From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 四月 2025 12:18:03 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/views/appmanage/scriptform/index.jsx |   37 +++++++++++++++++++++++++------------
 1 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/src/views/appmanage/scriptform/index.jsx b/src/views/appmanage/scriptform/index.jsx
index 0e0d257..5bc53d2 100644
--- a/src/views/appmanage/scriptform/index.jsx
+++ b/src/views/appmanage/scriptform/index.jsx
@@ -1,6 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Select, notification } from 'antd'
+import { Form, Row, Col, Input, Select, notification, Tooltip } from 'antd'
+import { QuestionCircleOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Api from '@/api'
@@ -16,7 +17,7 @@
   }
 
   state = {
-    type: 'subapp',
+    type: 'view',
     sublist: [],
     views: [],
     appId: '',
@@ -42,7 +43,9 @@
 
     this.viewList = {}
 
-    this.setState({sublist, appId, subAppId})
+    this.setState({sublist, appId, subAppId}, () => {
+      this.getViews()
+    })
   }
 
   /**
@@ -66,6 +69,7 @@
 
   changeApp = (val) => {
     const { applist } = this.props
+    const { type } = this.state
 
     let app = applist.filter(item => `${item.ID},${item.kei_no}` === val)[0]
 
@@ -84,7 +88,10 @@
     this.setState({sublist, subAppId, appId}, () => {
       this.getViews()
     })
-    this.props.form.setFieldsValue({subAppId})
+
+    if (type !== 'app') {
+      this.props.form.setFieldsValue({subAppId})
+    }
   }
 
   changeSubApp = (val) => {
@@ -144,28 +151,34 @@
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
-        sm: { span: 8 }
+        sm: { span: 6 }
       },
       wrapperCol: {
         xs: { span: 24 },
-        sm: { span: 16 }
+        sm: { span: 18 }
       }
     }
     return (
       <Form {...formItemLayout} className="app-script-form">
         <Row gutter={24}>
           <Col span={12}>
-            <Form.Item label="绫诲瀷">
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="1銆佸垵娆″崌绾ф垨搴旂敤鍩烘湰淇℃伅淇敼鏃讹紝璇烽鍏堟坊鍔犲簲鐢紙鍩烘湰淇℃伅锛夛紱2銆佸瓙搴旂敤鏁翠綋鍗囩骇鏃讹紝璇锋坊鍔犲瓙搴旂敤锛堝崌绾у唴瀹瑰寘鎷〉闈㈠強鏉冮檺鏍戯級锛�3銆佸崟涓〉闈㈠崌绾ф椂锛岃娣诲姞椤甸潰锛�4銆佹秹鍙婃潈闄愭洿鏂版椂锛岃娣诲姞鏉冮檺鏍�">
+                <QuestionCircleOutlined className="mk-form-tip" />绫诲瀷
+              </Tooltip>
+            }>
               {getFieldDecorator('VType', {
-                initialValue: 'subapp',
+                initialValue: 'view',
                 rules: [{
                   required: true,
                   message: '璇烽�夋嫨绫诲瀷!'
                 }]
               })(
                 <Select onChange={this.changeType}>
+                  <Select.Option value="app">搴旂敤锛堝熀鏈俊鎭級</Select.Option>
                   <Select.Option value="subapp">瀛愬簲鐢�</Select.Option>
                   <Select.Option value="view">椤甸潰</Select.Option>
+                  <Select.Option value="role">鏉冮檺鏍�</Select.Option>
                 </Select>
               )}
             </Form.Item>
@@ -187,7 +200,7 @@
               )}
             </Form.Item>
           </Col>
-          <Col span={12}>
+          {type !== 'app' ? <Col span={12}>
             <Form.Item label="瀛愬簲鐢�">
               {getFieldDecorator('subAppId', {
                 initialValue: subAppId,
@@ -203,7 +216,7 @@
                 </Select>
               )}
             </Form.Item>
-          </Col>
+          </Col> : null}
           {type === 'view' ? <Col span={12}>
             <Form.Item label="椤甸潰">
               {getFieldDecorator('viewId', {
@@ -213,9 +226,9 @@
                   message: '璇烽�夋嫨椤甸潰!'
                 }]
               })(
-                <Select>
+                <Select showSearch dropdownMatchSelectWidth={false} filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
                   {views.map(item => {
-                    return <Select.Option key={item.MenuID} value={item.MenuID}>{item.MenuName}</Select.Option>
+                    return <Select.Option key={item.MenuID} value={item.MenuID}>{item.MenuName + ' ' + item.MenuNo}</Select.Option>
                   })}
                 </Select>
               )}

--
Gitblit v1.8.0