对接高级查询

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