Bladeren bron

设备中心

xiaohaizhao 2 jaren geleden
bovenliggende
commit
7c3be901ca

+ 29 - 0
packageA/facility/detail.vue

@@ -0,0 +1,29 @@
+<template>
+    <view class="container">
+        <cu-custom id="custom"
+            bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png"
+            :isBack="true">
+            <block slot="backText">返回</block>
+            <block slot="content">
+                设备详情
+            </block>
+        </cu-custom>
+    </view>
+</template>
+
+<script>
+export default {
+    components: {},
+    name: "facilityD",
+    data() {
+        return {
+        }
+    },
+    onLoad(options) {
+        console.log(options)
+    },
+    methods: {}
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 75 - 0
packageA/facility/index.vue

@@ -0,0 +1,75 @@
+<template>
+    <view class="container">
+        <cu-custom id="custom"
+            bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png"
+            :isBack="true">
+            <block slot="backText">返回</block>
+            <block slot="content">
+                设备中心
+            </block>
+        </cu-custom>
+        <list ref="设备列表" v-show="PageCur == '设备列表'" :istabbar="true" />
+		<my-map ref="设备地图" v-show="PageCur == '设备地图'" />
+
+
+        <view v-if="istabbar" class="cu-bar tabbar bg-white foot" style="z-index: 100000;">
+            <view v-for="item in pageList" :key="item.label"
+                :class="PageCur == item.label ? 'action pitch-on-color' : 'action text-gray'">
+                <view class="iconfont" :class="item.icon" @click="changePage(item.label)" />
+                {{ item.label }}
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+import list from "./modules/list"
+import myMap from "../../pages/facility/my-map.vue";
+
+
+export default {
+    components: { list, myMap },
+    name: "facility",
+    data() {
+        return {
+            istabbar: false,
+            PageCur: "",
+            pageList: []
+        }
+    },
+    mounted() {
+        let authList = uni.getStorageSync('authList')['设备中心'],
+            pageList = [{
+                label: "设备列表",
+                icon: "icon-xunjianzhongxin"
+            }, {
+                label: "设备地图",
+                icon: "icon-ditu-xuanzhong"
+            }].filter(v => authList[v.label] && authList[v.label].option.some(s => s == 'read'));
+        if (pageList.length) {
+            this.pageList = pageList;
+            this.PageCur = pageList[0].label;
+            this.istabbar = pageList.length > 1;
+            this.loadElement();
+        } else {
+            uni.showToast({
+                title: '未查询到可用应用',
+                icon: "none",
+                mask: true,
+            });
+        }
+    },
+    methods: {
+        changePage(page) {
+            this.PageCur = page;
+            this.loadElement()
+        },
+        loadElement(forcedUpdating) {
+            let page = this.$refs[this.PageCur];
+            if (page.uninitialized || forcedUpdating) page.init();
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 7 - 5
pages.json

@@ -7,18 +7,20 @@
 		"path": "pages/index/index"
 	}, {
 		"path": "pages/index/modules/home"
-	}, {
-		"path": "pages/index/modules/my-map"
 	}, {
 		"path": "pages/index/modules/message"
 	}, {
 		"path": "pages/index/modules/mine"
+	}, {
+		"path": "pages/facility/index"
+	}, {
+		"path": "pages/facility/detail"
+	}, {
+		"path": "pages/facility/my-map"
 	}],
 	"subPackages": [{
 		"root": "packageA",
-		"pages": [{
-			"path": "facility/index"
-		}]
+		"pages": []
 	}],
 	"globalStyle": {
 		"navigationStyle": "custom"

+ 165 - 0
pages/facility/detail.vue

@@ -0,0 +1,165 @@
+<template>
+    <view class="container">
+        <cu-custom ref="Dustom" id="custom"
+            bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png"
+            :isBack="true">
+            <block slot="backText">返回</block>
+            <block slot="content">
+                设备详情
+            </block>
+        </cu-custom>
+        <My_listbox ref="List" :pullDown="false" @getlist="loadData">
+            <view class="head">
+                <view class="name">{{ detail.devicename }}</view>
+                <view class="row">
+                    设备编号:{{ detail.serialnumber || ' --' }}
+                </view>
+                <view class="row">
+                    设备状态:<text class="status">{{ detail.status }}</text>
+                </view>
+                <view class="row">
+                    区域:{{ (detail.province + detail.city + detail.county) || ' --' }}
+                </view>
+                <view class="row">
+                    设备地址:{{ detail.address || ' --' }}
+                </view>
+                <view class="row">
+                    注册时间:{{ detail.createdate || ' --' }}
+                </view>
+            </view>
+
+            <view class="image">
+                图片预留区域
+            </view>
+            <horizontal-direction ref="hd" />
+            <view class="tabs" :style="{ top: tovw(CustomBar) }">
+                <tabs :tabs="tabs" @changeTab="changeTab" />
+            </view>
+            <preview ref="详情信息" :detail="detail" />
+            <queue ref="操作队列" :w_deviceid="detail.w_deviceid" />
+            <record ref="操作记录" :w_deviceid="detail.w_deviceid" />
+            <view style="height: 30px;" />
+        </My_listbox>
+    </view>
+</template>
+
+<script>
+import horizontalDirection from "./modules/horizontalDirection.vue"
+import tabs from "./modules/tabs.vue"
+import preview from "./modules/preview.vue"
+import record from "./modules/record.vue"
+import queue from "./modules/queue.vue"
+
+let page = {};
+export default {
+    components: { horizontalDirection, tabs, preview, record, queue },
+    name: "facilityD",
+    data() {
+        return {
+            CustomBar: 0,
+            w_deviceid: 0,
+            detail: {},
+            showTab: '详情信息',
+            tabs: [{
+                name: '详情信息'
+            }, {
+                name: '操作队列',
+            }, {
+                name: '操作记录'
+            }]
+        }
+    },
+    onLoad(options) {
+        this.w_deviceid = options.id;
+        this.getDetail(true)
+    },
+    mounted() {
+        // this.$refs.Dustom.CustomBar
+        this.CustomBar = -10;
+        this.$refs.List.setHeight();
+    },
+    methods: {
+        getDetail(init = false) {
+            this.$Http.basic({
+                "id": 20230615103902,
+                "content": {
+                    "w_deviceid": this.w_deviceid
+                }
+            }).then(res => {
+                console.log("设备详情", res)
+                if (this.cutoff(res.msg)) return;
+                this.detail = res.data;
+                if (init) {
+                    this.$refs.hd.getList(this.w_deviceid);
+                    setTimeout(() => { this.changeTab({ name: this.showTab }, true) }, 100)
+                }
+            })
+        },
+        changeTab({ name }, init = false) {
+            this.showTab = name;
+            page.show = false;
+            page = this.$refs[name];
+            this.loadData(init);
+        },
+        loadData(init) {
+            // show t =加载 f=变化 
+            if ((page.uninitialized && !page.show) || init) {
+                console.log("首次加载", this.showTab)
+                page.show = true;
+                page.initialize(true)
+            } else if (page.show) {
+                page.initialize()
+            } else {
+                page.show = true;
+            }
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.tabs {
+    position: sticky;
+    box-shadow: rgba(0, 0, 0, 0.45) 0px 25px 20px -20px;
+    z-index: 99;
+}
+
+.head {
+    width: 355px;
+    background: #FFFFFF;
+    border-radius: 4px;
+    padding: 10px 15px;
+    box-sizing: border-box;
+    margin: 10px auto 0;
+
+    .name {
+        line-height: 20px;
+        font-size: 14px;
+        font-family: PingFang SC-Medium, PingFang SC;
+        font-weight: bold;
+        color: #333333;
+        margin-bottom: 10px;
+    }
+
+    .row {
+        line-height: 17px;
+        font-size: 12px;
+        color: #666666;
+        margin-bottom: 5px;
+
+        .status {
+            color: #3874F6;
+        }
+    }
+}
+
+.image {
+    width: 355px;
+    height: 158px;
+    border: 1px solid #ddd;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin: 15px auto 0;
+}
+</style>

+ 164 - 0
pages/facility/index.vue

@@ -0,0 +1,164 @@
+<template>
+    <view class="container">
+        <cu-custom id="custom"
+            bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png"
+            :isBack="isBack">
+            <block slot="backText">返回</block>
+            <block slot="content">
+                设备中心
+            </block>
+        </cu-custom>
+        <My_search :heightReduction="heightReduction" ref="Search" @onFilter="onFilter" @startSearch="startSearch" :filter="filter">
+            <template slot="left">
+                <view class="change" hover-class="navigator-hover" @click="changePage(PageCur == '设备列表' ? '设备地图' : '设备列表')">
+                    {{ PageCur == '设备列表' ? '列表' : '地图' }}
+                </view>
+            </template>
+        </My_search>
+        <list ref="设备列表" :empty="empty" :list="list" v-show="PageCur == '设备列表'" />
+        <my-map ref="设备地图" :tabHeight="tabHeight" :markers="markers" v-show="PageCur == '设备地图'" />
+    </view>
+</template>
+
+<script>
+import list from "./list.vue"
+import myMap from "./my-map.vue";
+
+export default {
+    components: { list, myMap },
+    props: {
+        tabHeight: {
+            type: Number,
+            default: 98
+        }
+    },
+    name: "facility",
+    data() {
+        return {
+            condition: "",
+            empty: false,
+            isBack: true,
+            uninitialized: true,
+            PageCur: "设备列表",
+            list: [],
+            markers: [],
+            "where": {
+                "condition": "",
+                "status": ""
+            },
+            filter: [{
+                label: "状态",
+                list: [{
+                    status: '全部',
+                    value: ""
+                }, {
+                    status: '在线',
+                    value: "在线"
+                }, {
+                    status: '离线',
+                    value: "离线"
+                }, {
+                    status: '禁用',
+                    value: "禁用"
+                }],
+                key: "status",
+                selectKey: "value",
+                showKey: 'status',
+                default: "0",
+                selectIndex: 0,
+            }],
+            heightReduction: 0
+        }
+    },
+    onLoad(options) {
+        this.getlist();
+        setTimeout(() => this.loadElement(), 100)
+    },
+    methods: {
+        init() {
+            this.getlist();
+            this.PageCur = '设备地图';
+            this.isBack = false;
+            this.heightReduction = 45
+            setTimeout(() => this.loadElement(true, {
+                mode: 'minus',
+                num: 50
+            }), 100)
+        },
+        changePage(page) {
+            this.PageCur = page;
+            this.loadElement()
+        },
+        loadElement(forcedUpdating, data) {
+            let page = this.$refs[this.PageCur];
+            if (page.uninitialized || forcedUpdating) page.init();
+        },
+        getlist() {
+            this.$Http.basic({
+                "id": 20230615153202,
+                "content": {
+                    "pageNumber": 1,
+                    "pageSize": 99999,
+                    where: this.where
+                }
+            }).then(res => {
+                console.log("设备列表", res)
+                if (this.cutoff(res.msg)) return;
+                this.empty = res.data.length == 0;
+                this.$refs.Search.onFinish();
+                this.markers = res.data.filter(v => v.latitude).map(v => {
+                    v.id = v.w_deviceid - 0;
+                    v.title = v.devicename;
+                    if (this.usePort == 'h5') v.iconPath = require("../../static/img/icon.png");
+                    v.customCallout = { display: 'BYCLICK', anchorY: -10 }
+                    return v
+                });
+                this.list = res.data.map(v => {
+                    switch (v.status) {
+                        case '在线':
+                            v.bgColor = "#3874F6";
+                            break;
+                        case '禁用':
+                            v.bgColor = "#EB4B5C";
+                            break;
+                        default:
+                            v.bgColor = "#BBBBBB";
+                            break;
+                    }
+                    return v
+                })
+            })
+        },
+        startSearch(condition) {
+            if (condition == this.where.condition) return;
+            this.where.condition = condition;
+            this.getlist()
+        },
+        onFilter(where) {
+            console.log("开始筛选", where)
+            where.condition = this.where.condition;
+            this.where = where;
+            this.getlist()
+        },
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+/deep/.My_search {
+    padding-left: 0 !important;
+}
+
+.change {
+    height: 30px;
+    line-height: 30px;
+    text-align: center;
+    margin-left: 5px;
+    font-size: 14px;
+    color: #FFFFFF;
+    border-radius: 4px;
+    padding: 0 10px;
+    margin-right: 5px;
+    border-radius: 4px;
+}
+</style>

+ 86 - 0
pages/facility/list.vue

@@ -0,0 +1,86 @@
+<template>
+    <view>
+        <My_listbox ref="List" :pullDown="false" :empty='empty'>
+            <navigator v-for="item in list" :key="item.w_deviceid" class="item"
+                :url="'/pages/facility/detail?id=' + item.w_deviceid">
+                <view class="name u-line-1">设备:{{ item.devicename || ' --' }}</view>
+                <view class="row u-line-1">设备编号:<text>{{ item.serialnumber || ' --' }}</text></view>
+                <view class="row u-line-1">设备地址:<text>{{ (item.province + item.city + item.county + item.address) || ' --'
+                }}</text>
+                </view>
+                <view class="status" :style="{ background: item.bgColor }">{{ item.status }}</view>
+            </navigator>
+        </My_listbox>
+    </view>
+</template>
+<script>
+export default {
+    props: {
+        list: Array,
+        empty: Boolean
+    },
+    name: "list",
+    data() {
+        return {
+            uninitialized: true
+        }
+    },
+    methods: {
+        init() {
+            this.uninitialized = false;
+            this.$refs.List.setHeight();
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.item {
+    position: relative;
+    width: 355px;
+    background: #FFFFFF;
+    border-radius: 4px;
+    margin: 5px auto;
+    margin-bottom: 10px;
+    padding: 10px;
+    box-sizing: border-box;
+    overflow: hidden;
+
+    .name {
+        width: 300px;
+        line-height: 21px;
+        font-size: 15px;
+        font-family: PingFang SC-Medium, PingFang SC;
+        font-weight: bold;
+        color: #333333;
+        margin-bottom: 10px;
+    }
+
+    .row {
+        line-height: 17px;
+        font-size: 12px;
+        color: #666666;
+        margin-bottom: 5px;
+
+        text {
+            line-height: 17px;
+            font-size: 12px;
+            color: #0A3971;
+        }
+    }
+
+    .status {
+        position: absolute;
+        right: 0;
+        top: 0;
+        border-radius: 0px 4px 0px 4px;
+        background: red;
+        text-align: center;
+        line-height: 24px;
+        padding: 0 10px;
+        font-size: 12px;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #FFFFFF;
+    }
+}
+</style>

+ 80 - 0
pages/facility/modules/horizontalDirection.vue

@@ -0,0 +1,80 @@
+<template>
+    <scroll-view class="scroll" v-if="list.length" :scroll-x="true">
+        <view class="box">
+            <view class="item" v-for="item in list" :key="item.w_dataparamid">
+                <view class="label">
+                    {{ item.paramname }}
+                    <text v-if="item.unit">
+                        ({{ item.unit }})
+                    </text>
+                </view>
+                <view class="value">
+                    {{ item.lastvalue }}
+                </view>
+            </view>
+        </view>
+    </scroll-view>
+</template>
+<script>
+export default {
+    props: {},
+    name: "horizontalDirection",
+    data() {
+        return {
+            list: []
+        }
+    },
+    methods: {
+        getList(w_deviceid) {
+            this.$Http.basic({
+                "id": 20230711165702,
+                "content": {
+                    w_deviceid
+                }
+            }).then(res => {
+                console.log("设备实时数据查询", res)
+                if (this.cutoff(res.msg)) return;
+                this.list = res.data;
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.scroll {
+    width: 355px;
+    background: #FFFFFF;
+    border-radius: 4px;
+    margin: 15px auto 0;
+    height: 62px;
+
+    .box {
+        display: flex;
+        flex-wrap: nowrap;
+        align-items: center;
+        padding: 12px;
+        box-sizing: border-box;
+
+        .item {
+            flex-shrink: 0;
+            padding-right: 15px;
+
+            .label {
+                line-height: 14px;
+                font-size: 10px;
+                color: #666666;
+            }
+
+            .value {
+                margin-top: 5px;
+                line-height: 20px;
+                font-size: 14px;
+                font-family: PingFang SC-Bold, PingFang SC;
+                font-weight: bold;
+                color: #333333;
+            }
+        }
+    }
+}
+</style>

+ 58 - 0
pages/facility/modules/operateList.vue

@@ -0,0 +1,58 @@
+<template>
+    <view>
+        <view class="item" v-for="item in list" :key="item.rowindex">
+            <view class="title">{{ item.funcname || ' --' }}</view>
+            <view class="row">
+                时间:{{ item.createdate }}
+            </view>
+            <view class="row" v-for="(it, index) in item.content" :key="index">
+                {{ it.title }}:{{ item.value || ' --' }}
+            </view>
+        </view>
+        <view v-if="!list.length" style="position: relative; z-index: 1 !important;">
+            <view style="height: 40px;" />
+            <u-empty mode="data" />
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    props: {
+        list: Array
+    },
+    name: 'operateList'
+}
+</script>
+
+<style lang="scss" scoped>
+.item {
+    width: 355px;
+    margin: 0 auto 10px;
+    padding: 10px;
+    background: #fff;
+    border-radius: 4px;
+    box-sizing: border-box;
+
+    .title {
+        line-height: 21px;
+        font-size: 15px;
+        font-family: PingFang SC-Medium, PingFang SC;
+        font-weight: bold;
+        color: #333333;
+        margin-bottom: 10px;
+    }
+
+    .row {
+        line-height: 17px;
+        font-size: 12px;
+        color: #666666;
+        margin-bottom: 5px;
+    }
+}
+
+
+/deep/.u-empty {
+    z-index: 1 !important;
+}
+</style>

+ 153 - 0
pages/facility/modules/preview.vue

@@ -0,0 +1,153 @@
+<template>
+    <view class="container" v-show="show">
+        <view class="label">
+            <view>
+                基本信息
+            </view>
+            <view class="right">
+                仅显示已填写的信息
+                <view style="width: 10px;" />
+                <!-- <u-switch v-model="reverlAll" size="22" /> -->
+                <switch color="#0078FB" @change="reverlAll = !reverlAll" />
+            </view>
+        </view>
+        <view class="box">
+            <view class="row" v-if="!reverlAll || detail.devicename">
+                <view class="row-label">设备名称</view>
+                <view class="row-value">{{ detail.devicename || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.serialnumber">
+                <view class="row-label">设备编号</view>
+                <view class="row-value">{{ detail.serialnumber || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.prodtype">
+                <view class="row-label">设备类型</view>
+                <view class="row-value">{{ detail.prodtype || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.status">
+                <view class="row-label">设备状态</view>
+                <view class="row-value" style="color:#3874F6 ;">{{ detail.status || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.county">
+                <view class="row-label">区域</view>
+                <view class="row-value">{{ detail.county ? detail.province + ',' + detail.city + ',' + detail.county : ' --'
+                }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.county">
+                <view class="row-label">省市县</view>
+                <view class="row-value">{{ detail.county ? detail.province + ',' + detail.city + ',' + detail.county : ' --'
+                }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.address">
+                <view class="row-label">详细地址</view>
+                <view class="row-value">{{ detail.address || ' --' }}</view>
+            </view>
+
+            <view class="row" v-if="!reverlAll || detail.prodname">
+                <view class="row-label">所属产品</view>
+                <view class="row-value">{{ detail.prodname || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.createdate">
+                <view class="row-label">注册时间</view>
+                <view class="row-value">{{ detail.createdate || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.remarks">
+                <view class="row-label">描述</view>
+                <view class="row-value">{{ detail.remarks || ' --' }}</view>
+            </view>
+        </view>
+        <view class="label">
+            <view>
+                系统信息
+            </view>
+        </view>
+        <view class="box">
+            <view class="row" v-if="!reverlAll || detail.createdate">
+                <view class="row-label">创建时间</view>
+                <view class="row-value">{{ detail.createdate || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.createby">
+                <view class="row-label">创建人</view>
+                <view class="row-value">{{ detail.createby || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.changedate">
+                <view class="row-label">最近编辑时间</view>
+                <view class="row-value">{{ detail.changedate || ' --' }}</view>
+            </view>
+            <view class="row" v-if="!reverlAll || detail.changeby">
+                <view class="row-label">最近编辑人</view>
+                <view class="row-value">{{ detail.changeby || ' --' }}</view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    name: "Preview",
+    props: {
+        detail: Object
+    },
+    data() {
+        return {
+            show: false,
+            uninitialized: true,
+            reverlAll: false
+        }
+    },
+    methods: {
+        initialize(init) {
+            this.uninitialized = false;
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.container {
+    width: 355px;
+    margin: 0 auto;
+
+    .label {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        height: 45px;
+        font-size: 14px;
+        font-family: PingFang SC-Medium, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+
+        .right {
+            display: flex;
+            align-items: center;
+        }
+    }
+
+    .box {
+        background: #fff;
+        border-radius: 4px;
+        overflow: hidden;
+
+        .row {
+            display: flex;
+            align-items: center;
+            padding: 10px;
+            box-sizing: border-box;
+
+            &-label {
+                width: 130px;
+                margin-right: 10px;
+                font-size: 14px;
+                color: #666666;
+            }
+
+            &-value {
+                flex: 1;
+                font-size: 14px;
+                color: #333333;
+            }
+        }
+    }
+}
+</style>

+ 78 - 0
pages/facility/modules/queue.vue

@@ -0,0 +1,78 @@
+<template>
+    <view v-show="show">
+        <view class="search">
+            <My_search @onFilter="onFilter" @startSearch="startSearch" />
+        </view>
+        <operate-list :list="list" />
+    </view>
+</template>
+
+<script>
+let paging = {}
+import operateList from "./operateList";
+export default {
+    components: { operateList },
+    name: "queue",
+    props: {
+        w_deviceid: Number || String
+    },
+    data() {
+        return {
+            show: false,
+            uninitialized: true,
+            list: []
+        }
+    },
+    methods: {
+        initialize(init) {
+            if (init) {
+                this.getList(true)
+            } else {
+                this.getList()
+            }
+        },
+        getList(init = false) {
+            if (init) paging = {
+                pageNumber: 1,
+                pageTotal: 1,
+            };
+            if (paging.pageNumber > paging.pageTotal) return;
+            this.$Http.basic({
+                "id": 20230701132202,
+                "content": {
+                    "type": 2,
+                    "w_deviceid": this.w_deviceid,
+                    ...paging,
+                    "where": {
+                        "begindate": "",
+                        "enddate": ""
+                    }
+                }
+            }).then(res => {
+                console.log('操作记录', res)
+                if (this.cutoff(res.msg)) return;
+                if (init) this.uninitialized = false;
+                paging.pageNumber = res.pageNumber + 1;
+                paging.pageTotal = res.pageTotal;
+                this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data)
+            })
+        },
+        startSearch(condition) {
+            if (condition == this.condition) return;
+            this.condition = condition;
+            this.getList(true)
+        },
+        onFilter(e) {
+            console.log("开始筛选", e)
+        },
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.search {
+    position: sticky;
+    top: 34px;
+    z-index: 998;
+}
+</style>

+ 80 - 0
pages/facility/modules/record.vue

@@ -0,0 +1,80 @@
+<template>
+    <view v-show="show">
+        <view class="search">
+            <My_search @onFilter="onFilter" @startSearch="startSearch" />
+        </view>
+        <operate-list :list="list" />
+    </view>
+</template>
+
+<script>
+let paging = {}
+import operateList from "./operateList";
+export default {
+    components: { operateList },
+    name: "record",
+    props: {
+        w_deviceid: Number || String
+    },
+    data() {
+        return {
+            show: false,
+            uninitialized: true,
+            list: [],
+            condition: ""
+        }
+    },
+    methods: {
+        initialize(init) {
+            if (init) {
+                this.getList(true)
+            } else {
+                this.getList()
+            }
+        },
+        getList(init = false) {
+            if (init) paging = {
+                pageNumber: 1,
+                pageTotal: 1,
+            };
+            if (paging.pageNumber > paging.pageTotal) return;
+            this.$Http.basic({
+                "id": 20230701132202,
+                "content": {
+                    "type": 0,
+                    "w_deviceid": this.w_deviceid,
+                    ...paging,
+                    "where": {
+                        condition: this.condition,
+                        "begindate": "",
+                        "enddate": ""
+                    }
+                }
+            }).then(res => {
+                console.log('操作记录', res)
+                if (this.cutoff(res.msg)) return;
+                if (init) this.uninitialized = false;
+                paging.pageNumber = res.pageNumber + 1;
+                paging.pageTotal = res.pageTotal;
+                this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data)
+            })
+        },
+        startSearch(condition) {
+            if (condition == this.condition) return;
+            this.condition = condition;
+            this.getList(true)
+        },
+        onFilter(e) {
+            console.log("开始筛选", e)
+        },
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.search {
+    position: sticky;
+    top: 34px;
+    z-index: 998;
+}
+</style>

+ 56 - 0
pages/facility/modules/tabs.vue

@@ -0,0 +1,56 @@
+<template>
+    <view v-if="tabs.length" class="tabs-box">
+        <u-tabs :list="tabs" @change="onChangeTab" lineColor="#052E5D"
+            :activeStyle="{ color: '#052E5D', fontWeight: 'bold' }" :inactiveStyle="{
+                color: '#BBBBBB', fontWeight: 'bold'
+            }" lineWidth="56" />
+    </view>
+</template>
+
+<script>
+export default {
+    name: "tabs",
+    props: {
+        tabs: Array,
+        current: {
+            type: Number || String,
+            default: 0
+        },
+        changeTab: Function
+    },
+    data() {
+        return {
+
+        }
+    },
+    methods: {
+        onChangeTab(e) {
+            this.$emit("changeTab", e)
+        }
+    }
+
+}
+</script>
+
+<style lang="scss" scoped>
+.tabs-box {
+    width: 355px;
+    height: 45px;
+    border-radius: 4px;
+    background: #fff;
+    margin: 15px auto 0;
+}
+
+/deep/ .uni-scroll-view,
+/deep/.u-tabs__wrapper__nav__item {
+    height: 45px !important;
+}
+
+/deep/ .u-tabs__wrapper__nav__item__text {
+    font-size: 14px !important;
+}
+
+/* /deep/ .u-tabs__wrapper__nav__line{
+    bottom: 0 !important;
+} */
+</style>

+ 207 - 0
pages/facility/my-map.vue

@@ -0,0 +1,207 @@
+<template>
+	<My_listbox ref="box" :pullDown="false"><!--  :latitude="latitude" :longitude="longitude" -->
+		<map name="map" style="width: 100%;height: 100vh;" show-location :markers="markers" :include-points="markers"
+			@markertap="onMarkerTap" @callouttap='usePort == "h5" ? onMarkerTap() : toDetail()'>
+			<cover-view slot="callout">
+				<cover-view class="customCallout" v-for="item in markers" :key="item.id" :marker-id="item.id">
+					<cover-view class="title">
+						设备信息
+					</cover-view>
+					<cover-view class="rep">
+						<cover-view class="row">
+							设备名称:<cover-view class="value u-line-1">{{ item.title || ' --' }}</cover-view>
+						</cover-view>
+						<cover-view class="row">
+							设备编号:<cover-view class="value u-line-1">{{ item.serialnumber || ' --' }}</cover-view>
+						</cover-view>
+						<cover-view class="row ">
+							设备状态:<cover-view class="status u-line-1">{{ item.status || ' --' }}</cover-view>
+						</cover-view>
+						<cover-view class="row" v-for="item1 in information" :key="item1.paramname">
+							{{ item1.paramname }}:<cover-view class="value u-line-1">{{ item1.lastvalue + item1.unit ||
+								'--' }}</cover-view>
+						</cover-view>
+					</cover-view>
+					<cover-view class="botton" hover-class="navigator-hover">
+						点击查看详情
+					</cover-view>
+				</cover-view>
+			</cover-view>
+		</map>
+
+		<view class="popup" v-if="h5Popup">
+			<view class="customCallout" style="padding: 10px;">
+				<view class="title">
+					设备信息
+					<u-icon name="close" @click="h5Popup = false" :size="tovw('16px')" />
+				</view>
+				<view class="rep">
+					<view class="row">
+						设备名称:<view class="value u-line-1">{{ facility.title || ' --' }}</view>
+					</view>
+					<view class="row">
+						设备编号:<view class="value u-line-1">{{ facility.serialnumber || ' --' }}</view>
+					</view>
+					<view class="row">
+						设备状态:<view class="status u-line-1">{{ facility.status || ' --' }}</view>
+					</view>
+					<view class="row" v-for="item1 in information" :key="item1.paramname">
+						{{ item1.paramname }}:<view class="value u-line-1">{{ item1.lastvalue + item1.unit || ' --' }}
+						</view>
+					</view>
+				</view>
+				<view class="botton" hover-class="navigator-hover" @click="toDetail">
+					更多信息
+				</view>
+			</view>
+		</view>
+	</My_listbox>
+</template>
+
+<script>
+export default {
+	props: {
+		markers: Array,
+		tabHeight: {
+			type: Number,
+			default: 98
+		}
+	},
+	name: 'My-map',
+	data() {
+		return {
+			uninitialized: true,
+			latitude: 30.746129,
+			longitude: 120.755486,
+			information: [],
+			facility: {},
+			h5Popup: false,
+			checkId: 0
+		};
+	},
+	created() {
+		this.setLocation();
+	},
+	methods: {
+		init(forcedUpdating = true) {
+			this.$refs.box.setHeight("minus", this.tabHeight);
+		},
+		onMarkerTap(e) {
+			this.checkId = e.detail.markerId
+			this.h5Popup = this.usePort == 'h5';
+
+			this.information = [];
+			this.$Http.basic({
+				"id": 20230711165702,
+				"content": {
+					"w_deviceid": e.detail.markerId
+				}
+			}).then(res => {
+				console.log("设备实时数据查询", res)
+				if (this.cutoff(res.msg)) return;
+				this.information = res.data;
+				if (this.usePort == 'h5') {
+					this.facility = this.markers.find(v => v.id == e.detail.markerId);
+				}
+			})
+		},
+		async setLocation() {
+			return;
+			let res = this.location || await this.getLocation();
+			this.__proto__.location = res;
+			this.latitude = res.latitude;
+			this.longitude = res.longitude;
+		},
+		toDetail() {
+			console.log("toDetail")
+			if (this.checkId == 0) return;
+			wx.navigateTo({
+				url: '/pages/facility/detail?id=' + this.checkId,
+			})
+		}
+	},
+}
+</script>
+
+<style lang="scss" scoped>
+page {
+	width: 100vw;
+	height: 100vh;
+	overflow: hidden;
+}
+
+
+.popup {
+	position: absolute;
+	top: 13%;
+	right: 12%;
+	z-index: 99999;
+	padding: 10px;
+	box-sizing: border-box;
+}
+
+.customCallout {
+	width: 178px;
+	background: rgba($color: #ffffff, $alpha: .8);
+	border-radius: 4px;
+	padding: 10rpx;
+	box-sizing: border-box;
+
+	.title {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		line-height: 22px;
+		font-size: 16px;
+		font-family: PingFang SC-Medium, PingFang SC;
+		font-weight: bold;
+		color: #333333;
+
+		.icon {
+			margin-right: 5px;
+		}
+	}
+
+	.rep {
+		margin-top: 5px;
+
+		.row {
+			display: flex !important;
+			line-height: 17px;
+			font-size: 12px;
+			color: #333333;
+			margin-top: 5px;
+
+			.value {
+				flex: 1;
+				width: 0;
+				line-height: 17px;
+				font-size: 12px;
+				color: #000;
+			}
+
+			.status {
+				line-height: 17px;
+				font-size: 12px;
+				color: #3874F6;
+			}
+		}
+	}
+
+	.botton {
+		position: relative;
+		width: 100%;
+		text-align: center;
+		height: 30px;
+		line-height: 30px;
+		font-size: 14px;
+		color: #3874F6;
+		background: #EBF2FF;
+		border: 1px solid #3874F6;
+		border-radius: 4px;
+		box-sizing: border-box;
+		margin-top: 10px;
+		z-index: 99999999999999;
+	}
+}
+</style>