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

fix: '方案制定优化'

parent 6bf22e2b
Pipeline #80692 waiting for manual action with stages
......@@ -99,6 +99,7 @@
"@wisdom-map/basemap": "1.1.0-31",
"ace-builds": "^1.4.12",
"antd-img-crop": "^3.13.2",
"array-move": "^4.0.0",
"bizcharts": "^4.0.15",
"chalk": "2.4.2",
"compression": "1.7.4",
......
......@@ -16,7 +16,6 @@ import ChangeAdd from './changeAdd';
const { Option } = Select;
const { TextArea } = Input;
const BookConfig = props => {
const {
callBackSubmit,
type,
......
......@@ -28,7 +28,7 @@ const BaseConfig = (props, ref) => {
const [MonthType2, setMonthType2] = useState('首');
const [MonthType3, setMonthType3] = useState('首');
const [MonthDayType1, setMonthDayType1] = useState('1'); // 月选择-日期
const [MonthDayType2, setMonthDayType2] = useState('31'); // 月选择-日期
const [MonthDayType2, setMonthDayType2] = useState('28'); // 月选择-日期
const [cities, setCities] = useState('周一');
const [secondCity, setSecondCity] = useState(cityData[provinceData[0]][0]);
const [startLen, setstartLen] = useState(1); // 开始日期
......@@ -123,7 +123,7 @@ const BaseConfig = (props, ref) => {
setMonthType1('首');
setMonthType2('首');
setMonthDayType1('1');
setMonthDayType2('31');
setMonthDayType2('28');
}
setValue(e.target.value);
};
......@@ -214,7 +214,7 @@ const BaseConfig = (props, ref) => {
value > MonthDayType1 && setMonthDayType1(value);
}
if (MonthType2 === '首') {
value > MonthDayType2 && setMonthDayType2('31');
value > MonthDayType2 && setMonthDayType2('28');
}
}}
options={[
......@@ -271,7 +271,7 @@ const BaseConfig = (props, ref) => {
setMonthDayType1(startLen);
}
if (MonthDayType2 < startLen) {
setMonthDayType2('31');
setMonthDayType2('28');
}
} else if (value === 2) {
if (MonthType2 === '末') {
......@@ -281,7 +281,7 @@ const BaseConfig = (props, ref) => {
setMonthDayType1(startLen);
}
if (MonthDayType2 < startLen) {
setMonthDayType2('31');
setMonthDayType2('28');
}
}
}
......
/* eslint-disable no-else-return */
/* eslint-disable react-hooks/rules-of-hooks */
/* 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 {
CM_XWBPlan_DataList,
......@@ -23,8 +23,11 @@ import AddModalNew from './AddModalNew';
import OptionEditModal from './OptionEditModal';
import SortModal from './SortModal';
import DragTable from '@/components/DragTable/DragTable';
import { defaultState, reducer } from './store/reducer'; // 状态管理
export const Context = createContext();
const maintenance = () => {
const [state, dispatch] = useReducer(reducer, defaultState);
const [addVisible, setAddVisible] = useState(false);
const [addVisibleNew, setAddVisibleNew] = useState(false);
const [optionVisible, setOptionVisible] = useState(false);
......@@ -791,6 +794,7 @@ const maintenance = () => {
};
return (
<Context.Provider value={{ state, dispatch }}>
<div className={styles.maintenanceContainer}>
<div className={styles.contentContainers}>
<div style={{ height: '50px', backgroundColor: 'white' }}>
......@@ -934,6 +938,7 @@ const maintenance = () => {
/>
</div>
</div>
</Context.Provider>
);
};
......
......@@ -206,7 +206,8 @@
display: flex;
align-items: center;
}
:global {
.dragTable {
:global {
.editable-cell {
position: relative;
}
......@@ -219,10 +220,43 @@
.editable-row:hover .editable-cell-value-wrap {
padding: 4px 11px;
border: 1px solid #d9d9d9;
height: 32px;
border-radius: 2px;
}
[data-theme='dark'] .editable-row:hover .editable-cell-value-wrap {
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