Commit 4c604d7d authored by “yiyousong”'s avatar “yiyousong”

feat:新增首页点击材料和事项预览,修改获取站点信息

parent a03c5757
...@@ -11,6 +11,29 @@ export default { ...@@ -11,6 +11,29 @@ export default {
return { return {
routeQuery: "", routeQuery: "",
devicenum: "", devicenum: "",
// serveinfo: {
// deviceInfo: {
// enabled: 1,
// productId: 1,
// productName: "排队机",
// siteCode: "",
// siteId: 2,
// siteName: "",
// source: 1,
// },
// rabbmitInfo: {
// downTopicFilter: "/down/00-F1-F5-12-3F-64",
// exchangeName: "phxt.pdj",
// host: "192.168.0.98",
// messageTtl: "86400000",
// password: "admin@2020",
// port: 5672,
// uploadTopicFilter: "/upload/00-F1-F5-12-3F-64",
// username: "taxi_mq",
// virtualHost: "/test",
// },
// serviceInfo: { homeUrl: "", serverUrl: "http://192.168.0.98:8090" },
// },
}; };
}, },
created() { created() {
...@@ -96,25 +119,30 @@ export default { ...@@ -96,25 +119,30 @@ export default {
}); });
return q; return q;
}, },
getInfo(info = {}) {
let { serveinfo, devicenum } = info;
let { deviceInfo, rabbmitInfo, serviceInfo } = serveinfo;
let { serverUrl } = serviceInfo;
let { siteId } = deviceInfo;
this.devicenum = devicenum;
local.setLocal("baseURL", serverUrl);
local.setLocal("siteId", siteId);
local.setLocal("devicenum", this.devicenum);
if (serveinfo) {
// **正式环境请打开下面内容**
rabbmitInfo && this.clientMp(rabbmitInfo);
}
},
loadconfig() { loadconfig() {
this.routeQuery = this.urlGet(); this.routeQuery = this.urlGet();
if (JSON.stringify(this.routeQuery) !== "{}") { if (JSON.stringify(this.routeQuery) !== "{}") {
let serveinfo = this.routeQuery["serveinfo"] this.getInfo(this.routeQuery);
? JSON.parse(this.UrlDecode(this.routeQuery["serveinfo"])) } else if (JSON.stringify(this.$route.query) !== "{}") {
: {}; this.getInfo(this.$route.query);
let serverUrl = } else {
this.routeQuery["serverUrl"] || "http://192.168.0.98:11078"; local.setLocal("baseURL", "http://192.168.0.98:11078");
this.devicenum = this.routeQuery["devicenum"] || "90-2B-34-BF-1B-48"; local.setLocal("siteId", 3);
if (serveinfo) { local.setLocal("devicenum", "90-2B-34-BF-1B-48");
// **正式环境请打开下面内容**
// serveinfo["rabbmitInfo"] && this.clientMp(serveinfo["rabbmitInfo"]);
if (!serveinfo["serviceInfo"]["serverUrl"]) {
serverUrl = "http://192.168.0.98:11078";
}
}
local.setLocal("baseURL", serverUrl);
// this.SET_devicenum(this.devicenum);
// this.getIndexSetinfo();
} }
}, },
}, },
...@@ -123,10 +151,11 @@ export default { ...@@ -123,10 +151,11 @@ export default {
<style lang="less"> <style lang="less">
.app { .app {
width: 1920px !important; width: 100%;
height: 1080px !important; min-height: 100%;
background-color: #f5f5f5; background-color: #f5f5f5;
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
display: flex;
} }
:root { :root {
// 标题颜色 // 标题颜色
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
> >
<div <div
class="matterDatumList-item flex flexc aic" class="matterDatumList-item flex flexc aic"
v-for="v in matterInfo.matterDatumList" v-for="(v, i) in matterInfo.matterDatumList"
:key="v.id" :key="v.id"
@click="handleWrite" @click="handleCheck(i)"
> >
<div class="pic-box"> <div class="pic-box">
<div class="pic-img-box"> <div class="pic-img-box">
...@@ -81,12 +81,13 @@ export default { ...@@ -81,12 +81,13 @@ export default {
}, },
}, },
methods: { methods: {
handleWrite() { handleCheck(index) {
this.$router.push({ this.$router.push({
path: "/showMaterials", path: "/showMaterials",
query: { query: {
matterName: this.matterInfo.matterName, matterName: this.matterInfo.matterName,
matterId: this.matterInfo.id, matterId: this.matterInfo.id,
index,
}, },
}); });
}, },
......
...@@ -98,12 +98,12 @@ ...@@ -98,12 +98,12 @@
<img v-if="i < 3" :src="checkTopImg(i)" /> <img v-if="i < 3" :src="checkTopImg(i)" />
<span v-else>{{ i + 1 }}.</span> <span v-else>{{ i + 1 }}.</span>
</div> </div>
<p class="flex1" v-ellipsis> <p class="flex1" v-ellipsis @click="checkMaterial(i, v)">
{{ v.materialName }} {{ v.materialName ? v.materialName : v.materiaFullName }}
</p> </p>
</div> </div>
</div> </div>
<div v-else class="tac mt50 empty-text">暂无数据</div> <div v-else class="tac empty-text">暂无数据</div>
</div> </div>
</div> </div>
<div class="right flex flexc aic jcb"> <div class="right flex flexc aic jcb">
...@@ -144,14 +144,14 @@ ...@@ -144,14 +144,14 @@
<img v-if="i < 3" :src="checkTopImg(i)" /> <img v-if="i < 3" :src="checkTopImg(i)" />
<span v-else>{{ i + 1 }}.</span> <span v-else>{{ i + 1 }}.</span>
</div> </div>
<p class="flex1" v-ellipsis> <p class="flex1" v-ellipsis @click="checkMatter(v)">
{{ v.matterName }} {{ v.matterName ? v.matterName : v.matterFullName }}
</p> </p>
</div> </div>
</div> </div>
</vue-seamless-scroll> </vue-seamless-scroll>
</div> </div>
<div v-else class="tac mt50 empty-text">暂无数据</div> <div v-else class="tac empty-text">暂无数据</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -177,12 +177,21 @@ ...@@ -177,12 +177,21 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 材料列表查看 -->
<MateralsList
:matterInfo="matterInfo"
:visible.sync="visible"
></MateralsList>
</div> </div>
</template> </template>
<script> <script>
import { getHomeInfo } from "@/api"; import { getHomeInfo } from "@/api";
import MateralsList from "@/components/MateralsList.vue";
export default { export default {
components: {
MateralsList,
},
data() { data() {
return { return {
search: "", search: "",
...@@ -193,6 +202,8 @@ export default { ...@@ -193,6 +202,8 @@ export default {
homeInfo: {}, // 首页数据 homeInfo: {}, // 首页数据
datumList: [], datumList: [],
matterList: [], matterList: [],
visible: false,
matterInfo: {},
}; };
}, },
computed: { computed: {
...@@ -280,6 +291,21 @@ export default { ...@@ -280,6 +291,21 @@ export default {
handleClose() { handleClose() {
this.search = ""; this.search = "";
}, },
// 查看材料列表
checkMatter(row) {
this.matterInfo = row;
this.visible = true;
},
// 查看材料
checkMaterial(index, row) {
this.$router.push({
path: "/showmaterials",
query: {
matterId: row.matterId,
index,
},
});
},
}, },
}; };
</script> </script>
...@@ -330,7 +356,7 @@ export default { ...@@ -330,7 +356,7 @@ export default {
} }
.home { .home {
width: 100%; width: 100%;
height: 100%; height: auto;
padding-top: 40px; padding-top: 40px;
background-size: 100% 100%; background-size: 100% 100%;
} }
...@@ -558,6 +584,15 @@ export default { ...@@ -558,6 +584,15 @@ export default {
border: 3px solid #ffffff; border: 3px solid #ffffff;
border-radius: 16px; border-radius: 16px;
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
position: relative;
.empty-text {
font-size: 18px;
color: #999;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.hot-matter-list { .hot-matter-list {
height: 130px; height: 130px;
padding: 0px 14px; padding: 0px 14px;
......
...@@ -11,6 +11,6 @@ export default {}; ...@@ -11,6 +11,6 @@ export default {};
<style lang="less" > <style lang="less" >
.layouts { .layouts {
width: 100%; width: 100%;
height: 100%; height: auto;
} }
</style> </style>
\ No newline at end of file
...@@ -147,6 +147,7 @@ export default { ...@@ -147,6 +147,7 @@ export default {
}; };
}); });
this.materailsList = data; this.materailsList = data;
this.active = +this.$route.query.index;
}, },
// 放大 // 放大
...@@ -172,7 +173,7 @@ export default { ...@@ -172,7 +173,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.write-page { .write-page {
width: 100%; width: 100%;
min-height: 100%; height: 100%;
background-color: #f5f5f5; background-color: #f5f5f5;
.back-home { .back-home {
font-size: 28px; font-size: 28px;
......
import Vue from "vue"; import Vue from "vue";
import VueRouter from "vue-router"; import VueRouter from "vue-router";
// import Layouts from "@/pages/layouts/Layouts.vue" import Layouts from "@/pages/layouts/Layouts.vue";
// 解决重复点击同一个路由报错 // 解决重复点击同一个路由报错
const originalPush = VueRouter.prototype.push; const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location) { VueRouter.prototype.push = function (location) {
...@@ -22,22 +22,46 @@ const routes = [ ...@@ -22,22 +22,46 @@ const routes = [
// 快速查看 // 快速查看
{ {
path: "/matterList", path: "/matterList",
component: () => import("@/pages/showpage/MatterList.vue"), component: Layouts,
children: [
{
path: "",
component: () => import("@/pages/showpage/MatterList.vue"),
},
],
}, },
// 快速搜索 // 快速搜索
{ {
path: "/searchpage", path: "/searchpage",
component: () => import("@/pages/searchpage/SearchPage.vue"), component: Layouts,
children: [
{
path: "",
component: () => import("@/pages/searchpage/SearchPage.vue"),
},
],
}, },
// 事项分类 // 事项分类
{ {
path: "/matterify", path: "/matterify",
component: () => import("@/pages/showpage/MatterIfy.vue"), component: Layouts,
children: [
{
path: "",
component: () => import("@/pages/showpage/MatterIfy.vue"),
},
],
}, },
// 材料展示 // 材料展示
{ {
path: "/showmaterials", path: "/showmaterials",
component: () => import("@/pages/showpage/ShowMaterials.vue"), component: Layouts,
children: [
{
path: "",
component: () => import("@/pages/showpage/ShowMaterials.vue"),
},
],
}, },
]; ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment