Commit 7c6b021e authored by 皮倩雯's avatar 皮倩雯

fix: '巡检反馈'

parent e3b0069b
Pipeline #56006 passed with stages
...@@ -12,11 +12,17 @@ import { ...@@ -12,11 +12,17 @@ import {
Select, Select,
Button, Button,
Dropdown, Dropdown,
Tooltip,
Menu, Menu,
Space, Space,
Radio, Radio,
} from 'antd'; } from 'antd';
import { PlusOutlined, DownOutlined, StepForwardFilled } from '@ant-design/icons'; import {
PlusOutlined,
DownOutlined,
StepForwardFilled,
InfoCircleOutlined,
} from '@ant-design/icons';
import styles from './maintenance.less'; import styles from './maintenance.less';
import { import {
CM_XWBPlan_AccountTable, CM_XWBPlan_AccountTable,
...@@ -102,10 +108,8 @@ const AddModal = props => { ...@@ -102,10 +108,8 @@ const AddModal = props => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
obj.feedbackName = inputValue.feedbackName; // obj.feedbackName = inputValue.feedbackName;
obj.doRole = inputValue.doRole; // obj.doRole = inputValue.doRole;
console.log(obj.doRole);
console.log(obj);
if (type == 'add') { if (type == 'add') {
CM_XWBPlan_DataEditORAdd(obj).then(res => { CM_XWBPlan_DataEditORAdd(obj).then(res => {
if (res.msg == '') { if (res.msg == '') {
...@@ -136,7 +140,7 @@ const AddModal = props => { ...@@ -136,7 +140,7 @@ const AddModal = props => {
notification.success({ notification.success({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: '添加成功', description: '编辑成功',
}); });
} else { } else {
notification.error({ notification.error({
...@@ -295,7 +299,7 @@ const AddModal = props => { ...@@ -295,7 +299,7 @@ const AddModal = props => {
title="巡维保计划配置" title="巡维保计划配置"
visible={visible} visible={visible}
destroyOnClose destroyOnClose
width="650px" width="600px"
{...props} {...props}
footer={ footer={
<Space> <Space>
...@@ -307,11 +311,11 @@ const AddModal = props => { ...@@ -307,11 +311,11 @@ const AddModal = props => {
> >
<Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}> <Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}>
<Row> <Row>
<Col span={23}> <Col span={24}>
<Item <Item
label="业务名称" label="业务名称"
name="businessName" name="businessName"
labelCol={{ span: 4 }} labelCol={{ span: 5 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -337,11 +341,11 @@ const AddModal = props => { ...@@ -337,11 +341,11 @@ const AddModal = props => {
<Input placeholder="业务名称不可重复" /> <Input placeholder="业务名称不可重复" />
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={24}>
<Item <Item
label="业务类型" label="业务类型"
name="businessType" name="businessType"
labelCol={{ span: 4 }} labelCol={{ span: 5 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -363,8 +367,8 @@ const AddModal = props => { ...@@ -363,8 +367,8 @@ const AddModal = props => {
</Select> </Select>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={24}>
<Item label="执行周期" name="docycle" labelCol={{ span: 4 }}> <Item label="执行周期" name="docycle" labelCol={{ span: 5 }}>
<Select placeholder="选择计划执行周期"> <Select placeholder="选择计划执行周期">
<Option value="一周一次">一周一次</Option> <Option value="一周一次">一周一次</Option>
<Option value="半月一次">半月一次</Option> <Option value="半月一次">半月一次</Option>
...@@ -375,11 +379,11 @@ const AddModal = props => { ...@@ -375,11 +379,11 @@ const AddModal = props => {
</Select> </Select>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={24}>
<Item <Item
label="台账名称" label="维保设备"
name="accountName" name="accountName"
labelCol={{ span: 4 }} labelCol={{ span: 5 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -388,7 +392,7 @@ const AddModal = props => { ...@@ -388,7 +392,7 @@ const AddModal = props => {
{ {
validator: (rule, value) => { validator: (rule, value) => {
if (form.getFieldsValue().accountName == '') { if (form.getFieldsValue().accountName == '') {
return Promise.reject('台账名称必选'); return Promise.reject('维保设备必选');
} }
return Promise.resolve(); return Promise.resolve();
}, },
...@@ -406,11 +410,11 @@ const AddModal = props => { ...@@ -406,11 +410,11 @@ const AddModal = props => {
</Select> </Select>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={24}>
<Item <Item
label="反馈名称" label="反馈名称"
name="feedbackName" name="feedbackName"
labelCol={{ span: 4 }} labelCol={{ span: 5 }}
rules={[ rules={[
{ {
validator: (rule, value) => { validator: (rule, value) => {
...@@ -439,11 +443,11 @@ const AddModal = props => { ...@@ -439,11 +443,11 @@ const AddModal = props => {
</div> </div>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={24}>
<Item <Item
label="执行角色" label="执行角色"
name="doRole" name="doRole"
labelCol={{ span: 4 }} labelCol={{ span: 5 }}
rules={[ rules={[
{ {
validator: (rule, value) => { validator: (rule, value) => {
...@@ -472,9 +476,23 @@ const AddModal = props => { ...@@ -472,9 +476,23 @@ const AddModal = props => {
</div> </div>
</Item> </Item>
</Col> </Col>
<Col span={13}> <Col span={12}>
<Item <Item
label="预生成天数" label={
<div>
<Tooltip title="任务提前生成天数,仅适用于接口定时执行">
<InfoCircleOutlined
style={{
color: '#1890ff',
marginRight: '2px',
}}
/>
</Tooltip>
<span>预生成天数</span>
</div>
}
labelCol={{ span: 10 }}
name="produceDays" name="produceDays"
rules={[ rules={[
{ {
...@@ -486,7 +504,7 @@ const AddModal = props => { ...@@ -486,7 +504,7 @@ const AddModal = props => {
<Input placeholder="请输入预生成天数" /> <Input placeholder="请输入预生成天数" />
</Item> </Item>
</Col> </Col>
<Col span={10}> <Col span={12}>
<Item <Item
label="在线任务量" label="在线任务量"
name="onLines" name="onLines"
...@@ -501,16 +519,16 @@ const AddModal = props => { ...@@ -501,16 +519,16 @@ const AddModal = props => {
<Input placeholder="请输入在线任务量" /> <Input placeholder="请输入在线任务量" />
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={24}>
<Item label="是否送审" name="isSubmit" labelCol={{ span: 4 }}> <Item label="是否送审" name="isSubmit" labelCol={{ span: 5 }}>
<Radio.Group defaultValue={chee}> <Radio.Group defaultValue={chee}>
<Radio value="否"></Radio> <Radio value="否"></Radio>
<Radio value="是"></Radio> <Radio value="是"></Radio>
</Radio.Group> </Radio.Group>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={24}>
<Item label="SQL过滤" name="filterCondition" labelCol={{ span: 4 }}> <Item label="SQL过滤" name="filterCondition" labelCol={{ span: 5 }}>
<TextArea placeholder="例如:and 泵房品牌='熊猫'" /> <TextArea placeholder="例如:and 泵房品牌='熊猫'" />
</Item> </Item>
</Col> </Col>
......
...@@ -100,6 +100,7 @@ const maintenance = () => { ...@@ -100,6 +100,7 @@ const maintenance = () => {
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 200,
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
...@@ -148,6 +149,7 @@ const maintenance = () => { ...@@ -148,6 +149,7 @@ const maintenance = () => {
align: 'center', align: 'center',
onCell: () => ({ onCell: () => ({
style: { style: {
maxWidth: 200,
overflow: 'hidden', overflow: 'hidden',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
...@@ -198,13 +200,13 @@ const maintenance = () => { ...@@ -198,13 +200,13 @@ const maintenance = () => {
</Tooltip> </Tooltip>
), ),
}, },
{ // {
title: '启停', // title: '启停',
dataIndex: 'doNot', // dataIndex: 'doNot',
key: 'doNot', // key: 'doNot',
width: 80, // width: 80,
align: 'center', // align: 'center',
}, // },
{ {
title: '操作', title: '操作',
ellipsis: true, ellipsis: true,
...@@ -324,7 +326,6 @@ const maintenance = () => { ...@@ -324,7 +326,6 @@ const maintenance = () => {
<Button <Button
icon={<OrderedListOutlined className={styles.icon} />} icon={<OrderedListOutlined className={styles.icon} />}
onClick={sort} onClick={sort}
type="primary"
style={{ style={{
marginLeft: '30px', marginLeft: '30px',
verticalAlign: 'middle', verticalAlign: 'middle',
......
/* eslint-disable no-else-return */
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
/* eslint-disable indent */
/* eslint-disable camelcase */
/* eslint-disable no-unused-expressions */
import React, { useState, useEffect } from 'react';
import {
Drawer,
Form,
Input,
notification,
Row,
Col,
Select,
Button,
Dropdown,
Menu,
Space,
Radio,
Tooltip,
} from 'antd';
import {
PlusOutlined,
DownOutlined,
StepForwardFilled,
InfoCircleOutlined,
} from '@ant-design/icons';
import styles from './patrolFeedback.less';
import {
CM_Feedback_LoadFeedbackTables,
CM_Feedback_LoadFeedbackEvent,
CM_Feedback_OperatePatrolFeedback,
CM_Feedback_LoadFields,
CM_Feedback_QueryPatrolFeedback,
} from '@/services/PatrolFeedback/api';
import { CM_Event_LoadDepartmentAndRoles } from '@/services/standingBook/api';
import ChangeRoles from './ChangeRoles';
import ChangeFields from './ChangeFields';
const { Option } = Select;
const AddModal = props => {
const [inputValue, setInputValue] = useState({
feedbackName: '',
doRole: '',
});
const { callBackSubmit = () => {}, visible, type, formObj, keepTableData } = props;
const [filed, setFiled] = useState({}); // 传给子组件列表数据
const [filed1, setFiled1] = useState({}); // 传给子组件列表数据
const [pickItem, setPickItem] = useState(''); // 复选框数据填入项
const [checkedList1, setCheckedList1] = useState([]); // 最新选择数据
const [feedbackTable, setFeedbackTable] = useState([]);
const [feedbackEvent, setFeedbackEvent] = useState([]);
const [isVisibleFields, setIsVisibleFields] = useState(false);
const [isVisibleRoles, setIsVisibleRoles] = useState(false);
const [nu, setNu] = useState([]);
const [nu1, setNu1] = useState([]);
const [form] = Form.useForm();
const { Item } = Form;
useEffect(() => {
if (visible) {
getFeedbackTable();
getRoles();
if (type === 'edit') {
CM_Feedback_QueryPatrolFeedback({ id: formObj.id }).then(res => {
console.log(res.data);
form.setFieldsValue({ ...res.data });
});
}
} else {
form.resetFields();
}
}, [visible]);
const getFeedbackTable = () => {
CM_Feedback_LoadFeedbackTables().then(res => {
if (res.code === 0) {
console.log(res.data);
setFeedbackTable(res.data);
}
});
CM_Feedback_LoadFeedbackEvent().then(res => {
if (res.code === 0) {
setFeedbackEvent(res.data);
if (type == 'add') {
form.setFieldsValue({ eventName: res.data[0].Name });
}
}
});
};
const getFields = e => {
console.log(e);
CM_Feedback_LoadFields(e).then(res => {
if (res.code === 0) {
setNu(res.data);
setFiled(formateArrDataA(res.data, 'groupName'));
}
});
};
const getRoles = () => {
CM_Event_LoadDepartmentAndRoles().then(res => {
if (res.code === 0) {
setNu1(res.data);
setFiled1(formateArrDataA1(res.data, 'groupType'));
}
});
};
const onSubmit = () => {
form.validateFields().then(validate => {
if (validate) {
let obj = form.getFieldsValue();
CM_Feedback_OperatePatrolFeedback({
...obj,
id: formObj.id,
}).then(res => {
if (res.msg == '') {
form.resetFields();
callBackSubmit();
notification.success({
message: '提示',
duration: 3,
description: type == 'add' ? '添加成功' : '编辑成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
}
});
};
const pickFiled = fileds => {
if (form.getFieldsValue().tableName) {
let pp = formateArrDataA(nu, 'groupName');
if (form.getFieldValue(fileds)) {
let ab = form.getFieldValue(fileds).split(',');
let arr = Object.keys(pp);
let b = [];
let a = [];
arr.map((item, index) => {
pp[item].map((i, j) => {
b.push(i);
});
});
ab.map((item, index) => {
if (b.includes(item) == false) {
if (item == '') {
a = [];
} else {
a.push(item);
}
}
});
if (a.length > 0) {
pp.外部字段 = a;
arr.push('外部字段');
}
setFiled(pp);
setCheckedList1(form.getFieldValue(fileds).split(','));
setPickItem(fileds);
setIsVisibleFields(true);
} else {
setFiled(pp);
setCheckedList1([]);
setPickItem(fileds);
setIsVisibleFields(true);
}
} else {
notification.warning({
message: '提示',
duration: 3,
description: '请先选择反馈名称',
});
}
};
const pickFiled1 = fileds => {
if (form.getFieldValue(fileds)) {
setCheckedList1(form.getFieldValue(fileds).split(','));
setPickItem(fileds);
setIsVisibleRoles(true);
} else {
setCheckedList1([]);
setPickItem(fileds);
setIsVisibleRoles(true);
}
};
const onChangeTableName = e => {
getFields(e);
};
const formateArrDataA = (initialArr, name) => {
console.log(initialArr);
console.log(name);
// 判定传参是否符合规则
if (!(initialArr instanceof Array)) {
return '请传入正确格式的数组';
}
if (!name) {
return '请传入对象属性';
}
// 先获取一下这个数组中有多少个"name"
let nameArr = [];
for (let i in initialArr) {
if (nameArr.indexOf(initialArr[i][`${name}`]) === -1) {
nameArr.push(initialArr[i][`${name}`]);
}
}
console.log(nameArr);
// 新建一个包含多个list的结果对象
let tempObj = {};
// 根据不同的"name"生成多个数组
for (let k in nameArr) {
for (let j in initialArr) {
if (initialArr[j][`${name}`] == nameArr[k]) {
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
console.log(tempObj[nameArr[k]]);
tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
console.log(initialArr[j]);
tempObj[nameArr[k]].push(initialArr[j]);
}
}
}
console.log(tempObj);
for (let keys in tempObj) {
let arr = [];
tempObj[keys].map((item, index) => {
console.log(tempObj[keys]);
tempObj[keys] = arr;
item.key = index;
arr.push(item);
});
console.log(arr);
}
Object.keys(tempObj).map((i, j) => {
console.log(tempObj[i]);
tempObj[i].map((k, y) => {
tempObj[i][y] = k.fieldName;
console.log(k);
});
});
console.log(tempObj);
return tempObj;
};
const formateArrDataA1 = (initialArr, name) => {
let aa = [];
let a1 = [];
let a2;
let a3 = [];
initialArr.data.map(i => {
// console.log(i.groupType)
a2 = i.groupType;
// console.log(a2)
// console.log(i.root)
a1 = i.root;
a1.map(j => {
j.group = a2;
// console.log(j)
});
aa.push(i.root);
});
// console.log(aa)
aa.map(p => {
// console.log(p)
p.map(o => {
// console.log(o)
a3.push(o);
});
});
console.log(a3);
// 判定传参是否符合规则
if (!(a3 instanceof Array)) {
return '请传入正确格式的数组';
}
if (!name) {
return '请传入对象属性';
}
// 先获取一下这个数组中有多少个"name"
let nameArr = [];
a3.map(i => {
if (nameArr.indexOf(i.group) === -1) {
nameArr.push(i.group);
}
});
console.log(nameArr);
// 新建一个包含多个list的结果对象
let tempObj = {};
// 根据不同的"name"生成多个数组
for (let k in nameArr) {
for (let j in a3) {
if (a3[j].group == nameArr[k]) {
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
tempObj[nameArr[k]].push(a3[j]);
}
}
}
for (let key in tempObj) {
let arr = [];
tempObj[key].map(item => {
tempObj[key] = arr;
arr.push(item.Name);
});
}
console.log(tempObj);
return tempObj;
};
const onOK = prop => {
setIsVisibleRoles(false);
let inputText = {};
inputText[prop.pickItem] = prop.str;
setCheckedList1(prop.stt);
form.setFieldsValue(inputText);
};
const onOK1 = prop => {
setIsVisibleFields(false);
let inputText = {};
inputText[prop.pickItem] = prop.str;
setCheckedList1(prop.stt);
form.setFieldsValue(inputText);
};
return (
<Drawer
title="反馈配置"
visible={visible}
destroyOnClose
width="550px"
{...props}
footer={
<Space>
<Button onClick={onSubmit} type="primary">
确定
</Button>
</Space>
}
>
<Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}>
<Row>
<Col span={23}>
<Item
label="巡检对象"
name="layerName"
labelCol={{ span: 4 }}
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldValue().layerName;
if (type === 'add' && keepTableData.indexOf(aa) != -1) {
return Promise.reject('巡检对象已存在');
} else if (
type === 'edit' &&
keepTableData.indexOf(aa) != -1 &&
aa != formObj.layerName
) {
return Promise.reject('巡检对象已存在');
}
return Promise.resolve();
},
},
]}
>
<Input placeholder="巡检对象名称不可重复" />
</Item>
</Col>
<Col span={23}>
<Item label="GIS图层" name="gisLayer" labelCol={{ span: 4 }}>
<Input placeholder="请输入GIS图层" />
</Item>
</Col>
<Col span={23}>
<Item label="GIS条件" name="gisFilterValue" labelCol={{ span: 4 }}>
<Input placeholder="请输入GIS条件" />
</Item>
</Col>
<Col span={23}>
<Item label="反馈表" name="tableName" labelCol={{ span: 4 }}>
<Select placeholder="选择反馈表" onChange={onChangeTableName} showSearch>
{feedbackTable
? feedbackTable.map((item, index) => (
<Option key={index} value={item.text}>
{item.text}
</Option>
))
: ''}
</Select>
</Item>
</Col>
<Col span={23}>
<Item label="字段集" name="fields" labelCol={{ span: 4 }}>
<div style={{ display: 'flex' }}>
<Item name="fields" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请选择字段集" allowClear />
</Item>
<Button
type="dashed"
onClick={() => pickFiled('fields')}
icon={<PlusOutlined style={{ marginTop: '5px' }} />}
style={{ marginLeft: '10px', width: '70px' }}
/>
</div>
</Item>
</Col>
{/* <Col span={23}>
<Item label="异常值" name="exceptionValue" labelCol={{ span: 4 }}>
<Input placeholder="请输入异常值" />
</Item>
</Col> */}
{/* <Col span={23}>
<Item label="触发事件" name="eventName" labelCol={{ span: 4 }}>
<Select placeholder="选择触发事件" showSearch>
{feedbackEvent
? feedbackEvent.map((item, index) => (
<Option key={index} value={item.Name}>
{item.Name}
</Option>
))
: ''}
</Select>
</Item>
</Col> */}
<Col span={23}>
<Item label="权限" name="roles" labelCol={{ span: 4 }}>
<div style={{ display: 'flex' }}>
<Item name="roles" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请选择字段集" allowClear />
</Item>
<Button
type="dashed"
onClick={() => pickFiled1('roles')}
icon={<PlusOutlined style={{ marginTop: '5px' }} />}
style={{ marginLeft: '10px', width: '70px' }}
/>
</div>
</Item>
</Col>
{/* <Col span={23}>
<Item label="分组" name="groupType" labelCol={{ span: 4 }}>
<Input placeholder="请输入分组" />
</Item>
</Col> */}
</Row>
</Form>
<ChangeFields
visible={isVisibleFields}
callBackSubmit={onOK1}
onCancel={() => setIsVisibleFields(false)}
newCheckedList={checkedList1}
filed={filed}
pickItem={pickItem}
formObj={formObj}
/>
<ChangeRoles
visible={isVisibleRoles}
onCancel={() => setIsVisibleRoles(false)}
callBackSubmit={onOK}
newCheckedList={checkedList1}
filed11={filed1}
pickItem={pickItem}
/>
</Drawer>
);
};
export default AddModal;
/* eslint-disable no-undef */
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
/* eslint-disable camelcase */
/* eslint-disable react/jsx-no-undef */
/* eslint-disable valid-typeof */
/* eslint-disable no-unused-vars */
/* eslint-disable consistent-return */
/* eslint-disable no-shadow */
/* eslint-disable indent */
/* eslint-disable no-unused-expressions */
/* eslint-disable array-callback-return */
/* eslint-disable eqeqeq */
/* eslint-disable no-plusplus */
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Form, Modal, Divider, Checkbox, Tabs } from 'antd';
import DragTable from '@/components/DragTable/DragTable';
import styles from '../../workOrder/incident/incident.less';
const CheckboxGroup = Checkbox.Group;
const ChangeFields = props => {
const { callBackSubmit = () => {}, pickItem, visible, filed, newCheckedList, flag } = props;
const [loading, setLoading] = useState(false);
const [value, setValue] = useState('');
const [checkValue, setCheckValue] = useState([]);
const [form] = Form.useForm();
const [title, setTitle] = useState([]);
const { Item } = Form;
const [checkedList, setCheckedList] = useState([]); // 选中复选框内容
const [indeterminate, setIndeterminate] = useState([]);
const [checkAll, setCheckAll] = useState([]);
const [selectData, setSelectData] = useState([]);
const [arrValue, setArrValue] = useState([]);
const [data, setData] = useState(0);
const [flagg, setFlagg] = useState(0);
const [type, setType] = useState(); // 是否全选
let objArr = [];
const onChangeList = (list, index, title) => {
const checkedListArr = [...checkedList];
checkedListArr[index] = list;
// 将第一次打开回显数据先存成数组
let oldArr = [];
let addArr = [];
let newArr = [];
// if (flagg == 0) {
arrValue.map((item, index) => {
oldArr = oldArr.concat(item);
});
console.log(oldArr);
// 将第一次打开回显数据存入已选择数组里
oldArr.map(item => {
newArr.push(item);
});
console.log(newArr);
// 获取本次新增数据后的数组
let objArr = [];
checkedListArr.map(item => {
objArr = objArr.concat(item);
});
console.log(checkedListArr);
console.log(objArr); // 本次增加数据后数组
console.log(arrValue); // 上次数组
// 获取新增数据
objArr.map((item1, index1) => {
if (arrValue.indexOf(item1) == -1) {
addArr.push(item1);
}
});
// 将每次新增数据从尾部写入已选择数组里
if (addArr.length != 0) {
addArr.map(item => {
newArr.push(item);
});
}
// 保存此次所有数据顺序
setArrValue(newArr);
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);
setFlagg(0);
};
const onSubmit1 = () => {
let aRR = [];
selectData.map(item => {
if (typeof item == 'string') {
aRR = selectData;
} else {
aRR.push(item.name);
}
});
let newArr = selectData.map(item => item.name);
console.log(newArr);
console.log(filed.外部字段);
let valueArr = [];
if (filed.外部字段) {
newArr.forEach(item => {
if (filed.外部字段.indexOf(item) != -1) {
valueArr.push(item);
}
});
}
callBackSubmit({
valueArr,
checkedList,
str: aRR.join(','),
pickItem,
stt: aRR,
title,
});
};
const onCheckAllChange1 = e => {
setData(1);
const indeterminateArr = [...indeterminate];
const checkAllArr = [...checkAll];
const checkedListArr = [...checkedList];
checkAllArr[e.target.index] = e.target.checked;
indeterminateArr[e.target.index] = false;
e.target.checked
? (checkedListArr[e.target.index] = e.target.checkvalue)
: (checkedListArr[e.target.index] = []);
setType(e.target.checked);
setCheckedList(checkedListArr);
setIndeterminate(indeterminateArr);
setCheckAll(checkAllArr);
};
useEffect(() => {
selectAll();
// console.log(flagg);
// // 不是第一次
// if (flagg == 0) {
// console.log(12121);
// selectAll();
// }
// // 是否是全选
// if (data == 1) {
// selectAll();
// }
setData(0);
}, [checkedList]);
const selectAll = () => {
objArr = [];
let lastArr = [];
// 处理未排序的勾选数据扁平化
checkedList.map(item => {
objArr = objArr.concat(item);
});
// 判断是否操作全部勾选的复选框
if (data == 1) {
// 处理上次选中改变顺序后的数据扁平化
let newArr = [];
arrValue.map(item => {
if (item.name == undefined) {
newArr = arrValue;
} else {
newArr = arrValue.map(item => item.name);
}
});
// 判断是否为全选
if (type == false) {
// 判断上次有顺序的数据是否包含这次未排序已选列表数据
newArr.map(item => {
if (objArr.indexOf(item) != -1) {
lastArr.push(item);
}
});
let newArr1 = lastArr.map(item => ({ name: item }));
if (newArr1.length === 1 && newArr1[0].name === '') {
newArr1 = [];
}
setSelectData(newArr1);
setArrValue(lastArr);
} else {
// 全选状态时
let addArr = [];
objArr.map(item => {
if (newArr.indexOf(item) == -1) {
addArr.push(item);
}
});
addArr.map(item => {
newArr.push(item);
});
let newArr1 = newArr.map(item => ({ name: item }));
if (newArr1.length === 1 && newArr1[0].name === '') {
newArr1 = [];
}
setSelectData(newArr1);
setArrValue(newArr);
}
} else {
// 判断扁平处理后的选中未排序列表数据是否存在于上次已选数组中
arrValue.map(item => {
if (objArr.indexOf(item) != -1) {
lastArr.push(item);
}
});
let newArr1 = lastArr.map(item => ({ name: item }));
if (newArr1.length === 1 && newArr1[0].name === '') {
newArr1 = [];
}
setSelectData(newArr1);
setArrValue(lastArr);
}
};
useEffect(() => {
console.log(filed);
console.log(newCheckedList);
if (visible) {
setFlagg(1);
let arr = Object.keys(filed);
console.log(arr, 'arr');
setTitle(arr);
let checkArr = [];
let indeterminateArr = [];
let checkAllArr = [];
arr.map((item, index) => {
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(checkArr);
setIndeterminate(indeterminateArr);
setCheckAll(checkAllArr);
let newArr1 = newCheckedList.map(item => ({ name: item }));
if (newArr1.length === 1 && newArr1[0].name === '') {
newArr1 = [];
}
setSelectData(newArr1);
setArrValue(newArr1);
}
}, [visible]);
const dragCallBack = arr => {
if (arr) {
setSelectData(arr);
let newArr = [];
arr.map(item => {
newArr.push(item.name);
});
setArrValue(newArr);
}
};
const columns = [
{
title: '已选列表',
dataIndex: 'name',
width: 150,
key: 'name',
},
];
return (
<Modal
title="字段集选择"
bodyStyle={{ width: '100%', minHeight: '100px' }}
width="750px"
destroyOnClose
centered
cancelText="取消"
okText="确认"
{...props}
onOk={() => onSubmit1()}
forceRender
getContainer={false}
>
{visible && (
<div className={styles.listCard}>
<div className={styles.cardItem} style={{ borderRight: '1px solid #99bbe8' }}>
{flag === 0 ? (
<>
<div className={styles.cardContent}>
<span
style={{
color: 'red',
fontSize: '1rem',
marginLeft: '25px',
}}
>
请先选择事件主表
</span>
</div>
</>
) : (
<>
{JSON.stringify(filed) == '{}' ? (
<>
<div className={styles.cardContent}>
<span
style={{
color: 'red',
fontSize: '1rem',
marginLeft: '25px',
}}
>
表字段缺失请先配置表/字段
</span>
</div>
</>
) : (
<>
<div className={styles.cardContent}>
{title.map((item, index) => (
<div className={styles.cardItemData} key={index}>
<Divider
orientation="left"
style={{
margin: '0 0 10px 0',
color: '#15428b',
borderTopColor: '#99bbe8',
}}
>
<Checkbox
indeterminate={indeterminate[index]}
onChange={onCheckAllChange1}
index={index}
checkvalue={filed[item]}
checked={checkAll[index]}
style={{ marginRight: '7px' }}
/>
{item}
</Divider>
<CheckboxGroup
options={filed[item]}
value={checkedList[index]}
onChange={e => onChangeList(e, index, item)}
/>
</div>
))}
</div>
</>
)}
</>
)}
</div>
<div className={styles.cardItem}>
<div className={styles.cardContent}>
<div className={styles.doctorTable}>
<DragTable
bordered
style={{ marginBottom: '10px' }}
rowKey={record => record.name}
columns={columns}
dataSource={selectData}
pagination={false}
size="small"
dragCallBack={dragCallBack}
ItemTypes="stadingOrder"
/>
</div>
</div>
</div>
</div>
)}
</Modal>
);
};
export default ChangeFields;
/* eslint-disable no-cond-assign */
/* eslint-disable react/no-array-index-key */
/* eslint-disable no-undef */
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
/* eslint-disable camelcase */
/* eslint-disable react/jsx-no-undef */
/* eslint-disable valid-typeof */
/* eslint-disable no-unused-vars */
/* eslint-disable consistent-return */
/* eslint-disable no-shadow */
/* eslint-disable indent */
/* eslint-disable no-unused-expressions */
/* eslint-disable array-callback-return */
/* eslint-disable eqeqeq */
/* eslint-disable no-plusplus */
import React, { useState, useEffect } from 'react';
import { Modal, Checkbox, Tabs, Input, Button, Pagination, Empty } from 'antd';
import { CM_Event_LoadDepartmentAndRoles } from '@/services/standingBook/api';
import styles from '../../workOrder/incident/incident.less';
const CheckboxGroup = Checkbox.Group;
const { TabPane } = Tabs;
const ChangeRoles = props => {
const { callBackSubmit = () => {}, pickItem, visible, filed11, newCheckedList } = props;
const [title, setTitle] = useState([]);
const [checkedList, setCheckedList] = useState([]); // 选中复选框内容
const [searchWord, setSearchWord] = useState(''); // 关键字
const { Search } = Input;
const [total, setTotal] = useState();
const [pageSize, setPageSize] = useState(40);
const [currentPage, setCurrentPage] = useState(1);
const [roleValue, setRoleValue] = useState([]);
const [checkDataRole, setCheckDataRole] = useState([]);
const [checkDataPm, setCheckDataPm] = useState([]);
const [checkDataSite, setCheckDataSite] = useState([]);
const [filed1, setFiled1] = useState([]); // 角色全部数据
const [saveCheckValue, setSaveCheckValue] = useState([]); // 保存选中值
const [keepOption1, setKeepOption1] = useState([]); // 保存了首次获取的部门列表数据
const [keepOption2, setKeepOption2] = useState([]); // 保存了首次获取的站点列表数据
const [keepTabKey, setKeepTabKey] = useState(0); // 保存tabs的key
const [list, setList] = useState([]);
const [listPm, setListPm] = useState([]);
const [listSite, setListSite] = useState([]);
const [keyValue, setKeyValue] = useState('0');
const [emptyValue, setEmptyValue] = useState(0);
const onSubmit = () => {
// 没有勾选部门下的选项
if (saveCheckValue[1] == undefined) {
let data = [];
newCheckedList.map(checkItem => {
if (keepOption1.includes(checkItem)) {
data.push(checkItem);
}
});
saveCheckValue[1] = data;
}
// 没有勾选站点下的选项
if (saveCheckValue[2] == undefined) {
let data = [];
newCheckedList.map(checkItem => {
if (keepOption2.includes(checkItem)) {
data.push(checkItem);
}
});
saveCheckValue[2] = data;
}
let data = [];
saveCheckValue.map((item, index) => {
data = data.concat(item);
});
callBackSubmit({
saveCheckValue,
str: data.join(','),
pickItem,
stt: data,
title,
filed22: filed1,
});
setKeyValue('0');
setSearchWord('');
};
useEffect(() => {
setKeepOption1(filed11['部门']);
setKeepOption2(filed11['站点']);
getRoles('角色', '', pageSize, 1);
setRoleValue(filed1);
let arr = Object.keys(filed1);
setTitle(arr);
let checkArr = [];
let listdata = [];
newCheckedList.map(checkItem => {
if (filed11['角色'].includes(checkItem)) {
listdata.push(checkItem);
}
});
setCheckDataRole(listdata); // 用于设置首次展示已选列表角色数据
checkArr[0] = listdata;
setSaveCheckValue(checkArr);
setCheckedList(checkArr);
let pmdata = [];
newCheckedList.map(checkItem => {
if (filed11['部门'].includes(checkItem)) {
pmdata.push(checkItem);
}
});
setCheckDataPm(pmdata);
let sitedata = [];
newCheckedList.map(checkItem => {
if (filed11['站点'].includes(checkItem)) {
sitedata.push(checkItem);
}
});
setCheckDataSite(sitedata);
}, [visible]);
const submitSearchUser = () => {
if (keepTabKey == 0) {
sreachRoles('角色', searchWord, pageSize, 1);
}
if (keepTabKey == 1) {
sreachRoles('部门', searchWord, pageSize, 1);
}
if (keepTabKey == 2) {
sreachRoles('站点', searchWord, pageSize, 1);
}
};
// 获取搜索框的值
const handleSearch = e => {
setSearchWord(e.target.value);
};
// 监听分页
const paginationChange = (page, pageSizes) => {
if (keepTabKey == 0) {
getRoles('角色', searchWord, pageSizes, page);
}
if (keepTabKey == 1) {
getRoles('部门', searchWord, pageSizes, page);
}
if (keepTabKey == 2) {
getRoles('站点', searchWord, pageSizes, page);
}
setCurrentPage(page);
setPageSize(pageSizes);
};
// 搜索时获取数据
const sreachRoles = (type, keywords, pageSizes, pageIndex) => {
CM_Event_LoadDepartmentAndRoles({
type,
keywords,
pageSize: pageSizes,
pageIndex,
}).then(res => {
if (res.msg === 'Ok') {
setRoleValue(formateArrDataA1(res.data, 'groupType'));
setFiled1(formateArrDataA1(res.data, 'groupType'));
setCurrentPage(1);
setTotal(res.data.count);
if (res.data.count == 0) {
setEmptyValue(1);
} else {
setEmptyValue(0);
}
}
});
};
// 重置
const onReset = () => {
// setListPm([]);
if (keepTabKey == 0) {
getRoles('角色', '', pageSize, 1);
}
if (keepTabKey == 1) {
getRoles('部门', '', pageSize, 1);
}
if (keepTabKey == 2) {
getRoles('站点', '', pageSize, 1);
}
setCurrentPage(1);
setSearchWord('');
};
const getRoles = (type, keywords, pageSizes, pageIndex) => {
CM_Event_LoadDepartmentAndRoles({
type,
keywords,
pageSize: pageSizes,
pageIndex,
}).then(res => {
if (res.msg === 'Ok') {
setTotal(res.data.count);
setRoleValue(formateArrDataA1(res.data, 'groupType'));
setFiled1(formateArrDataA1(res.data, 'groupType'));
if (res.data.count == 0) {
setEmptyValue(1);
} else {
setEmptyValue(0);
}
}
});
};
// 页面数据改变重新赋值
useEffect(() => {
let arr = Object.keys(filed1);
setTitle(arr);
let checkArr = [];
let data = [];
saveCheckValue.map((item, index) => {
data = data.concat(item);
});
arr.forEach(item => {
if (item == '角色') {
checkArr[0] = [];
checkDataRole.map(checkItem => {
if (filed1['角色'].includes(checkItem)) {
checkArr[0].push(checkItem);
}
});
setCheckedList(checkArr); // 按对象数组格式
} else if (item == '部门') {
checkArr[1] = [];
checkDataPm.map(checkItem => {
if (filed1['部门'].includes(checkItem)) {
checkArr[1].push(checkItem);
}
});
setCheckedList(checkArr);
} else if (item == '站点') {
checkArr[2] = [];
checkDataSite.map(checkItem => {
if (filed1['站点'].includes(checkItem)) {
checkArr[2].push(checkItem);
}
});
setCheckedList(checkArr);
}
});
}, [filed1]);
const formateArrDataA1 = (initialArr, name) => {
let aa = [];
let a1 = [];
let a2;
let a3 = [];
initialArr.data.map(i => {
a2 = i.groupType;
a1 = i.root;
a1.map(j => {
j.group = a2;
});
aa.push(i.root);
});
aa.map(p => {
p.map(o => {
a3.push(o);
});
});
// 判定传参是否符合规则
if (!(a3 instanceof Array)) {
return '请传入正确格式的数组';
}
if (!name) {
return '请传入对象属性';
}
// 先获取一下这个数组中有多少个"name"
let nameArr = [];
a3.map(i => {
if (nameArr.indexOf(i.group) === -1) {
nameArr.push(i.group);
}
});
// 新建一个包含多个list的结果对象
let tempObj = {};
// 根据不同的"name"生成多个数组
for (let k in nameArr) {
for (let j in a3) {
if (a3[j].group == nameArr[k]) {
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
tempObj[nameArr[k]].push(a3[j]);
}
}
}
for (let key in tempObj) {
let arr = [];
tempObj[key].map(item => {
tempObj[key] = arr;
arr.push(item.Name);
});
}
return tempObj;
};
useEffect(() => {
let checkedListArr = [...saveCheckValue];
let data = checkDataRole;
let DataValue = [];
// 拿到当前页数据
checkDataRole.forEach(item => {
if (roleValue['角色'].indexOf(item) != -1) {
DataValue.push(item);
}
});
// del
if (DataValue.length > list.length) {
DataValue.forEach(item => {
if (list.indexOf(item) == -1) {
data.splice(data.findIndex(ele => ele === item), 1);
}
});
} else {
// add
list.forEach(item => {
if (data.indexOf(item) == -1) {
data.push(item);
}
});
}
checkedListArr[0] = data;
setCheckDataRole(data);
setSaveCheckValue(checkedListArr);
setCheckedList(checkedListArr);
}, [list]);
useEffect(() => {
let checkedListArr = [...saveCheckValue];
let data = checkDataPm;
let DataValue = [];
// 拿到当前页数据
checkDataPm.forEach(item => {
if (roleValue['部门'].indexOf(item) != -1) {
DataValue.push(item);
}
});
// del
if (DataValue.length > listPm.length) {
DataValue.forEach(item => {
if (listPm.indexOf(item) == -1) {
data.splice(data.findIndex(ele => ele === item), 1);
}
});
} else {
// add
listPm.forEach(item => {
if (data.indexOf(item) == -1) {
data.push(item);
}
});
}
checkedListArr[1] = data;
setCheckDataPm(data);
setSaveCheckValue(checkedListArr);
setCheckedList(checkedListArr);
}, [listPm]);
useEffect(() => {
const checkedListArr = [...saveCheckValue];
let data = checkDataSite;
let DataValue = [];
// 拿到当前页数据
checkDataSite.forEach(item => {
if (roleValue['站点'].indexOf(item) != -1) {
DataValue.push(item);
}
});
// del
if (DataValue.length > listSite.length) {
DataValue.forEach(item => {
if (listSite.indexOf(item) == -1) {
data.splice(data.findIndex(ele => ele === item), 1);
}
});
} else {
// add
listSite.forEach(item => {
if (data.indexOf(item) == -1) {
data.push(item);
}
});
}
checkedListArr[2] = data;
setCheckDataSite(data);
setSaveCheckValue(checkedListArr);
setCheckedList(checkedListArr);
}, [listSite]);
const handleParChange = key => {
setKeyValue(key);
// setSearchWord('');
setCurrentPage(1);
setKeepTabKey(key);
let value;
if (key == 0) {
value = '角色';
getRoles('角色', searchWord, pageSize, 1);
}
if (key == 1) {
value = '部门';
getRoles('部门', searchWord, pageSize, 1);
}
if (key == 2) {
value = '站点';
getRoles('站点', searchWord, pageSize, 1);
}
};
const onChangeListNew = list => {
setList(list);
};
const onChangeListNew1 = list => {
setListPm(list);
};
const onChangeListNew2 = list => {
setListSite(list);
};
return (
<Modal
title="权限选择"
bodyStyle={{ width: '100%', height: '650px', overflowY: 'scorll' }}
width="1000px"
style={{ top: '10px' }}
destroyOnClose
centered
cancelText="取消"
okText="确认"
{...props}
onOk={() => onSubmit()}
forceRender
getContainer={false}
afterClose={() => {
setKeyValue('0');
setSearchWord('');
}}
>
<Search
style={{
width: 260,
marginRight: '20px',
marginBottom: '10px',
}}
placeholder="搜索"
onSearch={submitSearchUser}
onChange={e => handleSearch(e)}
enterButton
value={searchWord}
/>
<Button type="primary" htmlType="submit" onClick={onReset}>
重置
</Button>
{visible && (
<div className={styles.listCard1}>
<div className={styles.cardItem1}>
<div className={styles.cardContent1}>
<Tabs activeKey={keyValue} className={styles.tab} onChange={handleParChange}>
<TabPane tab="角色" key="0">
<div className={styles.cardItemData1}>
{emptyValue == 0 ? (
<CheckboxGroup
options={roleValue['角色']}
value={checkedList[0]}
onChange={onChangeListNew}
/>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
)}
</div>
</TabPane>
<TabPane tab="部门" key="1">
<div className={styles.cardItemData1}>
{emptyValue == 0 ? (
<CheckboxGroup
options={roleValue['部门']}
value={checkedList[1]}
onChange={onChangeListNew1}
/>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
)}
</div>
</TabPane>
<TabPane tab="站点" key="2">
<div className={styles.cardItemData1}>
{emptyValue == 0 ? (
<CheckboxGroup
options={roleValue['站点']}
value={checkedList[2]}
onChange={onChangeListNew2}
/>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无数据" />
)}
</div>
</TabPane>
</Tabs>
</div>
</div>
<div className={styles.cardItem11}>
<div className={styles.cardContent1}>
<Tabs className={styles.tab} activeKey={keyValue} onChange={handleParChange}>
<TabPane tab="角色" key="0">
{checkDataRole.map((item, index) => (
<div
key={index}
style={{
marginBottom: '5px',
}}
>
{item}
</div>
))}
</TabPane>
<TabPane tab="部门" key="1">
{checkDataPm.map((item, index) => (
<div
key={index}
style={{
marginBottom: '5px',
}}
>
{item}
</div>
))}
</TabPane>
<TabPane tab="站点" key="2">
{checkDataSite.map((item, index) => (
<div
key={index}
style={{
marginBottom: '5px',
}}
>
{item}
</div>
))}
</TabPane>
</Tabs>
</div>
</div>
</div>
)}
<div className={styles.foot}>
<Pagination
total={total}
showTotal={item => `共 ${item} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
pageSizeOptions={[10, 20, 40, 100]}
current={currentPage}
onChange={paginationChange}
style={{ marginBottom: '10px' }}
size="small"
showQuickJumper
/>
</div>
</Modal>
);
};
export default ChangeRoles;
/*
* @Description:
* @Author: leizhe
* @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-07-22 10:46:13
* @LastEditors: leizhe
*/
/* eslint-disable array-callback-return */
/* eslint-disable no-plusplus */
import React, { useState, useEffect } from 'react';
import { Modal, notification } from 'antd';
import { CM_Feedback_ChangPatrolOrder } from '@/services/PatrolFeedback/api';
import styles from './patrolFeedback.less';
import DragTable from '@/components/DragTable/DragTable';
const SortModal = props => {
const { callBackSubmit = () => {}, title, visible, onCancel, sortData } = props;
const [orderTable, setOrderTable] = useState([]);
const [flowIDs, setFlowIDs] = useState([]);
const onSumbit = () => {
console.log(flowIDs);
CM_Feedback_ChangPatrolOrder(flowIDs.toString()).then(res => {
if (res.code === 0) {
callBackSubmit();
onCancel();
notification.success({
message: '提示',
duration: 3,
description: '调整成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
// callBackSubmit({ str: flowIDs });
};
// 根据orderTable值改变flowIDs
useEffect(() => {
let ids = [];
orderTable.map(item => {
ids.push(item.id);
});
console.log(ids);
setFlowIDs(ids);
}, [orderTable]);
useEffect(() => {
console.log(sortData);
if (visible) {
setOrderTable(sortData);
}
}, [visible]);
// 拖拽回调函数
const dragCallBack = data => {
console.log(data);
if (data) {
setOrderTable(data);
}
};
const columns = [
{
title: '巡检对象',
dataIndex: 'layerName',
width: 150,
key: 'layerName',
},
];
return (
<Modal
title={title}
visible={visible}
onCancel={onCancel}
onOk={onSumbit}
okText="确认"
cancelText="取消"
>
<div
className={styles.cardContent}
style={{ width: '26rem', marginLeft: '24px', maxHeight: '400px', overflow: 'auto' }}
>
<div className={styles.doctorTable}>
<DragTable
bordered
style={{ marginBottom: '10px' }}
rowKey={record => record.id}
columns={columns}
dataSource={orderTable}
showHeader={false}
pagination={false}
size="small"
dragCallBack={dragCallBack}
ItemTypes="flowOrder"
/>
</div>
</div>
</Modal>
);
};
export default SortModal;
/* eslint-disable react-hooks/rules-of-hooks */
/* eslint-disable camelcase */
import React, { useState, useEffect } from 'react';
import { Space, Table, Popconfirm, Tooltip, Button, notification } from 'antd';
import {
CM_Feedback_LoadPatrolFeedbacks,
CM_Feedback_RemovePatrolFeedback,
} from '@/services/PatrolFeedback/api';
import { EditTwoTone, DeleteOutlined, PlusOutlined, OrderedListOutlined } from '@ant-design/icons';
import styles from './patrolFeedback.less';
import AddModal from './AddModal';
import SortModal from './SortModal';
import DragTable from '@/components/DragTable/DragTable';
const patrolFeedback = () => {
const [addVisible, setAddVisible] = useState(false);
const [type, setType] = useState('');
const [formObj, setFormObj] = useState('');
const [treeLoading, setTreeLoading] = useState(false);
const [flag, setFlag] = useState(0);
const [tableData, setTableData] = useState([]);
const [keepTableData, setKeepTableData] = useState([]);
const [sortVisible, setSortVisible] = useState(false);
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选用户数,机构改变时重置
const columns = [
{
title: '巡检对象',
dataIndex: 'layerName',
key: 'layerName',
align: 'center',
},
{
title: 'GIS图层',
dataIndex: 'gisLayer',
key: 'gisLayer',
align: 'center',
},
{
title: 'GIS条件',
dataIndex: 'gisFilterValue',
key: 'gisFilterValue',
align: 'center',
},
{
title: '反馈表',
dataIndex: 'tableName',
key: 'tableName',
width: 400,
onCell: () => ({
style: {
maxWidth: 400,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
align: 'center',
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
),
},
{
title: '字段集',
dataIndex: 'fields',
key: 'fields',
width: 100,
align: 'center',
},
// {
// title: '异常值',
// dataIndex: 'exceptionValue',
// key: 'exceptionValue',
// width: 150,
// align: 'center',
// },
// {
// title: '触发事件',
// dataIndex: 'eventName',
// key: 'eventName',
// width: 150,
// align: 'center',
// },
{
title: '权限',
dataIndex: 'roles',
key: 'roles',
align: 'center',
width: 100,
},
// {
// title: '分组',
// dataIndex: 'groupType',
// key: 'groupType',
// align: 'center',
// },
{
title: '操作',
ellipsis: true,
key: 'action',
align: 'center',
render: (text, record) => (
<Space>
<Tooltip title="修改">
<EditTwoTone onClick={() => editEventType(record)} style={{ fontSize: '16px' }} />
</Tooltip>
<Tooltip title="删除">
<Popconfirm
placement="bottomRight"
title={<p>是否确认删除?</p>}
okText="确认"
cancelText="取消"
onConfirm={() => deleteEventType(record)}
>
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
</Popconfirm>
</Tooltip>
</Space>
),
},
];
useEffect(() => {
setTreeLoading(true);
CM_Feedback_LoadPatrolFeedbacks({ pageIndex: 0, pageSize: 0 }).then(res => {
setTreeLoading(false);
if (res.code === 0) {
console.log(res.data.list);
setTableData(res.data.list);
let list = [];
res.data.list.map(i => {
list.push(i.layerName);
});
setKeepTableData(list);
}
});
}, [flag]);
const add = () => {
setAddVisible(true);
setType('add');
};
const editEventType = record => {
setAddVisible(true);
setType('edit');
setFormObj(record);
};
const deleteEventType = record => {
CM_Feedback_RemovePatrolFeedback(record.id).then(res => {
if (res.code === 0) {
notification.success({
message: '提示',
duration: 3,
description: '删除成功',
});
setFlag(flag + 1);
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
const onSubmit = () => {
setAddVisible(false);
setFlag(flag + 1);
};
const onOK = () => {
setFlag(flag + 1);
};
const sort = () => {
setSortVisible(true);
};
// 复选框
const rowSelection = {
selectedRowKeys,
onChange: (RowKeys, Rows) => {
setSelectedRowKeys(RowKeys);
},
};
const hasSelected = selectedRowKeys.length > 0;
const de = () => {
CM_Feedback_RemovePatrolFeedback(selectedRowKeys.toString()).then(res => {
if (res.code === 0) {
notification.success({
message: '提示',
duration: 3,
description: '批量删除成功',
});
setSelectedRowKeys([]);
setFlag(flag + 1);
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
const dragCallBack = value => {
if (value) {
console.log(value);
}
};
return (
<div className={styles.PatrolFeedbackContainer}>
<div className={styles.contentContainers}>
<div style={{ height: '50px', backgroundColor: 'white' }}>
<span style={{ float: 'right', marginRight: '10px' }}>
<Button
icon={<PlusOutlined className={styles.icon} />}
onClick={add}
type="primary"
style={{
marginLeft: '30px',
verticalAlign: 'middle',
marginTop: '10px',
}}
>
<span style={{ marginTop: '-3px' }}>新增</span>
</Button>
<Button
icon={<OrderedListOutlined className={styles.icon} />}
onClick={sort}
style={{
marginLeft: '30px',
verticalAlign: 'middle',
marginTop: '10px',
}}
>
<span style={{ marginTop: '-3px' }}>调序</span>
</Button>
<Button
icon={<DeleteOutlined className={styles.icon} />}
style={{
marginLeft: '30px',
verticalAlign: 'middle',
marginTop: '10px',
}}
onClick={de}
disabled={!hasSelected}
>
<span style={{ marginTop: '-3px' }}>批量删除</span>
</Button>
</span>
</div>
<Table
// rowClassName={setRowClassName}
rowSelection={{
type: 'checkbox',
...rowSelection,
}}
size="small"
rowKey={record => record.id}
bordered
loading={treeLoading}
onRow={record => ({
onDoubleClick: event => {
event.stopPropagation();
editEventType(record);
}, // 双击
})}
columns={columns}
dataSource={tableData}
scroll={{ y: 'calc(100vh - 205px)', x: 'max-content' }}
pagination={{
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`,
pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: 20,
showQuickJumper: true,
showSizeChanger: true,
}}
/>
{/* 添加事件 */}
<AddModal
visible={addVisible}
type={type}
onClose={() => setAddVisible(false)}
callBackSubmit={onSubmit}
formObj={formObj}
keepTableData={keepTableData}
placement="right"
/>
<SortModal
title="调整顺序"
visible={sortVisible}
sortData={tableData}
onCancel={() => setSortVisible(false)}
callBackSubmit={onOK}
/>
</div>
</div>
);
};
export default patrolFeedback;
.PatrolFeedbackContainer {
.ant-card-body {
padding: 12px 24px 24px 24px;
}
.pickItem {
background-color: #f5f6f9;
}
}
.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;
display: flex;
align-items: center;
justify-content: center;
}
}
}
.cardContent {
height: 30rem;
overflow-y: scroll;
overflow-x: scroll;
width: 100%;
}
.doctorTable {
margin-bottom: 16px;
}
.linkDrowp {
position: absolute;
top: 0px;
left: 93.5%;
width: 1rem;
height: 100%;
display: flex;
align-items: center;
}
.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;
}
.ant-select-arrow .anticon {
vertical-align: middle;
}
.listCard {
display: flex;
.cardItem {
padding: 0.5rem;
}
.cardContent {
height: 30rem;
overflow-y: scroll;
width: 100%;
}
.cardItemData {
display: inline-block;
padding: 0.5rem;
border: 1px solid #b5b8c8;
width: 100%;
min-height: 100px;
min-width: 333px;
// height: 30rem;
overflow-y: scroll;
}
}
.ant-modal-body {
padding: 10px 24px 0px 24px;
}
.ant-modal-footer {
padding: 10px 48px 10px 40px;
}
.ant-table-pagination.ant-pagination {
margin: 5px 0;
}
...@@ -716,6 +716,7 @@ const AddModal = props => { ...@@ -716,6 +716,7 @@ const AddModal = props => {
LoadEventFields({ eventTableName: value, distinctFields: '' }).then(res => { LoadEventFields({ eventTableName: value, distinctFields: '' }).then(res => {
if (res.data.root) { if (res.data.root) {
setNu(res.data.root); setNu(res.data.root);
console.log(res.data.root);
setFiled(formateArrDataA(res.data.root, 'group')); setFiled(formateArrDataA(res.data.root, 'group'));
ExternalSummaryField(res.data.root); ExternalSummaryField(res.data.root);
ExternalReportField(res.data.root); ExternalReportField(res.data.root);
...@@ -921,6 +922,8 @@ const AddModal = props => { ...@@ -921,6 +922,8 @@ const AddModal = props => {
}; };
const formateArrDataA = (initialArr, name) => { const formateArrDataA = (initialArr, name) => {
console.log(initialArr);
console.log(name);
// 判定传参是否符合规则 // 判定传参是否符合规则
if (!(initialArr instanceof Array)) { if (!(initialArr instanceof Array)) {
return '请传入正确格式的数组'; return '请传入正确格式的数组';
...@@ -945,6 +948,7 @@ const AddModal = props => { ...@@ -945,6 +948,7 @@ const AddModal = props => {
if (initialArr[j][`${name}`] == nameArr[k]) { if (initialArr[j][`${name}`] == nameArr[k]) {
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变 // 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj[nameArr[k]] = tempObj[nameArr[k]] || []; tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
console.log(initialArr[j]);
tempObj[nameArr[k]].push(initialArr[j]); tempObj[nameArr[k]].push(initialArr[j]);
} }
} }
...@@ -1104,7 +1108,6 @@ const AddModal = props => { ...@@ -1104,7 +1108,6 @@ const AddModal = props => {
const pickFiled = fileds => { const pickFiled = fileds => {
if (form.getFieldsValue().TableName) { if (form.getFieldsValue().TableName) {
setFlag(flag + 1); setFlag(flag + 1);
}
let pp = formateArrDataA(nu, 'group'); let pp = formateArrDataA(nu, 'group');
if (form.getFieldValue(fileds)) { if (form.getFieldValue(fileds)) {
let ab = form.getFieldValue(fileds).split(','); let ab = form.getFieldValue(fileds).split(',');
...@@ -1139,6 +1142,13 @@ const AddModal = props => { ...@@ -1139,6 +1142,13 @@ const AddModal = props => {
setPickItem(fileds); setPickItem(fileds);
setIsVisibleEdit(true); setIsVisibleEdit(true);
} }
} else {
notification.warning({
message: '提示',
duration: 3,
description: '请先选择事件主表',
});
}
}; };
const pickFiled1 = fileds => { const pickFiled1 = fileds => {
......
...@@ -185,7 +185,7 @@ const LoginLog = () => { ...@@ -185,7 +185,7 @@ const LoginLog = () => {
<Button onClick={() => setTime(24 * 7)}>近1周</Button> <Button onClick={() => setTime(24 * 7)}>近1周</Button>
<Button onClick={() => setTime(14 * 24)}>近2周</Button> <Button onClick={() => setTime(14 * 24)}>近2周</Button>
<Button onClick={() => setTime(30 * 24)}>近1月</Button> <Button onClick={() => setTime(30 * 24)}>近1月</Button>
<Button {/* <Button
icon={<SyncOutlined className={styles.icon} />} icon={<SyncOutlined className={styles.icon} />}
onClick={handleReset} onClick={handleReset}
style={{ style={{
...@@ -195,7 +195,7 @@ const LoginLog = () => { ...@@ -195,7 +195,7 @@ const LoginLog = () => {
}} }}
> >
重置 重置
</Button> </Button> */}
</Col> </Col>
</Row> </Row>
<Spin spinning={loading} tip="loading"> <Spin spinning={loading} tip="loading">
......
...@@ -288,7 +288,7 @@ const OmsLog = () => { ...@@ -288,7 +288,7 @@ const OmsLog = () => {
<div className={styles.omsLog}> <div className={styles.omsLog}>
<Row className={styles.head}> <Row className={styles.head}>
<Col span={24}> <Col span={24}>
<span style={{ lineHeight: 2 }}>时间:</span> <span style={{ lineHeight: 2, marginLeft: '27px' }}>时间:</span>
<RangePicker <RangePicker
locale={locale} locale={locale}
showTime showTime
...@@ -323,7 +323,9 @@ const OmsLog = () => { ...@@ -323,7 +323,9 @@ const OmsLog = () => {
<Button onClick={() => setTime(24 * 7)}>近1周</Button> <Button onClick={() => setTime(24 * 7)}>近1周</Button>
<Button onClick={() => setTime(14 * 24)}>近2周</Button> <Button onClick={() => setTime(14 * 24)}>近2周</Button>
<Button onClick={() => setTime(30 * 24)}>近1月</Button> <Button onClick={() => setTime(30 * 24)}>近1月</Button>
<span style={{ marginLeft: '20px' }}>接口查询:</span> <br />
<br />
<span>接口查询:</span>
<Input <Input
style={{ width: '200px' }} style={{ width: '200px' }}
placeholder="请输入接口名称" placeholder="请输入接口名称"
...@@ -371,7 +373,7 @@ const OmsLog = () => { ...@@ -371,7 +373,7 @@ const OmsLog = () => {
bordered bordered
columns={columns} columns={columns}
dataSource={data} dataSource={data}
scroll={{ x: 'max-content', y: 'calc(100vh - 230px)' }} scroll={{ x: 'max-content', y: 'calc(100vh - 285px)' }}
pagination={false} pagination={false}
onChange={onChangeInput} onChange={onChangeInput}
/> />
......
...@@ -520,7 +520,7 @@ const ServiceLog = () => { ...@@ -520,7 +520,7 @@ const ServiceLog = () => {
<div className={styles.serviceLog}> <div className={styles.serviceLog}>
<Row className={styles.head}> <Row className={styles.head}>
<Col span={24}> <Col span={24}>
<span>时间:</span> <span style={{ marginLeft: '27px' }}>时间:</span>
<RangePicker <RangePicker
locale={locale} locale={locale}
showTime showTime
...@@ -557,7 +557,9 @@ const ServiceLog = () => { ...@@ -557,7 +557,9 @@ const ServiceLog = () => {
<Button onClick={() => setTime(24 * 60, '3')}>近1天</Button> <Button onClick={() => setTime(24 * 60, '3')}>近1天</Button>
<Button onClick={() => setTime(24 * 7 * 60, '4')}>近1周</Button> <Button onClick={() => setTime(24 * 7 * 60, '4')}>近1周</Button>
<Button onClick={() => setTime(24 * dayTime() * 60, '4')}>本月</Button> <Button onClick={() => setTime(24 * dayTime() * 60, '4')}>本月</Button>
<span style={{ marginLeft: '20px' }}>返回状态:</span> <br />
<br />
<span>返回状态:</span>
<Select <Select
defaultValue="全部" defaultValue="全部"
value={logType} value={logType}
...@@ -580,7 +582,7 @@ const ServiceLog = () => { ...@@ -580,7 +582,7 @@ const ServiceLog = () => {
enterButton enterButton
value={searchWord} value={searchWord}
/> />
<Button {/* <Button
icon={<SyncOutlined className={styles.icon} />} icon={<SyncOutlined className={styles.icon} />}
onClick={handleReset} onClick={handleReset}
style={{ style={{
...@@ -590,14 +592,15 @@ const ServiceLog = () => { ...@@ -590,14 +592,15 @@ const ServiceLog = () => {
}} }}
> >
重置 重置
</Button> </Button> */}
</Col> </Col>
</Row> </Row>
<Spin spinning={loading} tip="loading"> <Spin spinning={loading} tip="loading">
<Row style={{ background: 'white' }}> <Row style={{ background: 'white' }}>
<Col span={8} style={{ paddingTop: '8px', paddingLeft: '5px' }}> <Col span={8} style={{ paddingTop: '8px', paddingLeft: '5px' }}>
<span style={{ fontSize: '14px', fontWeight: '600' }}>访问量统计</span> <span style={{ fontSize: '14px', fontWeight: '600' }}>访问量统计</span>
<span style={{ paddingLeft: '60%' }}>间隔:</span> <span style={{ float: 'right' }}>
<span>间隔:</span>
<Select <Select
defaultValue="每小时" defaultValue="每小时"
size="small" size="small"
...@@ -610,6 +613,7 @@ const ServiceLog = () => { ...@@ -610,6 +613,7 @@ const ServiceLog = () => {
<Option value="3">每小时</Option> <Option value="3">每小时</Option>
<Option value="4">每天</Option> <Option value="4">每天</Option>
</Select> </Select>
</span>
</Col> </Col>
<Col span={7} offset={1} style={{ paddingTop: '8px' }}> <Col span={7} offset={1} style={{ paddingTop: '8px' }}>
<span style={{ fontSize: '14px', fontWeight: '600' }}>接口调用频次统计</span> <span style={{ fontSize: '14px', fontWeight: '600' }}>接口调用频次统计</span>
...@@ -688,7 +692,7 @@ const ServiceLog = () => { ...@@ -688,7 +692,7 @@ const ServiceLog = () => {
bordered bordered
columns={columns} columns={columns}
dataSource={dataTable} dataSource={dataTable}
scroll={{ x: 'max-content', y: 'calc(100vh - 565px)' }} scroll={{ x: 'max-content', y: 'calc(100vh - 615px)' }}
pagination={false} pagination={false}
/> />
</div> </div>
......
...@@ -286,11 +286,7 @@ const AddModal = props => { ...@@ -286,11 +286,7 @@ const AddModal = props => {
getContainer={false} getContainer={false}
> >
<Form form={form} {...layout}> <Form form={form} {...layout}>
{/* {type === 'edit' ? ( {type === 'edit' ? (
<Item label="名称" name="systemName" rules={[{ required: true, message: '请输入名称' }]}>
<Input allowClear style={{ width: '100%' }} placeholder="请输入名称" disabled />
</Item>
) : ( */}
<Item <Item
label="名称" label="名称"
name="systemName" name="systemName"
...@@ -313,7 +309,30 @@ const AddModal = props => { ...@@ -313,7 +309,30 @@ const AddModal = props => {
> >
<Input allowClear style={{ width: '100%' }} placeholder="请输入名称" /> <Input allowClear style={{ width: '100%' }} placeholder="请输入名称" />
</Item> </Item>
{/* )} */} ) : (
<Item
label="名称"
name="systemName"
rules={[
{ required: true, message: '请输入名称' },
{
validator: (rule, value) => {
let aa = form.getFieldValue().systemName;
let regEn = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im;
let regCn = /[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im;
if (keepSystemName.indexOf(aa) != -1) {
return Promise.reject('名称已存在');
} else if (regEn.test(aa) || regCn.test(aa)) {
return Promise.reject('名称不能包含特殊字符');
}
return Promise.resolve();
},
},
]}
>
<Input allowClear style={{ width: '100%' }} placeholder="请输入名称" />
</Item>
)}
<Item label="副标题" name="subtitle" rules={[{ required: true, message: '请输入副标题' }]}> <Item label="副标题" name="subtitle" rules={[{ required: true, message: '请输入副标题' }]}>
<Input allowClear placeholder="建议使用英文" /> <Input allowClear placeholder="建议使用英文" />
...@@ -332,7 +351,7 @@ const AddModal = props => { ...@@ -332,7 +351,7 @@ const AddModal = props => {
name="accountParamKey" name="accountParamKey"
rules={[{ required: true, message: '请输入参数' }]} rules={[{ required: true, message: '请输入参数' }]}
> >
<Input allowClear /> <Input allowClear placeholder="请填写账号参数" />
</Item> </Item>
</Col> </Col>
<Col span={10}> <Col span={10}>
...@@ -344,7 +363,7 @@ const AddModal = props => { ...@@ -344,7 +363,7 @@ const AddModal = props => {
</Item> </Item>
</Col> </Col>
</Row> </Row>
<Item label="从新窗口打开" name="target"> <Item label="新标签" name="target">
<Radio.Group onChange={onChange} value={radio}> <Radio.Group onChange={onChange} value={radio}>
<Radio value={0}></Radio> <Radio value={0}></Radio>
<Radio value={1}></Radio> <Radio value={1}></Radio>
......
...@@ -338,11 +338,12 @@ const Integrate = () => { ...@@ -338,11 +338,12 @@ const Integrate = () => {
enterButton enterButton
value={searchWord} value={searchWord}
/> />
<Button icon={<SyncOutlined />} onClick={handleReset} style={{ marginLeft: '20px' }}> {/* <Button icon={<SyncOutlined />} onClick={handleReset} style={{ marginLeft: '20px' }}>
重置 重置
</Button> </Button> */}
<Button <Button
icon={<PlusOutlined className={styles.icon} />} icon={<PlusOutlined className={styles.icon} />}
type="primary"
onClick={add} onClick={add}
style={{ style={{
verticalAlign: 'middle', verticalAlign: 'middle',
...@@ -373,9 +374,7 @@ const Integrate = () => { ...@@ -373,9 +374,7 @@ const Integrate = () => {
<FilePdfOutlined style={{ fontSize: '24px' }} /> <FilePdfOutlined style={{ fontSize: '24px' }} />
</a> </a>
</Tooltip> </Tooltip>
<Button type="primary" onClick={masterStation}> <Button onClick={masterStation}>配置集成网站</Button>
配置集成网站
</Button>
</div> </div>
</div> </div>
<Spin spinning={loading} tip="loading"> <Spin spinning={loading} tip="loading">
......
...@@ -12,26 +12,26 @@ import PreviewModal from './PreviewModal'; ...@@ -12,26 +12,26 @@ import PreviewModal from './PreviewModal';
const { Item } = Form; const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const colorList = [ const colorList = [
{
key: '科技蓝新',
color: '#2262B2',
// headerColor: 'linear-gradient(0deg, #0066D6 0%, #39A9FF 100%)',
},
{
key: '环保绿新',
color: '#00A295',
// headerColor: 'linear-gradient(0deg, #00845D 0%, #02BF87 100%)',
},
{ {
key: '科技蓝', key: '科技蓝',
color: '#1890FF', color: '#2262B2',
// headerColor: 'linear-gradient(0deg, #0066D6 0%, #39A9FF 100%)', // headerColor: 'linear-gradient(0deg, #0066D6 0%, #39A9FF 100%)',
}, },
{ {
key: '环保绿', key: '环保绿',
color: '#00B496', color: '#00A295',
// headerColor: 'linear-gradient(0deg, #00845D 0%, #02BF87 100%)', // headerColor: 'linear-gradient(0deg, #00845D 0%, #02BF87 100%)',
}, },
// {
// key: '科技蓝',
// color: '#1890FF',
// // headerColor: 'linear-gradient(0deg, #0066D6 0%, #39A9FF 100%)',
// },
// {
// key: '环保绿',
// color: '#00B496',
// // headerColor: 'linear-gradient(0deg, #00845D 0%, #02BF87 100%)',
// },
]; ];
const Master = props => { const Master = props => {
...@@ -53,7 +53,7 @@ const Master = props => { ...@@ -53,7 +53,7 @@ const Master = props => {
form.setFieldsValue({ form.setFieldsValue({
logo: res.data.logo, logo: res.data.logo,
primaryColor: res.data.primaryColor, primaryColor: res.data.primaryColor,
subtitle: res.data.subtitle, // subtitle: res.data.subtitle,
title: aa[0], title: aa[0],
titlebr: aa[1], titlebr: aa[1],
}); });
...@@ -88,7 +88,7 @@ const Master = props => { ...@@ -88,7 +88,7 @@ const Master = props => {
AddIntegratedloginSetting({ AddIntegratedloginSetting({
logo: obj.logo, logo: obj.logo,
primaryColor: obj.primaryColor, primaryColor: obj.primaryColor,
subtitle: obj.subtitle, // subtitle: obj.subtitle,
title: obj.title, title: obj.title,
}) })
.then(res => { .then(res => {
...@@ -201,9 +201,9 @@ const Master = props => { ...@@ -201,9 +201,9 @@ const Master = props => {
> >
<Form form={form} {...layout}> <Form form={form} {...layout}>
<Row> <Row>
<Col span={12}> <Col span={14}>
<Item <Item
labelCol={{ span: 8 }} labelCol={{ span: 7 }}
label="标题" label="标题"
name="title" name="title"
rules={[ rules={[
...@@ -213,12 +213,16 @@ const Master = props => { ...@@ -213,12 +213,16 @@ const Master = props => {
}, },
]} ]}
> >
<Input placeholder="请输入标题" autoComplete="off" /> <Input placeholder="请输入标题" autoComplete="off" style={{ marginleft: '3px' }} />
</Item> </Item>
</Col> </Col>
<Col span={11}> <Col span={8}>
<Item labelCol={{ span: 7 }} label="换行标题" name="titlebr"> <Item name="titlebr">
<Input placeholder="仅新主题适用" autoComplete="off" style={{ width: '87%' }} /> <Input
placeholder="仅新主题适用"
autoComplete="off"
style={{ marginLeft: '20px', width: '123%' }}
/>
</Item> </Item>
</Col> </Col>
</Row> </Row>
...@@ -281,7 +285,7 @@ const Master = props => { ...@@ -281,7 +285,7 @@ const Master = props => {
</Col> </Col>
</Row> </Row>
<Item name="primaryColor" label="主题"> <Item name="primaryColor" label="主题">
<Select placeholder="请选择颜色"> <Select placeholder="请选择颜色" style={{ marginLeft: '3px' }}>
{colorList.map(item => ( {colorList.map(item => (
<Option value={item.color} key={item.color}> <Option value={item.color} key={item.color}>
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
......
...@@ -52,7 +52,8 @@ import IncidentView from '@/pages/bsmanager/workOrder/incident/incidentView'; ...@@ -52,7 +52,8 @@ import IncidentView from '@/pages/bsmanager/workOrder/incident/incidentView';
import Flow from '@/pages/bsmanager/workOrder/workFlow/flow'; import Flow from '@/pages/bsmanager/workOrder/workFlow/flow';
import FlowNode from '@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode'; import FlowNode from '@/pages/bsmanager/workOrder/workFlow/flowNode/flowNode';
import Workflow from '@/pages/bsmanager/workOrder/workflowEdit/Workflow'; import Workflow from '@/pages/bsmanager/workOrder/workflowEdit/Workflow';
import Maintenance from '@/pages/bsmanager/maintenance/maintenance'; import Maintenance from '@/pages/bsmanager/patrolMaintenance/maintenance/maintenance';
import PatrolFeedback from '@/pages/bsmanager/patrolMaintenance/patrolFeedback/patrolFeedback';
// 应用中心 // 应用中心
import ProductConfig from '@/pages/productCenter/productConfig/productConfig'; import ProductConfig from '@/pages/productCenter/productConfig/productConfig';
...@@ -237,12 +238,24 @@ export default { ...@@ -237,12 +238,24 @@ export default {
], ],
}, },
{ {
path: '/biz/maintenance', path: '/biz/patrolMaintenance',
name: '巡维保', name: '巡检维保',
component: BlankLayout,
routes: [
{
path: '/biz/patrolMaintenance/patrolFeedback',
name: '巡检反馈',
component: PatrolFeedback,
},
{
path: '/biz/patrolMaintenance/maintenance',
name: '维保模板',
component: Maintenance, component: Maintenance,
}, },
], ],
}, },
],
},
{ {
path: '/platform', path: '/platform',
component: BlankLayout, component: BlankLayout,
......
/* eslint-disable camelcase */
/*
* @Description:
* @Author: leizhe
* @Date: 2021-09-27 09:42:21
* @LastEditTime: 2022-07-22 10:46:09
* @LastEditors: leizhe
*/
import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index';
// 加载巡检反馈
export const CM_Feedback_LoadPatrolFeedbacks = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Feedback_LoadPatrolFeedbacks`, data);
// 添加或修改巡检反馈
export const CM_Feedback_OperatePatrolFeedback = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Feedback_OperatePatrolFeedback`, data);
// 删除巡检反馈
export const CM_Feedback_RemovePatrolFeedback = patrolFeedbackIDs =>
post(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Feedback_RemovePatrolFeedback?patrolFeedbackIDs=${patrolFeedbackIDs}`,
);
// 查询巡检反馈
export const CM_Feedback_QueryPatrolFeedback = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Feedback_QueryPatrolFeedback`, query);
// 加载事件反馈表
export const CM_Feedback_LoadFeedbackTables = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Feedback_LoadFeedbackTables`, query);
// 加载触发事件
export const CM_Feedback_LoadFeedbackEvent = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Feedback_LoadFeedbackEvent`, query);
// 根据反馈表加载关联的字段
export const CM_Feedback_LoadFields = feedbackTableName =>
get(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Feedback_LoadFields?feedbackTableName=${feedbackTableName}`,
);
// 调整巡检反馈顺序
export const CM_Feedback_ChangPatrolOrder = patrolOrder =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Feedback_ChangPatrolOrder?patrolOrder=${patrolOrder}`);
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