添加页面操作按钮操作权限
This commit is contained in:
parent
ae70da48be
commit
2a8aac2068
|
|
@ -38,7 +38,7 @@ export default class SlideModalTitle extends React.Component {
|
|||
<div className="btnWrapper">
|
||||
{this.props.btns}
|
||||
{
|
||||
this.state.editable && <Button type="primary" className="saveBtn" onClick={this.props.onSave}>保存</Button>
|
||||
this.props.showOperateBtn && this.state.editable && <Button type="primary" className="saveBtn" onClick={this.props.onSave}>保存</Button>
|
||||
}
|
||||
{this.props.customOperate}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const { RangePicker } = DatePicker;
|
|||
const { Option } = Select
|
||||
|
||||
|
||||
@inject('attendanceStore')
|
||||
@inject('attendanceStore', 'taxAgentStore')
|
||||
@observer
|
||||
export default class Attendance extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -224,7 +224,7 @@ export default class Attendance extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { attendanceStore } = this.props;
|
||||
const { attendanceStore, taxAgentStore: {showOperateBtn} } = this.props;
|
||||
const { modalParam } = this.state;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = attendanceStore;
|
||||
const { step, setStep, setSlideVisiable, slideVisiable, doBatchDelete, attendTableStore, fieldSettingAttendList, fieldSettingCustomList, setFieldSettingAttendList, setFieldSettingCustomList, searchFieldSettingList } = attendanceStore;
|
||||
|
|
@ -274,10 +274,11 @@ export default class Attendance extends React.Component {
|
|||
}];
|
||||
|
||||
const renderSearchOperationItem = () => {
|
||||
return <div>
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
return showOperateBtn ? <div>
|
||||
<Button type="primary" style={{ marginRight: '10px' }} onClick={() => { this.setState({ refereAttendFormVisible: true }) }}>引用</Button>
|
||||
<Button type="default" onClick={() => { this.setState({ modalVisiable: true}); setStep(0) }}>导入</Button>
|
||||
</div>
|
||||
</div> : null
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -351,7 +352,10 @@ export default class Attendance extends React.Component {
|
|||
const renderCustomOperate = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Dropdown.Button overlay={menu} type="primary">导出</Dropdown.Button>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Dropdown.Button overlay={menu} type="primary">导出</Dropdown.Button>
|
||||
}
|
||||
<WeaInputSearch
|
||||
placeholder="请输入姓名/部门/工号/手机号"
|
||||
onChange={(v) => {this.setState({searchValue: v})}}
|
||||
|
|
@ -376,7 +380,10 @@ export default class Attendance extends React.Component {
|
|||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Button type="primary" style={{marginRight: "10px"}} onClick={() => handleNewClick()}>新建</Button>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Button type="primary" style={{marginRight: "10px"}} onClick={() => handleNewClick()}>新建</Button>
|
||||
}
|
||||
<WeaInputSearch value={this.state.fieldName} onChange={(value) => {this.setState({fieldName: value})}} onSearch={(value) => {
|
||||
this.setState({fieldSettingSearchValue: value})
|
||||
handleItemSearch(value)
|
||||
|
|
@ -431,7 +438,7 @@ export default class Attendance extends React.Component {
|
|||
return <a onClick={() => {this.onItemEdit(record)}}
|
||||
dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
case "enableStatus":
|
||||
return <Switch checked={text == '1'} onChange={(value) => {handleSwitchItemChange(record, value)}}/>
|
||||
return <Switch checked={text == '1'} disabled={!showOperateBtn} onChange={(value) => {handleSwitchItemChange(record, value)}}/>
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }} />
|
||||
}
|
||||
|
|
@ -663,6 +670,7 @@ export default class Attendance extends React.Component {
|
|||
<SlideModalTitle
|
||||
subtitle={"考勤数据"}
|
||||
editable={false}
|
||||
showOperateBtn={showOperateBtn}
|
||||
customOperate={
|
||||
renderCustomOperate()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ export default class CumDeduct extends React.Component {
|
|||
previewImport,
|
||||
importFile,
|
||||
} = cumDeductStore;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const { taxAgentOption, showOperateBtn } = taxAgentStore;
|
||||
const {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
|
|
@ -502,7 +502,7 @@ export default class CumDeduct extends React.Component {
|
|||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
buttons={btns}>
|
||||
buttons={showOperateBtn ? btns : []}>
|
||||
<div className="weaTabWrapper">
|
||||
<WeaTab
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
|
|
@ -575,7 +575,8 @@ export default class CumDeduct extends React.Component {
|
|||
this.state.currentOperate == "add" ? doSave() : doUpdate();
|
||||
}}
|
||||
editable={false}
|
||||
btns={renderBtns()}
|
||||
showOperateBtn={showOperateBtn}
|
||||
btns={showOperateBtn ? renderBtns() : null}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ export default class CumSituation extends React.Component {
|
|||
previewImport,
|
||||
importFile,
|
||||
} = cumSituationStore;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const { taxAgentOption, showOperateBtn } = taxAgentStore;
|
||||
const {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
|
|
@ -509,7 +509,7 @@ export default class CumSituation extends React.Component {
|
|||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
buttons={btns}>
|
||||
buttons={showOperateBtn ? btns : []}>
|
||||
<div className="weaTabWrapper">
|
||||
<WeaTab
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
|
|
@ -580,7 +580,8 @@ export default class CumSituation extends React.Component {
|
|||
this.state.currentOperate == "add" ? doSave() : doUpdate();
|
||||
}}
|
||||
editable={false}
|
||||
btns={renderBtns()}
|
||||
showOperateBtn={showOperateBtn}
|
||||
btns={showOperateBtn ? renderBtns() : null}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ export default class OtherDeduct extends React.Component {
|
|||
previewImport,
|
||||
importFile,
|
||||
} = otherDeductStore;
|
||||
const { taxAgentOption } = taxAgentStore;
|
||||
const { taxAgentOption, showOperateBtn } = taxAgentStore;
|
||||
const {
|
||||
slideVisiable,
|
||||
setSlideVisiable,
|
||||
|
|
@ -502,7 +502,7 @@ export default class OtherDeduct extends React.Component {
|
|||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
buttons={btns}>
|
||||
buttons={showOperateBtn ? btns : []}>
|
||||
<div className="weaTabWrapper">
|
||||
<WeaTab
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
|
|
@ -573,7 +573,8 @@ export default class OtherDeduct extends React.Component {
|
|||
this.state.currentOperate == "add" ? doSave() : doUpdate();
|
||||
}}
|
||||
editable={false}
|
||||
btns={renderBtns()}
|
||||
showOperateBtn={showOperateBtn}
|
||||
btns={showOperateBtn ? renderBtns() : null}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
|
|
|
|||
|
|
@ -81,8 +81,13 @@ export default class MySalary extends React.Component {
|
|||
// 区间改变事件
|
||||
handleSalaryRangePickerChange(range) {
|
||||
const { mySalaryStore : {mySalaryBillList}} = this.props;
|
||||
this.range = range.map(item => moment(item).format("YYYY-MM"))
|
||||
mySalaryBillList(this.range, this.pageInfo)
|
||||
const isNull= _.every(range, it=> !!it)
|
||||
if(!_.isEmpty(range) && isNull){
|
||||
this.range = range.map(item => moment(item).format("YYYY-MM"))
|
||||
mySalaryBillList(this.range, this.pageInfo)
|
||||
}else{
|
||||
mySalaryBillList([], this.pageInfo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from "react";
|
||||
import React, { Fragment } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
|
|
@ -47,7 +47,7 @@ const { MonthPicker } = DatePicker;
|
|||
import "./index.less";
|
||||
import CustomTable from "../../components/customTable";
|
||||
|
||||
@inject("salaryFileStore")
|
||||
@inject("salaryFileStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class SalaryFile extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -174,20 +174,24 @@ export default class SalaryFile extends React.Component {
|
|||
|
||||
// 查看 Slide 头部操作按钮
|
||||
renderEditSlideOperate() {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
return (
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Dropdown.Button
|
||||
type="primary"
|
||||
overlay={
|
||||
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
|
||||
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
onClick={() => {
|
||||
this.setState({ changeSalaryVisible: true });
|
||||
}}>
|
||||
调薪
|
||||
</Dropdown.Button>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Dropdown.Button
|
||||
type="primary"
|
||||
overlay={
|
||||
<Menu onClick={this.handSildeOptionMenuClick.bind(this)}>
|
||||
<Menu.Item key="1">调整个税扣缴义务人</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
onClick={() => {
|
||||
this.setState({ changeSalaryVisible: true });
|
||||
}}>
|
||||
调薪
|
||||
</Dropdown.Button>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -351,36 +355,42 @@ export default class SalaryFile extends React.Component {
|
|||
);
|
||||
|
||||
const renderRightOperation = () => {
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
return (
|
||||
<div
|
||||
style={{ display: "inline-block", position: "relative" }}
|
||||
className="salaryFileTabWrapper">
|
||||
<WeaHelpfulTip
|
||||
style={{ marginRight: "10px" }}
|
||||
width={300}
|
||||
title="导入按钮使用场景说明:<br/>
|
||||
1.档案初始化:<br/>
|
||||
a.初次使用薪酬模块,全量导入员工的薪资档案数据;<br/>
|
||||
b.员工入职,导入新入职的员工的薪资档案数据(若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入);<br/>
|
||||
c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴;<br/>
|
||||
2.调薪:档案中已存在的人员批量调整薪资项目值(包括返聘人员的情况);<br/>
|
||||
3.调整个税扣缴义务人:档案中已存在的人员批量调整个税扣缴义务人(包括返聘人员的情况);<br/>"
|
||||
placement="topLeft"
|
||||
/>
|
||||
<Dropdown.Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
overlay={menu}>
|
||||
导入
|
||||
</Dropdown.Button>
|
||||
<Dropdown.Button
|
||||
style={{ marginRight: "10px" }}
|
||||
overlay={menu2}
|
||||
onClick={() => {
|
||||
this.handleExportAll();
|
||||
}}>
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Fragment>
|
||||
<WeaHelpfulTip
|
||||
style={{ marginRight: "10px" }}
|
||||
width={300}
|
||||
title="导入按钮使用场景说明:<br/>
|
||||
1.档案初始化:<br/>
|
||||
a.初次使用薪酬模块,全量导入员工的薪资档案数据;<br/>
|
||||
b.员工入职,导入新入职的员工的薪资档案数据(若导入表格中的人员已存在在薪资档案中,初始化导入会将档案中该人员的数据清除再导入);<br/>
|
||||
c.返聘人员使用调薪功能调整薪资档案值或使用调整个税扣缴;<br/>
|
||||
2.调薪:档案中已存在的人员批量调整薪资项目值(包括返聘人员的情况);<br/>
|
||||
3.调整个税扣缴义务人:档案中已存在的人员批量调整个税扣缴义务人(包括返聘人员的情况);<br/>"
|
||||
placement="topLeft"
|
||||
/>
|
||||
<Dropdown.Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
overlay={menu}>
|
||||
导入
|
||||
</Dropdown.Button>
|
||||
<Dropdown.Button
|
||||
style={{ marginRight: "10px" }}
|
||||
overlay={menu2}
|
||||
onClick={() => {
|
||||
this.handleExportAll();
|
||||
}}>
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
</Fragment>
|
||||
}
|
||||
<Button
|
||||
type="default"
|
||||
style={{ marginRight: "10px" }}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import CustomPaginationTable from '../../components/customPaginationTable';
|
|||
const { MonthPicker } = DatePicker;
|
||||
|
||||
|
||||
@inject('salaryItemStore')
|
||||
@inject('salaryItemStore', 'taxAgentStore')
|
||||
@observer
|
||||
export default class SalaryItem extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -85,7 +85,7 @@ export default class SalaryItem extends React.Component {
|
|||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
getColumns = () => {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { salaryItemStore, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { tableColumns} = salaryItemStore
|
||||
let columns = tableColumns.map(column => {
|
||||
let newColumn = column;
|
||||
|
|
@ -109,7 +109,7 @@ export default class SalaryItem extends React.Component {
|
|||
title: "操作",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<a onClick={() => {this.onEditItem(record, true)}}>编辑</a>
|
||||
<a onClick={() => {this.onEditItem(record, true)}}>{ showOperateBtn ? '编辑' : '查看' }</a>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
@ -175,7 +175,7 @@ export default class SalaryItem extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { salaryItemStore, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = salaryItemStore;
|
||||
const { tableDataSource, tableColumns, systemItemVisible, setSystemItemVisible, deleteItemVisible, setDeleteItemVisible, deleteItemList, editSlideVisible, setEditSlideVisible, request, pageInfo } = salaryItemStore
|
||||
const { formalModalVisible} = this.state;
|
||||
|
|
@ -238,8 +238,12 @@ export default class SalaryItem extends React.Component {
|
|||
);
|
||||
|
||||
const renderRightOperation = () => {
|
||||
const { taxAgentStore: { showOperateBtn } }= this.props;
|
||||
return (<div style={{display: "inline-block"}}>
|
||||
<Dropdown.Button overlay={menu} type="primary" style={{marginRight: "10px"}}>新增</Dropdown.Button>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Dropdown.Button overlay={menu} type="primary" style={{marginRight: "10px"}}>新增</Dropdown.Button>
|
||||
}
|
||||
<WeaInputSearch value={this.state.searchValue} onChange={(value) => {this.setState({searchValue: value})}} onSearch={(value) => {this.handleSearch(value)}}/>
|
||||
</div>)
|
||||
|
||||
|
|
@ -348,7 +352,7 @@ export default class SalaryItem extends React.Component {
|
|||
<SlideModalTitle
|
||||
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
|
||||
editable={false}
|
||||
customOperate={renderCustomOperate()}
|
||||
customOperate={showOperateBtn ? renderCustomOperate() : null}
|
||||
subItemChange={
|
||||
(item) => {this.setState({selectedTab: item.key})}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import ImportModal from '../../../components/importModal';
|
|||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
@inject('archivesStore')
|
||||
@inject('archivesStore','taxAgentStore')
|
||||
@observer
|
||||
export default class Archives extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -58,7 +58,7 @@ export default class Archives extends React.Component {
|
|||
}
|
||||
|
||||
getColumns() {
|
||||
const { archivesStore: {tableStore}} = this.props;
|
||||
const { archivesStore: {tableStore}, taxAgentStore: { showOperateBtn }} = this.props;
|
||||
let columns = [...tableStore.columns]
|
||||
columns = columns.filter(item => item.hide == "false")
|
||||
columns.map(item => {
|
||||
|
|
@ -71,7 +71,7 @@ export default class Archives extends React.Component {
|
|||
width: "100px",
|
||||
height: "auto",
|
||||
render: (text, record) => {
|
||||
return (<a onClick={() => {this.handleEdit(record)}}>编辑</a>)
|
||||
return (<a onClick={() => {this.handleEdit(record)}}>{showOperateBtn ? '编辑' : '查看'}</a>)
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
|
|
@ -158,7 +158,7 @@ export default class Archives extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { archivesStore } = this.props;
|
||||
const { archivesStore, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { selectedTab, selectedRowKeys } = this.state;
|
||||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd,
|
||||
previewCurDataColumns, previewCurDataDataSource, importResult, initImportParams
|
||||
|
|
@ -201,7 +201,6 @@ export default class Archives extends React.Component {
|
|||
// 导出选中
|
||||
const handleMenuClick = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
console.log("selectedRowKeys:", selectedRowKeys);
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择任何条目", 1);
|
||||
return
|
||||
|
|
@ -245,7 +244,7 @@ export default class Archives extends React.Component {
|
|||
showDropIcon={true} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
buttons={btns}
|
||||
buttons={showOperateBtn ? btns : []}
|
||||
>
|
||||
|
||||
<WeaTab
|
||||
|
|
@ -304,7 +303,7 @@ export default class Archives extends React.Component {
|
|||
customOperate={
|
||||
<div>
|
||||
{
|
||||
selectedTab != 0 && <Button type="primary" onClick={() => {this.handleEditSlideSave()}}>保存</Button>
|
||||
showOperateBtn && selectedTab != 0 && <Button type="primary" onClick={() => {this.handleEditSlideSave()}}>保存</Button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ const { MonthPicker } = DatePicker;
|
|||
import TwoColContent from "../../../components/twoColContent";
|
||||
import CopySchemaModal from "./copySchemaModal";
|
||||
|
||||
@inject("programmeStore")
|
||||
@inject("programmeStore", "taxAgentStore")
|
||||
@observer
|
||||
export default class Programme extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -257,7 +257,7 @@ export default class Programme extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { programmeStore } = this.props;
|
||||
const { programmeStore, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const {
|
||||
loading,
|
||||
hasRight,
|
||||
|
|
@ -456,18 +456,20 @@ export default class Programme extends React.Component {
|
|||
topTab={topTab}
|
||||
searchOperationItem={
|
||||
<div>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
onClick={() => {
|
||||
if (selectedKey == "custom") {
|
||||
handleCustomNewClick();
|
||||
} else {
|
||||
handleNewClick();
|
||||
}
|
||||
}}>
|
||||
新建
|
||||
</Button>
|
||||
{/* 操作按钮权限 */}
|
||||
{showOperateBtn &&
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginRight: "10px" }}
|
||||
onClick={() => {
|
||||
if (selectedKey == "custom") {
|
||||
handleCustomNewClick();
|
||||
} else {
|
||||
handleNewClick();
|
||||
}
|
||||
}}>
|
||||
新建
|
||||
</Button>}
|
||||
|
||||
{selectedKey == "custom" &&
|
||||
<WeaSelect
|
||||
|
|
|
|||
|
|
@ -374,7 +374,6 @@ export default class TaxAgent extends React.Component {
|
|||
icon={<i className="icon-coms-meeting" />} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true}>
|
||||
{" "}// 是否显示下拉按钮
|
||||
<Row
|
||||
gutter={16}
|
||||
style={{ overflow: "hidden", width: "100%", marginTop: 8 }}>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ const Home = props => props.children;
|
|||
|
||||
class Root extends React.Component {
|
||||
componentWillMount() {
|
||||
top.$(".ant-message").remove()
|
||||
top.$(".ant-message").remove();
|
||||
allStore.taxAgentStore.getPermission();
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export class TaxAgentStore {
|
|||
@observable condition = []; // 存储后台得到的form数据
|
||||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable showOperateBtn = false; // 页面操作按钮显示权限
|
||||
@observable loading = false; // 数据加载状态
|
||||
@observable modalVisiable = false; // EditModal 模态框
|
||||
@observable columns = [];
|
||||
|
|
@ -31,6 +32,8 @@ export class TaxAgentStore {
|
|||
|
||||
@action setDataSource = dataSource => (this.dataSource = dataSource);
|
||||
|
||||
@action setShowOperateBtn = bool => (this.showOperateBtn = bool);
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = params => {
|
||||
|
|
@ -118,6 +121,10 @@ export class TaxAgentStore {
|
|||
return new Promise((resolve, reject) => {
|
||||
API.getPermission(params).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { isAdminEnable, isOpenDevolution } = data;
|
||||
this.setShowOperateBtn(
|
||||
!isOpenDevolution ? true : isAdminEnable ? true : false
|
||||
);
|
||||
resolve({ status, data });
|
||||
} else {
|
||||
reject();
|
||||
|
|
|
|||
Loading…
Reference in New Issue