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

添加编辑修改

parent 76a2fb9e
...@@ -152,12 +152,12 @@ export default { ...@@ -152,12 +152,12 @@ export default {
key: "title", key: "title",
slot: "title" slot: "title"
}, },
{ {
title: "属性类型", title: "属性类型",
key: "dataType", key: "dataType",
align: "center", align: "center",
slot: "dataType", slot: "dataType",
width:150 width: 150
}, },
{ {
title: "备注", title: "备注",
...@@ -166,7 +166,7 @@ export default { ...@@ -166,7 +166,7 @@ export default {
slot: "note", slot: "note",
width: "150" width: "150"
}, },
// { // {
// title: "是否显示", // title: "是否显示",
// key: "result", // key: "result",
...@@ -192,14 +192,14 @@ export default { ...@@ -192,14 +192,14 @@ export default {
key: "required", key: "required",
align: "center", align: "center",
slot: "required", slot: "required",
width:80 width: 80
}, },
{ {
title: "唯一", title: "唯一",
key: "isUnique", key: "isUnique",
align: "center", align: "center",
slot: "isUnique", slot: "isUnique",
width:80 width: 80
}, },
{ {
title: "操作", title: "操作",
...@@ -242,7 +242,7 @@ export default { ...@@ -242,7 +242,7 @@ export default {
if (r.result) { if (r.result) {
var arr = r.result; var arr = r.result;
this.checkList = arr.filter(function(item) { this.checkList = arr.filter(function(item) {
item.mid=item.id; item.mid = item.id;
delete item["id"]; //删除属性id delete item["id"]; //删除属性id
return item; return item;
}); });
...@@ -269,15 +269,15 @@ export default { ...@@ -269,15 +269,15 @@ export default {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew() {
let maxId=0; let maxId = 0;
this.checkList.map(u=>{ this.checkList.map(u => {
if(u.mid>maxId){ if (u.mid > maxId) {
maxId=u.mid; maxId = u.mid;
} }
}) });
let obj = { let obj = {
mid:maxId+1, mid: maxId + 1,
field:"c"+maxId, field: "c" + maxId,
title: "", title: "",
note: "", note: "",
dataType: "", dataType: "",
...@@ -288,7 +288,7 @@ export default { ...@@ -288,7 +288,7 @@ export default {
action: 1, action: 1,
add: 0 //新增标识 add: 0 //新增标识
}; };
this.checkList.push(obj); this.checkList.unshift(obj);
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
......
...@@ -150,12 +150,12 @@ export default { ...@@ -150,12 +150,12 @@ export default {
key: "title", key: "title",
slot: "title" slot: "title"
}, },
{ {
title: "属性类型", title: "属性类型",
key: "dataType", key: "dataType",
align: "center", align: "center",
slot: "dataType", slot: "dataType",
width:150 width: 150
}, },
{ {
title: "备注", title: "备注",
...@@ -179,14 +179,14 @@ export default { ...@@ -179,14 +179,14 @@ export default {
key: "required", key: "required",
align: "center", align: "center",
slot: "required", slot: "required",
width:80 width: 80
}, },
{ {
title: "唯一", title: "唯一",
key: "isUnique", key: "isUnique",
align: "center", align: "center",
slot: "isUnique", slot: "isUnique",
width:80 width: 80
}, },
{ {
title: "操作", title: "操作",
...@@ -225,12 +225,16 @@ export default { ...@@ -225,12 +225,16 @@ export default {
fieldValue: this.nodeInfo.id fieldValue: this.nodeInfo.id
} }
]; ];
Api.listTable({ conditions: conditions ,sortBy:'id',isDesc:false}).then(r => { Api.listTable({
conditions: conditions,
sortBy: "id",
isDesc: false
}).then(r => {
if (r.result) { if (r.result) {
console.log(r); console.log(r);
r.result.map(u=>{ r.result.map(u => {
u.mid=u.id; u.mid = u.id;
}) });
this.checkList = r.result; this.checkList = r.result;
} }
}); });
...@@ -248,16 +252,16 @@ export default { ...@@ -248,16 +252,16 @@ export default {
setRow(row, index) { setRow(row, index) {
this.$set(this.checkList, index, row); this.$set(this.checkList, index, row);
}, },
addNew() { addNew() {
let maxId=0; let maxId = 0;
this.checkList.map(u=>{ this.checkList.map(u => {
if(u.mid>maxId){ if (u.mid > maxId) {
maxId=u.mid; maxId = u.mid;
} }
}) });
let obj = { let obj = {
mid:maxId+1, mid: maxId + 1,
field:"c"+maxId, field: "c" + maxId,
title: "", title: "",
note: "", note: "",
dataType: "", dataType: "",
...@@ -268,7 +272,7 @@ export default { ...@@ -268,7 +272,7 @@ export default {
action: 1, action: 1,
add: 0 //新增标识 add: 0 //新增标识
}; };
this.checkList.push(obj); this.checkList.unshift(obj);
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate(v => { this.$refs.form.validate(v => {
......
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