Commit 32749220 authored by Tình Trương's avatar Tình Trương

update

parent 37e665d2
...@@ -50,7 +50,7 @@ export enum ContactStatus { ...@@ -50,7 +50,7 @@ export enum ContactStatus {
inactive = 0, inactive = 0,
} }
export enum PolicyStatus { export enum ConfigSystemStatus {
active = 1, active = 1,
inactive = 0, inactive = 0,
} }
......
...@@ -474,6 +474,7 @@ export type ListConfigSystem = { ...@@ -474,6 +474,7 @@ export type ListConfigSystem = {
namePage: string; namePage: string;
title: string; title: string;
content: string; content: string;
url: string;
numIndex: number; numIndex: number;
status: number; status: number;
createTime?: string; createTime?: string;
...@@ -488,6 +489,7 @@ export type DetailConfigSystem = { ...@@ -488,6 +489,7 @@ export type DetailConfigSystem = {
title: string; title: string;
content: string; content: string;
numIndex: number; numIndex: number;
url: string;
status: number; status: number;
createTime?: string; createTime?: string;
createBy?: string; createBy?: string;
...@@ -501,6 +503,7 @@ export type UpdateConfigSystem = { ...@@ -501,6 +503,7 @@ export type UpdateConfigSystem = {
title: string; title: string;
content: string; content: string;
status: number; status: number;
url: string;
numIndex: number; numIndex: number;
createTime?: string; createTime?: string;
createBy?: string; createBy?: string;
...@@ -512,6 +515,7 @@ export type AddConfigSystem = { ...@@ -512,6 +515,7 @@ export type AddConfigSystem = {
namePage: string; namePage: string;
title: string; title: string;
content: string; content: string;
url: string;
numIndex: number; numIndex: number;
status: number; status: number;
}; };
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<q-form <q-form
greedy greedy
@submit.prevent=" @submit.prevent="
$emit('addUpdatePolicy', {}); $emit('addUpdateConfigSystem', {});
$emit('update:isOpened', false); $emit('update:isOpened', false);
" "
> >
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<q-item-section> <q-item-section>
<q-item-label class="text-h6 text-weight-regular">{{ <q-item-label class="text-h6 text-weight-regular">{{
isUpdate isUpdate
? $t('listPolicy.dialogLabel.titleAdd') ? $t('listConfigSystem.dialogLabel.titleAdd')
: $t('listPolicy.dialogLabel.titleUpdate') : $t('listConfigSystem.dialogLabel.titleUpdate')
}}</q-item-label> }}</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<q-input <q-input
:model-value="namePage" :model-value="namePage"
@update:model-value="$emit('update:namePage', $event)" @update:model-value="$emit('update:namePage', $event)"
:label="$t('listPolicy.dialogLabel.fieldLabels.namePage')" :label="$t('listConfigSystem.dialogLabel.fieldLabels.namePage')"
class="q-my-sm" class="q-my-sm"
type="text" type="text"
outlined outlined
...@@ -47,29 +47,39 @@ ...@@ -47,29 +47,39 @@
outlined outlined
clearable clearable
></q-input> ></q-input>
<div class="q-pt-sm q-pl-sm">
<span class="text-body1">{{
$t('listConfigSystem.dialogLabel.fieldLabels.status')
}}</span
><q-toggle
:model-value="status"
:true-value="ConfigSystemStatus.active"
:false-value="ConfigSystemStatus.inactive"
@update:model-value="$emit('update:status', $event)"
/>
</div>
</div> </div>
<div class="col-6"> <div class="col-6">
<q-input <q-input
:model-value="title" :model-value="title"
@update:model-value="$emit('update:title', $event)" @update:model-value="$emit('update:title', $event)"
:label="$t('listPolicy.dialogLabel.fieldLabels.title')" :label="$t('listConfigSystem.dialogLabel.fieldLabels.title')"
class="q-my-sm" class="q-my-sm"
type="text" type="text"
outlined outlined
:rules="titleRules" :rules="titleRules"
clearable clearable
></q-input> ></q-input>
<div class="q-pt-sm q-pl-sm"> <q-input
<span class="text-body1">{{ :model-value="url"
$t('listPolicy.dialogLabel.fieldLabels.status') @update:model-value="$emit('update:url', $event)"
}}</span :label="$t('listConfigSystem.dialogLabel.fieldLabels.url')"
><q-toggle class="q-my-sm"
:model-value="status" type="text"
:true-value="PolicyStatus.active" outlined
:false-value="PolicyStatus.inactive" :rules="urlRules"
@update:model-value="$emit('update:status', $event)" clearable
/> ></q-input>
</div>
</div> </div>
<div class="col-12"> <div class="col-12">
<div> <div>
...@@ -178,7 +188,7 @@ ...@@ -178,7 +188,7 @@
color="grey" color="grey"
no-caps no-caps
style="width: 90px" style="width: 90px"
:label="$t('listPolicy.crudActions.cancel')" :label="$t('listConfigSystem.crudActions.cancel')"
@click="$emit('update:isOpened', false)" @click="$emit('update:isOpened', false)"
/> />
<q-btn <q-btn
...@@ -186,7 +196,7 @@ ...@@ -186,7 +196,7 @@
color="primary" color="primary"
no-caps no-caps
style="width: 90px" style="width: 90px"
:label="$t('listPolicy.crudActions.save')" :label="$t('listConfigSystem.crudActions.save')"
/> />
</q-card-actions> </q-card-actions>
</q-form> </q-form>
...@@ -195,7 +205,7 @@ ...@@ -195,7 +205,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { PolicyStatus } from 'src/assets/enums'; import { ConfigSystemStatus } from 'src/assets/enums';
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { i18n } from 'src/boot/i18n'; import { i18n } from 'src/boot/i18n';
...@@ -208,6 +218,7 @@ export default defineComponent({ ...@@ -208,6 +218,7 @@ export default defineComponent({
isUpdate: { type: Boolean, default: false }, isUpdate: { type: Boolean, default: false },
namePage: { type: String, required: true }, namePage: { type: String, required: true },
title: { type: String, required: true }, title: { type: String, required: true },
url: { type: String, required: true },
numIndex: { type: Number, required: true }, numIndex: { type: Number, required: true },
content: { type: String, required: true }, content: { type: String, required: true },
status: { type: Number, required: true }, status: { type: Number, required: true },
...@@ -216,17 +227,23 @@ export default defineComponent({ ...@@ -216,17 +227,23 @@ export default defineComponent({
const namePageRules = [ const namePageRules = [
(val?: string) => (val?: string) =>
(val && val.trim().length) || (val && val.trim().length) ||
i18n.global.t('listPolicy.validateMessages.requireNamePage'), i18n.global.t('listConfigSystem.validateMessages.requireNamePage'),
]; ];
const titleRules = [ const titleRules = [
(val?: string) => (val?: string) =>
(val && val.trim().length) || (val && val.trim().length) ||
i18n.global.t('listPolicy.validateMessages.requireTitle'), i18n.global.t('listConfigSystem.validateMessages.requireTitle'),
];
const urlRules = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t('listConfigSystem.validateMessages.requireUrl'),
]; ];
return { return {
namePageRules, namePageRules,
titleRules, titleRules,
PolicyStatus, urlRules,
ConfigSystemStatus,
}; };
}, },
emits: [ emits: [
...@@ -234,10 +251,11 @@ export default defineComponent({ ...@@ -234,10 +251,11 @@ export default defineComponent({
'update:namePage', 'update:namePage',
'update:title', 'update:title',
'update:content', 'update:content',
'update:url',
'update:numIndex', 'update:numIndex',
'update:status', 'update:status',
'click:CloseBtn', 'click:CloseBtn',
'addUpdatePolicy', 'addUpdateConfigSystem',
], ],
}); });
</script> </script>
...@@ -959,33 +959,36 @@ export default { ...@@ -959,33 +959,36 @@ export default {
}, },
//Cấu hình chính sách //Cấu hình chính sách
listPolicy: { listConfigSystem: {
add: 'Thêm', add: 'Thêm',
toolTipMessageUpdate: 'Cập nhập', toolTipMessageUpdate: 'Cập nhập',
toolTipMessageDelete: 'Xóa', toolTipMessageDelete: 'Xóa',
title: 'Cấu hình Chính sách', title: 'Cấu hình hệ thống',
titleColumnsTable: { titleColumnsTable: {
stt: 'STT', stt: 'STT',
namePage: 'Tên chính sách', namePage: 'Tên cấu hình',
title: 'Tiêu đề', title: 'Tiêu đề',
url: 'Url target',
content: 'Nội dung', content: 'Nội dung',
numIndex: 'Vị trí', numIndex: 'Vị trí',
status: 'Trạng thái', status: 'Trạng thái',
action: 'Chức năng', action: 'Chức năng',
}, },
dialogLabel: { dialogLabel: {
titleAdd: 'Thêm Chính sách', titleAdd: 'Thêm Cấu hình',
titleUpdate: 'Cập nhập Chính sách', titleUpdate: 'Cập nhập Cấu hình',
fieldLabels: { fieldLabels: {
namePage: 'Tên chính sách *', namePage: 'Tên cấu hình *',
title: 'Tiêu đề *', title: 'Tiêu đề *',
url: 'Url target *',
numIndex: 'Vị trí', numIndex: 'Vị trí',
status: 'Trạng thái', status: 'Trạng thái',
}, },
}, },
validateMessages: { validateMessages: {
requireNamePage: 'Vui lòng nhập Tên chính sách', requireNamePage: 'Vui lòng nhập Tên Cấu hình',
requireTitle: 'Vui lòng nhập Tiêu đề', requireTitle: 'Vui lòng nhập Tiêu đề',
requireUrl: 'Vui lòng nhập Url target',
}, },
crudActions: { crudActions: {
save: 'Lưu', save: 'Lưu',
...@@ -997,13 +1000,13 @@ export default { ...@@ -997,13 +1000,13 @@ export default {
}, },
confirmActionsTitle: { confirmActionsTitle: {
confirmDelete: 'Xác nhận', confirmDelete: 'Xác nhận',
confirmDeleteContent: 'Bạn có chắc muốn xoá Menu này không?', confirmDeleteContent: 'Bạn có chắc muốn xoá Cấu hình này không?',
confirmDeleteCancelBtnLabel: 'Huỷ', confirmDeleteCancelBtnLabel: 'Huỷ',
}, },
actionMessages: { actionMessages: {
addSuccess: 'Thêm Menu thành công', addSuccess: 'Thêm Cấu hình thành công',
updateSuccess: 'Cập nhập Menu thành công', updateSuccess: 'Cập nhập Cấu hình thành công',
deleteSuccess: 'Xóa Menu thành công', deleteSuccess: 'Xóa Cấu hình thành công',
}, },
}, },
......
...@@ -19,7 +19,7 @@ export enum Pages { ...@@ -19,7 +19,7 @@ export enum Pages {
menu = 'menu', menu = 'menu',
listBooking = 'danh-sach-booking', listBooking = 'danh-sach-booking',
work = 'cong-viec', work = 'cong-viec',
policy = 'cau-hinh-chinh-sach', configSystem = 'cau-hinh-he-thong',
news = 'cau-hinh-tin-tuc', news = 'cau-hinh-tin-tuc',
hotProduct = 'cau-hinh-san-pham-noi-bat', hotProduct = 'cau-hinh-san-pham-noi-bat',
} }
...@@ -120,9 +120,9 @@ const routes: RouteRecordRaw[] = [ ...@@ -120,9 +120,9 @@ const routes: RouteRecordRaw[] = [
name: Pages.work, name: Pages.work,
}, },
{ {
path: 'cau-hinh-chinh-sach', path: 'cau-hinh-he-thong',
component: () => import('pages/cau-hinh-chinh-sach/index.vue'), component: () => import('pages/cau-hinh-he-thong/index.vue'),
name: Pages.policy, name: Pages.configSystem,
}, },
{ {
path: 'cau-hinh-tin-tuc', path: 'cau-hinh-tin-tuc',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment