| | |
| | | |
| | | fields.push('jskey') |
| | | |
| | | let _sql = `Declare @${btn.sheet} table (${usefulfields.map(item => item.field + ' ' + item.type).join(',')},jskey nvarchar(50) ) |
| | | let _sql = `Declare @${btn.sheet} table (${usefulfields.map(item => item.field + ' ' + item.type).join(',')},jskey nvarchar(50),data_type nvarchar(50),BID nvarchar(50)) |
| | | Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(50),@mk_organization nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) |
| | | Select @ErrorCode='', @retmsg='' |
| | | ` |
| | |
| | | </Col> |
| | | {usefulfields ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | BID, ID, LoginUID, SessionUid, UserID, Appkey, UserName, FullName, RoleID, mk_departmentcode, mk_organization, login_city, {usefulfields} |
| | | BID, ID, LoginUID, SessionUid, UserID, Appkey, UserName, FullName, RoleID, mk_departmentcode, mk_organization, login_city, {usefulfields},data_type(注:jskey为主键值,新增时前端生成;data_type为操作类型,新增 - add、修改 - upt、删除 - del) |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | const { columns, cols, card, setting } = this.props |
| | | const { columns, card, setting } = this.props |
| | | let _verify = fromJS(card).toJS() |
| | | _verify.sheet = _verify.sheet || setting.tableName |
| | | |
| | | let fieldLabel = {} |
| | | let _columns = [] |
| | | let _fields = {} |
| | | // let _columns = [] |
| | | // let _fields = {} |
| | | |
| | | columns.forEach(col => { |
| | | fieldLabel[col.field] = col.label |
| | | _fields[col.field] = col |
| | | // _fields[col.field] = col |
| | | }) |
| | | cols.forEach(col => { |
| | | if (!col.field || col.type === 'index' || !_fields[col.field]) return |
| | | // cols.forEach(col => { |
| | | // if (!col.field || col.type === 'index' || !_fields[col.field]) return |
| | | |
| | | _columns.push(_fields[col.field]) |
| | | }) |
| | | // _columns.push(_fields[col.field]) |
| | | // }) |
| | | |
| | | this.setState({ |
| | | fields: _columns, |
| | | fields: fromJS(columns).toJS().filter(item => item.field !== setting.primaryKey), |
| | | fieldLabel, |
| | | verify: _verify |
| | | }, () => { |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { fields, columns } = this.props |
| | | const { fields, setting } = this.props |
| | | const { data, editable } = this.state |
| | | |
| | | let _fields = [] |
| | | // let _fields = [] // 定义全部字段,不在从可编辑列中选取 |
| | | |
| | | let fieldType = {} |
| | | fields.forEach(item => { |
| | | fieldType[item.field] = item.datatype |
| | | }) |
| | | // let fieldType = {} |
| | | // fields.forEach(item => { |
| | | // fieldType[item.field] = item.datatype |
| | | // }) |
| | | |
| | | columns.forEach(col => { |
| | | if (!col.field || col.type === 'index') return |
| | | // columns.forEach(col => { |
| | | // if (!col.field || col.type === 'index') return |
| | | |
| | | _fields.push({...col, datatype: fieldType[col.field] || 'Nvarchar(50)'}) |
| | | }) |
| | | // _fields.push({...col, datatype: fieldType[col.field] || 'Nvarchar(50)'}) |
| | | // }) |
| | | |
| | | this.setState({ |
| | | fields: _fields, |
| | | fields: fields.filter(item => item.field !== setting.primaryKey), |
| | | }) |
| | | |
| | | if (editable === 'true' && data && data.length > 0) { |
| | |
| | | item.$Index = item.key + 1 + '' |
| | | |
| | | fields.forEach(col => { |
| | | item[col.field] = item[col.field] !== undefined ? item[col.field] : '' |
| | | |
| | | if (col.initval !== '$copy') { |
| | | item[col.field] = col.initval |
| | | } |
| | |
| | | if (isNaN(item[col.field])) { |
| | | item[col.field] = 0 |
| | | } |
| | | } |
| | | if (item[col.field] === undefined) { |
| | | item[col.field] = '' |
| | | } |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | fields.forEach(col => { |
| | | item[col.field] = item[col.field] !== undefined ? item[col.field] : '' |
| | | |
| | | if (col.initval !== '$copy') { |
| | | item[col.field] = col.initval |
| | | } |
| | |
| | | item[col.field] = 0 |
| | | } |
| | | } |
| | | |
| | | if (item[col.field] === undefined) { |
| | | item[col.field] = '' |
| | | } |
| | | }) |
| | | |
| | | this.setState({edData: [...edData, item]}) |
| | |
| | | componentDidMount () { |
| | | const { config } = this.state |
| | | |
| | | if (config.multiple !== 'true' && config.linkField) { |
| | | if (config.linkField) { |
| | | MKEmitter.addListener('mkFP', this.mkFormHandle) |
| | | } |
| | | } |
| | |
| | | const { config } = this.state |
| | | |
| | | let options = config.oriOptions.filter(option => option.ParentID === parentId) |
| | | let _option = options[0] && !options[0].$disabled ? options[0] : null |
| | | let val = _option ? _option.$value : '' |
| | | |
| | | this.setState({ |
| | | options, |
| | | value: val |
| | | }) |
| | | |
| | | let other = {} |
| | | |
| | | if (config.subFields && _option) { |
| | | config.subFields.forEach((n, i) => { |
| | | other[n.field] = _option[n.field] |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'input', n.uuid, _option[n.field]) |
| | | }, i * 5) |
| | | if (config.multiple === 'true') { |
| | | this.setState({ |
| | | options, |
| | | selectKeys: [] |
| | | }) |
| | | } |
| | | this.props.onChange('') |
| | | } else { |
| | | let _option = options[0] && !options[0].$disabled ? options[0] : null |
| | | let val = _option ? _option.$value : '' |
| | | |
| | | this.props.onChange(val, other) |
| | | |
| | | if (level < 7 && config.linkFields) { |
| | | config.linkFields.forEach((m, i) => { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFP', m.uuid, val, level + 1) |
| | | }, (i + 1) * 70) |
| | | this.setState({ |
| | | options, |
| | | selectKeys: val |
| | | }) |
| | | |
| | | let other = {} |
| | | |
| | | if (config.subFields && _option) { |
| | | config.subFields.forEach((n, i) => { |
| | | other[n.field] = _option[n.field] |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'input', n.uuid, _option[n.field]) |
| | | }, i * 5) |
| | | }) |
| | | } |
| | | |
| | | this.props.onChange(val, other) |
| | | |
| | | if (level < 7 && config.linkFields) { |
| | | config.linkFields.forEach((m, i) => { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFP', m.uuid, val, level + 1) |
| | | }, (i + 1) * 70) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | shows.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'database', 'backgroundColor') |
| | | } |
| | | } |
| | | if (this.record.multiple === 'false') { |
| | | shows.push('linkField') |
| | | } |
| | | shows.push('linkField') |
| | | reRequired.linkField = false |
| | | } |
| | | |
| | |
| | | |
| | | if (this.record.multiple === 'false') { |
| | | shows.push('linkSubField') |
| | | shows.push('linkField') |
| | | reRequired.linkField = false |
| | | } else { |
| | | reTooltip.initval = '添加多个初始值请使用逗号分隔。' |
| | | } |
| | | |
| | | shows.push('linkField') |
| | | reRequired.linkField = false |
| | | |
| | | if (sessionStorage.getItem('appType') === 'mob') { |
| | | shows.push('hidelabel') |
| | | } |