From dad957f2d33ba871beeba251e7c51c1e7bb2b1ab Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期四, 02 六月 2022 10:46:33 +0800 Subject: [PATCH] 'lct; --- src/views/safetyproduction/feature.vue | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 52 insertions(+), 7 deletions(-) diff --git a/src/views/safetyproduction/feature.vue b/src/views/safetyproduction/feature.vue index 442f961..93a0d3a 100644 --- a/src/views/safetyproduction/feature.vue +++ b/src/views/safetyproduction/feature.vue @@ -7,7 +7,24 @@ <el-input v-model="listQuery.filter.name"></el-input> </el-form-item> </el-col> - <el-col :span="4" style="text-align: center"> + <el-col :span="5"> + <el-form-item label="要素类型"> + <el-select + v-model="listQuery.filter.type" + placeholder="请选择" + style="width: 100%" + > + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value" + > + </el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="6" style="text-align: center"> <el-button type="primary" icon="el-icon-search" @click="find()" class="btns" >搜索</el-button > @@ -18,6 +35,12 @@ @click="handleClick('', '新增')" >新增</el-button > + <el-button + type="primary" + class="btns" + @click="reset()" + >重置</el-button + > </el-col> </el-row> </el-form> @@ -34,6 +57,8 @@ </el-table-column> <el-table-column label="得分" prop="point" align="center"> </el-table-column> + <el-table-column label="权重" prop="weight" align="center"> + </el-table-column> <el-table-column prop="remark" label="备注" align="center"> </el-table-column> <el-table-column prop="createTime" label="创建时间" align="center"> @@ -103,13 +128,22 @@ </el-form-item> </el-col> </el-row> - <el-row v-if="form.type==0?false:true"> + <el-row v-if="form.type==0 && form.type!=null"> + <el-col :span="11" > + <el-form-item label="权重" prop="weight"> + <el-input v-model="form.weight"></el-input> + </el-form-item> + </el-col> + </el-row> + + <el-row v-if="form.type==1 && form.type!=null"> <el-col :span="11"> <el-form-item label="父要素" prop="parentId"> <el-select v-model="form.parentId" placeholder="请选择" style="width: 100%" + :disabled="title=='编辑'?true:false" > <el-option v-for="item in parent" @@ -160,7 +194,6 @@ title: "", form: { name: "", - type: "", parentId: "", point:"", remark: "", @@ -200,6 +233,9 @@ point: [ { required: true, message: "得分不能为空", trigger: "change" }, ], + weight: [ + { required: true, message: "权重不能为空", trigger: "change" }, + ], }, }; }, @@ -207,9 +243,15 @@ this.elementManagementL(); }, methods: { + reset(){ + this.listQuery.filter={} + this.listQuery.pageIndex=1 + this.listQuery.pageSize=10 + this.elementManagementL(); + }, + async elementManagementL() { var res = await elementManagementList(this.listQuery); - console.log(res); if (res.data.code == 200) { this.list = res.data.result.records; this.recordTotal = res.data.result.total @@ -223,20 +265,18 @@ this.$refs["form"].clearValidate(); }); getParentElement().then(res=>{ - // console.log('父类:',res) this.parent=res.data.result }) if (type == "新增") { this.title = "新增"; this.form = { name: "", - type: "", parentId: "", remark: "", }; } else { this.title = "编辑"; - this.form = value; + this.form=JSON.parse(JSON.stringify(value)); } }, AddelementManagement() { @@ -319,6 +359,11 @@ type: "success", duration: 2000, }); + }else { + this.$message({ + type: "warning", + message: res.data.message, + }); } }); }) -- Gitblit v1.9.2