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

巡维保功能界面

parent 99fa4916
Pipeline #35435 skipped with stages
......@@ -352,9 +352,11 @@ const AppDic = () => {
marginBottom: '10px',
fontSize: '16px',
height: 'calc(100vh-200px)',
display:'flex',
alignItems:'center'
}}
>
<span style={{ padding: '0 10px' }}>数据字典</span>
<span >数据字典</span>
<Tooltip title="添加">
<PlusSquareOutlined
onClick={() => {
......@@ -364,9 +366,8 @@ const AppDic = () => {
style={{
color: '#1890FF',
fontSize: '20px',
verticalAlign: 'middle',
marginRight: '22px',
float: 'right'
marginRight: '22px',
marginLeft: '90%'
}}
/>
</Tooltip>
......@@ -382,7 +383,7 @@ const AppDic = () => {
style={{
color: '#1890FF',
fontSize: '20px',
verticalAlign: 'middle',
verticalAlign: 'text-bottom',
marginRight: '30px',
float: 'right'
}}
......
......@@ -16,6 +16,7 @@
}
.clickRowStyle:hover>td{
background: #aed8fa;
}
}
.ant-card-body{
......
......@@ -644,7 +644,7 @@ const WebDic = () => {
key=''
columns={columns}
dataSource={data}
scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }}
scroll={{ x: 'max-content', y: 'calc(100vh - 370px)' }}
bordered
title={() => {
return <div >
......
......@@ -27,8 +27,8 @@
}
}
.ant-table-body{
max-height: calc(100vh - 328px) !important;
min-height:calc(100vh - 328px);
max-height: calc(100vh - 370px) !important;
min-height:calc(100vh - 370px);
margin-right: -6px;
}
.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 styles from './maintenance.less'
import {
Form,
Card,
Space,
Table,
Popconfirm,
Spin,
Tooltip,
notification,
Tree,
Button,
notification
} from 'antd';
import {CM_XWBPlan_DataList, CM_XWBPlan_RemovePlan} from '@/services/maintenance/api';
import {
DoubleLeftOutlined,
DoubleRightOutlined,
PlusSquareFilled,
RightOutlined,
EditTwoTone,
DeleteOutlined,
OrderedListOutlined,
ApartmentOutlined,
DesktopOutlined,
PlusOutlined
} from '@ant-design/icons';
import AddModal from './AddModal'
......@@ -31,6 +20,8 @@ const maintenance = () => {
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 columns = [
......@@ -118,10 +109,11 @@ const maintenance = () => {
},
{
title: '操作',
ellipsis: true,
key: 'action',
align:'center',
rener: record =>{
<Space size="middle">
align: 'center',
render: (text, record) => (
<Space>
<Tooltip title="修改">
<EditTwoTone
onClick={() => editEventType(record)}
......@@ -144,11 +136,21 @@ const maintenance = () => {
</Popconfirm>
</Tooltip>
</Space>
}
}
),
},
]
useEffect(()=>{
setTreeLoading(true);
CM_XWBPlan_DataList().then(res=>{
setTreeLoading(false);
if(res.msg == 'Ok'){
setTableData(res.data)
}
})
},[flag])
const add =()=>{
setAddVisible(true)
setType('add')
......@@ -158,11 +160,30 @@ const maintenance = () => {
setType('edit')
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 =()=>{
setAddVisible(false)
setFlag(flag + 1)
}
return (
......@@ -175,12 +196,12 @@ const maintenance = () => {
</Button>
</span>
</div>
<Table
// rowClassName={setRowClassName}
size="small"
rowKey='ID'
bordered
loading={treeLoading}
onRow={record => {
return {
onDoubleClick: event => { event.stopPropagation(); editEventType(record) }, //双击
......
......@@ -2,30 +2,6 @@
.ant-card-body {
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{
background-color: #F5F6F9;
}
......@@ -55,4 +31,57 @@
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 => {
}
const pickFiled1 = (fileds) => {
setTypes('app')
// console.log(fileds)
// console.log(inputValue)
// console.log(inputValue[fileds])
setCharacterValue(inputValue[fileds])
setCheckedList1(inputValue[fileds].split(','))
setPickItem(fileds)
......
......@@ -114,7 +114,9 @@ const AddModal = props => {
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
console.log(characterValue)
let newArr = characterValue.length ? characterValue.split(",") : []
console.log(newArr)
setSelectData(newArr)
draftSort()
}
......
......@@ -75,7 +75,7 @@ const videoManager = () => {
width: 150,
align: 'center',
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: '操作',
......
......@@ -116,7 +116,7 @@ const RelateRoleModal = props => {
onCancel={onCancel}
okText="确认"
cancelText="取消"
width="920px"
width="500px"
>
<Spin spinning={loading} tip="loading">
<Tabs defaultActiveKey="1" style={{ marginTop: '-16px' }}>
......
......@@ -1271,7 +1271,7 @@ const UserManage = () => {
onSelect={onSelect}
height={
treeData.length && treeData.length > 30
? treeData.length * 15+30
? treeData.length * 18+50
: 1000
}
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