Commit 8a5d3601 authored by 涂伟's avatar 涂伟

fix: '1.表结构升级功能添加2.已附加/未附加显示bug修复3.模板配置交互样式优化'

parent 92f71fbd
This diff was suppressed by a .gitattributes entry.
...@@ -36,6 +36,7 @@ import { ...@@ -36,6 +36,7 @@ import {
FunnelPlotOutlined, FunnelPlotOutlined,
BranchesOutlined, BranchesOutlined,
ToolOutlined, ToolOutlined,
QuestionCircleTwoTone,
} from '@ant-design/icons'; } from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
...@@ -46,6 +47,8 @@ import { ...@@ -46,6 +47,8 @@ import {
checkTableType, checkTableType,
regroupTableType, regroupTableType,
GetDefaultTableFields, GetDefaultTableFields,
CheckUpgradeTable,
UpgradeTable,
} from '@/services/tablemanager/tablemanager'; } from '@/services/tablemanager/tablemanager';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { Ellipse } from 'bizcharts/lib/g-components'; import { Ellipse } from 'bizcharts/lib/g-components';
...@@ -64,6 +67,7 @@ import styles from './index.less'; ...@@ -64,6 +67,7 @@ import styles from './index.less';
import formDesign from '@/assets/font/omsfont/formDesign.svg'; import formDesign from '@/assets/font/omsfont/formDesign.svg';
import tableDesign from '@/assets/font/omsfont/tableDesign.svg'; import tableDesign from '@/assets/font/omsfont/tableDesign.svg';
import deleteSvg from '@/assets/font/omsfont/delete.svg'; import deleteSvg from '@/assets/font/omsfont/delete.svg';
import update from '@/assets/font/omsfont/update.png';
const { Search } = Input; const { Search } = Input;
const { Option } = Select; const { Option } = Select;
const placeholder = '请输入表名'; const placeholder = '请输入表名';
...@@ -255,7 +259,11 @@ const TableManager = props => { ...@@ -255,7 +259,11 @@ const TableManager = props => {
setSelectTableName(''); setSelectTableName('');
setPickIndex(0); setPickIndex(0);
setSelect(groupArr[0].type); setSelect(groupArr[0].type);
if (!text) {
setShowSearchStyle(false);
} else {
setShowSearchStyle(true); setShowSearchStyle(true);
}
}; };
const getField = () => { const getField = () => {
loadUnattachedTables().then(res => { loadUnattachedTables().then(res => {
...@@ -281,7 +289,7 @@ const TableManager = props => { ...@@ -281,7 +289,7 @@ const TableManager = props => {
item.tableStyle === '大' item.tableStyle === '大'
? `一行三列/${item.labelStyle ? `${item.labelStyle}布局` : '左右布局'}` ? `一行三列/${item.labelStyle ? `${item.labelStyle}布局` : '左右布局'}`
: item.tableStyle; : item.tableStyle;
let fieldCount = Number(item.fieldCount); let fieldCount = Number(item.fieldCount === '(无)' ? 0 : item.fieldCount);
let extraFieldCount = Number( let extraFieldCount = Number(
item.extraFieldCount === '(无)' ? 0 : item.extraFieldCount, item.extraFieldCount === '(无)' ? 0 : item.extraFieldCount,
); );
...@@ -413,6 +421,47 @@ const TableManager = props => { ...@@ -413,6 +421,47 @@ const TableManager = props => {
setFieldConfigShow(true); setFieldConfigShow(true);
}; };
const updateForm = (record, e) => {
e.stopPropagation();
let params = {
tableName: record.tableName,
toTableType:
record.groupName === '事件表' || record.groupName === '工单表'
? '事件工单表'
: record.groupName,
};
CheckUpgradeTable(params).then(res => {
if (res.code === 0) {
return Modal.confirm({
icon: <QuestionCircleTwoTone />,
content: '确定要升级表结构吗?',
okText: '确认',
cancelText: '取消',
onOk: () => {
console.log('确认了666666');
UpgradeTable(params).then(ress => {
if (ress.code === 0) {
message.success('升级成功!');
loadTable(showSearchStyle ? searchValue : '');
} else {
notification.error({
message: '提示',
duration: 3,
description: ress.msg,
});
}
});
},
});
}
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
});
};
const columns = [ const columns = [
{ {
title: '名称', title: '名称',
...@@ -420,7 +469,22 @@ const TableManager = props => { ...@@ -420,7 +469,22 @@ const TableManager = props => {
key: 'tableName', key: 'tableName',
width: 400, width: 400,
render: (text, record) => ( render: (text, record) => (
<div onClick={e => fieldsConfig(record, e)}>{searchStyle(text)}</div> <div
onClick={e => fieldsConfig(record, e)}
style={{ display: 'flex', alignItems: 'center' }}
>
{searchStyle(text)}
{record.IsCanUpgrade ? (
<img
className={styles.btnImg}
alt=""
title="升级表结构"
style={{ marginLeft: '6px' }}
src={update}
onClick={e => updateForm(record, e)}
/>
) : null}
</div>
), ),
}, },
{ {
......
...@@ -572,7 +572,7 @@ const AddModal = props => { ...@@ -572,7 +572,7 @@ const AddModal = props => {
// 改变关联事件类型 // 改变关联事件类型
const onChangeEvent = (e, i) => { const onChangeEvent = (e, i) => {
console.log(e, i, '666'); console.log(e, i, '666');
if (!i) { if (!i || !e) {
setKeepData(keep); setKeepData(keep);
formAdd.resetFields(); formAdd.resetFields();
} }
...@@ -680,7 +680,7 @@ const AddModal = props => { ...@@ -680,7 +680,7 @@ const AddModal = props => {
return ( return (
<Drawer <Drawer
title="巡维保计划配置" title="模板配置"
visible={visible} visible={visible}
destroyOnClose destroyOnClose
width="600px" width="600px"
...@@ -922,29 +922,29 @@ const AddModal = props => { ...@@ -922,29 +922,29 @@ const AddModal = props => {
<Input placeholder="请输入在线任务量" /> <Input placeholder="请输入在线任务量" />
</Item> </Item>
</Col> </Col>
<Col span={24}> <Col span={12}>
<Item label="是否送审" name="isSubmit" labelCol={{ span: 5 }}> <Item label="自动派发" name="autoAssign" labelCol={{ span: 10 }}>
<Switch <Switch
checkedChildren="是" checkedChildren="是"
unCheckedChildren="否" unCheckedChildren="否"
checked={visibleChecked} checked={visibleChecked1}
onChange={change} onChange={change1}
disabled={autoFlag}
/> />
{/* <Radio.Group defaultValue={chee}>
<Radio value="否">否</Radio>
<Radio value="是">是</Radio>
</Radio.Group> */}
</Item> </Item>
</Col> </Col>
<Col span={24}> <Col span={12}>
<Item label="自动派发" name="autoAssign" labelCol={{ span: 5 }}> <Item label="是否送审" name="isSubmit" labelCol={{ span: 10 }}>
<Switch <Switch
checkedChildren="是" checkedChildren="是"
unCheckedChildren="否" unCheckedChildren="否"
checked={visibleChecked1} checked={visibleChecked}
onChange={change1} onChange={change}
disabled={autoFlag}
/> />
{/* <Radio.Group defaultValue={chee}>
<Radio value="否">否</Radio>
<Radio value="是">是</Radio>
</Radio.Group> */}
</Item> </Item>
</Col> </Col>
<Col span={24}> <Col span={24}>
...@@ -970,12 +970,17 @@ const AddModal = props => { ...@@ -970,12 +970,17 @@ const AddModal = props => {
}, },
]} ]}
> >
<TextArea placeholder="例如:and 泵房品牌='熊猫'(SQL表达式)" /> <Input placeholder="例如:and 泵房品牌='熊猫'(SQL表达式)" />
</Item> </Item>
</Col> </Col>
<Col span={24}> <Col span={24}>
<Item label="关联事件" name="relationEvent" labelCol={{ span: 5 }}> <Item label="关联事件" name="relationEvent" labelCol={{ span: 5 }}>
<Select placeholder="选择关联事件类型" showSearch onChange={e => onChangeEvent(e)}> <Select
placeholder="选择关联事件类型"
showSearch
onChange={e => onChangeEvent(e)}
allowClear
>
{eventData {eventData
? eventData.map((item, index) => ( ? eventData.map((item, index) => (
<Option key={index} value={item}> <Option key={index} value={item}>
...@@ -987,12 +992,12 @@ const AddModal = props => { ...@@ -987,12 +992,12 @@ const AddModal = props => {
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
<span style={{ fontSize: '12px', color: '#bfbcbc', marginLeft: '80px' }}> <span style={{ fontSize: '12px', color: '#bfbcbc', marginLeft: '114px' }}>
当配置了关联事件后,可配置字段映射规则 当配置了关联事件后,可配置字段映射规则
</span> </span>
<br /> <br />
<span style={{ fontSize: '12px', color: '#bfbcbc', marginLeft: '80px' }}> <span style={{ fontSize: '12px', color: '#bfbcbc', marginLeft: '114px' }}>
配置后,巡维保发起的工单,可以传递该巡维保任务信息 配置后,设备维保发起的工单,可以传递该维保任务信息
</span> </span>
</Col> </Col>
<Col span={4} /> <Col span={4} />
......
...@@ -607,7 +607,7 @@ const AddModal = props => { ...@@ -607,7 +607,7 @@ const AddModal = props => {
// 改变关联事件类型 // 改变关联事件类型
const onChangeEvent = (e, i) => { const onChangeEvent = (e, i) => {
if (!i) { if (!i || !e) {
setKeepData(keep); setKeepData(keep);
formAdd.resetFields(); formAdd.resetFields();
} }
...@@ -832,7 +832,12 @@ const AddModal = props => { ...@@ -832,7 +832,12 @@ const AddModal = props => {
</Col> </Col>
<Col span={23}> <Col span={23}>
<Item label="关联事件" name="relationEvent" labelCol={{ span: 4 }}> <Item label="关联事件" name="relationEvent" labelCol={{ span: 4 }}>
<Select placeholder="选择关联事件类型" onChange={e => onChangeEvent(e)} showSearch> <Select
placeholder="选择关联事件类型"
onChange={e => onChangeEvent(e)}
showSearch
allowClear
>
{eventData {eventData
? eventData.map((item, index) => ( ? eventData.map((item, index) => (
<Option key={index} value={item}> <Option key={index} value={item}>
...@@ -849,7 +854,7 @@ const AddModal = props => { ...@@ -849,7 +854,7 @@ const AddModal = props => {
</span> </span>
<br /> <br />
<span style={{ fontSize: '12px', color: '#bfbcbc', marginLeft: '80px' }}> <span style={{ fontSize: '12px', color: '#bfbcbc', marginLeft: '80px' }}>
配置后,巡检发起的工单,可以传递该巡检任务信息 配置后,管网巡检发起的工单,可以传递该巡检任务信息
</span> </span>
</Col> </Col>
<Col span={4} /> <Col span={4} />
......
...@@ -85,3 +85,10 @@ export const GetDefaultTableFields = query => ...@@ -85,3 +85,10 @@ export const GetDefaultTableFields = query =>
export const GetTableGroupMeta = param => export const GetTableGroupMeta = param =>
get(`${PUBLISH_SERVICE}/AccountManage/GetTableGroupMeta`, param); get(`${PUBLISH_SERVICE}/AccountManage/GetTableGroupMeta`, param);
// 升级表前类型检查
export const CheckUpgradeTable = param =>
get(`${PUBLISH_SERVICE}/CaseManage/CheckUpgradeTable`, param);
// 升级表类型
export const UpgradeTable = param => get(`${PUBLISH_SERVICE}/CaseManage/UpgradeTable`, param);
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