Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
total-platform
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
物业总平台
total-platform
Commits
eb43a3de
提交
eb43a3de
authored
7月 27, 2023
作者:
何忠建
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增合作伙伴
上级
c7708c82
全部展开
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
822 行增加
和
0 行删除
+822
-0
api.js
src/api/api.js
+7
-0
PartnersDetails.vue
src/views/settled/partners/PartnersDetails.vue
+0
-0
PartnersList.vue
src/views/settled/partners/PartnersList.vue
+272
-0
RoleDataruleModal.vue
src/views/settled/partners/modules/RoleDataruleModal.vue
+121
-0
SelectRulesModal.vue
src/views/settled/partners/modules/SelectRulesModal.vue
+221
-0
UserRoleModal.vue
src/views/settled/partners/modules/UserRoleModal.vue
+201
-0
没有找到文件。
src/api/api.js
浏览文件 @
eb43a3de
...
...
@@ -114,6 +114,10 @@ const getCouncilsDetailApi = (params)=>getAction("/property-central/councils/pro
const
auditCouncilsApi
=
(
params
)
=>
postAction
(
"/property-central/councils/propertyCouncils/audit"
,
params
);
const
freezeOrCouncilsApi
=
(
params
)
=>
getAction
(
`/property-central/councils/propertyCouncils/freezeOrThaw/
${
params
.
id
}
/
${
params
.
status
}
`
,{});
const
getPartnersDetailApi
=
(
params
)
=>
getAction
(
"/property-central/partners/partnersInfo/queryById"
,
params
);
const
auditPartnersApi
=
(
params
)
=>
postAction
(
"/property-central/partners/partnersInfo/audit"
,
params
);
const
operatePartnersApi
=
(
params
)
=>
getAction
(
`/property-central/partners/partnersInfo/operate/
${
params
.
id
}
/
${
params
.
status
}
`
,{});
//费用管理
const
getCostListApi
=
(
params
)
=>
getAction
(
"/property-central/property/propertyChargrule/list"
,
params
);
const
getCostDetailApi
=
(
params
)
=>
getAction
(
"/property-central/property/propertyChargrule/queryById"
,
params
);
...
...
@@ -196,6 +200,9 @@ export {
getCouncilsDetailApi
,
auditCouncilsApi
,
freezeOrCouncilsApi
,
getPartnersDetailApi
,
auditPartnersApi
,
operatePartnersApi
}
...
...
src/views/settled/partners/PartnersDetails.vue
0 → 100644
浏览文件 @
eb43a3de
差异被折叠。
点击展开。
src/views/settled/partners/PartnersList.vue
0 → 100644
浏览文件 @
eb43a3de
<
template
>
<a-card
:bordered=
"false"
>
<!-- 查询区域 -->
<div
class=
"table-page-search-wrapper"
>
<a-form
layout=
"inline"
@
keyup
.
enter
.
native=
"searchQuery"
>
<a-row
:gutter=
"24"
>
<a-col
:md=
"6"
:sm=
"8"
>
<a-form-item
label=
"合作伙伴名称"
>
<j-input
placeholder=
"请输入合作伙伴名称"
v-model=
"queryParam.partnersName"
></j-input>
</a-form-item>
</a-col>
<a-col
:md=
"6"
:sm=
"8"
>
<a-form-item
label=
"入驻开始时间"
>
<a-date-picker
placeholder=
"入驻开始时间"
valueFormat=
"YYYY-MM-DD"
v-model=
"queryParam.createTime_begin"
></a-date-picker>
</a-form-item>
</a-col>
<a-col
:md=
"6"
:sm=
"8"
>
<a-form-item
label=
"入驻结束时间"
>
<a-date-picker
placeholder=
"入驻结束时间"
valueFormat=
"YYYY-MM-DD"
v-model=
"queryParam.createTime_end"
></a-date-picker>
</a-form-item>
</a-col>
<!--
<a-col
:md=
"8"
:sm=
"10"
>
<a-form-item
label=
"入驻时间"
>
<a-range-picker
v-model=
"queryParam.propertyTime"
/>
</a-form-item>
</a-col>
-->
<span
style=
"float: left;overflow: hidden;"
class=
"table-page-search-submitButtons"
>
<a-col
:md=
"6"
:sm=
"24"
>
<a-button
type=
"primary"
@
click=
"searchQuery"
>
查询
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"searchReset"
>
重置
</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div
class=
"table-operator"
>
<a-button
@
click=
"propertyDetails(1)"
type=
"primary"
icon=
"plus"
>
新增
</a-button>
<!--
<a-button
type=
"primary"
icon=
"download"
@
click=
"handleExportXls('t_property_settled')"
>
导出
</a-button>
-->
<a-dropdown
v-if=
"selectedRowKeys.length > 0"
>
<a-menu
slot=
"overlay"
>
<a-menu-item
key=
"1"
@
click=
"batchDel"
><a-icon
type=
"delete"
/>
删除
</a-menu-item>
</a-menu>
<a-button
style=
"margin-left: 8px"
>
批量操作
<a-icon
type=
"down"
/></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div
class=
"ant-alert ant-alert-info"
style=
"margin-bottom: 16px;"
>
<i
class=
"anticon anticon-info-circle ant-alert-icon"
></i>
已选择
<a
style=
"font-weight: 600"
>
{{
selectedRowKeys
.
length
}}
</a>
项
<a
style=
"margin-left: 24px"
v-if=
"selectedRowKeys.length > 0"
@
click=
"onClearSelected"
>
清空
</a>
</div>
<a-table
ref=
"table"
size=
"middle"
:scroll=
"
{x:true}" bordered rowKey="id" :columns="columns"
:dataSource="dataSource" :pagination="pagination" :loading="loading" class="j-table-force-nowrap"
@change="handleTableChange">
<span
slot=
"empowerEndDate"
slot-scope=
"text, record"
>
<span
v-if=
"record.empowerEndDate"
>
{{
record
.
empowerBeginDate
}}
至
{{
record
.
empowerEndDate
}}
</span>
</span>
<span
slot=
"partnersStatus"
slot-scope=
"text, record"
>
<span>
{{
record
.
partnersStatus
===
'normal'
?
'正常'
:
'冻结'
}}
</span>
</span>
<span
slot=
"expirationStatus"
slot-scope=
"text, record"
>
<a-tag>
{{
record
.
expirationStatus
===
'notStarted'
?
'未开始'
:
record
.
expirationStatus
===
'normal'
?
'正常'
:
record
.
expirationStatus
===
'soonExpired'
?
'即将到期'
:
record
.
expirationStatus
===
'expire'
?
'已过期'
:
''
}}
</a-tag>
</span>
<span
slot=
"action"
slot-scope=
"text, record"
>
<a
href=
"javascript:;"
@
click=
"propertyDetails(4, record.id)"
>
详情
</a>
<a-divider
type=
"vertical"
/>
<a-dropdown>
<a
class=
"ant-dropdown-link"
>
更多
<a-icon
type=
"down"
/>
</a>
<a-menu
slot=
"overlay"
>
<a-menu-item
v-if=
"record.auditStatus === 'auditPass'"
>
<a
@
click=
"handlePerssion(record.roleId)"
>
授权
</a>
</a-menu-item>
<a-menu-item>
<a
href=
"javascript:;"
@
click=
"propertyDetails(2, record.id)"
v-if=
"record.auditStatus != 'waitAudit'"
>
编辑
</a>
</a-menu-item>
<a-menu-item
v-if=
"record.auditStatus === 'waitAudit'"
>
<a
href=
"javascript:;"
@
click=
"propertyDetails(3, record.id)"
>
审核
</a>
</a-menu-item>
<a-menu-item
v-if=
"record.auditStatus === 'auditPass'"
>
<a
href=
"javascript:;"
@
click=
"onStatus(record)"
>
{{
record
.
partnersStatus
===
'normal'
?
'冻结'
:
'解冻'
}}
</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm
title=
"确定删除吗?"
@
confirm=
"() => handleDelete(record.id)"
placement=
"topLeft"
>
<a
style=
"color: #f00;"
>
删除
</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- table区域-end -->
<!-- 右侧的角色权限配置 -->
<user-role-modal
ref=
"modalUserRole"
></user-role-modal>
</a-card>
</
template
>
<
script
>
import
{
operatePartnersApi
}
from
'@/api/api'
import
{
JeecgListMixin
}
from
'@/mixins/JeecgListMixin'
import
{
filterDictTextByCache
}
from
'@/components/dict/JDictSelectUtil'
import
UserRoleModal
from
'./modules/UserRoleModal'
const
columns
=
[
{
title
:
'合作伙伴名称'
,
dataIndex
:
'partnersName'
,
key
:
'partnersName'
,
align
:
'center'
,
},
{
title
:
'统一社会信用代码'
,
dataIndex
:
'creditCode'
,
key
:
'creditCode'
,
align
:
'center'
,
},
{
title
:
'联系人'
,
dataIndex
:
'contactName'
,
key
:
'contactName'
,
align
:
'center'
,
},
{
title
:
'电话'
,
dataIndex
:
'contactPhone'
,
key
:
'contactPhone'
,
align
:
'center'
,
},
{
title
:
'授权时间'
,
dataIndex
:
'empowerEndDate'
,
scopedSlots
:
{
customRender
:
'empowerEndDate'
},
align
:
'center'
,
},
{
title
:
'推广商铺数量'
,
dataIndex
:
'empowerCommunityNum'
,
key
:
'empowerCommunityNum'
,
align
:
'center'
,
},
{
title
:
'推广费用合计'
,
dataIndex
:
'empowerCommunityNum1'
,
key
:
'empowerCommunityNum1'
,
align
:
'center'
,
},
{
title
:
'审核状态'
,
dataIndex
:
'auditStatus'
,
key
:
'auditStatus'
,
customRender
:
function
(
text
)
{
return
filterDictTextByCache
(
'auditStatus'
,
text
)
},
},
{
title
:
'到期提示'
,
dataIndex
:
'expirationStatus'
,
scopedSlots
:
{
customRender
:
'expirationStatus'
},
key
:
'expirationStatus'
,
align
:
'center'
,
},
{
title
:
'冻结状态'
,
dataIndex
:
'partnersStatus'
,
scopedSlots
:
{
customRender
:
'partnersStatus'
},
key
:
'partnersStatus'
,
align
:
'center'
,
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
scopedSlots
:
{
customRender
:
'action'
},
align
:
'center'
,
fixed
:
'right'
,
width
:
150
,
},
]
export
default
{
name
:
'PartnersList'
,
mixins
:
[
JeecgListMixin
],
components
:
{
UserRoleModal
},
data
()
{
return
{
columns
:
columns
,
loading
:
false
,
pagination
:
{},
url
:
{
list
:
'/property-central/partners/partnersInfo/list'
,
delete
:
'/property-central/partners/partnersInfo/delete'
,
deleteBatch
:
'/property-central/partners/partnersInfo/deleteBatch'
,
},
}
},
methods
:
{
propertyDetails
(
type
,
id
)
{
if
(
type
==
1
)
{
this
.
$router
.
push
({
path
:
'/settled/partners/PartnersDetails?type=add'
,
})
}
else
if
(
type
==
2
)
{
this
.
$router
.
push
({
path
:
'/settled/partners/PartnersDetails?type=edit&id='
+
id
,
})
}
else
if
(
type
==
3
)
{
this
.
$router
.
push
({
path
:
'/settled/partners/PartnersDetails?type=audit&id='
+
id
,
})
}
else
if
(
type
==
4
)
{
this
.
$router
.
push
({
path
:
'/settled/partners/PartnersDetails?type=detail&id='
+
id
,
})
}
},
// onLoadDetail(record, type) {
// record['registAdress'] = [record.provinceCode, record.cityCode, record.countyCode]
// if (type === 'edit') {
// this.handleEdit(record)
// } else {
// this.handleDetail(record)
// }
// },
// onChange(date, dateString) {
// if (dateString.length > 0) {
// this.queryParam.createTime_begin = dateString[0]
// this.queryParam.createTime_end = dateString[1]
// } else {
// this.queryParam.createTime_begin = ''
// this.queryParam.createTime_end = ''
// }
// },
onStatus
(
record
)
{
let
that
=
this
this
.
$confirm
({
title
:
`确认
${
record
.
partnersStatus
===
'normal'
?
'冻结'
:
'解冻'
}
此合作伙伴?`
,
closable
:
true
,
okText
:
`
${
record
.
partnersStatus
===
'normal'
?
'冻结'
:
'解冻'
}
`
,
onOk
()
{
return
operatePartnersApi
({
id
:
record
.
id
,
status
:
`
${
record
.
partnersStatus
===
'normal'
?
'freeze'
:
'normal'
}
`
,
}).
then
((
res
)
=>
{
that
.
searchQuery
()
})
},
onCancel
()
{},
})
},
handlePerssion
(
roleId
)
{
this
.
$refs
.
modalUserRole
.
show
(
roleId
)
},
},
}
</
script
>
<
style
scoped
>
@import
'~@assets/less/common.less'
;
</
style
>
\ No newline at end of file
src/views/settled/partners/modules/RoleDataruleModal.vue
0 → 100644
浏览文件 @
eb43a3de
<
template
>
<a-drawer
title=
"数据规则/按钮权限配置"
width=
"365"
:closable=
"false"
@
close=
"onClose"
:visible=
"visible"
>
<a-tabs
defaultActiveKey=
"1"
>
<a-tab-pane
tab=
"数据规则"
key=
"1"
>
<a-checkbox-group
v-model=
"dataruleChecked"
v-if=
"dataruleList.length>0"
>
<a-row>
<a-col
:span=
"24"
v-for=
"(item,index) in dataruleList"
:key=
" 'dr'+index "
>
<a-checkbox
:value=
"item.id"
>
{{
item
.
ruleName
}}
</a-checkbox>
</a-col>
<a-col
:span=
"24"
>
<div
style=
"width: 100%;margin-top: 15px"
>
<a-button
@
click=
"saveDataruleForRole"
type=
"primary"
size=
"small"
icon=
"save"
>
点击保存
</a-button>
</div>
</a-col>
</a-row>
</a-checkbox-group>
<div
v-else
><h3>
无配置信息!
</h3></div>
</a-tab-pane>
<!--
<a-tab-pane
tab=
"按钮权限"
key=
"2"
>
敬请期待!!!
</a-tab-pane>
-->
</a-tabs>
</a-drawer>
</
template
>
<
script
>
import
ARow
from
'ant-design-vue/es/grid/Row'
import
ACol
from
'ant-design-vue/es/grid/Col'
import
{
getAction
,
postAction
}
from
'@/api/manage'
export
default
{
name
:
'RoleDataruleModal'
,
components
:
{
ACol
,
ARow
},
data
(){
return
{
functionId
:
''
,
roleId
:
''
,
visible
:
false
,
tabList
:
[{
key
:
'1'
,
tab
:
'数据规则'
,
},
{
key
:
'2'
,
tab
:
'按钮权限'
,
}],
activeTabKey
:
'1'
,
url
:{
datarule
:
"/sys/role/datarule"
,
},
dataruleList
:[],
dataruleChecked
:[]
}
},
methods
:{
loadData
(){
getAction
(
`
${
this
.
url
.
datarule
}
/
${
this
.
functionId
}
/
${
this
.
roleId
}
`
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
success
){
this
.
dataruleList
=
res
.
result
.
datarule
let
drChecked
=
res
.
result
.
drChecked
if
(
drChecked
){
this
.
dataruleChecked
=
drChecked
.
split
(
","
)
}
}
})
},
saveDataruleForRole
(){
if
(
!
this
.
dataruleChecked
||
this
.
dataruleChecked
.
length
==
0
){
this
.
$message
.
warning
(
"请注意,现未勾选任何数据权限!"
)
}
let
params
=
{
permissionId
:
this
.
functionId
,
roleId
:
this
.
roleId
,
dataRuleIds
:
this
.
dataruleChecked
.
join
(
","
)
}
console
.
log
(
"保存数据权限"
,
params
)
postAction
(
this
.
url
.
datarule
,
params
).
then
(
res
=>
{
if
(
res
.
success
){
this
.
$message
.
success
(
res
.
message
)
}
else
{
this
.
$message
.
error
(
res
.
message
)
}
})
},
show
(
functionId
,
roleId
){
this
.
onReset
()
this
.
functionId
=
functionId
this
.
roleId
=
roleId
this
.
visible
=
true
this
.
loadData
()
},
onClose
(){
this
.
visible
=
false
this
.
onReset
()
},
onTabChange
(
key
)
{
this
.
activeTabKey
=
key
},
onReset
(){
this
.
functionId
=
''
this
.
roleId
=
''
this
.
dataruleList
=
[]
this
.
dataruleChecked
=
[]
}
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
src/views/settled/partners/modules/SelectRulesModal.vue
0 → 100644
浏览文件 @
eb43a3de
<
template
>
<div>
<a-modal
centered
:title=
"title"
:width=
"1000"
:visible=
"visible"
@
ok=
"selectRulesOK"
@
cancel=
"handleCancel"
cancelText=
"关闭"
>
<!-- 查询区域 -->
<div
class=
"table-page-search-wrapper"
>
<a-form
layout=
"inline"
@
keyup
.
enter
.
native=
"searchQuery"
>
<a-row
:gutter=
"24"
>
<a-col
:span=
"10"
>
<a-form-item
label=
"分利规则名称"
>
<a-input
placeholder=
"请输入分利规则名称"
v-model=
"queryParam.ruleName"
></a-input>
</a-form-item>
</a-col>
<a-col
:span=
"8"
>
<span
style=
"float: left;overflow: hidden;"
class=
"table-page-search-submitButtons"
>
<a-button
type=
"primary"
@
click=
"searchQuery"
icon=
"search"
>
查询
</a-button>
<a-button
type=
"primary"
@
click=
"searchReset"
icon=
"reload"
style=
"margin-left: 8px"
>
重置
</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- table区域-begin -->
<div>
<a-table
size=
"small"
bordered
rowKey=
"id"
:columns=
"columns"
:dataSource=
"dataSource1"
:pagination=
"ipagination"
:loading=
"loading"
:scroll=
"
{ y: 240 }"
:rowSelection="{selectedRowKeys: selectedRowKeys,onSelect:onSelect,onChange: onSelectChange}"
@change="handleTableChange">
</a-table>
</div>
<!-- table区域-end -->
</a-modal>
</div>
</
template
>
<
script
>
import
{
filterObj
}
from
'@/utils/util'
import
{
getAction
}
from
'@/api/manage'
export
default
{
name
:
"selectRulesModal"
,
data
()
{
return
{
title
:
"选择小区"
,
names
:
[],
visible
:
false
,
// 查询条件
queryParam
:
{},
// 表头
columns
:
[
{
title
:
'分利规则名称'
,
align
:
"center"
,
width
:
100
,
dataIndex
:
'ruleName'
},
{
title
:
'判断条件'
,
align
:
"center"
,
width
:
100
,
dataIndex
:
'judgingCondition'
},
{
title
:
'sass总平台分利'
,
align
:
"center"
,
width
:
150
,
dataIndex
:
'saasBenefits'
},
{
title
:
'合作伙伴分利'
,
align
:
"center"
,
width
:
100
,
dataIndex
:
'partnerBenefits'
},
{
title
:
'小区分利'
,
align
:
"center"
,
width
:
100
,
dataIndex
:
'communityBenefits'
},
],
//数据集
dataSource1
:
[],
// 分页参数
ipagination
:
{
current
:
1
,
pageSize
:
10
,
pageSizeOptions
:
[
'10'
,
'20'
,
'30'
],
showTotal
:
(
total
,
range
)
=>
{
return
range
[
0
]
+
"-"
+
range
[
1
]
+
" 共"
+
total
+
"条"
},
showQuickJumper
:
true
,
showSizeChanger
:
true
,
total
:
0
},
isorter
:
{
column
:
'createTime'
,
order
:
'desc'
,
},
loading
:
false
,
selectedRowKeys
:
[],
selectedRows
:
[],
selectedCurrently
:[],
// selectedRowKeys:[],
url
:
{
list
:
"/property-central/sharerule/shareRule/list"
,
}
}
},
created
()
{
this
.
loadData
();
},
methods
:
{
searchQuery
()
{
this
.
loadData
(
1
);
},
searchReset
()
{
this
.
queryParam
=
{};
this
.
loadData
(
1
);
},
handleCancel
()
{
this
.
visible
=
false
;
},
selectRulesOK
()
{
this
.
$emit
(
"selectFinished"
,
this
.
selectedCurrently
);
this
.
visible
=
false
;
},
loadData
(
arg
)
{
//加载数据 若传入参数1则加载第一页的内容
if
(
arg
===
1
)
{
this
.
ipagination
.
current
=
1
;
}
var
params
=
this
.
getQueryParams
();
//查询条件
getAction
(
this
.
url
.
list
,
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
dataSource1
=
res
.
result
.
records
;
this
.
ipagination
.
total
=
res
.
result
.
total
;
}
})
},
getQueryParams
()
{
var
param
=
Object
.
assign
({},
this
.
queryParam
,
this
.
isorter
);
param
.
pageNo
=
this
.
ipagination
.
current
;
param
.
pageSize
=
this
.
ipagination
.
pageSize
;
return
filterObj
(
param
);
},
onSelect
(
record
,
selected
)
{
// if (selected === true) {
// this.selectedCurrently = record;
// }
},
onSelectChange
(
selectedRowKeys
,
selectedRows
)
{
this
.
selectedRowKeys
=
selectedRowKeys
;
this
.
selectionRows
=
selectedRows
;
this
.
selectedCurrently
=
selectedRows
;
},
handleTableChange
(
pagination
,
filters
,
sorter
)
{
//分页、排序、筛选变化时触发
console
.
log
(
sorter
);
//TODO 筛选
if
(
Object
.
keys
(
sorter
).
length
>
0
)
{
this
.
isorter
.
column
=
sorter
.
field
;
this
.
isorter
.
order
=
"ascend"
==
sorter
.
order
?
"asc"
:
"desc"
}
this
.
ipagination
=
pagination
;
this
.
loadData
();
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.ant-card-body .table-operator {
margin-bottom: 18px;
}
.ant-table-tbody .ant-table-row td {
padding-top: 15px;
padding-bottom: 15px;
}
.anty-row-operator button {
margin: 0 5px
}
.ant-btn-danger {
background-color: #ffffff
}
.ant-modal-cust-warp {
height: 100%
}
.ant-modal-cust-warp .ant-modal-body {
height: calc(100% - 110px) !important;
overflow-y: auto
}
.ant-modal-cust-warp .ant-modal-content {
height: 90% !important;
overflow-y: hidden
}
</
style
>
\ No newline at end of file
src/views/settled/partners/modules/UserRoleModal.vue
0 → 100644
浏览文件 @
eb43a3de
<
template
>
<a-drawer
:title=
"title"
:maskClosable=
"true"
width=
650
placement=
"right"
:closable=
"true"
@
close=
"close"
:visible=
"visible"
style=
"overflow: auto;padding-bottom: 53px;"
>
<a-form>
<a-form-item
label=
'所拥有的权限'
>
<a-tree
checkable
@
check=
"onCheck"
:checkedKeys=
"checkedKeys"
:treeData=
"treeData"
@
expand=
"onExpand"
@
select=
"onTreeNodeSelect"
:selectedKeys=
"selectedKeys"
:expandedKeys=
"expandedKeysss"
:checkStrictly=
"checkStrictly"
>
<span
slot=
"hasDatarule"
slot-scope=
"
{slotTitle,ruleFlag}">
{{
slotTitle
}}
<a-icon
v-if=
"ruleFlag"
type=
"align-left"
style=
"margin-left:5px;color: red;"
></a-icon>
</span>
</a-tree>
</a-form-item>
</a-form>
<div
class=
"drawer-bootom-button"
>
<a-dropdown
style=
"float: left"
:trigger=
"['click']"
placement=
"topCenter"
>
<a-menu
slot=
"overlay"
>
<a-menu-item
key=
"1"
@
click=
"switchCheckStrictly(1)"
>
父子关联
</a-menu-item>
<a-menu-item
key=
"2"
@
click=
"switchCheckStrictly(2)"
>
取消关联
</a-menu-item>
<a-menu-item
key=
"3"
@
click=
"checkALL"
>
全部勾选
</a-menu-item>
<a-menu-item
key=
"4"
@
click=
"cancelCheckALL"
>
取消全选
</a-menu-item>
<a-menu-item
key=
"5"
@
click=
"expandAll"
>
展开所有
</a-menu-item>
<a-menu-item
key=
"6"
@
click=
"closeAll"
>
合并所有
</a-menu-item>
</a-menu>
<a-button>
树操作
<a-icon
type=
"up"
/>
</a-button>
</a-dropdown>
<a-popconfirm
title=
"确定放弃编辑?"
@
confirm=
"close"
okText=
"确定"
cancelText=
"取消"
>
<a-button
style=
"margin-right: .8rem"
>
取消
</a-button>
</a-popconfirm>
<a-button
@
click=
"handleSubmit(false)"
type=
"primary"
:loading=
"loading"
ghost
style=
"margin-right: 0.8rem"
>
仅保存
</a-button>
<a-button
@
click=
"handleSubmit(true)"
type=
"primary"
:loading=
"loading"
>
保存并关闭
</a-button>
</div>
<role-datarule-modal
ref=
"datarule"
></role-datarule-modal>
</a-drawer>
</
template
>
<
script
>
import
{
queryTreeListByTypeForRole
,
queryRolePermission
,
saveRolePermission
}
from
'@/api/api'
import
RoleDataruleModal
from
'./RoleDataruleModal.vue'
export
default
{
name
:
"RoleModal"
,
components
:{
RoleDataruleModal
},
data
(){
return
{
roleId
:
""
,
treeData
:
[],
defaultCheckedKeys
:[],
checkedKeys
:[],
expandedKeysss
:[],
allTreeKeys
:[],
autoExpandParent
:
true
,
checkStrictly
:
false
,
title
:
"物业权限配置"
,
visible
:
false
,
loading
:
false
,
selectedKeys
:[]
}
},
methods
:
{
onTreeNodeSelect
(
id
){
if
(
id
&&
id
.
length
>
0
){
this
.
selectedKeys
=
id
}
this
.
$refs
.
datarule
.
show
(
this
.
selectedKeys
[
0
],
this
.
roleId
)
},
onCheck
(
o
)
{
if
(
this
.
checkStrictly
){
this
.
checkedKeys
=
o
.
checked
;
}
else
{
this
.
checkedKeys
=
o
}
},
show
(
roleId
){
this
.
roleId
=
roleId
this
.
visible
=
true
;
},
close
()
{
this
.
reset
()
this
.
$emit
(
'close'
);
this
.
visible
=
false
;
},
onExpand
(
expandedKeys
){
this
.
expandedKeysss
=
expandedKeys
;
this
.
autoExpandParent
=
false
},
reset
()
{
this
.
expandedKeysss
=
[]
this
.
checkedKeys
=
[]
this
.
defaultCheckedKeys
=
[]
this
.
loading
=
false
},
expandAll
()
{
this
.
expandedKeysss
=
this
.
allTreeKeys
},
closeAll
()
{
this
.
expandedKeysss
=
[]
},
checkALL
()
{
this
.
checkedKeys
=
this
.
allTreeKeys
},
cancelCheckALL
()
{
//this.checkedKeys = this.defaultCheckedKeys
this
.
checkedKeys
=
[]
},
switchCheckStrictly
(
v
)
{
if
(
v
==
1
){
this
.
checkStrictly
=
false
}
else
if
(
v
==
2
){
this
.
checkStrictly
=
true
}
},
handleCancel
()
{
this
.
close
()
},
handleSubmit
(
exit
)
{
let
that
=
this
;
let
params
=
{
roleId
:
that
.
roleId
,
permissionIds
:
that
.
checkedKeys
.
join
(
","
),
lastpermissionIds
:
that
.
defaultCheckedKeys
.
join
(
","
),
};
that
.
loading
=
true
;
console
.
log
(
"请求参数:"
,
params
);
saveRolePermission
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
){
that
.
$message
.
success
(
res
.
message
);
that
.
loading
=
false
;
if
(
exit
)
{
that
.
close
()
}
}
else
{
that
.
$message
.
error
(
res
.
message
);
that
.
loading
=
false
;
if
(
exit
)
{
that
.
close
()
}
}
this
.
loadData
();
})
},
loadData
(){
queryTreeListByTypeForRole
({
platformType
:
'partner'
}).
then
((
res
)
=>
{
this
.
treeData
=
res
.
result
.
treeList
this
.
allTreeKeys
=
res
.
result
.
ids
queryRolePermission
({
roleId
:
this
.
roleId
}).
then
((
res
)
=>
{
this
.
checkedKeys
=
[...
res
.
result
];
this
.
defaultCheckedKeys
=
[...
res
.
result
];
this
.
expandedKeysss
=
this
.
allTreeKeys
;
console
.
log
(
this
.
defaultCheckedKeys
)
})
})
}
},
watch
:
{
visible
()
{
if
(
this
.
visible
)
{
this
.
loadData
();
}
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论