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

Merge remote-tracking branch 'origin/master'

parents a3a631aa 1d0ee3f6
#开发环境
NODE_ENV = "development"
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:11023
#VUE_APP_API_BASE_URL=http://192.168.0.217:17311
\ No newline at end of file
#生产环境
NODE_ENV = "production"
VUE_APP_API_BASE_URL=/basics_api
VUE_APP_API_PHP_URL=/zwfw_api/
......@@ -2,19 +2,22 @@
<div class="app">
<router-view></router-view>
<NetworkError :isShowError="isShowError"></NetworkError>
<EnabledDev :enabled="enabled"></EnabledDev>
</div>
</template>
<script>
import local from "@/utils/local";
import NetworkError from "@/components/NetworkError.vue";
import EnabledDev from "@/components/EnabledDev.vue";
import mq from "@/mixin/mq";
import { getHomeInfo, getSkinList } from "@/api";
import { getHomeInfo, getSkinList, getDeviceList } from "@/api";
import { mapMutations } from "vuex";
export default {
mixins: [mq],
components: {
NetworkError,
EnabledDev,
},
data() {
return {
......@@ -22,10 +25,12 @@ export default {
devicenum: "",
linkDom: null, // 换皮
isShowError: false,
enabled: 1,
};
},
watch: {
"$route.path"(newVal) {
this.getDeviceList();
if (newVal == "/" || newVal == "/home") {
this.getHomeInfo();
this.getSetinfo();
......@@ -59,7 +64,7 @@ export default {
},
serviceInfo: {
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: "B8-13-32-86-9F-04",
......@@ -79,6 +84,7 @@ export default {
window.addEventListener("offline", () => {
this.isShowError = true;
});
this.getDevInfo();
},
methods: {
...mapMutations([
......@@ -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>
......
......@@ -2,6 +2,7 @@
import local from "@/utils/local";
import request from "@/utils/request";
import store from "@/store";
let PHP_URL = process.env.VUE_APP_API_PHP_URL;
// 首页数据展示
export const getHomeInfo = (data) => {
let baseUrl = local.getLocal("serverUrl");
......@@ -114,3 +115,25 @@ export const getSkinList = (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>
<div class="header flex aic jcc main-title-bg-img">
<div class="count-down">
系统将在 <span>{{ times }}</span> 秒后返回首页
</div>
<slot name="title" class="title">
<div></div>
</slot>
......@@ -13,10 +16,14 @@
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {};
},
computed: {
...mapGetters(["times"]),
},
created() {},
methods: {
handleBack() {
......@@ -37,6 +44,16 @@ export default {
background-size: 100% 100%;
// background: var(--main-theme-color);
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 {
position: absolute;
right: 40px;
......
......@@ -5,21 +5,29 @@
</template>
<script>
import { mapMutations, mapGetters } from "vuex";
export default {
data() {
return {};
},
computed: {
...mapGetters(["times", "defaultTimes"]),
},
created() {
this.isTimeOut();
},
methods: {
...mapMutations(["SET_times"]),
// 返回首页
startTimer() {
let that = this;
clearInterval(that.timeOut);
this.timeOut = setTimeout(function () {
that.$router.push({ path: "/" });
}, 1000 * 60 * 5);
clearInterval(this.timeOut);
this.SET_times(this.defaultTimes);
this.timeOut = setInterval(() => {
if (this.times == 0) {
this.$router.push({ path: "/" });
}
this.SET_times(this.times - 1);
}, 1000);
},
// 无任何操作返回首页
isTimeOut() {
......@@ -40,7 +48,7 @@ export default {
document.body.removeEventListener("keyup", this.startTimer);
document.body.removeEventListener("click", this.startTimer);
document.body.removeEventListener("touchend", this.startTimer);
clearTimeout(this.timeOut);
clearInterval(this.timeOut);
},
};
</script>
......
......@@ -74,7 +74,7 @@
:key="'list' + item"
></div>
</div>
<el-empty class="empty" :image-size="200" v-else></el-empty>
<YEmpty v-else width="400"></YEmpty>
<!-- 分页 -->
<div class="tac">
<el-pagination
......@@ -104,13 +104,15 @@ import Header from "@/components/Header.vue";
import PageTop from "@/components/PageTop.vue";
import SearchBox from "@/components/SearchBox.vue";
import MateralsList from "@/components/MateralsList.vue";
import { getSampleformMatterList } from "@/api";
import YEmpty from "@/components/YEmpty.vue";
import { getSampleformMatterList, getMatterForFlownum } from "@/api";
export default {
components: {
Header,
PageTop,
SearchBox,
MateralsList,
YEmpty,
},
data() {
return {
......@@ -128,40 +130,61 @@ export default {
};
},
created() {
this.getSampleformMatterList();
this.typeSearch();
// this.getAllmaterials();
},
watch: {
searchVal(newVal) {
if (newVal === "") {
this.current = 1;
this.getSampleformMatterList();
this.typeSearch();
}
},
},
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({
page: this.current,
size: this.size,
isTerminal: 1,
matterFullName: this.searchVal,
matterFullName,
});
let { total, matterDatumTotal, data } = res.data.data;
this.matterList = data;
this.total = total;
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() {
this.current = 1;
this.getSampleformMatterList();
this.typeSearch();
},
// 分页
changePage(cur) {
this.current = cur;
this.getSampleformMatterList();
this.typeSearch();
},
// 查看
handleCheck(row) {
......
......@@ -12,11 +12,19 @@ export default new Vuex.Store({
datumList: [], // 首页材料
matterList: [], // 首页事项
deviceCode: "", // 设备编码
times: 300, // 倒计时时间
defaultTimes: 300, // 倒计时时间
},
getters: {
deviceCode(state) {
return state.deviceCode;
},
times(state) {
return state.times;
},
defaultTimes(state) {
return state.defaultTimes;
},
},
mutations: {
SET_devicenum(state, devicenum) {
......@@ -34,6 +42,9 @@ export default new Vuex.Store({
SET_deviceCode(state, deviceCode) {
state.deviceCode = deviceCode;
},
SET_times(state, times) {
state.times = times;
},
},
actions: {},
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