forked from github/dataease
Merge branch 'v1.12' of github.com:dataease/dataease into v1.12
This commit is contained in:
commit
972550fed1
@ -69,12 +69,16 @@ export default {
|
||||
},
|
||||
list() {
|
||||
this.resetList()
|
||||
this.init()
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetList()
|
||||
this.init()
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
addScrollDiv(selectDom) {
|
||||
@ -101,13 +105,13 @@ export default {
|
||||
if (this.defaultFirst && this.list.length > 0) {
|
||||
this.selectValue = this.list[0].value
|
||||
}
|
||||
if (!this.list || !this.list.length) return
|
||||
|
||||
const selectDom = document.querySelector(
|
||||
`.${this.classId} .el-select-dropdown .el-select-dropdown__wrap`
|
||||
)
|
||||
this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`)
|
||||
this.slectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`)
|
||||
if (!this.slectBoxDom || !this.slectBoxDom.style) return
|
||||
this.slectBoxDom.style.display = 'flex'
|
||||
this.slectBoxDom.style.flexDirection = 'row'
|
||||
this.domList = selectDom.querySelector(
|
||||
|
@ -36,6 +36,7 @@
|
||||
import ElVisualSelect from '@/components/ElVisualSelect'
|
||||
import { multFieldValues, linkMultFieldValues } from '@/api/dataset/dataset'
|
||||
import bus from '@/utils/bus'
|
||||
import { isSameVueObj } from '@/utils'
|
||||
import { getLinkToken, getToken } from '@/utils/auth'
|
||||
import customInput from '@/components/widget/DeWidget/customInput'
|
||||
import { textSelectWidget } from '@/components/widget/DeWidget/serviceNameFn.js'
|
||||
@ -143,7 +144,9 @@ export default {
|
||||
})
|
||||
},
|
||||
'element.options.attrs.sort': function(value, old) {
|
||||
if (value === null || typeof value === 'undefined' || value === old) return
|
||||
if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return
|
||||
this.show = false
|
||||
|
||||
this.datas = []
|
||||
|
||||
let method = multFieldValues
|
||||
@ -160,6 +163,10 @@ export default {
|
||||
this.element.options.attrs.fieldId.length > 0 &&
|
||||
method(param).then(res => {
|
||||
this.datas = this.optionDatas(res.data)
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
this.handleCoustomStyle()
|
||||
})
|
||||
}) || (this.element.options.value = '')
|
||||
}
|
||||
|
||||
|
@ -278,3 +278,11 @@ export function isMobile() {
|
||||
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
|
||||
return flag
|
||||
}
|
||||
|
||||
export const isSameVueObj = (source, target) => {
|
||||
if (!source && !target) return true
|
||||
if (!!source && !!target) {
|
||||
return JSON.stringify(source) === JSON.stringify(target)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user