修改测试问题
This commit is contained in:
@@ -1,85 +1,85 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='index'>
|
||||
<view class="content" v-for="(item, index) in formData" :key="index">
|
||||
<uni-forms>
|
||||
<uni-forms-item label="类型">
|
||||
<uni-data-select v-model="item.type" :localdata="range"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="区域">
|
||||
<uni-easyinput type="textarea" v-model="item.title" placeholder="请输入问题简要" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="描述">
|
||||
<uni-easyinput type="textarea" v-model="item.des" placeholder="请输入详细描述" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item " @click="submit"> 提交 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
formData: [
|
||||
{
|
||||
title: '',
|
||||
des: '',
|
||||
}
|
||||
],
|
||||
range: [
|
||||
{ value: 0, text: "需求" },
|
||||
{ value: 1, text: "缺陷" },
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.formData.push({
|
||||
type: '',
|
||||
address: '',
|
||||
})
|
||||
},
|
||||
submit () {
|
||||
console.log(this.formData)
|
||||
uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.index {
|
||||
padding: 20rpx;
|
||||
|
||||
.content {
|
||||
margin-bottom: 20rpx;
|
||||
padding: 34rpx;
|
||||
background: $uni-theme-white;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.btn-wrap {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn-wrap-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='index'>
|
||||
<view class="content" v-for="(item, index) in formData" :key="index">
|
||||
<uni-forms>
|
||||
<uni-forms-item label="类型">
|
||||
<uni-data-select v-model="item.type" :localdata="range"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="区域">
|
||||
<uni-easyinput type="textarea" v-model="item.title" placeholder="请输入区域" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="描述">
|
||||
<uni-easyinput type="textarea" v-model="item.des" placeholder="请输入详细描述" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item " @click="submit"> 提交 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
formData: [
|
||||
{
|
||||
title: '',
|
||||
des: '',
|
||||
}
|
||||
],
|
||||
range: [
|
||||
{ value: 0, text: "需求" },
|
||||
{ value: 1, text: "缺陷" },
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.formData.push({
|
||||
type: '',
|
||||
address: '',
|
||||
})
|
||||
},
|
||||
submit () {
|
||||
console.log(this.formData)
|
||||
uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.index {
|
||||
padding: 20rpx;
|
||||
|
||||
.content {
|
||||
margin-bottom: 20rpx;
|
||||
padding: 34rpx;
|
||||
background: $uni-theme-white;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.btn-wrap {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn-wrap-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-color;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -48,7 +48,7 @@
|
||||
<!-- @click="jump('about')" -->
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<view class="mine-nav-label">版本信息</view>
|
||||
<view style="color: #828282; font-size: 14rpx">当前版本V{{ version }}</view>
|
||||
<view style="color: #828282; font-size: 24rpx">V{{ version }}</view>
|
||||
<!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> -->
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none">
|
||||
|
||||
@@ -1,41 +1,25 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<Cn-page >
|
||||
<view class="mine" slot="body">
|
||||
<view class="mine-nav mt20" style="border-bottom: none">
|
||||
<view class="mine-nav-label">暂态事件</view>
|
||||
<switch
|
||||
style="transform: scale(0.8)"
|
||||
color="#376cf3"
|
||||
@change="change('eventInfo')"
|
||||
:checked="config.eventInfo === 1"
|
||||
/>
|
||||
<switch style="transform: scale(0.8)" 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
|
||||
style="transform: scale(0.8)"
|
||||
color="#376cf3"
|
||||
@change="change('harmonicInfo')"
|
||||
:checked="config.harmonicInfo === 1"
|
||||
/>
|
||||
<switch style="transform: scale(0.8)" color="#376cf3" @change="change('harmonicInfo')"
|
||||
:checked="config.harmonicInfo === 1" />
|
||||
</view>
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<view class="mine-nav" style="border-bottom: none" v-if="flag">
|
||||
<view class="mine-nav-label">运行告警</view>
|
||||
<switch
|
||||
style="transform: scale(0.8)"
|
||||
color="#376cf3"
|
||||
@change="change('alarmInfo')"
|
||||
:checked="config.alarmInfo === 1"
|
||||
/>
|
||||
<switch style="transform: scale(0.8)" color="#376cf3" @change="change('alarmInfo')"
|
||||
:checked="config.alarmInfo === 1" />
|
||||
</view>
|
||||
<view class="mine-nav" >
|
||||
<view class="mine-nav" v-if="flag">
|
||||
<view class="mine-nav-label">运行事件</view>
|
||||
<switch
|
||||
style="transform: scale(0.8)"
|
||||
color="#376cf3"
|
||||
@change="change('runInfo')"
|
||||
:checked="config.runInfo === 1"
|
||||
/>
|
||||
<switch style="transform: scale(0.8)" color="#376cf3" @change="change('runInfo')"
|
||||
:checked="config.runInfo === 1" />
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
@@ -49,6 +33,7 @@ export default {
|
||||
return {
|
||||
loading: true,
|
||||
config: {},
|
||||
flag: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -106,6 +91,9 @@ export default {
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
if (uni.getStorageSync(this.$cacheKey.userInfo).authorities === 'operation_manager') {
|
||||
this.flag = true
|
||||
}
|
||||
this.init()
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<view class="mine" slot="body">
|
||||
<view class="mine-nav" style="margin-top: 20rpx">
|
||||
<view class="mine-nav-label">ITIC</view>
|
||||
<switch
|
||||
style="transform: scale(0.8)"
|
||||
color="#376cf3"
|
||||
@change="change('iticFunction')"
|
||||
:checked="config.iticFunction === 1"
|
||||
/>
|
||||
</view>
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<view class="mine-nav-label">F47</view>
|
||||
<switch
|
||||
style="transform: scale(0.8)"
|
||||
color="#376cf3"
|
||||
@change="change('f47Function')"
|
||||
:checked="config.f47Function === 1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryUserPushConfig, updatePushConfig } from '@/common/api/mine'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
config: {},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
queryUserPushConfig().then((res) => {
|
||||
this.config = res.data
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
change(type) {
|
||||
this.config[type] = this.config[type] === 1 ? 0 : 1
|
||||
// updatePushConfig(this.config).then((res) => {
|
||||
// let str = ''
|
||||
// switch (type) {
|
||||
// case 'iticFunction':
|
||||
// str = 'ITIC'
|
||||
// break
|
||||
// case 'f47Function':
|
||||
// str = 'F47'
|
||||
// break
|
||||
// }
|
||||
// this.$util.toast(`${str}配置${this.config[type] === 1 ? '开启' : '关闭'}成功`)
|
||||
// })
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
this.init()
|
||||
},
|
||||
onUnload() {
|
||||
updatePushConfig(this.config).then((res) => {
|
||||
// this.$util.toast(`配置修改成功!`)
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mine {
|
||||
.title {
|
||||
padding: 0 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.mine-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 8rpx #e7e7e74c;
|
||||
|
||||
.mine-header-head {
|
||||
margin-right: 30rpx;
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mine-header-name {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.mine-nav {
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
border-bottom: 1rpx solid #e8e8e8;
|
||||
|
||||
&-icon {
|
||||
margin-right: 30rpx;
|
||||
height: 44rpx;
|
||||
width: 44rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-label {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #111;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,77 +1,77 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<view slot="body">
|
||||
<view class="index">
|
||||
<uni-card
|
||||
title="设备信息"
|
||||
sub-title="副标题"
|
||||
v-for="item in 3"
|
||||
:key="item"
|
||||
thumbnail="/static/real_time_data.png"
|
||||
>
|
||||
<view class="footer">
|
||||
<text>设备基础信息 </text>
|
||||
<view class="footer-btn" @click="del">移除</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
del() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要移除该设备权限吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
newDevice() {
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success: function (res) {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/newDevice',
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index {
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.footer-btn {
|
||||
padding: 0 20rpx;
|
||||
height: 50rpx;
|
||||
background-color: #e47470;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<view slot="body">
|
||||
<view class="index">
|
||||
<uni-card
|
||||
title="设备信息"
|
||||
sub-title="副标题"
|
||||
v-for="item in 3"
|
||||
:key="item"
|
||||
thumbnail="/static/real_time_data.png"
|
||||
>
|
||||
<view class="footer">
|
||||
<text>设备基础信息 </text>
|
||||
<view class="footer-btn" @click="del">移除</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
del() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要移除该设备权限吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
newDevice() {
|
||||
uni.scanCode({
|
||||
onlyFromCamera: false,
|
||||
success: function (res) {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
uni.navigateTo({
|
||||
url: '/pages/gateway/newDevice',
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.index {
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.footer-btn {
|
||||
padding: 0 20rpx;
|
||||
height: 50rpx;
|
||||
background-color: #e47470;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user