| | |
| | | |
| | | <view class="home-top-box" :style="{paddingTop:paddingTop+'px'}"> |
| | | <view class="userinfo-box"> |
| | | <view class="userinfo-img" style=""> |
| | | <!-- <u-avatar src="../../static/companylogo.png" style="background: #3E989D;"></u-avatar> --> |
| | | <image :src="companylogo" style="width:109.375px;height:25px;background: #3E989D;"></image> |
| | | <view class="userinfo-img" style=""> |
| | | <!-- <u-avatar src="../../static/companylogo.png" style="background: #3E989D;"></u-avatar> --> |
| | | <image :src="companylogo" style="width:109.375px;height:25px;background: #3E989D;"></image> |
| | | </view> |
| | | <view class="userinfo-value-box"> |
| | | <view class="user-nickname">{{ vuex_is_login ? vuex_user :'昵称' }}</view> |
| | |
| | | @click="updatedata"></u-cell> |
| | | <u-cell size="large" icon="setting-fill" title="部门管理" isLink @click="tobumen"></u-cell> |
| | | <u-cell size="large" icon="setting-fill" title="语音设置" isLink @click="tospeech"></u-cell> |
| | | |
| | | |
| | | <!-- <u-cell size="large" icon="bell-fill" title="测试通知" value="发送通知" isLink @click="message"></u-cell> --> |
| | | <!-- <u-cell size="large" icon="camera-fill" title="信息登记" value="前往录入" isLink @click="camera"></u-cell> --> |
| | | <!-- <u-cell v-show="juese=='超级管理员'" size="large" icon="../../static/my/faka.png" title="发卡管理" |
| | |
| | | <u-switch slot="value" v-model="isoffline" @change="changelixian"></u-switch></u-cell> |
| | | <u-cell size="large" icon="../../static/my/3wei.png" title="显示3维"> |
| | | <u-switch slot="value" v-model="is3wei" @change="change3wei"></u-switch></u-cell> |
| | | |
| | | <u-cell size="large" icon="../../static/my/Bell_ringing.png" title="开启语音"> |
| | | <u-switch slot="value" v-model="isyuyin" @change="changeyuyin"></u-switch></u-cell> |
| | | |
| | | <u-cell size="large" icon="../../static/my/Bell_ringing.png" title="开启语音"> |
| | | <u-switch slot="value" v-model="isyuyin" @change="changeyuyin"></u-switch></u-cell> |
| | | |
| | | <u-cell size="large" icon="../../static/my/hide.png" title="隐藏地图"> |
| | | <u-switch slot="value" v-model="ishidemap" @change="changehidemap"></u-switch></u-cell> |
| | | <!-- <u-cell size="large" icon="../../static/my/ceju.png" title="寻物防丢"> |
| | | <u-switch slot="value" v-model="isceju" @change="changeceju"></u-switch></u-cell> --> |
| | | </u-cell-group> |
| | |
| | | <view class="confirm-right" @click="logout" v-if="vuex_is_login">退出登录</view> |
| | | <view class="confirm-right" @click="confirm" v-if="!vuex_is_login">去登录</view> |
| | | </view> |
| | | |
| | | <!-- <tn-popup v-model="showpopup" mode="bottom" closeBtn> |
| | | |
| | | <!-- <tn-popup v-model="showpopup" mode="bottom" closeBtn> |
| | | <view class="page-wrap u-skeleton"> |
| | | <tn-form> |
| | | <tn-form-item label="类型:" :labelWidth="labelWidth"> |
| | |
| | | :show="showpopup" @cancel="cancelsave" @confirm="save" ref="uModal" :showCancelButton="true" |
| | | :closeOnClickOverlay="true"> |
| | | <!-- <u-icon name="close" style="position: absolute;right: 10px;top:10px" @click="closemodal"></u-icon> --> |
| | | <u--form style="" labelPosition="left" :model="form" ref="uForm"> |
| | | |
| | | <u-form-item required label="围栏类型:" prop="type" borderBottom ref="item1" :labelWidth="labelWidth"> |
| | | <tn-input v-model="form.type" type="select" @click="show1 = true" placeholder="请输入选择围栏类型" /> |
| | | <tn-action-sheet :list="typeList" v-model="show1" @click="typeCallback"></tn-action-sheet> |
| | | <u--form style="" labelPosition="left" :model="form" ref="uForm"> |
| | | |
| | | <u-form-item required label="围栏类型:" prop="type" borderBottom ref="item1" :labelWidth="labelWidth" @click="show1 = true"> |
| | | <!-- <tn-input v-model="form.type" type="select" @click="show1 = true" placeholder="请输入选择围栏类型" /> --> |
| | | <u-input v-model="form.type" disabled disabledColor="#ffffff" placeholder="请输入选择围栏类型" |
| | | border="none" /> |
| | | <u-icon slot="right" name="arrow-down"></u-icon> |
| | | <!-- <tn-action-sheet :list="typeList" v-model="show1" @click="typeCallback"></tn-action-sheet> --> |
| | | <tn-select v-model="show1" mode="single" :list="typeList" @confirm="typeCallback" |
| | | :searchShow="true"></tn-select> |
| | | </u-form-item> |
| | | |
| | | |
| | | <u-form-item required label="预警语音:" prop="nowarnmes" borderBottom ref="item1" labelWidth="80px"> |
| | | <u--input v-model="form.nowarnmes" border="none" placeholder="请输入预警语音"></u--input> |
| | | </u-form-item> |
| | | <u-form-item required label="告警语音:" prop="warnmes" borderBottom ref="item1" labelWidth="80px"> |
| | | <u--input v-model="form.warnmes" border="none" placeholder="请输入告警语音"></u--input> |
| | | </u-form-item> |
| | | |
| | | |
| | | </u--form> |
| | | </u-modal> |
| | | <!-- <tn-popup v-model="showpopup" mode="bottom" closeBtn> |
| | | <!-- <tn-popup v-model="showpopup" mode="bottom" closeBtn> |
| | | |
| | | |
| | | <view style="padding: 30rpx;margin-top:70px;"> |
| | |
| | | </view> |
| | | </tn-popup> --> |
| | | <!-- <bumenCom v-show="isbumen" ref="mainRef"></bumenCom> --> |
| | | |
| | | |
| | | <tn-popup v-model="showpopupip" mode="bottom" closeBtn> |
| | | |
| | | |
| | | |
| | | |
| | | <view style="padding: 30rpx;margin-bottom:70px;"> |
| | | <tn-form> |
| | | <tn-form-item label="IP地址:" labelWidth='100rpx'> |
| | |
| | | } from '@/config/request.js' // 导入 updateBaseURL 函数 |
| | | import { |
| | | checkLogin, |
| | | saveWarnmes, |
| | | findWarnmes, |
| | | saveWarnmes, |
| | | findWarnmes, |
| | | findTbUpapp, |
| | | } from '@/config/api.js'; |
| | | import { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | src:this.companylogo=='-1' ? "../../static/companylogo.png" :this.companylogo, |
| | | show1:false, |
| | | ishidemap: false, |
| | | src: this.companylogo == '-1' ? "../../static/companylogo.png" : this.companylogo, |
| | | show1: false, |
| | | typeList: [{ |
| | | text: '保护区' |
| | | value: '保护区', |
| | | label: '保护区' |
| | | }, |
| | | { |
| | | text: '禁入区' |
| | | value: '禁入区', |
| | | label: '禁入区' |
| | | }, |
| | | { |
| | | text: '工作区' |
| | | value: '工作区', |
| | | label: '工作区' |
| | | }, |
| | | { |
| | | text: '安全区' |
| | | value: '安全区', |
| | | label: '安全区' |
| | | }, |
| | | ], |
| | | form: { |
| | |
| | | warnmes: '', |
| | | type: '', |
| | | }, |
| | | showpopupip:false, |
| | | showpopup:false, |
| | | showpopupip: false, |
| | | showpopup: false, |
| | | labelWidth: 100, |
| | | isbumen: false, |
| | | value: 0, |
| | | appversion: 'v1.1.4', |
| | | appversion: 'v1.2.8', |
| | | downloadUrl: '', |
| | | text1: [], |
| | | jizhan: false, |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | console.log(this.companylogo); |
| | | this.lunbo() |
| | | setTimeout(() => { |
| | | this.paddingTop = this.vuex_padding_top |
| | |
| | | updateBaseURL("http://" + this.form.url + ':' + this.form.port); // 调用 updateBaseURL 函数 |
| | | if (this.vuex_is_login) { |
| | | const params = { |
| | | token: uni.getStorageSync('access_token'), |
| | | token: uni.getStorageSync('access_token'), |
| | | } |
| | | console.log(params); |
| | | checkLogin(params).then((res) => { |
| | | console.log(res); |
| | | if (res.code == 0) { |
| | | this.$refs.refSuccess.showBox({ |
| | | type: 'success', |
| | | txt: "切换数据源成功!请重新登录" |
| | | }); |
| | | |
| | | |
| | | this.showpopupip = false |
| | | this.form.port = '' |
| | | this.form.url = '' |
| | |
| | | name: 'vuex_is_login', |
| | | value: false |
| | | }) |
| | | setTimeout(() =>{ |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '/pages/index/index' |
| | | }); |
| | |
| | | }) |
| | | } |
| | | }, |
| | | getPortFromUrl(url) { |
| | | if (typeof url === 'string' && url.includes('//') && url.includes(':')) { |
| | | return url.split('//')[1].split(':')[1]; |
| | | } |
| | | return null; |
| | | getPortFromUrl(url) { |
| | | if (typeof url === 'string' && url.includes('//') && url.includes(':')) { |
| | | return url.split('//')[1].split(':')[1]; |
| | | } |
| | | return null; |
| | | }, |
| | | updatedata() { |
| | | const baseUrl = uni.getStorageSync('newBaseURL')== ''? 'http://123.117.152.120:8090' : uni.getStorageSync('newBaseURL'); |
| | | // const result = baseUrl === '' ? 'http://123.117.152.120:8090' : getPortFromUrl(baseUrl) || getPortFromUrl('http://123.117.152.120:8090'); |
| | | console.log(baseUrl.split('//')[1].split(':')[1]); |
| | | // console.log(result); |
| | | // console.log(uni.getStorageSync('newBaseURL')== ''? 'http://123.117.152.120:8090' : uni.getStorageSync('newBaseURL')); |
| | | // console.log(uni.getStorageSync('newBaseURL')== ''? 'http://123.117.152.120:8090' : uni.getStorageSync('newBaseURL').split("//")[1]); |
| | | // console.log(uni.getStorageSync('newBaseURL')== ''? 'http://123.117.152.120:8090' : uni.getStorageSync('newBaseURL').split("//")[1].split(":")[1]); |
| | | const baseUrl = uni.getStorageSync('newBaseURL') == '' ? 'http://123.117.152.120:8090' : uni |
| | | .getStorageSync('newBaseURL'); |
| | | this.showpopupip = true |
| | | |
| | | this.form.port =baseUrl.split('//')[1].split(':')[1] |
| | | |
| | | this.form.port = baseUrl.split('//')[1].split(':')[1] |
| | | this.form.url = baseUrl.split('//')[1].split(':')[0] |
| | | |
| | | |
| | | }, |
| | | cancelsave(){ |
| | | this.showpopup=false |
| | | |
| | | cancelsave() { |
| | | this.showpopup = false |
| | | |
| | | }, |
| | | save(){ |
| | | if (this.form.nowarnmes=='') { |
| | | save() { |
| | | if (this.form.nowarnmes == '') { |
| | | this.$refs.refSuccess.showBox({ |
| | | type: 'error', |
| | | txt: '预警语音不能为空' |
| | | }); |
| | | }else if (this.form.warnmes==''){ |
| | | } else if (this.form.warnmes == '') { |
| | | this.$refs.refSuccess.showBox({ |
| | | type: 'error', |
| | | txt: '告警语音不能为空' |
| | | }); |
| | | }else{ |
| | | |
| | | // this.showpopup=false |
| | | saveWarnmes(this.form).then((res) => { |
| | | console.log(res); |
| | | this.showpopup=false |
| | | } else { |
| | | |
| | | // this.showpopup=false |
| | | saveWarnmes(this.form).then((res) => { |
| | | this.showpopup = false |
| | | if (res.code == 0) { |
| | | // nowarnmes: '靠近危险请注意', |
| | | // warnmes: '进入危险区域请注意', |
| | | |
| | | } else { |
| | | |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | typeCallback(e) { |
| | | this.form.type = e[0].label; |
| | | const params = { |
| | | type: e[0].label, |
| | | } |
| | | findWarnmes(params).then((res) => { |
| | | if (res.code == 0) { |
| | | // nowarnmes: '靠近危险请注意', |
| | | // warnmes: '进入危险区域请注意', |
| | | |
| | | // if (res.data.type=="工作区") { |
| | | // this.form.nowarnmes = res.data.nowarnmes+";"+res.data.nowarnmestype |
| | | // this.form.warnmes = res.data.warnmes+";"+res.data.warnmestype |
| | | // }else{ |
| | | this.form.nowarnmes = res.data.nowarnmes |
| | | this.form.warnmes = res.data.warnmes |
| | | } else { |
| | | |
| | | |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | typeCallback(index) { |
| | | this.form.type = this.typeList[index].text; |
| | | const params = { |
| | | type: this.typeList[index].text, |
| | | } |
| | | console.log(params); |
| | | console.log(211111111111); |
| | | findWarnmes(params).then((res) => { |
| | | console.log(res); |
| | | if (res.code == 0) { |
| | | // nowarnmes: '靠近危险请注意', |
| | | // warnmes: '进入危险区域请注意', |
| | | // if (res.data.type=="工作区") { |
| | | // this.form.nowarnmes = res.data.nowarnmes+";"+res.data.nowarnmestype |
| | | // this.form.warnmes = res.data.warnmes+";"+res.data.warnmestype |
| | | // }else{ |
| | | this.form.nowarnmes = res.data.nowarnmes |
| | | this.form.warnmes = res.data.warnmes |
| | | // } |
| | | |
| | | console.log(this.form.watnmes); |
| | | console.log(this.form.nowarnmes); |
| | | } else { |
| | | |
| | | } |
| | | }) |
| | | |
| | | |
| | | }, |
| | | tobumen() { |
| | | this.$emit('tobumen', 5); |
| | | }, |
| | | |
| | | tospeech(){ |
| | | |
| | | tospeech() { |
| | | //语音管理 |
| | | this.showpopup=true |
| | | |
| | | this.showpopup = true |
| | | |
| | | }, |
| | | lunbo() { |
| | | if (this.vuex_is_login) { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | downloadTask.onProgressUpdate((res) => { |
| | | const progress = res.progress; |
| | | uni.showLoading({ |
| | | title: `正在下载 ${progress}%` |
| | | }); |
| | | }); |
| | | downloadTask.onProgressUpdate((res) => { |
| | | const progress = res.progress; |
| | | uni.showLoading({ |
| | | title: `正在下载 ${progress}%` |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | changeweilan(e) { |
| | |
| | | name: 'is3wei', |
| | | value: e |
| | | }) |
| | | this.$emit('weimap', e); |
| | | }, |
| | | |
| | | |
| | | changeyuyin(e) { |
| | | store.commit('$tStore', { |
| | | name: 'isyuyin', |
| | |
| | | }) |
| | | }, |
| | | |
| | | changehidemap(e) { |
| | | this.ishidemap = e |
| | | this.$emit('hidemap', e); |
| | | |
| | | }, |
| | | |
| | | cancel() { |
| | | this.show = false; |
| | | }, |