瀏覽代碼

fix something

Karsa 1 年之前
父節點
當前提交
ea04edb0ce

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

@@ -509,16 +509,15 @@
 						<div class="chart-bottom-insruction-info">
 
 							<div class="chart-source">
-								<span>
-									数据来源:
-									<span
-										v-if="chartInfo.SourcesFrom"
-										:style="`
-										color: ${JSON.parse(chartInfo.SourcesFrom).isShow ? JSON.parse(chartInfo.SourcesFrom).color : '#999'};
-										fontSize: ${ JSON.parse(chartInfo.SourcesFrom).fontSize }px;
-									`"
-									>{{ JSON.parse(chartInfo.SourcesFrom).text}}</span>
+								<span
+									v-if="chartInfo.SourcesFrom"
+									:style="`
+									color: ${JSON.parse(chartInfo.SourcesFrom).isShow ? JSON.parse(chartInfo.SourcesFrom).color : '#999'};
+									fontSize: ${ JSON.parse(chartInfo.SourcesFrom).fontSize }px;
+								`"
+								>数据来源:{{ JSON.parse(chartInfo.SourcesFrom).text}}
 								</span>
+
 								<el-switch
 									v-if="chartInfo.SourcesFrom"
 									v-model="chartInfo.SourcesFromVisable"

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

@@ -494,13 +494,12 @@
                   <div class="chart-bottom-insruction-info">
 
                     <div class="chart-source" v-if="chartInfo.SourcesFrom&&JSON.parse(chartInfo.SourcesFrom).isShow">
-                        数据来源:
                         <span
                           :style="`
                           color: ${JSON.parse(chartInfo.SourcesFrom).color};
                           fontSize: ${ JSON.parse(chartInfo.SourcesFrom).fontSize }px;
                         `"
-                        >{{ JSON.parse(chartInfo.SourcesFrom).text}}</span>
+                        >数据来源:{{ JSON.parse(chartInfo.SourcesFrom).text}}</span>
                     </div>
 
                     <!-- 公历农历切换 只用于季节性图 -->

+ 2 - 1
src/views/dataEntry_manage/components/chart.vue

@@ -109,7 +109,8 @@ export default {
 				},
 				chart: {
 					...defaultOpts.chart,
-					...chartTheme.drawOption
+					...chartTheme.drawOption,
+					spacing: chartTheme.legendOptions.verticalAlign==='bottom' ? [23,10,2,10] : [2,10,2,10],//图例在底部顶部空间留大点给单位
 				},
 				colors: chartTheme.colorsOptions
 			}

+ 2 - 2
src/views/dataEntry_manage/components/markersSection.vue

@@ -207,8 +207,8 @@ export default {
     /* 编辑标识线/区 */
     editMarkerItem({index,item}) {
       this.markerForm.markerType==='line'
-        ? this.markerLinesArr[index-1] = item
-        : this.markerAreasArr[index-1] = item
+        ? this.$set(this.markerLinesArr,[index-1],item) 
+        : this.$set(this.markerAreasArr,[index-1],item)
 
       this.updateChartHandle()
     },

+ 1 - 4
src/views/dataEntry_manage/editChart.vue

@@ -500,16 +500,13 @@
 						<div class="chart-bottom-insruction-info">
 
 							<div class="chart-source">
-								<span>
-									数据来源:
 									<span
 										v-if="chartInfo.SourcesFrom"
 										:style="`
 										color: ${JSON.parse(chartInfo.SourcesFrom).isShow ? JSON.parse(chartInfo.SourcesFrom).color : '#999'};
 										fontSize: ${ JSON.parse(chartInfo.SourcesFrom).fontSize }px;
 									`"
-									>{{ JSON.parse(chartInfo.SourcesFrom).text}}</span>
-								</span>
+									>数据来源:{{ JSON.parse(chartInfo.SourcesFrom).text}}</span>
 								<el-switch
 									v-if="chartInfo.SourcesFrom"
 									v-model="chartInfo.SourcesFromVisable"

+ 17 - 9
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -599,7 +599,7 @@ export const chartSetMixin = {
             },
             align: 'high',
             rotation: 0,
-            y: -15,
+            y: -12,
             x: (item.IsAxis===0 && this.rightTwoIndex>-1) ? -chartData[this.rightTwoIndex].Unit.length*12 : 0,
             textAlign: item.IsAxis===1 ? 'left' : 'right',
             reserveSpace: false
@@ -776,7 +776,7 @@ export const chartSetMixin = {
             },
             align: 'high',
             rotation: 0,
-            y: -15,
+            y: -12,
             x: (item.IsAxis===0 && this.rightTwoIndex>-1) ? -chartData[this.rightTwoIndex].Unit.length*12 : 0,
             textAlign: item.IsAxis===1 ? 'left' : 'right',
             reserveSpace: false
@@ -936,7 +936,7 @@ export const chartSetMixin = {
           // text:  null,
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           x: 0,
           textAlign: 'left',
           reserveSpace: false
@@ -1075,7 +1075,7 @@ export const chartSetMixin = {
           },
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           x:0,
           textAlign: 'left',
           reserveSpace: false
@@ -1186,7 +1186,7 @@ export const chartSetMixin = {
           textEn: this.chartInfo.UnitEn,
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           x:0,
           textAlign: 'left',
           reserveSpace: false,
@@ -1281,7 +1281,7 @@ export const chartSetMixin = {
           },
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           textAlign: 'left',
           reserveSpace: false
         },
@@ -1519,7 +1519,7 @@ export const chartSetMixin = {
           textEn: 'Correlation coefficient',
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           textAlign: 'left',
           reserveSpace: false,
           style:{
@@ -1828,7 +1828,7 @@ export const chartSetMixin = {
             textEn:item.UnitEn||item.Unit,
             align: 'high',
             rotation: 0,
-            y: -15,
+            y: -12,
             reserveSpace: false,
             style:{
               ...chartTheme&&chartTheme.yAxisOptions.style
@@ -2421,6 +2421,13 @@ export const chartSetMixin = {
           toMarkerValue = Number(_.toValue);
         }
 
+        //默认label有些偏移 重新归正下
+        let positionMapValue = {
+          'top': 12,
+          'middle': 0,
+          'bottom': -10
+        }
+
         return { 
           from: fromMarkerValue,
           to: toMarkerValue,
@@ -2431,7 +2438,8 @@ export const chartSetMixin = {
             style: {
               color: _.textColor,
               fontSize: _.textFontSize
-            }
+            },
+            y: positionMapValue[_.textPosition]
           }
         }
       })

+ 1 - 2
src/views/mychart_manage/components/chartDetailDia.vue

@@ -331,13 +331,12 @@
             <div class="chart-bottom-insruction-info">
 
               <div class="chart-source" v-if="chartInfo.SourcesFrom&&JSON.parse(chartInfo.SourcesFrom).isShow">
-                  数据来源:
                   <span
                     :style="`
                     color: ${ JSON.parse(chartInfo.SourcesFrom).color };
                     fontSize: ${ JSON.parse(chartInfo.SourcesFrom).fontSize }px;
                   `"
-                  >{{ JSON.parse(chartInfo.SourcesFrom).text}}</span>
+                  >数据来源:{{JSON.parse(chartInfo.SourcesFrom).text}}</span>
               </div>
 
                <!-- 公历农历切换 只用于季节性图 -->

+ 17 - 9
src/views/ppt_manage/mixins/mixins.js

@@ -124,7 +124,7 @@ export default {
             },
             align: 'high',
             rotation: 0,
-            y: -15,
+            y: -12,
             x: (item.IsAxis===0 && rightTwoIndex>-1) ? -chartData[rightTwoIndex].Unit.length*12 : 0,
             textAlign: item.IsAxis===1 ? 'left' : 'right',
             reserveSpace: false
@@ -285,7 +285,7 @@ export default {
             },
             align: 'high',
             rotation: 0,
-            y: -15,
+            y: -12,
             x: (item.IsAxis===0 && rightTwoIndex>-1) ? -chartData[rightTwoIndex].Unit.length*12 : 0,
             textAlign: item.IsAxis===1 ? 'left' : 'right',
             reserveSpace: false
@@ -443,7 +443,7 @@ export default {
           // text:  null,
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           x: 0,
           textAlign: 'left',
           reserveSpace: false
@@ -563,7 +563,7 @@ export default {
           },
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           offset: -(12 * chartData[1].Unit.length),
         },
         labels: {
@@ -678,7 +678,7 @@ export default {
           textEn: this.chartInfo.UnitEn,
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           x:0,
           textAlign: 'left',
           reserveSpace: false,
@@ -782,7 +782,7 @@ export default {
           textEn:   this.commodityEdbList[0].Unit?(this.commodityEdbList[0].UnitEn||'英文单位'):'',
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           textAlign: 'left',
           reserveSpace: false,
           style:{
@@ -998,7 +998,7 @@ export default {
           textEn: 'Correlation coefficient',
           align: 'high',
           rotation: 0,
-          y: -15,
+          y: -12,
           textAlign: 'left',
           reserveSpace: false,
           style:{
@@ -1299,7 +1299,7 @@ export default {
             textEn:item.UnitEn||item.Unit,
             align: 'high',
             rotation: 0,
-            y: -15,
+            y: -12,
             reserveSpace: false,
             style:{
               ...chartTheme&&chartTheme.yAxisOptions.style
@@ -1664,6 +1664,13 @@ export default {
           toMarkerValue = Number(_.toValue);
         }
 
+         //默认label有些偏移 重新归正下
+        let positionMapValue = {
+          'top': 12,
+          'middle': 0,
+          'bottom': -10
+        }
+
         return { 
           from: fromMarkerValue,
           to: toMarkerValue,
@@ -1674,7 +1681,8 @@ export default {
             style: {
               color: _.textColor,
               fontSize: _.textFontSize
-            }
+            },
+            y: positionMapValue[_.textPosition]
           }
         }
       })

+ 1 - 0
src/views/ppt_manage/mixins/pptMixins.js

@@ -485,6 +485,7 @@ export default {
           chart: {
             ...defaultOpts.chart,
 					  ...chartTheme&&chartTheme.drawOption,
+            spacing: chartTheme.legendOptions.verticalAlign==='bottom' ? [23,10,2,10] : [2,10,2,10],//图例在底部顶部空间留大点给单位
             animation: false,
             backgroundColor: "rgba(0,0,0,0)",
             renderTo:$(`#${refName}`)[0],

+ 1 - 2
src/views/ppt_manage/newVersion/components/formatEl/ChartEl.vue

@@ -46,13 +46,12 @@
   v-if="((chartSourcesFrom&&chartSourcesFrom.isShow) || (chartInstructions&&chartInstructions.isShow)) &&!this.$parent.isHintShow(position)">
 
     <div class="chart-source" v-if="chartSourcesFrom&&chartSourcesFrom.isShow">
-        数据来源:
         <span
           :style="`
           color: ${ chartSourcesFrom.color };
           fontSize: ${ chartSourcesFrom.fontSize }px;
         `"
-        >{{ chartSourcesFrom.text}}</span>
+        >数据来源:{{ chartSourcesFrom.text}}</span>
     </div>
     <!-- 图表说明 -->
     <div 

+ 10 - 2
src/views/system_manage/chartTheme/index.vue

@@ -51,7 +51,8 @@
           </el-card>
         </li>
         <li class="theme-item add-item" @click="addThemeHandle" v-permission="permissionBtn.chartThemePermission.chartTheme_add">
-          <div class="chart-img">
+          <div class="chart-img"></div>
+          <div class="add-cont">
             <i class="el-icon-plus"/>
             <el-button type="text" style="font-size:16px;">添加自定义主题</el-button>
           </div>
@@ -184,7 +185,7 @@ export default {
 
 
     async saveThemeHandle() {
-      if(!this.addThemeForm.themeName) return this.$message.warning('主题名称不能为空')
+      if(!this.addThemeForm.themeName) return this.$message.warning('请输入主题名称')
 
       let res = await chartThemeInterface.addTheme({
         ChartThemeName: this.addThemeForm.themeName,
@@ -264,6 +265,13 @@ export default {
         font-weight: bold;
         color: #0052D9;
       }
+
+      .add-cont {
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate(-50%,-50%);
+      }
     }
   }
 }

+ 13 - 0
src/views/system_manage/chartTheme/themeSetting.vue

@@ -35,6 +35,16 @@
 
       <!-- 预览区 -->
       <div class="chart-render-wrapper">
+        <div 
+          class="title"
+          :style="`
+            textAlign:${chartInfo.ChartThemeStyle&&JSON.parse(chartInfo.ChartThemeStyle).titleOptions.align};
+            fontSize:${chartInfo.ChartThemeStyle&&JSON.parse(chartInfo.ChartThemeStyle).titleOptions.style.fontSize}px;
+            color:${chartInfo.ChartThemeStyle&&JSON.parse(chartInfo.ChartThemeStyle).titleOptions.style.color}
+          `"
+        >
+          图表标题
+        </div>
         <Chart :options="options" :chartInfo="chartInfo" ref="chartRef" height="400px" minHeight="350px"/>
       </div>
     </div>
@@ -193,6 +203,9 @@ export default {
       border: 1px solid #C8CDD9;
       border-radius: 6px;
       margin-left: auto;
+      .title {
+        margin-bottom: 10px;
+      }
     }
   }
 }