Liuyi
2024-11-27 98a835cc45adbe5ef8ee3cca5ad478f7df673b80
添加设备管理列表
已修改10个文件
已添加2个文件
349 ■■■■■ 文件已修改
api/index.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pagesAdmin/adminPlatform/facility.vue 246 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pagesAdmin/adminPlatform/facilityDetail.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/images/maintain/expand.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/api/index.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/app.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/app.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/common/assets.js 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/common/vendor.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
unpackage/dist/dev/mp-weixin/pages/index/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/index.js
@@ -160,6 +160,14 @@
export function getWaterConsumptionApi(data){
    return request(`/homePage/getWaterConsumption`,data,'POST')
}
//获取区域数据
export function getParentAreaApi(){
    return request(`/waterArea/getParentArea`,{},'GET')
}
//获取设备列表
export function searchWaterFacilityApi(data){
    return request(`/waterFacility/search`,data,'POST')
}
pages.json
@@ -202,6 +202,13 @@
                    "style": {
                        "navigationStyle":"custom"
                    }
                },
                {
                    "path" : "adminPlatform/facilityDetail",
                    "style" :
                    {
                        "navigationBarTitleText" : ""
                    }
                }
            ]
        },
pages/index/index.vue
@@ -340,7 +340,7 @@
                </view>
            </view>
            <view class="function-box1">
                <view class="box1-bg box1-one" @click="upGrade">
                <view class="box1-bg box1-one" @click="navTo('/pages/preSendWater/index')">
                    <image src="../../static/images/index/home21.png" alt=""></image>
                    <view>送水到家</view>
                </view>
pagesAdmin/adminPlatform/facility.vue
@@ -1,13 +1,251 @@
<script setup>
    import{ ref,onMounted } from 'vue'
    import { getParentAreaApi,searchWaterFacilityApi } from '../../api/index.js'
    
    //区域搜索相关
    const DaTreeRef = ref()
    const regionListTree = ref([])
    const selectedReigonId = ref([])
    const selectedReigonName = ref([])
    async function getRegionList(){
        await getParentAreaApi().then((res) =>{
            if(res.code == 200){
                regionListTree.value = res.data
                // regionListTree.value[0].children.push({id: "1", areaName: "B2栋5-1"})
                // regionListTree.value[0].children.push({id: "2", areaName: "B2栋1"})
                // regionListTree.value[0].children.push({id: "3", areaName: "B2栋2"})
                // regionListTree.value[0].children.push({id: "4", areaName: "B2栋3"})
                // regionListTree.value[0].children.push({id: "5", areaName: "B2栋4"})
                // regionListTree.value[0].children.push({id: "6", areaName: "B2栋5"})
                // regionListTree.value[0].children.push({id: "7", areaName: "B2栋6"})
                // regionListTree.value[0].children.push({id: "8", areaName: "B2栋7"})
                // regionListTree.value[0].children.push({id: "9", areaName: "B2栋8"})
            }
        })
    }
    //选中区域
    function handleTreeChange(e,e2){
        isExpand.value = false
        // if(DaTreeRef.value.getHalfCheckedKeys()){
        //     selectedReigonId.value = DaTreeRef.value.getHalfCheckedKeys().concat(DaTreeRef.value.getCheckedKeys())
        // }else{
            selectedReigonId.value = DaTreeRef.value.getCheckedKeys()
            console.log(123,selectedReigonId.value)
        // }
        setRegionName()
    }
    //设置选中区域名
    function setRegionName(){
        let nodeList
        let nameList = []
        //判断选中是否根节点,根节点直接取选中node值
        if(DaTreeRef.value.getHalfCheckedNodes()){
            nodeList = DaTreeRef.value.getHalfCheckedNodes().concat(DaTreeRef.value.getCheckedNodes())
        }else{
            nodeList = DaTreeRef.value.getCheckedNodes()
        }
        nodeList.forEach((item)=>{
            nameList.push(item.label)
        })
        selectedReigonName.value = nameList.join()
        console.log('000',selectedReigonName.value,selectedReigonId.value)
    }
    //搜索样式
    const isExpand = ref(false)
    const iconRotated = ref({
        transform:'rotate(90deg)'
    })
    function setExpand(){
        isExpand.value = isExpand.value ? false : true
    }
    //获取设备列表
    const facilityList = ref([])
    async function getList(e){
        let postParams
        if(e){
            postParams = {limit:100,page:1,areaId:selectedReigonId.value[0]}
        }else{
            postParams = {limit:100,page:1}
        }
        await searchWaterFacilityApi(postParams).then((res) =>{
            if(res.code == 200){
                facilityList.value = res.data.list
                facilityList.value.forEach((item) =>{
                    item.onLineStateView = item.onLineState == 1 ? '在线' : (item.onLineState == 0 ? '离线' : '')
                })
            }
        })
    }
    function navTo(){
        uni.navigateTo({
            url:'/pagesAdmin/adminPlatform/facilityDetail'
        })
    }
    onMounted(async() =>{
        await getRegionList()
        await getList()
    })
</script>
<template>
    <view>
    <view class="container">
        <navbar title = '设备管理'></navbar>
        <view class="content">
            <view class="search">
                <view class="search-text">区域选择:</view>
                <view class="search-box">
                    <view class="placeholder" @click="setExpand">
                        <view v-if="selectedReigonName.length > 0" class="selected-Name"><text>{{selectedReigonName}}</text></view>
                        <text v-else>分区区域</text>
                        <image class="expand-icon" :style="isExpand ? '':iconRotated" src="../../static/images/maintain/expand.svg"></image>
                    </view>
                    <view v-if="isExpand" class="search-content">
                        <DaTree ref="DaTreeRef"
                            :data="regionListTree"
                            labelField="areaName"
                            valueField="id"
                            defaultExpandAll
                            :showRadioIcon='false'
                            @change="handleTreeChange"
                        </DaTree>
                    </view>
                </view>
                <view @click="getList(1)" class="search-btn">搜索</view>
            </view>
            <view class="main">
                <view class="item-box" v-for="(item,index) in facilityList" :key="index">
                    <view class="item">
                        <view class="item-left">
                            <text class="item-name">{{item.facilityName}}</text>
                            <view class="item-state">
                                设备状态
                                <text class="item-state-value">{{item.onLineStateView}}</text>
                            </view>
                        </view>
                        <view class="item-right" @click="navTo">
                            <text>查看详情</text>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
<style lang="scss" scoped>
    .container{
        width:100%;
        box-sizing: border-box;
        .content{
            height:calc(100vh - 176rpx);
            background: linear-gradient(to bottom,#8BC1FC 0%,#D2F2FE 30%,#D2F2FE 100%);
            padding:30rpx 40rpx 100rpx;
            box-sizing: border-box;
            .search{
                width:100%;
                height:130rpx;
                background:rgba(255,255,255,0.5);
                z-index:2;
                padding:30rpx 40rpx;
                box-sizing: border-box;
                border-radius:5rpx;
                .search-text{
                    float: left;
                    line-height:70rpx;
                    color:rgba(39, 39, 39, 0.8);
                }
                .search-btn{
                    float: right;
                    line-height:70rpx;
                    width:100rpx;
                    height:70rpx;
                    background: #a2c5fc;
                    text-align: center;
                    border-radius: 15rpx;
                }
                .search-box{
                    position:relative;
                    width:100%;
                    float: left;
                    width:320rpx;
                    height:70rpx;
                    background: #fff;
                    border-radius:10rpx;
                    .placeholder{
                        height:100%;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        color: #85898c;
                        padding:0 10rpx 0 20rpx ;
                        box-sizing: border-box;
                        .selected-Name{
                            height:100%;
                            color: #6f7375;
                            font-size:24rpx;
                            line-height:70rpx;
                            overflow: hidden;
                        }
                        .expand-icon{
                            width:44rpx;
                            height:44rpx;
                        }
                    }
                    .search-content{
                        position: absolute;
                        margin:0 auto;
                        z-index:2;
                        float: left;
                        width:100%;
                        background: rgba(255,255,255,0.7);
                        top:80rpx;
                    }
                }
            }
            .main{
                margin-top:4%;
                width:100%;
                height:86%;
                background:rgba(255, 255, 255,1);
                padding:30rpx;
                box-sizing: border-box;
                border-radius:5rpx;
                .item-box{
                    width:100%;
                    height:120rpx;
                    background: #f2f3f3;
                    margin-top:20rpx;
                    padding:20rpx;
                    box-sizing: border-box;
                    .item{
                        width:100%;
                        height:100%;
                        display:flex;
                        justify-content: space-between;
                        align-items: center;
                        .item-left{
                            height:100%;
                            display: flex;
                            flex-direction: column;
                            justify-content: space-evenly;
                            .item-name{
                                color: #3d84c7;
                            }
                            .item-state{
                                color: #9a9fa2;
                                font-size:28rpx;
                                .item-state-value{
                                    color: #eebe4c;
                                }
                            }
                        }
                        .item-right{
                            color: #5281c7;
                            font-size: 30rpx;
                        }
                    }
<style>
                }
            }
        }
    }
</style>
pagesAdmin/adminPlatform/facilityDetail.vue
对比新文件
@@ -0,0 +1,13 @@
<script setup>
</script>
<template>
    <view>
        <navbar title='设备详情'></navbar>
        设备详情
    </view>
</template>
<style lang="scss" scoped>
</style>
static/images/maintain/expand.svg
对比新文件
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732692767589" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4253" width="26" height="26" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M794.88 449.28l-268.8 268.8a37.12 37.12 0 0 1-53.76 0l-268.8-268.8C180.48 426.24 195.84 384 230.4 384H768c34.56 0 49.92 42.24 26.88 65.28z" fill="#bfbfbf" p-id="4254"></path></svg>
unpackage/dist/dev/mp-weixin/api/index.js
@@ -117,6 +117,12 @@
function getWaterConsumptionApi(data) {
  return util_request.request(`/homePage/getWaterConsumption`, data, "POST");
}
function getParentAreaApi() {
  return util_request.request(`/waterArea/getParentArea`, {}, "GET");
}
function searchWaterFacilityApi(data) {
  return util_request.request(`/waterFacility/search`, data, "POST");
}
exports.adminDetailApi = adminDetailApi;
exports.adminLoginApi = adminLoginApi;
exports.askShareApi = askShareApi;
@@ -130,6 +136,7 @@
exports.editShareTypeApi = editShareTypeApi;
exports.editUserInfoApi = editUserInfoApi;
exports.getAddressApi = getAddressApi;
exports.getParentAreaApi = getParentAreaApi;
exports.getPriceBySnApi = getPriceBySnApi;
exports.getRegionApi = getRegionApi;
exports.getRuleDetailApi = getRuleDetailApi;
@@ -152,6 +159,7 @@
exports.reportLossApi = reportLossApi;
exports.searchAddress = searchAddress;
exports.searchFacilityApi = searchFacilityApi;
exports.searchWaterFacilityApi = searchWaterFacilityApi;
exports.setAddressDefaultApi = setAddressDefaultApi;
exports.siteApi = siteApi;
exports.wxLoginApi = wxLoginApi;
unpackage/dist/dev/mp-weixin/app.js
@@ -29,6 +29,7 @@
  "./pages/wxScanWater/index.js";
  "./pagesAdmin/adminPlatform/home.js";
  "./pagesAdmin/adminPlatform/facility.js";
  "./pagesAdmin/adminPlatform/facilityDetail.js";
  "./pagesPoints/pointsMall/index.js";
  "./pagesPoints/pointsMall/pointsGetRecord/index.js";
  "./pagesPoints/pointsMall/pointsExchangeRecord/index.js";
unpackage/dist/dev/mp-weixin/app.json
@@ -31,7 +31,8 @@
      "root": "pagesAdmin",
      "pages": [
        "adminPlatform/home",
        "adminPlatform/facility"
        "adminPlatform/facility",
        "adminPlatform/facilityDetail"
      ]
    },
    {
unpackage/dist/dev/mp-weixin/common/assets.js
@@ -1,12 +1,12 @@
"use strict";
const _imports_0$e = "/static/images/login/logo.png";
const _imports_0$f = "/static/images/login/logo.png";
const _imports_1$9 = "/static/images/login/wx.png";
const _imports_2$2 = "/static/images/login/close_pwd.png";
const _imports_3$3 = "/static/images/login/open_pwd.png";
const _imports_4$3 = "/static/images/login/switchto.svg";
const _imports_0$d = "/static/images/index/head.png";
const _imports_0$e = "/static/images/index/head.png";
const _imports_1$8 = "/static/images/index/back.png";
const _imports_0$c = "/static/images/index/card11.png";
const _imports_0$d = "/static/images/index/card11.png";
const _imports_3$2 = "/static/images/index/code1.png";
const _imports_4$2 = "/static/images/index/vip-add.png";
const _imports_5$1 = "/static/images/index/home21.png";
@@ -19,23 +19,24 @@
const _imports_12 = "/static/images/index/icon51.png";
const _imports_13 = "/static/images/index/more-info5.png";
const _imports_14 = "/static/images/index/notice5.png";
const _imports_0$b = "/static/images/addCard/code.png";
const _imports_0$c = "/static/images/addCard/code.png";
const _imports_1$6 = "/static/images/other/more.png";
const _imports_0$a = "/static/images/other/expand.png";
const _imports_0$b = "/static/images/other/expand.png";
const _imports_1$5 = "/static/images/other/nodata.png";
const _imports_0$9 = "/static/images/other/code-none.png";
const _imports_0$8 = "/static/images/address/edit.png";
const _imports_0$a = "/static/images/other/code-none.png";
const _imports_0$9 = "/static/images/address/edit.png";
const _imports_1$4 = "/static/images/address/delete.png";
const _imports_0$7 = "/static/images/address/expand.png";
const _imports_0$6 = "/static/images/other/success.png";
const _imports_0$5 = "/static/logo.png";
const _imports_0$8 = "/static/images/address/expand.png";
const _imports_0$7 = "/static/images/other/success.png";
const _imports_0$6 = "/static/logo.png";
const _imports_1$3 = "/static/images/other/img-add.png";
const _imports_0$4 = "/static/images/other/home.svg";
const _imports_0$3 = "/static/images/maintain/maintenance-head.svg";
const _imports_0$5 = "/static/images/other/home.svg";
const _imports_0$4 = "/static/images/maintain/maintenance-head.svg";
const _imports_1$2 = "/static/images/maintain/fun-icon1.svg";
const _imports_2$1 = "/static/images/maintain/fun-icon2.svg";
const _imports_3$1 = "/static/images/maintain/fun-icon3.svg";
const _imports_4$1 = "/static/images/maintain/fun-icon4.svg";
const _imports_0$3 = "/static/images/maintain/expand.svg";
const _imports_0$2 = "/static/images/pointMall/back.svg";
const _imports_1$1 = "/static/images/pointMall/points.svg";
const _imports_2 = "/static/images/pointMall/points-icon.svg";
@@ -50,19 +51,20 @@
const _imports_0 = "/static/images/other/navBack.svg";
exports._imports_0 = _imports_0;
exports._imports_0$1 = _imports_0$2;
exports._imports_0$10 = _imports_0$6;
exports._imports_0$11 = _imports_0$5;
exports._imports_0$12 = _imports_0$4;
exports._imports_0$13 = _imports_0$3;
exports._imports_0$14 = _imports_0$1;
exports._imports_0$2 = _imports_0$e;
exports._imports_0$3 = _imports_0$c;
exports._imports_0$4 = _imports_0$d;
exports._imports_0$5 = _imports_0$b;
exports._imports_0$6 = _imports_0$a;
exports._imports_0$7 = _imports_0$9;
exports._imports_0$8 = _imports_0$8;
exports._imports_0$9 = _imports_0$7;
exports._imports_0$10 = _imports_0$7;
exports._imports_0$11 = _imports_0$6;
exports._imports_0$12 = _imports_0$5;
exports._imports_0$13 = _imports_0$4;
exports._imports_0$14 = _imports_0$3;
exports._imports_0$15 = _imports_0$1;
exports._imports_0$2 = _imports_0$f;
exports._imports_0$3 = _imports_0$d;
exports._imports_0$4 = _imports_0$e;
exports._imports_0$5 = _imports_0$c;
exports._imports_0$6 = _imports_0$b;
exports._imports_0$7 = _imports_0$a;
exports._imports_0$8 = _imports_0$9;
exports._imports_0$9 = _imports_0$8;
exports._imports_1 = _imports_1$9;
exports._imports_1$1 = _imports_1$7;
exports._imports_1$2 = _imports_1$8;
unpackage/dist/dev/mp-weixin/common/vendor.js
@@ -8077,6 +8077,12 @@
        style: {
          navigationStyle: "custom"
        }
      },
      {
        path: "adminPlatform/facilityDetail",
        style: {
          navigationBarTitleText: ""
        }
      }
    ]
  },
unpackage/dist/dev/mp-weixin/pages/index/index.js
@@ -325,7 +325,7 @@
      } : {}) : {}, {
        B: topHeight.value + "rpx",
        C: common_assets._imports_5,
        D: common_vendor.o(upGrade),
        D: common_vendor.o(($event) => navTo("/pages/preSendWater/index")),
        E: common_assets._imports_1$1,
        F: common_vendor.o(($event) => navTo("/pages/facilityList/index")),
        G: common_assets._imports_7,