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

@@ -22,7 +22,7 @@
class="modal-card-head px-4 py-3"
>
<p
class="fs-17 font-semibold has-text-primary control is-expanded has-text-left modal-card-title"
class="modal-card-title fs-17 font-semibold control is-expanded"
v-html="title"
></p>
<button
@@ -135,7 +135,7 @@ onUnmounted(() => {
var(--bulma-scheme-h),
var(--bulma-scheme-s),
var(--bulma-scheme-invert-l),
0.7
0.5
);
}

View File

@@ -539,7 +539,7 @@ function fieldList() {
component: "datatable/TableOption",
vbind: { pagename: props.pagename },
title: "Danh sách cột",
width: "50%",
width: "75%",
height: "630px",
};
}
@@ -606,7 +606,7 @@ const changeTab = function (v) {
const saveSetting = function () {
showmodal.value = {
component: "datatable/MenuSave",
vbind: { pagename: props.pagename, classify: 4 },
vbind: { pagename: props.pagename, classify: "data-field" },
title: "Lưu thiết lập",
width: "500px",
height: "auto",

View File

@@ -158,7 +158,6 @@ function dynamicComponent(htmlString) {
default: () => ({}),
},
},
emits: ["clickevent"],
});
}
var timer = undefined;

View File

@@ -81,7 +81,7 @@ if (props.realtime) {
if (vparams?.filter) {
for (const [key, value] of Object.entries(vparams.filter)) {
if (value.toString().indexOf("$") >= 0) {
if (value?.toString().indexOf("$") >= 0) {
vparams.filter[key] = store[value.replace("$", "")].id;
}
}

View File

@@ -10,9 +10,9 @@
</div>
<div class="field">
<label class="label">Chọn chế độ lưu</label>
<div class="control is-expanded fs-14">
<div class="control is-expanded is-flex is-gap-0.5 fs-14">
<button
class="button is-white has-text-inherit"
:class="['button', radioSave === 'overwrite' ? 'is-primary is-light' : 'is-white']"
v-if="isOverwrite()"
@click="changeType('overwrite')"
>
@@ -29,7 +29,7 @@
<span>Ghi đè</span>
</button>
<button
class="button is-white"
:class="['button', radioSave === 'new' ? 'is-primary is-light' : 'is-white']"
@click="changeType('new')"
>
<span class="icon">
@@ -90,7 +90,7 @@
<button
ref="saveBtn"
:class="['button is-primary', isLoading && 'is-loading']"
@click="saveSetting()"
@click="saveSetting"
>
Lưu lại
</button>
@@ -111,7 +111,7 @@ const props = defineProps({
});
const { $empty, $copy, $stripHtml, $updateapi, $insertapi, $findIndex, $snackbar } = useNuxtApp();
const radioOption = ref();
var login = { id: 1 };
const login = { id: 1 };
const errors = ref([]);
const radioType = ref();
const radioDefault = 0;
@@ -140,17 +140,19 @@ async function saveSetting() {
}
if (props.option) detail.option = props.option;
if (props.data) detail.data = props.data;
let data = {
const data = {
// user: login.id,
user: undefined,
name: name.value,
detail,
note,
note: note.value,
type: radioType.value.id,
classify: props.classify ? props.classify : store.settingclass.find((v) => v.code === "data-field").id,
classify: store.settingclass.find((v) => v.code === props.classify).id,
default: radioDefault,
update_time: new Date(),
};
let result;
isLoading.value = true;
if (radioSave.value === "new") {
@@ -162,10 +164,12 @@ async function saveSetting() {
}
result = await $insertapi("usersetting", data);
} else {
let copy = $copy(currentsetting);
copy.detail = detail;
copy.update_time = new Date();
result = await $updateapi("usersetting", copy);
const updatedSetting = {
...$copy(currentsetting),
detail,
update_time: new Date(),
};
result = await $updateapi("usersetting", updatedSetting);
}
isLoading.value = false;
if (radioSave.value === "new") {

View File

@@ -58,7 +58,7 @@
>
<SvgIcon v-bind="{ name: 'opennew.svg', type: 'gray', size: 15 }"></SvgIcon>
</a>
<span class="tooltiptext">Mở trong tab mớ</span>
<span class="tooltiptext">Mở trong tab mới</span>
</span>
<span
class="tooltip"

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, {

View File

@@ -1232,7 +1232,7 @@ export default defineNuxtPlugin((nuxtApp) => {
}
return rs;
} catch (err) {
console.log(err);
console.error(err);
return "error";
}
};

View File

@@ -1,6 +1,6 @@
export default defineNuxtPlugin(async (nuxtApp) => {
const { $getapi, $readyapi } = nuxtApp;
let connlist = $readyapi([
const connlist = $readyapi([
"datatype",
"common",
"filterchoice",
@@ -18,6 +18,6 @@ export default defineNuxtPlugin(async (nuxtApp) => {
"settingclass",
"sex",
]);
let notReadyConns = connlist.filter((v) => !v.ready);
const notReadyConns = connlist.filter((v) => !v.ready);
if (notReadyConns.length > 0) await $getapi(notReadyConns);
});

View File

@@ -9,9 +9,6 @@ export const useStore = defineStore("maindev", {
settings: [],
showmodal: undefined,
snackbar: undefined,
productdocument: undefined,
applicationstatus: undefined,
applicationproduct: undefined,
country: undefined,
lang: "vi",
branch: {},