From 09a7d782235db3192db6cd0013e96a3a9265a3fd Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期三, 27 七月 2022 17:49:33 +0800 Subject: [PATCH] 对接 --- src/views/goalManagement/TargetBook/component/DailogSearch.vue | 46 +++++++++++++++++++++++++++++++++++++--------- 1 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/views/goalManagement/TargetBook/component/DailogSearch.vue b/src/views/goalManagement/TargetBook/component/DailogSearch.vue index b8f225d..1801078 100644 --- a/src/views/goalManagement/TargetBook/component/DailogSearch.vue +++ b/src/views/goalManagement/TargetBook/component/DailogSearch.vue @@ -24,8 +24,14 @@ </el-row> </el-form> <el-button size="default" :icon="Delete">清除选择</el-button> - <el-table :data="tableData" style="width: 100%; margin-top: 20px"> - <el-table-column align="center" type="selection" /> + <el-table :data="tableData" style="width: 100%; margin-top: 20px" @cell-click="radio"> + <el-table-column align="center"> + <template #default="scope"> + <el-radio-group v-model="radio1"> + <el-radio :label="scope.row.id" size="large">{{ null }}</el-radio> + </el-radio-group> + </template> + </el-table-column> <el-table-column align="center" prop="date" label="岗位名称" /> </el-table> <el-pagination @@ -43,6 +49,7 @@ /> </el-col> <el-col :span="7"> + <div v-if="dynamicTags[0]==''?false:true"> <el-tag v-for="tag in dynamicTags" :key="tag" @@ -52,14 +59,15 @@ :disable-transitions="false" @close="handleClose(tag)" > - {{ tag }} + {{ tag.id }} </el-tag> + </div> </el-col> </el-row> <template #footer> <span class="dialog-footer"> <el-button @click="dialogVisible = false" size="default">关闭</el-button> - <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> + <el-button type="primary" @click="submitForm" size="default">确定</el-button> </span> </template> </el-dialog> @@ -68,7 +76,7 @@ import { defineComponent, reactive, ref } from 'vue'; import { Delete, FullScreen } from '@element-plus/icons-vue'; export default defineComponent({ - setup() { + setup(props,{emit}) { const dialogVisible = ref<boolean>(false); const openDailog = () => { dialogVisible.value = true; @@ -80,22 +88,24 @@ }); // 表格 const tableData = [ - { + { id:1, date: '2016-05-03', name: 'Tom', address: 'No. 189, Grove St, Los Angeles', }, { + id:2, date: '2016-05-02', name: 'Tom', address: 'No. 189, Grove St, Los Angeles', }, - { + { + id:3, date: '2016-05-04', name: 'Tom', address: 'No. 189, Grove St, Los Angeles', }, - { + { id:4, date: '2016-05-01', name: 'Tom', address: 'No. 189, Grove St, Los Angeles', @@ -109,10 +119,24 @@ console.log(`current page: ${val}`); }; // 右方点击添加后显示标签 - const dynamicTags = ref(['Tag 1', 'Tag 2', 'Tag 3']); + const dynamicTags = ref(['']); const handleClose = (tag: string) => { dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1); + radio1.value = ''; }; + const radio1 = ref(''); + const radio = (event: any) => { + dynamicTags.value[0] = event; + }; + const clear=()=>{ + dynamicTags.value=[''] + radio1.value="" + } + const submitForm=()=>{ + let obj=JSON.parse(JSON.stringify(dynamicTags.value)) + emit("backNum",obj[0]) + dialogVisible.value = false + } //全屏 const full = ref(false); const toggleFullscreen = () => { @@ -123,6 +147,9 @@ } }; return { + radio1, + radio, + clear, dialogVisible, openDailog, ruleForm, @@ -132,6 +159,7 @@ handleCurrentChange, dynamicTags, handleClose, + submitForm, Delete, full, toggleFullscreen, -- Gitblit v1.9.2