Commit 26902682 authored by 皮倩雯's avatar 皮倩雯

fix: '按钮别名字段修改'

parent 3c7d865b
Pipeline #77515 canceled with stages
/* eslint-disable react-hooks/rules-of-hooks */ /* eslint-disable react-hooks/rules-of-hooks */
/* eslint-disable camelcase */ /* eslint-disable camelcase */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Space, Table, Popconfirm, Tooltip, Button, notification, Spin, Card, Input } from 'antd'; import {
Space,
Table,
Popconfirm,
Tooltip,
Button,
notification,
Spin,
Card,
Input,
Pagination,
} from 'antd';
import { import {
CM_Feedback_LoadPatrolFeedbacks, CM_Feedback_LoadPatrolFeedbacks,
CM_Feedback_RemovePatrolFeedback, CM_Feedback_RemovePatrolFeedback,
...@@ -40,6 +51,11 @@ const patrolFeedback = () => { ...@@ -40,6 +51,11 @@ const patrolFeedback = () => {
const searchValue = useRef(null); const searchValue = useRef(null);
const [keepSearch, setKeepSearch] = useState([]); const [keepSearch, setKeepSearch] = useState([]);
const [newTableData, setNewTableData] = useState([]); const [newTableData, setNewTableData] = useState([]);
const tableList = useRef({
pageIndex: 1,
pageSize: 20,
total: '',
});
const columns = [ const columns = [
{ {
...@@ -212,12 +228,13 @@ const patrolFeedback = () => { ...@@ -212,12 +228,13 @@ const patrolFeedback = () => {
const getTableList = val => { const getTableList = val => {
setTreeLoading(true); setTreeLoading(true);
CM_Feedback_LoadPatrolFeedbacks({ CM_Feedback_LoadPatrolFeedbacks({
pageIndex: 1, pageIndex: tableList.current.pageIndex,
pageSize: 999, pageSize: tableList.current.pageSize,
keyword: val ? val : searchValue.current, keyword: val ? val : searchValue.current,
}).then(res => { }).then(res => {
setTreeLoading(false); setTreeLoading(false);
if (res.code === 0) { if (res.code === 0) {
tableList.current.total = res.data.TotalCount;
let data = {}; let data = {};
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
let area = []; let area = [];
...@@ -339,6 +356,12 @@ const patrolFeedback = () => { ...@@ -339,6 +356,12 @@ const patrolFeedback = () => {
getTableList(e); getTableList(e);
}; };
const paginationChange = (page, pageSizes) => {
tableList.current.pageSize = pageSizes;
tableList.current.pageIndex = page;
getTableList();
};
return ( return (
<div className={styles.PatrolFeedbackContainer}> <div className={styles.PatrolFeedbackContainer}>
<div className={styles.contentContainers}> <div className={styles.contentContainers}>
...@@ -496,16 +519,29 @@ const patrolFeedback = () => { ...@@ -496,16 +519,29 @@ const patrolFeedback = () => {
})} })}
columns={columns} columns={columns}
dataSource={newTableData} dataSource={newTableData}
scroll={{ y: 'calc(100% - 40px)', x: 'max-content' }} scroll={{ y: '100%', x: 'max-content' }}
pagination={{ pagination={false}
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`, />
pageSizeOptions: [10, 20, 50, 100], <div
defaultPageSize: 20, style={{
showQuickJumper: true, display: 'flex',
showSizeChanger: true, justifyContent: 'flex-end',
// marginBottom: '10px',
}} }}
>
<Pagination
size="small"
showTotal={(totals, range) => `第${range[0]}-${range[1]} 条/共 ${totals} 条`}
total={tableList.current.total}
showSizeChanger
defaultPageSize={tableList.current.pageSize}
defaultCurrent={1}
pageSizeOptions={[10, 20, 50, 100]}
current={tableList.current.pageIndex}
onChange={paginationChange}
/> />
</div> </div>
</div>
{/* 添加事件 */} {/* 添加事件 */}
<AddModal <AddModal
visible={addVisible} visible={addVisible}
......
...@@ -95,8 +95,6 @@ ...@@ -95,8 +95,6 @@
position: relative; position: relative;
transition: width 0.5s; transition: width 0.5s;
.title { .title {
margin: 16px 0 10px 16px; margin: 16px 0 10px 16px;
display: inline-block; display: inline-block;
...@@ -141,7 +139,7 @@ ...@@ -141,7 +139,7 @@
} }
.ant-table-wrapper { .ant-table-wrapper {
height: calc(100% - 50px); height: calc(100% - 100px);
.ant-table { .ant-table {
height: calc(100% - 45px); height: calc(100% - 45px);
...@@ -169,14 +167,10 @@ ...@@ -169,14 +167,10 @@
} }
} }
.ant-card-body { .ant-card-body {
padding: 12px 24px 24px 24px; padding: 12px 24px 24px 24px;
} }
.pickItem { .pickItem {
background-color: #f5f6f9; background-color: #f5f6f9;
} }
...@@ -186,7 +180,8 @@ ...@@ -186,7 +180,8 @@
height: 38rem; height: 38rem;
overflow-y: scroll; overflow-y: scroll;
.ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before { .ant-form-item-label
> label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before {
display: none; display: none;
} }
......
...@@ -1049,20 +1049,18 @@ const FlowChart = props => { ...@@ -1049,20 +1049,18 @@ const FlowChart = props => {
// currentNode.current = list; // currentNode.current = list;
let flowNodeBackfillConfigs = currentNode.current.FlowNodeBackfillConfigs; let flowNodeBackfillConfigs = currentNode.current.FlowNodeBackfillConfigs;
currentNode.current.FlowNodeBackfillConfigs = jsonData(flowNodeBackfillConfigs); currentNode.current.FlowNodeBackfillConfigs = jsonData(flowNodeBackfillConfigs);
let data = isJSON(currentNode.current.ButAliasNameConfig); let data = isJSON(currentNode.current.BtnAliasNameConfig);
console.log(data); // currentNode.current.BtnAliasNameConfig &&
debugger; // JSON.parse(currentNode.current.BtnAliasNameConfig.toString()).saveButAliasName;
// currentNode.current.ButAliasNameConfig && if (currentNode.current.BtnAliasNameConfig) {
// JSON.parse(currentNode.current.ButAliasNameConfig.toString()).saveButAliasName;
if (currentNode.current.ButAliasNameConfig) {
if (!data) { if (!data) {
let butAliasNameConfig = JSON.stringify({ let BtnAliasNameConfig = JSON.stringify({
saveButAliasName: currentNode.current.ButAliasNameConfig, saveButAliasName: currentNode.current.BtnAliasNameConfig,
}); });
currentNode.current.ButAliasNameConfig = butAliasNameConfig; currentNode.current.BtnAliasNameConfig = BtnAliasNameConfig;
} }
} else { } else {
currentNode.current.ButAliasNameConfig = ''; currentNode.current.BtnAliasNameConfig = '';
} }
FlowNodeSave({ FlowNodeSave({
PreviewImage: response.data, PreviewImage: response.data,
...@@ -1311,21 +1309,21 @@ const FlowChart = props => { ...@@ -1311,21 +1309,21 @@ const FlowChart = props => {
console.log(diagramObj.nodeDataArray); console.log(diagramObj.nodeDataArray);
diagramObj.nodeDataArray.map(i => { diagramObj.nodeDataArray.map(i => {
i.FlowNodeBackfillConfigs = jsonData(i.FlowNodeBackfillConfigs); i.FlowNodeBackfillConfigs = jsonData(i.FlowNodeBackfillConfigs);
let data = isJSON(i.ButAliasNameConfig); let data = isJSON(i.BtnAliasNameConfig);
console.log(data); console.log(data);
debugger; debugger;
// let data = // let data =
// i.ButAliasNameConfig && // i.BtnAliasNameConfig &&
// JSON.parse(i.ButAliasNameConfig.toString()).saveButAliasName; // JSON.parse(i.BtnAliasNameConfig.toString()).saveButAliasName;
if (i.ButAliasNameConfig) { if (i.BtnAliasNameConfig) {
if (!data) { if (!data) {
let butAliasNameConfig = JSON.stringify({ let BtnAliasNameConfig = JSON.stringify({
saveButAliasName: i.ButAliasNameConfig, saveButAliasName: i.BtnAliasNameConfig,
}); });
i.ButAliasNameConfig = butAliasNameConfig; i.BtnAliasNameConfig = BtnAliasNameConfig;
} }
} else { } else {
i.ButAliasNameConfig = ''; i.BtnAliasNameConfig = '';
} }
}); });
SaveNodeChange({ SaveNodeChange({
......
...@@ -15,20 +15,20 @@ const ConfigOperate = (props, ref) => { ...@@ -15,20 +15,20 @@ const ConfigOperate = (props, ref) => {
Transferable, Transferable,
// EventsInformation, // EventsInformation,
// IsSendMessage, // IsSendMessage,
ButAliasNameConfig, BtnAliasNameConfig,
IsSave, IsSave,
AutoClose, AutoClose,
HalfwayClose, HalfwayClose,
} = editMsg; } = editMsg;
let newButAliasNameConfig; let newBtnAliasNameConfig;
if (ButAliasNameConfig) { if (BtnAliasNameConfig) {
newButAliasNameConfig = JSON.parse(ButAliasNameConfig).saveButAliasName; newBtnAliasNameConfig = JSON.parse(BtnAliasNameConfig).saveButAliasName;
} }
const obj = { const obj = {
Transferable: Transferable === 1, Transferable: Transferable === 1,
// EventsInformation: EventsInformation === 1, // EventsInformation: EventsInformation === 1,
// IsSendMessage: IsSendMessage === 1, // IsSendMessage: IsSendMessage === 1,
ButAliasNameConfig: newButAliasNameConfig, BtnAliasNameConfig: newBtnAliasNameConfig,
IsSave: IsSave === 1, IsSave: IsSave === 1,
AutoClose: AutoClose === '是', AutoClose: AutoClose === '是',
HalfwayClose: HalfwayClose === 1, HalfwayClose: HalfwayClose === 1,
...@@ -158,7 +158,7 @@ const ConfigOperate = (props, ref) => { ...@@ -158,7 +158,7 @@ const ConfigOperate = (props, ref) => {
> >
<Row> <Row>
<Col span={18}> <Col span={18}>
<Form.Item name="ButAliasNameConfig" style={{ marginBottom: '0' }}> <Form.Item name="BtnAliasNameConfig" style={{ marginBottom: '0' }}>
<Input placeholder="请输入暂存按钮别名" style={{ width: '180px' }} /> <Input placeholder="请输入暂存按钮别名" style={{ width: '180px' }} />
</Form.Item> </Form.Item>
</Col> </Col>
......
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