Forráskód Böngészése

选择指标插值更改

Karsa 1 éve
szülő
commit
347a852ccd

+ 42 - 10
src/views/datasheet_manage/common/customTable.js

@@ -138,7 +138,7 @@ export function setCellBg(e) {
 export function getRightClickMenu(pos,canEdit=false) {
 export function getRightClickMenu(pos,canEdit=false) {
 
 
   let cellMenu = [
   let cellMenu = [
-    { label: "根据表格中日期选择指标值", key: "choose-target" },
+    { label: "根据日期选择指标值", key: "choose-target" },
     // { 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" },
@@ -265,7 +265,7 @@ export function findCellKeyByFactor(str) {
 
 
 /* 判断值是否是一个数字或数字字符串 */
 /* 判断值是否是一个数字或数字字符串 */
 export function isNumberVal(value) {
 export function isNumberVal(value) {
-   let reg = /^(?:\d*\.?\d+|\d+%|\d*\.\d+%)$/;
+   let reg = /^[-]?(?:\d*\.?\d+|\d+%|\d*\.\d+%)$/;
    
    
    return reg.test(value);
    return reg.test(value);
 }
 }
@@ -273,21 +273,25 @@ export function isNumberVal(value) {
 /* 增加减少小数点位数 */
 /* 增加减少小数点位数 */
 export function transDecimalPlace(str,decimalNum) {
 export function transDecimalPlace(str,decimalNum) {
   console.log(str,decimalNum)
   console.log(str,decimalNum)
-  let s = str, decimalPlaces = getDecimalPlaces(str);
+  let s = str.replace(/%/,''), decimalPlaces = getDecimalPlaces(str);
+
+  //后缀 百分号
+  let suffix = str.endsWith('%') ? '%' : '';
 
 
   if(decimalPlaces===0) { //整数
   if(decimalPlaces===0) { //整数
     // 补零
     // 补零
     const zerosToAdd = Math.max(0, decimalNum);
     const zerosToAdd = Math.max(0, decimalNum);
-    return zerosToAdd > 0 ? `${s}.${'0'.repeat(zerosToAdd)}`:s;
+    return zerosToAdd > 0 
+      ? `${s}.${'0'.repeat(zerosToAdd)}${suffix}`
+      : `${s}${suffix}`;
   }
   }
 
 
-  let integerStr = str.split('.')[0],
-      decimalStr = str.split('.')[1];
-
   if(decimalNum>0) {
   if(decimalNum>0) {
-    return `${s}${'0'.repeat(decimalNum)}`
+    return `${s}${'0'.repeat(decimalNum)}${suffix}`
   } else {
   } else {
-    return decimalNum+decimalPlaces > 0 ? `${integerStr}.${decimalStr.substring(0,decimalNum+decimalPlaces)}`:integerStr
+    return decimalNum+decimalPlaces > 0 
+      ? `${integerStr}.${decimalStr.substring(0,decimalNum+decimalPlaces)}${suffix}`
+      : `${integerStr}${suffix}`
   }
   }
 }
 }
 
 
@@ -308,6 +312,34 @@ export function getDecimalPlaces(numStr) {
 }
 }
 
 
 /* 格式化单元格值 显示转换 */
 /* 格式化单元格值 显示转换 */
-export function transShowValueByStyle() {
+export function transNumPercentType(str,type) {
+  console.log(str,type)
+
+  let isPercent = str.endsWith('%'),s=str.replace(/%/,''),decimalPlaces = getDecimalPlaces(str);
+  
+  if(isPercent && type==='percent') { //百分数转百分
+    return str
+  }
+
+  if(!isPercent && type==='number') { //数字转数字
+    return str
+  }
 
 
+  let num = parseFloat(s)
+
+  if(type==='percent') {
+    const percenStr = (num * 100).toFixed(2) + '%';
+    return percenStr;
+  }else {
+    return (num/100).toFixed(2);
+  }
 }
 }
+
+export function transValueFormat(str,{nt,pn}) {
+  let str1 = str,str2 = '';
+  if(pn !== 0) str1 = transDecimalPlace(str,pn)
+  
+  str2 = nt ? transNumPercentType(str1,nt) : str1;
+
+  return str2;
+}

+ 10 - 13
src/views/datasheet_manage/components/MixedTable.vue

@@ -100,7 +100,7 @@
                   :data-rindex="rowHeader[index]"
                   :data-rindex="rowHeader[index]"
                   :data-cindex="columnHeader[cell_index]"
                   :data-cindex="columnHeader[cell_index]"
                   :data-key="cell.Uid"
                   :data-key="cell.Uid"
-                >{{ cell.ShowStyle?cell.ShowFormulaValue:cell.ShowValue }}</span>
+                >{{ cell.ShowStyle?cell.ShowFormatValue:cell.ShowValue }}</span>
               </el-popover>
               </el-popover>
 
 
               <!-- 数字格式化显示 -->
               <!-- 数字格式化显示 -->
@@ -110,7 +110,7 @@
                 :data-cindex="columnHeader[cell_index]"
                 :data-cindex="columnHeader[cell_index]"
                 :data-key="cell.Uid"
                 :data-key="cell.Uid"
               >
               >
-                {{cell.ShowFormulaValue}}
+                {{cell.ShowFormatValue}}
               </span>
               </span>
 
 
               <span
               <span
@@ -390,7 +390,7 @@ export default {
       }
       }
 
 
       //选择指标弹窗打开时选择日期更新弹窗数据
       //选择指标弹窗打开时选择日期更新弹窗数据
-      this.isSelectTargetValueDialog&&this.$refs.selectTargetValueRef.changeDateType(this.selectCell)
+      // this.isSelectTargetValueDialog&&this.$refs.selectTargetValueRef.changeDateType(this.selectCell)
 
 
       //计算指标弹窗打开时选择日期更新弹窗数据
       //计算指标弹窗打开时选择日期更新弹窗数据
       // this.isInsertCalculate&&this.$refs.calculateEdbDiaRef.showResult&&this.$refs.calculateEdbDiaRef.calculateHandle()
       // this.isInsertCalculate&&this.$refs.calculateEdbDiaRef.showResult&&this.$refs.calculateEdbDiaRef.calculateHandle()
@@ -943,16 +943,16 @@ export default {
     /* 弹窗都是无遮罩的 弹一个就重置其他的 */
     /* 弹窗都是无遮罩的 弹一个就重置其他的 */
     resetDialogStatus(type='init') {
     resetDialogStatus(type='init') {
       if(type!=='insertEdbVal') {
       if(type!=='insertEdbVal') {
+        this.$refs.selectTargetValueRef&&this.$refs.selectTargetValueRef.initData();
         this.isSelectTargetValueDialog = false;
         this.isSelectTargetValueDialog = false;
-        this.$refs.selectTargetValueRef.initData();
       }
       }
       if(type!=='insertEdbCalculateVal') {
       if(type!=='insertEdbCalculateVal') {
+        this.$refs.calculateEdbDiaRef&&this.$refs.calculateEdbDiaRef.initData();
         this.isInsertCalculate = false;
         this.isInsertCalculate = false;
-        this.$refs.calculateEdbDiaRef.initData();
       }
       }
       if(type!=='insertDateCalculateVal') {
       if(type!=='insertDateCalculateVal') {
+        this.$refs.calculateDateDiaRef&&this.$refs.calculateDateDiaRef.initData();
         this.isInsertCalculateDate = false;
         this.isInsertCalculateDate = false;
-        this.$refs.calculateDateDiaRef.initData();
       }
       }
     },
     },
 
 
@@ -981,7 +981,7 @@ export default {
 
 
         this.insertCalculateInfo = {
         this.insertCalculateInfo = {
           ...menuInfo,
           ...menuInfo,
-          formStr: Value,
+          ...this.insertTargetCell
         }
         }
       }else {
       }else {
         this.insertCalculateInfo = {
         this.insertCalculateInfo = {
@@ -1158,13 +1158,10 @@ export default {
     },
     },
 
 
     /* 改变单元格显示文本 */
     /* 改变单元格显示文本 */
-    updateCellStyle({ShowStyle,ShowFormulaValue}) {
-      // this.selectCell = {
-      //   ...this.selectCell,
-      //   ...item
-      // }
+    updateCellStyle({ShowStyle,ShowFormatValue}) {
+      
       this.$set(this.selectCell,'ShowStyle',ShowStyle)
       this.$set(this.selectCell,'ShowStyle',ShowStyle)
-      this.$set(this.selectCell,'ShowFormulaValue',ShowFormulaValue)
+      this.$set(this.selectCell,'ShowFormatValue',ShowFormatValue)
       console.log(this.selectCell)
       console.log(this.selectCell)
     }
     }
   },
   },

+ 11 - 6
src/views/datasheet_manage/components/calculateEdbDia.vue

@@ -183,7 +183,11 @@
                   />期
                   />期
                 </div>
                 </div>
               </div>
               </div>
-              <el-radio v-model="dateSelectForm.Type" :label="2" style="margin-left:50px">表格日期</el-radio>
+              <div class="flex">
+                <el-radio v-model="dateSelectForm.Type" :label="2" style="margin-left:50px">表格日期</el-radio>
+                <span v-if="dateSelectForm.relationDate">{{dateSelectForm.relationDate}}</span>
+
+              </div>
             </li>
             </li>
             <li>
             <li>
               <dateMoveWaySec ref="dateMoveWayRef"/>
               <dateMoveWaySec ref="dateMoveWayRef"/>
@@ -244,11 +248,11 @@ export default {
       if(!nval) return
       if(!nval) return
       console.log(this.info)
       console.log(this.info)
       this.getTableEdbList()
       this.getTableEdbList()
-      const { source,formStr } = this.info;
+      const { source } = this.info;
 
 
       this.formData.source = source;
       this.formData.source = source;
       //回显
       //回显
-      if(formStr) {
+      if(this.info.Value) {
         const {
         const {
           Source,
           Source,
           Frequency,
           Frequency,
@@ -260,7 +264,7 @@ export default {
           DataTime,
           DataTime,
           MoveForward,
           MoveForward,
           DateChange
           DateChange
-        } = JSON.parse(formStr);
+        } = JSON.parse(this.info.Value);
 
 
         this.formData = {
         this.formData = {
           source: Source,
           source: Source,
@@ -276,7 +280,8 @@ export default {
 
 
         this.dateSelectForm = {
         this.dateSelectForm = {
           Type: DataTime ? 2 : 1,
           Type: DataTime ? 2 : 1,
-          MoveForward: MoveForward || 0
+          MoveForward: MoveForward || 0,
+          relationDate: this.info.DataTime
         }
         }
         this.selectTableEdbHandle({EdbInfoId})
         this.selectTableEdbHandle({EdbInfoId})
 
 
@@ -493,7 +498,7 @@ export default {
 				valueType: '期末值'
 				valueType: '期末值'
       }
       }
       this.dateSelectForm = {Type:1,MoveForward: 0}
       this.dateSelectForm = {Type:1,MoveForward: 0}
-      this.$refs.dateMoveWayRef.initData();
+      this.$refs.dateMoveWayRef&&this.$refs.dateMoveWayRef.initData();
     },
     },
 
 
     cancelHandle() {
     cancelHandle() {

+ 4 - 7
src/views/datasheet_manage/components/dateMoveWaySection.vue

@@ -21,19 +21,19 @@
               v-model="dateItem.Day"
               v-model="dateItem.Day"
               type="number"
               type="number"
               style="margin-right:10px;width:80px"
               style="margin-right:10px;width:80px"
-              @change="e => {dateItem.Day=Number(e);changeParams()}"
+              @change="e => {dateItem.Day=Number(e);}"
             />天
             />天
             <el-input
             <el-input
               v-model="dateItem.Month"
               v-model="dateItem.Month"
               type="number"
               type="number"
               style="margin-right:10px;width:80px"
               style="margin-right:10px;width:80px"
-              @change="e => {dateItem.Month=Number(e);changeParams()}"
+              @change="e => {dateItem.Month=Number(e);}"
             />月
             />月
             <el-input
             <el-input
               v-model="dateItem.Year"
               v-model="dateItem.Year"
               type="number"
               type="number"
               style="margin-right:10px;width:80px"
               style="margin-right:10px;width:80px"
-              @change="e => {dateItem.Year=Number(e);changeParams()}"
+              @change="e => {dateItem.Year=Number(e);}"
             />年
             />年
           </div>
           </div>
           <i class="el-icon-delete" @click="removeDateItem(index)"></i>
           <i class="el-icon-delete" @click="removeDateItem(index)"></i>
@@ -45,7 +45,7 @@
               style="max-width: 120px;"
               style="max-width: 120px;"
               v-model="dateItem.Frequency"
               v-model="dateItem.Frequency"
               placeholder="请选择频度"
               placeholder="请选择频度"
-              @change="dateItem.FrequencyDay=frequencyDaysOptions[0].name;changeParams()"
+              @change="dateItem.FrequencyDay=frequencyDaysOptions[0].name;"
           >
           >
             <el-option
             <el-option
                 v-for="item in frequencyOptions"
                 v-for="item in frequencyOptions"
@@ -59,7 +59,6 @@
               style="max-width: 120px;margin:0 10px"
               style="max-width: 120px;margin:0 10px"
               v-model="dateItem.FrequencyDay"
               v-model="dateItem.FrequencyDay"
               placeholder="请选择"
               placeholder="请选择"
-              @change="changeParams"
           >
           >
             <el-option
             <el-option
                 v-for="item in frequencyDaysOptions"
                 v-for="item in frequencyDaysOptions"
@@ -129,7 +128,6 @@ export default {
       }
       }
 
 
       this.dateChangeArr.push(item)
       this.dateChangeArr.push(item)
-      this.changeParams()
     },
     },
 
 
     /* 参数更新时刷数据 */
     /* 参数更新时刷数据 */
@@ -148,7 +146,6 @@ export default {
 
 
     removeDateItem(index) {
     removeDateItem(index) {
       this.dateChangeArr.splice(index,1)
       this.dateChangeArr.splice(index,1)
-      this.changeParams()
     }
     }
   },
   },
 }
 }

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

@@ -12,7 +12,7 @@
         @select="chooseEdb"
         @select="chooseEdb"
       />
       />
 
 
-      <ul class="data-cont">
+      <!-- <ul class="data-cont">
         <template v-if="result.List&&result.List.length">
         <template v-if="result.List&&result.List.length">
           <li 
           <li 
             v-for="(item,index) in result.List" 
             v-for="(item,index) in result.List" 
@@ -24,13 +24,13 @@
           </li>
           </li>
         </template>
         </template>
         <tableNoData size="mini" v-else/>
         <tableNoData size="mini" v-else/>
-      </ul>
+      </ul> -->
 
 
       <!-- 依赖日期选择方式 -->
       <!-- 依赖日期选择方式 -->
       <ul class="date-select-cont">
       <ul class="date-select-cont">
         <li class="flex">
         <li class="flex">
           <div class="flex">
           <div class="flex">
-            <el-radio v-model="dateSelectForm.Type" :label="1" @input="chooseEdb(edbInfo)">指标最新日期</el-radio>
+            <el-radio v-model="dateSelectForm.Type" :label="1">指标最新日期</el-radio>
             <div>
             <div>
               <label class="el-form-item__label">期数前移</label>
               <label class="el-form-item__label">期数前移</label>
               <el-input
               <el-input
@@ -38,14 +38,18 @@
                 type="number"
                 type="number"
                 :min="0"
                 :min="0"
                 style="margin-right:10px;width:80px"
                 style="margin-right:10px;width:80px"
-                @change="e => {dateSelectForm.MoveForward=Number(e);chooseEdb(edbInfo)}"
+                @change="e => {dateSelectForm.MoveForward=Number(e);}"
               />期
               />期
             </div>
             </div>
           </div>
           </div>
-          <el-radio v-model="dateSelectForm.Type" :label="2" style="margin-left:50px"  @input="chooseEdb(edbInfo)">表格日期</el-radio>
+          <div class="flex">
+            <el-radio v-model="dateSelectForm.Type" :label="2" style="margin-left:50px">表格日期</el-radio>
+            <span v-if="dateSelectForm.relationDate">{{dateSelectForm.relationDate}}</span>
+
+          </div>
         </li>
         </li>
         <li>
         <li>
-          <dateMoveWaySec ref="dateMoveWayRef" @updateData="chooseEdb(edbInfo)"/>
+          <dateMoveWaySec ref="dateMoveWayRef"/>
         </li>
         </li>
       </ul>
       </ul>
 
 
@@ -84,7 +88,8 @@ export default {
         const valueObj = JSON.parse(this.info.Value);
         const valueObj = JSON.parse(this.info.Value);
         this.dateSelectForm = {
         this.dateSelectForm = {
           Type: this.info.DataTime ? 2 : 1,
           Type: this.info.DataTime ? 2 : 1,
-          MoveForward: valueObj.MoveForward || 0
+          MoveForward: valueObj.MoveForward || 0,
+          relationDate: this.info.DataTime
         }
         }
 
 
         this.getEdbInfo(this.info.EdbInfoId);
         this.getEdbInfo(this.info.EdbInfoId);
@@ -119,6 +124,29 @@ export default {
       } 
       } 
 
 
       this.edbInfo = edb;
       this.edbInfo = edb;
+    },
+
+    // 切换日期依赖类型,在选择表格中日期的话默认切换到表格日期 在弹窗中手动切换类型不做处理
+    // changeDateType(cell) {
+    //   //根据表格中点选的是否是日期来勾选类型
+    //   this.dateSelectForm.Type=cell.DataType === 1?2:1;
+    //   this.dateSelectForm.relationDate=cell.DataType === 1?'':cell.ShowValue;
+    //   // this.chooseEdb(this.edbInfo);
+    // },
+
+    /* 获取指标信息回显 */
+    async getEdbInfo(EdbInfoId) {
+      const { Data } = await dataBaseInterface.targetDetail({EdbInfoId})
+
+      const { EdbName,LatestDate,Frequency } = Data;
+      this.edbInfo = { EdbName,LatestDate,Frequency,EdbInfoId };
+      this.$refs.selectRef.search_txt = EdbName;
+    },
+
+
+    //插入值的时候再去计算结果
+    async insertData() {
+      if(!this.edbInfo) return this.$message.warning('请先选择指标')
 
 
       let Date='';
       let Date='';
       if(this.dateSelectForm.Type===2) { //选框为表格日期再去取Date
       if(this.dateSelectForm.Type===2) { //选框为表格日期再去取Date
@@ -126,7 +154,7 @@ export default {
       }
       }
 
 
       const res = await sheetInterface.getDateLatelyData({ 
       const res = await sheetInterface.getDateLatelyData({ 
-        EdbInfoId: edb.EdbInfoId,
+        EdbInfoId: this.edbInfo.EdbInfoId,
         MoveForward: this.dateSelectForm.MoveForward,
         MoveForward: this.dateSelectForm.MoveForward,
         DateChange: this.$refs.dateMoveWayRef.dateChangeArr,
         DateChange: this.$refs.dateMoveWayRef.dateChangeArr,
         Date
         Date
@@ -138,9 +166,10 @@ export default {
       let value = (this.result.List&&this.result.List.length)
       let value = (this.result.List&&this.result.List.length)
         ? this.result.List.find(_ => _.DataTime===this.result.Date) ? this.result.List.find(_ => _.DataTime===this.result.Date).Value.toString() : ''
         ? this.result.List.find(_ => _.DataTime===this.result.Date) ? this.result.List.find(_ => _.DataTime===this.result.Date).Value.toString() : ''
         : ''
         : ''
+
       this.chooseItem = {
       this.chooseItem = {
         relationDate: Date,
         relationDate: Date,
-        edbId: edb.EdbInfoId,
+        edbId: this.edbInfo.EdbInfoId,
         value,
         value,
         str: JSON.stringify({
         str: JSON.stringify({
           MoveForward: this.dateSelectForm.MoveForward,
           MoveForward: this.dateSelectForm.MoveForward,
@@ -150,32 +179,6 @@ export default {
 
 
       console.log( this.chooseItem)
       console.log( this.chooseItem)
 
 
-    },
-
-    // 切换日期依赖类型,在选择表格中日期的话默认切换到表格日期 在弹窗中手动切换类型不做处理
-    changeDateType(cell) {
-      //根据表格中点选的是否是日期来勾选类型
-      this.dateSelectForm.Type=cell.DataType === 1?2:1;
-      this.dateSelectForm.relationDate=cell.DataType === 1?'':cell.ShowValue;
-      this.chooseEdb(this.edbInfo);
-    },
-
-    /* 获取指标信息回显 */
-    async getEdbInfo(EdbInfoId) {
-      const { Data } = await dataBaseInterface.targetDetail({EdbInfoId})
-
-      const { EdbName,LatestDate,Frequency } = Data;
-      this.edbInfo = { EdbName,LatestDate,Frequency,EdbInfoId };
-      this.$refs.selectRef.search_txt = EdbName;
-    },
-
-    insertData() {
-      // if(this.$parent.selectCell.DataType !== 1){
-      //   this.$message.warning('请在表格中选择日期')
-      //   return
-      // }
-      // if(!this.chooseItem.value) return this.$message.warning('该日期无数据')
-
       this.$emit('insert',this.chooseItem)
       this.$emit('insert',this.chooseItem)
       this.cancelHandle();
       this.cancelHandle();
     },
     },
@@ -186,7 +189,7 @@ export default {
       this.edbInfo=null;
       this.edbInfo=null;
       this.chooseItem = { edbId: 0,value: '',date: '' }
       this.chooseItem = { edbId: 0,value: '',date: '' }
       this.dateSelectForm = {Type:1,MoveForward: 0}
       this.dateSelectForm = {Type:1,MoveForward: 0}
-      this.$refs.dateMoveWayRef.initData();
+      this.$refs.dateMoveWayRef&&this.$refs.dateMoveWayRef.initData();
     },
     },
 
 
     cancelHandle() {
     cancelHandle() {

+ 25 - 13
src/views/datasheet_manage/components/toolBarSection.vue

@@ -13,7 +13,13 @@
         </template>
         </template>
 
 
         <template v-if="tool.type==='select'">
         <template v-if="tool.type==='select'">
-          <el-select v-model="option.nt" style="width: 90px" size="small" v-if="tool.key==='cell-type-edit'">
+          <el-select 
+            v-model="option.nt" 
+            style="width: 90px" 
+            size="small" 
+            v-if="tool.key==='cell-type-edit'"
+            @change="changeCellType"
+          >
             <el-option
             <el-option
               v-for="item in numberTypeOptions"
               v-for="item in numberTypeOptions"
               :key="item.key"
               :key="item.key"
@@ -28,7 +34,7 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import { transDecimalPlace,isNumberVal,getDecimalPlaces } from '../common/customTable';
+import { transDecimalPlace,isNumberVal,getDecimalPlaces,transNumPercentType,transValueFormat } from '../common/customTable';
 export default {
 export default {
   props: {
   props: {
     cell: {
     cell: {
@@ -43,7 +49,7 @@ export default {
         }
         }
       }else {
       }else {
         this.option = {
         this.option = {
-          nt: "number",//numberType
+          nt: "",//numberType
           pn: 0,//ponitNum
           pn: 0,//ponitNum
         }
         }
       }
       }
@@ -52,7 +58,7 @@ export default {
   data() {
   data() {
     return {
     return {
       option: {
       option: {
-        nt: "number",//numberType
+        nt: "",//numberType  number percent
         pn: 0,//ponitNum
         pn: 0,//ponitNum
       },
       },
 
 
@@ -113,7 +119,6 @@ export default {
       const handlesMap = {
       const handlesMap = {
         'add-point': this.changeCellPoint,
         'add-point': this.changeCellPoint,
         'del-point': this.changeCellPoint,
         'del-point': this.changeCellPoint,
-        'cell-type-edit': this.changeCellType,
       }
       }
 
 
       handlesMap[key]&&handlesMap[key](key)
       handlesMap[key]&&handlesMap[key](key)
@@ -130,20 +135,27 @@ export default {
       }
       }
 
 
       let nval = transDecimalPlace(value,this.option.pn)
       let nval = transDecimalPlace(value,this.option.pn)
-      
-      console.log({
-        ShowStyle: JSON.stringify(this.option),
-        ShowFormulaValue: nval
-      })
+      // console.log(nval)
+
       this.$emit('updateCell',{
       this.$emit('updateCell',{
         ShowStyle: JSON.stringify(this.option),
         ShowStyle: JSON.stringify(this.option),
-        ShowFormulaValue: nval
+        ShowFormatValue: nval
       })
       })
     },
     },
 
 
-    /* 处理显示格式 */
+    /* 处理百分位或数字格式 */
     changeCellType() {
     changeCellType() {
-      
+      if(!isNumberVal(this.cell.ShowValue)) return
+
+      let value = _.cloneDeep(this.cell.ShowValue)
+
+      let nval = transNumPercentType(value,this.option.nt)
+      console.log(nval)
+
+      this.$emit('updateCell',{
+        ShowStyle: JSON.stringify(this.option),
+        ShowFormatValue: nval
+      })
     }
     }
   },
   },
 };
 };