|
|
@@ -1557,13 +1557,19 @@
|
|
|
<equipment-select-single v-model="equipmentSelectVisible" @onSelected="onEquipmentSelected"></equipment-select-single>
|
|
|
<!-- 字段选择对话框 -->
|
|
|
<el-dialog title="选择导出字段" v-model="showExportFieldsDialog" width="600px" append-to-body>
|
|
|
+ <div style="position: absolute;bottom: 65px;right: 38%;">
|
|
|
+ <el-button type="primary" icon="upload" size="mini" style="width:5px;" @click="upDown('up')" /><br/>
|
|
|
+ <el-button type="primary" icon="download" size="mini" style="margin-top:3px;width:5px;" @click="upDown('down')" />
|
|
|
+ </div>
|
|
|
<el-transfer
|
|
|
v-model="exportFieldsSelected"
|
|
|
:data="exportFieldsData"
|
|
|
:titles="['可选字段', '导出字段']"
|
|
|
+ target-order = "push"
|
|
|
show-checkbox
|
|
|
filterable
|
|
|
- filter-placeholder="请输入字段名称">
|
|
|
+ filter-placeholder="请输入字段名称"
|
|
|
+ @right-check-change="rightCheckHandler">
|
|
|
</el-transfer>
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
@@ -3201,6 +3207,47 @@ const workPermitNumProxy = computed({
|
|
|
form.value.workPermitNum = trimmed
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+const rightChecks = ref([])
|
|
|
+function rightCheckHandler(val) {
|
|
|
+ rightChecks.value = exportFieldsSelected.value
|
|
|
+ .filter(item => val.includes(item))
|
|
|
+ console.log(rightChecks.value, "rightCheckHandler")
|
|
|
+}
|
|
|
+
|
|
|
+function upDown(direction) {
|
|
|
+ // 找出最小和最大索引
|
|
|
+ const indices = rightChecks.value
|
|
|
+ .map(i => exportFieldsSelected.value.indexOf(i))
|
|
|
+ .filter(i => i !== -1)
|
|
|
+ const minIndex = Math.min(...indices)
|
|
|
+ const maxIndex = Math.max(...indices)
|
|
|
+ // 边界检查
|
|
|
+ if (direction === 'up' && minIndex === 0) {
|
|
|
+ console.log('已到顶部')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (direction === 'down' && maxIndex === exportFieldsSelected.value.length - 1) {
|
|
|
+ console.log('已到底部')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (direction === 'up') {
|
|
|
+ rightChecks.value.map(i => {
|
|
|
+ const index = exportFieldsSelected.value.findIndex(t => t == i)
|
|
|
+ exportFieldsSelected.value.splice(index, 1);
|
|
|
+ exportFieldsSelected.value.splice(index - 1, 0, i);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ rightChecks.value.slice().reverse().forEach(i => {
|
|
|
+ const index = exportFieldsSelected.value.findIndex(t => t == i)
|
|
|
+ if (index < exportFieldsSelected.value.length - 1) {
|
|
|
+ exportFieldsSelected.value.splice(index, 1)
|
|
|
+ exportFieldsSelected.value.splice(index + 1, 0, i)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
getList()
|
|
|
</script>
|
|
|
<style scoped>
|