[update 首页] 翻译
This commit is contained in:
@@ -44,6 +44,12 @@ export default {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => []
|
||||
},
|
||||
// 是否返回区间,只选择一侧,另一侧会返回一个minDate或maxDate
|
||||
returnInterval: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -112,7 +118,14 @@ export default {
|
||||
},
|
||||
// 触发change事件
|
||||
triggerChange () {
|
||||
this.$emit('change', [this.startDate || minDate, this.endDate || maxDate])
|
||||
const startDate = this.startDate || minDate
|
||||
const endDate = this.endDate || maxDate
|
||||
// 是否一侧为空时,返回最大日期或最小日期
|
||||
if (this.returnInterval) {
|
||||
this.$emit('change', [startDate, endDate])
|
||||
} else {
|
||||
this.$emit('change', [this.startDate, this.endDate])
|
||||
}
|
||||
},
|
||||
// 记录最后一次点击的日期
|
||||
clickCalendarDate (val) {
|
||||
|
||||
@@ -738,3 +738,26 @@ export function queryStandardInfoByStandardNumber (standardNumber) {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找树节点
|
||||
* @param tree {Array} - 树结构
|
||||
* @param findVal - 查找的值
|
||||
* @param valueField - 查找的属性名
|
||||
* @param childrenField - 子节点属性名
|
||||
* @return {null | Object} - 返回对应节点
|
||||
*/
|
||||
export function findNodeByField (tree, findVal, valueField = 'id', childrenField = 'children') {
|
||||
for (const node of tree) {
|
||||
if (node[valueField] === findVal) {
|
||||
return node
|
||||
}
|
||||
if (node[childrenField] && node[childrenField].length > 0) {
|
||||
const result = findNodeByField(node[childrenField], findVal)
|
||||
if (result) {
|
||||
return result
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<div class="search-wrapper">
|
||||
<a-select class="resource-type-select" v-model="resourceType" size="large">
|
||||
<a-select-option value="all">{{ $t('dashboard.generalSearch.all')}}</a-select-option>
|
||||
<a-select-option v-for="item in resourceTypeOptions" :key="item.value" :value="item.value" :title="item.title">
|
||||
{{ item.title }}
|
||||
<a-select-option v-for="item in resourceTypeOptions" :key="item.value" :value="item.value" :title="isChinese() ? item.title : item.enText">
|
||||
{{ isChinese() ? item.title : item.enText }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-input class="search-input" size="large" v-model="searchValue" :placeholder="$t('pleaseEnter')" @pressEnter="searchInputEnter">
|
||||
|
||||
@@ -60,14 +60,12 @@
|
||||
<a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
|
||||
v-model="queryParam[item.dbFieldName]"></a-input>
|
||||
</template>
|
||||
<!-- 日期区间 -->
|
||||
<!-- 日期区间(条款选择的日期只要单侧) -->
|
||||
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
|
||||
<j-range-picker v-model="queryParam[item.dbFieldName]"
|
||||
<j-date-picker v-model="queryParam[item.dbFieldName]"
|
||||
:returnInterval="currStandardType !== '4'"
|
||||
format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
@change="onChange(item.dbFieldName)"></j-range-picker>
|
||||
<!--<a-range-picker v-model="queryParam[item.dbFieldName]"-->
|
||||
<!-- format="YYYY-MM-DD" value-format="YYYY-MM-DD"-->
|
||||
<!-- @change="onChange(item.dbFieldName)"></a-range-picker>-->
|
||||
@change="onChange(item.dbFieldName)"></j-date-picker>
|
||||
</template>
|
||||
<!-- 字典单选框 -->
|
||||
<template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
|
||||
@@ -245,11 +243,11 @@ import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '../../../store/mutation-types'
|
||||
import { previewPdf } from '../../../utils/previewPdf'
|
||||
import { kkFilePreview } from '../../../utils/kkFilePreview'
|
||||
import JRangePicker from '@comp/JDatePicker'
|
||||
import JDatePicker from '@comp/JDatePicker'
|
||||
|
||||
export default {
|
||||
name: 'AdvancedSearch',
|
||||
components: { JRangePicker, JTable },
|
||||
components: { JDatePicker, JTable },
|
||||
data () {
|
||||
return {
|
||||
FieldType,
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="label-col"><span class="search_label">{{ selectOptions[value].label }}</span></div>
|
||||
<div class="option-col">
|
||||
<div v-for="item in selectOptions[value].options" :key="item.itemValue" class="option-div" :class="selectOptions[value].current === item.itemValue ? 'option-curr' : ''" @click="selectOptionsChange(value, item.itemValue)">
|
||||
<span>{{ item.itemText }}<span v-if="item.statisticsCount || item.statisticsCount === 0">(<span class="option-span-num">{{ item.statisticsCount }}</span>)</span></span>
|
||||
<span>{{ isChinese() ? item.itemText : item.itemTextEnglish }}<span v-if="item.statisticsCount || item.statisticsCount === 0">(<span class="option-span-num">{{ item.statisticsCount }}</span>)</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -330,7 +330,11 @@ export default {
|
||||
if (res.result[item]) {
|
||||
// 通过key获取对应label
|
||||
const label = this.getLabelByKey(item)
|
||||
res.result[item].unshift({ itemText: this.$t('dashboard.generalSearch.all'), itemValue: 'all' })
|
||||
res.result[item].unshift({
|
||||
itemText: this.$t('dashboard.generalSearch.all'),
|
||||
itemTextEnglish: this.$t('dashboard.generalSearch.all'),
|
||||
itemValue: 'all'
|
||||
})
|
||||
this.selectOptions[item] = {
|
||||
options: res.result[item],
|
||||
label: label,
|
||||
|
||||
Reference in New Issue
Block a user