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

update fix-bug

parent df9411ae
<template>
<div
class="row q-col-gutter-sm flex-center"
style="max-height: calc(100vh - 14rem)"
>
<q-space></q-space>
<div class="col-auto">
<q-btn
@click="$emit('click:addAccountGroup')"
color="primary"
no-caps
style="width: 100px"
:label="$t('crudActions.add')"
>
</q-btn>
</div>
<div class="col-12 q-mt-sm">
<q-table
:rows="dataAccountGroup"
:columns="userTableColumnsAccountGroup"
:no-data-label="$t('emptyData')"
row-key="name"
separator="cell"
hide-pagination
>
<template v-slot:body-cell-stt="item">
<q-td :item="item">
{{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
</q-td>
</template>
</q-table>
</div>
<div class="col-12 q-mt-sm">
<Pagination
v-model:currentPage="pageIndex"
v-model:pageSize="pageSize"
:totalPage="totalPage"
@update:pageSize="changePageSize"
@update:currentPage="getListAccountGroup"
/>
</div>
</div>
</template>
<script lang="ts">
import { i18n } from 'src/boot/i18n';
import { defineComponent, onMounted, Ref, ref } from 'vue';
import Pagination from 'components/pagination/index.vue';
export default defineComponent({
components: {
Pagination,
},
setup() {
const userTableColumnsAccountGroup = [
{
name: 'STT',
required: true,
label: 'STT',
align: 'center',
sortable: false,
},
{
name: 'fullName',
field: 'fullName',
required: true,
label: i18n.global.t('userGroupPage.groupInfo.fieldLabels.fullName'),
align: 'center',
sortable: false,
},
{
name: 'user',
field: 'user',
required: true,
label: i18n.global.t('userGroupPage.groupInfo.fieldLabels.user'),
align: 'center',
sortable: false,
},
{
name: 'user',
field: 'user',
required: true,
label: i18n.global.t('userGroupPage.groupInfo.fieldLabels.position'),
align: 'center',
sortable: false,
},
];
const pageIndex = ref(1);
const pageSize = ref(20);
const totalPage = ref(0);
const dataAccountGroup: Ref<unknown[]> = ref([]);
const changePageSize = () => {
pageIndex.value = 1;
void getListAccountGroup();
};
const getListAccountGroup = () => {
console.log();
};
onMounted(() => {
void getListAccountGroup();
});
return {
userTableColumnsAccountGroup,
dataAccountGroup,
pageIndex,
pageSize,
totalPage,
changePageSize,
getListAccountGroup,
};
},
});
</script>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:model-value="isOpened" :model-value="isOpened"
@update:model-value="$emit('update:isOpened', $event)" @update:model-value="$emit('update:isOpened', $event)"
> >
<q-card class="full-width" style="max-width: 30rem" bordered> <q-card class="full-width" style="max-width: 40rem" bordered>
<q-form <q-form
greedy greedy
@submit.prevent=" @submit.prevent="
......
...@@ -20,12 +20,9 @@ ...@@ -20,12 +20,9 @@
<q-card-section> <q-card-section>
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12"> <div class="col-12">
<q-card flat style="max-height: 200px" v-if="urlFileLocal"> <q-card flat v-if="urlFileLocal">
<div align="center"> <div align="center">
<q-img <q-img :src="urlFileLocal" style="aspect-ratio: 16/9">
:src="urlFileLocal"
style="max-height: 200px; aspect-ratio: 16/9"
>
</q-img> </q-img>
</div> </div>
</q-card> </q-card>
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
<q-card-section> <q-card-section>
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12"> <div class="col-12">
<q-card flat style="max-height: 200px" v-if="urlFileLocal"> <q-card flat v-if="urlFileLocal">
<div align="center"> <div align="center">
<q-img <q-img
:src="imageAPI ? imageAPI : urlFileLocal" :src="imageAPI ? imageAPI : urlFileLocal"
style="max-height: 200px; aspect-ratio: 16/9" style="aspect-ratio: 16/9"
> >
</q-img> </q-img>
</div> </div>
......
...@@ -33,7 +33,7 @@ export default defineComponent({ ...@@ -33,7 +33,7 @@ export default defineComponent({
cardNumber.value = ''; cardNumber.value = '';
bank.value = null; bank.value = null;
cardType.value = null; cardType.value = null;
isDefault.value = 2; isDefault.value = 1;
} }
} }
); );
......
...@@ -45,10 +45,8 @@ ...@@ -45,10 +45,8 @@
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-STT="item"> <template v-slot:body-cell-STT="item">
<q-td style="padding: 0; height: 100%"> <q-td :item="item" style="text-align: center">
<div align="center"> {{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
{{ item.rowIndex + 1 }}
</div>
</q-td> </q-td>
</template> </template>
...@@ -77,15 +75,17 @@ ...@@ -77,15 +75,17 @@
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-imageUrl="rowData"> <template v-slot:body-cell-imageUrl="rowData">
<q-td style="padding: 0; height: 100%"> <q-td style="padding: auto; height: 100%">
<div align="center"> <div align="center">
<q-img <q-img
fit="contain"
:ratio="16 / 9"
style="width: 9rem"
:src=" :src="
rowData.row.file === undefined rowData.row.file === undefined
? configImg.API_IMAGE_ENDPOINT + rowData.value ? configImg.API_IMAGE_ENDPOINT + rowData.value
: rowData.value : rowData.value
" "
style="max-width: 70px"
></q-img> ></q-img>
</div> </div>
</q-td> </q-td>
......
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
<q-form greedy @submit.prevent="$emit('saveGroupInfo', isDisable)"> <q-form greedy @submit.prevent="$emit('saveGroupInfo', isDisable)">
<q-card-section style="padding-top: 28px"> <q-card-section style="padding-top: 28px">
<div class="row"> <div class="row">
<div class="col-4" style="display: flex"> <div class="col-12" style="display: flex; justify-content: flex-end">
<div class="text-h6">{{ $t('userGroupPage.groupInfo.title') }}</div>
</div>
<div class="col-8" style="display: flex; justify-content: flex-end">
<q-btn <q-btn
v-if="isDisable === EditMode.edit" v-if="isDisable === EditMode.edit"
style="margin-right: 8px" style="margin-right: 8px"
......
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
title: 'Nhóm người dùng', title: 'Nhóm người dùng',
groupInfo: { groupInfo: {
title: 'Thông tin nhóm', title: 'Thông tin nhóm',
accountGroup: 'Tài khoản nhóm',
validateMessages: { validateMessages: {
requireGroupName: 'Vui lòng nhập Tên nhóm người dùng', requireGroupName: 'Vui lòng nhập Tên nhóm người dùng',
groupNameLengthInvalid: groupNameLengthInvalid:
...@@ -54,6 +55,9 @@ export default { ...@@ -54,6 +55,9 @@ export default {
fieldLabels: { fieldLabels: {
groupName: 'Tên nhóm người dùng *', groupName: 'Tên nhóm người dùng *',
groupDescription: 'Mô tả *', groupDescription: 'Mô tả *',
fullName: 'Họ tên',
user: 'Tên đăng nhập',
position: 'Chức vụ',
}, },
}, },
...@@ -655,7 +659,7 @@ export default { ...@@ -655,7 +659,7 @@ export default {
tableColumnsPost: { tableColumnsPost: {
stt: 'STT', stt: 'STT',
name: 'Tên bài viết', name: 'Tên bài viết',
image: 'Avatar', image: 'Ảnh bài viết',
category: 'Danh mục bài viết', category: 'Danh mục bài viết',
createBy: 'Người thêm', createBy: 'Người thêm',
createTime: 'Thời gian thêm', createTime: 'Thời gian thêm',
...@@ -675,7 +679,7 @@ export default { ...@@ -675,7 +679,7 @@ export default {
}, },
postLabels: { postLabels: {
name: 'Tên bài viết *', name: 'Tên bài viết *',
image: 'Avatar *', image: 'Ảnh bài viết *',
category: 'Danh mục bài viết *', category: 'Danh mục bài viết *',
content: 'Nội dung *', content: 'Nội dung *',
status: 'Trạng thái', status: 'Trạng thái',
...@@ -691,7 +695,7 @@ export default { ...@@ -691,7 +695,7 @@ export default {
}, },
validateMessages: { validateMessages: {
requireName: 'Vui lòng nhập Tên bài viết', requireName: 'Vui lòng nhập Tên bài viết',
requireImage: 'Vui lòng chọn Avatar', requireImage: 'Vui lòng chọn Ảnh bài viết',
requireContent: 'Vui lòng nhập Nội dung', requireContent: 'Vui lòng nhập Nội dung',
requireCategory: 'Vui lòng chọn Danh mục bài viết', requireCategory: 'Vui lòng chọn Danh mục bài viết',
}, },
......
...@@ -45,13 +45,11 @@ ...@@ -45,13 +45,11 @@
hide-pagination hide-pagination
class="sticky-header-table" class="sticky-header-table"
> >
<!-- <template v-slot:body-cell-STT="item"> <template v-slot:body-cell-stt="item">
<q-td style="padding: 0; height: 100%"> <q-td :item="item" style="text-align: center">
<div align="center"> {{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
{{ item.rowIndex + 1 }}
</div>
</q-td> </q-td>
</template> --> </template>
<template v-slot:body-cell-action="item"> <template v-slot:body-cell-action="item">
<q-td style="padding: 0"> <q-td style="padding: 0">
<div align="center"> <div align="center">
...@@ -185,14 +183,14 @@ export default defineComponent({ ...@@ -185,14 +183,14 @@ export default defineComponent({
}, },
setup() { setup() {
const postTableColumns = [ const postTableColumns = [
// { {
// name: 'STT', name: 'stt',
// field: 'STT', field: 'stt',
// required: true, required: true,
// label: 'STT', label: 'STT',
// align: 'center', align: 'center',
// sortable: false, sortable: false,
// }, },
{ {
name: 'name', name: 'name',
field: 'name', field: 'name',
......
...@@ -69,12 +69,12 @@ ...@@ -69,12 +69,12 @@
class="sticky-header-table" class="sticky-header-table"
> >
<template v-slot:body-cell-stt="item"> <template v-slot:body-cell-stt="item">
<q-td :item="item"> <q-td :item="item" style="text-align: center">
{{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }} {{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-action="item"> <template v-slot:body-cell-action="item">
<q-td style="padding: 0" class="flex flex-center"> <q-td style="padding: 0; text-align: center">
<q-btn <q-btn
flat flat
round round
......
...@@ -72,12 +72,12 @@ ...@@ -72,12 +72,12 @@
class="sticky-header-table" class="sticky-header-table"
> >
<template v-slot:body-cell-stt="item"> <template v-slot:body-cell-stt="item">
<q-td :item="item"> <q-td :item="item" style="text-align: center">
{{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }} {{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-action="rowData"> <template v-slot:body-cell-action="rowData">
<q-td style="padding: 0" class="flex flex-center"> <q-td style="padding: 0; text-align: center">
<q-btn <q-btn
flat flat
round round
......
...@@ -43,10 +43,11 @@ ...@@ -43,10 +43,11 @@
separator="cell" separator="cell"
:no-data-label="$t('emptyData')" :no-data-label="$t('emptyData')"
hide-pagination hide-pagination
wrap-cells
class="sticky-header-table" class="sticky-header-table"
> >
<template v-slot:body-cell-action="item"> <template v-slot:body-cell-action="item">
<q-td style="padding: 0" class="flex flex-center"> <q-td style="padding: 0; text-align: center">
<q-btn <q-btn
flat flat
round round
...@@ -71,6 +72,16 @@ ...@@ -71,6 +72,16 @@
</q-btn> </q-btn>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-description="item">
<td>
<div class="ellipsis-3-lines">
{{ !item.row.description ? '' : item.row.description }}
<q-tooltip :offset="[20, 10]" max-width="35%">{{
!item.row.description ? '' : item.row.description
}}</q-tooltip>
</div>
</td>
</template>
<template v-slot:body-cell-status="rowData"> <template v-slot:body-cell-status="rowData">
<q-td> <q-td>
<div align="center"> <div align="center">
...@@ -143,7 +154,7 @@ export default defineComponent({ ...@@ -143,7 +154,7 @@ export default defineComponent({
field: 'name', field: 'name',
required: true, required: true,
label: i18n.global.t('field.tableColumnsField.name'), label: i18n.global.t('field.tableColumnsField.name'),
headerStyle: 'text-align: center !important;', headerStyle: 'text-align: center !important; width: 20%',
align: 'left', align: 'left',
sortable: false, sortable: false,
}, },
...@@ -152,8 +163,9 @@ export default defineComponent({ ...@@ -152,8 +163,9 @@ export default defineComponent({
field: 'description', field: 'description',
required: true, required: true,
label: i18n.global.t('field.tableColumnsField.description'), label: i18n.global.t('field.tableColumnsField.description'),
headerStyle: 'text-align: center !important;', headerStyle: 'text-align: center !important; width: 40%',
align: 'left', align: 'left',
width: '300px',
sortable: false, sortable: false,
}, },
{ {
...@@ -161,8 +173,9 @@ export default defineComponent({ ...@@ -161,8 +173,9 @@ export default defineComponent({
field: 'status', field: 'status',
required: true, required: true,
label: i18n.global.t('field.tableColumnsField.status'), label: i18n.global.t('field.tableColumnsField.status'),
headerStyle: 'text-align: center !important;', headerStyle: 'text-align: center !important; width: 15%',
align: 'center', align: 'center',
width: '120px',
sortable: false, sortable: false,
}, },
{ {
...@@ -170,8 +183,9 @@ export default defineComponent({ ...@@ -170,8 +183,9 @@ export default defineComponent({
field: 'action', field: 'action',
required: true, required: true,
label: i18n.global.t('field.tableColumnsField.action'), label: i18n.global.t('field.tableColumnsField.action'),
headerStyle: 'text-align: center !important;', headerStyle: 'text-align: center !important; width: 15%',
align: 'center', align: 'center',
width: '120px',
sortable: false, sortable: false,
}, },
]; ];
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
<q-btn <q-btn
color="primary" color="primary"
no-caps no-caps
style="width: 7.14rem"
:label="$t('crudActions.search')" :label="$t('crudActions.search')"
@click="getListArtists" @click="getListArtists"
> >
...@@ -58,8 +59,10 @@ ...@@ -58,8 +59,10 @@
</div> </div>
<div class="col-auto"> <div class="col-auto">
<q-btn <q-btn
class="q-mr-md"
color="primary" color="primary"
no-caps no-caps
style="width: 7.14rem"
:label="$t('crudActions.add')" :label="$t('crudActions.add')"
to="/nghe-sy/them-nghe-sy" to="/nghe-sy/them-nghe-sy"
></q-btn> ></q-btn>
...@@ -81,12 +84,12 @@ ...@@ -81,12 +84,12 @@
class="sticky-header-table" class="sticky-header-table"
> >
<template v-slot:body-cell-stt="item"> <template v-slot:body-cell-stt="item">
<q-td :item="item"> <q-td :item="item" style="text-align: center">
{{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }} {{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-avatar="avatar"> <template v-slot:body-cell-avatar="avatar">
<q-td style="padding: 0; height: 100%" class="flex flex-center"> <q-td style="padding: 0; height: 100%; text-align: center">
<q-img <q-img
style="width: 7rem; height: 5rem" style="width: 7rem; height: 5rem"
fit="contain" fit="contain"
......
...@@ -2,6 +2,7 @@ import { defineComponent, onMounted, Ref, ref } from 'vue'; ...@@ -2,6 +2,7 @@ import { defineComponent, onMounted, Ref, ref } from 'vue';
import { StateInterface, useStore } from 'src/store'; import { StateInterface, useStore } from 'src/store';
import UserGroupComponent from '../../components/user-group/index.vue'; import UserGroupComponent from '../../components/user-group/index.vue';
import GroupInfoComponent from '../../components/group-info/index.vue'; import GroupInfoComponent from '../../components/group-info/index.vue';
import accountGroup from '../../components/accountGroup/index.vue';
import { AxiosResponse } from 'axios'; import { AxiosResponse } from 'axios';
import { api, BaseResponseBody } from 'src/boot/axios'; import { api, BaseResponseBody } from 'src/boot/axios';
import { EditMode } from 'src/assets/enums'; import { EditMode } from 'src/assets/enums';
...@@ -20,7 +21,7 @@ export type GroupInfoType = { ...@@ -20,7 +21,7 @@ export type GroupInfoType = {
updateBy: null | string; updateBy: null | string;
updateTime: null | string; updateTime: null | string;
}; };
const tab = ref('inforGroup');
const userList: Ref<GroupInfoType[]> = ref([]); const userList: Ref<GroupInfoType[]> = ref([]);
const isDisable = ref(EditMode.default); const isDisable = ref(EditMode.default);
const groupName = ref(''); const groupName = ref('');
...@@ -226,7 +227,7 @@ const getGroupDetail = async () => { ...@@ -226,7 +227,7 @@ const getGroupDetail = async () => {
}; };
export default defineComponent({ export default defineComponent({
components: { UserGroupComponent, GroupInfoComponent }, components: { UserGroupComponent, GroupInfoComponent, accountGroup },
watch: { watch: {
selectedPageRoles() { selectedPageRoles() {
// console.log(value); // console.log(value);
...@@ -256,6 +257,7 @@ export default defineComponent({ ...@@ -256,6 +257,7 @@ export default defineComponent({
saveGroupInfo, saveGroupInfo,
confirmDeleteGroup, confirmDeleteGroup,
selectedPageRoles, selectedPageRoles,
tab,
}; };
}, },
}); });
...@@ -10,19 +10,45 @@ ...@@ -10,19 +10,45 @@
></UserGroupComponent> ></UserGroupComponent>
</div> </div>
<div class="col-8"> <div class="col-8">
<GroupInfoComponent <q-tabs
:is-disable="isDisable" v-model="tab"
v-model:group-name="groupName" dense
v-model:group-description="groupDescription" class="text-grey"
v-model:selectedPageRoles="selectedPageRoles" active-color="primary"
@resetGroupInfo="changeValueIsDisable" indicator-color="primary"
@saveGroupInfo="saveGroupInfo($store)" align="justify"
@deleteGroup="confirmDeleteGroup($store)" narrow-indicator
></GroupInfoComponent> >
<q-tab
no-caps
name="inforGroup"
:label="$t('userGroupPage.groupInfo.title')"
>
</q-tab>
<q-tab
no-caps
name="accountGroup"
:label="$t('userGroupPage.groupInfo.accountGroup')"
/>
</q-tabs>
<q-separator />
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="inforGroup">
<GroupInfoComponent
:is-disable="isDisable"
v-model:group-name="groupName"
v-model:group-description="groupDescription"
v-model:selectedPageRoles="selectedPageRoles"
@resetGroupInfo="changeValueIsDisable"
@saveGroupInfo="saveGroupInfo($store)"
@deleteGroup="confirmDeleteGroup($store)"
></GroupInfoComponent>
</q-tab-panel>
<q-tab-panel name="accountGroup">
<accountGroup></accountGroup>
</q-tab-panel>
</q-tab-panels>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts" src="./UserGroup.ts"> <script lang="ts" src="./UserGroup.ts"></script>
// import { UserGroup } from './UserGroup';
// export default UserGroup;
</script>
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