浏览代码

修改路由名称名称

zhengkaixin 4 年之前
父节点
当前提交
769b72d58b

+ 9 - 9
src/projects/business/router/common.js

@@ -124,9 +124,9 @@ const routesCommon = [
 					},
 					//手表绑定列表
 					{
-						path: 'watchBindList',
-						name: 'CommonDeviceWatchBindList',
-						component: () => import('../views/Common/Device/WatchBindList.vue'),
+						path: 'liveBindList',
+						name: 'CommonDeviceLiveBindList',
+						component: () => import('../views/Common/Device/LiveBindList.vue'),
 						meta: {
 							requireAuth: true,
 							role: [],
@@ -136,9 +136,9 @@ const routesCommon = [
 					},
 					//手表绑定列表
 					{
-						path: 'watchBindListAdmin',
-						name: 'CommonDeviceWatchBindListAdmin',
-						component: () => import('../views/Common/Device/WatchBindListAdmin.vue'),
+						path: 'liveBindListAdmin',
+						name: 'CommonDeviceLiveBindListAdmin',
+						component: () => import('../views/Common/Device/LiveBindListAdmin.vue'),
 						meta: {
 							requireAuth: true,
 							role: [],
@@ -148,9 +148,9 @@ const routesCommon = [
 					},
 					//手表绑定详情
 					{
-						path: 'watchBindInfo',
-						name: 'CommonDeviceWatchBindInfo',
-						component: () => import('../views/Common/Device/WatchBindInfo.vue'),
+						path: 'liveBindInfo',
+						name: 'CommonDeviceLiveBindInfo',
+						component: () => import('../views/Common/Device/LiveBindInfo.vue'),
 						meta: {
 							requireAuth: false,
 							role: [],

+ 0 - 2
src/projects/business/views/Common/Device/List.vue

@@ -75,8 +75,6 @@
 			//获取列表
 			getList() {
 				API_Device.listOfDevice({
-					pageIndex: 1,
-					pageSize: 500,
 					schoolId: this.person_data.companyId
 				}).then(data => {
 					this.devices = data.data;

+ 108 - 0
src/projects/business/views/Common/Device/LiveBindInfo.vue

@@ -0,0 +1,108 @@
+<template>
+<div>
+
+    <common @asynCallBack="asynCallBack"></common>
+    <top-header :pageTitle="pageTitle" :routeName="routeName"></top-header>
+    <div class="mui-content">
+        <div class="mui-content-padded vongi-qingjiadt vongi-editme">
+            <form class="mui-input-group">
+                <div class="mui-input-row">
+                    <label>设备名称</label>
+                    <span>{{detail.name}}</span>
+                </div>
+                <div class="mui-input-row">
+                    <label>设备序列号</label>
+                    <span>{{detail.onId}}</span>
+                </div>
+            </form>
+        </div>
+        <div class="mui-content-padded vongi-qingjiadt vongi-editme">
+            <form class="mui-input-group">
+                <div class="mui-input-row">
+                    <label>分配人员ID<i class="colorfe616c">*</i></label>
+                    <input type="text" class="mui-input-clear" v-model="detail.personId" placeholder="输入人员ID">
+                </div>
+            </form>
+        </div>
+        <div class="vongi-btn vongi-login-btn">
+            <button class="mui-btn mui-btn-primary" @click="submit()">保 存</button>
+        </div>
+    </div>
+</div>
+</template>
+
+<script>
+import * as API_Device from "@/apis/Common/device";
+import Common from '$project/components/Common.vue'
+import Loading from '$project/components/Loading.vue'
+import TopHeader from '$project/components/TopHeader.vue'
+import {
+    mapGetters,
+    mapMutations
+} from 'vuex'
+export default {
+    name: 'CommonDeviceLiveBindInfo',
+    components: {
+        Common,
+        Loading,
+        TopHeader
+    },
+    data() {
+        return {
+            pageTitle: '关联新设备',
+            routeName: "CommonDeviceLiveBindList",
+
+            isLoading: false,
+            detail: {},
+
+        }
+    },
+    created() {
+        this.detail = this.$route.query;
+        this.routeName = this.$route.query.routeName;
+    },
+    methods: {
+        //获取详情
+        submit() {
+
+            this.isLoading = true;
+            if (!this.detail.personId) {
+                this.detail.personId = "0"
+            }
+            API_Device.liveUpdate(this.detail).then(response => {
+
+                this.isLoading = false;
+                mui.toast("操作成功");
+                //跳转首页
+                this.$router.push({
+                    name: this.routeName,
+                    query: {}
+                })
+            }).catch(error => {
+                this.isLoading = false;
+                mui.toast(error);
+            })
+        },
+
+        asynCallBack() {
+
+        },
+    },
+    mounted() {
+        //获取详情
+
+    },
+    destroyed() {},
+    computed: {
+        ...mapGetters({
+            openId: 'wx_openid',
+            token: 'token',
+        })
+    },
+}
+</script>
+
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
+<style src="$project/assets/css/iconfont.css"></style>
+<style>
+</style>

+ 125 - 0
src/projects/business/views/Common/Device/LiveBindList.vue

@@ -0,0 +1,125 @@
+<template>
+<div>
+    <common @asynCallBack="asynCallBack"></common>
+    <top-header :pageTitle="pageTitle" :routeName="routeName"></top-header>
+    <div class="mui-content">
+        <div class="mui-content-padded">
+            <ul class="mui-table-view vongi-jy-ul">
+
+                <li class="mui-table-view-cell" v-for="(item,index) in recordList">
+                    <a @click="goto(item)" class="mui-navigate-right">
+                        {{item.deviceName}}
+                        <span class="mui-pull-right">{{item.personId}}</span>
+                    </a>
+                </li>
+
+            </ul>
+        </div>
+    </div>
+    <NullList :remark="'暂无设备'" v-if="!recordList.length"></NullList>
+
+    <loading :visible="isLoading"></loading>
+</div>
+</template>
+
+<script>
+import * as API_Device from "@/apis/Common/device";
+import NullList from "$project/components/NullList.vue";
+
+import Common from "$project/components/Common.vue";
+import Loading from "$project/components/Loading.vue";
+import TopHeader from "$project/components/TopHeader.vue";
+import isReachBottom from "$project/utils/isReachBottom";
+
+import {
+    mapGetters,
+    mapMutations
+} from "vuex";
+export default {
+    name: "CommonDeviceLiveBindList",
+    components: {
+        Common,
+        Loading,
+        TopHeader,
+        NullList,
+    },
+    data() {
+        return {
+            pageTitle: "设备维护",
+
+            isLoading: false,
+
+            listForm: {
+                pageIndex: 1,
+                pageSize: 20,
+                totalPage: 1,
+            },
+            routeName: "Master",
+            recordList: [],
+        };
+    },
+    created() {},
+    methods: {
+        goto(mod) {
+            if (mod.personId) {
+
+                mui.toast("已设置,如需修改,联系中层以上人员重置");
+                return;
+            }
+            //跳转首页
+            this.$router.push({
+                name: 'CommonDeviceLiveBindInfo',
+                query: {
+                    id: mod.id,
+                    name: mod.deviceName,
+                    onId: mod.deviceSerial,
+                    personId: mod.personId,
+                    routeName: 'CommonDeviceLiveBindList',
+                }
+            })
+        },
+        //获取列表
+        getList() {
+            this.isLoading = true;
+
+            API_Device.livePageList(this.listForm)
+                .then((response) => {
+                    if (response) {
+                        if (this.listForm.pageIndex == 1) {
+                            this.recordList = response.data;
+                            this.listForm.pageIndex = response.pageNumber;
+                            this.listForm.totalPage = response.totalPage;
+                        } else {
+                            this.recordList = [...this.recordList, ...response.data];
+                        }
+                    }
+                    this.listForm.pageIndex++;
+                    this.isLoading = false;
+                })
+                .catch((error) => {
+                    this.isLoading = false;
+                    mui.toast(error);
+                });
+        },
+        asynCallBack() {},
+    },
+    mounted() {
+        //获取列表
+        this.getList();
+    },
+    destroyed() {},
+    computed: {
+        ...mapGetters({
+            openId: "wx_openid",
+            token: "token",
+            person_data: "person_data",
+            person_popedom: "person_popedom",
+        }),
+    },
+};
+</script>
+
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
+<style src="$project/assets/css/iconfont.css"></style>
+<style>
+</style>

+ 121 - 0
src/projects/business/views/Common/Device/LiveBindListAdmin.vue

@@ -0,0 +1,121 @@
+<template>
+<div>
+    <common @asynCallBack="asynCallBack"></common>
+    <top-header :pageTitle="pageTitle" :routeName="routeName"></top-header>
+    <div class="mui-content">
+        <div class="mui-content-padded">
+            <ul class="mui-table-view vongi-jy-ul">
+
+                <li class="mui-table-view-cell" v-for="(item,index) in recordList">
+                    <a @click="goto(item)" class="mui-navigate-right">
+                        {{item.deviceName}}
+                        <span class="mui-pull-right">{{item.personId}}</span>
+                    </a>
+                </li>
+
+            </ul>
+        </div>
+    </div>
+    <NullList :remark="'暂无设备'" v-if="!recordList.length"></NullList>
+
+    <loading :visible="isLoading"></loading>
+</div>
+</template>
+
+<script>
+import * as API_Device from "@/apis/Common/device";
+import NullList from "$project/components/NullList.vue";
+
+import Common from "$project/components/Common.vue";
+import Loading from "$project/components/Loading.vue";
+import TopHeader from "$project/components/TopHeader.vue";
+import isReachBottom from "$project/utils/isReachBottom";
+
+import {
+    mapGetters,
+    mapMutations
+} from "vuex";
+export default {
+    name: "CommonDeviceLiveBindListAdmin",
+    components: {
+        Common,
+        Loading,
+        TopHeader,
+        NullList,
+    },
+    data() {
+        return {
+            pageTitle: "设备维护",
+
+            isLoading: false,
+
+            listForm: {
+                pageIndex: 1,
+                pageSize: 20,
+                totalPage: 1,
+            },
+            routeName: "Master",
+            recordList: [],
+        };
+    },
+    created() {},
+    methods: {
+        goto(mod) {
+
+            //跳转首页
+            this.$router.push({
+                name: 'CommonDeviceLiveBindInfo',
+                query: {
+                    id: mod.id,
+                    name: mod.deviceName,
+                    onId: mod.deviceSerial,
+                    personId: mod.personId,
+                    routeName: 'CommonDeviceLiveBindListAdmin',
+                }
+            })
+        },
+        //获取列表
+        getList() {
+            this.isLoading = true;
+
+            API_Device.livePageList(this.listForm)
+                .then((response) => {
+                    if (response) {
+                        if (this.listForm.pageIndex == 1) {
+                            this.recordList = response.data;
+                            this.listForm.pageIndex = response.pageNumber;
+                            this.listForm.totalPage = response.totalPage;
+                        } else {
+                            this.recordList = [...this.recordList, ...response.data];
+                        }
+                    }
+                    this.listForm.pageIndex++;
+                    this.isLoading = false;
+                })
+                .catch((error) => {
+                    this.isLoading = false;
+                    mui.toast(error);
+                });
+        },
+        asynCallBack() {},
+    },
+    mounted() {
+        //获取列表
+        this.getList();
+    },
+    destroyed() {},
+    computed: {
+        ...mapGetters({
+            openId: "wx_openid",
+            token: "token",
+            person_data: "person_data",
+            person_popedom: "person_popedom",
+        }),
+    },
+};
+</script>
+
+<style scoped src="$project/assets/css/xpwyfyy.css"></style>
+<style src="$project/assets/css/iconfont.css"></style>
+<style>
+</style>