[update] 修改高级检索和三个标准的查询标准状态变多选,并且有默认值
This commit is contained in:
@@ -307,6 +307,14 @@ export default {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
// 默认的查询条件
|
||||
defaultSearchParams: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
// searchQueryList: {
|
||||
// type: Array,
|
||||
@@ -331,6 +339,9 @@ export default {
|
||||
optionsData: {} // 用接口获取到的下拉数据
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.queryParam = Object.assign({}, this.defaultSearchParams)
|
||||
},
|
||||
mounted () {
|
||||
this.getSysCategoryTree()
|
||||
this.getSearch()
|
||||
@@ -352,7 +363,8 @@ export default {
|
||||
eventBus.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
|
||||
},
|
||||
searchReset () {
|
||||
this.queryParam = {}
|
||||
this.queryParam = Object.assign({}, this.defaultSearchParams)
|
||||
console.log(this.defaultSearchParams, this.queryParam)
|
||||
this.$emit('reset', JSON.parse(JSON.stringify(this.queryParam)))
|
||||
eventBus.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
|
||||
},
|
||||
@@ -378,6 +390,9 @@ export default {
|
||||
this.getQueryConditionFunc(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.searchList = res.result
|
||||
// 标准状态特殊处理成多选
|
||||
const standardStateIndex = this.searchList.findIndex(item => item.dbFieldName === 'standard_state')
|
||||
this.searchList[standardStateIndex].fieldShowType = FieldType.OPTION_MORE.value
|
||||
this.getOptionsData() // 获取下拉数据
|
||||
console.log(this.searchList)
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@ export const ConfigurableTableMixin = {
|
||||
getTableHeaderFunc: null, // 获取表头的方法
|
||||
tableSlotField: [], // 表格需要使用插槽的字段,dbFieldName
|
||||
disabledMixinsCreate: false,
|
||||
isBackTitle: false // 是否是详情页有返回的标题
|
||||
isBackTitle: false, // 是否是详情页有返回的标题
|
||||
defaultSearchParams: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -81,6 +82,7 @@ export const ConfigurableTableMixin = {
|
||||
if (this.disabledMixinsCreate) {
|
||||
return
|
||||
}
|
||||
this.searchParams = Object.assign({}, this.defaultSearchParams)
|
||||
this.getTableHeader()
|
||||
this.loadData()
|
||||
// 过滤没有权限的按钮
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
<script>
|
||||
import { filterObj } from '@/utils/util'
|
||||
import { StandardSource, FieldType } from '@/enums/commonEnums'
|
||||
import { StandardSource, FieldType, EnterpriseStandardStatus, StandardStatus } from '@/enums/commonEnums'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { getFormDictTreeList, queryDepartTreeList } from '@/api/api'
|
||||
import {
|
||||
@@ -269,6 +269,7 @@ export default {
|
||||
this.getQueryConditionFunc = getDomesticStandardQuery
|
||||
this.getSearch()
|
||||
this.getSysCategoryTree()
|
||||
this.queryParam.standard_state = '6,7'
|
||||
},
|
||||
methods: {
|
||||
// 点击一般检索
|
||||
@@ -311,6 +312,11 @@ export default {
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
}
|
||||
if (value === StandardSource.ENTERPRISE.value) {
|
||||
this.queryParam.standard_state = `${EnterpriseStandardStatus.CURRENTLY_EFFECTIVE.value},${EnterpriseStandardStatus.TRIAL_OPERATION.value},${EnterpriseStandardStatus.RELEASE.value}`
|
||||
} else {
|
||||
this.queryParam.standard_state = `${StandardStatus.CURRENTLY_EFFECTIVE.value},${StandardStatus.RELEASE.value}`
|
||||
}
|
||||
},
|
||||
onChange (item) {
|
||||
if (this.queryParam[item] && this.queryParam[item].length > 0) {
|
||||
@@ -344,6 +350,9 @@ export default {
|
||||
this.getQueryConditionFunc(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.searchList = res.result
|
||||
// 标准状态特殊处理成多选
|
||||
const standardStateIndex = this.searchList.findIndex(item => item.dbFieldName === 'standard_state')
|
||||
this.searchList[standardStateIndex].fieldShowType = FieldType.OPTION_MORE.value
|
||||
this.getOptionsData() // 获取下拉数据
|
||||
}
|
||||
}).finally(() => {
|
||||
@@ -438,6 +447,11 @@ export default {
|
||||
// 重置
|
||||
searchReset () {
|
||||
this.queryParam = {}
|
||||
if (this.currStandardType === StandardSource.ENTERPRISE.value) {
|
||||
this.queryParam.standard_state = `${EnterpriseStandardStatus.CURRENTLY_EFFECTIVE.value},${EnterpriseStandardStatus.TRIAL_OPERATION.value},${EnterpriseStandardStatus.RELEASE.value}`
|
||||
} else {
|
||||
this.queryParam.standard_state = `${StandardStatus.CURRENTLY_EFFECTIVE.value},${StandardStatus.RELEASE.value}`
|
||||
}
|
||||
this.dataSource = []
|
||||
this.ipagination.total = 0
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
<search ref="searchRef"
|
||||
:flag="flag"
|
||||
:get-query-condition-func="getQueryConditionFunc"
|
||||
:default-search-params="defaultSearchParams"
|
||||
search-has="enterpriseStandard:search"
|
||||
@search="searchQuery"
|
||||
@reset="searchReset" />
|
||||
@@ -229,7 +230,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { StandardSystemTreeNodeType } from '@/enums/commonEnums'
|
||||
import { StandardSystemTreeNodeType, EnterpriseStandardStatus } from '@/enums/commonEnums'
|
||||
import JTable from '@/components/jero/JTable'
|
||||
// 搜索组件
|
||||
import Search from '@/components/customField/Search'
|
||||
@@ -261,7 +262,6 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { previewPdf } from '@/utils/previewPdf'
|
||||
import { kkFilePreview } from '@/utils/kkFilePreview'
|
||||
import { getFileInfo } from '@api/api'
|
||||
import { OperationType, StandardSource } from '../../../enums/commonEnums'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
@@ -325,7 +325,10 @@ export default {
|
||||
},
|
||||
showAction: true, // 是否显示操作列
|
||||
currentShare: {},
|
||||
expandedKeys: [] // 体系展开的节点
|
||||
expandedKeys: [], // 体系展开的节点
|
||||
defaultSearchParams: {
|
||||
standard_state: `${EnterpriseStandardStatus.CURRENTLY_EFFECTIVE.value},${EnterpriseStandardStatus.TRIAL_OPERATION.value},${EnterpriseStandardStatus.RELEASE.value}`
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@@ -433,9 +436,9 @@ export default {
|
||||
/**
|
||||
* 重置查询
|
||||
*/
|
||||
searchReset () {
|
||||
searchReset (params) {
|
||||
this.currentTreeNode = null
|
||||
this.searchParams = {}
|
||||
this.searchParams = Object.assign({}, params)
|
||||
this.selectedRowKeys = []
|
||||
delete this.filters.nodeCode
|
||||
this.getTableHeader()
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
<search ref="searchRef"
|
||||
:url="url"
|
||||
:get-query-condition-func="getQueryConditionFunc"
|
||||
:defaultSearchParams="defaultSearchParams"
|
||||
search-has="domesticStandard:search"
|
||||
@search="searchQuery"
|
||||
@reset="searchReset" />
|
||||
@@ -261,7 +262,13 @@ import {
|
||||
collectionDomesticStandard,
|
||||
cancelCollectionDomesticStandard
|
||||
} from '../../../api/standardRegulationLibraryApi'
|
||||
import { OperationType, StandardSource, StandardSystemTreeNodeType, YesOrNoEnum } from '../../../enums/commonEnums'
|
||||
import {
|
||||
OperationType,
|
||||
StandardSource,
|
||||
StandardStatus,
|
||||
StandardSystemTreeNodeType,
|
||||
YesOrNoEnum
|
||||
} from '../../../enums/commonEnums'
|
||||
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
|
||||
import DomesticSystemTreeModal from './modules/DomesticSystemTreeModal.vue'
|
||||
import SelectionDomesticStandardDrawer from './modules/SelectionDomesticStandardDrawer.vue'
|
||||
@@ -342,7 +349,10 @@ export default {
|
||||
treeLoading: false,
|
||||
isCollection: false,
|
||||
expandedKeys: [], // 展开的节点
|
||||
needFilterTableBtn: true
|
||||
needFilterTableBtn: true,
|
||||
defaultSearchParams: {
|
||||
standard_state: `${StandardStatus.CURRENTLY_EFFECTIVE.value},${StandardStatus.RELEASE.value}`
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -713,8 +723,8 @@ export default {
|
||||
/**
|
||||
* 重置查询
|
||||
*/
|
||||
searchReset () {
|
||||
this.searchParams = {}
|
||||
searchReset (params) {
|
||||
this.searchParams = Object.assign({}, params)
|
||||
this.selectedRowKeys = []
|
||||
this.selectedTreeKeys = []
|
||||
delete this.filters.nodeCode
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
<search ref="searchRef"
|
||||
:url="url"
|
||||
:get-query-condition-func="getQueryConditionFunc"
|
||||
:default-search-params="defaultSearchParams"
|
||||
search-has="overseasStandard:search"
|
||||
@search="searchQuery"
|
||||
@reset="searchReset" />
|
||||
@@ -260,7 +261,13 @@ import {
|
||||
getOverseasStandardForm,
|
||||
getOverseasStandardDocumentInfo
|
||||
} from '../../../api/standardRegulationLibraryApi'
|
||||
import { OperationType, StandardSource, StandardSystemTreeNodeType, YesOrNoEnum } from '../../../enums/commonEnums'
|
||||
import {
|
||||
OperationType,
|
||||
StandardSource,
|
||||
StandardStatus,
|
||||
StandardSystemTreeNodeType,
|
||||
YesOrNoEnum
|
||||
} from '../../../enums/commonEnums'
|
||||
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
|
||||
import OverseasStandardModal from './modules/OverseasStandardModal.vue'
|
||||
import OverseasSystemTreeModal from './modules/OverseasSystemTreeModal.vue'
|
||||
@@ -342,7 +349,10 @@ export default {
|
||||
tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段
|
||||
treeLoading: false,
|
||||
isCollection: false,
|
||||
expandedKeys: []
|
||||
expandedKeys: [],
|
||||
defaultSearchParams: {
|
||||
standard_state: `${StandardStatus.CURRENTLY_EFFECTIVE.value},${StandardStatus.RELEASE.value}`
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -714,8 +724,8 @@ export default {
|
||||
/**
|
||||
* 重置查询
|
||||
*/
|
||||
searchReset () {
|
||||
this.searchParams = {}
|
||||
searchReset (params) {
|
||||
this.searchParams = Object.assign({}, params)
|
||||
this.selectedRowKeys = []
|
||||
this.selectedTreeKeys = []
|
||||
delete this.filters.nodeCode
|
||||
|
||||
Reference in New Issue
Block a user