| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import ElementForm from './elementform' |
| | | import CreateFunc from '@/templates/zshare/createfunc' |
| | | import DragElement from './dragaction' |
| | | import './index.scss' |
| | | |
| | |
| | | visible: false, // 模态框控制 |
| | | actvisible: false, // 按钮编辑模态框 |
| | | profVisible: false, // 验证信息编辑 |
| | | record: null |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | render() { |
| | | const { cards, cardCell } = this.props |
| | | const { elements, visible, actvisible, profVisible, card, dict } = this.state |
| | | const { elements, visible, actvisible, profVisible, card, dict, record } = this.state |
| | | |
| | | return ( |
| | | <div className="model-menu-card-cell-list"> |
| | |
| | | maskClosable={false} |
| | | onCancel={this.editModalCancel} |
| | | footer={[ |
| | | record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" onClick={this.handleActionSubmit}>{dict['model.confirm']}</Button> |
| | | ]} |
| | |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleActionSubmit} |
| | | setting={cards.setting} |
| | | updRecord={(record) => this.setState({record: fromJS(record).toJS()})} |
| | | wrappedComponentRef={(inst) => this.actionFormRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | setting: PropTypes.object, // 页面设置 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | | inputSubmit: PropTypes.any // 回车提交事件 |
| | | inputSubmit: PropTypes.func, // 回车提交事件 |
| | | updRecord: PropTypes.func // 更新信息 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | }, 100) |
| | | } |
| | | this.props.updRecord && this.props.updRecord(this.record) |
| | | } |
| | | |
| | | getMutilOptions = (requireOptions) => { |
| | |
| | | this.record.control = '' |
| | | _fieldval.control = '' |
| | | } |
| | | |
| | | this.props.updRecord && this.props.updRecord(this.record) |
| | | } else if (key === 'funcType') { |
| | | if (value === 'print') { |
| | | _fieldval.label = '打印' |
| | |
| | | } |
| | | } else if (key === 'intertype') { |
| | | this.record.sysInterface = 'false' |
| | | |
| | | this.props.updRecord && this.props.updRecord(this.record) |
| | | } else if (key === 'sysInterface') { |
| | | if (value === 'true') { |
| | | _fieldval.interface = window.GLOB.mainSystemApi || '' |
| | |
| | | formlist: null, // 表单信息 |
| | | actionlist: null, // 按钮组 |
| | | visible: false, // 模态框控制 |
| | | profVisible: false // 验证信息模态框 |
| | | profVisible: false, // 验证信息模态框 |
| | | record: null |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | render() { |
| | | const { config, type } = this.props |
| | | const { actionlist, visible, appType, card, dict, profVisible } = this.state |
| | | const { actionlist, visible, appType, card, dict, profVisible, record } = this.state |
| | | |
| | | return ( |
| | | <div className={'model-menu-action-list'}> |
| | |
| | | /> |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | | // title={dict['model.action'] + '-' + (card && card.copyType === 'action' ? dict['model.copy'] : dict['model.edit'])} |
| | | title="按钮·编辑" |
| | | visible={visible} |
| | | width={850} |
| | | maskClosable={false} |
| | | onCancel={this.editModalCancel} |
| | | footer={[ |
| | | <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/>, |
| | | record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" onClick={this.handleSubmit}>{dict['model.confirm']}</Button> |
| | | ]} |
| | |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | | setting={config.setting} |
| | | updRecord={(record) => this.setState({record: fromJS(record).toJS()})} |
| | | wrappedComponentRef={(inst) => this.actionFormRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | id: item.id || '', |
| | | card_number: item.card_number || '', |
| | | person_code: item.person_code || '', |
| | | group_list: item.group_list ? item.group_list.split(',') : [], |
| | | group_list: item.group_list ? item.group_list.split(',') : [1], |
| | | password: item.password || '', |
| | | id_number: item.id_number || '', |
| | | face_list: [{ |
| | |
| | | error = '人员名称不可为空' |
| | | } else if (!data.id) { |
| | | error = '人员id不可为空' |
| | | } else if (data.group_list.length === 0) { |
| | | error = '人员分组不可为空' |
| | | } else if (!data.face_list[0].data) { |
| | | error = '人员图片不可为空' |
| | | } else if (data.password) { |
| | |
| | | let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql |
| | | let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc)) // 删除存储过程sql |
| | | |
| | | this.refs.tableCreatFunc.exec(setting.innerFunc, newLText, DelText).then(result => { |
| | | if (result === 'success') { |
| | | this.setState({ |
| | | config: _config |
| | | }) |
| | | } |
| | | }) |
| | | this.refs.tableCreatFunc.exec(setting.innerFunc, newLText, DelText) |
| | | }) |
| | | } |
| | | |
| | |
| | | setting: PropTypes.object, // 页面设置 |
| | | formlist: PropTypes.any, // 表单信息 |
| | | card: PropTypes.any, // 按钮信息 |
| | | inputSubmit: PropTypes.any // 回车提交事件 |
| | | inputSubmit: PropTypes.func, // 回车提交事件 |
| | | updRecord: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | console.warn('表单focus失败!') |
| | | } |
| | | } |
| | | |
| | | this.props.updRecord && this.props.updRecord(this.record) |
| | | } |
| | | |
| | | getMutilOptions = () => { |
| | |
| | | if (!['funcbutton', 'excelIn', 'excelOut'].includes(value)) { |
| | | _fieldval.position = 'toolbar' |
| | | } |
| | | |
| | | this.props.updRecord && this.props.updRecord(this.record) |
| | | } else if (key === 'position') { |
| | | if (value === 'grid') { |
| | | _fieldval.Ot = 'requiredSgl' |
| | |
| | | } |
| | | } else if (key === 'intertype') { |
| | | this.record.sysInterface = 'false' |
| | | |
| | | this.props.updRecord && this.props.updRecord(this.record) |
| | | } else if (key === 'sysInterface') { |
| | | if (value === 'true') { |
| | | _fieldval.interface = window.GLOB.mainSystemApi || '' |
| | |
| | | copying: false, // 按钮复制中 |
| | | visible: false, // 模态框控制 |
| | | printTemps: [], // 单据打印模板 |
| | | profVisible: false // 验证信息模态框 |
| | | profVisible: false, // 验证信息模态框 |
| | | record: null |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { actionlist, visible, card, dict, copying, profVisible } = this.state |
| | | const { actionlist, visible, card, dict, copying, profVisible, record } = this.state |
| | | |
| | | return ( |
| | | <div className="model-table-action-list" style={config.charts.length > 1 ? {paddingTop: 25} : null}> |
| | |
| | | maskClosable={false} |
| | | onCancel={this.editModalCancel} |
| | | footer={[ |
| | | <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/>, |
| | | <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/>, |
| | | record && ['pop', 'exec', 'prompt'].includes(record.OpenType) && record.intertype === 'system' ? <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null, |
| | | record && record.intertype === 'inner' ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>{dict['model.confirm']}</Button> |
| | | ]} |
| | |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | | setting={config.setting} |
| | | updRecord={(record) => this.setState({record: fromJS(record).toJS()})} |
| | | wrappedComponentRef={(inst) => this.actionFormRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | excelData: [ |
| | | {field: 'id', datatype: 'string', type: 'nvarchar(50)', required: '必须', remark: '人员id'}, |
| | | {field: 'person_name', datatype: 'string', type: 'nvarchar(50)', required: '必须', remark: '人员名称'}, |
| | | {field: 'group_list', datatype: 'string', type: 'nvarchar(50)', required: '必须', remark: '绑定人员组的列表,多个使用逗号分隔,示例:\'1,2\''}, |
| | | {field: 'face_data', datatype: 'string', type: 'text', required: '必须', remark: 'Base64编码的照片数据(人脸信息)'}, |
| | | {field: 'group_list', datatype: 'string', type: 'nvarchar(50)', required: '非必须', remark: '绑定人员组的列表,多个使用逗号分隔,示例:\'1,2\''}, |
| | | {field: 'face_idx', datatype: 'integer', type: 'int', required: '非必须', remark: '照片索引,默认为0'}, |
| | | {field: 'is_admin', datatype: 'string', type: 'nvarchar(50)', required: '非必须', remark: '是否启用管理员权限,默认为\'false\''}, |
| | | {field: 'recognition_type', datatype: 'string', type: 'nvarchar(50)', required: '非必须', remark: '人员类型,staff – 普通人员(默认),visitor – 访客,blacklist – 黑名单'}, |
| | |
| | | search: null, // 搜索条件,包括主表搜索 |
| | | formlist: null, // 表单信息 |
| | | visible: false, // 模态框控制 |
| | | loading: false // 设置信息验证保存中 |
| | | loading: false, // 设置信息验证保存中 |
| | | record: null |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | const { config } = this.props |
| | | const { menu } = this.state |
| | | |
| | | this.settingRef.handleConfirm('func').then(setting => { |
| | | this.settingRef.handleConfirm('loading').then(setting => { |
| | | let res = this.resetSetting(setting) |
| | | let _config = {...config, setting: res} |
| | | let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql |
| | | let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc)) // 删除存储过程sql |
| | | |
| | | this.refs.funcCreatComponent.exec(setting.innerFunc, newLText, DelText).then(result => { |
| | | if (result === 'success') { |
| | | this.props.updatesetting(_config) |
| | | } |
| | | }) |
| | | this.refs.funcCreatComponent.exec(setting.innerFunc, newLText, DelText) |
| | | }) |
| | | } |
| | | |
| | |
| | | const { config } = this.props |
| | | const { menu } = this.state |
| | | |
| | | this.settingRef.handleConfirm('interface').then(setting => { |
| | | this.settingRef.handleConfirm('loading').then(setting => { |
| | | let res = this.resetSetting(setting) |
| | | let _config = {...config, setting: res} |
| | | let _menu = { |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { dict, visible, search, menu } = this.state |
| | | const { dict, visible, search, menu, record } = this.state |
| | | |
| | | return ( |
| | | <div className="model-menu-setting"> |
| | |
| | | maskClosable={false} |
| | | onCancel={() => { this.setState({ visible: false, loading: false })}} |
| | | footer={[ |
| | | <CreateInterface key="interface" loading={this.state.interloading} dict={dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>, |
| | | <CreateFunc key="create" dict={dict} ref="funcCreatComponent" trigger={this.tableCreatFunc}/>, |
| | | record && record.interType === 'system' ? <CreateInterface key="interface" loading={this.state.interloading} dict={dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/> : null, |
| | | record && record.interType === 'inner' ? <CreateFunc key="create" dict={dict} ref="funcCreatComponent" trigger={this.tableCreatFunc}/> : null, |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false, loading: false }) }}>{this.state.dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" loading={this.state.loading} onClick={this.settingSave}>{this.state.dict['model.confirm']}</Button> |
| | | ]} |
| | |
| | | menu={menu} |
| | | config={config} |
| | | search={search} |
| | | updRecord={(record) => this.setState({record: fromJS(record).toJS()})} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | | </Modal> |
| | |
| | | dict: PropTypes.object, // 字典项 |
| | | menu: PropTypes.object, // 菜单信息 |
| | | config: PropTypes.object, // 页面配置信息 |
| | | search: PropTypes.array // 搜索条件 |
| | | search: PropTypes.array, // 搜索条件 |
| | | updRecord: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | cbScripts: _cbScripts, |
| | | status |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | this.props.updRecord(this.state.status) |
| | | } |
| | | |
| | | getRegOptions = (searches) => { |
| | |
| | | if (activeKey === 'setting') { |
| | | return new Promise((resolve, reject) => { |
| | | this.settingForm.handleConfirm().then(res => { |
| | | if (trigger === 'func' && res.interType !== 'inner') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用内部接口,才可以创建存储过程!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({loading: false}) |
| | | reject() |
| | | return |
| | | } else if (trigger === 'interface' && res.interType !== 'system') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用系统接口时,才可以创建接口!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({loading: false}) |
| | | reject() |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | setting: res |
| | | }, () => { |
| | |
| | | }) |
| | | } else if (activeKey === 'scripts') { |
| | | return new Promise((resolve, reject) => { |
| | | if (trigger === 'func' && setting.interType !== 'inner') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用内部接口,才可以创建存储过程!', |
| | | duration: 5 |
| | | }) |
| | | this.sqlverify(() => { |
| | | this.setState({loading: false}) |
| | | resolve({...setting, scripts, preScripts, cbScripts}) |
| | | }, () => { |
| | | this.setState({loading: false}) |
| | | reject() |
| | | } else { |
| | | this.sqlverify(() => { |
| | | this.setState({loading: false}) |
| | | resolve({...setting, scripts, preScripts, cbScripts}) |
| | | }, () => { |
| | | this.setState({loading: false}) |
| | | reject() |
| | | }, 'submit') |
| | | } |
| | | }, 'submit') |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | |
| | | } |
| | | |
| | | updateStatus = (status) => { |
| | | this.setState({status: {...this.state.status, ...status}}) |
| | | let _status = {...this.state.status, ...status} |
| | | this.setState({status: _status}) |
| | | this.props.updRecord(_status) |
| | | } |
| | | |
| | | render() { |
| | |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | | class CreateFunc extends Component { |
| | | class CreateInterface extends Component { |
| | | static propTypes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | trigger: PropTypes.func |
| | |
| | | } |
| | | } |
| | | |
| | | export default CreateFunc |
| | | export default CreateInterface |