From 604cf458b39451a82b4bd7a64f0dd578dc2bd644 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期日, 09 十月 2022 17:47:04 +0800 Subject: [PATCH] 1 --- src/views/datamanage/styleManage.vue | 70 +++++++++++++++++++++++----------- 1 files changed, 47 insertions(+), 23 deletions(-) diff --git a/src/views/datamanage/styleManage.vue b/src/views/datamanage/styleManage.vue index 88c3eab..6736c9c 100644 --- a/src/views/datamanage/styleManage.vue +++ b/src/views/datamanage/styleManage.vue @@ -266,7 +266,7 @@ </div> <el-dialog title="淇敼璇︽儏" - top="5vh" + top="2vh" style="overflow: hidden" :before-close="removeUpdate" :visible.sync="dialogFormVisible" @@ -376,8 +376,8 @@ </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> - <el-button @click="removeUpdate">鍙� 娑�</el-button> - <el-button type="primary" @click="updateForm">纭� 瀹�</el-button> + <el-button @click="removeUpdate">{{$t('common.close')}}</el-button> + <el-button type="primary" @click="updateForm">{{$t('common.confirm')}}</el-button> </div> </el-dialog> <el-dialog @@ -491,8 +491,8 @@ </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> - <el-button @click="insertFromDataClose">鍙� 娑�</el-button> - <el-button type="primary" @click="insertFromData">纭� 瀹�</el-button> + <el-button @click="insertFromDataClose">{{$t('common.close')}}</el-button> + <el-button type="primary" @click="insertFromData">{{$t('common.confirm')}}</el-button> </div> </el-dialog> <div class="leftTree" v-if="showDirCata"> @@ -549,7 +549,6 @@ showinfoBox: false, itemdetail: {}, ruleForm: { - name: '', }, backupData: [], @@ -567,7 +566,6 @@ count: 0, listData: { name: null, - depName: null, pageIndex: 1, pageSize: 10, }, @@ -618,10 +616,8 @@ }, selectDepCataName() { this.showDepCata = false; - console.log(this.depFlag) switch (this.depFlag) { case 0: - // var data = this.$store.state.styleDirCateNodes; this.insertform.depValue = this.$store.state.styleDepCateNodes.name; this.insertform.depid = this.$store.state.styleDepCateNodes.id; break; @@ -677,6 +673,7 @@ if (this.listData.tab == '') { delete this.listData.tab; } + this.listData.name = this.ruleForm.name; const data = await select_Style_ByPageAndCount(this.listData); if (data.code != 200) { this.$message.error('鍒楄〃璋冪敤澶辫触'); @@ -696,8 +693,11 @@ }, formatStatus(row, column) { let date = row[column.property]; + return this.forMontStatus(date); + }, + forMontStatus(date) { if (date === undefined || date === null) { - return ''; + return; } switch (date) { case 1: @@ -805,15 +805,34 @@ addstyle() { this.$router.push('/addstyle'); }, - async updateForm() { - if (this.upform.dirid == null || this.upform.depid == null) { + statusFormat(res){ + switch(res){ + case "鍚敤": + return 1; + break; + case "鍋滅敤": + return 0; + break; + case "Start Using": + return 1; + break; + case "Stop Using": + return 0; + break; + } + }, + async updateForm() { + if (this.upform.dirid == null || this.upform.depid == null) { this.$message({ message: '璇烽�夋嫨鏍峰紡鎵�灞炵殑鐩綍鎴栧崟浣�', type: 'warning', }); return; } - const data = await updateStyle(this.upform); + if(Number.isInteger(this.upform.status) == false){ + this.upform.status = this.statusFormat(this.upform.status) + } + const data = await updateStyle(this.upform); if (data.code == 200) { this.dialogFormVisible = false; this.upform = {}; @@ -835,26 +854,30 @@ removeUpdate() { this.upflag = false; this.dialogFormVisible = false; - this.upform={} + this.upform = {} }, submitForm(formName) { - this.$refs[formName].validate((valid) => { - if (valid) { - this.searchName = this.ruleForm.name.trim(); - this.startFromData(); - } else { - console.log('error submit!!'); - return false; - } - }); + this.getRoleTabelData() + // this.$refs[formName].validate((valid) => { + // if (valid) { + // this.searchName = this.ruleForm.name.trim(); + // this.startFromData(); + // } else { + // console.log('error submit!!'); + // return false; + // } + // }); }, resetForm(formName) { + this.ruleForm ={} + this.getRoleTabelData(); }, showDetail(index, row) { this.showinfoBox = true; this.itemdetail = row; this.itemdetail.createTime = this.formomentTime(this.itemdetail.createTime); this.itemdetail.updateTime = this.formomentTime(this.itemdetail.updateTime); + }, closeDetial() { this.showinfoBox = false; @@ -868,6 +891,7 @@ this.upform = row; this.upform.depValue = row.depName; this.upform.dirValue = row.dirName; + this.upform.status = this.forMontStatus(row.status) }, handleDelete(index, row) { this.$confirm('纭畾鏄惁鍒犻櫎?', '鎻愮ず', { -- Gitblit v1.9.3