| | |
| | | let param = { |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: arr_field |
| | | arr_field: arr_field, |
| | | custom_script: setting.customScript || '', |
| | | default_sql: setting.default || 'true', |
| | | dataM: this.props.dataManager ? 'Y' : '' |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | if (setting.queryType === 'statistics') { // ç»è®¡æ°æ®æºï¼å
å®¹æ¿æ¢ |
| | | let fieldmap = new Map() |
| | | let options = search.map(item => { |
| | | let _field = item.key |
| | | |
| | | if (fieldmap.has(_field)) { |
| | | _field = _field + '1' |
| | | if (this.props.dataManager) { // æ°æ®æé |
| | | _dataresource = _dataresource.replace(/\$@/ig, '/*') |
| | | _dataresource = _dataresource.replace(/@\$/ig, '*/') |
| | | param.custom_script = param.custom_script.replace(/\$@/ig, '/*') |
| | | param.custom_script = param.custom_script.replace(/@\$/ig, '*/') |
| | | } else { |
| | | _dataresource = _dataresource.replace(/@\$|\$@/ig, '') |
| | | param.custom_script = param.custom_script.replace(/@\$|\$@/ig, '') |
| | | } |
| | | |
| | | fieldmap.set(item.key, true) |
| | | let regoptions = null |
| | | if (setting.queryType === 'statistics' || param.custom_script) { |
| | | let allSearch = Utils.getAllSearchOptions(search) |
| | | |
| | | regoptions = allSearch.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + _field, 'ig'), |
| | | value: item.value |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | |
| | | options.reverse() |
| | | |
| | | options.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, `'${item.value}'`) |
| | | regoptions.push({ |
| | | reg: new RegExp('@orderBy@', 'ig'), |
| | | value: orderBy |
| | | }, { |
| | | reg: new RegExp('@pageSize@', 'ig'), |
| | | value: pageSize |
| | | }, { |
| | | reg: new RegExp('@pageIndex@', 'ig'), |
| | | value: pageIndex |
| | | }) |
| | | } |
| | | |
| | | if (setting.queryType === 'statistics') { // ç»è®¡æ°æ®æºï¼å
å®¹æ¿æ¢ |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | _search = '' |
| | | } |
| | | |
| | | let LText = '' |
| | | let LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` |
| | | |
| | | if (pagination) { |
| | | LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` |
| | | } else { |
| | | LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows` |
| | | } |
| | | |
| | | if (param.custom_script) { |
| | | regoptions.forEach(item => { |
| | | param.custom_script = param.custom_script.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | param.custom_script = Utils.formatOptions(param.custom_script) |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | |
| | | }) |
| | | } |
| | | |
| | | let charterr = '' |
| | | config.charts.forEach(chart => { |
| | | if (!charterr && ['line', 'bar', 'pie'].includes(chart.chartType) && !chart.Xaxis) { |
| | | charterr = 'å¾è¡¨' + (chart.title ? 'ã' + chart.title + 'ã' : '') + 'åæ è½´æªè®¾ç½®ï¼ä¸å¯å¯ç¨ï¼' |
| | | } |
| | | }) |
| | | |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) { |
| | | return 'èåå°æªè®¾ç½®æ°æ®æºï¼ä¸å¯å¯ç¨ï¼' |
| | | } else if (!config.setting.primaryKey) { |
| | | return 'èåå°æªè®¾ç½®ä¸»é®ï¼ä¸å¯å¯ç¨ï¼' |
| | | } else if (!tabinvalid) { |
| | | return 'èåæ ç¾é¡µè®¾ç½®é误ï¼åå¨å¤è¡æ ç¾æ¶ï¼è¡æ ç¾ä¸å¯ä¸ºç©ºï¼ï¼' |
| | | } else if (charterr) { |
| | | return charterr |
| | | } else { |
| | | return true |
| | | } |
| | |
| | | margin-bottom: 70px; |
| | | |
| | | .chart-title { |
| | | min-height: 40px; |
| | | position: relative; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | font-weight: 400; |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon } from 'antd' |
| | | |
| | | import { formRule } from '@/utils/option.js' |
| | | import './index.scss' |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // åå
¸é¡¹ |
| | | formlist: PropTypes.any, |
| | | card: PropTypes.any, |
| | | inputSubmit: PropTypes.any // å车æäº¤äºä»¶ |
| | | } |
| | | |
| | | state = { |
| | | formlist: null, |
| | | columns: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card } = this.props |
| | | |
| | | let columns = this.props.formlist.filter(item => item.key === 'field')[0].options |
| | | |
| | | this.setState({ |
| | | columns: columns, |
| | | formlist: this.props.formlist.map(item => { |
| | | if (item.key === 'content' && card.datatype === 'dynamic') { |
| | | item.hidden = true |
| | | } else if (item.key === 'field' && card.datatype === 'static') { |
| | | item.hidden = true |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | |
| | | } |
| | | |
| | | typeChange = (key, value) => { |
| | | if (key === 'datatype') { |
| | | this.setState({ |
| | | formlist: this.props.formlist.map(item => { |
| | | item.hidden = false |
| | | |
| | | if (item.key === 'content' && value === 'dynamic') { |
| | | item.hidden = true |
| | | } else if (item.key === 'field' && value === 'static') { |
| | | item.hidden = true |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | | // if (this.props.form.getFieldValue('fieldlength') !== undefined) { |
| | | // this.props.form.setFieldsValue({fieldlength: fieldlength}) |
| | | // } |
| | | } |
| | | } |
| | | |
| | | handleSubmit = (e) => { |
| | | e.preventDefault() |
| | | |
| | | if (this.props.inputSubmit) { |
| | | this.props.inputSubmit() |
| | | } |
| | | } |
| | | |
| | | getFields() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const fields = [] |
| | | this.state.formlist.forEach((item, index) => { |
| | | if (item.hidden) return |
| | | |
| | | if (item.type === 'text') { // ææ¬æç´¢ |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | }, |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)} |
| | | </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}> |
| | | <Icon type="question-circle" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(item.unlimit ? <InputNumber /> : |
| | | <InputNumber min={item.min} max={item.max} precision={item.decimal} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'select') { // 䏿æç´¢ |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.typeChange(item.key, value)}} |
| | | getPopupContainer={() => document.getElementById('card-detail-edit-form')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option id={index} title={option.text} key={index} value={option.value}> |
| | | {option.text} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'radio') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal, |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: this.props.dict['form.required.select'] + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.typeChange(item.key, e.target.value)}}> |
| | | { |
| | | item.options.map(option => { |
| | | return ( |
| | | <Radio key={option.value} value={option.value}>{option.text}</Radio> |
| | | ) |
| | | }) |
| | | } |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'multiselect') { // å¤é |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.label}> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || [] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | mode="multiple" |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {item.options.map((option, i) => |
| | | <Select.Option id={i} key={i} value={option.value}>{option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | | } |
| | | |
| | | |
| | | handleConfirm = () => { |
| | | const { columns } = this.state |
| | | // 表åæäº¤æ¶æ£æ¥è¾å
¥å¼æ¯å¦æ£ç¡® |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.uuid = this.props.card.uuid || '' |
| | | |
| | | if (values.field && !values.content) { |
| | | values.content = columns.filter(col => col.value === values.field)[0].text |
| | | } |
| | | |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 7 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 17 } |
| | | } |
| | | } |
| | | return ( |
| | | <Form {...formItemLayout} className="card-detail-edit-form" id="card-detail-edit-form"> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(MainSearch) |
New file |
| | |
| | | .card-detail-edit-form { |
| | | min-height: 190px; |
| | | .ant-form-item { |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | | } |
| | | .anticon-question-circle { |
| | | color: #c49f47; |
| | | position: relative; |
| | | left: -3px; |
| | | } |
| | | .ant-radio-group { |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | |
| | | }) |
| | | |
| | | let _class = '' |
| | | if (card.type === 'title') { |
| | | if (card.bold === 'true') { |
| | | _class = 'ant-card-meta-title' |
| | | } else { |
| | | _class = 'ant-card-meta-description' |
| | | } |
| | | |
| | | if (card.width) { |
| | | _class += ' ' + card.width |
| | | } |
| | | if (card.align) { |
| | | _class += ' ' + card.align |
| | | } |
| | | |
| | | return ( |
| | | <div ref={node => drag(drop(node))} className={_class} style={{ opacity: opacity}}> |
| | | <div className="content">{card.content}</div> |
| | | <div className="content" title={card.content}>{card.content}</div> |
| | | <Icon className="edit" title="ç¼è¾" type="edit" onClick={() => editCard(card)} /> |
| | | <Icon className="edit close" title="å é¤" type="close" onClick={() => delCard(card)} /> |
| | | </div> |
| | |
| | | }) |
| | | |
| | | return ( |
| | | <div ref={drop} className="ant-card-meta-detail"> |
| | | <div ref={drop} className="ant-card-meta-detail" style={{marginLeft: 48}}> |
| | | {cards.map(card => ( |
| | | <Card |
| | | key={card.uuid} |
| | |
| | | .ant-card-meta-detail { |
| | | .line-card-edit-box .ant-card-meta-detail { |
| | | overflow: visible; |
| | | .ant-card-meta-title, .ant-card-meta-description { |
| | | position: relative; |
| | | overflow: visible; |
| | | } |
| | | .ant-card-meta-description { |
| | | display: inline-block; |
| | | width: 100%; |
| | | vertical-align: top; |
| | | font-size: 14px; |
| | | |
| | | .content { |
| | | max-width: 100%; |
| | | display: inline-block; |
| | | overflow: hidden; |
| | | word-break: break-word; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | } |
| | | |
| | | .helf { |
| | | width: 50%; |
| | | } |
| | | .third { |
| | | width: 33.3%; |
| | | } |
| | | .align-center { |
| | | text-align: center; |
| | | } |
| | | .align-right { |
| | | text-align: right; |
| | | } |
| | | .ant-card-meta-title:not(:last-child), .ant-card-meta-description:not(:last-child) { |
| | | margin-bottom: 0px; |
| | | } |
| | | |
| | | .edit { |
| | | position: absolute; |
| | | left: 0; |
| | | top: -10px; |
| | | font-size: 14px; |
| | | font-size: 13px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | display: none; |
| | | padding: 0 5px; |
| | | } |
| | | .edit.close { |
| | | left: 20px; |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Card, Icon } from 'antd' |
| | | import { Icon, Modal } from 'antd' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | // import ChartCompileForm from './chartcompile' |
| | | import { getCardDetailForm } from '@/templates/zshare/formconfig' |
| | | |
| | | import DragDetail from './dragdetail' |
| | | import CardDetailForm from './carddetailform' |
| | | import './index.scss' |
| | | |
| | | // const { Meta } = Card |
| | | const { confirm } = Modal |
| | | |
| | | class LineChart extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | state = { |
| | | dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, |
| | | visible: true, |
| | | visible: false, |
| | | formlist: null, |
| | | cardcell: null // å¡çå
ç´ |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | editdetail = (_cell) => { |
| | | const { config } = this.props |
| | | if (!_cell) { |
| | | _cell = {uuid: Utils.getuuid()} |
| | | _cell = { |
| | | datatype: 'dynamic' |
| | | } |
| | | } |
| | | |
| | | let _columns = config.columns.filter(col => ['text', 'number'].includes(col.type)) |
| | | _columns = _columns.map(col => { |
| | | return { |
| | | uuid: col.uuid, |
| | | value: col.field, |
| | | text: col.label |
| | | } |
| | | }) |
| | | |
| | | if (_columns.filter(col => col.value === _cell.field).length === 0) { |
| | | _cell.field = '' |
| | | } |
| | | |
| | | this.setState({ |
| | | cardcell: _cell |
| | | cardcell: _cell, |
| | | visible: true, |
| | | formlist: getCardDetailForm(_cell, _columns) |
| | | }) |
| | | |
| | | } |
| | | |
| | | deletedetail = () => { |
| | | handleSubmit = () => { |
| | | const { card } = this.props |
| | | let _details = fromJS(card.details).toJS() |
| | | |
| | | this.detailFormRef.handleConfirm().then(res => { |
| | | if (!res.uuid) { |
| | | res.uuid = Utils.getuuid() |
| | | _details.push(res) |
| | | } else { |
| | | _details = _details.map(item => { |
| | | if (item.uuid === res.uuid) return res |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | cardcell: null, |
| | | visible: false, |
| | | formlist: null |
| | | }) |
| | | this.plotChange({details: _details}) |
| | | }) |
| | | } |
| | | |
| | | editModalCancel = () => { |
| | | this.setState({ |
| | | cardcell: null, |
| | | visible: false, |
| | | formlist: null |
| | | }) |
| | | } |
| | | |
| | | deletedetail = (cell) => { |
| | | const { card } = this.props |
| | | const { dict } = this.state |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | content: dict['model.confirm'] + dict['model.delete'] + ` - ${cell.content} ï¼`, |
| | | okText: dict['model.confirm'], |
| | | cancelText: dict['header.cancel'], |
| | | onOk() { |
| | | let _details = fromJS(card.details).toJS() |
| | | |
| | | _details = _details.filter(item => item.uuid !== cell.uuid) |
| | | |
| | | _this.plotChange({details: _details}) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { dict, visible, cardcell } = this.state |
| | | |
| | | return ( |
| | | <div className="line-card-edit-box"> |
| | | {card.title ? <p className="chart-title">{card.title}</p> : null} |
| | | {card.cardType === 'card1' ? <Card |
| | | className={card.widthType === 'ratio' ? 'ant-col ant-col-' + card.cardWidth : ''} |
| | | <div |
| | | className={'ant-card ant-card-bordered chart-card' + (card.widthType === 'ratio' ? ' ant-col ant-col-' + card.cardWidth : '')} |
| | | style={card.widthType === 'absolute' ? { width: card.cardWidth } : null} |
| | | > |
| | | <div className="ant-card-head"> |
| | | <div className="ant-card-head-wrapper"> |
| | | <div className="ant-card-head-title">Card Title</div> |
| | | <div className="ant-card-extra"> |
| | | <span>Action</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div className="ant-card-body"> |
| | | <div className="ant-card-meta"> |
| | | <Icon type="plus" onClick={this.editdetail} /> |
| | | <Icon type="plus" onClick={() => this.editdetail()} /> |
| | | {card.cardType === 'card2' ? <div className="ant-card-meta-avatar"> |
| | | <span className="ant-avatar ant-avatar-circle ant-avatar-image" style={{width: 32, height: 32}}> |
| | | <img src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" alt=""/> |
| | | </span> |
| | | </div> : null } |
| | | <DragDetail |
| | | list={card.details} |
| | | handleList={this.handleList} |
| | |
| | | deleteMenu={this.deletedetail} |
| | | /> |
| | | </div> |
| | | </Card> : null} |
| | | {/* <Card |
| | | className={card.widthType === 'ratio' ? 'ant-col ant-col-' + card.cardWidth : ''} |
| | | style={card.widthType === 'absolute' ? { width: card.cardWidth } : null} |
| | | </div> |
| | | {card.cardType === 'card2' ? <ul className="ant-card-actions"> |
| | | <li style={{width: '33.3333%'}}> |
| | | <span> |
| | | <Icon type="setting"/> |
| | | </span> |
| | | </li> |
| | | <li style={{width: '33.3333%'}}> |
| | | <span> |
| | | <Icon type="edit"/> |
| | | </span> |
| | | </li> |
| | | <li style={{width: '33.3333%'}}> |
| | | <span> |
| | | <Icon type="edit"/> |
| | | </span> |
| | | </li> |
| | | </ul> : null} |
| | | </div> |
| | | {/* æ¾ç¤ºåç¼è¾ */} |
| | | <Modal |
| | | title="ç¼è¾" |
| | | visible={visible} |
| | | width={650} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | onCancel={this.editModalCancel} |
| | | destroyOnClose |
| | | > |
| | | <Meta |
| | | avatar={ |
| | | <Avatar size={64} src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" /> |
| | | } |
| | | title="Card title" |
| | | description="This is the description" |
| | | <CardDetailForm |
| | | dict={dict} |
| | | card={cardcell} |
| | | inputSubmit={this.handleSubmit} |
| | | formlist={this.state.formlist} |
| | | wrappedComponentRef={(inst) => this.detailFormRef = inst} |
| | | /> |
| | | </Card> */} |
| | | {/* <ChartCompileForm |
| | | plot={plot} |
| | | type={plot.chartType} |
| | | config={this.props.config} |
| | | dict={this.state.dict} |
| | | plotchange={this.plotChange} |
| | | /> */} |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | margin-bottom: 30px; |
| | | padding: 30px 20px; |
| | | |
| | | .ant-card { |
| | | .ant-card.chart-card { |
| | | min-height: 100px; |
| | | |
| | | .ant-card-head { |
| | | min-height: 40px; |
| | | line-height: 2; |
| | | .ant-card-head-title { |
| | | color: #000000; |
| | | font-weight: 500; |
| | | } |
| | | .ant-card-extra { |
| | | cursor: pointer; |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .ant-card.ant-card-bordered .ant-card-body { |
| | | padding: 20px; |
| | | zoom: 1; |
| | | |
| | | // .ant-card-meta-avatar { |
| | | .ant-card-meta { |
| | | position: relative; |
| | | >.anticon-plus { |
| | | color: #26C281; |
| | | position: absolute; |
| | | right: -15px; |
| | | top: -5px; |
| | | padding: 5px; |
| | | } |
| | | |
| | | .ant-card-meta-avatar { |
| | | position: absolute; |
| | | top: 0px; |
| | | left: 0px; |
| | | } |
| | | // .ant-card-meta-avatar + .ant-card-meta-detail { |
| | | // float: left; |
| | | // } |
| | | .ant-avatar-image { |
| | | box-sizing: border-box; |
| | | margin: 0; |
| | | padding: 0; |
| | | font-variant: tabular-nums; |
| | | line-height: 1.5; |
| | | list-style: none; |
| | | font-feature-settings: 'tnum'; |
| | | position: relative; |
| | | display: inline-block; |
| | | overflow: hidden; |
| | | color: #fff; |
| | | white-space: nowrap; |
| | | text-align: center; |
| | | vertical-align: middle; |
| | | border-radius: 50%; |
| | | |
| | | img { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .chart-title { |
| | |
| | | |
| | | return ( |
| | | <div className="line-chart-edit-box" style={{minHeight: plot.height ? plot.height + 50 : 450}}> |
| | | {plot.title ? <p className="chart-title">{plot.title}</p> : null} |
| | | <p className="chart-title">{plot.title}</p> |
| | | <div className="canvas" id={plot.uuid}></div> |
| | | <ChartCompileForm |
| | | plot={plot} |
| | |
| | | import bar4 from '@/assets/img/bar4.png' |
| | | import pie1 from '@/assets/img/pie1.png' |
| | | import pie2 from '@/assets/img/pie2.png' |
| | | import card1 from '@/assets/img/card1.jpg' |
| | | import card2 from '@/assets/img/card2.jpg' |
| | | import card3 from '@/assets/img/card3.jpg' |
| | | import './index.scss' |
| | | |
| | | const syslegends = { |
| | |
| | | card: [ |
| | | { |
| | | uuid: 'card1', |
| | | url: pie1, |
| | | url: card1, |
| | | type: 'card1' |
| | | }, |
| | | { |
| | | uuid: 'card2', |
| | | url: pie2, |
| | | url: card2, |
| | | type: 'card2' |
| | | }, |
| | | { |
| | | uuid: 'card3', |
| | | url: card3, |
| | | type: 'card3' |
| | | } |
| | | ] |
| | | } |
| | |
| | | |
| | | if (!result.details) { |
| | | result.details = [ |
| | | {type: 'title', uuid: 'cardtitle', content: 'Card title', datatype: 'static', align: 'left'}, |
| | | {type: 'description', uuid: 'carddescription', content: 'This is the description', datatype: 'static', align: 'left'} |
| | | {bold: 'true', uuid: 'cardtitle', content: 'Card title', datatype: 'static', align: 'left'}, |
| | | {bold: 'false', uuid: 'carddescription', content: 'Card content', datatype: 'static', align: 'left'} |
| | | ] |
| | | result.actions = [] |
| | | result.title = '' |
| | | } |
| | | } |
| | | |
| | |
| | | let _dataresource = _setting.dataresource |
| | | let _customScript = _setting.customScript |
| | | |
| | | // æç´¢æ¡ä»¶ |
| | | let allSearch = Utils.initMainSearch(config.search) |
| | | allSearch = Utils.getAllSearchOptions(allSearch) |
| | | |
| | | // æ¾ç¤ºååæ®µï¼ç¨äºæ¥è¯¢ |
| | | let arr_field = [] |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | | arr_field.push(col.field) |
| | | } |
| | | }) |
| | | arr_field = arr_field.join(',') |
| | | |
| | | // æ£åæ¿æ¢ |
| | | let regoptions = allSearch.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | |
| | | if (_setting.queryType === 'statistics') { |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | } |
| | | |
| | | if (_customScript) { |
| | | regoptions.push({ |
| | | reg: new RegExp('@orderBy@', 'ig'), |
| | | value: _setting.order |
| | |
| | | value: 1 |
| | | }) |
| | | } |
| | | |
| | | // æ°æ®æºå¤ç |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | _dataresource = `select ${_setting.laypage !== 'false' ? 'top 10' : ''} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${_setting.order}) as rows from ${_dataresource}) tmptable ${_setting.laypage !== 'false' ? 'where rows > 0' : ''} order by tmptable.rows` |
| | | |
| | | if (_setting.queryType === 'statistics') { |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | } |
| | | |
| | | if (_customScript) { |
| | | regoptions.forEach(item => { |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | }) |
| | |
| | | } |
| | | ] |
| | | } |
| | | |
| | | /** |
| | | * @description è·åå¡ç详æ
表åé
ç½®ä¿¡æ¯ |
| | | * @param {object} card // æ ç¾é
ç½®ä¿¡æ¯ |
| | | */ |
| | | export function getCardDetailForm (card, _columns) { |
| | | return [ |
| | | { |
| | | type: 'radio', |
| | | key: 'datatype', |
| | | label: 'æ°æ®ç±»å', |
| | | initVal: card.datatype || 'dynamic', |
| | | required: true, |
| | | options: [{ |
| | | value: 'dynamic', |
| | | text: '卿' |
| | | }, { |
| | | value: 'static', |
| | | text: 'éæ' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'content', |
| | | label: 'å
容', |
| | | initVal: card.content || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'field', |
| | | label: 'åæ®µ', |
| | | initVal: card.field || '', |
| | | required: true, |
| | | options: _columns |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'bold', |
| | | label: 'å ç²', |
| | | initVal: card.bold || 'false', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: 'æ¯' |
| | | }, { |
| | | value: 'false', |
| | | text: 'å¦' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'width', |
| | | label: '宽度', |
| | | initVal: card.width || '', |
| | | required: false, |
| | | options: [{ |
| | | value: '', |
| | | text: '100%' |
| | | }, { |
| | | value: 'helf', |
| | | text: '50%' |
| | | }, { |
| | | value: 'third', |
| | | text: '33.3%' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'align', |
| | | label: '对é½', |
| | | initVal: card.align || '', |
| | | required: false, |
| | | options: [{ |
| | | value: '', |
| | | text: 'å·¦' |
| | | }, { |
| | | value: 'align-center', |
| | | text: 'å±
ä¸' |
| | | }, { |
| | | value: 'align-right', |
| | | text: 'å³' |
| | | }] |
| | | } |
| | | ] |
| | | } |
| | |
| | | /* åç±»æ°æ®éªè¯ */ |
| | | Set @tbid='' |
| | | |
| | | Select top 1 @tbid='X' from (select ${item.field}${_primaryKey},1 an n from ${datasource} ) tb inner join (select ID from dbo.SplitComma(@ID@)) sp on tb.${primaryKey}=sp.ID group by ${item.field} having sum(n)>1 |
| | | Select top 1 @tbid='X' from (select ${item.field}${_primaryKey},1 as n from ${datasource} ) tb inner join (select ID from dbo.SplitComma(@ID@)) sp on tb.${primaryKey}=sp.ID group by ${item.field} having sum(n)>1 |
| | | |
| | | If @tbid!='' |
| | | Begin |
| | | Set @errorcode='E' ,Set @remsg='${item.fieldlabel} å¼ä¸å¯ä¸' |
| | | Set @ErrorCode='E' Set @retmsg='${item.fieldlabel} å¼ä¸å¯ä¸' |
| | | goto aaa |
| | | end |
| | | ` |