From 22f558363f391cf0d3447a68ebd82e8f67b14da7 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 25 Aug 2021 15:01:04 +0800
Subject: [PATCH] 多组件合并唯一 添加全局数据 方便维护
---
src/views/home/index.vue | 115 ++++++---------------------------------------------------
1 files changed, 13 insertions(+), 102 deletions(-)
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 420481b..69a30b7 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -24,7 +24,7 @@
v-for="(item, index) in dataCard"
:key="index"
:data="item"
- :ind="index"
+ :ind="item.type"
@open="openMain"
v-show="showCard"
></examineCard>
@@ -40,49 +40,21 @@
></i>
</span>
</Approval>
- <!-- 保安服务公司许可申请 -->
- <securityPermit class="securityPermit" :type="dataCard[0].type">
+ <cardPopup class="crossRegion" :data="dataCard">
<span slot="close">
<i class="el-icon-close ApprovalClose" @click="openClose"> </i>
</span>
- </securityPermit>
- <!-- 跨区域经营备案 -->
- <crossRegion class="crossRegion" :type="dataCard[1].type">
- <span slot="close">
- <i class="el-icon-close ApprovalClose" @click="openClose"> </i>
- </span>
- </crossRegion>
- <!-- 自招保安单位备案 -->
- <securityGuard class="securityGuard" :type="dataCard[2].type">
- <span slot="close">
- <i class="el-icon-close ApprovalClose" @click="openClose"> </i>
- </span>
- </securityGuard>
- <!-- 保安培训公司备案 -->
- <securityTraining class="securityTraining" :type="dataCard[3].type">
- <span slot="close">
- <i class="el-icon-close ApprovalClose" @click="openClose"> </i>
- </span>
- </securityTraining>
- <!-- 自招保安单位备案撤销 -->
- <cancellationOfFiling class="cancellationOfFiling" :type="dataCard[4].type">
- <span slot="close">
- <i class="el-icon-close ApprovalClose" @click="openClose"> </i>
- </span>
- </cancellationOfFiling>
+ </cardPopup>
</div>
</template>
<script>
+import { ourDatas } from "./ourDatas";
import examineCard from "@/components/examineCard/examineCard.vue"; //卡片
import Approval from "@/components/Approval/Approval.vue"; //审批进度查询
-import securityPermit from "@/components/securityPermit/securityPermit.vue"; // 保安服务公司许可申请
-import crossRegion from "@/components/crossRegion/crossRegion.vue"; // 跨区域经营备案
-import securityGuard from "@/components/securityGuard/securityGuard.vue"; // 自招保安单位备案
-import securityTraining from "@/components/securityTraining/securityTraining.vue"; // 保安培训公司备案
-import cancellationOfFiling from "@/components/cancellationOfFiling/cancellationOfFiling.vue"; // 自招保安单位备案撤销
+import cardPopup from "@/components/cardPopup/cardPopup.vue"; // 卡片弹窗
import {
- getDetail,
+ // getDetail,
getList,
getListre,
getListrek,
@@ -95,11 +67,7 @@
components: {
examineCard: examineCard,
Approval: Approval,
- securityPermit: securityPermit,
- crossRegion: crossRegion,
- securityGuard: securityGuard,
- securityTraining: securityTraining,
- cancellationOfFiling: cancellationOfFiling,
+ cardPopup: cardPopup,
},
computed: {
...mapGetters(["userInfo"]),
@@ -110,47 +78,9 @@
showCard: false,
zhezao: false,
data: [],
- dataCard: [
- {
- menuName: "保安服务公司许可申请",
- centerUrl: "/img/logo.png",
- // topUrl: "url(/img/服务许可背景图.jpg)",
- topUrl: "url(/img/login-sq1.png)",
- topUrlh: "url(/img/login-sq11.png)",
- // topUrl: "/img/服务许可背景图.jpg",
- targetUrl: "per",
- type: 0,
- },
- {
- menuName: "跨区域经营备案",
- centerUrl: "/img/logo.png",
- topUrl: "url(/img/login-sq2.png)",
- topUrlh: "url(/img/login-sq22.png)",
- type: 3,
- },
- {
- menuName: "自招保安单位备案",
- centerUrl: "/img/logo.png",
- topUrl: "url(/img/login-sq3.png)",
- topUrlh: "url(/img/login-sq33.png)",
- type: 1,
- },
- {
- menuName: "保安培训公司备案",
- centerUrl: "/img/logo.png",
- topUrl: "url(/img/login-sq4.png)",
- topUrlh: "url(/img/login-sq44.png)",
- type: 2,
- },
- {
- menuName: "自招保安单位备案撤销",
- centerUrl: "/img/logo.png",
- topUrl: "url(/img/login-sq5.png)",
- topUrlh: "url(/img/login-sq55.png)",
- type: 6,
- },
- ],
+ dataCard: [],
out: true,
+ d: [],
};
},
computed: {
@@ -164,6 +94,7 @@
total: 0,
};
this.onLoad(page);
+ this.dataCard = ourDatas;
},
methods: {
onLoad(page, params = {}) {
@@ -177,7 +108,7 @@
this.data = this.data.concat(resk.data.data.records);
getListrev(page.currentPage, page.pageSize, params).then((resv) => {
this.data = this.data.concat(resv.data.data.records);
- console.log(this.data.length);
+ console.log("已有申请数量", this.data.length);
if (this.data.length >= 1) {
// this.$store.commit("changehandle", false);
} else {
@@ -187,7 +118,7 @@
this.data.forEach((item) => {
for (const key in this.dataCard) {
if (this.dataCard[key].type == item.ptype) {
- console.log(this.dataCard[key].menuName);
+ console.log("已申请名称", this.dataCard[key].menuName);
}
}
});
@@ -226,27 +157,7 @@
this.$store.commit("doitApprovalShow", true);
return;
}
- if (val == 0) {
- //保安服务公司许可
- console.log(this.dataCard[val].menuName);
- this.$store.commit("changeuseWhere", val);
- } else if (val == 1) {
- //跨区域经营备案
- this.$store.commit("changeuseWhere", val);
- console.log(this.dataCard[val].menuName);
- } else if (val == 2) {
- //自招保安单位备案
- this.$store.commit("changeuseWhere", val);
- console.log(this.dataCard[val].menuName);
- } else if (val == 3) {
- //保安培训公司备案
- this.$store.commit("changeuseWhere", val);
- console.log(this.dataCard[val].menuName);
- } else if (val == 4) {
- //自招保安单位备案撤销
- this.$store.commit("changeuseWhere", val);
- console.log(this.dataCard[val].menuName);
- }
+ this.$store.commit("changeuseWhere", val);
},
},
};
--
Gitblit v1.9.3