|  |  |  | 
|---|
|  |  |  | <view class="uni-data-tree-input" @click="handleInput"> | 
|---|
|  |  |  | <slot :options="options" :data="inputSelected" :error="errorMessage"> | 
|---|
|  |  |  | <view class="input-value" :class="{'input-value-border': border}"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <text v-if="errorMessage" class="selected-area error-text">{{errorMessage}}</text> | 
|---|
|  |  |  | <view v-else-if="loading && !isOpened" class="selected-area"> | 
|---|
|  |  |  | <uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more> | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="dialog-close-plus dialog-close-rotate" data-id="close"></view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view v-if="false" | 
|---|
|  |  |  | style="margin-left:40rpx;margin-right:40rpx;; border-bottom:1px solid #eee;padding-bottom:20rpx;display:flex"> | 
|---|
|  |  |  | <view v-if="filter" | 
|---|
|  |  |  | style="margin-left:40rpx;margin-right:40rpx;; border-bottom:1px solid #eee;padding-bottom:20rpx;display:flex;color:#000"> | 
|---|
|  |  |  | <input v-model="search" style="height:60rpx;line-height:60rpx;color:#000" placeholder="请输入搜索内容"></input> | 
|---|
|  |  |  | <button @click="()=>{search='';updateSearch()}" | 
|---|
|  |  |  | style="height:60rpx;line-height:60rpx;margin-left:auto;margin-right:0rpx">清空</button> | 
|---|
|  |  |  | <button @click="updateSearch" | 
|---|
|  |  |  | style="height:60rpx;line-height:60rpx;margin-left:auto;margin-right:0rpx">搜索</button> | 
|---|
|  |  |  | <view @click="()=>{search='';updateSearch()}" | 
|---|
|  |  |  | style="height:60rpx;line-height:60rpx;margin-left:auto;margin-right:0rpx">清空</view> | 
|---|
|  |  |  | <view @click="updateSearch" | 
|---|
|  |  |  | style="height:60rpx;line-height:60rpx;margin-left:auto;margin-right:0rpx">搜索</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <data-picker-view class="picker-view" ref="pickerView" v-model="dataValue" :localdata="localdata" | 
|---|
|  |  |  | :preload="preload" :collection="collection" :field="field" :orderby="orderby" :where="where" | 
|---|
|  |  |  | :key="showpicker" | 
|---|
|  |  |  | :area="area" | 
|---|
|  |  |  | :step-searh="stepSearh" :self-field="selfField" :parent-field="parentField" :managed-mode="true" | 
|---|
|  |  |  | :map="map" :ellipsis="ellipsis" @change="onchange" @datachange="ondatachange" @nodeclick="onnodeclick"> | 
|---|
|  |  |  | </data-picker-view> | 
|---|
|  |  |  | 
|---|
|  |  |  | type: Boolean, | 
|---|
|  |  |  | default: false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | filter: { | 
|---|
|  |  |  | type: Boolean, | 
|---|
|  |  |  | default: false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | clearIcon: { | 
|---|
|  |  |  | type: Boolean, | 
|---|
|  |  |  | default: true | 
|---|
|  |  |  | 
|---|
|  |  |  | ellipsis: { | 
|---|
|  |  |  | type: Boolean, | 
|---|
|  |  |  | default: true | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | area:{ | 
|---|
|  |  |  | type: Boolean, | 
|---|
|  |  |  | default: false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | 
|---|
|  |  |  | await this.$emit('search',this.search) | 
|---|
|  |  |  | // console.log('updateSearch',this.localdata) | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | console.log('updateSearch2',this.localdata) | 
|---|
|  |  |  | this.showpicker = new Date().getTime() | 
|---|
|  |  |  | console.log('updateSearch2 setTimeout',this.localdata) | 
|---|
|  |  |  | // this.showpicker = new Date().getTime() | 
|---|
|  |  |  | // this.load() | 
|---|
|  |  |  | this.$refs.pickerView.updateData({ | 
|---|
|  |  |  | treeData: this.localdata, | 
|---|
|  |  |  | 
|---|
|  |  |  | this.load(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | load() { | 
|---|
|  |  |  | // console.log('load',this.readonly) | 
|---|
|  |  |  | if (this.readonly) { | 
|---|
|  |  |  | // console.debug('load readonly') | 
|---|
|  |  |  | this._processReadonly(this.localdata, this.dataValue); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (this.isLocalData) { | 
|---|
|  |  |  | this.loadData(); | 
|---|
|  |  |  | this.inputSelected = this.selected.slice(0); | 
|---|
|  |  |  | console.log('load isLocalData',this.inputSelected) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } else if (this.isCloudDataList || this.isCloudDataTree) { // 回显 Cloud 数据 | 
|---|
|  |  |  | // console.log('load Cloud') | 
|---|
|  |  |  | this.loading = true; | 
|---|
|  |  |  | this.getCloudDataValue().then((res) => { | 
|---|
|  |  |  | this.loading = false; | 
|---|
|  |  |  | 
|---|
|  |  |  | this.errorMessage = err; | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //  console.log('load over') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | show() { | 
|---|
|  |  |  | this.isOpened = true | 
|---|