jwyu 11 månader sedan
förälder
incheckning
506811304f

+ 10 - 0
src/utils/buttonConfig.js

@@ -455,6 +455,16 @@ export const etaTablePermission = {
     etaTable_analysis_del:'etaTable:analysis:del',//删除
     etaTable_analysis_save:'etaTable:analysis:save',//保存
     etaTable_analysis_edit:'etaTable:analysis:edit',//编辑
+
+    // 平衡表
+    etaTable_customize_balance_sheetAdd:'etaTable:customize:balance:sheetAdd',//添加
+    etaTable_customize_balance_del:'etaTable:customize:balance:del',//删除
+    etaTable_customize_balance_download:'etaTable:customize:balance:download',//下载
+    etaTable_customize_balance_otherSave:'etaTable:customize:balance:otherSave',//另存为
+    etaTable_customize_balance_refresh:'etaTable:customize:balance:refresh',//刷新
+    etaTable_customize_balance_edit:'etaTable:customize:balance:edit',//编辑
+    etaTable_customize_balance_classifyOpt_delete:'etaTable:customize:balance:classifyOpt:delete',//删除分类
+    etaTable_customize_balance_classifyOpt_edit:'etaTable:customize:balance:classifyOpt:edit',//添加/编辑分类
 }
 /*
  * --------------------------------------------------------------------------ETA逻辑------------------------------------------------

+ 92 - 19
src/views/datasheet_manage/components/BalanceAddChart.vue

@@ -470,13 +470,63 @@ export default {
       formRules: {},
 
       edbList: [],//sheet1!$A$3:$A$13
-      selectInput:''
+      selectInput:'',
+
+      editChartInfoId:0,//编辑时的图表id
     }
   },
   created() {
     this.edbList.push(this.createEbdListItem('A'))
   },
   methods: {
+    // 编辑时初始化数据
+    initEditData(e){
+      console.log('edit回显数据',e);
+      const {ChartInfo,EdbInfoList}=e
+      this.editChartInfoId=ChartInfo.ChartInfoId
+      this.formData.chartName=ChartInfo.ChartName
+      this.formData.chartSource=JSON.parse(ChartInfo.SourcesFrom).text
+      this.formData.showChartSource=JSON.parse(ChartInfo.SourcesFrom).isShow
+      this.formData.chartType=ChartInfo.ChartType
+      this.formData.leftMin=ChartInfo.LeftMin?Number(ChartInfo.LeftMin):0
+      this.formData.leftMax=ChartInfo.LeftMax?Number(ChartInfo.LeftMax):0
+      this.formData.rightMin=ChartInfo.RightMin?Number(ChartInfo.RightMin):0
+      this.formData.rightMax=ChartInfo.RightMax?Number(ChartInfo.RightMax):0
+      this.formData.rightTwoMin=ChartInfo.Right2Min?Number(ChartInfo.Right2Min):0
+      this.formData.rightTwoMax=ChartInfo.Right2Max?Number(ChartInfo.Right2Max):0
+      if(ChartInfo.ChartType===2&&ChartInfo.SeasonExtraConfig){
+        this.SeasonExtraConfig.ChartLegend=ChartInfo.SeasonExtraConfig.ChartLegend
+        this.SeasonExtraConfig.XStartDate=ChartInfo.SeasonExtraConfig.XStartDate
+        this.SeasonExtraConfig.XEndDate=ChartInfo.SeasonExtraConfig.XEndDate
+        this.SeasonExtraConfig.JumpYear=ChartInfo.SeasonExtraConfig.JumpYear?true:false
+        this.SeasonExtraConfig.type=ChartInfo.Calendar
+      }
+
+      // 回显
+      const arr=EdbInfoList||[]
+      let temEdbList=[]
+      arr.forEach((item,index)=>{
+        temEdbList.push({
+          tag: '',
+          ExcelChartEdbId:item.EdbInfoId,
+          timeSerial: '',
+          valueSerial: '',
+          maxData:item.MaxData,//选中数据的最大值
+          minData:item.MinData,//选中数据的最小值
+          name: item.EdbAliasName,
+          axis: item.IsAxis,//哪个轴 1左轴 0右轴 2右二轴
+          EdbInfoType: item.EdbInfoType,//指标类型 1标准指标 0领先指标
+          leadVal: item.LeadValue,//领先值
+          leadUnit: item.LeadUnit,//领先单位 
+          IsOrder: item.IsOrder,//是否逆序
+        })
+      })
+
+      this.edbList=temEdbList
+      
+
+    },
+
     // 点击选中哪个指标的时间\数值序列
     handleChooseInput(e){
       this.selectInput=e
@@ -600,10 +650,11 @@ export default {
     createEbdListItem(t) {
       return {
         tag: t,
+        ExcelChartEdbId:0,
         timeSerial: '',
         valueSerial: '',
         maxData:0,//选中数据的最大值
-        minData:0,//选中数据的最大=小值
+        minData:0,//选中数据的最小值
         name: '',
         axis: 1,//哪个轴 1左轴 0右轴 2右二轴
         EdbInfoType: 1,//指标类型 1标准指标 0领先指标
@@ -618,12 +669,35 @@ export default {
     },
     // 初始化表单
     initData() {
-      // this.
+      this.editChartInfoId=0
+      this.formData={
+        chartName: '',
+        chartSource: '平衡表',
+        showChartSource: false,
+        chartType: 1,
+        leftMin: 0,
+        leftMax: 0,
+        rightMin: 0,
+        rightMax: 0,
+        rightTwoMin: 0,
+        rightTwoMax: 0,
+      }
+      this.SeasonExtraConfig={
+        ChartLegend:[], // 图例名称数组
+				XStartDate:"01-01", // 横坐标显示范围 - 开始
+				XEndDate:"12-31", // 横坐标显示范围-结束
+				JumpYear:false, //是否跨年
+        isSpanYearDisable:false,
+        type:'公历',
+      }
+      this.edbList=[]
+      this.selectInput=''
+      this.edbList.push(this.createEbdListItem('A'))
     },
-    saveHandle() { 
+    async saveHandle() { 
       const params={
         ExcelInfoId:this.ExcelInfoId,
-        ChartInfoId:0,
+        ChartInfoId:this.editChartInfoId||0,
         ChartEdbInfoList:[],
         ChartName:this.formData.chartName,
         ChartType:this.formData.chartType,
@@ -631,12 +705,12 @@ export default {
           text:this.formData.chartSource,
           isShow:this.formData.showChartSource
         }),
-        LeftMin:this.formData.leftMin+'',
-        LeftMax:this.formData.leftMax+'',
-        RightMin:this.formData.rightMin+'',
-        RightMax:this.formData.rightMax+'',
-        Right2Min:this.formData.rightTwoMin+'',
-        Right2Max:this.formData.rightTwoMax+'',
+        LeftMin:`${this.formData.leftMin}`,
+        LeftMax:`${this.formData.leftMax}`,
+        RightMin:`${this.formData.rightMin}`,
+        RightMax:`${this.formData.rightMax}`,
+        Right2Min:`${this.formData.rightTwoMin}`,
+        Right2Max:`${this.formData.rightTwoMax}`,
         MinMaxSave:1,
         Source:11
       }
@@ -668,7 +742,7 @@ export default {
       this.edbList.forEach(item=>{
         arr.push({
           FromTag:item.tag,
-          ExcelChartEdbId:0,
+          ExcelChartEdbId:item.ExcelChartEdbId,
           EdbName:item.name,
           IsAxis:item.axis,
           IsOrder:item.IsOrder,
@@ -688,13 +762,12 @@ export default {
         if(!item.EdbName) return this.$message.warning(`第${index+1}个指标名称未填写`)
       }
 
-      sheetInterface.addBalanceChart(params).then(res=>{
-        if(res.Ret===200){
-          this.$message.success(this.$t('MsgPrompt.add_msg2'));
-          this.$emit('success')
-        }
-      })
-
+      const res=this.editChartInfoId?await sheetInterface.editBalanceChart(params):await sheetInterface.addBalanceChart(params)
+      if(res.Ret===200){
+        this.$message.success(this.$t('MsgPrompt.add_msg2'));
+        this.initData()
+        this.$emit('success')
+      }
     },
     cancelHandle() {
       this.$emit('update:isShow', false);

+ 6 - 1
src/views/datasheet_manage/components/BalanceSheetChartItem.vue

@@ -16,7 +16,7 @@
                 <!-- 加入我的图库 -->
                 <span class="btn-o" @click="handleAddMyChart">{{$t('Chart.chart_addmy_btn')}}</span>
                 <!-- 编辑 -->
-                <span class="btn-o">{{$t('Chart.chart_edit_btn')}}</span>
+                <span class="btn-o" @click="handleEditChart">{{$t('Chart.chart_edit_btn')}}</span>
                 <!-- 删除 -->
                 <span class="btn-o" style="color:#f00">{{$t('Chart.chart_del_btn')}}</span>
             </div>
@@ -70,6 +70,11 @@ export default {
             this.tableData.length&&this.setChartOptionHandle(this.tableData)
         },
 
+        // 编辑图表
+        handleEditChart(){
+            this.$emit('edit',this.chartData)
+        },
+
         /* 加入我的图库成功 */
         addMySuccess(params){
             this.isAddMyChart = false;

+ 5 - 0
src/views/datasheet_manage/components/BalanceSheetList.vue

@@ -30,30 +30,35 @@
             class="editsty"
             @click="itemHandle(row, 'edit')"
             style="margin-right: 10px"
+            v-if="$parent.isSheetBtnShow('edit')"
             >{{row.CanEdit?$t("ETable.Btn.edit_btn"):row.Editor+$t('OnlineExcelPage.editing_msg')}}</span
           >
           <span
             class="editsty"
             @click="itemHandle(row, 'refresh')"
             style="margin-right: 10px"
+            v-if="$parent.isSheetBtnShow('refresh')"
             >{{ $t("ETable.Btn.refresh_btn") }}</span
           >
           <span
             class="editsty"
             @click="itemHandle(row, 'save')"
             style="margin-right: 10px"
+            v-if="$parent.isSheetBtnShow('otherSave')"
             >{{ $t("ETable.Btn.save_as") }}</span
           >
           <span
             class="editsty"
             @click="itemHandle(row, 'download')"
             style="margin-right: 10px"
+            v-if="$parent.isSheetBtnShow('download')"
             >{{ $t("ETable.Btn.download_btn") }}</span
           >
           <span
             class="deletesty"
             @click="itemHandle(row, 'del')"
             style="margin-right: 10px"
+            v-if="$parent.isSheetBtnShow('del')"
             >{{ $t("Table.delete_btn") }}</span
           >
         </template>

+ 12 - 1
src/views/datasheet_manage/components/BalanceTable.vue

@@ -240,7 +240,12 @@
         <!-- 图表模块 -->
         <div class="right-wrap" v-if="chartList.length>0">
           <div class="chart-list">
-            <BalanceSheetChartItem :chartData="item" v-for="item in chartList" :key="item.ChartInfo.ChartInfoId"/>
+            <BalanceSheetChartItem 
+              :chartData="item" 
+              v-for="item in chartList" 
+              :key="item.ChartInfo.ChartInfoId"
+              @edit="handleEditChart"
+            />
           </div>
           
         </div>
@@ -535,6 +540,12 @@ export default {
       this.getChartList()
     },
 
+    // 编辑图表
+    handleEditChart(e){
+      this.isShowAddChart=true
+      this.$refs.balanceAddChart.initEditData(e)
+    },
+
 
     startSelection(startRow, startCol) {
       console.log('开始选择');

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

@@ -353,7 +353,8 @@ export default {
         '/sheetList': 'etaTable_excel',
         '/sheetTimeList': 'etaTable_customize_data',
         '/sheetMixedList': 'etaTable_customize_mix',
-        '/sheetAnalysisList': 'etaTable_analysis'
+        '/sheetAnalysisList': 'etaTable_analysis',
+        '/sheetBalanceList':'etaTable_customize_balance'
       }
       return this.permissionBtn.isShowBtn('etaTablePermission',`${sheetType[this.$route.path]}_${type}`)
     }

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

@@ -16,7 +16,7 @@
           <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_customize_data_sheetAdd)&&sourceMap[$route.path]===2" type="primary" style="margin-right:20px" @click="goAddSheetHandle">{{$t('OnlineExcelPage.add_timeline_table_btn')}}</el-button >
 
           <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_customize_mix_sheetAdd)&&sourceMap[$route.path]===3" type="primary" @click="goAddSheetHandle">{{$t('OnlineExcelPage.add_mixed_table_btn')}}</el-button >
-          <el-button v-if="sourceMap[$route.path]===5" type="primary" @click="showAddBalanceTable=true">{{$t('OnlineExcelPage.add_balance_table_btn')}}</el-button >
+          <el-button v-if="permissionBtn.checkPermissionBtn(permissionBtn.etaTablePermission.etaTable_customize_balance_sheetAdd)&&sourceMap[$route.path]===5" type="primary" @click="showAddBalanceTable=true">{{$t('OnlineExcelPage.add_balance_table_btn')}}</el-button >
 
           <el-checkbox 
             v-model="isShowMe"