| | |
| | | const editShow = (this.props.editState && !this.props.editLevel) || false |
| | | |
| | | return ( |
| | | <aside className={"side-menu ant-menu-dark" + (this.props.collapse ? ' side-menu-collapsed' : '') + (this.props.isiframe ? ' iframe' : '')}> |
| | | <aside className={"side-menu ant-menu-dark" + (this.props.collapse ? ' side-menu-collapsed' : '') + (this.props.isiframe ? ' iframe' : '') + (this.props.editState ? ' edit' : '')}> |
| | | {!(this.props.editLevel === 'level2' || this.props.editLevel === 'level3') && |
| | | <Menu openKeys={this.state.openKeys} onOpenChange={this.onOpenChange} mode="inline" theme="dark" inlineCollapsed={this.props.collapse}> |
| | | {editShow && <li className="sup-menu"><Icon onClick={this.enterSubEdit} className="edit-check" type="edit" /></li>} |
| | |
| | | left: 187px; |
| | | } |
| | | } |
| | | .side-menu.edit { // 编辑时控制菜单底色 |
| | | .ant-menu-sub.ant-menu-inline { |
| | | > .ant-menu-item.ant-menu-item-selected { |
| | | background: unset; |
| | | } |
| | | > .ant-menu-item.ant-menu-item-active { |
| | | background: unset; |
| | | } |
| | | } |
| | | } |
| | | .side-menu.iframe { // tab页中为iframe时 |
| | | max-height: 100vh; |
| | | overflow-y: scroll; |
| | |
| | | 'header.reset': 'Reset', |
| | | 'model.enable': 'Enable', |
| | | 'model.disable': 'Disable', |
| | | 'model.required': 'Required', |
| | | 'model.hidden': 'Hidden', |
| | | 'model.length': 'Length', |
| | | 'model.sort': 'Sort', |
| | | 'model.switch.open': 'Open', |
| | | 'model.switch.close': 'Close', |
| | | 'model.menu.level1': 'Level 1 menu', |
| | |
| | | 'header.form.column.itemUnit': 'Item', |
| | | 'header.form.column.itemsUnit': 'Items', |
| | | 'model.form.column.action': 'Action', |
| | | 'header.form.name': 'Name', |
| | | 'model.form.name': 'Name', |
| | | 'header.form.title': 'Title', |
| | | 'header.form.field': 'Field', |
| | | 'header.form.field.placeholder': 'Please enter a field name', |
| | | 'model.form.field': 'Field', |
| | | 'header.form.innerFunc': 'Internal func', |
| | | 'header.form.outerFunc': 'External function', |
| | | 'header.form.callbackFunc': 'Callback function', |
| | |
| | | 'header.form.blank': '当前页跳转', |
| | | 'model.form.prompt': 'Prompt', |
| | | 'model.form.exec': 'Direct execution', |
| | | 'header.form.icon': '图标', |
| | | 'header.form.class': '颜色', |
| | | 'header.form.align': '对齐方式', |
| | | 'header.form.alignLeft': '左对齐', |
| | | 'header.form.alignRight': '右对齐', |
| | | 'header.form.alignCenter': '居中', |
| | | 'header.form.Hide': '是否隐藏', |
| | | 'header.form.IsSort': '是否排序', |
| | | 'model.form.paramJoint': 'Joint param', |
| | | 'model.form.icon': 'Icon', |
| | | 'model.form.align': 'Alignment', |
| | | 'model.form.alignLeft': 'The left', |
| | | 'model.form.alignRight': 'The Right', |
| | | 'model.form.alignCenter': 'The center', |
| | | 'header.form.columnWidth': '列宽', |
| | | 'header.form.true': '是', |
| | | 'header.form.false': '否', |
| | |
| | | 'header.form.dropdown': '下拉菜单', |
| | | 'header.form.button': '按钮', |
| | | 'header.form.style': '风格', |
| | | 'header.form.color': '颜色', |
| | | 'model.form.color': 'Color', |
| | | 'header.form.order': '排列', |
| | | 'header.form.horizontal': '横向', |
| | | 'header.form.vertical': '纵向', |
| | |
| | | 'model.form.selectItem.error': '下拉选项设置错误!', |
| | | 'header.form.request.method': '请求方式', |
| | | 'header.form.readonly': '是否只读', |
| | | 'header.form.field.required': '是否必填', |
| | | 'header.form.field.ishidden': '是否隐藏', |
| | | 'header.form.queryType': '查询类型', |
| | | 'header.form.query': '查询', |
| | | 'header.form.statistics': '统计', |
| | | 'header.form.database': '数据库', |
| | | 'header.form.database.local': '本地', |
| | | 'header.form.database.sso': '系统', |
| | | 'header.form.field.length': '字段长度', |
| | | 'header.form.linkMain': '关联主表', |
| | | 'header.form.query.delete': '确定删除吗?', |
| | | 'header.form.up': '上移', |
| | |
| | | 'header.reset': '重置', |
| | | 'model.enable': '启', |
| | | 'model.disable': '停', |
| | | 'model.required': '必填', |
| | | 'model.hidden': '隐藏', |
| | | 'model.length': '长度', |
| | | 'model.sort': '排序', |
| | | 'model.switch.open': '开', |
| | | 'model.switch.close': '关', |
| | | 'model.menu.level1': '一级菜单', |
| | |
| | | 'header.form.column.itemUnit': '项', |
| | | 'header.form.column.itemsUnit': '项', |
| | | 'model.form.column.action': '操作', |
| | | 'header.form.name': '名称', |
| | | 'model.form.name': '名称', |
| | | 'header.form.title': '标题', |
| | | 'header.form.field': '字段', |
| | | 'header.form.field.placeholder': '请输入字段名', |
| | | 'model.form.field': '字段', |
| | | 'header.form.innerFunc': '内部函数', |
| | | 'header.form.outerFunc': '外部函数', |
| | | 'header.form.callbackFunc': '回调函数', |
| | |
| | | 'header.form.blank': '当前页跳转', |
| | | 'model.form.prompt': '提示框', |
| | | 'model.form.exec': '直接执行', |
| | | 'header.form.icon': '图标', |
| | | 'header.form.class': '颜色', |
| | | 'header.form.align': '对齐方式', |
| | | 'header.form.alignLeft': '左对齐', |
| | | 'header.form.alignRight': '右对齐', |
| | | 'header.form.alignCenter': '居中', |
| | | 'header.form.Hide': '是否隐藏', |
| | | 'header.form.IsSort': '是否排序', |
| | | 'model.form.paramJoint': '拼接参数', |
| | | 'model.form.icon': '图标', |
| | | 'model.form.align': '对齐方式', |
| | | 'model.form.alignLeft': '左对齐', |
| | | 'model.form.alignRight': '右对齐', |
| | | 'model.form.alignCenter': '居中', |
| | | 'header.form.columnWidth': '列宽', |
| | | 'header.form.true': '是', |
| | | 'header.form.false': '否', |
| | |
| | | 'header.form.dropdown': '下拉菜单', |
| | | 'header.form.button': '按钮', |
| | | 'header.form.style': '风格', |
| | | 'header.form.color': '颜色', |
| | | 'model.form.color': '颜色', |
| | | 'header.form.order': '排列', |
| | | 'header.form.horizontal': '横向', |
| | | 'header.form.vertical': '纵向', |
| | |
| | | 'model.form.selectItem.error': '下拉选项设置错误!', |
| | | 'header.form.request.method': '请求方式', |
| | | 'header.form.readonly': '是否只读', |
| | | 'header.form.field.required': '是否必填', |
| | | 'header.form.field.ishidden': '是否隐藏', |
| | | 'header.form.queryType': '查询类型', |
| | | 'header.form.query': '查询', |
| | | 'header.form.statistics': '统计', |
| | | 'header.form.database': '数据库', |
| | | 'header.form.database.local': '本地', |
| | | 'header.form.database.sso': '系统', |
| | | 'header.form.field.length': '字段长度', |
| | | 'header.form.linkMain': '关联主表', |
| | | 'header.form.query.delete': '确定删除吗?', |
| | | 'header.form.up': '上移', |
| | |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | |
| | | pageIndex: 1, // 页码 |
| | | pageSize: 10, // 每页数据条数 |
| | | orderBy: '', // 排序 |
| | | search: '', // 搜索条件数组,使用时需分场景处理 |
| | | search: [], // 搜索条件数组,使用时需分场景处理 |
| | | pickup: false, // 子表数据隐藏显示切换 |
| | | triggerBtn: null, // 按钮触发 |
| | | chartId: '' // 展开图表ID |
| | |
| | | selectedData: [], |
| | | resetTable: !this.state.resetTable, |
| | | }, () => { |
| | | this.loadmaindata(nextProps.BID, 'refresh') |
| | | if (this.state.setting) { |
| | | this.loadmaindata(nextProps.BID, 'refresh') |
| | | } |
| | | }) |
| | | } else if (this.state.config && nextProps.refreshtabs && nextProps.refreshtabs.includes(this.props.Tab.uuid)) { |
| | | this.reloadtable() |
| | |
| | | triggerBtn: trigger |
| | | }) |
| | | } else if (!this.props.Tab.supMenu && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadmaindata() |
| | | }) |
| | | if (this.state.setting) { |
| | | this.setState({}, () => { |
| | | this.loadmaindata() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | |
| | | reloadview = () => { |
| | | this.setState({ loadingview: true, viewlost: false, lostmsg: '', config: null, searchlist: null, actions: null, |
| | | columns: null, arr_field: '', setting: null, data: null, total: 0, loading: false, pageIndex: 1, pageSize: 10, |
| | | orderBy: '', search: '', triggerBtn: null |
| | | orderBy: '', search: [], triggerBtn: null |
| | | }, () => { |
| | | this.loadconfig() |
| | | }) |
| | |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | _arrField.push(col.field) |
| | | |
| | | _logcolumns.push(col) |
| | | |
| | | col.nameField && _arrField.push(col.nameField) // 链接名字段 |
| | | } |
| | | if (col.type === 'colspan' && col.sublist) { // 筛选隐藏列 |
| | | _hideCol = _hideCol.concat(col.sublist) |
| | |
| | | {content} |
| | | </span> |
| | | ) |
| | | } else if (col.type === 'link') { |
| | | let content = col.nameField ? data[col.nameField] : '' |
| | | let _href = data[col.field] || '' |
| | | |
| | | if (!content && _href) { |
| | | content = _href |
| | | } else if (!_href) { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.joint === 'true' && _href) { |
| | | let _param = window.btoa('id=' + data[this.props.setting.primaryKey] + '&userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')) |
| | | _href += '?' + _param |
| | | } |
| | | |
| | | return ( |
| | | <span> |
| | | {_href ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null} |
| | | </span> |
| | | ) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return ( |
| | | <div> |
| | | <div className="baseboard"></div> |
| | | <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> |
| | | {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null } |
| | | </div> |
| | | </div> |
| | | ) |
| | | } else if (item.type === 'link') { |
| | | let content = '' |
| | | let _href = record[item.field] || '' |
| | | |
| | | if (item.nameField && record.hasOwnProperty(item.nameField)) { |
| | | content = record[item.nameField] |
| | | } |
| | | |
| | | if (!content && _href) { |
| | | content = _href |
| | | } else if (!_href) { |
| | | content = '' |
| | | } |
| | | |
| | | if (item.joint === 'true' && _href) { |
| | | let _param = window.btoa('id=' + record[this.props.setting.primaryKey] + '&userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')) |
| | | _href += '?' + _param |
| | | } |
| | | |
| | | if (item.blur) { |
| | | content = md5(content) |
| | | } |
| | | |
| | | return ( |
| | | <div> |
| | | <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}> |
| | | {content ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null } |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | if (item.format === 'percent') { |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | contents.push(content) |
| | | } else if (col.type === 'link') { |
| | | let content = col.nameField ? record[col.nameField] : '' |
| | | let _href = record[col.field] || '' |
| | | |
| | | if (!content && _href) { |
| | | content = _href |
| | | } else if (!_href) { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.joint === 'true' && _href) { |
| | | let _param = window.btoa('id=' + record[this.props.setting.primaryKey] + '&userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')) |
| | | _href += '?' + _param |
| | | } |
| | | |
| | | if (item.blur) { |
| | | content = md5(content) |
| | | } |
| | | |
| | | content = _href ? <a href={_href} target="_blank" rel="noopener noreferrer">{content}</a> : null |
| | | |
| | | contents.push(content) |
| | | } else { |
| | | let content = record[col.field] |
| | | |
| | |
| | | }, |
| | | { |
| | | type: 'columns', |
| | | label: CommonDict['model.form.textarea'], |
| | | subType: 'textarea', |
| | | label: CommonDict['model.form.href'], |
| | | subType: 'link', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'columns', |
| | | label: CommonDict['model.form.href'], |
| | | subType: 'link', |
| | | label: CommonDict['model.form.textarea'], |
| | | subType: 'textarea', |
| | | url: '' |
| | | }, |
| | | { |
| | |
| | | if (item.subType === 'excelIn') { |
| | | // 导入和导出excel,按钮名称直接为导入、导出 |
| | | newcard.label = item.label |
| | | newcard.class = 'border-dgreen' |
| | | } else if (item.subType === 'excelOut') { |
| | | newcard.label = item.label |
| | | newcard.intertype = setting.interType |
| | |
| | | newcard.sysInterface = setting.sysInterface |
| | | newcard.outerFunc = setting.outerFunc |
| | | newcard.interface = setting.interface |
| | | newcard.class = 'dgreen' |
| | | } |
| | | |
| | | let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0 |
| | |
| | | fields = fields + ',' |
| | | } |
| | | |
| | | _value = `Insert into ${btn.sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid,@username,@fullname,@BID From @${btn.sheet}` |
| | | _value = `Insert into ${btn.sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From @${btn.sheet}` |
| | | } else { |
| | | _value = value |
| | | } |
| | |
| | | title: '执行位置', |
| | | dataIndex: 'position', |
| | | width: '10%', |
| | | render: (text, record) => record.position !== 'front' ? 'sql后' : 'sql前' |
| | | render: (text, record) => { |
| | | let _text = '' |
| | | if (record.position === 'front') { |
| | | _text = 'sql前' |
| | | } else if (record.position === 'init') { |
| | | _text = '初始化' |
| | | } else { |
| | | _text = 'sql后' |
| | | } |
| | | return _text |
| | | } |
| | | }, |
| | | { |
| | | title: '状态', |
| | |
| | | <Select |
| | | mode="multiple" |
| | | > |
| | | <Select.Option key="bid" value="BID">BID</Select.Option> |
| | | {fields.map(item => ( |
| | | <Select.Option key={item.uuid} value={item.Column}>{item.Text}</Select.Option> |
| | | ))} |
| | |
| | | } |
| | | } |
| | | |
| | | let _columns = config.columns.filter(col => ['text', 'number'].includes(col.type)) |
| | | let _columns = config.columns.filter(col => ['text', 'number', 'link'].includes(col.type)) |
| | | _columns = _columns.map(col => { |
| | | return { |
| | | uuid: col.uuid, |
| | |
| | | <Form {...formItemLayout} className="commontable-cospan-column-form" id="columncolspan"> |
| | | <Row gutter={24}> |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['header.form.name']}> |
| | | <Form.Item label={this.props.dict['model.form.name']}> |
| | | {getFieldDecorator('label', { |
| | | initialValue: this.props.card.label, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + this.props.dict['header.form.name'] + '!' |
| | | message: this.props.dict['form.required.input'] + this.props.dict['model.form.name'] + '!' |
| | | }, |
| | | { |
| | | max: formRule.input.max, |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['header.form.align']}> |
| | | <Form.Item label={this.props.dict['model.form.align']}> |
| | | {getFieldDecorator('Align', { |
| | | initialValue: this.props.card.Align, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + this.props.dict['header.form.align'] + '!' |
| | | message: this.props.dict['form.required.select'] + this.props.dict['model.form.align'] + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select |
| | | getPopupContainer={() => document.getElementById('columncolspan')} |
| | | > |
| | | <Select.Option value="left">{this.props.dict['header.form.alignLeft']}</Select.Option> |
| | | <Select.Option value="right">{this.props.dict['header.form.alignRight']}</Select.Option> |
| | | <Select.Option value="center">{this.props.dict['header.form.alignCenter']}</Select.Option> |
| | | <Select.Option value="left">{this.props.dict['model.form.alignLeft']}</Select.Option> |
| | | <Select.Option value="right">{this.props.dict['model.form.alignRight']}</Select.Option> |
| | | <Select.Option value="center">{this.props.dict['model.form.alignCenter']}</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={this.props.dict['header.form.Hide']}> |
| | | <Form.Item label={this.props.dict['model.hidden']}> |
| | | {getFieldDecorator('Hide', { |
| | | initialValue: this.props.card.Hide, |
| | | initialValue: this.props.card.Hide || 'false', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.select'] + this.props.dict['header.form.Hide'] + '!' |
| | | message: this.props.dict['form.required.select'] + this.props.dict['model.hidden'] + '!' |
| | | } |
| | | ] |
| | | })( |
| | |
| | | import './index.scss' |
| | | |
| | | const columnTypeOptions = { |
| | | text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'color', 'fieldlength', 'blacklist', 'linkmenu'], |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'color', 'blacklist', 'linkmenu'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'color', 'fieldlength', 'blacklist'], |
| | | text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist', 'linkmenu'], |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'linkmenu'], |
| | | link: ['label', 'field', 'type', 'nameField', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale', 'maxHeight'] |
| | | } |
| | | |
| | |
| | | |
| | | if (item.type === 'text') { // 文本搜索 |
| | | let rules = [] |
| | | if (item.key === 'field' || item.key === 'contrastField') { |
| | | if (item.key === 'field' || item.key === 'nameField') { |
| | | rules = [{ |
| | | pattern: formRule.field.pattern, |
| | | message: formRule.field.message |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: this.props.dict['header.form.name'], |
| | | label: this.props.dict['model.form.name'], |
| | | initVal: this.props.card.label, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'Align', |
| | | label: this.props.dict['header.form.align'], |
| | | label: this.props.dict['model.form.align'], |
| | | initVal: this.props.card.Align, |
| | | required: true, |
| | | options: [{ |
| | | MenuID: 'left', |
| | | text: this.props.dict['header.form.alignLeft'] |
| | | text: this.props.dict['model.form.alignLeft'] |
| | | }, { |
| | | MenuID: 'right', |
| | | text: this.props.dict['header.form.alignRight'] |
| | | text: this.props.dict['model.form.alignRight'] |
| | | }, { |
| | | MenuID: 'center', |
| | | text: this.props.dict['header.form.alignCenter'] |
| | | text: this.props.dict['model.form.alignCenter'] |
| | | }] |
| | | }, |
| | | { |
| | |
| | | <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} > |
| | | <div className="base" onClick={this.changeSelect}> |
| | | <Icon type="check" /> |
| | | <p title={card.field}>{this.props.dict['header.form.field']}: <span>{card.field}</span></p> |
| | | <p title={card.label}>{this.props.dict['header.form.name']}: <span>{card.label}</span></p> |
| | | <p title={card.field}>{this.props.dict['model.form.field']}: <span>{card.field}</span></p> |
| | | <p title={card.label}>{this.props.dict['model.form.name']}: <span>{card.label}</span></p> |
| | | </div> |
| | | {type === 'search' ? |
| | | <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}> |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { dict } = this.props |
| | | const { dataSource, type, loading } = this.state |
| | | |
| | | return ( |
| | | <div className="common-modal-edit-card"> |
| | | <Row className="search-row"> |
| | | <Col span={8}> |
| | | {!loading ? <Search placeholder={this.props.dict['header.form.field.placeholder']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} |
| | | {!loading ? <Search placeholder={dict['form.required.input'] + dict['header.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} |
| | | </Col> |
| | | <Col span={8}> |
| | | <Button onClick={this.reset}> |
| | |
| | | } else if (form.key === 'field' && type === 'text') { |
| | | form.tooltip = this.state.textTooltip |
| | | } else if (form.key === 'field' && type === 'group') { |
| | | form.label = dict['header.form.type'] + dict['header.form.field'] |
| | | form.label = dict['header.form.type'] + dict['model.form.field'] |
| | | } |
| | | form.hidden = !_options.includes(form.key) |
| | | return form |
| | |
| | | matchs = form.options |
| | | } else if (form.key === 'field') { |
| | | form.tooltip = '' |
| | | form.label = dict['header.form.field'] |
| | | form.label = dict['model.form.field'] |
| | | if (value === 'text') { |
| | | form.tooltip = this.state.textTooltip |
| | | } else if (value === 'group') { |
| | | form.label = dict['header.form.type'] + dict['header.form.field'] |
| | | form.label = dict['header.form.type'] + dict['model.form.field'] |
| | | } |
| | | } |
| | | |
| | |
| | | }, |
| | | { |
| | | type: 'columns', |
| | | label: CommonDict['model.form.textarea'], |
| | | subType: 'textarea', |
| | | label: CommonDict['model.form.href'], |
| | | subType: 'link', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'columns', |
| | | label: CommonDict['model.form.href'], |
| | | subType: 'link', |
| | | label: CommonDict['model.form.textarea'], |
| | | subType: 'textarea', |
| | | url: '' |
| | | }, |
| | | { |
| | |
| | | <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} > |
| | | <div className="base" onClick={this.changeSelect}> |
| | | <Icon type="check" /> |
| | | <p title={card.field}>{this.props.dict['header.form.field']}: <span>{card.field}</span></p> |
| | | <p title={card.label}>{this.props.dict['header.form.name']}: <span>{card.label}</span></p> |
| | | <p title={card.field}>{this.props.dict['model.form.field']}: <span>{card.field}</span></p> |
| | | <p title={card.label}>{this.props.dict['model.form.name']}: <span>{card.label}</span></p> |
| | | </div> |
| | | {type === 'search' ? |
| | | <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}> |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { dict } = this.props |
| | | const { dataSource, type, loading } = this.state |
| | | |
| | | return ( |
| | | <div className="common-modal-edit-card"> |
| | | <Row className="search-row"> |
| | | <Col span={8}> |
| | | {!loading ? <Search placeholder={this.props.dict['header.form.field.placeholder']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} |
| | | {!loading ? <Search placeholder={dict['form.required.input'] + dict['header.form.field']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null} |
| | | </Col> |
| | | <Col span={8}> |
| | | <Button onClick={this.reset}> |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: Formdict['header.form.name'], |
| | | label: Formdict['model.form.name'], |
| | | initVal: card.label || '', |
| | | required: true, |
| | | readonly: false |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'field', |
| | | label: Formdict['header.form.field'], |
| | | label: Formdict['model.form.field'], |
| | | initVal: card.field || '', |
| | | tooltipClass: 'middle', |
| | | required: true, |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['header.form.field.required'], |
| | | label: Formdict['model.required'], |
| | | initVal: card.required || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'icon', |
| | | label: Formdict['header.form.icon'], |
| | | label: Formdict['model.form.icon'], |
| | | initVal: card.icon, |
| | | required: false, |
| | | options: [] |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'class', |
| | | label: Formdict['header.form.class'], |
| | | label: Formdict['model.form.color'], |
| | | initVal: card.class, |
| | | required: false, |
| | | options: [] |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: Formdict['header.form.name'], |
| | | label: Formdict['model.form.name'], |
| | | initVal: card.label, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'field', |
| | | label: Formdict['header.form.field'], |
| | | label: Formdict['model.form.field'], |
| | | initVal: card.field, |
| | | required: true, |
| | | readonly: false |
| | |
| | | value: 'picture', |
| | | text: Formdict['model.form.picture'] |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.href'] |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'nameField', |
| | | label: Formdict['model.form.name'] + Formdict['model.form.field'], |
| | | initVal: card.nameField, |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: Formdict['model.form.paramJoint'], |
| | | initVal: card.joint || 'true', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'Hide', |
| | | label: Formdict['header.form.Hide'], |
| | | label: Formdict['model.hidden'], |
| | | initVal: card.Hide || 'false', |
| | | required: true, |
| | | options: [{ |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'IsSort', |
| | | label: Formdict['header.form.IsSort'], |
| | | label: Formdict['model.sort'], |
| | | initVal: card.IsSort || 'true', |
| | | required: true, |
| | | options: [{ |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'Align', |
| | | label: Formdict['header.form.align'], |
| | | label: Formdict['model.form.align'], |
| | | initVal: card.Align || 'left', |
| | | required: true, |
| | | options: [{ |
| | | value: 'left', |
| | | text: Formdict['header.form.alignLeft'] |
| | | text: Formdict['model.form.alignLeft'] |
| | | }, { |
| | | value: 'center', |
| | | text: Formdict['header.form.alignCenter'] |
| | | text: Formdict['model.form.alignCenter'] |
| | | }, { |
| | | value: 'right', |
| | | text: Formdict['header.form.alignRight'] |
| | | text: Formdict['model.form.alignRight'] |
| | | }] |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | label: Formdict['header.form.field.length'], |
| | | label: Formdict['model.form.field'] + Formdict['model.length'], |
| | | initVal: card.fieldlength || (card.type === 'text' ? 50 : 512), |
| | | required: true |
| | | }, |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'Hide', |
| | | label: Formdict['header.form.Hide'], |
| | | label: Formdict['model.hidden'], |
| | | initVal: card.Hide, |
| | | required: true, |
| | | options: [{ |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: Formdict['header.form.name'], |
| | | label: Formdict['model.form.name'], |
| | | initVal: card.label, |
| | | required: true, |
| | | readonly: false |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'field', |
| | | label: Formdict['header.form.field'], |
| | | label: Formdict['model.form.field'], |
| | | initVal: card.field || '', |
| | | required: true, |
| | | readonly: false |
| | |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | label: Formdict['header.form.field.length'], |
| | | label: Formdict['model.form.field'] + Formdict['model.length'], |
| | | tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512', |
| | | initVal: card.fieldlength || _fieldlength, |
| | | required: false |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['header.form.field.required'], |
| | | label: Formdict['model.required'], |
| | | initVal: card.required || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'hidden', |
| | | label: Formdict['header.form.field.ishidden'], |
| | | label: Formdict['model.required'], |
| | | initVal: card.hidden || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | } |
| | | }) |
| | | |
| | | if (columns && columns.length > 0 && this.props.btnTab.Ot !== 'notRequired') { |
| | | if (columns && columns.length > 0 && this.props.btnTab.Ot !== 'notRequired' && this.props.btnTab.Ot !== 'requiredOnce') { |
| | | columns.forEach(_f => { |
| | | if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { |
| | | if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired' && this.props.card.Ot !== 'requiredOnce') { |
| | | columns.forEach(_f => { |
| | | if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return |
| | | |
| | |
| | | let _select = ['@UserName=\'\'', '@FullName=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\''] |
| | | let fieldArr = _usefulfields.map(_f => _f.toLowerCase()) |
| | | |
| | | if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { |
| | | if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired' && this.props.card.Ot !== 'requiredOnce') { |
| | | columns.forEach(_f => { |
| | | if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return |
| | | |
| | |
| | | _defaultsql = `update ${this.props.card.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${config.setting.primaryKey}=@ID@;` |
| | | } else if (this.props.card.sqlType === 'delete') { |
| | | let _msg = '' |
| | | if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') { |
| | | if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired' && this.props.card.Ot !== 'requiredOnce') { |
| | | let _index = 0 |
| | | columns.forEach(col => { |
| | | if (col.field && col.Hide !== 'true' && _index < 4) { |
| | |
| | | let datasource = setting.dataresource |
| | | if (/\s/.test(datasource)) { // 拼接别名 |
| | | datasource = '(' + datasource + ') tb' |
| | | } else { |
| | | datasource = datasource + ' tb' |
| | | } |
| | | |
| | | verify.uniques.forEach(item => { |
| | | let _primaryKey = item.field.split(',').includes(primaryKey) ? '' : ',' + primaryKey |
| | | |
| | | _sql += ` |
| | | /* 同类数据验证 */ |
| | | Set @tbid='' |
| | | |
| | | Select top 1 @tbid='X' from (select ${item.field}${_primaryKey},1 as n from ${datasource} ) tb inner join (select ID from dbo.SplitComma(@ID@)) sp on tb.${primaryKey}=sp.ID group by ${item.field} having sum(n)>1 |
| | | Select top 1 @tbid='X' from (select distinct ${item.field},1 as n from ${datasource} inner join (select ID from dbo.SplitComma(@ID@)) sp on tb.${primaryKey}=sp.ID ) a group by ${item.field} having sum(n)>1 |
| | | |
| | | If @tbid!='' |
| | | Begin |