quanyawei
2023-11-06 a09099de00d6c13ebdaefb97f4c119948d73a7a3
fix:小程序订阅消息
1 files deleted
4 files modified
166 ■■■■■ changed files
pages.json 6 ●●●●● patch | view | raw | blame | history
pages/actionChange/newPage/index.vue 14 ●●●● patch | view | raw | blame | history
pages/actionChange/secondLevelData/index.vue 66 ●●●● patch | view | raw | blame | history
pages/login/login.vue 6 ●●●● patch | view | raw | blame | history
pages/login/register/register.vue 74 ●●●●● patch | view | raw | blame | history
pages.json
@@ -15,11 +15,9 @@
            "enablePullDownRefresh": false
        }
    }, {
        "path": "pages/login/login"
    }, {
        "path": "pages/login/register/register",
        "path": "pages/login/login",
        "style": {
            "navigationBarTitleText": "注册",
            "navigationBarTitleText": "登录",
            "enablePullDownRefresh": false
        }
    }, {
pages/actionChange/newPage/index.vue
@@ -35,8 +35,10 @@
                    type="select" />
                <u-icon slot="right" name="arrow-right" />
            </u-form-item>
            <u-form-item border-bottom label="限期天数:" placeholder="请输入" required>
                <u-input v-model="form.changeDay" border="none" type="number" />
            <u-form-item border-bottom label="限期天数:" placeholder="请输入" required
                :disabled='Number(sumbitForm.changeType)===1'>
                <u-input v-model="form.changeDay" border="none" type="number"
                    :disabled='Number(sumbitForm.changeType)===1' />
            </u-form-item>
            <u-form-item border-bottom label="上报单位:" prop="escalationUnitId" required @click="
                    showCheckBox = true;
@@ -218,6 +220,14 @@
                console.log(e)
                this.form[this.currentKey] = e.value[0].label
                this.sumbitForm[this.currentKey] = e.value[0].id
                console.log('this.form.changeType', this.currentKey)
                if (Number(this.sumbitForm.changeType) !== 1) {
                    this.sumbitForm.changeDay = '0'
                    this.form.changeDay = '0'
                } else {
                    this.sumbitForm.changeDay = ''
                    this.form.changeDay = ''
                }
                this.showCheckBox = false
            },
            checkTime(e) {
pages/actionChange/secondLevelData/index.vue
@@ -4,16 +4,16 @@
            <view class="ridoaBox">
                <u-radio-group v-model="value" placement="row" :size='radioOption.size'
                    :labelColor='radioOption.labelColor' :labelSize='radioOption.labelSize' @change='changeSearchType'>
                    <u-radio activeColor="#19be6b" label="Mac号询" name="1" :labelSize='radioOption.labelSize'
                    <u-radio activeColor="#19be6b" label="Mac号/站点名称" name="1" :labelSize='radioOption.labelSize'
                        :labelColor='radioOption.labelColor'></u-radio>
                    <u-radio activeColor="#19be6b" label="站点查询" name="0" :labelSize='radioOption.labelSize'
                    <u-radio activeColor="#19be6b" label="站点" name="0" :labelSize='radioOption.labelSize'
                        :labelColor='radioOption.labelColor'></u-radio>
                    <u-radio activeColor="#19be6b" label="特殊设备查询" name="2" :labelSize='radioOption.labelSize'
                    <u-radio activeColor="#19be6b" label="特殊设备" name="2" :labelSize='radioOption.labelSize'
                        :labelColor='radioOption.labelColor'></u-radio>
                </u-radio-group>
            </view>
            <view class="" v-if="value==='1'">
                <u-input placeholder="请输入Mac号" :placeholderStyle='placeholderStyle' color="#fff"
                <u-input placeholder="请输入Mac号/站点名称" :placeholderStyle='placeholderStyle' color="#fff"
                    customStyle="margin: 0 5px;" v-model='macName'>
                    <template slot="suffix">
                        <u-button @tap="searchMacList" text="查询" type="success" size="small"></u-button>
@@ -45,10 +45,17 @@
                    @cancel="showeEscalationTime = false"></u-picker>
            </view>
        </view>
        <view v-if="wsData2">
            <u-cell title="风向:" :value="windDirData"></u-cell>
        <view class="timeStyle">
            {{currentTime}}
        </view>
        <view>
            <u-cell title="站点:" :value="orgMacName"></u-cell>
        </view>
        <view class="boxPadd">
            <view class="windDirBox" v-if="showData.length>0">
                <view class=""> 风向: </view>
                <view class=""> {{windDirData}} </view>
            </view>
            <u-list v-if="showData.length>0">
                <u-list-item v-for="(item, index) in showData" :key="index">
                    <u-row customStyle="margin-bottom: 10px">
@@ -65,18 +72,18 @@
                </u-list-item>
            </u-list>
        </view>
        <u-toast ref="uToast"></u-toast>
        <u-modal :show="showModel" title='请选择Mac号' showCancelButton @cancel='showModel=false' @confirm='selectMac'>
            <view class="slot-content">
                <u-radio-group v-model="modeleMacSelect" iconPlacement="right" placement='column' borderBottom='true'
                    @change='clickMac'>
                    <view v-for="(item,index) in macList" :key="index" class="ridioBox">
                        <u-radio activeColor="#19be6b" :label="`${item.typeName}: ${item.mac}`"
                        <u-radio activeColor="#19be6b" :label="`${item.typeName}: ${item.name}  \\n Mac号:${item.mac}`"
                            :name="item.mac"></u-radio>
                    </view>
                </u-radio-group>
            </view>
        </u-modal>
        <u-toast ref="uToast"></u-toast>
    </view>
</template>
<script>
@@ -110,6 +117,7 @@
                },
                placeholderStyle: 'color: #fff',
                macName: '',
                orgMacName: '',
                defaultMonitorItems: [],
                chartSensorKey: [],
                coreMonitorItems: [],
@@ -128,6 +136,7 @@
                // 报警圆环图片
                alarmBg: {},
                timer: '',
                currentTime: new Date(),
                isLoading: true,
                specialType: '3'
            }
@@ -153,6 +162,7 @@
        },
        created() {
            this.getOrgs()
            this.getTime()
        },
        onUnload() {
            let that = this
@@ -161,7 +171,22 @@
            that.timer = ''
        },
        methods: {
            getTime() {
                var _this = this // 声明一个变量指向Vue实例this,保证作用域一致
                this.timer = setInterval(function() {
                    _this.currentTime = // 修改数据date
                        _this.appendZero(new Date().getFullYear()) + '-' + _this.appendZero(new Date().getMonth() +
                            1) + '-' + _this.appendZero(new Date().getDate()) + ' ' + _this.appendZero(new Date()
                            .getHours()) + ': ' + _this.appendZero(new Date().getMinutes()) + ': ' + _this
                        .appendZero(new Date().getSeconds())
                }, 1000)
            },
            appendZero(obj) {
                return obj < 10 ? '0' + obj : obj
            },
            clickMac(e) {
                this.macName = ''
                this.orgMacName = ''
                this.specialType = this.macList.find(item => item.mac === e).specialType
                console.log('specialType', this.specialType)
            },
@@ -171,16 +196,20 @@
                this.sensorLayout()
            },
            changeSearchType() {
                this.macName = ''
                if (this.value === '2') {
                    this.getSpeciallist()
                }
                if (this.value === '0') {
                    this.getOrgs()
                }
                if (this.value === '1') {
                    this.macName = ''
                }
            },
            selectMac() {
                this.macName = this.modeleMacSelect
                this.orgMacName = this.macList.find(item => item.mac === this.modeleMacSelect).name
                console.log('this.orgMacName', this.orgMacName)
                this.showModel = false
                if (this.socketTask) {
                    this.socketTask.close()
@@ -192,6 +221,7 @@
                    mac: this.macName
                }).then(res => {
                    this.macList = []
                    this.modeleMacSelect = ''
                    if (res.data && res.data.length > 0) {
                        this.macList = res.data
                        this.showModel = true
@@ -228,6 +258,7 @@
                    'name': name,
                    'id': id
                }
                this.getOrgs()
            },
            selectBack(e) {
                if (this.selectForm.name === 'orgName') {
@@ -239,6 +270,8 @@
                    }
                } else {
                    this.macName = e.value[0].mac
                    this.orgMacName = e.value[0].name
                    console.log('e', e)
                    if (this.socketTask) {
                        this.socketTask.close()
                    }
@@ -588,4 +621,19 @@
        max-height: 300px;
        overflow: auto;
    }
    .windDirBox {
        display: flex;
        justify-content: space-between;
        padding: 5px;
        margin-bottom: 5px;
        border-bottom: 1px solid;
    }
    .timeStyle {
        text-align: center;
        margin: 5px;
        font-size: 18px;
        color: #ef9790;
    }
</style>
pages/login/login.vue
@@ -91,8 +91,9 @@
                let data = await subScribeMsg()
                console.log('data', data)
                if (data['YNqUZ1MgMvwY3G-NENVbcmIBR5dUotSdnwcz96CWrho'] === 'accept') { // 用户点击确定后
                    this.doRequire()
                } else {
                    console.log('拒绝')
                    this.doRequire()
                }
            },
            doRequire() {
@@ -111,7 +112,7 @@
            },
            submit() {
                this.$refs.uForm.validate().then(res => {
                    this.doRequire()
                    this.aClick()
                }).catch(errors => {})
            },
            //登录
@@ -119,7 +120,6 @@
                const value = uni.getStorageSync('openId')
                console.log('openId', value)
                if (value) {
                    this.aClick()
                    this.logining(value)
                }
            },
pages/login/register/register.vue
File was deleted