Commit 739bb781 authored by hong-IT-99's avatar hong-IT-99

update code

parent 8c0b7d62
This source diff could not be displayed because it is too large. You can view the blob instead.
import { defineComponent } from 'vue';
// import { i18n } from 'src/boot/i18n';
// import { isEmail } from '../../../boot/functions';
// import { isMobilePhone } from '../../../boot/functions';
export default defineComponent({
props: {
openAddHotProduct: {
type: Boolean,
requied: true
},
status: { type: Boolean || Number, required: false },
},
setup() {
return {
};
},
emits: [
'update:openAddHotProduct',
'update:status',
'click:CloseBtnAddHotProduct'
],
});
<template>
<q-dialog
persistent
:model-value="openAddHotProduct"
@update:model-value="$emit('update:openAddHotProduct', $event)"
>
<q-card style="min-width: 700px" bordered>
<q-form greedy >
<q-card-section>
<q-item>
<q-item-section>
<q-item-label class="text-h6 text-weight-regular">{{
$t('artist.dialogLabel.title.addHotProduct')
}}</q-item-label>
</q-item-section>
</q-item>
</q-card-section>
<q-separator />
<q-card-section>
<div class="row q-col-gutter-sm">
<div class="col-12">
<q-input
:label="
$t('artist.artistInformation.titleDataField.artistCode')
"
type="text"
class="q-my-sm"
outlined
hide-bottom-space
clearable
></q-input>
<q-input
:label="$t('artist.artistInformation.titleDataField.fullName')"
hide-bottom-space
type="text"
class="q-my-sm"
outlined
clearable
></q-input>
<q-input
:label="
$t('artist.artistInformation.titleDataField.artistName')
"
type="text"
class="q-my-sm"
outlined
hide-bottom-space
clearable
></q-input>
<q-input
:label="$t('artist.artistInformation.titleDataField.birthday')"
type="text"
class="q-my-sm"
outlined
hide-bottom-space
clearable
></q-input>
<q-input
:label="$t('artist.artistInformation.titleDataField.email')"
type="text"
class="q-my-sm"
outlined
hide-bottom-space
clearable
></q-input>
</div>
<div style="padding-top: 13px; padding-left: 12px">
<span class="text-body1">{{
$t('userPage.dialogLabel.fieldLabels.status')
}}</span
>
<q-toggle
:model-value="status"
/>
</div>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
color="grey"
no-caps
style="width: 90px"
:label="$t('customer.crudActions.cancel')"
@click="$emit('click:CloseBtnAddHotProduct')"
/>
<q-btn
type="submit"
color="primary"
no-caps
style="width: 90px"
:label="$t('customer.crudActions.save')"
/>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>
<script lang="ts" src="./AddHotProductDialog.ts"></script>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<q-card style="min-width: 900px" bordered> <q-card style="min-width: 900px" bordered>
<q-form greedy @submit.prevent="$emit('addNewArtist')"> <q-form greedy @submit.prevent="$emit('addNewArtist')">
<q-card-section> <q-card-section>
<q-item> <q-item>t
<q-item-section> <q-item-section>
<q-item-label class="text-h6 text-weight-regular">{{ <q-item-label class="text-h6 text-weight-regular">{{
$t('artist.dialogLabel.title.addArtist') $t('artist.dialogLabel.title.addArtist')
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
</q-item> </q-item>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-6"> <div class="col-6">
......
...@@ -11,6 +11,7 @@ export default defineComponent({ ...@@ -11,6 +11,7 @@ export default defineComponent({
setup() { setup() {
const userTableColumnsHotProduct = [ const userTableColumnsHotProduct = [
{ {
name: 'STT',
required: true, required: true,
label: 'STT', label: 'STT',
align: 'center', align: 'center',
...@@ -98,8 +99,10 @@ export default defineComponent({ ...@@ -98,8 +99,10 @@ export default defineComponent({
pageIndex, pageIndex,
pageSize, pageSize,
totalPage, totalPage,
getListHotProduct, getListHotProduct,
changePageSize, changePageSize,
}; };
}, },
emits: ['click:addHotProduct']
}); });
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<q-space></q-space> <q-space></q-space>
<div class="col-auto"> <div class="col-auto">
<q-btn <q-btn
@click="$emit('click:addHotProduct')"
color="primary" color="primary"
no-caps no-caps
style="width: 100px" style="width: 100px"
...@@ -22,59 +23,51 @@ ...@@ -22,59 +23,51 @@
<template v-slot:body-cell-status="rowData"> <template v-slot:body-cell-status="rowData">
<q-td> <q-td>
<div align="center"> <div align="center">
<q-checkbox v-model="rowData.value" /> <q-checkbox
:true-value="1"
:false-value="2"
v-model="rowData.value"
/>
</div> </div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-action> <template v-slot:body-cell-STT="item">
<q-td style="padding: 0" class="flex flex-center"> <q-td style="padding: 0; height: 100%">
<q-btn flat round color="primary" icon="mdi-information-outline"> <div align="center">
<!-- <q-tooltip :offset="[20, 10]">{{ {{ item.rowIndex + 1 }}
$t('userPage.toolTipMessage.informationUser') </div>
}}</q-tooltip> --> </q-td>
</q-btn> </template>
<q-btn flat round color="primary" icon="mdi-minus-circle-outline">
<!-- <q-tooltip :offset="[20, 10]">{{ <template v-slot:body-cell-action>
$t('userPage.toolTipMessage.updateUserInfo') <q-td style="padding: 0; height: 100%">
}}</q-tooltip> --> <div align="center">
<q-btn flat round color="primary" icon="mdi-circle-edit-outline">
<q-tooltip>
Sửa
</q-tooltip>
</q-btn> </q-btn>
<q-btn flat round color="primary" icon="mdi-lock-outline"> <q-btn flat round color="primary" icon="mdi-delete-outline">
<!-- <q-tooltip :offset="[20, 10]">{{ <q-tooltip>
$t('userPage.toolTipMessage.updateUserInfo') Xóa
}}</q-tooltip> --> </q-tooltip>
</q-btn> </q-btn>
</div>
</q-td>
</template>
<template v-slot:body-cell-imageUrl="rowData">
<q-td style="padding: 0; height: 100%">
<div align="center">
<q-img
:src="rowData.value"
style="width: 100%"
>
</q-img>
</div>
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<!-- <div class="col-12 q-mt-sm">
<Pagination
v-model:currentPage="pageIndex"
v-model:pageSize="pageSize"
:totalPage="totalPage"
@update:pageSize="changePageSize"
@update:currentPage="getListHotProduct"
/>
</div> -->
<!-- <div class="col-12 q-mt-md">
<div class="row">
<q-space></q-space>
<div class="col-auto">
<q-btn
to="/nghe-sy"
color="grey"
no-caps
:label="$t('crudActions.back')"
></q-btn>
</div>
<div class="col-auto q-ml-md">
<q-btn
color="primary"
no-caps
:label="$t('crudActions.update')"
></q-btn>
</div>
</div>
</div> -->
</div> </div>
</div> </div>
</template> </template>
......
...@@ -359,6 +359,7 @@ export default { ...@@ -359,6 +359,7 @@ export default {
addArtist: 'Thêm nghệ sỹ', addArtist: 'Thêm nghệ sỹ',
updateArtist: 'Cập nhật nghệ sỹ', updateArtist: 'Cập nhật nghệ sỹ',
addAccountBank: 'Thêm tài khoản ngân hàng', addAccountBank: 'Thêm tài khoản ngân hàng',
addHotProduct: 'Thêm sản phẩm nổi bật'
}, },
fieldLabels: { fieldLabels: {
accountNumber: 'Mã thẻ', accountNumber: 'Mã thẻ',
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
></BankAccount> ></BankAccount>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="hotProduct"> <q-tab-panel name="hotProduct">
<HotProduct :products="products"></HotProduct> <HotProduct @click:addHotProduct="openAddHotProduct = true" :products="products" ></HotProduct>
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</q-card> </q-card>
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
@uploadEmbed="isOpenDialogEmbed = false" @uploadEmbed="isOpenDialogEmbed = false"
@click:CloseBtn="isOpenDialogEmbed = false" @click:CloseBtn="isOpenDialogEmbed = false"
></UploadEmbedDialog> ></UploadEmbedDialog>
<AddHotProductDialog v-model:status="status" v-model:open-add-hot-product="openAddHotProduct" @click:CloseBtnAddHotProduct="openAddHotProduct = false"></AddHotProductDialog>
<div class="col-12 q-mt-md"> <div class="col-12 q-mt-md">
<div class="row"> <div class="row">
<q-space></q-space> <q-space></q-space>
......
...@@ -3,6 +3,7 @@ import PersonalInformation from '../../components/artist-information/personal-in ...@@ -3,6 +3,7 @@ import PersonalInformation from '../../components/artist-information/personal-in
import VabAccount from '../../components/artist-information/VAB-account/index.vue'; import VabAccount from '../../components/artist-information/VAB-account/index.vue';
import BankAccount from '../../components/artist-information/bank-account/index.vue'; import BankAccount from '../../components/artist-information/bank-account/index.vue';
import HotProduct from '../../components/artist-information/hot-product/index.vue'; import HotProduct from '../../components/artist-information/hot-product/index.vue';
import AddHotProductDialog from '../../components/artist-information/AddHotProduct/index.vue';
import AddNewBankAccountDialog from 'components/artist-information/bank-account/add-new-bank-account-dialog/index.vue'; import AddNewBankAccountDialog from 'components/artist-information/bank-account/add-new-bank-account-dialog/index.vue';
import UploadEmbedDialog from 'components/artist-information/upload-embed-dialog/index.vue'; import UploadEmbedDialog from 'components/artist-information/upload-embed-dialog/index.vue';
import { api, BaseResponseBody } from 'src/boot/axios'; import { api, BaseResponseBody } from 'src/boot/axios';
...@@ -35,6 +36,7 @@ export default defineComponent({ ...@@ -35,6 +36,7 @@ export default defineComponent({
HotProduct, HotProduct,
AddNewBankAccountDialog, AddNewBankAccountDialog,
UploadEmbedDialog, UploadEmbedDialog,
AddHotProductDialog
}, },
watch: { watch: {
tab(value) { tab(value) {
...@@ -55,6 +57,8 @@ export default defineComponent({ ...@@ -55,6 +57,8 @@ export default defineComponent({
console.log('askdaskdkasds'); console.log('askdaskdkasds');
}; };
const isOpenAddAccountBankDialog: Ref<boolean> = ref(false); const isOpenAddAccountBankDialog: Ref<boolean> = ref(false);
const openAddHotProduct: Ref<boolean> = ref(false);
const isOpenDialogEmbed: Ref<boolean> = ref(false); const isOpenDialogEmbed: Ref<boolean> = ref(false);
const fieldOptions: Ref<FieldType[]> = ref([]); const fieldOptions: Ref<FieldType[]> = ref([]);
const nationalityOptions: Ref<NationalityType[]> = ref([]); const nationalityOptions: Ref<NationalityType[]> = ref([]);
...@@ -65,6 +69,7 @@ export default defineComponent({ ...@@ -65,6 +69,7 @@ export default defineComponent({
{ id: 1, name: 'Nam' }, { id: 1, name: 'Nam' },
{ id: 2, name: 'Nữ' }, { id: 2, name: 'Nữ' },
]); ]);
// const status: Ref<boolean | number> = ref(true);
const id: Ref<number> = ref(0); const id: Ref<number> = ref(0);
const account: Ref<string> = ref(''); const account: Ref<string> = ref('');
const artistCode: Ref<string> = ref(''); const artistCode: Ref<string> = ref('');
...@@ -246,6 +251,11 @@ export default defineComponent({ ...@@ -246,6 +251,11 @@ export default defineComponent({
deleteAccBank(value); deleteAccBank(value);
}); });
}; };
const openDialogAddHotProduct = () => {
console.log('object');
// console.log(openAddHotProduct.value);
openAddHotProduct.value = true
}
const openDialogAddAccBank = () => { const openDialogAddAccBank = () => {
accountNumber.value = null; accountNumber.value = null;
cardNumber.value = null; cardNumber.value = null;
...@@ -307,11 +317,13 @@ export default defineComponent({ ...@@ -307,11 +317,13 @@ export default defineComponent({
getWorkOptions, getWorkOptions,
bankAccounts, bankAccounts,
products, products,
account, account,
banners, banners,
shortDescription, shortDescription,
stories, stories,
isOpenAddAccountBankDialog, isOpenAddAccountBankDialog,
openAddHotProduct,
clickBtn, clickBtn,
accountNumber, accountNumber,
cardNumber, cardNumber,
...@@ -326,6 +338,8 @@ export default defineComponent({ ...@@ -326,6 +338,8 @@ export default defineComponent({
isOpenDialogEmbed, isOpenDialogEmbed,
deleteAccBank, deleteAccBank,
openDialogAddAccBank, openDialogAddAccBank,
openDialogAddHotProduct
}; };
}, },
}); });
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": "." "baseUrl": "."
} }
} }
\ No newline at end of file
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