Explorar o código

Merge branch 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

cfort hai 1 ano
pai
achega
8ab47f6aca
Modificáronse 1 ficheiros con 15 adicións e 3 borrados
  1. 15 3
      src/business/platform/data/templaterender/preview/index.vue

+ 15 - 3
src/business/platform/data/templaterender/preview/index.vue

@@ -22,7 +22,7 @@
             :width="width"
             :height="height"
             :dialog-height="dialogHeight"
-            :label-key="labelKey"
+            :label-key="showLabel"
             :toolbars="toolbars"
             :preview="preview"
             :temp-search="tempSearch"
@@ -43,7 +43,7 @@ import ButtonsConstants from '@/business/platform/data/constants/buttons'
 import TemplateDefault from './types/default'
 import TemplateDialog from './types/dialog'
 import TemplateValueSource from './types/value-source'
-
+import { buildLabelTitle } from '../utils'
 export default {
     components: {
         TemplateDefault,
@@ -90,7 +90,8 @@ export default {
             height: null,
             dialogHeight: null,
             toolbars: [],
-            selectedValue: this.multiple ? [] : {}
+            selectedValue: this.multiple ? [] : {},
+            showLabel: this.labelKey
         }
     },
     watch: {
@@ -100,6 +101,14 @@ export default {
             },
             immediate: true
         },
+        labelKey: {
+            handler: function (val, oldVal) {
+                if (val) {
+                    this.showLabel = val
+                }
+            },
+            immediate: true
+        },
         data: {
             handler: function (val, oldVal) {
                 this.initDataTemplate(val)
@@ -138,6 +147,9 @@ export default {
                 this.dialogHeight = h - 130 - (this.multiple ? 60 : 40) - vh
                 this.toolbars = this.handleToolbars(dialogs.buttons ? dialogs.buttons.dialog_buttons : [])
             }
+            if (this.$utils.isEmpty(this.labelKey)) {
+                this.showLabel = buildLabelTitle(dataTemplate)
+            }
         },
         handleToolbars (buttons) {
             const toolbars = []