feature/2.15.1.2407.01-权限
This commit is contained in:
parent
9a33cc96c6
commit
e5d43e7dc5
|
|
@ -97,7 +97,6 @@ class CustomBrowserDialog extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onLeftListCheck = (keys, datas) => {
|
onLeftListCheck = (keys, datas) => {
|
||||||
const { leftListSelectedData } = this.state;
|
const { leftListSelectedData } = this.state;
|
||||||
let targets = leftListSelectedData.concat(datas);
|
let targets = leftListSelectedData.concat(datas);
|
||||||
|
|
@ -154,6 +153,31 @@ class CustomBrowserDialog extends Component {
|
||||||
}
|
}
|
||||||
return bool;
|
return bool;
|
||||||
};
|
};
|
||||||
|
renderTitle = () => {
|
||||||
|
const { dialogType, searchParamsKey, isSingle } = this.props, {
|
||||||
|
query, pageInfo, selectedRowKeys, singleFilterVal
|
||||||
|
} = this.state;
|
||||||
|
return (<div className="wea-hr-muti-dialog-title">
|
||||||
|
<span>{getLabel(111, "数据选择")}</span>
|
||||||
|
{
|
||||||
|
dialogType === "table" ?
|
||||||
|
<WeaInputSearch
|
||||||
|
value={query[searchParamsKey]} style={{ width: 220 }}
|
||||||
|
onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })}
|
||||||
|
onSearch={() => {
|
||||||
|
this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => {
|
||||||
|
this.getData();
|
||||||
|
selectedRowKeys.forEach((v) => {
|
||||||
|
let item = this.getItemById(v);
|
||||||
|
if (item) this.selectedData[v] = item;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}}/> : isSingle ?
|
||||||
|
<WeaInputSearch value={singleFilterVal} onChange={singleFilterVal => this.setState({ singleFilterVal })}/> :
|
||||||
|
<div/>
|
||||||
|
}
|
||||||
|
</div>);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
|
|
@ -161,7 +185,7 @@ class CustomBrowserDialog extends Component {
|
||||||
singleFilterVal
|
singleFilterVal
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props;
|
const { dialogType, tableProps: { rowKey, columns }, isSingle, searchParamsKey } = this.props;
|
||||||
const sheight = this.dialog ? this.dialog.state.height - 55 : 260;
|
const sheight = this.dialog ? this.dialog.state.height - 116 : 260;
|
||||||
const buttons = [
|
const buttons = [
|
||||||
<Button type="primary" onClick={this.handleOk}
|
<Button type="primary" onClick={this.handleOk}
|
||||||
disabled={dialogType !== "table" && _.isEmpty(rightDatas)}>{getLabel(111, "确 定")}</Button>,
|
disabled={dialogType !== "table" && _.isEmpty(rightDatas)}>{getLabel(111, "确 定")}</Button>,
|
||||||
|
|
@ -172,7 +196,7 @@ class CustomBrowserDialog extends Component {
|
||||||
if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true;
|
if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true;
|
||||||
if (rightDatas && rightDatas.length > 0) rightAllActive = true;
|
if (rightDatas && rightDatas.length > 0) rightAllActive = true;
|
||||||
let dom = <Spin spinning={loading}>
|
let dom = <Spin spinning={loading}>
|
||||||
<div style={{ padding: 10, height: "100%" }} className="wea-hr-muti-dialog">
|
<div className="wea-hr-muti-dialog">
|
||||||
{
|
{
|
||||||
!isSingle ? <React.Fragment>
|
!isSingle ? <React.Fragment>
|
||||||
<div className="wea-hr-muti-input-left">
|
<div className="wea-hr-muti-input-left">
|
||||||
|
|
@ -184,7 +208,7 @@ class CustomBrowserDialog extends Component {
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<div>
|
<div>
|
||||||
<WeaNewScroll height={sheight}>
|
<WeaNewScroll height={this.dialog ? this.dialog.state.height - 51 : 260}>
|
||||||
<CustomBrowserMutiLeft
|
<CustomBrowserMutiLeft
|
||||||
filterData={rightDatas}
|
filterData={rightDatas}
|
||||||
datas={listDatas}
|
datas={listDatas}
|
||||||
|
|
@ -209,19 +233,16 @@ class CustomBrowserDialog extends Component {
|
||||||
</div>
|
</div>
|
||||||
<div className="wea-hr-muti-input-right">
|
<div className="wea-hr-muti-input-right">
|
||||||
<CustomBrowserMutiRight
|
<CustomBrowserMutiRight
|
||||||
height={sheight} data={rightDatas} checkedKeys={rightCheckedKeys}
|
height={this.dialog ? this.dialog.state.height - 51 : 260}
|
||||||
|
data={rightDatas} checkedKeys={rightCheckedKeys}
|
||||||
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
|
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
|
||||||
onDoubleClick={this.onRightDoubleClick}
|
onDoubleClick={this.onRightDoubleClick}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment> :
|
</React.Fragment> :
|
||||||
<React.Fragment>
|
<WeaTransferList height={this.dialog ? this.dialog.state.height - 16 : 260} checkedKeys={[]}
|
||||||
<WeaInputSearch value={singleFilterVal} style={{ width: "100%", marginBottom: 10 }}
|
checkedCb={([id]) => this.handleRowClick(_.find(listDatas, item => item.id === id))}
|
||||||
onChange={singleFilterVal => this.setState({ singleFilterVal })}/>
|
data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/>
|
||||||
<WeaTransferList height={this.dialog ? this.dialog.state.height - 65 : 260} checkedKeys={[]}
|
|
||||||
checkedCb={([id]) => this.handleRowClick(_.find(listDatas, item => item.id === id))}
|
|
||||||
data={listDatas.filter((item) => item.name.indexOf(_.trim(singleFilterVal)) > -1)}/>
|
|
||||||
</React.Fragment>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</Spin>;
|
</Spin>;
|
||||||
|
|
@ -257,33 +278,20 @@ class CustomBrowserDialog extends Component {
|
||||||
selectedRowKeys,
|
selectedRowKeys,
|
||||||
onChange: selectedRowKeys => this.setState({ selectedRowKeys })
|
onChange: selectedRowKeys => this.setState({ selectedRowKeys })
|
||||||
};
|
};
|
||||||
dom = <React.Fragment>
|
dom = <div className="wea-hr-muti-input-table">
|
||||||
<WeaInputSearch value={query[searchParamsKey]} className="tableSearch"
|
|
||||||
onChange={value => this.setState({ query: { ...query, [searchParamsKey]: value } })}
|
|
||||||
onSearch={() => {
|
|
||||||
this.setState({ pageInfo: { ...pageInfo, current: 1 } }, () => {
|
|
||||||
this.getData();
|
|
||||||
selectedRowKeys.forEach((v) => {
|
|
||||||
let item = this.getItemById(v);
|
|
||||||
if (item) this.selectedData[v] = item;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}}/>
|
|
||||||
<WeaTable dataSource={listDatas} loading={loading} pagination={pagination} scroll={{ y: sheight }}
|
<WeaTable dataSource={listDatas} loading={loading} pagination={pagination} scroll={{ y: sheight }}
|
||||||
onRowClick={this.handleRowClick} rowSelection={!isSingle ? rowSelection : null}
|
onRowClick={this.handleRowClick} rowSelection={!isSingle ? rowSelection : null}
|
||||||
rowKey={rowKey || "id"} columns={columns}/>
|
rowKey={rowKey || "id"} columns={columns}/>
|
||||||
</React.Fragment>;
|
</div>;
|
||||||
}
|
}
|
||||||
dialogType === "table" && isSingle && buttons.splice(0, 1);
|
dialogType === "table" && isSingle && buttons.splice(0, 1);
|
||||||
return (
|
return (
|
||||||
<WeaDialog
|
<WeaDialog
|
||||||
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={getLabel(111, "数据选择")}
|
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={this.renderTitle()}
|
||||||
className="custom_browser_dialog" style={{
|
className="custom_browser_dialog" draggable={false} style={{
|
||||||
width: 784, height: 460, minHeight: 200, minWidth: 380,
|
width: 784, height: 460, minHeight: 200, minWidth: 380,
|
||||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||||
}} buttons={buttons}>
|
}} buttons={buttons}>{dom}</WeaDialog>
|
||||||
{dom}
|
|
||||||
</WeaDialog>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,18 @@
|
||||||
.custom_browser_dialog {
|
.custom_browser_dialog {
|
||||||
.tableSearch {
|
.wea-hr-muti-dialog-title {
|
||||||
float: right;
|
display: flex;
|
||||||
margin: 16px;
|
justify-content: space-between;
|
||||||
position: relative;
|
align-items: center;
|
||||||
z-index: 99;
|
}
|
||||||
min-width: 200px;
|
|
||||||
|
.wea-hr-muti-input-table {
|
||||||
|
background: #f6f6f6;
|
||||||
|
padding: 8px 16px;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.wea-new-table {
|
||||||
|
background: #FFF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-spin-nested-loading, .ant-spin-container {
|
.ant-spin-nested-loading, .ant-spin-container {
|
||||||
|
|
@ -12,6 +20,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.wea-hr-muti-dialog {
|
.wea-hr-muti-dialog {
|
||||||
|
height: 100%;
|
||||||
|
background: #f6f6f6;
|
||||||
|
padding: 8px 16px;
|
||||||
|
|
||||||
|
.wea-hr-muti-input-left, .wea-hr-muti-input-right {
|
||||||
|
background: #FFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wea-transfer-list {
|
||||||
|
background: #FFF;
|
||||||
|
border: 1px solid #e9e9e9;
|
||||||
|
}
|
||||||
|
|
||||||
.wea-input-focus {
|
.wea-input-focus {
|
||||||
height: 35px !important;
|
height: 35px !important;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,12 @@ class Index extends Component {
|
||||||
(col.column === "jfValue" || col.column === "dfValue") ? "INPUTNUMBER" : "custom",
|
(col.column === "jfValue" || col.column === "dfValue") ? "INPUTNUMBER" : "custom",
|
||||||
viewAttr: !pzlxEnum.includes(pzlx) ? 2 : 1,
|
viewAttr: !pzlxEnum.includes(pzlx) ? 2 : 1,
|
||||||
render: (text, record, index, onEdit) => {
|
render: (text, record, index, onEdit) => {
|
||||||
const value = _.isArray(text) ? _.map(text, o => o.bh).join(",") : !_.isNil(text) ? text.bh : "";
|
const value = _.isArray(text) ? _.map(text, o => o.bh).join(",") : (!_.isNil(text) && text.bh) ? text.bh : text;
|
||||||
const replaceDatas = _.isArray(text) ? _.map(text, o => ({
|
const replaceDatas = _.isArray(text) ? _.map(text, o => ({
|
||||||
...o, id: o.bh, name: `${o.fzhslx}:${o.bh}/${o.mc}`
|
...o, id: o.bh, name: `${o.fzhslx}:${o.bh}/${o.mc}`
|
||||||
})) : !_.isNil(text) ? [{ ...text, id: text.bh, name: `${text.fzhslx}:${text.bh}/${text.mc}` }] : [];
|
})) : (!_.isNil(text) && text.bh) ? [{
|
||||||
|
...text, id: text.bh, name: `${text.fzhslx}:${text.bh}/${text.mc}`
|
||||||
|
}] : [];
|
||||||
const fzhslxEnum = { "fzhsXmqs": 0, "fzhsFwlb": 1, "fzhsSllb": 2, "fzhsKs": 3 };
|
const fzhslxEnum = { "fzhsXmqs": 0, "fzhsFwlb": 1, "fzhsSllb": 2, "fzhsKs": 3 };
|
||||||
return <CustomBrowser
|
return <CustomBrowser
|
||||||
fieldConfig={{
|
fieldConfig={{
|
||||||
|
|
@ -76,9 +78,11 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
value={value}
|
value={value}
|
||||||
onChange={(value) => onEdit({
|
onChange={(value) => {
|
||||||
record: { ...record, [col["column"]]: value }, index
|
onEdit({
|
||||||
})}
|
record: { ...record, [col["column"]]: value }, index, key: "custom", value
|
||||||
|
});
|
||||||
|
}}
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue