快乐的梦鱼 2 napja
szülő
commit
ec0eb18904

+ 2 - 1
src/components/dynamic/DynamicFormCate.vue

@@ -73,6 +73,7 @@ const props = defineProps({
     font-size: 28rpx;
     color: #333;
     margin-bottom: 16rpx;
+    margin-left: 26rpx;
   }
 
   &.row {
@@ -82,7 +83,7 @@ const props = defineProps({
 
     .form-group-title {
       display: inline-block;
-      margin-left: 10rpx;
+      margin-left: 30rpx;
     }
   }
 }

+ 18 - 1
src/components/form/Form.vue

@@ -27,7 +27,6 @@ export interface FormState {
    */
   [index: string]: any;
 }
-
 export interface FormProps {
   /**
    * 表单的值
@@ -37,11 +36,29 @@ export interface FormProps {
    * 表单验证数据
    */
   rules?: Rules;
+  /**
+   * 表单名称。透传给 `<form>` 元素的 `name` 属性。
+   */
   name?: string,
+  /**
+   * 标签的flex宽度占比值
+   */
   labelFlex?: number, 
+  /**
+   * 标签宽度
+   */
   labelWidth?: string|number;
+  /**
+   * 标签位置
+   */
   labelPosition?: 'top'|'left';
+  /**
+   * 标签对齐方式
+   */
   labelAlign?: "left" | "center" | "right";
+  /**
+   * 输入框的flex宽度占比值
+   */
   inputFlex?: number,
   /**
    * 添加冒号

+ 2 - 1
src/pages/dig/composeable/TaskEntryForm.ts

@@ -7,13 +7,14 @@ export function useTaskEntryForm() {
     villageVolunteerId: 0,
   });
   
-  function goForm(subType: string, subId: number, subKey = 'type', type = 'list') {
+  function goForm(subType: string, subId: number, subKey = 'type', type = 'list', subTitle = '') {
     navTo('/pages/dig/forms/' + type, {
       villageId: querys.value.villageId,  
       villageVolunteerId: querys.value.villageVolunteerId,  
       subType,
       subId,
       subKey,
+      subTitle,
     })
   }
 

+ 3 - 2
src/pages/dig/details.vue

@@ -40,7 +40,7 @@
           <view class="title">非物质文化遗产项目</view>
           <view class="desc">维护文化多样性</view>
         </view>
-        <view class="btn" @click="goForm('ich', 0)">
+        <view class="btn" @click="goForm('ich', 0, '非物质文化遗产项目')">
           去完成
         </view>
       </view>
@@ -148,12 +148,13 @@ const nextPageData = computed(() => ({
   villageVolunteerId: querys.value.villageVolunteerId,
 }));
 
-function goForm(subType: string, subId: number) {
+function goForm(subType: string, subId: number, title: string) {
   navTo('/pages/dig/forms/list', {
     villageId: querys.value.id,  
     villageVolunteerId: querys.value.villageVolunteerId,  
     subType,
     subId,
+    subTitle: title,
   })
 }
 </script>

+ 6 - 0
src/pages/dig/forms/common.vue

@@ -38,6 +38,7 @@ import Height from '@/components/layout/space/Height.vue';
 import { backAndCallOnPageBack } from '@/components/utils/PageAction';
 
 const loading = ref(false);
+const subTitle = ref('');
 
 const formRef = ref<FormExport>();
 const formDefine = ref<FormDefine>();
@@ -74,9 +75,14 @@ const { querys } = useLoadQuerys({
   villageVolunteerId: 0,
   subType: '',
   subId: 0,
+  subTitle: '',
   id: 0,
 }, async (querys) => {
   loading.value = true;
+  if (querys.subTitle) {
+    subTitle.value = querys.subTitle;
+    uni.setNavigationBarTitle({  title: subTitle.value + '详情', })
+  }
   if (!formRef.value)
     return;
 

+ 24 - 14
src/pages/dig/forms/forms.ts

@@ -548,7 +548,7 @@ const villageCommonContent : (model: Ref<FormExport>) => FormDefine = (model) =>
             }]
           },
           {
-            label: '相关图片',
+            label: '相关图片(可选)',
             name: 'images',
             type: 'uploader',
             defaultValue: '',
@@ -562,6 +562,19 @@ const villageCommonContent : (model: Ref<FormExport>) => FormDefine = (model) =>
         ],
       }
     },
+    {
+      name: '',
+      children: {
+        type: 'group',
+        props: {
+          type: 'block',
+        } as FormGroupProps,
+        propNestType: 'nest', 
+        items: [
+          
+        ],
+      }
+    },
   ]
 });
  
@@ -1084,19 +1097,16 @@ const villageInfoForm : Record<string, Record<number, SingleForm>> = {
             propNestType: 'nest', 
             items: [
               {
-                label: '突出价值',
-                name: 'prominent',
-                type: 'textarea', 
+                label: '相关视频(可选)',
+                name: 'video',
+                type: 'uploader',
                 defaultValue: '',
                 params: {
-                  placeholder: '请输入村落突出价值信息',
-                  maxLength: 1000,
-                  showWordLimit: true, 
-                } as FieldProps,
-                rules: [{
-                  required: true,
-                  message: '请输入突出价值',
-                }]
+                  upload: useAliOssUploadCo('xiangyuan/cultural/video'),
+                  chooseType: 'video',
+                  maxFileSize: 1024 * 1024 * 20,
+                  single: true,
+                } as UploaderFieldProps,
               },
             ]
           }
@@ -1109,7 +1119,7 @@ const villageInfoForm : Record<string, Record<number, SingleForm>> = {
     [2]: [CommonInfoModel, villageCommonContent],
     [3]: [CommonInfoModel, (m) => ({
       items: [
-        ...(villageCommonContent(m).items.slice(0, 2)),
+        ...(villageCommonContent(m).items.slice(0, 1)),
         {
           label: '扫描件或图片',
           name: 'images',
@@ -1129,7 +1139,7 @@ const villageInfoForm : Record<string, Record<number, SingleForm>> = {
     })],
     [4]: [CommonInfoModel, (m) => ({
       items: [
-        ...villageCommonContent(m).items,
+        ...villageCommonContent(m).items.slice(0, 1),
         {
           label: '口述历史视频/录音',
           name: 'video',

+ 9 - 3
src/pages/dig/forms/list.vue

@@ -38,8 +38,8 @@
     </FlexCol>
     <SimplePageListLoader :loader="listLoader" :noEmpty="true">
       <template #empty>
-        <Empty image="search" text="暂无数据,点击按钮新增数据">
-          <Button type="primary" @click="newData">+ 新增数据</Button>
+        <Empty image="search" text="这里还没有数据,快来编写完善吧!">
+          <Button type="primary" :text="`+ 新增${subTitle}数据`" @click="newData" />
         </Empty>
       </template>
     </SimplePageListLoader>
@@ -65,6 +65,7 @@ import Height from '@/components/layout/space/Height.vue';
 import H4 from '@/components/typography/H4.vue';
 import Touchable from '@/components/feedback/Touchable.vue';
 
+const subTitle = ref('');
 const searchText = ref('');
 const listLoader = useSimplePageListLoader<{
   id: number,
@@ -120,20 +121,25 @@ function goDetail(id: number) {
     subType: querys.value.subType,
     subKey: querys.value.subKey,
     subId: querys.value.subId,
+    subTitle: querys.value.subTitle,
   });
 }
 function search() {
   listLoader.loadData(undefined, true);
 }
 
-
 const { querys } = useLoadQuerys({ 
   villageId: 0,  
   villageVolunteerId: 0,
   subType: '',
   subKey: '',
   subId: 0,
+  subTitle: '',
 }, async (querys) => {
+  if (querys.subTitle) {
+    subTitle.value = querys.subTitle;
+    uni.setNavigationBarTitle({  title: subTitle.value + '列表', })
+  }
   listLoader.loadData(querys)
 });
 

+ 4 - 4
src/pages/dig/task/building.vue

@@ -10,7 +10,7 @@
           <view class="title">建筑分布</view>
           <view class="desc">村落内传统建筑分布情况</view>
         </view>
-        <view class="btn" @click="goForm('distribution', 0)">
+        <view class="btn" @click="goForm('distribution', 0, undefined, undefined, '建筑分布')">
           填写
         </view>
       </view>
@@ -20,7 +20,7 @@
           <view class="title">文物建筑</view>
           <view class="desc">历史、艺术、科学价值</view>
         </view>
-        <view class="btn" @click="goForm('building', 1, 'nature')">
+        <view class="btn" @click="goForm('building', 1, 'nature', undefined, '文物建筑')">
           填写
         </view>
       </view>
@@ -30,7 +30,7 @@
           <view class="title">历史建筑</view>
           <view class="desc">重大历史事件记录</view>
         </view>
-        <view class="btn" @click="goForm('building', 2, 'nature')">
+        <view class="btn" @click="goForm('building', 2, 'nature', undefined, '历史建筑')">
           填写
         </view>
       </view>
@@ -40,7 +40,7 @@
           <view class="title">重要传统建筑</view>
           <view class="desc">重要传统建筑的信息</view>
         </view>
-        <view class="btn" @click="goForm('building', 3, 'nature')">
+        <view class="btn" @click="goForm('building', 3, 'nature', undefined, '重要传统建筑')">
           填写
         </view>
       </view>

+ 6 - 6
src/pages/dig/task/custom.vue

@@ -10,7 +10,7 @@
           <view class="title">非物质文化遗产项目</view>
           <view class="desc">维护文化多样性</view>
         </view>
-        <view class="btn" @click="goForm('ich', 0)">
+        <view class="btn" @click="goForm('ich', 0, undefined, undefined, '非物质文化遗产项目')">
           填写
         </view>
       </view>
@@ -20,7 +20,7 @@
           <view class="title">节庆活动</view>
           <view class="desc">欢庆与传承并重的文化盛宴</view>
         </view>
-        <view class="btn" @click="goForm('folk_culture', 1, 'folk_culture_type')">
+        <view class="btn" @click="goForm('folk_culture', 1, 'folk_culture_type', undefined, '节庆活动')">
           填写
         </view>
       </view>
@@ -30,7 +30,7 @@
           <view class="title">祭祀崇礼</view>
           <view class="desc">对先贤与自然的崇高致敬</view>
         </view>
-        <view class="btn" @click="goForm('folk_culture', 2, 'folk_culture_type')">
+        <view class="btn" @click="goForm('folk_culture', 2, 'folk_culture_type', undefined, '祭祀崇礼')">
           填写
         </view>
       </view>
@@ -40,7 +40,7 @@
           <view class="title">婚丧嫁娶</view>
           <view class="desc">生命礼赞与文化传承的双重奏鸣</view>
         </view>
-        <view class="btn" @click="goForm('folk_culture', 3, 'folk_culture_type')">
+        <view class="btn" @click="goForm('folk_culture', 3, 'folk_culture_type', undefined, '婚丧嫁娶')">
           填写
         </view>
       </view>
@@ -50,7 +50,7 @@
           <view class="title">地方方言</view>
           <view class="desc">历史沉淀的语言瑰宝</view>
         </view>
-        <view class="btn" @click="goForm('folk_culture', 4, 'folk_culture_type')">
+        <view class="btn" @click="goForm('folk_culture', 4, 'folk_culture_type', undefined, '地方方言')">
           填写
         </view>
       </view>
@@ -60,7 +60,7 @@
           <view class="title">特色文化</view>
           <view class="desc">民族精神的鲜明烙印</view>
         </view>
-        <view class="btn" @click="goForm('folk_culture', 5, 'folk_culture_type')">
+        <view class="btn" @click="goForm('folk_culture', 5, 'folk_culture_type', undefined, '特色文化')">
           填写
         </view>
       </view>

+ 3 - 3
src/pages/dig/task/environment.vue

@@ -10,7 +10,7 @@
           <view class="title">自然环境</view>
           <view class="desc">村落建立与发展历程</view>
         </view>
-        <view class="btn" @click="goForm('environment', 0)">
+        <view class="btn" @click="goForm('environment', 0, undefined, undefined, '自然环境')">
           填写
         </view>
       </view>
@@ -20,7 +20,7 @@
           <view class="title">文物古迹</view>
           <view class="desc">重要历史文献资料</view>
         </view>
-        <view class="btn" @click="goForm('relic', 0)">
+        <view class="btn" @click="goForm('relic', 0, undefined, undefined, '文物古迹')">
           填写
         </view>
       </view>
@@ -30,7 +30,7 @@
           <view class="title">历史环境要素</view>
           <view class="desc">村民口述历史记录</view>
         </view>
-        <view class="btn" @click="goForm('element', 0)">
+        <view class="btn" @click="goForm('element', 0, undefined, undefined, '历史环境要素')">
           填写
         </view>
       </view>

+ 2 - 2
src/pages/dig/task/food.vue

@@ -10,7 +10,7 @@
           <view class="title">农副产品</view>
           <view class="desc">乡村繁荣的多元支柱</view>
         </view>
-        <view class="btn" @click="goForm('food_product', 1)">
+        <view class="btn" @click="goForm('food_product', 1, undefined, undefined, '农副产品')">
           填写
         </view>
       </view>
@@ -20,7 +20,7 @@
           <view class="title">特色美食</view>
           <view class="desc">给味蕾探索带来无限惊喜</view>
         </view>
-        <view class="btn" @click="goForm('food_product', 3)">
+        <view class="btn" @click="goForm('food_product', 3, undefined, undefined, '特色美食')">
           填写
         </view>
       </view>

+ 6 - 6
src/pages/dig/task/history.vue

@@ -10,7 +10,7 @@
           <view class="title">建村历史</view>
           <view class="desc">村落建立与发展历程</view>
         </view>
-        <view class="btn" @click="goForm('cultural', 1)">
+        <view class="btn" @click="goForm('cultural', 1, undefined, undefined, '建村历史')">
           填写
         </view>
       </view>
@@ -20,7 +20,7 @@
           <view class="title">历史人物</view>
           <view class="desc">重要历史人物事迹</view>
         </view>
-        <view class="btn" @click="goForm('figure', 0)">
+        <view class="btn" @click="goForm('figure', 0, undefined, undefined, '历史人物')">
           填写
         </view>
       </view>
@@ -30,7 +30,7 @@
           <view class="title">历史事件</view>
           <view class="desc">重大历史事件记录</view>
         </view>
-        <view class="btn" @click="goForm('cultural', 2)">
+        <view class="btn" @click="goForm('cultural', 2, undefined, undefined, '历史事件')">
           填写
         </view>
       </view>
@@ -40,7 +40,7 @@
           <view class="title">掌故轶事</view>
           <view class="desc">民间传说与历史故事</view>
         </view>
-        <view class="btn" @click="goForm('story', 0)">
+        <view class="btn" @click="goForm('story', 0, undefined, undefined, '掌故轶事')">
           填写
         </view>
       </view>
@@ -50,7 +50,7 @@
           <view class="title">历史文献</view>
           <view class="desc">重要历史文献资料</view>
         </view>
-        <view class="btn" @click="goForm('cultural', 3)">
+        <view class="btn" @click="goForm('cultural', 3, undefined, undefined, '历史文献')">
           填写
         </view>
       </view>
@@ -60,7 +60,7 @@
           <view class="title">口述历史</view>
           <view class="desc">村民口述历史记录</view>
         </view>
-        <view class="btn" @click="goForm('cultural', 4)">
+        <view class="btn" @click="goForm('cultural', 4, undefined, undefined, '口述历史')">
           填写
         </view>
       </view>

+ 3 - 3
src/pages/dig/task/mine.vue

@@ -10,7 +10,7 @@
           <view class="title">商业集市</view>
           <view class="desc">文化交流的开放窗口</view>
         </view>
-        <view class="btn" @click="goForm('food_product', 4)">
+        <view class="btn" @click="goForm('food_product', 4, undefined, undefined, '商业集市')">
           填写
         </view>
       </view>
@@ -20,7 +20,7 @@
           <view class="title">服装服饰</view>
           <view class="desc">艺术与功能交织的时尚篇章</view>
         </view>
-        <view class="btn" @click="goForm('food_product', 5)">
+        <view class="btn" @click="goForm('food_product', 5, undefined, undefined, '服装服饰')">
           填写
         </view>
       </view>
@@ -30,7 +30,7 @@
           <view class="title">运输工具</view>
           <view class="desc">历史的运输工具</view>
         </view>
-        <view class="btn" @click="goForm('food_product', 6)">
+        <view class="btn" @click="goForm('food_product', 6, undefined, undefined, '运输工具')">
           填写
         </view>
       </view>

+ 7 - 7
src/pages/dig/task/summary.vue

@@ -10,7 +10,7 @@
           <view class="title">行政区划</view>
           <view class="desc">村落行政区域划分及变迁</view>
         </view>
-        <view class="btn" @click="goForm(1)">
+        <view class="btn" @click="goForm(1, '行政区划')">
           填写
         </view>
       </view>
@@ -20,7 +20,7 @@
           <view class="title">村落综述</view>
           <view class="desc">村落整体概况介绍</view>
         </view>
-        <view class="btn" @click="goForm(5)">
+        <view class="btn" @click="goForm(5, '村落综述')">
           填写
         </view>
       </view>
@@ -30,7 +30,7 @@
           <view class="title">地理信息</view>
           <view class="desc">地理位置和自然环境特征</view>
         </view>
-        <view class="btn" @click="goForm(2)">
+        <view class="btn" @click="goForm(2, '地理信息')">
           填写
         </view>
       </view>
@@ -40,7 +40,7 @@
           <view class="title">建设与保护</view>
           <view class="desc">村落发展与文化遗产保护</view>
         </view>
-        <view class="btn" @click="goForm(3)">
+        <view class="btn" @click="goForm(3, '建设与保护')">
           填写
         </view>
       </view>
@@ -50,7 +50,7 @@
           <view class="title">人口与经济</view>
           <view class="desc">人口与经济情况</view>
         </view>
-        <view class="btn" @click="goForm(4)">
+        <view class="btn" @click="goForm(4, '人口与经济')">
           填写
         </view>
       </view>
@@ -65,7 +65,7 @@ import { useTaskEntryForm } from '../composeable/TaskEntryForm';
 const { canCollect } = useCollectStore();
 const t = useTaskEntryForm();
 
-function goForm(subId: number) {
-  t.goForm('overview', subId, undefined, 'common');
+function goForm(subId: number, title: string) {
+  t.goForm('overview', subId, undefined, 'common', title);
 }
 </script>

+ 4 - 4
src/pages/dig/task/trip.vue

@@ -9,7 +9,7 @@
         <view class="info">
           <view class="title">旅游导览</view>
         </view>
-        <view class="btn" @click="goForm('travel_guide', 0)">
+        <view class="btn" @click="goForm('travel_guide', 0, undefined, undefined, '旅游导览')">
           填写
         </view>
       </view>
@@ -18,7 +18,7 @@
         <view class="info">
           <view class="title">游览路线</view>
         </view>
-        <view class="btn" @click="goForm('route', 1)">
+        <view class="btn" @click="goForm('route', 1, undefined, undefined, '游览路线')">
           填写
         </view>
       </view>
@@ -27,7 +27,7 @@
         <view class="info">
           <view class="title">活动时间</view>
         </view>
-        <view class="btn" @click="goForm('route', 2)">
+        <view class="btn" @click="goForm('route', 2, undefined, undefined, '活动时间')">
           填写
         </view>
       </view>
@@ -36,7 +36,7 @@
         <view class="info">
           <view class="title">路线特色</view>
         </view>
-        <view class="btn" @click="goForm('route', 3)">
+        <view class="btn" @click="goForm('route', 3, undefined, undefined, '路线特色')">
           填写
         </view>
       </view>