Browse Source

数据表格默认升序 拖动悬浮窗

Karsa 1 year ago
parent
commit
c6675fe3e0
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/views/datasheet_manage/components/CustomTable.vue

+ 10 - 2
src/views/datasheet_manage/components/CustomTable.vue

@@ -303,7 +303,7 @@
 
 
       <!-- 添加 -->
-      <div class="add-fixed" v-if="!disabled">
+      <div class="add-fixed" v-if="!disabled" draggable @dragend="dragEnd">
         <div class="add-wrapper" v-show="!isSlideLeft">
           <div @click="addDateRow"> <i class="el-icon-circle-plus-outline"></i> 添加日期</div>
           <div @click="addTextRow"> <i class="el-icon-circle-plus-outline"></i> 添加文本</div>
@@ -437,7 +437,7 @@ export default {
       formula: '',
       config: {
         type: this.sheetType,
-        order: 1,// 1降序 2升序
+        order: 2,// 1降序 2升序
         EdbKeys: ["EdbName", "Unit"],
         data: [],
         textRowData: [],
@@ -750,6 +750,12 @@ export default {
     reset() {
       this.config.data = [];
       this.config.textRowData = [];
+    },
+
+    dragEnd(e) {
+      let dom = document.querySelector('.add-fixed');
+      dom.style.top = e.clientY-105 + 'px';
+      dom.style.bottom = 0;
     }
   },
 };
@@ -874,9 +880,11 @@ export default {
   }
 
   .add-fixed {
+    cursor: move;
     position: absolute;
     bottom: 20%;
     left: 0;
+    z-index: 99;
     .add-wrapper {
       position: relative;
       padding: 5px 50px 5px 20px;