提交 2042006f authored 作者: 钟是志's avatar 钟是志

Merge remote-tracking branch 'origin/master'

...@@ -435,7 +435,7 @@ export default class ZdyTable extends Component { ...@@ -435,7 +435,7 @@ export default class ZdyTable extends Component {
postData, postData,
modalInit, modalInit,
concealModel, // 场景设计器内置跳转函数 concealModel, // 场景设计器内置跳转函数
paddingBottom paddingBottom,
} = this.props; } = this.props;
let style = {}; let style = {};
if (formConfig.style != null) { if (formConfig.style != null) {
...@@ -475,12 +475,12 @@ export default class ZdyTable extends Component { ...@@ -475,12 +475,12 @@ export default class ZdyTable extends Component {
overflow: 'auto', overflow: 'auto',
width: '100%', width: '100%',
height: this.props.height, height: this.props.height,
paddingBottom: paddingBottom!=null?paddingBottom:'10px', paddingBottom: paddingBottom != null ? paddingBottom : '10px',
} }
: { : {
overflow: 'auto', overflow: 'auto',
width: '100%', width: '100%',
paddingBottom: paddingBottom!=null?paddingBottom:'10px', paddingBottom: paddingBottom != null ? paddingBottom : '10px',
}; };
if (!isReady) return <></>; if (!isReady) return <></>;
if (this.props.postData?.isUpdate) { if (this.props.postData?.isUpdate) {
......
@import '~antd/lib/style/themes/default.less'; @import '~antd/lib/style/themes/default.less';
@import './utils.less'; @import './utils.less';
.clearfix{ .clearfix {
width:110px; width: 110px;
height:90px; height: 90px;
} }
.headBox{ .headBox {
position: absolute; position: absolute;
top:55px; top: 55px;
right: 100px; right: 100px;
} }
.infoBox label{ .infoBox label {
width: 100px; width: 100px;
text-align: right text-align: right;
} }
.pagBox{ .pagBox {
position: relative; position: relative;
width: 100%; width: 100%;
} }
.infoBox{ .infoBox {
position: relative; position: relative;
width: 100%; width: 100%;
} }
.boxTitle{ .boxTitle {
font-size: 18px; font-size: 18px;
border-bottom: 1px solid #F0F0F0; border-bottom: 1px solid #f0f0f0;
color:#333; color: #333;
padding-bottom:10px; padding-bottom: 10px;
} }
.tableList { .tableList {
.tableListOperator { .tableListOperator {
...@@ -74,3 +73,13 @@ ...@@ -74,3 +73,13 @@
margin-right: 8px; margin-right: 8px;
} }
} }
.filter_btn {
font-size: 14px;
font-weight: 400;
color: #1998f0;
height: 30px;
background: #ffffff;
border-radius: 2px;
border-color: #1998f0;
}
...@@ -16,6 +16,8 @@ import { ...@@ -16,6 +16,8 @@ import {
Popconfirm, Popconfirm,
Tooltip, Tooltip,
Spin, Spin,
Popover,
Checkbox,
} from 'antd'; } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import PageHeaderWrapper from './PageHeaderWrapper'; import PageHeaderWrapper from './PageHeaderWrapper';
...@@ -35,6 +37,8 @@ import { isEmpty } from 'lodash'; ...@@ -35,6 +37,8 @@ import { isEmpty } from 'lodash';
import FilePreview from '@/webPublic/one_stop_public/filePreview'; import FilePreview from '@/webPublic/one_stop_public/filePreview';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig';
import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom'; import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom';
import ButtonDiy from '../../App/ButtonDiy/ButtonDiy';
import { cloneDeep } from '../../copy/index';
const FormItem = Form.Item; const FormItem = Form.Item;
let AllWidth = 0; // 表格总长度 let AllWidth = 0; // 表格总长度
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
...@@ -176,9 +180,12 @@ class FormList extends React.Component { ...@@ -176,9 +180,12 @@ class FormList extends React.Component {
showDiv: '', showDiv: '',
showMobileDiv: '', showMobileDiv: '',
isView: false, isView: false,
checkedList: [], // 复选框默认选中
cacheColumns: '', // 初始表头缓存数据 后续不做增删改查
}; };
columns = []; columns = [];
checkList = []; // 复选框内容
getOptions = () => { getOptions = () => {
const refIds = []; const refIds = [];
for (var i = 0; i < this.state.formItem.length; i++) { for (var i = 0; i < this.state.formItem.length; i++) {
...@@ -308,7 +315,6 @@ class FormList extends React.Component { ...@@ -308,7 +315,6 @@ class FormList extends React.Component {
showMobileDiv, showMobileDiv,
}); });
} }
console.log(showMobileDiv);
}; };
//渲染值 //渲染值
componentDidMount() { componentDidMount() {
...@@ -432,7 +438,20 @@ class FormList extends React.Component { ...@@ -432,7 +438,20 @@ class FormList extends React.Component {
if (datas) { if (datas) {
this.state.formItem = datas; this.state.formItem = datas;
let i = 0; let i = 0;
let cacheList = [];
let cacheChecked = [];
// 表头筛选逻辑
datas.map(item => {
cacheList.push({
label: item.title,
value: item.name,
});
cacheChecked.push(item.name);
});
this.checkList = cacheList;
this.setState({
checkedList: cacheChecked,
});
for (let t in datas) { for (let t in datas) {
if (datas[t].isPrimaryKey) this.state.primaryKey = datas[t].name; if (datas[t].isPrimaryKey) this.state.primaryKey = datas[t].name;
if (datas[t].isHidden) { if (datas[t].isHidden) {
...@@ -506,7 +525,9 @@ class FormList extends React.Component { ...@@ -506,7 +525,9 @@ class FormList extends React.Component {
this.setState({ tableWidth: (datas.length - 1) * 200 }); this.setState({ tableWidth: (datas.length - 1) * 200 });
this.columns.push(column); this.columns.push(column);
this.setState({
cacheColumns: this.columns,
});
if (datas[t].isShowQuery) { if (datas[t].isShowQuery) {
querys.push(datas[t]); querys.push(datas[t]);
if (datas[t].referenceObjId != null) { if (datas[t].referenceObjId != null) {
...@@ -994,6 +1015,30 @@ class FormList extends React.Component { ...@@ -994,6 +1015,30 @@ class FormList extends React.Component {
</Form> </Form>
); );
} }
/**
* @description: 表头筛选复选框 根据用户筛选将表头内容重置
* @param { Array<string> } 用户选择参数
* @return:
*/
CheckboxChange = checkedValues => {
if (checkedValues.length === 0) {
message.error('至少选择一项');
return;
}
const { cacheColumns } = this.state;
let initList = [];
checkedValues.map(item => {
let ary = cacheColumns.filter(data => data.dataIndex === item);
if (ary.length !== 0) {
initList.push(ary[0]);
}
});
this.columns = initList;
this.setState({
checkedList: checkedValues,
});
};
render() { render() {
const { modalVisible, selectedRows, querys, tableWidth, rights, data, isReady } = this.state; const { modalVisible, selectedRows, querys, tableWidth, rights, data, isReady } = this.state;
if (!isReady) { if (!isReady) {
...@@ -1155,8 +1200,10 @@ class FormList extends React.Component { ...@@ -1155,8 +1200,10 @@ class FormList extends React.Component {
!isEmpty(this.columns[this.columns.length - 1]) && !isEmpty(this.columns[this.columns.length - 1]) &&
this.columns[this.columns.length - 1].title === '操作' this.columns[this.columns.length - 1].title === '操作'
) { ) {
this.columns[this.columns.length - 2].width = ''; if (this.columns[this.columns.length - 2]) {
AllWidth += 100; this.columns[this.columns.length - 2].width = '';
AllWidth += 100;
}
} }
} }
const xxxx = ( const xxxx = (
...@@ -1224,6 +1271,35 @@ class FormList extends React.Component { ...@@ -1224,6 +1271,35 @@ class FormList extends React.Component {
</Popconfirm> </Popconfirm>
</span> </span>
)} )}
{rights && !rights.includes('headerFilter') ? (
''
) : (
<Popover // 划入选择栏
content={
<div
style={{
width: 150,
}}
>
<Checkbox.Group
onChange={this.CheckboxChange}
value={this.state.checkedList}
options={this.checkList}
/>
</div>
}
title="请选择表头展示"
trigger="click"
placement="bottom"
>
<Button // 表头筛选控件
className={styles.filter_btn}
icon="filter"
>
表头筛选
</Button>
</Popover>
)}
</div> </div>
{!istableCom || (this.props.value && this.props.value.columns) ? ( {!istableCom || (this.props.value && this.props.value.columns) ? (
<StandardTable <StandardTable
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论