custom/西安秦华天燃气
This commit is contained in:
parent
f6f3a42333
commit
2d15f19ddd
|
|
@ -40,7 +40,10 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) {
|
||||
if (
|
||||
(nextProps.value !== this.props.value && _.isEmpty(nextProps.value)) ||
|
||||
(nextProps.fieldConfig.value !== this.props.fieldConfig.value && _.isEmpty(nextProps.fieldConfig.value))
|
||||
) {
|
||||
this.setState({ searchKeys: [], selectedData: [] });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 业务线管理
|
||||
* 高级搜索
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button } from "antd";
|
||||
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
return (
|
||||
<div className="role-advance-search">
|
||||
<WeaInputSearch value={advanceForm.getFormParams().name}
|
||||
onChange={v => advanceForm.updateFields({ name: v })}
|
||||
onSearch={this.props.onAdvanceSearch}
|
||||
/>
|
||||
<Button type="ghost" className="wea-advanced-search text-elli"
|
||||
onClick={this.props.onOpenAdvanceSearch}>{getLabel(545754, "高级搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
.role-advance-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.wea-advanced-search {
|
||||
top: 0;
|
||||
left: -1px;
|
||||
height: 28px;
|
||||
line-height: 1;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
}
|
||||
|
||||
.wea-advanced-search:hover {
|
||||
border: 1px solid #dadada;
|
||||
color: #474747;
|
||||
}
|
||||
|
||||
.text-elli {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* 业务线管理
|
||||
* 高级搜索面板
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/9/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { roleSearchConditions } from "../conditions";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { Button } from "antd";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class AdvanceSearchPannel extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { conditions: [] };
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
this.setState({
|
||||
conditions: _.map(roleSearchConditions, item => ({
|
||||
...item, title: getLabel(item.lanId, item.title),
|
||||
items: _.map(item.items, o => {
|
||||
if (getKey(0) === "opts") {
|
||||
return {
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
options: _.map(o.options, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
|
||||
};
|
||||
}
|
||||
return { ...o, label: getLabel(o.lanId, o.label) };
|
||||
})
|
||||
}))
|
||||
}, () => advanceForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
|
||||
handleReset = () => {
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
this.setState({
|
||||
conditions: _.map(roleSearchConditions, item => ({
|
||||
...item, items: _.map(item.items, o => ({ ...o, value: "" }))
|
||||
}))
|
||||
}, () => advanceForm.resetForm());
|
||||
};
|
||||
handleFormChange = (val) => {
|
||||
const key = _.keys(val)[0];
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
if (key === "taxAgentIds" || key === "sobIds") {
|
||||
this.setState({
|
||||
conditions: _.map(roleSearchConditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
if (key === getKey(o)) {
|
||||
return { ...o, value: _.map(val[key], o => o.id).join(",") };
|
||||
}
|
||||
return { ...o, value: advanceForm.getFormParams()[getKey(o)] };
|
||||
})
|
||||
}))
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { advanceForm } } = this.props;
|
||||
const { conditions } = this.state;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="wea-advanced-searchsAd">
|
||||
{getSearchs(advanceForm, conditions, 2, false, this.handleFormChange)}
|
||||
</div>
|
||||
<div className="wea-search-buttons">
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.handleReset}>{getLabel(2022, "重置")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default AdvanceSearchPannel;
|
||||
|
||||
|
|
@ -114,3 +114,143 @@ export const roleOperatorConditions = [
|
|||
title: ""
|
||||
}
|
||||
];
|
||||
export const roleSearchConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["name"],
|
||||
fieldcol: 16,
|
||||
label: "名称",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeURL: "/api/bs/hrmsalary/taxAgent/listAuth",
|
||||
dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true,
|
||||
tableProps: {},
|
||||
isSingle: false,
|
||||
searchParamsKey: "name"
|
||||
},
|
||||
conditionType: "CUSTOMBROWSER",
|
||||
domkey: ["taxAgentIds"],
|
||||
fieldcol: 16,
|
||||
label: "个税扣缴义务人",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
type: "17"
|
||||
},
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["roleEmpIds"],
|
||||
fieldcol: 16,
|
||||
isQuickSearch: false,
|
||||
label: "成员",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeURL: "/api/bs/hrmsalary/salarysob/listAuth",
|
||||
dataParams: { filterType: "QUERY_DATA" },
|
||||
filterByName: true,
|
||||
tableProps: {},
|
||||
isSingle: false,
|
||||
searchParamsKey: "name"
|
||||
},
|
||||
conditionType: "CUSTOMBROWSER",
|
||||
domkey: ["sobIds"],
|
||||
fieldcol: 16,
|
||||
label: "薪资账套",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
browserConditionParam: {
|
||||
completeParams: {},
|
||||
conditionDataParams: {},
|
||||
dataParams: {},
|
||||
destDataParams: {},
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: false,
|
||||
linkUrl: "",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
replaceDatas: [],
|
||||
type: "17"
|
||||
},
|
||||
conditionType: "BROWSER",
|
||||
domkey: ["employeeIds"],
|
||||
fieldcol: 16,
|
||||
isQuickSearch: false,
|
||||
label: "数据",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["opts"],
|
||||
fieldcol: 16,
|
||||
label: "权限项",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
multiple: true,
|
||||
options: [
|
||||
{ key: "query", showname: "查询", lanId: 111 },
|
||||
{ key: "admin", showname: "管理", lanId: 111 }
|
||||
],
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["pages"],
|
||||
fieldcol: 16,
|
||||
label: "页面",
|
||||
lanId: 111,
|
||||
labelcol: 8,
|
||||
multiple: true,
|
||||
options: [
|
||||
{ key: "query", showname: "查询", lanId: 111 },
|
||||
{ key: "admin", showname: "管理", lanId: 111 }
|
||||
],
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true,
|
||||
title: "基本信息",
|
||||
lanId: 111,
|
||||
col: 2
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -9,12 +9,16 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaInputSearch, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import * as API from "../../apis/taxAgent";
|
||||
import "./index.less";
|
||||
import AddRoleDialog from "./components/addRoleDialog";
|
||||
import RoleDetailSetDialog from "./components/roleDetailSetDialog";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import AdvanceSearchPannel from "./components/advanceSearchPannel";
|
||||
import LogDialog from "../../components/logViewModal";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -24,9 +28,10 @@ class Index extends Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
loading: false, selectedRowKeys: [], addRoleDialog: { taxAgentId: "", visible: false },
|
||||
roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" }
|
||||
roleSetDialog: { visible: false, roleId: "", name: "", selectedKey: "" },
|
||||
logDialogVisible: false, filterConditions: "", showSearchAd: false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -35,8 +40,15 @@ class Index extends Component {
|
|||
}
|
||||
|
||||
getRoleList = () => {
|
||||
const { query, pageInfo } = this.state;
|
||||
const paylaod = { ...pageInfo, ...query };
|
||||
const { taxAgentStore: { advanceForm } } = this.props, { pageInfo } = this.state;
|
||||
const paylaod = {
|
||||
...pageInfo, ...advanceForm.getFormParams(),
|
||||
employeeIds: !_.isEmpty(advanceForm.getFormParams()["employeeIds"]) ? advanceForm.getFormParams()["employeeIds"].split(",") : [],
|
||||
opts: !_.isEmpty(advanceForm.getFormParams()["opts"]) ? advanceForm.getFormParams()["opts"].split(",") : [],
|
||||
roleEmpIds: !_.isEmpty(advanceForm.getFormParams()["roleEmpIds"]) ? advanceForm.getFormParams()["roleEmpIds"].split(",") : [],
|
||||
sobIds: !_.isEmpty(advanceForm.getFormParams()["sobIds"]) ? advanceForm.getFormParams()["sobIds"].split(",") : [],
|
||||
taxAgentIds: !_.isEmpty(advanceForm.getFormParams()["taxAgentIds"]) ? advanceForm.getFormParams()["taxAgentIds"].split(",") : []
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
API.getRoleList(paylaod).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
|
|
@ -69,8 +81,15 @@ class Index extends Component {
|
|||
<React.Fragment>
|
||||
<a href="javascript:void(0)" style={{ marginRight: 10 }}
|
||||
onClick={() => this.showRoleSetDialog(record)}>{getLabel(111, "编辑")}</a>
|
||||
<a href="javascript:void(0)"
|
||||
<a href="javascript:void(0)" style={{ marginRight: 10 }}
|
||||
onClick={() => this.deleteAuthRole([record.id])}>{getLabel(111, "删除")}</a>
|
||||
<Dropdown overlay={
|
||||
<Menu onClick={e => this.handleDropMenuClick(e.key, record.id)}>
|
||||
<Menu.Item key="log">{getLabel(545781, "操作日志")}</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0);"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment>
|
||||
)
|
||||
}]
|
||||
|
|
@ -97,23 +116,39 @@ class Index extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
handleDropMenuClick = (key, targetid = "") => {
|
||||
switch (key) {
|
||||
case "log":
|
||||
this.setState({
|
||||
logDialogVisible: true,
|
||||
filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
query, dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog
|
||||
dataSource, columns, pageInfo, loading, selectedRowKeys, addRoleDialog, roleSetDialog,
|
||||
logDialogVisible, filterConditions, showSearchAd
|
||||
} = this.state;
|
||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||
const admin = PageAndOptAuth.opts.includes("admin");
|
||||
|
||||
const dropMenuDatas = [{
|
||||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
}];
|
||||
const buttons = [
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
addRoleDialog: { taxAgentId: "", visible: true }
|
||||
})}>{getLabel(111, "新建")}</Button>,
|
||||
<Button type="ghost" disabled={_.isEmpty(selectedRowKeys)}
|
||||
onClick={() => this.deleteAuthRole(selectedRowKeys)}>{getLabel(111, "批量删除")}</Button>,
|
||||
<WeaInputSearch value={query.name} onChange={name => this.setState({ query: { name } })}
|
||||
onSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } },
|
||||
() => this.getRoleList())}/>
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.setState({ showSearchAd: true })}
|
||||
onAdvanceSearch={() => this.setState({ pageInfo: { ...pageInfo, current: 1 } },
|
||||
() => this.getRoleList())}/>
|
||||
];
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
|
|
@ -134,11 +169,17 @@ class Index extends Component {
|
|||
!admin && buttons.shift();
|
||||
!admin && buttons.shift();
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "业务线管理")} icon={<i className="icon-coms-Flow-setting"/>}
|
||||
iconBgcolor="#F14A2D" buttons={buttons} className="rolemanagement-index"
|
||||
>
|
||||
<WeaTop title={getLabel(111, "业务线管理")} icon={<i className="icon-coms-Flow-setting"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons} className="rolemanagement-index" showDropIcon dropMenuDatas={dropMenuDatas}
|
||||
onDropMenuClick={this.handleDropMenuClick}>
|
||||
<div className="rolemanagement-content">
|
||||
<div
|
||||
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<AdvanceSearchPannel onCancel={() => this.setState({ showSearchAd: false })}
|
||||
onAdSearch={() => this.setState({
|
||||
showSearchAd: false, pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getRoleList())}/>
|
||||
</div>
|
||||
<WeaTable dataSource={dataSource} columns={columns} pagination={pagination} loading={loading}
|
||||
rowSelection={rowSelection} scroll={{ y: `calc(100vh - 173px)` }} rowKey="id"/>
|
||||
{/*添加角色*/}
|
||||
|
|
@ -156,6 +197,9 @@ class Index extends Component {
|
|||
callback && callback();
|
||||
})}/>
|
||||
</div>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="authlink" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,57 @@
|
|||
.rolemanagement-index {
|
||||
.rolemanagement-content {
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
overflow-y: auto;
|
||||
padding: 16px 16px 0;
|
||||
background: rgb(246, 246, 246);
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-container {
|
||||
background: #FFF;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
.wea-search-buttons {
|
||||
border-top: 1px solid #dadada;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.wea-advanced-searchsAd {
|
||||
height: 247px;
|
||||
overflow: hidden auto;
|
||||
|
||||
.formItem-delete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -40px;
|
||||
}
|
||||
|
||||
.searchAdvanced-commonSelect {
|
||||
border-top: 1px solid #ebebeb;
|
||||
margin: 0 25px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.custom-advance-largeSpacing {
|
||||
padding-left: 26px;
|
||||
|
||||
.link {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 12px 10px 12px 26px;
|
||||
color: #2db7f5
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wea-input-focus .ant-input {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import { PAGE } from "../config";
|
|||
const { TableStore } = WeaTableNew;
|
||||
|
||||
export class TaxAgentStore {
|
||||
@observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单
|
||||
@observable roleForm = new WeaForm(); //权限-角色form表单
|
||||
@action initRoleForm = () => this.roleForm = new WeaForm();
|
||||
@observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单
|
||||
|
|
|
|||
Loading…
Reference in New Issue