Commit 4fd9ebea authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents a3a631aa 1d0ee3f6
#开发环境 #开发环境
NODE_ENV = "development" NODE_ENV = "development"
VUE_APP_API_BASE_URL=http://192.168.0.98:8090 VUE_APP_API_BASE_URL=http://192.168.0.98:8090
VUE_APP_API_PHP_URL=http://192.168.0.98:8090
#VUE_APP_API_BASE_URL=http://192.168.0.98:11071/zwfw #VUE_APP_API_BASE_URL=http://192.168.0.98:11071/zwfw
#VUE_APP_API_BASE_URL=http://192.168.0.98:11023 #VUE_APP_API_BASE_URL=http://192.168.0.98:11023
#VUE_APP_API_BASE_URL=http://192.168.0.217:17311 #VUE_APP_API_BASE_URL=http://192.168.0.217:17311
\ No newline at end of file
#生产环境 #生产环境
NODE_ENV = "production" NODE_ENV = "production"
VUE_APP_API_BASE_URL=/basics_api VUE_APP_API_PHP_URL=/zwfw_api/
...@@ -2,19 +2,22 @@ ...@@ -2,19 +2,22 @@
<div class="app"> <div class="app">
<router-view></router-view> <router-view></router-view>
<NetworkError :isShowError="isShowError"></NetworkError> <NetworkError :isShowError="isShowError"></NetworkError>
<EnabledDev :enabled="enabled"></EnabledDev>
</div> </div>
</template> </template>
<script> <script>
import local from "@/utils/local"; import local from "@/utils/local";
import NetworkError from "@/components/NetworkError.vue"; import NetworkError from "@/components/NetworkError.vue";
import EnabledDev from "@/components/EnabledDev.vue";
import mq from "@/mixin/mq"; import mq from "@/mixin/mq";
import { getHomeInfo, getSkinList } from "@/api"; import { getHomeInfo, getSkinList, getDeviceList } from "@/api";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
export default { export default {
mixins: [mq], mixins: [mq],
components: { components: {
NetworkError, NetworkError,
EnabledDev,
}, },
data() { data() {
return { return {
...@@ -22,10 +25,12 @@ export default { ...@@ -22,10 +25,12 @@ export default {
devicenum: "", devicenum: "",
linkDom: null, // 换皮 linkDom: null, // 换皮
isShowError: false, isShowError: false,
enabled: 1,
}; };
}, },
watch: { watch: {
"$route.path"(newVal) { "$route.path"(newVal) {
this.getDeviceList();
if (newVal == "/" || newVal == "/home") { if (newVal == "/" || newVal == "/home") {
this.getHomeInfo(); this.getHomeInfo();
this.getSetinfo(); this.getSetinfo();
...@@ -59,7 +64,7 @@ export default { ...@@ -59,7 +64,7 @@ export default {
}, },
serviceInfo: { serviceInfo: {
homeUrl: "http://192.168.0.24:8080/#/", homeUrl: "http://192.168.0.24:8080/#/",
serverUrl: "http://192.168.0.98:11078/", serverUrl: "http://112.19.80.237:11078/",
}, },
devicenum: "18-93-7F-C0-AD-B5", devicenum: "18-93-7F-C0-AD-B5",
// devicenum: "B8-13-32-86-9F-04", // devicenum: "B8-13-32-86-9F-04",
...@@ -79,6 +84,7 @@ export default { ...@@ -79,6 +84,7 @@ export default {
window.addEventListener("offline", () => { window.addEventListener("offline", () => {
this.isShowError = true; this.isShowError = true;
}); });
this.getDevInfo();
}, },
methods: { methods: {
...mapMutations([ ...mapMutations([
...@@ -148,6 +154,24 @@ export default { ...@@ -148,6 +154,24 @@ export default {
} }
} }
}, },
async getDeviceList() {
let res = await getDeviceList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
if (!data.length) return;
let { enabled } = data[0];
this.enabled = enabled;
}
},
// 轮询设备状态
getDevInfo() {
this.timer = setInterval(() => {
this.getDeviceList();
}, 1000 * 60);
},
}, },
}; };
</script> </script>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import local from "@/utils/local"; import local from "@/utils/local";
import request from "@/utils/request"; import request from "@/utils/request";
import store from "@/store"; import store from "@/store";
let PHP_URL = process.env.VUE_APP_API_PHP_URL;
// 首页数据展示 // 首页数据展示
export const getHomeInfo = (data) => { export const getHomeInfo = (data) => {
let baseUrl = local.getLocal("serverUrl"); let baseUrl = local.getLocal("serverUrl");
...@@ -114,3 +115,25 @@ export const getSkinList = (data) => { ...@@ -114,3 +115,25 @@ export const getSkinList = (data) => {
data, data,
}); });
}; };
// 排队编号查询对应事项
export const getMatterForFlownum = (params) => {
// let baseUrl = local.getLocal("serverUrl");
return request({
url: `${PHP_URL}api/matter/matterForFlownum`,
method: "get",
params,
});
};
//获取设备列表
export const getDeviceList = (data) => {
let baseUrl = local.getLocal("serverUrl");
let deviceCode = local.getLocal("devicenum");
return request({
url: `${baseUrl}sampleform/device/list`,
method: "post",
data: {
deviceCode,
...data,
},
});
};
<template>
<div class="enabled" v-show="!enabled">
<div class="enabled_box">
<img class="enabled_img" src="../assets/img/tingyong.png" />
</div>
</div>
</template>
<script>
export default {
props: {
enabled: {
type: Number,
required: true,
default: 1,
},
},
};
</script>
<style lang="less" scoped>
.enabled {
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.2);
position: fixed;
top: 0px;
left: 0px;
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
.enabled_box {
width: 400px;
height: 400px;
background-color: #fff;
border-radius: 4px;
.enabled_img {
width: 100%;
height: 100%;
}
}
}
</style>
\ No newline at end of file
<template> <template>
<div class="header flex aic jcc main-title-bg-img"> <div class="header flex aic jcc main-title-bg-img">
<div class="count-down">
系统将在 <span>{{ times }}</span> 秒后返回首页
</div>
<slot name="title" class="title"> <slot name="title" class="title">
<div></div> <div></div>
</slot> </slot>
...@@ -13,10 +16,14 @@ ...@@ -13,10 +16,14 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
export default { export default {
data() { data() {
return {}; return {};
}, },
computed: {
...mapGetters(["times"]),
},
created() {}, created() {},
methods: { methods: {
handleBack() { handleBack() {
...@@ -37,6 +44,16 @@ export default { ...@@ -37,6 +44,16 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
// background: var(--main-theme-color); // background: var(--main-theme-color);
box-shadow: 0px 2px 6px 6px #ccc; box-shadow: 0px 2px 6px 6px #ccc;
.count-down {
position: absolute;
left: 40px;
// color: var(--main-h1-color);
color: #fff;
font-size: 24px;
// span {
// color: var(--main-theme-color);
// }
}
.right-box { .right-box {
position: absolute; position: absolute;
right: 40px; right: 40px;
......
...@@ -5,21 +5,29 @@ ...@@ -5,21 +5,29 @@
</template> </template>
<script> <script>
import { mapMutations, mapGetters } from "vuex";
export default { export default {
data() { data() {
return {}; return {};
}, },
computed: {
...mapGetters(["times", "defaultTimes"]),
},
created() { created() {
this.isTimeOut(); this.isTimeOut();
}, },
methods: { methods: {
...mapMutations(["SET_times"]),
// 返回首页 // 返回首页
startTimer() { startTimer() {
let that = this; clearInterval(this.timeOut);
clearInterval(that.timeOut); this.SET_times(this.defaultTimes);
this.timeOut = setTimeout(function () { this.timeOut = setInterval(() => {
that.$router.push({ path: "/" }); if (this.times == 0) {
}, 1000 * 60 * 5); this.$router.push({ path: "/" });
}
this.SET_times(this.times - 1);
}, 1000);
}, },
// 无任何操作返回首页 // 无任何操作返回首页
isTimeOut() { isTimeOut() {
...@@ -40,7 +48,7 @@ export default { ...@@ -40,7 +48,7 @@ export default {
document.body.removeEventListener("keyup", this.startTimer); document.body.removeEventListener("keyup", this.startTimer);
document.body.removeEventListener("click", this.startTimer); document.body.removeEventListener("click", this.startTimer);
document.body.removeEventListener("touchend", this.startTimer); document.body.removeEventListener("touchend", this.startTimer);
clearTimeout(this.timeOut); clearInterval(this.timeOut);
}, },
}; };
</script> </script>
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
:key="'list' + item" :key="'list' + item"
></div> ></div>
</div> </div>
<el-empty class="empty" :image-size="200" v-else></el-empty> <YEmpty v-else width="400"></YEmpty>
<!-- 分页 --> <!-- 分页 -->
<div class="tac"> <div class="tac">
<el-pagination <el-pagination
...@@ -104,13 +104,15 @@ import Header from "@/components/Header.vue"; ...@@ -104,13 +104,15 @@ import Header from "@/components/Header.vue";
import PageTop from "@/components/PageTop.vue"; import PageTop from "@/components/PageTop.vue";
import SearchBox from "@/components/SearchBox.vue"; import SearchBox from "@/components/SearchBox.vue";
import MateralsList from "@/components/MateralsList.vue"; import MateralsList from "@/components/MateralsList.vue";
import { getSampleformMatterList } from "@/api"; import YEmpty from "@/components/YEmpty.vue";
import { getSampleformMatterList, getMatterForFlownum } from "@/api";
export default { export default {
components: { components: {
Header, Header,
PageTop, PageTop,
SearchBox, SearchBox,
MateralsList, MateralsList,
YEmpty,
}, },
data() { data() {
return { return {
...@@ -128,40 +130,61 @@ export default { ...@@ -128,40 +130,61 @@ export default {
}; };
}, },
created() { created() {
this.getSampleformMatterList(); this.typeSearch();
// this.getAllmaterials(); // this.getAllmaterials();
}, },
watch: { watch: {
searchVal(newVal) { searchVal(newVal) {
if (newVal === "") { if (newVal === "") {
this.current = 1; this.current = 1;
this.getSampleformMatterList(); this.typeSearch();
} }
}, },
}, },
methods: { methods: {
// 区分搜索
async typeSearch() {
let reg = /^[\u4e00-\u9fa5]+$/;
if (reg.test(this.searchVal) || this.searchVal == "") {
this.getSampleformMatterList(this.searchVal);
} else {
await this.getMatterForFlownum(this.searchVal);
}
},
// 获取事项列表 // 获取事项列表
async getSampleformMatterList() { async getSampleformMatterList(matterFullName) {
let res = await getSampleformMatterList({ let res = await getSampleformMatterList({
page: this.current, page: this.current,
size: this.size, size: this.size,
isTerminal: 1, isTerminal: 1,
matterFullName: this.searchVal, matterFullName,
}); });
let { total, matterDatumTotal, data } = res.data.data; let { total, matterDatumTotal, data } = res.data.data;
this.matterList = data; this.matterList = data;
this.total = total; this.total = total;
this.matterDatumTotal = matterDatumTotal; this.matterDatumTotal = matterDatumTotal;
}, },
// 排队编号获取事项
async getMatterForFlownum(flownum) {
let matterFullName = "";
let res = await getMatterForFlownum({ flownum });
if (res.data.code == 1) {
let { data } = res.data.data;
if (data.length) {
matterFullName = data[0].matterName;
this.getSampleformMatterList(matterFullName);
}
}
},
// 搜索 // 搜索
handleSearch() { handleSearch() {
this.current = 1; this.current = 1;
this.getSampleformMatterList(); this.typeSearch();
}, },
// 分页 // 分页
changePage(cur) { changePage(cur) {
this.current = cur; this.current = cur;
this.getSampleformMatterList(); this.typeSearch();
}, },
// 查看 // 查看
handleCheck(row) { handleCheck(row) {
......
...@@ -12,11 +12,19 @@ export default new Vuex.Store({ ...@@ -12,11 +12,19 @@ export default new Vuex.Store({
datumList: [], // 首页材料 datumList: [], // 首页材料
matterList: [], // 首页事项 matterList: [], // 首页事项
deviceCode: "", // 设备编码 deviceCode: "", // 设备编码
times: 300, // 倒计时时间
defaultTimes: 300, // 倒计时时间
}, },
getters: { getters: {
deviceCode(state) { deviceCode(state) {
return state.deviceCode; return state.deviceCode;
}, },
times(state) {
return state.times;
},
defaultTimes(state) {
return state.defaultTimes;
},
}, },
mutations: { mutations: {
SET_devicenum(state, devicenum) { SET_devicenum(state, devicenum) {
...@@ -34,6 +42,9 @@ export default new Vuex.Store({ ...@@ -34,6 +42,9 @@ export default new Vuex.Store({
SET_deviceCode(state, deviceCode) { SET_deviceCode(state, deviceCode) {
state.deviceCode = deviceCode; state.deviceCode = deviceCode;
}, },
SET_times(state, times) {
state.times = times;
},
}, },
actions: {}, actions: {},
modules: {}, modules: {},
......
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