| | |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | let content = null |
| | | let label = item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> : item.label |
| | | let label = item.label |
| | | if (item.tooltip) { |
| | | if (item.toolWidth) { |
| | | label = <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.toolWidth}} title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } else { |
| | | label = <Tooltip placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'text') { |
| | | content = (<MKEInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val}, item)} onSubmit={this.props.inputSubmit} />) |
| | |
| | | <div className="mk-popover-control"> |
| | | <PlusOutlined className="plus" title="添加元素" onClick={this.addElement} /> |
| | | <PlusSquareOutlined className="plus" title="添加按钮" onClick={this.addButton} /> |
| | | <NormalForm title="浮动卡设置" width={850} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <NormalForm title="浮动卡设置" width={900} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="balcony" card={card}/> |
| | |
| | | <div>2、同步类型中公式、按钮以及全选元素比较特殊,操作数据为其同步组件的数据。</div> |
| | | <div>3、上级类型需添加当前组件的上级组件,并可设置当前组件为始终显示,还是只有在上级组件选行后才显示。</div> |
| | | </div>, |
| | | toolWidth: 400, |
| | | required: false, |
| | | options: [ |
| | | {value: 'static', label: '独立'}, |
| | |
| | | if (['text', 'picture'].includes(this.record.eleType) && this.record.link) { |
| | | _options.push('linkType') |
| | | if (this.record.linkType === 'linkmenu') { |
| | | _options.push('open', 'joint') |
| | | _options.push('open') |
| | | if (this.record.link === 'static') { |
| | | _options.push('linkmenu') |
| | | } else { |
| | | _options.push('linkurl') |
| | | } |
| | | } else if (this.record.linkType === 'other') { |
| | | _options.push('linkurl', 'joint', 'open') |
| | | _options.push('linkurl', 'open') |
| | | } else { |
| | | _options.push('linkurl') |
| | | } |
| | |
| | | this.state.formlist.forEach((item, index) => { |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | let label = item.label |
| | | if (item.tooltip) { |
| | | if (item.toolWidth) { |
| | | label = <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.toolWidth}} title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } else { |
| | | label = <Tooltip placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'text') { |
| | | let rules = item.rules || [] |
| | | if (item.options && item.options.length > 0) { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | }, |
| | | ...rules |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | |
| | | } else if (item.type === 'textarea') { |
| | | fields.push( |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | if (item.help) { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item help={item.help} label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item help={item.help} label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [{ |
| | |
| | | } else { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [{ |
| | |
| | | } else if (item.type === 'select') { // 下拉搜索 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [{ |
| | |
| | | } else if (item.type === 'icon') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [{ |
| | |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [{ |
| | |
| | | } else if (item.type === 'color') { |
| | | fields.push( |
| | | <Col span={12} key={index} className="color-form"> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | } else if (item.type === 'cascader') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [], |
| | | rules: [ |
| | |
| | | } else if (item.type === 'table') { |
| | | fields.push( |
| | | <Col span={24} key={index} className="textarea"> |
| | | <Form.Item label={ |
| | | item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else if (item.type === 'codemirror') { |
| | | fields.push( |
| | | <Col span={24} key={index} className="textarea"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" overlayStyle={{width: 500, maxWidth: 500}} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } |
| | | |
| | | let fields = [] |
| | | if (cards.subtype === 'propcard' && cards.wrap.datatype === 'static') { |
| | | let isStatic = (cards.subtype === 'propcard' || cards.type === 'balcony') && cards.wrap.datatype === 'static' |
| | | if (isStatic) { |
| | | if (cards.wrap.supModule && cards.wrap.supModule.length) { |
| | | let cell = MenuUtils.getComponent(cards.wrap.supModule[cards.wrap.supModule.length - 1]) |
| | | if (cell && cell.columns) { |
| | | fields = cell.columns.map(col => ({ value: col.field })) |
| | | } |
| | | } else { |
| | | fields = cards.columns.map(col => ({ value: col.field })) |
| | | } |
| | | } |
| | | |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', |
| | | type: isStatic ? 'text' : 'select', |
| | | key: 'field', |
| | | label: '字段', |
| | | initVal: card.field || '', |
| | | tooltip: isStatic ? '可绑定上级组件字段,不存在上级组件时可绑定url参数字段。' : '', |
| | | required: true, |
| | | options: fields |
| | | options: fields, |
| | | rules: [{ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig, |
| | | message: '字段名只允许包含数字、字母、汉字以及_-' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'icon', |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', |
| | | type: isStatic ? 'text' : 'select', |
| | | key: 'posterField', |
| | | label: '预览地址', |
| | | initVal: card.posterField || '', |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', |
| | | type: isStatic ? 'text' : 'select', |
| | | key: 'bgImage', |
| | | label: '动态背景', |
| | | initVal: card.bgImage || '', |
| | |
| | | key: 'linkmenu', |
| | | label: '关联菜单', |
| | | initVal: card.linkmenu || '', |
| | | tooltip: '行信息(字段集中前40个长度不超过256的字段)将传递至此菜单,可在url变量、表单(关联主表)、静态属性卡、浮动卡中使用。', |
| | | required: true, |
| | | options: appMenus || [], |
| | | forbid: !['pc', 'mob'].includes(appType) |
| | |
| | | key: 'linkmenu', |
| | | label: '关联菜单', |
| | | initVal: card.linkmenu || [], |
| | | tooltip: '行信息将传递至此菜单,可在url变量、表单(关联主表)、静态属性卡、浮动卡中使用。', |
| | | required: true, |
| | | options: menulist, |
| | | forbid: ['pc', 'mob'].includes(appType) |
| | | }, |
| | | { |
| | | type: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', |
| | | defType: cards.subtype === 'propcard' && cards.wrap.datatype === 'static' ? 'text' : 'select', |
| | | type: isStatic ? 'text' : 'select', |
| | | defType: isStatic ? 'text' : 'select', |
| | | key: 'linkurl', |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | | tooltip: ['pc', 'mob'].includes(appType) ? '当链接类型为“其他”,且链接地址以@menuid@开头时,其后内容将被视为菜单ID。' : '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。' + (['pc', 'mob'].includes(appType) ? '当链接类型为“其他”,且链接地址以@menuid@开头时,其后内容将被视为菜单ID。' : ''), |
| | | toolWidth: 350, |
| | | required: true, |
| | | options: fields |
| | | }, |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: '拼接参数', |
| | | initVal: card.joint || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | key: 'formula', |
| | | label: '公式', |
| | | initVal: card.formula || '', |
| | | tooltip: '执行时会使用查询到的数据替换相应的字段,展示获得的结果,在不使用解析时换行符或空格会替换为页面元素。可使用JS的一些语法,如:三元表达式 @field1@ > @field2@ ? 0 : 1;Math对象,取绝对值 Math.abs(@field@)、四舍五入 Math.round(@field@)等。注:会替换公式中的@username@、@fullName@、@bid@。', |
| | | toolWidth: 450, |
| | | placeholder: '例如:@price@ * @number@', |
| | | required: true |
| | | }, |
| | |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'linkurl', values: ['link']}, |
| | | {field: 'open', values: ['menu', 'link', 'menus']}, |
| | | {field: 'joint', values: ['menu', 'link', 'menus', 'miniprogram']}, |
| | | {field: 'joint', values: ['miniprogram']}, |
| | | {field: 'linkbtn', values: ['button']}, |
| | | {field: 'clickType', values: ['button']}, |
| | | {field: 'menuType', values: ['menus']}, |
| | |
| | | field: 'menu', |
| | | label: '关联菜单', |
| | | initval: setting.menu || (appType ? '' : []), |
| | | tooltip: `行信息${appType ? '(字段集中前40个长度不超过256的字段)' : ''}将传递至此菜单,可在url变量、表单(关联主表)、静态属性卡、浮动卡中使用。`, |
| | | required: true, |
| | | extendName: 'MenuNo', |
| | | options: menulist, |
| | |
| | | field: 'linkurl', |
| | | label: '链接', |
| | | initval: setting.linkurl || '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。', |
| | | toolWidth: 350, |
| | | required: true, |
| | | options: [], |
| | | span: 24 |
| | |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'linkurl', values: ['link']}, |
| | | {field: 'open', values: ['menu', 'link']}, |
| | | {field: 'joint', values: ['menu', 'link']}, |
| | | {field: 'linkbtn', values: ['button']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'joint', |
| | | label: '参数拼接', |
| | | initval: setting.joint || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | field: 'menu', |
| | | label: '关联菜单', |
| | | initval: setting.menu || (appType ? '' : []), |
| | | tooltip: `行信息${appType ? '(字段集中前40个长度不超过256的字段)' : ''}将传递至此菜单,可在url变量、表单(关联主表)、静态属性卡、浮动卡中使用。`, |
| | | required: true, |
| | | extendName: 'MenuNo', |
| | | options: appType ? appmenulist : menulist, |
| | |
| | | field: 'linkurl', |
| | | label: '链接', |
| | | initval: setting.linkurl || '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。', |
| | | toolWidth: 350, |
| | | required: true, |
| | | options: [], |
| | | span: 24 |
| | |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'linkurl', values: ['link']}, |
| | | {field: 'open', values: ['menu', 'link']}, |
| | | {field: 'joint', values: ['menu', 'link', 'miniprogram']}, |
| | | {field: 'joint', values: ['miniprogram']}, |
| | | {field: 'miniAppId', values: ['miniprogram']}, |
| | | {field: 'miniPath', values: ['miniprogram']}, |
| | | ] |
| | |
| | | field: 'menu', |
| | | label: '关联菜单', |
| | | initval: setting.menu || (appType ? '' : []), |
| | | tooltip: `行信息${appType ? '(字段集中前40个长度不超过256的字段)' : ''}将传递至此菜单,可在url变量、表单(关联主表)、静态属性卡、浮动卡中使用。`, |
| | | required: true, |
| | | extendName: 'MenuNo', |
| | | options: appType ? appmenulist : menulist, |
| | |
| | | field: 'linkurl', |
| | | label: '链接', |
| | | initval: setting.linkurl || '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。', |
| | | toolWidth: 350, |
| | | required: true, |
| | | options: [], |
| | | span: 24 |
| | |
| | | ], |
| | | controlFields: [ |
| | | {field: 'jumpField', values: ['menu', 'link']}, |
| | | {field: 'joint', values: ['menu', 'link']}, |
| | | {field: 'open', values: ['menu', 'link']}, |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'link', values: ['link']}, |
| | |
| | | tooltip: '跳转链接为查询数据的返回值。', |
| | | required: true, |
| | | options: columns, |
| | | forbid: subtype !== 'propcard' || appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'joint', |
| | | label: '参数拼接', |
| | | initval: wrap.joint || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | forbid: subtype !== 'propcard' || appType !== 'mob' |
| | | }, |
| | | { |
| | |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'linkurl', values: ['link']}, |
| | | {field: 'open', values: ['menu', 'link']}, |
| | | {field: 'joint', values: ['menu', 'link']}, |
| | | {field: 'linkbtn', values: ['button']}, |
| | | {field: 'clickType', values: ['button', 'unfold']}, |
| | | ] |
| | |
| | | field: 'menu', |
| | | label: '关联菜单', |
| | | initval: setting.menu || (appType ? '' : []), |
| | | tooltip: `行信息${appType ? '(字段集中前40个长度不超过256的字段)' : ''}将传递至此菜单,可在url变量、表单(关联主表)、静态属性卡、浮动卡中使用。`, |
| | | required: true, |
| | | extendName: 'MenuNo', |
| | | options: menulist, |
| | |
| | | field: 'linkurl', |
| | | label: '链接', |
| | | initval: setting.linkurl || '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。', |
| | | toolWidth: 350, |
| | | required: true, |
| | | options: [], |
| | | span: 24 |
| | |
| | | {value: 'self', label: appType !== 'mob' ? '当前窗口' : '当前页面'}, |
| | | ], |
| | | forbid: appType !== 'pc' && appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'joint', |
| | | label: '参数拼接', |
| | | initval: setting.joint || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | {field: 'menus', values: ['menus']}, |
| | | {field: 'menuType', values: ['menus']}, |
| | | {field: 'open', values: ['menu', 'menus']}, |
| | | {field: 'joint', values: ['menu', 'menus']}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | {value: 'self', label: '当前窗口'}, |
| | | ], |
| | | forbid: appType !== 'pc' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'joint', |
| | | label: '参数拼接', |
| | | initval: card.joint || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'table', |
| | |
| | | controlFields: [ |
| | | {field: 'menu', values: ['menu']}, |
| | | {field: 'open', values: ['menu', 'menus']}, |
| | | {field: 'joint', values: ['menu', 'menus']}, |
| | | {field: 'menuType', values: ['menus']}, |
| | | {field: 'menus', values: ['menus']}, |
| | | ] |
| | |
| | | {value: 'self', label: '当前窗口'}, |
| | | ], |
| | | forbid: appType !== 'pc' || card.chartType !== 'bar', |
| | | hidden: card.click !== 'menu' && card.click !== 'menus' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'joint', |
| | | label: '参数拼接', |
| | | initval: card.joint || 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | forbid: appType === 'mob' || card.chartType !== 'bar', |
| | | hidden: card.click !== 'menu' && card.click !== 'menus' |
| | | }, |
| | | { |
| | |
| | | this.state.formlist.forEach((item, index) => { |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | let label = item.label |
| | | if (item.tooltip) { |
| | | if (item.toolWidth) { |
| | | label = <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.toolWidth}} title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } else { |
| | | label = <Tooltip placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'text') { |
| | | let _rules = [] |
| | | if (item.key === 'innerFunc') { |
| | |
| | | } |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else if (item.type === 'tip') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {item.initVal} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | } else if (item.type === 'select') { // 下拉搜索 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item help={item.help || null} label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item help={item.help || null} label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | } else if (item.type === 'textarea') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <Form.Item label={item.label} className="textarea"> |
| | | <Form.Item label={label} className="textarea"> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | } else if (item.type === 'cascader') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [], |
| | | rules: [ |
| | |
| | | initVal: card.innerFunc || '', |
| | | tooltip: functip, |
| | | fields: usefulFields, |
| | | tooltipClass: 'middle', |
| | | toolWidth: 350, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | |
| | | reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | |
| | | if (this.record.pageTemplate === 'custom') { |
| | | shows.push('url', 'proUrl', 'joint', 'open') |
| | | shows.push('url', 'proUrl', 'open') |
| | | } else if (this.record.pageTemplate === 'linkpage') { |
| | | shows.push('linkmenu', 'open') |
| | | |
| | | if (Ot === 'requiredSgl') { |
| | | shows.push('joint') |
| | | } |
| | | |
| | | reRequired.linkmenu = true |
| | | reTooltip.linkmenu = '' |
| | |
| | | } |
| | | reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | } else if (_funcType === 'refund') { |
| | | shows.push('Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu') |
| | | shows.push('Ot', 'execSuccess', 'execError', 'syncComponent', 'openmenu', 'tipTitle') |
| | | reOptions.Ot = requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | } else if (_funcType === 'shareLink') { |
| | | shows.push('shortUrl', 'shareUrl', 'shareProUrl', 'shareTip') |
| | |
| | | key: 'url', |
| | | label: '页面地址', |
| | | initVal: card.url || '', |
| | | tooltip: appType === '' ? '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。' : '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。' + (appType === '' ? '地址格式为:******/admin/index.html#/iframe/menuId/@loginuid@ 会打开标签页。' : ''), |
| | | toolWidth: 350, |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | key: 'proUrl', |
| | | label: '正式地址', |
| | | initVal: card.proUrl || '', |
| | | tooltip: appType === '' ? '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。' : '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。' + (appType === '' ? '地址格式为:******/admin/index.html#/iframe/menuId/@loginuid@ 会打开标签页。' : ''), |
| | | toolWidth: 350, |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | }, { |
| | | value: 'system', |
| | | text: '系统' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: '拼接参数', |
| | | initVal: card.joint || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | key: 'url', |
| | | label: '页面地址', |
| | | initVal: card.url || '', |
| | | tooltip: '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。地址格式为:******/admin/index.html#/iframe/menuId/@loginuid@ 会打开标签页。', |
| | | toolWidth: 350, |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | key: 'proUrl', |
| | | label: '正式地址', |
| | | initVal: card.proUrl || '', |
| | | tooltip: '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。地址格式为:******/admin/index.html#/iframe/menuId/@loginuid@ 会打开标签页。', |
| | | toolWidth: 350, |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | initVal: card.class, |
| | | required: false, |
| | | options: btnClasses |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: '拼接参数', |
| | | initVal: card.joint || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | key: 'nameField', |
| | | label: '名称字段', |
| | | initVal: card.nameField || '', |
| | | tooltip: '名称字段为链接在界面中显示的内容,在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。', |
| | | toolWidth: 350, |
| | | required: false, |
| | | rules: [{ |
| | | max: 100, |
| | |
| | | label: '列宽', |
| | | initVal: card.Width || 120, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: '拼接参数', |
| | | initVal: card.joint || 'true', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | key: 'linkurl', |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。', |
| | | toolWidth: 350, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'linkfields', |
| | | label: '关联字段', |
| | | initVal: card.linkfields || [], |
| | | required: false, |
| | | options: fields, |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | |
| | | const columnTypeOptions = { |
| | | text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'fieldlength', 'blacklist', 'perspective', 'rowspan'], |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], |
| | | link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist', 'nameField'], |
| | | link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'nameField'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'prefix', 'postfix', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'fieldlength', 'blacklist', 'scale', 'lenWidRadio', 'backgroundSize', 'span', 'lostTip'], |
| | | video: ['label', 'field', 'type', 'Align', 'Hide', 'startTime', 'Width', 'fieldlength', 'blacklist', 'aspectRatio'], |
| | |
| | | if (this.record.perspective === 'linkmenu') { |
| | | _options.push('linkmenu', 'open') |
| | | } else if (this.record.perspective === 'linkurl') { |
| | | _options.push('linkurl', 'linkfields', 'open') |
| | | _options.push('linkurl', 'open') |
| | | } |
| | | } else if (this.record.type === 'formula' && this.record.eval === 'true') { |
| | | _options.push('decimal') |
| | |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | let label = item.label |
| | | if (item.tooltip) { |
| | | if (item.toolWidth) { |
| | | label = <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.toolWidth}} title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } else { |
| | | label = <Tooltip placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'text') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | } else if (item.type === 'select') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | } else if (item.type === 'checkbox') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal |
| | | })( |
| | |
| | | } else if (item.type === 'multiselect') { // 多选 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [] |
| | | })( |
| | |
| | | } else if (item.type === 'cascader') { // 多选 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [], |
| | | rules: [ |
| | |
| | | if (item.key === 'formula') { |
| | | fields.push( |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else { |
| | | fields.push( |
| | | <Col span={24} key={index} className="textarea"> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | let content = null |
| | | let extra = null |
| | | let initVal = item.initVal || '' |
| | | let label = item.label |
| | | if (item.tooltip) { |
| | | if (item.toolWidth) { |
| | | label = <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.toolWidth}} title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } else { |
| | | label = <Tooltip placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'text') { |
| | | rules = [ |
| | |
| | | if (item.key === 'formula') { |
| | | fields.push( |
| | | <Col span={span} key={index}> |
| | | <Form.Item className={className} extra={extra} label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item className={className} extra={extra} label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: initVal, |
| | | rules: rules |
| | |
| | | |
| | | fields.push( |
| | | <Col span={span} key={index}> |
| | | <Form.Item className={className} extra={extra} label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item className={className} extra={extra} label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: initVal, |
| | | rules: rules |
| | |
| | | key: 'nameField', |
| | | label: '名称字段', |
| | | initVal: card.nameField || '', |
| | | tooltip: '名称字段为链接在界面中显示的内容,在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。', |
| | | toolWidth: 350, |
| | | required: false, |
| | | options: [{uuid: 'empty', field: '', label: '空'}, ...fields] |
| | | }, |
| | |
| | | label: '列宽', |
| | | initVal: card.Width || 120, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: '拼接参数', |
| | | initVal: card.joint || 'true', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | key: 'linkurl', |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | | tooltip: '在链接中以@***@形式拼接的字段(字段来源于字段集中,此外 id、appkey、userid、LoginUID 为系统字段),跳转时将替换为对应值,例如:http://sso.mk9h.cn/doc/index.html?appkey=@appkey@&LoginUID=@LoginUID@,其中appkey与LoginUID将被替换。', |
| | | toolWidth: 350, |
| | | required: true, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'linkfields', |
| | | label: '关联字段', |
| | | initVal: card.linkfields || [], |
| | | required: false, |
| | | options: fields, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | |
| | | const columnTypeOptions = { |
| | | text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'blacklist', 'perspective', 'rowspan'], |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], |
| | | link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'], |
| | | link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'nameField'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'], |
| | | picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'backgroundSize', 'span', 'lostTip'], |
| | | video: ['label', 'field', 'type', 'Align', 'Hide', 'startTime', 'Width', 'blacklist', 'aspectRatio'], |
| | |
| | | if (this.record.perspective === 'linkmenu') { |
| | | _options.push('linkmenu', 'open') |
| | | } else if (this.record.perspective === 'linkurl') { |
| | | _options.push('linkurl', 'linkfields', 'open') |
| | | _options.push('linkurl', 'open') |
| | | } |
| | | } else if (this.record.type === 'formula' && this.record.eval === 'true') { |
| | | _options.push('decimal') |
| | |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | let label = item.label |
| | | if (item.tooltip) { |
| | | if (item.toolWidth) { |
| | | label = <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.toolWidth}} title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } else { |
| | | label = <Tooltip placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'text') { |
| | | let rules = item.rules || [] |
| | | if (item.key !== 'linkurl') { |
| | |
| | | } |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | } else if (item.type === 'select') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | |
| | | } else if (item.type === 'checkbox') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal |
| | | })( |
| | |
| | | } else if (item.type === 'multiselect') { // 多选 |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [] |
| | | })( |
| | |
| | | } else if (item.type === 'cascader') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [], |
| | | rules: [ |
| | |
| | | if (item.key === 'formula') { |
| | | fields.push( |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | } else { |
| | | fields.push( |
| | | <Col span={24} key={index} className="textarea"> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | <Form.Item label={label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | |
| | | ` |
| | | } |
| | | } |
| | | |
| | | if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | _sql = _sql.replace(/@start_type@/ig, `'开始'`) |
| | | _sql = _sql.replace(/@check_type@/ig, `'审核'`) |
| | |
| | | _sql = _sql.replace(/@statusname@/ig, `'${statusName}'`) |
| | | _sql = _sql.replace(/@work_group@/ig, `'mk'`) |
| | | _sql = _sql.replace(/@work_grade@/ig, `'0'`) |
| | | } |
| | | |
| | | if (_backCustomScript) { |
| | | } else if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { MenuID, MenuName } = this.props |
| | | const { MenuID, MenuName, param } = this.props |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | // 权限过滤 |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | let skip = window.GLOB.mkHS |
| | | let param = this.props.param || {} // url参数 |
| | | let urlparam = {} // url参数 |
| | | if (param) { |
| | | Object.keys(param).forEach(key => { |
| | | if (/^\$/.test(key)) { |
| | | urlparam[key] = param[key] |
| | | } else { |
| | | urlparam[key.toLowerCase()] = param[key] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | window.GLOB.CacheData.set(MenuID, param) |
| | | window.GLOB.CacheData.set(MenuID, urlparam) |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | |
| | | } |
| | | if (config.urlFields) { |
| | | config.urlFields.forEach(field => { |
| | | let val = `'${param[field] || ''}'` |
| | | let val = `'${urlparam[field.toLowerCase()] || ''}'` |
| | | regs.push({ |
| | | reg: new RegExp('@' + field + '@', 'ig'), |
| | | value: val |
| | |
| | | regs.push({ reg: /@works_flow_code@/ig, value: `'${config.flow_code}'` }) |
| | | } |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName, config.process === 'true') |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, urlparam, MenuID, config.MenuName, config.process === 'true') |
| | | |
| | | let autoMatic = null |
| | | if (config.autoMatic && config.autoMatic.enable === 'true') { |
| | |
| | | } |
| | | }) |
| | | |
| | | let BID = param.$BID || '' |
| | | let BID = urlparam.$BID || '' |
| | | |
| | | config.components = this.formatSetting(config.components, regs) |
| | | |
| | |
| | | _data = window.GLOB.CacheData.get(_config.wrap.publicId) |
| | | _data = fromJS(_data).toJS() |
| | | } |
| | | } else { |
| | | _config.elements.forEach(item => { |
| | | if (item.eleType === 'button') return |
| | | if (item.datatype === 'dynamic' && item.field) { |
| | | item.field = item.field.toLowerCase() |
| | | } |
| | | }) |
| | | } |
| | | |
| | | _data.$$BID = BID || '' |
| | | _data.$$BData = BData || '' |
| | | if (_config.setting.primaryKey) { |
| | | _data.$$uuid = _data[_config.setting.primaryKey] || '' |
| | | } |
| | | |
| | | if (_config.wrap.datatype === 'static' && BData) { |
| | | Object.keys(BData).forEach(key => { |
| | | if (/\$/.test(key)) return |
| | | _data[key.toLowerCase()] = BData[key] |
| | | }) |
| | | } |
| | | |
| | | if (!_config.style.position) { |
| | |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | let _data = {$$BID: BID || '', $$BData: BData, $$empty: true, $$time: new Date().getTime()} |
| | | if (BData) { |
| | | Object.keys(BData).forEach(key => { |
| | | if (/\$/.test(key)) return |
| | | _data[key.toLowerCase()] = BData[key] |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | data: {$$BID: BID || '', $$BData: BData, $$empty: true, $$time: new Date().getTime()}, |
| | | data: _data |
| | | }) |
| | | return |
| | | } else if (config.setting.supModule && !BID) { // BID 不存在时,不做查询 |
| | |
| | | MenuID: menu.MenuID, |
| | | MenuName: menu.MenuName, |
| | | type: menu.tabType, |
| | | param: {} |
| | | param: {$BID: data.$$uuid || ''} |
| | | } |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | newtab.param.$BID = data.$$uuid || '' |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (key === 'children') return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (key === 'children') return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } else if (card.setting.click === 'menu') { |
| | |
| | | |
| | | if (!menu) return |
| | | |
| | | menu.param = {} |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | menu.param.$BID = data.$$uuid || '' |
| | | menu.param = {$BID: data.$$uuid || ''} |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (key === 'children') return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (key === 'children') return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } else if (card.setting.click === 'link') { |
| | |
| | | } |
| | | |
| | | src = src + `${con}id=${data.$$uuid || ''}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } else if (/@/.test(src)) { |
| | | src = src.replace(/@id@/ig, data.$$uuid || '') |
| | | src = src.replace(/@appkey@/ig, window.GLOB.appkey) |
| | | src = src.replace(/@userid@/ig, sessionStorage.getItem('UserID')) |
| | | src = src.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | src = src.replace(reg, data[key]) |
| | | }) |
| | | } |
| | | |
| | | window.open(src) |
| | |
| | | if (data.$$type === 'extendCard') { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, data.$$selectedData || []) |
| | | } else if (cards.subtype === 'datacard') { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn') |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn', (data.$$uuid || '') + (data.$Index || '')) |
| | | } else { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, data.$$empty ? [] : [data]) |
| | | } |
| | |
| | | if (data.$$type === 'extendCard') { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, data.$$selectedData || []) |
| | | } else if (cards.subtype === 'datacard') { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn') |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn', (data.$$uuid || '') + (data.$Index || '')) |
| | | } else { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, data.$$empty ? [] : [data]) |
| | | } |
| | |
| | | if (card.linkType === 'linkmenu') { |
| | | if (card.linkThdMenu) { |
| | | let __param = { |
| | | $BID: data.$$uuid |
| | | $BID: data.$$uuid || '' |
| | | } |
| | | |
| | | if (card.field) { |
| | |
| | | __param.$searchval = data[card.field] || '' |
| | | } |
| | | |
| | | if (card.joint === 'true' && card.linkThdMenu.urlFields) { |
| | | let lower = {} |
| | | Object.keys(data).forEach(key => { |
| | | lower[key.toLowerCase()] = data[key] |
| | | }) |
| | | |
| | | card.linkThdMenu.urlFields.split(',').forEach(field => { |
| | | __param[field] = lower[field.toLowerCase()] || '' |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (key === 'children') return |
| | | __param[key] = data[key] |
| | | }) |
| | | |
| | | let tabmenu = card.linkThdMenu |
| | | |
| | |
| | | d.click() |
| | | d.remove() |
| | | } else { |
| | | let Id = data.$$uuid || '' |
| | | |
| | | if (cards.subtype === 'propcard' && cardCell) { |
| | | Id = cardCell.setting.primaryId || '' |
| | | } |
| | | |
| | | if (card.joint === 'true') { |
| | | let Id = '' |
| | | |
| | | if (cards.subtype === 'propcard' && cardCell) { |
| | | Id = cardCell.setting.primaryId || '' |
| | | } else { |
| | | Id = data[cards.setting.primaryKey] || '' |
| | | } |
| | | |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(url)) { |
| | |
| | | } |
| | | |
| | | url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } else if (/@/.test(url)) { |
| | | url = url.replace(/@id@/ig, Id) |
| | | url = url.replace(/@appkey@/ig, window.GLOB.appkey) |
| | | url = url.replace(/@userid@/ig, sessionStorage.getItem('UserID')) |
| | | url = url.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | url = url.replace(reg, data[key]) |
| | | }) |
| | | } |
| | | |
| | | window.open(url) |
| | |
| | | } |
| | | |
| | | let MkButton = null |
| | | let lid = (data.$$uuid || '') + (data.$Index || '') |
| | | |
| | | if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { |
| | | MkButton = <NormalButton |
| | | btn={card} |
| | | name={name} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | |
| | | MkButton = <ExcelInButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | |
| | | MkButton = <ExcelOutButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | |
| | | btn={card} |
| | | name={name} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | |
| | | btn={card} |
| | | name={name} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | selectedData={_data} |
| | |
| | | btn={card} |
| | | name={name} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | selectedData={_data} |
| | |
| | | MkButton = <ChangeUserButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | |
| | | MkButton = <PrintButton |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | |
| | | MkButton = <FuncMegvii |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | | selectedData={_data} |
| | |
| | | MkButton = <FuncZip |
| | | btn={card} |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | | setting={cards.setting} |
| | |
| | | } else if (card.funcType === 'expPdf') { |
| | | MkButton = <ExportPdf |
| | | btn={card} |
| | | LID={lid} |
| | | /> |
| | | } else if (card.funcType === 'shareLink') { |
| | | MkButton = <ShareLink |
| | | BID={data.$$BID} |
| | | LID={lid} |
| | | btn={card} |
| | | selectedData={_data} |
| | | /> |
| | |
| | | |
| | | if (!menu) return |
| | | |
| | | menu.param = {} |
| | | menu.param = {$BID: item.$$uuid || ''} |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | menu.param.$BID = item.$$uuid || '' |
| | | |
| | | Object.keys(item).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (key === 'children') return |
| | | menu.param[key] = item[key] |
| | | }) |
| | | } |
| | | Object.keys(item).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (key === 'children') return |
| | | menu.param[key] = item[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } |
| | |
| | | this.loaded = true |
| | | } else if (_config.wrap.datatype === 'static') { |
| | | this.loaded = true |
| | | _config.subcards.forEach(card => { |
| | | card.elements.forEach(ele => { |
| | | if (ele.eleType === 'button') return |
| | | if (ele.datatype === 'dynamic' && ele.field) { |
| | | ele.field = ele.field.toLowerCase() |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | _data.$$BID = BID || '' |
| | |
| | | if (_config.wrap.datatype === 'static' && BData) { |
| | | Object.keys(BData).forEach(key => { |
| | | if (/\$/.test(key)) return |
| | | _data[key] = BData[key] |
| | | _data[key.toLowerCase()] = BData[key] |
| | | }) |
| | | } |
| | | |
| | |
| | | if (BData) { |
| | | Object.keys(BData).forEach(key => { |
| | | if (/\$/.test(key)) return |
| | | _data[key] = BData[key] |
| | | _data[key.toLowerCase()] = BData[key] |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | if (!menu) return |
| | | |
| | | menu.param = {} |
| | | menu.param = {$BID: data.$$uuid || ''} |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | menu.param.$BID = data.$$uuid || '' |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } else if (card.setting.click === 'link') { |
| | |
| | | } |
| | | |
| | | src = src + `${con}id=${data.$$uuid || ''}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } else if (/@/.test(src)) { |
| | | src = src.replace(/@id@/ig, data.$$uuid || '') |
| | | src = src.replace(/@appkey@/ig, window.GLOB.appkey) |
| | | src = src.replace(/@userid@/ig, sessionStorage.getItem('UserID')) |
| | | src = src.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | src = src.replace(reg, data[key]) |
| | | }) |
| | | } |
| | | |
| | | window.open(src) |
| | | } else if (card.setting.click === 'button' && card.setting.linkbtn) { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn') |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn', (data.$$uuid || '') + (data.$Index || '')) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (!menu) return |
| | | |
| | | menu.param = {} |
| | | menu.param = {$BID: data.$$uuid || ''} |
| | | |
| | | if (card.setting.joint === 'true') { |
| | | menu.param.$BID = data.$$uuid || '' |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } else if (card.setting.click === 'link') { |
| | |
| | | } |
| | | |
| | | src = src + `${con}id=${data.$$uuid || ''}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } else if (/@/.test(src)) { |
| | | src = src.replace(/@id@/ig, data.$$uuid || '') |
| | | src = src.replace(/@appkey@/ig, window.GLOB.appkey) |
| | | src = src.replace(/@userid@/ig, sessionStorage.getItem('UserID')) |
| | | src = src.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | src = src.replace(reg, data[key]) |
| | | }) |
| | | } |
| | | |
| | | window.open(src) |
| | | } else if (card.setting.click === 'button' && card.setting.linkbtn) { |
| | | if (cards.subtype === 'datacard') { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn') |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, [data], 'linkbtn', (data.$$uuid || '') + (data.$Index || '')) |
| | | } else { |
| | | MKEmitter.emit('triggerBtnId', card.setting.linkbtn, data.$$empty ? [] : [data]) |
| | | } |
| | |
| | | |
| | | window.GLOB.SyncData.delete(_config.dataName) |
| | | } |
| | | } else { |
| | | _config.subcards.forEach(card => { |
| | | card.elements.forEach(ele => { |
| | | if (ele.eleType === 'button') return |
| | | if (ele.datatype === 'dynamic' && ele.field) { |
| | | ele.field = ele.field.toLowerCase() |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | _data.$$uuid = _data[_config.setting.primaryKey] || '' |
| | | _data.$$BID = BID || '' |
| | | _data.$$BData = BData || '' |
| | | |
| | | if (_config.wrap.datatype === 'static' && BData) { |
| | | Object.keys(BData).forEach(key => { |
| | | if (/\$/.test(key)) return |
| | | _data[key.toLowerCase()] = BData[key] |
| | | }) |
| | | } |
| | | |
| | | if (!_config.wrap.height) { // 兼容 |
| | | _config.wrap.height = _config.style.height || '300px' |
| | |
| | | const { config, BID, BData } = this.state |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | let _data = {$$BID: BID || '', $$BData: BData, $$empty: true} |
| | | if (BData) { |
| | | Object.keys(BData).forEach(key => { |
| | | if (/\$/.test(key)) return |
| | | _data[key.toLowerCase()] = BData[key] |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | data: {$$BID: BID || '', $$BData: BData, $$empty: true} |
| | | data: _data |
| | | }) |
| | | return |
| | | } else if (config.setting.supModule && !BID) { // BID 不存在时,不做查询 |
| | |
| | | MenuName: menu.MenuName, |
| | | MenuNo: menu.MenuNo || '', |
| | | type: menu.tabType, |
| | | param: {} |
| | | param: {$BID: data.$$uuid || ''} |
| | | } |
| | | |
| | | if (plot.joint === 'true') { |
| | | newtab.param.$BID = data.$$uuid || '' |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } else if (plot.click === 'menu') { |
| | |
| | | |
| | | if (!menu) return |
| | | |
| | | menu.param = {} |
| | | menu.param = {$BID: data.$$uuid || ''} |
| | | |
| | | if (plot.joint === 'true') { |
| | | menu.param.$BID = data.$$uuid || '' |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | delCell = () => { |
| | | const { node } = this.state |
| | | |
| | | let cell = this.mkGraph.getCellById(node.id) |
| | | |
| | | this.mkGraph.removeCells([cell]) |
| | | |
| | | this.setState({node: null}) |
| | | } |
| | | |
| | | changeProps = (value, key) => { |
| | | const { node } = this.state |
| | | |
| | |
| | | <div id={config.uuid + 'container'} className="mk-container"></div> |
| | | <div className="mk-node-edit"> |
| | | <div className="header">设置</div> |
| | | {!node ? <div className="empty">未选中</div> : <NodeUpdate node={node} orgs={orgs} onChange={this.changeProps}/>} |
| | | {!node ? <div className="empty">未选中</div> : <NodeUpdate node={node} orgs={orgs} onChange={this.changeProps} onDel={this.delCell}/>} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Radio, InputNumber, Modal } from 'antd' |
| | | import { FormOutlined } from '@ant-design/icons' |
| | | import { FormOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | |
| | | import ColorSketch from '@/tabviews/zshare/mutilform/mkColor' |
| | | import NodeForm from './nodeform' |
| | |
| | | } else if (item.type === 'other') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <span className="split-line">{item.label}:<FormOutlined onClick={() => {this.setState({visible: true})}}/></span> |
| | | <span className="split-line">{item.label}:<FormOutlined onClick={() => {this.setState({visible: true})}}/><DeleteOutlined onClick={() => this.props.onDel()}/></span> |
| | | {mkdata ? <div className="mk-data"> |
| | | <div>状态:{mkdata.status}<span style={{float: 'right'}}>{mkdata.statusName}</span></div> |
| | | {mknode.shape !== 'edge' && !mknode.mknode ? <div>标记:{mkdata.sign || ''}</div> : null} |
| | |
| | | margin: 5px 12px 10px; |
| | | padding-bottom: 2px; |
| | | font-size: 13px; |
| | | |
| | | >.anticon-delete { |
| | | padding: 0 5px; |
| | | float: right; |
| | | color: #f5222d; |
| | | line-height: 22px; |
| | | } |
| | | >.anticon-form { |
| | | padding: 0 5px; |
| | | } |
| | | } |
| | | .mk-data { |
| | | font-size: 13px; |
| | |
| | | } |
| | | .member-input { |
| | | display: inline-block; |
| | | cursor: pointer; |
| | | width: 100%; |
| | | height: 32px; |
| | | padding: 4px 11px; |
| | |
| | | |
| | | return ( |
| | | <> |
| | | <div className="member-input">{value.length > 0 ? value.length + '人' : ''}<FormOutlined onClick={this.trigger} /></div> |
| | | <div className="member-input" onClick={this.trigger}>{value.length > 0 ? value.length + '人' : ''}<FormOutlined /></div> |
| | | <Modal |
| | | wrapClassName="member-modal" |
| | | title="选择人员" |
| | |
| | | MenuName: menu.MenuName, |
| | | MenuNo: menu.MenuNo || '', |
| | | type: menu.tabType, |
| | | param: {} |
| | | param: {$BID: data.$$uuid || ''} |
| | | } |
| | | |
| | | if (plot.joint === 'true') { |
| | | newtab.param.$BID = data.$$uuid || '' |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | newtab.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', newtab, true) |
| | | } else if (plot.click === 'menu') { |
| | |
| | | |
| | | if (!menu) return |
| | | |
| | | menu.param = {} |
| | | menu.param = {$BID: data.$$uuid || ''} |
| | | |
| | | if (plot.joint === 'true') { |
| | | menu.param.$BID = data.$$uuid || '' |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | menu.param[key] = data[key] |
| | | }) |
| | | |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | | } else { |
| | |
| | | __param.$searchkey = item.field.toLowerCase() |
| | | __param.$searchval = record[item.field] || '' |
| | | } |
| | | |
| | | if (item.linkThdMenu.urlFields) { |
| | | let lower = {} |
| | | Object.keys(record).forEach(key => { |
| | | lower[key.toLowerCase()] = record[key] |
| | | }) |
| | | |
| | | item.linkThdMenu.urlFields.split(',').forEach(field => { |
| | | __param[field] = lower[field.toLowerCase()] || '' |
| | | }) |
| | | } else if (item.linkfields && item.linkfields.length > 0) { |
| | | item.linkfields.forEach(field => { |
| | | __param[field] = record[field] || '' |
| | | }) |
| | | } |
| | | Object.keys(record).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | __param[key] = record[key] |
| | | }) |
| | | |
| | | let tabmenu = item.linkThdMenu |
| | | |
| | |
| | | } else if (item.linkurl) { |
| | | let src = item.linkurl |
| | | |
| | | let con = '?' |
| | | if (/@/.test(src)) { |
| | | src = src.replace(/@id@/ig, record.$$uuid) |
| | | src = src.replace(/@appkey@/ig, window.GLOB.appkey) |
| | | src = src.replace(/@userid@/ig, sessionStorage.getItem('UserID')) |
| | | src = src.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | if (/\?/ig.test(src)) { |
| | | con = '&' |
| | | } |
| | | |
| | | if (item.linkfields && item.linkfields.length > 0) { |
| | | item.linkfields.forEach(field => { |
| | | if (field.toLowerCase() === 'id') return |
| | | con += `${field}=${record[field] || ''}&` |
| | | Object.keys(record).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | src = src.replace(reg, record[key]) |
| | | }) |
| | | } |
| | | |
| | | src = src + `${con}id=${record.$$uuid}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | |
| | | window.open(src) |
| | | } |
| | |
| | | } else { |
| | | _href += '?' + _param |
| | | } |
| | | } else if (/@/.test(_href)) { |
| | | _href = _href.replace(/@id@/ig, record.$$uuid || '') |
| | | _href = _href.replace(/@appkey@/ig, window.GLOB.appkey) |
| | | _href = _href.replace(/@userid@/ig, sessionStorage.getItem('UserID')) |
| | | _href = _href.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | Object.keys(record).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | _href = _href.replace(reg, record[key]) |
| | | }) |
| | | } |
| | | |
| | | if (col.blur) { |
| | |
| | | if (!setting.doubleClick) return |
| | | if (record.$disabled) return |
| | | |
| | | MKEmitter.emit('triggerBtnId', setting.doubleClick, [record], 'linkbtn') |
| | | MKEmitter.emit('triggerBtnId', setting.doubleClick, [record], 'linkbtn', (record.$$uuid || '') + (record.$Index || '')) |
| | | } |
| | | |
| | | render() { |
| | |
| | | |
| | | if (col.supField) { |
| | | names = [] |
| | | if (BData && BData[col.supField]) { |
| | | names = BData[col.supField].split(',') |
| | | let val = '' |
| | | if (BData) { |
| | | let field = col.supField.toLowerCase() |
| | | Object.keys(BData).forEach(key => { |
| | | if (key.toLowerCase() === field) { |
| | | val = BData[key] + '' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (val) { |
| | | names = val.split(',') |
| | | |
| | | if (names.length > fields.length) { |
| | | names.length = fields.length |
| | |
| | | |
| | | if (col.supField) { |
| | | names = [] |
| | | if (BData && BData[col.supField]) { |
| | | names = BData[col.supField].split(',') |
| | | let val = '' |
| | | if (BData) { |
| | | let field = col.supField.toLowerCase() |
| | | Object.keys(BData).forEach(key => { |
| | | if (key.toLowerCase() === field) { |
| | | val = BData[key] + '' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (val) { |
| | | names = val.split(',') |
| | | |
| | | if (names.length > fields.length) { |
| | | names.length = fields.length |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { MenuID, MenuName } = this.props |
| | | const { MenuID, MenuName, param } = this.props |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | let balMap = new Map() |
| | | let skip = config.permission === 'false' || window.GLOB.mkHS |
| | | let param = this.props.param || {} // url参数 |
| | | let urlparam = {} // url参数 |
| | | if (param) { |
| | | Object.keys(param).forEach(key => { |
| | | if (/^\$/.test(key)) { |
| | | urlparam[key] = param[key] |
| | | } else { |
| | | urlparam[key.toLowerCase()] = param[key] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | window.GLOB.CacheData.set(MenuID, param) |
| | | window.GLOB.CacheData.set(MenuID, urlparam) |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | |
| | | } |
| | | if (config.urlFields) { |
| | | config.urlFields.forEach(field => { |
| | | let val = `'${param[field] || ''}'` |
| | | let val = `'${urlparam[field.toLowerCase()] || ''}'` |
| | | regs.push({ |
| | | reg: new RegExp('@' + field + '@', 'ig'), |
| | | value: val |
| | |
| | | let initInters = [] |
| | | |
| | | config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters, config.MenuName) |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID, config.process === 'true') |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, urlparam, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID, config.process === 'true') |
| | | |
| | | let params = [] |
| | | let BID = param.$BID || '' |
| | | let BID = urlparam.$BID || '' |
| | | let inherit = {} |
| | | |
| | | if (config.cacheUseful === 'true') { // 缓存继承 |
| | |
| | | |
| | | if (item.setting.supModule === 'preview') { |
| | | item.setting.supModule = '' |
| | | let val = '' |
| | | Object.keys(urlparam).forEach(key => { |
| | | if (key.toLowerCase() === item.setting.controlField) { |
| | | val = urlparam[key] |
| | | } |
| | | }) |
| | | let val = urlparam[item.setting.controlField] || '' |
| | | |
| | | item.subtabs = item.subtabs.filter(tab => { |
| | | if (tab.$pass) return true |
| | |
| | | if (item.setting.selectField) { |
| | | item.setting.selectField = item.setting.selectField.toLowerCase() |
| | | |
| | | let val = '' |
| | | Object.keys(urlparam).forEach(key => { |
| | | if (key.toLowerCase() === item.setting.selectField) { |
| | | val = urlparam[key] |
| | | } |
| | | }) |
| | | let val = urlparam[item.setting.selectField] || '' |
| | | |
| | | let activeKey = '' |
| | | |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { Tab } = this.props |
| | | const { Tab, param } = this.props |
| | | |
| | | let config = Tab.config || '' |
| | | |
| | |
| | | // 权限过滤 |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | let balMap = new Map() |
| | | let param = this.props.param || {} // url参数 |
| | | let urlparam = {} // url参数 |
| | | if (param) { |
| | | Object.keys(param).forEach(key => { |
| | | if (/^\$/.test(key)) { |
| | | urlparam[key] = param[key] |
| | | } else { |
| | | urlparam[key.toLowerCase()] = param[key] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | window.GLOB.CacheData.set(Tab.uuid, param) |
| | | window.GLOB.CacheData.set(Tab.uuid, urlparam) |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | |
| | | regs.push({ reg: /@works_flow_code@/ig, value: `'${flow.flow_code || ''}'` }) |
| | | } |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid) |
| | | config.components = this.filterComponent(config.components, roleId, balMap, urlparam, Tab, Tab.uuid, Tab.uuid) |
| | | |
| | | // 获取主搜索条件 |
| | | config.components.forEach(component => { |
| | |
| | | }) |
| | | |
| | | let params = [] |
| | | let BID = param.$BID || '' |
| | | let BID = urlparam.$BID || '' |
| | | |
| | | config.components = this.formatSetting(config.components, params, regs, balMap) |
| | | |
| | |
| | | |
| | | if (item.setting.supModule === 'preview') { |
| | | item.setting.supModule = '' |
| | | let val = '' |
| | | Object.keys(urlparam).forEach(key => { |
| | | if (key.toLowerCase() === item.setting.controlField) { |
| | | val = urlparam[key] |
| | | } |
| | | }) |
| | | let val = urlparam[item.setting.controlField] || '' |
| | | |
| | | item.subtabs = item.subtabs.filter(tab => { |
| | | if (tab.$pass) return true |
| | |
| | | if (item.setting.selectField) { |
| | | item.setting.selectField = item.setting.selectField.toLowerCase() |
| | | |
| | | let val = '' |
| | | Object.keys(urlparam).forEach(key => { |
| | | if (key.toLowerCase() === item.setting.selectField) { |
| | | val = urlparam[key] |
| | | } |
| | | }) |
| | | let val = urlparam[item.setting.selectField] || '' |
| | | |
| | | let activeKey = '' |
| | | |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { setting, selectedData, btn, MenuID } = this.props |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { setting, selectedData, btn, MenuID, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | if (btn.funcType === 'closetab') { |
| | | MKEmitter.emit('closeTabView', MenuID || btn.$MenuID) |
| | |
| | | if (btn.refreshTab && btn.refreshTab.length > 0) { |
| | | MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], 'table') |
| | | } |
| | | return |
| | | } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { setting, BID, btn, selectedData } = this.props |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { setting, BID, btn, selectedData, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | |
| | | message: '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | | if (btn.Ot === 'requiredSgl' && data.length !== 1) { |
| | | } else if (btn.Ot === 'requiredSgl' && data.length !== 1) { |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (!btn.verify || !btn.verify.sheet || !btn.verify.columns || btn.verify.columns.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'excel导入验证信息未设置!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let primaryId = '' // 导入时行Id |
| | | if (btn.Ot === 'requiredSgl' && setting.primaryKey) { |
| | | primaryId = data[0][setting.primaryKey] || '' |
| | | } |
| | | |
| | | this.setState({ |
| | | selines: data, |
| | | primaryId: primaryId |
| | | }, () => { |
| | | this.refs.excelIn.exceltrigger() |
| | | }) |
| | | |
| | | if (window.GLOB.systemType === 'production') { |
| | | MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '导入Excel'}) |
| | | } else { |
| | | let primaryId = '' // 导入时行Id |
| | | if (btn.Ot === 'requiredSgl' && setting.primaryKey) { |
| | | primaryId = data[0][setting.primaryKey] || '' |
| | | } |
| | | |
| | | this.setState({ |
| | | selines: data, |
| | | primaryId: primaryId |
| | | }, () => { |
| | | this.refs.excelIn.exceltrigger() |
| | | }) |
| | | |
| | | if (window.GLOB.systemType === 'production') { |
| | | MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '导入Excel'}) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { setting, BID, btn } = this.props |
| | | actionTrigger = (triggerId, _, type, lid) => { |
| | | const { setting, BID, btn, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | |
| | | message: '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(this.props.selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | |
| | | if (btn.errorType === 'error1') { |
| | | } else if (btn.errorType === 'error1') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请设置导出列!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.errorType === 'error2') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '按钮需自定义导出数据源!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | MKEmitter.emit('queryModuleParam', btn.$menuId, this.triggerExcelout) |
| | | if (window.GLOB.systemType === 'production') { |
| | | MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '导出Excel'}) |
| | | } else { |
| | | MKEmitter.emit('queryModuleParam', btn.$menuId, this.triggerExcelout) |
| | | if (window.GLOB.systemType === 'production') { |
| | | MKEmitter.emit('queryTrigger', {menuId: btn.uuid, name: '导出Excel'}) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { BID, btn, selectedData, setting } = this.props |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { BID, btn, selectedData, setting, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | let data = record || selectedData || [] |
| | | // let data = fromJS(mockdata.data).toJS() |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | |
| | | message: '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | |
| | | let data = record || selectedData || [] |
| | | // let data = fromJS(mockdata.data).toJS() |
| | | |
| | | if (data.length === 0) { |
| | | } else if (data.length === 0) { |
| | | // 需要选择行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else { |
| | | this.setState({ |
| | | loading: true, |
| | | lines: data |
| | | }) |
| | | this.getIpList() |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true, |
| | | lines: data |
| | | }) |
| | | this.getIpList() |
| | | } |
| | | |
| | | getIpList = () => { |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { BID, btn, selectedData, setting } = this.props |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { BID, btn, selectedData, setting, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | | if (btn.Ot !== 'notRequired' && data.length === 0) { |
| | | } else if (btn.Ot !== 'notRequired' && data.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { btn, selectedData, BID } = this.props |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { btn, selectedData, BID, LID } = this.props |
| | | const { disabled } = this.state |
| | | |
| | | if (disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | |
| | | if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | |
| | | |
| | | if (/#\/iframe\//.test(url)) { |
| | | url = url.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | if (btn.joint === 'true' && Id) { |
| | | url = url + '/' + Id |
| | | } |
| | | url = url + '/' + Id |
| | | |
| | | let menu = { |
| | | MenuID: btn.uuid, |
| | |
| | | return |
| | | } |
| | | |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(url)) { |
| | | con = '&' |
| | | } |
| | | |
| | | if (btn.joint === 'true') { |
| | | let con = '?' |
| | | |
| | | if (/\?/ig.test(url)) { |
| | | con = '&' |
| | | } |
| | | url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}` |
| | | } else if (Id) { |
| | | url = url + `${con}id=${Id}` |
| | | } else if (/@/.test(url)) { |
| | | url = url.replace(/@id@/ig, Id) |
| | | url = url.replace(/@appkey@/ig, window.GLOB.appkey) |
| | | url = url.replace(/@userid@/ig, sessionStorage.getItem('UserID')) |
| | | url = url.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID')) |
| | | |
| | | if (btn.Ot === 'requiredSgl' && data[0]) { |
| | | Object.keys(data[0]).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | url = url.replace(reg, data[0][key]) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | window.open(url) |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type, callback) => { |
| | | const { btn, selectedData } = this.props |
| | | actionTrigger = (triggerId, record, type, lid, callback) => { |
| | | const { btn, selectedData, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if (type === 'preButton') { |
| | |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | if (btn.OpenType === 'form' && btn.formType === 'count_line') return |
| | | |
| | | this.setState({autoMatic: type === 'autoMatic'}) |
| | |
| | | let node = document.getElementById('button' + btnId) |
| | | |
| | | if (node) { |
| | | MKEmitter.emit('triggerBtnId', btnId, null, 'preButton', (res) => { |
| | | MKEmitter.emit('triggerBtnId', btnId, null, 'preButton', null, (res) => { |
| | | if (!res) { |
| | | this.setState({loading: false}) |
| | | resolve() |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { setting, BID, btn, selectedData } = this.props |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { setting, BID, btn, selectedData, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | | if (btn.Ot === 'requiredSgl' && data.length !== 1) { |
| | | } else if (btn.Ot === 'requiredSgl' && data.length !== 1) { |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { BID, btn, selectedData, setting } = this.props |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { BID, btn, selectedData, setting, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | |
| | | message: '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId, record, type) => { |
| | | const { btn, selectedData, BID } = this.props |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { btn, selectedData, BID, LID } = this.props |
| | | const { disabled } = this.state |
| | | |
| | | if (disabled || btn.multiMenus) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | | |
| | | if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) { |
| | | return |
| | | } |
| | | if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return |
| | | |
| | | let data = record || selectedData || [] |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | if (btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') { |
| | | Object.keys(data[0]).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | if (key === 'children') return |
| | | menu.param[key] = data[0][key] |
| | | }) |
| | | } |
| | | |
| | | newtab = menu |
| | | } |
| | | |
| | |
| | | item.supInitVal = '' |
| | | |
| | | if (fieldMap.has(item.linkField)) { |
| | | item.supInitVal = fieldMap.get(item.linkField).initval || '' |
| | | let supitem = fieldMap.get(item.linkField) |
| | | item.supInitVal = supitem.initval || '' |
| | | if (supitem.$first) { |
| | | item.$resetSup = true |
| | | } |
| | | } else if (data.hasOwnProperty(item.linkField.toLowerCase())) { |
| | | item.supInitVal = data[item.linkField.toLowerCase()] |
| | | } |
| | |
| | | |
| | | // if (item.type === 'link') { |
| | | if (item.linkField) { |
| | | item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '') |
| | | let supInitVal = item.supInitVal |
| | | if (item.$resetSup) { |
| | | supInitVal = this.record[item.linkField] |
| | | } |
| | | item.options = item.oriOptions.filter(option => option.ParentID === supInitVal || option.value === '') |
| | | // } else if (['select', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type)) { |
| | | } else { |
| | | item.options = item.oriOptions |
| | |
| | | // 字段透视 |
| | | triggerLink = (e, item, record) => { |
| | | e.stopPropagation() |
| | | |
| | | let __param = { |
| | | $BID: record.$$uuid |
| | | } |
| | | |
| | | if (item.field) { |
| | | __param.$searchkey = item.field.toLowerCase() |
| | | __param.$searchval = record[item.field] || '' |
| | | } |
| | | |
| | | if (item.linkfields && item.linkfields.length > 0) { |
| | | item.linkfields.forEach(field => { |
| | | __param[field] = record[field] || '' |
| | | }) |
| | | } |
| | | |
| | | |
| | | if (item.linkThdMenu) { |
| | | let __param = { |
| | | $BID: record.$$uuid |
| | | } |
| | | |
| | | if (item.field) { |
| | | __param.$searchkey = item.field.toLowerCase() |
| | | __param.$searchval = record[item.field] || '' |
| | | } |
| | | |
| | | Object.keys(record).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | __param[key] = record[key] |
| | | }) |
| | | |
| | | let tabmenu = item.linkThdMenu |
| | | tabmenu.param = __param |
| | | |
| | |
| | | </div> |
| | | ) |
| | | } else if (item.type === 'action') { |
| | | let lid = (record.$$uuid || '') + (record.$Index || '') |
| | | return ( |
| | | <div className="action-col"> |
| | | {item.operations.map(btn => { |
| | |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | BID={record.$$BID} |
| | | LID={lid} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | BID={record.$$BID} |
| | | LID={lid} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BID={record.$$BID} |
| | | LID={lid} |
| | | BData={this.props.BData} |
| | | MenuID={this.props.MenuID} |
| | | /> |
| | |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | BID={record.$$BID} |
| | | LID={lid} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | |
| | | if (!setting.doubleClick) return |
| | | if (record.$disabled) return |
| | | |
| | | MKEmitter.emit('triggerBtnId', setting.doubleClick, [record], 'linkbtn') |
| | | MKEmitter.emit('triggerBtnId', setting.doubleClick, [record], 'linkbtn', (record.$$uuid || '') + (record.$Index || '')) |
| | | } |
| | | |
| | | render() { |
| | |
| | | } |
| | | } |
| | | |
| | | if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | _sql = _sql.replace(/@works_flow_sign@/ig, `'${sign}'`) |
| | | |
| | | _sql = _sql.replace(/@check_userids@/ig, `'${checkIds.join(',')}'`) |
| | |
| | | _sql = _sql.replace(/@statusname@/ig, `'${statusName}'`) |
| | | _sql = _sql.replace(/@work_group@/ig, `'${sessionStorage.getItem('work_group') || ''}'`) |
| | | _sql = _sql.replace(/@work_grade@/ig, `'${work_grade}'`) |
| | | } |
| | | |
| | | if (_backCustomScript) { |
| | | } else if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | |
| | | </Col> |
| | | {menu.Template === 'NewPage' ? <Col span={22}> |
| | | <Form.Item label={ |
| | | <Tooltip overlayStyle={{minWidth: 500}} placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>使用同一单点系统下的其他业务系统,链接格式为:http://<span style={{color: 'orange'}}>******</span>/admin/index.html#/iframe/<span style={{color: 'orange'}}>menuId</span>/<span style={{color: 'orange'}}>loginuid</span>/<span style={{color: 'orange'}}>BID</span>。注:******为域名+虚拟目录;menuId为菜单ID;loginuid为登录信息(使用@loginuid@时自动替换为当前系统的loginuid);BID是向菜单中的传参,可为空。</div>}><QuestionCircleOutlined className="mk-form-tip" />链接地址</Tooltip> |
| | | <Tooltip overlayStyle={{minWidth: 500}} placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>使用同一单点系统下的其他业务系统,链接格式为:http://<span style={{color: 'orange'}}>******</span>/admin/index.html#/iframe/<span style={{color: 'orange'}}>menuId</span>/<span style={{color: 'orange'}}>@loginuid@</span>/<span style={{color: 'orange'}}>BID</span>。注:******为域名+虚拟目录;menuId为菜单ID;@loginuid@为登录信息(系统自动替换);BID是向菜单中的传参,可为空。</div>}><QuestionCircleOutlined className="mk-form-tip" />链接地址</Tooltip> |
| | | }> |
| | | {getFieldDecorator('url', { |
| | | initialValue: menu.url || '', |