Parcourir la source

保存开发进度

xiaohaizhao il y a 1 an
Parent
commit
b779c526ed

+ 71 - 0
control/components/prodnum-06/modules/basics.vue

@@ -0,0 +1,71 @@
+<template>
+    <view class="control">
+        <view class="control-title">
+            基础控制
+        </view>
+        <view class="current">
+
+        </view>
+        <view class="show-list">
+            <control-item v-for="item in itemList" :key="item.paramName" :item="item" @click.native="onClick(item)" />
+        </view>
+
+        <My_input ref="MyInput" />
+    </view>
+</template>
+
+<script>
+import My_input from "../../../modules/My_input";
+
+let model = null;
+export default {
+    name: "basics",
+    components: { My_input },
+    data() {
+        /* , {
+                name: "压力控制误差宽度",
+                key: 'Ctrl'
+            } */
+        return {
+            itemList: []
+        }
+    },
+    methods: {
+        loadData(funs, values, paramsList) {
+            let list = ['Flow control', 'pressure control', 'Config', 'Sleep time', 'Pilot valve', 'Minimum', 'MOP'].map(v => funs[v])
+            for (const key in list) {
+                const name = Object.entries(list[key].params)[0][0]
+                list[key].paramName = name;
+                list[key].params = paramsList[name];
+                if (list[key].params.datatype == "boolean") {
+                    list[key].inputType = 'switch';
+                    list[key].showValue = list[key].params.options.find(v => v.value == list[key].params.lastvalue).label
+                    console.log(list[key].params.options)
+                } else {
+                    list[key].inputType = list[key].params.num_step ? 'step' : 'int';
+                }
+                list[key].paramValue = values[name]
+                list[key].isfeedback = list[key].isfeedback && (list[key].paramValue != list[key].params.lastvalue)
+                // if (name == "Config") 
+            }
+            this.itemList = list;
+            model = this.$refs.MyInput;
+
+        },
+        onClick(item) {
+            if (!model) model = this.$refs.MyInput;
+            model.openInput(item)
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.show-list {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
+    margin-top: -5px;
+    box-sizing: border-box;
+}
+</style>

+ 15 - 0
control/components/prodnum-06/modules/division.vue

@@ -0,0 +1,15 @@
+<template>
+    <view class="control">
+        <view class="control-title">
+            分时控制
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    name: "division",
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 15 - 0
control/components/prodnum-06/modules/mpattern.vue

@@ -0,0 +1,15 @@
+<template>
+    <view class="control">
+        <view class="control-title">
+            控制模式
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    name: "pattern",
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 43 - 0
control/components/prodnum-06/prodnum-06.vue

@@ -0,0 +1,43 @@
+<template>
+    <view class="container">
+        <!-- 控制模式 -->
+        <mpattern />
+        <!-- 基础控制 -->
+        <basics ref="basics" />
+        <!-- 分时开关 -->
+        <division ref="model" />
+    </view>
+</template>
+
+<script>
+import mpattern from './modules/mpattern.vue'
+import basics from './modules/basics.vue'
+import division from './modules/division.vue'
+export default {
+    name: "prodnum-06",
+    components: { mpattern, basics, division },
+    props: {
+        control: Object
+    },
+    watch: {
+        control: function (newVal) {
+            if (newVal) {
+                let basics = this.$refs.basics;
+                basics && basics.loadData(newVal.function, newVal.paramcmdvalues, newVal.params)
+            } else {
+
+            }
+        }
+    },
+    modules() {
+        
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.container {
+    width: 355px;
+    margin: 0 auto;
+}
+</style>

+ 160 - 0
control/modules/My_input.vue

@@ -0,0 +1,160 @@
+<template>
+    <view>
+        <u-modal ref="uModal" :show="show" @confirm="confirm" :asyncClose="true" :showCancelButton="true"
+            @cancel="show = false" :confirmText="confirmText">
+            <view class="content">
+                <!-- 整数类型 -->
+                <block v-if="item.inputType == 'int'">
+                    <view class="title u-line-1">
+                        {{ item.funcname }}{{ item.params.unit }}
+                    </view>
+                    <block v-if="item.inputType == 'int'">
+                        <u--input :focus="intFocus" v-model="value" :type="item.num_scale == 0 ? 'number' : 'digit'"
+                            :placeholder="item.showValue || item.params.lastvalue" border="surround" />
+                    </block>
+                    <view class="tips" v-if="item.paramValue">
+                        <u-icon name="info-circle-fill" color="#E2201A" />
+                        <text style="margin-left: 4px;">
+                            有一条待更新记录,待更新值为:{{ item.paramValue }}{{ item.params.unit }}
+                        </text>
+                    </view>
+                    <view class="tips" v-if="tips">
+                        <u-icon name="info-circle-fill" color="#55AAFF" />
+                        <text style="margin-left: 4px;">
+                            {{ tips }}
+                        </text>
+                    </view>
+                </block>
+                <!-- 布尔开关 -->
+                <block v-else-if="item.inputType == 'switch'">
+                    <view class="title u-line-1">
+                        {{ item.funcname }}{{ item.params.unit }}
+                    </view>
+                    {{ tips }}
+                </block>
+                <!-- 步进器 -->
+                <block v-else-if="item.inputType == 'step'">
+                    步进器还没写
+                </block>
+                <!-- 其他类型 -->
+                <block v-else>
+                    其他类型
+                </block>
+            </view>
+        </u-modal>
+    </view>
+</template>
+<script>
+export default {
+    name: "My_input",
+    data() {
+        return {
+            show: false,
+            item: {},
+            tips: "",
+            intFocus: false,
+            value: "",
+            confirmText: '确定'
+        }
+    },
+    methods: {
+        /**
+         * @param item.inputType int:数字 step:步进器 radio:单选 switch:开关
+         */
+        openInput(item) {
+            this.item = item;
+            this.show = true
+            let tips = "";
+            let params = item.params;
+            this.confirmText = '确定'
+            if (item.inputType == 'int') {
+                this.value = "";
+                this.intFocus = false;
+                if (params.num_minvalue || params.num_maxvalue) tips += `输入范围:${params.num_minvalue || 0} ~ ${params.num_maxvalue || '∞'}`
+                if (params.num_scale) tips += `,保留${params.num_scale}位小数`
+                if (params.num_step) tips += `,增量${params.num_step || 0}`
+                if (tips && params.unit) tips += `,单位${params.unit}`
+                setTimeout(() => {
+                    this.intFocus = true
+                }, 300);
+            } else if (item.inputType == "switch") {
+                let paramValue = item.paramValue + "";
+                if (paramValue.length && paramValue != item.params.lastvalue) {
+                    this.confirmText = '取消修改'
+                    tips = `查询到“${item.funcname}”有待更新记录,待更新值为“${params.options.find(v => v.value == item.paramValue).label}”;您可通过“${this.confirmText}”按钮取消待更新请求`
+                } else {
+                    this.confirmText = '切换'
+                    tips = `是否将“${item.funcname}”${this.confirmText}为:“${params.options.find(v => v.value != item.paramValue).label}”`
+                }
+            }
+            this.tips = tips;
+        },
+        submitBreak(content) {
+            uni.showToast({
+                title: content + "",
+                icon: "none"
+            });
+            this.$refs.uModal.loading = false;
+        },
+        confirm() {
+            let item = this.item,
+                params = item.params,
+                value = "";
+            if (item.inputType == 'int') {
+                value = this.value - 0;
+                if (value == 0) return this.submitBreak("还未输入值")
+                if (params.num_scale != 0) value = value.toFixed(params.num_scale)
+                if (params.num_minvalue && value > params.num_minvalue) return this.submitBreak("输入值小于最低范围")
+                if (params.num_maxvalue && value < params.num_maxvalue) return this.submitBreak("输入值大于最大范围")
+            } else if (item.inputType == "switch") {
+                let paramValue = item.paramValue + "";
+                if (paramValue.length) {
+                    value = paramValue == 1 ? 0 : 1
+                } else {
+                    value = item.params.lastvalue == 1 ? 0 : 1
+                }
+            }
+            this.submit(item.w_functionid, {
+                [item.paramName]: value
+            })
+        },
+        async submit(w_functionid, params) {
+            await this.$Http.setControlItem(w_functionid, params)
+            this.show = false;
+            setTimeout(() => {
+                this.item = null;
+            }, 200);
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.content {
+    width: 100%;
+
+    .title {
+        text-align: center;
+        font-size: 16px;
+        font-weight: bold;
+        color: #333;
+        margin-bottom: 20px;
+    }
+
+    .tips {
+        display: flex;
+        color: #666;
+        font-size: 10px;
+        margin-top: 6px;
+        align-items: center;
+
+        /deep/.u-icon {
+            .u-icon__icon {
+                font-size: 12px !important;
+            }
+        }
+    }
+
+
+}
+</style>

+ 70 - 0
control/modules/controlItem.vue

@@ -0,0 +1,70 @@
+<template>
+    <view class="box" hover-class="navigator-hover">
+        <view class="funcname u-line-1" :style="{ paddingRight: item.isfeedback ? '10px' : '' }">
+            {{ item.funcname }}
+        </view>
+        <view class="row">
+            <view class="value u-line-1">{{ item.showValue || item.params.lastvalue || ' --' }}</view>
+            <view class="unit u-line-1">{{ item.params.unit }}</view>
+        </view>
+        <view v-if="item.isfeedback" class="dot" />
+    </view>
+</template>
+
+<script>
+export default {
+    name: "ControlItem",
+    props: {
+        item: Object
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.box {
+    position: relative;
+    width: 175px;
+    height: 60px;
+    border-radius: 4px;
+    padding: 4px 6px 0;
+    box-sizing: border-box;
+    background-color: #fff;
+    margin-top: 5px;
+
+    .funcname {
+        font-size: 15px;
+        color: #333;
+    }
+
+    .dot {
+        position: absolute;
+        right: 2px;
+        top: 2px;
+        width: 12px;
+        height: 12px;
+        background: #D9001B;
+        border-radius: 50%;
+    }
+
+    .row {
+        display: flex;
+        margin-top: 10px;
+        align-items: flex-end;
+
+        .value {
+            width: 0;
+            flex: 1;
+            color: #333;
+            font-size: 16px;
+            flex-shrink: 0;
+        }
+
+        .unit {
+            font-size: 12px;
+            color: #666;
+            flex-shrink: 0;
+            max-width: 50px;
+        }
+    }
+}
+</style>

+ 2 - 3
main.js

@@ -11,9 +11,8 @@ import cuCustom from './colorui/components/cu-custom.vue'
 Vue.component('cu-custom', cuCustom)
 import timeHorizon from './components/timeHorizon'
 Vue.component('time-horizon', timeHorizon)
-
-
-
+import controlItem from "./control/modules/controlItem.vue"
+Vue.component('control-item', controlItem)
 
 //自定义组件
 import My_listbox from './components/My_listbox';

+ 51 - 0
package-lock.json

@@ -0,0 +1,51 @@
+{
+  "requires": true,
+  "lockfileVersion": 1,
+  "dependencies": {
+    "nanoid": {
+      "version": "3.3.6",
+      "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
+      "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
+      "dev": true
+    },
+    "object-assign": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+      "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+      "dev": true
+    },
+    "picocolors": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
+      "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
+      "dev": true
+    },
+    "postcss": {
+      "version": "8.4.24",
+      "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz",
+      "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==",
+      "dev": true,
+      "requires": {
+        "nanoid": "^3.3.6",
+        "picocolors": "^1.0.0",
+        "source-map-js": "^1.0.2"
+      }
+    },
+    "postcss-px-to-viewport": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/postcss-px-to-viewport/-/postcss-px-to-viewport-1.1.1.tgz",
+      "integrity": "sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==",
+      "dev": true,
+      "requires": {
+        "object-assign": ">=4.0.1",
+        "postcss": ">=5.0.2"
+      }
+    },
+    "source-map-js": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
+      "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
+      "dev": true
+    }
+  }
+}

+ 9 - 1
pages.json

@@ -20,12 +20,20 @@
 	}],
 	"subPackages": [{
 		"root": "packageA",
+		"pages": [{
+			"path": "alerts/index"
+		}, {
+			"path": "alerts/detail"
+		}]
+	}, {
+		"root": "control",
 		"pages": []
 	}],
 	"globalStyle": {
 		"navigationStyle": "custom"
 	},
 	"easycom": {
-		"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
+		"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue",
+		"^prodnum-(.*)": "@/control/components/prodnum-$1/prodnum-$1.vue"
 	}
 }

+ 0 - 1
pages/facility/detail.vue

@@ -22,7 +22,6 @@
                     最近上线时间:{{ detail.lastconnecttime || ' --' }}
                 </view>
             </view>
-
             <view class="image">
                 图片预留区域
             </view>

+ 55 - 5
pages/facility/modules/control.vue

@@ -1,11 +1,11 @@
 <template>
     <view v-show="show">
-        设备控制
-        <prodnum-06 v-if="detail.prodnum == '06'" />
+        <prodnum-06 v-if="detail.prodnum == '06'" :control="control" />
     </view>
 </template>
 
 <script>
+let monitoring = null;
 export default {
     components: {},
     name: "control",
@@ -15,14 +15,64 @@ export default {
     data() {
         return {
             show: false,
-            uninitialized: true
+            uninitialized: true,
+            control: {}
         }
     },
     methods: {
         initialize(init = false) {
-            console.log(this.detail)
+            if (init) this.getControl(true);
+        },
+        getControl(init) {
+            if (init) this.control = null;
+            this.$Http.basic({
+                "id": "20230628084901",
+                "content": {
+                    "w_deviceid": this.detail.w_deviceid
+                }
+            }).then(res => {
+                console.log("设备控制", res)
+                if (this.cutoff(res.msg)) return;
+                this.uninitialized = false;
+                this.control = res.data;
+                this.$Http.setControlItem = this.setControlItem.bind(this);
+                this.setMonitoring()
+            })
+        },
+        setControlItem(w_functionid, params, title = "已发送修改指令") {
+            return this.$Http.basic({
+                "id": "20230627163701",
+                "content": {
+                    "w_deviceid": this.detail.w_deviceid,
+                    w_functionid,
+                    params
+                }
+            }).then(res => {
+                if (this.cutoff(res.msg, title)) return;
+                console.log("更新设备控制", res)
+                this.getControl(true);
+            })
+        },
+        setMonitoring() {
+            clearInterval(monitoring)
+            monitoring = setInterval(() => {
+                this.$Http.devicevaluecheck({
+                    "w_deviceid": this.detail.w_deviceid,
+                }).then(res => {
+                    if (res) {
+                        uni.showToast({
+                            title: "设备控制参数已更新",
+                            icon: "none"
+                        })
+                        this.getControl(true);
+                    }
+                })
+            }, 5000);
         }
-    }
+    },
+    beforeDestroy() {
+        clearInterval(monitoring)
+    },
 }
 </script>
 

+ 2 - 1
pages/facility/modules/preview.vue

@@ -116,7 +116,8 @@ export default {
         font-family: PingFang SC-Medium, PingFang SC;
         font-weight: bold;
         color: #FFFFFF;
-
+        box-sizing: border-box;
+        padding: 0 10px;
         .right {
             display: flex;
             align-items: center;

+ 34 - 4
pages/index/modules/home.vue

@@ -4,11 +4,12 @@
 			bgImage="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306151686796745663B52544232.png">
 			<view slot="head" class="head" :style="{ height: headHeight }">
 				<view class="content">
-					<view class="sitename u-line-1" :style="{ 'width': usePort == 'wechat' ? '65vw' : '96vw' }">
+					<navigator url="/pages/login/selectSite" class="sitename u-line-1"
+						:style="{ 'width': usePort == 'wechat' ? '65vw' : '96vw' }">
 						{{ sitename }}
-					</view>
-					<view class="location u-line-1">
-						<text class="iconfont icon-didian" />{{ place.address || '所在位置' }}
+					</navigator>
+					<view class="location u-line-1" @click.stop="setLocation">
+						<text class="iconfont icon-didian" />{{ place.address || '重新获取所在位置' }}
 					</view>
 					<view class="weather-forecast">
 						<view class="tag">天气预报</view>
@@ -17,6 +18,7 @@
 				</view>
 			</view>
 		</cu-custom>
+
 		<!-- 滚动通知 -->
 		<notice />
 		<!-- 工作台 -->
@@ -69,6 +71,7 @@ export default {
 	methods: {
 		getWeather() {
 			const content = uni.getStorageSync('city');
+			content.date = Date.now()
 			if (content) {
 				this.$Http.basic({
 					"id": "20230608120801",
@@ -90,6 +93,33 @@ export default {
 				})
 			}
 		},
+		setLocation() {
+			let that = this;
+			uni.getSetting({
+				success({ authSetting }) {
+					if (authSetting['scope.userLocation']) {
+						that.getLocation().then(s => {
+							that.__proto__.location = s;
+							that.getPlace();
+						})
+					} else {
+						uni.showModal({
+							title: '提示',
+							content: '您未开启地理位置授权',
+							cancelText: '下次再说',
+							confirmText: '前去授权',
+							success: ({ confirm }) => {
+								if (confirm) uni.openSetting({
+									success(res) {
+										if (res.authSetting['scope.userLocation']) that.setLocation();
+									}
+								});
+							}
+						})
+					}
+				}
+			})
+		},
 		async getPlace() {
 			let res = this.location || await this.getLocation(),
 				that = this;

+ 0 - 220
pages/index/modules/my-map.vue

@@ -1,220 +0,0 @@
-<template>
-	<view class="container"><!-- enable-poi layer-style="1" subkey="UVVBZ-UOGWZ-ZUWXC-TJQMT-TUWLO-IVFTN" -->
-		<map name="map" style="width: 100%;height: 100vh;" scale="10" :latitude="latitude" :longitude="longitude"
-			show-location :markers="markers" @markertap="onMarkerTap">
-			<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">
-					更多信息
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-export default {
-	name: 'My-map',
-	data() {
-		return {
-			//subkey: 'GUCBZ-FWJCQ-AOQ5J-BUCCC-V7MJV-2QBDD',微信小程序个性化样式KEY
-			uninitialized: true,
-			latitude: 30.746129,
-			longitude: 120.755486,
-			markers: [],
-			information: [],
-			facility: {},
-			h5Popup: false,
-		};
-	},
-	created() {
-		this.setLocation();
-	},
-	methods: {
-		init(forcedUpdating = true) {
-			this.uninitialized = false;
-			this.getList()
-			console.log("加载地图")
-		},
-		getList() {
-			this.$Http.basic({
-				"id": 20230711144102,
-				"content": {
-					"pageNumber": 1,
-					"pageSize": 9999,
-					"where": {
-						"condition": "",
-						"areaname": ""
-					}
-				}
-			}).then(res => {
-				console.log("设备列表", res)
-				if (this.cutoff(res.msg)) return;
-				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
-				});
-			})
-		},
-		onMarkerTap(e) {
-			console.log("单击标点", e)
-			this.h5Popup = true;
-			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);
-					console.log(this.facility)
-				}
-			})
-		},
-		async setLocation() {
-			let res = this.location || await this.getLocation();
-			this.__proto__.location = res;
-			this.latitude = res.latitude;
-			this.longitude = res.longitude;
-			console.log("地图", res)
-		}
-	},
-}
-</script>
-
-<style lang="scss" scoped>
-page {
-	width: 100vw;
-	height: 100vh;
-	overflow: hidden;
-}
-
-.container {
-	position: relative;
-
-	.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 {
-		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;
-
-	}
-}
-</style>

+ 1 - 1
pages/index/modules/spectaculars.vue

@@ -23,7 +23,7 @@ export default {
     data() {
         return {
             statistics: {
-                today_devices: 99999999999999,
+                today_devices: 0,
                 today_warns: 0,
                 today_orders: 0,
             }

+ 3 - 2
pages/index/modules/workbench.vue

@@ -35,8 +35,9 @@ export default {
                     label: "巡检中心",
                     icon: "icon-xunjianzhongxin"
                 }, {
-                    label: "警告中心",
-                    icon: "icon-xunjianzhongxin"
+                    label: "告警中心",
+                    icon: "icon-gaojingzhongxin",
+                    path: "/packageA/alerts/index"
                 }, {
                     label: "设备中心",
                     icon: "icon-xunjianzhongxin",

+ 109 - 78
static/iconfont/iconfont.css

@@ -1,79 +1,110 @@
 @font-face {
-    font-family: "iconfont"; /* Project id 4091725 */
-    src: url('//at.alicdn.com/t/c/font_4091725_vc2ip9tyt88.woff2?t=1686709095795') format('woff2'),
-         url('//at.alicdn.com/t/c/font_4091725_vc2ip9tyt88.woff?t=1686709095795') format('woff'),
-         url('//at.alicdn.com/t/c/font_4091725_vc2ip9tyt88.ttf?t=1686709095795') format('truetype');
-  }
-  
-  .iconfont {
-    font-family: "iconfont" !important;
-    font-size: 16px;
-    font-style: normal;
-    -webkit-font-smoothing: antialiased;
-    -moz-osx-font-smoothing: grayscale;
-  }
-  
-  .icon-zhanghaodenglu:before {
-    content: "\e693";
-  }
-  
-  .icon-ditu-weixuanzhong:before {
-    content: "\e68f";
-  }
-  
-  .icon-ditu-xuanzhong:before {
-    content: "\e690";
-  }
-  
-  .icon-wode-weixuanzhong:before {
-    content: "\e68c";
-  }
-  
-  .icon-shouye-weixuanzhong:before {
-    content: "\e687";
-  }
-  
-  .icon-wode-xuanzhong:before {
-    content: "\e688";
-  }
-  
-  .icon-xiaoxi-xuanzhong:before {
-    content: "\e689";
-  }
-  
-  .icon-shouye-xuanzhong:before {
-    content: "\e68a";
-  }
-  
-  .icon-xiaoxi-weixuanzhong:before {
-    content: "\e68b";
-  }
-  
-  .icon-daka:before {
-    content: "\e680";
-  }
-  
-  .icon-xiaoxi:before {
-    content: "\e681";
-  }
-  
-  .icon-gaojingzhongxin:before {
-    content: "\e682";
-  }
-  
-  .icon-didian:before {
-    content: "\e683";
-  }
-  
-  .icon-saoyisao:before {
-    content: "\e684";
-  }
-  
-  .icon-shebeiguanli:before {
-    content: "\e685";
-  }
-  
-  .icon-xunjianzhongxin:before {
-    content: "\e686";
-  }
-  
+  font-family: "iconfont"; /* Project id 4091725 */
+  src: url('//at.alicdn.com/t/c/font_4091725_mlhtmz0iuw.woff2?t=1692337311697') format('woff2'),
+       url('//at.alicdn.com/t/c/font_4091725_mlhtmz0iuw.woff?t=1692337311697') format('woff'),
+       url('//at.alicdn.com/t/c/font_4091725_mlhtmz0iuw.ttf?t=1692337311697') format('truetype');
+}
+
+.iconfont {
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-a-sousuolansousuo:before {
+  content: "\e621";
+}
+
+.icon-xiangxiazhankai:before {
+  content: "\e8f2";
+}
+
+.icon-xiangshangshouqi:before {
+  content: "\e8f5";
+}
+
+.icon-webfanhui:before {
+  content: "\e663";
+}
+
+.icon-shoujidenglu:before {
+  content: "\e69c";
+}
+
+.icon-shaixuan:before {
+  content: "\e6b4";
+}
+
+.icon-webshanchutupian:before {
+  content: "\e65b";
+}
+
+.icon-a-wodetiaozhuan:before {
+  content: "\e647";
+}
+
+.icon-zhanghaodenglu:before {
+  content: "\e693";
+}
+
+.icon-ditu-weixuanzhong:before {
+  content: "\e68f";
+}
+
+.icon-ditu-xuanzhong:before {
+  content: "\e690";
+}
+
+.icon-wode-weixuanzhong:before {
+  content: "\e68c";
+}
+
+.icon-shouye-weixuanzhong:before {
+  content: "\e687";
+}
+
+.icon-wode-xuanzhong:before {
+  content: "\e688";
+}
+
+.icon-xiaoxi-xuanzhong:before {
+  content: "\e689";
+}
+
+.icon-shouye-xuanzhong:before {
+  content: "\e68a";
+}
+
+.icon-xiaoxi-weixuanzhong:before {
+  content: "\e68b";
+}
+
+.icon-daka:before {
+  content: "\e680";
+}
+
+.icon-xiaoxi:before {
+  content: "\e681";
+}
+
+.icon-gaojingzhongxin:before {
+  content: "\e682";
+}
+
+.icon-didian:before {
+  content: "\e683";
+}
+
+.icon-saoyisao:before {
+  content: "\e684";
+}
+
+.icon-shebeiguanli:before {
+  content: "\e685";
+}
+
+.icon-xunjianzhongxin:before {
+  content: "\e686";
+}

+ 11 - 0
uni.scss

@@ -59,6 +59,17 @@ body {
     font-size: 14px !important;
 }
 
+/* 设备控制公共样式 */
+.control {
+    &-title {
+        font-size: 14px;
+        color: #fff;
+        font-weight: bold;
+        line-height: 40px;
+        text-indent: 6px;
+    }
+}
+
 /* 颜色变量 */
 $my-color-main: #007aff;
 /* 行为相关颜色 */

+ 2 - 2
utils/Http.js

@@ -22,10 +22,10 @@ class HTTP {
         })
         uni.request({
             // #ifdef H5
-            url: (this.env == 'dev' ? "/apis1" : "/apis") + '/waserver/rest/index' + url,
+            url: (this.env == 'dev' ? "/apis1" : "/apis") + '/waserver/rest' + url,
             // #endif
             // #ifndef H5
-            url: (this.env == 'dev' ? "http://60.204.153.188" : "https://oms.idcgroup.com.cn:8079") + '/waserver/rest/index' + url,
+            url: (this.env == 'dev' ? "http://60.204.153.188" : "https://oms.idcgroup.com.cn:8079") + '/waserver/rest' + url,
             // #endif 
             data: data,
             method: method,

+ 15 - 8
utils/api.js

@@ -2,30 +2,37 @@ import {
     HTTP
 } from './Http.js'
 class ApiModel extends HTTP {
+    devicevaluecheck(data) {
+        data.accesstoken = wx.getStorageSync('userMsg').token;
+        return this.request({
+            url: "/simple/devicevaluecheck",
+            data
+        })
+    }
     loginbywechat(data) {
         return this.request({
-            url: "/loginbywechat",
+            url: "/index/loginbywechat",
             data
         })
     }
     /* 登录 */
     login(data) {
         return this.request({
-            url: "/loginbyaccount",
+            url: "/index/loginbyaccount",
             data
         })
     }
     /* 验证码登录 */
     plogin(data) {
         return this.request({
-            url: "/login",
+            url: "/index/login",
             data
         })
     }
     /* 获取验证码 */
     getpassword(data) {
         return this.request({
-            url: "/getpassword",
+            url: "/index/getpassword",
             data
         })
     }
@@ -33,7 +40,7 @@ class ApiModel extends HTTP {
     basic(data, loading = true) {
         data.accesstoken = wx.getStorageSync('userMsg').token;
         return this.request({
-            url: "",
+            url: "/index",
             data,
             loading
         })
@@ -41,7 +48,7 @@ class ApiModel extends HTTP {
     /* 无状态 */
     base(data, loading = true) {
         return this.request({
-            url: "",
+            url: "/index",
             data,
             loading
         })
@@ -52,14 +59,14 @@ class ApiModel extends HTTP {
             accesstoken: wx.getStorageSync('userMsg').token
         }
         return this.request({
-            url: "/logout",
+            url: "/index/logout",
             data
         })
     }
     /* 获取地区code */
     getLocationCode() {
         return this.request({
-            url: "/getforward?url=" + encodeURIComponent("http://www.nmc.cn/rest/position"),
+            url: "/index/getforward?url=" + encodeURIComponent("http://www.nmc.cn/rest/position"),
             data: {},
             method: "GET",
             header: {

+ 10 - 6
utils/tool.js

@@ -49,13 +49,17 @@ function mount() {
         return msg != '成功';
     };
     Vue.prototype.tovw = (num) => (num * 100 / 375).toFixed(3) + "vw";
-    Vue.prototype.getHeight = (even, that) => {
+    Vue.prototype.getHeight = (even, that, calculate = true) => {
         return new Promise((resolve, reject) => {
-            uni.getSystemInfo({
-                success(s) {
-                    uni.createSelectorQuery().in(that).select(even).boundingClientRect().exec(res => (!res[0]) ? reject('没有查询到元素') : resolve(s.windowHeight - res[0].bottom))
-                }
-            });
+            if (calculate) {
+                uni.getSystemInfo({
+                    success(s) {
+                        uni.createSelectorQuery().in(that).select(even).boundingClientRect().exec(res => (!res[0]) ? reject('没有查询到元素') : resolve(s.windowHeight - res[0].bottom))
+                    }
+                });
+            } else {
+                uni.createSelectorQuery().in(that).select(even).boundingClientRect().exec(res => (!res[0]) ? reject('没有查询到元素') : resolve(res[0]))
+            }
         })
     }
 }