[update 搜索中心] 完善

This commit is contained in:
danshihao
2024-06-28 10:37:58 +08:00
parent acdd3beb54
commit 254f4dbd72
7 changed files with 54 additions and 35 deletions
+4 -2
View File
@@ -12,8 +12,10 @@ module.exports = {
standardClass: 'Standard Class', standardClass: 'Standard Class',
dynamicType: 'Dynamic Type', dynamicType: 'Dynamic Type',
applicableVehicleType: 'Applicable Vehicle Type', applicableVehicleType: 'Applicable Vehicle Type',
standardType: 'Standard Type', standardCategoryCode: 'Standard classification code',
state: 'State', applicableMarkets: 'Applicable markets',
standardType: 'Type',
state: 'Standard state',
enterpriseStandardCode: 'Enterprise Standard Code', enterpriseStandardCode: 'Enterprise Standard Code',
standardState: 'Standard State', standardState: 'Standard State',
standardGradeClassification: 'Standard Grade Classification', standardGradeClassification: 'Standard Grade Classification',
+5 -3
View File
@@ -11,9 +11,11 @@ module.exports = {
resourceType: '资源类型', resourceType: '资源类型',
standardClass: '标准类别', standardClass: '标准类别',
dynamicType: '动力类型', dynamicType: '动力类型',
applicableVehicleType: '适用车辆类型', applicableVehicleType: '适用车型',
standardType: '标准类型', standardCategoryCode: '标准分类代码',
state: '状态', applicableMarkets: '适用市场',
standardType: '类型',
state: '标准状态',
enterpriseStandardCode: '企业标准代号', enterpriseStandardCode: '企业标准代号',
standardState: '标准状态', standardState: '标准状态',
standardGradeClassification: '标准等级分类', standardGradeClassification: '标准等级分类',
@@ -110,6 +110,7 @@ module.exports = {
pcrNumber: 'PCR number', pcrNumber: 'PCR number',
rectifyFinishingDate: 'Completion date of rectification', rectifyFinishingDate: 'Completion date of rectification',
viewMarketList: 'View market list', viewMarketList: 'View market list',
viewTroubleshootingResults: 'View troubleshooting results' viewTroubleshootingResults: 'View troubleshooting results',
exportXlsName: 'Standard Master Plan'
} }
} }
@@ -111,6 +111,7 @@ module.exports = {
pcrNumber: 'PCR编号', pcrNumber: 'PCR编号',
rectifyFinishingDate: '整改完成日期', rectifyFinishingDate: '整改完成日期',
viewMarketList: '查看市场清单', viewMarketList: '查看市场清单',
viewTroubleshootingResults: '查看排查结果' viewTroubleshootingResults: '查看排查结果',
exportXlsName: '标准主计划'
} }
} }
@@ -828,6 +828,8 @@ export default {
// 标准类型是条款时,默认回显第一个标准的条款 // 标准类型是条款时,默认回显第一个标准的条款
if (this.dataSource.length && this.currStandardType === '4') { if (this.dataSource.length && this.currStandardType === '4') {
this.handleClickStandar(this.dataSource[0]) this.handleClickStandar(this.dataSource[0])
} else {
this.clauseDataSource = []
} }
if (res.result.total) { if (res.result.total) {
this.ipagination.total = res.result.total this.ipagination.total = res.result.total
+38 -27
View File
@@ -204,7 +204,8 @@ export default {
'standardState', // 状态 'standardState', // 状态
'standardCode', // 企业标准代号 'standardCode', // 企业标准代号
'enterpriseStandardState', // 标准状态 'enterpriseStandardState', // 标准状态
'gradeClassification' // 标准等级分类 'gradeClassification', // 标准等级分类
'categoryCode' // 标准分类代码
], // 其他筛选条件中所有的key,为了能按顺序遍历 ], // 其他筛选条件中所有的key,为了能按顺序遍历
dataSource: [], dataSource: [],
ipagination: { ipagination: {
@@ -326,32 +327,8 @@ export default {
// 设置对象key为搜索时需要传给后端的字段名,以及设置选项和字段label // 设置对象key为搜索时需要传给后端的字段名,以及设置选项和字段label
for (const item in res.result) { for (const item in res.result) {
if (res.result[item]) { if (res.result[item]) {
let label = '' // 通过key获取对应label
if (item === 'applicableVehicle') { const label = this.getLabelByKey(item)
// 适用车辆类型
label = this.$t('dashboard.generalSearch.applicableVehicleType')
} else if (item === 'dynamicType') {
// 动力类型
label = this.$t('dashboard.generalSearch.dynamicType')
} else if (item === 'enterpriseStandardState') {
// 标准状态
label = this.$t('dashboard.generalSearch.standardState')
} else if (item === 'gradeClassification') {
// 标准等级分类
label = this.$t('dashboard.generalSearch.standardGradeClassification')
} else if (item === 'standardClass') {
// 标准类别
label = this.$t('dashboard.generalSearch.standardClass')
} else if (item === 'standardCode') {
// 企业标准代号
label = this.$t('dashboard.generalSearch.enterpriseStandardCode')
} else if (item === 'standardProperty') {
// 标准类型
label = this.$t('dashboard.generalSearch.standardType')
} else if (item === 'standardState') {
// 状态
label = this.$t('dashboard.generalSearch.state')
}
res.result[item].unshift({ itemText: this.$t('dashboard.generalSearch.all'), itemValue: 'all' }) res.result[item].unshift({ itemText: this.$t('dashboard.generalSearch.all'), itemValue: 'all' })
this.selectOptions[item] = { this.selectOptions[item] = {
options: res.result[item], options: res.result[item],
@@ -375,6 +352,40 @@ export default {
this.selectOptionLoading = false this.selectOptionLoading = false
}) })
}, },
// 通过key获取label
getLabelByKey (key) {
if (key === 'applicableVehicle') {
// 适用车型
return this.$t('dashboard.generalSearch.applicableVehicleType')
} else if (key === 'dynamicType') {
// 动力类型
return this.$t('dashboard.generalSearch.dynamicType')
} else if (key === 'enterpriseStandardState') {
// 标准状态
return this.$t('dashboard.generalSearch.standardState')
} else if (key === 'gradeClassification') {
// 标准等级分类
return this.$t('dashboard.generalSearch.standardGradeClassification')
} else if (key === 'standardClass') {
// 标准类别
return this.$t('dashboard.generalSearch.standardClass')
} else if (key === 'standardCode') {
// 企业标准代号
return this.$t('dashboard.generalSearch.enterpriseStandardCode')
} else if (key === 'standardProperty') {
// 标准类型
return this.$t('dashboard.generalSearch.standardType')
} else if (key === 'standardState') {
// 状态
return this.$t('dashboard.generalSearch.state')
} else if (key === 'categoryCode') {
// 标准分类代码
return this.$t('dashboard.generalSearch.standardCategoryCode')
} else if (key === 'applicableMarket') {
// 适用市场
return this.$t('dashboard.generalSearch.applicableMarkets')
}
},
// 查询时获取参数 // 查询时获取参数
getSearchParam () { getSearchParam () {
const param = {} const param = {}
@@ -33,7 +33,7 @@
</div> </div>
<div class="table-operator" style="border-top: 5px"> <div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'standardMasterPlan:add'">{{ $t('add') }}</a-button> <a-button @click="handleAdd" type="primary" icon="plus" v-has="'standardMasterPlan:add'">{{ $t('add') }}</a-button>
<a-button type="primary" icon="upload" ghost @click="handleExportXls($t('dict.dictInfo'))" <a-button type="primary" icon="upload" ghost @click="handleExportXls($t('standardRegulationLibrary.standardMasterPlan.exportXlsName'))"
v-has="'standardMasterPlan:export'">{{ $t('export') }} v-has="'standardMasterPlan:export'">{{ $t('export') }}
</a-button> </a-button>
</div> </div>