新需求

This commit is contained in:
蔡玲
2024-09-06 10:51:49 +08:00
parent 20f8520be2
commit f2c9f1b896
5 changed files with 45 additions and 78 deletions

View File

@@ -3,36 +3,25 @@
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">区域一</span>
</view>
<view class="zd-col-19 filter_select">
<uni-data-select v-model="index1" :localdata="options1"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">区域二</span>
</view>
<view class="zd-col-19 filter_select">
<uni-data-select v-model="index2" :localdata="options1"></uni-data-select>
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">区域三</span>
</view>
<view class="zd-col-19 filter_select">
<uni-data-select v-model="index3" :localdata="options1"></uni-data-select>
<zxz-uni-data-select
v-model="index"
:localdata="options"
:multiple="true"
:collapseTags="true"
/>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === '' && index2 === '' && index3 === ''}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === '' && index2 === '' && index3 === ''}" :disabled="disabled" @tap="_handheldLock('0')">释放</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index.length === 0}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index.length === 0}" :disabled="disabled" @tap="_handheldLock('0')">释放</button>
</view>
</view>
</template>
@@ -50,10 +39,9 @@
data() {
return {
title: '',
options1: [],
index1: '',
index2: '',
index3: '',
options: [],
index: [],
multiple: true,
disabled: false
};
},
@@ -64,20 +52,19 @@
methods: {
async _regionList () {
let res = await regionList()
this.options1 = [...res.content]
this.options1.map(el => {
this.options = [...res.content]
this.options.map(el => {
this.$set(el, 'text', el.label)
})
},
async _handheldLock (type) {
this.disabled = true
if (this.index1 === '' && this.index2 === '' && this.index3 === '') {
if (this.index.length === 0) {
this.disabled = false
return
}
try {
let arr = [this.index1, this.index2, this.index3]
let res = await handheldLock(arr, type)
let res = await handheldLock(this.index, type)
this.clearUp()
uni.showToast({
title: res.message,
@@ -88,9 +75,7 @@
}
},
clearUp () {
this.index1 = ''
this.index2 = ''
this.index3 = ''
this.index = []
this.disabled = false
}
}