Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
有来技术
vue3-element-admin
提交
528a17fe
V
vue3-element-admin
项目概览
有来技术
/
vue3-element-admin
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue3-element-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
528a17fe
编写于
7月 05, 2022
作者:
郝
郝先瑞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 接口路径变更和删除依赖包
上级
f573d95c
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
507 addition
and
355 deletion
+507
-355
docs/node_modules.zip
docs/node_modules.zip
+0
-0
src/api/pms/brand.ts
src/api/pms/brand.ts
+1
-1
src/api/pms/goods.ts
src/api/pms/goods.ts
+10
-10
src/api/sms/advert.ts
src/api/sms/advert.ts
+2
-2
src/api/sms/coupon.ts
src/api/sms/coupon.ts
+11
-11
src/api/system/menu.ts
src/api/system/menu.ts
+9
-9
src/api/system/role.ts
src/api/system/role.ts
+9
-9
src/api/system/user.ts
src/api/system/user.ts
+12
-12
src/assets/icons/404.svg
src/assets/icons/404.svg
+0
-1
src/assets/icons/coupon.svg
src/assets/icons/coupon.svg
+1
-0
src/layout/components/TagsView/index.vue
src/layout/components/TagsView/index.vue
+8
-8
src/permission.ts
src/permission.ts
+1
-1
src/types/api/oms/order.d.ts
src/types/api/oms/order.d.ts
+1
-1
src/types/api/sms/advert.d.ts
src/types/api/sms/advert.d.ts
+5
-5
src/types/api/sms/coupon.ts
src/types/api/sms/coupon.ts
+97
-9
src/types/api/system/menu.d.ts
src/types/api/system/menu.d.ts
+3
-3
src/types/api/system/user.d.ts
src/types/api/system/user.d.ts
+1
-1
src/views/pms/goods/components/GoodsInfo.vue
src/views/pms/goods/components/GoodsInfo.vue
+13
-10
src/views/pms/goods/components/GoodsStock.vue
src/views/pms/goods/components/GoodsStock.vue
+4
-56
src/views/pms/goods/detail.vue
src/views/pms/goods/detail.vue
+2
-2
src/views/pms/goods/index.vue
src/views/pms/goods/index.vue
+3
-3
src/views/sms/advert/index.vue
src/views/sms/advert/index.vue
+33
-28
src/views/sms/coupon/index.vue
src/views/sms/coupon/index.vue
+196
-88
src/views/system/menu/components/Menu.vue
src/views/system/menu/components/Menu.vue
+11
-11
src/views/system/role/index.vue
src/views/system/role/index.vue
+43
-43
src/views/system/user/index.vue
src/views/system/user/index.vue
+31
-31
未找到文件。
docs/node_modules.zip
已删除
100644 → 0
浏览文件 @
f573d95c
文件已删除
src/api/pms/brand.ts
浏览文件 @
528a17fe
...
...
@@ -16,7 +16,7 @@ export function listBrandPages(
queryParams
:
BrandQueryParam
):
AxiosPromise
<
BrandPageResult
>
{
return
request
({
url
:
'
/mall-pms/api/v1/brands/page
'
,
url
:
'
/mall-pms/api/v1/brands/page
s
'
,
method
:
'
get
'
,
params
:
queryParams
,
});
...
...
src/api/pms/goods.ts
浏览文件 @
528a17fe
...
...
@@ -11,11 +11,11 @@ import { AxiosPromise } from 'axios';
*
* @param queryParams
*/
export
function
list
PageGood
s
(
export
function
list
SpuPage
s
(
queryParams
:
GoodsQueryParam
):
AxiosPromise
<
GoodsPageResult
>
{
return
request
({
url
:
'
/mall-pms/api/v1/
goods/page
'
,
url
:
'
/mall-pms/api/v1/
spu/pages
'
,
method
:
'
get
'
,
params
:
queryParams
,
});
...
...
@@ -26,9 +26,9 @@ export function listPageGoods(
*
* @param id
*/
export
function
get
Goods
Detail
(
id
:
string
):
AxiosPromise
<
GoodsDetail
>
{
export
function
get
Spu
Detail
(
id
:
string
):
AxiosPromise
<
GoodsDetail
>
{
return
request
({
url
:
'
/mall-pms/api/v1/
goods
/
'
+
id
,
url
:
'
/mall-pms/api/v1/
spu
/
'
+
id
,
method
:
'
get
'
,
});
}
...
...
@@ -38,9 +38,9 @@ export function getGoodsDetail(id: string): AxiosPromise<GoodsDetail> {
*
* @param data
*/
export
function
add
Goods
(
data
:
object
)
{
export
function
add
Spu
(
data
:
object
)
{
return
request
({
url
:
'
/mall-pms/api/v1/
goods
'
,
url
:
'
/mall-pms/api/v1/
spu
'
,
method
:
'
post
'
,
data
:
data
,
});
...
...
@@ -52,9 +52,9 @@ export function addGoods(data: object) {
* @param id
* @param data
*/
export
function
update
Goods
(
id
:
number
,
data
:
object
)
{
export
function
update
Spu
(
id
:
number
,
data
:
object
)
{
return
request
({
url
:
'
/mall-pms/api/v1/
goods
/
'
+
id
,
url
:
'
/mall-pms/api/v1/
spu
/
'
+
id
,
method
:
'
put
'
,
data
:
data
,
});
...
...
@@ -65,9 +65,9 @@ export function updateGoods(id: number, data: object) {
*
* @param ids
*/
export
function
delete
Goods
(
ids
:
string
)
{
export
function
delete
Spu
(
ids
:
string
)
{
return
request
({
url
:
'
/mall-pms/api/v1/
goods
/
'
+
ids
,
url
:
'
/mall-pms/api/v1/
spu
/
'
+
ids
,
method
:
'
delete
'
,
});
}
src/api/sms/advert.ts
浏览文件 @
528a17fe
...
...
@@ -11,11 +11,11 @@ import { AxiosPromise } from 'axios';
*
* @param queryParams
*/
export
function
listAdvert
sPage
(
export
function
listAdvert
Pages
(
queryParams
:
AdvertQueryParam
):
AxiosPromise
<
AdvertPageResult
>
{
return
request
({
url
:
'
/mall-sms/api/v1/adverts
'
,
url
:
'
/mall-sms/api/v1/adverts
/pages
'
,
method
:
'
get
'
,
params
:
queryParams
,
});
...
...
src/api/sms/coupon.ts
浏览文件 @
528a17fe
import
{
CouponQueryParam
,
CouponPageResult
,
CouponFormData
,
CouponFormData
}
from
'
@/types/api/sms/coupon
'
;
import
request
from
'
@/utils/request
'
;
import
{
AxiosPromise
}
from
'
axios
'
;
...
...
@@ -11,25 +11,25 @@ import { AxiosPromise } from 'axios';
*
* @param queryParams
*/
export
function
lis
tCouponsPage
(
export
function
lis
CoupontPages
(
queryParams
:
CouponQueryParam
):
AxiosPromise
<
CouponPageResult
>
{
return
request
({
url
:
'
/mall-sms/api/v1/coupons
/pagelist
'
,
url
:
'
/mall-sms/api/v1/coupons
'
,
method
:
'
get
'
,
params
:
queryParams
,
params
:
queryParams
});
}
/**
* 获取优惠券
详情
* 获取优惠券
表单数据
*
* @param id
*/
export
function
getCouponFormD
etail
(
id
:
number
):
AxiosPromise
<
CouponFormData
>
{
export
function
getCouponFormD
ata
(
id
:
number
):
AxiosPromise
<
CouponFormData
>
{
return
request
({
url
:
'
/mall-sms/api/v1/coupons/
'
+
id
,
method
:
'
get
'
,
url
:
'
/mall-sms/api/v1/coupons/
'
+
id
+
'
/form_data
'
,
method
:
'
get
'
});
}
...
...
@@ -42,7 +42,7 @@ export function addCoupon(data: CouponFormData) {
return
request
({
url
:
'
/mall-sms/api/v1/coupons
'
,
method
:
'
post
'
,
data
:
data
,
data
:
data
});
}
...
...
@@ -56,7 +56,7 @@ export function updateCoupon(id: number, data: CouponFormData) {
return
request
({
url
:
'
/mall-sms/api/v1/coupons/
'
+
id
,
method
:
'
put
'
,
data
:
data
,
data
:
data
});
}
...
...
@@ -68,6 +68,6 @@ export function updateCoupon(id: number, data: CouponFormData) {
export
function
deleteCoupons
(
ids
:
string
)
{
return
request
({
url
:
'
/mall-sms/api/v1/coupons/
'
+
ids
,
method
:
'
delete
'
,
method
:
'
delete
'
});
}
src/api/system/menu.ts
浏览文件 @
528a17fe
import
{
MenuFormData
,
MenuItem
,
MenuQueryParam
MenuQueryParam
,
}
from
'
@/types/api/system/menu
'
;
import
{
Option
}
from
'
@/types/common
'
;
import
request
from
'
@/utils/request
'
;
...
...
@@ -13,7 +13,7 @@ import { AxiosPromise } from 'axios';
export
function
listRoutes
()
{
return
request
({
url
:
'
/youlai-admin/api/v1/menus/routes
'
,
method
:
'
get
'
method
:
'
get
'
,
});
}
...
...
@@ -28,7 +28,7 @@ export function listMenus(
return
request
({
url
:
'
/youlai-admin/api/v1/menus
'
,
method
:
'
get
'
,
params
:
queryParams
params
:
queryParams
,
});
}
...
...
@@ -38,7 +38,7 @@ export function listMenus(
export
function
listMenuOptions
():
AxiosPromise
<
Option
[]
>
{
return
request
({
url
:
'
/youlai-admin/api/v1/menus/options
'
,
method
:
'
get
'
method
:
'
get
'
,
});
}
...
...
@@ -48,7 +48,7 @@ export function listMenuOptions(): AxiosPromise<Option[]> {
export
function
getResource
():
AxiosPromise
<
any
>
{
return
request
({
url
:
'
/youlai-admin/api/v1/menus/resources
'
,
method
:
'
get
'
method
:
'
get
'
,
});
}
...
...
@@ -59,7 +59,7 @@ export function getResource(): AxiosPromise<any> {
export
function
getMenuDetail
(
id
:
number
):
AxiosPromise
<
MenuFormData
>
{
return
request
({
url
:
'
/youlai-admin/api/v1/menus/
'
+
id
,
method
:
'
get
'
method
:
'
get
'
,
});
}
...
...
@@ -72,7 +72,7 @@ export function addMenu(data: MenuFormData) {
return
request
({
url
:
'
/youlai-admin/api/v1/menus
'
,
method
:
'
post
'
,
data
:
data
data
:
data
,
});
}
...
...
@@ -86,7 +86,7 @@ export function updateMenu(id: string, data: MenuFormData) {
return
request
({
url
:
'
/youlai-admin/api/v1/menus/
'
+
id
,
method
:
'
put
'
,
data
:
data
data
:
data
,
});
}
...
...
@@ -98,6 +98,6 @@ export function updateMenu(id: string, data: MenuFormData) {
export
function
deleteMenus
(
ids
:
string
)
{
return
request
({
url
:
'
/youlai-admin/api/v1/menus/
'
+
ids
,
method
:
'
delete
'
method
:
'
delete
'
,
});
}
src/api/system/role.ts
浏览文件 @
528a17fe
...
...
@@ -2,7 +2,7 @@ import {
RoleFormData
,
RolePageResult
,
RoleQueryParam
,
RoleResourceData
RoleResourceData
,
}
from
'
@/types/api/system/role
'
;
import
{
Option
}
from
'
@/types/common
'
;
...
...
@@ -20,7 +20,7 @@ export function listRolePages(
return
request
({
url
:
'
/youlai-admin/api/v1/roles/pages
'
,
method
:
'
get
'
,
params
:
queryParams
params
:
queryParams
,
});
}
...
...
@@ -35,7 +35,7 @@ export function listRoleOptions(
return
request
({
url
:
'
/youlai-admin/api/v1/roles/options
'
,
method
:
'
get
'
,
params
:
queryParams
params
:
queryParams
,
});
}
...
...
@@ -47,7 +47,7 @@ export function listRoleOptions(
export
function
getRoleResourceIds
(
roleId
:
string
):
AxiosPromise
<
any
>
{
return
request
({
url
:
'
/youlai-admin/api/v1/roles/
'
+
roleId
+
'
/resource_ids
'
,
method
:
'
get
'
method
:
'
get
'
,
});
}
...
...
@@ -63,7 +63,7 @@ export function updateRoleResource(
return
request
({
url
:
'
/youlai-admin/api/v1/roles/
'
+
roleId
+
'
/resources
'
,
method
:
'
put
'
,
data
:
data
data
:
data
,
});
}
...
...
@@ -75,7 +75,7 @@ export function updateRoleResource(
export
function
getRoleFormDetail
(
id
:
number
):
AxiosPromise
<
RoleFormData
>
{
return
request
({
url
:
'
/youlai-admin/api/v1/roles/
'
+
id
,
method
:
'
get
'
method
:
'
get
'
,
});
}
...
...
@@ -88,7 +88,7 @@ export function addRole(data: RoleFormData) {
return
request
({
url
:
'
/youlai-admin/api/v1/roles
'
,
method
:
'
post
'
,
data
:
data
data
:
data
,
});
}
...
...
@@ -102,7 +102,7 @@ export function updateRole(id: number, data: RoleFormData) {
return
request
({
url
:
'
/youlai-admin/api/v1/roles/
'
+
id
,
method
:
'
put
'
,
data
:
data
data
:
data
,
});
}
...
...
@@ -114,6 +114,6 @@ export function updateRole(id: number, data: RoleFormData) {
export
function
deleteRoles
(
ids
:
string
)
{
return
request
({
url
:
'
/youlai-admin/api/v1/roles/
'
+
ids
,
method
:
'
delete
'
method
:
'
delete
'
,
});
}
src/api/system/user.ts
浏览文件 @
528a17fe
...
...
@@ -4,7 +4,7 @@ import {
UserFormData
,
UserInfo
,
UserPageResult
,
UserQueryParam
UserQueryParam
,
}
from
'
@/types/api/system/user
'
;
/**
...
...
@@ -13,7 +13,7 @@ import {
export
function
getUserInfo
():
AxiosPromise
<
UserInfo
>
{
return
request
({
url
:
'
/youlai-admin/api/v1/users/me
'
,
method
:
'
get
'
method
:
'
get
'
,
});
}
...
...
@@ -28,7 +28,7 @@ export function listUserPages(
return
request
({
url
:
'
/youlai-admin/api/v1/users/pages
'
,
method
:
'
get
'
,
params
:
queryParams
params
:
queryParams
,
});
}
...
...
@@ -40,7 +40,7 @@ export function listUserPages(
export
function
getUserFormData
(
userId
:
number
):
AxiosPromise
<
UserFormData
>
{
return
request
({
url
:
'
/youlai-admin/api/v1/users/
'
+
userId
+
'
/form_data
'
,
method
:
'
get
'
method
:
'
get
'
,
});
}
...
...
@@ -53,7 +53,7 @@ export function addUser(data: any) {
return
request
({
url
:
'
/youlai-admin/api/v1/users
'
,
method
:
'
post
'
,
data
:
data
data
:
data
,
});
}
...
...
@@ -67,7 +67,7 @@ export function updateUser(id: number, data: UserFormData) {
return
request
({
url
:
'
/youlai-admin/api/v1/users/
'
+
id
,
method
:
'
put
'
,
data
:
data
data
:
data
,
});
}
...
...
@@ -81,7 +81,7 @@ export function updateUserPart(id: number, data: any) {
return
request
({
url
:
'
/youlai-admin/api/v1/users/
'
+
id
,
method
:
'
patch
'
,
data
:
data
data
:
data
,
});
}
...
...
@@ -93,7 +93,7 @@ export function updateUserPart(id: number, data: any) {
export
function
deleteUsers
(
ids
:
string
)
{
return
request
({
url
:
'
/youlai-admin/api/v1/users/
'
+
ids
,
method
:
'
delete
'
method
:
'
delete
'
,
});
}
...
...
@@ -106,7 +106,7 @@ export function downloadTemplate() {
return
request
({
url
:
'
/youlai-admin/api/v1/users/template
'
,
method
:
'
get
'
,
responseType
:
'
arraybuffer
'
responseType
:
'
arraybuffer
'
,
});
}
...
...
@@ -121,7 +121,7 @@ export function exportUser(queryParams: UserQueryParam) {
url
:
'
/youlai-admin/api/v1/users/_export
'
,
method
:
'
get
'
,
params
:
queryParams
,
responseType
:
'
arraybuffer
'
responseType
:
'
arraybuffer
'
,
});
}
...
...
@@ -140,7 +140,7 @@ export function importUser(deptId: number, roleIds: string, file: File) {
method
:
'
post
'
,
data
:
formData
,
headers
:
{
'
Content-Type
'
:
'
multipart/form-data
'
}
'
Content-Type
'
:
'
multipart/form-data
'
,
}
,
});
}
src/assets/icons/404.svg
已删除
100644 → 0
浏览文件 @
f573d95c
<svg
width=
"128"
height=
"128"
xmlns=
"http://www.w3.org/2000/svg"
><path
d=
"M121.718 73.272v9.953c3.957-7.584 6.199-16.05 6.199-24.995C127.917 26.079 99.273 0 63.958 0 28.644 0 0 26.079 0 58.23c0 .403.028.806.028 1.21l22.97-25.953h13.34l-19.76 27.187h6.42V53.77l13.728-19.477v49.361H22.998V73.272H2.158c5.951 20.284 23.608 36.208 45.998 41.399-1.44 3.3-5.618 11.263-12.565 12.674-8.607 1.764 23.358.428 46.163-13.178 17.519-4.611 31.938-15.849 39.77-30.513h-13.506V73.272H85.02V59.464l22.998-25.977h13.008l-19.429 27.187h6.421v-7.433l13.727-19.402v39.433h-.027zm-78.24 2.822a10.516 10.516 0 0 1-.996-4.535V44.548c0-1.613.332-3.124.996-4.535a11.66 11.66 0 0 1 2.713-3.68c1.134-1.032 2.49-1.864 4.04-2.468 1.55-.605 3.21-.908 4.982-.908h11.292c1.77 0 3.431.303 4.981.908 1.522.604 2.85 1.41 3.986 2.418l-12.26 16.303v-2.898a1.96 1.96 0 0 0-.665-1.512c-.443-.403-.996-.604-1.66-.604-.665 0-1.218.201-1.661.604a1.96 1.96 0 0 0-.664 1.512v9.071L44.364 77.606a10.556 10.556 0 0 1-.886-1.512zm35.73-4.535c0 1.613-.332 3.124-.997 4.535a11.66 11.66 0 0 1-2.712 3.68c-1.134 1.032-2.49 1.864-4.04 2.469-1.55.604-3.21.907-4.982.907H55.185c-1.77 0-3.431-.303-4.981-.907-1.55-.605-2.906-1.437-4.041-2.47a12.49 12.49 0 0 1-1.384-1.512l13.727-18.217v6.375c0 .605.222 1.109.665 1.512.442.403.996.604 1.66.604.664 0 1.218-.201 1.66-.604a1.96 1.96 0 0 0 .665-1.512V53.87L75.97 36.838c.913.932 1.66 1.99 2.214 3.175.664 1.41.996 2.922.996 4.535v27.011h.028z"
/></svg>
\ No newline at end of file
src/assets/icons/coupon.svg
0 → 100644
浏览文件 @
528a17fe
<svg
t=
"1656952898982"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"1483"
width=
"200"
height=
"200"
><path
d=
"M896 170.666667a85.333333 85.333333 0 0 1 85.333333 85.333333v170.666667h-85.333333l-6.4 0.213333a85.333333 85.333333 0 0 0 0 170.24L896 597.333333h85.333333v170.666667a85.333333 85.333333 0 0 1-85.333333 85.333333H128a85.333333 85.333333 0 0 1-85.333333-85.333333v-170.666667h85.333333a85.333333 85.333333 0 0 0 6.4-170.453333L128 426.666667H42.666667V256a85.333333 85.333333 0 0 1 85.333333-85.333333h768z m0 42.666666H128a42.666667 42.666667 0 0 0-42.368 37.674667L85.333333 256v128h44.245334l7.936 0.341333a128 128 0 0 1-2.005334 255.445334L128 640H85.333333v128a42.666667 42.666667 0 0 0 37.674667 42.368L128 810.666667h192v-42.666667h42.666667v42.666667H896a42.666667 42.666667 0 0 0 42.368-37.674667L938.666667 768v-128h-44.245334l-7.936-0.341333A128 128 0 0 1 768 512a128.213333 128.213333 0 0 1 112.554667-126.976l7.509333-0.768L896 384h42.666667V256a42.666667 42.666667 0 0 0-37.674667-42.368L896 213.333333zM362.666667 682.666667v42.666666h-42.666667v-42.666666h42.666667z m160.938666-327.082667l2.474667 2.816 1.962667 3.328 47.914666 100.096 48-100.096a21.333333 21.333333 0 0 1 39.850667 14.805333l-1.365333 3.626667-52.608 109.696 55.04 0.042667a21.333333 21.333333 0 0 1 3.84 42.325333l-3.84 0.341333L597.333333 532.522667v43.050666l67.541334 0.042667a21.333333 21.333333 0 0 1 3.84 42.325333l-3.84 0.341334L597.333333 618.24V682.666667a21.333333 21.333333 0 0 1-42.325333 3.84L554.666667 682.666667v-64.426667l-67.541334 0.042667a21.333333 21.333333 0 0 1-3.84-42.325334l3.84-0.341333L554.666667 575.573333v-43.050666l-67.541334 0.042666a21.333333 21.333333 0 0 1-3.84-42.325333l3.84-0.341333 54.997334-0.042667-52.565334-109.696a21.333333 21.333333 0 0 1 34.048-24.576zM362.666667 597.333333v42.666667h-42.666667v-42.666667h42.666667z m0-85.333333v42.666667h-42.666667v-42.666667h42.666667z m0-85.333333v42.666666h-42.666667v-42.666666h42.666667z m0-85.333334v42.666667h-42.666667V341.333333h42.666667z m0-85.333333v42.666667h-42.666667V256h42.666667z"
p-id=
"1484"
></path></svg>
src/layout/components/TagsView/index.vue
浏览文件 @
528a17fe
...
...
@@ -10,7 +10,7 @@
:key=
"tag.path"
:data-path=
"tag.path"
:class=
"isActive(tag) ? 'active' : ''"
:to=
"
{ path: tag.path, query: tag.query
, fullPath: tag.fullPath
}"
:to=
"
{ path: tag.path, query: tag.query }"
class="tags-view__item"
@click.middle="!isAffix(tag) ? closeSelectedTag(tag) : ''"
@contextmenu.prevent="openMenu(tag, $event)"
...
...
@@ -66,7 +66,7 @@ import {
ref
,
watch
,
onMounted
,
ComponentInternalInstance
,
ComponentInternalInstance
}
from
'
vue
'
;
import
path
from
'
path-browserify
'
;
...
...
@@ -103,11 +103,11 @@ watch(
},
{
//初始化立即执行
immediate
:
true
,
immediate
:
true
}
);
watch
(
visible
,
(
value
)
=>
{
watch
(
visible
,
value
=>
{
if
(
value
)
{
document
.
body
.
addEventListener
(
'
click
'
,
closeMenu
);
}
else
{
...
...
@@ -115,17 +115,17 @@ watch(visible, (value) => {
}
});
function
filterAffixTags
(
routes
:
RouteRecordRaw
[],
basePath
=
'
/
'
)
{
function
filterAffixTags
(
routes
:
any
[],
basePath
=
'
/
'
)
{
let
tags
:
TagView
[]
=
[];
routes
.
forEach
(
(
route
)
=>
{
routes
.
forEach
(
route
=>
{
if
(
route
.
meta
&&
route
.
meta
.
affix
)
{
const
tagPath
=
path
.
resolve
(
basePath
,
route
.
path
);
tags
.
push
({
fullPath
:
tagPath
,
path
:
tagPath
,
name
:
route
.
name
,
meta
:
{
...
route
.
meta
}
,
meta
:
{
...
route
.
meta
}
});
}
...
...
@@ -205,7 +205,7 @@ function refreshSelectedTag(view: TagView) {
tagsView
.
delCachedView
(
view
);
const
{
fullPath
}
=
view
;
nextTick
(()
=>
{
router
.
replace
({
path
:
'
/redirect
'
+
fullPath
}).
catch
(
(
err
)
=>
{
router
.
replace
({
path
:
'
/redirect
'
+
fullPath
}).
catch
(
err
=>
{
console
.
warn
(
err
);
});
});
...
...
src/permission.ts
浏览文件 @
528a17fe
...
...
@@ -21,7 +21,7 @@ router.beforeEach(async (to, from, next) => {
const
hasGetUserInfo
=
user
.
roles
.
length
>
0
;
if
(
hasGetUserInfo
)
{
if
(
to
.
matched
.
length
===
0
)
{
from
.
name
?
next
({
name
:
from
.
name
})
:
next
(
'
/401
'
);
from
.
name
?
next
({
name
:
from
.
name
as
any
})
:
next
(
'
/401
'
);
}
else
{
next
();
}
...
...
src/types/api/oms/order.d.ts
浏览文件 @
528a17fe
...
...
@@ -19,7 +19,7 @@ export interface Order {
payType
:
number
;
status
:
number
;
totalQuantity
:
number
;
gmtCreat
e
:
string
;
createTim
e
:
string
;
memberId
:
string
;
sourceType
:
number
;
orderItems
:
OrderItem
[];
...
...
src/types/api/sms/advert.d.ts
浏览文件 @
528a17fe
import
{
PageQueryParam
,
PageResult
}
from
'
../base
'
;
/**
* 广告查询参数类型
声明
* 广告查询参数类型
*/
export
interface
AdvertQueryParam
extends
PageQueryParam
{
title
?
:
string
;
keywords
:
string
;
}
/**
* 广告分页列表项
声明
* 广告分页列表项
*/
export
interface
AdvertItem
{
id
:
string
;
...
...
@@ -18,12 +18,12 @@ export interface AdvertItem {
}
/**
* 广告分页项类型
声明
* 广告分页项类型
*/
export
type
AdvertPageResult
=
PageResult
<
AdvertItem
[]
>
;
/**
* 广告表单类型
声明
* 广告表单类型
*/
export
interface
AdvertFormData
{
id
?:
number
;
...
...
src/types/api/sms/coupon.ts
浏览文件 @
528a17fe
import
{
PageQueryParam
,
PageResult
}
from
'
../base
'
;
import
{
PageQueryParam
,
PageResult
}
from
'
../base
'
;
import
{
Option
}
from
'
@/types/common
'
;
/**
* 优惠券查询参数类型
*/
export
interface
CouponQueryParam
extends
PageQueryParam
{
status
?:
number
;
keywords
?:
string
;
}
/**
* 优惠券分页列表项
*/
export
interface
CouponItem
{
export
interface
CouponItem
{
id
:
string
;
name
:
string
;
type
:
string
;
code
:
string
;
platformLabel
:
string
;
typeLabel
:
string
;
faceValueLabel
:
string
;
validityPeriodLabel
:
string
;
}
/**
*优惠券分页
项类型
*优惠券分页
*/
export
type
CouponPageResult
=
PageResult
<
CouponItem
[]
>
;
/**
*
广告表单类型声明
*
优惠券表单类型
*/
export
interface
CouponFormData
{
export
interface
CouponFormData
{
/**
* ID
*/
id
?:
number
;
/**
* 优惠券名称
*/
name
:
string
;
type
:
string
;
/**
* 优惠券码
*/
code
:
string
;
/**
* 使用平台(0:全平台;1:移动端;2:PC;)
*/
platform
:
number
;
/**
* 优惠券类型(1:满减券;2:直减券;3:折扣券)
*/
type
:
number
;
/**
* 优惠券面值
*/
faceValue
:
number
;
/**
* 优惠券折扣
*/
discount
:
number
;
/**
* 发放数量
*/
issueCount
:
number
;
/**
* 使用门槛(0:无门槛)
*/
minPoint
:
number
;
/**
* 每人限领张数(-1:无限制)
*/
perLimit
:
number
;
/**
* 有效期类型(1:自领取之日起有效天数;2:有效起止时间)
*/
validityPeriodType
:
number
;
/**
* 自领取之日起有效天数
*/
validityDays
:
number
;
/**
* 有效期起始时间
*/
validityBeginTime
:
string
;
/**
* 有效期截止时间
*/
validityEndTime
:
string
;
/**
* 使用类型(0:全场通用;1:指定商品分类;2:指定商品)
*/
useType
:
number
;
/**
* 使用类型:指定商品分类
*/
spuCategoryList
:
CouponSpuCategory
[];
/**
* 使用类型:指定商品
*/
spuList
:
CouponSpu
[];
/**
* 使用说明
*/
remark
:
string
;
}
export
interface
CouponSpuCategory
{
id
:
number
;
categoryId
:
number
;
categoryName
:
string
;
}
export
interface
CouponSpu
{
id
:
number
;
spuId
:
number
;
spuName
:
string
;
}
src/types/api/system/menu.d.ts
浏览文件 @
528a17fe
...
...
@@ -2,7 +2,7 @@
* 菜单查询参数类型声明
*/
export
interface
MenuQueryParam
{
name
?
:
string
;
name
:
string
;
}
/**
...
...
@@ -12,8 +12,8 @@ export interface MenuQueryParam {
export
interface
MenuItem
{
id
:
number
;
parentId
:
number
;
gmtCreat
e
:
string
;
gmtModified
:
string
;
createTim
e
:
string
;
updateTime
:
string
;
name
:
string
;
icon
:
string
;
component
:
string
;
...
...
src/types/api/system/user.d.ts
浏览文件 @
528a17fe
...
...
@@ -33,7 +33,7 @@ export interface UserItem {
status
:
number
;
deptName
:
string
;
roleNames
:
string
;
gmtCreat
e
:
string
;
createTim
e
:
string
;
}
/**
...
...
src/views/pms/goods/components/GoodsInfo.vue
浏览文件 @
528a17fe
...
...
@@ -53,10 +53,7 @@
<single-upload
v-model=
"item.url"
:show-close=
"true"
/>
<div
v-if=
"item.url"
>
<el-link
type=
"danger"
class=
"button"
v-if=
"item.main == true"
<el-link
type=
"danger"
class=
"button"
v-if=
"item.main == true"
>
商品主图
</el-link
>
<el-link
...
...
@@ -64,7 +61,8 @@
class=
"button"
v-else
@
click=
"changeMainPicture(index)"
>
设为主图
</el-link>
>
设为主图
</el-link
>
</div>
<div
v-else
>
...
...
@@ -120,7 +118,7 @@ const state = reactive({
brandOptions
:
[]
as
Array
<
any
>
,
// 商品图册
pictures
:
[
{
url
:
undefined
,
main
:
true
},
// main
= true
代表主图,可切换
{
url
:
undefined
,
main
:
true
},
// main
为true
代表主图,可切换
{
url
:
undefined
,
main
:
false
},
{
url
:
undefined
,
main
:
false
},
{
url
:
undefined
,
main
:
false
},
...
...
@@ -142,10 +140,12 @@ function loadData() {
});
const
goodsId
=
goodsInfo
.
value
.
id
;
if
(
goodsId
)
{
// 主图
const
mainPicUrl
=
goodsInfo
.
value
.
picUrl
;
if
(
mainPicUrl
)
{
state
.
pictures
.
filter
((
item
)
=>
item
.
main
)[
0
].
url
=
mainPicUrl
;
}
// 商品副图
const
subPicUrls
=
goodsInfo
.
value
.
subPicUrls
;
if
(
subPicUrls
&&
subPicUrls
.
length
>
0
)
{
for
(
let
i
=
1
;
i
<=
subPicUrls
.
length
;
i
++
)
{
...
...
@@ -175,18 +175,21 @@ function handlePrev() {
function
handleNext
()
{
dataFormRef
.
value
.
validate
((
valid
:
any
)
=>
{
if
(
valid
)
{
// 商品
图片
// 商品
主图
const
mainPicUrl
=
state
.
pictures
.
filter
((
item
)
=>
item
.
main
==
true
&&
item
.
url
)
.
map
((
item
)
=>
item
.
url
);
if
(
mainPicUrl
&&
mainPicUrl
.
length
>
0
)
{
goodsInfo
.
value
.
picUrl
=
mainPicUrl
[
0
];
}
const
subPicUrl
=
state
.
pictures
// 商品副图
const
subPicUrls
=
state
.
pictures
.
filter
((
item
)
=>
item
.
main
==
false
&&
item
.
url
)
.
map
((
item
)
=>
item
.
url
);
if
(
subPicUrl
&&
subPicUrl
.
length
>
0
)
{
goodsInfo
.
value
.
subPicUrls
=
subPicUrl
;
if
(
subPicUrls
&&
subPicUrls
.
length
>
0
)
{
goodsInfo
.
value
.
subPicUrls
=
subPicUrls
;
}
else
{
goodsInfo
.
value
.
subPicUrls
=
[];
}
emit
(
'
next
'
);
}
...
...
src/views/pms/goods/components/GoodsStock.vue
浏览文件 @
528a17fe
...
...
@@ -180,34 +180,23 @@
</template>
<
script
setup
lang=
"ts"
>
import
{
computed
,
nextTick
,
onMounted
,
reactive
,
ref
,
toRefs
,
watch
,
}
from
'
vue
'
;
import
{
computed
,
onMounted
,
reactive
,
ref
,
toRefs
,
watch
}
from
'
vue
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
Plus
,
Minus
}
from
'
@element-plus/icons-vue
'
;
import
{
ElNotification
,
ElMessage
,
ElTable
,
ElForm
}
from
'
element-plus
'
;
// API 引用
import
{
listAttributes
}
from
'
@/api/pms/attribute
'
;
import
{
add
Goods
,
updateGoods
}
from
'
@/api/pms/goods
'
;
import
{
add
Spu
,
updateSpu
}
from
'
@/api/pms/goods
'
;
// 自定义组件引用
import
SvgIcon
from
'
@/components/SvgIcon/index.vue
'
;
import
SingleUpload
from
'
@/components/Upload/SingleUpload.vue
'
;
// import Sortable from 'sortablejs'
const
emit
=
defineEmits
([
'
prev
'
,
'
next
'
,
'
update:modelValue
'
]);
/* const proxy = getCurrentInstance(); */
const
router
=
useRouter
();
/* const specTableRef = ref(ElTable); */
const
specFormRef
=
ref
(
ElForm
);
const
skuFormRef
=
ref
(
ElForm
);
...
...
@@ -326,10 +315,6 @@ function loadData() {
handleSpecChange
();
handleSpecReorder
();
nextTick
(()
=>
{
// registerSpecDragSortEvent()
});
}
/**
...
...
@@ -349,28 +334,6 @@ function handleSpecReorder() {
});
}
/**
* 注册拖拽排序事件
*/
/*function registerSpecDragSortEvent() {
const el = specTableRef.value.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
Sortable.create(el, {
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
setData: function (dataTransfer: any) {
dataTransfer.setData('Text', '')
},
onEnd: (evt: any) => {
// oldIndex 拖拽行当前所在索引
// newIndex 拖拽行目标索引
const targetRow = state.specForm.specList.splice(evt.oldIndex, 1)[0] // 返回被删除的行
state.specForm.specList.splice(evt.newIndex, 0, targetRow) // 拼接
generateSkuList() // 重新生成sku
handleSpecChange()
handleSpecReorder()
}
})
}*/
/**
* 根据商品规格笛卡尔积生成SKU列表
*
...
...
@@ -623,7 +586,7 @@ function submitForm() {
const
goodsId
=
goodsInfo
.
value
.
id
;
if
(
goodsId
)
{
// 编辑商品提交
update
Goods
(
goodsId
,
submitsData
).
then
(()
=>
{
update
Spu
(
goodsId
,
submitsData
).
then
(()
=>
{
router
.
push
({
path
:
'
/pms/goods
'
});
ElNotification
({
title
:
'
提示
'
,
...
...
@@ -633,7 +596,7 @@ function submitForm() {
});
}
else
{
// 新增商品提交
add
Goods
(
submitsData
).
then
(()
=>
{
add
Spu
(
submitsData
).
then
(()
=>
{
router
.
push
({
path
:
'
/pms/goods
'
});
ElNotification
({
title
:
'
提示
'
,
...
...
@@ -648,21 +611,6 @@ function submitForm() {
});
}
/* function openFullScreen() {
state.loading = (proxy as any).$loading({
lock: true,
text: "商品信息提交中,请等待...",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
}
function closeFullScreen() {
if (state.loading) {
(state.loading as any).close();
}
} */
function
handlePrev
()
{
emit
(
'
prev
'
);
}
...
...
src/views/pms/goods/detail.vue
浏览文件 @
528a17fe
...
...
@@ -51,7 +51,7 @@ import GoodsInfo from './components/GoodsInfo.vue';
import
GoodsAttribute
from
'
./components/GoodsAttribute.vue
'
;
import
GoodsStock
from
'
./components/GoodsStock.vue
'
;
import
{
get
Goods
Detail
}
from
'
@/api/pms/goods
'
;
import
{
get
Spu
Detail
}
from
'
@/api/pms/goods
'
;
import
{
useRoute
}
from
'
vue-router
'
;
import
{
GoodsDetail
}
from
'
@/types/api/pms/goods
'
;
...
...
@@ -74,7 +74,7 @@ function loadData() {
const
goodsId
=
route
.
query
.
goodsId
as
string
;
if
(
goodsId
)
{
get
Goods
Detail
(
goodsId
).
then
((
response
)
=>
{
get
Spu
Detail
(
goodsId
).
then
((
response
)
=>
{
state
.
goodsInfo
=
response
.
data
;
state
.
goodsInfo
.
originPrice
=
(
state
.
goodsInfo
.
originPrice
as
any
)
/
100
;
state
.
goodsInfo
.
price
=
(
state
.
goodsInfo
.
price
as
any
)
/
100
;
...
...
src/views/pms/goods/index.vue
浏览文件 @
528a17fe
...
...
@@ -18,7 +18,7 @@ import {
Delete
,
View
,
}
from
'
@element-plus/icons-vue
'
;
import
{
list
PageGoods
,
deleteGoods
}
from
'
@/api/pms/goods
'
;
import
{
list
SpuPages
,
deleteSpu
}
from
'
@/api/pms/goods
'
;
import
{
listCascadeCategories
}
from
'
@/api/pms/category
'
;
import
{
GoodsItem
,
GoodsQueryParam
}
from
'
@/types/api/pms/goods
'
;
import
{
moneyFormatter
}
from
'
@/utils/filter
'
;
...
...
@@ -59,7 +59,7 @@ const {
function
handleQuery
()
{
state
.
loading
=
true
;
list
PageGood
s
(
state
.
queryParams
).
then
(({
data
})
=>
{
list
SpuPage
s
(
state
.
queryParams
).
then
(({
data
})
=>
{
state
.
goodsList
=
data
.
list
;
state
.
total
=
data
.
total
;
state
.
loading
=
false
;
...
...
@@ -100,7 +100,7 @@ function handleDelete(row: any) {
type
:
'
warning
'
,
})
.
then
(
function
()
{
return
delete
Goods
(
ids
);
return
delete
Spu
(
ids
);
})
.
then
(()
=>
{
ElMessage
.
success
(
'
删除成功
'
);
...
...
src/views/sms/advert/index.vue
浏览文件 @
528a17fe
<
script
lang=
"ts"
>
export
default
{
name
:
'
advert
'
,
name
:
'
advert
'
};
</
script
>
...
...
@@ -10,21 +10,21 @@ import { ElForm, ElMessage, ElMessageBox } from 'element-plus';
import
{
Search
,
Plus
,
Edit
,
Refresh
,
Delete
}
from
'
@element-plus/icons-vue
'
;
import
SingleUpload
from
'
@/components/Upload/SingleUpload.vue
'
;
import
{
listAdvert
sPage
,
listAdvert
Pages
,
getAdvertFormDetail
,
updateAdvert
,
addAdvert
,
deleteAdverts
,
deleteAdverts
}
from
'
@/api/sms/advert
'
;
import
{
Dialog
}
from
'
@/types/common
'
;
import
{
AdvertFormData
,
AdvertItem
,
AdvertQueryParam
,
AdvertQueryParam
}
from
'
@/types/api/sms/advert
'
;
const
queryFormRef
=
ref
(
ElForm
);
// 属性名必须和元素的ref属性值一致
const
dataFormRef
=
ref
(
ElForm
);
// 属性名必须和元素的ref属性值一致
const
queryFormRef
=
ref
(
ElForm
);
const
dataFormRef
=
ref
(
ElForm
);
const
state
=
reactive
({
loading
:
true
,
...
...
@@ -37,17 +37,16 @@ const state = reactive({
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
}
as
AdvertQueryParam
,
advertList
:
[]
as
AdvertItem
[],
total
:
0
,
dialog
:
{}
as
Dialog
,
dialog
:
{
title
:
''
,
visible
:
false
}
as
Dialog
,
formData
:
{
status
:
1
,
sort
:
100
,
sort
:
100
}
as
AdvertFormData
,
rules
:
{
title
:
[{
required
:
true
,
message
:
'
请输入广告名称
'
,
trigger
:
'
blur
'
}],
beginTime
:
[{
required
:
true
,
message
:
'
请填写开始时间
'
,
trigger
:
'
blur
'
}],
endTime
:
[{
required
:
true
,
message
:
'
请填写结束时间
'
,
trigger
:
'
blur
'
}],
picUrl
:
[{
required
:
true
,
message
:
'
请上传广告图片
'
,
trigger
:
'
blur
'
}],
picUrl
:
[{
required
:
true
,
message
:
'
请上传广告图片
'
,
trigger
:
'
blur
'
}]
},
validityPeriod
:
''
as
any
});
const
{
...
...
@@ -59,11 +58,12 @@ const {
dialog
,
formData
,
rules
,
validityPeriod
}
=
toRefs
(
state
);
function
handleQuery
()
{
state
.
loading
=
true
;
listAdvert
sPage
(
state
.
queryParams
).
then
(({
data
})
=>
{
listAdvert
Pages
(
state
.
queryParams
).
then
(({
data
})
=>
{
state
.
advertList
=
data
.
list
;
state
.
total
=
data
.
total
;
state
.
loading
=
false
;
...
...
@@ -84,18 +84,19 @@ function handleSelectionChange(selection: any) {
function
handleAdd
()
{
state
.
dialog
=
{
title
:
'
添加广告
'
,
visible
:
true
,
visible
:
true
};
}
function
handleUpdate
(
row
:
any
)
{
state
.
dialog
=
{
title
:
'
修改广告
'
,
visible
:
true
,
visible
:
true
};
const
advertId
=
row
.
id
||
state
.
ids
;
getAdvertFormDetail
(
advertId
).
then
((
response
)
=>
{
state
.
formData
=
response
.
data
;
getAdvertFormDetail
(
advertId
).
then
(({
data
})
=>
{
state
.
formData
=
data
;
validityPeriod
.
value
=
[
data
.
beginTime
,
data
.
endTime
];
});
}
...
...
@@ -104,6 +105,12 @@ function submitForm() {
if
(
valid
)
{
const
avertId
=
state
.
formData
.
id
;
if
(
avertId
)
{
// 有效期转换
if
(
validityPeriod
.
value
)
{
formData
.
value
.
beginTime
=
validityPeriod
.
value
[
0
];
formData
.
value
.
endTime
=
validityPeriod
.
value
[
1
];
}
updateAdvert
(
avertId
,
state
.
formData
).
then
(()
=>
{
ElMessage
.
success
(
'
修改成功
'
);
cancel
();
...
...
@@ -131,7 +138,7 @@ function handleDelete(row: any) {
ElMessageBox
.
confirm
(
'
确认删除已选中的数据项?
'
,
'
警告
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
,
type
:
'
warning
'
})
.
then
(()
=>
{
deleteAdverts
(
ids
).
then
(()
=>
{
...
...
@@ -166,8 +173,8 @@ onMounted(() => {
<el-form-item
prop=
"title"
>
<el-input
v-model=
"queryParams.
title
"
placeholder=
"
广告
标题"
v-model=
"queryParams.
keywords
"
placeholder=
"标题"
clearable
@
keyup.enter=
"handleQuery"
/>
...
...
@@ -252,16 +259,14 @@ onMounted(() => {
<el-input
v-model=
"formData.title"
/>
</el-form-item>
<el-form-item
label=
"有效期"
prop=
"beginTime"
>
<el-date-picker
v-model=
"formData.beginTime"
placeholder=
"开始时间"
value-format=
"YYYY-MM-DD"
/>
~
<el-form-item
label=
"有效期"
>
<el-date-picker
v-model=
"formData.endTime"
placeholder=
"结束时间"
v-model=
"validityPeriod"
type=
"daterange"
range-separator=
"~"
start-placeholder=
"起始时间"
end-placeholder=
"截止时间"
format=
"YYYY-MM-DD"
value-format=
"YYYY-MM-DD"
/>
</el-form-item>
...
...
src/views/sms/coupon/index.vue
浏览文件 @
528a17fe
<!--优惠券管理-->
<
script
lang=
"ts"
>
export
default
{
name
:
'
advert
'
,
name
:
'
coupon
'
};
</
script
>
...
...
@@ -9,45 +10,50 @@ import { onMounted, reactive, ref, toRefs } from 'vue';
import
{
ElForm
,
ElMessage
,
ElMessageBox
}
from
'
element-plus
'
;
import
{
Search
,
Plus
,
Edit
,
Refresh
,
Delete
}
from
'
@element-plus/icons-vue
'
;
import
{
lis
tCouponsPage
,
getCouponFormD
etail
,
lis
CoupontPages
,
getCouponFormD
ata
,
updateCoupon
,
addCoupon
,
deleteCoupons
,
deleteCoupons
}
from
'
@/api/sms/coupon
'
;
import
{
Dialog
}
from
'
@/types/common
'
;
import
{
CouponItem
,
CouponQueryParam
,
CouponFormData
,
CouponFormData
}
from
'
@/types/api/sms/coupon
'
;
const
queryFormRef
=
ref
(
ElForm
);
// 属性名必须和元素的ref属性值一致
const
dataFormRef
=
ref
(
ElForm
);
// 属性名必须和元素的ref属性值一致
const
queryFormRef
=
ref
(
ElForm
);
const
dataFormRef
=
ref
(
ElForm
);
const
state
=
reactive
({
loading
:
true
,
// 选中ID数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
}
as
CouponQueryParam
,
couponList
:
[]
as
CouponItem
[],
total
:
0
,
dialog
:
{}
as
Dialog
,
dialog
:
{
title
:
''
,
visible
:
false
}
as
Dialog
,
formData
:
{
id
:
undefined
,
name
:
''
,
type
:
''
,
type
:
1
,
platform
:
0
,
validityPeriodType
:
1
,
perLimit
:
1
,
useType
:
0
//使用类型(默认全场通用)
}
as
CouponFormData
,
rules
:
{
title
:
[{
required
:
true
,
message
:
'
请输入优惠券名称
'
,
trigger
:
'
blur
'
}],
beginTime
:
[{
required
:
true
,
message
:
'
请填写开始时间
'
,
trigger
:
'
blur
'
}],
endTime
:
[{
required
:
true
,
message
:
'
请填写结束时间
'
,
trigger
:
'
blur
'
}],
picUrl
:
[{
required
:
true
,
message
:
'
请上传优惠券图片
'
,
trigger
:
'
blur
'
}]
,
picUrl
:
[{
required
:
true
,
message
:
'
请上传优惠券图片
'
,
trigger
:
'
blur
'
}]
},
validityPeriod
:
''
as
any
,
totalCountChecked
:
false
,
perLimitChecked
:
false
});
const
{
...
...
@@ -59,17 +65,25 @@ const {
dialog
,
formData
,
rules
,
validityPeriod
,
totalCountChecked
,
perLimitChecked
}
=
toRefs
(
state
);
/**
* 查询
*/
function
handleQuery
()
{
state
.
loading
=
true
;
lis
tCouponsPage
(
state
.
queryParams
).
then
(({
data
})
=>
{
state
.
couponList
=
data
.
list
;
state
.
total
=
data
.
total
;
state
.
loading
=
false
;
lis
CoupontPages
(
queryParams
.
value
).
then
(({
data
})
=>
{
couponList
.
value
=
data
.
list
;
total
.
value
=
data
.
total
;
loading
.
value
=
false
;
});
}
/**
* 查询重置
*/
function
resetQuery
()
{
queryFormRef
.
value
.
resetFields
();
handleQuery
();
...
...
@@ -82,36 +96,49 @@ function handleSelectionChange(selection: any) {
}
function
handleAdd
()
{
state
.
dialog
=
{
dialog
.
value
=
{
title
:
'
添加优惠券
'
,
visible
:
true
,
visible
:
true
};
}
function
handleUpdate
(
row
:
any
)
{
state
.
dialog
=
{
dialog
.
value
=
{
title
:
'
修改优惠券
'
,
visible
:
true
,
visible
:
true
};
const
advertId
=
row
.
id
||
state
.
ids
;
getCouponFormDetail
(
advertId
).
then
((
response
)
=>
{
state
.
formData
=
response
.
data
;
const
id
=
row
.
id
;
getCouponFormData
(
id
).
then
(({
data
})
=>
{
formData
.
value
=
data
;
perLimitChecked
.
value
=
data
.
perLimit
==
-
1
;
totalCountChecked
.
value
=
data
.
issueCount
==
-
1
;
// 有效期转换
if
(
data
.
validityPeriodType
==
2
)
{
validityPeriod
.
value
=
[
data
.
validityBeginTime
,
data
.
validityEndTime
];
}
});
}
function
submitForm
()
{
console
.
log
(
'
validityPeriod
'
,
validityPeriod
.
value
[
0
]);
dataFormRef
.
value
.
validate
((
valid
:
any
)
=>
{
if
(
valid
)
{
const
avertId
=
state
.
formData
.
id
;
if
(
avertId
)
{
updateCoupon
(
avertId
,
state
.
formData
).
then
(()
=>
{
ElMessage
.
success
(
'
修改成功
'
);
// 有效期转换
if
(
formData
.
value
.
validityPeriodType
==
2
&&
validityPeriod
.
value
)
{
formData
.
value
.
validityBeginTime
=
validityPeriod
.
value
[
0
];
formData
.
value
.
validityEndTime
=
validityPeriod
.
value
[
1
];
}
const
couponId
=
formData
.
value
.
id
;
if
(
couponId
)
{
updateCoupon
(
couponId
,
formData
.
value
).
then
(()
=>
{
ElMessage
.
success
(
'
修改优惠券成功
'
);
cancel
();
handleQuery
();
});
}
else
{
addCoupon
(
state
.
formData
).
then
(()
=>
{
ElMessage
.
success
(
'
新增成功
'
);
addCoupon
(
formData
.
value
).
then
(()
=>
{
ElMessage
.
success
(
'
新增
优惠券
成功
'
);
cancel
();
handleQuery
();
});
...
...
@@ -120,18 +147,32 @@ function submitForm() {
});
}
const
handleTotalCountChange
=
(
val
:
any
)
=>
{
formData
.
value
.
issueCount
=
-
1
;
};
const
hanclePerLimitChange
=
(
val
:
any
)
=>
{
formData
.
value
.
perLimit
=
-
1
;
};
/**
* 表单取消
*/
function
cancel
()
{
state
.
formData
.
id
=
undefined
;
dataFormRef
.
value
.
resetFields
();
state
.
dialog
.
visible
=
false
;
}
/**
* 删除优惠券
*/
function
handleDelete
(
row
:
any
)
{
const
ids
=
[
row
.
id
||
state
.
ids
].
join
(
'
,
'
);
ElMessageBox
.
confirm
(
'
确认删除已选中的数据项?
'
,
'
警告
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
,
type
:
'
warning
'
})
.
then
(()
=>
{
deleteCoupons
(
ids
).
then
(()
=>
{
...
...
@@ -164,10 +205,10 @@ onMounted(() => {
>
</el-form-item>
<el-form-item
prop=
"
title
"
>
<el-form-item
prop=
"
keywords
"
>
<el-input
v-model=
"queryParams.
statu
s"
placeholder=
"优惠券
标题
"
v-model=
"queryParams.
keyword
s"
placeholder=
"优惠券
名称
"
clearable
@
keyup.enter=
"handleQuery"
/>
...
...
@@ -188,29 +229,27 @@ onMounted(() => {
>
<el-table-column
type=
"selection"
min-width=
"5"
align=
"center"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"80"
align=
"center"
/>
<el-table-column
prop=
"title"
min-width=
"100"
label=
"优惠券标题"
/>
<el-table-column
label=
"优惠券图片"
width=
"100"
>
<template
#default
="
scope
"
>
<el-popover
placement=
"right"
:width=
"400"
trigger=
"hover"
>
<img
:src=
"scope.row.picUrl"
width=
"400"
height=
"400"
/>
<template
#reference
>
<img
:src=
"scope.row.picUrl"
style=
"max-height: 60px; max-width: 60px"
/>
</
template
>
</el-popover>
</template>
</el-table-column>
<el-table-column
prop=
"beginTime"
label=
"开始时间"
width=
"150"
/>
<el-table-column
prop=
"endTime"
label=
"结束时间"
width=
"150"
/>
<el-table-column
prop=
"status"
label=
"状态"
width=
"100"
>
<
template
#default=
"scope"
>
<el-tag
v-if=
"scope.row.status === 1"
type=
"success"
>
开启
</el-tag>
<el-tag
v-else
type=
"info"
>
关闭
</el-tag>
</
template
>
</el-table-column>
<el-table-column
prop=
"sort"
label=
"排序"
width=
"80"
/>
<el-table-column
prop=
"name"
min-width=
"100"
label=
"优惠券名称"
/>
<el-table-column
prop=
"code"
min-width=
"100"
label=
"优惠券码"
/>
<el-table-column
prop=
"platformLabel"
min-width=
"100"
label=
"使用平台"
/>
<el-table-column
prop=
"typeLabel"
min-width=
"100"
label=
"类型"
/>
<el-table-column
prop=
"faceValueLabel"
min-width=
"100"
label=
"面值/折扣"
/>
<el-table-column
prop=
"minPointLabel"
min-width=
"100"
label=
"使用门槛(元)"
/>
<el-table-column
prop=
"validityPeriodLabel"
min-width=
"200"
label=
"有效期"
/>
<el-table-column
prop=
"remark"
label=
"使用说明"
/>
<el-table-column
label=
"操作"
align=
"center"
width=
"150"
>
<template
#default
="
scope
"
>
<el-button
...
...
@@ -241,53 +280,122 @@ onMounted(() => {
/>
<!-- 表单弹窗 -->
<el-dialog
:title=
"dialog.title"
v-model=
"dialog.visible"
width=
"
7
00px"
>
<el-dialog
:title=
"dialog.title"
v-model=
"dialog.visible"
width=
"
10
00px"
>
<el-form
ref=
"dataFormRef"
:model=
"formData"
:rules=
"rules"
label-width=
"1
0
0px"
label-width=
"1
5
0px"
>
<
!-- <el-form-item label="优惠券标题" prop="titl
e">
<el-input v-model="formData.
titl
e" />
<
el-form-item
label=
"优惠券名称"
prop=
"nam
e"
>
<el-input
v-model=
"formData.
nam
e"
/>
</el-form-item>
<el-form-item label="有效期" prop="beginTime">
<el-date-picker
v-model="formData.beginTime"
placeholder="开始时间"
value-format="YYYY-MM-DD"
/>
~
<el-date-picker
v-model="formData.endTime"
placeholder="结束时间"
value-format="YYYY-MM-DD"
/>
<el-form-item
label=
"适用类型"
prop=
"useType"
>
<el-radio-group
v-model=
"formData.useType"
>
<el-radio
:label=
"0"
>
全场通用
</el-radio>
<el-radio
:label=
"1"
>
指定商品分类
</el-radio>
<el-radio
:label=
"2"
>
指定商品
</el-radio>
</el-radio-group>
<!--指定商品分类-->
<el-tag
v-for=
"item in formData.spuCategoryList"
:key=
"item.categoryId"
closable
>
{{ item.categoryName }}
</el-tag>
<!--指定商品列表-->
<el-tag
v-for=
"item in formData.spuList"
:key=
"item.spuId"
closable
>
{{ item.spuName }}
</el-tag>
</el-form-item>
<el-form-item
label=
"优惠券类型"
prop=
"type"
>
<el-radio-group
v-model=
"formData.type"
>
<el-radio
:label=
"1"
>
满减券
</el-radio>
<el-radio
:label=
"2"
>
直减券
</el-radio>
<el-radio
:label=
"3"
>
折扣券
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="优惠券图片" prop="picUrl">
<single-upload v-model="formData.picUrl" />
<el-form-item
label=
"优惠券面值(元)"
v-if=
"formData.type == 2 || formData.type == 3"
prop=
"faceValue"
>
<el-input
v-model=
"formData.faceValue"
/>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="formData.sort" style="width: 200px" />
<el-form-item
label=
"优惠券折扣"
v-if=
"formData.type == 3"
prop=
"discount"
>
<el-input
v-model=
"formData.discount"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="1">开启</el-radio>
<el-radio :label="0">关闭</el-radio>
<el-form-item
label=
"最低消费金额(元)"
prop=
"minPoint"
>
<el-input
v-model=
"formData.minPoint"
/>
</el-form-item>
<el-form-item
label=
"有效期类型"
prop=
"validType"
>
<el-radio-group
v-model=
"formData.validityPeriodType"
>
<el-radio
:label=
"1"
>
自领取之日起有效天数
</el-radio>
<el-radio
:label=
"2"
>
有效起止时间
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="跳转链接" prop="url">
<el-input v-model="formData.url" />
<el-form-item
label=
"有效天数"
v-if=
"formData.validityPeriodType == 1"
prop=
"validDays"
>
<el-input
v-model=
"formData.validityDays"
/>
</el-form-item>
<el-form-item
label=
"有效期"
v-if=
"formData.validityPeriodType == 2"
>
<el-date-picker
v-model=
"validityPeriod"
type=
"daterange"
range-separator=
"~"
start-placeholder=
"起始时间"
end-placeholder=
"截止时间"
format=
"YYYY-MM-DD HH:mm:ss"
value-format=
"YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-form-item
label=
"发放数量"
prop=
"totalCount"
>
<el-input
v-model=
"formData.issueCount"
/>
<el-checkbox
v-model=
"totalCountChecked"
label=
"无限制"
@
change=
"handleTotalCountChange"
/>
</el-form-item>
<el-form-item
label=
"每人限领张数"
prop=
"perLimit"
>
<el-checkbox
v-model=
"perLimitChecked"
@
change=
"hanclePerLimitChange"
label=
"不限次数"
/>
<div
style=
"width: 100%"
>
<el-input
v-model=
"formData.perLimit"
:readonly=
"perLimitChecked"
style=
"width: 200px"
>
<
template
#prepend
>
限
</
template
>
<
template
#append
>
次
</
template
>
</el-input>
</div>
</el-form-item>
<el-form-item
label=
"使用说明"
prop=
"remark"
>
<el-input
type=
"textarea"
v-model=
"formData.remark"
/>
</el-form-item>
-->
</el-form-item>
</el-form>
<
template
#footer
>
...
...
src/views/system/menu/components/Menu.vue
浏览文件 @
528a17fe
...
...
@@ -225,7 +225,7 @@ import { Dialog, Option } from '@/types/common';
import
{
MenuFormData
,
MenuItem
,
MenuQueryParam
MenuQueryParam
,
}
from
'
@/types/api/system/menu
'
;
// API 依赖
import
{
...
...
@@ -234,7 +234,7 @@ import {
listMenuOptions
,
addMenu
,
deleteMenus
,
updateMenu
updateMenu
,
}
from
'
@/api/system/menu
'
;
import
SvgIcon
from
'
@/components/SvgIcon/index.vue
'
;
...
...
@@ -262,7 +262,7 @@ const state = reactive({
visible
:
1
,
sort
:
1
,
component
:
'
Layout
'
,
type
:
'
MENU
'
type
:
'
MENU
'
,
}
as
MenuFormData
,
rules
:
{
parentId
:
[{
required
:
true
,
message
:
'
请选择顶级菜单
'
,
trigger
:
'
blur
'
}],
...
...
@@ -270,8 +270,8 @@ const state = reactive({
type
:
[{
required
:
true
,
message
:
'
请选择菜单类型
'
,
trigger
:
'
blur
'
}],
path
:
[{
required
:
true
,
message
:
'
请输入路由路径
'
,
trigger
:
'
blur
'
}],
component
:
[
{
required
:
true
,
message
:
'
请输入组件完整路径
'
,
trigger
:
'
blur
'
}
]
{
required
:
true
,
message
:
'
请输入组件完整路径
'
,
trigger
:
'
blur
'
}
,
]
,
},
menuOptions
:
[]
as
Option
[],
currentRow
:
undefined
,
...
...
@@ -279,8 +279,8 @@ const state = reactive({
iconSelectVisible
:
false
,
cacheData
:
{
menuType
:
''
,
menuPath
:
''
}
menuPath
:
''
,
}
,
});
const
{
...
...
@@ -292,7 +292,7 @@ const {
rules
,
menuOptions
,
iconSelectVisible
,
cacheData
cacheData
,
}
=
toRefs
(
state
);
/**
...
...
@@ -338,7 +338,7 @@ async function handleAdd(row: any) {
await
loadMenuData
();
state
.
dialog
=
{
title
:
'
添加菜单
'
,
visible
:
true
visible
:
true
,
};
if
(
row
.
id
)
{
// 行点击新增
...
...
@@ -368,7 +368,7 @@ async function handleUpdate(row: any) {
await
loadMenuData
();
state
.
dialog
=
{
title
:
'
修改菜单
'
,
visible
:
true
visible
:
true
,
};
const
id
=
row
.
id
||
state
.
ids
;
getMenuDetail
(
id
).
then
(({
data
})
=>
{
...
...
@@ -417,7 +417,7 @@ function handleDelete(row: any) {
ElMessageBox
.
confirm
(
'
确认删除已选中的数据项?
'
,
'
警告
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
type
:
'
warning
'
,
})
.
then
(()
=>
{
deleteMenus
(
ids
).
then
(()
=>
{
...
...
src/views/system/role/index.vue
浏览文件 @
528a17fe
<
script
lang=
"ts"
>
export
default
{
name
:
'
role
'
name
:
'
role
'
,
};
</
script
>
<
script
setup
lang=
"ts"
>
import
{
nextTick
,
onMounted
,
reactive
,
ref
,
toRefs
}
from
'
vue
'
;
import
{
onMounted
,
reactive
,
ref
,
toRefs
,
nextTick
}
from
'
vue
'
;
import
{
listRolePages
,
updateRole
,
...
...
@@ -13,7 +13,7 @@ import {
addRole
,
deleteRoles
,
getRoleResourceIds
,
updateRoleResource
updateRoleResource
,
}
from
'
@/api/system/role
'
;
import
{
getResource
}
from
'
@/api/system/menu
'
;
...
...
@@ -22,7 +22,7 @@ import { Search, Plus, Edit, Refresh, Delete } from '@element-plus/icons-vue';
import
{
RoleFormData
,
RoleItem
,
RoleQueryParam
RoleQueryParam
,
}
from
'
@/types/api/system/role
'
;
import
SvgIcon
from
'
@/components/SvgIcon/index.vue
'
;
...
...
@@ -41,28 +41,26 @@ const state = reactive({
multiple
:
true
,
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
pageSize
:
10
,
}
as
RoleQueryParam
,
roleList
:
[]
as
RoleItem
[],
total
:
0
,
dialog
:
{
title
:
''
,
visible
:
false
visible
:
false
,
},
formData
:
{}
as
RoleFormData
,
rules
:
{
name
:
[{
required
:
true
,
message
:
'
请输入角色名称
'
,
trigger
:
'
blur
'
}],
code
:
[{
required
:
true
,
message
:
'
请输入角色编码
'
,
trigger
:
'
blur
'
}]
code
:
[{
required
:
true
,
message
:
'
请输入角色编码
'
,
trigger
:
'
blur
'
}]
,
},
resourceDialogVisible
:
false
,
menuOptions
:
[]
as
any
[],
permOptions
:
[]
as
any
[],
checkStrictly
:
false
,
permGroupList
:
[],
checkedRole
:
{
id
:
''
,
name
:
''
}
// 选中的角色
name
:
''
,
}
,
// 选中的角色
});
const
{
...
...
@@ -78,7 +76,6 @@ const {
menuOptions
,
permOptions
,
checkedRole
,
checkStrictly
}
=
toRefs
(
state
);
function
handleQuery
()
{
...
...
@@ -109,14 +106,14 @@ function handleRowClick(row: any) {
function
handleAdd
()
{
state
.
dialog
=
{
title
:
'
添加角色
'
,
visible
:
true
visible
:
true
,
};
}
function
handleUpdate
(
row
:
any
)
{
state
.
dialog
=
{
title
:
'
修改角色
'
,
visible
:
true
visible
:
true
,
};
const
roleId
=
row
.
id
||
state
.
ids
;
getRoleFormDetail
(
roleId
).
then
(({
data
})
=>
{
...
...
@@ -125,19 +122,22 @@ function handleUpdate(row: any) {
}
function
submitFormData
()
{
loading
.
value
=
true
;
dataFormRef
.
value
.
validate
((
valid
:
any
)
=>
{
if
(
valid
)
{
if
(
state
.
formData
.
id
)
{
updateRole
(
state
.
formData
.
id
as
any
,
state
.
formData
).
then
(()
=>
{
ElMessage
.
success
(
'
修改成功
'
);
ElMessage
.
success
(
'
修改
角色
成功
'
);
cancel
();
handleQuery
();
loading
.
value
=
false
;
});
}
else
{
addRole
(
state
.
formData
).
then
(()
=>
{
cancel
();
ElMessage
.
success
(
'
新增成功
'
);
ElMessage
.
success
(
'
新增
角色
成功
'
);
handleQuery
();
loading
.
value
=
false
;
});
}
}
...
...
@@ -145,7 +145,7 @@ function submitFormData() {
}
/**
*
弹窗关闭
*
取消
*/
function
cancel
()
{
state
.
dialog
.
visible
=
false
;
...
...
@@ -160,7 +160,7 @@ function handleDelete(row: any) {
ElMessageBox
.
confirm
(
'
确认删除已选中的数据项?
'
,
'
警告
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
type
:
'
warning
'
,
})
.
then
(()
=>
{
deleteRoles
(
ids
).
then
(()
=>
{
...
...
@@ -176,41 +176,40 @@ function handleDelete(row: any) {
*/
function
handleResourceAssign
(
row
:
RoleItem
)
{
resourceDialogVisible
.
value
=
true
;
permOptions
.
value
.
map
(
item
=>
(
item
.
checked
=
false
));
loading
.
value
=
true
;
permOptions
.
value
.
map
((
item
)
=>
(
item
.
checked
=
false
));
const
roleId
:
any
=
row
.
id
;
checkedRole
.
value
=
{
id
:
roleId
,
name
:
row
.
name
name
:
row
.
name
,
};
//资源下拉数据
getResource
().
then
(
response
=>
{
checkStrictly
.
value
=
true
;
// 父子节点不互相关联
getResource
().
then
((
response
)
=>
{
state
.
menuOptions
=
response
.
data
.
menus
;
state
.
permOptions
=
response
.
data
.
perms
;
// 获取角色拥有的资源数据进行勾选
getRoleResourceIds
(
roleId
).
then
(
res
=>
{
getRoleResourceIds
(
roleId
).
then
(
(
res
)
=>
{
const
checkedMenuIds
=
res
.
data
.
menuIds
;
const
checkedPermIds
=
res
.
data
.
permIds
;
nextTick
(()
=>
{
resourceRef
.
value
.
setCheckedKeys
(
checkedMenuIds
);
permOptions
.
value
.
forEach
(
perm
=>
{
if
(
checkedPermIds
.
includes
(
perm
.
value
))
{
perm
.
checked
=
true
;
}
else
{
perm
.
checked
=
false
;
}
});
resourceRef
.
value
.
setCheckedKeys
(
checkedMenuIds
);
permOptions
.
value
.
forEach
((
perm
)
=>
{
if
(
checkedPermIds
.
includes
(
perm
.
value
))
{
perm
.
checked
=
true
;
}
else
{
perm
.
checked
=
false
;
}
});
checkStrictly
.
value
=
false
;
// 父子节点互相关联
loading
.
value
=
false
;
});
});
}
/**
*
提交资源权限
*
分配资源权限提交
*/
function
handleRoleResourceSubmit
()
{
const
checkedMenuIds
:
any
[]
=
resourceRef
.
value
...
...
@@ -218,16 +217,16 @@ function handleRoleResourceSubmit() {
.
map
((
node
:
any
)
=>
node
.
value
);
const
checkedPermIds
=
state
.
permOptions
.
filter
(
item
=>
item
.
checked
)
.
map
(
item
=>
item
.
value
);
.
filter
(
(
item
)
=>
item
.
checked
)
.
map
(
(
item
)
=>
item
.
value
);
const
roleResourceData
=
{
menuIds
:
checkedMenuIds
,
permIds
:
checkedPermIds
permIds
:
checkedPermIds
,
};
updateRoleResource
(
checkedRole
.
value
.
id
,
roleResourceData
).
then
(
res
=>
{
ElMessage
.
success
(
'
修改
成功
'
);
updateRoleResource
(
checkedRole
.
value
.
id
,
roleResourceData
).
then
(
(
res
)
=>
{
ElMessage
.
success
(
'
分配权限
成功
'
);
state
.
resourceDialogVisible
=
false
;
handleQuery
();
});
...
...
@@ -374,12 +373,13 @@ onMounted(() => {
</
template
>
</el-dialog>
<!--分配权限弹窗-->
<el-dialog
:title=
"'【' + checkedRole.name + '】
资源
权限'"
:title=
"'【' + checkedRole.name + '】
分配
权限'"
v-model=
"resourceDialogVisible"
width=
"1000px"
>
<el-scrollbar
max-height=
"600px"
>
<el-scrollbar
max-height=
"600px"
v-loading=
"loading"
>
<el-tree
ref=
"resourceRef"
node-key=
"value"
...
...
@@ -392,7 +392,7 @@ onMounted(() => {
<div
class=
"resource-tree-node__content"
>
<el-checkbox
v-for=
"perm in permOptions.filter(
perm
=> perm.parentId == data.permPid
(perm)
=> perm.parentId == data.permPid
)"
:key=
"perm.value"
:label=
"perm.value"
...
...
src/views/system/user/index.vue
浏览文件 @
528a17fe
<
script
lang=
"ts"
>
export
default
{
name
:
'
user
'
name
:
'
user
'
,
};
</
script
>
...
...
@@ -12,7 +12,7 @@ import {
watchEffect
,
onMounted
,
getCurrentInstance
,
toRefs
toRefs
,
}
from
'
vue
'
;
// 导入API
...
...
@@ -25,7 +25,7 @@ import {
updateUserPart
,
downloadTemplate
,
exportUser
,
importUser
importUser
,
}
from
'
@/api/system/user
'
;
import
{
listSelectDepartments
}
from
'
@/api/system/dept
'
;
import
{
listRoleOptions
}
from
'
@/api/system/role
'
;
...
...
@@ -36,7 +36,7 @@ import {
ElMessageBox
,
ElTree
,
ElForm
,
UploadFile
UploadFile
,
}
from
'
element-plus
'
;
import
{
Search
,
...
...
@@ -47,13 +47,13 @@ import {
Lock
,
Download
,
Top
,
UploadFilled
UploadFilled
,
}
from
'
@element-plus/icons-vue
'
;
import
{
UserItem
,
UserQueryParam
,
UserFormData
,
UserImportFormData
UserImportFormData
,
}
from
'
@/types/api/system/user
'
;
import
{
Option
,
Dialog
}
from
'
@/types/common
'
;
...
...
@@ -81,7 +81,7 @@ const state = reactive({
userList
:
[]
as
UserItem
[],
// 弹窗属性
dialog
:
{
visible
:
false
visible
:
false
,
}
as
Dialog
,
deptName
:
undefined
,
// 部门树选项
...
...
@@ -93,18 +93,18 @@ const state = reactive({
roleOptions
:
[]
as
Option
[],
// 表单参数
formData
:
{
status
:
1
status
:
1
,
}
as
UserFormData
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
pageSize
:
10
,
}
as
UserQueryParam
,
// 表单校验
rules
:
{
username
:
[{
required
:
true
,
message
:
'
用户名不能为空
'
,
trigger
:
'
blur
'
}],
nickname
:
[
{
required
:
true
,
message
:
'
用户昵称不能为空
'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'
用户昵称不能为空
'
,
trigger
:
'
blur
'
}
,
],
deptId
:
[{
required
:
true
,
message
:
'
所属部门不能为空
'
,
trigger
:
'
blur
'
}],
roleIds
:
[{
required
:
true
,
message
:
'
用户角色不能为空
'
,
trigger
:
'
blur
'
}],
...
...
@@ -112,25 +112,25 @@ const state = reactive({
{
pattern
:
/
\w[
-
\w
.+
]
*@
([
A-Za-z0-9
][
-A-Za-z0-9
]
+
\.)
+
[
A-Za-z
]{2,14}
/
,
message
:
'
请输入正确的邮箱地址
'
,
trigger
:
'
blur
'
}
trigger
:
'
blur
'
,
}
,
],
mobile
:
[
{
pattern
:
/^1
[
3|4|5|6|7|8|9
][
0-9
]\d{8}
$/
,
message
:
'
请输入正确的手机号码
'
,
trigger
:
'
blur
'
}
]
trigger
:
'
blur
'
,
}
,
]
,
},
importDialog
:
{
title
:
'
用户导出
'
,
visible
:
false
visible
:
false
,
}
as
Dialog
,
importFormData
:
{}
as
UserImportFormData
,
excelFile
:
undefined
as
any
,
excelFilelist
:
[]
as
File
[]
excelFilelist
:
[]
as
File
[]
,
});
const
{
...
...
@@ -147,7 +147,7 @@ const {
roleOptions
,
importDialog
,
importFormData
,
excelFilelist
excelFilelist
,
}
=
toRefs
(
state
);
/**
...
...
@@ -158,7 +158,7 @@ watchEffect(
deptTreeRef
.
value
.
filter
(
state
.
deptName
);
},
{
flush
:
'
post
'
// watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行
flush
:
'
post
'
,
// watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行
}
);
...
...
@@ -184,7 +184,7 @@ function handleDeptNodeClick(data: { [key: string]: any }) {
* 加载角色数据
*/
async
function
loadRoleOptions
()
{
listRoleOptions
().
then
(
response
=>
{
listRoleOptions
().
then
(
(
response
)
=>
{
state
.
roleOptions
=
response
.
data
;
});
}
...
...
@@ -200,7 +200,7 @@ function handleStatusChange(row: { [key: string]: any }) {
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
type
:
'
warning
'
,
}
)
.
then
(()
=>
{
...
...
@@ -252,7 +252,7 @@ function resetPassword(row: { [key: string]: any }) {
'
重置密码
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
cancelButtonText
:
'
取消
'
,
}
)
.
then
(({
value
})
=>
{
...
...
@@ -261,7 +261,7 @@ function resetPassword(row: { [key: string]: any }) {
return
false
;
}
updateUserPart
(
row
.
id
,
{
password
:
value
password
:
value
,
}).
then
(()
=>
{
ElMessage
.
success
(
'
修改成功,新密码是:
'
+
value
);
});
...
...
@@ -277,7 +277,7 @@ async function handleAdd() {
await
loadRoleOptions
();
state
.
dialog
=
{
title
:
'
添加用户
'
,
visible
:
true
visible
:
true
,
};
}
...
...
@@ -290,7 +290,7 @@ async function handleUpdate(row: { [key: string]: any }) {
await
loadRoleOptions
();
state
.
dialog
=
{
title
:
'
修改用户
'
,
visible
:
true
visible
:
true
,
};
getUserFormData
(
userId
).
then
(({
data
})
=>
{
state
.
formData
=
data
;
...
...
@@ -332,7 +332,7 @@ function handleDelete(row: { [key: string]: any }) {
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
type
:
'
warning
'
,
}
)
.
then
(
function
()
{
...
...
@@ -357,7 +357,7 @@ function cancel() {
* 加载部门
*/
async
function
loadDeptOptions
()
{
listSelectDepartments
().
then
(
response
=>
{
listSelectDepartments
().
then
(
(
response
)
=>
{
state
.
deptOptions
=
response
.
data
;
});
}
...
...
@@ -377,7 +377,7 @@ function loadGenderOptions() {
function
handleDownloadTemplate
()
{
downloadTemplate
().
then
((
response
:
any
)
=>
{
const
blob
=
new
Blob
([
response
.
data
],
{
type
:
'
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
'
type
:
'
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
'
,
});
const
a
=
document
.
createElement
(
'
a
'
);
const
href
=
window
.
URL
.
createObjectURL
(
blob
);
// 下载链接
...
...
@@ -429,7 +429,7 @@ function submitImportForm() {
const
deptId
=
state
.
importFormData
.
deptId
;
const
roleIds
=
state
.
importFormData
.
roleIds
.
join
(
'
,
'
);
importUser
(
deptId
,
roleIds
,
state
.
excelFile
).
then
(
response
=>
{
importUser
(
deptId
,
roleIds
,
state
.
excelFile
).
then
(
(
response
)
=>
{
ElMessage
.
success
(
response
.
data
);
closeImportDialog
();
handleQuery
();
...
...
@@ -454,7 +454,7 @@ function closeImportDialog() {
function
handleExport
()
{
exportUser
(
queryParams
.
value
).
then
((
response
:
any
)
=>
{
const
blob
=
new
Blob
([
response
.
data
],
{
type
:
'
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
'
type
:
'
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
'
,
});
const
a
=
document
.
createElement
(
'
a
'
);
const
href
=
window
.
URL
.
createObjectURL
(
blob
);
// 下载的链接
...
...
@@ -638,7 +638,7 @@ onMounted(() => {
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"
gmtCreat
e"
prop=
"
createTim
e"
width=
"180"
></el-table-column>
<el-table-column
label=
"操作"
align=
"center"
width=
"150"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录