|
@@ -41,63 +41,81 @@
|
|
|
</van-cell>
|
|
</van-cell>
|
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
|
<!--多选 -->
|
|
<!--多选 -->
|
|
|
- <van-list
|
|
|
|
|
- v-model="loading"
|
|
|
|
|
- :finished="finished"
|
|
|
|
|
- finished-text="没有更多了"
|
|
|
|
|
- @load="loadData"
|
|
|
|
|
- >
|
|
|
|
|
- <van-checkbox-group
|
|
|
|
|
- ref="checkboxGroup"
|
|
|
|
|
- v-model="checkbox"
|
|
|
|
|
- :max="multiple ? 0 : 1"
|
|
|
|
|
|
|
+ <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
|
|
|
|
+ <van-list
|
|
|
|
|
+ v-model="loading"
|
|
|
|
|
+ :finished="finished"
|
|
|
|
|
+ @load="loadData"
|
|
|
>
|
|
>
|
|
|
- <van-cell-group>
|
|
|
|
|
- <van-cell
|
|
|
|
|
- v-for="(data, index) in dataList"
|
|
|
|
|
- :key="data[valueKey] + index"
|
|
|
|
|
- clickable
|
|
|
|
|
- @click="toggle(data, index)"
|
|
|
|
|
- >
|
|
|
|
|
- <div slot="title">
|
|
|
|
|
- <van-checkbox ref="checkboxes" :name="data[valueKey]">
|
|
|
|
|
- <!-- <field-formatter
|
|
|
|
|
- :label-key="labelKey"
|
|
|
|
|
- :data="data"
|
|
|
|
|
- :template-fields="templateFields"
|
|
|
|
|
- /> -->
|
|
|
|
|
- <div>
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="(item, i) in data.showlabel"
|
|
|
|
|
- :key="i"
|
|
|
|
|
- style="display:flex"
|
|
|
|
|
- >
|
|
|
|
|
- <span>{{ item.label }}</span>
|
|
|
|
|
- <span v-if="item.label!=''">:</span>
|
|
|
|
|
- <field-formatter
|
|
|
|
|
- :label-key="item.bt"
|
|
|
|
|
- :data="data"
|
|
|
|
|
- :template-fields="templateFields"
|
|
|
|
|
- :field-options="item.fieldOptions"
|
|
|
|
|
- :field-type="item.fieldType"
|
|
|
|
|
- :tem ="tem"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </van-checkbox>
|
|
|
|
|
- </div>
|
|
|
|
|
- <span
|
|
|
|
|
- v-if="hasChild(data)"
|
|
|
|
|
- slot="right-icon"
|
|
|
|
|
|
|
+ <van-checkbox-group
|
|
|
|
|
+ ref="checkboxGroup"
|
|
|
|
|
+ v-model="checkbox"
|
|
|
|
|
+ :max="multiple ? 0 : 1"
|
|
|
|
|
+ >
|
|
|
|
|
+ <van-cell-group>
|
|
|
|
|
+ <van-cell
|
|
|
|
|
+ v-for="(data, index) in dataList"
|
|
|
|
|
+ :key="data[valueKey] + index"
|
|
|
|
|
+ clickable
|
|
|
@click="toggle(data, index)"
|
|
@click="toggle(data, index)"
|
|
|
>
|
|
>
|
|
|
- <span class="van-cell__right-icon" />
|
|
|
|
|
- <van-icon name="arrow " class="van-cell__right-icon" />
|
|
|
|
|
- </span>
|
|
|
|
|
- </van-cell>
|
|
|
|
|
- </van-cell-group>
|
|
|
|
|
- </van-checkbox-group>
|
|
|
|
|
- </van-list>
|
|
|
|
|
|
|
+ <div slot="title">
|
|
|
|
|
+ <field-formatter
|
|
|
|
|
+ v-if="labelField"
|
|
|
|
|
+ class="titles"
|
|
|
|
|
+ :label-key="labelKey"
|
|
|
|
|
+ :data="data"
|
|
|
|
|
+ :descField="labelField"
|
|
|
|
|
+ :field-options="comFieldOptions(labelField['name'])"
|
|
|
|
|
+ :field-type="comFieldType(labelField['name'])"
|
|
|
|
|
+ :template-fields="templateFields"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div slot="label">
|
|
|
|
|
+ <van-checkbox ref="checkboxes" :name="data[valueKey]">
|
|
|
|
|
+ <!-- <field-formatter
|
|
|
|
|
+ :label-key="labelKey"
|
|
|
|
|
+ :data="data"
|
|
|
|
|
+ :template-fields="templateFields"
|
|
|
|
|
+ /> -->
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="(item, i) in data.showlabel"
|
|
|
|
|
+ :key="i"
|
|
|
|
|
+ style="display:flex"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
|
|
+ <span v-if="item.label!=''">:</span>
|
|
|
|
|
+ <field-formatter
|
|
|
|
|
+ :label-key="item.bt"
|
|
|
|
|
+ :data="data"
|
|
|
|
|
+ :template-fields="templateFields"
|
|
|
|
|
+ :field-options="item.fieldOptions"
|
|
|
|
|
+ :field-type="item.fieldType"
|
|
|
|
|
+ :tem ="tem"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </van-checkbox>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span
|
|
|
|
|
+ v-if="hasChild(data)"
|
|
|
|
|
+ slot="right-icon"
|
|
|
|
|
+ @click="toggle(data, index)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="van-cell__right-icon" />
|
|
|
|
|
+ <van-icon name="arrow " class="van-cell__right-icon" />
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </van-cell>
|
|
|
|
|
+ </van-cell-group>
|
|
|
|
|
+ </van-checkbox-group>
|
|
|
|
|
+ </van-list>
|
|
|
|
|
+ <ibps-list-result-page
|
|
|
|
|
+ v-if="dataList.length === 0 && !loading"
|
|
|
|
|
+ result-type="empty"
|
|
|
|
|
+ />
|
|
|
|
|
+ </van-pull-refresh>
|
|
|
|
|
+
|
|
|
</van-popup>
|
|
</van-popup>
|
|
|
|
|
|
|
|
<!--点击明细-查看选中的 -->
|
|
<!--点击明细-查看选中的 -->
|
|
@@ -157,6 +175,7 @@
|
|
|
import { queryDataByKey, queryDataById } from '@/api/platform/data/dataTemplate'
|
|
import { queryDataByKey, queryDataById } from '@/api/platform/data/dataTemplate'
|
|
|
import { remoteRequest } from '@/utils/remote'
|
|
import { remoteRequest } from '@/utils/remote'
|
|
|
import TreeUtils from '@/utils/tree'
|
|
import TreeUtils from '@/utils/tree'
|
|
|
|
|
+import IbpsListResultPage from '@/components/ibps-list-result-page'
|
|
|
import ActionUtils from '@/utils/action'
|
|
import ActionUtils from '@/utils/action'
|
|
|
import { buildLabelTitle } from '../templaterender/utils/index'
|
|
import { buildLabelTitle } from '../templaterender/utils/index'
|
|
|
import i18n from '@/utils/i18n' // Internationalization 国际化
|
|
import i18n from '@/utils/i18n' // Internationalization 国际化
|
|
@@ -166,13 +185,15 @@ import IbpsPickerToolbar from '@/components/ibps-picker-toolbar'
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
IbpsPickerToolbar,
|
|
IbpsPickerToolbar,
|
|
|
- FieldFormatter
|
|
|
|
|
|
|
+ FieldFormatter,
|
|
|
|
|
+ IbpsListResultPage
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
|
visible: Boolean,
|
|
visible: Boolean,
|
|
|
templateKey: String,
|
|
templateKey: String,
|
|
|
templateFields: Object,
|
|
templateFields: Object,
|
|
|
params: Object,
|
|
params: Object,
|
|
|
|
|
+ labelField: Object,
|
|
|
values: Array,
|
|
values: Array,
|
|
|
multiple: Boolean,
|
|
multiple: Boolean,
|
|
|
leftText: String,
|
|
leftText: String,
|
|
@@ -180,6 +201,7 @@ export default {
|
|
|
isTree: Boolean,
|
|
isTree: Boolean,
|
|
|
datat: Object,
|
|
datat: Object,
|
|
|
fieldType: String,
|
|
fieldType: String,
|
|
|
|
|
+ defaultFilterListCol: [Array, undefined],
|
|
|
idKey: {
|
|
idKey: {
|
|
|
// 唯一键
|
|
// 唯一键
|
|
|
type: String,
|
|
type: String,
|
|
@@ -214,8 +236,8 @@ export default {
|
|
|
dataList: [], // 数据
|
|
dataList: [], // 数据
|
|
|
cacheData: {}, // 缓存数据
|
|
cacheData: {}, // 缓存数据
|
|
|
template: {},
|
|
template: {},
|
|
|
- displayColumns: [],
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // displayColumns: [],
|
|
|
|
|
+ refreshing: false,
|
|
|
checkedValue: [],
|
|
checkedValue: [],
|
|
|
dataTem: {},
|
|
dataTem: {},
|
|
|
showDialogPopup: false,
|
|
showDialogPopup: false,
|
|
@@ -230,6 +252,18 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ comFieldOptions() {
|
|
|
|
|
+ return function(fieldLabel) {
|
|
|
|
|
+ const fieldOptions = this.templateFields[fieldLabel] && this.templateFields[fieldLabel].field_options
|
|
|
|
|
+ return this.$utils.isNotEmpty(fieldOptions) ? fieldOptions : {}
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ comFieldType() {
|
|
|
|
|
+ return function(fieldLabel) {
|
|
|
|
|
+ const fieldType = this.templateFields[fieldLabel] && this.templateFields[fieldLabel].field_type
|
|
|
|
|
+ return this.$utils.isNotEmpty(fieldType) ? fieldType : ''
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
title() {
|
|
title() {
|
|
|
if (this.multiple) {
|
|
if (this.multiple) {
|
|
|
const length = this.checkbox.length
|
|
const length = this.checkbox.length
|
|
@@ -256,6 +290,10 @@ export default {
|
|
|
return this.checkbox.map(d => {
|
|
return this.checkbox.map(d => {
|
|
|
return this.cacheData[d] || {}
|
|
return this.cacheData[d] || {}
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ displayColumns() {
|
|
|
|
|
+ const columns = this.tem.display_columns || []
|
|
|
|
|
+ return columns.filter(t => t.isAppShow !== 'N' && t.isTitle !== 'Y')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -305,6 +343,12 @@ export default {
|
|
|
// })
|
|
// })
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ onRefresh() {
|
|
|
|
|
+ this.refreshing = true
|
|
|
|
|
+ this.finished = false
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ this.onSearch()
|
|
|
|
|
+ },
|
|
|
initData() {
|
|
initData() {
|
|
|
const data = this.values
|
|
const data = this.values
|
|
|
this.checkedValue = []
|
|
this.checkedValue = []
|
|
@@ -327,6 +371,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleLabel(data) {
|
|
handleLabel(data) {
|
|
|
const config = this.labelKeys
|
|
const config = this.labelKeys
|
|
|
|
|
+ console.log('this.labelKeys====>', config(data))
|
|
|
if (typeof config === 'function') {
|
|
if (typeof config === 'function') {
|
|
|
return config(data)
|
|
return config(data)
|
|
|
} else if (typeof config === 'string') {
|
|
} else if (typeof config === 'string') {
|
|
@@ -383,6 +428,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
loadData(p, isInit) {
|
|
loadData(p, isInit) {
|
|
|
|
|
+ console.log('触底加载')
|
|
|
if (isInit) {
|
|
if (isInit) {
|
|
|
this.pathData = []
|
|
this.pathData = []
|
|
|
}
|
|
}
|
|
@@ -419,29 +465,26 @@ export default {
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
const dl = dataResult
|
|
const dl = dataResult
|
|
|
- dl.map(d => {
|
|
|
|
|
|
|
+ this.refreshing = false
|
|
|
|
|
+ dl.forEach(d => {
|
|
|
this.cacheData[d[this.valueKey]] = d
|
|
this.cacheData[d[this.valueKey]] = d
|
|
|
// const objName = Object.keys(d)
|
|
// const objName = Object.keys(d)
|
|
|
- const fb = { ...d }
|
|
|
|
|
- fb.showlabel = {}
|
|
|
|
|
|
|
+ const fb = { ...d, showlabel: {} }
|
|
|
if (typeof this.tem.display_columns !== 'undefined') {
|
|
if (typeof this.tem.display_columns !== 'undefined') {
|
|
|
const keyName = this.dataList.findIndex(t => t.id_ == d.id_)
|
|
const keyName = this.dataList.findIndex(t => t.id_ == d.id_)
|
|
|
if (typeof keyName !== -1) {
|
|
if (typeof keyName !== -1) {
|
|
|
- this.tem.display_columns.forEach((it, i) => {
|
|
|
|
|
- let b = {}
|
|
|
|
|
-
|
|
|
|
|
- b = {
|
|
|
|
|
|
|
+ this.displayColumns.forEach((it, i) => {
|
|
|
|
|
+ let b = {
|
|
|
label: it.label,
|
|
label: it.label,
|
|
|
bt: it.name,
|
|
bt: it.name,
|
|
|
- val: {},
|
|
|
|
|
|
|
+ val: {
|
|
|
|
|
+ [it.name]: d[it.name]
|
|
|
|
|
+ },
|
|
|
fieldType: it.field_type,
|
|
fieldType: it.field_type,
|
|
|
fieldOptions: it.field_options
|
|
fieldOptions: it.field_options
|
|
|
}
|
|
}
|
|
|
- b.val[it.name] = d[it.name]
|
|
|
|
|
fb.showlabel[it.name] = b
|
|
fb.showlabel[it.name] = b
|
|
|
})
|
|
})
|
|
|
- this.dataList.push(fb)
|
|
|
|
|
- } else {
|
|
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
let b = {}
|
|
let b = {}
|
|
@@ -458,8 +501,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
b.val = d[key]
|
|
b.val = d[key]
|
|
|
fb.showlabel = [b]
|
|
fb.showlabel = [b]
|
|
|
- this.dataList.push(fb)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ this.dataList.push(fb)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
this.page++
|
|
this.page++
|
|
@@ -607,3 +650,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+.titles {
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ }
|
|
|
|
|
+ ::v-deep .van-checkbox {
|
|
|
|
|
+ flex-direction: row-reverse;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ .van-checkbox__label {
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|