首页修改
This commit is contained in:
@@ -20,7 +20,7 @@ export function getDevCount(id) {
|
||||
url: '/cs-device-boot/deviceUser/devCount',
|
||||
method: 'post',
|
||||
|
||||
data: { id },
|
||||
data: {id},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -89,10 +89,22 @@ export const queryTopologyDiagram = (devId) => {
|
||||
|
||||
// 设备扫码移交
|
||||
|
||||
export const transferDevice = (id) => {
|
||||
export const transferDevice = (id, userId) => {
|
||||
return request({
|
||||
url: '/cs-device-boot/deviceUser/transfer',
|
||||
method: 'POST',
|
||||
data: {
|
||||
ids: id,
|
||||
userId: userId || uni.getStorageSync('userInfo').userIndex
|
||||
},
|
||||
})
|
||||
}
|
||||
// 设备扫码分享
|
||||
|
||||
export const shareDevice = (id, userId) => {
|
||||
return request({
|
||||
url: '/cs-device-boot/deviceUser/share',
|
||||
method: 'POST',
|
||||
data: {
|
||||
ids: id,
|
||||
},
|
||||
@@ -141,8 +153,6 @@ export const updateDevice = (params) => {
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: {
|
||||
pointList: params,
|
||||
},
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import request from '../js/request';
|
||||
import config from '../js/config';
|
||||
|
||||
/**
|
||||
* 添加反馈
|
||||
* @param {*} params {description: '', files: '', title: 1,type: 1,user_id:12}
|
||||
@@ -7,17 +8,25 @@ import config from '../js/config';
|
||||
*/
|
||||
export function addFeedBack(params) {
|
||||
let files = params.files;
|
||||
console.log(files);
|
||||
console.log(files.length);
|
||||
let data = JSON.parse(JSON.stringify(params));
|
||||
delete data.files
|
||||
return uni.uploadFile({
|
||||
url: config.domain + '/cs-system-boot/feedback/addFeedBack', //仅为示例,非真实的接口地址
|
||||
files: files,
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('access_token'),
|
||||
},
|
||||
formData: data,
|
||||
});
|
||||
if (files.length) {
|
||||
return uni.uploadFile({
|
||||
url: config.domain + '/cs-system-boot/feedback/addFeedBack', //仅为示例,非真实的接口地址
|
||||
files: files,
|
||||
header: {
|
||||
Authorization: uni.getStorageSync('access_token'),
|
||||
},
|
||||
formData: data,
|
||||
});
|
||||
} else {
|
||||
return request({
|
||||
url: '/cs-system-boot/feedback/addFeedBack',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,12 +77,12 @@ export function AddFeedbackChat(params) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新反馈聊天状态
|
||||
* 更新反馈聊天状态
|
||||
* @param {*} params {
|
||||
"id": "2e47078c0f59a4a612655bb3bbaed617",
|
||||
"userId": "12"
|
||||
}
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
export function updateChatStatus(params) {
|
||||
return request({
|
||||
|
||||
@@ -35,5 +35,32 @@ export const queryAppInfoByType = (type) => {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看用户消息推送配置
|
||||
*/
|
||||
|
||||
//
|
||||
export const queryUserPushConfig = () => {
|
||||
return request({
|
||||
url: '/cs-system-boot/appInfoSet/queryByUserId',
|
||||
method: 'post',
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: {},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新消息推送配置
|
||||
*/
|
||||
|
||||
export const updatePushConfig = (params) => {
|
||||
return request({
|
||||
url: '/cs-system-boot/appInfoSet/update',
|
||||
method: 'post',
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const debug = true // true 是连地服务端本地,false 是连接线上
|
||||
const debug = false // true 是连地服务端本地,false 是连接线上
|
||||
|
||||
const development = {
|
||||
domain: 'http://192.168.1.115:10215',
|
||||
|
||||
@@ -30,6 +30,10 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
},
|
||||
timer:null,
|
||||
callBack: null,
|
||||
firstCallBack: null,
|
||||
loadedCallback: null,
|
||||
reload() {
|
||||
this.data = []
|
||||
this.status = 'loading'
|
||||
@@ -37,9 +41,13 @@ export default {
|
||||
this.params.pageNum = 1
|
||||
this.next()
|
||||
},
|
||||
callBack: null,
|
||||
firstCallBack: null,
|
||||
loadedCallback: null,
|
||||
search() {
|
||||
// 节流搜索
|
||||
clearTimeout(this.timer)
|
||||
this.timer = setTimeout(() => {
|
||||
this.reload()
|
||||
}, 300)
|
||||
},
|
||||
next() {
|
||||
me.$request({
|
||||
url: url,
|
||||
|
||||
@@ -34,10 +34,12 @@ export default {
|
||||
let dom = document.getElementById(domId);
|
||||
console.log(dom.offsetWidth, dom.offsetHeight);
|
||||
html2canvas(dom, {
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
dpi: 300,
|
||||
taintTest: true,
|
||||
scrollX:0,
|
||||
scrollY:0,
|
||||
width: dom.offsetWidth,
|
||||
height: dom.offsetHeight,
|
||||
allowTaint:true
|
||||
}).then((canvas) => {
|
||||
// this.$refs.header.appendChild(canvas);
|
||||
const posterImg = canvas.toDataURL()
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name" : "灿能物联",
|
||||
"appid" : "__UNI__88BC25B",
|
||||
"description" : "",
|
||||
"versionName" : "1.1.0",
|
||||
"versionCode" : 110,
|
||||
"versionName" : "1.1.4",
|
||||
"versionCode" : 114,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
@@ -132,7 +132,7 @@
|
||||
"/api" : {
|
||||
"https" : true,
|
||||
// "target" : "https://china.indpecker.com",
|
||||
"target" : "http://192.168.1.115:10215",
|
||||
"target" : "http://192.168.1.139:10215",
|
||||
"changOrigin" : true,
|
||||
"pathRewrite" : {
|
||||
"/api" : ""
|
||||
|
||||
54
pages.json
54
pages.json
@@ -4,23 +4,7 @@
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
"bounce": "none", //关闭窗口回弹效果
|
||||
"titleNView": {
|
||||
"titleText": "灿能物联", // 窗口的标题
|
||||
"titleAlign": "left",
|
||||
"padding-left": "16rpx",
|
||||
"padding-right": "20rpx",
|
||||
"buttons": [
|
||||
{
|
||||
"text": "请先创建工程",
|
||||
"fontSize": "28rpx",
|
||||
"select": true,
|
||||
"width": "auto"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -247,12 +231,42 @@
|
||||
"navigationBarTitleText": "移交"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/device/share",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分享"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/home/feedback",
|
||||
"style": {
|
||||
"navigationBarTitleText": "提交反馈"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/home/selectEngineering",
|
||||
"style": {
|
||||
"app-plus": {
|
||||
"bounce": "none",
|
||||
//关闭窗口回弹效果
|
||||
"titleNView": {
|
||||
"titleText": "灿能物联",
|
||||
// 窗口的标题
|
||||
"titleAlign": "center",
|
||||
"padding-left": "16rpx",
|
||||
"padding-right": "20rpx",
|
||||
"buttons": [
|
||||
{
|
||||
"text": "创建工程",
|
||||
"fontSize": "28rpx",
|
||||
"select": false,
|
||||
"width": "auto"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/message/feedback",
|
||||
"style": {
|
||||
@@ -455,9 +469,8 @@
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "灿能电力",
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"backgroundColor": "#f3f4f5"
|
||||
"backgroundColor": "#f3f4f5",
|
||||
// #ifdef H5
|
||||
,
|
||||
"navigationStyle": "custom"
|
||||
// #endif
|
||||
},
|
||||
@@ -470,7 +483,8 @@
|
||||
},
|
||||
"condition": {
|
||||
//模式配置,仅开发期间生效
|
||||
"current": 0, //当前激活的模式(list 的索引项)
|
||||
"current": 0,
|
||||
//当前激活的模式(list 的索引项)
|
||||
"list": []
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<view>
|
||||
<uni-data-checkbox v-model="radio" :localdata="sex"></uni-data-checkbox>
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="bar" :opts="opts" :chartData="chartData"/>
|
||||
<qiun-data-charts type="column" :ontouch='true' :opts="opts" :chartData="chartData"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -12,8 +12,8 @@ export default {
|
||||
props: {
|
||||
basicData: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -26,31 +26,45 @@ export default {
|
||||
//您可以通过修改 config-ucharts.js 文件中下标为 ['column'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
|
||||
opts: {
|
||||
enableScroll: true,
|
||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
|
||||
padding: [10, 0, 10, 0],
|
||||
color: [
|
||||
'#1890FF',
|
||||
'#91CB74',
|
||||
'#FAC858',
|
||||
'#EE6666',
|
||||
'#73C0DE',
|
||||
'#3CA272',
|
||||
'#FC8452',
|
||||
'#9A60B4',
|
||||
'#ea7ccc',
|
||||
],
|
||||
padding: [20, 10, 0, 0],
|
||||
legend: {},
|
||||
xAxis: {
|
||||
disableGrid: true,
|
||||
itemCount: 8,
|
||||
// scrollShow: true,
|
||||
data: [
|
||||
{
|
||||
min: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
yAxis: {
|
||||
data: [
|
||||
{
|
||||
min: 0
|
||||
}
|
||||
]
|
||||
min: 0,
|
||||
tofix: 4,
|
||||
},
|
||||
],
|
||||
},
|
||||
extra: {
|
||||
column: {
|
||||
type: "group",
|
||||
width: 30,
|
||||
activeBgColor: "#000000",
|
||||
activeBgOpacity: 0.08
|
||||
}
|
||||
width: 10,
|
||||
categoryGap: 1,
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
basicData: {
|
||||
@@ -75,7 +89,8 @@ export default {
|
||||
})
|
||||
if (index > -1) {
|
||||
if (this.renderData[arr[index]['name']][item.phase]) {
|
||||
this.renderData[arr[index]['name']][item.phase][item.statisticalName] = item.statisticalData || 0
|
||||
this.renderData[arr[index]['name']][item.phase][item.statisticalName] =
|
||||
item.statisticalData || 0
|
||||
} else {
|
||||
this.renderData[arr[index]['name']][item.phase] = {
|
||||
phase: item.phase,
|
||||
@@ -88,76 +103,59 @@ export default {
|
||||
this.sex = Object.keys(this.renderData['电网侧']).map((item, index) => {
|
||||
return {
|
||||
text: item,
|
||||
value: index
|
||||
value: index,
|
||||
}
|
||||
})
|
||||
|
||||
let obj = JSON.parse(JSON.stringify(this.renderData['电网侧'][Object.keys(this.renderData['电网侧'])[0]]))
|
||||
let obj = JSON.parse(
|
||||
JSON.stringify(this.renderData['电网侧'][Object.keys(this.renderData['电网侧'])[0]]),
|
||||
)
|
||||
delete obj['phase']
|
||||
console.log(Object.keys(obj).map(item => {
|
||||
return Number(item.match(/Pq_HarmI_(\d+)/)[1])
|
||||
}))
|
||||
console.log(Object.values(this.renderData['电网侧'][this.sex[this.radio].text]).filter((item) => {
|
||||
return typeof item === 'number'
|
||||
}))
|
||||
console.log(Object.values(this.renderData['负载侧'][this.sex[this.radio].text]).filter((item) => {
|
||||
return typeof item === 'number'
|
||||
}))
|
||||
this.chartData = {
|
||||
categories: Object.keys(obj).map(item => {
|
||||
console.log(
|
||||
Object.keys(obj).map((item) => {
|
||||
return item.match(/Pq_HarmI_(\d+)/)[1]
|
||||
}),
|
||||
)
|
||||
console.log(
|
||||
Object.values(this.renderData['电网侧'][this.sex[this.radio].text]).filter((item) => {
|
||||
return typeof item === 'number'
|
||||
}),
|
||||
)
|
||||
console.log(
|
||||
Object.values(this.renderData['负载侧'][this.sex[this.radio].text]).filter((item) => {
|
||||
return typeof item === 'number'
|
||||
}),
|
||||
)
|
||||
this.chartData = {
|
||||
categories: Object.keys(obj).map((item) => {
|
||||
return Number(item.match(/Pq_HarmI_(\d+)/)[1])
|
||||
}),
|
||||
series: [
|
||||
{
|
||||
name: "电网侧",
|
||||
name: '电网侧',
|
||||
data: Object.values(this.renderData['电网侧'][this.sex[this.radio].text]).filter((item) => {
|
||||
return typeof item === 'number'
|
||||
})
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "负载侧",
|
||||
name: '负载侧',
|
||||
data: Object.values(this.renderData['负载侧'][this.sex[this.radio].text]).filter((item) => {
|
||||
return typeof item === 'number'
|
||||
})
|
||||
}
|
||||
]
|
||||
}),
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.getServerData();
|
||||
},
|
||||
methods: {
|
||||
getServerData() {
|
||||
//模拟从服务器获取数据时的延时
|
||||
setTimeout(() => {
|
||||
//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
|
||||
let res = {
|
||||
categories: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"],
|
||||
series: [
|
||||
{
|
||||
name: "电网侧",
|
||||
data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 7]
|
||||
},
|
||||
{
|
||||
name: "负载册",
|
||||
data: [5, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
|
||||
}
|
||||
]
|
||||
};
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
}, 500);
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.charts-box {
|
||||
margin-top: 20rpx;
|
||||
height: 600px;
|
||||
height: 800rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body">
|
||||
<view class="detail" :style="{ opacity: domLoading ? '0' : '1' }">
|
||||
<view class="detail" :style="{ opacity: domLoading ? '0' : '1' }" style="overflow: hidden">
|
||||
<view class="detail-header">
|
||||
<Cn-htmlToImg domId="header" @renderFinish="renderFinish">
|
||||
<view class="header" id="header" ref="header" @click="previewImg">
|
||||
@@ -331,7 +331,7 @@ export default {
|
||||
this.timer = setInterval(() => {
|
||||
console.log('askDevData')
|
||||
this.client.publish(`/zl/askDevData/${this.devId}`)
|
||||
}, 10000)
|
||||
}, 1000 * 60)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -346,9 +346,10 @@ export default {
|
||||
console.log('连接断开')
|
||||
})
|
||||
.on('message', (topic, message) => {
|
||||
console.log('接收推送信息:', message.toString())
|
||||
if (!message.toString()) {
|
||||
return
|
||||
console.log('接收推送信息:', message.toString(), topic)
|
||||
if (topic !== `/zl/devData/${this.devId}`) return
|
||||
if ((!message.toString() || message.toString().length < 10) && this.loading) {
|
||||
this.$util.toast('该设备暂无数据')
|
||||
}
|
||||
this.loading = false
|
||||
this.handlerData(JSON.parse(message.toString()))
|
||||
@@ -389,6 +390,8 @@ export default {
|
||||
uni.setNavigationBarTitle({title: this.deviceInfo.devName || '设备详情'})
|
||||
this.topolodyData.filter((item) => {
|
||||
let index = this.deviceInfo.appsLineTopologyDiagramPO.findIndex((element) => {
|
||||
element.label = element.name
|
||||
item.label = element.name
|
||||
return element.linePostion === item.linePostion
|
||||
})
|
||||
if (index > -1) {
|
||||
|
||||
@@ -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,7 +18,7 @@
|
||||
</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>
|
||||
@@ -41,17 +41,17 @@
|
||||
<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
|
||||
<uni-icons
|
||||
type="image"
|
||||
color="#007aff"
|
||||
size="26"
|
||||
class="ml20"
|
||||
@click="chooseGplot"
|
||||
></uni-icons> -->
|
||||
></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="监测点" v-if="pointList.length && formData.topologyDiagramUrl">
|
||||
@@ -68,10 +68,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">
|
||||
@@ -86,8 +86,8 @@
|
||||
:key="key"
|
||||
/>
|
||||
<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>
|
||||
@@ -96,7 +96,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">
|
||||
@@ -125,8 +125,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>
|
||||
@@ -135,8 +135,9 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { registerDevice, getModel, addDevice, queryByTopoId, updateDevice } from '@/common/api/device.js'
|
||||
import { getProjectList, queryTopologyDiagramPage } from '@/common/api/project.js'
|
||||
import {registerDevice, getModel, addDevice, queryByTopoId, updateDevice} from '@/common/api/device.js'
|
||||
import {getProjectList, queryTopologyDiagramPage} from '@/common/api/project.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -170,6 +171,8 @@ export default {
|
||||
position: item.linePostion,
|
||||
}
|
||||
})
|
||||
console.log(this.pointList, 'this.poinitList')
|
||||
this.queryTopologyDiagramPage()
|
||||
},
|
||||
created() {
|
||||
let engineering = uni.getStorageSync(this.$cacheKey.engineering)
|
||||
@@ -236,8 +239,9 @@ export default {
|
||||
projectId: this.formData.projectId,
|
||||
}).then((res) => {
|
||||
this.imageList = res.data.records
|
||||
this.activeGplot = 0
|
||||
this.confirmGplot()
|
||||
this.activeGplot = this.imageList.findIndex(item => {
|
||||
return item.id === this.deviceInfo.id
|
||||
})
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
@@ -247,7 +251,8 @@ export default {
|
||||
positionChange(e) {
|
||||
this.point.name = this.positionList.find((item) => item.id == e).name
|
||||
},
|
||||
projectChange(e) {},
|
||||
projectChange(e) {
|
||||
},
|
||||
scanCode() {
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
@@ -309,6 +314,8 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.point.lat = this.point.coordinate.x
|
||||
this.point.lng = this.point.coordinate.y
|
||||
this.pointList[this.editIndex] = this.point
|
||||
console.log(this.pointList)
|
||||
this.closeDrawer()
|
||||
@@ -317,6 +324,7 @@ export default {
|
||||
this.pointList.splice(index, 1)
|
||||
},
|
||||
editPoint(item, index) {
|
||||
console.log(item)
|
||||
this.point = item
|
||||
console.log(this.point)
|
||||
this.editIndex = index
|
||||
@@ -334,15 +342,22 @@ export default {
|
||||
},
|
||||
dragPoint(e) {
|
||||
console.log(e)
|
||||
this.point.lat = e.detail.x
|
||||
this.point.lng = e.detail.y
|
||||
this.point.coordinate = {
|
||||
x: e.detail.x,
|
||||
y: e.detail.y,
|
||||
}
|
||||
// this.point.lat = e.detail.x
|
||||
// this.point.lng = e.detail.y
|
||||
},
|
||||
submit() {
|
||||
updateDevice(this.pointList).then((res) => {
|
||||
updateDevice({
|
||||
pointList: this.pointList,
|
||||
id: this.imageList[this.activeGplot].id
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.$util.toast('提交成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({ delta: 2 })
|
||||
uni.navigateBack({delta: 2})
|
||||
}, 1500)
|
||||
})
|
||||
},
|
||||
@@ -383,6 +398,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 188rpx;
|
||||
}
|
||||
|
||||
.gplot-empty {
|
||||
margin: 0 auto;
|
||||
border: 1px dashed #dcdfe6;
|
||||
@@ -460,6 +476,7 @@ export default {
|
||||
.point-item:first-of-type {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.gplot-image {
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
|
||||
@@ -278,9 +278,14 @@ export default {
|
||||
},
|
||||
scanCode() {
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
success (res) {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
let content = JSON.parse(res.result)
|
||||
if (content.type === 'NDID') {
|
||||
this.formData.nDid = content.nDid
|
||||
this.register()
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
@@ -337,6 +342,8 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
this.point.lat = this.point.coordinate.x
|
||||
this.point.lng = this.point.coordinate.y
|
||||
this.pointList[this.editIndex] = this.point
|
||||
console.log(this.pointList)
|
||||
this.closeDrawer()
|
||||
@@ -362,8 +369,12 @@ export default {
|
||||
},
|
||||
dragPoint(e) {
|
||||
console.log(e)
|
||||
this.point.lat = e.detail.x
|
||||
this.point.lng = e.detail.y
|
||||
this.point.coordinate = {
|
||||
x: e.detail.x,
|
||||
y: e.detail.y,
|
||||
}
|
||||
// this.point.lat = e.detail.x
|
||||
// this.point.lng = e.detail.y
|
||||
},
|
||||
submit() {
|
||||
if (!this.formData.projectId) {
|
||||
|
||||
197
pages/device/share.vue
Normal file
197
pages/device/share.vue
Normal file
File diff suppressed because one or more lines are too long
@@ -4,7 +4,8 @@
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<!-- <uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode> -->
|
||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }" :loading="false"></uqrcode>
|
||||
<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">请让接收人员扫码接收</view>
|
||||
@@ -12,7 +13,7 @@
|
||||
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||
返回
|
||||
</button>
|
||||
<button class="transfer-btn-item ml20" @click="home">转移成功</button>
|
||||
<button class="transfer-btn-item ml20" @click="scan">扫一扫</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -22,22 +23,51 @@
|
||||
// import QRCode from 'qrcodejs2'
|
||||
// import UQRCode from '@/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js';
|
||||
|
||||
import {transferDevice} from "@/common/api/device";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
content: '',
|
||||
options: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
uni.navigateBack({delta: 1})
|
||||
},
|
||||
home() {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
uni.navigateBack({delta: 1})
|
||||
},
|
||||
transferDevice(userId) {
|
||||
transferDevice(this.options.id, userId).then((res) => {
|
||||
uni.showToast({
|
||||
title: '移交成功',
|
||||
icon: 'none',
|
||||
})
|
||||
uni.navigateBack()
|
||||
})
|
||||
},
|
||||
scan() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
let data = JSON.parse(res.result)
|
||||
if (data.type === 'userId') {
|
||||
this.transferDevice(data.id)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请扫描正确的二维码',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.options = options
|
||||
this.content = JSON.stringify({
|
||||
type: 'transferDevice',
|
||||
id: options.id,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<view class="header-des-mini mb10"
|
||||
>{{ engineering.provinceName + engineering.cityName }} {{ engineering.createTime }}</view
|
||||
>
|
||||
<view class="header-des">{{ engineering.description }} </view>
|
||||
<view class="header-des">工程描述:{{ engineering.description }} </view>
|
||||
</view>
|
||||
<view class="nav">
|
||||
<view
|
||||
@@ -34,11 +34,11 @@
|
||||
<view class="term-list-bottom">
|
||||
<view class="term-list-bottom-item">
|
||||
<view>设备个数</view>
|
||||
<view>3</view>
|
||||
<view>{{item.devNum}}</view>
|
||||
</view>
|
||||
<view class="term-list-bottom-item">
|
||||
<view>用户个数</view>
|
||||
<view>1</view>
|
||||
<view>创建时间</view>
|
||||
<view>{{item.createTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
@@ -17,12 +17,15 @@
|
||||
@clickLeft="back"
|
||||
@clickRight="add"
|
||||
/>
|
||||
<uni-search-bar v-model="store.params.name" clearButton="none" bgColor="#fff" placeholder="请输入关键词"
|
||||
@input="store.search()"></uni-search-bar>
|
||||
<view class="message">
|
||||
<uni-card
|
||||
:title="item.name"
|
||||
:extra="item.projectType"
|
||||
@click="jump(item)"
|
||||
v-for="(item, index) in store.data"
|
||||
:style="{marginTop:index===0?'0':''}"
|
||||
:key="index"
|
||||
>
|
||||
<view class="term-list-bottom">
|
||||
@@ -57,6 +60,7 @@ export default {
|
||||
init() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.store = this.DataSource('/cs-device-boot/engineering/queryEngineeringPage')
|
||||
this.store.params.name = ''
|
||||
this.store.reload()
|
||||
this.store.firstCallBack = (res) => {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
|
||||
@@ -8,28 +8,29 @@
|
||||
<uni-data-select v-model="item.type" :localdata="range"></uni-data-select>
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="标题">
|
||||
<uni-easyinput type="text" v-model="formData.title" placeholder="请输入问题简要" />
|
||||
<uni-easyinput type="text" v-model="formData.title" placeholder="请输入问题简要"/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="描述">
|
||||
<uni-easyinput type="textarea" v-model="formData.description" placeholder="请输入详细描述" />
|
||||
<uni-easyinput type="textarea" v-model="formData.description" placeholder="请输入详细描述"/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="图片">
|
||||
<uni-file-picker :auto-upload="false" @select="fileChange" @delete="delImg" />
|
||||
<uni-file-picker :auto-upload="false" @select="fileChange" @delete="delImg"/>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item " @click="submit"> 提交 </view>
|
||||
<view class="btn-wrap-item " @click="submit"> 提交</view>
|
||||
</view>
|
||||
<navigator url="/pages/home/service" hover-class="none" class="fixed-btn">
|
||||
<image src="/static/service.png" style="height:66rpx;width:66rpx" />
|
||||
<image src="/static/service.png" style="height:66rpx;width:66rpx"/>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { addFeedBack } from '../../common/api/feedback'
|
||||
import {addFeedBack} from '../../common/api/feedback'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -42,8 +43,8 @@ export default {
|
||||
files: []
|
||||
},
|
||||
range: [
|
||||
{ value: 0, text: "DVR" },
|
||||
{ value: 1, text: "APF" },
|
||||
{value: 0, text: "DVR"},
|
||||
{value: 1, text: "APF"},
|
||||
],
|
||||
|
||||
}
|
||||
@@ -57,7 +58,7 @@ export default {
|
||||
console.log(e);
|
||||
e.tempFilePaths.forEach(item => {
|
||||
this.formData.files.push({
|
||||
url: item,
|
||||
uri: item,
|
||||
name: 'files'
|
||||
})
|
||||
})
|
||||
@@ -79,20 +80,24 @@ export default {
|
||||
}
|
||||
addFeedBack(this.formData).then(res => {
|
||||
console.log(res)
|
||||
res = res[1]
|
||||
res = JSON.parse(res.data)
|
||||
console.log(res);
|
||||
console.log(this.formData.files.length)
|
||||
if (this.formData.files.length > 0) {
|
||||
res = res[1]
|
||||
res = JSON.parse(res.data)
|
||||
console.log(res);
|
||||
}
|
||||
console.log(res)
|
||||
if (res.code === 'A0000') {
|
||||
this.$util.toast(res.message)
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({ url: '/pages/message/feedback' })
|
||||
uni.redirectTo({url: '/pages/message/feedback'})
|
||||
}, 1000);
|
||||
} else {
|
||||
this.$util.toast(res.message)
|
||||
}
|
||||
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
60
pages/home/selectEngineering.vue
Normal file
60
pages/home/selectEngineering.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='select-enineering'>
|
||||
<uni-indexed-list
|
||||
:options="engineeringListFilter"
|
||||
:showSelect="false"
|
||||
@click="confirm"
|
||||
></uni-indexed-list>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import {pinyin} from 'pinyin-pro'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
engineeringList:[]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
engineeringListFilter() {
|
||||
let result = []
|
||||
this.engineeringList.forEach((item) => {
|
||||
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)
|
||||
if (index === -1) {
|
||||
result.push({
|
||||
letter,
|
||||
data: [item.name],
|
||||
})
|
||||
} else {
|
||||
result[index].data.push(item.name)
|
||||
}
|
||||
})
|
||||
return result
|
||||
},
|
||||
},
|
||||
onLoad(){
|
||||
this.engineeringList = uni.getStorageSync('engineeringList')
|
||||
},
|
||||
methods: {
|
||||
confirm(e) {
|
||||
console.log(e)
|
||||
let engineering = this.engineeringList.find((item) => item.name === e.item.name)
|
||||
uni.setStorageSync('engineering', engineering)
|
||||
uni.navigateBack()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.index {
|
||||
padding: 34rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="device">
|
||||
<view class="nav" :style="{ top: navHeight + 'px' }">
|
||||
<view class="nav" :style="{ top: navTabHeight + 'px' }">
|
||||
<!-- <view class="nav-menu" :class="{ 'nav-menu-active': select.engineeringName }" @click="openDrawer"
|
||||
>{{ select.engineeringName || '工程' }}
|
||||
</view> -->
|
||||
@@ -37,20 +37,21 @@
|
||||
<view style="flex: 1"></view>
|
||||
<template v-if="deviceListFilter.length">
|
||||
<template v-if="transfer || share">
|
||||
<view class="nav-menu nav-menu-btn" @click="submit">确定 </view>
|
||||
<view class="nav-menu nav-menu-btn" @click="cancel">取消</view>
|
||||
<view class="nav-menu nav-menu-btn" @click="submit">确定</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view
|
||||
class="nav-menu nav-menu-btn"
|
||||
@click="transfer = true"
|
||||
@click="selectDevice('transfer')"
|
||||
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
|
||||
>移交
|
||||
>移交
|
||||
</view>
|
||||
<view
|
||||
class="nav-menu nav-menu-btn"
|
||||
@click="share = true"
|
||||
@click="selectDevice('share')"
|
||||
v-if="userInfo.authorities === 'app_vip_user'"
|
||||
>分享
|
||||
>分享
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
@@ -92,8 +93,9 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getProjectList } from '@/common/api/project'
|
||||
import { queryDictData } from '@/common/api/dictionary'
|
||||
import {getProjectList} from '@/common/api/project'
|
||||
import {queryDictData} from '@/common/api/dictionary'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
store: {
|
||||
@@ -113,18 +115,18 @@ export default {
|
||||
projectType: '',
|
||||
projectTypeIndex: 0,
|
||||
},
|
||||
minHeight: '',
|
||||
minHeight: 0,
|
||||
navTabHeight: 0,
|
||||
engineeringList: [],
|
||||
projectList: [],
|
||||
projectType: [],
|
||||
navHeight: 0,
|
||||
userInfo: {},
|
||||
selectProject: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
deviceListFilter() {
|
||||
return this.store.data.filter((item) => {
|
||||
let arr = this.store.data.filter((item) => {
|
||||
if (this.select.projectName && this.select.projectType) {
|
||||
return item.project === this.select.projectName && item.type === this.select.projectType
|
||||
} else if (this.select.projectName) {
|
||||
@@ -135,12 +137,30 @@ export default {
|
||||
return true
|
||||
}
|
||||
})
|
||||
if (this.transfer || this.share) {
|
||||
return arr.filter((item) => {
|
||||
return item.isPrimaryUser === '1'
|
||||
})
|
||||
} else {
|
||||
return arr
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
selectDevice(type) {
|
||||
if (this.deviceListFilter.findIndex(item => item.isPrimaryUser === '1') === -1) {
|
||||
this.$util.toast('没有可操作的设备')
|
||||
} else {
|
||||
this[type] = true
|
||||
}
|
||||
},
|
||||
deviceIcon(e) {
|
||||
let str = ''
|
||||
switch (e) {
|
||||
@@ -165,35 +185,50 @@ export default {
|
||||
this.checkList.push(e.equipmentId)
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
console.log(this.checkList)
|
||||
if (this.transfer) {
|
||||
this.transfer = false
|
||||
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.checkList.join(',') })
|
||||
} else if (this.share) {
|
||||
this.share = false
|
||||
this.$emit('share', this.shareList)
|
||||
}
|
||||
cancel() {
|
||||
this.transfer = false
|
||||
this.share = false
|
||||
this.checkList = []
|
||||
},
|
||||
submit() {
|
||||
console.log(this.checkList)
|
||||
if (this.checkList.length === 0) {
|
||||
this.$util.toast('请选择设备')
|
||||
return
|
||||
}
|
||||
if (this.transfer) {
|
||||
uni.navigateTo({url: '/pages/device/transfer?id=' + this.checkList.join(',')})
|
||||
} else if (this.share) {
|
||||
uni.navigateTo({url: '/pages/device/share?id=' + this.checkList.join(',')})
|
||||
}
|
||||
this.cancel()
|
||||
},
|
||||
async init() {
|
||||
console.warn('init')
|
||||
this.getProjectList()
|
||||
this.getDeviceList()
|
||||
},
|
||||
getDeviceList() {
|
||||
this.store.params.pageSize = 999
|
||||
this.store.firstCallBack = () => {
|
||||
// 获取nav高度
|
||||
this.store.params.pageSize = 50
|
||||
this.store.firstCallBack = (res) => {
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect2) => {
|
||||
if (!rect2) return
|
||||
// #ifdef H5
|
||||
this.minHeight = 'calc(100vh - env(safe-area-inset-bottom) - ' + (50 + rect2.height) + 'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + rect2.height + 'px)'
|
||||
// #endif
|
||||
.select('.uni-navbar')
|
||||
.boundingClientRect((rect1) => {
|
||||
if (!rect1) return
|
||||
this.navTabHeight = rect1.height
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect2) => {
|
||||
if (!rect2) return
|
||||
// #ifdef H5
|
||||
this.minHeight = 'calc(100vh - ' + (this.navTabHeight + rect2.height + 50) + 'px)'
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.minHeight = 'calc(100vh - ' + (this.navTabHeight + rect2.height) + 'px)'
|
||||
console.log(this.minHeight)
|
||||
// #endif
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
.exec()
|
||||
}
|
||||
@@ -239,7 +274,7 @@ export default {
|
||||
})
|
||||
},
|
||||
submitFeedBack() {
|
||||
uni.navigateTo({ url: '/pages/home/feedback' })
|
||||
uni.navigateTo({url: '/pages/home/feedback'})
|
||||
},
|
||||
projectTypeChange(e) {
|
||||
this.select.projectTypeIndex = e.detail.value
|
||||
@@ -266,7 +301,7 @@ export default {
|
||||
confirmText: '直连装置',
|
||||
cancelText: '网关接入',
|
||||
cancelColor: '#007aff',
|
||||
success: ({ confirm, cancel }) => {
|
||||
success: ({confirm, cancel}) => {
|
||||
if (confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/new',
|
||||
@@ -300,6 +335,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
|
||||
&-left {
|
||||
flex: 1;
|
||||
margin-right: 10px;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<Cn-grid title="">
|
||||
<Cn-grid-item src="/static/device2.png" text="设备注册" @click="registerDevice"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item src="/static/gateway2.png" text="网关注册" @click="registerGateway"></Cn-grid-item> -->
|
||||
<Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item>
|
||||
<!-- <Cn-grid-item src="/static/feedback2.png" text="问题反馈" @click="submitFeedBack"></Cn-grid-item>-->
|
||||
</Cn-grid>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body" class="canneng-index">
|
||||
<!-- <uni-nav-bar
|
||||
<uni-nav-bar
|
||||
rightWidth="300rpx"
|
||||
leftWidth="300rpx"
|
||||
dark
|
||||
:fixed="true"
|
||||
status-bar
|
||||
background-color="#376cf3"
|
||||
color="#fff"
|
||||
@clickRight="openDrawer"
|
||||
background-color="#fff"
|
||||
color="#111"
|
||||
@clickRight="selectEngineering"
|
||||
>
|
||||
<template slot="left">
|
||||
<text style="font-size: 32rpx; font-weight: 500">灿能物联</text>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<text class="hide-txt mr5" style="font-size: 28rpx">{{ select.engineeringName }}</text>
|
||||
<uni-icons type="bottom" size="16" color="#fff"></uni-icons>
|
||||
<uni-icons type="bottom" size="16" color="#111"></uni-icons>
|
||||
</template>
|
||||
</uni-nav-bar> -->
|
||||
</uni-nav-bar>
|
||||
<view class="index">
|
||||
<!-- 运维 -->
|
||||
<YunWei :devCount="devCount" v-if="userInfo.authorities === 'operation_manager'"/>
|
||||
@@ -34,15 +34,6 @@
|
||||
<Device ref="device" :store="store"/>
|
||||
</template>
|
||||
</view>
|
||||
<uni-drawer ref="showRight" mode="right" :mask-click="false">
|
||||
<view>
|
||||
<uni-indexed-list
|
||||
:options="engineeringListFilter"
|
||||
:showSelect="false"
|
||||
@click="closeDrawer"
|
||||
></uni-indexed-list>
|
||||
</view>
|
||||
</uni-drawer>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
@@ -56,7 +47,6 @@ 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'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
@@ -78,56 +68,24 @@ export default {
|
||||
engineeringId: '',
|
||||
},
|
||||
engineeringList: [],
|
||||
drawer: false,
|
||||
navTabHeight: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
engineeringListFilter() {
|
||||
let result = []
|
||||
this.engineeringList.forEach((item) => {
|
||||
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)
|
||||
if (index === -1) {
|
||||
result.push({
|
||||
letter,
|
||||
data: [item.name],
|
||||
})
|
||||
} else {
|
||||
result[index].data.push(item.name)
|
||||
}
|
||||
})
|
||||
return result
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onNavigationBarButtonTap(e) {
|
||||
console.log(e)
|
||||
// e的返回格式为json对象:{"text":"测试","index":0}
|
||||
this.drawer = !this.drawer
|
||||
if (this.drawer) {
|
||||
this.openDrawer()
|
||||
} else {
|
||||
this.closeDrawer()
|
||||
}
|
||||
selectEngineering() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/selectEngineering',
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
let res = await queryEngineering()
|
||||
this.engineeringList = res.data
|
||||
uni.setStorageSync('engineeringList', this.engineeringList)
|
||||
if (this.engineeringList.length === 0) {
|
||||
console.log('没有工程')
|
||||
uni.removeStorageSync(this.$cacheKey.engineering)
|
||||
this.projectList = []
|
||||
// 修改buttons
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: '请先创建工程',
|
||||
})
|
||||
// #endif
|
||||
} else {
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', res.data[0])
|
||||
@@ -144,15 +102,11 @@ export default {
|
||||
}
|
||||
}
|
||||
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()
|
||||
console.log(this.$refs.device, 'this.$refs.device')
|
||||
this.$nextTick(() => {
|
||||
this.$refs.device && this.$refs.device.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
getDevCount() {
|
||||
@@ -169,90 +123,18 @@ export default {
|
||||
console.log(this.devCount);
|
||||
})
|
||||
},
|
||||
closeDrawer(e) {
|
||||
if (!e) {
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: this.select.engineeringName
|
||||
? this.select.engineeringName.length > 7
|
||||
? this.select.engineeringName.substring(0, 7) + '...'
|
||||
: this.select.engineeringName
|
||||
: '请选择工程',
|
||||
select: true,
|
||||
})
|
||||
// #endif
|
||||
this.$refs.showRight.close()
|
||||
return
|
||||
}
|
||||
console.log(e)
|
||||
this.engineeringList.forEach((item) => {
|
||||
if (item.name === e.item.name) {
|
||||
uni.setStorageSync('engineering', item)
|
||||
this.select.engineeringName = item.name
|
||||
this.select.engineeringId = item.id
|
||||
this.store.params.engineerId = item.id
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text:
|
||||
this.select.engineeringName.length > 7
|
||||
? this.select.engineeringName.substring(0, 7) + '...'
|
||||
: this.select.engineeringName,
|
||||
select: true,
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
this.$refs.device.select.projectName = ''
|
||||
this.$refs.device.select.projectNameIndex = 0
|
||||
this.getDevCount()
|
||||
this.$refs.device.init()
|
||||
this.$refs.showRight.close()
|
||||
},
|
||||
send() {
|
||||
uni.createPushMessage({
|
||||
title: '灿能',
|
||||
content: '灿能推送',
|
||||
success: function (res) {
|
||||
console.log('推送成功')
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('推送失败')
|
||||
},
|
||||
})
|
||||
},
|
||||
loadingChange(e) {
|
||||
this.loading = e
|
||||
},
|
||||
openDrawer(item) {
|
||||
if (this.engineeringList.length === 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new',
|
||||
})
|
||||
return
|
||||
} else if (this.engineeringList.length === 1) {
|
||||
uni.showToast({
|
||||
title: '暂无其他工程',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
var webView = this.$mp.page.$getAppWebview()
|
||||
// 修改buttons
|
||||
webView.setTitleNViewButtonStyle(0, {
|
||||
text: '取消',
|
||||
select: false,
|
||||
})
|
||||
// #endif
|
||||
this.$refs.showRight.open()
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
this.store = this.DataSource('/cs-device-boot/EquipmentDelivery/queryEquipmentByProject')
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery().select('.uni-navbar').boundingClientRect((rect) => {
|
||||
this.navTabHeight = rect.height
|
||||
console.log('calc(100vh - ' + this.navTabHeight + ')')
|
||||
}).exec()
|
||||
}, 1000)
|
||||
// #endif
|
||||
},
|
||||
onShow() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
@@ -271,6 +153,10 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.popup-content {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.index {
|
||||
padding: 20rpx 0 0;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<view :loading="loading">
|
||||
<view class="mine">
|
||||
<view class="mine-header" @click="jump('basic')">
|
||||
<image mode="aspectFill" class="mine-header-head" :src="userInfo.avatar" v-if="userInfo.avatar" />
|
||||
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" v-else />
|
||||
<image mode="aspectFill" class="mine-header-head" :src="userInfo.avatar" v-if="userInfo.avatar"/>
|
||||
<image mode="aspectFill" class="mine-header-head" src="/static/head.png" v-else/>
|
||||
<view class="mine-header-name hide-txt">
|
||||
<view>{{ userInfo.nickname }}</view>
|
||||
<view></view>
|
||||
<view class="tag">{{ roleName }} </view>
|
||||
<view class="tag">{{ roleName }}</view>
|
||||
</view>
|
||||
<image
|
||||
src="/static/erweima.png"
|
||||
@@ -17,7 +17,7 @@
|
||||
<uni-icons type="forward" color="#aaa" size="16"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" v-if="userInfo.authorities === 'tourist'" @click="jump('upgrade')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png" />
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/server.png"/>
|
||||
<view class="mine-nav-label">角色升级</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
@@ -37,12 +37,12 @@
|
||||
@click="jump('scan')"
|
||||
v-if="userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'"
|
||||
>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.png" />
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/scan.png"/>
|
||||
<view class="mine-nav-label">扫一扫</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('engineering')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png"/>
|
||||
<view class="mine-nav-label">工程列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
@@ -51,12 +51,12 @@
|
||||
@click="jump('engineering/setting')"
|
||||
v-if="userInfo.authorities === 'engineering_user'"
|
||||
>
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png" />
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/like.png"/>
|
||||
<view class="mine-nav-label">关注工程配置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('project')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png" />
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/project.png"/>
|
||||
<view class="mine-nav-label">项目列表</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
@@ -70,12 +70,12 @@
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view> -->
|
||||
<view class="mine-nav" @click="jump('setupMessage')">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/message4.png" />
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/message4.png"/>
|
||||
<view class="mine-nav-label">消息配置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('setup')" style="border-bottom: none">
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png" />
|
||||
<image mode="aspectFill" class="mine-nav-icon" src="/static/setup.png"/>
|
||||
<view class="mine-nav-label">设置</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
@@ -93,8 +93,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { roleUpdate, autoLogin } from '@/common/api/user'
|
||||
import { transferDevice } from '@/common/api/device'
|
||||
import {roleUpdate, autoLogin} from '@/common/api/user'
|
||||
import {transferDevice,shareDevice} from '@/common/api/device'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -130,7 +130,8 @@ export default {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {},
|
||||
init() {
|
||||
},
|
||||
upgrade(code) {
|
||||
console.log(code)
|
||||
roleUpdate({
|
||||
@@ -162,7 +163,11 @@ export default {
|
||||
case 'transferDevice':
|
||||
this.transferDevice(content.id.split(','))
|
||||
break
|
||||
case 'shareDevice':
|
||||
this.shareDevice(content.id.split(','))
|
||||
break
|
||||
default:
|
||||
this.$util.toast('无效二维码')
|
||||
break
|
||||
}
|
||||
},
|
||||
@@ -210,7 +215,12 @@ export default {
|
||||
},
|
||||
transferDevice(id) {
|
||||
transferDevice(id).then((res) => {
|
||||
uni.navigateTo({ url: '/pages/mine/result?type=transferDevice&id=' + id })
|
||||
uni.navigateTo({url: '/pages/mine/result?type=transferDevice&id=' + id})
|
||||
})
|
||||
},
|
||||
shareDevice(id) {
|
||||
shareDevice(id).then((res) => {
|
||||
uni.navigateTo({url: '/pages/mine/result?type=shareDevice&id=' + id})
|
||||
})
|
||||
},
|
||||
},
|
||||
@@ -252,6 +262,7 @@ export default {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
|
||||
.engineering-button {
|
||||
margin-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<uni-list>
|
||||
<uni-list-item :title="item.createBy" :note="item.chatContent" :rightText="item.createTime"
|
||||
<uni-list-item :title="item.userName" :note="item.chatContent" :rightText="item.createTime"
|
||||
v-for="(item, index) in pageData.csFeedbackChatPOList" :key="index" />
|
||||
<Cn-empty v-if="pageData.csFeedbackChatPOList && pageData.csFeedbackChatPOList.length == 0"></Cn-empty>
|
||||
</uni-list>
|
||||
@@ -66,6 +66,13 @@ export default {
|
||||
// 反转数组
|
||||
res.data.csFeedbackChatPOList.reverse()
|
||||
this.pageData = res.data
|
||||
this.imageValue = res.data.imageUrls.map(item => {
|
||||
return {
|
||||
"name": item,
|
||||
"extname": item.split('.')[1],
|
||||
"url": item,
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
console.log(res);
|
||||
})
|
||||
|
||||
@@ -27,6 +27,9 @@ export default {
|
||||
case 'transferDevice':
|
||||
str = '移交成功'
|
||||
break
|
||||
case 'shareDevice':
|
||||
str = '设备分享接受成功'
|
||||
break
|
||||
default:
|
||||
str = '操作成功'
|
||||
break
|
||||
|
||||
@@ -1,35 +1,66 @@
|
||||
<template>
|
||||
<view :loading="loading">
|
||||
<view class="mine">
|
||||
<Cn-page :loading="loading">
|
||||
<view class="mine" slot="body">
|
||||
<view class="mine-nav" style="margin-top: 20rpx">
|
||||
<view class="mine-nav-label">稳态越限</view>
|
||||
<switch color="#376cf3" />
|
||||
<switch color="#376cf3" @change="change('dataInfo')" :checked="config.dataInfo === 1"/>
|
||||
</view>
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<view class="mine-nav-label">暂态事件</view>
|
||||
<switch color="#376cf3" />
|
||||
<switch color="#376cf3" @change="change('eventInfo')" :checked="config.eventInfo === 1"/>
|
||||
</view>
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<view class="mine-nav-label">设备状态</view>
|
||||
<switch color="#376cf3" />
|
||||
<switch color="#376cf3" @change="change('deviceInfo')" :checked="config.deviceInfo === 1"/>
|
||||
</view>
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<view class="mine-nav-label">设备消息</view>
|
||||
<switch color="#376cf3" />
|
||||
<switch color="#376cf3" @change="change('systemInfo')" :checked="config.systemInfo === 1"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {queryUserPushConfig, updatePushConfig} from '@/common/api/mine'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
loading: true,
|
||||
config: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {},
|
||||
init() {
|
||||
queryUserPushConfig().then(res => {
|
||||
this.config = res.data
|
||||
console.log(this.config)
|
||||
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
change(type) {
|
||||
this.config[type] = this.config[type] === 1 ? 0 : 1
|
||||
updatePushConfig(this.config).then(res => {
|
||||
let str = ''
|
||||
switch (type){
|
||||
case 'dataInfo':
|
||||
str = '稳态越限'
|
||||
break
|
||||
case 'eventInfo':
|
||||
str = '暂态事件'
|
||||
break
|
||||
case 'deviceInfo':
|
||||
str = '设备状态'
|
||||
break
|
||||
case 'systemInfo':
|
||||
str = '设备消息'
|
||||
break
|
||||
}
|
||||
this.$util.toast(`${str}推送${this.config[type] === 1 ? '开启' : '关闭'}成功`)
|
||||
})
|
||||
},
|
||||
jump(type) {
|
||||
switch (type) {
|
||||
case 'changePwd':
|
||||
@@ -63,6 +94,7 @@ export default {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.mine-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
>{{ project.name }}
|
||||
<!-- <view class="header-title-extra">用能</view> -->
|
||||
</view>
|
||||
<view class="header-des">{{ project.description }}</view>
|
||||
<view class="header-des">项目描述:{{ project.description }}</view>
|
||||
</view>
|
||||
<view class="nav">
|
||||
<view
|
||||
@@ -37,25 +37,25 @@
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
</view>
|
||||
<!-- <view style="padding: 0 20rpx" v-show="navMenuActive == 1">-->
|
||||
<!-- <uni-list>-->
|
||||
<!-- <uni-list-item-->
|
||||
<!-- title="张三"-->
|
||||
<!-- note="2023-02-10 14:55"-->
|
||||
<!-- thumb="/static/head.png"-->
|
||||
<!-- thumb-size="lg"-->
|
||||
<!-- >-->
|
||||
<!-- </uni-list-item>-->
|
||||
<!-- <uni-list-item-->
|
||||
<!-- title="李四"-->
|
||||
<!-- note="2023-02-10 14:55"-->
|
||||
<!-- thumb="/static/head.png"-->
|
||||
<!-- thumb-size="lg"-->
|
||||
<!-- >-->
|
||||
<!-- </uni-list-item>-->
|
||||
<!-- </uni-list>-->
|
||||
<!-- </view>-->
|
||||
<view style="padding: 0 20rpx" v-show="navMenuActive == 1">
|
||||
<uni-list>
|
||||
<uni-list-item
|
||||
title="张三"
|
||||
note="2023-02-10 14:55"
|
||||
thumb="/static/head.png"
|
||||
thumb-size="lg"
|
||||
>
|
||||
</uni-list-item>
|
||||
<uni-list-item
|
||||
title="李四"
|
||||
note="2023-02-10 14:55"
|
||||
thumb="/static/head.png"
|
||||
thumb-size="lg"
|
||||
>
|
||||
</uni-list-item>
|
||||
</uni-list>
|
||||
</view>
|
||||
<view style="padding: 0 20rpx" v-show="navMenuActive == 2">
|
||||
<!-- <image
|
||||
class="gplot gplot-box"
|
||||
mode="aspectFill"
|
||||
@@ -108,9 +108,9 @@ export default {
|
||||
{
|
||||
text: '设备',
|
||||
},
|
||||
{
|
||||
text: '用户',
|
||||
},
|
||||
// {
|
||||
// text: '用户',
|
||||
// },
|
||||
{
|
||||
text: '拓扑图',
|
||||
},
|
||||
|
||||
@@ -13,16 +13,20 @@
|
||||
@clickLeft="back"
|
||||
@clickRight="add"
|
||||
/>
|
||||
<uni-search-bar v-model="store.params.searchValue" clearButton="none" bgColor="#fff" placeholder="请输入关键词"
|
||||
@input="store.search()"></uni-search-bar>
|
||||
<view class="message">
|
||||
<uni-card :title="item.name" @click="jump(item)" v-for="(item, index) in store.data" :key="index">
|
||||
<uni-card :title="item.name" @click="jump(item)"
|
||||
v-for="(item, index) in store.data" :key="index"
|
||||
:style="{marginTop:index===0?'0':''}">
|
||||
<view class="term-list-bottom">
|
||||
<view class="term-list-bottom-item">
|
||||
<view>设备个数</view>
|
||||
<view>{{ item.devNum }}</view>
|
||||
</view>
|
||||
<view class="term-list-bottom-item">
|
||||
<view>创建时间</view>
|
||||
<view>{{ item.createTime }}</view>
|
||||
<view>所属工程</view>
|
||||
<view>{{ item.engineeringName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
@@ -47,7 +51,7 @@ export default {
|
||||
init() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.store = this.DataSource('/cs-device-boot/project/queryProject')
|
||||
this.store.params.engineeringId = uni.getStorageSync('engineering')?.id
|
||||
this.store.params.searchValue = ''
|
||||
this.store.reload()
|
||||
},
|
||||
back() {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</uni-forms>
|
||||
<button type="default" class="submit-btn" @click="submit">提交</button>
|
||||
<view class="login-box-tips">
|
||||
<view style="color: #999">说明:密码需要包含特殊字符字母数字,长度为8-16</view>
|
||||
<view style="color: #999">说明:密码需要长度为8-16</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -140,14 +140,15 @@ export default {
|
||||
icon: 'none',
|
||||
})
|
||||
} else {
|
||||
// 密码需要包含特殊字符字母数字,长度为8-16
|
||||
if (
|
||||
!/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[#@!~%^&*.])[a-zA-Z\d#@!~%^&*.]{8,16}$/.test(
|
||||
this.formData.password,
|
||||
)
|
||||
) {
|
||||
return this.$util.toast('密码需要包含特殊字符字母数字,长度为8-16')
|
||||
// 密码需要长度为8-16
|
||||
if (this.formData.password.length < 8 || this.formData.password.length > 16) {
|
||||
uni.showToast({
|
||||
title: '密码需要长度为8-16',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
let loginName = encrypt(this.formData.phone)
|
||||
gongkey({ loginName }).then((response) => {
|
||||
let publicKey = response.data
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
<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>
|
||||
<image class="avatar" :src="userInfo.avatar" v-if="userInfo.avatar"></image>
|
||||
<image class="avatar" src="/static/head.png" v-else></image>
|
||||
<view class="right">
|
||||
<view class="user-info-name">{{ userInfo.nickname }}</view>
|
||||
<view class="user-info-role">{{ roleName }}</view>
|
||||
@@ -91,6 +92,7 @@ export default {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
console.log(this.userInfo)
|
||||
this.content = JSON.stringify({
|
||||
type: 'userId',
|
||||
id: this.userInfo.userIndex,
|
||||
@@ -122,6 +124,7 @@ export default {
|
||||
height: 100rpx;
|
||||
width: 100rpx;
|
||||
border-radius: 8rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.right {
|
||||
@@ -132,6 +135,7 @@ export default {
|
||||
.user-info-name {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.user-info-role {
|
||||
|
||||
@@ -137,9 +137,13 @@ export default {
|
||||
if (this.formData.password != this.formData.password2) {
|
||||
return this.$util.toast('两次密码不一致')
|
||||
}
|
||||
// 密码需要包含特殊字符字母数字,长度为8-16
|
||||
if (!/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[#@!~%^&*])[a-zA-Z\d#@!~%^&*]{8,16}$/.test(this.formData.password)) {
|
||||
return this.$util.toast('密码需要包含特殊字符字母数字,长度为8-16')
|
||||
// 密码需要长度为8-16
|
||||
if (this.formData.password.length < 8 || this.formData.password.length > 16) {
|
||||
uni.showToast({
|
||||
title: '密码需要长度为8-16',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
let loginName = encrypt(this.formData.phone)
|
||||
gongkey({ loginName }).then((response) => {
|
||||
|
||||
@@ -110,6 +110,7 @@ export default {
|
||||
waitTime: 0,
|
||||
tenantId: '',
|
||||
companyName: '',
|
||||
inter:null
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
|
||||
@@ -58,6 +58,7 @@ export default {
|
||||
step: 1,
|
||||
loading: false,
|
||||
waitTime: 0,
|
||||
inter:null,
|
||||
// 表单数据
|
||||
formData: {
|
||||
phone: '',
|
||||
|
||||
BIN
static/share_bg.png
Normal file
BIN
static/share_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
@@ -471,4 +471,4 @@
|
||||
.fixforpc-top {
|
||||
top: 0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user