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

修改数据字典模块

parents bf89e623 2d8a8a4e
Pipeline #31991 skipped with stages
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -21,22 +21,26 @@ const EditForm = props => {
otherForm.resetFields();
}, [info]);
useEffect(() => {
if (nodeType === 1 || nodeType === 2) {
let arr = Object.keys(form.getFieldsValue());
let obj = {};
arr.map(i => {
obj[i] = info[i];
});
form.setFieldsValue({ ...obj, shortName: info.menuShortName });
}
if (nodeType === 3 || nodeType === 4) {
let arr = Object.keys(otherForm.getFieldsValue());
let obj = {};
arr.map(i => {
obj[i] = info[i];
});
otherForm.setFieldsValue({ ...obj, shortName: info.menuShortName });
if(JSON.stringify(info)!='{}' ){
let data =info.data
if (nodeType === 1 || nodeType === 2) {
let arr = Object.keys(form.getFieldsValue());
let obj = {};
arr.map(i => {
obj[i] = data[i];
});
form.setFieldsValue({ ...obj, shortName: data.menuShortName });
}
if (nodeType === 3 || nodeType === 4) {
let arr = Object.keys(otherForm.getFieldsValue());
let obj = {};
arr.map(i => {
obj[i] = data[i];
});
otherForm.setFieldsValue({ ...obj, shortName: data.menuShortName });
}
}
}, [info]);
const submit = () => {
......@@ -214,7 +218,7 @@ const EditForm = props => {
<Input />
</Item>
<CheckList
info={info}
info={info.data?info.data:{}}
nodeType={nodeType}
valueCallback={valueCallback}
/>
......
import React, { useState, useEffect } from 'react';
import {
Form,
Modal,
Space,
Table,
Button,
Popconfirm,
Spin,
notification,
} from 'antd';
import { reloadTableFields, removeFields } from '@/services/platform/bs';
import FieldEditor from './fieldEditor';
const AddModal = props => {
const [tableData, setTableData] = useState([]);
const { callBackSubmit = () => {}, type, formObj, visible } = props;
const [loading, setLoading] = useState(false);
const [treeLoading, setTreeLoading] = useState(true);
const [form] = Form.useForm();
const [flag, setFlag] = useState(0); // 弹窗类型
const [isVisible, setIsVisible] = useState(false); // 弹窗
const [isType, setIsType] = useState(''); // 弹窗类型
const [itemData, setItemData] = useState({});
const { Item } = Form;
// 提交
const onSubmit = () => {
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
}
});
};
const columns = [
{
title: '字段名',
dataIndex: 'name',
key: 'name',
width: 150,
render: text => <a>{text}</a>,
},
{
title: '别名',
dataIndex: 'alias',
key: 'alias',
align: 'center',
},
{
title: '字段类型',
dataIndex: 'storeType',
key: 'storeType',
align: 'center',
},
{
title: '形态',
dataIndex: 'shape',
key: 'shape',
align: 'center',
},
{
title: '配置',
dataIndex: 'config',
key: 'config',
align: 'center',
},
{
title: '只读',
dataIndex: 'readOnly',
key: 'readOnly',
align: 'center',
},
{
title: '同步',
dataIndex: 'syncEvent',
key: 'syncEvent',
align: 'center',
},
{
title: '操作',
width: 250,
ellipsis: true,
align: 'center',
render: (text, record) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
editor(record);
}}
>
编辑
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该字段?"
okText="确认"
cancelText="取消"
onConfirm={() => {
deleteChart(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
const editor = record => {
setIsType('edit');
setIsVisible(true);
setItemData(record);
};
const Submit = prop => {
setIsVisible(false);
setFlag(flag + 1);
};
useEffect(() => {
if (type !== '') {
setTreeLoading(true);
reloadTableFields({
tableName: formObj.tableName,
}).then(res => {
setTreeLoading(false);
if (res.msg === 'Ok') {
setTableData(res.data.root);
}
});
}
}, [visible, flag]);
// 删除表字段
const deleteChart = record => {
removeFields({ fieldIDs: record.ID }).then(res => {
if (res.msg === 'Ok' || res.msg === '') {
notification.success({
message: '提示',
duration: 3,
description: '删除成功',
});
setFlag(flag + 1);
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
return (
<>
<Modal
title="字段配置"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '50px', left: '50px' }}
width="60%"
destroyOnClose
maskClosable={false}
cancelText="取消"
okText="确认"
{...props}
onOk={() => onSubmit()}
confirmLoading={loading}
forceRender
getContainer={false}
>
{visible && (
<Spin tip="loading..." spinning={treeLoading}>
<Table
columns={columns}
dataSource={tableData}
// pagination={{ pageSize: 10 }}
scroll={{ x: 'max-content', y: '35rem' }}
size="small"
rowKey={(record, index) => `complete${record.tableID}${index}`}
pagination={false}
/>
</Spin>
)}
</Modal>
<FieldEditor
isVisible={isVisible}
isType={isType}
itemData={itemData}
formObj1={formObj}
onCancel={() => setIsVisible(false)}
callBackSubmit={Submit}
/>
</>
);
};
export default AddModal;
......@@ -50,9 +50,9 @@
padding: 0.5rem;
}
.cardContent{
height: 25rem;
height:35rem;
overflow-y: scroll;
width: 19.5rem;
width: 22rem;
}
.cardItemData{
padding: 1rem;
......@@ -77,6 +77,9 @@
font-weight: 600;
background: #FAFAFA;
}
td{
width: 12rem;
}
}
tbody{
tr:hover{
......@@ -85,3 +88,9 @@
}
}
}
.defaultTile{
background-color:transparent ;
}
.activeTile{
background-color:#dfe8f6 ;
}
\ No newline at end of file
......@@ -20,7 +20,6 @@ import styles from './index.less'
import Editor from './components/Field/editor'
import AddTablelList from './components/Field/addTable'
import AffiliateAdd from './components/Field/affiliateAdd'
import FieldsConfig from './components/Field/fieldsConfig'
import LoadGroup from './components/Field/loadGroup'
import { useHistory } from 'react-router-dom';
const { Search } = Input;
......@@ -140,6 +139,7 @@ const TableManager = () => {
Object.keys(groupData).map((item, index) => {
newArr.push({ type: item, key: index })
})
console.log('groupData',groupData);
setAllData(groupData)
setGroupArr(newArr)
}
......@@ -302,7 +302,7 @@ const TableManager = () => {
{
title: '类型', dataIndex: 'type', key: 'type',
render: text => {
return (<div style={{ color: '#3764a0' }}>{text}({allData[text].length}个)</div>)
return (<div style={{ color: '#3764a0' }}>{text}({allData&&allData[text]?allData[text].length:0}个)</div>)
}
},
......@@ -311,7 +311,6 @@ const TableManager = () => {
return (
<Spin tip="loading..." spinning={treeLoading}>
<PageContainer>
<div className={styles.tablemanager_container}>
<div className={styles.operate_bar}>
<div className={styles.fast_search}>
......@@ -331,7 +330,7 @@ const TableManager = () => {
<Button type="primary" style={{ marginLeft: "10px" }} onClick={AffiliateAddTable}>附加</Button>
</div>
<div className={styles.table_container}>
<div style={{ width: '100vm', height: 'calc(100vh - 150px) ', background: '#ffffff' }}>
{/* <Table
columns={columns}
dataSource={tableData}
......@@ -353,6 +352,7 @@ const TableManager = () => {
className="components-table-demo-nested"
columns={columns}
expandable={{ expandedRowRender }}
showHeader={false}
dataSource={groupArr}
size="small"
style={{ height: '8rem' }}
......@@ -393,15 +393,7 @@ const TableManager = () => {
formObj={formObj}
/>
)}
{visible && type === 'config' && (
<FieldsConfig
visible={visible}
type={type}
formObj={formObj}
onCancel={() => setVisible(false)}
callBackSubmit={onSubmit}
/>
)}
{visible && type === 'sort' && (
<LoadGroup
visible={visible}
......
.tablemanager_container {
display: flex;
flex-direction: column;
width: 100vm;
.operate_bar {
width: 100%;
height: 60px;
......@@ -25,7 +26,3 @@
}
}
.table_container{
width: 100%;
height: calc(100% - 100px);
}
\ No newline at end of file
......@@ -19,10 +19,16 @@ const AddModal = props => {
const [checkAll, setCheckAll] = useState([]);
const [selectData, setSelectData] = useState([])
let objArr = []
const onChangeList = (list, index) => {
const onChangeList = (list, index,title) => {
const checkedListArr = [...checkedList]
checkedListArr[index] = list
setCheckedList(checkedListArr);
const indeterminateArr = [...indeterminate]
const checkAllArr = [...checkAll]
indeterminateArr[index] = !!list.length && list.length < filed[title].length
checkAllArr[index] = list.length === filed[title].length
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr);
};
const onCheckAllChange = e => {
......@@ -61,14 +67,21 @@ const AddModal = props => {
else if (isType === 'characteristics') {
let arr = Object.keys(filed)
setTitle(arr)
console.log('arr', arr);
let checkArr = []
let indeterminateArr = []
let checkAllArr = []
arr.map((item, index) => {
indeterminateArr.push(true)
checkAllArr.push(false)
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed[item].includes(checkItem)) {
checkArr[index].push(checkItem)
}
})
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed[item].length)
checkAllArr.push(checkArr[index].length === filed[item].length)
})
setCheckedList(newCheckedList)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
let newArr = characterValue.length? characterValue.split(","):[]
......@@ -158,7 +171,7 @@ const AddModal = props => {
{title.map((item, index) => {
return <div className={styles.cardItemData} key={index}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', color: '#15428b', borderTopColor: '#99bbe8' }}>{item} <Checkbox indeterminate={indeterminate[index]} onChange={onCheckAllChange} index={index} checkvalue={filed[item]} checked={checkAll[index]}> </Checkbox></Divider>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index)} /></div>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index,item)} /></div>
})}
</div>
</div>
......
......@@ -33,7 +33,6 @@ const AddModal = props => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
console.log('obj', obj);
let data = [{ Unit: pramData.Unit || '', StoreType: "nvarchar(255)", Group: pramData.Group || '', Shape, ExceptionEvent: pramData.ExceptionEvent || '', RowSpan: pramData.RowSpan || 0, ColSpan: pramData.ColSpan || 0, ReadOnly: pramData.ReadOnly || false, EditableLater: pramData.EditableLater || false, ExceptionValue: pramData.ExceptionValue || '', Preset: pramData.Preset || '', ID: Number(itemData.ID), Name: obj.Name, Alias: obj.Alias, SyncEvent: obj.SyncEvent, ValidationRule: obj.ValidationRule, ExceptionEventFields: characterValue }]
switch (Shape) {
......@@ -87,10 +86,12 @@ const AddModal = props => {
form.setFieldsValue({ ...res[0].data.root })
if (res[0].data.root.ExceptionEventFields === '') {
setCharacterValue('')
setCheckedList([])
setIsShow(false)
} else {
setIsShow(true)
setCharacterValue(res[0].data.root.ExceptionEventFields)
setCheckedList(res[0].data.root.ExceptionEventFields.split(','))
}
setShape(res[0].data.root.Shape)
let coordinates = false, picture = false, must = false
......@@ -109,6 +110,9 @@ const AddModal = props => {
}
setPramData({ ...res[0].data.root, coordinates, must, picture })
let index = res[2].data.root.find(item => { return item.Name == res[0].data.root.ExceptionEvent })
console.log('index',index);
getFieldData(index.TableName)
}
})
}
......@@ -178,6 +182,7 @@ const AddModal = props => {
setIsShow(false)
setFiled({})
setCharacterValue('')
setCheckedList([])
}
}
const getFieldData = (value) => {
......@@ -312,7 +317,7 @@ const AddModal = props => {
width="700px"
destroyOnClose
maskClosable={false}
centered ={true}
centered={true}
cancelText="取消"
okText="确认"
{...props}
......@@ -329,7 +334,7 @@ const AddModal = props => {
name="Name"
rules={[{ required: true, message: '请输入表名' }]}
>
<Input placeholder="请输入别名" disabled/>
<Input placeholder="请输入别名" disabled />
</Item>
<Item
label="别名"
......
......@@ -16,105 +16,15 @@ import { useHistory } from 'react-router-dom';
import styles from './index.less'
const AddModal = props => {
const history = useHistory();
const [allData, setAllData] = useState([]);
const [tableData, setTableData] = useState([]);
const { callBackSubmit = () => { }, type, visible } = props;
const [loading, setLoading] = useState(false);
const [treeLoading, setTreeLoading] = useState(false);
const [formObj, setFormObj] = useState('');
const [form] = Form.useForm();
const [flag, setFlag] = useState(0); // 弹窗类型
const [isVisible, setIsVisible] = useState(false); // 弹窗
const [isType, setIsType] = useState(''); // 弹窗类型
const [itemData, setItemData] = useState({});
const { Item } = Form;
// 提交
const onSubmit = () => {
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
let obj = form.getFieldsValue();
}
});
};
const columns = [
{
title: '字段名',
dataIndex: 'name',
key: 'name',
width: 150,
render: text => <a>{text}</a>,
},
{
title: '别名',
dataIndex: 'alias',
key: 'alias',
align: 'center',
},
{
title: '字段类型',
dataIndex: 'storeType',
key: 'storeType',
align: 'center',
},
{
title: '形态',
dataIndex: 'shape',
key: 'shape',
align: 'center',
},
{
title: '配置',
dataIndex: 'config',
key: 'config',
align: 'center',
},
{
title: '只读',
dataIndex: 'readOnly',
key: 'readOnly',
align: 'center',
},
{
title: '同步',
dataIndex: 'syncEvent',
key: 'syncEvent',
align: 'center',
},
{
title: '操作',
width: 250,
ellipsis: true,
align: 'center',
render: (text, record) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
editor(record);
}}
>
编辑
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该字段?"
okText="确认"
cancelText="取消"
onConfirm={() => {
deleteChart(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
const editor = record => {
setIsType('edit');
setIsVisible(true);
......@@ -124,6 +34,106 @@ const AddModal = props => {
setIsVisible(false);
setFlag(flag + 1);
};
const expandedRowRender = (item) => {
const columns = [
{
title: '字段名',
dataIndex: 'name',
key: 'name',
width: 150,
render: text => <a>{text}</a>,
},
{
title: '别名',
dataIndex: 'alias',
key: 'alias',
align: 'center',
width: 200,
},
{
title: '字段类型',
dataIndex: 'storeType',
key: 'storeType',
align: 'center',
width: 200,
},
{
title: '形态',
dataIndex: 'shape',
key: 'shape',
align: 'center',
width: 200,
},
{
title: '配置',
dataIndex: 'config',
key: 'config',
align: 'center',
width: 200,
},
{
title: '只读',
dataIndex: 'readOnly',
key: 'readOnly',
align: 'center',
width: 200,
},
{
title: '同步',
dataIndex: 'syncEvent',
key: 'syncEvent',
align: 'center',
width: 200,
},
{
title: '操作',
width: 250,
ellipsis: true,
align: 'center',
render: (text, record) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
editor(record);
}}
>
编辑
</Button>
<div onClick={e => e.stopPropagation()}>
<Popconfirm
title="是否删除该字段?"
okText="确认"
cancelText="取消"
onConfirm={() => {
deleteChart(record);
}}
>
<Button size="small" danger>
删除
</Button>
</Popconfirm>
</div>
</Space>
),
},
];
return <Table columns={columns} dataSource={allData[item.type]} pagination={false} />;
};
const columns = [
{
title: '类型', dataIndex: 'type', key: 'type',
render: text => {
return (<div style={{ color: '#3764a0' }}>{text}(共{allData[text].length}条)</div>)
}
},
];
useEffect(() => {
if (props.match.params.id) {
setFormObj(props.match.params.id)
......@@ -133,9 +143,13 @@ const AddModal = props => {
}).then(res => {
setTreeLoading(false);
if (res.msg === 'Ok') {
setTableData(res.data.root);
console.log(formateArrDataA(res.data.root,'groupName'));
let arr =formateArrDataA(res.data.root,'group')
let newArr = []
Object.keys(arr).map((item, index) => {
newArr.push({ type: item, key: index,id:index })
})
setAllData(arr);
setTableData(newArr);
}
});
}
......@@ -167,11 +181,12 @@ const AddModal = props => {
}
}
}
for (let key in tempObj) {
for (let keys in tempObj) {
let arr = []
tempObj[key].map(item => {
tempObj[key] = arr;
arr.push(item.fieldName)
tempObj[keys].map((item,index) => {
tempObj[keys] = arr;
item.key = index
arr.push(item)
})
}
return tempObj
......@@ -206,10 +221,12 @@ const AddModal = props => {
<Table
columns={columns}
dataSource={tableData}
expandable={{ expandedRowRender }}
showHeader={false}
// pagination={{ pageSize: 10 }}
scroll={{ x: 'max-content', y: '45rem' }}
scroll={{ y: '45rem' }}
size="small"
rowKey={(record, index) => `complete${record.tableID}${index}`}
rowKey='id'
pagination={{
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`,
......
......@@ -7,10 +7,11 @@ import {
Button,
Select,
Popconfirm,
message
message,
Tooltip
} from 'antd';
import { PlusCircleOutlined } from '@ant-design/icons';
import { PlusCircleOutlined, EditTwoTone, DeleteOutlined, FundViewOutlined } from '@ant-design/icons';
import { useHistory } from 'react-router-dom';
const { Search } = Input;
const { Option } = Select;
import EditModal from './components/EditModal'
......@@ -18,7 +19,7 @@ import VisibleRoleModal from './components/RolseSelect/VisibleRoleModal'
import { GetMessageConfigList, TestPush, DeleteMessageConfig, GetMsgTypeList, DeleteIISAgentConfig } from '@/services/platform/messagemanage'
import styles from './ProjectManage.less'
const ProjectManage = () => {
const history = useHistory();
const [visibleParams, setvisibleParams] = useState({
addVisible: false, // 新增弹窗
delVisible: false, // 删除弹窗
......@@ -72,24 +73,16 @@ const ProjectManage = () => {
ellipsis: true,
render: (text, record) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
<Tooltip title="测试">
<FundViewOutlined style={{ fontSize: '16px', color: '#1890FF' }} onClick={() => {
TestDesc(record);
}}
>
测试
</Button>
<Button
type="primary"
size="small"
onClick={() => {
}} />
</Tooltip>
<Tooltip title="编辑">
<EditTwoTone style={{ fontSize: '16px', color: '#e86060' }} onClick={() => {
changeDesc(record);
}}
>
编辑
</Button>
}}></EditTwoTone>
</Tooltip>
{
record.name != "通用报警"
......@@ -104,9 +97,8 @@ const ProjectManage = () => {
DeleteProject(record)
}}
>
<Button size="small" danger>
删除
</Button>
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }}></DeleteOutlined>
</Popconfirm>
</div>)
}
......@@ -120,28 +112,27 @@ const ProjectManage = () => {
GetMessageList({ pageSize: 10, pageIndex: 0, search: value })
}
const changeDesc = (record) => {
setCurrentTempalte(record)
handleShowModal("editVisible", true)
history.push({ pathname: `/platformCenter/schemeDetail`, state: { template: record } })
// handleShowModal("editVisible", true)
}
const TestDesc = (record) => {
console.log(record)
if(record.ThemeName)
TestPush({
theme:record.ThemeName,
msgType:record.MsgType,
tousers:record.PushGroup,
pushPath:record.item.AgentConfig.Url,
msgTypeId:record.ID
}).then(
res =>{
if(res.code === 0){
message.success("测试推送成功")
}else{
message.error(res.msg)
if (record.ThemeName)
TestPush({
theme: record.ThemeName,
msgType: record.MsgType,
tousers: record.PushGroup,
pushPath: record.item.AgentConfig ? record.item.AgentConfig.Url : '',
msgTypeId: record.ID
}).then(
res => {
if (res.code === 0) {
message.success("测试推送成功")
} else {
message.error(res.msg)
}
}
}
)
)
}
const DeleteProject = (record) => {
let agen = record.item.AgentConfig
......@@ -158,21 +149,21 @@ const ProjectManage = () => {
res3 => {
if (res3.code === 0) {
message.success("删除方案成功")
setFlag(flag +1)
setFlag(flag + 1)
}
}
)
}
}
)
}else{
} else {
DeleteMessageConfig({
id:config.ID
id: config.ID
}).then(
res3 =>{
if(res3.code === 0){
res3 => {
if (res3.code === 0) {
message.success("删除方案成功")
setFlag(flag +1)
setFlag(flag + 1)
}
}
)
......@@ -189,16 +180,18 @@ const ProjectManage = () => {
setvisibleParams({ ...visibleParams, [key]: value });
};
const editModal = () => {
handleShowModal("editVisbile",false)
handleShowModal("editVisbile", false)
setFlag(flag + 1)
}
const bddModal = () => {
handleShowModal("addVisbile",false)
handleShowModal("addVisbile", false)
setFlag(flag + 1)
}
const onAddClick = () => {
setCurrentTempalte({})
handleShowModal("addVisible", true)
// handleShowModal("addVisible", true)
history.push({ pathname: `/platformCenter/schemeDetail`, state: { template: {} } })
}
const onTypeChange = (value) => {
if (value == "全部") {
......@@ -237,6 +230,7 @@ const ProjectManage = () => {
res => {
let mesList = []
if (res.code === 0) {
console.log('res.data.MessageConfigModels', res.data.MessageConfigModels);
res.data.MessageConfigModels.map((item) => {
mesList.push({
name: item.MessageConfig.MsgType,
......@@ -248,7 +242,7 @@ const ProjectManage = () => {
item: item
})
})
console.log('mesList',mesList);
console.log('mesList', mesList);
setDataList(mesList)
}
}
......@@ -297,7 +291,7 @@ const ProjectManage = () => {
</div>
<div className={styles.list_view}>
<Table columns={columns} dataSource={dataList} pagination={{ pageSize: '10' }} rowKey='ID'/>
<Table columns={columns} dataSource={dataList} pagination={{ pageSize: '10' }} rowKey='ID' />
</div>
<EditModal
visible={visibleParams.editVisible}
......
......@@ -20,8 +20,8 @@
align-items: center;
.title {
margin-left: 5px;
margin-right: 5px;
margin-left: 18px;
margin-right: 10px;
}
}
......@@ -34,8 +34,8 @@
align-items: center;
.title {
margin-left: 20px;
margin-right: 5px;
margin-left: 25px;
margin-right: 10px;
}
}
}
......
......@@ -105,12 +105,13 @@ const EditModal = props => {
console.log(form.getFieldValue())
let fv = form.getFieldValue()
if (template.ThemeName) {
console.log('fv.wx_template',fv.wx_template);
console.log('fv.push_mode.toString()',fv.push_mode.toString());
let a = {
ID: template.ID,
ThemeName: template.ThemeName,
MsgType: fv.name,
PublicTemplateID: fv.wx_template,
PublicTemplateID: fv.wx_template.toString(),
PublicConfig: template.PublicConfig,
PublicPath: fv.h5_path,
MsgTemplateName: template.MsgTemplateName,
......@@ -157,6 +158,7 @@ const EditModal = props => {
)
} else {
console.log('fv.push_mode.toString()',fv.push_mode.toString());
let b = {
ThemeName: "定时推送",
MsgType: fv.name,
......@@ -209,7 +211,6 @@ const EditModal = props => {
}
const onTypeChange = (value) => {
console.log(value)
setCurrentTrench({
isAPPShow: value.indexOf("平台弹框") > -1 ? true : false,
isWXShow: value.indexOf("公众号推送") > -1 ? true : false,
......
......@@ -6,6 +6,7 @@ import DayOfWeekSelect from './DayOfWeekSelect'
import styles from './VisibleIISAgentConfig.less'
import moment from 'moment'
import { tr } from 'voca';
import {EditOutlined } from '@ant-design/icons';
const { Item } = Form;
......@@ -25,7 +26,6 @@ const VisibleIISAgentConfig = props => {
const [form] = Form.useForm();
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
const { agentConfig, value, onIISAgentSubmit } = props
useEffect(() => {
if (agentConfig) {
form.setFieldsValue({
......@@ -53,11 +53,13 @@ const VisibleIISAgentConfig = props => {
}
form.setFieldsValue({
name: value
})
setSelectRole(props.value)
if(value){
form.setFieldsValue({
name: value
})
setSelectRole(props.value)
}
}, [props])
......@@ -163,8 +165,7 @@ const VisibleIISAgentConfig = props => {
return (
<div className={styles.agent_container}>
<Input value={selectRole} disabled={true} />
<div className={styles.select_btn} onClick={handleClick}>推送计划</div>
<div className={styles.select_btn} onClick={handleClick}><EditOutlined style={{fontSize:'18px'}}/></div>
<SiteModal
{...props}
title="编辑定时任务"
......@@ -174,6 +175,7 @@ const VisibleIISAgentConfig = props => {
destroyOnClose
cancelText="取消"
okText="确认"
forceRender
visible={previewVisible}
onOk={() => handleOk()}
confirmLoading={loading}
......
.agent_container {
display: flex;
flex-direction: row;
width: 80%;
.select_btn {
display: inline-block;
color: #2f54eb;
cursor: pointer;
border-bottom: 1px solid #2f54eb;
width: 80px;
margin-left: 20px;
text-align: center;
padding: 0 0.8rem;
color: rgba(22,133,255,1);
}
.select_result {}
......
......@@ -24,7 +24,7 @@ const VisibleRoleModal = props => {
const [dataTree, setDataTree] = useState([])
const [dataLeafs, setDataLeafs] = useState([])
const [selectValues, setSelectValues] = useState([])
const { onSubmit, title, operate,initValues } = props
const { onSubmit, title, operate, initValues, selectValue } = props
const GetRoleGroupList = () => {
......@@ -50,11 +50,11 @@ const VisibleRoleModal = props => {
// for (const id of initValues) {
// if(id == roleItem.roleID){
// leafNode.checked = true
// }
// }
return leafNode
})
})
})
......@@ -66,6 +66,7 @@ const VisibleRoleModal = props => {
useEffect(() => {
setSelectRole(props.value)
selectValue && setSelectRole(selectValue)
GetRoleGroupList()
}, [])
......@@ -110,7 +111,7 @@ const VisibleRoleModal = props => {
<SiteModal
{...props}
title={title ? `选择${title}` : "关联角色"}
title={title && Object.prototype.toString.call(title) !== '[object Object]' ? `选择${title}` : "关联角色"}
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
......@@ -124,7 +125,7 @@ const VisibleRoleModal = props => {
>
<div className={styles.list_card}>
<ListCard {...props} onChange2={onChange2} data={dataTree} dataLeafs={dataLeafs} initValues={initValues}/>
<ListCard {...props} onChange2={onChange2} data={dataTree} dataLeafs={dataLeafs} initValues={initValues} />
</div>
</SiteModal>
</div>
......@@ -147,7 +148,7 @@ const checkChildrenByCondition = (
const ListCard = props => {
const { onChange, onChange2, data, dataLeafs,initValues } = props
const { onChange, onChange2, data, dataLeafs, initValues } = props
const [changedItem, setChangedItem] = useState({ item: {} });
const [valueList, setValueList] = useState([]);
......@@ -219,7 +220,7 @@ const ListCard = props => {
}
useEffect(() => {
initValues&&setValueList(initValues)
initValues && setValueList(initValues)
}, [])
return (
<div>
......
.role_container {
display: flex;
flex-direction: row;
width: 80%;
.select_btn {
display: inline-block;
color: #2f54eb;
cursor: pointer;
border-bottom: 1px solid #2f54eb;
width: 80px;
margin-left: 20px;
text-align: center;
padding: 0 0.8rem;
color: rgba(22,133,255,1);
}
}
.list_card{
......
......@@ -72,11 +72,8 @@ const TemplateManage = () => {
setOption([]);
GetThirdpartyTemplates(obj).then(res => {
if (res.msg==="Ok") {
console.log(res.data);
setOption(res.data);
console.log(2)
} else {
console.log(1);
notification.error({
message: '提示',
duration: 15,
......
This diff is collapsed.
.editModal_container{
width: 100%;
overflow-y: hidden;
height: calc(100% - 20px);
display: flex;
flex-direction: column;
button[ant-click-animating-without-extra-node]:after {
border: 0 none;
opacity: 0;
animation:none 0 ease 0 1 normal;
}
.content{
height: calc(100vh - 140px);
overflow-y: scroll;
}
.cardList{
display: flex;
flex-wrap: wrap;
.cardListItem{
width: 50%;
margin-bottom: 1rem;
}
}
.ant-card-bordered {
border-right: none;
}
.push_trench{
width: 100%;
height: fit-content;
display: flex;
flex-direction:row;
flex-wrap: wrap;
justify-content: space-between;
.trench_card{
margin-top: 1rem;
width: 49.2%;
border-width: 1px;
border-color: #EEEEEE;
border-style: solid;
border-radius: 5px;
display: flex;
flex-direction: column;
align-items: center;
background-color: #ffffff;
.card_title{
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color:#F6F7F9;
height:50px;
width: 100%;
display: flex;
flex-direction: row;
justify-content:space-between;
padding: 0 1.6rem;
align-items: center;
.lable{
font-size: large;
margin-left: 10px;
}
}
.card_body{
margin-top: 10px;
width: 100%;
padding: 10px;
height: 18rem;
display: flex;
flex-direction: column;
justify-content: center;
}
}
}
}
\ No newline at end of file
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Form, Modal, Space, Divider, Radio, Checkbox } from 'antd';
import {
} from '@/services/platform/bs'
import styles from './index.less'
import styles from './standingBook.less'
import Sortable from 'sortablejs';
const CheckboxGroup = Checkbox.Group;
const AddModal = props => {
const { callBackSubmit = () => { }, isType, formObj, visible, filed, characterValue, newCheckedList } = props;
const { callBackSubmit = () => { }, isType, pickItem, visible, filed, characterValue, newCheckedList } = props;
const [loading, setLoading] = useState(false);
const [value, setValue] = useState('');
const [checkValue, setCheckValue] = useState([]);
......@@ -19,10 +17,16 @@ const AddModal = props => {
const [checkAll, setCheckAll] = useState([]);
const [selectData, setSelectData] = useState([])
let objArr = []
const onChangeList = (list, index) => {
const onChangeList = (list, index, title) => {
const checkedListArr = [...checkedList]
checkedListArr[index] = list
setCheckedList(checkedListArr);
const indeterminateArr = [...indeterminate]
const checkAllArr = [...checkAll]
indeterminateArr[index] = !!list.length && list.length < filed[title].length
checkAllArr[index] = list.length === filed[title].length
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr);
};
const onCheckAllChange = e => {
......@@ -50,47 +54,37 @@ const AddModal = props => {
}
const onSubmit = () => {
isType === 'rule' ? callBackSubmit(`${value === '无' || value === '' ? '' : value + ','}${checkValue.join(',')}`) : callBackSubmit({ checkedList, str: selectData.join(",") });
isType === 'rule' ? callBackSubmit(`${value === '无' || value === '' ? '' : value + ','}${checkValue.join(',')}`) : callBackSubmit({ checkedList, str: selectData.join(","), pickItem });
};
useEffect(() => {
if (isType != '' && isType === 'rule') {
setValue(formObj.numerical)
setCheckValue(formObj.rule)
}
else if (isType === 'characteristics') {
if (isType != '') {
let arr = Object.keys(filed)
setTitle(arr)
console.log('arr', arr);
let checkArr = []
let indeterminateArr = []
let checkAllArr = []
arr.map((item, index) => {
indeterminateArr.push(true)
checkAllArr.push(false)
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed[item].includes(checkItem)) {
checkArr[index].push(checkItem)
}
})
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed[item].length)
checkAllArr.push(checkArr[index].length === filed[item].length)
})
setCheckedList(newCheckedList)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
let newArr = characterValue.length? characterValue.split(","):[]
let newArr = characterValue.length ? characterValue.split(",") : []
setSelectData(newArr)
draftSort()
}
}, [visible]);
//单选框变化时触发的事件
const handleChange = (e) => {
setValue(e.target.value)
if (e.target.value === '无') {
setCheckValue([])
}
}
//复选框变化时触发的事件
const onChange = (e) => {
setCheckValue(e)
if (e.length && value == '无') {
setValue('')
}
}
//拖拽初始化及逻辑
const draftSort = () => {
let el = document.getElementById('doctor-drag-items');
......@@ -114,10 +108,10 @@ const AddModal = props => {
<Modal
title={isType === 'rule' ? '选择验证规则' : '字段集选择'}
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '160px' }}
style={{ top: '10px' }}
width="700px"
destroyOnClose
centered ={true}
centered={true}
maskClosable={false}
cancelText="取消"
okText="确认"
......@@ -127,30 +121,8 @@ const AddModal = props => {
forceRender={true}
getContainer={false}
>
{visible && isType === 'rule' && (
<>
<Radio.Group onChange={handleChange} value={value}>
<Space direction="vertical">
<Radio value='无'>无(清空选中)</Radio>
<Radio value='number'>数值(number)</Radio>
<Radio value='digits'>整数(digits)</Radio>
<Radio value='email'>邮箱(email)</Radio>
<Radio value='identity'>身份证号(identity)</Radio>
<Radio value='mobile'>手机号(mobile)</Radio>
<Radio value='bankAccount'>银行卡号(bankAccount)</Radio>
<Radio value='timeControl'>时间控制(timeControl)</Radio>
</Space>
</Radio.Group>
<Checkbox.Group style={{ width: '100%', marginTop: '1rem' }} onChange={onChange} value={checkValue}>
<Space direction="vertical">
<Checkbox value="required">必填(required)</Checkbox>
<Checkbox value="emphasis">强调(emphasis)</Checkbox>
<Checkbox value="sensitive">敏感(sensitive)</Checkbox>
</Space>
</Checkbox.Group>
</>
)}
{visible && isType === 'characteristics' && (
{visible && (
<div className={styles.listCard}>
<div className={styles.cardItem} style={{ borderRight: '1px solid #99bbe8' }}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', backgroundColor: '#dfe8f6' }}>待选字段列表</Divider>
......@@ -158,7 +130,7 @@ const AddModal = props => {
{title.map((item, index) => {
return <div className={styles.cardItemData} key={index}>
<Divider orientation="left" style={{ margin: '0 0 10px 0', color: '#15428b', borderTopColor: '#99bbe8' }}>{item} <Checkbox indeterminate={indeterminate[index]} onChange={onCheckAllChange} index={index} checkvalue={filed[item]} checked={checkAll[index]}> </Checkbox></Divider>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index)} /></div>
<CheckboxGroup options={filed[item]} value={checkedList[index]} onChange={(e) => onChangeList(e, index, item)} /></div>
})}
</div>
</div>
......
This diff is collapsed.
This diff is collapsed.
.redText{
color: red;
cursor: pointer;
}
.ant-layout{
overflow: auto;
.ant-layout-content{
margin:12px !important;
}
}
.ant-btn > .anticon + span, .ant-btn > span + .anticon {
margin-left: 8px;
vertical-align: middle;
}
.siteTitle{
font-size: 16px;
margin: 0 0 6px 0;
user-select: none;
padding: 3px;
border-bottom: 1px solid #ccc;
}
.userManageContainer{
.ant-card-body{
padding-left: 0;
padding-right: 0;
}
.listItem{
display: flex;
justify-content: space-between;
font-size: 14px;
font-weight: 400;
color: #414E65;
cursor: pointer;
line-height: 28px;
align-items: center;
padding: 8px 14px;
}
.pickItem{
background-color: #F5F6F9;
}
.ant-form-item {
vertical-align: top;
}
.ant-form-item-label > label {
align-items:middle;
}
.ant-modal-body{
padding-bottom:0px;
padding-right:40px;
padding-left:40px;
.ant-form{
width: 90%;
}
}
.anticon svg {
margin-top: -3px;
}
.ant-popover-message {
position: relative;
padding: 0px 0 0px;
color: rgba(0, 0, 0, 0.85);
font-size: 14px;
}
.ant-tree-treenode{
width: 100% !important;
.ant-tree-node-content-wrapper{
display: inline-block;
width: 100%;
}
.iconWraper1{
float: right;
span{
display: none;
}
}
}
.ant-tree-treenode:hover{
.iconWraper1>span{
margin-left: 12px;
font-size: 18px;
display: inline-block;
}
}
.ant-radio-group {
margin: 0px !important;
}
.contentContainers{
display: flex;
width: 100%;
position: relative;
.ant-table.ant-table-bordered > .ant-table-container {
min-width: calc(100vw - 582px);
height: calc(100vh - 120px);
overflow-x: hidden;
border: none;
}
.orgContainer{
height: calc(100vh - 74px);
width: 340px;
left: 0;
top: 0;
overflow-x: hidden;
margin-right: 10px;
position: relative;
transition-property:width,left;
transition-duration: 0.5s;
white-space: nowrap;
.ant-tree{
padding-top: 6px;
.ant-tree-switcher{
line-height: 1;
margin-right: 0px !important;
color:#1890FF;
.ant-tree-switcher-line-icon{
margin-left: 5px;
}
}
}
.switcher{
display: block;
position: absolute;
font-size: 18px;
color: #1890FF!important;
top: 50%;
right: 2px;
transform: translate(0%,-50%);
z-index: 1;
}
}
.orgContainerHide{
// transform: translateX(-230px);
left: 0px;
top: 0;
width: 26px;
}
.ant-popover-message-title {
padding-left: 20px;
}
.userContainer{
height: calc(100vh - 74px) !important;
z-index: 999;
min-width: 800px;
background: white;
width: 100%;
position: relative;
transition: width 0.5s;
.title{
margin: 16px 0 10px 16px;
display: inline-block;
width: 270px;
cursor: pointer;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.ant-table-pagination{
padding-right: 12px;
background: white;
margin: 1px 0;
padding: 8px;
padding-right: 20px;
}
.ant-btn{
margin: 0px 10px;
.ant-btn-primary{
background: #50aefc;
}
}
.ant-input-search-button{
margin-left: 0px !important;
}
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.ant-table-cell{
text-align:center;
overflow: hidden;
// text-overflow:ellipsis;
white-space: nowrap;
}
.ant-table-body{
height:calc(100vh - 210px);
border-right: white;
overflow: auto !important;
}
.clickRowStyle{
background: #cfe7fd;
}
.ant-pagination{
z-index: 999;
border-top: 1px solid #f0eded;
}
}
}
}
.ant-modal-root{
.ant-tree-switcher{
line-height: 1;
color:#1890FF;
margin-right: 0px !important;
}
.ant-checkbox-group .ant-checkbox-group-item {
margin-right: 0px !important;
min-width: 270px !important;
}
.ant-tree-list-holder{
overflow: auto;
overflow-x:hidden;
height: 40vh;
}
.ant-tabs-content-holder{
overflow: auto;
height: 50vh;
}
}
.ant-modal-content{
border-radius: 5px;
}
.ant-modal-header{
border-radius: 5px 5px 0 0;
padding: 28px 40px;
}
.ant-modal-close{
top:14px;
right:20px;
}
.ant-modal-footer{
border:none;
padding: 28px 40px;
}
.ant-modal-footer .ant-btn + .ant-btn:not(.ant-dropdown-trigger) {
margin-bottom: 0;
margin-left: 15px;
}
// .ant-form-horizontal .ant-form-item-control {
// margin-left: 10px;
// }
.linkDrowp{
position: absolute;
top: 0;
left: 94.6%;
width: 1rem;
height: 100%;
display: flex;
align-items: center;
}
.title{
display: flex;
align-items: center;
width: 100%;
}
.tip{
display: none;
}
.fs{
font-size: 18px;
margin-left: 10px;
}
.title:hover{
.tip{
display: flex;
align-items: center;
justify-content: flex-end;
width: 100%;
}
}
.titleText{
width: 12rem;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
}
.ant-popover-inner {
border-radius: 10px;
background-color: rgba(255, 255, 255, 0.788);
}
.ant-popover-inner-content {
padding: 10px 10px;
}
.ant-popover-message > .anticon {
top: 7.0005px
}
.listCard{
display: flex;
.cardItem{
padding: 0.5rem;
}
.cardContent{
height: 30rem;
overflow-y: scroll;
width: 19.5rem;
}
.cardItemData{
padding: 1rem;
border: 1px solid #b5b8c8;
margin-bottom: 1rem;
}
}
.sortable-ghost {
border-bottom: 2px dashed #1890ff;
}
.doctorTable {
margin-bottom: 16px;
table {
width: 100%;
td {
padding: 6px;
border: 1px solid #e8e8e8;
}
thead {
tr {
font-weight: 600;
background: #FAFAFA;
}
}
tbody{
tr:hover{
background-color:#ededed ;
}
}
}
}
.formData{
height: 38rem;
overflow-y: scroll;
.ant-form-item-label > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before{
display: none;
}
.formData_label{
display: flex;
align-items: center;
}
.filed_listItem{
display: flex;
height: 3.6rem;
.ant-btn-icon-only {
width: 32px;
height: 32px;
/* padding: 2.4px 0; */
font-size: 16px;
border-radius: 2px;
vertical-align: -1px;
display: flex;
align-items: center;
justify-content: center;
}
}
}
......@@ -38,15 +38,17 @@ import { USER_MODE } from '@/utils/constants';
import BaseFrameContainer from '@/components/BaseFrameContainer';
import JumpContainer from '@/components/JumpContainer';
import HostManager from '@/pages/platformCenter/hostmanager';
import MessageManager from '@/pages/platformCenter/messageManage';
import MessageManager from '@/pages/platformCenter/messageManage'
import SchemeDetail from '@/pages/platformCenter/schemeDetail/schemeDetail'
import SchemeConfig from '@/pages/platformCenter/schemeConfig/schemeConfig';
import DimensionsConfig from '@/pages/platformCenter/dimensionsConfig/dimensionsConfig';
import TaskScheduling from '@/pages/artificial/taskScheduling/taskScheduling';
import PoliciesIssued from '@/pages/artificial/policiesIssued/policiesIssued';
import TableManager from '@/pages/platformCenter/bsmanager/tablemanager';
import FiledConfig from '@/pages/platformCenter/filedConfig/filedConfig';
import AuthControl from '@/pages/authcontrol';
import TableManager from '@/pages/platformCenter/bsmanager/tablemanager'
import StandingBook from '@/pages/platformCenter/standingBook/standingBook'
import FiledConfig from '@/pages/platformCenter/filedConfig/filedConfig'
// import ColConen from '@/components/Colophon/colContent';
const iconStyle = { verticalAlign: '0.125em' };
......@@ -242,6 +244,12 @@ export default {
name: '消息平台',
component: MessageManager,
},
{
path: '/platformCenter/SchemeDetail',
name: '模板编辑',
component: SchemeDetail,
hideMenu: true,
},
{
path: '/platformCenter/emq',
name: '宿主管理',
......@@ -267,6 +275,11 @@ export default {
component: FiledConfig,
hideMenu: true,
},
{
path: '/platformCenter/bsmanger/standingBook',
name: '台账管理',
component: StandingBook,
},
// {
// path: '/platformCenter/bsmanger/standbookmanager',
// name: '台账配置',
......
import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index';
// 加载台账
export const GetCM_Ledger_LoadLedgers = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Ledger_LoadLedgers`, query);
// 加载台账表
export const GetCM_Ledger_LoadLedgerTable = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Ledger_LoadLedgerTable`, query);
// 查看对应台账
export const GetCMLedger_QueryLedgers = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCMLedger_QueryLedgers`, query);
// 编辑或新增台账
export const GetCMLedger_OperateLedger = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCMLedger_OperateLedger`, data);
// 删除台账
export const CM_Ledger_RmoveLedger = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Ledger_RmoveLedger`, query);
\ No newline at end of file
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