| | |
| | | 'header.form.readin.tooltip': '是否将表格或主表中的数据写入表单', |
| | | 'header.form.afterExecSuccess': '成功后', |
| | | 'header.form.afterExecError': '失败后', |
| | | 'header.form.pagination': '分页', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | 'header.form.readin.tooltip': '是否将表格中的数据写入表单', |
| | | 'header.form.afterExecSuccess': '成功后', |
| | | 'header.form.afterExecError': '失败后', |
| | | 'header.form.pagination': '分页', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | // if () { // 权限黑名单 |
| | | // col.Hide = 'true' |
| | | // } |
| | | |
| | | _logcolumns.push(col) |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | |
| | | if (btn.execSuccess === 'grid' && type === 'success') { |
| | | this.reloadtable() |
| | | } else if (btn.execError === 'grid' && type === 'error') { |
| | | this.reloadview() |
| | | } else if (btn.execSuccess === 'view' && type === 'success') { |
| | | this.reloadtable() |
| | | } else if (btn.execSuccess === 'view' && type === 'success') { |
| | | this.reloadview() |
| | | } else if (btn.execError === 'view' && type === 'error') { |
| | | this.reloadview() |
| | | } else if (btn.popClose === 'view' && type === 'pop') { |
| | | this.reloadview() |
| | | } else if (btn.popClose === 'grid' && type === 'pop') { |
| | | this.reloadtable() |
| | | } else if (type === 'excelOut') { |
| | | this.handleDefaultExcelout(btn) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 使用默认存储过程 sPC_Get_TableData 导出excel表格 |
| | | * @description 导出Excel时,获取页面搜索排序等参数 |
| | | */ |
| | | handleDefaultExcelout = (btn) => { |
| | | getexceloutparam = () => { |
| | | const { MenuName } = this.props |
| | | const { arr_field, orderBy, search, setting, config } = this.state |
| | | const { arr_field, orderBy, search, setting} = this.state |
| | | |
| | | let _arr_labels = [] // 列名称集 |
| | | let _arr_label_field = [] // 列名称字段集 |
| | | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arr_labels.push(col.label) |
| | | _arr_label_field.push(`${col.field} as ${col.label}`) |
| | | } |
| | | }) |
| | | |
| | | _arr_labels = _arr_labels.join(',') |
| | | _arr_label_field = _arr_label_field.join(',') |
| | | |
| | | let _search = Utils.joinMainSearchkey(search) |
| | | _search = _search ? 'where ' + _search : '' |
| | | |
| | | // 获取excel数据,与获取列表数据不同为未设置页码等参数 |
| | | let param = { |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: _arr_labels, |
| | | appkey: window.GLOB.appkey || '' |
| | | return { |
| | | arr_field: arr_field, |
| | | orderBy: orderBy || setting.order, |
| | | search: search, |
| | | menuName: MenuName |
| | | } |
| | | |
| | | let _orderBy = orderBy || setting.order |
| | | let _dataresource = setting.dataresource |
| | | |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | let LText = `select ${_arr_label_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.DateCount = '' |
| | | |
| | | let name = `${MenuName}${moment().format('YYYYMMDDHHmmss')}.xlsx` |
| | | |
| | | Api.getExcelOut(param, name).then(res => { |
| | | if (res && res.status === false) { |
| | | this.refs.mainButton.execError(res, btn) |
| | | } else { |
| | | this.refs.mainButton.execSuccess(btn) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | ContainerId={this.state.ContainerId} |
| | | refreshdata={this.refreshbyaction} |
| | | triggerPopview={this.triggerPopview} |
| | | getexceloutparam={this.getexceloutparam} |
| | | gettableselected={this.gettableselected} |
| | | /> : null |
| | | } |
| | |
| | | this.props.handleMainTable() |
| | | } else if (btn.popClose === 'subgrid' && type === 'pop') { |
| | | this.reloadtable() |
| | | } else if (type === 'excelOut') { |
| | | this.handleDefaultExcelout(btn) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 使用默认存储过程 sPC_Get_TableData 导出excel表格 |
| | | * @description 导出Excel时,获取页面搜索排序等参数 |
| | | */ |
| | | handleDefaultExcelout = (btn) => { |
| | | const { MenuName } = this.props |
| | | const { arr_field, orderBy, search, setting, config } = this.state |
| | | getexceloutparam = () => { |
| | | const { Tab } = this.props |
| | | const { arr_field, orderBy, search, setting} = this.state |
| | | |
| | | let _arr_labels = [] // 列名称集 |
| | | let _arr_label_field = [] // 列名称字段集 |
| | | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arr_labels.push(col.label) |
| | | _arr_label_field.push(`${col.field} as ${col.label}`) |
| | | } |
| | | }) |
| | | |
| | | _arr_labels = _arr_labels.join(',') |
| | | _arr_label_field = _arr_label_field.join(',') |
| | | |
| | | let _search = Utils.joinMainSearchkey(search) |
| | | _search = _search ? 'where (' + _search + ')' : '' |
| | | // 获取列表数据 |
| | | let param = { |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: _arr_labels, |
| | | BID: this.props.BID, |
| | | appkey: window.GLOB.appkey || '' |
| | | return { |
| | | arr_field: arr_field, |
| | | orderBy: orderBy || setting.order, |
| | | search: search, |
| | | menuName: Tab.label |
| | | } |
| | | |
| | | let _orderBy = orderBy || setting.order |
| | | let _dataresource = setting.dataresource |
| | | |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | let LText = `select ${_arr_label_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.DateCount = '' |
| | | |
| | | let name = `${MenuName}${moment().format('YYYYMMDDHHmmss')}.xlsx` |
| | | |
| | | Api.getExcelOut(param, name).then(res => { |
| | | if (res && res.status === false) { |
| | | this.refs.subButton.execError(res, btn) |
| | | } else { |
| | | this.refs.subButton.execSuccess(btn) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | ContainerId={this.props.ContainerId} |
| | | refreshdata={this.refreshbyaction} |
| | | triggerPopview={this.triggerPopview} |
| | | getexceloutparam={this.getexceloutparam} |
| | | gettableselected={this.gettableselected} |
| | | /> |
| | | } |
| | |
| | | import PropTypes from 'prop-types' |
| | | import moment from 'moment' |
| | | import { Button, Affix, Modal, notification, Spin, message } from 'antd' |
| | | import * as XLSX from 'xlsx' |
| | | import MutilForm from '@/tabviews/tableshare/mutilform' |
| | | import ExcelIn from '../excelin' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | type: PropTypes.string, // 判断当前为主表(main)、子表(sub)、子表标签(subtab) |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | actions: PropTypes.array, // 按钮组 |
| | | logcolumns: PropTypes.array, // 日志中显示列 |
| | | logcolumns: PropTypes.array, // 显示列 |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | refreshdata: PropTypes.func, // 执行完成后数据刷新 |
| | | triggerPopview: PropTypes.func, // 弹窗标签页触发 |
| | | getexceloutparam: PropTypes.func, // 获取excel导出数据 |
| | | gettableselected: PropTypes.func // 获取表格中数据 |
| | | } |
| | | |
| | |
| | | this.improveAction(item) |
| | | }) |
| | | } else if (item.OpenType === 'excelOut') { |
| | | this.setState({loadingUuid: item.uuid}) |
| | | this.refreshdata(item, 'excelOut') |
| | | if ( |
| | | item.intertype === 'inner' && !item.innerFunc && |
| | | ((setting.interType === 'inner' && setting.innerFunc) || setting.interType === 'outer') |
| | | ) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '导出按钮配置错误!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.triggerExcelout(item) |
| | | |
| | | } else if (item.OpenType === 'excelIn') { |
| | | if (item.verify && item.verify.sheet && item.verify.columns && item.verify.columns.length > 0) { |
| | | let primaryId = '' // 导入时行Id |
| | |
| | | * 5、通知主列表刷新 |
| | | */ |
| | | execSuccess = (btn, res) => { |
| | | if (btn.OpenType === 'excelOut' || btn.OpenType === 'excelIn') { // 导出excel |
| | | this.setState({ |
| | | loadingUuid: '' |
| | | }) |
| | | } else if (res && res.ErrCode === 'S') { // 执行成功 |
| | | if (res && res.ErrCode === 'S') { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.ErrMesg || this.props.dict['main.action.confirm.success'], |
| | | duration: 2 |
| | | duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | this.setState({ |
| | | visible: false |
| | | }) |
| | | } else if (btn.OpenType === 'excelOut' || btn.OpenType === 'excelIn') { // 导出excel |
| | | this.setState({ |
| | | loadingUuid: '' |
| | | }) |
| | | } |
| | | |
| | | this.refreshdata(btn, 'success') |
| | | } |
| | | |
| | |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | duration: btn.errorTime || 15 |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 15 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | duration: btn.errorTime || 15 |
| | | duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 15 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || res.ErrMesg) |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description Excel 导入 |
| | | */ |
| | | getexceldata = (data, btn, errors, primaryId) => { |
| | | if (errors) { |
| | | if (errors === 'notexit') { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description Excel 导出 |
| | | */ |
| | | triggerExcelout = (btn) => { |
| | | let viewParam = this.props.getexceloutparam() |
| | | let name = `${viewParam.menuName}${moment().format('YYYYMMDDHHmmss')}.xlsx` |
| | | // let pageSize = 100 |
| | | |
| | | this.setState({loadingUuid: btn.uuid}) |
| | | |
| | | if (btn.pagination !== 'true') { |
| | | if (btn.intertype === 'inner' && !btn.innerFunc) { // 使用系统函数 |
| | | if (!viewParam.arr_field) { |
| | | this.execError({ErrCode: 'N', message: '未设置显示列!'}, btn) |
| | | return |
| | | } |
| | | |
| | | let param = this.getExcelDefaultParam(viewParam.arr_field, viewParam.orderBy, viewParam.search) |
| | | |
| | | Api.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | this.exportExcel(result.data, btn, name) |
| | | } else { |
| | | this.execError(result, btn) |
| | | } |
| | | }) |
| | | } else if (btn.intertype === 'inner' && btn.innerFunc) { // 使用内部函数 |
| | | let param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search) |
| | | param.func = btn.innerFunc |
| | | |
| | | Api.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | this.exportExcel(result.data, btn, name) |
| | | } else { |
| | | this.execError(result, btn) |
| | | } |
| | | }) |
| | | } else if (btn.intertype === 'outer' && !btn.innerFunc) { // 使用外部函数 |
| | | let param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search) |
| | | if (btn.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = btn.interface |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | if (btn.outerFunc) { |
| | | param.func = btn.outerFunc |
| | | } |
| | | |
| | | Api.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | this.exportExcel(result.data, btn, name) |
| | | } else { |
| | | this.execError(result, btn) |
| | | } |
| | | }) |
| | | } else if (btn.intertype === 'outer' && btn.innerFunc) { |
| | | let param = this.getExcelCustomParam(viewParam.orderBy, viewParam.search) |
| | | param.func = btn.innerFunc |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | delete res.ErrCode |
| | | delete res.ErrMesg |
| | | delete res.message |
| | | delete res.status |
| | | |
| | | if (btn.sysInterface === 'true') { |
| | | res.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | res.rduri = btn.interface |
| | | } |
| | | |
| | | if (btn.outerFunc) { |
| | | res.func = btn.outerFunc |
| | | } |
| | | |
| | | res.appkey = window.GLOB.appkey || '' // 外部请求时,统一添加appkey |
| | | |
| | | Api.genericInterface(res).then(result => { |
| | | if (result.status) { |
| | | this.exportExcel(result.data, btn, name) |
| | | } else { |
| | | this.execError(result, btn) |
| | | } |
| | | }) |
| | | } else { |
| | | this.execError(res, btn) |
| | | } |
| | | }) |
| | | } else { |
| | | this.execError({ErrCode: 'N', message: '导出按钮设置错误!'}, btn) |
| | | } |
| | | } |
| | | } |
| | | |
| | | exportExcel = (data, btn, name) => { |
| | | const { logcolumns } = this.props |
| | | if (data && data.length > 0) { |
| | | try { |
| | | let _header = [] |
| | | let _topRow = {} |
| | | let colwidth = [] |
| | | logcolumns.forEach(col => { |
| | | if (col.Hide === 'true') return |
| | | |
| | | if (!data[0].hasOwnProperty(col.field)) return |
| | | |
| | | _header.push(col.field) |
| | | _topRow[col.field] = col.label |
| | | |
| | | let _colwidth = Math.floor(col.Width / 6) |
| | | |
| | | if (!_colwidth || _colwidth < 10) { |
| | | _colwidth = 10 |
| | | } |
| | | |
| | | colwidth.push({width: _colwidth}) |
| | | }) |
| | | |
| | | let table = [] |
| | | |
| | | table.push(_topRow) |
| | | |
| | | data.forEach(item => { |
| | | let _row = {} |
| | | _header.forEach(field => { |
| | | _row[field] = item[field] |
| | | }) |
| | | |
| | | table.push(_row) |
| | | }) |
| | | |
| | | // const ws = XLSX.utils.aoa_to_sheet(data) |
| | | const ws = XLSX.utils.json_to_sheet(table, {header: _header, skipHeader: true}) |
| | | |
| | | ws['!cols'] = colwidth |
| | | |
| | | const wb = XLSX.utils.book_new() |
| | | XLSX.utils.book_append_sheet(wb, ws, 'Sheet1') |
| | | |
| | | XLSX.writeFile(wb, name) |
| | | |
| | | this.execSuccess(btn, {ErrCode: 'S', ErrMesg: '导出成功!'}) |
| | | } catch { |
| | | this.execError({ErrCode: 'N', message: 'Excel生成失败!'}, btn) |
| | | } |
| | | |
| | | } else { |
| | | this.execError({ErrCode: 'N', message: '未查询到导出数据!'}, btn) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 获取用户自定义存储过程传参 |
| | | */ |
| | | getExcelCustomParam = (orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => { |
| | | let _search = Utils.formatCustomMainSearch(search) |
| | | |
| | | let param = { |
| | | OrderCol: orderBy, |
| | | ..._search |
| | | } |
| | | |
| | | if (pagination) { |
| | | param.PageIndex = pageIndex |
| | | param.PageSize = pageSize |
| | | } |
| | | |
| | | return param |
| | | } |
| | | |
| | | /** |
| | | * @description 获取默认存储过程请求参数 |
| | | */ |
| | | getExcelDefaultParam = (arr_field, orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => { |
| | | const { setting } = this.props |
| | | |
| | | let _search = Utils.joinMainSearchkey(search) |
| | | |
| | | _search = _search ? 'where ' + _search : '' |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: arr_field, |
| | | appkey: window.GLOB.appkey || '' |
| | | } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | if (setting.queryType === 'statistics') { // 统计数据源,内容替换 |
| | | let fieldmap = new Map() |
| | | let options = search.map(item => { |
| | | let _field = item.key |
| | | |
| | | if (fieldmap.has(_field)) { |
| | | _field = _field + '1' |
| | | } |
| | | |
| | | fieldmap.set(item.key, true) |
| | | |
| | | return { |
| | | reg: new RegExp('@' + _field, 'ig'), |
| | | value: item.value |
| | | } |
| | | }) |
| | | |
| | | options.reverse() |
| | | |
| | | options.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, `'${item.value}'`) |
| | | }) |
| | | |
| | | _search = '' |
| | | } |
| | | |
| | | let LText = '' |
| | | if (pagination) { |
| | | LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` |
| | | } else { |
| | | LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.DateCount = '' |
| | | |
| | | return param |
| | | } |
| | | |
| | | /** |
| | | * @description 模态框(表单),确认 |
| | | */ |
| | | handleOk = () => { |
| | |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | | tabs: PropTypes.array // 所有标签页 |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.object, // 页面设置 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | | tabs: PropTypes.array // 所有标签页 |
| | | } |
| | | |
| | | state = { |
| | |
| | | _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] |
| | | } else if (_opentype === 'excelOut') { // 导入导出 |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } |
| | | } else if (_opentype === 'excelIn') { // 导入导出 |
| | | if (_intertype === 'outer') { |
| | |
| | | _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] |
| | | } else if (value === 'excelOut') { |
| | | if (this.state.interType === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } |
| | | } else if (value === 'excelIn') { |
| | | if (this.state.interType === 'outer') { |
| | |
| | | let _options = null |
| | | if (openType === 'excelOut') { |
| | | if (value === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } |
| | | } else if (openType === 'excelIn') { |
| | | if (value === 'outer') { |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { setting } = this.props |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | if (values.OpenType === 'excelIn') { |
| | | values.position = 'toolbar' |
| | | } else if (values.OpenType === 'excelOut') { |
| | | if (values.intertype === 'inner' && !values.innerFunc) { |
| | | if ((setting.interType === 'inner' && setting.innerFunc) || setting.interType === 'outer') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '表格数据查询未使用数据源,导出Excel使用内部接口时,需自定义内部函数!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | values.position = 'toolbar' |
| | | values.Ot = 'notRequired' |
| | | } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id |
| | |
| | | if (btn.verify && btn.verify.sheet && btn.verify.columns && btn.verify.columns.length > 0) { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | name: config.setting.tableName || '', |
| | | fields: '', |
| | | menuNo: menu.MenuNo |
| | | } |
| | | newLText = Utils.formatOptions(Utils.getexcelInfunc(_param, btn, menu, config)) |
| | | newLText = Utils.formatOptions(Utils.getexcelInfunc(_param, btn, menu)) |
| | | DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName)) |
| | | // resolve(true) |
| | | resolve(false) |
| | | resolve(true) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | <DragElement |
| | | type="action" |
| | | list={this.state.config.action} |
| | | setting={this.state.config.setting} |
| | | handleList={this.handleList} |
| | | handleMenu={this.handleAction} |
| | | copyElement={(val) => this.handleAction(val, 'copy')} |
| | |
| | | card={this.state.card} |
| | | tabs={this.state.tabviews} |
| | | formlist={this.state.formlist} |
| | | setting={this.state.config.setting} |
| | | wrappedComponentRef={(inst) => this.actionFormRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | <Col span={12}> |
| | | <Form.Item label="表名"> |
| | | {getFieldDecorator('tableName', { |
| | | initialValue: data.tableName, |
| | | initialValue: data.tableName || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={12}> |
| | | <Form.Item label="表格属性"> |
| | | {getFieldDecorator('tableType', { |
| | | initialValue: data.tableType |
| | | initialValue: data.tableType || 'checkbox' |
| | | })( |
| | | <Select |
| | | getPopupContainer={() => document.getElementById('commontable-setting-form')} |
| | |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('dataresource', { |
| | | initialValue: data.dataresource |
| | | initialValue: data.dataresource || '' |
| | | })(<TextArea rows={4} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | | tabs: PropTypes.array // 所有标签页 |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.object, // 页面设置 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | | tabs: PropTypes.array // 所有标签页 |
| | | } |
| | | |
| | | state = { |
| | |
| | | _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] |
| | | } else if (_opentype === 'excelOut') { |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } |
| | | } else if (_opentype === 'excelIn') { |
| | | if (_intertype === 'outer') { |
| | |
| | | _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] |
| | | } else if (value === 'excelOut') { |
| | | if (this.state.interType === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } |
| | | } else if (value === 'excelIn') { |
| | | if (this.state.interType === 'outer') { |
| | |
| | | |
| | | if (openType === 'excelOut') { |
| | | if (value === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'pagination'] |
| | | } |
| | | } else if (openType === 'excelIn') { |
| | | if (value === 'outer') { |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { setting } = this.props |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | if (values.OpenType === 'excelIn') { |
| | | values.position = 'toolbar' |
| | | } else if (values.OpenType === 'excelOut') { |
| | | if (values.intertype === 'inner' && !values.innerFunc) { |
| | | if ((setting.interType === 'inner' && setting.innerFunc) || setting.interType === 'outer') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '表格数据查询未使用数据源,导出Excel使用内部接口时,需自定义内部函数!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | values.position = 'toolbar' |
| | | values.Ot = 'notRequired' |
| | | } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id |
| | |
| | | }) |
| | | } |
| | | }) |
| | | } else if (btn.OpenType === 'excelIn') { |
| | | if (btn.verify && btn.verify.sheet && btn.verify.columns && btn.verify.columns.length > 0) { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | menuNo: _config.tabNo |
| | | } |
| | | newLText = Utils.formatOptions(Utils.getexcelInfunc(_param, btn, {MenuID: _config.uuid, MenuName: _config.tabName})) |
| | | DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName)) |
| | | resolve(true) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善导入Excel验证信息!', |
| | | duration: 10 |
| | | }) |
| | | resolve(false) |
| | | } |
| | | } else { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | |
| | | card={this.state.card} |
| | | tabs={this.state.tabviews} |
| | | formlist={this.state.formlist} |
| | | setting={this.state.config.setting} |
| | | wrappedComponentRef={(inst) => this.actionFormRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | <Col span={12}> |
| | | <Form.Item label="表名"> |
| | | {getFieldDecorator('tableName', { |
| | | initialValue: data.tableName, |
| | | initialValue: data.tableName || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | <Col span={12}> |
| | | <Form.Item label="表格属性"> |
| | | {getFieldDecorator('tableType', { |
| | | initialValue: data.tableType |
| | | initialValue: data.tableType || 'checkbox' |
| | | })( |
| | | <Select |
| | | getPopupContainer={() => document.getElementById('subtable-setting-form')} |
| | |
| | | </Tooltip> |
| | | } className="textarea"> |
| | | {getFieldDecorator('dataresource', { |
| | | initialValue: data.dataresource |
| | | initialValue: data.dataresource || '' |
| | | })(<TextArea rows={4} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | newcard.errorTime = 15 |
| | | newcard.verify = null |
| | | |
| | | if (item.subType === 'excelIn' || item.subType === 'excelOut') { |
| | | if (item.subType === 'excelIn') { |
| | | // 导入和导出excel,按钮名称直接为导入、导出 |
| | | newcard.label = item.label |
| | | } else if (item.subType === 'excelOut') { |
| | | newcard.label = item.label |
| | | newcard.intertype = setting.interType |
| | | newcard.innerFunc = setting.innerFunc |
| | | newcard.sysInterface = setting.sysInterface |
| | | newcard.outerFunc = setting.outerFunc |
| | | newcard.interface = setting.interface |
| | | } |
| | | } else if (item.type === 'columns') { |
| | | newcard.Align = 'left' |
| | |
| | | tooltip: Formdict['header.form.actionhelp.sqlType'], |
| | | required: false, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'pagination', |
| | | label: Formdict['header.form.pagination'], |
| | | initVal: card.pagination || 'false', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | } |
| | | ] |
| | | } |
| | |
| | | return |
| | | } |
| | | } |
| | | console.log(_verify) |
| | | |
| | | resolve(_verify) |
| | | } else { |
| | |
| | | let Ltext = `create proc ${param.funcName} |
| | | ( /*${menu.MenuName} ${btn.label}*/ |
| | | @ID nvarchar(50)='', |
| | | @BID nvarchar(50)='', |
| | | @BID nvarchar(50)='', |
| | | @Ltext nvarchar(max)='', |
| | | @sEPTMenuNo nvarchar(50)='${param.menuNo}', |
| | | @lang nvarchar(50)='', |
| | | @LoginUID nvarchar(50)='', |
| | | @SessionUid nvarchar(50)='', |
| | | @UserID nvarchar(50), |
| | | @ErrorCode nvarchar(50) out, |
| | | @ErrorCode nvarchar(50) out, |
| | | @retmsg nvarchar(4000) out |
| | | ) |
| | | as |
| | | begin |
| | | declare @sEPTMenuNo ,@Begindate datetime,@Enddate datetime |
| | | select @sEPTMenuNo=@retmsg,@Begindate=getdate() |
| | | declare @BegindateTest datetime,@EnddateTest datetime |
| | | select @BegindateTest=getdate() |
| | | set @ErrorCode='' |
| | | set @retmsg='' |
| | | BEGIN TRY |