From a45ebcabfb93f05d8c0550edb9659b50c227c5cc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 15 四月 2020 09:44:31 +0800 Subject: [PATCH] 2020-04-15 --- src/tabviews/managetable/secretKeyTable/actionList/index.jsx | 63 ++++++++++++++++--------------- 1 files changed, 33 insertions(+), 30 deletions(-) diff --git a/src/tabviews/managetable/secretKeyTable/actionList/index.jsx b/src/tabviews/managetable/secretKeyTable/actionList/index.jsx index 7b14a7a..d50430e 100644 --- a/src/tabviews/managetable/secretKeyTable/actionList/index.jsx +++ b/src/tabviews/managetable/secretKeyTable/actionList/index.jsx @@ -1,12 +1,11 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -// import moment from 'moment' +import moment from 'moment' import { Button, Modal, notification, message } from 'antd' import MutilForm from '@/tabviews/zshare/mutilform' import Utils from '@/utils/utils.js' import { refCodes } from '../config' -// import options from '@/store/options.js' -// import Api from '@/api' +import Api from '@/api' import './index.scss' const { confirm } = Modal @@ -45,7 +44,7 @@ * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ actionTrigger = (item) => { - const { setting, BID } = this.props + const { setting, BID, datalist } = this.props if (!BID) { notification.warning({ @@ -95,6 +94,15 @@ }) return } + } + + if ((!datalist || datalist.length === 0) && item.sqlType !== 'revert') { + notification.warning({ + top: 92, + message: '鏁版嵁涓㈠け鎴栭敊璇紝璇锋仮澶嶉粯璁よ缃紒', + duration: 10 + }) + return } if (item.OpenType === 'prompt') { @@ -161,35 +169,30 @@ {uuid: 'other_system2', public: 'd', private: 'damson', keyType: 'other'} ] } - console.log(datalist) + let _number = Math.floor(Math.random() * 10) - console.log(_number) let keyString = window.btoa(window.encodeURIComponent(JSON.stringify(datalist))) - console.log(keyString) let regular = refCodes[_number] - console.log(regular) - keyString = keyString.replace(new RegExp(regular.char,'g'), regular.md5str) - console.log(keyString) - // window.btoa(window.encodeURIComponent(JSON.stringify(val))) - - // for (let i = 0; i < a.length; i++) { - // if (a[i] !== b[i]) { - // console.log(i) - // console.log(src.substring(i- 10, i+ 10)) - // } - // } - // let param = { refCodes - // func: 'sPC_TableData_InUpDe', - // BID: this.props.BID - // } - // Api.genericInterface(param).then((res) => { - // if (res.status) { - // this.execSuccess(btn, res) - // } else { - // this.execError(res, btn) - // } - // _resolve() - // }) + keyString = keyString.replace(new RegExp(regular.char, 'g'), regular.md5str) + keyString = window.btoa(keyString) + keyString = _number + keyString + + let param = { + func: 's_app_secret_param_adduptdel', + BID: this.props.BID, + LText: keyString, + timestamp: moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + } + + param.secretkey = Utils.encrypt(param.LText, param.timestamp) + Api.getLocalConfig(param).then((res) => { + if (res.status) { + this.execSuccess(btn, res) + } else { + this.execError(res, btn) + } + _resolve() + }) } -- Gitblit v1.8.0