import { observable, action } from 'mobx'; import { TopStore, FormStore, TableListStore, AuthorityStore } from '../../../pc4backstage/hrmengine/public/valhalla/stores/index.js' import { i18n } from '../../../pc4backstage/hrmengine/public/i18n.js'; import { message } from 'antd'; import * as api from '../apis/sensitiveWordProcess.js'; export default class SenstiveWordProcessStore { searchGroupProps = { col: 1 }; @observable topStore = new TopStore(this); @observable formStore = new FormStore(this); @observable tableListStore = new TableListStore(this); @observable authorityStore = new AuthorityStore(api.hasRight); @observable canEdit = false; get topConf() { return { btnMenu: this.canEdit ? [{ "isTop": "1", "menuFun": "processSensitive", "menuIcon": "icon-coms-plus", "menuName": i18n.label['531731'](), "type": "BTN_Process" }, { "isTop": "1", "menuFun": "del", "menuIcon": "icon-coms-Batch-delete", "menuName": i18n.label['531732'](), "type": "BTN_BatchDelete" }] : [], title: i18n.label['531603'](), additionalTopProps: { icon: } } } get formConf() { return { isCustomRender: false, hasTitle: false, api: api.getSensitiveWordLogForm }; } init = () => { this.authorityStore.fetchAuthority({type: 'intercept',id:this.dataId}).then(()=>{ this.initTop(); this.initForm(); }) } initTop = () => { this.topStore.init(this.topConf).fetchRightMenu() } initForm = () => { const exportDatas = (datas) => { this.canEdit = datas.canEdit; this.initTop(); } const params = { id: this.dataId }; this.formStore.init(this.formConf).fetchForm(params, exportDatas) } processSensitive = () => { const getStyle = code => (code == '531605') ? { color: 'red' } : {}; const msg =
{i18n.label[code]()}
)}