Sfoglia il codice sorgente

Merge branch 'master'

Karsa 1 anno fa
parent
commit
ee827ffc2a

+ 1 - 1
src/api/modules/dataApi.js

@@ -199,7 +199,7 @@ const dataInterence = {
 		return http.get('/entry/data/ine',params)
 	},
 
-	// 获取研究所分类 Exchange
+	// 获取研究所分类 Exchange DataTime
 	/* 	cffex 中金所
 		shanghai 上期所
 		ine 上海能源交易所

+ 0 - 213
src/views/chartRelevance_manage/components/addClassify.vue

@@ -1,213 +0,0 @@
-<template>
-	<div class="chartDialog-box">
-		<el-dialog
-		:visible.sync="isOpenDialog"
-		:close-on-click-modal="false"
-		:modal-append-to-body='false'
-		@close="cancelHandle"
-		custom-class="dialog"
-		center
-		width="560px"
-		v-dialogDrag>
-			<div slot="title" style="display:flex;alignItems:center;">
-				<img :src="title=='添加'?$icons.add:title=='编辑'?$icons.edit:''" style="color:#fff;width:16px;height:16px;marginRight:5px;">
-				<span style="fontSize:16px;">{{title}}</span>
-			</div>
-			<div class="dialog-main">
-				<el-form
-				ref="diaForm"
-				label-position="left"
-				hide-required-asterisk
-				label-width="80px"
-				:model="formData"
-				:rules="formRules">
-					<!-- 添加/编辑1级目录 -->
-					<template 
-					v-if="(title=='添加'&&formData.level === 0)
-					|| (title=='编辑'&&formData.level === 1)">
-						<el-form-item label="分类名称" prop="level_1">
-							<el-input
-							v-model="formData.level_1"
-							style="width: 80%"
-							placeholder="必填项"></el-input>
-						</el-form-item>
-					</template>
-					<!-- 添加/编辑2级目录 -->
-					<template 
-					v-else-if="(title=='添加'&&formData.level === 1)
-					|| (title=='编辑'&&formData.level === 2)">
-						<el-form-item label="一级目录" prop="level_1">
-							<span>{{formData.level_1}}</span>
-						</el-form-item>
-						<el-form-item label="分类名称" prop="level_2">
-							<el-input
-							v-model="formData.level_2"
-							style="width: 80%"
-							placeholder="必填项"></el-input>
-						</el-form-item>
-					</template>
-					<!-- 添加/编辑三级目录 -->
-				<!-- 	<template v-else-if="(title=='添加'&&formData.level === 2)
-					|| (title=='编辑'&&formData.level === 3)">
-						<el-form-item label="一级目录" prop="level_1">
-							<span>{{formData.level_1}}</span>
-						</el-form-item>
-						<el-form-item label="二级目录" prop="level_2">
-							<span>{{formData.level_2}}</span>
-						</el-form-item>
-						<el-form-item label="分类名称" prop="level_3">
-							<el-input
-							v-model="formData.level_3"
-							style="width: 80%"
-							placeholder="必填项"></el-input>
-						</el-form-item>
-					</template> -->
-				</el-form>
-			</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>
-		</el-dialog>
-	</div>
-</template>
-
-<script>
-import { dataBaseInterface } from '@/api/api.js';
-import { formRules } from '@/utils/defaultOptions'
-export default {
-	props: {
-		isOpenDialog: {
-			type: Boolean,
-		},
-		//标题
-		title: {
-			type: String,
-			default: '添加'
-		},
-		formData: {
-			type: Object,
-		}
-	},
-	watch: {
-		'isOpenDialog': {
-			handler(newval) {
-				if((newval && this.formData.level === 3)) {
-					this.getMenu();
-				}
-				// console.log(this.formData);
-			}
-		}
-	},
-	data () {
-		return {			
-			formRules,
-			options:  [],
-			levelProps: {
-				label: 'ChartClassifyName',
-				value: 'ChartClassifyId',
-				children: 'Children',
-			},
-
-		};
-	},
-	methods: {
-		saveHandle() {
-			this.$refs.diaForm.validate((valid) => {
-				if(valid) {
-					this.title==='添加' && dataBaseInterface.addChartClassify({
-						ChartClassifyName: this.formData.level === 0 
-							? this.formData.level_1
-							: this.formData.level === 1
-							? this.formData.level_2
-							:'',
-						ParentId:this.formData.parent_id || 0,
-						Level: this.formData.level
-					}).then(res => {
-						if(res.Ret === 200) {
-							this.$message.success(res.Msg);
-							this.callbackHandle('add');
-						}
-					})
-					//修改图表
-					if(this.title==='编辑' && this.formData.level===3) {
-						dataBaseInterface.chartEdit({
-							ChartClassifyId: this.formData.level_menu[this.formData.level_menu.length - 1],
-							ChartInfoId: this.formData.chart_id,
-							ChartName: this.formData.level_4
-						}).then(res => {
-							if(res.Ret === 200) {
-								this.$message.success(res.Msg);
-								this.callbackHandle('update');
-							}
-						})
-					}else if(this.title==='编辑' && this.formData.level!==3) {
-						//修改目录
-						dataBaseInterface.editChartClassify({
-							ChartClassifyName: this.formData.level === 1
-								? this.formData.level_1
-								: this.formData.level === 2
-								? this.formData.level_2
-								:'',
-							ChartClassifyId:this.formData.classify_id || 0
-						}).then(res => {
-							if(res.Ret === 200) {
-								this.$message.success(res.Msg);
-								this.callbackHandle();
-							}
-						})
-					}
-
-					// this.title === '选择分类' && this.$emit('addClassifyCallBack',this.formData.level_menu[2])
-				}
-			})
-		},
-		/* 成功回调 */
-		callbackHandle(type) {
-			this.$refs.diaForm.resetFields();
-			this.$emit('sucessCallback',type)
-		},
-		/* 取消 */
-		cancelHandle() {
-			this.$refs.diaForm.resetFields();
-			this.$emit('closeDia')
-		},
-		/* 获取目录结构 */
-		getMenu() {
-			dataBaseInterface.chartClassify().then(res => {
-				if(res.Ret === 200) {
-					this.filterNodes(res.Data.AllNodes);
-					this.options = res.Data.AllNodes || [];
-				}
-			})
-		},
-		// 递归改变第三级目录结构
-		filterNodes(arr) {
-			arr.length && arr.forEach(item => {
-				item.Children.length && this.filterNodes(item.Children)
-				if(item.Level === 2) {
-					delete item.Children
-				}
-			})
-		}
-	},
-	created() {},
-	mounted() {},
-}
-</script>
-<style lang='scss'>
-.chartDialog-box {
-	.dialog-main {
-		padding-left: 50px;
-	}
-	.el-cascader .el-input {
-		width: 100%;
-	}
-	.dia-bot {
-		margin: 52px 0 30px;
-		display: flex;
-		justify-content: center;
-
-	}
-}
-</style>

+ 5 - 1
src/views/dataEntry_manage/chartSetting.vue

@@ -1535,7 +1535,11 @@ export default {
       const res = await dataBaseInterface.getChartInfoById({
           ChartInfoId: this.selected_chartid
         })
-        
+      if(res.Ret===406){
+        this.$message.warning(res.Msg)
+        this.deleteLabel({code:this.select_node})
+        return
+      }
       if (res.Ret !== 200) return;
       this.chartInfo = res.Data.ChartInfo;
       

+ 1 - 0
src/views/dataEntry_manage/components/insertData.vue

@@ -130,6 +130,7 @@ export default {
       }
       if (size > 10) {
         this.$message.warning("文件大小不得超过10M");
+        return false;
       }
     },
     handleStarting() {

+ 1 - 1
src/views/dataEntry_manage/databaseComponents/chartTrendRender.vue

@@ -132,8 +132,8 @@ export default {
 	watch: {
 		edbid:{
 			handler(newVal){
-				console.log('??')
 				if(newVal){
+					this.init()
 					this.chart_type = 1
 					this.isShowOnyearData = false
 					this.getDataByPath()

+ 2 - 0
src/views/dataEntry_manage/databaseList.vue

@@ -854,6 +854,7 @@ export default {
 
 						this.$refs.menuTree.setCurrentKey(null)
 						// 清除当前的label
+						this.$message.warning('该图表已删除,自动查看下一图表')
 						this.deleteLabel({code:this.select_node,id:this.selected_edbid,classifyId:''})
 						
 					}
@@ -1938,6 +1939,7 @@ export default {
 				this.$message.success('保存成功')
 
 				this.$refs.createChart.saveEdbImg(this.EdbData)
+				this.$refs.createChart.oldOptions = {}
 			})
 		},
 		//重绘指标图表

+ 228 - 109
src/views/dataEntry_manage/onlineExcelCopy.vue

@@ -30,9 +30,10 @@
         <el-tooltip :open-delay="400">
           <div slot="content">
             <p class="hint-message">1、新增指标:在预设好的指标列下输入指标名称、单位、数值并保存;</p>
-            <p class="hint-message">2、新增日期:在第一列选择日期或插入日期行(需复制已有日期格式)输入数值并保存;</p>
-            <p class="hint-message">3、除指标:清空该指标下所有数据并保存,请勿直接删除指标列;</p>
+            <p class="hint-message">2、新增日期:在第一列选择日期或插入日期行(需复制已有日期格式)输入数值并保存;</p>
+            <p class="hint-message">3、除指标:清空该指标下所有数据并保存,该操作不会删除指标,仅清除指标数据,请勿直接删除指标列;</p>
             <p class="hint-message">4、删除日期:清空该日期对应所有数据并保存,请勿直接删除日期行;</p>
+            <p class="hint-message">5、指标名称编辑、单位编辑、频度编辑、指标删除等操作请在“手工指标列表”中完成;</p>
           </div>
           <div class="instruction-hint" >
             <span>使用说明</span>
@@ -51,105 +52,101 @@ import EventBus from '@/api/bus.js'
 export default {
   name:'onlineExcelCopy',
   data() {
-    return {
-      // 初始化数据
-      options:{
-        container:'luckysheet',
-        lang: 'zh',
-        gridKey:'handmade-excel',
-        showinfobar:false,
-        row:300,
-        column:60,
-        data:[
-          {
-            "name":"test",
-            "celldata":[
-              {
-                "r":0,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"一级分类",
-                  v:"一级分类",
-                  bg:'#b4a7d6'
-                },
-              },
-              {
-                "r":1,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"指标分类",
-                  v:"指标分类",
-                  bg:'#b4a7d6'
-                },
+    // 受保护的数据 维护一个二维数组 用于还原不能被修改或者以错误方式修改的数据
+    this.protectedData=[]
+
+    // 初始化数据
+    this.options={
+      container:'luckysheet',
+      lang: 'zh',
+      gridKey:'handmade-excel',
+      showinfobar:false,
+      row:300,
+      column:60,
+      data:[
+        {
+          "name":"test",
+          "celldata":[
+            {
+              "r":0,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"一级分类",
+                v:"一级分类",
+                bg:'#b4a7d6'
               },
-              {
-                "r":2,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"频度",
-                  v:"频度",
-                  bg:'#b4a7d6'
-                },
+            },
+            {
+              "r":1,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"指标分类",
+                v:"指标分类",
+                bg:'#b4a7d6'
               },
-              {
-                "r":3,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"指标名称",
-                  v:"指标名称",
-                  bg:'#b4a7d6'
-                },
+            },
+            {
+              "r":2,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"频度",
+                v:"频度",
+                bg:'#b4a7d6'
               },
-              {
-                "r":4,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"单位",
-                  v:"单位",
-                  bg:'#b4a7d6'
-                },
+            },
+            {
+              "r":3,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"指标名称",
+                v:"指标名称",
+                bg:'#b4a7d6'
               },
-            ],
-            "config":{
-              "borderInfo":[{
-                "rangeType": "range",
-                "borderType": "border-all",
-                "style": "1",
-                "color": "#fff",
-                "range": [{
-                    "row": [0,4],
-                    "column": [0,0]
-                }]
-              }],
             },
-            "frozen":{
-              type: 'rangeBoth',
-              range: {row_focus: 4, column_focus: 0}
+            {
+              "r":4,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"单位",
+                v:"单位",
+                bg:'#b4a7d6'
+              },
             },
-            "dataVerification":{}
-          }
-        ],
-        hook:{
-          cellUpdateBefore(r,c){
-            // 禁止更新的单元格
-            if([0,1,2,3,4].includes(r) && c==0){
-              return false
-            }
+          ],
+          "config":{
+            "borderInfo":[{
+              "rangeType": "range",
+              "borderType": "border-all",
+              "style": "1",
+              "color": "#fff",
+              "range": [{
+                  "row": [0,4],
+                  "column": [0,0]
+              }]
+            }],
           },
-          cellMousedownBefore(e,position){
-            // 禁止鼠标选中的单元格
-            if([0,1,2].includes(position.r) || ([3,4].includes(position.r) && position.c==0)){
-              return false
-            }
-          }
-        },
-        showsheetbar:false
-		  },
+          "frozen":{
+            type: 'rangeBoth',
+            range: {row_focus: 4, column_focus: 0}
+          },
+          "dataVerification":{}
+        }
+      ],
+      hook:{},
+      showsheetbar:false,
+      // cellRightClickConfig:{
+      //   insertColumn:false,
+      //   deleteRow:false,
+      //   deleteColumn:false
+      // }
+    }
+
+    return {
       dataForm:{
         firstClassify:'',
         secondClassify:'',
@@ -165,7 +162,9 @@ export default {
       secondClassifyArray:[],
       // 保存时候的加载框
       saveLoading:false,
-      isEdit:"false"
+      isEdit:"false",
+      refreshed:false,
+      haveSaveProtected:false
     }
   },
 created() {
@@ -224,6 +223,102 @@ created() {
           // if(res.Data.FrequencyList) this.dataForm.frequency = res.Data.FrequencyList[0]
         }
       }
+
+      // hook设置
+      // 处理复制粘贴造成的漏洞 - 记录数据
+      this.options.hook.cellAllRenderBefore=(data,sheet)=>{
+        if(this.haveSaveProtected) return 
+        // console.log("全部刷新");
+        if(!this.protectedData.length>0){
+          for (let i = 0; i < 5; i++) {
+            if([0,1,2].includes(i)){
+              for (let j = 0; j < 2; j++) {
+                const element = data[i][j];
+                if(!Array.isArray(this.protectedData[i])) this.protectedData[i]=[]
+                this.protectedData[i][j] = element
+              }
+            }else{
+              for (let k = 0; k <= dataList.length; k++) {
+                const element = data[i][k];
+                if(!Array.isArray(this.protectedData[i])) this.protectedData[i]=[]
+                this.protectedData[i][k] = element
+              }
+            }
+          }
+        }
+        this.haveSaveProtected=true
+      }
+      this.options.hook.cellUpdateBefore=(r,c)=>{
+        // 禁止更新的单元格 已经有的指标名称和单位不允许更新
+        if(([0,1,2].includes(r) && c==0) || ([3,4].includes(r) && c<=dataList.length)){
+          return false
+        }
+      }
+
+      this.options.hook.cellMousedownBefore=(e,position)=>{
+        // console.log(e,position);
+        // 禁止鼠标选中的单元格
+        if([0,1,2].includes(position.r) || ([3,4].includes(position.r) && position.c<=dataList.length)){
+          return false
+        }
+      }
+
+      // 处理复制粘贴造成的漏洞 - 还原数据
+      this.options.hook.cellRenderBefore=(cell,position,sheet,ctx)=>{
+        // console.log('cellRenderBeforecellRenderBefore');
+        // 是否更改了受保护的数据
+        let haveUpdatedProtectedData=false
+        if([3,4].includes(position.r) && position.c>=0 && position.c<=dataList.length){
+          if(!cell) return 
+          Object.keys(this.protectedData[position.r][position.c]).forEach(key => {
+            // console.log(_.isEqual(cell[key], this.protectedData[position.r][position.c][key]),'lodash');
+            if(!_.isEqual(cell[key], this.protectedData[position.r][position.c][key])){
+              haveUpdatedProtectedData=true
+              cell[key] = this.protectedData[position.r][position.c][key]
+            }
+          }); 
+        }else if([0,1,2].includes(position.r)){
+          let cindex = position.c>1?1:position.c
+          // console.log(position.c,position.r,cell);
+          if(!cell){
+            if(cindex<1){
+              return 
+            }
+            luckysheet.getSheet().data[position.r][position.c] = this.protectedData[position.r][cindex]
+          }else{
+            Object.keys(this.protectedData[position.r][cindex]).forEach(key => {
+              if(!_.isEqual(cell[key], this.protectedData[position.r][cindex][key])){
+                haveUpdatedProtectedData=true
+                cell[key] = this.protectedData[position.r][cindex][key]
+              }
+            });
+            if([0,1,2].includes(position.r) && position.c>0){
+              if(position.r==0){
+                if(cell.m !==this.firstClassName || cell.v !== this.firstClassName){
+                  haveUpdatedProtectedData=true
+                  cell.m = cell.v = this.firstClassName
+                }
+              }else if(position.r==1){
+                if(cell.m !==this.secondClassName || cell.v !== this.secondClassName){
+                  haveUpdatedProtectedData=true
+                  cell.m = cell.v = this.secondClassName
+                }
+              }else{
+                if(cell.m !==this.dataForm.frequency || cell.v !== this.dataForm.frequency){
+                  haveUpdatedProtectedData=true
+                  cell.m = cell.v = this.dataForm.frequency
+                }
+              }
+            }
+          }
+          // console.log(cindex,position.r,'cindex,position.r',this.protectedData[position.r][cindex]);
+        }
+        if(haveUpdatedProtectedData){
+          // 还原数据后的手动刷新
+          this.refreshManual()
+        }
+      }
+
       // 拿出所有数组
       let arr = dataList.map((item => item.DataList)).flat()
       // 拿出所有数组的日期并展平排序
@@ -238,7 +333,7 @@ created() {
         return objList
       })
       /**
-       * 当数据的长度大于默认的84时,行数需要设置成数据的长度+15
+       * 当数据的长度大于默认的300时,行数需要设置成数据的长度+15
        */
       this.options.row = dateArr.length>(this.options.row-15) ? (dateArr.length+15):this.options.row
       /**
@@ -257,7 +352,8 @@ created() {
             "v":{
               ct: {fa: "General", t: "g"},
               m:item.SecName,
-              v:item.SecName
+              v:item.SecName,
+              bg:'#cccccc'
             }
           },
           {
@@ -266,7 +362,8 @@ created() {
             "v":{
               ct: {fa: "General", t: "g"},
               m:item.Unit,
-              v:item.Unit
+              v:item.Unit,
+              bg:'#cccccc'
             }
         })
       })
@@ -343,6 +440,15 @@ created() {
             "row": [5,row],
             "column": [0,0]
         }]
+      },{
+        "rangeType": "range",
+        "borderType": "border-all",
+        "style": "1",
+        "color": "#fff",
+        "range": [{
+            "row": [3,4],
+            "column": [1,dataList.length]
+        }]
       })
       // 设置数据验证
       for (let i = 0; i < col; i++) {
@@ -360,6 +466,15 @@ created() {
         luckysheet.create(this.options)
       })
     },
+    refreshManual: _.debounce(function() {
+      if(!this.refreshed) {
+        luckysheet.refresh()
+        this.refreshed=true
+        setTimeout(()=>{
+          this.refreshed=false
+        },1500)
+      }
+		},1000),
     // 获取分类
     async getClassify() {
       let res=await dataInterence.getClassify()
@@ -393,25 +508,29 @@ created() {
         this.dataForm.secondClassify = this.secondClassifyArray[0].ClassifyId
         this.secondClassName = this.secondClassifyArray[0].ClassifyName
       }
-      for (let i= 1;  i< col+1 ; i++) {
-        luckysheet.setCellValue(0,i,this.firstClassName,{isRefresh:false})
-        luckysheet.setCellValue(1,i,this.secondClassName,{isRefresh:i==col?true:false})
-      }
+      luckysheet.refresh()
+      // for (let i= 1;  i< col+1 ; i++) {
+      //   luckysheet.setCellValue(0,i,this.firstClassName,{isRefresh:false})
+      //   luckysheet.setCellValue(1,i,this.secondClassName,{isRefresh:i==col?true:false})
+      // }
     },
     // 切换选择二级分类
     changeSecondClassify(id){
       let col = this.options.column
       let item = this.secondClassifyArray.find(item => item.ClassifyId == id)
-      for (let i= 1;  i< col+1; i++) {
-        luckysheet.setCellValue(1,i,item.ClassifyName,{isRefresh:i==col?true:false})
-      }
+      this.secondClassName=item.ClassifyName
+      // for (let i= 1;  i< col+1; i++) {
+      //   luckysheet.setCellValue(1,i,this.secondClassName,{isRefresh:i==col?true:false})
+      // }
+      luckysheet.refresh()
     },
     // 切换选择频度
     changeFrequency(value){
-      let col = this.options.column
-      for (let i= 1;  i< col+1; i++) {
-        luckysheet.setCellValue(2,i,value,{isRefresh:i==col?true:false})
-      }
+      // let col = this.options.column
+      // for (let i= 1;  i< col+1; i++) {
+      //   luckysheet.setCellValue(2,i,value,{isRefresh:i==col?true:false})
+      // }
+      luckysheet.refresh()
     },
     saveExcel(){
       this.$refs.dataOptions.validate((valid)=>{

+ 8 - 3
src/views/dataEntry_manage/thirdBase/dlExchangeData.vue

@@ -128,7 +128,8 @@ export default {
 
         // 时间切换
         handleTimeChange(){
-            this.getData();
+            // this.getData();
+            this.getClassifyList()
         },
 
         // 计算合计
@@ -143,11 +144,15 @@ export default {
         // 获取分类
         async getClassifyList(){
             const res=await dataInterence.getResearcherClassifyList({
-                Exchange:'dalian'
+                Exchange:'dalian',
+                DataTime:this.time
             })
             if(res.Ret===200){
                 this.typeList=res.Data&&res.Data[0]||[]
-                this.time=res.Data&&res.Data[1][0]||''
+                if(!this.time){
+                    // 第一次取 后端返回的最新日期
+                    this.time=res.Data&&res.Data[1][0]||''
+                }
                 this.type=this.typeList[0]
                 this.getNumList()
             }

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

@@ -1,3 +1,4 @@
+<!-- 通用二级分类的弹窗 -->
 <template>
 	<div class="sheet-classify-dialog">
 		<el-dialog
@@ -93,7 +94,7 @@ export default {
 
 		/* 表格分类接口 */
 		async sheetClassifyApi(classify_name,classify_id) {
-			const { Ret,Msg } = this.title==='添加' 
+			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] })
         
@@ -105,7 +106,7 @@ export default {
 
 		/* 商品曲线分类接口 */
 		async commodityClassifyApi(classify_name,classify_id) {
-			const { Ret,Msg } = this.title==='添加' 
+			const { Ret,Msg } = !classify_id
         ? await futuresInterface.classifyAdd({ ChartClassifyName:classify_name })
         : await futuresInterface.classifyEdit({ ChartClassifyName:classify_name, ChartClassifyId:classify_id  })
         
@@ -117,7 +118,7 @@ export default {
 
 		/* 相关性图表 */
 		async relevanceClassifyApi(classify_name,classify_id) {
-			const { Ret,Msg } = this.title==='添加' 
+			const { Ret,Msg } = !classify_id
 				? await chartRelevanceApi.classifyAdd({ ChartClassifyName:classify_name })
 				: await chartRelevanceApi.classifyEdit({ ChartClassifyName:classify_name, ChartClassifyId:classify_id  })
 				
@@ -129,7 +130,7 @@ export default {
 
 		/* 拟合方程曲线 */
 		async fittingEquationClassifyApi(classify_name,classify_id){
-			const { Ret,Msg } = this.title==='添加' 
+			const { Ret,Msg } = !classify_id
 				? await fittingEquationInterface.classifyAdd({ ChartClassifyName:classify_name })
 				: await fittingEquationInterface.classifyEdit({ ChartClassifyName:classify_name, ChartClassifyId:classify_id  })
 				
@@ -141,7 +142,7 @@ export default {
 
 		/* 统计特征曲线 */
 		async statisticFeatureClassifyApi(classify_name,classify_id){
-			const { Ret,Msg } = this.title==='添加' 
+			const { Ret,Msg } = !classify_id
 				? await statisticFeatureInterface.classifyAdd({ ChartClassifyName:classify_name })
 				: await statisticFeatureInterface.classifyEdit({ ChartClassifyName:classify_name, ChartClassifyId:classify_id  })
 				

+ 1 - 0
src/vuex/mutations.js

@@ -9,6 +9,7 @@ const mutations = {
   SET_DATA_AUTH(state, bool) {
     state.dataAuth = bool;
   },
+
   SET_COLLAPSE(state,bool) {
     state.isCollapse = bool;
   },