Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quasar-web-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Hải Sơn
quasar-web-base
Commits
9dc0c804
Commit
9dc0c804
authored
Nov 30, 2022
by
Nguyễn Đức Thắng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2c1fc2ab
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
495 additions
and
28 deletions
+495
-28
index.vue
src/components/artist-information/UpdateHotProduct/index.vue
+22
-0
updateHotProduc.ts
...ts/artist-information/UpdateHotProduct/updateHotProduc.ts
+10
-0
HotProduct.ts
src/components/artist-information/hot-product/HotProduct.ts
+46
-0
index.vue
src/components/artist-information/hot-product/index.vue
+27
-0
AddNewUserDialog.ts
...s/user-management/add-new-user-dialog/AddNewUserDialog.ts
+2
-6
index.vue
src/components/user-management/add-new-user-dialog/index.vue
+0
-1
index.ts
src/i18n/vi/index.ts
+1
-1
index.vue
src/pages/cap-nhat-thong-tin-nghe-sy/index.vue
+2
-0
updateInformationArtist.ts
...ges/cap-nhat-thong-tin-nghe-sy/updateInformationArtist.ts
+2
-0
index.vue
src/pages/cau-hinh-trang-chu/index.vue
+367
-8
User.ts
src/pages/nguoi-dung/User.ts
+14
-12
index.vue
src/pages/them-nghe-sy/index.vue
+2
-0
No files found.
src/components/artist-information/UpdateHotProduct/index.vue
View file @
9dc0c804
...
@@ -88,6 +88,28 @@
...
@@ -88,6 +88,28 @@
:rules=
"statusRules"
:rules=
"statusRules"
hide-bottom-space
hide-bottom-space
></q-select>
></q-select>
<!--
<q-select
v-model=
"homeStatus"
emit-value
label=
"Nổi bật ở trang chủ"
class=
"q-my-sm"
:options=
"statusHomeOptions"
option-value=
"id"
option-label=
"name"
outlined
map-options
hide-bottom-space
></q-select>
-->
<!--
<div
class=
"q-pt-sm"
>
<span
class=
"text-body1"
>
Nổi bật ở trang chủ
</span
><q-toggle
:model-value=
"homeStatus"
:true-value=
"1"
:false-value=
"2"
/>
</div>
-->
</div>
</div>
</div>
</div>
</q-card-section>
</q-card-section>
...
...
src/components/artist-information/UpdateHotProduct/updateHotProduc.ts
View file @
9dc0c804
...
@@ -29,10 +29,15 @@ export default defineComponent({
...
@@ -29,10 +29,15 @@ export default defineComponent({
const
urlFileLocal
:
Ref
<
string
>
=
ref
(
''
);
const
urlFileLocal
:
Ref
<
string
>
=
ref
(
''
);
const
imageAPI
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
imageAPI
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
status
:
Ref
<
number
>
=
ref
(
2
);
const
status
:
Ref
<
number
>
=
ref
(
2
);
// const homeStatus: Ref<number> = ref(0);
const
statusOptions
=
ref
([
const
statusOptions
=
ref
([
{
id
:
1
,
name
:
'Sản phẩm khác'
},
{
id
:
1
,
name
:
'Sản phẩm khác'
},
{
id
:
2
,
name
:
'Sản phẩm nổi bật'
},
{
id
:
2
,
name
:
'Sản phẩm nổi bật'
},
]);
]);
// const statusHomeOptions = ref([
// { id: 0, name: 'Hiển thị' },
// { id: 1, name: 'Ẩn' },
// ])
const
id
:
Ref
<
number
|
null
>
=
ref
(
null
);
const
id
:
Ref
<
number
|
null
>
=
ref
(
null
);
const
uploadAvatar
=
(
value
:
FileList
)
=>
{
const
uploadAvatar
=
(
value
:
FileList
)
=>
{
urlFileLocal
.
value
=
URL
.
createObjectURL
(
value
[
0
]);
urlFileLocal
.
value
=
URL
.
createObjectURL
(
value
[
0
]);
...
@@ -49,6 +54,7 @@ export default defineComponent({
...
@@ -49,6 +54,7 @@ export default defineComponent({
code
.
value
=
props
.
dataUpdate
?.
code
as
string
;
code
.
value
=
props
.
dataUpdate
?.
code
as
string
;
embeddedUrl
.
value
=
props
.
dataUpdate
?.
embeddedUrl
as
string
;
embeddedUrl
.
value
=
props
.
dataUpdate
?.
embeddedUrl
as
string
;
status
.
value
=
props
.
dataUpdate
?.
status
as
number
;
status
.
value
=
props
.
dataUpdate
?.
status
as
number
;
// homeStatus.value = props.dataUpdate?.status as number
urlFileLocal
.
value
=
props
.
dataUpdate
?.
imageUrl
as
string
;
urlFileLocal
.
value
=
props
.
dataUpdate
?.
imageUrl
as
string
;
if
(
props
.
dataUpdate
?.
file
)
{
if
(
props
.
dataUpdate
?.
file
)
{
imageAPI
.
value
=
null
;
imageAPI
.
value
=
null
;
...
@@ -67,6 +73,7 @@ export default defineComponent({
...
@@ -67,6 +73,7 @@ export default defineComponent({
embeddedUrl
.
value
=
''
;
embeddedUrl
.
value
=
''
;
urlFileLocal
.
value
=
''
;
urlFileLocal
.
value
=
''
;
status
.
value
=
2
;
status
.
value
=
2
;
// homeStatus.value = 0
};
};
const
SubbmitDataUpdate
=
()
=>
{
const
SubbmitDataUpdate
=
()
=>
{
context
.
emit
(
'click:CloseBtnUpdateHotProduct'
);
context
.
emit
(
'click:CloseBtnUpdateHotProduct'
);
...
@@ -75,6 +82,7 @@ export default defineComponent({
...
@@ -75,6 +82,7 @@ export default defineComponent({
name
:
name
.
value
,
name
:
name
.
value
,
code
:
code
.
value
,
code
:
code
.
value
,
status
:
status
.
value
,
status
:
status
.
value
,
// isFeaturedOnHomepage: homeStatus.value,
embeddedUrl
:
embeddedUrl
.
value
,
embeddedUrl
:
embeddedUrl
.
value
,
imageUrl
:
urlFileLocal
.
value
,
imageUrl
:
urlFileLocal
.
value
,
id
:
id
.
value
,
id
:
id
.
value
,
...
@@ -131,6 +139,8 @@ export default defineComponent({
...
@@ -131,6 +139,8 @@ export default defineComponent({
url_embed
,
url_embed
,
statusRules
,
statusRules
,
statusOptions
,
statusOptions
,
// statusHomeOptions,
// homeStatus,
id
,
id
,
configImg
,
configImg
,
imageAPI
,
imageAPI
,
...
...
src/components/artist-information/hot-product/HotProduct.ts
View file @
9dc0c804
...
@@ -4,6 +4,7 @@ import Pagination from 'components/pagination/index.vue';
...
@@ -4,6 +4,7 @@ import Pagination from 'components/pagination/index.vue';
import
{
ProductType
}
from
'src/assets/type'
;
import
{
ProductType
}
from
'src/assets/type'
;
import
{
HotProductStatus
}
from
'src/assets/enums'
;
import
{
HotProductStatus
}
from
'src/assets/enums'
;
import
{
config
}
from
'src/assets/configurations.example'
;
import
{
config
}
from
'src/assets/configurations.example'
;
import
{
Dialog
,
Notify
}
from
'quasar'
;
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
components
:
{
Pagination
,
Pagination
,
...
@@ -13,6 +14,7 @@ export default defineComponent({
...
@@ -13,6 +14,7 @@ export default defineComponent({
// DataInsertHotProduct: { type: Object, requied: false }
// DataInsertHotProduct: { type: Object, requied: false }
},
},
setup
(
_
,
context
)
{
setup
(
_
,
context
)
{
const
configImg
=
config
;
const
configImg
=
config
;
const
userTableColumnsHotProduct
=
[
const
userTableColumnsHotProduct
=
[
{
{
...
@@ -61,6 +63,16 @@ export default defineComponent({
...
@@ -61,6 +63,16 @@ export default defineComponent({
align
:
'center'
,
align
:
'center'
,
sortable
:
false
,
sortable
:
false
,
},
},
{
name
:
'isFeaturedOnHomepage'
,
field
:
'isFeaturedOnHomepage'
,
required
:
true
,
label
:
'Nổi bật ở trang chủ'
,
align
:
'center'
,
sortable
:
false
,
},
{
{
name
:
'action'
,
name
:
'action'
,
field
:
'action'
,
field
:
'action'
,
...
@@ -75,6 +87,7 @@ export default defineComponent({
...
@@ -75,6 +87,7 @@ export default defineComponent({
const
pageIndex
=
ref
(
1
);
const
pageIndex
=
ref
(
1
);
const
pageSize
=
ref
(
20
);
const
pageSize
=
ref
(
20
);
const
totalPage
=
ref
(
10
);
const
totalPage
=
ref
(
10
);
const
updateProduct
=
(
item
:
{
row
:
ProductType
})
=>
{
const
updateProduct
=
(
item
:
{
row
:
ProductType
})
=>
{
context
.
emit
(
'setDataUpdate'
,
{
context
.
emit
(
'setDataUpdate'
,
{
code
:
item
.
row
.
code
,
code
:
item
.
row
.
code
,
...
@@ -86,7 +99,37 @@ export default defineComponent({
...
@@ -86,7 +99,37 @@ export default defineComponent({
file
:
item
.
row
.
file
,
file
:
item
.
row
.
file
,
});
});
context
.
emit
(
'click:openUpdateHotProduct'
);
context
.
emit
(
'click:openUpdateHotProduct'
);
};
};
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const
showHiden
=
(
index
:
any
)
=>
{
Dialog
.
create
({
title
:
i18n
.
global
.
t
(
'managingUnit.confirmActionsTitle.confirmDeleteManagingUnitsTitle'
),
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
message
:
index
.
isFeaturedOnHomepage
===
1
?
'Bạn có chắc chắn muốn ẩn ở trang chủ không?'
:
'Bạn có chắc chắn muốn hiển thị ở trang chủ không?'
,
cancel
:
i18n
.
global
.
t
(
'managingUnit.confirmActionsTitle.confirmDeleteManagingUnitsCancelBtnLabel'
),
color
:
'negative'
,
}).
onOk
(()
=>
{
context
.
emit
(
'click:updateStatusHot'
);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
console
.
log
(
index
.
id
,
'index'
)
Notify
.
create
({
type
:
'positive'
,
message
:
'Thay đổi trạng thái thành công'
,
actions
:
[{
icon
:
'close'
,
color
:
'white'
}],
});
});
}
const
clickAdd
=
()
=>
{
const
clickAdd
=
()
=>
{
context
.
emit
(
'click:addHotProduct'
);
context
.
emit
(
'click:addHotProduct'
);
};
};
...
@@ -104,7 +147,9 @@ export default defineComponent({
...
@@ -104,7 +147,9 @@ export default defineComponent({
deleteRow
,
deleteRow
,
clickAdd
,
clickAdd
,
updateProduct
,
updateProduct
,
showHiden
,
HotProductStatus
,
HotProductStatus
,
};
};
},
},
emits
:
[
emits
:
[
...
@@ -113,5 +158,6 @@ export default defineComponent({
...
@@ -113,5 +158,6 @@ export default defineComponent({
'deleteRow'
,
'deleteRow'
,
'click:openUpdateHotProduct'
,
'click:openUpdateHotProduct'
,
'setDataUpdate'
,
'setDataUpdate'
,
'click:updateStatusHot'
],
],
});
});
src/components/artist-information/hot-product/index.vue
View file @
9dc0c804
...
@@ -50,6 +50,20 @@
...
@@ -50,6 +50,20 @@
</div>
</div>
</q-td>
</q-td>
</
template
>
</
template
>
<
template
v-slot:body-cell-isFeaturedOnHomepage=
"rowData"
>
<q-td>
<div
v-if=
"rowData.value === 1"
align=
"center"
>
<q-chip
color=
" positive"
text-color=
"white"
size=
"sm"
>
Hiển thị
</q-chip>
</div>
<div
v-if=
"rowData.value === 0"
align=
"center"
>
<q-chip
color=
"primary"
text-color=
"white"
size=
"sm"
>
Ẩn
</q-chip>
</div>
</q-td>
</
template
>
<
template
v-slot:body-cell-STT=
"item"
>
<
template
v-slot:body-cell-STT=
"item"
>
<q-td
:item=
"item"
style=
"text-align: center"
>
<q-td
:item=
"item"
style=
"text-align: center"
>
{{
1
+
item
.
rowIndex
+
pageSize
*
(
pageIndex
-
1
)
}}
{{
1
+
item
.
rowIndex
+
pageSize
*
(
pageIndex
-
1
)
}}
...
@@ -59,6 +73,19 @@
...
@@ -59,6 +73,19 @@
<
template
v-slot:body-cell-action=
"item"
>
<
template
v-slot:body-cell-action=
"item"
>
<q-td
style=
"padding: 0; height: 100%"
>
<q-td
style=
"padding: 0; height: 100%"
>
<div
align=
"center"
>
<div
align=
"center"
>
<q-btn
flat
round
color=
"primary"
:icon=
"
item.row.isFeaturedOnHomepage === 0
? 'mdi-eye-off-outline'
: 'mdi-eye-outline'
"
@
click=
"showHiden(item.row)"
>
<q-tooltip>
Nổi bật ở trang chủ
</q-tooltip>
</q-btn>
<q-btn
<q-btn
flat
flat
round
round
...
...
src/components/user-management/add-new-user-dialog/AddNewUserDialog.ts
View file @
9dc0c804
...
@@ -75,11 +75,7 @@ export default defineComponent({
...
@@ -75,11 +75,7 @@ export default defineComponent({
(
val
&&
val
.
trim
().
length
)
||
(
val
&&
val
.
trim
().
length
)
||
i18n
.
global
.
t
(
'userPage.validateMessages.requireUnit'
),
i18n
.
global
.
t
(
'userPage.validateMessages.requireUnit'
),
];
];
const
sexRules
=
[
(
val
?:
number
)
=>
val
!==
undefined
||
i18n
.
global
.
t
(
'userPage.validateMessages.requireSex'
),
];
const
groupRules
=
[
const
groupRules
=
[
(
val
?:
Array
<
unknown
>
)
=>
(
val
?:
Array
<
unknown
>
)
=>
val
?.
length
||
i18n
.
global
.
t
(
'userPage.validateMessages.requiredGroup'
),
val
?.
length
||
i18n
.
global
.
t
(
'userPage.validateMessages.requiredGroup'
),
...
@@ -94,7 +90,7 @@ export default defineComponent({
...
@@ -94,7 +90,7 @@ export default defineComponent({
mobileNumberRules
,
mobileNumberRules
,
addressRules
,
addressRules
,
unitRules
,
unitRules
,
sexRules
,
groupRules
,
groupRules
,
birthdayRules
,
birthdayRules
,
};
};
...
...
src/components/user-management/add-new-user-dialog/index.vue
View file @
9dc0c804
...
@@ -119,7 +119,6 @@
...
@@ -119,7 +119,6 @@
option-label=
"text"
option-label=
"text"
outlined
outlined
map-options
map-options
:rules=
"sexRules"
hide-bottom-space
hide-bottom-space
></q-select>
></q-select>
<q-input
<q-input
...
...
src/i18n/vi/index.ts
View file @
9dc0c804
...
@@ -97,7 +97,7 @@ export default {
...
@@ -97,7 +97,7 @@ export default {
address
:
'Địa chỉ'
,
address
:
'Địa chỉ'
,
phoneNumber
:
'Số máy bàn'
,
phoneNumber
:
'Số máy bàn'
,
unit
:
'Đơn vị phòng ban'
,
unit
:
'Đơn vị phòng ban'
,
sex
:
'Giới tính
*
'
,
sex
:
'Giới tính'
,
birthday
:
'Ngày sinh'
,
birthday
:
'Ngày sinh'
,
group
:
'Thuộc nhóm *'
,
group
:
'Thuộc nhóm *'
,
scheduleAccess
:
'Lịch truy cập'
,
scheduleAccess
:
'Lịch truy cập'
,
...
...
src/pages/cap-nhat-thong-tin-nghe-sy/index.vue
View file @
9dc0c804
...
@@ -136,6 +136,7 @@
...
@@ -136,6 +136,7 @@
@
click:addHotProduct=
"openAddHotProduct = true"
@
click:addHotProduct=
"openAddHotProduct = true"
@
click:openUpdateHotProduct=
"openUpdateHotProduct = true"
@
click:openUpdateHotProduct=
"openUpdateHotProduct = true"
@
setDataUpdate=
"SetProduct($event)"
@
setDataUpdate=
"SetProduct($event)"
@
click:update-status-hot=
"getInformationArtist"
></HotProduct>
></HotProduct>
</q-tab-panel>
</q-tab-panel>
</q-tab-panels>
</q-tab-panels>
...
@@ -179,6 +180,7 @@
...
@@ -179,6 +180,7 @@
@
UpdateData=
"UpdateData($event)"
@
UpdateData=
"UpdateData($event)"
@
click:CloseBtnUpdateHotProduct=
"openUpdateHotProduct = false"
@
click:CloseBtnUpdateHotProduct=
"openUpdateHotProduct = false"
v-model:open-update-hot-product=
"openUpdateHotProduct"
v-model:open-update-hot-product=
"openUpdateHotProduct"
></UpdateHotProduct>
></UpdateHotProduct>
<AddStory
<AddStory
@
insertData=
"addStory"
@
insertData=
"addStory"
...
...
src/pages/cap-nhat-thong-tin-nghe-sy/updateInformationArtist.ts
View file @
9dc0c804
...
@@ -345,6 +345,7 @@ export default defineComponent({
...
@@ -345,6 +345,7 @@ export default defineComponent({
// }
// }
// );
// );
const
getInformationArtist
=
async
()
=>
{
const
getInformationArtist
=
async
()
=>
{
const
response
=
(
await
api
({
const
response
=
(
await
api
({
url
:
API_PATHS
.
getDetailArtist
,
url
:
API_PATHS
.
getDetailArtist
,
...
@@ -1054,6 +1055,7 @@ export default defineComponent({
...
@@ -1054,6 +1055,7 @@ export default defineComponent({
confirmDeleteRow
,
confirmDeleteRow
,
updateInformationArtist
,
updateInformationArtist
,
openUpdateHotProduct
,
openUpdateHotProduct
,
SetProduct
,
SetProduct
,
DataUpdateHotProduct
,
DataUpdateHotProduct
,
UpdateData
,
UpdateData
,
...
...
src/pages/cau-hinh-trang-chu/index.vue
View file @
9dc0c804
<
template
>
<
template
>
<q-page
class=
"row items-center justify-evenly"
>
<div
class=
"row q-col-gutter-sm flex-center q-mt-sm"
>
<!--
<q-btn
color=
"primary"
@
click=
"$store.dispatch('authentication/logOut')"
<div
class=
"col-auto text-h6 text-weight-regular flex flex-center q-mr-md"
>
>
Logout
</q-btn
Danh sách sản phẩm nổi bật
>
-->
<q-separator
vertical
spaced
/>
</q-page>
</div>
<q-space></q-space>
<div
class=
"col-12 q-mt-sm"
>
<q-table
:rows=
"bannerTableRows"
:columns=
"bannerTableColumns"
row-key=
"id"
separator=
"cell"
wrap-cells
:no-data-label=
"$t('emptyData')"
:rows-per-page-label=
"$t('recordPerPage')"
:pagination=
"
{
rowsPerPage: 0,
}"
hide-pagination
class="sticky-header-table"
>
<template
v-slot:body-cell-action=
"item"
>
<q-td
style=
"padding: 0; text-align: center"
>
<q-btn
flat
round
color=
"primary"
icon=
"mdi-delete-outline"
@
click=
"confirmDeleteBanner(item.row.id)"
>
<q-tooltip
:offset=
"[20, 10]"
>
Xóa
</q-tooltip>
</q-btn>
</q-td>
</
template
>
<
template
v-slot:body-cell-imageUrl=
"image"
>
<q-td
style=
"padding: auto; height: 100%; text-align: center"
>
<q-img
style=
"width: 18rem; height: 6rem"
:src=
"configImg.API_IMAGE_ENDPOINT + image.row.imageUrl"
></q-img>
</q-td>
</
template
>
<
template
v-slot:body-cell-artistName=
"item"
>
<q-td
style=
"padding: auto; height: 100%; text-align: center"
>
{{
item
.
row
.
artistName
.
artistName
}}
</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=
"configHomeProduct"
/>
</div>
<!-- <AddUpdateBannerDialog
v-model:isOpened="addBannerDialogIsOpened"
v-model:name="name"
v-model:image="image"
v-model:numIndex="numIndex"
v-model:status="status"
@SetAvatar="setAvatar($event)"
@deleteAvatar="deleteAvatar"
isUpdate
@saveBannerInfo="addBanner"
/> -->
</div>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
i18n
}
from
'src/boot/i18n'
;
import
{
defineComponent
,
onMounted
,
ref
,
Ref
}
from
'vue'
;
import
{
AxiosResponse
}
from
'axios'
;
import
Pagination
from
'components/pagination/index.vue'
;
import
{
api
,
BaseResponseBody
}
from
'src/boot/axios'
;
import
{
PaginationResponse
,
FileUploadType
,
ListBannerConfig
,
DetailBannerConfig
,
AddBannerConfig
,
}
from
'src/assets/type'
;
import
{
config
,
API_PATHS
}
from
'src/assets/configurations.example'
;
import
{
BannerStatus
}
from
'src/assets/enums'
;
// import AddUpdateBannerDialog from 'components/add-update-banner/index.vue';
import
{
Dialog
,
Notify
}
from
'quasar'
;
export
type
AvatarType
=
{
file
?:
File
;
url
?:
string
|
null
;
};
import
{
defineComponent
,
ref
}
from
'vue'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'PageIndex'
,
components
:
{
Pagination
,
// AddUpdateBannerDialog,
},
setup
()
{
const
bannerTableColumns
=
[
{
name
:
'name'
,
field
:
'name'
,
required
:
true
,
label
:
'Tên sản phẩm'
,
headerStyle
:
'text-align: center !important; width: 10%'
,
align
:
'left'
,
sortable
:
false
,
},
{
name
:
'code'
,
field
:
'code'
,
required
:
true
,
label
:
'Mã sản phẩm'
,
align
:
'center'
,
headerStyle
:
'width: 10%'
,
sortable
:
false
,
},
{
name
:
'artistName'
,
field
:
'artistName'
,
required
:
true
,
label
:
'Tên nghệ sỹ'
,
align
:
'center'
,
headerStyle
:
'width: 10%'
,
sortable
:
false
,
},
{
name
:
'embeddedUrl'
,
field
:
'embeddedUrl'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'artist.hotProduct.tableColumnsProduct.urlEmbed'
),
headerStyle
:
'text-align: center !important; width: 25%'
,
align
:
'left'
,
sortable
:
false
,
},
{
name
:
'imageUrl'
,
field
:
'imageUrl'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'artist.hotProduct.tableColumnsProduct.productImage'
),
align
:
'center'
,
sortable
:
false
,
headerStyle
:
'width: 25%'
},
{
name
:
'action'
,
field
:
'action'
,
required
:
true
,
label
:
i18n
.
global
.
t
(
'artist.bankAccount.tableColumnsBank.action'
),
align
:
'center'
,
sortable
:
false
,
headerStyle
:
'width: 5%'
},
];
const
pageIndex
=
ref
(
1
);
const
pageSize
=
ref
(
20
);
const
totalPage
=
ref
(
1
);
const
changePageSize
=
()
=>
{
pageIndex
.
value
=
1
;
void
configHomeProduct
();
};
const
bannerTableRows
:
Ref
<
unknown
[]
>
=
ref
([]);
const
addBannerDialogIsOpened
=
ref
(
false
);
const
name
=
ref
(
''
);
const
image
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
numIndex
:
Ref
<
number
|
undefined
>
=
ref
(
undefined
);
const
status
:
Ref
<
number
>
=
ref
(
BannerStatus
.
active
);
const
bannerId
:
Ref
<
number
|
undefined
>
=
ref
(
undefined
);
const
nameBanner
=
ref
(
''
);
const
avatarFile
:
Ref
<
File
|
null
>
=
ref
(
null
);
const
avatarUploaded
:
Ref
<
string
>
=
ref
(
''
);
const
imageChange
:
Ref
<
string
>
=
ref
(
''
);
//gọi api ds
const
configHomeProduct
=
async
()
=>
{
const
response
=
(
await
api
({
url
:
API_PATHS
.
configHomeProduct
,
method
:
'GET'
,
params
:
{
pageIndex
:
pageIndex
.
value
,
pageSize
:
pageSize
.
value
,
name
:
nameBanner
.
value
,
},
}))
as
AxiosResponse
<
BaseResponseBody
<
PaginationResponse
<
ListBannerConfig
[]
>>
>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
bannerTableRows
.
value
=
response
.
data
.
data
.
data
;
totalPage
.
value
=
response
.
data
.
data
.
totalPages
;
}
};
const
confirmDeleteBanner
=
(
id
:
number
)
=>
{
Dialog
.
create
({
title
:
i18n
.
global
.
t
(
'banner.confirmActionsTitle.confirmDeleteBannerTitle'
),
message
:
'Bạn chắc chắn muốn xóa sản phẩm này khỏi danh sách nổi bật không?'
,
cancel
:
i18n
.
global
.
t
(
'banner.confirmActionsTitle.confirmDeleteBannerCancelBtnLabel'
),
color
:
'negative'
,
}).
onOk
(()
=>
{
void
deleteBanner
(
id
);
});
};
//gói api xóa
const
deleteBanner
=
async
(
id
:
number
)
=>
{
try
{
const
deleteResult
=
(
await
api
({
url
:
API_PATHS
.
deleteBanner
,
method
:
'GET'
,
params
:
{
id
:
id
,
},
}))
as
AxiosResponse
<
BaseResponseBody
<
unknown
>>
;
if
(
deleteResult
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
Notify
.
create
({
type
:
'positive'
,
message
:
i18n
.
global
.
t
(
'banner.actionMessages.deleteBannerAccess'
),
});
void
configHomeProduct
();
}
}
catch
(
error
)
{}
};
const
openAddBannerDialog
=
()
=>
{
name
.
value
=
''
;
numIndex
.
value
=
undefined
;
image
.
value
=
null
;
status
.
value
=
BannerStatus
.
active
;
addBannerDialogIsOpened
.
value
=
true
;
};
//gọi api add
const
addBanner
=
async
()
=>
{
avatarUploaded
.
value
=
await
callApiUploadAvatar
(
avatarFile
.
value
as
File
);
const
data
=
{
name
:
name
.
value
,
image
:
avatarUploaded
.
value
,
numIndex
:
numIndex
.
value
,
status
:
status
.
value
,
};
const
response
=
(
await
api
({
url
:
API_PATHS
.
addBanner
,
method
:
'POST'
,
data
,
}))
as
AxiosResponse
<
BaseResponseBody
<
AddBannerConfig
[]
>>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
addBannerDialogIsOpened
.
value
=
false
;
Notify
.
create
({
type
:
'positive'
,
message
:
i18n
.
global
.
t
(
'banner.actionMessages.addNewBannerAccess'
),
actions
:
[{
icon
:
'close'
,
color
:
'white'
}],
});
void
configHomeProduct
();
}
};
//gọi api detail
const
getDetailBanner
=
async
(
id
:
number
)
=>
{
try
{
const
response
=
(
await
api
({
url
:
API_PATHS
.
getDetailBanner
,
method
:
'GET'
,
params
:
{
id
:
id
,
},
}))
as
AxiosResponse
<
BaseResponseBody
<
DetailBannerConfig
>>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
bannerId
.
value
=
response
.
data
.
data
.
id
;
name
.
value
=
response
.
data
.
data
.
name
;
numIndex
.
value
=
response
.
data
.
data
.
numIndex
;
status
.
value
=
response
.
data
.
data
.
status
;
image
.
value
=
config
.
API_IMAGE_ENDPOINT
+
response
.
data
.
data
.
image
;
imageChange
.
value
=
response
.
data
.
data
.
image
;
}
}
catch
(
error
)
{}
};
const
setAvatar
=
(
value
:
{
file
?:
File
;
url
?:
string
})
=>
{
avatarFile
.
value
=
value
.
file
as
File
;
image
.
value
=
value
.
url
as
string
;
};
const
callApiUploadAvatar
=
async
(
file
:
File
)
=>
{
try
{
const
bodyFormData
=
new
FormData
();
bodyFormData
.
append
(
'file'
,
file
);
const
response
=
(
await
api
({
headers
:
{
'Content-Type'
:
'multipart/form-data'
},
// url: 'https://cms.vab.vn/file/upload/', // pro
url
:
config
.
API_IMAGE_ENDPOINT
,
// pro
// url: 'http://103.147.34.20:10705/file/upload/', // test
method
:
'POST'
,
data
:
bodyFormData
,
}))
as
AxiosResponse
<
BaseResponseBody
<
FileUploadType
>>
;
if
(
response
.
data
.
error
.
code
===
config
.
API_RES_CODE
.
OK
.
code
)
{
return
response
.
data
.
data
.
fileName
;
}
else
{
return
''
;
}
}
catch
(
error
)
{
return
''
;
}
};
const
deleteAvatar
=
()
=>
{
image
.
value
=
null
;
};
const
configImg
=
config
;
onMounted
(()
=>
{
void
configHomeProduct
();
});
return
{
addBannerDialogIsOpened
,
bannerTableColumns
,
bannerTableRows
,
configHomeProduct
,
pageIndex
,
pageSize
,
totalPage
,
changePageSize
,
BannerStatus
,
openAddBannerDialog
,
name
,
status
,
addBanner
,
confirmDeleteBanner
,
deleteBanner
,
getDetailBanner
,
nameBanner
,
image
,
numIndex
,
setAvatar
,
callApiUploadAvatar
,
deleteAvatar
,
configImg
,
avatarUploaded
,
bannerId
,
};
},
});
});
</
script
>
</
script
>
src/pages/nguoi-dung/User.ts
View file @
9dc0c804
...
@@ -97,11 +97,11 @@ export default defineComponent({
...
@@ -97,11 +97,11 @@ export default defineComponent({
const
userName
=
ref
(
''
);
const
userName
=
ref
(
''
);
const
password
=
ref
(
''
);
const
password
=
ref
(
''
);
const
fullName
=
ref
(
''
);
const
fullName
=
ref
(
''
);
const
birthday
:
Ref
<
string
|
undefined
>
=
ref
(
);
const
birthday
:
Ref
<
string
|
null
>
=
ref
(
null
);
const
email
=
ref
(
''
);
const
email
=
ref
(
''
);
const
phoneNumber
=
ref
(
''
);
const
phoneNumber
=
ref
(
''
);
const
mobileNumber
=
ref
(
''
);
const
mobileNumber
=
ref
(
''
);
const
sex
:
Ref
<
number
|
undefined
>
=
ref
(
);
const
sex
:
Ref
<
number
|
null
>
=
ref
(
null
);
const
sexOptions
=
ref
([
const
sexOptions
=
ref
([
{
id
:
1
,
text
:
'Nam'
},
{
id
:
1
,
text
:
'Nam'
},
{
id
:
2
,
text
:
'Nữ'
},
{
id
:
2
,
text
:
'Nữ'
},
...
@@ -157,11 +157,11 @@ export default defineComponent({
...
@@ -157,11 +157,11 @@ export default defineComponent({
userName
.
value
=
''
;
userName
.
value
=
''
;
password
.
value
=
''
;
password
.
value
=
''
;
fullName
.
value
=
''
;
fullName
.
value
=
''
;
birthday
.
value
=
''
;
birthday
.
value
=
null
;
email
.
value
=
''
;
email
.
value
=
''
;
phoneNumber
.
value
=
''
;
phoneNumber
.
value
=
''
;
mobileNumber
.
value
=
''
;
mobileNumber
.
value
=
''
;
sex
.
value
=
undefined
;
sex
.
value
=
null
;
address
.
value
=
''
;
address
.
value
=
''
;
unit
.
value
=
null
;
unit
.
value
=
null
;
status
.
value
=
true
;
status
.
value
=
true
;
...
@@ -169,6 +169,7 @@ export default defineComponent({
...
@@ -169,6 +169,7 @@ export default defineComponent({
};
};
const
addNewUser
=
async
()
=>
{
const
addNewUser
=
async
()
=>
{
try
{
try
{
const
groups
:
{
id
:
number
}[]
=
[];
const
groups
:
{
id
:
number
}[]
=
[];
group
.
value
.
map
((
item
)
=>
{
group
.
value
.
map
((
item
)
=>
{
...
@@ -183,11 +184,11 @@ export default defineComponent({
...
@@ -183,11 +184,11 @@ export default defineComponent({
password
:
password
.
value
,
password
:
password
.
value
,
fullName
:
fullName
.
value
.
trim
(),
fullName
:
fullName
.
value
.
trim
(),
birthday
:
birthday
:
birthday
.
value
===
''
?
''
:
moment
(
birthday
.
value
,
'DD/MM/YYYY'
).
format
(
'DD/MM/YYYY 00:00:00'
),
birthday
.
value
===
null
?
null
:
moment
(
birthday
.
value
,
'DD/MM/YYYY'
).
format
(
'DD/MM/YYYY 00:00:00'
),
email
:
email
.
value
.
trim
(),
email
:
email
.
value
.
trim
(),
phoneNumber
:
phoneNumber
.
value
.
trim
(),
phoneNumber
:
phoneNumber
.
value
.
trim
(),
mobileNumber
:
mobileNumber
.
value
.
trim
(),
mobileNumber
:
mobileNumber
.
value
.
trim
(),
sex
:
sex
.
value
,
sex
:
sex
.
value
===
null
?
null
:
sex
.
value
,
address
:
address
.
value
?.
trim
(),
address
:
address
.
value
?.
trim
(),
unit
:
unit
.
value
?.
trim
(),
unit
:
unit
.
value
?.
trim
(),
status
:
status
.
value
?
1
:
0
,
status
:
status
.
value
?
1
:
0
,
...
@@ -319,20 +320,21 @@ export default defineComponent({
...
@@ -319,20 +320,21 @@ export default defineComponent({
'DD/MM/YYYY HH:mm:ss'
'DD/MM/YYYY HH:mm:ss'
).
format
(
'DD/MM/YYYY'
);
).
format
(
'DD/MM/YYYY'
);
}
else
{
}
else
{
birthday
.
value
=
''
;
birthday
.
value
=
null
;
}
}
email
.
value
=
userInfo
.
email
as
string
;
email
.
value
=
userInfo
.
email
as
string
;
fullName
.
value
=
userInfo
.
fullName
as
string
;
fullName
.
value
=
userInfo
.
fullName
as
string
;
mobileNumber
.
value
=
userInfo
.
mobileNumber
as
string
;
mobileNumber
.
value
=
userInfo
.
mobileNumber
as
string
;
phoneNumber
.
value
=
userInfo
.
phoneNumber
as
string
;
phoneNumber
.
value
=
userInfo
.
phoneNumber
as
string
;
if
(
userInfo
.
sex
!==
0
)
{
if
(
userInfo
.
sex
!==
null
)
{
sex
.
value
=
userInfo
.
sex
;
sex
.
value
=
userInfo
.
sex
;
}
else
{
}
else
{
sex
.
value
=
1
;
sex
.
value
=
null
;
}
}
status
.
value
=
userInfo
.
status
?
true
:
false
;
status
.
value
=
userInfo
.
status
?
true
:
false
;
unit
.
value
=
userInfo
.
unit
;
unit
.
value
=
userInfo
.
unit
;
userName
.
value
=
userInfo
.
userName
;
userName
.
value
=
userInfo
.
userName
;
password
.
value
=
userInfo
.
password
}
}
}
catch
(
error
)
{}
}
catch
(
error
)
{}
};
};
...
@@ -350,11 +352,11 @@ export default defineComponent({
...
@@ -350,11 +352,11 @@ export default defineComponent({
fullName
:
fullName
.
value
.
trim
(),
fullName
:
fullName
.
value
.
trim
(),
birthday
:
birthday
:
birthday
.
value
===
''
?
''
:
moment
(
birthday
.
value
,
'DD/MM/YYYY'
).
format
(
'DD/MM/YYYY 00:00:00'
),
birthday
.
value
===
null
?
null
:
moment
(
birthday
.
value
,
'DD/MM/YYYY'
).
format
(
'DD/MM/YYYY 00:00:00'
),
email
:
email
.
value
.
trim
(),
email
:
email
.
value
.
trim
(),
phoneNumber
:
phoneNumber
.
value
.
trim
(),
phoneNumber
:
phoneNumber
.
value
.
trim
(),
mobileNumber
:
mobileNumber
.
value
.
trim
(),
mobileNumber
:
mobileNumber
.
value
.
trim
(),
sex
:
sex
.
value
,
sex
:
sex
.
value
===
null
?
null
:
sex
.
value
,
address
:
address
.
value
?.
trim
(),
address
:
address
.
value
?.
trim
(),
unit
:
unit
.
value
?.
trim
(),
unit
:
unit
.
value
?.
trim
(),
status
:
status
.
value
?
1
:
0
,
status
:
status
.
value
?
1
:
0
,
...
...
src/pages/them-nghe-sy/index.vue
View file @
9dc0c804
...
@@ -192,6 +192,8 @@
...
@@ -192,6 +192,8 @@
@
UpdateData=
"UpdateData($event)"
@
UpdateData=
"UpdateData($event)"
@
click:CloseBtnUpdateHotProduct=
"openUpdateHotProduct = false"
@
click:CloseBtnUpdateHotProduct=
"openUpdateHotProduct = false"
v-model:open-update-hot-product=
"openUpdateHotProduct"
v-model:open-update-hot-product=
"openUpdateHotProduct"
></UpdateHotProduct>
></UpdateHotProduct>
<AddStory
<AddStory
@
insertData=
"addStory"
@
insertData=
"addStory"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment