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