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

update

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