[update] 删除common.less中重复样式,修改多选时间组件和用户组织机构选择组件,搜索组件结构调整
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<template>
|
||||
<a-date-picker
|
||||
:id="fieldName"
|
||||
:show-time="false"
|
||||
:open="open"
|
||||
dropdownClassName="j-multiple-date-picker"
|
||||
:ref="fieldName"
|
||||
:dropdownClassName="'j-multiple-date-picker ' + fieldName + '-drop'"
|
||||
@openChange="handleOpenChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
@@ -11,9 +13,9 @@
|
||||
{{current.date()}}
|
||||
</div>
|
||||
</template>
|
||||
<template slot="renderExtraFooter" slot-scope="">
|
||||
<a class="ant-calendar-ok-btn" @click="handleOk">确定</a>
|
||||
</template>
|
||||
<!-- <template slot="renderExtraFooter" slot-scope="">-->
|
||||
<!-- <a class="ant-calendar-ok-btn" @click="handleOk">确定</a>-->
|
||||
<!-- </template>-->
|
||||
</a-date-picker>
|
||||
</template>
|
||||
|
||||
@@ -24,13 +26,17 @@ export default {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
fieldName: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value (val) {
|
||||
if (!val) {
|
||||
this.checkedValue = []
|
||||
document.getElementsByClassName('ant-calendar-picker-input')[0].value = ''
|
||||
document.getElementById(this.fieldName).children[0].children[0].value = ''
|
||||
this.$emit('change', '')
|
||||
}
|
||||
}
|
||||
@@ -47,12 +53,12 @@ export default {
|
||||
if (open) {
|
||||
this.open = open
|
||||
setTimeout(() => {
|
||||
document.getElementsByClassName('ant-calendar-input')[0].value = this.checkedValue.join(',')
|
||||
document.getElementsByClassName(this.fieldName + '-drop')[0].children[0].children[0].children[0].children[0].children[0].value = this.checkedValue.join(',')
|
||||
}, 100)
|
||||
} else {
|
||||
this.open = open
|
||||
this.$nextTick(() => {
|
||||
document.getElementsByClassName('ant-calendar-picker-input')[0].value = this.checkedValue.join(',')
|
||||
document.getElementById(this.fieldName).children[0].children[0].value = this.checkedValue.join(',')
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -62,30 +68,31 @@ export default {
|
||||
return true
|
||||
}
|
||||
},
|
||||
// 点击日期,加日期或者减日期
|
||||
clickCalendarDate (current) {
|
||||
const currentStr = current.format('YYYY-MM-DD')
|
||||
if (!this.checkedValue.includes(currentStr)) {
|
||||
console.log('加日期')
|
||||
this.checkedValue.push(currentStr)
|
||||
// event.target.className += ' blue'
|
||||
} else {
|
||||
console.log('减日期')
|
||||
this.checkedValue = this.checkedValue.filter(item => item !== currentStr)
|
||||
// console.log(event.target.className)
|
||||
// // 选中日期不存在该日期,该日期有blue类时删掉该类
|
||||
// if (event.target.className.split(' ').includes('blue')) {
|
||||
// event.target.className = event.target.className.split(' ').filter(item => item !== 'blue').join(' ')
|
||||
// }
|
||||
}
|
||||
document.getElementsByClassName('ant-calendar-input')[0].value = this.checkedValue.join(',')
|
||||
},
|
||||
handleOk () {
|
||||
this.open = false
|
||||
this.$nextTick(() => {
|
||||
document.getElementsByClassName('ant-calendar-picker-input')[0].value = this.checkedValue.join(',')
|
||||
document.getElementsByClassName(this.fieldName + '-drop')[0].children[0].children[0].children[0].children[0].children[0].value = this.checkedValue.join(',')
|
||||
})
|
||||
this.$emit('change', this.checkedValue.join(','))
|
||||
}
|
||||
// 点击日期弹出框中的确定按钮
|
||||
// handleOk () {
|
||||
// this.open = false
|
||||
// this.$nextTick(() => {
|
||||
// // 改变外侧日期显示框的数据
|
||||
// document.getElementById(this.fieldName).children[0].children[0].value = this.checkedValue.join(',')
|
||||
// // document.getElementsByClassName(this.fieldName)[0].children[0].children[0].value = this.checkedValue.join(',')
|
||||
// })
|
||||
// this.$emit('change', this.checkedValue.join(','))
|
||||
// }
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
|
||||
Reference in New Issue
Block a user