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() {
|
list() {
|
||||||
this.resetList()
|
this.resetList()
|
||||||
this.init()
|
this.$nextTick(() => {
|
||||||
|
this.init()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.resetList()
|
this.resetList()
|
||||||
this.init()
|
this.$nextTick(() => {
|
||||||
|
this.init()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addScrollDiv(selectDom) {
|
addScrollDiv(selectDom) {
|
||||||
@ -101,13 +105,13 @@ export default {
|
|||||||
if (this.defaultFirst && this.list.length > 0) {
|
if (this.defaultFirst && this.list.length > 0) {
|
||||||
this.selectValue = this.list[0].value
|
this.selectValue = this.list[0].value
|
||||||
}
|
}
|
||||||
|
if (!this.list || !this.list.length) return
|
||||||
|
|
||||||
const selectDom = document.querySelector(
|
const selectDom = document.querySelector(
|
||||||
`.${this.classId} .el-select-dropdown .el-select-dropdown__wrap`
|
`.${this.classId} .el-select-dropdown .el-select-dropdown__wrap`
|
||||||
)
|
)
|
||||||
this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`)
|
this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`)
|
||||||
this.slectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`)
|
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.display = 'flex'
|
||||||
this.slectBoxDom.style.flexDirection = 'row'
|
this.slectBoxDom.style.flexDirection = 'row'
|
||||||
this.domList = selectDom.querySelector(
|
this.domList = selectDom.querySelector(
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
import ElVisualSelect from '@/components/ElVisualSelect'
|
import ElVisualSelect from '@/components/ElVisualSelect'
|
||||||
import { multFieldValues, linkMultFieldValues } from '@/api/dataset/dataset'
|
import { multFieldValues, linkMultFieldValues } from '@/api/dataset/dataset'
|
||||||
import bus from '@/utils/bus'
|
import bus from '@/utils/bus'
|
||||||
|
import { isSameVueObj } from '@/utils'
|
||||||
import { getLinkToken, getToken } from '@/utils/auth'
|
import { getLinkToken, getToken } from '@/utils/auth'
|
||||||
import customInput from '@/components/widget/DeWidget/customInput'
|
import customInput from '@/components/widget/DeWidget/customInput'
|
||||||
import { textSelectWidget } from '@/components/widget/DeWidget/serviceNameFn.js'
|
import { textSelectWidget } from '@/components/widget/DeWidget/serviceNameFn.js'
|
||||||
@ -143,7 +144,9 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
'element.options.attrs.sort': function(value, old) {
|
'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 = []
|
this.datas = []
|
||||||
|
|
||||||
let method = multFieldValues
|
let method = multFieldValues
|
||||||
@ -160,6 +163,10 @@ export default {
|
|||||||
this.element.options.attrs.fieldId.length > 0 &&
|
this.element.options.attrs.fieldId.length > 0 &&
|
||||||
method(param).then(res => {
|
method(param).then(res => {
|
||||||
this.datas = this.optionDatas(res.data)
|
this.datas = this.optionDatas(res.data)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.show = true
|
||||||
|
this.handleCoustomStyle()
|
||||||
|
})
|
||||||
}) || (this.element.options.value = '')
|
}) || (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)
|
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
|
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