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

fix: '表字段形态'

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