修改禅道已知bug

This commit is contained in:
qq787203167
2022-06-30 10:52:36 +08:00
parent 6931b3ffc7
commit db79b808f1
2 changed files with 55 additions and 44 deletions
+45 -38
View File
@@ -3,13 +3,20 @@
<a-radio v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio> <a-radio v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio>
</a-radio-group> </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-button v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio-button>
</a-radio-group> </a-radio-group>
<a-select v-else-if="tagType=='select'" allowClear :getPopupContainer = "getPopupContainer" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput"> <a-select v-else-if="tagType=='select'" allowClear :getPopupContainer="getPopupContainer"
<!-- <a-select-option :value="null">{{$t('pleaseSelect')}}</a-select-option>--> show-search
<a-select-option v-for="(item, key) in dictOptionsValue" :key="key" :value="item.value"> 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 "> <span class="itemOption-index" :title=" item.text || item.label ">
{{ item.text || item.label }} {{ item.text || item.label }}
</span> </span>
@@ -18,19 +25,19 @@
</template> </template>
<script> <script>
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
export default { export default {
name: "JDictSelectTag", name: 'JDictSelectTag',
props: { props: {
dictCode: String, dictCode: String,
placeholder: String, placeholder: String,
triggerChange: Boolean, triggerChange: Boolean,
disabled: Boolean, disabled: Boolean,
db_field_name:String, db_field_name: String,
value: [String, Number], value: [String, Number],
type: String, type: String,
getPopupContainer:{ getPopupContainer: {
type: Function, type: Function,
default: (node) => node.parentNode default: (node) => node.parentNode
} }
@@ -38,36 +45,36 @@
data() { data() {
return { return {
dictOptions: [], dictOptions: [],
tagType:"" tagType: ''
} }
}, },
watch:{ watch: {
dictCode:{ dictCode: {
immediate:true, immediate: true,
handler() { handler() {
this.initDictData() this.initDictData()
}, }
} }
}, },
created() { created() {
// console.log(this.dictCode); // console.log(this.dictCode);
if(!this.type || this.type==="list"){ if (!this.type || this.type === 'list') {
this.tagType = "select" this.tagType = 'select'
}else{ } else {
this.tagType = this.type this.tagType = this.type
} }
//获取字典数据 //获取字典数据
// this.initDictData(); // this.initDictData();
}, },
computed: { computed: {
getValueSting(){ getValueSting() {
// update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------ // update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
// 当有null或“” 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的文字 ------ // update-end author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
}, },
dictOptionsValue: function () { dictOptionsValue: function() {
return this.dictOptions.filter(function (dictOption) { return this.dictOptions.filter(function(dictOption) {
return dictOption.value return dictOption.value
}) })
} }
@@ -75,8 +82,8 @@
methods: { methods: {
initDictData() { initDictData() {
//优先从缓存中读取字典配置 //优先从缓存中读取字典配置
if(getDictItemsFromCache(this.dictCode)){ if (getDictItemsFromCache(this.dictCode)) {
this.dictOptions = getDictItemsFromCache(this.dictCode); this.dictOptions = getDictItemsFromCache(this.dictCode)
return return
} }
@@ -84,34 +91,34 @@
ajaxGetDictItems(this.dictCode, null).then((res) => { ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) { if (res.success) {
// console.log(res.result); // console.log(res.result);
this.dictOptions = res.result; this.dictOptions = res.result
} }
}) })
}, },
handleInput(e) { handleInput(e) {
let val; let val
if(this.tagType=="radio"){ if (this.tagType == 'radio') {
val = e.target.value val = e.target.value
}else{ } else {
val = e val = e
} }
let content = '' let content = ''
this.dictOptions.forEach(res=>{ this.dictOptions.forEach(res => {
if (res.value == e){ if (res.value == e) {
content = res.text || res.label content = res.text || res.label
} }
}) })
if(this.triggerChange){ if (this.triggerChange) {
this.$emit('change', val); this.$emit('change', val)
}else{ } else {
this.$emit('input', val); this.$emit('input', val)
this.$emit('changeQuery', content,this.db_field_name); this.$emit('changeQuery', content, this.db_field_name)
} }
}, },
setCurrentDictOptions(dictOptions){ setCurrentDictOptions(dictOptions) {
this.dictOptions = dictOptions this.dictOptions = dictOptions
}, },
getCurrentDictOptions(){ getCurrentDictOptions() {
return this.dictOptions return this.dictOptions
} }
} }
@@ -124,6 +131,6 @@
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
-o-text-overflow:ellipsis; -o-text-overflow: ellipsis;
} }
</style> </style>
@@ -151,13 +151,17 @@
}, },
//带文件导出 //带文件导出
handleFileExport() { handleFileExport() {
let query = { if (this.idList.length > 0) {
...this.$refs.searchRef.queryParam, let query = {
id: this.idList.join(','), ...this.$refs.searchRef.queryParam,
flag: 'file' 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() { handleAdd() {