c
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -158,7 +158,6 @@ function dynamicComponent(htmlString) {
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
emits: ["clickevent"],
|
||||
});
|
||||
}
|
||||
var timer = undefined;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user