Browse Source

switch branch

Karsa 1 year ago
parent
commit
eb822c8bfd

+ 18 - 0
src/views/datasheet_manage/common/customTable.js

@@ -143,6 +143,24 @@ export function getRightClickMenu(pos,canEdit=false) {
     { label: "插入指标值", key: "insert-value" },
     { label: "导入系统日期", key: "insert-sys-date" },
     { label: "导入指标日期", key: "insert-edb-date" },
+    { label: "指标计算",
+      key: "insert-edb-calculate",
+      children: [
+        { label: '累计值转月值',key: 1,fromEdbKey:5 },
+        { label: '同比值',key: 2,fromEdbKey:6 },
+        { label: '同差值',key: 3,fromEdbKey:7 },
+        { label: 'N数值移动平均计算',key: 4,fromEdbKey:8 },
+        { label: 'N数值环比值',key: 5,fromEdbKey:12 },
+        { label: '升频',key: 6,fromEdbKey:14 },
+        { label: '时间移位',key: 7,fromEdbKey:22 },
+        { label: '超季节性',key: 8,fromEdbKey:35 },
+        { label: '年化',key: 9,fromEdbKey:52 },
+        { label: '降频',key: 10,fromEdbKey:51 },
+        { label: '累计值',key: 11,fromEdbKey:62 },
+        { label: '指数修匀',key: 12,fromEdbKey:'alpha' },
+        { label: '日均值',key: 14,fromEdbKey:75 },
+      ]
+    },
     { label: "清空", key: "reset" },
   ]
 

+ 42 - 2
src/views/datasheet_manage/components/MixedTable.vue

@@ -135,7 +135,25 @@
 
       <!-- 右键菜单 -->
       <div class="contextMenu-wrapper" id="contextMenu-wrapper" @mouseleave="hideContextMenu">
-        <div :class="['item',{'deletesty': menu.key==='reset'}]" v-for="menu in config.contextMenuOption" :key="menu.key" @click="handleContext(menu.key)">{{menu.label}}</div>
+        <div :class="['item',{'deletesty': menu.key==='reset'}]" v-for="menu in config.contextMenuOption" :key="menu.key" @click="handleContext(menu.key)">
+          {{menu.label}}
+          
+          <i class="el-icon-arrow-right" v-if="menu.children"></i>
+
+          <!-- 二级菜单 -->
+          <div class="subMenu-wrapper" v-if="menu.children">
+            <div slot="reference" class="item" v-for="submenu in menu.children" :key="submenu.key" @click="edbCalculateInsertOpen(menu.key,submenu)">
+                <el-popover
+                  width="300"
+                  trigger="hover"
+                  placement="right"
+                >
+                  <div v-html="formulaTip.get(submenu.fromEdbKey)"></div>
+                  <div slot="reference" style="width:100%">{{submenu.label}}</div>   
+                </el-popover>
+            </div>
+          </div>
+        </div>
       </div>
     </template>
 
@@ -179,6 +197,7 @@ import { dataBaseInterface } from '@/api/api.js';
 import md5 from '@/utils/md5.js';
 import selectTargetValueDia from './selectTargetValueDia.vue';
 import insertDateDia from './insertDateDia.vue';
+import { formulaTip } from '@/views/dataEntry_manage/databaseComponents/util';
 export default {
   props: {
     disabled: { //是否只预览
@@ -237,7 +256,8 @@ export default {
       isInsertDateDialog: false,//导入日期弹窗
       insertDateInfo: {
         key: '',
-      }
+      },
+      formulaTip
     };
   },
   mounted() {
@@ -347,6 +367,7 @@ export default {
     // 建立插入单元格和依赖单元格关联关系
     setRelation(data,cellType=4) {
       const { insert_cell } = data;
+
       let relation_obj = {
         type: cellType,
         key: insert_cell.key,
@@ -639,6 +660,7 @@ export default {
         'choose-target': this.selectTargetOpen,//选择指标插入值
         'insert-sys-date': this.insertDateOpen,//导入系统日期
         'insert-edb-date': this.insertDateOpen,//导入指标日期
+        // 'insert-edb-calculate': this.edbCalculateInsertOpen,//指标计算
         'reset': this.clearCell, //清空
         'cell-edit': this.insertDateOpen
       }
@@ -827,6 +849,11 @@ export default {
       this.insertTargetCell.DataTime = insertValue;
     },
 
+    /* 公式计算弹窗 */
+    edbCalculateInsertOpen(key) {
+      console.log(key)
+    },
+
     /* 初始化8行5列 */
     initData(initData=null) {
       if(initData) {
@@ -1043,6 +1070,19 @@ export default {
       &:hover {
         background-color: #f5f7fa;
       }
+      &:hover .subMenu-wrapper {
+        display: block;
+      }
+    }
+
+    .subMenu-wrapper {
+      display: none;
+      padding: 10px 0;
+      box-shadow: 0 1px 4px #999;
+      background: #fff;
+      position: absolute;
+      right: -174px;
+      top: -50%;
     }
   }
 }