master
parent
166ed6e38f
commit
038c35e6f2
|
|
@ -1,2 +1,2 @@
|
|||
<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title></title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/static/index.97465e7b.css"></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.959091ef.js"></script><script src="/static/js/index.b8997f94.js"></script></body></html>
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/static/index.97465e7b.css"></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.959091ef.js"></script><script src="/static/js/index.f33bff14.js"></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,37 @@
|
|||
<template>
|
||||
<u-dropdown-item
|
||||
:title="label"
|
||||
v-model="status"
|
||||
@change="handleChange"
|
||||
:options="getOptions"
|
||||
></u-dropdown-item>
|
||||
<view>
|
||||
<!-- <u-dropdown-item v-if="filterable">
|
||||
<u-input v-model="filterValue" placeholder="筛选"></u-input>
|
||||
</u-dropdown-item> -->
|
||||
<u-dropdown-item
|
||||
:title="label"
|
||||
v-model="status"
|
||||
@change="handleChange"
|
||||
:options="getOptions"
|
||||
>
|
||||
<view class="bg-white">
|
||||
<view class="px-34rpx" v-if="filterable">
|
||||
<u-input v-model="filterValue" placeholder="筛选"></u-input>
|
||||
</view>
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
:style="{
|
||||
height: $u.addUnit(getOptions.length > 8 ? 930 : 'auto'),
|
||||
}"
|
||||
>
|
||||
<u-cell-group>
|
||||
<u-cell-item
|
||||
@click="handleSelect(item)"
|
||||
v-for="(item, i) in getOptions"
|
||||
:key="i"
|
||||
:title="item.label"
|
||||
:arrow="false"
|
||||
></u-cell-item>
|
||||
</u-cell-group>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</u-dropdown-item>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { omit } from 'lodash-es'
|
||||
|
|
@ -33,6 +60,10 @@ export default {
|
|||
type: String,
|
||||
default: 'value',
|
||||
},
|
||||
filterable: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
status: {
|
||||
|
|
@ -46,7 +77,7 @@ export default {
|
|||
},
|
||||
getOptions() {
|
||||
const { labelField, valueField } = this
|
||||
return this.options.reduce((prev, next) => {
|
||||
const arr = this.options.reduce((prev, next) => {
|
||||
if (next) {
|
||||
const value = next[valueField]
|
||||
prev.push({
|
||||
|
|
@ -57,10 +88,13 @@ export default {
|
|||
}
|
||||
return prev
|
||||
}, [])
|
||||
if (!this.filterValue) return arr
|
||||
return arr.filter((e) => e.label.includes(this.filterValue))
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filterValue: '',
|
||||
options: [],
|
||||
emitData: null,
|
||||
isFirstLoad: true,
|
||||
|
|
@ -70,6 +104,10 @@ export default {
|
|||
this.fetch()
|
||||
},
|
||||
methods: {
|
||||
handleSelect(e) {
|
||||
this.status = e.value
|
||||
this.$emit('close-dropdown', this.status)
|
||||
},
|
||||
async fetch() {
|
||||
const api = this.api
|
||||
if (!api || !this.isFunction(api)) return
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<u-dropdown-item :title="label">
|
||||
<view class="bg-white p-30rpx">
|
||||
<u-input v-model="status" :placeholder="placeholder" class="flex-1" />
|
||||
<u-input v-model="status" :placeholder="placeholder" :clearable="false" class="flex-1" />
|
||||
<view class="my-20rpx">
|
||||
<u-line></u-line>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- <u-sticky :h5NavHeight="h5NavHeightP"> -->
|
||||
<view class="bg-white">
|
||||
<SearchForm
|
||||
:schemas="searchFormSchema"
|
||||
@submit="handleSubmit"
|
||||
></SearchForm>
|
||||
</view>
|
||||
<view class="bg-white">
|
||||
<SearchForm
|
||||
:schemas="searchFormSchema"
|
||||
@submit="handleSubmit"
|
||||
></SearchForm>
|
||||
</view>
|
||||
<!-- </u-sticky> -->
|
||||
<mescroll-body
|
||||
@init="mescrollInit"
|
||||
|
|
@ -147,14 +147,6 @@ export default {
|
|||
formShow: false,
|
||||
baseShow: false,
|
||||
searchFormSchema: [
|
||||
{
|
||||
field: 'name',
|
||||
label: '名称',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'industry',
|
||||
label: '农业类型',
|
||||
|
|
@ -172,6 +164,36 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
label: '名称',
|
||||
component: 'ApiSelect',
|
||||
componentProps: ({ formActionType }) => {
|
||||
return {
|
||||
api: async (e) => {
|
||||
const { data } = await http.get('/api/agricultural-basic', {
|
||||
params: {
|
||||
page: 1,
|
||||
per_page: 10000,
|
||||
},
|
||||
})
|
||||
return [{name:'全部',key:''}].concat(data.data.map(e => ({name:e.name,key:e.name})))
|
||||
},
|
||||
filterable: true,
|
||||
filterMethod: (e) => {},
|
||||
labelField: 'name',
|
||||
valueField: 'key',
|
||||
}
|
||||
},
|
||||
},
|
||||
// {
|
||||
// field: 'name',
|
||||
// label: '名称',
|
||||
// component: 'Input',
|
||||
// componentProps: {
|
||||
// placeholder: '请输入名称'
|
||||
// },
|
||||
// }
|
||||
],
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue