From 60f39207ebbc04dcfeaf4be97e1befebf7caff2b Mon Sep 17 00:00:00 2001 From: mors <3067699729@qq.com> Date: Wed, 26 Apr 2023 16:58:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/modulex/ModulexList.vue | 66 ++++++++++++++++++- .../src/views/projectx/ProjectxList.vue | 10 +-- 2 files changed, 69 insertions(+), 7 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue b/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue index a5b893f..0698e68 100644 --- a/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue +++ b/ant-design-vue-jeecg/src/views/modulex/ModulexList.vue @@ -123,6 +123,7 @@ import ModulexModal from './modules/ModulexModal' import {getAction} from "@api/manage"; import BugxModal from "@views/modulex/modules/BugxModal"; import store from "@/store"; +import {filterObj} from "@/utils/util"; export default { name: 'ModulexList', @@ -303,6 +304,8 @@ export default { dictOptions: {}, superFieldList: [], userRole1: '', //管理员是1 其他是2 + projectIdx: '', + loadRouteType:false, } }, created() { @@ -426,8 +429,67 @@ export default { fieldList.push({type: 'int', value: 'verisonStatus', text: '版本状态', dictCode: ''}) fieldList.push({type: 'int', value: 'verison', text: '版本号', dictCode: ''}) this.superFieldList = fieldList - } - } + }, + loadParameter() { + if (this.loadRouteType === false) { + this.projectIdx = this.$route.query.moduleid; + // console.log('aaaaaaaaa',this.projectIdx) + // console.log("***********想看看") + this.loadRouteType = true; + } + }, + loadData(arg) { + if (!this.url.list) { + this.$message.error("请设置url.list属性!"); + return + } + //加载数据 若传入参数1则加载第一页的内容 + if (arg === 1) { + this.ipagination.current = 1; + } + this.loadParameter(); + var params = this.getQueryParams();//查询条件 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + this.dataSource = res.result.records || res.result; + if (res.result.total) { + this.ipagination.total = res.result.total; + } else { + this.ipagination.total = 0; + } + //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) + }, + getQueryParams() { + //获取查询条件 + let sqp = {} + if (this.superQueryParams) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters); + param.field = this.getQueryField(); + param.pageNo = this.ipagination.current; + param.pageSize = this.ipagination.pageSize; + //param.id=this.id; + param.projectId = this.$route.query.moduleid; + // console.log('paaaaaaaaaaaaaaaaaaaaa') + return filterObj(param); + }, + searchReset() { + this.queryParam='' + this.loadData(); + }, + + }, + }