Commit 3d5276b8 authored by 皮倩雯's avatar 皮倩雯

巡维保功能界面

parent 99fa4916
Pipeline #35435 skipped with stages
...@@ -352,9 +352,11 @@ const AppDic = () => { ...@@ -352,9 +352,11 @@ const AppDic = () => {
marginBottom: '10px', marginBottom: '10px',
fontSize: '16px', fontSize: '16px',
height: 'calc(100vh-200px)', height: 'calc(100vh-200px)',
display:'flex',
alignItems:'center'
}} }}
> >
<span style={{ padding: '0 10px' }}>数据字典</span> <span >数据字典</span>
<Tooltip title="添加"> <Tooltip title="添加">
<PlusSquareOutlined <PlusSquareOutlined
onClick={() => { onClick={() => {
...@@ -364,9 +366,8 @@ const AppDic = () => { ...@@ -364,9 +366,8 @@ const AppDic = () => {
style={{ style={{
color: '#1890FF', color: '#1890FF',
fontSize: '20px', fontSize: '20px',
verticalAlign: 'middle', marginRight: '22px',
marginRight: '22px', marginLeft: '90%'
float: 'right'
}} }}
/> />
</Tooltip> </Tooltip>
...@@ -382,7 +383,7 @@ const AppDic = () => { ...@@ -382,7 +383,7 @@ const AppDic = () => {
style={{ style={{
color: '#1890FF', color: '#1890FF',
fontSize: '20px', fontSize: '20px',
verticalAlign: 'middle', verticalAlign: 'text-bottom',
marginRight: '30px', marginRight: '30px',
float: 'right' float: 'right'
}} }}
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
} }
.clickRowStyle:hover>td{ .clickRowStyle:hover>td{
background: #aed8fa; background: #aed8fa;
} }
} }
.ant-card-body{ .ant-card-body{
......
...@@ -644,7 +644,7 @@ const WebDic = () => { ...@@ -644,7 +644,7 @@ const WebDic = () => {
key='' key=''
columns={columns} columns={columns}
dataSource={data} dataSource={data}
scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }} scroll={{ x: 'max-content', y: 'calc(100vh - 370px)' }}
bordered bordered
title={() => { title={() => {
return <div > return <div >
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
} }
} }
.ant-table-body{ .ant-table-body{
max-height: calc(100vh - 328px) !important; max-height: calc(100vh - 370px) !important;
min-height:calc(100vh - 328px); min-height:calc(100vh - 370px);
margin-right: -6px; margin-right: -6px;
} }
.ant-table-pagination.ant-pagination { .ant-table-pagination.ant-pagination {
......
import React, { useState, useEffect } from 'react';
import { Modal, Divider, Checkbox } from 'antd';
import styles from './maintenance.less'
const CheckboxGroup = Checkbox.Group;
const ChangeAdd = props => {
const { callBackSubmit = () => { }, isType, visible, newCheckedList, filed1, filed, pickItem, characterValue } = props;
const [title, setTitle] = useState([])//分组名
const [checkedList, setCheckedList] = useState([]);//选中的复选框内容
const [indeterminate, setIndeterminate] = useState([]);//全选样式控制
const [checkAll, setCheckAll] = useState([]);//全选
const [selectData, setSelectData] = useState([])//选中复选框的值集合
let objArr = []
const onChangeList = (list) => {
let arr= []
list.map((item, index)=>{
arr.push(item)
})
console.log(list)
console.log(arr)
setCheckedList(arr)
// 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 onChangeList1 = (list, index, title) => {
const checkedListArr = [...checkedList]
checkedListArr[index] = list
setCheckedList(checkedListArr);
console.log(checkedListArr)
const indeterminateArr = [...indeterminate]
const checkAllArr = [...checkAll]
indeterminateArr[index] = !!list.length && list.length < filed1[title].length
checkAllArr[index] = list.length === filed1[title].length
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr);
};
const onSubmit = () => {
isType === 'rule' ? callBackSubmit(`${value === '无' || value === '' ? '' : value + ','}${checkValue.join(',')}`) : callBackSubmit({ checkedList, str: selectData.join(","), pickItem, stt:selectData, title:title, filed22:filed1, isType:isType });
}
const onCheckAllChange = e => {
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] = []
setCheckedList(checkedListArr);
setIndeterminate(indeterminateArr);
setCheckAll(checkAllArr);
};
useEffect(() => {
selectAll()
}, [checkedList]);
const selectAll = () => {
objArr = []
checkedList.map(item => {
objArr = objArr.concat(item)
})
console.log(checkedList)
setSelectData(objArr)
}
useEffect(() => {
if (isType != '' && isType === 'add') {
// console.log(filed)
// let arr = Object.keys(filed)
// console.log(arr, 'arr')
// setTitle(arr)
let checkArr = []
// let indeterminateArr = []
// let checkAllArr = []
console.log(newCheckedList);
// arr.map((item, index) => {
// checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed.includes(checkItem)) {
checkArr.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 newArr = characterValue.length ? characterValue.split(",") : []
setSelectData(newArr)
} else if (isType === 'app') {
console.log(filed1)
let arr = Object.keys(filed1)
console.log(arr, 'arr')
setTitle(arr)
let checkArr = []
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
console.log(characterValue)
arr.map((item, index) => {
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
checkArr[index].push(checkItem)
}
})
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
checkAllArr.push(checkArr[index].length === filed1[item].length)
})
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
let newArr = characterValue.length ? characterValue.split(",") : []
setSelectData(newArr)
}
}, [visible]);
if (isType != 'app') {
return (
<div className={styles.ChangeAddContainer}>
<Modal
title='反馈名称'
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '10px' }}
width="500px"
destroyOnClose
centered={true}
maskClosable={false}
onOk={onSubmit}
okText="确认"
cancelText="取消"
{...props}
forceRender={true}
getContainer={false}
>
{visible && (
<div className={styles.listCard}>
<div className={styles.cardItem}>
{JSON.stringify(filed) == "{}" ?
<>
<div className={styles.cardContent}>
<span style={{color: 'red',fontSize: '1rem', marginLeft: '25px'}}>暂无数据请先配置台账管理台账名称为反馈</span>
</div>
</>
:
<>
<div className={styles.cardContent}>
<div className={styles.cardItemData1}>
{/* <Checkbox indeterminate={indeterminate} onChange={onCheckAllChange} checked={checkAll}></Checkbox> */}
<CheckboxGroup options={filed} value={checkedList} onChange={(e) => onChangeList(e)} style={{width:'400px'}} /></div>
</div>
</>
}
</div>
</div>
)
}
</Modal>
</div>
);
} else if (isType === 'app') {
return (
<Modal
title= '角色'
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: '10px' }}
width="1200px"
destroyOnClose
centered={true}
maskClosable={false}
onOk={onSubmit}
okText="确认"
cancelText="取消"
{...props}
forceRender={true}
getContainer={false}
>
{visible && (
<div className={styles.listCard}>
<div className={styles.cardItem}>
<div className={styles.cardContent}>
{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={filed1[item]} checked={checkAll[index]}> </Checkbox></Divider>
<CheckboxGroup options={filed1[item]} value={checkedList[index]} onChange={(e) => onChangeList1(e, index, item)} /></div>
})}
</div>
</div>
</div>
)
}
</Modal>
);
}
};
export default ChangeAdd
\ No newline at end of file
.ChangeAddContainer{
.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;
}
}
}
.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{
padding: 1rem;
border: 1px solid #b5b8c8;
margin-bottom: 1rem;
}
}
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './maintenance.less' import styles from './maintenance.less'
import { import {
Form,
Card,
Space, Space,
Table, Table,
Popconfirm, Popconfirm,
Spin,
Tooltip, Tooltip,
notification,
Tree,
Button, Button,
notification
} from 'antd'; } from 'antd';
import {CM_XWBPlan_DataList, CM_XWBPlan_RemovePlan} from '@/services/maintenance/api';
import { import {
DoubleLeftOutlined,
DoubleRightOutlined,
PlusSquareFilled,
RightOutlined,
EditTwoTone, EditTwoTone,
DeleteOutlined, DeleteOutlined,
OrderedListOutlined,
ApartmentOutlined,
DesktopOutlined,
PlusOutlined PlusOutlined
} from '@ant-design/icons'; } from '@ant-design/icons';
import AddModal from './AddModal' import AddModal from './AddModal'
...@@ -31,6 +20,8 @@ const maintenance = () => { ...@@ -31,6 +20,8 @@ const maintenance = () => {
const [addVisible, setAddVisible] = useState(false) const [addVisible, setAddVisible] = useState(false)
const [type, setType] = useState('') const [type, setType] = useState('')
const [formObj, setFormObj] = useState('') const [formObj, setFormObj] = useState('')
const [treeLoading, setTreeLoading] = useState(false);
const [flag, setFlag] = useState(0);
const [tableData, setTableData] = useState([]) const [tableData, setTableData] = useState([])
const columns = [ const columns = [
...@@ -118,10 +109,11 @@ const maintenance = () => { ...@@ -118,10 +109,11 @@ const maintenance = () => {
}, },
{ {
title: '操作', title: '操作',
ellipsis: true,
key: 'action', key: 'action',
align:'center', align: 'center',
rener: record =>{ render: (text, record) => (
<Space size="middle"> <Space>
<Tooltip title="修改"> <Tooltip title="修改">
<EditTwoTone <EditTwoTone
onClick={() => editEventType(record)} onClick={() => editEventType(record)}
...@@ -144,11 +136,21 @@ const maintenance = () => { ...@@ -144,11 +136,21 @@ const maintenance = () => {
</Popconfirm> </Popconfirm>
</Tooltip> </Tooltip>
</Space> </Space>
} ),
},
}
] ]
useEffect(()=>{
setTreeLoading(true);
CM_XWBPlan_DataList().then(res=>{
setTreeLoading(false);
if(res.msg == 'Ok'){
setTableData(res.data)
}
})
},[flag])
const add =()=>{ const add =()=>{
setAddVisible(true) setAddVisible(true)
setType('add') setType('add')
...@@ -158,11 +160,30 @@ const maintenance = () => { ...@@ -158,11 +160,30 @@ const maintenance = () => {
setType('edit') setType('edit')
setFormObj(record); setFormObj(record);
} }
const deleteEventType =record=>{ const deleteEventType = record =>{
CM_XWBPlan_RemovePlan({planId:record.id}).then(res =>{
if (res.msg === '') {
notification.success({
message: '提示',
duration: 3,
description: '删除成功',
});
console.log(111)
setFlag(flag + 1)
console.log(222)
console.log(flag)
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
})
} }
const onSubmit =()=>{ const onSubmit =()=>{
setAddVisible(false) setAddVisible(false)
setFlag(flag + 1)
} }
return ( return (
...@@ -175,12 +196,12 @@ const maintenance = () => { ...@@ -175,12 +196,12 @@ const maintenance = () => {
</Button> </Button>
</span> </span>
</div> </div>
<Table <Table
// rowClassName={setRowClassName} // rowClassName={setRowClassName}
size="small" size="small"
rowKey='ID' rowKey='ID'
bordered bordered
loading={treeLoading}
onRow={record => { onRow={record => {
return { return {
onDoubleClick: event => { event.stopPropagation(); editEventType(record) }, //双击 onDoubleClick: event => { event.stopPropagation(); editEventType(record) }, //双击
......
...@@ -2,30 +2,6 @@ ...@@ -2,30 +2,6 @@
.ant-card-body { .ant-card-body {
padding: 12px 24px 24px 24px; padding: 12px 24px 24px 24px;
} }
.linkDrowp{
position: absolute;
top: 0px;
left: 92.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-btn .anticon.anticon-plus > svg, .ant-btn .anticon.anticon-minus > svg {
margin-top: -5px;
}
.pickItem{ .pickItem{
background-color: #F5F6F9; background-color: #F5F6F9;
} }
...@@ -55,4 +31,57 @@ ...@@ -55,4 +31,57 @@
justify-content: center; justify-content: center;
} }
} }
} }
\ No newline at end of file .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: 1rem;
border: 1px solid #b5b8c8;
margin-bottom: 1rem;
width:30.5%;
margin-right:15px;
margin-left:17px;
height: 30rem;
overflow-y: scroll;
}
.cardItemData1{
padding: 1rem;
border: 1px solid #b5b8c8;
margin-bottom: 1rem;
height: 30rem;
overflow-y: scroll;
}
}
...@@ -496,6 +496,9 @@ const AddModal = props => { ...@@ -496,6 +496,9 @@ const AddModal = props => {
} }
const pickFiled1 = (fileds) => { const pickFiled1 = (fileds) => {
setTypes('app') setTypes('app')
// console.log(fileds)
// console.log(inputValue)
// console.log(inputValue[fileds])
setCharacterValue(inputValue[fileds]) setCharacterValue(inputValue[fileds])
setCheckedList1(inputValue[fileds].split(',')) setCheckedList1(inputValue[fileds].split(','))
setPickItem(fileds) setPickItem(fileds)
......
...@@ -114,7 +114,9 @@ const AddModal = props => { ...@@ -114,7 +114,9 @@ const AddModal = props => {
setCheckedList(checkArr) setCheckedList(checkArr)
setIndeterminate(indeterminateArr) setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr) setCheckAll(checkAllArr)
console.log(characterValue)
let newArr = characterValue.length ? characterValue.split(",") : [] let newArr = characterValue.length ? characterValue.split(",") : []
console.log(newArr)
setSelectData(newArr) setSelectData(newArr)
draftSort() draftSort()
} }
......
...@@ -75,7 +75,7 @@ const videoManager = () => { ...@@ -75,7 +75,7 @@ const videoManager = () => {
width: 150, width: 150,
align: 'center', align: 'center',
title: ( title: (
<div>录入时间<Tooltip title="点击降序"><CaretUpFilled style={{display:show1,color:'#1890ff',marginTop: '-18px', marginLeft: '60%'}} onClick={()=> shengxu()}/></Tooltip><Tooltip title="点击升序"><CaretDownFilled style={{display:show2,color:'#1890ff',marginTop: '-18px', marginLeft: '60%'}} onClick={()=> jiangxu()}/></Tooltip></div> <div>录入时间<Tooltip title="点击降序"><CaretUpFilled style={{display:show1,color:'#1890ff',marginTop: '-13px', marginLeft: '60%'}} onClick={()=> shengxu()}/></Tooltip><Tooltip title="点击升序"><CaretDownFilled style={{display:show2,color:'#1890ff',marginTop: '-13px', marginLeft: '60%'}} onClick={()=> jiangxu()}/></Tooltip></div>
) )
}, { }, {
title: '操作', title: '操作',
......
...@@ -116,7 +116,7 @@ const RelateRoleModal = props => { ...@@ -116,7 +116,7 @@ const RelateRoleModal = props => {
onCancel={onCancel} onCancel={onCancel}
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
width="920px" width="500px"
> >
<Spin spinning={loading} tip="loading"> <Spin spinning={loading} tip="loading">
<Tabs defaultActiveKey="1" style={{ marginTop: '-16px' }}> <Tabs defaultActiveKey="1" style={{ marginTop: '-16px' }}>
......
...@@ -1271,7 +1271,7 @@ const UserManage = () => { ...@@ -1271,7 +1271,7 @@ const UserManage = () => {
onSelect={onSelect} onSelect={onSelect}
height={ height={
treeData.length && treeData.length > 30 treeData.length && treeData.length > 30
? treeData.length * 15+30 ? treeData.length * 18+50
: 1000 : 1000
} }
treeData={treeData.map(t => mapTree(t))} treeData={treeData.map(t => mapTree(t))}
......
/*
* @Description:
* @Author: leizhe
* @Date: 2021-09-27 09:42:21
* @LastEditTime: 2021-09-27 16:49:28
* @LastEditors: leizhe
*/
import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index';
// 巡维保计划数据获取
export const CM_XWBPlan_DataList = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_DataList`, query);
//巡维保计划关联设备台账
export const CM_XWBPlan_AccountTable = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_AccountTable`, query);
//计划关联反馈台账表
export const CM_XWBPlan_feedbackTable = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_feedbackTable`, query);
//巡维保计划数据删除
export const CM_XWBPlan_RemovePlan = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_RemovePlan`, query);
//巡维保计划数据编辑OR添加
export const CM_XWBPlan_DataEditORAdd = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_DataEditORAdd`, data);
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