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

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

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