反馈修改
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const debug = false // true 是连地服务端本地,false 是连接线上
|
||||
const debug = true // true 是连地服务端本地,false 是连接线上
|
||||
|
||||
const development = {
|
||||
domain: 'http://192.168.1.115:10215',
|
||||
|
||||
@@ -36,8 +36,6 @@ export default {
|
||||
html2canvas(dom, {
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
width: dom.offsetWidth,
|
||||
height: dom.offsetHeight,
|
||||
dpi: 300,
|
||||
taintTest: true,
|
||||
}).then((canvas) => {
|
||||
@@ -49,7 +47,7 @@ export default {
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
}, 1000);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"padding-right": "20rpx",
|
||||
"buttons": [
|
||||
{
|
||||
"text": "请选择工程",
|
||||
"text": "请先创建工程",
|
||||
"fontSize": "28rpx",
|
||||
"select": true,
|
||||
"width": "auto"
|
||||
|
||||
@@ -118,6 +118,7 @@ export default {
|
||||
position: '26eae70fb5ff1c090d2dc7c3a0743948',
|
||||
},
|
||||
]
|
||||
console.log(this.deviceInfo)
|
||||
this.deviceInfo.appsLineTopologyDiagramPO.forEach((item1) => {
|
||||
if (item1.value.length === 0) {
|
||||
return
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
<view class="item">模块一</view>
|
||||
<view class="item">
|
||||
<view class="status-point-success mr10"></view>
|
||||
<view style="width: 30rpx"> 15 </view>
|
||||
<view> °C </view>
|
||||
<view style="width: 30rpx"> 15</view>
|
||||
<view> °C</view>
|
||||
</view>
|
||||
<view class="item">模块二</view>
|
||||
<view class="item">
|
||||
<view class="status-point-error mr10"></view>
|
||||
<view style="width: 30rpx"> 0 </view>
|
||||
<view> °C </view>
|
||||
<view style="width: 30rpx"> 0</view>
|
||||
<view> °C</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -57,7 +57,7 @@
|
||||
v-for="(item, index) in navMenuList"
|
||||
:key="index"
|
||||
@click="navMenuClick(index)"
|
||||
>{{ item.text }}
|
||||
>{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -101,10 +101,11 @@ import xieBo from './comp/xieBo.vue'
|
||||
import power from './comp/power.vue'
|
||||
import oscillogram from './comp/oscillogram.vue'
|
||||
import IO from './comp/IO.vue'
|
||||
import { queryTopologyDiagram, deleteDevice } from '@/common/api/device'
|
||||
import { MQTT_IP, MQTT_OPTIONS } from '@/common/js/mqtt.js'
|
||||
import {queryTopologyDiagram, deleteDevice} from '@/common/api/device'
|
||||
import {MQTT_IP, MQTT_OPTIONS} from '@/common/js/mqtt.js'
|
||||
import mqtt from 'mqtt/dist/mqtt.js'
|
||||
import { base64ToPath, pathToBase64 } from 'image-tools'
|
||||
import {base64ToPath, pathToBase64} from 'image-tools'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
basic,
|
||||
@@ -203,17 +204,17 @@ export default {
|
||||
} else if (e.item.text === '下载') {
|
||||
this.$util.toast('下载成功')
|
||||
} else if (e.item.text === '记录') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/record' })
|
||||
uni.navigateTo({url: '/pages/device/APF/record'})
|
||||
} else if (e.item.text === '告警') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/report' })
|
||||
uni.navigateTo({url: '/pages/device/APF/report'})
|
||||
} else if (e.item.text === '关于') {
|
||||
uni.navigateTo({ url: '/pages/device/APF/about?id=' + this.devId })
|
||||
uni.navigateTo({url: '/pages/device/APF/about?id=' + this.devId})
|
||||
} else if (e.item.text === '移交') {
|
||||
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.devId })
|
||||
uni.navigateTo({url: '/pages/device/transfer?id=' + this.devId})
|
||||
} else if (e.item.text === '反馈') {
|
||||
uni.navigateTo({ url: '/pages/device/feedback' })
|
||||
uni.navigateTo({url: '/pages/device/feedback'})
|
||||
} else if (e.item.text === '用户') {
|
||||
uni.navigateTo({ url: '/pages/device/user' })
|
||||
uni.navigateTo({url: '/pages/device/user'})
|
||||
} else if (e.item.text === '报表') {
|
||||
this.$util.toast('效果是直接打开报表')
|
||||
} else if (e.item.text === '版本') {
|
||||
@@ -221,15 +222,19 @@ export default {
|
||||
} else if (e.item.text === '模版') {
|
||||
this.$util.toast('效果是功能暂未开放直接打开报表')
|
||||
} else if (e.item.text === '编辑') {
|
||||
let data = JSON.parse(JSON.stringify(this.deviceInfo))
|
||||
data.appsLineTopologyDiagramPO.forEach((item) => {
|
||||
delete item.value
|
||||
})
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/edit?deviceInfo=' + encodeURIComponent(JSON.stringify(this.deviceInfo)),
|
||||
url: '/pages/device/edit?deviceInfo=' + encodeURIComponent(JSON.stringify(data)),
|
||||
})
|
||||
}
|
||||
this.$refs.fab.close()
|
||||
},
|
||||
navMenuClick(idx) {
|
||||
this.navMenuActive = idx
|
||||
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
|
||||
uni.pageScrollTo({scrollTop: 0, duration: 0})
|
||||
},
|
||||
init() {
|
||||
if (this.isPrimaryUser == 1) {
|
||||
@@ -358,7 +363,7 @@ export default {
|
||||
this.init()
|
||||
queryTopologyDiagram(options.id).then((res) => {
|
||||
this.deviceInfo = res.data
|
||||
uni.setNavigationBarTitle({ title: this.deviceInfo.devName || '设备详情' })
|
||||
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
||||
this.dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
item.children.forEach((item2) => {
|
||||
@@ -387,6 +392,7 @@ export default {
|
||||
height: 100%;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: relative;
|
||||
width: 375px;
|
||||
@@ -399,6 +405,7 @@ export default {
|
||||
image-rendering: crisp-edges;
|
||||
-ms-interpolation-mode: nearest-neighbor;
|
||||
}
|
||||
|
||||
.point {
|
||||
position: absolute;
|
||||
color: #111;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<uni-forms>
|
||||
<uni-forms-item label="设备识别码">
|
||||
<view style="display: flex">
|
||||
<uni-easyinput type="text" v-model="formData.nDid" placeholder="请输入设备识别码" />
|
||||
<uni-easyinput type="text" v-model="formData.nDid" placeholder="请输入设备识别码"/>
|
||||
<uni-icons
|
||||
type="camera"
|
||||
color="#007aff"
|
||||
@@ -18,25 +18,35 @@
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="register"> 发起注册 </view>
|
||||
<view class="btn-wrap-item" @click="register"> 发起注册</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="content">
|
||||
<uni-forms>
|
||||
<uni-forms-item label="项目">
|
||||
<uni-data-select
|
||||
v-model="formData.projectId"
|
||||
:localdata="projectRange"
|
||||
@change="queryTopologyDiagramPage"
|
||||
></uni-data-select>
|
||||
<view style="display: flex;align-items: center">
|
||||
<uni-data-select
|
||||
v-model="formData.projectId"
|
||||
:localdata="projectRange"
|
||||
@change="queryTopologyDiagramPage"
|
||||
></uni-data-select>
|
||||
<uni-icons
|
||||
type="plusempty"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="createProject"
|
||||
></uni-icons>
|
||||
</view>
|
||||
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="型号">
|
||||
<uni-data-select v-model="formData.type" :localdata="typeRange"
|
||||
@change="typeChange(item)"></uni-data-select>
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="位置">
|
||||
<view style="display: flex">
|
||||
<view style="display: flex;">
|
||||
<uni-easyinput
|
||||
:clearable="false"
|
||||
type="textarea"
|
||||
@@ -44,22 +54,22 @@
|
||||
v-model="formData.area"
|
||||
placeholder="请输入位置信息"
|
||||
/>
|
||||
<!-- <uni-icons
|
||||
<uni-icons
|
||||
type="location"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="chooseLocation"
|
||||
></uni-icons> -->
|
||||
></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="拓扑图" v-if="formData.projectId">
|
||||
<view style="display: flex">
|
||||
<view style="flex: 1">
|
||||
<view v-if="formData.topologyDiagramUrl">
|
||||
<image :src="formData.topologyDiagramUrl" style="width: 100%" mode="widthFix" />
|
||||
<image :src="formData.topologyDiagramUrl" style="width: 100%" mode="widthFix"/>
|
||||
</view>
|
||||
<view v-else class="gplot gplot-empty center" @click="chooseGplot"> 选择拓扑图 </view>
|
||||
<view v-else class="gplot gplot-empty center" @click="chooseGplot"> 选择拓扑图</view>
|
||||
</view>
|
||||
<uni-icons
|
||||
type="image"
|
||||
@@ -84,10 +94,10 @@
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<image class="gplot-image" ref="gplot-image" :src="formData.topologyDiagramUrl" mode="widthFix" />
|
||||
<image class="gplot-image" ref="gplot-image" :src="formData.topologyDiagramUrl" mode="widthFix"/>
|
||||
<view class="btn-wrap">
|
||||
<!-- <view class="btn-wrap-item" @click="add"> 添加监测点 </view> -->
|
||||
<view class="btn-wrap-item" @click="submit"> 提交 </view>
|
||||
<view class="btn-wrap-item" @click="submit"> 提交</view>
|
||||
</view>
|
||||
<uni-drawer ref="gplot" mode="right" :mask-click="false">
|
||||
<scroll-view style="height: 100%" scroll-y="true">
|
||||
@@ -101,9 +111,10 @@
|
||||
v-for="(item, key) in imageList"
|
||||
:key="key"
|
||||
/>
|
||||
<view v-if="imageList.length === 0" style="text-align: center" class="mt50 mb50">暂无拓扑图</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消 </view>
|
||||
<view class="btn-wrap-item ml20" @click="confirmGplot"> 确定 </view>
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消</view>
|
||||
<view class="btn-wrap-item ml20" @click="confirmGplot"> 确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -112,7 +123,7 @@
|
||||
<scroll-view style="height: 100%" scroll-y="true">
|
||||
<view style="background: #fff">
|
||||
<view class="map-pin-box">
|
||||
<image class="gplot" mode="widthFix" :src="formData.topologyDiagramUrl" />
|
||||
<image class="gplot" mode="widthFix" :src="formData.topologyDiagramUrl"/>
|
||||
|
||||
<movable-area class="map-pin-box-area">
|
||||
<movable-view :x="point.lat" :y="point.lng" direction="all" @change="dragPoint">
|
||||
@@ -141,8 +152,8 @@
|
||||
/>
|
||||
</uni-forms>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消 </view>
|
||||
<view class="btn-wrap-item ml20" @click="addPoint"> 确定 </view>
|
||||
<view class="btn-wrap-item" @click="closeDrawer"> 取消</view>
|
||||
<view class="btn-wrap-item ml20" @click="addPoint"> 确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@@ -151,13 +162,14 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { registerDevice, getModel, addDevice, queryByTopoId } from '@/common/api/device.js'
|
||||
import { getProjectList, queryTopologyDiagramPage } from '@/common/api/project.js'
|
||||
import {registerDevice, getModel, addDevice, queryByTopoId} from '@/common/api/device.js'
|
||||
import {getProjectList, queryTopologyDiagramPage} from '@/common/api/project.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
type: 1,
|
||||
type: 2,
|
||||
formData: {
|
||||
nDid: '',
|
||||
area: '',
|
||||
@@ -174,7 +186,22 @@ export default {
|
||||
isAdaptive: false, // 是否适应当前项目
|
||||
}
|
||||
},
|
||||
created() {
|
||||
onLoad() {
|
||||
|
||||
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
|
||||
dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
this.positionList = item.children.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.name,
|
||||
value: item.id,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
let engineering = uni.getStorageSync(this.$cacheKey.engineering)
|
||||
getProjectList({
|
||||
pageNum: 1,
|
||||
@@ -193,21 +220,14 @@ export default {
|
||||
]
|
||||
this.projectRange = arr
|
||||
})
|
||||
let dictData = uni.getStorageSync(this.$cacheKey.dictData)
|
||||
dictData.forEach((item) => {
|
||||
if (item.code == 'Line_Position') {
|
||||
this.positionList = item.children.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
text: item.name,
|
||||
value: item.id,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
resize(){
|
||||
createProject() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/new?from=newDevice',
|
||||
})
|
||||
},
|
||||
resize() {
|
||||
console.log(this.$refs['gplot-image']);
|
||||
},
|
||||
confirmGplot() {
|
||||
@@ -240,7 +260,12 @@ export default {
|
||||
}).then((res) => {
|
||||
this.imageList = res.data.records
|
||||
this.activeGplot = 0
|
||||
this.confirmGplot()
|
||||
if (this.imageList.length) {
|
||||
this.confirmGplot()
|
||||
} else {
|
||||
this.formData.topologyDiagramUrl = ''
|
||||
this.formData.topologyDiagram = ''
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
@@ -250,7 +275,8 @@ export default {
|
||||
positionChange(e) {
|
||||
console.log(e)
|
||||
},
|
||||
projectChange(e) {},
|
||||
projectChange(e) {
|
||||
},
|
||||
scanCode() {
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
@@ -355,7 +381,7 @@ export default {
|
||||
console.log(res)
|
||||
this.$util.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
uni.navigateBack({delta: 1})
|
||||
}, 1500)
|
||||
})
|
||||
},
|
||||
@@ -396,6 +422,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 188rpx;
|
||||
}
|
||||
|
||||
.gplot-empty {
|
||||
margin: 0 auto;
|
||||
border: 1px dashed #dcdfe6;
|
||||
@@ -473,6 +500,7 @@ export default {
|
||||
.point-item:first-of-type {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.gplot-image {
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<uni-easyinput
|
||||
type="textarea"
|
||||
autoHeight
|
||||
maxlength="250"
|
||||
v-model="formData.description"
|
||||
placeholder="请输入工程描述"
|
||||
/>
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
|
||||
<script>
|
||||
import list from '../../common/js/list'
|
||||
import { queryAllEnginner, csMarketDataAdd } from '@/common/api/engineering'
|
||||
import {queryAllEnginner, csMarketDataAdd, queryEngineering} from '@/common/api/engineering'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -107,7 +108,26 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
onBackPress() {
|
||||
console.log('onBackPress')
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
queryEngineering().then(res => {
|
||||
if (res.data.length === 0) {
|
||||
uni.removeStorage({
|
||||
key: this.$cacheKey.engineering,
|
||||
})
|
||||
} else if (engineering && !res.data.some(item => item.id = engineering.id)) {
|
||||
uni.removeStorage({
|
||||
key: this.$cacheKey.engineering,
|
||||
})
|
||||
} else {
|
||||
uni.setStorage({
|
||||
key: this.$cacheKey.engineering,
|
||||
data: res.data[0],
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onLoad() {
|
||||
this.init()
|
||||
},
|
||||
@@ -120,14 +140,17 @@ export default {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&-left {
|
||||
flex: 1;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .uni-list-item__content {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.message-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
cancelColor: '#007aff',
|
||||
success: ({confirm, cancel}) => {
|
||||
if (confirm) {
|
||||
if (this.devCount.engineeringListLength > 1) {
|
||||
if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new',
|
||||
})
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
<view class="header">
|
||||
<view class="header-item">
|
||||
<view class="header-item-value">{{
|
||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||
}}</view>
|
||||
devCount.currentOnLineDevCount + devCount.currentOffLineDevCount || 0
|
||||
}}
|
||||
</view>
|
||||
<view class="header-item-label">设备总数</view>
|
||||
</view>
|
||||
<view class="header-item" @click="jump('currentOnLineDevs')">
|
||||
@@ -60,7 +61,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
submitFeedBack() {
|
||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||
uni.navigateTo({url: '/pages/home/feedback'})
|
||||
},
|
||||
registerDevice() {
|
||||
uni.showModal({
|
||||
@@ -69,15 +70,23 @@ export default {
|
||||
confirmText: '直连装置',
|
||||
cancelText: '网关接入',
|
||||
cancelColor: '#007aff',
|
||||
success: ({ confirm, cancel }) => {
|
||||
success: ({confirm, cancel}) => {
|
||||
if (confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new',
|
||||
})
|
||||
if (this.devCount.engineeringListLength > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new',
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new?from=index'
|
||||
})
|
||||
}
|
||||
|
||||
} else if (cancel) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/list',
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/gateway/list',
|
||||
// })
|
||||
this.$util.toast('功能正在开发,敬请期待')
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -21,16 +21,18 @@
|
||||
</uni-nav-bar> -->
|
||||
<view class="index">
|
||||
<!-- 运维 -->
|
||||
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'" />
|
||||
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'"/>
|
||||
<!-- 专职 -->
|
||||
<ZhuanZhi :devCount="devCount" v-if="userInfo.authorities === 'market_user'" />
|
||||
<ZhuanZhi :devCount="devCount" v-if="userInfo.authorities === 'market_user'"/>
|
||||
<!-- 工程 -->
|
||||
<GongCheng :devCount="devCount" v-if="userInfo.authorities === 'engineering_user'" />
|
||||
<GongCheng :devCount="devCount" v-if="userInfo.authorities === 'engineering_user'"/>
|
||||
<!-- 主用户 -->
|
||||
<ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'" />
|
||||
<YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"> </YouKe>
|
||||
<view class="canneng-index-title mt20">设备列表</view>
|
||||
<Device ref="device" :store="store" />
|
||||
<ZhuYongHu :devCount="devCount" v-if="userInfo.authorities === 'app_vip_user'"/>
|
||||
<YouKe :devCount="devCount" v-if="userInfo.authorities === 'tourist'"></YouKe>
|
||||
<template v-if="engineeringList.length">
|
||||
<view class="canneng-index-title mt20">设备列表</view>
|
||||
<Device ref="device" :store="store"/>
|
||||
</template>
|
||||
</view>
|
||||
<uni-drawer ref="showRight" mode="right" :mask-click="false">
|
||||
<view>
|
||||
@@ -52,9 +54,9 @@ import ZhuanZhi from './comp/indexZhuanZhi.vue'
|
||||
import YouKe from './comp/indexYouKe.vue'
|
||||
import Device from './comp/device.vue'
|
||||
import list from '../../common/js/list'
|
||||
import { getDevCount } from '../../common/api/device.js'
|
||||
import { queryEngineering } from '@/common/api/engineering.js'
|
||||
import { pinyin } from 'pinyin-pro'
|
||||
import {getDevCount} from '../../common/api/device.js'
|
||||
import {queryEngineering} from '@/common/api/engineering.js'
|
||||
import {pinyin} from 'pinyin-pro'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
@@ -83,7 +85,7 @@ export default {
|
||||
engineeringListFilter() {
|
||||
let result = []
|
||||
this.engineeringList.forEach((item) => {
|
||||
let arr = pinyin(item.name[0], { toneType: 'none', type: 'array' })
|
||||
let arr = pinyin(item.name[0], {toneType: 'none', type: 'array'})
|
||||
let letter = arr[0][0].toUpperCase()
|
||||
console.log(letter)
|
||||
let index = result.findIndex((item) => item.letter === letter)
|
||||
@@ -105,14 +107,6 @@ export default {
|
||||
// e的返回格式为json对象:{"text":"测试","index":0}
|
||||
this.drawer = !this.drawer
|
||||
if (this.drawer) {
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: '取消',
|
||||
select: false,
|
||||
})
|
||||
// #endif
|
||||
this.openDrawer()
|
||||
} else {
|
||||
this.closeDrawer()
|
||||
@@ -123,32 +117,47 @@ export default {
|
||||
let res = await queryEngineering()
|
||||
this.engineeringList = res.data
|
||||
if (this.engineeringList.length === 0) {
|
||||
console.log('没有工程')
|
||||
uni.removeStorageSync(this.$cacheKey.engineering)
|
||||
return
|
||||
}
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
this.projectList = []
|
||||
// 修改buttons
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: '请先创建工程',
|
||||
})
|
||||
// #endif
|
||||
} else {
|
||||
if (this.engineeringList.findIndex((item) => item.id === engineering.id) === -1) {
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
} else {
|
||||
this.select.engineeringName = engineering.name
|
||||
this.select.engineeringId = engineering.id
|
||||
if (this.engineeringList.findIndex((item) => item.id === engineering.id) === -1) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
this.select.engineeringName = res.data[0].name
|
||||
this.select.engineeringId = res.data[0].id
|
||||
} else {
|
||||
this.select.engineeringName = engineering.name
|
||||
this.select.engineeringId = engineering.id
|
||||
}
|
||||
}
|
||||
this.store.params.engineerId = this.select.engineeringId
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: this.select.engineeringName,
|
||||
})
|
||||
// #endif
|
||||
this.getDevCount()
|
||||
this.$refs.device && this.$refs.device.init()
|
||||
}
|
||||
this.store.params.engineerId = this.select.engineeringId
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: this.select.engineeringName,
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
getDevCount() {
|
||||
getDevCount(this.select.engineeringId).then((res) => {
|
||||
// Object.assign(this.devCount, res.data)
|
||||
this.devCount = res.data
|
||||
this.devCount.currentOffLineDevs.forEach((item) => {
|
||||
item.runStatus = 1
|
||||
@@ -159,7 +168,6 @@ export default {
|
||||
this.devCount.engineeringListLength = this.engineeringList.length
|
||||
console.log(this.devCount);
|
||||
})
|
||||
this.$refs.device && this.$refs.device.init()
|
||||
},
|
||||
closeDrawer(e) {
|
||||
if (!e) {
|
||||
@@ -200,9 +208,7 @@ export default {
|
||||
})
|
||||
this.$refs.device.select.projectName = ''
|
||||
this.$refs.device.select.projectNameIndex = 0
|
||||
getDevCount(this.select.engineeringId).then((res) => {
|
||||
this.devCount = res.data
|
||||
})
|
||||
this.getDevCount()
|
||||
this.$refs.device.init()
|
||||
this.$refs.showRight.close()
|
||||
},
|
||||
@@ -223,9 +229,8 @@ export default {
|
||||
},
|
||||
openDrawer(item) {
|
||||
if (this.engineeringList.length === 0) {
|
||||
uni.showToast({
|
||||
title: '暂无工程',
|
||||
icon: 'none',
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new',
|
||||
})
|
||||
return
|
||||
} else if (this.engineeringList.length === 1) {
|
||||
@@ -235,6 +240,14 @@ export default {
|
||||
})
|
||||
return
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: '取消',
|
||||
select: false,
|
||||
})
|
||||
// #endif
|
||||
this.$refs.showRight.open()
|
||||
},
|
||||
},
|
||||
@@ -261,11 +274,13 @@ export default {
|
||||
.index {
|
||||
padding: 20rpx 0 0;
|
||||
}
|
||||
|
||||
.canneng-index-title {
|
||||
padding: 0 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/deep/ .uni-card {
|
||||
background: $uni-theme-white;
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ export default {
|
||||
engineeringList: [],
|
||||
tempList: [],
|
||||
project: null,
|
||||
options: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -153,6 +154,7 @@ export default {
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.options = options
|
||||
if (options.project) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '编辑项目',
|
||||
@@ -298,7 +300,7 @@ export default {
|
||||
})
|
||||
}
|
||||
console.log(arr)
|
||||
this.formData.topoIds = this.formData.tempFiles.map((item) => (item.topoId))
|
||||
this.formData.topoIds = this.formData.tempFiles.map((item) => (item.id))
|
||||
let data = JSON.parse(JSON.stringify(this.formData))
|
||||
let res = {}
|
||||
console.warn(data, arr)
|
||||
@@ -332,8 +334,12 @@ export default {
|
||||
this.$util.toast('项目修改成功')
|
||||
this.$util.refreshPrePage(2)
|
||||
} else {
|
||||
this.$util.toast('项目创建成功')
|
||||
this.$util.refreshPrePage()
|
||||
if (this.options.from === 'newDevice') {
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
this.$util.toast('项目创建成功')
|
||||
this.$util.refreshPrePage()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.toast(result.message)
|
||||
|
||||
@@ -1,40 +1,93 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<view slot="body">
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }" :loading="false"></uqrcode>
|
||||
<canvas id="qrcode" width="200" height="200"></canvas>
|
||||
<view class="transfer-text">{{ userInfo.nickname }}</view>
|
||||
<!-- <view class="transfer-btn">
|
||||
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||
返回
|
||||
</button>
|
||||
<button class="transfer-btn-item ml20" @click="home">转移成功</button>
|
||||
</view> -->
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<Cn-htmlToImg domId="content" @renderFinish="renderFinish" style="display: flex">
|
||||
<view class="content" id="content">
|
||||
<view class="user-info">
|
||||
<image class="avatar" :src="userInfo.avatar"></image>
|
||||
<view class="right">
|
||||
<view class="user-info-name">{{ userInfo.nickname }}</view>
|
||||
<view class="user-info-role">{{ roleName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<uqrcode size="260" ref="uqrcode" canvas-id="qrcode" :value="content"
|
||||
:loading="false"></uqrcode>
|
||||
</view>
|
||||
</Cn-htmlToImg>
|
||||
<view class="transfer-text">
|
||||
<!-- <view>换个样式</view>-->
|
||||
<view @click="save">保存图片</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
<!-- <view class="transfer-btn">
|
||||
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||
返回
|
||||
</button>
|
||||
<button class="transfer-btn-item ml20" @click="home">转移成功</button>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import QRCode from 'qrcodejs2'
|
||||
// import UQRCode from '@/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js';
|
||||
|
||||
import {base64ToPath} from "image-tools";
|
||||
import setting from "@/pages/engineering/setting.vue";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
content: '',
|
||||
img: '',
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
roleName() {
|
||||
let roleName = ''
|
||||
switch (this.userInfo.authorities) {
|
||||
case 'tourist':
|
||||
roleName = '游客'
|
||||
break
|
||||
case 'engineering_user':
|
||||
roleName = '工程用户'
|
||||
break
|
||||
case 'app_vip_user':
|
||||
roleName = 'VIP用户'
|
||||
break
|
||||
case 'market_user':
|
||||
roleName = '营销用户'
|
||||
break
|
||||
case 'operation_manager':
|
||||
roleName = '运维管理员'
|
||||
break
|
||||
}
|
||||
return roleName
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
this.$util.refreshPrePage(2)
|
||||
},
|
||||
home() {
|
||||
this.$util.refreshPrePage(2)
|
||||
renderFinish(e) {
|
||||
this.img = e
|
||||
},
|
||||
save() {
|
||||
if(!this.img){
|
||||
setTimeout(()=>{
|
||||
this.save()
|
||||
},500)
|
||||
}
|
||||
base64ToPath(this.img).then((res) => {
|
||||
console.log(res)
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res,
|
||||
success: () => {
|
||||
this.$util.toast('已保存到系统相册')
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log(err)
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
@@ -46,19 +99,66 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.transfer {
|
||||
padding: 200rpx 34rpx 0;
|
||||
.content {
|
||||
width: 330px;
|
||||
padding: 30px 0;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 50rpx;
|
||||
width: 260px;
|
||||
|
||||
.avatar {
|
||||
margin-right: 20rpx;
|
||||
height: 100rpx;
|
||||
width: 100rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.user-info-name {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.user-info-role {
|
||||
margin-top: 10rpx;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.transfer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 100rpx 0;
|
||||
|
||||
.transfer-img {
|
||||
}
|
||||
|
||||
.transfer-text {
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
margin-top: 30rpx;
|
||||
color: rgb(122, 126, 153);
|
||||
}
|
||||
|
||||
.transfer-btn {
|
||||
|
||||
Reference in New Issue
Block a user