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

添加编辑修改

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