Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopFront
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
newshop
newShopFront
Commits
7790f12c
Commit
7790f12c
authored
Nov 08, 2019
by
邓学云
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
122
parent
d01f1100
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
769 additions
and
5 deletions
+769
-5
router.config.js
src/config/router.config.js
+26
-0
manage.js
src/mock/services/manage.js
+53
-4
ulistManage.vue
src/views/userstaff/details/ulistManage.vue
+199
-0
userGroup_edit.vue
src/views/userstaff/details/userGroup_edit.vue
+182
-0
uList.vue
src/views/userstaff/uList.vue
+191
-0
userGroup.vue
src/views/userstaff/userGroup.vue
+116
-0
vue.config.js
vue.config.js
+2
-1
No files found.
src/config/router.config.js
View file @
7790f12c
...
@@ -34,6 +34,32 @@ export const asyncRouterMap = [
...
@@ -34,6 +34,32 @@ export const asyncRouterMap = [
name
:
'Userlist'
,
name
:
'Userlist'
,
component
:
()
=>
import
(
'@/views/userstaff/Userlist'
),
component
:
()
=>
import
(
'@/views/userstaff/Userlist'
),
meta
:
{
title
:
'用户留言列表'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
meta
:
{
title
:
'用户留言列表'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
},
{
path
:
'/userstaff/ulist'
,
name
:
'UList'
,
component
:
()
=>
import
(
'@/views/userstaff/uList'
),
meta
:
{
title
:
'用户列表'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
},
{
path
:
'/userstaff/ulist_details'
,
name
:
'UListdetails'
,
hidden
:
true
,
component
:
()
=>
import
(
'@/views/userstaff/details/ulistManage'
),
meta
:
{
title
:
'用户列表管理'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
},
{
path
:
'/userstaff/user_group'
,
name
:
'userGroup'
,
component
:
()
=>
import
(
'@/views/userstaff/userGroup'
),
meta
:
{
title
:
'用户组管理'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
},
{
path
:
'/userstaff/user_group_editor'
,
name
:
'userGroupEdit'
,
hidden
:
true
,
component
:
()
=>
import
(
'@/views/userstaff/details/userGroup_edit'
),
meta
:
{
title
:
'用户组设置'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
}
}
]
]
},
},
...
...
src/mock/services/manage.js
View file @
7790f12c
...
@@ -19,10 +19,19 @@ const serverList = (options) => {
...
@@ -19,10 +19,19 @@ const serverList = (options) => {
key
:
tmpKey
,
key
:
tmpKey
,
id
:
tmpKey
,
id
:
tmpKey
,
no
:
'No '
+
tmpKey
,
no
:
'No '
+
tmpKey
,
description
:
'这是一段描述'
,
// 新增
callNo
:
Mock
.
mock
(
'@integer(1, 999)'
),
name
:
'小明'
,
status
:
Mock
.
mock
(
'@integer(0, 3)'
),
zhucetime
:
'2019-11-08 12:14:21'
,
updatedAt
:
Mock
.
mock
(
'@datetime'
),
tjgh
:
'12345'
,
dh
:
'18899996688'
,
wehid
:
'6472583'
,
yhbq
:
'雨诺'
,
points
:
'666'
,
// end
// description: '这是一段描述',
// callNo: Mock.mock('@integer(1, 999)'),
// status: Mock.mock('@integer(0, 3)'),
// updatedAt: Mock.mock('@datetime'),
editable
:
false
editable
:
false
})
})
}
}
...
@@ -35,7 +44,46 @@ const serverList = (options) => {
...
@@ -35,7 +44,46 @@ const serverList = (options) => {
data
:
result
data
:
result
})
})
}
}
const
usergroupList
=
(
options
)
=>
{
const
parameters
=
getQueryParameters
(
options
)
const
result
=
[]
const
pageNo
=
parseInt
(
parameters
.
pageNo
)
const
pageSize
=
parseInt
(
parameters
.
pageSize
)
const
totalPage
=
Math
.
ceil
(
totalCount
/
pageSize
)
const
key
=
(
pageNo
-
1
)
*
pageSize
const
next
=
(
pageNo
>=
totalPage
?
(
totalCount
%
pageSize
)
:
pageSize
)
+
1
for
(
let
i
=
1
;
i
<
next
;
i
++
)
{
const
tmpKey
=
key
+
i
result
.
push
({
key
:
tmpKey
,
id
:
tmpKey
,
no
:
'No '
+
tmpKey
,
// 新增
newuser
:
'新用户'
,
yhpercent
:
'100'
,
trueorfalse
:
'是'
,
sxjf
:
'0'
,
jfbl
:
'0.01'
,
tjsj
:
'2019-11-08 12:14:21'
,
// end
// description: '这是一段描述',
// callNo: Mock.mock('@integer(1, 999)'),
// status: Mock.mock('@integer(0, 3)'),
// updatedAt: Mock.mock('@datetime'),
editable
:
false
})
}
return
builder
({
pageSize
:
pageSize
,
pageNo
:
pageNo
,
totalCount
:
totalCount
,
totalPage
:
totalPage
,
data
:
result
})
}
const
projects
=
()
=>
{
const
projects
=
()
=>
{
return
builder
({
return
builder
({
'data'
:
[{
'data'
:
[{
...
@@ -246,6 +294,7 @@ const radar = () => {
...
@@ -246,6 +294,7 @@ const radar = () => {
}
}
Mock
.
mock
(
/
\/
service/
,
'get'
,
serverList
)
Mock
.
mock
(
/
\/
service/
,
'get'
,
serverList
)
Mock
.
mock
(
/
\/
usergroup/
,
'get'
,
usergroupList
)
Mock
.
mock
(
/
\/
list
\/
search
\/
projects/
,
'get'
,
projects
)
Mock
.
mock
(
/
\/
list
\/
search
\/
projects/
,
'get'
,
projects
)
Mock
.
mock
(
/
\/
workplace
\/
activity/
,
'get'
,
activity
)
Mock
.
mock
(
/
\/
workplace
\/
activity/
,
'get'
,
activity
)
Mock
.
mock
(
/
\/
workplace
\/
teams/
,
'get'
,
teams
)
Mock
.
mock
(
/
\/
workplace
\/
teams/
,
'get'
,
teams
)
...
...
src/views/userstaff/details/ulistManage.vue
0 → 100644
View file @
7790f12c
<
template
>
<div>
<a-card
:body-style=
"
{padding: '24px 32px'}" :bordered="false">
<a-form
@
submit=
"handleSubmit"
:form=
"form"
>
<a-form-item
label=
"昵称"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
v-decorator=
"[
'name',
{rules: [{ required: true, message: '请输入昵称' }]}
]"
name="name"
placeholder="请输入昵称" />
</a-form-item>
<a-form-item
label=
"工号/手机号"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
v-decorator=
"[
'phone',
{rules: [{ required: true, message: '请输入工号/手机号' }]}
]"
name="name"
placeholder="请输入工号/手机号" />
</a-form-item>
<a-form-item
label=
"积分"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
v-decorator=
"[
'phone',
{rules: [{ required: true, message: '请输入工号/手机号' }]}
]"
name="name"
placeholder="请输入积分" />
</a-form-item>
<a-form-item
label=
"所属用户组"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-select
mode=
"multiple"
:size=
"size"
placeholder=
"Please select"
:defaultValue=
"['a1', 'b2']"
@
change=
"handleChange"
@
popupScroll=
"popupScroll"
>
<a-select-option
v-for=
"i in 25"
:key=
"(i + 9).toString(36) + i"
>
{{
(
i
+
9
).
toString
(
36
)
+
i
}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"手机号"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
v-decorator=
"[
'phone',
{rules: [{ required: true, message: '请输入手机号' }]}
]"
name="name"
placeholder="请输入手机号" />
</a-form-item>
<a-form-item
label=
"性别"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-select
defaultValue=
"1"
v-decorator=
"[
'sex'
]"
>
<a-select-option
value=
"1"
>
男
</a-select-option>
<a-select-option
value=
"0"
>
女
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"出生日期"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-date-picker
v-decorator=
"[
'childdate',
{rules: [{ required: true, message: '请选择出生日期' }]}
]" />
</a-form-item>
<a-form-item
label=
"员工工号"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
v-decorator=
"[
'phone',
{rules: [{ required: true, message: '请输入员工工号' }]}
]"
name="name"
placeholder="请输入员工工号" />
</a-form-item>
<a-form-item
label=
"门店代码"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
v-decorator=
"[
'phone',
{rules: [{ required: true, message: '请输入门店代码' }]}
]"
name="name"
placeholder="请输入门店代码" />
</a-form-item>
<a-form-item
label=
"会员卡号"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
v-decorator=
"[
'phone',
{rules: [{ required: true, message: '请输入会员卡号' }]}
]"
name="name"
placeholder="请输入会员卡号" />
</a-form-item>
<a-form-item
label=
"会员标签"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-select
mode=
"multiple"
:size=
"size"
placeholder=
"Please select"
:defaultValue=
"['a1', 'b2']"
@
change=
"handleChange"
@
popupScroll=
"popupScroll"
>
<a-select-option
v-for=
"i in 25"
:key=
"(i + 9).toString(36) + i"
>
{{
(
i
+
9
).
toString
(
36
)
+
i
}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"是否为惠氏分销商上级"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-select
defaultValue=
"0"
v-decorator=
"[
'sex'
]"
>
<a-select-option
value=
"1"
>
是
</a-select-option>
<a-select-option
value=
"0"
>
否
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
:wrapperCol=
"
{ span: 24 }"
style="text-align: center"
>
<a-button
htmlType=
"submit"
type=
"primary"
>
提交
</a-button>
<a-button
@
click=
"goBack"
style=
"margin-left: 8px"
>
返回
</a-button>
</a-form-item>
</a-form>
</a-card>
</div>
</
template
>
<
script
>
export
default
{
name
:
'UserListEditor'
,
data
()
{
return
{
mdl
:
{},
size
:
'default'
,
description
:
'表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。'
,
value
:
1
,
// form
form
:
this
.
$form
.
createForm
(
this
)
}
},
methods
:
{
goBack
(){
this
.
$router
.
push
({
path
:
'/userstaff/ulist'
})
},
// handler
handleSubmit
(
e
)
{
e
.
preventDefault
()
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
// eslint-disable-next-line no-console
console
.
log
(
'Received values of form: '
,
values
)
}
})
}
}
}
</
script
>
src/views/userstaff/details/userGroup_edit.vue
0 → 100644
View file @
7790f12c
<
template
>
<a-card
:body-style=
"
{padding: '24px 32px'}" :bordered="false">
<a-form
@
submit=
"handleSubmit"
:form=
"form"
>
<a-form-item
label=
"组名称"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
v-decorator=
"[
'name',
{rules: [{ required: true, message: '请输入标题' }]}
]"
name="name"
placeholder="请输入组名称" />
</a-form-item>
<a-form-item
label=
"优惠百分比"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }">
<a-input
placeholder=
"请输入优惠百分比"
v-decorator=
"[
'customer',
{rules: [{ required: true, message: '请描述你服务的客户' }]}
]" />
</a-form-item>
<a-form-item
label=
"优惠范围"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }"
:required="false"
>
<a-radio-group
v-model=
"value"
>
<a-radio
:value=
"1"
>
全店通用
</a-radio>
<a-radio
:value=
"2"
>
指定商品
</a-radio>
</a-radio-group>
<a-form-item>
<div
mode=
"multiple"
v-if=
"value === 2"
>
<a-button
type=
"primary"
class=
"editable-add-btn"
@
click=
"handleAdd"
icon=
"plus"
>
添加商品
</a-button>
<a-table
bordered
:dataSource=
"dataSource"
:columns=
"columns"
>
<template
slot=
"name"
slot-scope=
"text, record"
>
<editable-cell
:text=
"text"
@
change=
"onCellChange(record.key, 'name', $event)"
/>
</
template
>
<
template
slot=
"operation"
slot-scope=
"text, record"
>
<a-popconfirm
v-if=
"dataSource.length"
title=
"确定删除?"
@
confirm=
"() => onDelete(record.key)"
>
<a
href=
"javascript:;"
>
删除
</a>
</a-popconfirm>
</
template
>
</a-table>
</div>
<!-- <a-select mode="multiple" v-if="value === 2">
<a-select-option value="4">同事一</a-select-option>
<a-select-option value="5">同事二</a-select-option>
<a-select-option value="6">同事三</a-select-option>
</a-select>
</a-form-item> -->
</a-form-item>
</a-form-item>
<a-form-item
label=
"是否为默认组"
:labelCol=
"{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol=
"{lg: {span: 10}, sm: {span: 17} }"
:required=
"false"
>
<a-radio-group
defaultValue=
'1'
>
<a-radio
value=
"1"
>
是
</a-radio>
<a-radio
value=
"2"
>
否
</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
label=
"积分比率"
:labelCol=
"{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol=
"{lg: {span: 10}, sm: {span: 17} }"
:required=
"false"
>
<a-input-number
:min=
"0"
:max=
"100"
/>
<span>
%
</span>
</a-form-item>
<a-form-item
:wrapperCol=
"{ span: 24 }"
style=
"text-align: center"
>
<a-button
htmlType=
"submit"
type=
"primary"
>
提交
</a-button>
<a-button
@
click=
"goBack"
style=
"margin-left: 8px"
>
返回
</a-button>
</a-form-item>
</a-form>
</a-card>
</template>
<
script
>
export
default
{
name
:
'BaseForm'
,
data
()
{
return
{
dataSource
:
[
{
key
:
'0'
,
name
:
'Edward King 0'
,
age
:
'32'
,
address
:
'London, Park Lane no. 0'
,
},
{
key
:
'1'
,
name
:
'Edward King 1'
,
age
:
'32'
,
address
:
'London, Park Lane no. 1'
,
},
],
count
:
2
,
columns
:
[
{
title
:
'名称'
,
dataIndex
:
'name'
,
width
:
'30%'
,
scopedSlots
:
{
customRender
:
'name'
},
},
{
title
:
'原价'
,
dataIndex
:
'age'
,
},
{
title
:
'优惠价格'
,
dataIndex
:
'address'
,
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
scopedSlots
:
{
customRender
:
'operation'
},
},
],
description
:
'表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。'
,
value
:
1
,
// form
form
:
this
.
$form
.
createForm
(
this
)
}
},
methods
:
{
goBack
(){
this
.
$router
.
push
({
path
:
"/userstaff/user_group"
})
},
onCellChange
(
key
,
dataIndex
,
value
)
{
const
dataSource
=
[...
this
.
dataSource
];
const
target
=
dataSource
.
find
(
item
=>
item
.
key
===
key
);
if
(
target
)
{
target
[
dataIndex
]
=
value
;
this
.
dataSource
=
dataSource
;
}
},
onDelete
(
key
)
{
const
dataSource
=
[...
this
.
dataSource
];
this
.
dataSource
=
dataSource
.
filter
(
item
=>
item
.
key
!==
key
);
},
handleAdd
()
{
const
{
count
,
dataSource
}
=
this
;
const
newData
=
{
key
:
count
,
name
:
`Edward King
${
count
}
`
,
age
:
32
,
address
:
`London, Park Lane no.
${
count
}
`
,
};
this
.
dataSource
=
[...
dataSource
,
newData
];
this
.
count
=
count
+
1
;
},
// handler
handleSubmit
(
e
)
{
e
.
preventDefault
()
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
// eslint-disable-next-line no-console
console
.
log
(
'Received values of form: '
,
values
)
}
})
}
}
}
</
script
>
src/views/userstaff/uList.vue
0 → 100644
View file @
7790f12c
<
template
>
<div>
<div
class=
"table-page-search-wrapper"
>
<a-form
layout=
"inline"
>
<a-row
:gutter=
"48"
>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"用户名"
>
<a-input
v-model=
"queryParam.id"
placeholder=
"请输入"
/>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"绑定会员"
>
<a-select
v-model=
"queryParam.status"
placeholder=
"请选择"
default-value=
"0"
>
<a-select-option
value=
"0"
>
否
</a-select-option>
<a-select-option
value=
"1"
>
是
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<template
v-if=
"advanced"
>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"会员卡号"
>
<a-input-number
v-model=
"queryParam.callNo"
placeholder=
"请输入"
style=
"width: 100%"
/>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"注册时间"
>
<a-date-picker
v-model=
"queryParam.date"
style=
"width: 100%"
placeholder=
"请输入更新日期"
/>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"用户所属"
>
<a-select
v-model=
"queryParam.useStatus"
placeholder=
"请选择"
default-value=
"0"
>
<a-select-option
value=
"0"
>
全部
</a-select-option>
<a-select-option
value=
"1"
>
关闭
</a-select-option>
<a-select-option
value=
"2"
>
运行中
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"手机号/账号"
>
<a-input-number
v-model=
"queryParam.callNo"
placeholder=
"请输入"
style=
"width: 100%"
/>
</a-form-item>
</a-col>
</
template
>
<a-col
:md=
"!advanced && 8 || 24"
:sm=
"24"
>
<span
class=
"table-page-search-submitButtons"
:style=
"advanced && { float: 'right', overflow: 'hidden' } || {} "
>
<a-button
type=
"primary"
@
click=
"$refs.table.refresh(true)"
>
查询
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"() => queryParam = {}"
>
重置
</a-button>
<a
@
click=
"toggleAdvanced"
style=
"margin-left: 8px"
>
{{ advanced ? '收起' : '展开' }}
<a-icon
:type=
"advanced ? 'up' : 'down'"
/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<s-table
ref=
"table"
size=
"default"
:columns=
"columns"
:data=
"loadData"
>
<!-- :data="loadData" -->
<span
slot=
"action"
>
<router-link
to=
"/userstaff/ulist_details"
>
<a
type=
"primary"
>
修改
</a>
</router-link>
<!-- <a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;">1st menu item</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;">2nd menu item</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;">3rd menu item</a>
</a-menu-item>
</a-menu>
</a-dropdown> -->
</span>
</s-table>
</div>
</template>
<
script
>
import
moment
from
'moment'
import
{
STable
}
from
'@/components'
export
default
{
name
:
'TableList'
,
components
:
{
STable
},
// mounted(){
// var url = this.HOME + 'ajax/json_demo.json'; //HOME变量为已挂载的可跨域域名,这里将其拼接完,成为一个完整路径
// console.log(url)
// this.$axios({ //this代表vue对象,之前在入口文件中把axios挂载到了vue中,所以这里直接用this.$axios调用axios对象
// method: 'get',
// url:url
// }).then(function (res) {
// console.log(res);
// }).catch(function (err) {
// console.log(err);
// })
// },
data
()
{
return
{
mdl
:
{},
// 高级搜索 展开/关闭
advanced
:
false
,
// 查询参数
queryParam
:
{},
columns
:
[
{
title
:
'规则编号'
,
dataIndex
:
'no'
},
{
title
:
'用户姓名'
,
dataIndex
:
'name'
},
{
title
:
'注册时间'
,
dataIndex
:
'zhucetime'
},
{
title
:
'推荐工号'
,
dataIndex
:
'tjgh'
},
{
title
:
'电话'
,
dataIndex
:
'dh'
},
{
title
:
'wecha_id'
,
dataIndex
:
'wehid'
},
{
title
:
'用户标签'
,
dataIndex
:
'yhbq'
},
{
title
:
'积分'
,
dataIndex
:
'points'
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
scopedSlots
:
{
customRender
:
'action'
}
}
],
// 加载数据方法 必须为 Promise 对象
loadData
:
parameter
=>
{
return
this
.
$http
.
get
(
'/service'
,
{
params
:
Object
.
assign
(
parameter
,
this
.
queryParam
)
}).
then
(
res
=>
{
console
.
log
(
res
.
result
)
return
res
.
result
})
}
}
},
methods
:
{
toggleAdvanced
()
{
this
.
advanced
=
!
this
.
advanced
},
resetSearchForm
()
{
this
.
queryParam
=
{
date
:
moment
(
new
Date
())
}
},
edit
(
row
)
{
// axios 发送数据到后端 修改数据成功后
// 调用 refresh() 重新加载列表数据
// 这里 setTimeout 模拟发起请求的网络延迟..
setTimeout
(()
=>
{
this
.
$refs
.
table
.
refresh
()
// refresh() 不传参默认值 false 不刷新到分页第一页
},
1500
)
}
// goEditor () {
// this.$router.push({ path: '/other/userlist/user-list-editor' })
// }
}
}
</
script
>
src/views/userstaff/userGroup.vue
0 → 100644
View file @
7790f12c
<
template
>
<div>
<div
class=
"table-operator"
>
<a-button
@
click=
"goEdit"
type=
'primary'
icon=
'plus'
>
新建
</a-button>
</div>
<s-table
ref=
"table"
size=
"default"
:columns=
"columns"
:data=
"loadData"
>
<span
slot=
"action"
slot-scope=
"text, record"
>
<router-link
to=
"/userstaff/user_group_editor"
>
<a
type=
"primary"
>
编辑
</a>
</router-link>
<a-divider
type=
"vertical"
/>
<a-popconfirm
title=
"是否要删除此行?"
@
confirm=
"remove(record.key)"
>
<a>
删除
</a>
</a-popconfirm>
</span>
</s-table>
</div>
</
template
>
<
script
>
import
moment
from
'moment'
import
{
STable
}
from
'@/components'
export
default
{
name
:
'TableList'
,
components
:
{
STable
},
data
()
{
return
{
mdl
:
{},
// 高级搜索 展开/关闭
advanced
:
false
,
// 查询参数
queryParam
:
{},
columns
:
[
{
title
:
'规则编号'
,
dataIndex
:
'no'
},
{
title
:
'组名称'
,
dataIndex
:
'newuser'
},
{
title
:
'优惠百分比'
,
dataIndex
:
'yhpercent'
},
{
title
:
'是否为默认组'
,
dataIndex
:
'trueorfalse'
},
{
title
:
'所需积分'
,
dataIndex
:
'sxjf'
},
{
title
:
'积分比率'
,
dataIndex
:
'jfbl'
},
{
title
:
'添加时间'
,
dataIndex
:
'tjsj'
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
scopedSlots
:
{
customRender
:
'action'
}
}
],
removeKey
:
''
,
// 加载数据方法 必须为 Promise 对象
loadData
:
parameter
=>
{
return
this
.
$http
.
get
(
'/usergroup'
,
{
params
:
Object
.
assign
(
parameter
,
this
.
queryParam
)
}).
then
(
res
=>
{
// console.log(res.result)
return
res
.
result
})
}
}
},
methods
:
{
// goEdit () {
// this.$router.push({ path: "/userstaff/user_group_editor" })
// },
// remove ( key ) {
// this.removeKey = key - 1;
// },
toggleAdvanced
()
{
this
.
advanced
=
!
this
.
advanced
},
resetSearchForm
()
{
this
.
queryParam
=
{
date
:
moment
(
new
Date
())
}
},
edit
(
row
)
{
// axios 发送数据到后端 修改数据成功后
// 调用 refresh() 重新加载列表数据
// 这里 setTimeout 模拟发起请求的网络延迟..
setTimeout
(()
=>
{
this
.
$refs
.
table
.
refresh
()
// refresh() 不传参默认值 false 不刷新到分页第一页
},
1500
)
}
// goEditor () {
// this.$router.push({ path: '/other/userlist/user-list-editor' })
// }
}
}
</
script
>
vue.config.js
View file @
7790f12c
...
@@ -106,7 +106,8 @@ const vueConfig = {
...
@@ -106,7 +106,8 @@ const vueConfig = {
// disable source map in production
// disable source map in production
productionSourceMap
:
false
,
productionSourceMap
:
false
,
lintOnSave
:
undefined
,
// lintOnSave: undefined,
lintOnSave
:
false
,
// babel-loader no-ignore node_modules/*
// babel-loader no-ignore node_modules/*
transpileDependencies
:
[]
transpileDependencies
:
[]
}
}
...
...
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