修改禅道已知bug
This commit is contained in:
@@ -3,13 +3,20 @@
|
||||
<a-radio v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio>
|
||||
</a-radio-group>
|
||||
|
||||
<a-radio-group v-else-if="tagType=='radioButton'" buttonStyle="solid" @change="handleInput" :value="getValueSting" :disabled="disabled">
|
||||
<a-radio-group v-else-if="tagType=='radioButton'" buttonStyle="solid" @change="handleInput" :value="getValueSting"
|
||||
:disabled="disabled">
|
||||
<a-radio-button v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio-button>
|
||||
</a-radio-group>
|
||||
|
||||
<a-select v-else-if="tagType=='select'" allowClear :getPopupContainer = "getPopupContainer" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput">
|
||||
<!-- <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>-->
|
||||
<a-select-option v-for="(item, key) in dictOptionsValue" :key="key" :value="item.value">
|
||||
<a-select v-else-if="tagType=='select'" allowClear :getPopupContainer="getPopupContainer"
|
||||
show-search
|
||||
optionFilterProp="label"
|
||||
:placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput">
|
||||
<!-- <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>-->
|
||||
<a-select-option v-for="(item, key) in dictOptionsValue"
|
||||
:key="key"
|
||||
:label="item.text || item.label"
|
||||
:value="item.value">
|
||||
<span class="itemOption-index" :title=" item.text || item.label ">
|
||||
{{ item.text || item.label }}
|
||||
</span>
|
||||
@@ -18,19 +25,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api'
|
||||
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: "JDictSelectTag",
|
||||
name: 'JDictSelectTag',
|
||||
props: {
|
||||
dictCode: String,
|
||||
placeholder: String,
|
||||
triggerChange: Boolean,
|
||||
disabled: Boolean,
|
||||
db_field_name:String,
|
||||
db_field_name: String,
|
||||
value: [String, Number],
|
||||
type: String,
|
||||
getPopupContainer:{
|
||||
getPopupContainer: {
|
||||
type: Function,
|
||||
default: (node) => node.parentNode
|
||||
}
|
||||
@@ -38,36 +45,36 @@
|
||||
data() {
|
||||
return {
|
||||
dictOptions: [],
|
||||
tagType:""
|
||||
tagType: ''
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
dictCode:{
|
||||
immediate:true,
|
||||
watch: {
|
||||
dictCode: {
|
||||
immediate: true,
|
||||
handler() {
|
||||
this.initDictData()
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// console.log(this.dictCode);
|
||||
if(!this.type || this.type==="list"){
|
||||
this.tagType = "select"
|
||||
}else{
|
||||
if (!this.type || this.type === 'list') {
|
||||
this.tagType = 'select'
|
||||
} else {
|
||||
this.tagType = this.type
|
||||
}
|
||||
//获取字典数据
|
||||
// this.initDictData();
|
||||
},
|
||||
computed: {
|
||||
getValueSting(){
|
||||
getValueSting() {
|
||||
// update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
|
||||
// 当有null或“” placeholder不显示
|
||||
return this.value != null ? this.value.toString() : undefined;
|
||||
return this.value != null ? this.value.toString() : undefined
|
||||
// update-end author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
|
||||
},
|
||||
dictOptionsValue: function () {
|
||||
return this.dictOptions.filter(function (dictOption) {
|
||||
dictOptionsValue: function() {
|
||||
return this.dictOptions.filter(function(dictOption) {
|
||||
return dictOption.value
|
||||
})
|
||||
}
|
||||
@@ -75,8 +82,8 @@
|
||||
methods: {
|
||||
initDictData() {
|
||||
//优先从缓存中读取字典配置
|
||||
if(getDictItemsFromCache(this.dictCode)){
|
||||
this.dictOptions = getDictItemsFromCache(this.dictCode);
|
||||
if (getDictItemsFromCache(this.dictCode)) {
|
||||
this.dictOptions = getDictItemsFromCache(this.dictCode)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -84,34 +91,34 @@
|
||||
ajaxGetDictItems(this.dictCode, null).then((res) => {
|
||||
if (res.success) {
|
||||
// console.log(res.result);
|
||||
this.dictOptions = res.result;
|
||||
this.dictOptions = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
handleInput(e) {
|
||||
let val;
|
||||
if(this.tagType=="radio"){
|
||||
let val
|
||||
if (this.tagType == 'radio') {
|
||||
val = e.target.value
|
||||
}else{
|
||||
} else {
|
||||
val = e
|
||||
}
|
||||
let content = ''
|
||||
this.dictOptions.forEach(res=>{
|
||||
if (res.value == e){
|
||||
content = res.text || res.label
|
||||
}
|
||||
this.dictOptions.forEach(res => {
|
||||
if (res.value == e) {
|
||||
content = res.text || res.label
|
||||
}
|
||||
})
|
||||
if(this.triggerChange){
|
||||
this.$emit('change', val);
|
||||
}else{
|
||||
this.$emit('input', val);
|
||||
this.$emit('changeQuery', content,this.db_field_name);
|
||||
if (this.triggerChange) {
|
||||
this.$emit('change', val)
|
||||
} else {
|
||||
this.$emit('input', val)
|
||||
this.$emit('changeQuery', content, this.db_field_name)
|
||||
}
|
||||
},
|
||||
setCurrentDictOptions(dictOptions){
|
||||
setCurrentDictOptions(dictOptions) {
|
||||
this.dictOptions = dictOptions
|
||||
},
|
||||
getCurrentDictOptions(){
|
||||
getCurrentDictOptions() {
|
||||
return this.dictOptions
|
||||
}
|
||||
}
|
||||
@@ -124,6 +131,6 @@
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow:ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
@@ -151,13 +151,17 @@
|
||||
},
|
||||
//带文件导出
|
||||
handleFileExport() {
|
||||
let query = {
|
||||
...this.$refs.searchRef.queryParam,
|
||||
id: this.idList.join(','),
|
||||
flag: 'file'
|
||||
if (this.idList.length > 0) {
|
||||
let query = {
|
||||
...this.$refs.searchRef.queryParam,
|
||||
id: this.idList.join(','),
|
||||
flag: 'file'
|
||||
}
|
||||
let handlingTime = moment(new Date()).format('YYYY-MM-DD')
|
||||
downloadFile('document/bussDocumentLibraryEO/exportZip', this.$t('DocumentLibrary')+handlingTime+'.zip', query, this.Deselect)
|
||||
}else{
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
}
|
||||
let handlingTime = moment(new Date()).format('YYYY-MM-DD')
|
||||
downloadFile('document/bussDocumentLibraryEO/exportZip', this.$t('DocumentLibrary')+handlingTime+'.zip', query, this.Deselect)
|
||||
},
|
||||
//新增
|
||||
handleAdd() {
|
||||
|
||||
Reference in New Issue
Block a user