|
@@ -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()
|
|
|
}
|
|
|
|