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

@@ -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"