c
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
class="modal-card-head px-4 py-3"
|
class="modal-card-head px-4 py-3"
|
||||||
>
|
>
|
||||||
<p
|
<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"
|
v-html="title"
|
||||||
></p>
|
></p>
|
||||||
<button
|
<button
|
||||||
@@ -135,7 +135,7 @@ onUnmounted(() => {
|
|||||||
var(--bulma-scheme-h),
|
var(--bulma-scheme-h),
|
||||||
var(--bulma-scheme-s),
|
var(--bulma-scheme-s),
|
||||||
var(--bulma-scheme-invert-l),
|
var(--bulma-scheme-invert-l),
|
||||||
0.7
|
0.5
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ function fieldList() {
|
|||||||
component: "datatable/TableOption",
|
component: "datatable/TableOption",
|
||||||
vbind: { pagename: props.pagename },
|
vbind: { pagename: props.pagename },
|
||||||
title: "Danh sách cột",
|
title: "Danh sách cột",
|
||||||
width: "50%",
|
width: "75%",
|
||||||
height: "630px",
|
height: "630px",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -606,7 +606,7 @@ const changeTab = function (v) {
|
|||||||
const saveSetting = function () {
|
const saveSetting = function () {
|
||||||
showmodal.value = {
|
showmodal.value = {
|
||||||
component: "datatable/MenuSave",
|
component: "datatable/MenuSave",
|
||||||
vbind: { pagename: props.pagename, classify: 4 },
|
vbind: { pagename: props.pagename, classify: "data-field" },
|
||||||
title: "Lưu thiết lập",
|
title: "Lưu thiết lập",
|
||||||
width: "500px",
|
width: "500px",
|
||||||
height: "auto",
|
height: "auto",
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ function dynamicComponent(htmlString) {
|
|||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ["clickevent"],
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var timer = undefined;
|
var timer = undefined;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ if (props.realtime) {
|
|||||||
|
|
||||||
if (vparams?.filter) {
|
if (vparams?.filter) {
|
||||||
for (const [key, value] of Object.entries(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;
|
vparams.filter[key] = store[value.replace("$", "")].id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label">Chọn chế độ lưu</label>
|
<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
|
<button
|
||||||
class="button is-white has-text-inherit"
|
:class="['button', radioSave === 'overwrite' ? 'is-primary is-light' : 'is-white']"
|
||||||
v-if="isOverwrite()"
|
v-if="isOverwrite()"
|
||||||
@click="changeType('overwrite')"
|
@click="changeType('overwrite')"
|
||||||
>
|
>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<span>Ghi đè</span>
|
<span>Ghi đè</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="button is-white"
|
:class="['button', radioSave === 'new' ? 'is-primary is-light' : 'is-white']"
|
||||||
@click="changeType('new')"
|
@click="changeType('new')"
|
||||||
>
|
>
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<button
|
<button
|
||||||
ref="saveBtn"
|
ref="saveBtn"
|
||||||
:class="['button is-primary', isLoading && 'is-loading']"
|
:class="['button is-primary', isLoading && 'is-loading']"
|
||||||
@click="saveSetting()"
|
@click="saveSetting"
|
||||||
>
|
>
|
||||||
Lưu lại
|
Lưu lại
|
||||||
</button>
|
</button>
|
||||||
@@ -111,7 +111,7 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
const { $empty, $copy, $stripHtml, $updateapi, $insertapi, $findIndex, $snackbar } = useNuxtApp();
|
const { $empty, $copy, $stripHtml, $updateapi, $insertapi, $findIndex, $snackbar } = useNuxtApp();
|
||||||
const radioOption = ref();
|
const radioOption = ref();
|
||||||
var login = { id: 1 };
|
const login = { id: 1 };
|
||||||
const errors = ref([]);
|
const errors = ref([]);
|
||||||
const radioType = ref();
|
const radioType = ref();
|
||||||
const radioDefault = 0;
|
const radioDefault = 0;
|
||||||
@@ -140,17 +140,19 @@ async function saveSetting() {
|
|||||||
}
|
}
|
||||||
if (props.option) detail.option = props.option;
|
if (props.option) detail.option = props.option;
|
||||||
if (props.data) detail.data = props.data;
|
if (props.data) detail.data = props.data;
|
||||||
let data = {
|
|
||||||
|
const data = {
|
||||||
// user: login.id,
|
// user: login.id,
|
||||||
user: undefined,
|
user: undefined,
|
||||||
name: name.value,
|
name: name.value,
|
||||||
detail,
|
detail,
|
||||||
note,
|
note: note.value,
|
||||||
type: radioType.value.id,
|
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,
|
default: radioDefault,
|
||||||
update_time: new Date(),
|
update_time: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let result;
|
let result;
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
if (radioSave.value === "new") {
|
if (radioSave.value === "new") {
|
||||||
@@ -162,10 +164,12 @@ async function saveSetting() {
|
|||||||
}
|
}
|
||||||
result = await $insertapi("usersetting", data);
|
result = await $insertapi("usersetting", data);
|
||||||
} else {
|
} else {
|
||||||
let copy = $copy(currentsetting);
|
const updatedSetting = {
|
||||||
copy.detail = detail;
|
...$copy(currentsetting),
|
||||||
copy.update_time = new Date();
|
detail,
|
||||||
result = await $updateapi("usersetting", copy);
|
update_time: new Date(),
|
||||||
|
};
|
||||||
|
result = await $updateapi("usersetting", updatedSetting);
|
||||||
}
|
}
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
if (radioSave.value === "new") {
|
if (radioSave.value === "new") {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
>
|
>
|
||||||
<SvgIcon v-bind="{ name: 'opennew.svg', type: 'gray', size: 15 }"></SvgIcon>
|
<SvgIcon v-bind="{ name: 'opennew.svg', type: 'gray', size: 15 }"></SvgIcon>
|
||||||
</a>
|
</a>
|
||||||
<span class="tooltiptext">Mở trong tab mớ</span>
|
<span class="tooltiptext">Mở trong tab mới</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="tooltip"
|
class="tooltip"
|
||||||
|
|||||||
@@ -134,10 +134,10 @@ export default {
|
|||||||
},
|
},
|
||||||
createUserSetting() {
|
createUserSetting() {
|
||||||
this.pagedata3 = this.$getpage();
|
this.pagedata3 = this.$getpage();
|
||||||
let fields = [];
|
const fields = [];
|
||||||
let arr = ["AutoField", "ForeignKey", "FloatField", "IntegerField"];
|
const arr = ["AutoField", "ForeignKey", "FloatField", "IntegerField"];
|
||||||
this.pagedata2.data.map((v) => {
|
this.pagedata2.data.forEach((v) => {
|
||||||
let field = this.$createField(
|
const field = this.$createField(
|
||||||
v.name,
|
v.name,
|
||||||
v.name,
|
v.name,
|
||||||
arr.findIndex((x) => x == v.datatype) >= 0 ? "number" : "string",
|
arr.findIndex((x) => x == v.datatype) >= 0 ? "number" : "string",
|
||||||
@@ -146,13 +146,13 @@ export default {
|
|||||||
);
|
);
|
||||||
fields.push(field);
|
fields.push(field);
|
||||||
});
|
});
|
||||||
this.$store.commit(this.pagename3, { update: { fields: fields } });
|
this.$store.commit(this.pagename3, { update: { fields } });
|
||||||
this.showmodal = {
|
this.showmodal = {
|
||||||
component: "menu/MenuSave",
|
component: "menu/MenuSave",
|
||||||
title: "Lưu thiết lập",
|
title: "Lưu thiết lập",
|
||||||
width: "600px",
|
width: "600px",
|
||||||
height: "auto",
|
height: "auto",
|
||||||
vbind: { pagename: this.pagename3, classify: 3 },
|
vbind: { pagename: this.pagename3, classify: "data-field" },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
remove(v) {
|
remove(v) {
|
||||||
@@ -164,11 +164,11 @@ export default {
|
|||||||
async insertData() {
|
async insertData() {
|
||||||
let copy = this.$copy(this.current);
|
let copy = this.$copy(this.current);
|
||||||
copy.id = undefined;
|
copy.id = undefined;
|
||||||
let rs = await this.$insertrow("importsetting", copy, undefined, this.pagename);
|
await this.$insertrow("importsetting", copy, undefined, this.pagename);
|
||||||
},
|
},
|
||||||
async saveData() {
|
async saveData() {
|
||||||
if (!this.row) return this.insertData();
|
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() {
|
updateFromModel() {
|
||||||
let filter = this.$filter(this.pagedata2.data, {
|
let filter = this.$filter(this.pagedata2.data, {
|
||||||
|
|||||||
@@ -1232,7 +1232,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.error(err);
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export default defineNuxtPlugin(async (nuxtApp) => {
|
export default defineNuxtPlugin(async (nuxtApp) => {
|
||||||
const { $getapi, $readyapi } = nuxtApp;
|
const { $getapi, $readyapi } = nuxtApp;
|
||||||
let connlist = $readyapi([
|
const connlist = $readyapi([
|
||||||
"datatype",
|
"datatype",
|
||||||
"common",
|
"common",
|
||||||
"filterchoice",
|
"filterchoice",
|
||||||
@@ -18,6 +18,6 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
|||||||
"settingclass",
|
"settingclass",
|
||||||
"sex",
|
"sex",
|
||||||
]);
|
]);
|
||||||
let notReadyConns = connlist.filter((v) => !v.ready);
|
const notReadyConns = connlist.filter((v) => !v.ready);
|
||||||
if (notReadyConns.length > 0) await $getapi(notReadyConns);
|
if (notReadyConns.length > 0) await $getapi(notReadyConns);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ export const useStore = defineStore("maindev", {
|
|||||||
settings: [],
|
settings: [],
|
||||||
showmodal: undefined,
|
showmodal: undefined,
|
||||||
snackbar: undefined,
|
snackbar: undefined,
|
||||||
productdocument: undefined,
|
|
||||||
applicationstatus: undefined,
|
|
||||||
applicationproduct: undefined,
|
|
||||||
country: undefined,
|
country: undefined,
|
||||||
lang: "vi",
|
lang: "vi",
|
||||||
branch: {},
|
branch: {},
|
||||||
|
|||||||
Reference in New Issue
Block a user