From 91e21e0a90474f2161a41a14adf58385a99a6885 Mon Sep 17 00:00:00 2001 From: admin <1628672303@qq.com> Date: Wed, 26 Apr 2023 17:06:34 +0800 Subject: [PATCH] 4-26 --- .../src/views/tablex/TablexList.vue | 75 ++++++++++++++++--- 1 file changed, 66 insertions(+), 9 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/tablex/TablexList.vue b/ant-design-vue-jeecg/src/views/tablex/TablexList.vue index d7667d2..72649f0 100644 --- a/ant-design-vue-jeecg/src/views/tablex/TablexList.vue +++ b/ant-design-vue-jeecg/src/views/tablex/TablexList.vue @@ -121,6 +121,8 @@ import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import JEllipsis from '@/components/jeecg/JEllipsis' import FieldxList from "@/views/fieldx/FieldxList"; + import {getAction} from "@api/manage"; + import {filterObj} from "@/utils/util"; export default { name: 'TablexList', @@ -239,9 +241,9 @@ } }, created() { - this.loadParameter(); + // this.loadParameter(); this.getSuperFieldList(); - this.loadData(); + // this.loadData(); }, computed: { importExcelUrl: function(){ @@ -254,12 +256,12 @@ this.$refs.FieldxList.edit(record); this.$refs.FieldxList.disableSubmit = false; }, - loadParameter() { - this.queryParam.moduleId = this.$route.query.moduleid; - // console.log("***********想看看") - this.loadRouteType = true; - this.loadData(); - }, + // loadParameter() { + // this.queryParam.moduleId = this.$route.query.moduleid; + // // console.log("***********想看看") + // this.loadRouteType = true; + // this.loadData(); + // }, initDictConfig(){ }, getSuperFieldList(){ @@ -273,7 +275,62 @@ 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.id = this.$route.query.moduleid; + // 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.moduleId = this.$route.query.moduleid; + return filterObj(param); + }, + searchReset() { + this.queryParam='' + this.loadData(); + }, } }