From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 09 十二月 2022 15:53:32 +0800
Subject: [PATCH] 2022-12-09

---
 src/templates/sharecomponent/actioncomponent/index.jsx |  122 +++++++++++++++++++---------------------
 1 files changed, 59 insertions(+), 63 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx
index 8a0a704..024cfc7 100644
--- a/src/templates/sharecomponent/actioncomponent/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/index.jsx
@@ -1,14 +1,11 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Tooltip, Modal, notification, Button } from 'antd'
-import { QuestionCircleOutlined } from '@ant-design/icons'
+import { Modal, notification, Button } from 'antd'
 import moment from 'moment'
 
 import Api from '@/api'
 import Utils, { FuncUtils } from '@/utils/utils.js'
-import zhCN from '@/locales/zh-CN/model.js'
-import enUS from '@/locales/en-US/model.js'
 import { getActionForm } from '@/templates/zshare/formconfig'
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
 
@@ -24,6 +21,7 @@
 const VerifyCard = asyncSpinComponent(() => import('@/templates/zshare/verifycard'))
 const VerifyPrint = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyprint'))
 const VerifyExcelIn = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelin'))
+const VerifyMegvii = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifymegvii'))
 const VerifyExcelOut = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelout'))
 
 class ActionComponent extends Component {
@@ -37,14 +35,14 @@
   }
 
   state = {
-    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     card: null,          // 缂栬緫涓厓绱�
     formlist: null,      // 琛ㄥ崟淇℃伅
     actionlist: null,    // 鎸夐挳缁�
     copying: false,      // 鎸夐挳澶嶅埗涓�
     visible: false,      // 妯℃�佹鎺у埗
     printTemps: [],      // 鍗曟嵁鎵撳嵃妯℃澘
-    profVisible: false   // 楠岃瘉淇℃伅妯℃�佹
+    profVisible: false,  // 楠岃瘉淇℃伅妯℃�佹
+    record: null
   }
 
   /**
@@ -425,7 +423,7 @@
             Align: 'center',
             IsSort: 'false',
             uuid: Utils.getuuid(),
-            label: this.state.dict['model.operation'],
+            label: '鎿嶄綔',
             type: 'action',
             style: 'button',
             show: 'horizontal',
@@ -625,11 +623,10 @@
    */
   deleteElement = (card) => {
     const { config } = this.props
-    const { dict } = this.state
     let _this = this
 
     confirm({
-      content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋,
+      content: `纭畾鍒犻櫎 - ${card.label} 锛焋,
       onOk() {
         let _actionlist = fromJS(_this.state.actionlist).toJS()
 
@@ -646,7 +643,7 @@
             Align: 'center',
             IsSort: 'false',
             uuid: Utils.getuuid(),
-            label: this.state.dict['model.operation'],
+            label: '鎿嶄綔',
             type: 'action',
             style: 'button',
             show: 'horizontal',
@@ -786,11 +783,7 @@
             resolve(false)
           }
         } else if (btn.OpenType === 'excelOut') {
-          let _param = {
-            innerFunc: btn.innerFunc
-          }
-
-          newLText = Utils.formatOptions(FuncUtils.getTableFunc(_param, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql
+          newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql
           DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
 
           resolve(true)
@@ -858,15 +851,51 @@
     MKEmitter.removeListener('pasteButton', this.pasteButton)
   }
 
+  getVerify = (card) => {
+    const { config } = this.props
+
+    if (!card) return null
+
+    if (['pop', 'prompt', 'exec'].includes(card.OpenType)) {
+      return <VerifyCard
+        card={card}
+        config={config}
+        columns={config.columns}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    } else if (card.OpenType === 'excelIn') {
+      return <VerifyExcelIn
+        card={card}
+        columns={config.columns}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    } else if (card.OpenType === 'excelOut') {
+      return <VerifyExcelOut
+        card={card}
+        config={config}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    } else if (card.OpenType === 'funcbutton' && card.funcType === 'print') {
+      return <VerifyPrint
+        card={card}
+        columns={config.columns}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    } else if (card.OpenType === 'funcbutton' && card.funcType === 'megvii') {
+      return <VerifyMegvii
+        card={card}
+        columns={config.columns}
+        wrappedComponentRef={(inst) => this.verifyRef = inst}
+      />
+    }
+  }
+
   render() {
     const { config } = this.props
-    const { actionlist, visible, card, dict, copying, profVisible } = this.state
+    const { actionlist, visible, card, copying, profVisible, record } = this.state
 
     return (
-      <div className="model-table-action-list" style={config.charts.length > 1 ? {paddingTop: 25} : null}>
-        <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃寜閽�嬩腑锛岄�夋嫨瀵瑰簲绫诲瀷鐨勬寜閽嫋鑷虫澶勬坊鍔狅紝濡傞�夋嫨鎸夐挳绫诲瀷涓鸿〃鍗曘�佹柊鏍囩椤电瓑鍚湁閰嶇疆椤甸潰鐨勬寜閽紝鍙湪宸︿晶宸ュ叿鏍�-鎸夐挳-鍙厤缃寜閽锛岀偣鍑绘寜閽畬鎴愮浉鍏抽厤缃�傛敞锛氬綋璁剧疆鎸夐挳鏄剧ず浣嶇疆涓鸿〃鏍兼椂锛屾樉绀哄垪浼氬鍔犳搷浣滃垪銆�">
-          <QuestionCircleOutlined style={{color: '#c49f47', position: 'absolute', left: '5px', top: '5px'}} />
-        </Tooltip>
+      <div className="model-table-action-list" style={config.charts && config.charts.length > 1 ? {paddingTop: 25} : null}>
         <DragElement
           list={actionlist}
           setting={this.props.config.setting}
@@ -878,37 +907,36 @@
         />
         {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */}
         <Modal
-          title={dict['model.action'] + '-' + (card && card.copyType === 'action' ? dict['model.copy'] : dict['model.edit'])}
+          title={'鎸夐挳-' + (card && card.copyType === 'action' ? '澶嶅埗' : '缂栬緫')}
           wrapClassName="model-table-action-edit-modal"
           visible={visible}
-          width={850}
+          width={920}
           maskClosable={false}
           onCancel={this.editModalCancel}
           footer={[
-            <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/>,
-            <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/>,
-            <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>,
-            <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>{dict['model.confirm']}</Button>
+            record && ['pop', 'exec', 'prompt'].includes(record.OpenType) && record.intertype === 'system' ? <CreateInterface key="interface" ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null,
+            record && record.intertype === 'inner' ? <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null,
+            <Button key="cancel" onClick={this.editModalCancel}>鍙栨秷</Button>,
+            <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>纭畾</Button>
           ]}
           destroyOnClose
         >
           <ActionForm
-            dict={dict}
             card={card}
             formlist={this.state.formlist}
             inputSubmit={this.handleSubmit}
             setting={config.setting}
+            updRecord={(record) => this.setState({record: fromJS(record).toJS()})}
             wrappedComponentRef={(inst) => this.actionFormRef = inst}
           />
         </Modal>
         {/* 鎸夐挳浣跨敤绯荤粺瀛樺偍杩囩▼鏃讹紝楠岃瘉淇℃伅妯℃�佹 */}
         <Modal
-          wrapClassName="model-table-action-verify-modal"
-          title={(card && card.label ? card.label + ' - ' : '') + '楠岃瘉淇℃伅'}
+          wrapClassName="mk-pop-modal"
           visible={profVisible}
           width={'90vw'}
           maskClosable={false}
-          okText={dict['model.submit']}
+          okText="鎻愪氦"
           onOk={this.verifySubmit}
           onCancel={() => {
             if (this.verifyRef.handleCancel) {
@@ -921,39 +949,7 @@
           }}
           destroyOnClose
         >
-          {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ?
-            <VerifyCard
-              card={card}
-              dict={dict}
-              config={config}
-              columns={config.columns}
-              wrappedComponentRef={(inst) => this.verifyRef = inst}
-            /> : null
-          }
-          {card && card.execMode ?
-            <VerifyPrint
-              card={card}
-              dict={dict}
-              columns={config.columns}
-              wrappedComponentRef={(inst) => this.verifyRef = inst}
-            /> : null
-          }
-          {card && card.OpenType === 'excelIn' ?
-            <VerifyExcelIn
-              card={card}
-              dict={dict}
-              columns={config.columns}
-              wrappedComponentRef={(inst) => this.verifyRef = inst}
-            /> : null
-          }
-          {card && card.OpenType === 'excelOut' ?
-            <VerifyExcelOut
-              card={card}
-              dict={dict}
-              config={config}
-              wrappedComponentRef={(inst) => this.verifyRef = inst}
-            /> : null
-          }
+          {this.getVerify(card)}
         </Modal>
       </div>
     )

--
Gitblit v1.8.0