Przeglądaj źródła

fix: 脚本添加$message兼容脚本this.$message

johnsen 5 miesięcy temu
rodzic
commit
4896235bad

+ 1 - 0
src/business/platform/data/templaterender/utils/JDialogTemplate.js

@@ -28,6 +28,7 @@ _.extend(JDialog, {
     _init: function (template) {
         if (this._isInitialization) return
         this.$template = template
+        this.$message = template.$message
         this.$vue = Vue
         this.$request = request
         this.$dialog = dialog

+ 1 - 0
src/business/platform/data/templaterender/utils/JTemplate.js

@@ -29,6 +29,7 @@ _.extend(JTemplate, {
         if (this._isInitialization) return
         this.$template = template
         this.$vue = Vue
+        this.$message = template.$message
         this.$request = request
         this.$dialog = dialog
         this.$common = common

+ 1 - 0
src/business/platform/form/utils/JForm.js

@@ -30,6 +30,7 @@ _.extend(JForm, {
         if (this._isInitialization) return
         this.$form = form
         this.$vue = Vue
+        this.$message = form.$message
         this.$request = request
         this.$dialog = dialog
         this.$common = common

+ 4 - 4
src/views/platform/message/inner/detail/dialog.vue

@@ -206,13 +206,13 @@ export default {
         acquire (res) {
             const mid = { key: 'viewDetails', label: '查看详情', type: 'danger', icon: 'ibps-icon-search' }
             if (res) {
-                const indexNum = this.toolbars.findIndex(i => i.key == mid.key)
-                if (indexNum == -1) {
+                const indexNum = this.toolbars.findIndex(i => i.key === mid.key)
+                if (indexNum === -1) {
                     this.toolbars.unshift(mid)
                 }
             } else {
-                const indexNum = this.toolbars.findIndex(i => i.key == mid.key)
-                if (indexNum != -1) {
+                const indexNum = this.toolbars.findIndex(i => i.key === mid.key)
+                if (indexNum !== -1) {
                     this.toolbars.splice(indexNum, 1)
                 }
             }