Commit 98e3d6b5 authored by 皮倩雯's avatar 皮倩雯

fix: '方案制定优化'

parent 6bf22e2b
Pipeline #80692 waiting for manual action with stages
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
"@wisdom-map/basemap": "1.1.0-31", "@wisdom-map/basemap": "1.1.0-31",
"ace-builds": "^1.4.12", "ace-builds": "^1.4.12",
"antd-img-crop": "^3.13.2", "antd-img-crop": "^3.13.2",
"array-move": "^4.0.0",
"bizcharts": "^4.0.15", "bizcharts": "^4.0.15",
"chalk": "2.4.2", "chalk": "2.4.2",
"compression": "1.7.4", "compression": "1.7.4",
......
...@@ -16,7 +16,6 @@ import ChangeAdd from './changeAdd'; ...@@ -16,7 +16,6 @@ import ChangeAdd from './changeAdd';
const { Option } = Select; const { Option } = Select;
const { TextArea } = Input; const { TextArea } = Input;
const BookConfig = props => { const BookConfig = props => {
const { const {
callBackSubmit, callBackSubmit,
type, type,
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
/* eslint-disable camelcase */ /* eslint-disable camelcase */
/* eslint-disable no-unused-expressions */ /* eslint-disable no-unused-expressions */
import React, { useContext, useEffect, useRef, useState } from 'react'; import React, { useContext, useEffect, useRef, useState } from 'react';
import { Context } from './maintenance';
import { arrayMoveImmutable } from 'array-move';
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
import { import {
Drawer, Drawer,
Form, Form,
...@@ -31,13 +34,11 @@ import { ...@@ -31,13 +34,11 @@ import {
} from 'antd'; } from 'antd';
import { import {
PlusOutlined, PlusOutlined,
DownOutlined,
StepForwardFilled,
InfoCircleOutlined, InfoCircleOutlined,
MinusCircleOutlined, MinusCircleOutlined,
EditOutlined, EditOutlined,
MenuOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { setAutoFreeze } from 'immer';
import styles from './maintenance.less'; import styles from './maintenance.less';
import RuleConfig from '@/components/RuleConfig'; import RuleConfig from '@/components/RuleConfig';
import { FormRender } from 'panda-xform'; import { FormRender } from 'panda-xform';
...@@ -65,12 +66,98 @@ import RMSComponents from '@/components/RolePmSite/index'; ...@@ -65,12 +66,98 @@ import RMSComponents from '@/components/RolePmSite/index';
import ChangeAdd from './ChangeAdd'; import ChangeAdd from './ChangeAdd';
import logo from '@/assets/images/icons/值映射.png'; import logo from '@/assets/images/icons/值映射.png';
import { objectExpression } from '@babel/types';
const { Option } = Select; const { Option } = Select;
const EditableContext = React.createContext(null);
const EditableRow = ({ index, ...props }) => {
const [formFeed] = Form.useForm();
return (
<Form form={formFeed} component={false}>
<EditableContext.Provider value={formFeed}>
<tr {...props} />
</EditableContext.Provider>
</Form>
);
};
const EditableCell = ({
index,
title,
editable,
children,
dataIndex,
record,
handleSave,
...restProps
}) => {
const [editing, setEditing] = useState(false);
const inputRef = useRef(null);
const formBack = useContext(EditableContext);
const { state, dispatch } = useContext(Context);
useEffect(() => {
if (editing && inputRef.current) {
inputRef.current.focus();
}
}, [editing]);
const toggleEdit = () => {
setEditing(!editing);
formBack.setFieldsValue({
[dataIndex]: record[dataIndex],
});
};
const save = async () => {
try {
const values = await formBack.validateFields();
toggleEdit();
handleSave({ ...record, ...values });
} catch (errInfo) {
console.log('Save failed:', errInfo);
}
};
let childNode = children;
if (editable) {
childNode = editing ? (
<Form.Item
style={{
margin: 0,
}}
name={dataIndex}
rules={[
{
required: true,
message: `请选择反馈名称`,
},
]}
>
<Select ref={inputRef} showSearch onPressEnter={save} onBlur={save} onSelect={save}>
{state.selectList
? state.selectList.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</Select>
</Form.Item>
) : (
<div
className="editable-cell-value-wrap"
style={{
paddingRight: 24,
}}
onClick={toggleEdit}
>
{children}
</div>
);
}
return <td {...restProps}>{childNode}</td>;
};
const AddModal = props => { const AddModal = props => {
const { callBackSubmit = () => {}, visible, type, formObj, keepTableData } = props; const { callBackSubmit = () => {}, visible, type, formObj, keepTableData } = props;
const { state, dispatch } = useContext(Context);
const [Type1, setType1] = useState(''); const [Type1, setType1] = useState('');
const [Type2, setType2] = useState(''); const [Type2, setType2] = useState('');
const [selectValue, setSelectValue] = useState(''); const [selectValue, setSelectValue] = useState('');
...@@ -113,79 +200,100 @@ const AddModal = props => { ...@@ -113,79 +200,100 @@ const AddModal = props => {
const { TextArea } = Input; const { TextArea } = Input;
const { TreeNode } = TreeSelect; const { TreeNode } = TreeSelect;
const [characteristics1, setCharacteristics1] = useState([
{
name: '一日一次',
ID: 0,
},
{
name: '一周一次',
ID: 1,
},
{
name: '半月一次',
ID: 2,
},
{
name: '一月一次',
ID: 3,
},
{
name: '季度一次',
ID: 4,
},
{
name: '半年一次',
ID: 5,
},
{
name: '一年一次',
ID: 6,
},
{
name: '小时类',
ID: 7,
children: [
'1小时一次',
'2小时一次',
'3小时一次',
'4小时一次',
'6小时一次',
'8小时一次',
'12小时一次',
],
},
]);
const [formJson, setFormJson] = useState(null); const [formJson, setFormJson] = useState(null);
const [visibleLook, setVisibleLook] = useState(false); const [visibleLook, setVisibleLook] = useState(false);
const EditableContext = React.createContext(null);
const [dataSource, setDataSource] = useState([]); const [dataSource, setDataSource] = useState([]);
const [count, setCount] = useState(2); const [count, setCount] = useState(0);
const SortableItem = SortableElement(props => <tr {...props} />);
const SortableBody = SortableContainer(props => <tbody {...props} />);
const [stateType, setStateType] = useState('edit');
const handleDelete = key => { const handleDelete = key => {
const newData = dataSource.filter(item => item.key !== key); const newData = dataSource.filter(item => item.key !== key);
setDataSource(newData); setDataSource(newData);
}; };
const defaultColumns = [
const DragHandle = SortableHandle(() => (
<MenuOutlined
style={{
cursor: 'grab',
color: '#999',
}}
/>
));
const columnsDrag = [
{
title: '排序',
dataIndex: 'sort',
width: 30,
className: 'drag-visible',
render: r => {
return (
<div
style={{
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
onMouseEnter={() => {
setStateType('drag');
}}
>
<DragHandle />
</div>
);
},
},
{ {
title: '反馈名称', title: <span style={{ marginLeft: '12px' }}>反馈名称</span>,
dataIndex: 'name', dataIndex: 'name',
width: '70%', width: '60%',
className: 'drag-visible',
editable: true, editable: true,
render: r => {
return (
<div
style={{
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
paddingLeft: stateType === 'drag' ? '12px' : '0px',
}}
onMouseEnter={() => {
setStateType('edit');
}}
>
{r}
</div>
);
},
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'operation', dataIndex: 'operation',
className: 'drag-visible',
align: 'center', align: 'center',
render: (_, record) => render: (_, record) =>
dataSource.length >= 1 ? ( dataSource.length >= 1 ? (
<div style={{ display: 'flex', justifyContent: 'space-around' }}> <div style={{ display: 'flex', justifyContent: 'space-around' }}>
{record.name ? (
<span <span
onClick={() => handleLook(record.name)} onClick={() => handleLook(record.name)}
style={{ color: '#0e8ef7', cursor: 'pointer' }} style={{ color: '#0e8ef7', cursor: 'pointer' }}
> >
预览 预览
</span> </span>
) : (
<span style={{ color: '#b3b3b3', cursor: 'not-allowed' }}>预览</span>
)}
<span <span
onClick={() => handleDelete(record.key)} onClick={() => handleDelete(record.key)}
style={{ color: '#fb8686', cursor: 'pointer' }} style={{ color: '#fb8686', cursor: 'pointer' }}
...@@ -196,96 +304,33 @@ const AddModal = props => { ...@@ -196,96 +304,33 @@ const AddModal = props => {
) : null, ) : null,
}, },
]; ];
const EditableRow = ({ index, ...props }) => {
const [formFeed] = Form.useForm();
return (
<Form form={formFeed} component={false}>
<EditableContext.Provider value={formFeed}>
<tr {...props} />
</EditableContext.Provider>
</Form>
);
};
const EditableCell = ({ const onSortEnd = ({ oldIndex, newIndex }) => {
title, if (oldIndex !== newIndex) {
editable, const newData = arrayMoveImmutable(dataSource.slice(), oldIndex, newIndex).filter(el => !!el);
children, console.log('Sorted items: ', newData);
dataIndex, setDataSource(newData);
record,
handleSave,
...restProps
}) => {
const [editing, setEditing] = useState(false);
const inputRef = useRef(null);
const formBack = useContext(EditableContext);
useEffect(() => {
if (editing && inputRef.current) {
inputRef.current.focus();
}
}, [editing]);
const toggleEdit = () => {
setEditing(!editing);
formBack.setFieldsValue({
[dataIndex]: record[dataIndex],
});
};
const save = async () => {
try {
const values = await formBack.validateFields();
toggleEdit();
handleSave({
...record,
...values,
});
} catch (errInfo) {
console.log('Save failed:', errInfo);
} }
}; };
let childNode = children; const DraggableContainer = props => (
if (editable) { <SortableBody
childNode = editing ? ( useDragHandle
<Form.Item disableAutoscroll
style={{ helperClass="row-dragging"
margin: 0, onSortEnd={onSortEnd}
}} {...props}
name={dataIndex} />
rules={[
{
required: true,
message: `${title} is required.`,
},
]}
>
<Select ref={inputRef} showSearch onPressEnter={save} onBlur={save}>
{filed
? filed.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</Select>
</Form.Item>
) : (
<div
className="editable-cell-value-wrap"
style={{
paddingRight: 24,
}}
onClick={toggleEdit}
>
{children}
</div>
); );
} const DraggableBodyRow = ({ className, style, ...restProps }) => {
return <td {...restProps}>{childNode}</td>; const index = dataSource.findIndex(x => x.key === restProps['data-row-key']);
return <SortableItem style={{ zIndex: 999999, height: '50px' }} index={index} {...restProps} />;
}; };
const handleAdd = () => { const handleAdd = () => {
setStateType('edit');
const newData = { const newData = {
key: count, key: count,
name: `${filed[0]}`, name: ``,
}; };
setDataSource([...dataSource, newData]); setDataSource([...dataSource, newData]);
setCount(count + 1); setCount(count + 1);
...@@ -300,12 +345,6 @@ const AddModal = props => { ...@@ -300,12 +345,6 @@ const AddModal = props => {
}); });
setDataSource(newData); setDataSource(newData);
}; };
const components = {
body: {
row: EditableRow,
cell: EditableCell,
},
};
useEffect(() => { useEffect(() => {
let list = []; let list = [];
...@@ -316,6 +355,7 @@ const AddModal = props => { ...@@ -316,6 +355,7 @@ const AddModal = props => {
} }
}); });
setFiled(list); setFiled(list);
dispatch({ type: 'SET_SELECT_LIST', data: list });
let arr = []; let arr = [];
dataSource.map(i => { dataSource.map(i => {
arr.push(i.name); arr.push(i.name);
...@@ -323,7 +363,7 @@ const AddModal = props => { ...@@ -323,7 +363,7 @@ const AddModal = props => {
onChangeFeed(arr.toString(), 1); onChangeFeed(arr.toString(), 1);
}, [dataSource]); }, [dataSource]);
const columns = defaultColumns.map(col => { const columns = columnsDrag.map(col => {
if (!col.editable) { if (!col.editable) {
return col; return col;
} }
...@@ -356,6 +396,7 @@ const AddModal = props => { ...@@ -356,6 +396,7 @@ const AddModal = props => {
setType1(''); setType1('');
setType2(''); setType2('');
setFiled1({}); setFiled1({});
setCount(0);
} else if (type === 'edit') { } else if (type === 'edit') {
getParentList(); getParentList();
...@@ -383,8 +424,9 @@ const AddModal = props => { ...@@ -383,8 +424,9 @@ const AddModal = props => {
let str = data.feedbackName?.split(','); let str = data.feedbackName?.split(',');
let arr = []; let arr = [];
str?.forEach((i, index) => { str?.forEach((i, index) => {
arr.push({ key: index + 1, name: i }); arr.push({ key: index, name: i });
}); });
setCount(arr.length);
setDataSource(arr); setDataSource(arr);
setVisibleChecked(data.isSubmit === '是'); setVisibleChecked(data.isSubmit === '是');
setVisibleChecked1(data.autoAssign === '是'); setVisibleChecked1(data.autoAssign === '是');
...@@ -413,6 +455,7 @@ const AddModal = props => { ...@@ -413,6 +455,7 @@ const AddModal = props => {
setKeepTree([]); setKeepTree([]);
setKeepData([]); setKeepData([]);
setKeep([]); setKeep([]);
setCount(0);
} }
}, [visible]); }, [visible]);
...@@ -480,7 +523,11 @@ const AddModal = props => { ...@@ -480,7 +523,11 @@ const AddModal = props => {
dataSource.forEach(i => { dataSource.forEach(i => {
arr.push(i.name); arr.push(i.name);
}); });
obj.feedbackName = arr.toString(); let newArr = arr.filter(i => i !== '');
if (newArr.length === 0) {
message.warning('请选择填报内容');
} else {
obj.feedbackName = newArr.toString();
if (type === 'add') { if (type === 'add') {
CM_XWBPlan_DataEditORAdd({ CM_XWBPlan_DataEditORAdd({
...obj, ...obj,
...@@ -529,6 +576,7 @@ const AddModal = props => { ...@@ -529,6 +576,7 @@ const AddModal = props => {
}); });
} }
} }
}
}); });
} }
}); });
...@@ -675,6 +723,7 @@ const AddModal = props => { ...@@ -675,6 +723,7 @@ const AddModal = props => {
arr.push(item.accountName); arr.push(item.accountName);
}); });
setFiled(arr); setFiled(arr);
dispatch({ type: 'SET_SELECT_LIST', data: arr });
setKeepFeed(arr); setKeepFeed(arr);
} }
}); });
...@@ -1058,8 +1107,6 @@ const AddModal = props => { ...@@ -1058,8 +1107,6 @@ const AddModal = props => {
}, },
]; ];
const timeChange = e => {};
return ( return (
<Drawer <Drawer
title="模板配置" title="模板配置"
...@@ -1075,7 +1122,12 @@ const AddModal = props => { ...@@ -1075,7 +1122,12 @@ const AddModal = props => {
</Space> </Space>
} }
> >
<Form form={form} labelCol={{ span: 7 }} style={{ overflowY: 'scroll' }}> <Form
form={form}
labelCol={{ span: 7 }}
style={{ overflowY: 'scroll' }}
className={styles.dragTable}
>
<Row> <Row>
<Col span={24}> <Col span={24}>
<div className={styles.titleIcon}> <div className={styles.titleIcon}>
...@@ -1252,16 +1304,6 @@ const AddModal = props => { ...@@ -1252,16 +1304,6 @@ const AddModal = props => {
} }
name="feedbackName" name="feedbackName"
labelCol={{ span: 5 }} labelCol={{ span: 5 }}
rules={[
{
validator: (rule, value) => {
if (dataSource.length === 0) {
return Promise.reject('填报内容必填');
}
return Promise.resolve();
},
},
]}
style={{ marginBottom: '10px' }} style={{ marginBottom: '10px' }}
> >
{/* <Select {/* <Select
...@@ -1288,16 +1330,36 @@ const AddModal = props => { ...@@ -1288,16 +1330,36 @@ const AddModal = props => {
> >
请选择此设备巡检后的反馈表单,来源与类型维设备反馈的台账 请选择此设备巡检后的反馈表单,来源与类型维设备反馈的台账
</div> </div>
{stateType === 'drag'
? dataSource.length > 0 && (
<Table <Table
size="small" pagination={false}
components={components}
rowClassName={() => 'editable-row'}
bordered
dataSource={dataSource} dataSource={dataSource}
columns={columns} columns={columns}
rowKey={record => record.key}
components={{
body: {
wrapper: DraggableContainer,
row: DraggableBodyRow,
},
}}
/>
)
: dataSource.length > 0 && (
<Table
pagination={false} pagination={false}
id="box" dataSource={dataSource}
columns={columns}
rowKey={record => record.key}
rowClassName={() => 'editable-row'}
components={{
body: {
row: EditableRow,
cell: EditableCell,
},
}}
/> />
)}
</Item> </Item>
</Col> </Col>
<Col span={24}> <Col span={24}>
...@@ -1313,65 +1375,12 @@ const AddModal = props => { ...@@ -1313,65 +1375,12 @@ const AddModal = props => {
添加设备反馈 添加设备反馈
</Button> </Button>
</Col> </Col>
{/* <Col span={24}>
<Item label="执行周期" name="docycle" labelCol={{ span: 5 }}>
<TreeSelect
showSearch
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择执行周期"
allowClear
treeDefaultExpandAll
showCheckedStrategy
>
{characteristics1.map(i => mapTreeSelect(i))}
</TreeSelect>
</Item>
</Col> */}
<BaseTimeConfig <BaseTimeConfig
keepTimeData={keepTimeData} keepTimeData={keepTimeData}
ref={timeData} ref={timeData}
visible={visible} visible={visible}
type={type} type={type}
/> />
{/* <Col span={24}>
<Item label="周期模式" name="docycle1" labelCol={{ span: 5 }}>
<Radio.Group value={timeData} onChange={timeChange}>
<Radio value={1}>按小时</Radio>
<Radio value={2}>按日</Radio>
<Radio value={3}>按周</Radio>
<Radio value={4}>按月</Radio>
<Radio value={5}>按季度</Radio>
<Radio value={6}>按年</Radio>
</Radio.Group>
</Item>
</Col>
<Col span={24}>
<Item label="周期设置" labelCol={{ span: 5 }} style={{ marginBottom: '0' }}>
<Row>
<Col span={8}>
<Item name="docycle2">
<InputNumber min={1} defaultValue={1} style={{ width: '50px' }} />
</Item>
</Col>
<Col span={3}>
<div style={{ marginTop: '5px', marginLeft: '2px' }}>日</div>
</Col>
<Col span={8}>
<Item name="docycle3">
<InputNumber min={1} defaultValue={1} style={{ width: '50px' }} />
</Item>
</Col>
<Col span={3}>
<div style={{ marginTop: '5px', marginLeft: '2px' }}>次</div>
</Col>
</Row>
</Item>
</Col>
<Col span={24}>
<Item label="执行时间" name="docycle4" labelCol={{ span: 5 }}>
<Input />
</Item>
</Col> */}
<Col span={24}> <Col span={24}>
<div className={styles.titleIcon}> <div className={styles.titleIcon}>
<div className={styles.icon} /> <div className={styles.icon} />
......
...@@ -28,7 +28,7 @@ const BaseConfig = (props, ref) => { ...@@ -28,7 +28,7 @@ const BaseConfig = (props, ref) => {
const [MonthType2, setMonthType2] = useState('首'); const [MonthType2, setMonthType2] = useState('首');
const [MonthType3, setMonthType3] = useState('首'); const [MonthType3, setMonthType3] = useState('首');
const [MonthDayType1, setMonthDayType1] = useState('1'); // 月选择-日期 const [MonthDayType1, setMonthDayType1] = useState('1'); // 月选择-日期
const [MonthDayType2, setMonthDayType2] = useState('31'); // 月选择-日期 const [MonthDayType2, setMonthDayType2] = useState('28'); // 月选择-日期
const [cities, setCities] = useState('周一'); const [cities, setCities] = useState('周一');
const [secondCity, setSecondCity] = useState(cityData[provinceData[0]][0]); const [secondCity, setSecondCity] = useState(cityData[provinceData[0]][0]);
const [startLen, setstartLen] = useState(1); // 开始日期 const [startLen, setstartLen] = useState(1); // 开始日期
...@@ -123,7 +123,7 @@ const BaseConfig = (props, ref) => { ...@@ -123,7 +123,7 @@ const BaseConfig = (props, ref) => {
setMonthType1('首'); setMonthType1('首');
setMonthType2('首'); setMonthType2('首');
setMonthDayType1('1'); setMonthDayType1('1');
setMonthDayType2('31'); setMonthDayType2('28');
} }
setValue(e.target.value); setValue(e.target.value);
}; };
...@@ -214,7 +214,7 @@ const BaseConfig = (props, ref) => { ...@@ -214,7 +214,7 @@ const BaseConfig = (props, ref) => {
value > MonthDayType1 && setMonthDayType1(value); value > MonthDayType1 && setMonthDayType1(value);
} }
if (MonthType2 === '首') { if (MonthType2 === '首') {
value > MonthDayType2 && setMonthDayType2('31'); value > MonthDayType2 && setMonthDayType2('28');
} }
}} }}
options={[ options={[
...@@ -271,7 +271,7 @@ const BaseConfig = (props, ref) => { ...@@ -271,7 +271,7 @@ const BaseConfig = (props, ref) => {
setMonthDayType1(startLen); setMonthDayType1(startLen);
} }
if (MonthDayType2 < startLen) { if (MonthDayType2 < startLen) {
setMonthDayType2('31'); setMonthDayType2('28');
} }
} else if (value === 2) { } else if (value === 2) {
if (MonthType2 === '末') { if (MonthType2 === '末') {
...@@ -281,7 +281,7 @@ const BaseConfig = (props, ref) => { ...@@ -281,7 +281,7 @@ const BaseConfig = (props, ref) => {
setMonthDayType1(startLen); setMonthDayType1(startLen);
} }
if (MonthDayType2 < startLen) { if (MonthDayType2 < startLen) {
setMonthDayType2('31'); setMonthDayType2('28');
} }
} }
} }
......
/* eslint-disable no-else-return */ /* eslint-disable no-else-return */
/* eslint-disable react-hooks/rules-of-hooks */ /* eslint-disable react-hooks/rules-of-hooks */
/* eslint-disable camelcase */ /* eslint-disable camelcase */
import React, { useState, useEffect, useMemo } from 'react'; import React, { useState, createContext, useEffect, useMemo, useReducer } from 'react';
import { Space, Table, Popconfirm, Tooltip, Button, notification, Tag, message } from 'antd'; import { Space, Table, Popconfirm, Tooltip, Button, notification, Tag, message } from 'antd';
import { import {
CM_XWBPlan_DataList, CM_XWBPlan_DataList,
...@@ -23,8 +23,11 @@ import AddModalNew from './AddModalNew'; ...@@ -23,8 +23,11 @@ import AddModalNew from './AddModalNew';
import OptionEditModal from './OptionEditModal'; import OptionEditModal from './OptionEditModal';
import SortModal from './SortModal'; import SortModal from './SortModal';
import DragTable from '@/components/DragTable/DragTable'; import DragTable from '@/components/DragTable/DragTable';
import { defaultState, reducer } from './store/reducer'; // 状态管理
export const Context = createContext();
const maintenance = () => { const maintenance = () => {
const [state, dispatch] = useReducer(reducer, defaultState);
const [addVisible, setAddVisible] = useState(false); const [addVisible, setAddVisible] = useState(false);
const [addVisibleNew, setAddVisibleNew] = useState(false); const [addVisibleNew, setAddVisibleNew] = useState(false);
const [optionVisible, setOptionVisible] = useState(false); const [optionVisible, setOptionVisible] = useState(false);
...@@ -791,6 +794,7 @@ const maintenance = () => { ...@@ -791,6 +794,7 @@ const maintenance = () => {
}; };
return ( return (
<Context.Provider value={{ state, dispatch }}>
<div className={styles.maintenanceContainer}> <div className={styles.maintenanceContainer}>
<div className={styles.contentContainers}> <div className={styles.contentContainers}>
<div style={{ height: '50px', backgroundColor: 'white' }}> <div style={{ height: '50px', backgroundColor: 'white' }}>
...@@ -934,6 +938,7 @@ const maintenance = () => { ...@@ -934,6 +938,7 @@ const maintenance = () => {
/> />
</div> </div>
</div> </div>
</Context.Provider>
); );
}; };
......
...@@ -206,7 +206,8 @@ ...@@ -206,7 +206,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
} }
:global { .dragTable {
:global {
.editable-cell { .editable-cell {
position: relative; position: relative;
} }
...@@ -219,10 +220,43 @@ ...@@ -219,10 +220,43 @@
.editable-row:hover .editable-cell-value-wrap { .editable-row:hover .editable-cell-value-wrap {
padding: 4px 11px; padding: 4px 11px;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
height: 32px;
border-radius: 2px; border-radius: 2px;
} }
[data-theme='dark'] .editable-row:hover .editable-cell-value-wrap { [data-theme='dark'] .editable-row:hover .editable-cell-value-wrap {
border: 1px solid #434343; border: 1px solid #434343;
} }
.ant-table-tbody > tr > td {
padding: 8px 16px;
height: 50px;
}
.row-dragging {
background: #fafafa;
border: 1px solid #ccc;
}
.row-dragging td {
padding: 16px;
}
.row-dragging .drag-visible {
visibility: visible;
}
}
}
// 拖拽组件拖拽行样式会丢失写全局样式解决
:global {
.row-dragging {
background: #fafafa;
border: 1px solid #ccc;
}
.row-dragging td {
padding: 16px;
}
.row-dragging .drag-visible {
visibility: visible;
}
} }
/* eslint-disable no-unused-expressions */
export const defaultState = {
selectList: [],
};
export const reducer = (state, action) => {
switch (action.type) {
case 'SET_SELECT_LIST':
return { ...state, selectList: action.data };
default:
defaultState;
}
};
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