刘洋 1 năm trước cách đây
mục cha
commit
5e04a31e9a

+ 1 - 0
package.json

@@ -27,6 +27,7 @@
     "spark-md5": "^3.0.2",
     "vue": "^2.6.12",
     "vue-awesome": "^4.1.0",
+    "vue-bus": "^1.2.1",
     "vue-router": "^3.5.1",
     "vuex": "^3.6.2"
   },

+ 2 - 0
src/main.js

@@ -2,6 +2,7 @@ import Vue from "vue";
 import App from "./App.vue";
 import router from "./router";
 import store from "./store";
+import VueBus from "vue-bus";
 // import "./registerServiceWorker";
 import "./components/registerComponents";
 import "./modules/questions/component/registerComponents";
@@ -17,6 +18,7 @@ import "@/components/svgIcon/svgIcon";
 
 import globalVuePlugins from "./plugins/globalVuePlugins";
 Vue.use(globalVuePlugins);
+Vue.use(VueBus);
 
 Vue.config.productionTip = process.env.NODE_ENV !== "production";
 

+ 1 - 0
src/modules/paper/components/AuditPaperDialog.vue

@@ -111,6 +111,7 @@ export default {
       this.$emit("modified");
       this.$message.success("操作成功!");
       this.cancel();
+      this.$bus.emit("updateBadge");
     },
   },
 };

+ 3 - 0
src/modules/portal/views/home/HomeSide.vue

@@ -247,6 +247,9 @@ export default {
     this.UPDATE_MENU_LIST(this.menuList);
     this.updatePath();
     this.getBadge();
+    this.$bus.on("updateBadge", () => {
+      this.getBadge();
+    });
   },
   methods: {
     ...mapMutations([UPDATE_CURRENT_PATHS, UPDATE_MENU_LIST, "setAuthButtons"]),

+ 1 - 0
src/modules/question/components/AuditQuestionDialog.vue

@@ -112,6 +112,7 @@ export default {
       this.$emit("modified");
       this.$message.success("操作成功!");
       this.cancel();
+      this.$bus.emit("updateBadge");
     },
   },
 };

+ 1 - 0
src/modules/questions/views/CheckDuplicateInfo.vue

@@ -206,6 +206,7 @@ export default {
             message: "操作成功",
             type: "success",
           });
+          this.$bus.emit("updateBadge");
           if (this.from == "question") {
             this.$router.push({
               path: "/questions/check_duplicate_list/0",

+ 2 - 0
src/modules/questions/views/CheckDuplicateList.vue

@@ -309,6 +309,7 @@ export default {
             type: "success",
           });
           this.searchQues();
+          this.$bus.emit("updateBadge");
         });
     },
     deleteQuestion(id) {
@@ -345,6 +346,7 @@ export default {
             type: "success",
           });
           this.searchQues();
+          this.$bus.emit("updateBadge");
         });
     },
     selectChange(row) {

+ 5 - 0
yarn.lock

@@ -7005,6 +7005,11 @@ vue-awesome@^4.1.0:
   resolved "https://registry.npmmirror.com/vue-awesome/-/vue-awesome-4.5.0.tgz#d42179335de20b53fee9bdb090498aeee1074f78"
   integrity sha512-pbtZkRecXLm3fg0eVkwObDRM9YNU1BW5wDsL4mMoSvUXZbTnS+N2E4CahAwKJL5OPbqmhJQgZPekQoJrID7dcQ==
 
+vue-bus@^1.2.1:
+  version "1.2.1"
+  resolved "https://registry.npmmirror.com/vue-bus/-/vue-bus-1.2.1.tgz#50577b0b73fc1af9cda8a475fef2f7f0fdad7045"
+  integrity sha512-uCSJEWFWoDZz+GV/Pj/wXAC7WVBLD18V62l+2ezd4UCsZWZB27Hz3K0M9WUcbNum/yKBoN+OkOCIrU6A9xqWhw==
+
 vue-cli-plugin-axios@0.0.4:
   version "0.0.4"
   resolved "https://registry.npmmirror.com/vue-cli-plugin-axios/-/vue-cli-plugin-axios-0.0.4.tgz#29d4eb48275c7fe15b92e1fd5d95fbe2a966436f"