import React from "react"; import { WeaDialog, WeaTop, WeaSteps, WeaNewScroll, WeaSearchGroup, WeaFormItem, WeaButtonIcon, WeaLocaleProvider, WeaRightMenu, WeaInput, WeaUpload, WeaHelpfulTip, WeaInputSearch } from "ecCom"; import { Button, Row, message, Modal, Icon, Tooltip } from 'antd'; import { inject, observer } from 'mobx-react'; import {WeaTableNew, WeaSwitch, WeaLogView} from 'comsMobx'; import { toJS } from 'mobx'; import NoRight from '../util/NoRight'; const {WeaTable} = WeaTableNew; const Step = WeaSteps.Step; const getLabel = WeaLocaleProvider.getLabel; const WeaLogViewComp = WeaLogView.Component; const store = [ 'weesoSeachSetStore', 'weesoStore' ]; @inject(...store) @observer export default class WeesoSearchSet extends React.Component { constructor(props) { super(props); this.state = { weesoSearchPageSetHeight: 590, }; this.customStepRef = React.createRef(); this.customStepTopRef = React.createRef(); this.weesoSearchPageSetRef = React.createRef(); } componentDidMount() { const { getSeachTable, getSeachCustomTable, doSaveSearchTag, doSaveHistorySearch, page_uuid } = this.props.weesoSeachSetStore; getSeachTable(); getSeachCustomTable(); } componentDidUpdate() { if(this.weesoSearchPageSetRef && this.weesoSearchPageSetRef.current && this.weesoSearchPageSetRef.current.state) { if(this.weesoSearchPageSetRef.current.state.height !== this.state.weesoSearchPageSetHeight) { this.setState({ weesoSearchPageSetHeight: this.weesoSearchPageSetRef.current.state.height }); } } } openView = (page_uuid) => { if(page_uuid) { const { addSubdomainUrl } = this.props.weesoStore; window.open(`${addSubdomainUrl('/spa/esearch/static/index.html#/main/esearch/weeso?page_uuid=')}${page_uuid}`); } } onOperatesClick = (record,index,operate,flag, type) => { const { setState, getCusPageSetDtl, doSaveCusPageSetDtl, getCusPageSetList, delCusPageSet, getSearchTagDtl, search_type, delSearchTag, showAndHideSearchTag, getCustompageBaseDatas, recordParams } = this.props.weesoSeachSetStore; if(type === 'searchSet') { // 搜索页面 setState({ recordParams: record, commonPageType: '' }); if(operate.index === '0') { // {getLabel('221','预览') } this.openView(record.page_uuid); } else if(operate.index === '1') { // 编辑 setState({ customizationDialogVisible: true, recordId: record.randomFieldId, currentStep: 0, commonPageType: 'edit' }, () => { getCusPageSetDtl({ id: record.randomFieldId, type: '1', page_uuid: record.page_uuid }); }); } else if(operate.index === '2') { // 另存为 doSaveCusPageSetDtl({ fromSaveAsNew: '1', id: record.randomFieldId, }, (ret) => { setState({ customizationDialogVisible: true, recordId: ret.newId, currentStep: 0, commonPageType: 'saveas', recordParams: { randomFieldId: ret.newId, page_uuid: ret.newPage_uuid } }); getCusPageSetDtl({ id: ret.newId, type: '1', page_uuid: ret.newPage_uuid }); getCusPageSetList(); }); } else if(operate.index === '3') { // 删除 this.delCusPageSet(record.randomFieldId); } else if(operate.index === '4') { // 日志 setState({ logvisible: true }); } } else if(type === 'searchCustom') { // 常用条件设置 setState({ commonConditionParams: record }); if(operate.index === '0') { // 编辑 let p = { id: record.randomFieldId } if(!(this.props.page === 'maintenanceKey' && this.props.lvisible === true)) { p = { ...p, page_uuid: recordParams.page_uuid || '' } } getSearchTagDtl(p, () => { if(this.props.page === 'maintenanceKey' && this.props.lvisible === true) { setState({ maintenanceKeyAddCommonVisible: true, addRecordId: record.randomFieldId }); } else { setState({ addCommonVisible: true, addRecordId: record.randomFieldId }); } getCustompageBaseDatas({ cuspage_type: '3' }); }); } else if(operate.index === '1') { // 隐藏 showAndHideSearchTag({ id: record.randomFieldId , enable: 0 }, () => { this.getCommonConditionSetTable(); getCustompageBaseDatas({ cuspage_type: '3' }); }); } else if(operate.index === '2') { // 取消隐藏 showAndHideSearchTag({ id: record.randomFieldId , enable: 1 }, () => { this.getCommonConditionSetTable(); getCustompageBaseDatas({ cuspage_type: '3' }); }); } else if(operate.index === '3') { // 删除 this.deleteRecords(getLabel(127574, '确定删除吗?'), () => { let p = { id: record.randomFieldId, }; if(this.props.page === 'maintenanceKey' && this.props.lvisible === true) { } else { p = { ...p, page_uuid: recordParams.page_uuid, fromSystem: 1, }; } delSearchTag(p, () => { this.getCommonConditionSetTable(); getCustompageBaseDatas({ cuspage_type: '3' }); }); },); } } } onTopBtnClick = (type) => { const { setState, customizationDialogVisible, getCusPageSetDtl, searchTableStore } = this.props.weesoSeachSetStore; if(type === 'add') { setState({ customizationDialogVisible: true, recordId: '', currentStep: 0, commonPageType: 'create', pageCusCurrentId: '' }, () => { getCusPageSetDtl({ type: '1' }); }); } else if(type === 'del') { this.delCusPageSet(toJS(searchTableStore.selectedRowKeys)); } } delCusPageSet = (ids) => { const { getCusPageSetList, delCusPageSet } = this.props.weesoSeachSetStore; this.deleteRecords(getLabel(127574, '确定删除吗?'), () => { delCusPageSet({ id: ids }, () => { getCusPageSetList(); }); },); } copyUrl = (url) => { let mark = document.createElement('input'); mark.value = url; document.body.appendChild(mark); mark.select(); let successful = document.execCommand('Copy'); if(successful) { message.success(getLabel('125245','复制成功')); mark && document.body.removeChild(mark); } } onFormItemChange = (formObj) => { let _this = this; const { setState } = this.props.weesoSeachSetStore; setState({ searchTagParams: {} }); if(formObj.tagName) { if(window.esearch_debounce) clearTimeout(window.esearch_debounce); window.esearch_debounce = setTimeout(() => {// 防抖 const { addCommonForm } = _this.props.weesoSeachSetStore; const formParams = addCommonForm.getFormParams(); if(formParams.tagTitle === '' && formParams.tagName !== '') { addCommonForm.updateFields({ tagTitle: formParams.tagName }); } }, 500); } } imgVisible = (domkey, type, imgValue) => { let uploadBool = false; if(domkey === 'page_resultLogo') { if(type === 'create' || type === 'create-edit') { if(imgValue === undefined || imgValue === '') { uploadBool = true; } } else { if(imgValue === undefined || imgValue === '') { uploadBool = true; } } } if(domkey === 'page_icon') { if(type === 'create' || type === 'create-edit') { if(imgValue === undefined || imgValue === '') { if(type === 'create') { uploadBool = false; } else { uploadBool = true; } } } else { if(imgValue === undefined || imgValue === '') { uploadBool = true; } } } return uploadBool; } imgV = (domkey, type, imgValue) => { let bool = true; if(domkey === 'page_icon') { if(imgValue === undefined || imgValue === '') { bool = false; } else if(imgValue === 'CLASSNAME:icon-coms-ws') { bool = false; } } return bool; } resetDefaultIcon = () => { let { commonPageType,setState } = this.props.weesoSeachSetStore; setState({ commonPageType: 'create' }); } getSearchs(form, conditioninfo, type) { let { currentStep, commonPageType, hasPageIcon, hasPageResultLogo, setState, page_icon_dir, recordParams } = this.props.weesoSeachSetStore; if(form === undefined || conditioninfo === undefined) return const { isFormInit } = form; const formParams = form.getFormParams(); let group = []; let isstep2 = Number(currentStep) === 2; isFormInit && toJS(conditioninfo).map((c, _index) => { let items = []; c.items.map(field => { let col = 1; if(type === 'viewUrl') { items.push({ com: ( { this.copyUrl(field.value); }} > ), col: col, hide: form.isHide(field, (keys, allParams) => { return false; }) }); } else { let pointPerson = false; if(field.domkey && field.domkey[0] === 'CREATERID_select' && formParams.CREATERID_select === '2') { // 创建人--指定人员 field.selectLinkageDatas && field.selectLinkageDatas[2] && (field.selectLinkageDatas[2].viewAttr = 3); (formParams.CREATERID === '' || formParams.CREATERID === undefined) && (pointPerson = true); } if(type !== 'add-common-conditions') { if(field.domkey && (field.domkey[0] === 'WORKFLOWID' || field.domkey[0] === 'firstDirectory')) { // 流程-路径, 文档-目录必填 field.viewAttr = 3; } if(field.domkey && field.domkey[0] === 'CREATEDATE_date_select' && formParams.CREATEDATE_date_select === '5') { // 创建时间--自定义 field.selectLinkageDatas && field.selectLinkageDatas[5] && (field.selectLinkageDatas[5].viewAttr = 3); } } if(type === 'add-common-conditions') { if(field.domkey && field.domkey[0] === 'CREATEDATE_date_select' && formParams.CREATEDATE_date_select === '5') { // 创建时间--自定义 field.selectLinkageDatas && field.selectLinkageDatas[5] && (field.selectLinkageDatas[5].viewAttr = 3); } } const deleteIcon = ( { if(commonPageType === 'create') { setState({ commonPageType: 'create-edit' }); if(e && e.target.getAttribute('domkey') === 'page_icon') { form.updateFields({ page_icon: { value: '' } }); } if(e && e.target.getAttribute('domkey') === 'page_resultLogo') { form.updateFields({ page_resultLogo: { value: '' } }); } } else { if(e && e.target.getAttribute('domkey') === 'page_icon') { setState({ hasPageIcon: false }); form.updateFields({ page_icon: { value: '' } }); } if(e && e.target.getAttribute('domkey') === 'page_resultLogo') { setState({ hasPageResultLogo: false }); form.updateFields({ page_resultLogo: { value: '' } }); } } }} /> ); items.push({ com: ( { (field.domkey[0] === 'page_icon' || field.domkey[0] === 'page_resultLogo') ?
{ this.imgVisible(field.domkey[0], commonPageType, formParams[field.domkey[0]]) ? { form.updateFields({ [field.domkey[0]]: { value: ids[0] } }); }} /> :
{ ((commonPageType === 'create' && field.domkey[0] === 'page_icon' && formParams.page_icon === '') || (field.domkey[0] === 'page_icon'&& formParams.page_icon === 'CLASSNAME:icon-coms-ws') ) && { deleteIcon } } { !this.imgVisible(field.domkey[0], commonPageType, formParams[field.domkey[0]]) && this.imgV(field.domkey[0], commonPageType, formParams[field.domkey[0]]) && { deleteIcon } }
} {field.domkey[0] === 'page_icon' &&
{getLabel('524263','建议上传图片大小为36px*36px') }
} {field.domkey[0] === 'page_resultLogo' &&
{getLabel('524264','建议上传图片大小为70px*40px')}
} {recordParams.page_uuid === "FULLSEARCH" && field.domkey[0] === 'page_icon' && commonPageType !== 'create' && formParams.page_icon === '' &&
}
: } { field.domkey[0] === 'page_descStr' && {getLabel('524265','描述的位置说明') } } placement="bottomLeft" /> }
), col: col, hide: form.isHide(field, (keys, allParams) => { let bool = true; if(type === 'setpage') { if(currentStep === 0) { if(keys[0] === 'doc_sourceType') {// 文档来源 bool = false; formParams['search_type'] === "DOC" && (bool = true); } if(keys[0] === 'firstDirectory') {// 目录 bool = false; formParams['search_type'] === "DOC" && (bool = true); formParams['doc_sourceType'] == '1' && (bool = false); } if(keys[0] === 'wf_sourceType') {// 流程来源 bool = false; formParams['search_type'] === "WF" && (bool = true); } if(keys[0] === 'WORKFLOWID') {// 路径 bool = false; formParams['search_type'] === "WF" && (bool = true); formParams['wf_sourceType'] == '1' && (bool = false); } if(keys[0] === 'page_descStr') {// 描述 bool = true; formParams['search_type'] === "ALL" && (bool = false); } } if(currentStep === 2) { keys[0] === "page_resultLogo" && formParams['page_resultShowLogo'] === "0" && (bool = false); } } return !bool; }) }); } }); group.push( ); }); if(type === 'viewUrl') { group =
{ group }
} return group; } stepOne = (callback) => {// 页面基本设置 const { stepForm, doSaveCusPageSetDtl, setState, recordParams, currentStep, recordId } = this.props.weesoSeachSetStore; let formParams = stepForm.getFormParams(); let current = parseInt(currentStep, 10); stepForm.validateForm().then(f => { if (f.isValid) { if((formParams.search_type === "WF" && formParams.wf_sourceType !== '1' && formParams.WORKFLOWID === '' ) || (formParams.search_type === "DOC" && formParams.doc_sourceType !== '1' && formParams.firstDirectory === '' ) ) { message.error(getLabel('524259','必填项未填写!') ); } else { doSaveCusPageSetDtl({ type: 1, id: recordId, page_uuid: recordParams.page_uuid, ...formParams }, (ret) => { setState({ recordParams: ret }); typeof callback === 'function' && callback(ret); }); } } else { f.showErrors(); } }); } stepThree = (callback) => {// 搜索结果页设置 const { currentStep, setState, getCusPageSetDtl, recordId, stepForm, doSaveCusPageSetDtl, recordParams } = this.props.weesoSeachSetStore; const formParams = stepForm.getFormParams(); if(formParams.page_resultShowLogo == '1' && formParams.page_resultLogo === '') { message.error(getLabel('524259','必填项未填写!') ); } else { stepForm.validateForm().then(f => { if (f.isValid) { doSaveCusPageSetDtl({ type: 3, id: recordId, page_uuid: recordParams.page_uuid, ...formParams }, (ret) => { if(ret && ret.status === 'success') { typeof callback === 'function' && callback(ret); } }); } else { f.showErrors(); } }); } } onStepClick = (type, btntype, callback) => { const { currentStep, setState, stepContents, getCusPageSetDtl, recordId, stepForm, doSaveCusPageSetDtl, getCusPageSetList, recordParams, hasPageIcon, commonPageType } = this.props.weesoSeachSetStore; let current = parseInt(currentStep, 10); if(type === 'next-step' && currentStep < stepContents.length || btntype === 'viewBtn') { if(current === 0) { // 页面基本设置 let formParams = stepForm.getFormParams(); if(commonPageType === 'create') {//新建且没有点击过删除默认图片 formParams = { ...formParams, page_icon: "CLASSNAME:icon-coms-ws", }; } stepForm.validateForm().then(f => { if (f.isValid) { if((formParams.search_type === "WF" && formParams.wf_sourceType !== '1' && formParams.WORKFLOWID === '' ) || (formParams.search_type === "DOC" && formParams.doc_sourceType !== '1' && formParams.firstDirectory === '' ) ) { message.error(getLabel('524259','必填项未填写!') ); } else { doSaveCusPageSetDtl({ type: 1, id: recordId, page_uuid: recordParams.page_uuid, ...formParams }, (ret) => { if(btntype === 'viewBtn') {// 新建{getLabel('221','预览') } typeof callback === 'function' && callback(recordParams.page_uuid); } else { setState({ currentStep: current + 1, recordParams: ret}); this.getCommonConditionSetTable(ret); } }); } } else { f.showErrors(); } }); } else if(current === 1) { getCusPageSetDtl({ id: recordId,type: current + 2, page_uuid: recordParams.page_uuid }, (ret) => { if(btntype === 'viewBtn') { typeof callback === 'function' && callback(recordParams.page_uuid); }else { setState({ currentStep: current + 1}); } }); } else if(current === 2) {// 搜索结果设置 const formParams = stepForm.getFormParams(); if(formParams.page_resultShowLogo == '1' && formParams.page_resultLogo === '') { message.error(getLabel('524259','必填项未填写!') ); } else { stepForm.validateForm().then(f => { if (f.isValid) { doSaveCusPageSetDtl({ type: 3, id: recordId, page_uuid: recordParams.page_uuid, ...formParams }, (ret) => { if(btntype === 'viewBtn') { typeof callback === 'function' && callback(recordParams.page_uuid); }else { setState({ currentStep: current + 1}); getCusPageSetDtl({ id: recordId,type: current + 2, page_uuid: ret.page_uuid }); } }); } else { f.showErrors(); } }); } } else if(current === 3) { if(btntype === 'viewBtn') { typeof callback === 'function' && callback(recordParams.page_uuid); } } } else if((type === 'pre-step' || type === 'click-step-pre')&& currentStep > 0) { if(current === 2 && (type !== 'click-step-pre')) { this.stepThree(() => { setState({ currentStep: current - 1}); getCusPageSetDtl({ id: recordId,type: current, page_uuid: recordParams.page_uuid }); }); } else { setState({ currentStep: current - 1}); getCusPageSetDtl({ id: recordId,type: current, page_uuid: recordParams.page_uuid }); } this.getCommonConditionSetTable(recordParams); } } preStep = (type) => { if(type === 'click-step-pre') { this.onStepClick('click-step-pre'); } else { this.onStepClick('pre-step'); } } nextStep = () => { this.onStepClick('next-step'); } viewBtn = () => { this.onStepClick('pre-step', 'viewBtn',this.openView); } getCommonConditionSetTable = (params) => { const { getSearchTagList, recordId, addRecordId } = this.props.weesoSeachSetStore; if(this.props.page === 'maintenanceKey' && this.props.lvisible === true) { getSearchTagList(); } else { let p = { infoSetId: recordId, fromSystem: 1 }; if(params && params.page_uuid) { p = { ...p, page_uuid: params.page_uuid } } getSearchTagList(p); } } stepComplete = () => { const { setState, getCusPageSetList } = this.props.weesoSeachSetStore; setState({ customizationDialogVisible: false }); getCusPageSetList(); } getCumtonDialogBtns = () => { const { currentStep, stepContents } = this.props.weesoSeachSetStore; let btns = []; let nextStep = false, preStep = false; if(currentStep > 0) { btns.push( , ); } if(currentStep < stepContents.length - 1) { btns.push( , ); } if(currentStep === stepContents.length - 1) { btns.push( , ); btns.push( , ); } return btns; } getSearchDialogBtns = () => { let btns = []; btns.push( , ); return btns; } getRightMenu(btns) { let btnArr = []; Array.isArray(btns) && btns.forEach(res => { let icon = ; if(res.key === 'pre') { icon = ; } else if(res.key === 'next') { icon = ; } else if(res.key === 'searchset-save') { icon = ; } else if(res.key === "complete") { icon = ; } else if(res.key.indexOf('save') > -1) { icon = ; } btnArr.push({ key: res.key, icon: icon, content : res.props ? res.props.children : '', onClick : res.props ? res.props.onClick : null }); }); return btnArr; } filterParams = () => { let { browserKeyArr, addCommonForm } = this.props.weesoSeachSetStore; const formParams = addCommonForm.getFormParams(); let search_json = { ...formParams }; delete search_json.showorder; delete search_json.tagName; delete search_json.tagTitle; browserKeyArr = toJS(browserKeyArr); Object.keys(search_json).forEach(key => { if(browserKeyArr.some(v => v === key)) { if(search_json[key] !== '') { search_json[key] = search_json[key].split(','); } else { delete search_json[key]; } } }); return search_json; } addCommonSaveBtn = () => { const { addCommonForm, doSaveSearchTag, commonConditionParams, addRecordId, recordId, recordParams, getCustompageBaseDatas, editCommonConditionRetdatas } = this.props.weesoSeachSetStore; let { browserKeyArr } = this.props.weesoSeachSetStore; addCommonForm.validateForm().then(f => { if (f.isValid) { const formParams = addCommonForm.getFormParams(); let bool = false; if(formParams.CREATEDATE_date_select === '5' &&(formParams.CREATEDATE_range_picker_end === '' || formParams.CREATEDATE_range_picker_end === undefined)) { bool = true; } if(formParams.CREATERID_select === '2' &&(formParams.CREATERID === '' || formParams.CREATERID === undefined)) { bool = true; } if(bool) { message.error(getLabel('524259','必填项未填写!') ); return; } let search_json = { ...formParams }; delete search_json.showorder; delete search_json.tagName; delete search_json.tagTitle; browserKeyArr = toJS(browserKeyArr); Object.keys(search_json).forEach(key => { if(browserKeyArr.some(v => v === key)) { if(search_json[key] !== '') { search_json[key] = search_json[key].split(','); } else { delete search_json[key]; } } }); let p = { ...formParams, id: commonConditionParams.randomFieldId, search_json: JSON.stringify(search_json) }; if(!(this.props.page === 'maintenanceKey' && this.props.lvisible === true)) { if(recordParams.page_uuid) { p = { ...p, fromSystem: 1, page_uuid: recordParams.page_uuid }; } else { p = { ...p, fromSystem: 1, }; } } if(editCommonConditionRetdatas.search_type) { p = { ...p, search_type: editCommonConditionRetdatas.search_type }; } doSaveSearchTag({ ...p }, (ret) => { this.addCommononCancel(); this.getCommonConditionSetTable(ret); getCustompageBaseDatas({ cuspage_type: '3' }); }); } else { f.showErrors(); } }) } addCommonBtns = () => { let btns = []; btns.push( , ); return btns; } addCommononCancel = () => { const { setState } = this.props.weesoSeachSetStore; setState({ addCommonVisible: false, maintenanceKeyAddCommonVisible: false }); } getAddCommonConditions = () => { const dialogW = 600, dialogH = 350; const { collectParams, addCommonVisible, maintenanceKeyAddCommonVisible, setState, addCommonForm, addCommonConditions } = this.props.weesoSeachSetStore; let dialogVisible = addCommonVisible; if(this.props.page === "maintenanceKey") { dialogVisible = maintenanceKeyAddCommonVisible; } return( { this.getSearchs(addCommonForm, addCommonConditions, 'add-common-conditions') } ); } getUrlDialog = () => { const dialogW = 600, dialogH = 200; const { collectParams, urlDialogVisible, setState, stepForm, stepConditions } = this.props.weesoSeachSetStore; return( { setState({ urlDialogVisible: false }) }} // moreBtn={{ // datas : this.getRightMenu(this.addCommonBtns()), // collectParams : collectParams // }} > { this.getSearchs(stepForm, stepConditions, 'viewUrl') } ); } getColumns = (e) => { let newColumns = ''; newColumns = e.map(column => { let newColumn = column; newColumn.render = (text, record, index) => { //前端元素转义 let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex]; return ( newColumn.dataIndex == "page_uuid" ?
{ const { setState, getCusPageSetDtl } = this.props.weesoSeachSetStore; setState({ urlDialogVisible: true, recordId: record.randomFieldId }); getCusPageSetDtl({ id: record.randomFieldId,type: '4' }); }} dangerouslySetInnerHTML={{__html: getLabel('33564','查看') }}/> :
) } return newColumn; }); return newColumns; } deleteRecords = (msg, onOk, onCancel) => { Modal.confirm({ title: getLabel('131329','信息确认') , content: msg, onOk() { typeof onOk === 'function' && onOk(); }, onCancel() { typeof onCancel === 'function' && onCancel(); }, }); } maintenanceKeyAdd = (type) => { const { dialogVisible, setState, searchTableStore, customizationDialogVisible, form, conditions, currentStep, collectParams, stepForm, stepConditions, commonConditionTableStore, getSearchTagDtl, search_type, recordId, commonConditionParams,recordParams } = this.props.weesoSeachSetStore; const { defalutMoreKey } = this.props.weesoStore; let param = {}; if(!(this.props.page === 'maintenanceKey' && this.props.lvisible === true)) { param = { page_uuid: recordParams.page_uuid, }; } if(type === 'commonSet') { param = { ...param, search_type: defalutMoreKey }; } getSearchTagDtl({ id: '', ...param }, () => { if(this.props.page === 'maintenanceKey' && this.props.lvisible === true) { setState({ addCommonVisible: false, maintenanceKeyAddCommonVisible: true, commonConditionParams: {} }); } else { setState({ addCommonVisible: true, maintenanceKeyAddCommonVisible: false, commonConditionParams: {} }); } }); } maintenanceKeyDel = () => { const { delSearchTag, commonConditionTableStore, recordI, recordParams, getCustompageBaseDatas } = this.props.weesoSeachSetStore; let ids = toJS(commonConditionTableStore.selectedRowKeys); let params = { id: ids, }; this.deleteRecords(getLabel(127574, '确定删除吗?'), () => { if(!(this.props.page === 'maintenanceKey' && this.props.lvisible === true)) { params = { ...params, page_uuid: recordParams.page_uuid, fromSystem: 1 }; } delSearchTag(params, () => { this.getCommonConditionSetTable(); getCustompageBaseDatas({ cuspage_type: '3' }); }); },); } searchPageCusCancel = () => { const { setState, commonPageType, pageCusCurrentId, delCusPageSet, currentStep, defalutStepForm, stepForm } = this.props.weesoSeachSetStore; if(String(currentStep) === '1' || (String(currentStep) === '4' && commonPageType.indexOf('create') === -1 )) { setState({ customizationDialogVisible: false, recordParams: {} }); } else { let isModify = false; if(typeof defalutStepForm.getFormParams === 'function') { const defalutStepFormParams = defalutStepForm.getFormParams(); const stepFormParams = stepForm.getFormParams(); Object.keys(defalutStepForm.getFormParams()).forEach(key => { if(String(defalutStepFormParams[key]) !== String(stepFormParams[key])) { isModify = true; } }); } if(isModify) { this.deleteRecords(getLabel('524268','数据未保存,确定退出吗?') ,() => { if(commonPageType === 'create' && pageCusCurrentId !== '') { delCusPageSet({ id: pageCusCurrentId }, () => { setState({ customizationDialogVisible: false, recordParams: {} }); }); } else { setState({ customizationDialogVisible: false, recordParams: {} }); } }); } else { setState({ customizationDialogVisible: false, recordParams: {} }); } } } searchPageCancel = () => { } closeLog = () => { const { setState, } = this.props.weesoSeachSetStore; setState({ logvisible: false }); } onSearch = (value) => { const { getCusPageSetList, setState } = this.props.weesoSeachSetStore; getCusPageSetList({ page_title: value || '' }); } onSearchChange = (value) => { const { setState } = this.props.weesoSeachSetStore; setState({ searchDefinePageInputVal: value }); } onCommonSearchChange = (value) => { const { setState } = this.props.weesoSeachSetStore; setState({ searchDefineCommonInputVal: value }); } onCommonSearch = (value) => { const { getSearchTagList } = this.props.weesoSeachSetStore; getSearchTagList({ tagTitle: value || '' }); } onCloseSearchDefineDialog = () => { const { setState } = this.props.weesoSeachSetStore; setState({ dialogVisible: false, searchDefineCommonInputVal: '', searchDefinePageInputVal: '' }); } onStepChange = (e) => { if(e) { const { currentStep, setState, stepContents, getCusPageSetDtl, recordId, stepForm, doSaveCusPageSetDtl, getCusPageSetList, recordParams, hasPageIcon, commonPageType } = this.props.weesoSeachSetStore; if(commonPageType !== 'saveas' && commonPageType !== 'edit') return; const current = Number(currentStep); // 当前步 const now = Number(e.step); if(now > current) {// 往后 if(current === 0) { this.stepOne((ret) => { setState({ currentStep: now }); if(now === 1) { this.getCommonConditionSetTable(ret); } if(now === 2) { getCusPageSetDtl({ id: recordId,type: 3, page_uuid: recordParams.page_uuid }, (ret) => { }); } if(now === 3) { getCusPageSetDtl({ id: recordId,type: 4, page_uuid: ret.page_uuid }); } }); } if(current === 1) { if(now === 2) { this.nextStep(); } if(now === 3) { setState({ currentStep: now }); getCusPageSetDtl({ id: recordId,type: 4, page_uuid: recordParams.page_uuid }); } } if(current === 2) { this.nextStep(); } } if(now < current) {// 往前 if(current === 1) { this.preStep(); } if(current === 2) { this.stepThree(() => { if(now === 0 ) { setState({ currentStep: now }); getCusPageSetDtl({ id: recordId,type: 1, page_uuid: recordParams.page_uuid }); } if(now === 1 ) { this.preStep('click-step-pre'); } }); } if(current === 3) { if(now === 0) { setState({ currentStep: now }); getCusPageSetDtl({ id: recordId,type: 1, page_uuid: recordParams.page_uuid }); } if(now === 1) { setState({ currentStep: now }); this.getCommonConditionSetTable(); } if(now === 2) { this.preStep(); } } } } } maintenanceKey_Add = () => { this.maintenanceKeyAdd('commonSet'); } render() { const { dialogVisible, setState, searchTableStore, customizationDialogVisible, form, conditions, currentStep, collectParams, stepForm, stepConditions, commonConditionTableStore, getSearchTagDtl, search_type,recordParams, logStore, logvisible, logSmallType, logType, searchPageRight, commonPageType } = this.props.weesoSeachSetStore; let { stepContents, } = this.props.weesoSeachSetStore; const { weesoSearchPageSetHeight } = this.state; stepContents = toJS(stepContents); const dialogH = weesoSearchPageSetHeight, dialogW = 900; const stepTopH = this.customStepTopRef&&this.customStepTopRef.current ? this.customStepTopRef.current.offsetHeight : 160; if(this.props.page === 'maintenanceKey') { return(
} > this.onOperatesClick(record,index,operate,flag, 'searchCustom')} /> { this.getAddCommonConditions() }
) } return(
{!searchPageRight && } {searchPageRight && { this.onTopBtnClick("add"); }} /> { this.onTopBtnClick("del") }} />
} > this.onOperatesClick(record,index,operate,flag, 'searchSet')} getColumns={this.getColumns} /> }
{ stepContents && stepContents.map(res => ( this.onStepChange(res)} description={res.label} />)) }
{ currentStep !== 1 && currentStep !== 3 && this.getSearchs(stepForm, stepConditions, 'setpage') } { currentStep === 1 &&
} > this.onOperatesClick(record,index,operate,flag, 'searchCustom')} />
} { currentStep === 3 && this.getSearchs(stepForm, stepConditions, 'viewUrl')} { this.getAddCommonConditions() } { this.getUrlDialog() } ); } }