From 04dd71efebbf350fa97ea77fc0a64b75fe5ef889 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 02 十一月 2021 09:35:09 +0800
Subject: [PATCH] 2021-11-02

---
 src/tabviews/zshare/automatic/index.jsx               |   18 ++++++++++++++----
 src/templates/zshare/unattended/index.jsx             |    2 +-
 src/templates/zshare/unattended/settingform/index.jsx |   30 ++++++++++++++++++++++--------
 3 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/src/tabviews/zshare/automatic/index.jsx b/src/tabviews/zshare/automatic/index.jsx
index 8145aa3..6a8d387 100644
--- a/src/tabviews/zshare/automatic/index.jsx
+++ b/src/tabviews/zshare/automatic/index.jsx
@@ -15,10 +15,19 @@
   state = {
     running: false,
     line: 1,
+    gap: 2000,
     init: true
   }
 
   timer = null
+
+  UNSAFE_componentWillMount() {
+    const { autoMatic } = this.props
+
+    if (autoMatic.gap && autoMatic.gap >= 1) {
+      this.setState({gap: autoMatic.gap * 1000})
+    }
+  }
 
   componentDidMount () {
     MKEmitter.addListener('modifyTabs', this.breakOff)
@@ -60,6 +69,7 @@
 
   autoExecOver = (btnId, type) => {
     const { autoMatic, config } = this.props
+    const { gap } = this.state
 
     if (!this.state.running || btnId !== autoMatic.action) return
 
@@ -70,12 +80,12 @@
         this.setState({line: this.state.line + 1}, () => {
           setTimeout(() => {
             MKEmitter.emit('autoQueryData', config.MenuID, this.state.line)
-          }, 2000)
+          }, gap)
         })
       } else if (autoMatic.onFail === 'stay') {
         setTimeout(() => {
           MKEmitter.emit('autoQueryData', config.MenuID, this.state.line)
-        }, 2000)
+        }, gap)
       } else {
         this.setState({running: false})
       }
@@ -84,12 +94,12 @@
         this.setState({line: this.state.line + 1}, () => {
           setTimeout(() => {
             MKEmitter.emit('autoQueryData', config.MenuID, this.state.line)
-          }, 2000)
+          }, gap)
         })
       } else if (autoMatic.onSuccess === 'stay') {
         setTimeout(() => {
           MKEmitter.emit('autoQueryData', config.MenuID, this.state.line)
-        }, 2000)
+        }, gap)
       } else {
         this.setState({running: false})
       }
diff --git a/src/templates/zshare/unattended/index.jsx b/src/templates/zshare/unattended/index.jsx
index 1ed4f34..2a5852a 100644
--- a/src/templates/zshare/unattended/index.jsx
+++ b/src/templates/zshare/unattended/index.jsx
@@ -61,7 +61,7 @@
           title="鏃犱汉鍊煎畧"
           wrapClassName="unattended-field-modal"
           visible={visible}
-          width={600}
+          width={800}
           maskClosable={false}
           onOk={this.submit}
           onCancel={() => { this.setState({ visible: false })}}
diff --git a/src/templates/zshare/unattended/settingform/index.jsx b/src/templates/zshare/unattended/settingform/index.jsx
index 017efa0..2d44742 100644
--- a/src/templates/zshare/unattended/settingform/index.jsx
+++ b/src/templates/zshare/unattended/settingform/index.jsx
@@ -47,7 +47,7 @@
     return (
       <Form {...formItemLayout}>
         <Row gutter={24}>
-          <Col span={20}>
+          <Col span={12}>
             <Form.Item label="鏄惁鍚敤">
               {getFieldDecorator('enable', {
                 initialValue: autoMatic.enable,
@@ -59,7 +59,7 @@
               )}
             </Form.Item>
           </Col>
-          {enable === 'true' ? <Col span={20}>
+          {enable === 'true' ? <Col span={12}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="鐢ㄤ簬鑷姩鎵ц鐨勬寜閽��">
                 <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} />
@@ -81,7 +81,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {enable === 'true' ? <Col span={20}>
+          {enable === 'true' ? <Col span={12}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="鎸夐挳鎵ц鎴愬姛锛屽悗缁殑澶勭悊鏂瑰紡銆�">
                 <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} />
@@ -98,7 +98,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {enable === 'true' ? <Col span={20}>
+          {enable === 'true' ? <Col span={12}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="鎸夐挳鎵ц澶辫触鏃讹紝鍚庣画鐨勫鐞嗘柟寮忋��">
                 <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} />
@@ -108,7 +108,7 @@
               {getFieldDecorator('onFail', {
                 initialValue: autoMatic.onFail || 'stop',
               })(
-                <Radio.Group>
+                <Radio.Group style={{whiteSpace: 'nowrap'}}>
                   <Radio value="next">涓嬩竴琛�</Radio>
                   <Radio value="stay">褰撳墠琛�</Radio>
                   <Radio value="stop">鍋滄</Radio>
@@ -116,7 +116,21 @@
               )}
             </Form.Item>
           </Col> : null}
-          {enable === 'true' ? <Col span={20}>
+          {enable === 'true' ? <Col span={12}>
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="鐩搁偦涓ゆ潯鏁版嵁锛屾墽琛屾椂鐨勯棿闅旀椂闂达紝鏈�灏忎负1s銆�">
+                <Icon type="question-circle" style={{color: '#c49f47', marginRight: '3px'}} />
+                鏁版嵁闂撮殧(s)
+              </Tooltip>
+            }>
+              {getFieldDecorator('gap', {
+                initialValue: autoMatic.gap || 2,
+              })(
+                <InputNumber style={{width: '100%'}} min={1} precision={0}/>
+              )}
+            </Form.Item>
+          </Col> : null}
+          {enable === 'true' ? <Col span={12}>
             <Form.Item label="瀹屾垚鍚�">
               {getFieldDecorator('onFinish', {
                 initialValue: autoMatic.onFinish || 'over',
@@ -128,7 +142,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {enable === 'true' && onFinish === 'restart' ? <Col span={20}>
+          {enable === 'true' && onFinish === 'restart' ? <Col span={12}>
             <Form.Item label="鍚姩闂撮殧(s)">
               {getFieldDecorator('interval', {
                 initialValue: autoMatic.interval === 0 ? 0 : (autoMatic.interval || 600),
@@ -137,7 +151,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {enable === 'true' && onFinish === 'restart' ? <Col span={20}>
+          {enable === 'true' && onFinish === 'restart' ? <Col span={12}>
             <Form.Item label="閲嶅惎鏃�">
               {getFieldDecorator('restart', {
                 initialValue: autoMatic.restart || 'first',

--
Gitblit v1.8.0