From 8b7c2fe49917d670eb2a03cecda23ea50961c494 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期二, 09 八月 2022 09:26:29 +0800
Subject: [PATCH] lct

---
 src/components/checkTemplate/index.vue |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/components/checkTemplate/index.vue b/src/components/checkTemplate/index.vue
index 15734ac..24f6c25 100644
--- a/src/components/checkTemplate/index.vue
+++ b/src/components/checkTemplate/index.vue
@@ -26,10 +26,10 @@
             :data="tableData"
             ref="multipleTableRef"
             style="width: 100%;margin-top:20px"
-            @cell-click="radio"
+            @selection-change="handleSelectionChange"
         >
-          <el-table-column width="55">
-            <template #default="scope">
+          <el-table-column type="selection" width="55" v-if="types==0">
+            <template #default="scope" v-if="types!=0">
               <el-radio-group v-model="radio1">
                 <el-radio :label="scope.row.id" @click="radio(scope.row)" size="large">{{ null }}</el-radio>
               </el-radio-group>
@@ -88,14 +88,16 @@
 import {
   ElMessage,
 } from 'element-plus';
-import {contingencyApi} from "/@/api/contingency";
+import {contingencyApi} from "/@/api/contingencyManagement/contingency";
 
 export default defineComponent({
   setup(props, { emit }) {
+    const types=ref()
     const dialogVisible = ref<boolean>(false);
-    const openDailog = () => {
+    const openDailog = (type:any) => {
+      types.value=type
       dialogVisible.value = true;
-      onSubmit();
+      // onSubmit();
     };
     // 搜索条件
     const listQuery = reactive({
@@ -123,10 +125,17 @@
       }
     }
     const submitForm = () => {
-      let obj = JSON.parse(JSON.stringify(dynamicTags.value));
-      emit('SearchUser', obj[0]);
+      if(types.value==0){
+        emit('SearchUser',dynamicTags.value,types.value);
+      }
+      else {
+        emit('SearchUser',dynamicTags.value[0],types.value);
+      }
       dialogVisible.value = false;
     };
+    const handleSelectionChange = (val:any) => {
+      dynamicTags.value=val
+    }
     // 重置
     const submitReset = () => {
       listQuery.searchParams.teamName = '';
@@ -157,6 +166,7 @@
     };
     const radio1 = ref('');
     const radio = (event: any) => {
+      console.log(event)
       dynamicTags.value[0] = event;
     };
     onMounted(() => {
@@ -192,7 +202,8 @@
       radio,
       radio1,
       submitForm,
-
+      types,
+      handleSelectionChange,
     };
   },
 });

--
Gitblit v1.9.2