Commit d2ff4995 authored by 皮倩雯's avatar 皮倩雯

fix: 'web配置增加公告内容'

parent 59975fa1
Pipeline #80094 passed with stages
......@@ -38,6 +38,7 @@ import {
CM_Event_LoadDepartmentAndRoles,
} from '@/services/standingBook/api';
import RMSComponents from '@/components/RolePmSite/index';
import { GetDataDictionaryList } from '@/services/dataCenter/api';
import ChangeRoles from './ChangeRoles';
import ChangeFields from './ChangeFields';
......@@ -85,6 +86,7 @@ const AddModal = props => {
const [fieldList, setFieldList] = useState([]);
const [layerList, setLayerList] = useState([]);
const [newPipeArr, setNewPipeArr] = useState([]);
const [dataList, setDataList] = useState([]);
const [form] = Form.useForm();
const [formAdd] = Form.useForm();
......@@ -93,6 +95,7 @@ const AddModal = props => {
useEffect(() => {
getEventData(); // 获取所有关联事件数据
getDataList();
if (visible) {
setNewPipeArr(pipeArr);
if (type === 'edit') {
......@@ -114,6 +117,15 @@ const AddModal = props => {
// : res.data.gisLayer,
});
}
if (res.data.inspectionType) {
let arr = res.data.inspectionType.split(',');
let newArr = arr.filter(i => {
return i !== '';
});
form.setFieldsValue({
inspectionType: newArr,
});
}
getGisPatrolObject(res.data.gisServerName);
onChangeEvent(res.data.relationEvent, aa); // 改变关联事件类型
......@@ -141,6 +153,16 @@ const AddModal = props => {
}
}, [visible]);
const getDataList = () => {
GetDataDictionaryList({ nodeID: 647 }).then(res => {
if (res.code === 0) {
setDataList(res.data);
} else {
setDataList([]);
}
});
};
// 获取字段名数据
const getGetTaskSyncField = (e, newKeep) => {
if (e) {
......@@ -371,6 +393,7 @@ const AddModal = props => {
// obj.gisLayer = list[1];
// groupNameSever = list[0];
// }
obj.inspectionType = obj.inspectionType.toString();
if (type == 'add') {
CM_Feedback_OperatePatrolFeedback({
...obj,
......@@ -808,6 +831,26 @@ const AddModal = props => {
<Input placeholder="示例:设备级别 = '小区阀门' (设备级别来自图层表字段)" />
</Item>
</Col>
<Col span={23}>
<Item label="巡检性质" name="inspectionType" labelCol={{ span: 4 }}>
<Select
mode="multiple"
allowClear
style={{
width: '100%',
}}
placeholder="请选择巡检性质"
>
{dataList
? dataList.map((item, index) => (
<Option key={index} value={item.nodeName}>
{item.nodeName}
</Option>
))
: ''}
</Select>
</Item>
</Col>
<Col span={23}>
<Item label="反馈表" name="tableName" labelCol={{ span: 4 }}>
<Select placeholder="选择反馈表" onChange={onChangeTableName} showSearch>
......
......@@ -56,6 +56,8 @@ const colorList = [
},
];
const { TextArea } = Input;
export default props => {
const {
visible,
......@@ -97,6 +99,7 @@ export default props => {
const [checkValue, setCheckValue] = useState([]);
const [checkValueList, setCheckValueList] = useState([]);
const [aftercare, setAftercare] = useState('请勾选不显示售后服务的用户');
const [visibleAnn, setVisibleAnn] = useState();
useEffect(() => {
onGetLoginPages();
let text = [];
......@@ -138,8 +141,6 @@ export default props => {
if (visible) {
if (isEdit) {
// 获取表单回显
console.log(config, 'config');
debugger;
if (config.CloudStyle == '是') {
config.CloudStyle == true;
setVisibleChecked1(true);
......@@ -170,6 +171,7 @@ export default props => {
setVisibleChecked4(config.messageVoice);
setVisibleChecked7(config.useCoverMap == 'true');
setHomePageConfig(config.roleHomePages);
setVisibleAnn(config.OpenAnnouncement);
form.setFieldsValue({
...config,
primaryColor: config.primaryColor ? config.primaryColor : '#0087F7',
......@@ -183,6 +185,7 @@ export default props => {
isCache: config.isCache,
changeStation: config.changeStation,
OpenAnnouncement: config.OpenAnnouncement,
AnnouncementContent: config.AnnouncementContent,
headerPrimaryColor: config.headerPrimaryColor
? config.headerPrimaryColor
: 'linear-gradient(0deg, #0066D6 0%, #39A9FF 100%)',
......@@ -236,6 +239,7 @@ export default props => {
OpenAnnouncement: false,
headerPrimaryColor: 'linear-gradient(0deg, #0066D6 0%, #39A9FF 100%)',
});
setVisibleAnn(false);
setCheckValue([]);
setAftercare('请勾选不显示售后服务的用户');
}
......@@ -248,6 +252,7 @@ export default props => {
setVisibleChecked3('');
setVisibleChecked4('');
setVisibleChecked5('');
setVisibleAnn('');
setHomePageConfig([]);
setCheckValue([]);
setCheckValueList([]);
......@@ -404,6 +409,10 @@ export default props => {
setVisibleChecked4(e);
};
const changeAnn = e => {
setVisibleAnn(e);
};
const change5 = e => {
setVisibleChecked5(e);
};
......@@ -771,9 +780,25 @@ export default props => {
onChange={change4}
/>
</Form.Item>
<Form.Item label="开启公告" name="OpenAnnouncement" valuePropName="checked">
<Switch checkedChildren="是" unCheckedChildren="否" />
</Form.Item>
<Row>
<Col span={8}>
<Form.Item
label="开启公告"
name="OpenAnnouncement"
valuePropName="checked"
labelCol={{ span: 15 }}
>
<Switch checkedChildren="是" unCheckedChildren="否" onChange={changeAnn} />
</Form.Item>
</Col>
{visibleAnn && (
<Col span={16}>
<Form.Item label="公告内容" name="AnnouncementContent" labelCol={{ span: 6 }}>
<TextArea rows={3} placeholder="请输入公告内容" />
</Form.Item>
</Col>
)}
</Row>
{/* <Form.Item label="菜单样式" name="menuState">
<Switch
checkedChildren="展开"
......
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