|
@@ -1,51 +1,51 @@
|
|
-import { queryAllToOrgan } from "../../api/dashboard";
|
|
|
|
-const loadings = {};
|
|
|
|
-// const filterOrganId = [
|
|
|
|
-// 36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 55, 56,
|
|
|
|
-// ];
|
|
|
|
-const filterOrganId = [
|
|
|
|
- 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26,
|
|
|
|
- 27, 28, 34, 37, 40, 71, 72, 124, 125,
|
|
|
|
-];
|
|
|
|
-const state = {
|
|
|
|
- allBranch: [],
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-const mutations = {
|
|
|
|
- commit_all_branch: (state, allBranch) => {
|
|
|
|
- state.allBranch = allBranch;
|
|
|
|
- },
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-const actions = {
|
|
|
|
- async setAllBranch({ commit, state }, force) {
|
|
|
|
- if (
|
|
|
|
- (!state.allBranch.length || force === true) &&
|
|
|
|
- !loadings.commit_all_branch
|
|
|
|
- ) {
|
|
|
|
- loadings.commit_all_branch = await queryAllToOrgan();
|
|
|
|
- try {
|
|
|
|
- const res = await loadings.commit_all_branch;
|
|
|
|
- const result = res.data;
|
|
|
|
- let tempOrgan = [];
|
|
|
|
- // 过滤不会显示的分部
|
|
|
|
- result.forEach((item) => {
|
|
|
|
- if (filterOrganId.includes(item.id)) {
|
|
|
|
- tempOrgan.push(item);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- commit("commit_all_branch", tempOrgan);
|
|
|
|
- } catch (error) {
|
|
|
|
- //
|
|
|
|
- }
|
|
|
|
- loadings.commit_all_branch = false;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-export default {
|
|
|
|
- namespaced: true,
|
|
|
|
- state,
|
|
|
|
- mutations,
|
|
|
|
- actions,
|
|
|
|
-};
|
|
|
|
|
|
+import { queryAllToOrgan } from "../../api/dashboard";
|
|
|
|
+const loadings = {};
|
|
|
|
+// const filterOrganId = [
|
|
|
|
+// 36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 55, 56,
|
|
|
|
+// ];
|
|
|
|
+const filterOrganId = [
|
|
|
|
+ 1, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25,
|
|
|
|
+ 26, 27, 28, 34, 37, 40, 71, 72, 124, 125,
|
|
|
|
+];
|
|
|
|
+const state = {
|
|
|
|
+ allBranch: [],
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const mutations = {
|
|
|
|
+ commit_all_branch: (state, allBranch) => {
|
|
|
|
+ state.allBranch = allBranch;
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const actions = {
|
|
|
|
+ async setAllBranch({ commit, state }, force) {
|
|
|
|
+ if (
|
|
|
|
+ (!state.allBranch.length || force === true) &&
|
|
|
|
+ !loadings.commit_all_branch
|
|
|
|
+ ) {
|
|
|
|
+ loadings.commit_all_branch = await queryAllToOrgan();
|
|
|
|
+ try {
|
|
|
|
+ const res = await loadings.commit_all_branch;
|
|
|
|
+ const result = res.data;
|
|
|
|
+ let tempOrgan = [];
|
|
|
|
+ // 过滤不会显示的分部
|
|
|
|
+ result.forEach((item) => {
|
|
|
|
+ if (filterOrganId.includes(item.id)) {
|
|
|
|
+ tempOrgan.push(item);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ commit("commit_all_branch", tempOrgan);
|
|
|
|
+ } catch (error) {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+ loadings.commit_all_branch = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ namespaced: true,
|
|
|
|
+ state,
|
|
|
|
+ mutations,
|
|
|
|
+ actions,
|
|
|
|
+};
|