Przeglądaj źródła

数据表格,混合表格独立

Karsa 1 rok temu
rodzic
commit
5cd375aa7c

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

@@ -254,4 +254,88 @@ export const insertData = params => {
  */
 export const getDateLatelyData = params => {
 	return http.get('/datamanage/edb_info/date_data/before_after',params)
+}
+
+
+/* =====自定义分析==== */
+
+export const sheetAnalysisInterface = {
+	/**
+	 * 获取分类
+	 * @returns 
+	 */
+	classifyList: params =>{
+		return http.get('/datamanage/excel_classify/list',params)
+	},
+
+	/**
+	 * 新增分类
+	 * @param {*} params  "ExcelClassifyName": "分类1-2"
+	 * @returns 
+	 */
+	classifyAdd: params =>{
+		return http.post('/datamanage/excel_classify/add',params)
+	},
+
+	/**
+	 * 编辑分类
+	 * @param {*} params  ExcelClassifyName ExcelClassifyId
+	 * @returns 
+	 */
+	classifyEdit: params =>{
+		return http.post('/datamanage/excel_classify/edit',params)
+	},
+
+	/**
+	 * 删除分类检测
+	 * @param {*} params ExcelClassifyId ExcelInfoId
+	 * @returns 
+	 */
+	classifyDelCheck: params =>{
+		return  http.post('/datamanage/excel_classify/delete/check',params)
+	},
+
+	/**
+	 * 删除分类
+	 * @param {*} params ExcelClassifyId ExcelInfoId
+	 * @returns 
+	 */
+	classifyDel: params =>{
+		return  http.post('/datamanage/excel_classify/delete',params)
+	},
+
+	/**
+	 * 移动分类
+	 * @param {*} params ClassifyId "PrevClassifyId":1, "NextClassifyId":2,
+	 * @returns 
+	 */
+	classifyMove: params =>{
+		return  http.post('/datamanage/excel_classify/move',params)
+	},
+
+	/**
+	 * 移动表格
+	 * @param {*} params ExcelClassifyId ExcelInfoId PrevExcelInfoId NextExcelInfoId
+	 * @returns 
+	 */
+	sheetMove: params => {
+		return http.post('/datamanage/excel_info/move',params)
+	},
+
+	/**
+	 * 表格列表
+	 * @param {*} params  CurrentIndex  PageSize  ExcelClassifyId 
+	 */
+	sheetList: params => {
+		return http.get('/datamanage/excel_info/list',params)
+	},
+
+	/**
+	 * 表格分类
+	 * @param {*} params 
+	 * @returns 
+	 */
+	excelClassifyOne: params => {
+		return http.get('/datamanage/excel_classify/items',params)
+	}
 }

+ 1 - 1
src/routes/modules/chartRoutes.js

@@ -87,7 +87,7 @@ export default [
 				component:()=>import('@/views/datasheet_manage/sheetList.vue')
 			},
 			{
-				path:"sheetDimeList",
+				path:"sheetTimeList",
 				name:"时间序列表格",
 				component:()=>import('@/views/datasheet_manage/sheetList.vue')
 			},

+ 16 - 1
src/utils/buttonConfig.js

@@ -292,10 +292,25 @@ export const etaTablePermission = {
     etaTable_customize_otherSave:'etaTable:customize:otherSave',
     etaTable_customize_refresh:'etaTable:customize:refresh',
     etaTable_customize_edit:'etaTable:customize:edit',
+
     /*-----------常规表格--------- */
     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_timeorder_del:'etaTable:timeorder:del',
+    etaTable_timeorder_download:'etaTable:timeorder:download',
+    etaTable_timeorder_otherSave:'etaTable:timeorder:otherSave',
+    etaTable_timeorder_refresh:'etaTable:timeorder:refresh',
+    etaTable_timeorder_edit:'etaTable:timeorder:edit',
+
+    /* 混合表格 */
+    etaTable_mixed_del:'etaTable:mixed:del',
+    etaTable_mixed_download:'etaTable:mixed:download',
+    etaTable_mixed_otherSave:'etaTable:mixed:otherSave',
+    etaTable_mixed_refresh:'etaTable:mixed:refresh',
+    etaTable_mixed_edit:'etaTable:mixed:edit',
 }
 /*
  * --------------------------------------------------------------------------ETA逻辑------------------------------------------------

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

@@ -81,6 +81,8 @@ export default {
       
 			const handleMap = {
 				'/sheetList': this.sheetClassifyApi,
+				'/sheetTimeList': this.sheetClassifyApi,
+				'/sheetMixedList': this.sheetClassifyApi,
 				'/commordityChartBase': this.commodityClassifyApi,
 				'/chartrelevance':this.relevanceClassifyApi,
 				'/fittingEquationList': this.fittingEquationClassifyApi,
@@ -92,8 +94,8 @@ export default {
 		/* 表格分类接口 */
 		async sheetClassifyApi(classify_name,classify_id) {
 			const { Ret,Msg } = this.title==='添加' 
-        ? 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);

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

@@ -157,7 +157,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

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

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

@@ -114,7 +114,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
   

+ 17 - 16
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="sourceMap[$route.path]===2" type="primary" style="margin-right:20px" @click="goAddSheetHandle">添加时间序列表格</el-button >
+          <el-button v-if="sourceMap[$route.path]===3" type="primary" @click="goAddSheetHandle">添加混合表格</el-button >
 
-          <el-dropdown v-permission="permissionBtn.etaTablePermission.etaTable_customize"
-            @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">数据表格</el-dropdown-item>
-              <el-dropdown-item :command="3">混合表格</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
         </div>
         <div class="search-cont">
           <el-select
@@ -407,6 +398,12 @@ export default {
           { required: true, message: "表格分类不能为空", trigger: "blur" },
         ],
       },
+
+      sourceMap: {
+        '/sheetList': 1,
+        '/sheetTimeList': 2,
+        '/sheetMixedList': 3,
+      }
     };
   },
   watch: {
@@ -451,9 +448,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",
@@ -470,7 +468,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;
 
@@ -491,6 +489,7 @@ export default {
             Keyword: query,
             CurrentIndex: 1,
             PageSize: 10000,
+            Source: this.sourceMap[this.$route.path]
           }).then((res) => {
             if (res.Ret !== 200) return;
             this.searchOptions = res.Data.List || [];
@@ -565,6 +564,7 @@ export default {
         .classifyDel({
           ExcelClassifyId,
           ExcelInfoId,
+          Source: this.sourceMap[this.$route.path]
         })
         .then((res) => {
           if (res.Ret !== 200) return;
@@ -693,6 +693,7 @@ export default {
         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;