Karsa 1 год назад
Родитель
Сommit
7b5ffdc591

+ 1 - 0
index.html

@@ -75,6 +75,7 @@
 	<script type="text/javascript" src="./static/js/jquery.min.js"></script>
 	<script src="https://hzstatic.hzinsights.com/static/cdn/Luckysheet@2.1.13/dist/plugins/js/plugin.js"></script>
 	<script src="https://hzstatic.hzinsights.com/static/cdn/Luckysheet@2.1.13/dist/luckysheet.umd.js"></script>
+	<script src="https://hzstatic.hzinsights.com/static/cdn/luckyexcel.umd.js"></script>
 	<script type="text/javascript" src="./static/js/jquery.dataTables.js"></script>
 </body>
 </html>

+ 97 - 0
src/api/modules/sheetApi.js

@@ -254,4 +254,101 @@ export const insertData = params => {
  */
 export const getDateLatelyData = params => {
 	return http.get('/datamanage/edb_info/date_data/before_after',params)
+}
+
+
+/* =====自定义分析==== */
+
+export const sheetAnalysisInterface = {
+
+	/**
+	 * 移动表格
+	 * @param {*} params ExcelClassifyId ExcelInfoId PrevExcelInfoId NextExcelInfoId
+	 * @returns 
+	 */
+	sheetMove: params => {
+		return http.post('/datamanage/excel_info/move',params)
+	},
+	
+	/**
+	 * 新增表格
+	 * @param {*} params ExcelName ExcelClassifyId ExcelImage Content
+	 * @returns 
+	 */
+	excelSheetAdd: params => {
+		return http.post('/custom_analysis/add',params)
+	},
+
+	/**
+	 * 获取详情
+	 * @param {*} params UniqueCode
+	 * @returns 
+	 */
+	getExcelDetail: params => {
+		return http.get('/custom_analysis/excel/base',params)
+	},
+
+	/**
+	 * 分页加载celldata
+	 * @param {*} params  UniqueCode Page
+	 * @returns 
+	 */
+	getExcelDataByPage: params => {
+		return http.get('/custom_analysis/excel/data',params)
+	},
+
+	/**
+	 * 表格保存
+	 * @param {*} params ExcelName ExcelInfoId ExcelClassifyId ExcelImage Content
+	 */
+	sheetEdit: params => {
+		return http.post('/custom_analysis/save',params)
+	},
+
+	/**
+	 * 生成指标
+	 * @param {*} params  
+	 * EdbName ExcelInfoId ClassifyId Frequency Unit DateSequenceVal DataSequenceVal DateSequenceStr DataSequenceStr
+	 * @returns 
+	 */
+	edbAddBysheet: params => {
+		return http.post('/custom_analysis/edb/add',params)
+	},
+
+	/**
+	 * 指标编辑
+	 * @param {*} params 
+	 * EdbName ExcelInfoId EdbInfoId ClassifyId Frequency Unit DateSequenceVal DataSequenceVal
+	 * @returns 
+	 */
+	edbEditBysheet: params => {
+		return http.post('/custom_analysis/edb/edit',params)
+	},
+
+	/**
+	 * 获取表格生成的指标列表
+	 * @param {*} params ExcelInfoId
+	 * @returns 
+	 */
+	edbListBySheet: params => {
+		return http.get('/custom_analysis/edb/list',params)
+	},
+
+	/**
+	 * 刷新
+	 * @param {*} params ExcelInfoId
+	 * @returns 
+	 */
+	sheetRefresh: params => {
+		return http.get('/custom_analysis/edb/refresh',params)
+	},
+
+	/**
+	 * 检查是否有同名表格
+	 * @param {*} params  ExcelName
+	 * @returns 
+	 */
+	checkSheetRepeat: params => {
+		return http.get('/custom_analysis/excel_by_name',params)
+	}
 }

BIN
src/assets/img/home/loading.gif


BIN
src/assets/img/icons/jump_ico.png


+ 29 - 4
src/routes/modules/chartRoutes.js

@@ -83,7 +83,17 @@ export default [
 		children:[
 			{
 				path:"sheetList",
-				name:"ETA表格",
+				name:"在线Excel",
+				component:()=>import('@/views/datasheet_manage/sheetList.vue')
+			},
+			{
+				path:"sheetTimeList",
+				name:"时间序列表格",
+				component:()=>import('@/views/datasheet_manage/sheetList.vue')
+			},
+			{
+				path:"sheetMixedList",
+				name:"混合表格",
 				component:()=>import('@/views/datasheet_manage/sheetList.vue')
 			},
 			{
@@ -93,14 +103,29 @@ export default [
 			},
 			{
 				path:"addCustomSheet",
-				name:"添加表格",
+				name:"添加数据表格",
 				component:()=>import('@/views/datasheet_manage/customSheetEdit.vue')
 			},
 			{
 				path:"addMixedSheet",
-				name:"添加表格",
+				name:"添加混合表格",
 				component:()=>import('@/views/datasheet_manage/mixedSheetEdit.vue')
-			}
+			},
+			{
+				path:"sheetAnalysisList",
+				name:"自定义分析",
+				component:()=>import('@/views/datasheet_manage/customAnalysis/list.vue')
+			},
+			{
+				path:"addAnalysisSheet",
+				name:"上传文件",
+				component:()=>import('@/views/datasheet_manage/customAnalysis/addAnalysisSheet.vue')
+			},
+			{
+				path:"createTaregtBySheet",
+				name:"生成指标",
+				component:()=>import('@/views/datasheet_manage/customAnalysis/addAnalysisSheet.vue')
+			},
 		]
 	},
 

+ 28 - 8
src/utils/buttonConfig.js

@@ -337,10 +337,6 @@ export const myETAPermission = {
 */
 export const etaTablePermission = {
     /*-----------页面按钮--------- */
-    etaTable_customize:'etaTable:customize',//自定义表格这个按钮显示不显示
-    etaTable_excel:'etaTable:excel',//添加Excel表格这个按钮显示不显示
-    etaTable_classifyOpt_edit:'etaTable:classifyOpt:edit',//添加编辑表格
-    etaTable_classifyOpt_delete:'etaTable:classifyOpt:delete',//删除表格
 
     /*-----------自定义表格--------- */
     /* etaTable_customize_del:'etaTable:customize:del',
@@ -348,22 +344,46 @@ export const etaTablePermission = {
     etaTable_customize_otherSave:'etaTable:customize:otherSave',
     etaTable_customize_refresh:'etaTable:customize:refresh',
     etaTable_customize_edit:'etaTable:customize:edit', */
-    //混合表格
+
+    //混合表格页面
+    etaTable_customize_mix_sheetAdd: 'etaTable:customize:mix:sheetAdd',//添加混合表格按钮
+    etaTable_customize_mix_classifyOpt_edit: 'etaTable:customize:mix:classifyOpt:edit',//混合表格分类操作
+    etaTable_customize_mix_classifyOpt_delete: 'etaTable:customize:mix:classifyOpt:delete',//混合表格分类删除
     etaTable_customize_mix_edit:'etaTable:customize:mix:edit',//编辑
     etaTable_customize_mix_refresh:'etaTable:customize:mix:refresh',//刷新
     etaTable_customize_mix_otherSave:'etaTable:customize:mix:otherSave',//另存为
     etaTable_customize_mix_download:'etaTable:customize:mix:download',//下载
     etaTable_customize_mix_del:'etaTable:customize:mix:del',//删除
-    //数据表格
+
+    //数据表格页面
+    etaTable_customize_data_sheetAdd: 'etaTable:customize:data:sheetAdd',//添加数据表格按钮
+    etaTable_customize_data_classifyOpt_edit: 'etaTable:customize:data:classifyOpt:edit',//数据表格分类操作
+    etaTable_customize_data_classifyOpt_delete: 'etaTable:customize:data:classifyOpt:delete',//数据表格分类删除
     etaTable_customize_data_edit:'etaTable:customize:data:edit',//编辑
     etaTable_customize_data_refresh:'etaTable:customize:data:refresh',//刷新
     etaTable_customize_data_otherSave:'etaTable:customize:data:otherSave',//另存为
     etaTable_customize_data_download:'etaTable:customize:data:download',//下载
     etaTable_customize_data_del:'etaTable:customize:data:del',//删除
-    /*-----------常规表格--------- */
+
+    /*-----------excel表格页面--------- */
+    etaTable_excel:'etaTable:excel',//添加Excel表格这个按钮显示不显示
+    etaTable_excel_classifyOpt_edit:'etaTable:excel:classifyOpt:edit',//添加编辑表格
+    etaTable_excel_classifyOpt_delete:'etaTable:excel:classifyOpt:delete',//删除表格
     etaTable_excel_del:'etaTable:excel:del',
     etaTable_excel_download:'etaTable:excel:download',
-    etaTable_excel_save:'etaTable:excel:save'
+    etaTable_excel_save:'etaTable:excel:save',
+
+    //自定义分析表格页面
+    // etaTable_analysis_sheetAdd: 'etaTable:analysis:sheetAdd',//添加数据表格按钮
+    etaTable_analysis_classifyOpt_edit: 'etaTable:analysis:classifyOpt:edit',//数据表格分类操作
+    etaTable_analysis_classifyOpt_delete: 'etaTable:analysis:classifyOpt:delete',//数据表格分类删除
+    etaTable_analysis_upload:'etaTable:analysis:upload',//上传文件
+    etaTable_analysis_createedb:'etaTable:analysis:createedb',//生成指标
+    etaTable_analysis_refresh:'etaTable:analysis:refresh',//刷新
+    etaTable_analysis_otherSave:'etaTable:analysis:otherSave',//另存为
+    etaTable_analysis_download:'etaTable:analysis:download',//下载
+    etaTable_analysis_del:'etaTable:analysis:del',//删除
+    etaTable_analysis_save:'etaTable:analysis:save',//保存
 }
 /*
  * --------------------------------------------------------------------------ETA逻辑------------------------------------------------

+ 2 - 0
src/utils/icon.js

@@ -65,4 +65,6 @@ export default {
 	no_view: require('@/assets/img/icons/no_view.png'),
 	/* 中英文切换 */
 	to_en: require('@/assets/img/icons/toEn.png'),
+	/* 跳转icon */
+	jupm_icon: require('@/assets/img/icons/jump_ico.png')
 }

+ 1 - 1
src/views/Home.vue

@@ -286,7 +286,7 @@
               :style="!isHaveAside ? 'padding: 0 30px 0 0;' : ''"
             >
               <transition name="fade" mode="out-in">
-                <router-view></router-view>
+                <router-view :key="$route.fullPath"></router-view>
               </transition>
             </el-col>
           </el-row>

+ 4 - 3
src/views/dataEntry_manage/databaseList.vue

@@ -141,7 +141,7 @@
 								/>
 								<!-- 查看计算指标 -->
 								<i class="el-icon-view" 
-									v-if="data.EdbType===2&&![58,59,67,68].includes(data.Source)&&isEdbBtnShow('checkCalcChart')" 
+									v-if="data.EdbType===2&&![58,59,67,68,74].includes(data.Source)&&isEdbBtnShow('checkCalcChart')" 
 									@click.stop="viewNode(node,data)"></i>
 								<!-- 查看关联图表 -->
 								<img 
@@ -1180,8 +1180,9 @@ export default {
 			// console.log(node);
 			this.dialog_title = '编辑';
 			if(data.EdbCode) {
-				/* 编辑指标 */
-				(data.EdbType===1 || [58,59,67,68].includes(data.Source)) && dataBaseInterface.targetDetail({
+				/* 编辑指标 基础弹窗 */
+				
+				(data.EdbType===1 || [58,59,67,68,74].includes(data.Source)) && dataBaseInterface.targetDetail({
 					EdbInfoId: data.EdbInfoId
 				}).then(res => {
 					if(res.Ret === 200) {

+ 33 - 23
src/views/datasheet_manage/common/option.js

@@ -1,11 +1,10 @@
 
 /*  初始化  
-  options 用来初始化数据用 
-  data 初始化数据 [{celldata}]
+  options 其他配置 包括初始化数据 data:[{ celldata:[] }]
   sheetInfo 表格id相关信息 用来内容hooks变化时保存草稿
 */
 import * as sheetInterface from '@/api/modules/sheetApi.js';
-export const initSheet = (container,options={},sheetInfo={}) =>  {
+export function initSheet(container,options={},sheetInfo={}) {
   const configOpt = {
     container,
     lang: 'zh', // 设定表格语言
@@ -22,24 +21,23 @@ export const initSheet = (container,options={},sheetInfo={}) =>  {
       image: false, // 插入图片
       link: false, // 插入链接
     },
-    data: [{
-      ...options,
-      scrollTop: 0,
-      scrollLeft: 0
-    }],
     hook: {
       updated: (a,b,c,d,e)=> {
-        let data = luckysheet.getAllSheets()[0];
-        data.luckysheet_select_save = [];
-        const { ExcelInfoId,ExcelName,ExcelClassifyId } = sheetInfo;
-        ExcelInfoId && sheetInterface.sheetDrafSave({
-          ExcelInfoId,
-          ExcelName,
-          ExcelClassifyId,
-          Content: JSON.stringify(data)
-        })
+
+        if(sheetInfo.Source&&sheetInfo.Source===1) {
+          let data = luckysheet.getAllSheets()[0];
+          data.luckysheet_select_save = [];
+          const { ExcelInfoId,ExcelName,ExcelClassifyId } = sheetInfo;
+          ExcelInfoId && sheetInterface.sheetDrafSave({
+            ExcelInfoId,
+            ExcelName,
+            ExcelClassifyId,
+            Content: JSON.stringify(data)
+          })
+        }
       }
-    }
+    },
+    ...options
   }
 
   luckysheet.create(configOpt)
@@ -49,12 +47,24 @@ export const initSheet = (container,options={},sheetInfo={}) =>  {
 /* 保存表格关联截图 手动选区截图再清空选区 */
 export const getSheetImage = (data) => {
   const { celldata } = data;
-  
-  const r_arr = celldata.map(_ => _.c);
-  let r_start = celldata[0].r,
-    r_end = celldata[celldata.length-1].r,
-    c_start = Math.min(...r_arr),
+
+  //超过1000个就不遍历了
+  let r_start,r_end,c_start,c_end;
+  if(celldata.length > 1000) {
+    const splitData = celldata.slice(0,1000);
+    const r_arr = splitData.map(_ => _.c);
+    r_start = splitData[0].r;
+    r_end = splitData[splitData.length-1].r;
+    c_start = Math.min(...r_arr);
     c_end = Math.max(...r_arr);
+
+  }else {
+    const r_arr = celldata.map(_ => _.c);
+    r_start = celldata[0].r;
+    r_end = celldata[celldata.length-1].r;
+    c_start = Math.min(...r_arr);
+    c_end = Math.max(...r_arr);
+  }
   
   luckysheet.setRangeShow({row:[r_start,r_end],column:[c_start,c_end]},{show: false})
   let img = luckysheet.getScreenshot()

+ 3 - 13
src/views/datasheet_manage/components/SheetExcel.vue

@@ -8,7 +8,7 @@ import { initSheet } from '../common/option';
 export default {
   props: {
     option: {
-      type: String,
+      type: Object,
       default: ''
     },
     sheetInfo: {
@@ -16,25 +16,15 @@ export default {
       default: ()=>{}
     }
   },
-  // watch: {
-  //   option: {
-  //     handler(newval) {
-  //       console.log(newval)
-  //       this.optionData = newval ? JSON.parse(newval) : {}
-  //       this.init();
-  //     },
-  //     deep:true
-  //   }
-  // },
   data() {
     return {
-      // optionData: {},
       sheetObj: {}
     }
   },
   methods: {
     init() {
-      let optionData = this.option ? JSON.parse(this.option) : {};
+      let optionData = this.option ? this.option : {};
+
       initSheet('sheet-container',optionData,this.sheetInfo)
     }
   },

+ 1 - 1
src/views/datasheet_manage/components/selectTargetValueDia.vue

@@ -107,7 +107,7 @@ export default {
 }
 </script>
 <style scoped lang='scss'>
-@import "../../../styles/theme-vars.scss";
+@import "~@/styles/theme-vars.scss";
 .select-target-value-dia {
   background: #fff;
   position: fixed;

+ 6 - 2
src/views/datasheet_manage/components/sheetClassifyDia.vue

@@ -1,3 +1,4 @@
+<!-- 通用二级分类的弹窗 -->
 <template>
 	<div class="sheet-classify-dialog">
 		<el-dialog
@@ -81,6 +82,9 @@ export default {
       
 			const handleMap = {
 				'/sheetList': this.sheetClassifyApi,
+				'/sheetTimeList': this.sheetClassifyApi,
+				'/sheetMixedList': this.sheetClassifyApi,
+				'/sheetAnalysisList': this.sheetClassifyApi,
 				'/commordityChartBase': this.commodityClassifyApi,
 				'/chartrelevance':this.relevanceClassifyApi,
 				'/fittingEquationList': this.fittingEquationClassifyApi,
@@ -92,8 +96,8 @@ export default {
 		/* 表格分类接口 */
 		async sheetClassifyApi(classify_name,classify_id) {
 			const { Ret,Msg } = !classify_id
-        ? await sheetInterface.classifyAdd({ ExcelClassifyName:classify_name })
-        : await sheetInterface.classifyEdit({ ExcelClassifyName:classify_name, ExcelClassifyId:classify_id  })
+        ? await sheetInterface.classifyAdd({ ExcelClassifyName:classify_name,Source: this.$parent.sourceMap[this.$route.path] })
+        : await sheetInterface.classifyEdit({ ExcelClassifyName:classify_name, ExcelClassifyId:classify_id,Source: this.$parent.sourceMap[this.$route.path] })
         
       if( Ret !== 200) return
       this.$message.success(Msg);

+ 119 - 0
src/views/datasheet_manage/components/sheetListWrap.vue

@@ -0,0 +1,119 @@
+<template>
+  <div class="sheet-list-cont">
+    <span>共{{ total }}张表格</span>
+    <div class="sheetlist-wrapper" ref="listRef" @scroll="$emit('loadMoreHandle')">
+      <el-col
+        :span="6"
+        style="margin-bottom: 20px; padding-right: 20px"
+        v-for="cell in list"
+        :key="cell.ExcelInfoId"
+      >
+        <el-card class="sheet-item">
+          <div slot="header" class="item-top">
+            <span class="text_oneLine">{{ cell.ExcelName }}</span>
+          </div>
+          <img
+            :src="cell.ExcelImage"
+            alt=""
+            class="chart-img"
+            :height="imgHeight"
+            @click="$emit('detailShowHandle',cell)"
+          />
+          <div class="item-bottom">
+            <span>创建时间: {{ cell.CreateTime.slice(0, 10) }}</span>
+            <div>
+              <span
+                v-if="$parent.isSheetBtnShow('download')"
+                class="editsty"
+                style="margin-right: 10px"
+                @click="$emit('downloadExcel',cell)"
+                >下载</span
+              >
+              <span
+                v-if="$parent.isSheetBtnShow('del')"
+                class="deletesty"
+                @click="$emit('delSheetHandle',{cell, type:'del-list'})"
+                >删除</span
+              >
+            </div>
+          </div>
+        </el-card>
+      </el-col>
+    </div>
+    <div v-if="!total" class="nodata">
+      <tableNoData text="暂无表格"/>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  props: ['total','list'],
+  data() {
+    return {
+    }
+  },
+  mounted(){
+
+  },
+}
+</script>
+<style scoped lang='scss'>
+  .sheet-list-cont {
+    color: #333;
+    .el-card .el-card__header,
+    .el-card__body {
+      padding: 10px;
+    }
+
+    .sheetlist-wrapper {
+      margin-top: 10px;
+      display: flex;
+      flex-wrap: wrap;
+      max-height: calc(100vh - 143px);
+      overflow: hidden;
+      overflow-y: auto;
+      .drag-cont {
+        width: 100%;
+        display: flex;
+        flex-wrap: wrap;
+      }
+      .dragShdow {
+        box-shadow: 0 1px 8px rgba(64, 158, 255, 0.8);
+        opacity: 0.5;
+      }
+      .sheet-item {
+        .item-top {
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          font-size: 16px;
+          font-weight: 600;
+        }
+        .chart-img {
+          width: 100%;
+          height: 196px;
+          object-fit: contain !important;
+          cursor: pointer;
+        }
+        .item-bottom {
+          margin-top: 10px;
+          display: flex;
+          justify-content: space-between;
+          font-size: 12px;
+          color: #666;
+          .collected {
+            color: #f00;
+            cursor: pointer;
+          }
+          .join_txt {
+            color: #409eff;
+            cursor: pointer;
+          }
+        }
+      }
+    }
+    .nodata {
+      text-align: center;
+    }
+  }
+</style>

+ 505 - 0
src/views/datasheet_manage/customAnalysis/addAnalysisSheet.vue

@@ -0,0 +1,505 @@
+<template>
+  <div class="addSheet-wrap">
+    
+    <createTargetForm 
+      v-if="$route.path==='/createTaregtBySheet'"
+      ref="createTargetRef" 
+      @save="handleCreateTarget" 
+    />
+
+
+    <div class="main">
+      <div class="left-section">
+        <el-tabs 
+          v-model="selectIndex" 
+          type="card"
+        >
+          <el-tab-pane
+            :key="item.name"
+            v-for="(item,index) in uploadSheetsList"
+            :label="item.name"
+            :name="String(index)"
+          />
+        </el-tabs>
+        <div class="sheet-wrapper">
+          <Sheet ref="sheetRef" :option="sheetConfig" v-if="sheetConfig.data"/>
+
+          <dataLoading :loading="isLoading"/>
+        </div>
+
+      </div>
+
+      <!-- 指标列表 -->
+      <rightSection 
+        ref="edbWrapRef"
+        v-if="$route.path==='/createTaregtBySheet'"
+        :list="edbList"
+        @choose="chooseEdbHandle"
+      />
+    </div>
+
+
+    <!-- 上传文件 -->
+    <bottomSection
+      ref="bottomSecRef"
+      v-if="$route.path==='/addAnalysisSheet'" 
+      :sheetList="sheetConfig.data||[]"
+      :classifyArr="classifyArr"
+      @save="handleAddSheet"
+    />
+
+  </div>
+</template>
+
+<script>
+import * as sheetInterface from '@/api/modules/sheetApi.js';
+import Sheet from '../components/SheetExcel.vue';
+import { getSheetImage } from '../common/option';
+import bottomSection from './components/bottomSection.vue'
+import rightSection from './components/rightSection.vue';
+import createTargetForm from './components/createTargetForm.vue';
+export default {
+  components: { Sheet,bottomSection,rightSection,createTargetForm },
+  computed: {
+    files() {
+      return this.$store.state.sheet.files;
+    },
+    sheetConfig() {
+      return this.$route.path==='/createTaregtBySheet' 
+        ? {
+            showsheetbar: true,
+            // allowCopy:false,
+            // allowEdit:false,
+            // allowUpdate:false,
+            // enableAddRow:false,
+            data: null,
+            hook: {
+              //选区时
+              rangeSelect: (sheet,range) => {
+                if(this.$refs.createTargetRef && this.$refs.createTargetRef.selectArea && !this.$refs.createTargetRef.isLockUpdate) this.getRangeCell()
+              },
+            }
+          } 
+        : {
+            showsheetbar: true,
+            data: null
+          }
+    },
+  },
+  data() {
+    return {
+      isLoading: false,
+      uploadSheetsList: [],
+      pageSize: 2000,
+      currentPage: 0,
+      maxPage:0,
+
+      selectIndex: '0',
+      classifyArr: [],
+
+      sheetDetailInfo: {},
+      sheetDataPage: 2,
+      sheetAllcellData:[],//全部单元格数据 分页push
+      dataToalPage: 0,
+
+      edbList: [],//生成的指标列表
+    }
+  },
+  methods: {
+
+    backHandle(scence=null) {
+      if(scence === 'into-detail') {
+        const { ExcelInfoId, UniqueCode } = this.sheetDetailInfo;
+        
+        this.$router.replace({
+          path: '/sheetAnalysisList',
+          query: {
+            code: UniqueCode,
+            id: ExcelInfoId
+          }
+        })
+      }else {
+        this.$router.go(-1);
+      }
+
+    },
+
+    /* 切换表格 */
+    handleSwitchSheet() {
+      this.sheetConfig.data = null;
+      this.handelTranslateData(); 
+    },
+
+    /* 获取分类 */
+    getClassify() {
+      sheetInterface.excelClassifyOne({Source: 4}).then(res => {
+        if(res.Ret !==200) return
+        
+        this.classifyArr = res.Data.AllNodes || [];
+      })
+    },
+
+    loadDataSync() {
+      let len = this.sheetConfig.data.length;
+      for(let i =0;i<len;i++) {
+        if(this.allSheetData[i].celldata[this.currentPage*this.pageSize]) {
+          let concatData = this.allSheetData[i].celldata.slice(this.currentPage*this.pageSize, (this.currentPage+1)*this.pageSize);
+
+          // this.sheetConfig.data[i].celldata = this.sheetConfig.data[i].celldata.concat(concatData) 
+          // this.$refs.sheetRef.init()
+        }
+        continue
+
+      }
+
+      if (this.currentPage<this.maxPage) {
+        this.currentPage++
+        requestAnimationFrame(this.loadDataSync());
+      }
+    },
+
+    /* 分割数据 */
+    splitSheetData(sheets) {
+      // this.allSheetData = sheets.map(_ => ({
+      //   index: _.index, //工作表索引
+      //   order: _.order, //工作表的下标
+      //   name: _.name,
+      //   calcChain: _.calcChain,
+      //   celldata: _.celldata,
+      //   config: _.config
+      // }));
+      // this.maxPage = Math.max(...sheets.map(_ =>  Math.ceil(_.celldata.length / this.pageSize)))
+      console.log(sheets)
+
+      this.sheetConfig.data = sheets.map(_ => ({
+        index: _.index, //工作表索引
+        order: Number(_.order), //工作表的下标
+        name: _.name,
+        calcChain: _.calcChain,
+        config: _.config,
+        celldata: _.celldata,
+      }));
+      
+      //辣鸡插件连更新数据的api都没有
+       //  this.loadDataSync();
+      
+      this.isLoading = false;
+    },
+
+    handelTranslateData() {
+        this.isLoading = true;
+        LuckyExcel.transformExcelToLucky(this.uploadSheetsList[Number(this.selectIndex)], (exportJson, luckysheetfile) =>{
+                                  
+          if(exportJson.sheets==null || exportJson.sheets.length==0){
+              this.$message.warning('解析文件失败')
+              return;
+          }
+
+            this.splitSheetData(exportJson.sheets);
+
+        });
+
+    },
+
+    /* 移除表格 */
+    handleRemoveSheet(index) {
+      if(this.uploadSheetsList.length === 1) {
+        this.backHandle()
+        return
+      }
+
+      this.uploadSheetsList.splice(Number(index),1)
+      if(this.selectIndex === index) {
+        this.selectIndex = '0';
+        this.handleSwitchSheet()
+      }
+
+    },
+
+
+    /* 保存表格 */
+    handleAddSheet: _.debounce(async function() {
+      luckysheet.exitEditMode()
+      let data = luckysheet.getAllSheets().filter(_ => this.$refs.bottomSecRef.sheetChecked.includes(_.name));
+      console.log(data)
+
+      this.loading = this.$loading({
+				target:'.addSheet-wrap',
+				lock: true,
+				text: '保存中...',
+				spinner: 'el-icon-loading',
+				background: 'rgba(255, 255, 255, 0.6)'
+			});
+      let img = getSheetImage(data[0]);
+			const form  = new FormData();
+			form.append('Image', img);
+			const { Data } = await sheetInterface.uploadImg(form)
+
+      data.luckysheet_select_save = [];
+      const res = await sheetInterface.sheetAnalysisInterface.excelSheetAdd({
+        ExcelName: this.uploadSheetsList[0].name,
+        ExcelClassifyId: this.$refs.bottomSecRef.select_classify,
+        ExcelImage: Data.ResourceUrl,
+        Content: JSON.stringify(data)
+      })
+      this.loading.close()
+      if(res.Ret !== 200) return
+
+      this.$message.success(res.Msg);
+
+      // const { ExcelInfoId, UniqueCode } = res.Data;
+      
+      this.$router.replace({
+        path: '/sheetAnalysisList',
+        // query: {
+        //   code: UniqueCode,
+        //   id: ExcelInfoId
+        // }
+      })
+    },300),
+
+     /* 获取表格详情 */
+    getDetailHandle() {
+      this.isLoading = true;
+      sheetInterface.sheetAnalysisInterface.getExcelDetail({
+        UniqueCode: this.$route.query.code,
+      }).then((res) => {
+        if (res.Ret !== 200) return;
+
+        this.sheetDetailInfo = res.Data.ExcelInfo;
+        this.dataToalPage =  Math.max(...res.Data.SheetList.map(_ => _.PageNum));
+        this.sheetAllcellData = res.Data.SheetList.map(_ => _.Data ? JSON.parse(_.Data.Data): []);
+
+        this.getCellData(res.Data.SheetList)
+      });
+    },
+
+    //分页获取表格数据
+    async getCellData(sheets) {
+
+      let res = await sheetInterface.sheetAnalysisInterface.getExcelDataByPage({
+        UniqueCode: this.$route.query.code,
+        Page: this.sheetDataPage
+      })
+
+      if(res.Ret !== 200) return
+
+      for(let i = 0;i<this.sheetAllcellData.length;i++) {
+        if(res.Data[i].Data) {
+          this.sheetAllcellData[i] = [...this.sheetAllcellData[i],...JSON.parse(res.Data[i].Data.Data)]
+        }
+        continue
+      }
+      
+      //数据继续加载或渲染表格
+      if(this.sheetDataPage < this.dataToalPage) {
+        this.sheetDataPage++;
+        this.getCellData(sheets)
+      }else {
+        this.sheetConfig.data = sheets.map((_,index) => ({
+          index: _.Index, //工作表id
+          order: _.Sort, //工作表的下标
+          name: _.SheetName,
+          calcChain: JSON.parse(_.CalcChain),
+          config: JSON.parse(_.Config),
+          celldata: this.sheetAllcellData[index],
+        }))
+
+        this.isLoading = false;
+        this.getTargetList()
+      }
+    },
+
+
+    /* 获取选取对应单元格数组和拼接选取的公式 
+      Sheet1!$A$1:$A$25
+      Sheet1!$E:$E
+    */
+    getRangeCell: _.debounce(function() {
+      let sheet = luckysheet.getSheet();
+      let rangeArr = luckysheet.getRangeAxis();
+
+      if(rangeArr.length > 1) return this.$message.warning('同时只允许选择一块区域');
+      //检查选取是否满足同行/同列
+      if(!this.checkRangeVaild(rangeArr[0])) return this.$message.warning('序列只允许选择同行或同列');
+
+      let rangeCells = luckysheet.getRangeValue().flat().map(_=>_?_.m:'');
+
+      let format = `${sheet.name}!${this.formatStr(rangeArr[0])}`;
+
+      console.log(format)
+      this.$refs.createTargetRef.setFormula(format,rangeCells)
+    },300),
+
+    //检验同行同列
+    checkRangeVaild(range) {
+      let reg = /^([A-Z]+)(\d+)$/;
+      let arr = range.split(':').map(_ => [_.match(reg)[1],_.match(reg)[2]]);
+      
+      if(arr.length ===1) return true;
+
+      if(arr[0][0] === arr[1][0] || arr[0][1] === arr[1][1]) {
+        return true
+      }else {
+        return false
+      }
+    },
+
+    formatStr(inputRange) {
+      // 将字母和数字前面都拼接"$"
+      const parts = inputRange.split(':');
+      if (parts.length === 2) {
+          const start = parts[0].replace(/(^[A-Z]+)(\d+)$/, '$$$1$$$2');
+          const end = parts[1].replace(/(^[A-Z]+)(\d+)$/, '$$$1$$$2');
+          return start + ':' + end;
+      }
+      return inputRange;
+      
+    },
+    
+    /* 生成指标 */
+    async handleCreateTarget() {
+      console.log(this.$refs.createTargetRef.formData)
+      this.loading = this.$loading({
+				target:'.addSheet-wrap',
+				lock: true,
+				text: '保存中...',
+				spinner: 'el-icon-loading',
+				background: 'rgba(255, 255, 255, 0.6)'
+			});
+
+      let data = luckysheet.getAllSheets();
+      data.luckysheet_select_save = [];
+      const { ExcelInfoId, ExcelName, ExcelClassifyId } = this.sheetDetailInfo;
+      await sheetInterface.sheetAnalysisInterface.sheetEdit({
+        ExcelInfoId,
+        ExcelName,
+        ExcelClassifyId,
+        // ExcelImage: Data.ResourceUrl,
+        Content: JSON.stringify(data)
+      });
+      
+      const { edbInfoId,
+        dateSeries,
+        valueSeries,
+        dateArr,
+        valueArr,
+				edbName,
+				classify,
+				frequency,
+				unit } = this.$refs.createTargetRef.formData;
+      let params = {
+        EdbName: edbName,
+        ExcelInfoId: ExcelInfoId,
+        ClassifyId: classify,
+        Frequency: frequency,
+        Unit: unit,
+        DateSequenceVal: dateArr,
+        DataSequenceVal: valueArr,
+        DateSequenceStr: dateSeries,
+        DataSequenceStr: valueSeries
+      }
+      const res = edbInfoId 
+        ? await sheetInterface.sheetAnalysisInterface.edbEditBysheet({...params,EdbInfoId: edbInfoId})
+        : await sheetInterface.sheetAnalysisInterface.edbAddBysheet(params)
+
+      this.loading.close();
+      if(res.Ret !== 200) return
+
+      this.$message.success(res.Msg)
+
+      if(!edbInfoId) this.$refs.createTargetRef.initData();
+
+      this.getTargetList()
+    },
+
+    /* 获取生成指标列表 */
+    async getTargetList() {
+      const res = await sheetInterface.sheetAnalysisInterface.edbListBySheet({
+        ExcelInfoId: this.sheetDetailInfo.ExcelInfoId
+      })
+
+      if(res.Ret !== 200) return
+      
+      this.edbList = res.Data || [];
+    },
+
+    /* 选择指标列表更新表单信息和区域选中 */
+    chooseEdbHandle() {
+
+      if(this.$refs.edbWrapRef.selectEdb.EdbInfoId) {
+        this.$refs.createTargetRef.initData(this.$refs.edbWrapRef.selectEdb)
+      } else {
+        this.$refs.createTargetRef.initData()
+      }
+    }
+    
+  },
+  mounted() {
+    this.getClassify();
+    //上传文件的解析渲染
+    if(this.files) {
+      this.uploadSheetsList =  Object.values(this.files);
+      this.handelTranslateData()
+      this.$store.commit('sheet/SET_UPLOADFIlES',null)
+    }
+
+    //详情的渲染
+    if(this.$route.query.code) this.getDetailHandle();
+  }
+}
+</script>
+<style scoped lang="scss">
+*{ box-sizing: border-box; }
+.addSheet-wrap {
+  min-height: calc(100vh - 120px);
+  .wrap-top {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
+    padding: 20px;
+    background: #fff;
+    border: 1px solid #ececec;
+    border-radius: 4px;
+    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
+    display: flex;
+    z-index: 1;
+    .form-ul {
+      flex: 1;
+      display: flex;
+      li {
+        margin-right: 30px;
+      }
+    }
+  }
+  .main {
+    display: flex;
+    position: relative;
+    min-height: 700px;
+    .left-section {
+      flex:1;
+      .sheet-wrapper {
+        position: relative;
+        background: #fff;
+        min-height: 700px;
+      }
+    
+    }
+    &.full-height {
+      min-height: calc(100vh - 120px);
+    }
+  }
+}
+</style>
+<style lang="scss">
+.addSheet-wrap {
+  .el-tabs__nav {
+    background: #fff;
+  }
+  .el-tabs__header {
+    margin-bottom: 0;
+    // border-bottom: none;
+  }
+}
+</style>

+ 130 - 0
src/views/datasheet_manage/customAnalysis/components/bottomSection.vue

@@ -0,0 +1,130 @@
+<template>
+  <div class="bottom-section">
+
+    <!-- 无同名 -->
+    <div>
+      <div class="page-list" v-if="sheetPages.length">
+        <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange" style="margin-right:30px">全部</el-checkbox>
+        <el-checkbox-group v-model="sheetChecked" @change="handleCheckedChange">
+          <el-checkbox v-for="item in sheetPages" :label="item" :key="item">{{item}}</el-checkbox>
+        </el-checkbox-group>
+      </div>
+
+      <div>
+        <el-select 
+          v-model="select_classify"
+          placeholder="请选择表格目录"
+          clearable
+          style="width:350px;"
+        >
+          <el-option
+            v-for="item in classifyArr"
+            :key="item.ExcelClassifyId"
+            :label="item.ExcelClassifyName"
+            :value="item.ExcelClassifyId"
+          />
+        </el-select>
+        <el-button type="primary" style="margin-left:30px" @click="saveSheetHandle">保存</el-button>
+          <el-tooltip class="item" effect="dark" content="根据用户选择的sheet页上传文件" placement="top-start">
+          <i class="el-icon-warning"/>
+        </el-tooltip>
+      </div>
+    </div>
+
+    <!-- 有同名文件 -->
+    <!-- <div>
+      <div class="same-page-item">
+        <label>
+          <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
+            <path d="M14.7136 12.8013L9.22087 2.90725C8.54904 1.69758 7.45106 1.69758 6.77941 2.90725L1.28669 12.8013C0.615035 14.0122 1.16452 15 2.5069 15H13.4933C14.8357 15 15.3846 14.0121 14.7136 12.8013ZM7.2457 5.71459C7.44308 5.49263 7.69402 5.38164 8.00006 5.38164C8.30627 5.38164 8.55698 5.49146 8.75456 5.71015C8.95086 5.92933 9.04898 6.20343 9.04898 6.53305C9.04898 6.81664 8.63924 8.902 8.50257 10.4191H7.51565C7.39579 8.90199 6.95119 6.81664 6.95119 6.53305C6.95122 6.20844 7.0495 5.93546 7.2457 5.71459ZM8.74074 12.9285C8.53313 13.1387 8.28608 13.2435 8.00013 13.2435C7.71426 13.2435 7.46714 13.1387 7.25956 12.9285C7.05256 12.7186 6.94967 12.4645 6.94967 12.166C6.94967 11.8691 7.05256 11.6123 7.25956 11.397C7.46714 11.1816 7.71426 11.0739 8.00013 11.0739C8.28608 11.0739 8.53313 11.1816 8.74074 11.397C8.94761 11.6123 9.05074 11.8691 9.05074 12.166C9.05074 12.4645 8.94761 12.7186 8.74074 12.9285Z" fill="#E37318"/>
+          </svg>
+          下列sheet页同名,勾选可替换页面内容
+          <span style="color:#999">(不勾选则拼接原内容+上传内容,不去重)</span>
+        </label>
+        <div class="page-list">
+          <el-radio v-model="item.checked" v-for="item in sheetPages" :key="item">{{item}}</el-radio>
+        </div>
+      </div>
+      <div class="same-page-item">
+        <label>
+          <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
+            <path d="M14.7136 12.8013L9.22087 2.90725C8.54904 1.69758 7.45106 1.69758 6.77941 2.90725L1.28669 12.8013C0.615035 14.0122 1.16452 15 2.5069 15H13.4933C14.8357 15 15.3846 14.0121 14.7136 12.8013ZM7.2457 5.71459C7.44308 5.49263 7.69402 5.38164 8.00006 5.38164C8.30627 5.38164 8.55698 5.49146 8.75456 5.71015C8.95086 5.92933 9.04898 6.20343 9.04898 6.53305C9.04898 6.81664 8.63924 8.902 8.50257 10.4191H7.51565C7.39579 8.90199 6.95119 6.81664 6.95119 6.53305C6.95122 6.20844 7.0495 5.93546 7.2457 5.71459ZM8.74074 12.9285C8.53313 13.1387 8.28608 13.2435 8.00013 13.2435C7.71426 13.2435 7.46714 13.1387 7.25956 12.9285C7.05256 12.7186 6.94967 12.4645 6.94967 12.166C6.94967 11.8691 7.05256 11.6123 7.25956 11.397C7.46714 11.1816 7.71426 11.0739 8.00013 11.0739C8.28608 11.0739 8.53313 11.1816 8.74074 11.397C8.94761 11.6123 9.05074 11.8691 9.05074 12.166C9.05074 12.4645 8.94761 12.7186 8.74074 12.9285Z" fill="#E37318"/>
+          </svg>
+          下列sheet页不同名,勾选可新增sheet页
+          <span style="color:#999">(不勾选则不新增)</span>
+        </label>
+        <div class="page-list">
+          <el-radio v-model="item.checked" v-for="item in sheetPages" :key="item">{{item}}</el-radio>
+          
+        </div>
+      </div>
+
+      <el-button type="primary">保存</el-button>
+    </div> -->
+
+  </div>
+</template>
+<script>
+export default {
+  props: {
+    sheetList: {
+      type: Array
+    },
+    classifyArr: {
+      type: Array
+    }
+  },
+  watch: {
+    sheetList(nval) {
+      this.sheetPages = nval.map(_ => _.name)
+      this.sheetChecked = this.sheetPages;
+    }
+  },
+  data() {
+    return {
+      isIndeterminate: false,
+      checkAll: true,
+      sheetPages: [],
+      sheetChecked: [],
+
+      select_classify: '',
+      classifyArr: this.classifyArr,
+    }
+  },
+  methods:{
+    saveSheetHandle() {
+      if(!this.sheetChecked.length) return this.$message.warning('请选择要保存的sheet页')
+      if(!this.select_classify) return this.$message.warning('请选择分类')
+
+      this.$emit('save')
+    },
+
+    handleCheckedChange(val){
+      this.checkAll = val.length === this.sheetPages.length;
+      this.isIndeterminate = val.length > 0 && val.length < this.sheetPages.length;
+      console.log(this.sheetChecked)
+    },
+    handleCheckAllChange(val){
+      this.sheetChecked = val ? this.sheetPages : [];
+      this.isIndeterminate = false;
+    },
+  },
+}
+</script>
+<style scoped lang='scss'>
+.bottom-section {
+  background: #fff;
+  padding: 20px 20px 50px;
+  border-radius: 4px;
+  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
+  .page-list  {
+    display: flex;
+    align-items: center;
+    margin: 10px 0;
+    margin-bottom: 30px;
+  }
+  .btn-bottom {
+    margin-top: 20px;
+  }
+}
+</style>

+ 261 - 0
src/views/datasheet_manage/customAnalysis/components/createTargetForm.vue

@@ -0,0 +1,261 @@
+<template>
+  <div class="create-form-cont">
+    <el-form
+      ref="formRef"
+      label-position="left"
+      hide-required-asterisk
+      inline
+      label-width="0"
+      :model="formData"
+      :rules="formRules"
+    >
+      <el-form-item prop="dateSeries">
+        <el-input v-model="formData.dateSeries" placeholder="请选择日期序列" @focus="selectArea='date'" @change="changeFormat('date')" @keyup.native="e => { e.keyCode===13 && initSelect()}" :class="{'select': selectArea==='date'}"></el-input>
+      </el-form-item>
+      <el-form-item prop="valueSeries">
+        <el-input v-model="formData.valueSeries" placeholder="请选择数值序列" @focus="selectArea='value'" @change="changeFormat('value')" @keyup.native="e => { e.keyCode===13 && initSelect()}" :class="{'select': selectArea==='value'}"></el-input>
+      </el-form-item>
+
+      <el-form-item prop="edbName">
+        <el-input v-model="formData.edbName" placeholder="指标名称" @focus="initSelect"></el-input>
+      </el-form-item>
+      <el-form-item prop="classify">
+        <el-cascader
+          v-model="formData.classify"
+          :options="classifyOption"
+          style="width: 100%"
+          @focus="initSelect"
+          :props="{
+            label: 'ClassifyName',
+            value: 'ClassifyId',
+            children: 'Children',
+            emitPath: false,
+            checkStrictly: true
+          }"
+          clearable
+          placeholder="请选择所属目录"
+        />
+      </el-form-item>
+      <el-form-item prop="frequency">
+        <el-select
+          v-model="formData.frequency"
+          placeholder="请选择频率"
+          style="width: 100%"
+          @focus="initSelect"
+          clearable
+        >
+          <el-option
+            v-for="item in frequencyArr"
+            :key="item"
+            :label="item"
+            :value="item"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="unit">
+        <selectUnit v-model="formData.unit" @click.native="initSelect"/>
+      </el-form-item>
+      
+      <el-form-item>
+        <el-button type="primary" @click="handleSaveTarget">保存</el-button>
+        <el-button type="primary" plain @click="$parent.backHandle('into-detail')">返回</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+<script>
+import {dataBaseInterface} from '@/api/api.js'
+export default {
+  data() {
+    return {
+      selectArea: '',
+      formData: {
+        edbInfoId: 0,
+        dateSeries: '',
+        valueSeries: '',
+        dateArr:[],
+        valueArr: [],
+				edbName:'',
+				classify:'',
+				frequency: '',
+				unit:'',
+      },
+      formRules: {
+        // dateSeries: [{ required: true, message: '日期序列不能为空', trigger: 'blur' }],
+        // valueSeries: [{ required: true, message: '数值序列不能为空', trigger: 'blur' }],
+        edbName: [{ required: true, message: '指标名称不能为空', trigger: 'blur' }],
+        classify: [{ required: true, message: '目录不能为空', trigger: 'blur' }],
+        frequency: [{ required: true, message: '频率不能为空', trigger: 'blur' }],
+        unit: [{ required: true, message: '单位不能为空', trigger: 'blur' }],
+      },
+      frequencyArr:['日度','周度','旬度','月度','季度','年度'],
+      classifyOption: [],
+
+      isLockUpdate: false,//防止手动改变公式设置选区出发hook事件又更新公式和值 手动设置值即可
+    };
+  },
+  methods: {
+
+    /* 选区时更新公式 */
+    setFormula(formula,arr) {
+      if(!this.selectArea) return
+      //更新日期序列公式
+      if(this.selectArea === 'date') {
+        this.formData.dateArr = arr;
+        this.formData.dateSeries = formula
+      }else if(this.selectArea === 'value') {
+        //更新数值序列公式
+        this.formData.valueArr = arr;
+         this.formData.valueSeries = formula
+      }
+
+      console.log(this.formData)
+    },
+
+    /* 获取分类 */
+		getMenu() {
+			dataBaseInterface.menuListV3().then((res) => {
+				if (res.Ret !== 200) return
+        this.filterNodes(res.Data.AllNodes||[]);
+				this.classifyOption = res.Data.AllNodes || [];
+			});
+		},
+    
+    filterNodes(arr) {
+			arr.length &&
+				arr.forEach((item) => {
+					item.Children.length && this.filterNodes(item.Children);
+					if (!item.Children.length) {
+						delete item.Children;
+					}
+				});
+		},
+
+    /* 改变公式 */
+    changeFormat(type) {
+      this.isLockUpdate = true;
+      this.setRangeShow(type==='date'?this.formData.dateSeries:this.formData.valueSeries)
+      
+      let rangeArr = luckysheet.getRangeAxis();
+
+      //检查选取是否满足同行/同列
+      if(!this.$parent.checkRangeVaild(rangeArr[0])){
+        type==='date'?this.formData.dateSeries = '':this.formData.valueSeries ='';
+        return this.$message.warning('序列只允许选择同行或同列');
+      } 
+
+      let rangeCells = luckysheet.getRangeValue().flat().map(_=>_?_.m:'');
+      //更新公式关联的数据数组
+      type==='date' ? this.formData.dateArr = rangeCells : this.formData.valueArr = rangeCells;
+      console.log(this.formData)
+      this.isLockUpdate = false;
+    },
+
+    initSelect() {
+      this.selectArea = ''
+    },
+
+    initData(data=null) {
+      this.initSelect()
+      if(data) {
+        this.formData = {
+          edbInfoId: data.EdbInfoId,
+          dateSeries: data.DateSequenceStr,
+          valueSeries: data.DataSequenceStr,
+          dateArr:[],
+          valueArr: [],
+          edbName: data.EdbName,
+          classify: data.ClassifyId,
+          frequency: data.Frequency,
+          unit: data.Unit,
+        }
+
+        this.setRangeShow([data.DateSequenceStr,data.DataSequenceStr]);
+      }else {
+        this.formData = {
+          edbInfoId: 0,
+          dateSeries: '',
+          valueSeries: '',
+          dateArr:[],
+          valueArr: [],
+          edbName:'',
+          classify:'',
+          frequency: '',
+          unit:'',
+        }
+        
+        this.setRangeShow(['A1','A1'])
+      }
+    },
+
+    /* 解析公式显示选区 */
+    setRangeShow(range) {
+      
+      //初始化多选区
+      let rangeArr = [];
+      if(Array.isArray(range)) {
+        range.forEach(_ => {
+          rangeArr.push(this.splitFormula(_))
+        })
+      }else {
+        rangeArr = [this.splitFormula(range)]
+      }
+      luckysheet.setRangeShow(rangeArr)
+    },
+
+    /* 解析公式 */
+    splitFormula(formula) {
+      let str = formula.substr(formula.indexOf('!')+1).replace(/\$/g,'')
+      return str
+    },
+
+    /* 保存 */
+    handleSaveTarget: _.debounce(async function() {
+      if(!this.formData.dateSeries) return this.$message.warning('日期序列不能为空')
+      if(!this.formData.valueSeries) return this.$message.warning('数值序列不能为空')
+
+      await this.$refs.formRef.validate();
+      this.initSelect();
+      this.$emit('save')
+    },300),
+  },
+  
+  mounted() {
+    this.getMenu()
+  },
+};
+</script>
+<style scoped lang="scss">
+.create-form-cont {
+  background: #fff;
+  margin-bottom: 20px;
+  display: flex;
+  flex-wrap: wrap;
+  padding: 20px;
+  .el-form-item {
+    margin-bottom: 20px;
+    /* .select {
+      &::before {
+        content: '';
+        position: absolute;
+        left: 0;
+        right: 0;
+        top: 0;
+        bottom: 0;
+        border: 2px dashed #18ad18;
+        border-radius: 4px;
+      }
+    } */
+  }
+}
+</style>
+
+<style lang="scss">
+  .create-form-cont {
+    .select .el-input__inner {
+       border: 2px dashed #18ad18;
+      border-radius: 4px;
+    }
+  }
+</style>

+ 118 - 0
src/views/datasheet_manage/customAnalysis/components/rightSection.vue

@@ -0,0 +1,118 @@
+<template>
+  <div class="right-section-wrapper">
+    <div class="create-cont">
+      <ul class="edb-list" v-if="edbList.length">
+        <li :class="['edb-item',{'selected':selectEdb.EdbInfoId===item.EdbInfoId}]" v-for="(item,index) in edbList" :key="index" @click="chooseEdb(item)">
+          <span>{{item.EdbName}}</span>
+          <div class="item-right">
+            <!-- <i class="el-icon-edit" style="margin-right:10px" @click.stop="editEdbSettingHandle"/> -->
+            <img :src="$icons.jupm_icon" class="jump-icon" @click.stop="linkToEdbBase(item)">
+          </div>
+        </li>
+      </ul>
+      <div style="padding-top: 50px;" v-else>
+        <tableNoData text="暂无指标"/>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  props: {
+    list: {
+      type: Array
+    }
+  },
+  watch: {
+    list(nval) {
+      this.edbList = nval;
+    }
+  },
+  data() {
+    return {
+      edbList:[],
+      selectEdb: {},
+    }
+  },
+  mounted(){
+
+  },
+  methods:{
+
+    chooseEdb(item) {
+      if(item.EdbInfoId === this.selectEdb.EdbInfoId) {
+        this.selectEdb = {};
+      }else {
+        this.selectEdb = item;
+      }
+
+      this.$emit('choose')
+    },
+
+    //跳转指标库
+    linkToEdbBase({UniqueCode,EdbInfoId,ClassifyId}) {
+      let {href} = this.$router.resolve({path:'/database', query: {
+        code: UniqueCode,
+        id: EdbInfoId,
+        classifyId:ClassifyId
+      }});
+			window.open(href,'_blank');
+    }
+  },
+}
+</script>
+<style scoped lang='scss'>
+@import"~@/styles/theme-vars.scss";
+.right-section-wrapper {
+  width: 360px;
+  flex-shrink: 0;
+  border-radius: 4px;
+  border: 1px solid #C8CDD9;
+  background: #FFF;
+  margin-left: 20px;
+  .create-cont {
+    .edb-list {
+      padding: 30px;
+      overflow-y: auto;
+      .edb-item {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 14px 20px;
+        margin: 10px 0;
+        border-radius: 4px;
+        border: 1px solid #C8CDD9;
+        background: #FFF;
+        &.selected { 
+          border-color: $theme-color; background: #ECF2FE;
+        }
+        .item-right {
+          display: flex;
+          align-items: center;
+          .jump-icon {
+            cursor: pointer;
+            &:hover {
+              opacity: 0.8;
+            }
+          }
+        }
+        .el-icon-edit {
+          font-size: 16px;
+          &:hover {
+            color: $theme-color;
+            cursor: pointer;
+          }
+        }
+      }
+    }
+  }
+}
+</style>
+<style lang="scss">
+.right-section-wrapper {
+  .el-form--label-top .el-form-item__label {
+    height: 20px;
+    line-height: 20px;
+  }
+} 
+</style>

+ 1092 - 0
src/views/datasheet_manage/customAnalysis/list.vue

@@ -0,0 +1,1092 @@
+<template>
+  <div class="dataSheet-container" v-if="showData">
+    <span
+      class="slide-icon slide-right"
+      @click="isSlideLeft = !isSlideLeft"
+      v-show="isSlideLeft"
+    >
+      <i class="el-icon-d-arrow-right"></i>
+    </span>
+    <div class="data-sheet-main" id="box">
+      <div class="main-left left" id="left" v-show="!isSlideLeft">
+        <div class="datasheet_top">
+          
+          <el-button
+            type="primary" 
+            style="margin-right:20px"
+            :loading="isUploadLoading"
+            @click="clickUpload"
+            v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_analysis_upload)"
+          >上传文件</el-button>
+          <input type="file" @change="fileSelected" id="file"  style="display: none;">
+          
+          <el-checkbox v-model="isShowMe"  @change="() => { getTreeData();getPublicList() }">只看我的</el-checkbox>
+        </div>
+        <div class="search-cont">
+          <el-select
+            v-model="search_txt"
+            ref="searchRef"
+            :filterable="!search_txt"
+            remote
+            clearable
+            placeholder="表格名称"
+            style="width: 100%"
+            :remote-method="searchHandle"
+            @focus="searchHandle('')"
+          >
+            <i slot="prefix" class="el-input__icon el-icon-search"></i>
+            <el-option
+              v-for="item in searchOptions"
+              :key="item.ExcelInfoId"
+              :label="item.ExcelName"
+              :value="item.ExcelInfoId"
+            >
+            </el-option>
+          </el-select>
+        </div>
+        <div class="tree-cont">
+          <el-tree
+            ref="treeRef"
+            class="target_tree"
+            :data="treeData"
+            node-key="UniqueCode"
+            :props="defaultProp"
+            :allow-drag="canDragHandle"
+            :allow-drop="canDropHandle"
+            :current-node-key="select_node"
+            :default-expanded-keys="defaultShowNodes"
+            draggable
+            :expand-on-click-node="false"
+            check-strictly
+            empty-text="暂无分类"
+            @node-expand="handleNodeExpand"
+            @node-collapse="handleNodeCollapse"
+            @current-change="nodeChange"
+            @node-drop="dropOverHandle"
+            @node-drag-end="dropMouseLeave"
+            @node-drag-leave="dropMouseLeave"
+            @node-drag-enter="dropMouseOver"
+          >
+            <span class="custom-tree-node" slot-scope="{ node, data }">
+              <el-input
+                ref="editVal"
+                style="width: 90px"
+                placeholder="请输入值"
+                class="label-input"
+                v-model="new_label"
+                v-if="data.isEdit&&isSheetBtnShow('classifyOpt_edit')"
+                @blur="changeValue(data)"
+              />
+              <span
+                @dblclick.stop="editNodeLabel(data)"
+                v-else
+                class="text_oneLine node_label"
+                :style="`width:${
+                  (select_node === data.UniqueCode && node.Nodewidth) || ''
+                }`"
+              >
+                <span>{{ data.ExcelClassifyName }}</span>
+              </span>
+              <span
+                style="display: flex; align-items: center"
+                v-if="select_node === data.UniqueCode"
+              >
+                <img
+                  src="~@/assets/img/data_m/move_ico.png"
+                  alt=""
+                  style="width: 14px; height: 14px; margin-right: 8px"
+                />
+                <img
+                  src="~@/assets/img/set_m/edit.png"
+                  alt=""
+                  style="width: 15px; height: 14px; margin-right: 8px"
+                  @click.stop="editNode(node, data)"
+                  v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_edit')"
+                />
+                <img
+                  slot="reference"
+                  src="~@/assets/img/set_m/del.png"
+                  alt=""
+                  style="width: 14px; height: 14px"
+                  @click.stop="removeNode(node, data)"
+                  v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_delete')"
+                />
+              </span>
+            </span>
+          </el-tree>
+          <div class="noDepart" @click="addLevelOneHandle" v-if="isSheetBtnShow('classifyOpt_edit')">
+            <img
+              src="~@/assets/img/set_m/add_ico.png"
+              alt=""
+              style="width: 16px; height: 16px; margin-right: 10px"
+            />
+            <span>添加表格分类</span>
+          </div>
+        </div>
+        <span
+          class="move-btn resize"
+          v-drag
+          id="resize"
+          @mousemove="dynamicNode && resetNodeStyle(dynamicNode)"
+        ></span>
+        <span class="slide-icon slide-left" @click="isSlideLeft = !isSlideLeft">
+          <i class="el-icon-d-arrow-left"></i>
+        </span>
+      </div>
+
+      <div
+        class="main-right"
+        id="right"
+        :style="isSlideLeft ? 'width:100%' : 'width:80%'"
+      >
+        <!-- 表格详情 -->
+        <div class="sheet-detail-wrapper" v-if="select_id" >
+          <div class="detail-top">
+            <span class="author"
+              >作者:{{ sheetDetailInfo.SysUserRealName }}</span
+            >
+            <el-input
+              ref="sheetEditTitRef"
+              style="width: 400px"
+              placeholder="请输入表格名称"
+              class="label-input"
+              v-model="sheet_title"
+              v-if="sheetDetailInfo.isEditTit"
+              @blur="changeValue(sheetDetailInfo, 'edit-tit')"
+            />
+            <span
+              class="sheet-name"
+              @click="editNodeLabel(sheetDetailInfo, 'edit-tit')"
+              v-else
+            >
+              {{ sheetDetailInfo.ExcelName }}
+              <i class="el-icon-edit"/>
+            </span>
+            <ul class="action-ul" v-if="sheetDetailInfo.Button">
+
+              <el-tooltip effect="dark" content="在当前表格选择日期列和数据列生成指标" placement="top-start">
+                  <li class="editsty" @click="HandleToPath" v-if="isSheetBtnShow('createedb')&&sheetDetailInfo.Button.OpEdbButton">生成指标</li>
+              </el-tooltip>
+
+              <el-tooltip effect="dark" content="根据表格保存的最新内容,更新当前表格生成的所有指标" placement="top-start">
+                  <li class="editsty" @click="refreshSheet" v-if="isSheetBtnShow('refresh')&&sheetDetailInfo.Button.RefreshEdbButton">刷新指标</li>
+              </el-tooltip>
+              <li class="editsty" @click="saveHandle" v-if="isSheetBtnShow('save')&&sheetDetailInfo.Button.OpButton">保存</li>
+              <li
+                class="editsty"
+                @click="saveOtherHandle"
+                v-if="isSheetBtnShow('otherSave')&&sheetDetailInfo.Button.CopyButton"
+              >
+                另存为
+              </li>
+              <li class="editsty" @click="downloadExcel
+              (sheetDetailInfo)" v-if="isSheetBtnShow('download')&&sheetDetailInfo.Button.DownloadButton">
+                下载
+              </li>
+              <li
+                class="deletesty"
+                v-if="isSheetBtnShow('del')&&sheetDetailInfo.Button.DeleteButton"
+                @click="delSheetHandle({cell:sheetDetailInfo, type:'del'})"
+              >
+                删除
+              </li>
+            </ul>
+          </div>
+
+          <!-- <dataLoading :loading="isSheetLoading"/> -->
+
+          <!-- 表格 -->
+          <div class="sheet-wrap">
+            <Sheet
+              ref="sheetRef"
+              v-if="sheetConfigOpt.data"
+              :option="sheetConfigOpt"
+              :sheetInfo="{
+                ExcelInfoId: sheetDetailInfo.ExcelInfoId,
+                ExcelName: sheetDetailInfo.ExcelName,
+                ExcelClassifyId: sheetDetailInfo.ExcelClassifyId,
+                Source: sheetDetailInfo.Source
+              }"
+            />
+          </div>
+        </div>
+
+         <!-- 列表 -->
+        <sheetListWrap
+          v-else
+          :total="sheet_total" 
+          :list="sheetList" 
+          @loadMoreHandle="loadMoreHandle"
+          @detailShowHandle="detailShowHandle"
+          @delSheetHandle="delSheetHandle"
+          @downloadExcel="downloadExcel"
+          ref="sheetListWrap"
+        />
+      </div>
+
+      <dataLoading :loading="isSheetLoading"/>
+    </div>
+
+    <!-- 分类弹窗 -->
+    <classify-dia
+      :isOpenDialog.sync="classifyDia"
+      :title="dialog_title"
+      :form="classifyForm"
+      @successCallback="getTreeData"
+    />
+
+    <!-- 表格另存 -->
+    <m-dialog
+      :show.sync="isSaveOther"
+      width="650px"
+      title="另存为"
+      @close="cancelSaveOther"
+    >
+      <div style="padding-left: 80px">
+        <el-form
+          ref="formRef"
+          label-position="left"
+          hide-required-asterisk
+          label-width="80px"
+          :model="saveOtherForm"
+          :rules="saveOtherFormRule"
+        >
+          <el-form-item label="表格名称" prop="name">
+            <el-input
+              v-model="saveOtherForm.name"
+              style="width: 80%"
+              placeholder="请输入表格名称"
+            />
+          </el-form-item>
+          <el-form-item label="表格分类" prop="classify">
+            <el-cascader
+              v-model="saveOtherForm.classify"
+              :options="classifyOptions"
+              :props="{
+                label: 'ExcelClassifyName',
+                value: 'ExcelClassifyId',
+                children: 'Children',
+                emitPath: false,
+              }"
+              style="width: 80%"
+              placeholder="请选择所属分类"
+              class="sheet-classify-cascader"
+            />
+          </el-form-item>
+        </el-form>
+      </div>
+      <div style="display: flex; justify-content: center; margin-top: 30px">
+        <el-button
+          type="primary"
+          style="margin-right: 60px"
+          @click="saveCopyOther"
+          >保存</el-button
+        >
+        <el-button type="primary" plain @click="cancelSaveOther"
+          >取消</el-button
+        >
+      </div>
+    </m-dialog>
+  </div>
+</template>
+
+<script>
+import * as sheetInterface from "@/api/modules/sheetApi.js";
+import leftMixin from "../mixins/classifyMixin";
+import mDialog from "@/components/mDialog.vue";
+import classifyDia from "../components/sheetClassifyDia.vue";
+import Sheet from "../components/SheetExcel.vue";
+import { getSheetImage } from "../common/option";
+import sheetListWrap from "../components/sheetListWrap.vue"
+export default {
+  name: "",
+  components: { mDialog, classifyDia, Sheet, sheetListWrap },
+  mixins: [leftMixin],
+  computed: {
+    downExcelFileUrl() {
+      let url = `${
+        process.env.VUE_APP_API_ROOT
+      }/datamanage/excel_info/table/download?${localStorage.getItem("auth")}`;
+      return url;
+    },
+    classifyOptions() {
+      let options = this.treeData.map((_) => ({
+        ExcelClassifyId: _.ExcelClassifyId,
+        ExcelClassifyName: _.ExcelClassifyName,
+      }));
+
+      return options;
+    },
+  },
+  data() {
+    return {
+      showData: false,
+      search_txt: "",
+      searchOptions: [],
+      isSlideLeft: false, //左侧分类收起
+
+      select_node: "", //节点唯一标识code
+      select_classify: "",
+      new_label: "", //双击修改的value
+      treeData: [], //分类数据
+      defaultShowNodes: [], //展开节点
+      defaultProp: {
+        label: "ExcelClassifyName",
+        children: "Children",
+      }, //树结构配置项
+      dynamicNode: null,
+
+      /* 分类弹窗 */
+      dialog_title: "",
+      classifyDia: false, //
+      classifyForm: {},
+
+      select_id: "", //选中的表格id
+      sheetDetailInfo: {},
+      sheet_title: "", //表格标题 双击标题修改时来存储最新值
+      sheetConfigOpt: {
+        showsheetbar: true,
+        data: null
+      },
+      sheetDataPage: 2,
+      sheetAllcellData:[],//全部单元格数据 分页push
+      dataToalPage: 0,
+      isSheetLoading: false,
+
+      /* 表格列表 */
+      publicHaveMove: true, //是否还有列表数据
+      sheetList: [],
+      sheet_total: 0,
+      sheet_page: 1,
+      sheet_pages_size: 16,
+
+      /* 另存为 */
+      isSaveOther: false,
+      saveOtherForm: {
+        name: '',
+				classify: ''
+      },
+      saveOtherFormRule: {
+        name: [
+          { required: true, message: "表格名称不能为空", trigger: "blur" },
+        ],
+        classify: [
+          { required: true, message: "表格分类不能为空", trigger: "blur" },
+        ],
+      },
+
+      isShowMe: false,
+
+      sourceMap: {
+        '/sheetAnalysisList': 4,
+      },
+    };
+  },
+  watch: {
+    /* 设置动态右侧区域宽度 */
+    isSlideLeft(newval) {
+      this.select_id && this.$refs.sheetRef && this.$refs.sheetRef.init();
+      this.$nextTick(() => {
+        this.reloadRightWid();
+      });
+    },
+    /* 表格id */
+    select_id(newval) {
+      this.sheetDataPage = 2,
+      this.sheetAllcellData = [],//全部单元格数据 分页push
+      this.dataToalPage = 0;
+      this.sheetConfigOpt.data = null;
+      newval && this.getDetailHandle();
+    },
+
+    select_classify(newval) {
+      if (this.$refs.sheetListWrap) this.$refs.sheetListWrap.$refs.listRef.scrollTop = 0;
+      if (newval) {
+        this.sheet_page = 1;
+        this.getPublicList();
+      }
+    },
+
+    /* 搜索关键词 */
+    search_txt(newval) {
+      if (newval) {
+        let search_obj = this.searchOptions.find(
+          (_) => _.ExcelInfoId === newval
+        );
+        let deep_arr = _.cloneDeep(this.treeData);
+        // 查找图表的分类父级id
+        let arr = this.findParentNodeHandle(deep_arr, search_obj.UniqueCode)
+          .slice(1)
+          .reverse(); // 父的父的父-父的父-父
+        this.defaultShowNodes = arr;
+        this.select_node = search_obj.UniqueCode;
+        this.$refs.treeRef.setCurrentKey(this.select_node);
+        // 重置筛选状态
+        this.select_id = newval;
+      }
+    },
+  },
+  methods: {
+
+    /* 获取表格分类 */
+    getTreeData(params = null) {
+      sheetInterface.classifyList({Source: this.sourceMap[this.$route.path],IsShowMe: this.isShowMe}).then((res) => {
+        const { Ret, Data } = res;
+        if (Ret !== 200) return;
+
+        this.showData = true;
+        this.treeData = Data.AllNodes || [];
+        this.$nextTick(() => {
+          /* 新增完成后 处理树展开和选中 */
+          params && this.selectCurrentNode(params);
+        });
+      });
+    },
+
+    /* 搜索表格 */
+    searchHandle(query) {
+      if (query) {
+        /* 查找列表 */
+        sheetInterface
+          .sheetList({
+            Keyword: query,
+            CurrentIndex: 1,
+            PageSize: 10000,
+            Source: this.sourceMap[this.$route.path]
+          })
+          .then((res) => {
+            if (res.Ret !== 200) return;
+            this.searchOptions = res.Data.List || [];
+          });
+      } else {
+        this.searchOptions = [];
+      }
+    },
+
+    /* 选中分类变化时 */
+    nodeChange({ UniqueCode, ExcelInfoId, ExcelClassifyId }, node) {
+      this.search_txt = "";
+      this.select_node = UniqueCode;
+      this.select_classify = !ExcelInfoId ? ExcelClassifyId : 0;
+      if (this.select_id !== ExcelInfoId) {
+        this.select_id = ExcelInfoId || 0;
+        this.sheetDetailInfo = {};
+      }
+      this.resetNodeStyle(node);
+      this.dynamicNode = node;
+    },
+
+    /* 添加一级目录 */
+    addLevelOneHandle() {
+      this.dialog_title = "添加";
+      this.classifyForm = {
+        classify_name: "",
+      };
+      this.classifyDia = true;
+    },
+
+    /* 编辑节点 */
+    editNode(node, { ExcelClassifyName, ExcelClassifyId }) {
+      this.dialog_title = "编辑";
+      /* 编辑目录 */
+      this.classifyForm = {
+        classify_name: ExcelClassifyName,
+        classify_id: ExcelClassifyId,
+      };
+      this.classifyDia = true;
+    },
+
+    /* 删除节点校验 */
+    async removeNode(node, { ExcelClassifyId, ExcelInfoId }) {
+      const { Data } = await sheetInterface.classifyDelCheck({
+        ExcelClassifyId,
+        ExcelInfoId,
+      });
+
+      const { DeleteStatus } = Data;
+
+      DeleteStatus === 1
+        ? this.$confirm("该分类下关联表格不可删除", "删除失败", {
+            confirmButtonText: "知道了",
+            showCancelButton: false,
+            type: "error",
+          })
+        : DeleteStatus === 0 && !ExcelInfoId
+        ? this.$confirm("确定删除当前分类吗?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(() => {
+            this.delApi(ExcelClassifyId, ExcelInfoId);
+          })
+        : null;
+    },
+
+    /* 删除方法 */
+    delApi(ExcelClassifyId, ExcelInfoId, type = "") {
+      sheetInterface
+        .classifyDel({
+          ExcelClassifyId,
+          ExcelInfoId,
+          Source: this.sourceMap[this.$route.path]
+        })
+        .then((res) => {
+          if (res.Ret !== 200) return;
+          this.$message.success(res.Msg);
+
+          if (!res.Data.ExcelInfoId) this.select_id = "";
+
+          //删除表格后自动显示下一张表格
+          type == "del" && res.Data.ExcelInfoId
+            ? this.getTreeData({
+                code: res.Data.UniqueCode,
+                id: res.Data.ExcelInfoId,
+              })
+            : this.getTreeData();
+
+          //删除封面
+          if (type === "del-list") {
+            let index = this.sheetList.findIndex(
+              (_) => _.ExcelInfoId === ExcelInfoId
+            );
+            this.sheetList.splice(index, 1);
+          }
+        });
+    },
+
+    /* 分类成功回调 */
+    classifyCallback(type) {
+      this.getTreeData();
+
+      if (type === "add") {
+        //新增分类完成之后,展开父节点显示刚新增的分类,若已展开节点则不做处理
+        let code = this.add_parent_id;
+        let flag = this.defaultShowNodes.some((item) => item === code);
+        // console.log(flag)
+        !flag && this.defaultShowNodes.push(code);
+        this.add_parent_id = "";
+      }
+    },
+
+    /* 展开对应菜单 显示详情 */
+    detailShowHandle({ UniqueCode, ExcelInfoId }) {
+      let params = {
+        code: UniqueCode,
+        id: ExcelInfoId,
+      };
+      this.selectCurrentNode(params);
+      this.select_classify = 0;
+    },
+
+    /* 下载数据 */
+    downloadExcel(cell) {
+      const { FileUrl, ExcelName } = cell;
+      this.downLoad(FileUrl, ExcelName);
+    },
+
+    downLoad(url, filename) {
+      const request = new window.XMLHttpRequest();
+      request.open("GET", url, true);
+      request.responseType = "blob";
+      request.onload = () => {
+        const url = window.URL.createObjectURL(request.response);
+        const a = document.createElement("a");
+        a.href = url;
+        a.target = "_blank";
+        a.download = filename;
+        a.style.display = "none";
+        document.body.append(a);
+        a.click();
+      };
+      request.send();
+    },
+
+    /* 保存表格 */
+    saveHandle: _.debounce(async function () {
+      luckysheet.exitEditMode();
+      let data = luckysheet.getAllSheets();
+
+      this.loading = this.$loading({
+        target: ".dataSheet-container",
+        lock: true,
+        text: "保存中...",
+        spinner: "el-icon-loading",
+        background: "rgba(255, 255, 255, 0.6)",
+      });
+
+      let img = getSheetImage(data[0]);
+      const form = new FormData();
+      form.append("Image", img);
+      const { Data } = await sheetInterface.uploadImg(form);
+
+      data.luckysheet_select_save = [];
+      const { ExcelInfoId, ExcelName, ExcelClassifyId } = this.sheetDetailInfo;
+      const res = await sheetInterface.sheetAnalysisInterface.sheetEdit({
+        ExcelInfoId,
+        ExcelName,
+        ExcelClassifyId,
+        ExcelImage: Data.ResourceUrl,
+        Content: JSON.stringify(data),
+      });
+      this.loading.close();
+      if (res.Ret !== 200) return;
+      this.$message.success("保存成功");
+      this.getTreeData();
+    }, 300),
+
+    /* 获取表格列表 */
+    getPublicList() {
+      sheetInterface
+        .sheetList({
+          CurrentIndex: this.sheet_page,
+          PageSize: this.sheet_pages_size,
+          ExcelClassifyId: this.select_classify || 0,
+          Source: this.sourceMap[this.$route.path],
+          IsShowMe: this.isShowMe 
+        })
+        .then((res) => {
+          if (res.Ret !== 200) return;
+
+          this.publicHaveMove = res.Data
+            ? this.sheet_page < res.Data.Paging.Pages
+            : false;
+          this.sheetList = res.Data
+            ? this.sheet_page === 1
+              ? res.Data.List
+              : [...this.sheetList, ...res.Data.List]
+            : [];
+          this.sheet_total = res.Data ? res.Data.Paging.Totals : 0;
+        });
+    },
+
+    /* 加载更多 */
+    loadMoreHandle: _.throttle(function () {
+      let scrollTop = this.$refs.sheetListWrap.$refs.listRef.scrollTop;
+      let clientHeight = this.$refs.sheetListWrap.$refs.listRef.clientHeight;
+      let scrollHeight = this.$refs.sheetListWrap.$refs.listRef.scrollHeight;
+      if (
+        scrollTop + clientHeight >= scrollHeight - 10 &&
+        this.publicHaveMove
+      ) {
+        this.sheet_page++;
+        this.getPublicList();
+      }
+    }, 300),
+
+    /* 获取表格详情 */
+    getDetailHandle() {
+      this.isSheetLoading = true;
+      sheetInterface.sheetAnalysisInterface.getExcelDetail({
+        UniqueCode: this.select_node,
+      }).then((res) => {
+        if (res.Ret !== 200) return;
+
+        this.sheetDetailInfo = res.Data.ExcelInfo;
+        this.dataToalPage =  Math.max(...res.Data.SheetList.map(_ => _.PageNum));
+        this.sheetAllcellData = res.Data.SheetList.map(_ => _.Data ? JSON.parse(_.Data.Data) : []);
+
+        this.getCellData(res.Data.SheetList)
+      });
+    },
+
+    //分页获取表格数据
+    async getCellData(sheets) {
+
+      let res = await sheetInterface.sheetAnalysisInterface.getExcelDataByPage({
+        UniqueCode: this.select_node,
+        Page: this.sheetDataPage
+      })
+
+      if(res.Ret !== 200) return
+      console.log(this.sheetAllcellData)
+
+      for(let i = 0;i<this.sheetAllcellData.length;i++) {
+        if(res.Data[i].Data) {
+          this.sheetAllcellData[i] = [...this.sheetAllcellData[i],...JSON.parse(res.Data[i].Data.Data)]
+        }
+
+        continue
+      }
+      
+      //数据继续加载或渲染表格.
+      if(this.sheetDataPage < this.dataToalPage) {
+        this.sheetDataPage++;
+        this.getCellData(sheets)
+      }else {
+        this.sheetConfigOpt.data = sheets.map((_,index) => ({
+          index: _.Index, //工作表id
+          order: _.Sort, //工作表的下标
+          name: _.SheetName,
+          calcChain: _.CalcChain?JSON.parse(_.CalcChain):[],
+          config: JSON.parse(_.Config),
+          celldata: this.sheetAllcellData[index],
+        }))
+
+        console.log(this.sheetConfigOpt)
+
+        this.isSheetLoading = false;
+      }
+    },
+
+    /* 删除表格 */
+    delSheetHandle({cell, type = ""}) {
+      const { ExcelClassifyId, ExcelInfoId  } = cell;
+      this.$confirm("删除后该表格将不能再引用,确认删除吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.delApi(ExcelClassifyId, ExcelInfoId, type);
+        })
+        .catch(() => {});
+    },
+
+    /* 表格另存为 */
+    saveOtherHandle() {
+      this.saveOtherForm.name = this.sheetDetailInfo.ExcelName + "(1)";
+      this.isSaveOther = true;
+    },
+
+    cancelSaveOther() {
+      this.$refs.formRef.resetFields();
+      this.saveOtherForm = {
+        name: '',
+				classify: ''
+      };
+      this.isSaveOther = false;
+    },
+
+    /* 另存为 */
+    async saveCopyOther() {
+      await this.$refs.formRef.validate();
+      let { classify, name } = this.saveOtherForm;
+
+      const res = await sheetInterface.copyExcel({
+        ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,
+        ExcelName: name,
+        ExcelClassifyId: classify
+      });
+
+      if (res.Ret !== 200) return;
+
+      this.$message.success("保存成功");
+      this.cancelSaveOther();
+      this.getTreeData();
+    },
+
+    /* 刷新表格 */
+    refreshSheet: _.debounce(async function() {
+      let res = await sheetInterface.sheetAnalysisInterface.sheetRefresh({ExcelInfoId: this.sheetDetailInfo.ExcelInfoId})
+
+      if(res.Ret !== 200) return 
+      this.$message.success(res.Msg)
+    },300),
+
+    /* 重绘右侧区域宽度 */
+    reloadRightWid() {
+      let total_wid = $(".data-sheet-main")[0].offsetWidth;
+      let left = $("#left")[0].offsetWidth;
+      let rigtWid = total_wid - left - 20 + "px";
+      $("#right")[0].style.width = rigtWid;
+    },
+
+    clickUpload() {
+      $(`#file`).click()
+    },
+
+    //选择文件上传
+    async fileSelected(){ 
+      let file = document.getElementById('file').files[0];
+      if(file){
+        if(!file.name.includes('.xlsx')) return this.$message.warning("上传失败,格式不符合xlsx");
+        if(file.size > 5.1*1024*1024) return this.$message.warning("上传文件最大不能超过5M");
+
+
+        const res = await sheetInterface.sheetAnalysisInterface.checkSheetRepeat({ExcelName: file.name})
+        if(res.Data.IsFind) return this.$message.warning('已有同名文件,请上传新文件')
+
+        this.$store.commit('sheet/SET_UPLOADFIlES',[file])
+        this.$router.push({ path: '/addAnalysisSheet' });
+      } 
+		},
+
+    //跳转生成指标
+    HandleToPath() {
+      this.$router.push({ path: '/createTaregtBySheet',query: {
+        code: this.sheetDetailInfo.UniqueCode 
+      }});
+    }
+
+  },
+  mounted() {
+    if (this.$route.query.code) {
+      this.getTreeData({
+        code: this.$route.query.code,
+        id: Number(this.$route.query.id),
+      });
+    } else {
+      this.getTreeData();
+      this.getPublicList();
+    }
+
+    window.addEventListener("resize", this.reloadRightWid);
+  },
+  destroyed() {
+    window.removeEventListener("resize", this.reloadRightWid);
+  },
+};
+</script>
+<style lang="scss" scoped>
+* {
+  box-sizing: border-box;
+}
+$mini-font: 12px;
+$normal-font: 14px;
+.dataSheet-container {
+  .slide-icon {
+    padding: 20px 0;
+    /* display: block; */
+    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    cursor: pointer;
+    position: absolute;
+    top: 50%;
+    transform: translateY(-50%);
+    z-index: 99;
+    &:hover {
+      background-color: rgba(0, 0, 0, 0.05);
+    }
+    &.slide-left {
+      right: 0;
+    }
+    &.slide-right {
+      left: 0;
+    }
+  }
+  .data-sheet-main {
+    display: flex;
+    position: relative;
+
+    .main-left {
+      width: 400px;
+      min-width: 350px;
+      background: #fff;
+      margin-right: 20px;
+      border: 1px solid #ececec;
+      border-radius: 4px;
+      box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
+      height: calc(100vh - 120px);
+      overflow: hidden;
+      position: relative;
+      box-sizing: border-box;
+
+      .datasheet_top {
+        padding: 20px;
+        background: #fff;
+        border: 1px solid #ececec;
+        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
+        margin-bottom: 20px;
+      }
+      .search-cont {
+        padding: 0 20px;
+      }
+
+      .tree-cont {
+        padding: 30px 20px;
+        max-height: calc(100vh - 280px);
+        overflow: auto;
+      }
+      .target_tree {
+        color: #333;
+        .custom-tree-node {
+          display: flex !important;
+          justify-content: space-between;
+          align-items: center;
+          display: block;
+          flex: 1;
+          .node_label {
+            margin-right: 2px;
+          }
+          .el-icon-view {
+            color: #409eff;
+            font-size: 18px;
+            margin-left: 5px;
+          }
+        }
+      }
+      .noDepart {
+        margin: 60px 0;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        color: #409eff;
+        font-size: 16px;
+        cursor: pointer;
+      }
+      .move-btn {
+        height: 100%;
+        width: 4px;
+        /* opacity: 0; */
+        position: absolute;
+        right: 0px;
+        top: 0;
+        &:hover {
+          cursor: col-resize;
+          /* background-color: orange */
+        }
+      }
+    }
+
+    .main-right {
+      width: 80%;
+      position: relative;
+      .sheet-detail-wrapper {
+        height: 100%;
+        border: 1px solid #ececec;
+        border-radius: 4px;
+        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
+        overflow: auto;
+        background: #fff;
+        .detail-top {
+          padding: 20px;
+          display: flex;
+          justify-content: space-between;
+          align-items: center;
+          border-bottom: 1px solid #ececec;
+          .sheet-name {
+            font-size: 17px;
+            cursor: pointer;
+            max-width: 450px;
+            &:hover {
+              text-decoration: underline;
+            }
+          }
+          .action-ul {
+            display: flex;
+            li {
+              margin: 0 10px;
+            }
+          }
+        }
+        .sheet-wrap {
+          position: relative;
+          height: calc(100vh - 190px);
+          padding: 15px;
+          /* min-height: 500px; */
+        }
+      }
+
+      .sheet-list-cont {
+        color: #333;
+        .el-card .el-card__header,
+        .el-card__body {
+          padding: 10px;
+        }
+
+        .sheetlist-wrapper {
+          margin-top: 10px;
+          display: flex;
+          flex-wrap: wrap;
+          max-height: calc(100vh - 143px);
+          overflow: hidden;
+          overflow-y: auto;
+          .drag-cont {
+            width: 100%;
+            display: flex;
+            flex-wrap: wrap;
+          }
+          .dragShdow {
+            box-shadow: 0 1px 8px rgba(64, 158, 255, 0.8);
+            opacity: 0.5;
+          }
+          .sheet-item {
+            .item-top {
+              display: flex;
+              justify-content: space-between;
+              align-items: center;
+              font-size: 16px;
+              font-weight: 600;
+            }
+            .chart-img {
+              width: 100%;
+              /* height: 230px; */
+              object-fit: contain !important;
+              cursor: pointer;
+            }
+            .item-bottom {
+              margin-top: 10px;
+              display: flex;
+              justify-content: space-between;
+              font-size: 12px;
+              color: #666;
+              .collected {
+                color: #f00;
+                cursor: pointer;
+              }
+              .join_txt {
+                color: #409eff;
+                cursor: pointer;
+              }
+            }
+          }
+        }
+        .nodata {
+          text-align: center;
+        }
+      }
+    }
+  }
+}
+</style>
+
+<style lang="scss">
+.dataSheet-container {
+  .label-input .el-input__inner {
+    height: 25px;
+    line-height: 25px;
+    padding: 0 10px;
+  }
+
+  .el-tree__drop-indicator {
+    height: 3px;
+    background-color: #409eff;
+  }
+  .el-tree-node__content {
+    margin-bottom: 14px !important;
+  }
+  .el-tree-node__children {
+    .el-tree-node {
+      /* margin-bottom: 8px !important; */
+      margin-bottom: 0px !important;
+      padding-left: 18px;
+    }
+    .el-tree-node__content {
+      margin-bottom: 5px !important;
+      padding-left: 0 !important;
+    }
+  }
+  .expanded.el-icon-caret-right:before {
+    content: url("~@/assets/img/set_m/down.png") !important;
+  }
+  .el-icon-caret-right:before {
+    content: url("~@/assets/img/set_m/slide.png") !important;
+  }
+  .el-tree-node__expand-icon.is-leaf.el-icon-caret-right:before {
+    content: "" !important;
+  }
+  .el-tree-node__expand-icon.expanded {
+    -webkit-transform: rotate(0deg);
+    transform: rotate(0deg);
+  }
+  .el-tree-node.is-current > .el-tree-node__content {
+    background-color: #f0f4ff !important;
+  }
+  .el-tree-node__content {
+    padding-right: 10px !important;
+  }
+}
+.sheet-classify-cascader .el-input {
+	width: 100%;
+}
+</style>

+ 1 - 1
src/views/datasheet_manage/customSheetEdit.vue

@@ -165,7 +165,7 @@ export default {
 
     /* 获取分类 */
     getClassify() {
-      sheetInterface.excelClassifyOne().then(res => {
+      sheetInterface.excelClassifyOne({Source: 2}).then(res => {
         if(res.Ret !==200) return
         
         this.classifyArr = res.Data.AllNodes || [];

+ 1 - 1
src/views/datasheet_manage/mixedSheetEdit.vue

@@ -117,7 +117,7 @@ export default {
 
     /* 获取分类 */
     getClassify() {
-      sheetInterface.excelClassifyOne().then(res => {
+      sheetInterface.excelClassifyOne({Source: 3}).then(res => {
         if(res.Ret !==200) return
         
         this.classifyArr = res.Data.AllNodes || [];

+ 38 - 2
src/views/datasheet_manage/mixins/classifyMixin.js

@@ -85,7 +85,9 @@ export default {
 		editNodeLabel(data,type='') {
       if(type === 'edit-tit') {
         if([2,3].includes(this.sheetDetailInfo.Source)) return
-        if(!this.permissionBtn.isShowBtn('etaTablePermission','etaTable_classifyOpt_edit')) return
+        // if(!this.permissionBtn.isShowBtn('etaTablePermission','etaTable_classifyOpt_edit')) return
+
+        if(!this.isSheetBtnShow('classifyOpt_edit')) return
         this.$set(data,'isEditTit',true)
         this.sheet_title = data.ExcelName;
         this.$nextTick(() => {
@@ -114,7 +116,8 @@ export default {
   
         this.new_label !== data.ClassifyName && sheetInterface.classifyEdit({
           ExcelClassifyId: data.ExcelClassifyId,
-          ExcelClassifyName: this.new_label
+          ExcelClassifyName: this.new_label,
+          Source: this.sourceMap[this.$route.path]
         }).then(res => {
           if(res.Ret !== 200) return
   
@@ -286,5 +289,38 @@ export default {
 
       return canDrop;
     },
+
+    //判断右侧列表的下载按钮是否显示
+    isDownLoadShow(cell){
+        const {checkPermissionBtn,etaTablePermission} = this.permissionBtn
+        const checkMap = {
+            1:etaTablePermission.etaTable_excel_download,
+            2:etaTablePermission.etaTable_customize_data_download,
+            3:etaTablePermission.etaTable_customize_mix_download,
+            4:etaTablePermission.etaTable_analysis_download
+        }
+        return checkPermissionBtn(checkMap[cell.Source])
+    },
+    //判断右侧列表的删除按钮是否显示
+    isDeleteShow(cell){
+        const {checkPermissionBtn,etaTablePermission} = this.permissionBtn
+        const checkMap = {
+            1:etaTablePermission.etaTable_excel_del,
+            2:etaTablePermission.etaTable_customize_data_del,
+            3:etaTablePermission.etaTable_customize_mix_del,
+            4:etaTablePermission.etaTable_analysis_del,
+        }
+        return checkPermissionBtn(checkMap[cell.Source])
+    },
+    //判断自定义表格-编辑,另存为,刷新按钮是否显示
+    isSheetBtnShow(type){
+      const sheetType = {
+        '/sheetList': 'etaTable_excel',
+        '/sheetTimeList': 'etaTable_customize_data',
+        '/sheetMixedList': 'etaTable_customize_mix',
+        '/sheetAnalysisList': 'etaTable_analysis'
+      }
+      return this.permissionBtn.isShowBtn('etaTablePermission',`${sheetType[this.$route.path]}_${type}`)
+    }
   },
 };

+ 74 - 138
src/views/datasheet_manage/sheetList.vue

@@ -10,20 +10,11 @@
     <div class="data-sheet-main" id="box">
       <div class="main-left left" id="left" v-show="!isSlideLeft">
         <div class="datasheet_top">
-          <el-button v-permission="permissionBtn.etaTablePermission.etaTable_excel"
-            type="primary" style="margin-right:20px" @click="goAddSheetHandle(1)"
+          <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_excel)&&sourceMap[$route.path]===1" type="primary" style="margin-right:20px" @click="goAddSheetHandle"
           >添加Excel表格</el-button >
+          <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_customize_data_sheetAdd)&&sourceMap[$route.path]===2" type="primary" style="margin-right:20px" @click="goAddSheetHandle">添加时间序列表格</el-button >
+          <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_customize_mix_sheetAdd)&&sourceMap[$route.path]===3" type="primary" @click="goAddSheetHandle">添加混合表格</el-button >
 
-          <el-dropdown v-if="isShowDataSheet||isShowMixSheet"
-            @command="goAddSheetHandle">
-            <el-button type="primary">
-              自定义表格<i class="el-icon-arrow-down el-icon--right"></i>
-            </el-button>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item :command="2" v-if="isShowDataSheet">数据表格</el-dropdown-item>
-              <el-dropdown-item :command="3" v-if="isShowMixSheet">混合表格</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
         </div>
         <div class="search-cont">
           <el-select
@@ -77,7 +68,7 @@
                 placeholder="请输入值"
                 class="label-input"
                 v-model="new_label"
-                v-if="data.isEdit&&permissionBtn.isShowBtn('etaTablePermission','etaTable_classifyOpt_edit')"
+                v-if="data.isEdit&&isSheetBtnShow('classifyOpt_edit')"
                 @blur="changeValue(data)"
               />
               <span
@@ -104,7 +95,7 @@
                   alt=""
                   style="width: 15px; height: 14px; margin-right: 8px"
                   @click.stop="editNode(node, data)"
-                  v-if="!data.ExcelInfoId&&permissionBtn.isShowBtn('etaTablePermission','etaTable_classifyOpt_edit')"
+                  v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_edit')"
                 />
                 <img
                   slot="reference"
@@ -112,12 +103,12 @@
                   alt=""
                   style="width: 14px; height: 14px"
                   @click.stop="removeNode(node, data)"
-                  v-if="!data.ExcelInfoId&&permissionBtn.isShowBtn('etaTablePermission','etaTable_classifyOpt_delete')"
+                  v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_delete')"
                 />
               </span>
             </span>
           </el-tree>
-          <div class="noDepart" @click="addLevelOneHandle" v-if="permissionBtn.isShowBtn('etaTablePermission','etaTable_classifyOpt_edit')">
+          <div class="noDepart" @click="addLevelOneHandle" v-if="isSheetBtnShow('classifyOpt_edit')">
             <img
               src="~@/assets/img/set_m/add_ico.png"
               alt=""
@@ -171,7 +162,7 @@
                 @click="saveHandle"
                 v-if="
                   sheetDetailInfo.Source === 1 &&
-                  sheetDetailInfo.Button.OpButton&&permissionBtn.isShowBtn('etaTablePermission','etaTable_excel_save')
+                  sheetDetailInfo.Button.OpButton&&isSheetBtnShow('save')
                 "
               >
                 保存
@@ -180,21 +171,21 @@
                 <li
                   class="editsty"
                   @click="goEditHandle"
-                  v-if="sheetDetailInfo.Button.OpButton&&isSheetBtnShow(sheetDetailInfo,'edit')"
+                  v-if="sheetDetailInfo.Button.OpButton&&isSheetBtnShow('edit')"
                 >
                   编辑
                 </li>
                 <li
                   class="editsty"
-                  @click="refreshSheet"
-                  v-if="sheetDetailInfo.Button.RefreshButton&&isSheetBtnShow(sheetDetailInfo,'refresh')"
+                  @click="refreshSheetEdb"
+                  v-if="sheetDetailInfo.Button.RefreshButton&&isSheetBtnShow('refresh')"
                 >
                   刷新
                 </li>
                 <li
                   class="editsty"
                   @click="saveOtherHandle"
-                  v-if="sheetDetailInfo.Button.CopyButton&&isSheetBtnShow(sheetDetailInfo,'otherSave')"
+                  v-if="sheetDetailInfo.Button.CopyButton&&isSheetBtnShow('otherSave')"
                 >
                   另存为
                 </li>
@@ -209,7 +200,7 @@
                   sheetDetailInfo.Button && sheetDetailInfo.Button.DeleteButton
                   &&isDeleteShow(sheetDetailInfo)
                 "
-                @click="delSheetHandle(sheetDetailInfo, 'del')"
+                @click="delSheetHandle({cell:sheetDetailInfo, type:'del'})"
               >
                 删除
               </li>
@@ -221,11 +212,18 @@
             <Sheet
               ref="sheetRef"
               v-if="sheetDetailInfo.Source === 1"
-              :option="sheetDetailInfo.Content"
+              :option="{
+                data: [{
+                  ...JSON.parse(sheetDetailInfo.Content),
+                  scrollTop: 0,
+                  scrollLeft: 0
+                }]
+              }"
               :sheetInfo="{
                 ExcelInfoId: sheetDetailInfo.ExcelInfoId,
                 ExcelName: sheetDetailInfo.ExcelName,
                 ExcelClassifyId: sheetDetailInfo.ExcelClassifyId,
+                Source: sheetDetailInfo.Source
               }"
             />
 
@@ -245,52 +243,17 @@
           </div>
         </div>
 
-        <!-- 列表 -->
-        <div class="sheet-list-cont" v-else>
-          <span>共{{ sheet_total }}张表格</span>
-          <div class="sheetlist-wrapper" ref="listRef" @scroll="loadMoreHandle">
-            <el-col
-              :span="6"
-              style="margin-bottom: 20px; padding-right: 20px"
-              v-for="cell in sheetList"
-              :key="cell.ExcelInfoId"
-            >
-              <el-card class="sheet-item">
-                <div slot="header" class="item-top">
-                  <span class="text_oneLine">{{ cell.ExcelName }}</span>
-                </div>
-                <img
-                  :src="cell.ExcelImage"
-                  alt=""
-                  class="chart-img"
-                  :height="imgHeight"
-                  @click="detailShowHandle(cell)"
-                />
-                <div class="item-bottom">
-                  <span>创建时间: {{ cell.CreateTime.slice(0, 10) }}</span>
-                  <div>
-                    <span
-                      v-if="isDownLoadShow(cell)"
-                      class="editsty"
-                      style="margin-right: 10px"
-                      @click="downloadExcel(cell)"
-                      >下载</span
-                    >
-                    <span
-                      v-if="isDeleteShow(cell)"
-                      class="deletesty"
-                      @click="delSheetHandle(cell, 'del-list')"
-                      >删除</span
-                    >
-                  </div>
-                </div>
-              </el-card>
-            </el-col>
-          </div>
-          <div v-if="!sheet_total" class="nodata">
-            <tableNoData text="暂无表格"/>
-          </div>
-        </div>
+         <!-- 列表 -->
+        <sheetListWrap
+          v-else
+          :total="sheet_total" 
+          :list="sheetList" 
+          @loadMoreHandle="loadMoreHandle"
+          @detailShowHandle="detailShowHandle"
+          @delSheetHandle="delSheetHandle"
+          @downloadExcel="downloadExcel"
+          ref="sheetListWrap"
+        />
       </div>
     </div>
 
@@ -366,9 +329,10 @@ import Sheet from "./components/SheetExcel.vue";
 import { getSheetImage } from "./common/option";
 import CustomTable from "./components/CustomTable.vue";
 import MixedTable from "./components/MixedTable.vue";
+import sheetListWrap from "./components/sheetListWrap.vue"
 export default {
   name: "",
-  components: { mDialog, classifyDia, Sheet, CustomTable, MixedTable },
+  components: { mDialog, classifyDia, Sheet, CustomTable, MixedTable,sheetListWrap },
   mixins: [leftMixin],
   computed: {
     downExcelFileUrl() {
@@ -431,7 +395,6 @@ export default {
       sheet_total: 0,
       sheet_page: 1,
       sheet_pages_size: 16,
-      imgHeight: 196,
 
       /* 另存为 */
       isSaveOther: false,
@@ -447,6 +410,12 @@ export default {
           { required: true, message: "表格分类不能为空", trigger: "blur" },
         ],
       },
+
+      sourceMap: {
+        '/sheetList': 1,
+        '/sheetTimeList': 2,
+        '/sheetMixedList': 3,
+      }
     };
   },
   watch: {
@@ -463,7 +432,7 @@ export default {
     },
 
     select_classify(newval) {
-      if (this.$refs.listRef) this.$refs.listRef.scrollTop = 0;
+      if (this.$refs.sheetListWrap) this.$refs.sheetListWrap.$refs.listRef.scrollTop = 0;
       if (newval) {
         this.sheet_page = 1;
         this.getPublicList();
@@ -491,9 +460,10 @@ export default {
   },
   methods: {
     /* 添加表格 */
-    goAddSheetHandle(type) {
-      if (!this.treeData.length)
-        return this.$message.warning("请先添加表格分类");
+    goAddSheetHandle() {
+      if (!this.treeData.length) return this.$message.warning("请先添加表格分类");
+      let type = this.sourceMap[this.$route.path];
+
       let path = {
         1: "/addsheet",
         2: "/addCustomSheet",
@@ -510,7 +480,7 @@ export default {
 
     /* 获取表格分类 */
     getTreeData(params = null) {
-      sheetInterface.classifyList().then((res) => {
+      sheetInterface.classifyList({Source: this.sourceMap[this.$route.path]}).then((res) => {
         const { Ret, Data } = res;
         if (Ret !== 200) return;
 
@@ -527,13 +497,12 @@ export default {
     searchHandle(query) {
       if (query) {
         /* 查找列表 */
-        sheetInterface
-          .sheetList({
+        sheetInterface.sheetList({
             Keyword: query,
             CurrentIndex: 1,
             PageSize: 10000,
-          })
-          .then((res) => {
+            Source: this.sourceMap[this.$route.path]
+          }).then((res) => {
             if (res.Ret !== 200) return;
             this.searchOptions = res.Data.List || [];
           });
@@ -607,6 +576,7 @@ export default {
         .classifyDel({
           ExcelClassifyId,
           ExcelInfoId,
+          Source: this.sourceMap[this.$route.path]
         })
         .then((res) => {
           if (res.Ret !== 200) return;
@@ -731,32 +701,31 @@ export default {
 
     /* 获取表格列表 */
     getPublicList() {
-      sheetInterface
-        .sheetList({
-          CurrentIndex: this.sheet_page,
-          PageSize: this.sheet_pages_size,
-          ExcelClassifyId: this.select_classify || 0,
-        })
-        .then((res) => {
-          if (res.Ret !== 200) return;
-
-          this.publicHaveMove = res.Data
-            ? this.sheet_page < res.Data.Paging.Pages
-            : false;
-          this.sheetList = res.Data
-            ? this.sheet_page === 1
-              ? res.Data.List
-              : [...this.sheetList, ...res.Data.List]
-            : [];
-          this.sheet_total = res.Data ? res.Data.Paging.Totals : 0;
-        });
+      sheetInterface.sheetList({
+        CurrentIndex: this.sheet_page,
+        PageSize: this.sheet_pages_size,
+        ExcelClassifyId: this.select_classify || 0,
+        Source: this.sourceMap[this.$route.path]
+      }).then((res) => {
+        if (res.Ret !== 200) return;
+
+        this.publicHaveMove = res.Data
+          ? this.sheet_page < res.Data.Paging.Pages
+          : false;
+        this.sheetList = res.Data
+          ? this.sheet_page === 1
+            ? res.Data.List
+            : [...this.sheetList, ...res.Data.List]
+          : [];
+        this.sheet_total = res.Data ? res.Data.Paging.Totals : 0;
+      });
     },
 
     /* 加载更多 */
     loadMoreHandle: _.throttle(function () {
-      let scrollTop = this.$refs.listRef.scrollTop;
-      let clientHeight = this.$refs.listRef.clientHeight;
-      let scrollHeight = this.$refs.listRef.scrollHeight;
+      let scrollTop = this.$refs.sheetListWrap.$refs.listRef.scrollTop;
+      let clientHeight = this.$refs.sheetListWrap.$refs.listRef.clientHeight;
+      let scrollHeight = this.$refs.sheetListWrap.$refs.listRef.scrollHeight;
       if (
         scrollTop + clientHeight >= scrollHeight - 10 &&
         this.publicHaveMove
@@ -790,7 +759,8 @@ export default {
     },
 
     /* 删除表格 */
-    delSheetHandle({ ExcelClassifyId, ExcelInfoId }, type = "") {
+    delSheetHandle({cell, type = ""}) {
+      const { ExcelClassifyId, ExcelInfoId  } = cell;
       this.$confirm("删除后该表格将不能再引用,确认删除吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -815,7 +785,7 @@ export default {
     },
 
     /* 刷新表格 */
-    refreshSheet: _.debounce(async function () {
+    refreshSheetEdb: _.debounce(async function () {
       const res = await sheetInterface.refreshCustomSheet({
         ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,
       });
@@ -864,40 +834,6 @@ export default {
       let left = $("#left")[0].offsetWidth;
       let rigtWid = total_wid - left - 20 + "px";
       $("#right")[0].style.width = rigtWid;
-
-      !this.select_id &&
-        this.$nextTick(() => {
-          this.imgHeight =
-            $(".chart-img")[0].offsetWidth / 1.64 > 150
-              ? $(".chart-img")[0].offsetWidth / 1.64
-              : 150;
-        });
-    },
-    //判断右侧列表的下载按钮是否显示
-    isDownLoadShow(cell){
-        const {checkPermissionBtn,etaTablePermission} = this.permissionBtn
-        const checkMap = {
-            1:etaTablePermission.etaTable_excel_download,
-            2:etaTablePermission.etaTable_customize_data_download,
-            3:etaTablePermission.etaTable_customize_mix_download
-        }
-        return checkPermissionBtn(checkMap[cell.Source])
-    },
-    //判断右侧列表的删除按钮是否显示
-    isDeleteShow(cell){
-        const {checkPermissionBtn,etaTablePermission} = this.permissionBtn
-        const checkMap = {
-            1:etaTablePermission.etaTable_excel_del,
-            2:etaTablePermission.etaTable_customize_data_del,
-            3:etaTablePermission.etaTable_customize_mix_del
-        }
-        return checkPermissionBtn(checkMap[cell.Source])
-    },
-    //判断自定义表格-编辑,另存为,刷新按钮是否显示
-    isSheetBtnShow(cell,type){
-        console.log('cell',cell.Source)
-        const sheetType = cell.Source===2?'data':'mix'
-        return this.permissionBtn.isShowBtn('etaTablePermission',`etaTable_customize_${sheetType}_${type}`)
     }
   },
   mounted() {

+ 2 - 0
src/vuex/index.js

@@ -5,6 +5,7 @@ import sand from "./modules/sand";
 import ppt from "./modules/ppt";
 import edb from "./modules/edb";
 import permissionButton from "./modules/permissionButton";
+import sheet from "./modules/sheet";
 
 
 // 应用初始状态
@@ -42,5 +43,6 @@ export default {
     ppt,
     edb,
     permissionButton,
+    sheet
   },
 };

+ 14 - 0
src/vuex/modules/sheet.js

@@ -0,0 +1,14 @@
+
+const sheet = {
+  namespaced: true,
+  state: {
+    files: null, 
+  },
+
+  mutations: {
+    SET_UPLOADFIlES(state,files) {
+      state.files = files
+    }
+  }
+}
+export default sheet;