ZaiZai 1 anno fa
parent
commit
4a62fcf34c

+ 5 - 3
src/components/hc-tasks-user/modules/process-modal.vue

@@ -9,7 +9,10 @@
             </template>
             <template #flowTaskType="{ row }">
                 <el-select v-model="row.flowTaskType" size="small" filterable block>
-                    <el-option v-for="item in flowTaskTypeData" :key="item.value" :label="item.label" :value="item.value" />
+                    <template v-if="flowTaskTypeData.length > 0">
+                        <el-option v-for="item in flowTaskTypeData" :key="item.value" :label="item.label" :value="item.value" />
+                    </template>
+                    <el-option v-else label="普通流程" :value="1" />
                 </el-select>
             </template>
             <template #type="{ row }">
@@ -24,7 +27,7 @@
         </hc-table>
         <template #footer>
             <el-button @click="modalClose">取消</el-button>
-            <el-button type="primary" :loading="confirmLoading" @click="confirmClick">确定</el-button>
+            <el-button type="primary" @click="confirmClick">确定</el-button>
         </template>
     </hc-dialog>
 </template>
@@ -111,7 +114,6 @@ const rowSortTap = async (rows) => {
 }
 
 //确定选择
-const confirmLoading = ref(false)
 const confirmClick = async () => {
     const list = deepClone(tableData.value)
     emit('finish', list)

+ 29 - 5
src/components/hc-tasks-user/modules/sort-modal.vue

@@ -1,9 +1,12 @@
 <template>
     <hc-dialog v-model="isShow" ui="hc-tasks-user-sort-modal" widths="600px" title="调整任务人顺序" @close="modalClose">
-        111111
+        <hc-table
+            ref="tableRef" :column="tableColumn" :datas="tableData" ui="hc-tasks-user-sort-drop-table"
+            is-row-drop quick-sort is-sort @row-drop="rowDropTap" @row-sort="rowSortTap"
+        />
         <template #footer>
             <el-button @click="modalClose">取消</el-button>
-            <el-button type="primary" :loading="confirmLoading" @click="confirmClick">确定</el-button>
+            <el-button type="primary" @click="confirmClick">确定</el-button>
         </template>
     </hc-dialog>
 </template>
@@ -37,16 +40,37 @@ watch(isShow, (val) => {
     if (val) setInitData()
 })
 
+//表格
+const tableRef = ref(null)
+const tableColumn = [{ key: 'userName', name: '名称' }]
+const tableData = ref([])
+
 //初始化
 const setInitData = async () => {
     await nextTick()
-    console.log(userData.value)
+    tableData.value = getArrValue(userData.value)
+}
+
+// 行拖拽
+const rowDropTap = async (rows) => {
+    // 先清空,否则排序会异常
+    tableData.value = []
+    await nextTick()
+    tableRef.value?.setData(rows)
+}
+
+// 点击排序
+const rowSortTap = async (rows) => {
+    // 先清空,否则排序会异常
+    tableData.value = []
+    await nextTick()
+    tableData.value = rows
 }
 
 //确定选择
-const confirmLoading = ref(false)
 const confirmClick = async () => {
-    emit('finish')
+    const list = deepClone(tableData.value)
+    emit('finish', list)
     modalClose()
 }
 

+ 2 - 1
src/components/hc-tasks-user/modules/user-modal.vue

@@ -381,7 +381,8 @@ const fixedUserSortClick = () => {
 
 //任务人排序完成
 const userSortFinish = (data) => {
-    console.log(data)
+    const index = fixedIndex.value
+    fixedData.value[index].userList = getArrValue(data)
 }
 
 //确定选择