From 69070570c9b5c4f1c5ca38eaf052f1a72e5fd888 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 09 六月 2022 00:54:06 +0800
Subject: [PATCH] 2022-06-09

---
 src/menu/components/form/formaction/formconfig.jsx             |   13 ++----
 src/menu/components/card/cardsimplecomponent/options.jsx       |   48 ++++++++++++------------
 src/menu/components/share/actioncomponent/actionform/index.jsx |    6 +-
 src/menu/components/share/actioncomponent/formconfig.jsx       |   13 ++----
 src/menu/components/form/formaction/actionform/index.jsx       |   28 +++++++++++---
 src/menu/components/card/cardcomponent/options.jsx             |    6 +-
 6 files changed, 62 insertions(+), 52 deletions(-)

diff --git a/src/menu/components/card/cardcomponent/options.jsx b/src/menu/components/card/cardcomponent/options.jsx
index dfbcf7c..d36487f 100644
--- a/src/menu/components/card/cardcomponent/options.jsx
+++ b/src/menu/components/card/cardcomponent/options.jsx
@@ -154,10 +154,10 @@
       initval: setting.open || 'blank',
       required: false,
       options: [
-        {value: 'blank', label: '鏂扮獥鍙�'},
-        {value: 'self', label: '褰撳墠绐楀彛'},
+        {value: 'blank', label: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'},
+        {value: 'self', label: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'},
       ],
-      forbid: appType !== 'pc'
+      forbid: appType !== 'pc' && appType !== 'mob'
     },
     {
       type: 'radio',
diff --git a/src/menu/components/card/cardsimplecomponent/options.jsx b/src/menu/components/card/cardsimplecomponent/options.jsx
index f013902..7b397d1 100644
--- a/src/menu/components/card/cardsimplecomponent/options.jsx
+++ b/src/menu/components/card/cardsimplecomponent/options.jsx
@@ -111,6 +111,18 @@
       ],
     },
     {
+      type: 'radio',
+      field: 'open',
+      label: '鎵撳紑鏂瑰紡',
+      initval: setting.open || 'blank',
+      required: false,
+      options: [
+        {value: 'blank', label: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'},
+        {value: 'self', label: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'},
+      ],
+      forbid: appType !== 'pc' && appType !== 'mob'
+    },
+    {
       type: appType ? 'select' : 'cascader',
       field: 'menu',
       label: '鍏宠仈鑿滃崟',
@@ -127,18 +139,6 @@
       required: true,
       options: [],
       span: 24
-    },
-    {
-      type: 'radio',
-      field: 'open',
-      label: '鎵撳紑鏂瑰紡',
-      initval: setting.open || 'blank',
-      required: false,
-      options: [
-        {value: 'blank', label: '鏂扮獥鍙�'},
-        {value: 'self', label: '褰撳墠绐楀彛'},
-      ],
-      forbid: appType !== 'pc'
     },
     {
       type: 'select',
@@ -236,25 +236,16 @@
       options: appType ? appmenulist : menulist,
     },
     {
-      type: 'textarea',
-      field: 'linkurl',
-      label: '閾炬帴',
-      initval: setting.linkurl || '',
-      required: true,
-      options: [],
-      span: 24
-    },
-    {
       type: 'radio',
       field: 'open',
       label: '鎵撳紑鏂瑰紡',
       initval: setting.open || 'blank',
       required: false,
       options: [
-        {value: 'blank', label: '鏂扮獥鍙�'},
-        {value: 'self', label: '褰撳墠绐楀彛'},
+        {value: 'blank', label: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'},
+        {value: 'self', label: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'},
       ],
-      forbid: appType !== 'pc'
+      forbid: appType !== 'pc' && appType !== 'mob'
     },
     {
       type: 'radio',
@@ -267,6 +258,15 @@
         {value: 'false', label: '鍚�'},
       ],
     },
+    {
+      type: 'textarea',
+      field: 'linkurl',
+      label: '閾炬帴',
+      initval: setting.linkurl || '',
+      required: true,
+      options: [],
+      span: 24
+    },
   ]
 
   return cardSettingForm
diff --git a/src/menu/components/form/formaction/actionform/index.jsx b/src/menu/components/form/formaction/actionform/index.jsx
index 8021155..3dc6914 100644
--- a/src/menu/components/form/formaction/actionform/index.jsx
+++ b/src/menu/components/form/formaction/actionform/index.jsx
@@ -21,6 +21,7 @@
     formlist: null,  // 琛ㄥ崟淇℃伅
     interType: null, // 鎺ュ彛绫诲瀷锛氬唴閮ㄣ�佸閮�
     procMode: null,  // 鍙傛暟鏂瑰紡
+    linkmenu: null
   }
 
   
@@ -30,11 +31,12 @@
     let _intertype = card.intertype || 'system'  // 鎺ュ彛绫诲瀷
     let _procMode = card.procMode || 'system'    // 鍙傛暟璇锋眰鏂瑰紡
 
-    let _options = this.getOptions(_intertype, _procMode)
+    let _options = this.getOptions(_intertype, _procMode, card.linkmenu)
 
     this.setState({
       interType: _intertype,
       procMode: _procMode,
+      linkmenu: card.linkmenu,
       formlist: this.props.formlist.map(item => {
         if (item.key === 'innerFunc' && _procMode === 'inner') {
           item.required = true
@@ -46,7 +48,7 @@
     })
   }
 
-  getOptions = (_intertype, _procMode) => {
+  getOptions = (_intertype, _procMode, linkmenu) => {
     const { card } = this.props
 
     if (card.type === 'prev') {
@@ -54,7 +56,7 @@
     } else if (card.type === 'next') {
       return ['type', 'label', 'enable']
     }
-    let _options = ['type', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'open', 'enable', 'output', 'reload'] // 閫夐」鍒楄〃
+    let _options = ['type', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'enable', 'output', 'reload'] // 閫夐」鍒楄〃
     
     if (_intertype === 'custom') {
       _options.pop()
@@ -71,6 +73,10 @@
     } else {
       _options.push('sql', 'sqlType')
     }
+    
+    if (linkmenu && linkmenu !== 'goback') {
+      _options.push('open')
+    }
 
     return _options
   }
@@ -82,10 +88,10 @@
    * 3銆佸垏鎹㈡爣绛剧被鍨嬶紝閲嶇疆鍙�夋爣绛�
    */
   optionChange = (key, value) => {
-    const { procMode } = this.state
+    const { procMode, linkmenu } = this.state
 
     if (key === 'intertype') {
-      let _options = this.getOptions(value, procMode)
+      let _options = this.getOptions(value, procMode, linkmenu)
 
       this.setState({
         interType: value,
@@ -101,7 +107,7 @@
         })
       })
     } else if (key === 'procMode') {
-      let _options = this.getOptions(this.state.interType, value)
+      let _options = this.getOptions(this.state.interType, value, linkmenu)
 
       this.setState({
         procMode: value,
@@ -114,6 +120,16 @@
           return item
         })
       })
+    } else if (key === 'linkmenu') {
+      let _options = this.getOptions(this.state.interType, procMode, value)
+
+      this.setState({
+        linkmenu: value,
+        formlist: this.state.formlist.map(item => {
+          item.hidden = !_options.includes(item.key)
+          return item
+        })
+      })
     } else if (key === 'sysInterface') {
       if (value === 'true') {
         this.props.form.setFieldsValue({
diff --git a/src/menu/components/form/formaction/formconfig.jsx b/src/menu/components/form/formaction/formconfig.jsx
index 52525a1..4fbab1a 100644
--- a/src/menu/components/form/formaction/formconfig.jsx
+++ b/src/menu/components/form/formaction/formconfig.jsx
@@ -297,14 +297,11 @@
       label: '鎵撳紑鏂瑰紡',
       initVal: card.open || 'blank',
       required: false,
-      forbid: appType !== 'pc',
-      options: [{
-        value: 'blank',
-        text: '鏂扮獥鍙�'
-      }, {
-        value: 'self',
-        text: '褰撳墠绐楀彛'
-      }]
+      forbid: appType !== 'pc' && appType !== 'mob',
+      options: [
+        {value: 'blank', text: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'},
+        {value: 'self', text: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'},
+      ]
     },
     {
       type: 'cascader',
diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx
index 497d406..f654b14 100644
--- a/src/menu/components/share/actioncomponent/actionform/index.jsx
+++ b/src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -18,7 +18,7 @@
   excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'pagination', 'search', 'width', 'hidden'],
   popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'width', 'display', 'ratio', 'syncComponent', 'clickouter', 'hidden'],
   tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden'],
-  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'open', 'hidden'],
+  innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'],
   funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'],
   form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'width', 'refreshTab', 'title', 'hidden']
 }
@@ -318,9 +318,9 @@
       reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value))
 
       if (this.record.pageTemplate === 'custom') {
-        shows.push('url', 'joint')
+        shows.push('url', 'joint', 'open')
       } else if (this.record.pageTemplate === 'linkpage') {
-        shows.push('linkmenu')
+        shows.push('linkmenu', 'open')
 
         if (Ot === 'requiredSgl') {
           shows.push('joint')
diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index 7146b69..6c9251e 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -724,16 +724,13 @@
       key: 'open',
       label: '鎵撳紑鏂瑰紡',
       initVal: card.open || 'blank',
-      tooltip: '鑿滃崟鎵撳紑鏂瑰紡銆傛敞锛氱Щ鍔ㄧ鍙湪灏忕▼搴忔垨app涓湁鏁堛��',
+      tooltip: '鑿滃崟鎵撳紑鏂瑰紡銆�',
       required: true,
       forbid: appType !== 'pc' && appType !== 'mob',
-      options: [{
-        value: 'blank',
-        text: '鏂扮獥鍙�'
-      }, {
-        value: 'self',
-        text: '褰撳墠绐楀彛'
-      }]
+      options: [
+        {value: 'blank', text: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'},
+        {value: 'self', text: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'},
+      ]
     },
     {
       type: 'radio',

--
Gitblit v1.8.0