|
|
@@ -8,22 +8,24 @@
|
|
|
:readonly="true"
|
|
|
/>
|
|
|
<!-- 选择器 -->
|
|
|
- <ibps-selector
|
|
|
- v-else-if="
|
|
|
- newFieldType === 'selector' ||
|
|
|
- newFieldType === 'currentUser' ||
|
|
|
- newFieldType === 'currentOrg'
|
|
|
- "
|
|
|
- v-model="label"
|
|
|
- :store="newFieldOptions.store || 'id'"
|
|
|
- :type="newFieldOptions.selector_type || 'user'"
|
|
|
- :multiple="$utils.toBoolean(newFieldOptions.multiple, true)"
|
|
|
- :field-options="newFieldOptions"
|
|
|
- :filter="newFieldOptions.filter"
|
|
|
- :readonly="true"
|
|
|
- :islistShow="true"
|
|
|
- />
|
|
|
- <div v-else-if="hasCustomFormatter(descField.name)" v-html="customFormatter(descField.name, label, data, descField)" />
|
|
|
+ <template v-else-if="selectTypes.includes(newFieldType)">
|
|
|
+ <van-tag
|
|
|
+ v-for="(item, index) in selectorValue"
|
|
|
+ :key="item"
|
|
|
+ :color="'#D6EAFE'"
|
|
|
+ :text-color="'#3396FB'"
|
|
|
+ class="ibps-tag-span ibps-mr-8"
|
|
|
+ >
|
|
|
+ <template #default>
|
|
|
+ <div>{{ item }}</div>
|
|
|
+ </template>
|
|
|
+ </van-tag>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-else-if="hasCustomFormatter(descField.name)"
|
|
|
+ v-html="customFormatter(descField.name, label, data, descField)"
|
|
|
+ ></div>
|
|
|
<span v-else class="ibps-data-template-data" v-html="label || '/'" />
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -37,9 +39,13 @@ import { get as getOrgById } from '@/api/platform/org/org'
|
|
|
import { get as getPositionById } from '@/api/platform/org/position'
|
|
|
import { get as getRoleById } from '@/api/platform/org/role'
|
|
|
import { get as getAttachmentById } from '@/api/platform/file/attachment'
|
|
|
+import { remoteRequest } from '@/utils/remote'
|
|
|
+import ActionUtils from '@/utils/action'
|
|
|
import {
|
|
|
transferByIds as getDataById,
|
|
|
- queryLinkageData as getLinkDataByKey
|
|
|
+ queryLinkageData as getLinkDataByKey,
|
|
|
+ queryDataTable,
|
|
|
+ getByKey
|
|
|
} from '@/api/platform/data/dataTemplate'
|
|
|
// import {
|
|
|
// loadDataTemplateByKey,
|
|
|
@@ -50,6 +56,7 @@ var WorldDistricts = null
|
|
|
var DICTIONARY_CACHE = {}
|
|
|
var ATTACHMENT_CACHE = {}
|
|
|
var SELECTOR_CACHE = {}
|
|
|
+// var LINK_CACHE = {}
|
|
|
|
|
|
// var DATA_KEY = {
|
|
|
// ID: '#id#',
|
|
|
@@ -71,9 +78,12 @@ export default {
|
|
|
type: Object,
|
|
|
default: () => {}
|
|
|
},
|
|
|
+ cacheData: {
|
|
|
+ type: Map
|
|
|
+ },
|
|
|
defaultValue: {
|
|
|
type: String,
|
|
|
- default: ' '
|
|
|
+ default: '/'
|
|
|
},
|
|
|
// 列属性字段 当same为N时取自身的fieldType
|
|
|
descField: Object,
|
|
|
@@ -91,7 +101,17 @@ export default {
|
|
|
userList,
|
|
|
label: '',
|
|
|
newFieldType: '',
|
|
|
- newFieldOptions: ''
|
|
|
+ newFieldOptions: '',
|
|
|
+ cachesData: new Map(),
|
|
|
+ selectTypes: ['selector', 'currentUser', 'currentOrg']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ selectorValue() {
|
|
|
+ if (this.selectTypes.includes(this.newFieldType)) {
|
|
|
+ return this.label && this.label.split ? this.label.split(',') : []
|
|
|
+ }
|
|
|
+ return []
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -102,7 +122,7 @@ export default {
|
|
|
this.initData()
|
|
|
}
|
|
|
},
|
|
|
- mounted: function() {
|
|
|
+ mounted: function () {
|
|
|
this.initData()
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -120,24 +140,27 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
// console.log('this.descField===>', this.descField, this.descField.field_type, this.fieldType)
|
|
|
- const fieldType = this.descField.same === 'N' ? this.descField.field_type : this.fieldType
|
|
|
- const fieldOptions = this.descField.same === 'N' ? this.descField.field_options : this.fieldOptions
|
|
|
+ const fieldType =
|
|
|
+ this.descField.same === 'N' ? this.descField.field_type : this.fieldType
|
|
|
+ const fieldOptions =
|
|
|
+ this.descField.same === 'N'
|
|
|
+ ? this.descField.field_options
|
|
|
+ : this.fieldOptions
|
|
|
this.newFieldType = fieldType
|
|
|
this.newFieldOptions = fieldOptions
|
|
|
+ // console.log('fieldType====>', fieldType)
|
|
|
// 不转化值数组
|
|
|
// newFieldType === 'selector' ||
|
|
|
// newFieldType === 'currentUser' ||
|
|
|
// newFieldType === 'currentOrg'
|
|
|
- const noFormateValueTypes = ['selector', 'currentUser', 'currentOrg']
|
|
|
+ // const noFormateValueTypes = ['selector', 'currentUser', 'currentOrg']
|
|
|
if (
|
|
|
this.$utils.isEmpty(value) ||
|
|
|
this.$utils.isEmpty(fieldType) ||
|
|
|
- this.$utils.isEmpty(fieldOptions) ||
|
|
|
- noFormateValueTypes.includes(fieldType)
|
|
|
+ this.$utils.isEmpty(fieldOptions)
|
|
|
+ // noFormateValueTypes.includes(fieldType)
|
|
|
) {
|
|
|
- console.log('===>', this.labelKey)
|
|
|
this.label = value
|
|
|
-
|
|
|
return
|
|
|
}
|
|
|
// 数据格式
|
|
|
@@ -145,28 +168,31 @@ export default {
|
|
|
},
|
|
|
/**
|
|
|
* 脚本渲染函数
|
|
|
- * @param name
|
|
|
+ * @param name
|
|
|
* @param value 当前行值
|
|
|
- * @param rowData
|
|
|
- * @param column
|
|
|
+ * @param rowData
|
|
|
+ * @param column
|
|
|
*/
|
|
|
- customFormatter (name, value, rowData, column) {
|
|
|
+ customFormatter(name, value, rowData, column) {
|
|
|
return JTemplate._customFormatter(this, name, value, rowData, column)
|
|
|
},
|
|
|
- // 自定义格式数据事件
|
|
|
- hasCustomFormatter: function (name) {
|
|
|
- const customFormatterResult = JTemplate._customFormatter(this, name)
|
|
|
- if (typeof customFormatterResult !== 'undefined' && customFormatterResult) {
|
|
|
- return true
|
|
|
- }
|
|
|
- return false
|
|
|
+ // 自定义格式数据事件
|
|
|
+ hasCustomFormatter: function (name) {
|
|
|
+ const customFormatterResult = JTemplate._customFormatter(this, name)
|
|
|
+ if (
|
|
|
+ typeof customFormatterResult !== 'undefined' &&
|
|
|
+ customFormatterResult
|
|
|
+ ) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
},
|
|
|
dataFormatter(value, fieldType, fieldOptions) {
|
|
|
if (String(this.tag) === 'Y') {
|
|
|
this.formatterCustomDialog(value, fieldOptions)
|
|
|
return
|
|
|
}
|
|
|
- // console.log('fieldType==>', fieldType)
|
|
|
+ // console.log('fieldOptions==>', this.labelKey, fieldOptions)
|
|
|
switch (fieldType) {
|
|
|
case 'hidden':
|
|
|
case 'text':
|
|
|
@@ -191,7 +217,6 @@ export default {
|
|
|
fieldOptions['options'],
|
|
|
'val'
|
|
|
)
|
|
|
- this.tag = true
|
|
|
break
|
|
|
case 'switch': // 开关
|
|
|
this.label = this.formatterOptions(
|
|
|
@@ -204,10 +229,8 @@ export default {
|
|
|
this.formatterDictionary(value, fieldOptions)
|
|
|
break
|
|
|
case 'customDialog': // TODO 自定义对话框
|
|
|
- this.formatterSelectorData(
|
|
|
- value,
|
|
|
- 'position'
|
|
|
- )
|
|
|
+ console.log('descField===>', this.descField)
|
|
|
+ this.formatterSelectorData(value, 'position')
|
|
|
break
|
|
|
case 'linkdata': // TODO 关联数据
|
|
|
this.formatterLinkdata(value, fieldOptions)
|
|
|
@@ -232,7 +255,7 @@ export default {
|
|
|
/**
|
|
|
* 格式化数字
|
|
|
*/
|
|
|
- formatterNumber(value, fieldOptions) {
|
|
|
+ formatterNumber(value) {
|
|
|
return value
|
|
|
},
|
|
|
/**
|
|
|
@@ -277,15 +300,17 @@ export default {
|
|
|
'name'
|
|
|
)
|
|
|
} else {
|
|
|
- getDictionaryData({
|
|
|
- typeKey: key
|
|
|
+ remoteRequest('dataTemplate', { id: key }, () => {
|
|
|
+ return getDictionaryData({
|
|
|
+ typeKey: key
|
|
|
+ })
|
|
|
})
|
|
|
- .then(response => {
|
|
|
+ .then((response) => {
|
|
|
const data = response.data
|
|
|
DICTIONARY_CACHE[key] = data
|
|
|
this.label = this.formatterOptions(value, data, 'key', 'name')
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
+ .catch((e) => {
|
|
|
DICTIONARY_CACHE[key] = []
|
|
|
// 异常
|
|
|
console.error(e)
|
|
|
@@ -315,6 +340,7 @@ export default {
|
|
|
formatterSelectorData(id, type) {
|
|
|
var key = type + ':' + id
|
|
|
var nameKey = 'name'
|
|
|
+ // console.log('key====>', key)
|
|
|
if (SELECTOR_CACHE[key]) {
|
|
|
this.label = SELECTOR_CACHE[key]
|
|
|
} else {
|
|
|
@@ -328,8 +354,10 @@ export default {
|
|
|
})
|
|
|
this.label = lab.replace(/,$/, '')
|
|
|
if (!this.label) {
|
|
|
- getUserById({ employeeId: id })
|
|
|
- .then(response => {
|
|
|
+ remoteRequest('dataTemplate', { id }, () => {
|
|
|
+ return getUserById({ employeeId: id })
|
|
|
+ })
|
|
|
+ .then((response) => {
|
|
|
const data = response.data
|
|
|
data[nameKey] = data['name']
|
|
|
if (data) {
|
|
|
@@ -337,24 +365,26 @@ export default {
|
|
|
this.label = data[nameKey]
|
|
|
}
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
+ .catch((e) => {
|
|
|
console.error(e)
|
|
|
})
|
|
|
}
|
|
|
} else if (type === 'org') {
|
|
|
- getOrgById({ orgId: id })
|
|
|
- .then(response => {
|
|
|
+ remoteRequest('dataTemplate', { id }, () => {
|
|
|
+ return getOrgById({ orgId: id })
|
|
|
+ })
|
|
|
+ .then((response) => {
|
|
|
const data = response.data
|
|
|
if (data) {
|
|
|
this.label = data[nameKey]
|
|
|
SELECTOR_CACHE[key] = data[nameKey]
|
|
|
}
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
+ .catch((e) => {
|
|
|
console.error(e)
|
|
|
})
|
|
|
} else if (type === 'position') {
|
|
|
- // console.log('this.deptList===>', this.deptList)
|
|
|
+ // console.log('this.deptList===>11111111111', this.deptList, id)
|
|
|
let lab = ''
|
|
|
this.deptList.forEach((item, i) => {
|
|
|
// console.log('item===>', id)
|
|
|
@@ -364,17 +394,38 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.label = lab.replace(/,$/, '')
|
|
|
- console.log()
|
|
|
+ // console.log(
|
|
|
+ // 'this.label===>',
|
|
|
+ // this.labelKey,
|
|
|
+ // type,
|
|
|
+ // this.deptList.filter((t) => id.includes(t.positionId))
|
|
|
+ // )
|
|
|
if (!this.label) {
|
|
|
- getPositionById({ positionId: id })
|
|
|
- .then(response => {
|
|
|
- const data = response.data
|
|
|
- if (data) {
|
|
|
- this.label = data[nameKey]
|
|
|
- SELECTOR_CACHE[key] = data[nameKey]
|
|
|
+ remoteRequest('dataTemplate', { id }, () => {
|
|
|
+ return this.getRemoteDataTemplateFunc(
|
|
|
+ this.descField.field_options['dialog']
|
|
|
+ )
|
|
|
+ })
|
|
|
+ .then((response) => {
|
|
|
+ console.log('dasdsa==>', this.labelKey)
|
|
|
+ const dataTem = JSON.parse(response.data)
|
|
|
+ const data = dataTem?.datasets[0]
|
|
|
+ if (!data) {
|
|
|
+ return
|
|
|
}
|
|
|
+ const tableName = data.name
|
|
|
+ const sql = `select ${this.labelKey} from ${tableName} where id_='${id}'`
|
|
|
+ remoteRequest('dataTemplatesql', { id }, () => {
|
|
|
+ return this.$common.request('sql', sql)
|
|
|
+ }).then((res) => {
|
|
|
+ const { data = [] } = res.variables || {}
|
|
|
+ if (data) {
|
|
|
+ this.label = data[0] ? data[0][this.labelKey] : '/'
|
|
|
+ SELECTOR_CACHE[key] = this.label
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
+ .catch((e) => {
|
|
|
console.error(e)
|
|
|
})
|
|
|
}
|
|
|
@@ -387,15 +438,17 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
if (!lab) {
|
|
|
- getRoleById({ roleId: id })
|
|
|
- .then(response => {
|
|
|
+ remoteRequest('dataTemplate', { id }, () => {
|
|
|
+ return getRoleById({ roleId: id })
|
|
|
+ })
|
|
|
+ .then((response) => {
|
|
|
const data = response.data
|
|
|
if (data) {
|
|
|
this.label = data[nameKey]
|
|
|
SELECTOR_CACHE[key] = data[nameKey]
|
|
|
}
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
+ .catch((e) => {
|
|
|
console.error(e)
|
|
|
})
|
|
|
} else {
|
|
|
@@ -424,13 +477,13 @@ export default {
|
|
|
this.label = ATTACHMENT_CACHE[id]
|
|
|
} else {
|
|
|
getAttachmentById({ attachmentId: id, type: type })
|
|
|
- .then(response => {
|
|
|
+ .then((response) => {
|
|
|
const data = response.data
|
|
|
if (this.$utils.isEmpty(data)) return
|
|
|
this.label = data['fileName']
|
|
|
ATTACHMENT_CACHE[id] = data['fileName']
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
+ .catch((e) => {
|
|
|
console.error(e)
|
|
|
})
|
|
|
}
|
|
|
@@ -439,7 +492,7 @@ export default {
|
|
|
* 格式化自定义对话框
|
|
|
*/
|
|
|
formatterCustomDialog(value, fieldOptions) {
|
|
|
- console.log('this.labelKey--->', this.labelKey)
|
|
|
+ // console.log('this.labelKey--->', this.labelKey)
|
|
|
const dialog = fieldOptions['dialog']
|
|
|
// const store = fieldOptions['store_mode'] || 'id'
|
|
|
|
|
|
@@ -454,7 +507,7 @@ export default {
|
|
|
const d = dataTitle.split(/(\$[0-9a-zA-Z._]+#[0-9A-Fa-f]*)/g)
|
|
|
const rtn = []
|
|
|
|
|
|
- d.forEach(n => {
|
|
|
+ d.forEach((n) => {
|
|
|
let a = n
|
|
|
if (/^\$(_widget_)/.test(n)) {
|
|
|
// 对字段进行处理
|
|
|
@@ -470,22 +523,24 @@ export default {
|
|
|
formatterDataTemplateValue: function (value, key) {
|
|
|
// console.log('格式化自定义对话框===>', value)
|
|
|
this.label = ''
|
|
|
- value.split('-').forEach(id => {
|
|
|
+ value.split('-').forEach((id) => {
|
|
|
if (key) {
|
|
|
- getDataById({ id: id, key: key }).then(response => {
|
|
|
- const responseData = response.data
|
|
|
- const data = responseData.data[0]
|
|
|
- // const data = response.data
|
|
|
- const variables = response.data
|
|
|
- if (this.$utils.isNotEmpty(data)) {
|
|
|
- // TODO 多个字段组合处理
|
|
|
- const a = this.exp(data, variables['title'].name)
|
|
|
- // const val = variables['title'] || ''
|
|
|
- this.label += this.$utils.isNotEmpty(a) ? a : ''
|
|
|
- }
|
|
|
- }).catch((e) => {
|
|
|
- console.error(e)
|
|
|
- })
|
|
|
+ getDataById({ id: id, key: key })
|
|
|
+ .then((response) => {
|
|
|
+ const responseData = response.data
|
|
|
+ const data = responseData.data[0]
|
|
|
+ // const data = response.data
|
|
|
+ const variables = response.data
|
|
|
+ if (this.$utils.isNotEmpty(data)) {
|
|
|
+ // TODO 多个字段组合处理
|
|
|
+ const a = this.exp(data, variables['title'].name)
|
|
|
+ // const val = variables['title'] || ''
|
|
|
+ this.label += this.$utils.isNotEmpty(a) ? a : ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ console.error(e)
|
|
|
+ })
|
|
|
} else {
|
|
|
const labelKeys = buildLabelTitle(this.tem)
|
|
|
const a = this.handleLabel(this.data, labelKeys)
|
|
|
@@ -522,38 +577,61 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
formatterLinkdata(value, fieldOptions) {
|
|
|
- const linkConfig = fieldOptions['link_config'] || {}
|
|
|
- const __key = fieldOptions['linkdata']
|
|
|
- const __linkKey = linkConfig.id || 'id_'
|
|
|
- const __linkText = linkConfig.text || 'name_'
|
|
|
- this.label = this.getLinkdataValue(__key, __linkKey, __linkText, value)
|
|
|
+ this.label = value
|
|
|
+ // console.log('fieldOptions===>', fieldOptions)
|
|
|
+ // const linkConfig = fieldOptions['link_config'] || {}
|
|
|
+ // const __key = fieldOptions['linkdata']
|
|
|
+ // const __linkKey = linkConfig.id || 'id_'
|
|
|
+ // const __linkText = linkConfig.text || 'name_'
|
|
|
+ // this.getLinkdataValue(__key, __linkKey, __linkText, value)
|
|
|
+ },
|
|
|
+ async getRemoteDataTemplateFunc(templateKey) {
|
|
|
+ console.log('templateKey==>', templateKey)
|
|
|
+ return remoteRequest('dataTemplate1', templateKey, () => {
|
|
|
+ return getByKey({ dataTemplateKey: templateKey })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 获取格式化参数
|
|
|
+ */
|
|
|
+ async getFormatParams(key, __linkKey) {
|
|
|
+ let formParams = {}
|
|
|
+ const res = await this.getRemoteDataTemplateFunc(key)
|
|
|
+ const data = JSON.parse(res.data)
|
|
|
+ if (!data.templates) return {}
|
|
|
+ const template = data.templates[0]
|
|
|
+ console.log('data1111111111====>', this.templateFields)
|
|
|
+ const responseData = JSON.parse(JSON.stringify(template))
|
|
|
+ responseData.datasetKey = data.datasetKey
|
|
|
+ responseData.unique = __linkKey
|
|
|
+ responseData['key'] = key
|
|
|
+ responseData['dynamic_params'] = {}
|
|
|
+ formParams['response_data'] = JSON.stringify(responseData)
|
|
|
+ formParams['filter_condition_key'] = JSON.stringify({
|
|
|
+ key: 'filter_condition_key',
|
|
|
+ value: ''
|
|
|
+ })
|
|
|
+ return ActionUtils.formatParams(formParams)
|
|
|
},
|
|
|
- getLinkdataValue(key, __linkKey, __linkText, value) {
|
|
|
+ async getLinkdataValue(key, __linkKey, __linkText, value) {
|
|
|
if (this.$utils.isEmpty(key)) {
|
|
|
return value
|
|
|
}
|
|
|
// TODO: 有问题
|
|
|
- getLinkDataByKey({
|
|
|
- key: key
|
|
|
+ // const a = await this.getFormatParams(key)
|
|
|
+ console.log('getFormatParams===>', __linkKey)
|
|
|
+ remoteRequest('dataTemplate', { key }, async () => {
|
|
|
+ const params = await this.getFormatParams(key, __linkKey)
|
|
|
+ return queryDataTable(params)
|
|
|
})
|
|
|
- .then(response => {
|
|
|
- const data = response.data
|
|
|
- if (this.$utils.isNotEmpty(data)) {
|
|
|
- const arrayValue = value.split(',')
|
|
|
- const rtn = []
|
|
|
- for (var d = 0; d < data.length; d++) {
|
|
|
- const item = data[d]
|
|
|
- const v = arrayValue.find(val => {
|
|
|
- return val === item[__linkKey]
|
|
|
- })
|
|
|
- if (v) {
|
|
|
- rtn.push(item[__linkText] || '')
|
|
|
- }
|
|
|
- }
|
|
|
- this.label += rtn.join(',')
|
|
|
- }
|
|
|
+ .then((response) => {
|
|
|
+ const item = response.data.dataResult.find(
|
|
|
+ (t) => t[__linkKey] === value
|
|
|
+ )
|
|
|
+ console.log('item====>', item)
|
|
|
+ this.label = item ? item[__linkText] : '/'
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
+ .catch((e) => {
|
|
|
console.error(e)
|
|
|
})
|
|
|
},
|
|
|
@@ -583,7 +661,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// ====================地址展示处理================
|
|
|
- getTextValue: function(data, value) {
|
|
|
+ getTextValue: function (data, value) {
|
|
|
if (this.$utils.isEmpty(value) || this.$utils.isEmpty(data)) {
|
|
|
return value || ''
|
|
|
}
|
|
|
@@ -592,13 +670,13 @@ export default {
|
|
|
}
|
|
|
return value || ''
|
|
|
},
|
|
|
- getTop: function(fieldOptions) {
|
|
|
+ getTop: function (fieldOptions) {
|
|
|
return fieldOptions['top'] ? fieldOptions['top'] : 'country'
|
|
|
},
|
|
|
- getLevel: function(fieldOptions) {
|
|
|
+ getLevel: function (fieldOptions) {
|
|
|
return fieldOptions['level'] ? fieldOptions['level'] : 'district'
|
|
|
},
|
|
|
- getTopval: function(fieldOptions) {
|
|
|
+ getTopval: function (fieldOptions) {
|
|
|
var top = this.getTop(fieldOptions)
|
|
|
var rtnVal = '0'
|
|
|
var topval = fieldOptions['topval']
|
|
|
@@ -616,7 +694,7 @@ export default {
|
|
|
},
|
|
|
getAddressData(fieldOptions, v, type) {
|
|
|
// TODO: 获取地址信息
|
|
|
- getAreaData().then(response => {
|
|
|
+ getAreaData().then((response) => {
|
|
|
WorldDistricts = response.data
|
|
|
})
|
|
|
if (this.$utils.isEmpty(v)) {
|
|
|
@@ -672,11 +750,11 @@ export default {
|
|
|
*/
|
|
|
formatterOptions(value, options, valueKey = 'value', labelKey = 'label') {
|
|
|
const optionObj = {}
|
|
|
- options.map(option => {
|
|
|
+ options.map((option) => {
|
|
|
optionObj[option[valueKey]] = option[labelKey]
|
|
|
})
|
|
|
const aryValue = value.split(',')
|
|
|
- const res = aryValue.map(v => {
|
|
|
+ const res = aryValue.map((v) => {
|
|
|
return optionObj[v] || v
|
|
|
})
|
|
|
return res.join(',')
|
|
|
@@ -697,7 +775,7 @@ export default {
|
|
|
if (typeof aryValue !== 'object') {
|
|
|
return aryValue
|
|
|
}
|
|
|
- const res = aryValue.map(val => {
|
|
|
+ const res = aryValue.map((val) => {
|
|
|
return val[key] || ''
|
|
|
})
|
|
|
return res.join(',')
|
|
|
@@ -709,12 +787,13 @@ export default {
|
|
|
.ibps-data-template-data {
|
|
|
word-break: break-all;
|
|
|
word-wrap: break-word;
|
|
|
+ color: #333;
|
|
|
}
|
|
|
::v-deep .van-cell__title {
|
|
|
- width: 65%;
|
|
|
+ width: 65%;
|
|
|
|
|
|
- .van-cell__label {
|
|
|
- overflow-wrap: break-word;
|
|
|
- }
|
|
|
+ .van-cell__label {
|
|
|
+ overflow-wrap: break-word;
|
|
|
}
|
|
|
+}
|
|
|
</style>
|