Browse Source

调整转译组件代码

Lijy 1 year ago
parent
commit
089823f049

+ 15 - 5
fhKeeper/formulahousekeeper/timesheet/src/components/translationOpenData.vue

@@ -2,13 +2,13 @@
     <div class="translation">
         <!-- 文本 -->
         <template v-if="renderType[configuration.renderIndex] === 'text'">
-            <span v-if="corporateWeChat">
+            <span v-if="corporateWeChat && !noRender.includes(translationValue)">
                 <ww-open-data :type='configuration.openType' :openid='translationValue'></ww-open-data>
             </span>
-            <span v-if="dingdingPlatform">
+            <span v-else-if="dingdingPlatform && !noRender.includes(translationValue)">
                 <dt-open-data :open-type='configuration.openType' :open-id='translationValue'></dt-open-data>
             </span>
-            <span v-if="!corporateWeChat && !dingdingPlatform">{{ translationValue }}</span>
+            <span v-else>{{ translationValue }}</span>
         </template>
         <!-- 数组 -->
         <template v-if="renderType[configuration.renderIndex] === 'array'">
@@ -53,6 +53,8 @@ export default {
                 openId: '',
                 renderIndex: 0,
             }, // 配置对象
+
+            noRender: ['全部人员', '未分配']
         }
     },
     computed: {},
@@ -73,15 +75,22 @@ export default {
             const { userNameNeedTranslate, dingdingUserid } = this.user
             if (userNameNeedTranslate) {
                 this.corporateWeChat = true
-                this.dingdingPlatform = dingdingUserid ? true : false
+                if(dingdingUserid) {
+                    this.dingdingPlatform = true
+                    this.corporateWeChat = false
+                } else {
+                    this.dingdingPlatform = false
+                }
             } else {
                 this.corporateWeChat = false
                 this.dingdingPlatform = false
             }
             console.log(this.corporateWeChat, this.dingdingPlatform, this.configurationItems)
+            // console.log(this.corporateWeChat, '<=== 企业微信转译')
+            // console.log(this.dingdingPlatform, '<=== 钉钉转译')
+            this.assignmentValue(this.configurationItems)
         },
         assignmentValue(value) {
-            console.log(value)
             const { openType, openId, renderIndex = 0 } = value
             this.configuration = { openType, openId, renderIndex }
             const type = this.renderType[renderIndex]
@@ -99,6 +108,7 @@ export default {
                 default:
                     break;
             }
+            console.log(this.translationValue, '<=== 转译文本')
         }
     },
 }