From 2b4328392746fc59f5edf98fed629f8db2804e18 Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期三, 27 七月 2022 09:29:23 +0800 Subject: [PATCH] 对接 --- src/components/DailogSearchUser/index.vue | 75 +++++++++++++++++++++++++------------ 1 files changed, 51 insertions(+), 24 deletions(-) diff --git a/src/components/DailogSearchUser/index.vue b/src/components/DailogSearchUser/index.vue index 775913e..a1e722b 100644 --- a/src/components/DailogSearchUser/index.vue +++ b/src/components/DailogSearchUser/index.vue @@ -10,7 +10,7 @@ </div> </div> </el-col> - <el-col :span="14" style="padding:20px"> + <el-col :span="14" style="padding: 20px"> <el-form ref="ruleFormRef" :model="ruleForm" status-icon> <el-row> <el-col :span="10" :offset="1"> @@ -26,12 +26,19 @@ </el-col> </el-row> </el-form> - <el-table :data="tableData" style="width: 100%; margin-top: 20px"> - <el-table-column align="center" width="50px" type="selection"></el-table-column> - <el-table-column align="center" prop="date" label="安全目标指标" /> - <el-table-column align="center" prop="name" label="目标指标编号" /> - <el-table-column align="center" prop="address" label="年度" /> - <el-table-column align="center" prop="address" label="指标值" /> + <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-column align="center" prop="name" label="用户名" /> + <el-table-column align="center" prop="address" label="所属机构" /> + <el-table-column align="center" prop="address" label="所属部门" /> + <el-table-column align="center" prop="address" label="状态" /> </el-table> <el-pagination style="padding: 20px 0; border-bottom: 1px solid #dedede" @@ -48,15 +55,23 @@ /> </el-col> <el-col :span="4"> - <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin:5px" closable :disable-transitions="false" @close="handleClose(tag)"> - {{ tag }} + <el-tag + v-for="tag in dynamicTags" + :key="tag" + class="mx-1" + style="margin: 5px" + closable + :disable-transitions="false" + @close="handleClose(tag)" + > + {{ tag.name }} </el-tag> </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> @@ -69,7 +84,7 @@ children?: Tree[]; } export default defineComponent({ - setup() { + setup(props,{emit}) { //左边树形部分 const names = ref<any>(); const handleNodeClick = (data: Tree) => { @@ -141,22 +156,23 @@ }); // 表格 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', @@ -169,26 +185,35 @@ const handleCurrentChange = (val: number) => { console.log(`current page: ${val}`); }; - const radio1 = ref('1'); - // 右方点击添加后显示标签 - 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 dialogVisible = ref(false); const openDailog = () => { dialogVisible.value = true; }; - //全屏 + //全屏 const full = ref(false); const toggleFullscreen = () => { if (full.value == false) { full.value = true; - }else{ - full.value = false; - } + } else { + full.value = false; + } }; + const submitForm=()=>{ + let obj=JSON.parse(JSON.stringify(dynamicTags.value)) + emit("SearchUser",obj[0]) + dialogVisible.value = false + } return { dialogVisible, names, @@ -202,10 +227,12 @@ handleCurrentChange, radio1, dynamicTags, - handleClose, + handleClose, FullScreen, full, - toggleFullscreen + toggleFullscreen, + radio, + submitForm }; }, }); -- Gitblit v1.9.2