gaoshp
2024-10-09 a09f0991bab9791e0c4911dbe4077579bc7016f4
src/config/table.js
@@ -1,3 +1,9 @@
/*
 * @Date: 2024-03-23 09:49:06
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-03-27 22:16:52
 * @FilePath: /cps-web/src/config/table.js
 */
//数据表格配置
import tool from '@/utils/tool'
@@ -10,16 +16,16 @@
   parseData: function (res) {                              //数据分析
      return {
         data: res.data,            //分析无分页的数据字段结构
         rows: res.data.rows,      //分析行数据字段结构
         rows: res.data.records,      //分析行数据字段结构
         total: res.data.total,      //分析总数字段结构
         summary: res.data.summary,   //分析合计行字段结构
         msg: res.message,         //分析描述字段结构
         msg: res.msg,         //分析描述字段结构
         code: res.code            //分析状态字段结构
      }
   },
   request: {                     //请求规定字段
      page: 'page',               //规定当前分页字段
      pageSize: 'pageSize',         //规定一页条数字段
      page: 'current',               //规定当前分页字段
      pageSize: 'size',         //规定一页条数字段
      prop: 'prop',               //规定排序字段名字段
      order: 'order'               //规定排序规格字段
   },
@@ -30,11 +36,11 @@
    */
   columnSettingSave: function (tableName, column) {
      return new Promise((resolve) => {
         setTimeout(()=>{
         setTimeout(() => {
            //这里为了演示使用了session和setTimeout演示,开发时应用数据请求
            tool.session.set(tableName, column)
            resolve(true)
         },1000)
         }, 1000)
      })
   },
   /**
@@ -46,9 +52,9 @@
      return new Promise((resolve) => {
         //这里为了演示使用了session和setTimeout演示,开发时应用数据请求
         const userColumn = tool.session.get(tableName)
         if(userColumn){
         if (userColumn) {
            resolve(userColumn)
         }else{
         } else {
            resolve(column)
         }
      })
@@ -61,10 +67,10 @@
   columnSettingReset: function (tableName, column) {
      return new Promise((resolve) => {
         //这里为了演示使用了session和setTimeout演示,开发时应用数据请求
         setTimeout(()=>{
         setTimeout(() => {
            tool.session.remove(tableName)
            resolve(column)
         },1000)
         }, 1000)
      })
   }
}