From e4c5bd13edea4cf6a1b0f4e825902344b5cb599e Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期三, 08 二月 2023 10:17:54 +0800 Subject: [PATCH] 元数据添加版本选项 --- src/views/datamanage/metadataManage.vue | 74 ++++++++++++++++++++++++++++-------- 1 files changed, 57 insertions(+), 17 deletions(-) diff --git a/src/views/datamanage/metadataManage.vue b/src/views/datamanage/metadataManage.vue index 9ad7539..c814193 100644 --- a/src/views/datamanage/metadataManage.vue +++ b/src/views/datamanage/metadataManage.vue @@ -13,6 +13,21 @@ > <el-form-item> <el-cascader + v-model="queryForm.depid" + :show-all-levels="false" + :options="companyOption1" + @change="handleChange1" + :props="{ + label: 'name', + value: 'id', + children: 'children', + checkStrictly: true, + emitPath: false, + }" + ></el-cascader> + </el-form-item> + <el-form-item> + <el-cascader v-model="queryForm.dirid" :show-all-levels="false" :options="companyOption" @@ -27,19 +42,19 @@ ></el-cascader> </el-form-item> <el-form-item> - <el-cascader - v-model="queryForm.depid" - :show-all-levels="false" - :options="companyOption1" - @change="handleChange1" - :props="{ - label: 'name', - value: 'id', - children: 'children', - checkStrictly: true, - emitPath: false, - }" - ></el-cascader> + <el-select + v-model="queryForm.verid" + placeholder="璇烽�夋嫨" + @change="verHandleChange($event)" + > + <el-option + v-for="item in verOptions" + :key="item.id" + :label="item.name" + :value="item.id" + > + </el-option> + </el-select> </el-form-item> <el-form-item prop="name"> <el-input @@ -506,7 +521,8 @@ sign_getPublicKey, meta_selectDownloadFile, meta_selectFields, - meta_selectByPageForUpload + meta_selectByPageForUpload, + meta_selectVerByDirid } from '../../api/api'; import MyBread from '../../components/MyBread.vue'; @@ -535,6 +551,7 @@ } }; return { + verOptions: [], defaultProps: { children: 'children', label: 'name', @@ -556,7 +573,8 @@ queryForm: { name: '', dirid: '', - depid: '' + depid: '', + verid: '' }, behavior: '', initialForm: '', @@ -696,9 +714,11 @@ } this.companyOption1 = this.treeData(res.result); this.queryForm.depid = this.companyOption1[0].id + this.getQueryDirTree(); }, + async getQueryDirTree() { const res = await selectdirTab(); if (res.code != 200) { @@ -707,13 +727,30 @@ } this.companyOption = this.treeData(res.result); this.queryForm.dirid = this.companyOption[0].id + this.getQueryVerList(); + }, + + async getQueryVerList() { + const data = await meta_selectVerByDirid({ dirid: this.queryForm.dirid }) + if (data.code != 200) { + this.$message.error('鐗堟湰鍒楄〃鑾峰彇澶辫触'); + return; + } + this.verOptions = data.result; + this.queryForm.verid = data.result[0].id; + this.getMetaData(); + }, + verHandleChange(val) { + this.queryForm.verid = val; + this.listData.pageSize = 10; + this.listData.pageIndex = 1; this.getMetaData(); }, handleChange(value) { this.listData.pageSize = 10; this.listData.pageIndex = 1; this.queryForm.dirid = value; - this.getMetaData(); + this.getQueryVerList() }, handleChange1(value) { this.listData.pageSize = 10; @@ -843,6 +880,8 @@ getMetaData() { this.listData.depid = this.queryForm.depid; this.listData.dirid = this.queryForm.dirid; + + this.listData.verid = this.queryForm.verid; // this.listData.dirid = 57 select_meta_ByPageAndCount(this.listData).then((res) => { @@ -865,7 +904,8 @@ this.listData.pageIndex = 1; this.listData.name = null; this.queryForm.dirid = this.companyOption[0].id; - this.queryForm.depid = this.companyOption1[0].id + this.queryForm.depid = this.companyOption1[0].id; + this.getQueryVerList(); this.getMetaData(); }, //鏂板鎸夐挳 -- Gitblit v1.9.3