From bf772e586c29b4858366dbad143b1eaeca3c46ed Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 17 四月 2020 10:18:09 +0800 Subject: [PATCH] 2020-04-17 --- src/templates/zshare/verifycardexcelin/index.jsx | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 46 insertions(+), 1 deletions(-) diff --git a/src/templates/zshare/verifycardexcelin/index.jsx b/src/templates/zshare/verifycardexcelin/index.jsx index 9ae2d2e..4ded8bf 100644 --- a/src/templates/zshare/verifycardexcelin/index.jsx +++ b/src/templates/zshare/verifycardexcelin/index.jsx @@ -1,7 +1,9 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber, Radio } from 'antd' +import moment from 'moment' +import Api from '@/api' import Utils from '@/utils/utils.js' import UniqueForm from './uniqueform' @@ -21,6 +23,7 @@ state = { verify: {}, + systemScripts: [], excelColumns: [ { title: 'Column', @@ -142,7 +145,13 @@ { title: 'SQL', dataIndex: 'sql', - width: '70%' + width: '60%' + }, + { + title: '鎵ц浣嶇疆', + dataIndex: 'position', + width: '10%', + render: (text, record) => record.position !== 'front' ? 'sql鍚�' : 'sql鍓�' }, { title: '鐘舵��', @@ -214,6 +223,41 @@ columns: _columns, scripts: _verify.scripts || [], uniques: _verify.uniques || [] + } + }) + } + + componentDidMount () { + let _scriptSql = `Select distinct func+Remark as funcname,longparam from聽s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end` + + _scriptSql = Utils.formatOptions(_scriptSql) + + let _sParam = { + func: 'sPC_Get_SelectedList', + LText: _scriptSql, + obj_name: 'data', + arr_field: 'funcname,longparam' + } + + _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) + + Api.getSystemConfig(_sParam).then(res => { + if (res.status) { + this.setState({ + systemScripts: res.data.map(item => { + return { + name: item.funcname, + value: Utils.formatOptions(item.longparam, true) + } + }) + }) + } else { + notification.warning({ + top: 92, + message: res.message, + duration: 10 + }) } }) } @@ -673,6 +717,7 @@ isdefault={verify.default} usefulfields={verify.columns} scripts={verify.scripts} + systemScripts={this.state.systemScripts} scriptsChange={this.scriptsChange} wrappedComponentRef={(inst) => this.scriptsForm = inst} /> -- Gitblit v1.8.0