diff --git a/src/pages/MerchantMgm/FunctionMgm/index.scss b/src/pages/MerchantMgm/FunctionMgm/index.scss index e96872a..6500a9d 100644 --- a/src/pages/MerchantMgm/FunctionMgm/index.scss +++ b/src/pages/MerchantMgm/FunctionMgm/index.scss @@ -350,5 +350,12 @@ $color-primary : var(--color-primary); .rest { margin-left: 10px; } + .bind-tree { + .ant-tree-list { + max-height: 200px; + overflow-y: auto; + @include scrollBar("", ""); + } + } } } diff --git a/src/pages/MerchantMgm/FunctionMgm/loadable.jsx b/src/pages/MerchantMgm/FunctionMgm/loadable.jsx index b603c8f..bd47a41 100644 --- a/src/pages/MerchantMgm/FunctionMgm/loadable.jsx +++ b/src/pages/MerchantMgm/FunctionMgm/loadable.jsx @@ -88,1097 +88,10 @@ function FunctionMgm() { const [updateVisible, setUpdateVisible] = useState(false) //更新表单 const [updateForm]=Form.useForm() - //绑定功能 - const treeData = [ - { - title: '路内停车管理系统', - key: '0', - children: [ - { - title: '停车场管理', - key: '0-0', - children: [ - { - title: '停车场管理', - key: '0-0-0', - children: [ - { - title: '【按钮】查询', - key: '0-0-0-0', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - { - title: '【按钮】停车场配置', - key: '', - }, - ] - }, - { - title: '停车记录查询', - key: '0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】详情', - key: '', - }, - ] - }, - { - title: '泊位列表', - key: '0-0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - ] - }, - ], - }, - { - title: '业务管理', - key: '0-0-1', - children: [ - { - title: '计费规则管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - ] - }, - { - title: '白名单管理', - key: '', - children: [ - { - title: '白名单记录', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - { - title: '【按钮】修改', - key: '', - }, - { - title: '【按钮】启用', - key: '', - }, - ] - }, - { - title: '白名单申请', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】创建申请', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - { - title: '【按钮】修改', - key: '', - }, - { - title: '【按钮】删除', - key: '', - }, - ] - }, - { - title: '白名单审核', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】审核', - key: '', - }, - ] - }, - ] - }, - ], - }, - { - title: '人员管理', - key: '0-0-1', - children: [ - { - title: '人员管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】离职/在职', - key: '', - }, - ] - }, - { - title: '人员考勤', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - ] - }, - ], - }, - { - title: '设备管理', - key: '0-0-0-1', - children: [ - { - title: '路内车场设备监控', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】详情', - key: '', - }, - ] - }, - { - title: '路外车场设备监控', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】详情', - key: '', - }, - ] - }, - { - title: '视频监控设备管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】删除', - key: '', - }, - { - title: '【按钮】查看监控', - key: '', - }, - ] - }, - { - title: '杆位管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - { - title: '【按钮】导入', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: 'PDA管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】删除', - key: '', - }, - ] - }, - { - title: '品牌管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - ] - }, - ] - }, - { - title: '运营统计', - key: '0-0-1', - children: [ - { - title: '停车场数据分析', - key: '', - children: [ - { - title: '停车场实况数据', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - ] - }, - { - title: '停车场运营分析', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - ] - }, - - ] - }, - ], - }, - { - title: '财务管理', - key: '0-0-1', - children: [ - { - title: '停车场欠费订单', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '欠费追缴查询', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '停车场收入报表', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '营收总报表', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '收费员收入统计', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '支付渠道统计', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - } - ] - }, - { - title: '发票记录', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】冲红重开', - key: '', - }, - ] - }, - { - title: '停车支付订单', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - ], - }, - ], - }, - { - title: '路外停车管理系统', - key: '0-0', - children: [ - { - title: '停车场管理', - key: '0-0-0', - children: [ - { - title: '停车场管理', - key: '0-0-0-0', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - { - title: '【按钮】二维码下载', - key: '', - }, - { - title: '【按钮】保存并同步', - key: '', - }, - { - title: '【按钮】停车场配置', - key: '', - }, - ] - }, - { - title: '计费规则管理', - key: '0-0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】删除', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - ] - }, - { - title: '停车记录查询', - key: '0-0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】详情', - key: '', - }, - ] - }, - ], - }, - { - title: '人员管理', - key: '0-0-1', - children: [ - { - title: '交接班报表', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - ] - }, - { - title: 'MS收费员管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】在职/离职', - key: '', - }, - ] - }, - ], - }, - { - title: '设备管理', - key: '0-0-0-1', - children: [ - { - title: '视频监控设备管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】删除', - key: '', - }, - { - title: '【按钮】查看监控', - key: '', - }, - ] - }, - { - title: '路外设备管理', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看', - key: '', - } - ] - } - ] - }, - { - title: '运营统计', - key: '0-0-1', - children: [ - { - title: '停车场数据分析', - key: '', - children: [ - { - title: '停车场实况数据', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - ] - }, - { - title: '停车场运营分析', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - ] - }, - - ] - }, - ], - }, - { - title: '异常管理', - key: '0-0-1', - children: [ - { - title: '抬杆记录', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '特殊放行记录', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '车牌修正记录', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - } - ], - }, - { - title: '财务管理', - key: '0-0-1', - children: [ - { - title: '停车场支付订单', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '营收总报表', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '停车场收入报表', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - ] - }, - { - title: '支付渠道统计', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - ] - }, - ], - }, - ], - }, - { - title: '充电管理系统', - key: '0-0', - children: [ - { - title: '实时监控', - key: '0-0-0', - children: [ - { - title: '电桩监控', - key: '0-0-0-0', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看详情', - key: '', - }, - { - title: '【按钮】远程监控', - key: '', - }, - { - title: '【按钮】状态变更记录', - key: '', - }, - ] - }, - { - title: '充电监控', - key: '0-0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看详情', - key: '', - }, - ] - }, - { - title: '地锁监控', - key: '0-0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看详情', - key: '', - }, - ] - }, - { - title: '充电泊位监控', - key: '0-0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看详情', - key: '', - }, - ] - }, - ], - }, - { - title: '记录查询', - key: '0-0-1', - children: [ - { - title: '充电订单', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - { - title: '【按钮】查看详情', - key: '', - }, - ] - }, - { - title: '开锁记录', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - } - ] - }, - { - title: '预约订单', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】导出', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - ] - }, - { - title: '违规行为记录', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】详情', - key: '', - }, - ] - }, - ], - }, - ] - }, - { - title: '系统管理', - key: '0-0', - children: [ - { - title: '商户信息查看', - key: '0-0-0', - children: [ - { - title: '【按钮】查询', - key: '0-0-0-0', - }, - { - title: '【Tab】商户信息', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - ] - }, - { - title: '【Tab】发票配置', - key: '', - children: [ - { - title: '【按钮】查询', - key: '', - }, - ] - }, - { - title: '计费规则管理', - key: '0-0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】删除', - key: '', - }, - { - title: '【按钮】查看', - key: '', - }, - ] - }, - { - title: '停车记录查询', - key: '0-0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】详情', - key: '', - }, - ] - }, - ], - }, - { - title: '管理员管理', - key: '0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】离职', - key: '', - }, - ], - }, - { - title: '角色管理', - key: '0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】删除', - key: '', - }, - ], - }, - { - title: '组织架构', - key: '0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】添加', - key: '', - }, - { - title: '【按钮】编辑', - key: '', - }, - { - title: '【按钮】删除', - key: '', - }, - ], - }, - { - title: '系统日志', - key: '0-0-1', - children: [ - { - title: '【按钮】查询', - key: '', - }, - { - title: '【按钮】查看', - key: '', - } - ], - }, - ], - }, - ]; + // 功能绑定数据 + const [bindTreeData, setBindTreeData] = useState([]); + //功能绑定选中 + const [checkedKeys, setCheckedKeys] = useState([]); //获取商户名称的下拉 const getTenantNamePull = () => { ajax.ElectInvoice.getSelectOperator().then( @@ -1246,8 +159,40 @@ function FunctionMgm() { getTable({...parameter}) } + // 绑定功能全选 + const $onCheckEditBox = () => { + let arr = [] + if (!bindTreeData.length) return + bindTreeData.map(res => { + arr.push(res.id) + res.children.map(res => { + arr.push(res.id) + res.children?.map(res => { + arr.push(res.id) + res.children?.map(res => { + arr.push(res.id) + res.children?.map(res => { + arr.push(res.id) + }) + }) + }) + }) + }) + setCheckedKeys(arr) + } + //编辑 const updateBtn = (record) => { + ajax.getDepartId().then((res) => { + if (res.status === 20000 || res.status == 0) { + setBindTreeData(res?.data || []) + } else { + message.error(res.message); + } + }).catch((error) => { + setLoading(false); + message.error(error.message); + }); setUpdateVisible(true) updateForm.setFieldsValue( { @@ -1263,16 +208,15 @@ function FunctionMgm() { } //编辑后提交 const submitUpdate=()=>{ - + let value = updateForm.getFieldsValue(["note"]); + value = { + ...value, + bind: checkedKeys, + tenantName: formData.tenantName + }; + console.log(value); } - const onSelect = (selectedKeys, info) => { - console.log('selected', selectedKeys, info); - }; - const onCheck = (checkedKeys, info) => { - console.log('onCheck', checkedKeys, info); - }; - useEffect( () => { const value = searchForm.getFieldsValue(["operatorid", "phone", "name", "account", "status"]) @@ -1370,8 +314,8 @@ function FunctionMgm() { - - + + {/* { + // setGetImg( + // Object.assign({}, getImg, { auth: checkedKeysValue }) + // ); + setCheckedKeys(checkedKeysValue) + }} + checkedKeys={checkedKeys} + treeData={bindTreeData} + fieldNames={{ + title: 'name', + key: 'id', + children: 'children' + }} /> */} diff --git a/src/pages/MerchantMgm/MerchantInfo/loadable.jsx b/src/pages/MerchantMgm/MerchantInfo/loadable.jsx index ab79dc8..d397cb3 100644 --- a/src/pages/MerchantMgm/MerchantInfo/loadable.jsx +++ b/src/pages/MerchantMgm/MerchantInfo/loadable.jsx @@ -897,7 +897,7 @@ const MerchantInfo = (props) => { > }