Commit 2cbd7c56 authored by 邓超's avatar 邓超

fix: 新增菜单产品跟url合并处理

parent fb84fbcb
Pipeline #71267 passed with stages
...@@ -18,6 +18,14 @@ const AddForm = props => { ...@@ -18,6 +18,14 @@ const AddForm = props => {
const submit = () => { const submit = () => {
if (addType === 1) { if (addType === 1) {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let arr = obj.pageUrl.split('/'); // 用const声明常量
const product = productList.find(item => item.PackageName.includes(arr[0]));
if (product) {
arr.shift();
obj.pageUrl = arr.join('/');
}
console.log(product, 'product');
obj.product = product?.PackageName || 'civweb4';
submitCallback(obj, nodeObj); submitCallback(obj, nodeObj);
} }
if (addType === 2) { if (addType === 2) {
...@@ -54,7 +62,7 @@ const AddForm = props => { ...@@ -54,7 +62,7 @@ const AddForm = props => {
<Item label="菜单别名" name="shortName"> <Item label="菜单别名" name="shortName">
<Input placeholder="请输入菜单别名" /> <Input placeholder="请输入菜单别名" />
</Item> </Item>
<Item label="产品类型:" name="product"> {/* <Item label="产品类型:" name="product">
<Select placeholder="请选择产品类型" allowClear> <Select placeholder="请选择产品类型" allowClear>
{productList && {productList &&
productList.length > 0 && productList.length > 0 &&
...@@ -64,7 +72,7 @@ const AddForm = props => { ...@@ -64,7 +72,7 @@ const AddForm = props => {
</Option> </Option>
))} ))}
</Select> </Select>
</Item> </Item> */}
<Item <Item
label="菜单图标" label="菜单图标"
name="imageUrl" name="imageUrl"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment