ZaiZai 1 éve
szülő
commit
8c0a172bfb

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240517113743"
+  "value": "20240517114247"
 }

+ 2 - 2
src/config/index.json

@@ -1,7 +1,7 @@
 {
     "version": "20230607160059",
-    "target": "http://192.168.0.102:8090",
-    "target1": "http://39.108.216.210:8090",
+    "target1": "http://192.168.0.102:8090",
+    "target": "http://39.108.216.210:8090",
     "smsPhone": "",
     "vite": {
         "port": 5174,

+ 3 - 2
src/views/tentative/detect/components/ListItem.vue

@@ -1720,8 +1720,9 @@ const linkAcquisitionClick = (item, index) => {
     isLinkAcquisition.value = true
 }
 
-const linkAcquisitionChange = (id) => {
-    linkAcquisitionLoadDataId.value = id
+const linkAcquisitionChange = (ids) => {
+    console.log(ids)
+    linkAcquisitionLoadDataId.value = ids
 }
 
 //确定

+ 28 - 13
src/views/tentative/detect/components/linkAcquisition.vue

@@ -45,8 +45,8 @@
                     <el-tag v-else type="info" effect="dark">未引用</el-tag>
                 </template>
                 <template #action="{ row }">
-                    <el-link v-if="row.id == dataId" type="warning" @click="rowCancel(row)">取消选择</el-link>
-                    <el-link v-else type="primary" @click="rowSelect(row)">选择</el-link>
+                    <el-link v-if="dataIds.indexOf(row.id) !== -1" type="warning" @click="rowCancel(row.id)">取消选择</el-link>
+                    <el-link v-else type="primary" @click="rowSelect(row.id)">选择</el-link>
                     <!-- el-link v-if="row.key24 === 2" type="info">选择</el-link -->
                 </template>
             </hc-table>
@@ -61,7 +61,7 @@
 import { onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import { getErtractInfo } from '~api/other'
-import { getArrValue } from 'js-fast-way'
+import { deepClone, getArrValue, isNullES } from 'js-fast-way'
 import mainApi from '~api/tentative/acquisition/data'
 
 //事件
@@ -83,9 +83,9 @@ const curId = defineModel('modelValue', {
 })
 
 //监听
-const dataId = ref(curId.value)
+const dataIds = ref([])
 watch(() => curId.value, (id) => {
-    dataId.value = id
+    dataIds.value = isNullES(id) ? [] : id.split(',')
 })
 
 //分割配置
@@ -310,17 +310,32 @@ const getTableData = async () => {
 }
 
 //选择
-const rowSelect = (row) => {
-    dataId.value = row.id
-    curId.value = row.id
-    emit('change', row.id)
+const rowSelect = (id) => {
+    const ids = deepClone(dataIds.value)
+    if (ids.length >= 7) {
+        window?.$message.warning('最多只能选择7条数据关联')
+        return
+    }
+    if (ids.indexOf(id) !== -1) {
+        window?.$message.warning('当前选择的数据已关联')
+        return
+    }
+    ids.push(id)
+    dataIds.value = ids
+    curId.value = ids.join(',')
+    emit('change', ids.join(','))
 }
 
 //取消选择
-const rowCancel = () => {
-    dataId.value = null
-    curId.value = null
-    emit('change', '')
+const rowCancel = (id) => {
+    const ids = deepClone(dataIds.value)
+    const index = ids.indexOf(id)
+    if (index !== -1) {
+        ids.splice(index, 1)
+    }
+    dataIds.value = ids
+    curId.value = ids.join(',')
+    emit('change', ids.join(','))
 }
 </script>