cxmo 1 år sedan
förälder
incheckning
090e7c5adb

+ 14 - 0
src/api/modules/toolBoxApi.js

@@ -0,0 +1,14 @@
+import http from "@/api/http.js"
+
+//工具箱
+export const ToolBoxInterface = {
+    /**
+     * 获取联储观察的数据
+     * @param {Object} params 
+     * @param {String} DateTime //时间 yyyy-MM-dd
+     * @returns 
+     */
+    getSheetDetail:(params)=>{
+        return http.get('/meeting_probabilities/detail',params)
+    }
+}

+ 1 - 1
src/routes/modules/chartRoutes.js

@@ -241,7 +241,7 @@ export default [
 			{
 				path:'federalReserveWatch',
 				name:'联储观察',
-				component:()=>import('@/views/toolBox_manage/FederaReserveWatch.vue')
+				component:()=>import('@/views/toolBox_manage/FederalReserveWatch.vue')
 			}
 		]
 	}

+ 94 - 19
src/views/toolBox_manage/FederalReserveWatch.vue

@@ -1,46 +1,121 @@
 <template>
     <!-- 联储观察 -->
     <div class="federal-reserve-wrap">
-        <div class="select-box">
+        <div class="tool-box">
             <el-date-picker
-                v-model="value1"
+                v-model="selectDate"
+                value-format="yyyy-MM-dd"
                 type="date"
-                placeholder="选择日期">
+                placeholder="选择日期" @change="getSheetDetail">
             </el-date-picker>
-        </div>
-        <div class="tool-box">
-            <el-button>下载</el-button>
+            <el-button type="text" @click="downloadSheet">下载</el-button>
         </div>
         <div class="table-box">
-            <!-- <Sheet
-              v-if="sheetDetailInfo.ExcelInfoId"
-              ref="sheetRef"
-              :option="sheetDetailInfo.Content"
-              :sheetInfo="{
-                ExcelInfoId: sheetDetailInfo.ExcelInfoId,
-                ExcelName: sheetDetailInfo.ExcelName,
-                ExcelClassifyId: sheetDetailInfo.ExcelClassifyId,
-              }"
-            /> -->
+            <div class="sheet-wrap">
+                <Sheet
+                    v-if="sheetDetailInfo.MeetingInfoId"
+                    ref="sheetRef"
+                    :option="sheetDetailInfo.Content"
+                    />
+                <div v-else style="text-align: center;">
+                    <tableNoData text="该日期暂无数据"/>
+                </div>
+            </div>
+            
         </div>
     </div>
 </template>
 
 <script>
 import Sheet from '@/views/datasheet_manage/components/SheetExcel.vue';
+import {ToolBoxInterface} from "@/api/modules/toolBoxApi.js";
 export default {
     components:{Sheet},
     data() {
         return {
-            sheetDetailInfo:{}
+            sheetDetailInfo:{},
+            selectDate:''
         };
     },
     methods: {
-        getSheetDetail(){}
+        getSheetDetail(){
+            if(!this.selectDate){
+                this.sheetDetailInfo = {}
+                return
+            }
+            ToolBoxInterface.getSheetDetail({
+                DateTime: this.selectDate||'',
+            }).then(res=>{
+                if(res.Ret!==200) return
+                this.sheetDetailInfo = res.Data||{};
+                this.$nextTick(()=>{
+                    this.initSheet()
+                })
+            })
+        },
+        downloadSheet(){},
+        initSheet(){
+            const baseOption = this.sheetDetailInfo.Content ? JSON.parse(this.sheetDetailInfo.Content) : {}
+            //luckysheet配置,能隐藏的都隐藏了,并且禁止编辑
+            const options = {
+                container:'sheet-container',
+                lang: 'zh',
+                showinfobar: false,
+                showtoolbar:false,
+                showsheetbar:false,
+                showstatisticBar:false,
+                showstatisticBarConfig: {
+                    count: false, // 计数栏
+                    view: false, // 打印视图
+                    zoom: true, // 缩放
+                },
+                allowCopy:false,
+                allowEdit:false,//不允许编辑
+                allowUpdate:false,
+                enableAddRow:false,
+                sheetFormulaBar:false,
+                showConfigWindowResize:true,
+                data: [{
+                    ...baseOption,
+                    luckysheet_select_save:[],
+                    scrollTop: 0,
+                    scrollLeft: 0,
+                }],
+            }
+            luckysheet.create(options)
+            document.querySelector("#luckysheet-cols-h-c").style.pointerEvents = 'none'
+        }
     },
+    mounted(){
+        this.getSheetDetail()
+    }
 };
 </script>
 
 <style scoped lang="scss">
-
+.federal-reserve-wrap{
+    height:calc(100vh - 120px);
+    background-color: #fff;
+    display: flex;
+    flex-direction: column;
+    box-sizing: border-box;
+    padding:30px;
+    .tool-box{
+        display: flex;
+        justify-content: space-between;
+    }
+    .table-box{
+        width:100%;
+        box-sizing: border-box;
+        flex: 1;
+        margin-top: 30px;
+        .sheet-wrap{
+            width:100%;
+            height: 100%;
+            position: relative;
+            /* cursor:not-allowed;
+            pointer-events: none; */
+        }
+    }
+}
 </style>