[add] 文档拆分模块

This commit is contained in:
lideqin
2023-08-15 18:20:08 +08:00
parent ff0570abd2
commit 74ac8c07d0
11 changed files with 929 additions and 132 deletions
+69 -63
View File
@@ -1,8 +1,8 @@
<template>
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8" v-for="(item,index) in searchList" :key="index" style="line-height: 48px">
<template v-if="index < 3">
<a-col :md="(24 / (minLength + 1))" :sm="(24 / minLength)" v-for="(item,index) in searchList" :key="index" style="line-height: 48px">
<template v-if="index < minLength">
<!-- 树形选择器 -->
<div class="box-title-text" v-if="item.field_show_type === FieldType.TREE.value">
<div class="title-text" :title="item.db_field_txt">
@@ -87,7 +87,7 @@
<!-- </div>-->
</template>
<template v-if="index >= 3 && toggleSearchStatus">
<template v-if="index >= minLength && toggleSearchStatus">
<div class="box-title-text" v-if="item.field_show_type === FieldType.TREE.value">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
@@ -165,14 +165,14 @@
</a-col>
<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" v-if="searchList.length > 3">
{{ !toggleSearchStatus ? $t('open') : $t('putAway') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</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" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
</a-col>
<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-col>
</span>
</a-row>
</a-form>
@@ -183,6 +183,7 @@ import { getAction } from '@/api/manage'
import JDictSelectTag from '../dict/JDictSelectTag'
import JMultiSelectTag from '../dict/JMultiSelectTag'
import { FieldType } from '../../enums/commonEnums'
import eventBus from '@/common/event'
export default {
name: 'Search',
@@ -198,12 +199,16 @@ export default {
type: String,
default: ''
},
searchQueryList: {
type: Array,
default: () => {
return []
}
minLength: {
type: Number,
default: 3
}
// searchQueryList: {
// type: Array,
// default: () => {
// return []
// }
// }
},
data () {
return {
@@ -230,20 +235,20 @@ export default {
field_show_type: '1',
tree: []
},
{
db_field_name: 'state',
db_field_txt: '状态',
dict_field: 'state',
field_show_type: '3',
tree: []
},
{
db_field_name: 'region',
db_field_txt: '适用地区',
dict_field: 'region',
field_show_type: '4',
tree: []
},
// {
// db_field_name: 'state',
// db_field_txt: '状态',
// dict_field: 'state',
// field_show_type: '3',
// tree: []
// },
// {
// db_field_name: 'region',
// db_field_txt: '适用地区',
// dict_field: 'region',
// field_show_type: '4',
// tree: []
// },
// {
// db_field_name: 'technology_territory',
// db_field_txt: '技术领域',
@@ -251,36 +256,36 @@ export default {
// field_show_type: '0',
// tree: []
// },
{
db_field_name: 'issue_time',
db_field_txt: '发布日期',
dict_field: '',
field_show_type: '5',
tree: []
},
{
db_field_name: 'xin1_che1_xing2_shi2_shi1_ri4_qi1',
db_field_txt: '新车型实施日期',
dict_field: '',
field_show_type: '5',
tree: []
},
{
db_field_name: 'implement_time',
db_field_txt: '在产车实施日期',
dict_field: '',
field_show_type: '5',
tree: []
}
// {
// db_field_name: 'issue_time',
// db_field_txt: '发布日期',
// dict_field: '',
// field_show_type: '5',
// tree: []
// },
// {
// db_field_name: 'xin1_che1_xing2_shi2_shi1_ri4_qi1',
// db_field_txt: '新车型实施日期',
// dict_field: '',
// field_show_type: '5',
// tree: []
// },
// {
// db_field_name: 'implement_time',
// db_field_txt: '在产车实施日期',
// dict_field: '',
// field_show_type: '5',
// tree: []
// }
]
},
methods: {
searchQuery () {
this.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
eventBus.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
},
searchReset () {
this.queryParam = {}
this.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
eventBus.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
},
// 获取查询条件列表
getSearch () {
@@ -290,20 +295,21 @@ export default {
getAction(this.url.getSearchList, params).then((res) => {
if (res.success) {
this.searchList = res.result
if (this.searchQueryList && this.searchQueryList.length > 0) {
for (let i = 0; i < this.searchList.length; i++) {
if (this.searchList[i].db_field_name === 'issue_time') {
this.searchList.splice(i, 1)
i--
}
// db_field_name 说明可以被代替位置??
if (this.searchList[i].db_field_name === 'title') {
const data = this.searchList[i + 1]
this.searchList[i + 1] = this.searchQueryList[0]
this.searchList.push(data)
}
}
}
// if (this.searchQueryList && this.searchQueryList.length > 0) {
// for (let i = 0; i < this.searchList.length; i++) {
// // 是要去掉这个字段的搜索??
// if (this.searchList[i].db_field_name === 'issue_time') {
// this.searchList.splice(i, 1)
// i--
// }
// // db_field_name 说明可以被代替位置??
// if (this.searchList[i].db_field_name === 'title') {
// const data = this.searchList[i + 1]
// this.searchList[i + 1] = this.searchQueryList[0]
// this.searchList.push(data)
// }
// }
// }
}
})
},