This commit is contained in:
Viet An
2026-06-11 09:16:36 +07:00
parent 7325230280
commit 03f3112573
5 changed files with 228 additions and 304 deletions

View File

@@ -8,7 +8,7 @@
<input
class="input fs-13"
type="text"
:value="tablesetting.find((v) => v.code === 'table-font-size').detail"
:value="getDetail('table-font-size')"
@change="changeSetting($event.target.value, 'table-font-size')"
/>
</p>
@@ -21,7 +21,7 @@
<input
class="input fs-13"
type="text"
:value="tablesetting.find((v) => v.code === 'header-font-size').detail"
:value="getDetail('header-font-size')"
@change="changeSetting($event.target.value, 'header-font-size')"
/>
</p>
@@ -34,7 +34,7 @@
<input
class="input fs-13"
type="text"
:value="tablesetting.find((v) => v.code === 'per-page').detail"
:value="getDetail('per-page')"
@change="changeSetting($event.target.value, 'per-page')"
/>
</p>
@@ -46,14 +46,14 @@
<p class="control is-flex is-gap-1">
<input
type="color"
:value="tablesetting.find((v) => v.code === 'table-background').detail"
:value="getDetail('table-background')"
@change="changeSetting($event.target.value, 'table-background')"
/>
<input
class="input fs-13"
type="text"
placeholder="#f29384, var(--bulma-blue)"
:value="tablesetting.find((v) => v.code === 'table-background').detail"
:value="getDetail('table-background')"
@change="changeSetting($event.target.value, 'table-background')"
/>
</p>
@@ -65,14 +65,14 @@
<p class="control is-flex is-gap-1">
<input
type="color"
:value="tablesetting.find((v) => v.code === 'table-font-color').detail"
:value="getDetail('table-font-color')"
@change="changeSetting($event.target.value, 'table-font-color')"
/>
<input
class="input fs-13"
type="text"
placeholder="#f29384, var(--bulma-blue)"
:value="tablesetting.find((v) => v.code === 'table-font-color').detail"
:value="getDetail('table-font-color')"
@change="changeSetting($event.target.value, 'table-font-color')"
/>
</p>
@@ -84,14 +84,14 @@
<p class="control is-flex is-gap-1">
<input
type="color"
:value="tablesetting.find((v) => v.code === 'header-font-color').detail"
:value="getDetail('header-font-color')"
@change="changeSetting($event.target.value, 'header-font-color')"
/>
<input
class="input fs-13"
type="text"
placeholder="#f29384, var(--bulma-blue)"
:value="tablesetting.find((v) => v.code === 'header-font-color').detail"
:value="getDetail('header-font-color')"
@change="changeSetting($event.target.value, 'header-font-color')"
/>
</p>
@@ -110,7 +110,7 @@
class="input fs-13 h-full"
type="text"
placeholder="#f29384, var(--bulma-blue)"
:value="tablesetting.find((v) => v.code === 'header-background').detail"
:value="getDetail('header-background')"
@change="changeSetting($event.target.value, 'header-background')"
/>
@@ -118,7 +118,7 @@
ref="renderedHeaderBg"
class="is-hidden"
:style="{
backgroundColor: tablesetting.find((v) => v.code === 'header-background').detail,
backgroundColor: getDetail('header-background'),
}"
></div>
</div>
@@ -130,14 +130,14 @@
<p class="control is-flex is-gap-1">
<input
type="color"
:value="tablesetting.find((v) => v.code === 'header-filter-color').detail"
:value="getDetail('header-filter-color')"
@change="changeSetting($event.target.value, 'header-filter-color')"
/>
<input
class="input fs-13"
type="text"
placeholder="#f29384, var(--bulma-blue)"
:value="tablesetting.find((v) => v.code === 'header-filter-color').detail"
:value="getDetail('header-filter-color')"
@change="changeSetting($event.target.value, 'header-filter-color')"
/>
</p>
@@ -150,11 +150,7 @@
<input
class="input fs-13"
type="text"
:value="
tablesetting.find((v) => v.code === 'td-border')
? tablesetting.find((v) => v.code === 'td-border').detail
: undefined
"
:value="getDetail('td-border')"
@change="changeSetting($event.target.value, 'td-border')"
/>
</p>
@@ -175,15 +171,20 @@ const props = defineProps({
});
const emit = defineEmits(["close"]);
const { $copy, $clone, $empty, $store } = useNuxtApp();
var pagedata = $clone($store[props.pagename]);
let pagedata = $clone($store[props.pagename]);
if (!pagedata.tablesetting) {
pagedata.tablesetting = [];
}
if (!Array.isArray(pagedata.tablesetting)) {
pagedata.tablesetting = Object.values(pagedata.tablesetting);
}
const getDetail = (code) => tablesetting.find((v) => v.code === code)?.detail || "";
const errors = ref([]);
let radioNote = "no";
var tablesetting = pagedata.tablesetting;
let found = tablesetting.find((v) => v.code === "note");
if (found ? found.detail !== "@" : false) radioNote = "yes";
let found = getDetail("note");
if (found !== "@") radioNote = "yes";
function changeSetting(value, code) {
if (code === "note" && $empty(value)) return;