vxe-grid 实现配置式form搜索条件 & form搜索条件框可折叠 & 配置式table
创始人
2025-01-07 10:33:18
0

文章目录

  • 效果图
  • 代码

效果图

效果图

代码

 

data定义

gridOptions: {   id: 'full_edit_1', //storage需要   keepSource: true,//编辑状态下的还原需要   border: true,   loading: false,   align: "center",   stripe: true,   printConfig: {},   exportConfig: {},   rowConfig: {     isHover: true//高亮显示   },   formConfig: {     titleWidth: 80,     titleAlign: 'right',     items: [],     data: {}   },   columnConfig: {     resizable: true //是否启用列宽调整   },   customConfig: {     storage: true, //是否启用 localStorage 本地保存     immediate: true,     showFooter: false   },   toolbarConfig: {     refresh: {queryMethod: this.handleQuery},     slots: {       buttons: 'toolbar_buttons'//自定义工具栏按钮     }   },   editConfig: {     trigger: 'dblclick',     enabled: true,     mode: 'row',     showStatus: true //只对 keep-source 开启有效,是否显示单元格新增与修改状态   },   sortConfig: {     trigger: 'cell',//触发方式     remote: true //所有列是否使用服务端排序,如果设置为 true 则不会对数据进行处理   },   filterConfig: {     remote: true   },   //右击菜单   menuConfig: {     body: {}   },   importConfig: {     remote: true,     importMethod: this.importMethod,     types: ['xlsx'],     modes: ['insert']   },   checkboxConfig: {     labelField: '',     reserve: true,     highlight: true,     range: true   },   //列   columns: [],   //较验规则   editRules: {},   data: [] } 
created() {    this.gridOptions.menuConfig.body = constant.menuConfig;    this.getColumns();//请求tableConfig配置项数据    this.priceJustStatic()  }, methods: {     getColumns() {       this.gridOptions.loading = true       getInfoByBusiCode("请求配置项数据").then(res => {         if (res.code === 200) {           this.gridOptions.columns = JSON.parse(res.data.columns);           this.gridOptions.formConfig.items = JSON.parse(res.data.formConfig);           this.gridOptions.editRules = JSON.parse(res.data.rules);           this.handleQuery();         } else {           this.gridOptions.loading = false;           this.$modal.msgError("获取表数据失败,请重试");         }       });     },     getList() { //获取table列表数据       this.gridOptions.loading = true       const params = {         pageNum: this.pageNum,         pageSize: this.pageSize,         form: this.gridOptions.formConfig.data //获取from搜索条件数据       }       getInfoList(params).then(res => {         this.gridOptions.loading = false;         if (res.code === 200) {           this.gridOptions.data = res.rows;           this.total = res.total;         }       })     }, 	 handleQuery() {       this.pageNum = 1;       this.getList();     }, } 
//from 配置 [{ 	"field": "pId", 	"title": "标题", 	"span": 8, 	"itemRender": {}, 	"slots": { 		"default": "pId" 	} }, { 	"field": "billCode", 	"title": "单据号", 	"span": 8, 	"itemRender": { 		"name": "VxeInput", 		"props": { 			"placeholder": "请输入单据号" 		} 	} }, { 	"field": "sType", 	"title": "标题", 	"span": 8, 	"folding": true, //开启折叠 	"itemRender": {}, 	"slots": { 		"default": "sType" 	} }, { 	"field": "Time", 	"title": "日期", 	"span": 12, 	"folding": true,//开启折叠 	"itemRender": {}, 	"slots": { 		"default": "Time" 	} }, { 	"span": 24, 	"align": "center", 	"collapseNode": true,//折叠终止 	"itemRender": {}, 	"slots": { 		"default": "fromButton" 	} }] 

在这里插入图片描述

//table 配置 [{ 	"type": "checkbox", 	"width": "50", 	"fixed": "left" }, { 	"type": "seq", 	"title": "序号", 	"visible": true, 	"width": "80" }, { 	"field": "id", 	"title": "ID", 	"visible": false, 	"width": "60", 	"fixed": "left" }, { 	"field": "remark", 	"title": "备注", 	"visible": true, 	"width": "80", 	"slots": { 		"default": "remark" 	} }, { 	"title": "操作", 	"width": "150", 	"fixed": "right", 	"slots": { 		"default": "operate" 	} }] 

相关内容

热门资讯

4分钟辅助!天天手游辅助工具,... 4分钟辅助!天天手游辅助工具,好像存在有辅助脚本(有挂秘诀)1、起透看视 天天手游辅助工具辅助软件价...
7分钟辅助!微乐小程序自建房辅... 7分钟辅助!微乐小程序自建房辅助,都是有辅助方法(有人有挂)1、玩家可以在微乐小程序自建房辅助线上大...
2分钟辅助!约局吧辅助器,本来... 2分钟辅助!约局吧辅助器,本来真的有辅助插件(的确有挂)1、约局吧辅助器破解器简单,约局吧辅助器机器...
三分钟辅助!微乐自建房辅助工具... 三分钟辅助!微乐自建房辅助工具,确实有辅助挂(存在有挂)1、很好的工具软件,可以解锁游戏的微乐自建房...
8分钟辅助!巴郎新疆开挂,一直... 8分钟辅助!巴郎新疆开挂,一直有辅助工具(有挂详情)1、巴郎新疆开挂透视辅助软件激活码多个强度级别选...
五分钟辅助!温州茶苑手机辅助器... 五分钟辅助!温州茶苑手机辅助器,好像真的有辅助软件(有挂技巧)1、每一步都需要思考,不同水平的挑战温...
两分钟辅助!白金岛手游的作弊码... 两分钟辅助!白金岛手游的作弊码,其实真的是有辅助挂(有挂细节)1、白金岛手游的作弊码免费辅助多个强度...
八分钟辅助!极速暗宝辅助,一贯... 八分钟辅助!极速暗宝辅助,一贯真的有辅助技巧(有挂神器)1、许多玩家不知道极速暗宝辅助辅助怎么退出观...
一分钟辅助!创乐源辅助软件,果... 一分钟辅助!创乐源辅助软件,果然有辅助工具(有挂讲解)1、一分钟辅助!创乐源辅助软件,果然有辅助工具...
8分钟辅助!微乐自建房辅助多少... 8分钟辅助!微乐自建房辅助多少钱一个月,真是真的是有辅助工具(有挂讲解)小薇(辅助器软件下载)致您一...