This commit is contained in:
Viet An
2026-06-01 10:17:47 +07:00
parent 5e958e4166
commit a39a8b3d43
10 changed files with 33 additions and 33 deletions

View File

@@ -134,10 +134,10 @@ export default {
},
createUserSetting() {
this.pagedata3 = this.$getpage();
let fields = [];
let arr = ["AutoField", "ForeignKey", "FloatField", "IntegerField"];
this.pagedata2.data.map((v) => {
let field = this.$createField(
const fields = [];
const arr = ["AutoField", "ForeignKey", "FloatField", "IntegerField"];
this.pagedata2.data.forEach((v) => {
const field = this.$createField(
v.name,
v.name,
arr.findIndex((x) => x == v.datatype) >= 0 ? "number" : "string",
@@ -146,13 +146,13 @@ export default {
);
fields.push(field);
});
this.$store.commit(this.pagename3, { update: { fields: fields } });
this.$store.commit(this.pagename3, { update: { fields } });
this.showmodal = {
component: "menu/MenuSave",
title: "Lưu thiết lập",
width: "600px",
height: "auto",
vbind: { pagename: this.pagename3, classify: 3 },
vbind: { pagename: this.pagename3, classify: "data-field" },
};
},
remove(v) {
@@ -164,11 +164,11 @@ export default {
async insertData() {
let copy = this.$copy(this.current);
copy.id = undefined;
let rs = await this.$insertrow("importsetting", copy, undefined, this.pagename);
await this.$insertrow("importsetting", copy, undefined, this.pagename);
},
async saveData() {
if (!this.row) return this.insertData();
let rs = await this.$updateapi("importsetting", this.current, undefined, this.pagename);
await this.$updateapi("importsetting", this.current, undefined, this.pagename);
},
updateFromModel() {
let filter = this.$filter(this.pagedata2.data, {