| | |
| | | if (appType === 'mob') { |
| | | group.fields.forEach(f => { |
| | | if (f.field && ['select', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | fields.push({...f, label: `${f.label}(${f.field})`}) |
| | | } |
| | | }) |
| | | } else { |
| | | group.fields.forEach(f => { |
| | | if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | fields.push({...f, label: `${f.label}(${f.field})`}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Popover, Modal, Button, Switch, message } from 'antd' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined } from '@ant-design/icons' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined, VerticalRightOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | }) |
| | | } |
| | | |
| | | toLower = () => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let that = this |
| | | |
| | | card.subcards[0].fields = card.subcards[0].fields.map(item => { |
| | | if (item.field) { |
| | | item.field = item.field.toLowerCase() |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | confirm({ |
| | | content: `确定将字段转为小写吗?`, |
| | | onOk() { |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | } trigger="hover"> |
| | | <SwapOutlined /> |
| | | </Popover> : null} |
| | | <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/> |
| | | <FormFork forms={card.subcards[0].fields}/> |
| | | {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */} |
| | | <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> |
| | |
| | | if (appType === 'mob') { |
| | | config.subcards[0].fields.forEach(f => { |
| | | if (f.field && ['select', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | fields.push({...f, label: `${f.label}(${f.field})`}) |
| | | } |
| | | }) |
| | | } else { |
| | | config.subcards[0].fields.forEach(f => { |
| | | if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | fields.push({...f, label: `${f.label}(${f.field})`}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Popover, Modal, Button, Switch, notification, message } from 'antd' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined } from '@ant-design/icons' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined, VerticalRightOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | } |
| | | } |
| | | |
| | | toLower = () => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | let card = fromJS(this.state.card).toJS() |
| | | let that = this |
| | | |
| | | group.fields = group.fields.map(item => { |
| | | if (item.field) { |
| | | item.field = item.field.toLowerCase() |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | card.subcards = card.subcards.map(item => { |
| | | if (item.uuid === group.uuid) { |
| | | return group |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | confirm({ |
| | | content: `确定将字段转为小写吗?`, |
| | | onOk() { |
| | | that.setState({group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | } trigger="hover"> |
| | | <SwapOutlined /> |
| | | </Popover> : null} |
| | | <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/> |
| | | <FormFork forms={group.fields}/> |
| | | {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */} |
| | | <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Popover, Modal, Button, Switch, notification, message } from 'antd' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined } from '@ant-design/icons' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined, VerticalRightOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | } |
| | | } |
| | | |
| | | toLower = () => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | let card = fromJS(this.state.card).toJS() |
| | | let that = this |
| | | |
| | | group.fields = group.fields.map(item => { |
| | | if (item.field) { |
| | | item.field = item.field.toLowerCase() |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | card.subcards = card.subcards.map(item => { |
| | | if (item.uuid === group.uuid) { |
| | | return group |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | confirm({ |
| | | content: `确定将字段转为小写吗?`, |
| | | onOk() { |
| | | that.setState({group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | } trigger="hover"> |
| | | <SwapOutlined /> |
| | | </Popover> : null} |
| | | <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/> |
| | | <FormFork forms={group.fields}/> |
| | | {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */} |
| | | <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> |
| | |
| | | writein: item.writein !== 'false', |
| | | type: item.type |
| | | } |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | |
| | | if (_item.type === 'datemonth') { |
| | | _item.type = 'text' |
| | |
| | | writein: item.writein !== 'false', |
| | | type: item.type |
| | | } |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | |
| | | if (_item.type === 'datemonth') { |
| | | _item.type = 'text' |
| | |
| | | key: 'mk_n_id' |
| | | }) |
| | | } |
| | | |
| | | let verifyValSql = '' |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.$verify) { |
| | | verifyValSql += ` |
| | | if @${form.key}=${form.type === 'number' ? 0 : `''`} |
| | | begin |
| | | select @errorcode='E',@retmsg='${form.label},关联主表失效' |
| | | goto aaa |
| | | end |
| | | ` |
| | | } |
| | | |
| | | let _key = form.key.toLowerCase() |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | |
| | | } else if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | if (verifyValSql) { |
| | | _sql += verifyValSql |
| | | } |
| | | |
| | | if (btn.procMode === 'system') { |
| | | _sql += ` |
| | |
| | | import { DndProvider } from 'react-dnd' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { Button, Card, Modal, Collapse, Switch, message, Popover } from 'antd' |
| | | import { SettingOutlined, CopyOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import { SettingOutlined, CopyOutlined, SwapOutlined, DeleteOutlined, VerticalRightOutlined } from '@ant-design/icons' |
| | | |
| | | import { getModalForm } from '@/templates/zshare/formconfig' |
| | | import SourceElement from '@/templates/modalconfig/dragelement/source' |
| | |
| | | }) |
| | | } |
| | | |
| | | toLower = () => { |
| | | let _config = fromJS(this.state.config).toJS() |
| | | let that = this |
| | | |
| | | _config.fields = _config.fields.map(item => { |
| | | if (item.field) { |
| | | item.field = item.field.toLowerCase() |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | confirm({ |
| | | content: `确定将字段转为小写吗?`, |
| | | onOk() { |
| | | that.setState({ |
| | | config: _config |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | triggerCopy = () => { |
| | | const { config } = this.state |
| | | |
| | |
| | | } trigger="hover"> |
| | | <SwapOutlined /> |
| | | </Popover> |
| | | <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/> |
| | | <FormFork forms={config.fields}/> |
| | | <CopyOutlined title="复制" onClick={this.triggerCopy} /> |
| | | <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> |
| | |
| | | newcard.span = 24 |
| | | newcard.focus = true |
| | | |
| | | if (item.subType === 'textarea') { |
| | | if (item.subType === 'linkMain') { |
| | | newcard.hidden = 'true' |
| | | newcard.verifyVal = 'true' |
| | | } else if (item.subType === 'textarea') { |
| | | newcard.required = 'false' |
| | | } |
| | | |
| | |
| | | |
| | | let val = form.value |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | } else if (['date', 'datemonth'].includes(form.type)) { |
| | |
| | | let val = form.value |
| | | |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | _initFormfields.push(`@${_key}=${val}`) |
| | |
| | | let key = item.field.toLowerCase() |
| | | let _readin = item.readin !== 'false' |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | if (_item.type === 'date') { // 时间兼容 |
| | | _item.precision = item.precision || 'day' |
| | | } else if (_item.type === 'datetime') { |
| | |
| | | |
| | | let val = form.value |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | } else if (['date', 'datemonth'].includes(form.type)) { |
| | |
| | | |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | let val = form.value |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | _initvars.push(`@${_key}=${val}`) |
| | |
| | | let key = item.field.toLowerCase() |
| | | let _readin = item.readin !== 'false' |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | if (_item.type === 'date') { // 时间兼容 |
| | | _item.precision = item.precision || 'day' |
| | | } else if (_item.type === 'datetime') { |
| | |
| | | } else if (item.type === 'linkMain') { |
| | | readin = false |
| | | item.readin = false |
| | | item.$verify = item.verifyVal === 'true' |
| | | } else if (item.type === 'number') { |
| | | item.decimal = item.decimal || 0 |
| | | item.fieldlength = item.decimal |
| | |
| | | key: item.field, |
| | | isconst: item.constant === 'true' |
| | | } |
| | | |
| | | if (item.$verify) { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | |
| | | _item.value = record[item.field] !== undefined ? record[item.field] : '' |
| | | |
| | |
| | | |
| | | if (item.subType === 'linkMain') { |
| | | newcard.hidden = 'true' |
| | | newcard.verifyVal = 'true' |
| | | } else if (item.subType === 'textarea') { |
| | | newcard.required = 'false' |
| | | } |
| | |
| | | > |
| | | {fields.map(option => |
| | | <Select.Option id={option.uuid} title={option.label} key={option.uuid} value={option.field}> |
| | | {option.label} |
| | | {`${option.label}(${option.field})`} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | > |
| | | {fields.map(option => |
| | | <Select.Option key={option.uuid} value={option.uuid}> |
| | | {option.label} |
| | | {`${option.label}(${option.field})`} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'verifyVal', |
| | | label: '空值验证', |
| | | tooltip: '按钮提交时验证字段值是否为空(或数值为0)。', |
| | | initVal: card.verifyVal || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '开启' |
| | | }, { |
| | | value: 'false', |
| | | text: '关闭' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'format', |
| | | label: '格式化', |
| | | tooltip: '使用千分位时,数值将以千分位格式显示,提交时为原数值。', |
| | |
| | | formula: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'supField', 'span', 'labelwidth', 'formula', 'eval', 'postfix'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom', 'contHeidht'], |
| | | funcvar: ['span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom'], |
| | | linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom', 'verifyVal'], |
| | | popSelect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'enter', 'dataSource', 'columns', 'primaryKey', 'order', 'controlField', 'laypage', 'onload', 'searchKey', 'showField', 'popWidth'], |
| | | vercode: ['label', 'field', 'type', 'blacklist', 'supField', 'readonly', 'required', 'hidden', 'span', 'labelwidth', 'tooltip', 'marginTop', 'marginBottom', 'placeholder', 'enter', 'smsId', 'phoneField', 'sendType'] |
| | | } |
| | |
| | | |
| | | if (value === 'linkMain') { |
| | | this.record.hidden = 'true' |
| | | this.record.verifyVal = 'true' |
| | | _fieldval.hidden = 'true' |
| | | _fieldval.verifyVal = 'true' |
| | | } |
| | | |
| | | if (this.record.type === 'cascader' && value !== 'cascader') { |
| | |
| | | _f.writein = _f.writein !== 'false' |
| | | _f.fieldlen = _f.fieldlength || 50 |
| | | |
| | | if (_f.type === 'linkMain' && _f.verifyVal === 'true') { |
| | | _f.$verify = true |
| | | } |
| | | |
| | | if (_f.type === 'datemonth') { |
| | | _f.type = 'text' |
| | | } else if (_f.type === 'number' || _f.type === 'rate') { |
| | |
| | | |
| | | formdata = formdata.length ? formdata : null |
| | | |
| | | let verifyValSql = '' |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.$verify) { |
| | | verifyValSql += ` |
| | | if @${form.field}=${form.type === 'number' ? 0 : `''`} |
| | | begin |
| | | select @errorcode='E',@retmsg='${form.label},关联主表失效' |
| | | goto aaa |
| | | end |
| | | ` |
| | | } |
| | | |
| | | let _key = form.field.toLowerCase() |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | |
| | | } else if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | if (verifyValSql) { |
| | | _sql += verifyValSql |
| | | } |
| | | |
| | | if (btn.procMode === 'system') { |
| | | _sql += ` |
| | |
| | | isconst: item.constant === 'true' |
| | | } |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | |
| | | if (_item.type === 'datemonth') { |
| | | _item.type = 'text' |
| | | } else if (_item.type === 'number' || _item.type === 'rate') { |
| | |
| | | formdata.push(item) |
| | | } |
| | | |
| | | let verifyValSql = '' |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.$verify) { |
| | | verifyValSql += ` |
| | | if @${form.key}=${form.type === 'number' ? 0 : `''`} |
| | | begin |
| | | select @errorcode='E',@retmsg='${form.label},关联主表失效' |
| | | goto aaa |
| | | end |
| | | ` |
| | | } |
| | | |
| | | let _key = form.key.toLowerCase() |
| | | |
| | | if (!formkeys.includes(_key)) { |
| | |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | if (verifyValSql) { |
| | | _sql += verifyValSql |
| | | } |
| | | |
| | | if (verify.workFlow === 'true' && process) { |
| | | if (verify.flowType === 'start') { |
| | | _sql = _sql.replace(/@start_type@/ig, `'开始'`) |
| | |
| | | let _initFormfields = [] |
| | | let _initColfields = [] |
| | | let _declarefields = [] |
| | | let verifyValSql = '' |
| | | |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.$verify) { |
| | | verifyValSql += ` |
| | | if @${form.key}=${form.type === 'number' ? 0 : `''`} |
| | | begin |
| | | select @errorcode='E',@retmsg='${form.label},关联主表失效' |
| | | goto aaa |
| | | end |
| | | ` |
| | | } |
| | | |
| | | let _key = form.key.toLowerCase() |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | |
| | | let val = form.value |
| | | |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | _initFormfields.push(`@${_key}=${val}`) |
| | |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | if (verifyValSql) { |
| | | _sql += verifyValSql |
| | | } |
| | | |
| | | if (window.GLOB.breakpoint) { |
| | | let start = new RegExp('\\/\\*\\$breakpoint_begin_' + window.GLOB.breakpoint + '@', 'ig') |
| | | let end = new RegExp('@breakpoint_end_' + window.GLOB.breakpoint + '\\$\\*\\/', 'ig') |