From 5046d0d13dc6a8563b8e54e31913bc44cfa1072f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 四月 2022 19:23:18 +0800
Subject: [PATCH] 2022-04-26

---
 src/templates/zshare/customscript/index.jsx |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx
index 28cd769..8daf4ab 100644
--- a/src/templates/zshare/customscript/index.jsx
+++ b/src/templates/zshare/customscript/index.jsx
@@ -1,13 +1,15 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { fromJS } from 'immutable'
-import { Form, Row, Col, Icon, Button, notification, Select, Popconfirm, Typography } from 'antd'
+import { Form, Row, Col, Button, notification, Select, Popconfirm, Typography } from 'antd'
+import { StopOutlined, CheckCircleOutlined, EditOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Utils from '@/utils/utils.js'
 import Api from '@/api'
 import CodeMirror from '@/templates/zshare/codemirror'
 import asyncComponent from '@/utils/asyncComponent'
+import MKEmitter from '@/utils/events.js'
 import './index.scss'
 
 const { Paragraph } = Typography
@@ -38,12 +40,12 @@
         render: (text) => {
           let title = text.match(/^\s*\/\*.+\*\//)
           title = title && title[0] ? title[0] : ''
-          text = title ? text.replace(title, '') : text
+          let _text = title ? text.replace(title, '') : text
 
           return (
             <div>
-              {title ? <span style={{color: '#a50'}}>{title}</span> : null}
-              <Paragraph copyable ellipsis={{ rows: 4, expandable: true }}>{text}</Paragraph>
+              {title ? <span style={{color: '#a50'}}>{title}<span style={{fontSize: '12px', marginLeft: '5px'}}>{_text.length}</span></span> : null}
+              <Paragraph copyable={{ text: text }} ellipsis={{ rows: 4, expandable: true }}>{_text}</Paragraph>
             </div>
           )
         }
@@ -54,15 +56,15 @@
         width: '12%',
         render: (text, record) => record.status === 'false' ?
           (
-            <div>
+            <div style={{color: '#ff4d4f'}}>
               {this.props.dict['model.status.forbidden']}
-              <Icon style={{marginLeft: '5px'}} type="stop" theme="twoTone" twoToneColor="#ff4d4f" />
+              <StopOutlined style={{marginLeft: '5px'}} />
             </div>
           ) :
           (
-            <div>
+            <div style={{color: '#26C281'}}>
               {this.props.dict['model.status.open']}
-              <Icon style={{marginLeft: '5px'}} type="check-circle" theme="twoTone" twoToneColor="#52c41a" />
+              <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
       },
@@ -73,14 +75,14 @@
         dataIndex: 'operation',
         render: (text, record) =>
           (<div style={{textAlign: 'center'}}>
-            <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><Icon type="edit" /></span>
-            <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><Icon type="swap" /></span>
+            <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span>
+            <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span>
             <Popconfirm
               overlayClassName="popover-confirm"
               title={this.props.dict['model.query.delete']}
               onConfirm={() => this.handleDelete(record)
             }>
-              <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span>
+              <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
             </Popconfirm>
           </div>)
       }
@@ -94,9 +96,7 @@
     searches.forEach(item => {
       if (!item.field) return
       if (item.type === 'group') {
-        if (item.transfer === 'true') {
-          _usefulFields.push(item.field)
-        }
+        _usefulFields.push(item.field)
         _usefulFields.push(item.datefield)
         _usefulFields.push(item.datefield + '1')
       } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) {
@@ -261,6 +261,8 @@
         editItem: null
       })
 
+      MKEmitter.emit('editLineId', values.uuid)
+
       this.props.scriptsUpdate(_scripts)
       this.props.form.setFieldsValue({
         sql: ''
@@ -379,7 +381,7 @@
             </Col>
             <Col span={24} className="sqlfield">
               <Form.Item label={'鍙敤瀛楁'}>
-                id, bid, loginuid, sessionuid, userid, username, fullname, login_city, appkey, time_id, orderBy{setting.laypage === 'true' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''}
+                id, bid, loginuid, sessionuid, userid, username, fullname, RoleID, mk_departmentcode, mk_organization, login_city, appkey, time_id, orderBy{setting.laypage === 'true' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''}
               </Form.Item>
             </Col>
             <Col span={10} className="quick-add">
@@ -391,6 +393,9 @@
                   onChange={this.selectScript}
                 >
                   <Select.Option key="default" value={defaultSql}>榛樿sql</Select.Option>
+                  <Select.Option key="debugger" value={`z_debug: select @ErrorCode='E',@retmsg='娴嬭瘯鏂偣' goto aaa`}>
+                    娴嬭瘯鏂偣
+                  </Select.Option>
                   {systemScripts.map((option, i) =>
                     <Select.Option style={{whiteSpace: 'normal'}} key={i} value={option.value}>{option.name}</Select.Option>
                   )}

--
Gitblit v1.8.0