Эх сурвалжийг харах

Merge branch 'master' into feature/v1.5.20

123456 2 жил өмнө
parent
commit
36c7c90e50

+ 12 - 4
src/components/work-desktop/Transfer.vue

@@ -6,7 +6,7 @@
     @left-check-change="leftChange"
     @change="onChange"
     :data="transferData">
-  </el-transfer>
+    </el-transfer>
   </div>
 </template>
 
@@ -58,9 +58,13 @@ export default {
   },
   methods: {
     allData () {
-      const allData = JSON.parse(JSON.stringify(this.left))
+      const allData = JSON.parse(JSON.stringify(this.left)).map(s => {
+        return Object.assign(s, {
+          name: s.name.replace('<br>', ' ')
+        })
+      })
       const rightData = JSON.parse(JSON.stringify(this.right)).map(s => {
-        return s.name.replace('<br>', '')
+        return s.name.replace('<br>', ' ')
       })
       // console.log(rightData)
       const data = []
@@ -85,7 +89,7 @@ export default {
     rightData () {
       const data = []
       JSON.parse(JSON.stringify(this.right)).forEach(v => {
-        v.name = v.name.replace('<br>', '')
+        v.name = v.name.replace('<br>', ' ')
         this.transferData.forEach(s => {
           if (v.name === s.label) {
             data.push(s.key)
@@ -174,6 +178,7 @@ export default {
       padding: 0 20px;
     }
     .el-transfer__button{
+      display: block;
       padding: 0 16px;
       height: 30px;
       border: 1px solid #2CB7CA;
@@ -181,6 +186,9 @@ export default {
       border-radius: 4px;
       background: #EAF8FA;
       color: #2CB7CA;
+      & + .el-transfer__button {
+        margin-left: 0;
+      }
     }
     .el-transfer__button.is-disabled,
     .el-transfer__button.is-disabled:hover{

+ 1 - 2
src/store/workspace/common-use.js

@@ -20,7 +20,7 @@ export default {
   namespaced: true,
   state: () => ({
     platform: 'PC',
-    maxCount: 8,
+    maxCount: Infinity,
     dialogShow: false,
     menuInfoList: [], // 请求回来的原始数组
     allFunctionsContainsUsable: [], // 全部功能,包含可用的和不可用的(扁平化后)
@@ -129,7 +129,6 @@ export default {
           platform: state.platform
         })
         if (code === 0 && data) {
-          console.log(data)
           commit('setCommonList', data)
         } else {
           commit('setCommonList', [])

+ 50 - 2
src/views/workspace/components/CommonUse.vue

@@ -32,7 +32,7 @@
         <div class="transfer-content">
           <Transfer :maxCount="maxCount" submitKey="id" :left="allFunctions" :right="transferCommonList" @onSave="onTransferSave"></Transfer>
         </div>
-        <p class="more-tips">最多可选择 <em style="color:#2CB7CA;">{{ maxCount }}</em> 个常用功能</p>
+        <!-- <p class="more-tips">最多可选择 <em style="color:#2CB7CA;">{{ maxCount }}</em> 个常用功能</p> -->
       </SelectorCard>
     </el-dialog>
   </WorkspaceCard>
@@ -103,7 +103,54 @@ export default {
           }
         })
       } else {
-        this.showNoPowerMessageTip()
+        // 判断是否需要自定义弹窗文案
+        const hasTipInfo = Object.keys(item?.tipInfo || {}).length > 0
+        if (hasTipInfo) {
+          // 自定义弹窗文案
+          const menu = item
+          // 格式化弹窗配置信息
+          const dialogParams = {
+            type: 'tip',
+            title: menu.tipInfo?.title,
+            message: menu.tipInfo?.content,
+            options: Object.assign({
+              dangerouslyUseHTMLString: true,
+              customClass: 'custom-message-box',
+              confirmButtonText: '我知道了',
+              confirmButtonClass: 'custom-confirm-btn',
+              showClose: false,
+              showCancelButton: false,
+              closeOnClickModal: false,
+              center: true
+            }, {
+              showCancelButton: menu.tipInfo?.isShowCancel,
+              confirmButtonText: menu.tipInfo?.confirmText
+            }, menu.tipInfo?.options || {})
+          }
+          this.$confirm(dialogParams.message, dialogParams.title, dialogParams.options).then(() => {
+            // 确认按钮自定义跳转
+            if (menu.tipInfo?.confirmUrl) {
+              // 调用工作桌面函数跳转
+              tryCallHooks({
+                fn: () => {
+                  this.$BRACE.methods.open({
+                    route: {
+                      link: menu.tipInfo?.confirmUrl,
+                      appType: menu.tipInfo?.appType,
+                      openType: menu.tipInfo?.openType
+                    }
+                  })
+                },
+                spareFn: () => {
+                  window.open(menu.tipInfo?.confirmUrl)
+                }
+              })
+            }
+          }).catch(e => e)
+        } else {
+          // 默认文案
+          this.showNoPowerMessageTip()
+        }
       }
     },
     confirmSaveFn () {
@@ -196,6 +243,7 @@ $main: #2cb7ca;
 .common-lists{
   padding: 0 20px;
   display: flex;
+  flex-wrap: wrap;
   .list-item,
   .list-add{
     width: 120px;