From 4aa42f5c20d56661a3d7dbaad8a9d0a21bbb5f73 Mon Sep 17 00:00:00 2001
From: bleachtred <bleachtred@163.com>
Date: 星期四, 18 四月 2024 11:29:57 +0800
Subject: [PATCH] fix  角色必填*号

---
 src/views/workflow/task/allTaskWaiting.vue |  134 +++++++++++++++++++++++++-------------------
 1 files changed, 75 insertions(+), 59 deletions(-)

diff --git a/src/views/workflow/task/allTaskWaiting.vue b/src/views/workflow/task/allTaskWaiting.vue
index 8d5836f..4fe4518 100644
--- a/src/views/workflow/task/allTaskWaiting.vue
+++ b/src/views/workflow/task/allTaskWaiting.vue
@@ -3,8 +3,8 @@
     <div class="mb-[10px]">
       <el-card shadow="hover" class="text-center">
         <el-radio-group v-model="tab" @change="changeTab(tab)">
-          <el-radio-button label="waiting">寰呭姙浠诲姟</el-radio-button>
-          <el-radio-button label="finish">宸插姙浠诲姟</el-radio-button>
+          <el-radio-button value="waiting">寰呭姙浠诲姟</el-radio-button>
+          <el-radio-button value="finish">宸插姙浠诲姟</el-radio-button>
         </el-radio-group>
       </el-card>
     </div>
@@ -41,11 +41,15 @@
 
       <el-table v-loading="loading" border :data="taskList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column fixed align="center" type="index" label="搴忓彿" width="60"></el-table-column>
-        <el-table-column fixed align="center" prop="processDefinitionName" label="娴佺▼瀹氫箟鍚嶇О"></el-table-column>
-        <el-table-column fixed align="center" prop="processDefinitionKey" label="娴佺▼瀹氫箟KEY"></el-table-column>
-        <el-table-column fixed align="center" prop="name" label="浠诲姟鍚嶇О"></el-table-column>
-        <el-table-column fixed align="center" prop="assigneeName" label="鍔炵悊浜�">
+        <el-table-column align="center" type="index" label="搴忓彿" width="60"></el-table-column>
+        <el-table-column :show-overflow-tooltip="true" align="center" label="娴佺▼瀹氫箟鍚嶇О">
+          <template #default="scope">
+            <span>{{ scope.row.processDefinitionName }}v{{ scope.row.processDefinitionVersion }}.0</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" prop="processDefinitionKey" label="娴佺▼瀹氫箟KEY"></el-table-column>
+        <el-table-column align="center" prop="name" label="浠诲姟鍚嶇О"></el-table-column>
+        <el-table-column align="center" prop="assigneeName" label="鍔炵悊浜�">
           <template v-if="tab === 'waiting'" #default="scope">
             <template v-if="scope.row.participantVo && scope.row.assignee === null">
               <el-tag v-for="(item, index) in scope.row.participantVo.candidateName" :key="index" type="success">
@@ -54,38 +58,40 @@
             </template>
             <template v-else>
               <el-tag type="success">
-                {{ scope.row.assigneeName }}
+                {{ scope.row.assigneeName || '鏃�' }}
               </el-tag>
             </template>
           </template>
           <template v-else-if="tab === 'finish'" #default="scope">
             <el-tag type="success">
-              {{ scope.row.assigneeName }}
+              {{ scope.row.assigneeName || '鏃�' }}
             </el-tag>
           </template>
         </el-table-column>
-        <el-table-column align="center" prop="businessStatusName" label="娴佺▼鐘舵��" min-width="70">
+        <el-table-column align="center" label="娴佺▼鐘舵��" min-width="70">
           <template #default="scope">
-            <el-tag v-if="tab === 'waiting'" type="success">{{ scope.row.businessStatusName }}</el-tag>
+            <dict-tag v-if="tab === 'waiting'" :options="wf_business_status" :value="scope.row.businessStatus"></dict-tag>
             <el-tag v-else type="success">宸插畬鎴�</el-tag>
           </template>
         </el-table-column>
-        <el-table-column align="center" v-if="tab === 'waiting'" prop="createTime" label="鍒涘缓鏃堕棿" width="160"></el-table-column>
-        <el-table-column align="center" v-if="tab === 'finish'" prop="startTime" label="鍒涘缓鏃堕棿" width="160"></el-table-column>
-        <el-table-column label="鎿嶄綔" align="center" width="160" class-name="small-padding fixed-width">
+        <el-table-column v-if="tab === 'waiting'" align="center" prop="createTime" label="鍒涘缓鏃堕棿" width="160"></el-table-column>
+        <el-table-column v-if="tab === 'finish'" align="center" prop="startTime" label="鍒涘缓鏃堕棿" width="160"></el-table-column>
+        <el-table-column label="鎿嶄綔" align="center" :width="tab === 'finish' ? '80' : '151'">
           <template #default="scope">
             <el-row :gutter="10" class="mb8">
               <el-col :span="1.5">
-                <el-button link type="primary" size="small" icon="Document" @click="handleApprovalRecord(scope.row)">瀹℃壒璁板綍</el-button>
-              </el-col>
-              <el-col v-if="scope.row.multiInstance" :span="1.5">
-                <el-button link type="primary" size="small" icon="CirclePlus" @click="addMultiInstanceUser(scope.row)">鍔犵</el-button>
-              </el-col>
-              <el-col v-if="scope.row.multiInstance" :span="1.5">
-                <el-button link type="primary" size="small" icon="Remove" @click="deleteMultiInstanceUser(scope.row)">鍑忕</el-button>
+                <el-button link type="primary" size="small" icon="View" @click="handleView(scope.row)">鏌ョ湅</el-button>
               </el-col>
               <el-col v-if="tab === 'waiting'" :span="1.5">
                 <el-button link type="primary" size="small" icon="Document" @click="handleInstanceVariable(scope.row)">娴佺▼鍙橀噺</el-button>
+              </el-col>
+            </el-row>
+            <el-row v-if="scope.row.multiInstance" :gutter="10" class="mb8">
+              <el-col :span="1.5">
+                <el-button link type="primary" size="small" icon="Remove" @click="deleteMultiInstanceUser(scope.row)">鍑忕</el-button>
+              </el-col>
+              <el-col :span="1.5">
+                <el-button link type="primary" size="small" icon="CirclePlus" @click="addMultiInstanceUser(scope.row)">鍔犵</el-button>
               </el-col>
             </el-row>
           </template>
@@ -99,22 +105,24 @@
         @pagination="handleQuery"
       />
     </el-card>
-    <!-- 瀹℃壒璁板綍 -->
-    <approvalRecord ref="approvalRecordRef" />
     <!-- 鍔犵缁勪欢 -->
     <multiInstanceUser ref="multiInstanceUserRef" :title="title" @submit-callback="handleQuery" />
     <!-- 閫変汉缁勪欢 -->
     <UserSelect ref="userSelectRef" :multiple="false" @confirm-call-back="submitCallback"></UserSelect>
     <!-- 娴佺▼鍙橀噺寮�濮� -->
     <el-dialog v-model="variableVisible" draggable title="娴佺▼鍙橀噺" width="60%" :close-on-click-modal="false">
-      <el-card class="box-card" v-loading="variableLoading">
-        <div slot="header" class="clearfix">
-          <span>娴佺▼瀹氫箟鍚嶇О锛�<el-tag>{{processDefinitionName}}</el-tag></span>
-        </div>
-        <div v-for="(v,index) in variableList" :key="index" >
-          <el-form :label-position="'right'"  v-if="v.key!=='_FLOWABLE_SKIP_EXPRESSION_ENABLED'" label-width="150px">
-            <el-form-item :label="v.key+'锛�'">
-              {{v.value}}
+      <el-card v-loading="variableLoading" class="box-card">
+        <template #header>
+          <div class="clearfix">
+            <span
+              >娴佺▼瀹氫箟鍚嶇О锛�<el-tag>{{ processDefinitionName }}</el-tag></span
+            >
+          </div>
+        </template>
+        <div v-for="(v, index) in variableList" :key="index">
+          <el-form v-if="v.key !== '_FLOWABLE_SKIP_EXPRESSION_ENABLED'" :label-position="'right'" label-width="150px">
+            <el-form-item :label="v.key + '锛�'">
+              {{ v.value }}
             </el-form-item>
           </el-form>
         </div>
@@ -126,19 +134,20 @@
 
 <script lang="ts" setup>
 import { getPageByAllTaskWait, getPageByAllTaskFinish, updateAssignee, getInstanceVariable } from '@/api/workflow/task';
-import ApprovalRecord from '@/components/Process/approvalRecord.vue';
 import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue';
 import UserSelect from '@/components/UserSelect';
 import { TaskQuery, TaskVO, VariableVo } from '@/api/workflow/task/types';
+import workflowCommon from '@/api/workflow/workflowCommon';
+import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
 //瀹℃壒璁板綍缁勪欢
-const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
 //鍔犵缁勪欢
 const multiInstanceUserRef = ref<InstanceType<typeof MultiInstanceUser>>();
-//閫変汉缁勪欢 
+//閫変汉缁勪欢
 const userSelectRef = ref<InstanceType<typeof UserSelect>>();
 
 const queryFormRef = ref<ElFormInstance>();
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
 // 閬僵灞�
 const loading = ref(true);
 // 閫変腑鏁扮粍
@@ -157,13 +166,13 @@
 // 娴佺▼鍙橀噺鏄惁鏄剧ず
 const variableVisible = ref(false);
 const variableLoading = ref(true);
-// 娴佺▼鍙橀噺 
+// 娴佺▼鍙橀噺
 const variableList = ref<VariableVo>({
   key: '',
-  value: '',
-})
+  value: ''
+});
 //娴佺▼瀹氫箟鍚嶇О
-const processDefinitionName = ref(undefined);
+const processDefinitionName = ref();
 // 鏌ヨ鍙傛暟
 const queryParams = ref<TaskQuery>({
   pageNum: 1,
@@ -173,15 +182,7 @@
   processDefinitionKey: undefined
 });
 const tab = ref('waiting');
-onMounted(() => {
-  getWaitingList();
-});
-//瀹℃壒璁板綍
-const handleApprovalRecord = (row: TaskVO) => {
-  if (approvalRecordRef.value) {
-    approvalRecordRef.value.init(row.processInstanceId);
-  }
-};
+
 //鍔犵
 const addMultiInstanceUser = (row: TaskVO) => {
   if (multiInstanceUserRef.value) {
@@ -218,6 +219,7 @@
   multiple.value = !selection.length;
 };
 const changeTab = async (data: string) => {
+  taskList.value = [];
   queryParams.value.pageNum = 1;
   if ('waiting' === data) {
     getWaitingList();
@@ -247,24 +249,38 @@
   userSelectRef.value.open();
 };
 //淇敼鍔炵悊浜�
-const submitCallback  = async (data) => {
-  if(data && data.length > 0){
+const submitCallback = async (data) => {
+  if (data && data.length > 0) {
     await proxy?.$modal.confirm('鏄惁纭鎻愪氦锛�');
     loading.value = true;
-    await updateAssignee(ids.value, data[0].userId)
-    handleQuery()
+    await updateAssignee(ids.value, data[0].userId);
+    handleQuery();
     proxy?.$modal.msgSuccess('鎿嶄綔鎴愬姛');
-  }else{
+  } else {
     proxy?.$modal.msgWarning('璇烽�夋嫨鐢ㄦ埛锛�');
   }
 };
 //鏌ヨ娴佺▼鍙橀噺
-const handleInstanceVariable  = async (row: TaskVO) => {
-  variableLoading.value = true
-  variableVisible.value = true
-  processDefinitionName.value = row.processDefinitionName
-  let data = await getInstanceVariable(row.id)
-  variableList.value = data.data
-  variableLoading.value = false
+const handleInstanceVariable = async (row: TaskVO) => {
+  variableLoading.value = true;
+  variableVisible.value = true;
+  processDefinitionName.value = row.processDefinitionName;
+  let data = await getInstanceVariable(row.id);
+  variableList.value = data.data;
+  variableLoading.value = false;
 };
+/** 鏌ョ湅鎸夐挳鎿嶄綔 */
+const handleView = (row) => {
+  const routerJumpVo = reactive<RouterJumpVo>({
+    wfDefinitionConfigVo: row.wfDefinitionConfigVo,
+    wfNodeConfigVo: row.wfNodeConfigVo,
+    businessKey: row.businessKey,
+    taskId: row.id,
+    type: 'view'
+  });
+  workflowCommon.routerJump(routerJumpVo, proxy);
+};
+onMounted(() => {
+  getWaitingList();
+});
 </script>

--
Gitblit v1.9.3