[update 首页] 翻译
This commit is contained in:
@@ -44,6 +44,12 @@ export default {
|
|||||||
type: Array,
|
type: Array,
|
||||||
required: false,
|
required: false,
|
||||||
default: () => []
|
default: () => []
|
||||||
|
},
|
||||||
|
// 是否返回区间,只选择一侧,另一侧会返回一个minDate或maxDate
|
||||||
|
returnInterval: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
@@ -112,7 +118,14 @@ export default {
|
|||||||
},
|
},
|
||||||
// 触发change事件
|
// 触发change事件
|
||||||
triggerChange () {
|
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) {
|
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">
|
<div class="search-wrapper">
|
||||||
<a-select class="resource-type-select" v-model="resourceType" size="large">
|
<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 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">
|
<a-select-option v-for="item in resourceTypeOptions" :key="item.value" :value="item.value" :title="isChinese() ? item.title : item.enText">
|
||||||
{{ item.title }}
|
{{ isChinese() ? item.title : item.enText }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
<a-input class="search-input" size="large" v-model="searchValue" :placeholder="$t('pleaseEnter')" @pressEnter="searchInputEnter">
|
<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"
|
<a-input :placeholder="$t('pleaseEnter')+item.dbFieldTxt"
|
||||||
v-model="queryParam[item.dbFieldName]"></a-input>
|
v-model="queryParam[item.dbFieldName]"></a-input>
|
||||||
</template>
|
</template>
|
||||||
<!-- 日期区间 -->
|
<!-- 日期区间(条款选择的日期只要单侧) -->
|
||||||
<template v-else-if="[FieldType.DATE_SINGLE.value, FieldType.DATE_MORE.value].includes(item.fieldShowType)">
|
<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"
|
format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||||
@change="onChange(item.dbFieldName)"></j-range-picker>
|
@change="onChange(item.dbFieldName)"></j-date-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>-->
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 字典单选框 -->
|
<!-- 字典单选框 -->
|
||||||
<template v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value">
|
<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 { ACCESS_TOKEN } from '../../../store/mutation-types'
|
||||||
import { previewPdf } from '../../../utils/previewPdf'
|
import { previewPdf } from '../../../utils/previewPdf'
|
||||||
import { kkFilePreview } from '../../../utils/kkFilePreview'
|
import { kkFilePreview } from '../../../utils/kkFilePreview'
|
||||||
import JRangePicker from '@comp/JDatePicker'
|
import JDatePicker from '@comp/JDatePicker'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AdvancedSearch',
|
name: 'AdvancedSearch',
|
||||||
components: { JRangePicker, JTable },
|
components: { JDatePicker, JTable },
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
FieldType,
|
FieldType,
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
<div class="label-col"><span class="search_label">{{ selectOptions[value].label }}</span></div>
|
<div class="label-col"><span class="search_label">{{ selectOptions[value].label }}</span></div>
|
||||||
<div class="option-col">
|
<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)">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -330,7 +330,11 @@ export default {
|
|||||||
if (res.result[item]) {
|
if (res.result[item]) {
|
||||||
// 通过key获取对应label
|
// 通过key获取对应label
|
||||||
const label = this.getLabelByKey(item)
|
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] = {
|
this.selectOptions[item] = {
|
||||||
options: res.result[item],
|
options: res.result[item],
|
||||||
label: label,
|
label: label,
|
||||||
|
|||||||
Reference in New Issue
Block a user