Commit 4ff2023e authored by 皮倩雯's avatar 皮倩雯

fix: '表字段形态'

parent e163b3ff
Pipeline #53883 passed with stages
...@@ -58,6 +58,7 @@ const AddModal = props => { ...@@ -58,6 +58,7 @@ const AddModal = props => {
onCancel, onCancel,
treeData, treeData,
keepTreeFirst, keepTreeFirst,
keepStandingBook,
} = props; } = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [fieldName, setFieldName] = useState([]); // 弹窗 const [fieldName, setFieldName] = useState([]); // 弹窗
...@@ -86,6 +87,7 @@ const AddModal = props => { ...@@ -86,6 +87,7 @@ const AddModal = props => {
'设备二维码', '设备二维码',
'本人ID', '本人ID',
'富文本', '富文本',
'编码',
], ],
}, },
{ {
...@@ -121,11 +123,11 @@ const AddModal = props => { ...@@ -121,11 +123,11 @@ const AddModal = props => {
ID: 4, ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'], children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
}, },
{ // {
name: '台账专有类', // name: '台账专有类',
ID: 5, // ID: 5,
children: ['编码', '智能抄表'], // children: ['智能抄表'],
}, // },
]); ]);
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [isShow, setIsShow] = useState(false); // 弹窗 const [isShow, setIsShow] = useState(false); // 弹窗
...@@ -165,6 +167,7 @@ const AddModal = props => { ...@@ -165,6 +167,7 @@ const AddModal = props => {
const { Item } = Form; const { Item } = Form;
const { TreeNode } = TreeSelect; const { TreeNode } = TreeSelect;
const [timeData, setTimeData] = useState(''); const [timeData, setTimeData] = useState('');
const { Option } = Select;
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
// 不切换树 // 不切换树
...@@ -266,8 +269,8 @@ const AddModal = props => { ...@@ -266,8 +269,8 @@ const AddModal = props => {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`; data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
} }
} }
if (obj.filterName && obj.filterValue) { if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}='${obj.filterValue}'`; data[0].Config = `${data[0].Config}?${obj.filterName}`;
} }
break; break;
// case '人员选择器': // case '人员选择器':
...@@ -521,10 +524,10 @@ const AddModal = props => { ...@@ -521,10 +524,10 @@ const AddModal = props => {
}); });
let book1 = res[0].data.root.Config.split('?'); let book1 = res[0].data.root.Config.split('?');
if (book1[1]) { if (book1[1]) {
let aa = book1[1].split('='); // let aa = book1[1].split('=');
form.setFieldsValue({ form.setFieldsValue({
filterName: aa[0], filterName: book1[1],
filterValue: aa[1].substring(1, aa[1].length - 1), // filterValue: aa[1].substring(1, aa[1].length - 1),
}); });
} }
if (book1[0].endsWith('.n')) { if (book1[0].endsWith('.n')) {
...@@ -1163,10 +1166,10 @@ const AddModal = props => { ...@@ -1163,10 +1166,10 @@ const AddModal = props => {
}); });
let book1 = aa.Config.split('?'); let book1 = aa.Config.split('?');
if (book1[1]) { if (book1[1]) {
let cc = book1[1].split('='); // let cc = book1[1].split('=');
form.setFieldsValue({ form.setFieldsValue({
filterName: cc[0], filterName: book1[1],
filterValue: cc[1].substring(1, cc[1].length - 1), // filterValue: cc[1].substring(1, cc[1].length - 1),
}); });
} }
if (book1[0].endsWith('.n')) { if (book1[0].endsWith('.n')) {
...@@ -1435,10 +1438,10 @@ const AddModal = props => { ...@@ -1435,10 +1438,10 @@ const AddModal = props => {
}); });
let book1 = res[0].data.root.Config.split('?'); let book1 = res[0].data.root.Config.split('?');
if (book1[1]) { if (book1[1]) {
let aa = book1[1].split('='); // let aa = book1[1].split('=');
form.setFieldsValue({ form.setFieldsValue({
filterName: aa[0], filterName: book1[1],
filterValue: aa[1].substring(1, aa[1].length - 1), // filterValue: aa[1].substring(1, aa[1].length - 1),
}); });
} }
if (book1[0].endsWith('.n')) { if (book1[0].endsWith('.n')) {
...@@ -1676,8 +1679,8 @@ const AddModal = props => { ...@@ -1676,8 +1679,8 @@ const AddModal = props => {
data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`; data[0].Config = radio == 0 ? `${obj.standingBook}` : `${obj.standingBook}.n`;
} }
} }
if (obj.filterName && obj.filterValue) { if (obj.filterName) {
data[0].Config = `${data[0].Config}?${obj.filterName}='${obj.filterValue}'`; data[0].Config = `${data[0].Config}?${obj.filterName}`;
} }
break; break;
// case '人员选择器': // case '人员选择器':
...@@ -2080,13 +2083,13 @@ const AddModal = props => { ...@@ -2080,13 +2083,13 @@ const AddModal = props => {
<Radio value={1} style={{ marginRight: '0.5rem' }}> <Radio value={1} style={{ marginRight: '0.5rem' }}>
工单 → 事件 工单 → 事件
</Radio> </Radio>
<Radio value={2}>事件(上报时) → 工单</Radio> {/* <Radio value={2}>事件(上报时) → 工单</Radio> */}
</Radio.Group> </Radio.Group>
</Item> </Item>
<Row> <Row>
{/* <Col span={1} /> */} {/* <Col span={1} /> */}
<Col span={12}> <Col span={15}>
<Item label="形态" labelCol={{ span: 6 }}> <Item label="形态" labelCol={{ span: 5 }}>
<div className={styles.listEvent}> <div className={styles.listEvent}>
<TreeSelect <TreeSelect
style={{ width: '95%' }} style={{ width: '95%' }}
...@@ -2129,13 +2132,13 @@ const AddModal = props => { ...@@ -2129,13 +2132,13 @@ const AddModal = props => {
</div> </div>
</Item> </Item>
</Col> </Col>
<Col span={1} />
<Col span={5}> <Col span={5}>
<Item label="单位" name="Unit" labelCol={{ span: 7 }}> <Item label="单位" name="Unit" labelCol={{ span: 7 }}>
<Input style={{ width: '95%' }} placeholder="" /> <Input style={{ width: '95%' }} placeholder="" />
</Item> </Item>
</Col> </Col>
<Col span={5}> <Col span={3}>
<Item label="宽" name="RowSpan" labelCol={{ span: 7 }}> <Item label="宽" name="RowSpan" labelCol={{ span: 7 }}>
<Input style={{ width: '87%' }} placeholder="" /> <Input style={{ width: '87%' }} placeholder="" />
</Item> </Item>
...@@ -2370,29 +2373,21 @@ const AddModal = props => { ...@@ -2370,29 +2373,21 @@ const AddModal = props => {
<Item <Item
name="Config" name="Config"
labelCol={{ span: 3 }} labelCol={{ span: 3 }}
label={ // label={
<div> // <div>
<Tooltip title="默认全局多选"> // <Tooltip title="默认全局多选">
<InfoCircleOutlined // <InfoCircleOutlined
style={{ // style={{
color: 'rgb(24 144 255)', // color: 'rgb(24 144 255)',
marginRight: '2px', // marginRight: '2px',
}} // }}
/> // />
</Tooltip> // </Tooltip>
<span>配置</span> // <span>配置</span>
</div> // </div>
} // }
label="配置"
> >
{/* <Select
placeholder="默认为全局.n即全局多选,.n为多选(全局时勾选由问题)"
style={{ width: '93%' }}
>
<Select.Option value="全局.n">全局(多选)</Select.Option>
<Select.Option value="全局">全局</Select.Option>
<Select.Option value="本人.n">本人(多选)</Select.Option>
<Select.Option value="本人">本人</Select.Option>
</Select> */}
<div style={{ display: 'inline-block' }}> <div style={{ display: 'inline-block' }}>
<Item name="pepole" style={{ marginBottom: '0' }}> <Item name="pepole" style={{ marginBottom: '0' }}>
<Checkbox <Checkbox
...@@ -2428,7 +2423,15 @@ const AddModal = props => { ...@@ -2428,7 +2423,15 @@ const AddModal = props => {
labelCol={{ span: 6 }} labelCol={{ span: 6 }}
rules={[{ required: true, message: '请输入台账名' }]} rules={[{ required: true, message: '请输入台账名' }]}
> >
<Input style={{ width: '95%' }} placeholder="请输入台账名" /> <Select showSearch style={{ width: '95%' }}>
{keepStandingBook
? keepStandingBook.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</Select>
</Item> </Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
...@@ -2441,12 +2444,17 @@ const AddModal = props => { ...@@ -2441,12 +2444,17 @@ const AddModal = props => {
<Input style={{ width: '85%' }} placeholder="请输入字段名" /> <Input style={{ width: '85%' }} placeholder="请输入字段名" />
</Item> </Item>
</Col> </Col>
<Col span={12}> </Row>
<Item label="台账过滤" name="filterName" labelCol={{ span: 6 }}> {/* <Col span={12}> */}
<Input style={{ width: '95%' }} placeholder="请输入字段名" /> <Item label="台账过滤" name="filterName" labelCol={{ span: 3 }}>
</Item> <TextArea
</Col> style={{ width: '93%' }}
<Col span={2}> placeholder="示例:部门='研发一部'"
/>
</Item>
{/* </Col> */}
{/* <Col span={2}>
<span style={{ marginLeft: '20px' }}>=</span> <span style={{ marginLeft: '20px' }}>=</span>
</Col> </Col>
<Col span={9}> <Col span={9}>
...@@ -2456,8 +2464,8 @@ const AddModal = props => { ...@@ -2456,8 +2464,8 @@ const AddModal = props => {
placeholder="请输入过滤条件" placeholder="请输入过滤条件"
/> />
</Item> </Item>
</Col> </Col> */}
</Row>
<Item colon={false} name="check" label="配置:" labelCol={{ span: 3 }}> <Item colon={false} name="check" label="配置:" labelCol={{ span: 3 }}>
<Radio.Group onChange={onChange2} value={radio} defaultValue={chee}> <Radio.Group onChange={onChange2} value={radio} defaultValue={chee}>
<Radio value={0}>单选</Radio> <Radio value={0}>单选</Radio>
...@@ -2587,7 +2595,7 @@ const AddModal = props => { ...@@ -2587,7 +2595,7 @@ const AddModal = props => {
<Tooltip <Tooltip
title={ title={
<> <>
<span>默认非全部,展示形式为下拉框</span> <span>默认展示形式为下拉框</span>
<Image width={200} src={partImage} /> <Image width={200} src={partImage} />
</> </>
} }
...@@ -2606,7 +2614,7 @@ const AddModal = props => { ...@@ -2606,7 +2614,7 @@ const AddModal = props => {
<Tooltip <Tooltip
title={ title={
<> <>
<span>全部,展示形式为弹窗</span> <span>展示形式为弹窗显示人员所属机构</span>
<Image width={200} src={AllImage} /> <Image width={200} src={AllImage} />
</> </>
} }
...@@ -2630,25 +2638,25 @@ const AddModal = props => { ...@@ -2630,25 +2638,25 @@ const AddModal = props => {
</Item> </Item>
</div> </div>
<div style={{ display: 'inline-block', marginRight: '10px' }}> <div style={{ display: 'inline-block', marginRight: '10px' }}>
<Item name="AllID1" style={{ marginBottom: '0' }}> <Item name="choose" style={{ marginBottom: '0' }}>
<Checkbox <Checkbox
checked={checkboxAllID1} checked={cho}
onChange={changeAllID1} onChange={changeChoose}
style={{ marginBottom: '0' }} style={{ marginBottom: '0' }}
disabled={hide}
> >
存储ID 单选
</Checkbox> </Checkbox>
</Item> </Item>
</div> </div>
<div style={{ display: 'inline-block', marginRight: '10px' }}> <div style={{ display: 'inline-block', marginRight: '10px' }}>
<Item name="choose" style={{ marginBottom: '0' }}> <Item name="AllID1" style={{ marginBottom: '0' }}>
<Checkbox <Checkbox
checked={cho} checked={checkboxAllID1}
onChange={changeChoose} onChange={changeAllID1}
style={{ marginBottom: '0' }} style={{ marginBottom: '0' }}
disabled={hide}
> >
单选 ID存储
</Checkbox> </Checkbox>
</Item> </Item>
</div> </div>
......
...@@ -27,6 +27,7 @@ import { ...@@ -27,6 +27,7 @@ import {
reloadTableFields, reloadTableFields,
removeFields, removeFields,
loadUnattachedTables, loadUnattachedTables,
LoadLedgers,
} from '@/services/tablemanager/tablemanager'; } from '@/services/tablemanager/tablemanager';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import FieldEditor from './fieldEditor'; import FieldEditor from './fieldEditor';
...@@ -61,6 +62,7 @@ const AddModal = props => { ...@@ -61,6 +62,7 @@ const AddModal = props => {
const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除 const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除
const [checkStrictly, setCheckStrictly] = useState(false); const [checkStrictly, setCheckStrictly] = useState(false);
const [selectGroup, setSelectGroup] = useState([]); const [selectGroup, setSelectGroup] = useState([]);
const [keepStandingBook, setKeepStandingBook] = useState([]);
const editor = record => { const editor = record => {
console.log(record); console.log(record);
...@@ -300,6 +302,17 @@ const AddModal = props => { ...@@ -300,6 +302,17 @@ const AddModal = props => {
}, },
}, },
]; ];
useEffect(() => {
LoadLedgers().then(res => {
if (res.code === 0) {
let data = [];
res.data.root.map(i => {
data.push(i.name);
});
setKeepStandingBook(data);
}
});
}, []);
useEffect(() => { useEffect(() => {
console.log(props); console.log(props);
...@@ -724,6 +737,7 @@ const AddModal = props => { ...@@ -724,6 +737,7 @@ const AddModal = props => {
treeData={treeData} treeData={treeData}
keepTreeFirst={keepTreeFirst} keepTreeFirst={keepTreeFirst}
callBackSubmit={Submit} callBackSubmit={Submit}
keepStandingBook={keepStandingBook}
/> />
{visible && type === 'affiliateAdd' && ( {visible && type === 'affiliateAdd' && (
<AffiliateAdd <AffiliateAdd
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-04-06 11:38:46 * @Date: 2022-04-06 11:38:46
* @LastEditTime: 2022-05-23 10:49:46 * @LastEditTime: 2022-06-22 13:53:09
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -119,8 +119,8 @@ const DrawBoardManage = () => { ...@@ -119,8 +119,8 @@ const DrawBoardManage = () => {
const updateTrees = e => { const updateTrees = e => {
setTreeLoading(true); setTreeLoading(true);
typeList().then(res => { typeList().then(res => {
setTreeLoading(false);
if (res.code === 0) { if (res.code === 0) {
setTreeLoading(false);
if (e) { if (e) {
let aa = res.data.find(i => i.name === e); let aa = res.data.find(i => i.name === e);
setPickItem(aa); setPickItem(aa);
......
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