瀏覽代碼

Merge branch 'requirements_184'

hbchen 8 月之前
父節點
當前提交
8c42d776ca

+ 18 - 1
src/api/modules/chartApi.js

@@ -688,6 +688,15 @@ const dataBaseInterface = {
 		setChartImage: params => {
 			return http.post('/datamanage/chart_info/image/set',params)
 		},
+		/**
+		 * 设置图表缩略图 formData
+		 * @param {Img} string 
+		 * @param {Chartlnfold} number 
+		 * @returns 
+		 */
+		setChartThumbnail: params => {
+			return http.post('/datamanage/chart_info/image/set_by_svg',params)
+		},
 		/**
 		 * 通过unicode获取图表信息
 		 * @param {UniqueCode} params 
@@ -984,7 +993,15 @@ const dataBaseInterface = {
 	saveEdbChartImg:(params)=>{
 		return http.post('/datamanage/edb_info/image/set',params)
 	},
-
+	/**
+	 * 设置图表缩略图 formData
+	 * @param {Number} EdbInfoId 
+	 * @param {String} Img 
+	 * @returns 
+	 */
+	saveEdbChartThumbnail:(params)=>{
+		return http.post('/datamanage/edb_info/image/set_by_svg',params)
+	},
 	/** 
 	 * 获取图表批量刷新结果
 	 * @param {Object} params

+ 8 - 1
src/api/modules/predictEdbApi.js

@@ -166,7 +166,14 @@ export const edbSearch = params => {
 export const setImg = params => {
 	return http.post('/datamanage/predict_edb_info/image/set',params)
 }
-
+/**
+ * 设置缩略图 formData
+ * @param {*} params EdbInfoId  Img
+ * @returns 
+ */
+export const setThumbnail = params => {
+	return http.post('/datamanage/predict_edb_info/image/set_by_svg',params)
+}
 /**
  * 指标刷新
  * @param {*} params EdbInfoId

+ 7 - 5
src/views/chartRelevance_manage/components/chartCard.vue

@@ -253,11 +253,13 @@ export default {
     },
 
     async setImageHandle(form,id) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-      await dataBaseInterface.setChartImage({
-        ChartInfoId: id,
-        ImageUrl: Data.ResourceUrl,
-      });
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+      // await dataBaseInterface.setChartImage({
+      //   ChartInfoId: id,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+      form.append('ChartInfoId',id)
+      await dataBaseInterface.setChartThumbnail(form)
     },
 
     /* 更新图表 */

+ 7 - 6
src/views/chartRelevance_manage/crossVarietyAnalysis/chartEditor.vue

@@ -429,12 +429,13 @@ export default {
       this.setImageHandle(form,data);
     },
     async setImageHandle(form,{ UniqueCode,ChartInfoId }) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-      await dataBaseInterface.setChartImage({
-        ChartInfoId: ChartInfoId,
-        ImageUrl: Data.ResourceUrl,
-      });
-
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+      // await dataBaseInterface.setChartImage({
+      //   ChartInfoId: ChartInfoId,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+      form.append('ChartInfoId',ChartInfoId)
+      await dataBaseInterface.setChartThumbnail(form)
 			this.$message.success(/* '保存成功' */this.$t('StatisticAnalysis.FittingEquationChart.detail_dialog_save_success'));
 			this.$router.replace({
 				path: '/crossVarietyChartList',

+ 8 - 6
src/views/chartRelevance_manage/mixins/classifyMixin.js

@@ -437,12 +437,14 @@ export default {
     },
 
     async setImageHandle(form) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-
-      await dataBaseInterface.setChartImage({
-        ChartInfoId: this.select_id,
-        ImageUrl: Data.ResourceUrl,
-      });
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+
+      // await dataBaseInterface.setChartImage({
+      //   ChartInfoId: this.select_id,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+      form.append('ChartInfoId',this.select_id)
+      await dataBaseInterface.setChartThumbnail(form)
     },
 
     copyChartConfirm(type) {

+ 8 - 7
src/views/dataEntry_manage/addChart.vue

@@ -937,13 +937,14 @@ export default {
       this.setImageHandle(form,data);
     },
     async setImageHandle(form,{ UniqueCode,ChartInfoId }) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-      // let { Data } = await dataBaseInterface.uploadImg(form);
-      await dataBaseInterface.setChartImage({
-        ChartInfoId: ChartInfoId,
-        ImageUrl: Data.ResourceUrl,
-      });
-
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+      // // let { Data } = await dataBaseInterface.uploadImg(form);
+      // await dataBaseInterface.setChartImage({
+      //   ChartInfoId: ChartInfoId,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+      form.append('ChartInfoId',ChartInfoId)
+      await dataBaseInterface.setChartThumbnail(form)
 			// this.$message.success('添加成功');
 			this.$message.success(this.$t('MsgPrompt.add_msg2'));
 			this.$router.replace({

+ 9 - 7
src/views/dataEntry_manage/chartSetting.vue

@@ -2403,13 +2403,15 @@ export default {
         this.setImageHandle(form);
     },
     async setImageHandle(form) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-
-      // let { Data } = await dataBaseInterface.uploadImg(form);
-      await dataBaseInterface.setChartImage({
-        ChartInfoId: this.selected_chartid,
-        ImageUrl: Data.ResourceUrl,
-      });
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+
+      // // let { Data } = await dataBaseInterface.uploadImg(form);
+      // await dataBaseInterface.setChartImage({
+      //   ChartInfoId: this.selected_chartid,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+      form.append('ChartInfoId',this.selected_chartid)
+      await dataBaseInterface.setChartThumbnail(form)
     },
 
     /* 分享图表 */

+ 9 - 6
src/views/dataEntry_manage/databaseComponents/chartTrendRender.vue

@@ -294,13 +294,16 @@ export default {
 			});
 			let form = new FormData();
 			form.append("Img", svg);
-			let { Data,Ret } = await dataBaseInterface.uploadImgSvg(form);
+			form.append('EdbInfoId',EdbInfo.EdbInfoId)
+      await dataBaseInterface.saveEdbChartThumbnail(form)
+			
+			// let { Data,Ret } = await dataBaseInterface.uploadImgSvg(form);
 
-			if(Ret!==200 || !Data) return 
-			await dataBaseInterface.saveEdbChartImg({
-				EdbInfoId: EdbInfo.EdbInfoId,
-				ImageUrl: Data.ResourceUrl,
-			});
+			// if(Ret!==200 || !Data) return 
+			// await dataBaseInterface.saveEdbChartImg({
+			// 	EdbInfoId: EdbInfo.EdbInfoId,
+			// 	ImageUrl: Data.ResourceUrl,
+			// });
 		},
 
 		/* 获取装置指标数据 */

+ 7 - 5
src/views/datasheet_manage/components/BalanceSheetChartItem.vue

@@ -119,12 +119,14 @@ export default {
             });
             let form = new FormData();
             form.append('Img', svg);
-            let { Data } = await dataBaseInterface.uploadImgSvg(form);
+            // let { Data } = await dataBaseInterface.uploadImgSvg(form);
 
-            await dataBaseInterface.setChartImage({
-                ChartInfoId: this.chartInfo.ChartInfoId,
-                ImageUrl: Data.ResourceUrl,
-            });
+            // await dataBaseInterface.setChartImage({
+            //     ChartInfoId: this.chartInfo.ChartInfoId,
+            //     ImageUrl: Data.ResourceUrl,
+            // });
+            form.append('ChartInfoId',this.chartInfo.ChartInfoId)
+            await dataBaseInterface.setChartThumbnail(form)
         },
 
         handleAddMyChart(){

+ 7 - 6
src/views/futures_manage/chartEditor.vue

@@ -576,12 +576,13 @@ export default {
     },
     
     async setImageHandle(form,{ UniqueCode,ChartInfoId }) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-      await dataBaseInterface.setChartImage({
-        ChartInfoId: ChartInfoId,
-        ImageUrl: Data.ResourceUrl,
-      });
-
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+      // await dataBaseInterface.setChartImage({
+      //   ChartInfoId: ChartInfoId,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+			form.append('ChartInfoId',ChartInfoId)
+			await dataBaseInterface.setChartThumbnail(form)
 			this.$message.success(this.chart_code ? this.$t('MsgPrompt.add_msg2')||'添加成功' : this.$t('MsgPrompt.saved_msg')||'保存成功');
 			this.$router.replace({
 				path: '/commordityChartBase',

+ 8 - 6
src/views/futures_manage/commodityChartBase.vue

@@ -575,12 +575,14 @@ export default {
     },
 
     async setImageHandle(form) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-
-      await dataBaseInterface.setChartImage({
-        ChartInfoId: this.selected_chartid,
-        ImageUrl: Data.ResourceUrl,
-      });
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+
+      // await dataBaseInterface.setChartImage({
+      //   ChartInfoId: this.selected_chartid,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+			form.append('ChartInfoId',this.selected_chartid)
+			await dataBaseInterface.setChartThumbnail(form)
     },
 
 		copyChartConfirm(type) {

+ 8 - 6
src/views/mychart_manage/components/chartDetailDia.vue

@@ -1235,12 +1235,14 @@ export default {
         this.setImageHandle(form);
     },
     async setImageHandle(form) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-      // let { Data } = await dataBaseInterface.uploadImg(form);
-      await dataBaseInterface.setChartImage({
-        ChartInfoId: this.chartInfo.ChartInfoId,
-        ImageUrl: Data.ResourceUrl,
-      });
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+      // // let { Data } = await dataBaseInterface.uploadImg(form);
+      // await dataBaseInterface.setChartImage({
+      //   ChartInfoId: this.chartInfo.ChartInfoId,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+      form.append('ChartInfoId',this.chartInfo.ChartInfoId)
+			await dataBaseInterface.setChartThumbnail(form)
     },
 
     /* 点击表格行展开配置项 */

+ 7 - 5
src/views/predictEdb_manage/addPredicEdb.vue

@@ -993,11 +993,13 @@ export default {
     },
 
     async setImageHandle(form) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-      await preDictEdbInterface.setImg({
-        EdbInfoId: this.formData.edb_id,
-        ImageUrl: Data.ResourceUrl,
-      });
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+      // await preDictEdbInterface.setImg({
+      //   EdbInfoId: this.formData.edb_id,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+      form.append("EdbInfoId", this.formData.edb_id);
+      await preDictEdbInterface.setThumbnail(form)
     },
 
     refreshData() {

+ 7 - 5
src/views/predictEdb_manage/components/edbDetail.vue

@@ -177,11 +177,13 @@ export default {
         },
 
         async setImageHandle(form) {
-            let { Data } = await dataBaseInterface.uploadImgSvg(form);
-            await preDictEdbInterface.setImg({
-                EdbInfoId: this.id,
-                ImageUrl: Data.ResourceUrl,
-            });
+            // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+            // await preDictEdbInterface.setImg({
+            //     EdbInfoId: this.id,
+            //     ImageUrl: Data.ResourceUrl,
+            // });
+            form.append("EdbInfoId", this.id);
+            await preDictEdbInterface.setThumbnail(form)
         },
         getData(){
             preDictEdbInterface.edbDataInfo({

+ 7 - 5
src/views/predictEdb_manage/predictEdb.vue

@@ -938,11 +938,13 @@ export default {
     },
 
     async setImageHandle(form) {
-      let { Data } = await dataBaseInterface.uploadImgSvg(form);
-      await preDictEdbInterface.setImg({
-        EdbInfoId: this.select_id,
-        ImageUrl: Data.ResourceUrl,
-      });
+      // let { Data } = await dataBaseInterface.uploadImgSvg(form);
+      // await preDictEdbInterface.setImg({
+      //   EdbInfoId: this.select_id,
+      //   ImageUrl: Data.ResourceUrl,
+      // });
+			form.append("EdbInfoId", this.select_id);
+      await preDictEdbInterface.setThumbnail(form)
     },
 
 		/* 添加一级目录 */