瀏覽代碼

在线文档

fan 2 年之前
父節點
當前提交
5d5b3b3f22
共有 2 個文件被更改,包括 25 次插入9 次删除
  1. 14 3
      public/static/views/onlineShareExcel.html
  2. 11 6
      src/pages/main/onlineExcel/index.vue

+ 14 - 3
public/static/views/onlineShareExcel.html

@@ -172,7 +172,7 @@
         }
 
         // 表格初始化
-        function initExcel(data) {
+        function initExcel(data,name) {
             if (type == '1') {
                 flag = false
             } else {
@@ -181,6 +181,10 @@
             if (isAdmin) {
                 adminFlag = true;
             }
+            var fileName = excelInfo.fileName;
+            if ($.trim(name)!=''){
+                fileName = name;
+            }
             try {
                 luckysheet.create({
                     container: 'luckysheet',
@@ -235,7 +239,7 @@
                     showinfobar: true, // 顶部信息 文件名称 按钮
                     allowUpdate: false, // 是否允许操作表格后的后台更新 在线文档websocket时为true
                     allowEdit: flag, // 是否允许前台编辑
-                    title: excelInfo.fileName, // 文件名称
+                    title: fileName, // 文件名称
                     lang: 'zh',
                     enableAddRow: adminFlag,
                     showstatisticBar: false, // 底部计数
@@ -308,6 +312,13 @@
                 $("#shareBtn").hide();
                 $("#saves").show();
             }
+            if (excelInfo.shareStatus == '1') {
+                $("#editTo").attr('disabled', true);
+                $("#editFrom").attr('disabled', true);
+            } else {
+                $("#editTo").attr('disabled', false);
+                $("#editFrom").attr('disabled', false);
+            }
             initHandel();
         }
 
@@ -494,7 +505,7 @@
                         // 重新加载
                         var a = exportJson.sheets[0];
                         a.name = '';
-                        initExcel([a])
+                        initExcel([a], name.replace('.xlsx', ''));
                         // 绑定按钮事件
                         initHandel()
                     }

+ 11 - 6
src/pages/main/onlineExcel/index.vue

@@ -14,11 +14,11 @@
                         <el-button slot="append" @click="searchMenu" icon="el-icon-search"></el-button>
                     </el-input>
                 </div>
-                <div v-loading="loading" style="height: calc(100% - 100px);overflow-y: scroll;">
+                <div v-loading="loading" style="height: calc(100% - 100px);overflow-y: scroll;overflow-x: scroll">
                     <el-tree ref="tree" class="tree-line" :expand-on-click-node="false" :auto-expand-parent="true"
                              :default-expand-all="true" :default-checked-keys="checkedMenu" :data="menuList"
                              @check="checkChange"
-                             @node-click="nodeClick" :filter-node-method="filterNode" node-key="functionCode">
+                             @node-click="nodeClick" :filter-node-method="filterNode" node-key="functionCode" style="width: 300px">
                         <span class="custom-tree-node" slot-scope="{ node }">
                             <span>
                                 <span v-if="node.data.type == 4"
@@ -73,8 +73,8 @@
                         </el-table-column>
                         <el-table-column prop="shareEditStatus" label="权限状态">
                             <template slot-scope="scope">
-                                <span v-if="scope.row.shareEditStatus == 0">开</span>
-                                <span v-if="scope.row.shareEditStatus == 1">关</span>
+                                <span v-if="scope.row.editStatus == 0">开</span>
+                                <span v-if="scope.row.editStatus == 1">关</span>
                             </template>
                         </el-table-column>
                         <el-table-column label="操作" width="180px" align="center" fixed="right">
@@ -329,15 +329,18 @@ export default {
         //提交分享
         processExcelShare(shareType) {
             var deptList = [];
+            var _this = this;
             if (shareType == 3) {
                 this.treeList.map((o) => {
                     deptList.push(o.receiveNo);
                 });
             }
+            if (shareType == 1) {
+                _this.shareType = 1;
+            }
             console.log(deptList);
             console.log('oa:' + this.oaType);
             console.log('share:' + shareType);
-            var _this = this;
             //提交
             this.$http({
                 url: '/market/cOnlineExcel/saveExcelShare',
@@ -397,6 +400,7 @@ export default {
         //从excel页面调用来关闭excel
         closeExcel() {
             this.showExcel = false;
+            this.getList({}, this.pageSize);
         },
         //打开excel
         moveToEdit(row) {
@@ -584,6 +588,7 @@ export default {
         // 点击树节点事件
         nodeClick(a, b, c, d) {
             console.log(a);
+            this.showExcel = false;
             this.nowFolder = a;
             this.tooltit = '在线文档-' + a.functionName;
             this.getList({}, 1);
@@ -725,7 +730,7 @@ export default {
         }
 
         .inner-right {
-            width: 100%;
+            width: 80%;
             margin-left: 1%;
         }
     }