更换责任领域接口

This commit is contained in:
范强强
2023-04-17 17:11:09 +08:00
parent 827ea7152d
commit f359d26fc6
4 changed files with 63 additions and 42 deletions
+1
View File
@@ -66,6 +66,7 @@ const editDictItem = (params)=>putAction("/sys/dictItem/edit",params);
//字典标签专用(通过code获取字典数组) //字典标签专用(通过code获取字典数组)
export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params); export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params);
export const getDutyTerritoryDictItems = (code, params)=>getAction(`/sys/dict/getDutyTerritoryDictItems/${code}`,params);
//从缓存中获取字典配置 //从缓存中获取字典配置
function getDictItemsFromCache(dictCode) { function getDictItemsFromCache(dictCode) {
if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]) { if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]) {
@@ -25,7 +25,7 @@
</template> </template>
<script> <script>
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' import { ajaxGetDictItems, getDictItemsFromCache, getDutyTerritoryDictItems } from '@/api/api'
export default { export default {
name: 'JDictSelectTag', name: 'JDictSelectTag',
@@ -88,12 +88,22 @@
} }
//根据字典Code, 初始化字典数组 //根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => { if (this.dictCode == 'duty_territory'){
if (res.success) { getDutyTerritoryDictItems(this.dictCode, null).then((res) => {
if (res.success) {
// console.log(res.result); // console.log(res.result);
this.dictOptions = res.result this.dictOptions = res.result
} }
}) })
}else{
ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) {
// console.log(res.result);
this.dictOptions = res.result
}
})
}
}, },
handleInput(e) { handleInput(e) {
let val let val
@@ -109,7 +119,7 @@
} }
}) })
if (this.triggerChange) { if (this.triggerChange) {
this.$emit('change', val,content) this.$emit('change', val, content)
} 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)
@@ -27,7 +27,7 @@
</template> </template>
<script> <script>
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' import { ajaxGetDictItems, getDictItemsFromCache,getDutyTerritoryDictItems } from '@/api/api'
export default { export default {
name: 'JMultiSelectTag', name: 'JMultiSelectTag',
@@ -117,11 +117,21 @@
return return
} }
//根据字典Code, 初始化字典数组 //根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => { if (this.dictCode == 'duty_territory'){
if (res.success) { getDutyTerritoryDictItems(this.dictCode, null).then((res) => {
this.dictOptions = res.result if (res.success) {
} // console.log(res.result);
}) this.dictOptions = res.result
}
})
}else{
ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) {
// console.log(res.result);
this.dictOptions = res.result
}
})
}
} }
}, },
@@ -44,37 +44,37 @@
</a-select> </a-select>
</div> </div>
</a-col> </a-col>
<template v-if="toggleSearchStatus"> <!-- <template v-if="toggleSearchStatus">-->
<a-col :md="6" :sm="8"> <!-- <a-col :md="6" :sm="8">-->
<div class="box-title-text"> <!-- <div class="box-title-text">-->
<div class="title-text" :title="$t('Tasknode')"> <!-- <div class="title-text" :title="$t('Tasknode')">-->
<span>{{$t('Tasknode')}}</span> <!-- <span>{{$t('Tasknode')}}</span>-->
</div> <!-- </div>-->
<a-select :placeholder="$t('PleaseSelect')+$t('Tasknode')" <!-- <a-select :placeholder="$t('PleaseSelect')+$t('Tasknode')"-->
class="box-input" <!-- class="box-input"-->
:getPopupContainer="triggerNode=> triggerNode.parentNode" <!-- :getPopupContainer="triggerNode=> triggerNode.parentNode"-->
allowClear <!-- allowClear-->
showSearch <!-- showSearch-->
optionFilterProp="label" <!-- optionFilterProp="label"-->
v-model="queryParam.status"> <!-- v-model="queryParam.status">-->
<a-select-option v-for="(item, key) in taskStatusList" <!-- <a-select-option v-for="(item, key) in taskStatusList"-->
:key="key" <!-- :key="key"-->
:label="item.name" <!-- :label="item.name"-->
:value="item.value"> <!-- :value="item.value">-->
<span style="display: inline-block;width: 100%" :title=" item.name"> <!-- <span style="display: inline-block;width: 100%" :title=" item.name">-->
{{ item.name }} <!-- {{ item.name }}-->
</span> <!-- </span>-->
</a-select-option> <!-- </a-select-option>-->
</a-select> <!-- </a-select>-->
</div> <!-- </div>-->
</a-col> <!-- </a-col>-->
</template> <!-- </template>-->
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons"> <span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a @click="handleToggleSearch"> <!-- <a @click="handleToggleSearch">-->
{{ !toggleSearchStatus ? $t('open') : $t('away') }} <!-- {{ !toggleSearchStatus ? $t('open') : $t('away') }}-->
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
</a> <!-- </a>-->
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button> <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button> <a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
</a-col> </a-col>