pkuclay 发表于 2021-4-26 15:23:53

处理待办流程后自动刷新首页,待办列表

在这个文件中修改servers/webServer/o2_core/o2/xDesktop/$all.min.js
备份源文件,下载并重新格式化文件,大约在8369行 close 函数中添加下列代码,懂js优化的同学位置可以稍微调整,然后再重新压缩js文件,覆盖上传。
close: function (hasTaskitem) {
      if (this.inBrowser) {
          this.desktop.refreshApp(this.desktop.appCurrentList); // 刷新首页即第一个tab
            window.open("", "_self").close();
            window.close();
      } else {
            this.fireAppEvent("queryClose");
            this.setUncurrent();
            this.window.close(function () {
                if (!hasTaskitem) this.taskitem.destroy();
                this.window = null;
                this.taskitem = null;
                if (this.resizeFun) layout.desktop.removeEvent("resize", this.resizeFun);
                this.desktop.refreshApp(this.desktop.appCurrentList); // 刷新首页即第一个tab
            
                this.desktop.closeApp(this, hasTaskitem);
                this.fireAppEvent("postClose");
               
                o2.release(this);
            }.bind(this));
      }
    },

论坛管理员 发表于 2021-4-27 09:57:34

有类似需求的人可以参考!

lin 发表于 2021-7-13 18:26:24

好的,谢谢管理员大大。

c296251630 发表于 2024-3-13 17:58:05

新的解决方法是在关闭页面时执行:
console.log(this.form.getDesktop());
this.form.getDesktop().refreshApp(this.form.getDesktop().appCurrentList);

百川123 发表于 2024-4-23 19:58:57

c296251630 发表于 2024-3-13 17:58
新的解决方法是在关闭页面时执行:
console.log(this.form.getDesktop());
this.form.getDesktop().refresh ...

这个代码写在每个表单中的afterclose中吗?

c296251630 发表于 2024-5-7 16:33:20

百川123 发表于 2024-4-23 19:58
这个代码写在每个表单中的afterclose中吗?

是的,也可以写在自己的脚本

zeng 发表于 2024-7-2 18:54:17

c296251630 发表于 2024-5-7 16:33
是的,也可以写在自己的脚本
但是这样的话我在流程管理那里新建然后关闭就又自动到首页了

页: [1]
查看完整版本: 处理待办流程后自动刷新首页,待办列表