测试bug反馈修复
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading">
|
||||
<view slot="body">
|
||||
<view class="new">
|
||||
<view class="new" :class="{'project-new':!this.options.project}">
|
||||
<view class="content">
|
||||
<uni-forms :label-width="80">
|
||||
<uni-forms-item label="工程名称">
|
||||
<uni-forms-item label="工程名称" @click.native.stop.prevent="selectEngineering">
|
||||
<uni-easyinput
|
||||
v-model="formData.engineeringName"
|
||||
placeholder="请输入项目名称"
|
||||
:clearable="false"
|
||||
disabled
|
||||
:disabled="true"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="项目名称">
|
||||
@@ -71,13 +71,6 @@
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="submit"> 提交</view>
|
||||
</view>
|
||||
<uni-drawer ref="showRight" mode="right" :mask-click="false">
|
||||
<uni-indexed-list
|
||||
:options="engineeringListFilter"
|
||||
:showSelect="false"
|
||||
@click="closeDrawer"
|
||||
></uni-indexed-list>
|
||||
</uni-drawer>
|
||||
<uni-popup ref="showTemp" type="bottom" :mask-click="false">
|
||||
<view class="popup-header">
|
||||
<view class="popup-header-title">模版库</view>
|
||||
@@ -127,31 +120,17 @@ export default {
|
||||
lat: '',
|
||||
lng: '',
|
||||
},
|
||||
engineeringList: [],
|
||||
tempList: [],
|
||||
project: null,
|
||||
options: {}
|
||||
}
|
||||
},
|
||||
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
|
||||
},
|
||||
onShow() {
|
||||
if (!this.options.project) {
|
||||
let engineering = uni.getStorageSync(this.$cacheKey.engineering)
|
||||
this.formData.engineeringId = engineering.id
|
||||
this.formData.engineeringName = engineering.name
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.options = options
|
||||
@@ -166,10 +145,6 @@ export default {
|
||||
this.formData[key] = this.project[key]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let engineering = uni.getStorageSync(this.$cacheKey.engineering)
|
||||
this.formData.engineeringId = engineering.id
|
||||
this.formData.engineeringName = engineering.name
|
||||
}
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
@@ -179,9 +154,6 @@ export default {
|
||||
console.log('当前位置的纬度:' + res.latitude)
|
||||
},
|
||||
})
|
||||
queryEngineering().then((res) => {
|
||||
this.engineeringList = res.data
|
||||
})
|
||||
getTopoTemplate().then((res) => {
|
||||
console.log(res)
|
||||
this.tempList = res.data
|
||||
@@ -202,6 +174,12 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
selectEngineering() {
|
||||
if (this.options.project) return
|
||||
uni.navigateTo({
|
||||
url: '/pages/home/selectEngineering',
|
||||
})
|
||||
},
|
||||
beforeRemove(e) {
|
||||
console.log(e)
|
||||
if (!e.tempFile.id) {
|
||||
@@ -244,15 +222,6 @@ export default {
|
||||
openTemp() {
|
||||
this.$refs.showTemp.open()
|
||||
},
|
||||
showDrawer() {
|
||||
this.$refs.showRight.open()
|
||||
},
|
||||
closeDrawer(e) {
|
||||
console.log(e)
|
||||
this.formData.engineeringName = e.item.name
|
||||
this.formData.engineeringId = this.engineeringList.find((item) => item.name === e.item.name).id
|
||||
this.$refs.showRight.close()
|
||||
},
|
||||
select(e) {
|
||||
console.log(e)
|
||||
this.formData.files.push(...e.tempFiles)
|
||||
@@ -348,10 +317,16 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.project-new /deep/ .is-disabled {
|
||||
background: #fff !important;
|
||||
color: #111;
|
||||
}
|
||||
.new {
|
||||
padding: 34rpx;
|
||||
.project-new{
|
||||
|
||||
}
|
||||
.content {
|
||||
.content-des {
|
||||
font-size: 28rpx;
|
||||
|
||||
Reference in New Issue
Block a user