| | |
| | | </el-table-column> |
| | | <el-table-column label="父要素" prop="parentName" align="center"> |
| | | </el-table-column> |
| | | <el-table-column label="得分" prop="point" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" label="备注" align="center"> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" label="创建时间" align="center"> |
| | |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="dialogVisible" |
| | | :close-on-click-modal="false" |
| | | width="40%" |
| | | > |
| | | <el-form ref="form" :rules="rules" :model="form" label-width="80px"> |
| | |
| | | v-model="form.parentId" |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | :disabled="title=='编辑'?true:false" |
| | | > |
| | | <el-option |
| | | v-for="item in parent" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="得分" prop="point"> |
| | | <el-input v-model.number="form.point"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="备注"> |
| | |
| | | <el-button type="primary" class="btns" @click="AddelementManagement()" |
| | | >确 定</el-button |
| | | > |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | <el-button @click="cancel()">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | name: "", |
| | | type: "", |
| | | parentId: "", |
| | | point:"", |
| | | remark: "", |
| | | }, |
| | | pageSize: 10, |
| | |
| | | parentId: [ |
| | | { required: true, message: "父要素不能为空", trigger: "change" }, |
| | | ], |
| | | point: [ |
| | | { required: true, message: "得分不能为空", trigger: "change" }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | methods: { |
| | | 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 |
| | |
| | | this.$refs["form"].clearValidate(); |
| | | }); |
| | | getParentElement().then(res=>{ |
| | | // console.log('父类:',res) |
| | | this.parent=res.data.result |
| | | }) |
| | | if (type == "新增") { |
| | |
| | | }; |
| | | } else { |
| | | this.title = "编辑"; |
| | | this.form = value; |
| | | this.form=JSON.parse(JSON.stringify(value)); |
| | | } |
| | | }, |
| | | AddelementManagement() { |
| | |
| | | title: "成功", |
| | | }); |
| | | } else { |
| | | his.$message({ |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res.data.message, |
| | | }); |
| | |
| | | }); |
| | | }, |
| | | deleteById(val) { |
| | | elementManagementDel({id:val}).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | title: "成功", |
| | | message: "删除成功", |
| | | type: "success", |
| | | duration: 2000, |
| | | }); |
| | | } |
| | | }); |
| | | this.$confirm('确认删除吗','提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(()=>{ |
| | | elementManagementDel({id:val}).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.elementManagementL(); |
| | | this.$notify({ |
| | | title: "成功", |
| | | message: "删除成功", |
| | | type: "success", |
| | | duration: 2000, |
| | | }); |
| | | }else { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: res.data.message, |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(error =>{ |
| | | }); |
| | | }, |
| | | cancel(){ |
| | | this.elementManagementL(); |
| | | this.dialogVisible = false; |
| | | }, |
| | | find(){ |
| | | this.elementManagementL(); |
| | | }, |
| | |
| | | background-color: #034ea2; |
| | | border: 1px solid #034ea2; |
| | | } |
| | | </style> |
| | | </style> |