changes
This commit is contained in:
@@ -259,11 +259,11 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div v-if="currentTab === 'detail'">
|
||||
<div class="fs-14 mt-3 is-flex is-gap-0.5 is-align-items-center">
|
||||
<p class="font-semibold">Tên trường:</p>
|
||||
<p>{{ currentField.name }}</p>
|
||||
<p class="field fs-14 is-flex is-gap-0.5 is-align-items-center">
|
||||
<span class="font-semibold">Tên trường:</span>
|
||||
<span>{{ currentField.name }}</span>
|
||||
<button
|
||||
class="button is-white is-small"
|
||||
class="button is-small size-8 is-primary is-light is-rounded"
|
||||
@click="copyContent(currentField.name)"
|
||||
>
|
||||
<span class="icon">
|
||||
@@ -273,38 +273,42 @@
|
||||
/>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<label class="label fs-14 mt-3">Mô tả<span class="has-text-danger"> *</span></label>
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded">
|
||||
<input
|
||||
class="input fs-14 h-full"
|
||||
type="text"
|
||||
@change="changeLabel($event.target.value)"
|
||||
v-model="label"
|
||||
/>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button h-full"
|
||||
@click="editLabel()"
|
||||
>
|
||||
<span class="icon">
|
||||
<Icon
|
||||
name="material-symbols:edit-outline-rounded"
|
||||
:size="18"
|
||||
/>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<p
|
||||
v-if="errors.find((v) => v.name === 'label')"
|
||||
class="help is-danger"
|
||||
>
|
||||
{{ errors.find((v) => v.name === "label").msg }}
|
||||
</p>
|
||||
<div class="field mt-3">
|
||||
<div class="field">
|
||||
<label class="label fs-14">Mô tả<span class="has-text-danger"> *</span></label>
|
||||
<div class="control">
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded">
|
||||
<input
|
||||
class="input fs-14 h-full"
|
||||
type="text"
|
||||
@change="changeLabel($event.target.value)"
|
||||
v-model="label"
|
||||
/>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button h-full"
|
||||
@click="editLabel()"
|
||||
>
|
||||
<span class="icon">
|
||||
<Icon
|
||||
name="material-symbols:edit-outline-rounded"
|
||||
:size="18"
|
||||
/>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p
|
||||
v-if="errors.find((v) => v.name === 'label')"
|
||||
class="help is-danger"
|
||||
>
|
||||
{{ errors.find((v) => v.name === "label").msg }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label fs-14">Kiểu dữ liệu<span class="has-text-danger"> * </span></label>
|
||||
<div class="control fs-14">
|
||||
<button
|
||||
@@ -365,36 +369,34 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field is-horizontal mt-3">
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<label class="label fs-14">Định dạng nâng cao</label>
|
||||
<div class="control">
|
||||
<button
|
||||
v-for="v in colorchoice.filter((v) => v.code !== 'condition')"
|
||||
@click="changeTemplate(v)"
|
||||
class="button is-white fs-14"
|
||||
>
|
||||
<span class="icon">
|
||||
<Icon
|
||||
:name="
|
||||
radioTemplate === v.code
|
||||
? 'material-symbols:radio-button-checked-outline'
|
||||
: 'material-symbols:radio-button-unchecked'
|
||||
"
|
||||
:size="22"
|
||||
/>
|
||||
</span>
|
||||
<span>{{ v.name }}</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="radioTemplate === 'option'"
|
||||
class="button is-primary is-light fs-14 ml-2"
|
||||
@click="showSidebar()"
|
||||
>
|
||||
{{ currentField.template ? "Sửa" : "Tạo" }} định dạng
|
||||
</button>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="field">
|
||||
<label class="label fs-14">Định dạng nâng cao</label>
|
||||
<div class="control">
|
||||
<button
|
||||
v-for="v in colorchoice.filter((v) => v.code !== 'condition')"
|
||||
@click="changeTemplate(v)"
|
||||
class="button is-white fs-14"
|
||||
>
|
||||
<span class="icon">
|
||||
<Icon
|
||||
:name="
|
||||
radioTemplate === v.code
|
||||
? 'material-symbols:radio-button-checked-outline'
|
||||
: 'material-symbols:radio-button-unchecked'
|
||||
"
|
||||
:size="22"
|
||||
/>
|
||||
</span>
|
||||
<span>{{ v.name }}</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="radioTemplate === 'option'"
|
||||
class="button is-primary is-light fs-14 ml-2"
|
||||
@click="showSidebar()"
|
||||
>
|
||||
{{ currentField.template ? "Sửa" : "Tạo" }} định dạng
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
v-if="array || !enableTime"
|
||||
v-if="timeRanges || !enableTime"
|
||||
class="has-text-primary fixed-grid has-12-cols"
|
||||
style="border-bottom: 2px solid var(--bulma-grey-80)"
|
||||
>
|
||||
@@ -8,61 +8,62 @@
|
||||
<div
|
||||
v-if="enableTime"
|
||||
class="cell is-col-span-7 is-flex is-align-items-center is-flex-wrap-wrap"
|
||||
style="row-gap: 0; column-gap: 1rem"
|
||||
style="gap: 0.5rem 1rem"
|
||||
>
|
||||
<Caption
|
||||
:title="lang === 'vi' ? 'Thời gian' : 'Time'"
|
||||
type="has-text-orange"
|
||||
/>
|
||||
<div
|
||||
v-for="v in array"
|
||||
v-for="v in timeRanges"
|
||||
:key="v.code"
|
||||
:class="['is-flex is-align-items-center', v.code !== current && 'is-clickable']"
|
||||
style="gap: 0.35rem"
|
||||
@click="v.code !== current && changeOption(v)"
|
||||
>
|
||||
<span
|
||||
v-if="v.code === current"
|
||||
class="icon-text is-flex-wrap-nowrap font-semibold has-text-orange"
|
||||
>
|
||||
<span class="icon">
|
||||
<Icon
|
||||
name="material-symbols:check-rounded"
|
||||
:size="22"
|
||||
/>
|
||||
</span>
|
||||
<span style="text-wrap: nowrap">{{ v.name }}</span>
|
||||
</span>
|
||||
<span
|
||||
v-else
|
||||
class="icon-text font-semibold has-text-grey is-clickable"
|
||||
:class="v.code === current ? 'font-bold has-text-orange' : 'font-medium has-text-grey-50'"
|
||||
style="text-wrap: nowrap"
|
||||
@click="changeOption(v)"
|
||||
>
|
||||
{{ v.name }}
|
||||
</span>
|
||||
<span
|
||||
:class="[
|
||||
'tag rounded-md w-5 h-6 fs-13',
|
||||
v.code === current
|
||||
? 'font-bold has-text-orange has-background-orange-90'
|
||||
: 'font-medium has-text-grey-40 has-background-grey-90',
|
||||
]"
|
||||
>{{ v.count }}</span
|
||||
>
|
||||
</div>
|
||||
<span
|
||||
v-if="newDataAvailable"
|
||||
class="has-text-danger is-italic fs-14 ml-2"
|
||||
class="has-text-danger-50 px-3 py-1.5 has-background-danger-95 rounded-md is-italic fs-14"
|
||||
>Có dữ liệu mới, vui lòng làm mới.</span
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="cell is-col-span-5 is-flex is-align-items-center is-flex-wrap-wrap"
|
||||
style="row-gap: 0; column-gap: 1rem"
|
||||
style="gap: 0.25rem 0.5rem"
|
||||
>
|
||||
<Caption
|
||||
:title="lang === 'vi' ? `Tìm ${viewport === 1 ? '' : 'kiếm'}` : 'Search'"
|
||||
:title="lang === 'vi' ? `Tìm ${this.store.viewport > 2 ? 'kiếm' : ''}` : 'Search'"
|
||||
type="has-text-orange"
|
||||
/>
|
||||
<input
|
||||
class="input is-small is-orange"
|
||||
id="input"
|
||||
type="text"
|
||||
v-model="text"
|
||||
:style="`${viewport === 1 ? 'width:150px;' : ''} border: 1px solid var(--bulma-grey-80); max-width: 160px`"
|
||||
@keyup="startSearch"
|
||||
id="input"
|
||||
:placeholder="lang === 'vi' ? 'Nhập từ khóa...' : 'Enter keyword...'"
|
||||
class="input is-orange fs-12"
|
||||
:style="{
|
||||
maxWidth: '180px',
|
||||
width: this.store.viewport === 1 ? '150px' : 'auto',
|
||||
}"
|
||||
/>
|
||||
<div class="field has-addons is-flex is-flex-wrap-wrap is-gap-0 is-align-items-center">
|
||||
<div class="field has-addons is-flex-wrap-wrap is-align-items-center">
|
||||
<p
|
||||
v-if="importdata && $getEditRights()"
|
||||
class="control"
|
||||
@@ -174,14 +175,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{ code: 0, name: this.lang === "vi" ? "Hôm nay" : "Today" },
|
||||
{ code: 0, name: this.store.lang === "vi" ? "Hôm nay" : "Today" },
|
||||
{ code: 1, name: "1D" },
|
||||
{ code: 7, name: "7D" },
|
||||
{ code: 30, name: "1M" },
|
||||
{ code: 90, name: "3M" },
|
||||
{ code: 180, name: "6M" },
|
||||
{ code: 360, name: "1Y" },
|
||||
{ code: 36000, name: this.lang === "vi" ? "Tất cả" : "All" },
|
||||
{ code: 36000, name: this.store.lang === "vi" ? "Tất cả" : "All" },
|
||||
],
|
||||
showmodal: undefined,
|
||||
current: 7,
|
||||
@@ -189,11 +190,10 @@ export default {
|
||||
timer: undefined,
|
||||
text: undefined,
|
||||
status: [{ code: 100, name: "Chọn" }],
|
||||
array: undefined,
|
||||
timeRanges: undefined,
|
||||
enableAdd: true,
|
||||
enableTime: true,
|
||||
choices: [], // Sẽ được cập nhật động từ pagedata
|
||||
viewport: this.store.viewport,
|
||||
pagedata: undefined,
|
||||
loading: false,
|
||||
pollingInterval: null,
|
||||
@@ -202,7 +202,7 @@ export default {
|
||||
},
|
||||
|
||||
watch: {
|
||||
pagename(newVal) {
|
||||
pagename() {
|
||||
this.updateSearchableFields();
|
||||
},
|
||||
},
|
||||
@@ -211,7 +211,7 @@ export default {
|
||||
// Cập nhật searchable fields ngay từ đầu
|
||||
this.updateSearchableFields();
|
||||
|
||||
if (this.viewport < 5) {
|
||||
if (this.store.viewport < 5) {
|
||||
this.options = [
|
||||
{ code: 0, name: "Hôm nay" },
|
||||
{ code: 1, name: "1D" },
|
||||
@@ -230,7 +230,7 @@ export default {
|
||||
|
||||
let filter = this.$copy(this.filter);
|
||||
if (filter) {
|
||||
//dynamic parameter
|
||||
// dynamic parameter
|
||||
for (const [key, value] of Object.entries(filter)) {
|
||||
if (value.toString().indexOf("$") >= 0) {
|
||||
filter[key] = this.store[value.replace("$", "")].id;
|
||||
@@ -255,7 +255,7 @@ export default {
|
||||
|
||||
let f = {};
|
||||
this.options.map((v) => {
|
||||
f[`${v.code}`] = {
|
||||
f[v.code] = {
|
||||
type: "Count",
|
||||
field: "create_time__date",
|
||||
filter: v.filter,
|
||||
@@ -268,16 +268,16 @@ export default {
|
||||
try {
|
||||
let rs = await this.$getapi([found]);
|
||||
for (const [key, value] of Object.entries(rs[0].data.rows)) {
|
||||
let found = this.$find(this.options, { code: Number(key) });
|
||||
const found = this.$find(this.options, { code: Number(key) });
|
||||
if (found) {
|
||||
found.name = `${found.name} (${value})`;
|
||||
found.count = value;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
}
|
||||
|
||||
this.array = this.$copy(this.options);
|
||||
this.timeRanges = this.$copy(this.options);
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@@ -380,7 +380,7 @@ export default {
|
||||
this.text = undefined;
|
||||
this.search = undefined;
|
||||
}
|
||||
this.$emit("option", this.$find(this.array, { code: this.current }));
|
||||
this.$emit("option", this.$find(this.timeRanges, { code: this.current }));
|
||||
},
|
||||
|
||||
doSearch() {
|
||||
|
||||
Reference in New Issue
Block a user