对接高级查询

This commit is contained in:
qq787203167
2022-05-23 16:05:04 +08:00
parent d59a93ade1
commit 8e90efefa0
5 changed files with 104 additions and 22 deletions
@@ -159,7 +159,10 @@
loading: false,
pageNo: 1,
pageSize: 10,
total: 0
total: 0,
fieldList: [],
queryParamQuery: {},
queryConditionVOList: [],
}
},
mounted() {
@@ -170,7 +173,9 @@
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
this.queryConditionVOList = []
this.replacePage()
this.queryConditionInventory()
},
searchQuery() {
this.pageNo = 1
@@ -179,6 +184,9 @@
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.resetLine()
this.$refs.globalAdvancedQueryRef.emitCallback()
this.replacePage()
},
onChange(page, pageSize) {
@@ -194,7 +202,8 @@
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam
...this.queryParam,
queryConditionVOList: this.queryConditionVOList,
}
this.loading = true
postAction(this.url.addModelList, query).then((res) => {
@@ -203,10 +212,24 @@
this.total = res.result.total
this.loading = false
} else {
this.dataList = []
this.total = 0
this.loading = false
}
})
},
queryConditionInventory() {
let query = {
flag: 1
}
getAction(this.url.queryConditionInventory, query).then((res) => {
if (res.success) {
this.fieldList = res.result || []
} else {
this.fieldList = []
}
})
},
onSelectChange(value) {
this.selectedRowKeys = value
},
@@ -240,16 +263,17 @@
handleSuperQuery(params, matchType) {
let sqp = {}
if (!params || (params && params.length == 0)) {
sqp['superQueryParams'] = ''
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.superQueryFlag = false
} else {
this.$refs.globalAdvancedQueryRef.superQueryFlag = true
sqp['superQueryParams'] = encodeURI(JSON.stringify(params))
sqp['superQueryMatchType'] = matchType
this.queryConditionVOList = params
this.queryConditionVOList.forEach(res=>{
res.type = matchType
})
}
this.queryParamQuery = sqp
this.getList()
},
this.replacePage()
}
}
}
</script>
@@ -264,7 +288,7 @@
position: absolute;
bottom: 0;
width: 100%;
z-index:100;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
@@ -260,7 +260,8 @@
}
],
url: {
addModelList: '/project/projectLawsInventoryEO/queryPageInfoBussDocument',
addModelList: '/dummy/dummyInventoryInfoEO/queryPageDummy',
queryConditionInventory:'/dummy/dummyInventoryInfoEO/queryConditionInventory',
list: '/dummy/dummyInventoryInfoEO/list',
addModel: '/dummy/dummyInventoryInfoEO/add',
editModel: '/dummy/dummyInventoryInfoEO/edit',
@@ -30,6 +30,12 @@
{{ $t('delete') }}
</a>
</span>
<span slot="operationFile" slot-scope="text,record">
<a @click="viewFileClick(text)" v-if="text">
{{$t('viewFile')}}
</a>
<span v-else>--</span>
</span>
</a-table>
<div class="page" v-if="dataList.length > 0">
<a-pagination
@@ -51,6 +57,7 @@
</a-drawer>
<certificationDirectoryAdd @certificationDirectoryList="certificationDirectoryList"
ref="certificationDirectoryAddRef"/>
<viewFileModel ref="viewFileModelRef"/>
</div>
</template>
@@ -58,11 +65,13 @@
<script>
import { getAction, postAction, deleteAction } from '@/api/manage'
import certificationDirectoryAdd from './certificationDirectoryAdd'
import viewFileModel from '@/components/viewFileModel/index'
export default {
name: 'certificationDirectory',
components: {
certificationDirectoryAdd
certificationDirectoryAdd,
viewFileModel
},
data() {
return {
@@ -87,13 +96,15 @@
title: this.$t('catalogFile'),
dataIndex: 'directoryFile',
align: 'center',
ellipsis: true
ellipsis: true,
scopedSlots: { customRender: 'operationFile' }
},
{
title: this.$t('testScheme'),
dataIndex: 'experimentFile',
align: 'center',
ellipsis: true
ellipsis: true,
scopedSlots: { customRender: 'operationFile' }
},
{
title: this.$t('testReportLocation'),
@@ -164,7 +175,7 @@
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
projectLibraryId:this.$route.query.id,
projectLibraryId: this.$route.query.id,
...this.queryParam
}
this.loading = true
@@ -209,6 +220,9 @@
certificationDirectoryList() {
this.pageNo = 1
this.replacePage()
},
viewFileClick(item) {
this.$refs.viewFileModelRef.clickButtonToUpload(item)
}
}
}
@@ -42,6 +42,9 @@
</a-col>
<span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
<globalAdvancedQuery ref="globalAdvancedQueryRef"
@handleSuperQuery="handleSuperQuery"
:fieldList="fieldList"/>
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
@@ -79,19 +82,19 @@
</template>
<script>
import currencySearch from '@/components/currencySearch/index'
import { getAction, postAction } from '@/api/manage'
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
export default {
name: 'listAddModel',
components: {
currencySearch
globalAdvancedQuery
},
props:['url'],
props: ['url'],
data() {
return {
visible: false,
queryParam:{},
queryParam: {},
confirmLoading: false,
selectedRowKeys: [],
columns: [
@@ -144,6 +147,8 @@
pageNo: 1,
pageSize: 10,
total: 0,
fieldList: [],
queryConditionVOList: []
}
},
mounted() {
@@ -154,7 +159,9 @@
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
this.queryConditionVOList = []
this.replacePage()
this.queryConditionInventory()
},
searchQuery() {
this.pageNo = 1
@@ -163,6 +170,9 @@
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.resetLine()
this.$refs.globalAdvancedQueryRef.emitCallback()
this.replacePage()
},
onChange(page, pageSize) {
@@ -178,7 +188,8 @@
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam
...this.queryParam,
queryConditionVOList: this.queryConditionVOList
}
this.loading = true
postAction(this.url.addModelList, query).then((res) => {
@@ -187,6 +198,8 @@
this.total = res.result.total
this.loading = false
} else {
this.dataList = []
this.total = 0
this.loading = false
}
})
@@ -201,7 +214,10 @@
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.confirmLoading = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
postAction(this.url.addModel, { ids: selectedRowKeys.join(','),projectLibraryId: this.$route.query.id }).then((res) => {
postAction(this.url.addModel, {
ids: selectedRowKeys.join(','),
projectLibraryId: this.$route.query.id
}).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
@@ -217,6 +233,32 @@
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
queryConditionInventory() {
let query = {
flag: 1
}
getAction(this.url.queryConditionInventory, query).then((res) => {
if (res.success) {
this.fieldList = res.result || []
} else {
this.fieldList = []
}
})
},
handleSuperQuery(params, matchType) {
let sqp = {}
if (!params || (params && params.length == 0)) {
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.superQueryFlag = false
} else {
this.$refs.globalAdvancedQueryRef.superQueryFlag = true
this.queryConditionVOList = params
this.queryConditionVOList.forEach(res => {
res.type = matchType
})
}
this.replacePage()
}
}
}
@@ -232,7 +274,7 @@
position: absolute;
bottom: 0;
width: 100%;
z-index:100;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
@@ -650,7 +650,8 @@
},
queryParam: {},
url: {
addModelList: '/project/projectLawsInventoryEO/queryPageInfoBussDocument',
addModelList: '/project/projectLawsInventoryEO/queryPageDummy',
queryConditionInventory:'/project/projectLawsInventoryEO/queryConditionInventory',
list: '/project/projectLawsInventoryEO/list',
addModel: 'project/projectLawsInventoryEO/add',
editModel: '/project/projectLawsInventoryEO/edit',