Commit c4b7b181 authored by 仇晓婷's avatar 仇晓婷

jj

parent cf460496
......@@ -89,14 +89,15 @@ export default {
categoryId: this.nodeInfo.categoryId, //左侧树点击的id
customProperties: {},
rootCategoryId: this.nodeInfo.rootCategoryId, //左侧树点击的数据的最顶层id
version: null
version: null,
codeRuleType: this.nodeInfo.codeRuleType,
},
fileds: [],
checkList: [],
disabled: false,
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
}
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
async fetch({ store, params }) {
......@@ -114,16 +115,16 @@ export default {
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: this.nodeInfo.rootCategoryId
}
fieldValue: this.nodeInfo.rootCategoryId,
},
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
isDesc: false,
}).then((r) => {
if (r.result) {
this.fileds = r.result.filter(function(item) {
this.fileds = r.result.filter(function (item) {
item.span = 12;
if (item.dataType > 4) {
item.span = 24;
......@@ -131,7 +132,7 @@ export default {
delete item["id"];
return item.fieldType != 1;
});
this.fileds.map(u => {
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
......@@ -143,7 +144,7 @@ export default {
});
},
get() {
Api.get({ id: this.eid }).then(r => {
Api.get({ id: this.eid }).then((r) => {
if (r.result) {
this.entity = r.result;
this.entity.version = parseInt(r.result.version);
......@@ -155,23 +156,23 @@ export default {
{
conditionalType: "In",
fieldName: "fieldType",
fieldValue: "1,2"
fieldValue: "1,2",
},
{
conditionalType: "Equal",
fieldName: "categoryId",
fieldValue: "0"
}
fieldValue: "0",
},
];
Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
isDesc: false,
}).then((r) => {
if (r.result) {
var arr = r.result;
this.checkList = arr.filter(function(item) {
this.checkList = arr.filter(function (item) {
item.mid = item.id;
delete item["id"]; //删除属性id
return item;
......@@ -195,12 +196,12 @@ export default {
},
handleSubmit() {
this.$refs.form.validate(v => {
this.$refs.form.validate((v) => {
if (v) {
// let categoryDto = this.entity;
// let pro = this.checkList.concat(this.arr);
Api.update(this.entity)
.then(r => {
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
......@@ -208,7 +209,7 @@ export default {
this.$Message.error(r.error.message);
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error(r.error.message);
});
......@@ -217,7 +218,7 @@ export default {
},
handleClose() {
this.$emit("on-close");
}
}
},
},
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment