Forráskód Böngészése

📦 专家审核

快乐的梦鱼 12 órája%!(EXTRA string=)
szülő
commit
3214526d1f

+ 1 - 0
src/api/auth/UserApi.ts

@@ -61,6 +61,7 @@ export class UserInfo extends DataModel<UserInfo> {
   avatar = '';
   username = '';
   regionId = 0;
+  isReviewer = false;
 }
 
 export class UserApi extends AppServerRequestModule<DataModel> {

+ 2 - 2
src/components/dynamicf/SimpleSelectFormItem.vue

@@ -6,9 +6,9 @@
     v-bind="customProps"
   >
     <template v-if="renderOption" #option="data">
-      <VNodeRenderer :render="renderOption" :data="data" />
+      <VNodeRenderer :render="(renderOption as any)" :data="data" />
     </template>
-    <a-select-option v-for="it in options" :key="it.value" :value="it.value">
+    <a-select-option v-for="it in options" :key="it.value" v-bind="it">
       <a-badge v-if="it.badgeColor" :color="it.badgeColor" :text="it.text" />
       <a-badge v-else-if="it.badgeState" :status="it.badgeState" :text="it.text" />
       <span v-else>{{it.text}}</span>

+ 2 - 2
src/pages/admin.vue

@@ -26,7 +26,7 @@
             >
               <template #itemRight="{ item }">
                 <AdminItemState :item="item" />
-                <a-button type="link">编辑</a-button>
+                <a-button type="link">编辑/审核</a-button>
                 <a-button type="link" @click.stop="handleCopyAccount(item)">传承人账号</a-button>
               </template>
             </CommonListBlock>
@@ -46,7 +46,7 @@
               >
               <template #itemRight="{ item }">
                 <AdminItemState :item="item" />
-                <a-button type="link" @click.stop="router.push({ name: 'FormIch', query: { id: item.id } })">编辑</a-button>
+                <a-button type="link" @click.stop="router.push({ name: 'FormIch', query: { id: item.id } })">编辑/审核</a-button>
                 <a-button type="link" @click.stop="handleGoWorks(item)">非遗项目作品</a-button>
                 <a-button type="link" @click.stop="handleGoSeminar(item)">关联传习所</a-button>
               </template>

+ 114 - 5
src/pages/forms/form.vue

@@ -14,10 +14,16 @@
         <template v-else>   
           <a-tabs centered>
             <a-tab-pane key="1" :tab="basicTabText">
+              <a-alert 
+                v-if="(formModel as any).progress === -1 && !isReviewer && !isAdmin" 
+                message="提示:您的信息已被审核退回,请根据审核建议修改后重新提交。"
+                :description="(formModel as any).comment"
+                showIcon
+              ></a-alert>
               <DynamicForm
                 ref="formBase"
                 :model="(formModel as any)" 
-                :options="formOptions"
+                :options="finalFormOptions"
               />
               <div class="d-flex flex-column mt-3">
                 <div class="d-flex flex-row w-100 align-items-center justify-content-between">
@@ -29,6 +35,7 @@
                 </div>
                 <div class="d-flex flex-row w-100 align-items-center justify-content-end mt-3">
                   <a-popover
+                    v-if="!isReviewer"
                     title="保存提示"
                     content="如果未完成编辑,可以先点击保存按钮保存修改,完成后再点击提交审核。您可以在历史版本中查看之前的修改。"
                   >
@@ -172,6 +179,10 @@ const props = defineProps({
     type: Function as PropType<(model: U) => Promise<DataModel>>,
     default: (a: any) => Promise.resolve(a)
   },
+  pushExamine: {
+    type: Boolean,
+    default: false
+  },
 })
 
 const { formModel, formOptions, extendFormOptions, load } = toRefs(props);
@@ -188,10 +199,108 @@ const showHistory = ref(false);
 const showHistoryLoading = ref(false);
 const showHistoryModel = ref<any>(null);
 
-watch(readonly, (newValue) => {
-  formOptions.value.disabled = newValue;
-  extendFormOptions.value.disabled = newValue;
-})
+const isAdmin = computed(() => {
+  return authStore.loginType === 1;
+});
+const isReviewer = computed(() => {
+  return authStore.userInfo?.isReviewer ?? false;
+});
+const finalFormOptions = computed(() => {
+  
+  return {
+    ...formOptions.value,
+    formItems: [
+      ...formOptions.value.formItems,
+      ...(props.pushExamine ? [
+        {
+          type: 'group-flat', label: '审核', name: 'ichInfo',
+          childrenColProps: { span: 24 },
+          children: [
+            { 
+              label: '审核人员', name: 'text1', type: 'static-text', 
+              hidden: { callback: (_: any, model: any) => isAdmin.value || isReviewer.value },
+              additionalProps: {
+                text: '黄念旭,李向群,卢志明',
+                style: { color: '#999', }
+              }
+            },
+            { 
+              label: '审核状态', name: 'text2', type: 'static-text', 
+              hidden: { callback: (_: any, model: any) => isAdmin.value || isReviewer.value },
+              additionalProps: {
+                text: '暂未审核',
+                style: { color: '#999', }
+              }
+            },
+            { 
+              label: '填报人', name: 'text3', type: 'static-text', 
+              hidden: { callback: (_: any, model: any) => !(!isAdmin.value && !isReviewer.value) },
+              additionalProps: {
+                text: authStore.userInfo?.nickname,
+              }
+            },
+            /* { 
+              label: '填报人', name: 'text3', type: 'static-text', 
+              hidden: { callback: (_: any, model: any) => !(isAdmin.value || isReviewer.value) },
+              additionalProps: {
+                text: authStore.userInfo?.nickname,
+              }
+            }, */
+            { 
+              label: '初审状态', name: 'progress', type: 'select', 
+              hidden: { callback: (_: any, model: any) => !(!isReviewer.value) },
+              additionalProps: {
+                options: [
+                  { text: '保存未审核', value: -2, disabled: true },
+                  { text: '审核退回', value: -1 },
+                  { text: '暂未审核', value: 0 },
+                  { text: '初审通过', value: 1 },
+                  { text: '专家审核通过', value: 2, disabled: true },
+                ]
+              }
+            },
+            { 
+              label: '审核状态', name: 'progress', type: 'select', 
+              hidden: { callback: (_: any, model: any) => !(isReviewer.value) },
+              additionalProps: {
+                options: [
+                  { text: '未审核', value: -2, disabled: true },
+                  { text: '审核退回', value: -1 },
+                  { text: '未审核', value: 0, disabled: true },
+                  { text: '未审核', value: 1, disabled: true },
+                  { text: '通过审核', value: 2 },
+                ],
+              }
+            },
+            { 
+              label: '审核状态', name: 'progress', type: 'select', 
+              hidden: { callback: (_: any, model: any) => isAdmin.value || isReviewer.value },
+              disabled: true,
+              additionalProps: {
+                options: [
+                  { text: '保存未审核', value: -2 },
+                  { text: '审核退回', value: -1 },
+                  { text: '暂未审核', value: 0 },
+                  { text: '初审通过', value: 1 },
+                  { text: '审核员通过', value: 2 },
+                ]
+              }
+            },
+            { 
+              label: '审核意见', name: 'comment', type: 'text-area',
+              disabled: { callback: (_: any, model: any) => !isAdmin.value },
+              additionalProps: {
+                placeholder: { callback: (_: any, model: any) => (isAdmin.value || isReviewer.value) ? '若审核不通过,请输入审核意见' : '暂无审核意见' },
+              }
+            },
+          ]
+        }
+      ] : [])
+    ],
+    disabled: readonly.value,
+  }
+});
+
 
 useWindowOnUnLoadConfirm();
 

+ 1 - 40
src/pages/forms/ich.vue

@@ -8,6 +8,7 @@
     :formOptions="formOptions"
     :load="loadData"
     :model="IchInfo"
+    pushExamine
   />
 </template>
 
@@ -147,46 +148,6 @@ const formOptions = ref<IDynamicFormOptions>({
             uploadCo: useAliOssUploadCo('ich/video'),
           } as UploadImageFormItemProps,  
         },
-        { 
-          label: '审核人员', name: 'text1', type: 'static-text', 
-          additionalProps: {
-            text: '黄念旭,李向群,卢志明',
-            style: { color: '#999', }
-          }
-        },
-        { 
-          label: '审核状态', name: 'text2', type: 'static-text', 
-          additionalProps: {
-            text: '暂未审核',
-            style: { color: '#999', }
-          }
-        },
-        { 
-          label: '填报人', name: 'text3', type: 'static-text', 
-          hidden: { callback: (_, model) => authStore.loginType !== 0 },
-          additionalProps: {
-            text: authStore.userInfo?.nickname,
-          }
-        },
-        { 
-          label: '初审状态', name: 'progress', type: 'select', 
-          hidden: { callback: (_, model) => authStore.loginType !== 1 },
-          additionalProps: {
-            options: [
-              { text: '保存未审核', value: -2 },
-              { text: '审核退回', value: -1 },
-              { text: '暂未审核', value: 0 },
-              { text: '初审通过', value: 1 },
-            ],
-          }
-        },
-        { 
-          label: '审核意见', name: 'comment', type: 'text-area',
-          disabled: { callback: (_, model) => authStore.loginType !== 1 },
-          additionalProps: {
-            placeholder: { callback: (_: any, model: any) => authStore.loginType === 1 ? '若审核不通过,请输入审核意见' : '暂无审核意见' },
-          }
-        },
       ]
     },
     /* {

+ 1 - 42
src/pages/forms/inheritor.vue

@@ -6,17 +6,16 @@
     :formOptions="formOptions"
     :load="loadData"
     :model="InheritorInfo"
+    pushExamine
   />
 </template>
 
 <script setup lang="ts">
 import { ref, type Ref } from 'vue';
-import { useImageSimpleUploadCo } from '@/common/upload/ImageUploadCo';
 import Form from './form.vue';
 import InheritorContent, { InheritorExpandInfo, InheritorInfo } from '@/api/inheritor/InheritorContent';
 import CommonContent from '@/api/CommonContent';
 import type { IDynamicFormOptions } from '@imengyu/vue-dynamic-form';
-import type { SelectProps } from 'ant-design-vue';
 import { useBeforeUploadImageChecker, useBeforeUploadVideoChecker, type UploadImageFormItemProps } from '@/components/dynamicf/UploadImageFormItem';
 import { useAuthStore } from '@/stores/auth';
 import { useAliOssUploadCo } from '@/common/upload/AliOssUploadCo';
@@ -132,46 +131,6 @@ const formOptions = ref<IDynamicFormOptions>({
             uploadCo: useAliOssUploadCo('inheritor/video'),
           } as UploadImageFormItemProps,  
         },
-        { 
-          label: '审核人员', name: 'text1', type: 'static-text', 
-          additionalProps: {
-            text: '黄念旭,李向群,卢志明',
-            style: { color: '#999', }
-          }
-        },
-        { 
-          label: '审核状态', name: 'text2', type: 'static-text', 
-          additionalProps: {
-            text: '暂未审核',
-            style: { color: '#999', }
-          }
-        },
-        { 
-          label: '填报人', name: 'text3', type: 'static-text', 
-          hidden: { callback: (_, model) => authStore.loginType !== 0 },
-          additionalProps: {
-            text: authStore.userInfo?.nickname,
-          }
-        },
-        { 
-          label: '初审状态', name: 'progress', type: 'select', 
-          hidden: { callback: (_, model) => authStore.loginType !== 1 },
-          additionalProps: {
-            options: [
-              { text: '保存未审核', value: -2 },
-              { text: '审核退回', value: -1 },
-              { text: '暂未审核', value: 0 },
-              { text: '初审通过', value: 1 },
-            ],
-          }
-        },
-        { 
-          label: '审核意见', name: 'comment', type: 'text-area',
-          disabled: { callback: (_, model) => authStore.loginType !== 1 },
-          additionalProps: {
-            placeholder: { callback: (_: any, model: any) => authStore.loginType === 1 ? '若审核不通过,请输入审核意见' : '暂无审核意见' },
-          }
-        },
       ]
     },
     /* {