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 = {
......
......@@ -49,14 +49,22 @@ const AddModal = props => {
};
const onChangeType = (value) => {
setTemplateName(option.filter(item => item.Type === value))
console.log(option.filter(item => item.Type === value))
}
const onChangeType1 = (value) => {
form.setFieldsValue({
third_id: value
})
}
return (
<SiteModal
{...props}
title="模板添加"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
width="820px"
destroyOnClose
cancelText="取消"
okText="确认"
......@@ -82,7 +90,7 @@ const AddModal = props => {
},
]}
>
<Input style={{ width: '12rem' }} placeholder="请输入模板名称" />
<Input style={{ width: '12rem' }} placeholder="请输入模板名称" />
</Item>
<Item
label="模板类型"
......@@ -97,96 +105,136 @@ const AddModal = props => {
<Select style={{ width: '10rem' }} onChange={(value) => onChangeType(value)} >
<Select.Option value="公众号">公众号</Select.Option>
<Select.Option value="短信">短信</Select.Option>
<Select.Option value="企业微信">企业微信</Select.Option>
</Select>
</Item>
</div>
</Item>
<Item
label="请输入第三方模板名称"
wrapperCol={{ span: 17 }}
labelCol={{ span: 6 }}
style={{ marginBottom: '0' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
{form.getFieldsValue().type !== '企业微信' ?
<>
<Item
label=""
name="third_name"
rules={[
{
required: true,
message: '请输入第三方模板名称',
},
]}
label="请选择第三方模板名称"
wrapperCol={{ span: 17 }}
labelCol={{ span: 6 }}
style={{ marginBottom: '0' }}
>
{/* <Input placeholder="请输入模板名称" /> */}
<Select
placeholder="请选择模板名称"
style={{ width: '12rem' }}
onChange={(value, option) => onChange(value, option)}
>
{templateName &&
templateName.length > 0 &&
templateName.map((item, index) => (
<Select.Option value={item.Name} key={index} code={item.Code}>
{item.Name}
</Select.Option>
))}
</Select>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Item
label=""
name="third_name"
rules={[
{
required: true,
message: '请选择第三方模板名称',
},
]}
>
{/* <Input placeholder="请输入模板名称" /> */}
<Select
placeholder="请选择模板名称"
style={{ width: '12rem' }}
onChange={(value, option) => onChange(value, option)}
>
{templateName &&
templateName.length > 0 &&
templateName.map((item, index) => (
<Select.Option value={item.Name} key={index} code={item.Code}>
{item.Name}
</Select.Option>
))}
</Select>
</Item>
<Item
label="第三方模板编号"
name="third_id"
rules={[
{
required: true,
message: '请输入第三方模板编号',
},
]}
>
<Input disabled placeholder="请输入第三方模板编号" />
</Item>
</div>
</Item>
</> :
<>
<Item
label="第三方模板编号"
name="third_id"
rules={[
{
required: true,
message: '请输入第三方模板编号',
},
]}
label="请选择第三方模板名称"
wrapperCol={{ span: 17 }}
labelCol={{ span: 6 }}
style={{ marginBottom: '0' }}
>
<Input disabled placeholder="请输入第三方模板编号" />
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Item
label=""
name="third_name"
rules={[
{
required: true,
message: '请选择第三方模板名称',
},
]}
>
<Select style={{width:'12rem'}} onChange={(value) => onChangeType1(value)} placeholder="请选择模板名称" >
<Select.Option value="普通文本">普通文本</Select.Option>
<Select.Option value="文字卡片">文字卡片</Select.Option>
<Select.Option value="图片消息">图片消息</Select.Option>
<Select.Option value="图片">图片</Select.Option>
</Select>
</Item>
<Item
label="企业微信应用id"
labelCol={{ span: 11 }}
name="weixin"
rules={[
{
required: true,
message: '请输入企业微信号',
},
]}
>
<Input placeholder="请输入企业微信号" />
</Item>
</div>
</Item>
</div></Item>
</>
}
<Item
label="模板参数"
label="模板参数1.0"
labelCol={{ span: 6 }}
name="params"
rules={[
{
required: true,
message: '请输入模板参数',
},
]}
>
<TextArea rows={4} style={{width:'96%'}} placeholder="first|Second|Third|Four" />
<TextArea rows={2} style={{ width: '96%' }} placeholder="first|Second|Third|Four" />
</Item>
<Item
label="模板参数2.0"
labelCol={{ span: 6 }}
name="param1"
>
<TextArea rows={2} style={{ width: '96%' }} placeholder="first|Second|Third|Four" />
</Item>
<Item
label="参数说明"
name="desc"
labelCol={{ span: 6 }}
rules={[
{
required: true,
message: '请输入参数说明',
},
]}
>
<TextArea style={{width:'96%'}} rows={4} placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息" />
<TextArea style={{ width: '96%' }} rows={4} placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息" />
</Item>
<Item
label="参数解析"
label="解析规则"
name="analysis_params"
labelCol={{ span: 6 }}
rules={[
{
required: true,
message: '请输入参数解析',
},
]}
>
<TextArea rows={4} style={{width:'96%'}} placeholder="param1|param2|param3|param4" />
<TextArea rows={2} style={{ width: '96%' }} placeholder="param1|param2|param3|param4" />
</Item>
</Form>
</div>
......
......@@ -6,15 +6,15 @@ import { Form, Input, notification, Select, Row, Col } from 'antd'
const { Item } = Form;
const { TextArea } = Input;
const EditModal = props => {
const { option } = props;
const { option, visible } = props;
const [form] = Form.useForm();
const [templateName, setTemplateName] = useState([]);
const [loading, setLoading] = useState(false);
const [flag, setFlag] = useState(0)
const onSubmit = () => {
form.submit()
}
const onSubmitSuccess = () => {
const result = form.getFieldValue()
......@@ -22,18 +22,36 @@ const EditModal = props => {
}
useEffect(() => {
// console.log(props)
// if(props.template.type=='企业微信'){
// form.setFieldsValue({type:'企业微信'})
// }
// let aa
// if(props.template.third_id==null){
// aa=props.template.weixin
// }
// if(props.template.weixin==null){
// aa=props.template.third_id
// }
form.setFieldsValue({
name: props.template.name,
type: props.template.type,
third_name: props.template.third_name,
third_id: props.template.third_id,
params: props.template.template_params,
weixin:props.template.weixin,
params: props.template.template_params1,
param1: props.template.template_params2,
desc: props.template.desc,
analysis_params: props.template.analysis_params,
})
console.log(form.getFieldsValue().type)
if (option) {
setTemplateName(option.filter(item => item.Type === props.template.type))
}
}, [props.template])
const layout = {
......@@ -47,7 +65,7 @@ const EditModal = props => {
};
const onChangeType = (value) => {
console.log(option.filter(item => item.Type === value),'123');
console.log(option.filter(item => item.Type === value), '123');
setTemplateName(option.filter(item => item.Type === value))
}
const onChange = (value, option) => {
......@@ -57,13 +75,20 @@ const EditModal = props => {
// setTemplateName(option.filter(item => item.Type === value))
};
const onChangeType1 = (value) => {
form.setFieldsValue({
third_id: value
})
}
return (
<SiteModal
{...props}
title="模板编辑"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
width="820px"
destroyOnClose
cancelText="取消"
okText="确认"
......@@ -98,56 +123,99 @@ const EditModal = props => {
},
]}
>
<Select onChange={(value) => onChangeType(value)}>
<Select onChange={(value) => onChangeType(value)}>
<Select.Option value="公众号">公众号</Select.Option>
<Select.Option value="短信">短信</Select.Option>
<Select.Option value="企业微信">企业微信</Select.Option>
</Select>
</Item>
</Col>
</Row>
<Row gutter={24}>
<Col span={11}>
<Item
label="第三方模板名称"
name="third_name"
rules={[
{
required: true,
message: '请输入第三方模板名称',
},
]}
>
{/* <Input placeholder="请输入模板名称" /> */}
<Select
placeholder="请选择模板名称"
onChange={(value, option) => onChange(value, option)}
{form.getFieldsValue().type == '企业微信'||props.template.type=='企业微信' ?
<>
<Row gutter={24}>
<Col span={11}>
<Item
label="第三方模板名称"
name="third_name"
rules={[
{
required: true,
message: '请输入第三方模板名称',
},
]}
>
<Select style={{ width: '11.5rem' }} onChange={(value) => onChangeType1(value)} placeholder="请选择模板名称" >
<Select.Option value="普通文本">普通文本</Select.Option>
<Select.Option value="文字卡片">文字卡片</Select.Option>
<Select.Option value="图片消息">图片消息</Select.Option>
<Select.Option value="图片">图片</Select.Option>
</Select>
</Item>
</Col>
<Col span={11}>
<Item
label="企业微信应用id"
// labelCol={{ span: 11 }}
name="weixin"
rules={[
{
required: true,
message: '请输入企业微信号',
},
]}
>
<Input placeholder="请输入企业微信号" />
</Item>
</Col>
</Row>
</> :
<>
<Row gutter={24}>
<Col span={11}>
<Item
label="第三方模板名称"
name="third_name"
rules={[
{
required: true,
message: '请输入第三方模板名称',
},
]}
>
<Select
placeholder="请选择模板名称"
onChange={(value, option) => onChange(value, option)}
>
{templateName &&
templateName.length > 0 &&
templateName.map((item, index) => (
<Option value={item.Name} key={item.Name + index} code={item.Code}>
{item.Name}
</Option>
))}
</Select>
</Item>
</Col>
<Col span={11}>
<Item
label="第三方模板编号"
name="third_id"
rules={[
{
required: true,
message: '请输入第三方模板编号',
},
]}
>
<Input placeholder="请输入模板名称" />
</Item>
</Col>
</Row>
>
{templateName &&
templateName.length > 0 &&
templateName.map((item, index) => (
<Option value={item.Name} key={item.Name + index} code={item.Code}>
{item.Name}
</Option>
))}
</Select>
</Item>
</Col>
<Col span={11}>
<Item
label="第三方模板编号"
name="third_id"
rules={[
{
required: true,
message: '请输入第三方模板编号',
},
]}
>
<Input placeholder="请输入模板名称" />
</Item>
</Col>
</Row>
</>
}
<Row gutter={24}>
<Col span={1}>
<Item>
......@@ -156,18 +224,20 @@ const EditModal = props => {
</Col>
<Col span={23}>
<Item
label="模板参数"
label="模板参数1.0"
labelCol={{ span: 3 }}
style={{ marginLeft: '1.4rem' }}
name="params"
>
<TextArea rows={2} placeholder="first|Second|Third|Four" />
</Item>
<Item
label="模板参数2.0"
labelCol={{ span: 3 }}
style={{ marginLeft: '1.4rem' }}
rules={[
{
required: true,
message: '请输入模板参数',
},
]}
name="param1"
>
<TextArea rows={4} placeholder="first|Second|Third|Four" />
<TextArea rows={2} placeholder="first|Second|Third|Four" />
</Item>
</Col>
</Row>
......@@ -183,12 +253,7 @@ const EditModal = props => {
labelCol={{ span: 3 }}
style={{ marginLeft: '1.4rem' }}
name="desc"
rules={[
{
required: true,
message: '请输入参数说明',
},
]}
>
<TextArea rows={4} placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息" />
</Item>
......@@ -202,18 +267,12 @@ const EditModal = props => {
</Col>
<Col span={23}>
<Item
label="参数解析"
label="解析规则"
labelCol={{ span: 3 }}
style={{ marginLeft: '1.4rem' }}
name="analysis_params"
rules={[
{
required: true,
message: '请输入参数解析',
},
]}
>
<TextArea rows={4} placeholder="param1|param2|param3|param4" />
<TextArea rows={2} placeholder="param1|param2|param3|param4" />
</Item>
</Col>
</Row>
......
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