效期剩余时间(天)分类搜索下拉框数据获取 label宽度和searchWidth调整
This commit is contained in:
@@ -92,11 +92,13 @@ v-if="tableSearch['Group by']&&tableSearch['Group by'].includes(key)||!tableSear
|
||||
import * as ReportApi from '@/api/design/report'
|
||||
import { InputNumberRange,InputDateRange ,InputDateTimeRange,InputTimeRange} from '../shareControl/index'
|
||||
import download from '@/utils/download'
|
||||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { assembleLengObj } from '@/utils/lowDesign'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import Avue from '@smallwei/avue'
|
||||
import { Console } from 'console'
|
||||
defineOptions({ name: 'LowReport' })
|
||||
|
||||
interface Props {
|
||||
@@ -261,7 +263,6 @@ const initTable = async () => {
|
||||
// 处理动态列(暂不构建children,等数据返回后动态生成)
|
||||
dynamicFields.forEach((item, index) => {
|
||||
if (item.parentFieldCode && item.parentFieldCode !== '') return
|
||||
|
||||
const config: any = {
|
||||
prop: item.fieldCode,
|
||||
label: t(`${props.reportCode}.${item.fieldCode}`),
|
||||
@@ -285,9 +286,9 @@ const initTable = async () => {
|
||||
tableSearch.value[config.prop]=item.searchDefaultValue
|
||||
}
|
||||
}
|
||||
|
||||
if(['年','年度','年份','月','月度','月份','年月'].includes(item.fieldName)&&config.search){
|
||||
config.searchSpan=3
|
||||
config.searchLabelWidth=60
|
||||
if(item.fieldName.includes('年')){
|
||||
config.searchType='year'
|
||||
config.valueFormat = 'YYYY'
|
||||
@@ -296,6 +297,9 @@ const initTable = async () => {
|
||||
config.dicData=[{label:'1月',value:'1'},{label:'2月',value:'2'},{label:'3月',value:'3'},{label:'4月',value:'4'},{label:'5月',value:'5'},{label:'6月',value:'6'},{label:'7月',value:'7'},{label:'8月',value:'8'},{label:'9月',value:'9'},{label:'10月',value:'10'},{label:'11月',value:'11'},{label:'12月',value:'12'}]
|
||||
}
|
||||
}
|
||||
if(item.fieldName=='效期剩余时间(天)分类') config.searchSpan=5
|
||||
|
||||
if(config.search) config.searchLabelWidth=item.fieldName.length*12 +40
|
||||
if(['货品名称','货品','剂型','产品','产品名称','剂型名称','客户名称','客户','业务员'].includes(item.fieldName)&&config.search){
|
||||
config.dataType= 'string'
|
||||
config.dictType= 'defaultTable'
|
||||
@@ -305,19 +309,21 @@ const initTable = async () => {
|
||||
pageSize: 1000000,
|
||||
pageNo:1
|
||||
}
|
||||
config.filterable= true
|
||||
|
||||
config.collapseTags=true
|
||||
config.dicFormatter= (res) => { //请求数据格式化
|
||||
const arr=[...new Set(res.records.map(item=>item[config.prop]))]
|
||||
return arr.map(item=>({label:item,value:item}))
|
||||
}
|
||||
config.searchType='select'
|
||||
}
|
||||
|
||||
if(item.dictCode){
|
||||
const dictData=getStrDictOptions(item.dictCode)
|
||||
config.dicData=dictData
|
||||
config.searchType= 'select'
|
||||
config.dataType= 'string'
|
||||
}
|
||||
const moreIn="MORE_IN".includes(item.queryMode)
|
||||
config.searchType=moreIn?'select':config.searchType
|
||||
config.multiple=moreIn
|
||||
config.multiple=config.filterable=config.collapseTags=moreIn
|
||||
|
||||
if(!!item.isAmount){
|
||||
index==0?amountFieds.value.fistField=config.prop:''
|
||||
|
||||
Reference in New Issue
Block a user