cyy 5 hónapja
szülő
commit
3f41a05313

+ 78 - 49
src/business/platform/data/templaterender/utils/JDialogTemplate.js

@@ -1,98 +1,127 @@
 /**
  * 数据模版--封装自定义代码扩展接口
  */
-import _ from 'lodash'
-import Vue from 'vue'
-import request from '@/utils/request'
-import dialog from '@/utils/dialog'
-import common from '@/utils/common'
-const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-import store from '@/store'
-import router from '@/router'
+import _ from "lodash";
+import Vue from "vue";
+import request from "@/utils/request";
+import dialog from "@/utils/dialog";
+import common from "@/utils/common";
+const _import = require("@/utils/util.import." + process.env.NODE_ENV);
+import store from "@/store";
+import router from "@/router";
 
 // 定义全局
-var JDialog
+var JDialog;
 if (!window.JDialog) {
-    JDialog = window.JDialog = {}
+    JDialog = window.JDialog = {};
 } else {
-    JDialog = window.JDialog
+    JDialog = window.JDialog;
 }
 /**
-   * 封装自定义代码扩展接口
-   */
+ * 封装自定义代码扩展接口
+ */
 _.extend(JDialog, {
     // 已经初始化
     _isInitialization: false,
     _isLoadJavaScriptFile: false,
     // 初始化表单
     _init: function (template) {
-        if (this._isInitialization) return
-        this.$template = template
-        this.$vue = Vue
-        this.$request = request
-        this.$dialog = dialog
-        this.$common = common
-        this.$router = router
-        this.$store = store
-        this.$import = _import
-        this._ = _
-        this._isInitialization = true
+        if (this._isInitialization) return;
+        this.$template = template;
+        this.$message = template.$message;
+        this.$vue = Vue;
+        this.$request = request;
+        this.$dialog = dialog;
+        this.$common = common;
+        this.$router = router;
+        this.$store = store;
+        this.$import = _import;
+        this._ = _;
+        this._isInitialization = true;
     },
 
     // 页面加载
     _onLoad: function (template) {
-        this._init(template)
+        this._init(template);
         if (_.isFunction(this.onLoad)) {
-            this.onLoad(template)
+            this.onLoad(template);
         }
     },
 
     // 加载按钮
     _onLoadActions: function (template) {
         if (_.isFunction(this.onLoadActions)) {
-            this.onLoadActions(template)
+            this.onLoadActions(template);
         }
     },
     // 按钮提交前事件
-    _beforeSubmit: function (template, action, position, selection, data, callback) {
+    _beforeSubmit: function (
+        template,
+        action,
+        position,
+        selection,
+        data,
+        callback
+    ) {
         if (_.isFunction(this.beforeSubmit)) {
-            return this.beforeSubmit(template, action, position, selection, data, callback)
+            return this.beforeSubmit(
+                template,
+                action,
+                position,
+                selection,
+                data,
+                callback
+            );
         }
         if (_.isFunction(callback)) {
-            const flag = true
-            callback(flag)
+            const flag = true;
+            callback(flag);
         }
     },
 
     // 按钮提交后事件
-    _afterSubmit: function (template, action, position, selection, data, callback) {
+    _afterSubmit: function (
+        template,
+        action,
+        position,
+        selection,
+        data,
+        callback
+    ) {
         if (_.isFunction(this.afterSubmit)) {
-            return this.afterSubmit(template, action, position, selection, data, callback)
+            return this.afterSubmit(
+                template,
+                action,
+                position,
+                selection,
+                data,
+                callback
+            );
         }
         if (_.isFunction(callback)) {
-            const flag = true
-            callback(flag)
+            const flag = true;
+            callback(flag);
         }
     },
     // 单元格自定义格式
     _customFormatter: function (template, name, value, rowData, column) {
         if (_.isFunction(this.customFormatter)) {
-            return this.customFormatter(template, name, value, rowData, column)
+            return this.customFormatter(template, name, value, rowData, column);
         }
     },
     // 清理所有自定义事件
     cleanEvents: function () {
-        this.onLoad = null
-        this.onLoadActions = null
-        this.onValidate = null
-        this.afterSubButton = null
-        this.beforeSubButton = null
-        this.summaryMethod = null
-        this.afterSubmit = null
-        this.beforeSubmit = null
-        this.customFormatter = null
-        this._isInitialization = false
-    }
-})
+        this.onLoad = null;
+        this.onLoadActions = null;
+        this.onValidate = null;
+        this.afterSubButton = null;
+        this.beforeSubButton = null;
+        this.summaryMethod = null;
+        this.afterSubmit = null;
+        this.beforeSubmit = null;
+        this.customFormatter = null;
+        this._isInitialization = false;
+    },
+});
 
-export default JDialog
+export default JDialog;

+ 76 - 47
src/business/platform/data/templaterender/utils/JTemplate.js

@@ -1,21 +1,21 @@
 /**
  * 数据模版--封装自定义代码扩展接口
  */
-import _ from 'lodash'
-import Vue from 'vue'
-import request from '@/utils/request'
-import dialog from '@/utils/dialog'
-import common from '@/utils/common'
-const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-import store from '@/store'
-import router from '@/router'
+import _ from "lodash";
+import Vue from "vue";
+import request from "@/utils/request";
+import dialog from "@/utils/dialog";
+import common from "@/utils/common";
+const _import = require("@/utils/util.import." + process.env.NODE_ENV);
+import store from "@/store";
+import router from "@/router";
 
 // 定义全局
-var JTemplate
+var JTemplate;
 if (!window.JTemplate) {
-    JTemplate = window.JTemplate = {}
+    JTemplate = window.JTemplate = {};
 } else {
-    JTemplate = window.JTemplate
+    JTemplate = window.JTemplate;
 }
 /**
  * 封装自定义代码扩展接口
@@ -26,73 +26,102 @@ _.extend(JTemplate, {
     _isLoadJavaScriptFile: false,
     // 初始化表单
     _init: function (template) {
-        if (this._isInitialization) return
-        this.$template = template
-        this.$vue = Vue
-        this.$request = request
-        this.$dialog = dialog
-        this.$common = common
-        this.$router = router
-        this.$store = store
-        this.$import = _import
-        this._ = _
-        this._isInitialization = true
+        if (this._isInitialization) return;
+        this.$template = template;
+        this.$message = template.$message;
+        this.$vue = Vue;
+        this.$request = request;
+        this.$dialog = dialog;
+        this.$common = common;
+        this.$router = router;
+        this.$store = store;
+        this.$import = _import;
+        this._ = _;
+        this._isInitialization = true;
     },
 
     // 页面加载
     _onLoad: function (template) {
-        this._init(template)
+        this._init(template);
         if (_.isFunction(this.onLoad)) {
-            this.onLoad(template)
+            this.onLoad(template);
         }
     },
 
     // 加载按钮
     _onLoadActions: function (template, action, button, type, row) {
         if (_.isFunction(this.onLoadActions)) {
-            return this.onLoadActions(template, action, button, type, row)
+            return this.onLoadActions(template, action, button, type, row);
         }
     },
     // 按钮提交前事件
-    _beforeSubmit: function (template, action, position, selection, data, callback) {
+    _beforeSubmit: function (
+        template,
+        action,
+        position,
+        selection,
+        data,
+        callback
+    ) {
         if (_.isFunction(this.beforeSubmit)) {
-            return this.beforeSubmit(template, action, position, selection, data, callback)
+            return this.beforeSubmit(
+                template,
+                action,
+                position,
+                selection,
+                data,
+                callback
+            );
         }
         if (_.isFunction(callback)) {
-            const flag = true
-            callback(flag)
+            const flag = true;
+            callback(flag);
         }
     },
 
     // 按钮提交后事件
-    _afterSubmit: function (template, action, position, selection, data, callback) {
+    _afterSubmit: function (
+        template,
+        action,
+        position,
+        selection,
+        data,
+        callback
+    ) {
         if (_.isFunction(this.afterSubmit)) {
-            return this.afterSubmit(template, action, position, selection, data, callback)
+            return this.afterSubmit(
+                template,
+                action,
+                position,
+                selection,
+                data,
+                callback
+            );
         }
         if (_.isFunction(callback)) {
-            const flag = true
-            callback(flag)
+            const flag = true;
+            callback(flag);
         }
     },
     // 单元格自定义格式
     _customFormatter: function (template, name, value, rowData, column) {
         if (_.isFunction(this.customFormatter)) {
-            return this.customFormatter(template, name, value, rowData, column)
+            return this.customFormatter(template, name, value, rowData, column);
         }
     },
     // 清理所有自定义事件
     cleanEvents: function () {
-        this.onLoad = null
-        this.onLoadActions = null
-        this.onValidate = null
-        this.afterSubButton = null
-        this.beforeSubButton = null
-        this.summaryMethod = null
-        this.afterSubmit = null
-        this.beforeSubmit = null
-        this.customFormatter = null
-        this._isInitialization = false
-    }
-})
+        this.onLoad = null;
+        this.onLoadActions = null;
+        this.onValidate = null;
+        this.afterSubButton = null;
+        this.beforeSubButton = null;
+        this.summaryMethod = null;
+        this.afterSubmit = null;
+        this.beforeSubmit = null;
+        this.customFormatter = null;
+        this._isInitialization = false;
+    },
+});
 
-export default JTemplate
+export default JTemplate;

+ 65 - 52
src/business/platform/form/utils/JForm.js

@@ -1,22 +1,22 @@
 /**
  * 表单--封装自定义代码扩展接口
  */
-import _ from 'lodash'
-import Vue from 'vue'
-import request from '@/utils/request'
-import dialog from '@/utils/dialog'
-import common from '@/utils/common'
-import sealApi from '@/utils/seal'
-const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-import store from '@/store'
-import router from '@/router'
+import _ from "lodash";
+import Vue from "vue";
+import request from "@/utils/request";
+import dialog from "@/utils/dialog";
+import common from "@/utils/common";
+import sealApi from "@/utils/seal";
+const _import = require("@/utils/util.import." + process.env.NODE_ENV);
+import store from "@/store";
+import router from "@/router";
 
 // 定义全局
-var JForm
+var JForm;
 if (!window.JForm) {
-    JForm = window.JForm = {}
+    JForm = window.JForm = {};
 } else {
-    JForm = window.JForm
+    JForm = window.JForm;
 }
 /**
  * 封装自定义代码扩展接口
@@ -27,43 +27,44 @@ _.extend(JForm, {
     _isLoadJavaScriptFile: false,
     // 初始化表单
     _init: function (form) {
-        if (this._isInitialization) return
-        this.$form = form
-        this.$vue = Vue
-        this.$request = request
-        this.$dialog = dialog
-        this.$common = common
-        this.$sealApi = sealApi
-        this.$router = router
-        this.$store = store
-        this.$import = _import
-        this._ = _
-        this._isInitialization = true
-        this.$loading = Vue.prototype.$loading
+        if (this._isInitialization) return;
+        this.$form = form;
+        this.$vue = Vue;
+        this.$message = form.$message;
+        this.$request = request;
+        this.$dialog = dialog;
+        this.$common = common;
+        this.$sealApi = sealApi;
+        this.$router = router;
+        this.$store = store;
+        this.$import = _import;
+        this._ = _;
+        this._isInitialization = true;
+        this.$loading = Vue.prototype.$loading;
     },
 
     // 表单加载
     _onLoad: function (form) {
-        this._init(form)
+        this._init(form);
         if (_.isFunction(this.onLoad)) {
-            this.onLoad(form)
+            this.onLoad(form);
         }
     },
 
     // 加载按钮
     _onLoadActions: function (form, action, button, type) {
         if (_.isFunction(this.onLoadActions)) {
-            return this.onLoadActions(form, action, button, type)
+            return this.onLoadActions(form, action, button, type);
         }
     },
 
     // 表单校验
     _onValidate: function (form, callback) {
         if (_.isFunction(this.onValidate)) {
-            return this.onValidate(form, callback)
+            return this.onValidate(form, callback);
         }
         if (_.isFunction(callback)) {
-            callback(true)
+            callback(true);
         }
     },
 
@@ -71,61 +72,73 @@ _.extend(JForm, {
     _beforeSubmit: function (form, action, postValue, callback) {
         if (_.isFunction(this.beforeSubmit)) {
             try {
-                return this.beforeSubmit(form, action, postValue, callback)
+                return this.beforeSubmit(form, action, postValue, callback);
             } catch (e) {
-                return callback(true)
+                return callback(true);
             }
         }
         if (_.isFunction(callback)) {
-            callback(true)
+            callback(true);
         }
     },
 
     // 按钮提交后事件
     _afterSubmit: function (form, action, postValue, callback) {
         if (_.isFunction(this.afterSubmit)) {
-            return this.afterSubmit(form, action, postValue, callback)
+            return this.afterSubmit(form, action, postValue, callback);
         }
         if (_.isFunction(callback)) {
-            callback(true)
+            callback(true);
         }
     },
     // 子表按钮的提交前事件
     _beforeSubButton: function (tableForm, action, position, params, callback) {
         if (_.isFunction(this.beforeSubButton)) {
-            return this.beforeSubButton(tableForm, action, position, params, callback)
+            return this.beforeSubButton(
+                tableForm,
+                action,
+                position,
+                params,
+                callback
+            );
         }
         if (_.isFunction(callback)) {
-            callback(true)
+            callback(true);
         }
     },
     // 子表按钮的提交后事件
     _afterSubButton: function (tableForm, action, position, params, callback) {
         if (_.isFunction(this.afterSubButton)) {
-            return this.afterSubButton(tableForm, action, position, params, callback)
+            return this.afterSubButton(
+                tableForm,
+                action,
+                position,
+                params,
+                callback
+            );
         }
         if (_.isFunction(callback)) {
-            callback(true)
+            callback(true);
         }
     },
     // 子表统计
     _summaryMethod: function (tableForm, tableName, params) {
         if (_.isFunction(this.summaryMethod)) {
-            return this.summaryMethod(tableForm, tableName, params)
+            return this.summaryMethod(tableForm, tableName, params);
         }
     },
     // 清理所有自定义事件
     cleanEvents: function () {
-        this.onLoad = null
-        this.onLoadActions = null
-        this.onValidate = null
-        this.afterSubButton = null
-        this.beforeSubButton = null
-        this.summaryMethod = null
-        this.afterSubmit = null
-        this.beforeSubmit = null
-        this._isInitialization = false
-    }
-})
+        this.onLoad = null;
+        this.onLoadActions = null;
+        this.onValidate = null;
+        this.afterSubButton = null;
+        this.beforeSubButton = null;
+        this.summaryMethod = null;
+        this.afterSubmit = null;
+        this.beforeSubmit = null;
+        this._isInitialization = false;
+    },
+});
 
-export default JForm
+export default JForm;

+ 9 - 1
src/views/component/fileTraining/index.vue

@@ -103,7 +103,8 @@
                                 <el-tooltip
                                     class="itemStyle"
                                     effect="dark"
-                                    placement="right-end"
+                                    popper-class="tooltip-max-width"
+                                    placement="right"
                                     :content="showContent(activity, index)"
                                 >
                                     <div>
@@ -751,6 +752,13 @@ export default {
 }
 </script>
 <style lang="scss">
+.tooltip-max-width {
+  max-width: 1200px !important; /* 固定最大宽度800px */
+  width: max-content; /* 内容不足时自适应宽度,不占满800px */
+  white-space: pre-wrap; /* 超长内容自动换行,避免横向溢出 */
+  word-break: break-all; /* 英文/数字超长时强制换行 */
+  padding: 8px 12px; /* 可选:调整内边距,优化排版 */
+}
 .ibps-file-preview-dialog {
     width: 80%;
     z-index: 99999;

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

@@ -192,10 +192,13 @@ export default {
                         this.$common.request('add', returnParams).then(() => { console.log('确认接收到发放文件') }).then(() => {
                             this.type = ''
                             this.getFormData()
+                            this.closeDialog()
                         })
+                    } else {
+                        this.closeDialog()
                     }
                 })
-                this.closeDialog()
+                // this.closeDialog()
             }).catch(() => { })
         },
         handleCallback (res) {