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