Quellcode durchsuchen

分类更改三级目录,
新增日期计算,
导入日期逻辑更改

Karsa vor 1 Jahr
Ursprung
Commit
0f4f9d98f1

+ 23 - 1
src/api/modules/sheetApi.js

@@ -263,7 +263,7 @@ export const insertData = params => {
  * @returns 
  * @returns 
  */
  */
 export const getDateLatelyData = params => {
 export const getDateLatelyData = params => {
-	return http.get('/datamanage/edb_info/date_data/before_after',params)
+	return http.post('/datamanage/edb_info/date_data/before_after',params)
 }
 }
 
 
 /**
 /**
@@ -309,6 +309,28 @@ export const getRefreshResult = (params)=>{
     return http.post('/datamanage/excel_info/table/batch_refresh/result',params)
     return http.post('/datamanage/excel_info/table/batch_refresh/result',params)
 }
 }
 
 
+
+/**
+ * 日期计算
+ * @param {
+ * 	Formula,
+ * 	DateList: [{Date,Tag}]
+ * } params 
+ * @returns 
+ */
+export const getDateCalculate = params => {
+	return http.post('/datamanage/excel_info/mixed/date_calculate',params)
+}
+
+/**
+ * 根据id获取指标基础信息 无数据
+ * @param {*EdbInfoIds} params 
+ * @returns 
+ */
+export const getEdbBaseInfo = params => {
+	return http.get('/datamanage/excel_info/base_edb_info',params)
+}
+
 /* =====自定义分析==== */
 /* =====自定义分析==== */
 
 
 export const sheetAnalysisInterface = {
 export const sheetAnalysisInterface = {

+ 4 - 1
src/views/chartRelevance_manage/components/selectTarget.vue

@@ -73,7 +73,7 @@
       remote
       remote
       clearable
       clearable
       placeholder="请选择指标名称"
       placeholder="请选择指标名称"
-      :style="`width: 100%; ${filter?'margin-top: 20px':''}`"
+      :style="`width: ${width}; ${filter?'margin-top: 20px':''}`"
       :remote-method="searchHandle"
       :remote-method="searchHandle"
       @click.native="inputFocusHandle"
       @click.native="inputFocusHandle"
       @change="handleSelectTarget"
       @change="handleSelectTarget"
@@ -113,6 +113,9 @@ export default {
       },
       },
       filter: { //是否要预测和eta的筛选
       filter: { //是否要预测和eta的筛选
         default: true
         default: true
+      },
+      width: {
+        default:'100%'
       }
       }
     },
     },
     watch:{
     watch:{

+ 13 - 12
src/views/datasheet_manage/addSheet.vue

@@ -11,19 +11,20 @@
           </el-input>
           </el-input>
         </li>
         </li>
         <li>
         <li>
-          <el-select 
-            v-model="sheetForm.classify" 
-            placeholder="请选择表格分类"
-            style="width:240px"
+          <el-cascader
+            v-model="sheetForm.classify"
+            :options="classifyArr"
+            style="width:240px;"
+            :props="{
+              label: 'ExcelClassifyName',
+              value: 'ExcelClassifyId',
+              children: 'Children',
+              emitPath: false,
+              checkStrictly: true
+            }"
             clearable
             clearable
-          >
-							<el-option
-								v-for="item in classifyArr"
-								:key="item.ExcelClassifyId"
-								:label="item.ExcelClassifyName"
-								:value="item.ExcelClassifyId"
-              />
-						</el-select>
+            placeholder="请选择表格分类"
+          />
         </li>
         </li>
       </ul>
       </ul>
       <div v-if="updateTime" style="color:#999999;margin-right: 30px;">最近保存时间:{{ updateTime }}</div>
       <div v-if="updateTime" style="color:#999999;margin-right: 30px;">最近保存时间:{{ updateTime }}</div>

+ 1 - 0
src/views/datasheet_manage/common/customTable.js

@@ -142,6 +142,7 @@ export function getRightClickMenu(pos,canEdit=false) {
     // { label: "插入指标值", key: "insert-value" },
     // { label: "插入指标值", key: "insert-value" },
     { label: "导入日期", key: "insert-date" },
     { label: "导入日期", key: "insert-date" },
     // { label: "导入指标日期", key: "insert-edb-date" },
     // { label: "导入指标日期", key: "insert-edb-date" },
+    { label: "日期计算", key: "insert-date-calculate" },
     { label: "指标计算",
     { label: "指标计算",
       key: "insert-edb-calculate",
       key: "insert-edb-calculate",
       children: [
       children: [

+ 74 - 22
src/views/datasheet_manage/components/MixedTable.vue

@@ -65,7 +65,7 @@
 
 
             <!-- 插入单元格禁止编辑 -->
             <!-- 插入单元格禁止编辑 -->
             <template 
             <template 
-              v-if="([4,5,6,7].includes(cell.DataType)&&!cell.CanEdit)
+              v-if="([4,5,6,7,8].includes(cell.DataType)&&!cell.CanEdit)
               ||disabled
               ||disabled
               ||(cell.DataType===1&&[1,2].includes(cell.DataTimeType))"
               ||(cell.DataType===1&&[1,2].includes(cell.DataTimeType))"
             >
             >
@@ -188,6 +188,14 @@
       :info="insertCalculateInfo"
       :info="insertCalculateInfo"
       @insert="insertCalculateData"
       @insert="insertCalculateData"
     />
     />
+
+    <!-- 日期计算弹窗 -->
+    <calculateDateDia
+      ref="calculateDateDiaRef"
+      :isShow.sync="isInsertCalculateDate"
+      :info="insertCalculateDateInfo"
+      @insert="insertCalculateDateValue"
+    />
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -215,6 +223,7 @@ import md5 from '@/utils/md5.js';
 import selectTargetValueDia from './selectTargetValueDia.vue';
 import selectTargetValueDia from './selectTargetValueDia.vue';
 import insertDateDia from './insertDateDia.vue';
 import insertDateDia from './insertDateDia.vue';
 import calculateEdbDia from './calculateEdbDia.vue';
 import calculateEdbDia from './calculateEdbDia.vue';
+import calculateDateDia from './calculateDateDia.vue';
 import { formulaTip } from '@/views/dataEntry_manage/databaseComponents/util';
 import { formulaTip } from '@/views/dataEntry_manage/databaseComponents/util';
 export default {
 export default {
   props: {
   props: {
@@ -223,7 +232,7 @@ export default {
       default: false,
       default: false,
     }
     }
   },
   },
-  components: { selectTargetValueDia,insertDateDia,calculateEdbDia },
+  components: { selectTargetValueDia,insertDateDia,calculateEdbDia,calculateDateDia },
   computed: {
   computed: {
     //列头
     //列头
     columnHeader() {
     columnHeader() {
@@ -260,13 +269,14 @@ export default {
     return {
     return {
       config: {
       config: {
         /* 单元格类型 
         /* 单元格类型 
-          1手动日期格 DataTimeType 0 系统日期导入格 DataTimeType 1  指标日期导入格 DataTimeType 2
+          1手动日期格 DataTimeType 0 /系统日期导入格 DataTimeType 1  /指标日期导入格 DataTimeType 2
           2指标格 //eta1.5.6又弃用了
           2指标格 //eta1.5.6又弃用了
           3自定义输入 
           3自定义输入 
           4插入值 表格里有关联的日期和指标格  // eta1.1.6弃用了
           4插入值 表格里有关联的日期和指标格  // eta1.1.6弃用了
           5弹窗里的插入值 有关联日期格 
           5弹窗里的插入值 有关联日期格 
           6公式计算单元格 
           6公式计算单元格 
           7指标计算的插入值单元格
           7指标计算的插入值单元格
+          8日期计算值单元格
         */
         */
         data: [], 
         data: [], 
         contextMenuOption: [],
         contextMenuOption: [],
@@ -289,9 +299,7 @@ export default {
       calculateClickCell: null,//双击公式单元格时的单元格信息 用于之后选其他单元格拼接公式
       calculateClickCell: null,//双击公式单元格时的单元格信息 用于之后选其他单元格拼接公式
 
 
       isInsertDateDialog: false,//导入日期弹窗
       isInsertDateDialog: false,//导入日期弹窗
-      insertDateInfo: {
-        key: '',
-      },
+      insertDateInfo: {},
 
 
       calculateChainList: [],//公式链 key数组 后端需要
       calculateChainList: [],//公式链 key数组 后端需要
 
 
@@ -302,6 +310,9 @@ export default {
       
       
       hasInit:false,
       hasInit:false,
 
 
+      isInsertCalculateDate: false,//日期计算弹窗
+      insertCalculateDateInfo: {},//日期计算info
+
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -360,6 +371,9 @@ export default {
 
 
       //计算指标弹窗打开时选择日期更新弹窗数据
       //计算指标弹窗打开时选择日期更新弹窗数据
       this.isInsertCalculate&&this.$refs.calculateEdbDiaRef.showResult&&this.$refs.calculateEdbDiaRef.calculateHandle()
       this.isInsertCalculate&&this.$refs.calculateEdbDiaRef.showResult&&this.$refs.calculateEdbDiaRef.calculateHandle()
+
+      //日期计算弹窗打开选中日期框时且有选中item时更新选中值
+      cell.DataType===1&&this.isInsertCalculateDate&&this.$refs.calculateDateDiaRef.selectIndex&&this.$refs.calculateDateDiaRef.setSelectItemValue(this.selectCell)
     },
     },
 
 
     /* 插入值 往左往上寻找同行同列是否有符合条件的一指标一日期 */
     /* 插入值 往左往上寻找同行同列是否有符合条件的一指标一日期 */
@@ -509,6 +523,7 @@ export default {
           cell.DataType = 1;
           cell.DataType = 1;
           cell.Extra='';
           cell.Extra='';
           cell.ShowValue = dateFormat;
           cell.ShowValue = dateFormat;
+          cell.DataTime = dateFormat;
           cell.Value = dateFormat;
           cell.Value = dateFormat;
         }else if(value.startsWith('=')) { //公式单元格
         }else if(value.startsWith('=')) { //公式单元格
           cell.DataType = 6;
           cell.DataType = 6;
@@ -667,7 +682,7 @@ export default {
         pos = 'cell'
         pos = 'cell'
       }
       }
       this.config.contextMenuOption = pos === 'cell' 
       this.config.contextMenuOption = pos === 'cell' 
-        ? getRightClickMenu(pos,(cell.DataType===1&&[1,2].includes(cell.DataTimeType))||cell.DataType===7)
+        ? getRightClickMenu(pos,(cell.DataType===1&&[1,2].includes(cell.DataTimeType))||[5,7,8].includes(cell.DataType))
         : getRightClickMenu(pos)
         : getRightClickMenu(pos)
 
 
       this.$nextTick(() => {
       this.$nextTick(() => {
@@ -700,7 +715,8 @@ export default {
 
 
       let editHandlesMap = {
       let editHandlesMap = {
         1: this.insertDateOpen,
         1: this.insertDateOpen,
-        7: this.edbCalculateInsertOpen
+        7: this.edbCalculateInsertOpen,
+        8: this.insertDateCalculateOpen
       }
       }
 
 
       const keyMap = {
       const keyMap = {
@@ -713,6 +729,7 @@ export default {
         'choose-target': this.selectTargetOpen,//选择指标插入值
         'choose-target': this.selectTargetOpen,//选择指标插入值
         'insert-date': this.insertDateOpen,//导入系统日期
         'insert-date': this.insertDateOpen,//导入系统日期
         // 'insert-edb-date': this.insertDateOpen,//导入指标日期
         // 'insert-edb-date': this.insertDateOpen,//导入指标日期
+        'insert-date-calculate': this.insertDateCalculateOpen,//日期计算弹窗
         'reset': this.clearCell, //清空
         'reset': this.clearCell, //清空
         'cell-edit': this.selectCell ? editHandlesMap[this.selectCell.DataType] : null
         'cell-edit': this.selectCell ? editHandlesMap[this.selectCell.DataType] : null
       }
       }
@@ -725,12 +742,10 @@ export default {
     打开弹窗后仍可以在页面上点击 多存一个选择指标时的当前单元格信息 */
     打开弹窗后仍可以在页面上点击 多存一个选择指标时的当前单元格信息 */
     selectTargetOpen() {
     selectTargetOpen() {
       this.insertTargetCell = this.selectCell;
       this.insertTargetCell = this.selectCell;
-      resetDialogCellStyle();
       setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target')
       setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target')
       this.isSelectTargetValueDialog = true;
       this.isSelectTargetValueDialog = true;
 
 
-      this.isInsertCalculate = false;
-      this.$refs.calculateEdbDiaRef.initData();
+      this.resetDialogStatus('insertEdbVal')
     },
     },
 
 
     /* 插入选择指标的值 */
     /* 插入选择指标的值 */
@@ -878,25 +893,36 @@ export default {
     /* 导入系统/指标日期弹窗 */
     /* 导入系统/指标日期弹窗 */
     insertDateOpen(type) {
     insertDateOpen(type) {
       this.insertTargetCell = this.selectCell;
       this.insertTargetCell = this.selectCell;
-      resetDialogCellStyle();
 
 
       if(type === 'cell-edit') { //编辑日期
       if(type === 'cell-edit') { //编辑日期
-        const { DataTimeType } = this.insertTargetCell;
+        // const { DataTimeType } = this.insertTargetCell;
         this.insertDateInfo = {
         this.insertDateInfo = {
-          key: DataTimeType===1? 'insert-sys-date' : 'insert-edb-date',
+          // key: DataTimeType===1? 'insert-sys-date' : 'insert-edb-date',
           ...this.insertTargetCell
           ...this.insertTargetCell
         }
         }
       }else {
       }else {
         this.insertDateInfo = {
         this.insertDateInfo = {
-          key:type
+          // key:type
         }
         }
       }
       }
       this.isInsertDateDialog = true;
       this.isInsertDateDialog = true;
+      this.resetDialogStatus();
+    },
 
 
-      this.isSelectTargetValueDialog = false;
-      this.$refs.selectTargetValueRef.initData();
-      this.isInsertCalculate = false;
-      this.$refs.calculateEdbDiaRef.initData();
+    /* 弹窗都是无遮罩的 弹一个就重置其他的 */
+    resetDialogStatus(type='init') {
+      if(type!=='insertEdbVal') {
+        this.isSelectTargetValueDialog = false;
+        this.$refs.selectTargetValueRef.initData();
+      }
+      if(type!=='insertEdbCalculateVal') {
+        this.isInsertCalculate = false;
+        this.$refs.calculateEdbDiaRef.initData();
+      }
+      if(type!=='insertDateCalculateVal') {
+        this.isInsertCalculateDate = false;
+        this.$refs.calculateDateDiaRef.initData();
+      }
     },
     },
 
 
     /* 插入系统/指标日期 */
     /* 插入系统/指标日期 */
@@ -913,7 +939,6 @@ export default {
     /* 指标计算弹窗 */
     /* 指标计算弹窗 */
     edbCalculateInsertOpen(item) {
     edbCalculateInsertOpen(item) {
       this.insertTargetCell = this.selectCell;
       this.insertTargetCell = this.selectCell;
-      resetDialogCellStyle();
       setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target');
       setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target');
 
 
       if(item === 'cell-edit') { //编辑
       if(item === 'cell-edit') { //编辑
@@ -934,8 +959,7 @@ export default {
       }
       }
       this.isInsertCalculate = true;
       this.isInsertCalculate = true;
 
 
-      this.isSelectTargetValueDialog = false;
-      this.$refs.selectTargetValueRef.initData();
+      this.resetDialogStatus('insertEdbCalculateVal')
     },
     },
 
 
     /* 导入指标计算值 */
     /* 导入指标计算值 */
@@ -964,6 +988,34 @@ export default {
       }
       }
     },
     },
 
 
+    /* 日期计算弹窗 */
+    insertDateCalculateOpen(type) {
+      this.insertTargetCell = this.selectCell;
+      setRelationStyle({ key:this.insertTargetCell.Uid },'td-choose-insert-target')
+
+      if(type === 'cell-edit') { //编辑
+        this.insertCalculateDateInfo = {
+          ...this.insertTargetCell
+        }
+      }else {
+        this.insertCalculateDateInfo = {}
+      }
+      this.isInsertCalculateDate = true;
+      this.resetDialogStatus('insertDateCalculateVal');
+    },
+
+    /* 插入日期计算值 */
+    insertCalculateDateValue(data) {
+      const { insertValue,str } = data;
+      this.insertTargetCell.DataType = 8;
+      this.insertTargetCell.ShowValue = insertValue;
+      this.insertTargetCell.Value = str;
+      this.insertTargetCell.EdbInfoId = 0;
+      this.insertTargetCell.DataTime = '';
+
+      this.$message.success('插入成功')
+    },
+
     /* 初始化8行5列 */
     /* 初始化8行5列 */
     initData(initData=null) {
     initData(initData=null) {
       console.log('initData');
       console.log('initData');

+ 277 - 0
src/views/datasheet_manage/components/calculateDateDia.vue

@@ -0,0 +1,277 @@
+<template>
+<div v-dialogDrag v-if="isShow" >
+	<div class="calculate-date-dialog el-dialog" >
+		<div class="header el-dialog__header">
+			<span>日期计算</span>
+			<i class="el-icon-close" @click="cancelHandle"/>
+		</div>
+		<div class="dialog-main">
+			<ul class="add-cont">
+				<li class="add-li" v-for="(list, index) in addList" :key="index">
+					<span class="li-tag">{{ list.Tag }}</span>
+          <el-input
+						v-model="list.Date"
+						placeholder="选择日期"
+						style="width: 250px" 
+						@focus="selectIndex=index+1"
+						@keyup.native="e => { e.keyCode===13 && initSelect}" 
+						:class="{'select': selectIndex===index+1}"
+					/>
+					
+					<i
+						class="el-icon-error del-tag"
+						v-if="index > 1"
+						@click="list.splice(index,1)"
+					/>
+				</li>
+			</ul>
+			<span class="add-icon" @click="addTargetHandle">
+				<i
+					class="el-icon-circle-plus-outline"
+					style="color: #5882ef; font-size: 16px"
+				/>
+				添加更多日期
+			</span>
+			<div class="computed-min">
+				<div class="computed-section">
+					<label class="label">计算公式</label>
+					<el-input placeholder="请输入公式" v-model="formula" clearable @focus="initSelect">
+					</el-input>
+				</div>	
+        <div class="example-txt">公式示例:A-B 以数字形式返回日期A和日期B的天数差</div>
+			</div>
+		</div>
+		<div class="dia-bot">
+			<el-button
+				type="primary"
+				style="margin-right: 20px"
+				@click="saveHandle"
+				>确定</el-button
+			>
+			<el-button type="primary" plain @click="cancelHandle">取消</el-button>
+		</div>
+	</div>
+</div>
+</template>
+
+<script>
+import * as sheetInterface from "@/api/modules/sheetApi.js";
+import { resetDialogCellStyle } from "../common/customTable";
+const tag_arr = [];
+for(let i=0;i<26;i++) tag_arr.push(String.fromCharCode(65+i));
+export default {
+	name: '',
+	props: {
+		isShow: {
+			type: Boolean,
+		},
+		info: {
+			type: Object,
+		}
+	},
+	watch: {
+		isShow(newval) {
+			if(!newval) return
+
+			/* 回显 */
+			if(this.info.Value) {
+				let valueObj = JSON.parse(this.info.Value);
+
+				this.formula = valueObj.Formula;
+				this.addList = valueObj.RelationCellList;
+			}
+			
+		},
+	},
+	data() {
+		return {
+			selectIndex: 1,//默认选中第一个框
+			addList: [
+				{
+					Tag: tag_arr[0],
+					Uid: '', //关联表格中日期格子的uid
+					Date: '',
+				},
+				{
+					Tag: tag_arr[1],
+					Uid: '',
+					Date: '',
+				},
+			],
+			formula: '', //计算公式
+
+		};
+	},
+	methods: {
+		/* 添加额外的指标列 */
+		addTargetHandle() {
+			if(this.addList.length >= 26) return this.$message.warning('添加指标个数已达上限')
+			let tag = this.addList[this.addList.length-1].tag;
+			let index = tag_arr.findIndex(item => item === tag);
+			const item = {
+				Tag: tag_arr[index+1],
+				Uid: '',
+				Date: ''
+			};
+			this.addList.push(item);
+		},
+
+		/* 选择日期时更新选中item的值 */
+		setSelectItemValue(cell) {
+			let item = this.addList[this.selectIndex-1];
+
+			this.$set(this.addList,this.selectIndex-1,{
+				...item,
+				Uid: cell.Uid,
+				Date: cell.ShowValue
+			})
+		},
+
+		async saveHandle() {
+			if (!this.formula) return this.$message.warning('计算公式不能为空');
+
+			let dateList = this.addList.filter(_ => _.Date&&_.Uid);
+			const res = await sheetInterface.getDateCalculate({
+				Formula: this.formula,
+				DateList: dateList
+			})
+			if(res.Ret !== 200) return
+
+			let backData = {
+				insertValue: res.Data.ShowValue,
+        str: JSON.stringify({
+					Formula: this.formula,
+					RelationCellList: dateList
+				})
+			}
+
+			this.$emit('insert',backData)
+			this.cancelHandle()
+		},
+
+		initSelect() {
+			this.selectIndex = 0;
+		},
+
+		initData() {
+			this.selectIndex = 1;
+			this.addList = [
+				{
+					Tag: tag_arr[0],
+					Uid: '',
+					Date: '',
+				},
+				{
+					Tag: tag_arr[1],
+					Uid: '',
+					Date: '',
+				},
+			];
+			this.formula = '';
+
+		},
+		cancelHandle() {
+			this.initData();
+			this.$emit('update:isShow',false);
+			resetDialogCellStyle()
+		},
+	},
+	mounted() {},
+};
+</script>
+<style lang="scss" scoped>
+@import "~@/styles/theme-vars.scss";
+.calculate-date-dialog {
+	width:750px;
+	background: #fff;
+  position: fixed;
+  top: 20%;
+  left: 50%;
+  border-radius: 2px;
+  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
+  z-index: 9999;
+	overflow: hidden;
+	div::-webkit-scrollbar {
+		width: 6px !important;
+	}
+	.header { 
+    font-size: 16px;
+    background: $theme-color;
+    color: #fff;
+    padding: 15px;
+    display: flex;
+    align-content: center;
+    justify-content: space-between;
+    .el-icon-close {
+      font-size: 20px;
+      cursor: pointer;
+    }
+  }
+	.dialog-main {
+		padding: 25px 42px 25px 25px;
+		@media screen and (max-height:850px){
+			box-sizing: border-box;
+			height: 65vh;
+			overflow-y: auto;
+		}
+		.el-cascader .el-input {
+			width: 340px;
+		}
+		.add-cont {
+			display: flex;
+			flex-wrap: wrap;
+			justify-content: space-between;
+			.add-li {
+				position: relative;
+				margin-bottom: 48px;
+				.li-tag {
+					font-size: 16px;
+					margin-right: 8px;
+				}
+				.del-tag {
+					position: absolute;
+					right: -30px;
+					top: 12px;
+					font-size: 16px;
+					cursor: pointer;
+				}
+			}
+		}
+		.add-icon {
+			font-size: 16px;
+			color: #5882ef;
+			cursor: pointer;
+		}
+		.computed-min {
+			margin: 50px 0;
+			padding-bottom: 40px;
+			border-bottom: 1px dashed #aab4cc;
+			.computed-section {
+				display: flex;
+				margin-top: 20px;
+			}
+			.label {
+				padding:10px 10px 10px 0;
+			}
+			.example-txt {
+				margin-top: 10px;
+				padding-left: 60px;
+				color: #999;
+			}
+		}
+	}
+	.dia-bot {
+		padding-bottom: 40px;
+		display: flex;
+		justify-content: center;
+	}
+}
+</style>
+<style lang="scss">
+  .calculate-date-dialog {
+    .select .el-input__inner {
+      border: 2px dashed #18ad18;
+      border-radius: 4px;
+    }
+  }
+</style>

+ 36 - 32
src/views/datasheet_manage/components/dateMoveWaySection.vue

@@ -12,40 +12,40 @@
     </div>
     </div>
     
     
     <ul v-if="dateChangeArr.length" class="date-change-list">
     <ul v-if="dateChangeArr.length" class="date-change-list">
-      <li v-for="dateItem in dateChangeArr" :key="dateItem.type" class="date-change-li">
+      <li v-for="(dateItem,index) in dateChangeArr" :key="dateItem.ChangeType" class="date-change-li">
 
 
-        <div v-if="dateItem.Type===1" class="date-item">
+        <div v-if="dateItem.ChangeType===1" class="date-item">
           <el-tag type="info" style="margin-right:15px">日期位移</el-tag>
           <el-tag type="info" style="margin-right:15px">日期位移</el-tag>
           <div>
           <div>
             <el-input
             <el-input
-              v-model="dateItem.DayNum"
+              v-model="dateItem.Day"
               type="number"
               type="number"
-              style="margin-right:10px;width:60px"
-              @change="e => {dateItem.DayNum=Number(e)}"
+              style="margin-right:10px;width:80px"
+              @change="e => {dateItem.Day=Number(e)}"
             />天
             />天
             <el-input
             <el-input
-              v-model="dateItem.MonthNum"
+              v-model="dateItem.Month"
               type="number"
               type="number"
-              style="margin-right:10px;width:60px"
-              @change="e => {dateItem.MonthNum=Number(e)}"
-            />
+              style="margin-right:10px;width:80px"
+              @change="e => {dateItem.Month=Number(e)}"
+            />
             <el-input
             <el-input
-              v-model="dateItem.YearNum"
+              v-model="dateItem.Year"
               type="number"
               type="number"
-              style="margin-right:10px;width:60px"
-              @change="e => {dateItem.YearNum=Number(e)}"
-            />
+              style="margin-right:10px;width:80px"
+              @change="e => {dateItem.Year=Number(e)}"
+            />
           </div>
           </div>
-          <i class="el-icon-delete" @click="removeDateItem"></i>
+          <i class="el-icon-delete" @click="removeDateItem(index)"></i>
         </div>
         </div>
 
 
-        <div v-else-if="dateItem.Type===2" class="date-item">
+        <div v-else-if="dateItem.ChangeType===2" class="date-item">
           <el-tag type="info" style="margin-right:15px">指定频率</el-tag>
           <el-tag type="info" style="margin-right:15px">指定频率</el-tag>
           <el-select
           <el-select
               style="max-width: 120px;"
               style="max-width: 120px;"
               v-model="dateItem.Frequency"
               v-model="dateItem.Frequency"
               placeholder="请选择频度"
               placeholder="请选择频度"
-              @change="dateItem.Day=frequencyDaysOptions[0].name"
+              @change="dateItem.FrequencyDay=frequencyDaysOptions[0].name"
           >
           >
             <el-option
             <el-option
                 v-for="item in frequencyOptions"
                 v-for="item in frequencyOptions"
@@ -57,7 +57,7 @@
 
 
           <el-select
           <el-select
               style="max-width: 120px;margin:0 10px"
               style="max-width: 120px;margin:0 10px"
-              v-model="dateItem.Day"
+              v-model="dateItem.FrequencyDay"
               placeholder="请选择"
               placeholder="请选择"
           >
           >
             <el-option
             <el-option
@@ -68,7 +68,7 @@
             />
             />
           </el-select>
           </el-select>
 
 
-          <i class="el-icon-delete" @click="removeDateItem"></i>
+          <i class="el-icon-delete" @click="removeDateItem(index)"></i>
         </div>
         </div>
       </li>
       </li>
     </ul>
     </ul>
@@ -90,7 +90,7 @@ export default {
         ]
         ]
       }
       }
       
       
-      let obj = this.dateChangeArr.find(_ => _.Type===2);
+      let obj = this.dateChangeArr.find(_ => _.ChangeType===2);
       if(!obj) return []
       if(!obj) return []
 
 
       return typeMap[obj.Frequency] 
       return typeMap[obj.Frequency] 
@@ -101,9 +101,7 @@ export default {
   data() {
   data() {
     return {
     return {
       dateChangeSelect: 1,
       dateChangeSelect: 1,
-      dateChangeArr: [
-
-      ],
+      dateChangeArr: [],
 
 
       frequencyOptions: [
       frequencyOptions: [
         { name: '本周', value: '本周' },
         { name: '本周', value: '本周' },
@@ -114,27 +112,33 @@ export default {
         { name: '本年', value: '本年' },
         { name: '本年', value: '本年' },
       ],
       ],
     }
     }
-  },
-  mounted(){
-
   },
   },
   methods:{
   methods:{
     /* 提加日期变换数组 */
     /* 提加日期变换数组 */
     addDateChange() {
     addDateChange() {
-      let haveObj = this.dateChangeArr.find(_ => _.Type===this.dateChangeSelect);
+      let haveObj = this.dateChangeArr.find(_ => _.ChangeType===this.dateChangeSelect);
       if(haveObj) return this.$message.warning(this.dateChangeSelect===1?'已添加日期位移':'已添加指定频率')
       if(haveObj) return this.$message.warning(this.dateChangeSelect===1?'已添加日期位移':'已添加指定频率')
       let item = {
       let item = {
-        Type: this.dateChangeSelect,
-        DayNum: 0,
-        MonthNum: 0,
-        YearNum: 0,
+        ChangeType: this.dateChangeSelect,
+        Day: 0,
+        Month: 0,
+        Year: 0,
         Frequency: '本周',
         Frequency: '本周',
-        Day: '周一'
+        FrequencyDay: '周一'
       }
       }
 
 
       this.dateChangeArr.push(item)
       this.dateChangeArr.push(item)
     },
     },
 
 
+    initData(data=null) {
+      if(data) {
+        this.dateChangeArr = data || [];
+      }else {
+        this.dateChangeSelect = 1;
+        this.dateChangeArr = []
+      }
+    },
+
     removeDateItem(index) {
     removeDateItem(index) {
       this.dateChangeArr.splice(index,1)
       this.dateChangeArr.splice(index,1)
     }
     }
@@ -145,7 +149,7 @@ export default {
 .date-change-ways {
 .date-change-ways {
   padding-left: 20px;
   padding-left: 20px;
   .date-change-list {
   .date-change-list {
-    padding-left: 80px;
+    padding-left: 68px;
   }
   }
   .date-change-li {
   .date-change-li {
     margin: 10px 0;
     margin: 10px 0;

+ 65 - 186
src/views/datasheet_manage/components/insertDateDia.vue

@@ -10,110 +10,14 @@
 		width="650px"
 		width="650px"
 		v-dialogDrag>
 		v-dialogDrag>
 			<div class="dialog-main">
 			<div class="dialog-main">
-          <!-- 导入系统日期 -->
-          <!-- <ul v-if="info.key==='insert-sys-date'">
-            <li class="form-item">
-              <label>导入方式</label>
-              <el-select
-                  v-model="formData.Source"
-                  placeholder="请选择导入方式"
-                  @change="init('form')"
-              >
-                <el-option
-                    v-for="item in wayOptions"
-                    :key="item.value"
-                    :label="item.name"
-                    :value="item.value"
-                />
-              </el-select>
-
-              <template v-if="formData.Source===3">
-                <el-select
-                    style="max-width: 120px;margin:0 10px"
-                    v-model="formData.Frequency"
-                    placeholder="请选择频度"
-                    @change="formData.Day=frequencyDaysOptions[0].name"
-                >
-                  <el-option
-                      v-for="item in frequencyOptions"
-                      :key="item.value"
-                      :label="item.name"
-                      :value="item.value"
-                  />
-                </el-select>
-
-                <el-select
-                    style="max-width: 120px;"
-                    v-model="formData.Day"
-                    placeholder="请选择"
-                >
-                  <el-option
-                      v-for="item in frequencyDaysOptions"
-                      :key="item.name"
-                      :label="item.name"
-                      :value="item.name"
-                  />
-                </el-select>
-              </template>
-
-              <el-tooltip effect="dark" style="margin-left:10px">
-                <div
-                  slot="content"
-                  v-html="tips[info.key]"
-                  style="line-height: 20px;"
-                ></div>
-                <i class="el-icon-question" style="font-size:18px;"/>
-              </el-tooltip>
-            </li>
-            <template v-if="formData.Source===2">
-              <li class="form-item">
-                <label>天数</label>
-                <el-input
-                  v-model="formData.CalculateNum"
-                  type="number"
-                  style="margin-right:10px;width:200px"
-                  @change="e => {formData.CalculateNum=Number(e)}"
-                />
-                {{formData.CalculateFrequency}}
-              </li>
-              <li style="color:#999">示例:5,表示当前日期+5天的日期; -5,表示当前日期-5天的日期;</li>
-            </template>
-          </ul> -->
-
-          <!-- 导入指标日期 -->
-          <!-- <ul v-else> 
-            <li class="form-item">
-
-              <selectTarget
-                :defaultId="search_edb"
-                :defaultOpt="searchOptions"
-                ref="selectRef"
-                @select="e => { selectEdbInfo = e ||{} }"
-                :filter="false"
-              />
-
-              <el-tooltip effect="dark" style="margin-left:10px">
-                <div
-                  slot="content"
-                  v-html="tips[info.key]"
-                  style="line-height: 20px;"
-                ></div>
-                <i class="el-icon-question" style="font-size:18px;"/>
-              </el-tooltip>
-            </li>
-            <li class="form-item" v-if="selectEdbInfo.Frequency">
-              <label>更新频度</label>
-              {{ selectEdbInfo.Frequency }}
-            </li>
-            <li class="form-item" v-if="selectEdbInfo.LatestDate">
-              <label>最新日期</label>
-              {{ selectEdbInfo.LatestDate }}
-            </li>
-          </ul> -->
 
 
           <ul>
           <ul>
             <li class="form-item">
             <li class="form-item">
-              <el-radio v-model="radio">指标日期</el-radio>
+              <el-radio 
+                v-model="dateChangeSelect"
+                style="margin-right:12px"
+                :label="2"
+              >指标日期</el-radio>
 
 
               <selectTarget
               <selectTarget
                 :defaultId="search_edb"
                 :defaultId="search_edb"
@@ -121,26 +25,30 @@
                 ref="selectRef"
                 ref="selectRef"
                 @select="e => { selectEdbInfo = e ||{} }"
                 @select="e => { selectEdbInfo = e ||{} }"
                 :filter="false"
                 :filter="false"
+                width="240px"
               />
               />
               
               
-              <span v-show="selectEdbInfo.Frequency" style="margin: 0 15px">频度: {{ selectEdbInfo.Frequency }}</span>
+              <span v-show="selectEdbInfo.Frequency" style="margin: 0 10px">频度: {{ selectEdbInfo.Frequency }}</span>
               <span v-show="selectEdbInfo.LatestDate">最新日期: {{ selectEdbInfo.LatestDate }}</span>
               <span v-show="selectEdbInfo.LatestDate">最新日期: {{ selectEdbInfo.LatestDate }}</span>
             </li>
             </li>
-            <li class="form-item">
-              <el-radio v-model="radio">系统日期</el-radio>
-              
-              <span>{{ $moment().format('YYYY-MM-DD') }}</span>
+            <li class="form-item" style="padding-left:10px">
+              <label class="el-form-item__label">期数前移</label>
+              <el-input
+                v-model="formData.MoveForward"
+                type="number"
+                :min="0"
+                style="margin-right:10px;width:80px"
+                @change="e => {formData.MoveForward=Number(e)}"
+              />期
             </li>
             </li>
             <li class="form-item">
             <li class="form-item">
-              <el-radio v-model="radio">固定日期</el-radio>
+              <el-radio 
+                v-model="dateChangeSelect"
+                :label="1"
+                style="margin-right:12px"
+              >系统日期</el-radio>
               
               
-              <el-date-picker
-                v-model="formData.date"
-                type="date"
-                value-format="yyyy-MM-dd"
-                placeholder="选择日期"
-                style="width:200px"
-              />
+              <span>{{ $moment().format('YYYY-MM-DD') }}</span>
             </li>
             </li>
             <li class="form-item">
             <li class="form-item">
               <dateMoveWaySec ref="dateMoveWayRef"/>
               <dateMoveWaySec ref="dateMoveWayRef"/>
@@ -174,10 +82,14 @@ export default {
         if(nval && this.info.Value) { //处理日期编辑回显
         if(nval && this.info.Value) { //处理日期编辑回显
           const valueObj = JSON.parse(this.info.Value);
           const valueObj = JSON.parse(this.info.Value);
 
 
+          // this.formData = {
+          //   ...this.formData,
+          //   ...valueObj
+          // }
           this.formData = {
           this.formData = {
-            ...this.formData,
-            ...valueObj
+            MoveForward: valueObj.MoveForward
           }
           }
+          this.dateChangeSelect = this.info.DataTimeType;
 
 
           if(this.info.DataTimeType===2) { //指标日期时获取指标详情
           if(this.info.DataTimeType===2) { //指标日期时获取指标详情
             const { Data } = await dataBaseInterface.targetDetail({EdbInfoId: valueObj.EdbInfoId})
             const { Data } = await dataBaseInterface.targetDetail({EdbInfoId: valueObj.EdbInfoId})
@@ -188,60 +100,25 @@ export default {
             this.search_edb = valueObj.EdbInfoId;
             this.search_edb = valueObj.EdbInfoId;
             this.searchOptions = [this.selectEdbInfo];
             this.searchOptions = [this.selectEdbInfo];
           }
           }
+
+          this.$nextTick(() => {
+            this.$refs.dateMoveWayRef&&this.$refs.dateMoveWayRef.initData(valueObj.DateChange)
+          })
         }
         }
       }
       }
     }  
     }  
 
 
   },
   },
-  computed: {
-    frequencyDaysOptions() {
-      let typeMap = {
-        '本周': [
-          { name: '周一' },
-          { name: '周二' },
-          { name: '周三' },
-          { name: '周四' },
-          { name: '周五' },
-          { name: '周六' },
-          { name: '周日' },
-        ]
-      }
-      return typeMap[this.formData.Frequency] 
-        ? typeMap[this.formData.Frequency] 
-        : [{name:'第一天'},{name:'最后一天'}]
-    }
-  },
+
   data() {
   data() {
     return {
     return {
       formData: {
       formData: {
-        Source: 1,
-        Frequency: '本周',
-        Day: '周一',
-        CalculateNum: 0,
-        CalculateFrequency: '日',
-        DateChangeArr:[]
-      },
-
-      wayOptions: [
-        { name: '直接导入', value: 1 },
-        { name: '日期计算', value: 2 },
-        { name: '指定频率', value: 3 },
-      ],
-      frequencyOptions: [
-        { name: '本周', value: '本周' },
-        { name: '本旬', value: '本旬' },
-        { name: '本月', value: '本月' },
-        { name: '本季', value: '本季' },
-        { name: '本半年', value: '本半年' },
-        { name: '本年', value: '本年' },
-      ],
-
-      search_edb: '',
-      searchOptions:[],
-
-      titleMap: {
-        'insert-sys-date': '导入系统日期',
-        'insert-edb-date': '导入指标日期'
+        // Source: 1,
+        // Frequency: '本周',
+        // Day: '周一',
+        // CalculateNum: 0,
+        // CalculateFrequency: '日'
+        MoveForward: 0,
       },
       },
 
 
       tips: {
       tips: {
@@ -253,7 +130,7 @@ export default {
 
 
       selectEdbInfo: {},
       selectEdbInfo: {},
 
 
-      dateChangeSelect: 1,
+      dateChangeSelect: 1,//日期方式选择 1系统日期 2指标日期
 
 
     }
     }
   },
   },
@@ -261,48 +138,50 @@ export default {
     // 保存插入信息
     // 保存插入信息
     async saveInsertHandle() {
     async saveInsertHandle() {
 
 
-      if(this.info.key==='insert-edb-date' && !this.selectEdbInfo.EdbInfoId) return this.$message.warning('请选择指标')
+      if(this.dateChangeSelect===2 && !this.selectEdbInfo.EdbInfoId) return this.$message.warning('请选择指标')
       
       
       let backData = {}
       let backData = {}
       //插入系统日期
       //插入系统日期
-      if(this.info.key==='insert-sys-date') {
+      // if(this.info.key==='insert-sys-date') {
+
+        let valueParam = {
+          EdbInfoId: this.selectEdbInfo.EdbInfoId||0,
+          MoveForward: this.formData.MoveForward,
+          DateChange: this.$refs.dateMoveWayRef.dateChangeArr
+        }
+
         let { Data } = await sheetInterface.getSystemDate({
         let { Data } = await sheetInterface.getSystemDate({
-          DataTimeType: 1,
-          Value: JSON.stringify(this.formData)
+          DataTimeType: this.dateChangeSelect,
+          Value: JSON.stringify(valueParam)
         })
         })
         
         
         backData = {
         backData = {
           insertValue: Data.Date,
           insertValue: Data.Date,
-          dataTimeType: 1,
-          str: JSON.stringify(this.formData)
-        }
-      }else { //指标日期
-        backData = {
-          insertValue: this.selectEdbInfo.LatestDate,
-          dataTimeType: 2,
-          str:  JSON.stringify({EdbInfoId: this.selectEdbInfo.EdbInfoId})
+          dataTimeType: this.dateChangeSelect,
+          str: JSON.stringify(valueParam)
         }
         }
-      }
+      // }else { //指标日期
+      //   backData = {
+      //     insertValue: this.selectEdbInfo.LatestDate,
+      //     dataTimeType: 2,
+      //     str:  JSON.stringify({EdbInfoId: this.selectEdbInfo.EdbInfoId})
+      //   }
+      // }
       this.$emit('insert',backData)
       this.$emit('insert',backData)
       this.cancelHandle()
       this.cancelHandle()
     },
     },
 
 
-    init(type='') {
+    init() {
 
 
       this.formData = {
       this.formData = {
-        Source: this.formData.Source,
-        Frequency: '本周',
-        Day: '周一',
-        CalculateNum: 0,
-        CalculateFrequency: '日'
+        MoveForward: 0,
       }
       }
 
 
       this.search_edb = '';
       this.search_edb = '';
       this.searchOptions = [];
       this.searchOptions = [];
       if(this.$refs.selectRef) this.$refs.selectRef.search_txt='';
       if(this.$refs.selectRef) this.$refs.selectRef.search_txt='';
-
-      if(!type) this.formData.Source = 1;
       this.selectEdbInfo = {}
       this.selectEdbInfo = {}
+      this.$refs.dateMoveWayRef.initData();
     },
     },
     cancelHandle() {
     cancelHandle() {
       this.init()
       this.init()
@@ -313,9 +192,9 @@ export default {
 </script>
 </script>
 <style scoped lang='scss'>
 <style scoped lang='scss'>
 .dialog-main {
 .dialog-main {
-  padding: 20px;
+  padding: 0 20px;
   .form-item { 
   .form-item { 
-    margin: 15px 0; 
+    margin: 20px 0; 
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     label { width: 80px;flex-shrink: 0; }
     label { width: 80px;flex-shrink: 0; }

+ 36 - 2
src/views/datasheet_manage/components/selectTargetValueDia.vue

@@ -26,6 +26,29 @@
         <tableNoData size="mini" v-else/>
         <tableNoData size="mini" v-else/>
       </ul>
       </ul>
 
 
+      <!-- 依赖日期选择方式 -->
+      <ul class="date-select-cont">
+        <li>
+          <div>
+            <el-radio v-model="dateSelectForm.Type" :label="1">指标最新日期</el-radio>
+              <div>
+                <label class="el-form-item__label">期数前移</label>
+                <el-input
+                  v-model="dateSelectForm.CalculateNum"
+                  type="number"
+                  :min="0"
+                  style="margin-right:10px;width:80px"
+                  @change="e => {dateSelectForm.CalculateNum=Number(e)}"
+                />期
+              </div>
+          </div>
+          <el-radio v-model="dateSelectForm.Type" :label="2">表格日期</el-radio>
+        </li>
+        <li>
+          <dateMoveWaySec ref="dateMoveWayRef"/>
+        </li>
+      </ul>
+
       <div class="dia-bot">
       <div class="dia-bot">
         <el-button type="primary" style="margin-right: 20px" @click="insertData"
         <el-button type="primary" style="margin-right: 20px" @click="insertData"
           >插入值</el-button
           >插入值</el-button
@@ -41,13 +64,14 @@
 import * as sheetInterface from "@/api/modules/sheetApi.js";
 import * as sheetInterface from "@/api/modules/sheetApi.js";
 import selectTarget from '@/views/chartRelevance_manage/components/selectTarget.vue';
 import selectTarget from '@/views/chartRelevance_manage/components/selectTarget.vue';
 import { resetDialogCellStyle } from "../common/customTable";
 import { resetDialogCellStyle } from "../common/customTable";
+import dateMoveWaySec from './dateMoveWaySection.vue'
 export default {
 export default {
   props: {
   props: {
     isShow: {
     isShow: {
       type: Boolean,
       type: Boolean,
     }
     }
   },
   },
-  components: { selectTarget },
+  components: { selectTarget,dateMoveWaySec },
   data() {
   data() {
     return {
     return {
       result: {},
       result: {},
@@ -55,6 +79,11 @@ export default {
       chooseItem: {
       chooseItem: {
         edbId: 0,
         edbId: 0,
         value:''
         value:''
+      },
+
+      dateSelectForm: {
+        Type:1,
+        CalculateNum: 0
       }
       }
     }
     }
   },
   },
@@ -125,7 +154,7 @@ export default {
   position: fixed;
   position: fixed;
   top: 20%;
   top: 20%;
   left: 55%;
   left: 55%;
-  width: 500px;
+  width: 650px;
   border-radius: 2px;
   border-radius: 2px;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
   z-index: 9999;
   z-index: 9999;
@@ -168,6 +197,11 @@ export default {
       display: flex;
       display: flex;
       justify-content: center;
       justify-content: center;
     }
     }
+    .date-select-cont {
+      li {
+        margin: 10px 0;
+      }
+    }
   }
   }
 }
 }
 </style>
 </style>

+ 11 - 3
src/views/datasheet_manage/components/sheetClassifyDia.vue

@@ -20,7 +20,7 @@
 				:model="formData"
 				:model="formData"
 				:rules="formRules">
 				:rules="formRules">
 				
 				
-          <el-form-item label="分类名称" prop="classify_name" v-if="formData.parentName">
+          <el-form-item label="上级目录" prop="classify_name" v-if="formData.parentClassifyId">
             <span>{{formData.parentName}}</span>
             <span>{{formData.parentName}}</span>
           </el-form-item>
           </el-form-item>
           <el-form-item label="分类名称" prop="classify_name">
           <el-form-item label="分类名称" prop="classify_name">
@@ -99,9 +99,17 @@ export default {
 
 
 		/* 表格分类接口 */
 		/* 表格分类接口 */
 		async sheetClassifyApi(classify_name,classify_id) {
 		async sheetClassifyApi(classify_name,classify_id) {
+			const { parentClassifyId } = this.formData;
+
+			let params = {
+				ExcelClassifyName:classify_name,
+				Source: this.$parent.sourceMap[this.$route.path],
+				ParentId: parentClassifyId
+			}
+
 			const { Ret,Msg } = !classify_id
 			const { Ret,Msg } = !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] })
+        ? await sheetInterface.classifyAdd(params)
+        : await sheetInterface.classifyEdit({ ExcelClassifyId:classify_id,...params })
         
         
       if( Ret !== 200) return
       if( Ret !== 200) return
       this.$message.success(Msg);
       this.$message.success(Msg);

+ 16 - 2
src/views/datasheet_manage/customAnalysis/components/bottomSection.vue

@@ -11,7 +11,7 @@
       </div>
       </div>
 
 
       <div>
       <div>
-        <el-select 
+        <!-- <el-select 
           v-model="select_classify"
           v-model="select_classify"
           placeholder="请选择表格目录"
           placeholder="请选择表格目录"
           clearable
           clearable
@@ -23,7 +23,21 @@
             :label="item.ExcelClassifyName"
             :label="item.ExcelClassifyName"
             :value="item.ExcelClassifyId"
             :value="item.ExcelClassifyId"
           />
           />
-        </el-select>
+        </el-select> -->
+        <el-cascader
+          v-model="select_classify"
+          :options="classifyArr"
+          style="width:350px;"
+          :props="{
+            label: 'ExcelClassifyName',
+            value: 'ExcelClassifyId',
+            children: 'Children',
+            emitPath: false,
+            checkStrictly: true
+          }"
+          clearable
+          placeholder="请选择表格分类"
+        />
         <el-button type="primary" style="margin-left:30px" @click="saveSheetHandle">保存</el-button>
         <el-button type="primary" style="margin-left:30px" @click="saveSheetHandle">保存</el-button>
           <el-tooltip class="item" effect="dark" content="根据用户选择的sheet页上传文件" placement="top-start">
           <el-tooltip class="item" effect="dark" content="根据用户选择的sheet页上传文件" placement="top-start">
           <i class="el-icon-warning"/>
           <i class="el-icon-warning"/>

+ 30 - 2
src/views/datasheet_manage/customAnalysis/list.vue

@@ -102,7 +102,7 @@
 									alt=""
 									alt=""
 									style="width: 14px; height: 14px; margin-right: 8px"
 									style="width: 14px; height: 14px; margin-right: 8px"
 									@click.stop="addNode(node,data)"
 									@click.stop="addNode(node,data)"
-									v-if="isSheetBtnShow('classifyOpt_edit')&&node.level<3"
+									v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_edit')&&node.level<3"
 								/>
 								/>
                 <img
                 <img
                   src="~@/assets/img/set_m/edit.png"
                   src="~@/assets/img/set_m/edit.png"
@@ -504,17 +504,45 @@ export default {
       this.dialog_title = "添加";
       this.dialog_title = "添加";
       this.classifyForm = {
       this.classifyForm = {
         classify_name: "",
         classify_name: "",
+        parentClassifyId: 0,
+        parentName:''
+      };
+      this.classifyDia = true;
+    },
+
+    // 递归节点
+		getNodeParentData(data,arr){
+			if(data.level===0) return
+			arr.push({ExcelClassifyName:data.data.ExcelClassifyName,ExcelClassifyId:data.data.ExcelClassifyId})
+			this.getNodeParentData(data.parent,arr)
+			return arr
+		},
+
+    /* 添加节点 */
+    addNode(node,data) {
+      let arr = []
+      arr = this.getNodeParentData(node,arr).reverse();
+      this.dialog_title = "添加";
+      /* 编辑目录 */
+      this.classifyForm = {
+        classify_name: "",
+        parentClassifyId: data.ExcelClassifyId,
+        parentName: arr.map(_=>_.ExcelClassifyName).join('/')
       };
       };
       this.classifyDia = true;
       this.classifyDia = true;
     },
     },
 
 
     /* 编辑节点 */
     /* 编辑节点 */
-    editNode(node, { ExcelClassifyName, ExcelClassifyId }) {
+    editNode(node, { ExcelClassifyName, ExcelClassifyId,ParentId }) {
+      let arr = []
+      arr = ParentId ? this.getNodeParentData(node.parent,arr).reverse() : [];
       this.dialog_title = "编辑";
       this.dialog_title = "编辑";
       /* 编辑目录 */
       /* 编辑目录 */
       this.classifyForm = {
       this.classifyForm = {
         classify_name: ExcelClassifyName,
         classify_name: ExcelClassifyName,
         classify_id: ExcelClassifyId,
         classify_id: ExcelClassifyId,
+        parentClassifyId: ParentId,
+        parentName: arr.map(_=>_.ExcelClassifyName).join('/')
       };
       };
       this.classifyDia = true;
       this.classifyDia = true;
     },
     },

+ 18 - 2
src/views/datasheet_manage/customSheetEdit.vue

@@ -26,7 +26,7 @@
             </el-input>
             </el-input>
           </li>
           </li>
           <li>
           <li>
-            <el-select 
+            <!-- <el-select 
               v-model="sheetForm.classify" 
               v-model="sheetForm.classify" 
               placeholder="请选择表格分类"
               placeholder="请选择表格分类"
               style="width:240px;"
               style="width:240px;"
@@ -38,7 +38,23 @@
                   :label="item.ExcelClassifyName"
                   :label="item.ExcelClassifyName"
                   :value="item.ExcelClassifyId"
                   :value="item.ExcelClassifyId"
                 />
                 />
-              </el-select>
+              </el-select> -->
+
+
+            <el-cascader
+              v-model="sheetForm.classify"
+              :options="classifyArr"
+              style="width:240px;"
+              :props="{
+                label: 'ExcelClassifyName',
+                value: 'ExcelClassifyId',
+                children: 'Children',
+                emitPath: false,
+                checkStrictly: true
+              }"
+              clearable
+              placeholder="请选择表格分类"
+            />
           </li>
           </li>
           <li>
           <li>
             <el-select 
             <el-select 

+ 13 - 12
src/views/datasheet_manage/mixedSheetEdit.vue

@@ -11,19 +11,20 @@
           </el-input>
           </el-input>
         </li>
         </li>
         <li>
         <li>
-          <el-select 
-            v-model="sheetForm.classify" 
-            placeholder="请选择表格分类"
+          <el-cascader
+            v-model="sheetForm.classify"
+            :options="classifyArr"
+            style="width:240px;"
+            :props="{
+              label: 'ExcelClassifyName',
+              value: 'ExcelClassifyId',
+              children: 'Children',
+              emitPath: false,
+              checkStrictly: true
+            }"
             clearable
             clearable
-            style="min-width:240px"
-          >
-							<el-option
-								v-for="item in classifyArr"
-								:key="item.ExcelClassifyId"
-								:label="item.ExcelClassifyName"
-								:value="item.ExcelClassifyId"
-              />
-						</el-select>
+            placeholder="请选择表格分类"
+          />
         </li>
         </li>
         <li>
         <li>
           表格说明
           表格说明

+ 71 - 17
src/views/datasheet_manage/mixins/classifyMixin.js

@@ -118,6 +118,7 @@ export default {
         this.new_label !== data.ClassifyName && sheetInterface.classifyEdit({
         this.new_label !== data.ClassifyName && sheetInterface.classifyEdit({
           ExcelClassifyId: data.ExcelClassifyId,
           ExcelClassifyId: data.ExcelClassifyId,
           ExcelClassifyName: this.new_label,
           ExcelClassifyName: this.new_label,
+          ParentId: data.ParentId,
           Source: this.sourceMap[this.$route.path]
           Source: this.sourceMap[this.$route.path]
         }).then(res => {
         }).then(res => {
           if(res.Ret !== 200) return
           if(res.Ret !== 200) return
@@ -131,11 +132,67 @@ export default {
     dropOverHandle(b, a, i, e) {
     dropOverHandle(b, a, i, e) {
       // console.log(i, a);
       // console.log(i, a);
       // 被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置
       // 被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置
-      // 一/二级目录
-      if ([1].includes(b.level)) this.handleMoveCatalogue(b, a, i, e);
+      let isSheet = b.data.ExcelInfoId ? true : false;
+      let list=a.parent.childNodes;
+			let targetIndex=0,PrevClassifyId=0,NextClassifyId=0,ParentClassifyId=0;
+      
+			let ClassifyId=isSheet?0:b.data.ExcelClassifyId,ExcelInfoId=isSheet?b.data.ExcelInfoId:0,PrevExcelInfoId=0,NextExcelInfoId=0;
 
 
-      // 指标层
-      if (b.level === 2) this.handleMoveSheet(b, a, i, e);
+
+      if(i!=='inner'){
+				ParentClassifyId=a.parent.data.ExcelClassifyId||0
+				list.forEach((item,index)=>{
+					if(isSheet){
+						if(item.data.ExcelInfoId===b.data.ExcelInfoId){
+							targetIndex=index
+						}
+					}else{
+						if(item.data.ExcelClassifyId===b.data.ExcelClassifyId){
+							targetIndex=index
+						}
+					}
+					
+				})
+				
+				
+				if(targetIndex===0){
+					const data=list[targetIndex+1].data
+					NextClassifyId=data.ExcelInfoId?0:data.ExcelClassifyId
+					NextExcelInfoId=data.ExcelInfoId?data.ExcelInfoId:0
+				}else if(targetIndex===list.length-1){
+					const data=list[targetIndex-1].data
+					PrevClassifyId=data.ExcelInfoId?0:data.ExcelClassifyId
+					PrevExcelInfoId=data.ExcelInfoId?data.ExcelInfoId:0
+				}else{
+					const pData=list[targetIndex-1].data
+					PrevClassifyId=pData.ExcelInfoId?0:pData.ExcelClassifyId
+
+					PrevExcelInfoId=pData.ExcelInfoId?pData.ExcelInfoId:0
+
+					const nData=list[targetIndex+1].data
+					NextClassifyId=nData.ExcelInfoId?0:nData.ExcelClassifyId
+					NextExcelInfoId=nData.ExcelInfoId?nData.ExcelInfoId:0
+				}
+			}else{
+				ParentClassifyId=a.data.ExcelClassifyId||0
+			}
+      
+      let params = {
+        ClassifyId,
+        ParentClassifyId,
+        NextClassifyId,
+        PrevClassifyId,
+        ExcelInfoId,
+        NextExcelInfoId,
+        PrevExcelInfoId,
+        Source: this.sourceMap[this.$route.path]
+      }
+      sheetInterface.classifyMove(params)
+        .then((res) => {
+          if (res.Ret !== 200) return;
+          this.$message.success("移动成功!");
+          this.getTreeData();
+        });
     },
     },
 
 
     // 移动的为一级目录
     // 移动的为一级目录
@@ -273,20 +330,17 @@ export default {
     /* 判断节点是否能被拖入 */
     /* 判断节点是否能被拖入 */
     canDropHandle(draggingNode, dropNode, type) {
     canDropHandle(draggingNode, dropNode, type) {
       let canDrop = false;
       let canDrop = false;
-      // 移动的是一级目录
-      if (draggingNode.level === 1 && dropNode.level === 1 &&type!=='inner') {
-        canDrop = true;
-      }
 
 
-      // 二级
-      if (draggingNode.level === 2) {
-        if (
-          (dropNode.level === 1 && type === "inner") ||
-          (dropNode.level === 2 && type !== "inner")
-        ) {
-          canDrop = true;
-        }
-      }
+      // 指标
+			if(draggingNode.data.ExcelInfoId){
+				if(!(dropNode.level===1&&type!=='inner')){
+					canDrop=true
+				}
+			}else{//目录
+				if((dropNode.level+1==draggingNode.level&&type==='inner')||(dropNode.level===draggingNode.level&&type!=='inner')){
+					canDrop=true
+				}
+			}
 
 
       return canDrop;
       return canDrop;
     },
     },

+ 20 - 6
src/views/datasheet_manage/sheetList.vue

@@ -104,7 +104,7 @@
 									alt=""
 									alt=""
 									style="width: 14px; height: 14px; margin-right: 8px"
 									style="width: 14px; height: 14px; margin-right: 8px"
 									@click.stop="addNode(node,data)"
 									@click.stop="addNode(node,data)"
-									v-if="isSheetBtnShow('classifyOpt_edit')&&node.level<3"
+									v-if="!data.ExcelInfoId&&isSheetBtnShow('classifyOpt_edit')&&node.level<3"
 								/>
 								/>
                 <img
                 <img
                   src="~@/assets/img/set_m/edit.png"
                   src="~@/assets/img/set_m/edit.png"
@@ -573,31 +573,45 @@ export default {
       this.dialog_title = "添加";
       this.dialog_title = "添加";
       this.classifyForm = {
       this.classifyForm = {
         classify_name: "",
         classify_name: "",
+        parentClassifyId: 0,
+        parentName:''
       };
       };
       this.classifyDia = true;
       this.classifyDia = true;
     },
     },
 
 
+    // 递归节点
+		getNodeParentData(data,arr){
+			if(data.level===0) return
+			arr.push({ExcelClassifyName:data.data.ExcelClassifyName,ExcelClassifyId:data.data.ExcelClassifyId})
+			this.getNodeParentData(data.parent,arr)
+			return arr
+		},
+
     /* 添加节点 */
     /* 添加节点 */
     addNode(node,data) {
     addNode(node,data) {
+      let arr = []
+      arr = this.getNodeParentData(node,arr).reverse();
       this.dialog_title = "添加";
       this.dialog_title = "添加";
       /* 编辑目录 */
       /* 编辑目录 */
       this.classifyForm = {
       this.classifyForm = {
         classify_name: "",
         classify_name: "",
-        parentClassifyId: 0,
-        parentName:''
+        parentClassifyId: data.ExcelClassifyId,
+        parentName: arr.map(_=>_.ExcelClassifyName).join('/')
       };
       };
       this.classifyDia = true;
       this.classifyDia = true;
     },
     },
 
 
     /* 编辑节点 */
     /* 编辑节点 */
-    editNode(node, { ExcelClassifyName, ExcelClassifyId }) {
+    editNode(node, { ExcelClassifyName, ExcelClassifyId,ParentId }) {
+      let arr = []
+      arr = ParentId ? this.getNodeParentData(node.parent,arr).reverse() : [];
       this.dialog_title = "编辑";
       this.dialog_title = "编辑";
       /* 编辑目录 */
       /* 编辑目录 */
       this.classifyForm = {
       this.classifyForm = {
         classify_name: ExcelClassifyName,
         classify_name: ExcelClassifyName,
         classify_id: ExcelClassifyId,
         classify_id: ExcelClassifyId,
-        parentName: '',
-        parentClassifyId: 0
+        parentClassifyId: ParentId,
+        parentName: arr.map(_=>_.ExcelClassifyName).join('/')
       };
       };
       this.classifyDia = true;
       this.classifyDia = true;
     },
     },