Commit d8cdec6b authored by 田翔's avatar 田翔

fix: 代码优化

parent c4e973a5
Pipeline #81838 passed with stages
import React, { useState, useContext, useMemo, useEffect } from 'react'
import styles from './index.less'
import { Input, Form, TreeSelect, Switch, Modal, Space, Button } from 'antd'
import { Input, Form, TreeSelect, Switch, Modal, Space, Button, Popover } from 'antd'
import { GlobalStore } from '../index'
import { getMenuInfo, getMiniAppModuleTree } from '@/services/mobileConfig/api'
import {
......@@ -19,6 +19,7 @@ import { getImageBases } from '@/services/common/api'
import PicturesWall from '@/components/Upload/index'
const { TreeNode } = TreeSelect
const { TextArea } = Input
const themes = [
{ name: '供水主题背景' },
......@@ -220,6 +221,25 @@ const Right = () => {
setParamShow(false)
}
const content = (
<TreeSelect
showSearch
treeNodeFilterProp="title"
style={{ width: '280px' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择功能路径"
allowClear
treeDefaultExpandAll
treeIcon
onChange={(value) => {
let item = urlArray.find(v => v.menuID === value)
cardSettingOther(item.product + item.pageUrl, 'url')
}}
>
{moblieList.map(i => mapTreeMoblie(i))}
</TreeSelect>
)
useEffect(() => {
getData()
//初始增加一个供水主题
......@@ -298,24 +318,12 @@ const Right = () => {
}
</Form.Item>
<Form.Item label="功能跳转" name="url">
<TreeSelect
showSearch
treeNodeFilterProp="title"
style={{ width: '97%' }}
value={card.url}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择功能路径"
allowClear
treeDefaultExpandAll
treeIcon
// onSearch={(value) => cardSettingOther(value, 'url')}
onChange={(value) => {
let item = urlArray.find(v => v.menuID === value)
cardSettingOther(item.product + item.pageUrl, 'url')
}}
<Popover
content={content}
trigger="click"
>
{moblieList.map(i => mapTreeMoblie(i))}
</TreeSelect>
<TextArea value={card.url} onChange={e => cardSettingOther(e.target.value, 'url')} rows={4} />
</Popover>
</Form.Item>
<Form.Item label="卡片参数" name="param">
<Input value={card.param} onClick={paramShowChange} />
......
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