@@ -72,30 +72,30 @@ export async function getInitialState() { | |||
} | |||
], | |||
}, | |||
{ | |||
code: 'integral', | |||
name: '积分管理', | |||
icon: 'BankFilled', | |||
path: '/integral', | |||
routes: [ | |||
{ | |||
code: 'integralConfigure', | |||
name: '积分规则', | |||
icon: 'smile', | |||
path: '/integral/integralConfigure', | |||
component: './integral/integralConfigure', | |||
access: 'k12', | |||
}, | |||
{ | |||
name: '规则分发', | |||
icon: 'smile', | |||
path: '/integral/integralDistribute', | |||
component: './integral/integralDistribute', | |||
access: 'k12', | |||
}, | |||
] | |||
// { | |||
// code: 'integral', | |||
// name: '积分管理', | |||
// icon: 'BankFilled', | |||
// path: '/integral', | |||
// routes: [ | |||
// { | |||
// code: 'integralConfigure', | |||
// name: '积分规则', | |||
// icon: 'smile', | |||
// path: '/integral/integralConfigure', | |||
// component: './integral/integralConfigure', | |||
// access: 'k12', | |||
// }, | |||
// { | |||
// name: '规则分发', | |||
// icon: 'smile', | |||
// path: '/integral/integralDistribute', | |||
// component: './integral/integralDistribute', | |||
// access: 'k12', | |||
// }, | |||
// ] | |||
}, | |||
// }, | |||
{ | |||
code: 'foodMenu', | |||
name: '菜谱管理', | |||
@@ -271,14 +271,6 @@ export async function getInitialState() { | |||
component: './goods/newgoods', | |||
access: 'k10', | |||
}, | |||
{ | |||
code: 'goods-taste', | |||
name: '商品口味', | |||
icon: 'smile', | |||
path: '/goods/goods-taste', | |||
component: './goods/goods-taste', | |||
access: 'k11', | |||
}, | |||
{ | |||
code: 'goods-type', | |||
name: '商品小类', | |||
@@ -304,6 +296,7 @@ export async function getInitialState() { | |||
access: 'k11', | |||
}, | |||
{ | |||
code: 'goodsPractice', | |||
name: '做法关联设置', | |||
icon: 'smile', | |||
path: '/goods/goodsPractice', | |||
@@ -311,6 +304,7 @@ export async function getInitialState() { | |||
access: 'k9', | |||
}, | |||
{ | |||
code: 'goodsPracticeType', | |||
name: '商品做法类别', | |||
icon: 'smile', | |||
path: '/goods/goodsPracticeType', | |||
@@ -318,6 +312,7 @@ export async function getInitialState() { | |||
access: 'k9', | |||
}, | |||
{ | |||
code: 'goodsPracticeInfo', | |||
name: '商品做法基础信息', | |||
icon: 'smile', | |||
path: '/goods/goodsPracticeInfo', | |||
@@ -619,11 +614,11 @@ export async function getInitialState() { | |||
const currentUser = await fetchUserInfo(); | |||
var tempMenu = await queryMenuData(); | |||
//创建菜单 | |||
// await syncMenus(tempMenu); | |||
// if (!isDev) { | |||
// var data = await dymicMenus(currentUser.data.id); | |||
// tempMenu = data.data; | |||
// } | |||
//await syncMenus(tempMenu); | |||
if (!isDev) { | |||
var data = await dymicMenus(currentUser.data.id); | |||
tempMenu = data.data; | |||
} | |||
return { | |||
fetchUserInfo, | |||
@@ -257,21 +257,6 @@ const Advanced = (props) => { | |||
} | |||
</Select> | |||
</Form.Item> | |||
<Form.Item name="tasteID" label="商品口味" rules={[{ required: true }]}> | |||
<Select> | |||
{ | |||
goodsTaste == undefined ? '' : ( | |||
goodsTaste.map((item, index) => { | |||
return ( | |||
<Select.Option index={index} value={item.id} key={item.id}> | |||
{item.tasteClassName} | |||
</Select.Option> | |||
); | |||
}) | |||
) | |||
} | |||
</Select> | |||
</Form.Item> | |||
<Form.Item | |||
name="status" | |||
label="状态" | |||
@@ -387,19 +372,8 @@ const Advanced = (props) => { | |||
setGoodsBigTypes(arr); | |||
}); | |||
} | |||
function initGoodsTaste() { | |||
getgoodsTaste().then((r) => { | |||
var arr = r.data; | |||
arr.forEach((element) => { | |||
element.text = element.tasteClassName; | |||
}); | |||
setGoodsTaste(arr); | |||
}); | |||
} | |||
initGoodsType(); | |||
initGoodsBigType(); | |||
initGoodsTaste(); | |||
}, []); | |||
return ( | |||
@@ -31,6 +31,7 @@ const CreateForm = (props) => { | |||
<Form.Item name="adminName" label="管理员姓名" rules={[{ required: true, max: 20 }]}> | |||
<Input placeholder="请输入管理员姓名" /> | |||
</Form.Item> | |||
<Form.Item name="settlementCycles" label="结算周期" rules={[{ required: true}]}> | |||
<InputNumber step={1} min={1} max={100} precision={0} /> | |||
</Form.Item> | |||
@@ -45,6 +46,9 @@ message: '手机号格式不正确' }]}> | |||
<Form.Item name="host" label="域名" rules={[{ max: 100 }]}> | |||
<Input placeholder="请输入域名" /> | |||
</Form.Item> | |||
<Form.Item name="wechatAppId" label="小程序id" rules={[{ max: 100 }]}> | |||
<Input placeholder="小程序id" /> | |||
</Form.Item> | |||
<Form.Item name="remark" label="备注" rules={[{ max: 100 }]}> | |||
<Input placeholder="请输入备注" /> | |||
</Form.Item> | |||
@@ -6,7 +6,13 @@ import Enumerable from 'linq'; | |||
const MenuForm = (props) => { | |||
const [load, setLoad] = useState(); | |||
const [selectedRowsState, setSelectedRows] = useState(); | |||
const [checkedKeys, setCheckedKeys] = useState(); | |||
useEffect(async () => { | |||
var arr = []; | |||
Enumerable.from(props.values).forEach(t => { | |||
arr.push(t.id); | |||
}); | |||
setCheckedKeys(arr) | |||
var ret = await api.GetMenu('ALL'); | |||
var data = Enumerable.from(ret.data).toArray(); | |||
setLoad(data); | |||
@@ -15,7 +21,7 @@ const MenuForm = (props) => { | |||
const lbl = () => { | |||
var arr = []; | |||
Enumerable.from(props.values).forEach(t => { | |||
arr.push(<Tag style={{width:68,margin:'Center'}} color="processing">{t}</Tag>); | |||
arr.push(<Tag style={{ width: 68, margin: 'Center' }} color="processing">{t.name}</Tag>); | |||
}); | |||
return arr; | |||
} | |||
@@ -25,20 +31,21 @@ const MenuForm = (props) => { | |||
destroyOnClose | |||
title={'菜单分配'} | |||
visible={props.modalVisible} | |||
onOk={() => props.onSubmit(selectedRowsState)} | |||
onOk={() => props.onSubmit(checkedKeys)} | |||
onCancel={() => props.onCancel()} | |||
maskClosable={false}> | |||
<Row> | |||
<Col span={12}> | |||
<Tree treeData={load} | |||
onCheck={(keys, e) => { setSelectedRows(keys) }} | |||
onCheck={(keys, e) => { setCheckedKeys(keys) }} | |||
defaultExpandAll={true} | |||
checkedKeys={checkedKeys} | |||
checkable /> | |||
</Col> | |||
<Col span={12}> | |||
<div>已选菜单</div> | |||
{props.values == undefined ? '' : ( | |||
lbl() | |||
lbl() | |||
)} | |||
</Col> | |||
@@ -47,4 +54,4 @@ const MenuForm = (props) => { | |||
return html | |||
}; | |||
export default MenuForm; | |||
export default MenuForm; |
@@ -159,6 +159,12 @@ const companyManage = () => { | |||
title: '电话', | |||
dataIndex: 'phone', | |||
}, | |||
{ | |||
title: '小程序id', | |||
dataIndex: 'wechatAppId', | |||
hideInSearch:true, | |||
}, | |||
{ | |||
title: '备注', | |||
dataIndex: 'remark', | |||
@@ -203,7 +209,7 @@ const companyManage = () => { | |||
<a | |||
onClick={() => { | |||
api.GetRoleMenu(record.sysRoleId).then((r) => { | |||
setRow(r.data.data); | |||
setRow(r.data); | |||
handleUpdateMenuModalVisible(true); | |||
}); | |||
setStepFormValues(record); | |||
@@ -6,7 +6,13 @@ import Enumerable from 'linq'; | |||
const MenuForm = (props) => { | |||
const [load, setLoad] = useState(); | |||
const [selectedRowsState, setSelectedRows] = useState(); | |||
const [checkedKeys, setCheckedKeys] = useState(); | |||
useEffect(async () => { | |||
var arr = []; | |||
Enumerable.from(props.values).forEach(t => { | |||
arr.push(t.id); | |||
}); | |||
setCheckedKeys(arr) | |||
var ret = await api.SelectTree(); | |||
var data = Enumerable.from(ret.data).toArray(); | |||
setLoad(data); | |||
@@ -15,7 +21,7 @@ const MenuForm = (props) => { | |||
const lbl = () => { | |||
var arr = []; | |||
Enumerable.from(props.values).forEach(t => { | |||
arr.push(<Tag style={{width:68,margin:'Center'}} color="processing">{t}</Tag>); | |||
arr.push(<Tag style={{ width: 68, margin: 'Center' }} color="processing">{t.name}</Tag>); | |||
}); | |||
return arr; | |||
} | |||
@@ -25,15 +31,16 @@ const MenuForm = (props) => { | |||
destroyOnClose | |||
title={'菜单分配'} | |||
visible={props.modalVisible} | |||
onOk={() => props.onSubmit(selectedRowsState)} | |||
onOk={() => props.onSubmit(checkedKeys)} | |||
onCancel={() => props.onCancel()} | |||
maskClosable={false}> | |||
<Row> | |||
<Col span={12}> | |||
<Tree treeData={load} | |||
onCheck={(keys, e) => { setSelectedRows(keys) }} | |||
defaultExpandAll={true} | |||
checkable /> | |||
onCheck={(keys, e) => { setCheckedKeys(keys) }} | |||
defaultExpandAll={true} | |||
checkedKeys={checkedKeys} | |||
checkable /> | |||
</Col> | |||
<Col span={12}> | |||
<div> | |||
@@ -47,4 +54,4 @@ const MenuForm = (props) => { | |||
return html | |||
}; | |||
export default MenuForm; | |||
export default MenuForm; |
@@ -167,7 +167,7 @@ const roleManager = () => { | |||
style={{ pointerEvents: record.code =='sys_manager_role' ? 'none' : 'auto' }} | |||
onClick={() => { | |||
GetRoleMenu(record.id).then(r => { | |||
setRow( r.data.data ); | |||
setRow(r.data); | |||
handleUpdateMenuModalVisible(true); | |||
}) | |||
setStepFormValues(record); | |||