Commit 6d6071a0 authored by 邓超's avatar 邓超
parents 6a3a8f8f db608237
Pipeline #38729 skipped with stages
# PUBLIC_PATH = reactOMS, 默认转发 /cityinterface # PUBLIC_PATH = reactOMS, 默认转发 /cityinterface
PROXY=/Cityinterface:http://192.168.19.105:8049;/PandaOMS:http://192.168.12.116:8015;/Web4:http://192.168.19.105:8049;/CityTemp:http://192.168.19.105:8049 PROXY=/Cityinterface:http://192.168.19.105:8049;/PandaOMS:http://192.168.19.105:8049;/Web4:http://192.168.19.105:8049;/CityTemp:http://192.168.19.105:8049
# PROXY=/Cityinterface:http://192.168.12.121:8082;/PandaOMS:http://192.168.12.121:8082;/Web4:http://192.168.12.121:8082;/CityTemp:http://192.168.12.121:8082 # PROXY=/Cityinterface:http://192.168.12.121:8082;/PandaOMS:http://192.168.12.121:8082;/Web4:http://192.168.12.121:8082;/CityTemp:http://192.168.12.121:8082
# 可设置第二个代理,test为转发前缀,后面为代理转发的地址 # 可设置第二个代理,test为转发前缀,后面为代理转发的地址
# PROXY2 = test : http://localhost:8006/ # PROXY2 = test : http://localhost:8006/
......
...@@ -53,7 +53,7 @@ const WebDic = () => { ...@@ -53,7 +53,7 @@ const WebDic = () => {
const history = useHistory(); const history = useHistory();
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式 const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [orderTable, setOrderTable] = useState([]); const [orderTable, setOrderTable] = useState([]);
const [flowIDs, setFlowIDs] = useState(''); const [orderTable1, setOrderTable1] = useState([]);
const [fgg, setFgg] = useState(0); const [fgg, setFgg] = useState(0);
const [InPutVisible, setInPutVisible] = useState(false); const [InPutVisible, setInPutVisible] = useState(false);
...@@ -318,35 +318,61 @@ const WebDic = () => { ...@@ -318,35 +318,61 @@ const WebDic = () => {
getData(null);//首次加载可以为空 getData(null);//首次加载可以为空
}, [flag]); }, [flag]);
const setOd = e =>{ const setOd = e => {
setOrderTable(e) setOrderTable(e)
setFgg(fgg+1) setFgg(fgg + 1)
}
const setOd1 = e => {
setOrderTable1(e)
setFgg(fgg + 1)
} }
useEffect(() => { useEffect(() => {
setOrderTable(() => { setOrderTable(data);
let table; setOrderTable1(subData);
console.log(data) }, [fgg]);
table = data.filter(item => item.nodeID !== -1); // 根据orderTable值改变flowIDs
console.log(table) useEffect(() => {
return table;
});
}, [fgg]);
// 根据orderTable值改变flowIDs
useEffect(() => {
let ids = ''; let ids = '';
console.log(orderTable)
orderTable.forEach((item, index) => { orderTable.forEach((item, index) => {
if (index === orderTable.length - 1) { if (index === orderTable.length - 1) {
ids += `${item.nodeID}`; ids += `${item.nodeID}`;
} else { } else {
ids += `${item.nodeID},`; ids += `${item.nodeID},`;
} }
}); });
console.log(ids) console.log(ids)
setFlowIDs(ids); let bb = ids.split(",")
}, [orderTable]); console.log(bb)
setLoading(true)
DataDictionaryChangeOrder(bb).then(res => {
setLoading(false)
})
}, [orderTable]);
useEffect(() => {
let ids = '';
console.log(orderTable1)
if(orderTable1 != ''){
orderTable1.forEach((item, index) => {
if (index === orderTable1.length - 1) {
ids += `${item.nodeID}`;
} else {
ids += `${item.nodeID},`;
}
});
}
console.log(ids)
let bb = ids.split(",")
console.log(bb)
setIsloading(true)
DataDictionaryChangeOrder(bb).then(res => {
setIsloading(false)
})
}, [orderTable1]);
// 根据父节点nodeID(即parentID)获取子节点数据,一级条目parentID = -1 // 根据父节点nodeID(即parentID)获取子节点数据,一级条目parentID = -1
const getData = value => { const getData = value => {
console.log(value); console.log(value);
...@@ -366,7 +392,7 @@ const WebDic = () => { ...@@ -366,7 +392,7 @@ const WebDic = () => {
if (value === null || value === '-1') { if (value === null || value === '-1') {
setData(res); setData(res);
setOd(res) setOd(res)
console.log(res) console.log(res)
console.log(first) console.log(first)
if (first) { if (first) {
...@@ -379,6 +405,7 @@ const WebDic = () => { ...@@ -379,6 +405,7 @@ const WebDic = () => {
} else if (value) { } else if (value) {
console.log(res); console.log(res);
setSubData(res);//设置二级条目,res为空[]时也要设置 setSubData(res);//设置二级条目,res为空[]时也要设置
setOd1(res)
} }
isLoadingShow(value, false) isLoadingShow(value, false)
// } else { // } else {
...@@ -732,15 +759,18 @@ const WebDic = () => { ...@@ -732,15 +759,18 @@ const WebDic = () => {
} }
// 拖拽回调函数 // 拖拽回调函数
const dragCallBack = data => { const dragCallBack = value => {
console.log(data) console.log(value)
if (data) { console.log(orderTable)
setData(data); if (value) {
setOrderTable(value)
} }
}; };
const dragCallBack1 = data => { const dragCallBack1 = e => {
if (data) { console.log(e)
setSubData(data); console.log(orderTable1)
if (e) {
setOrderTable1(e);
} }
}; };
...@@ -780,7 +810,6 @@ const WebDic = () => { ...@@ -780,7 +810,6 @@ const WebDic = () => {
rowKey={record => record.nodeID} rowKey={record => record.nodeID}
columns={columns} columns={columns}
dataSource={orderTable} dataSource={orderTable}
// orderTable={orderTable}
scroll={{ y: 'calc(100vh - 370px)' }} scroll={{ y: 'calc(100vh - 370px)' }}
bordered bordered
dragCallBack={dragCallBack} dragCallBack={dragCallBack}
...@@ -802,15 +831,13 @@ const WebDic = () => { ...@@ -802,15 +831,13 @@ const WebDic = () => {
</div> </div>
}} }}
rowClassName={setRowClassName} rowClassName={setRowClassName}
onRow={(record, index) => ({ onClick={record => {
index, getData(record.nodeID);
onClick: () => { setSelect(record);
getData(record.nodeID); setSelectColor(record);
setSelect(record); setSelectID(record.nodeID);
setSelectColor(record); }}
setSelectID(record.nodeID); ItemTypes='first'
},
})}
pagination={pagenation} pagination={pagenation}
/> />
</Col> </Col>
...@@ -819,21 +846,19 @@ const WebDic = () => { ...@@ -819,21 +846,19 @@ const WebDic = () => {
<Spin spinning={isloading} tip="loading..."> <Spin spinning={isloading} tip="loading...">
<DragTable <DragTable
size="small" size="small"
ItemTypes='second'
bordered bordered
rowKey={record => record.nodeID} rowKey={record => record.nodeID}
columns={columns1} columns={columns1}
dragCallBack={dragCallBack1} dragCallBack={dragCallBack1}
className={styles.tab} className={styles.tab}
dataSource={subData} dataSource={orderTable1}
scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }} scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }}
rowClassName={setRowClassName1} rowClassName={setRowClassName1}
onRow={record => ({ onClick={record => {
onClick: () => { setSelect(record);
setSelect(record); setTwoSelectColor(record);
setTwoSelectColor(record); }}
// setSelectID(record.nodeID);
},
})}
title={() => { title={() => {
return <div> return <div>
<span>二级条目</span> <span>二级条目</span>
......
...@@ -62,9 +62,11 @@ const TemplateManage = () => { ...@@ -62,9 +62,11 @@ const TemplateManage = () => {
type: item.Type, type: item.Type,
third_name: item.Name, third_name: item.Name,
third_id: item.No, third_id: item.No,
template_params: item.TDescription, template_params2: item.ParsingParams,//模板参数2.0
analysis_params: item.ParsingRules, template_params1: item.TParameters,//模板参数1.0
desc: item.ParsingDescription analysis_params: item.ParsingRules,//模板解析
desc: item.ParsingDescription,//模板参数说明
weixin: item.WorkWeiXinId//企业微信ID
}) })
}) })
setData(list) setData(list)
...@@ -121,6 +123,12 @@ const TemplateManage = () => { ...@@ -121,6 +123,12 @@ const TemplateManage = () => {
key: 'third_name', key: 'third_name',
align: 'center', align: 'center',
}, },
{
title: '企业微信ID',
dataIndex: 'weixin',
key: 'weixin',
align: 'center',
},
{ {
title: '第三方模版编号', title: '第三方模版编号',
dataIndex: 'third_id', dataIndex: 'third_id',
...@@ -128,9 +136,15 @@ const TemplateManage = () => { ...@@ -128,9 +136,15 @@ const TemplateManage = () => {
align: 'center', align: 'center',
}, },
{ {
title: '模板参数', title: '模板参数1.0',
dataIndex: 'template_params', dataIndex: 'template_params1',
key: 'template_params', key: 'template_params1',
align: 'center',
},
{
title: '模板参数2.0',
dataIndex: 'template_params2',
key: 'template_params2',
align: 'center', align: 'center',
}, },
{ {
...@@ -140,7 +154,7 @@ const TemplateManage = () => { ...@@ -140,7 +154,7 @@ const TemplateManage = () => {
align: 'center', align: 'center',
}, },
{ {
title: '解析参数', title: '解析规则',
dataIndex: 'analysis_params', dataIndex: 'analysis_params',
key: 'analysis_params', key: 'analysis_params',
align: 'center', align: 'center',
...@@ -251,51 +265,101 @@ const TemplateManage = () => { ...@@ -251,51 +265,101 @@ const TemplateManage = () => {
handleShowModal("editVisible", false) handleShowModal("editVisible", false)
} }
const onSubmit = (result) => { const onSubmit = (result) => {
UpdateMessageTemplate({ if(result.type == '企业微信'){
Id: result.Id, UpdateMessageTemplate({
Type: result.type, Id: result.Id,
LikeName: result.name, Type: result.type,
Name: result.third_name, LikeName: result.name,
No: result.third_id, Name: result.third_name,
ParsingRules: result.analysis_params, ParsingRules: result.analysis_params,
ParsingDescription: result.desc, ParsingDescription: result.desc,
TDescription: result.params TParameters: result.params,
}).then( ParsingParams: result.param1,
res => { WorkWeiXinId: result.weixin
if (res.code === 0) { }).then(
message.success("模板保存成功!") res => {
handleShowModal("editVisible", false) if (res.code === 0) {
setFlag(flag + 1) message.success("模板保存成功!")
} else { handleShowModal("editVisible", false)
message.warn("模板保存失败!") setFlag(flag + 1)
} else {
message.warn("模板保存失败!")
}
} }
} )
) }else{
UpdateMessageTemplate({
Id: result.Id,
Type: result.type,
LikeName: result.name,
Name: result.third_name,
No: result.third_id,
ParsingRules: result.analysis_params,
ParsingDescription: result.desc,
TParameters: result.params,
ParsingParams: result.param1,
}).then(
res => {
if (res.code === 0) {
message.success("模板保存成功!")
handleShowModal("editVisible", false)
setFlag(flag + 1)
} else {
message.warn("模板保存失败!")
}
}
)
}
} }
//新增 //新增
const addModal = () => { const addModal = () => {
handleShowModal("editVisible", false) handleShowModal("editVisible", false)
} }
const onAddSubmit = (result) => { const onAddSubmit = (result) => {
InsertMessageTemplate({ if(result.type == '企业微信'){
Type: result.type, InsertMessageTemplate({
LikeName: result.name, Type: result.type,
Name: result.third_name, LikeName: result.name,
No: result.third_id, Name: result.third_name,
ParsingRules: result.analysis_params, ParsingRules: result.analysis_params,
ParsingDescription: result.desc, ParsingDescription: result.desc,
TDescription: result.params TParameters: result.params,
}).then( ParsingParams: result.param1,
res => { WorkWeiXinId: result.weixin
if (res.code === 0) { }).then(
message.success("模板添加成功!") res => {
handleShowModal("addVisible", false) if (res.code === 0) {
setFlag(flag + 1) message.success("模板添加成功!")
} else { handleShowModal("addVisible", false)
message.warn("模板添加失败!") setFlag(flag + 1)
} else {
message.warn("模板添加失败!")
}
} }
} )
) }else{
InsertMessageTemplate({
Type: result.type,
LikeName: result.name,
Name: result.third_name,
No: result.third_id,
ParsingRules: result.analysis_params,
ParsingDescription: result.desc,
TParameters: result.params,
ParsingParams: result.param1,
}).then(
res => {
if (res.code === 0) {
message.success("模板添加成功!")
handleShowModal("addVisible", false)
setFlag(flag + 1)
} else {
message.warn("模板添加失败!")
}
}
)
}
} }
const pagenation = { const pagenation = {
......
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