Переглянути джерело

Merge branch 'develop' of http://120.55.44.4:10080/xujunjie/BomWeb into develop

xjj 2 роки тому
батько
коміт
f10d6fcbb2

+ 6 - 3
config/router.config.js

@@ -9,13 +9,12 @@ export default [
       },
       {
         path: '/bom',
-        redirect: '/home'
+        redirect: '/home',
       },
       {
         path: '/home',
         component: './Index',
         routes: [
-         
           {
             path: '/home',
             component: './List/List',
@@ -42,7 +41,11 @@ export default [
           },
         ],
       },
-   
+      {
+        path: '/mobile/detail/:projectId/:templateId/:versionId',
+        component: './Detail/Mobile',
+      },
+
       // {
       //   path: '/dd-login/:dingUserId',
       //   component: './DDLogin/index',

+ 13 - 7
src/pages/Detail/Index.less

@@ -5,6 +5,7 @@
   font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
   vertical-align: middle;
 }
+.mobileSheetBox,
 .sheetBox {
   display: flex;
   .sheetItem {
@@ -22,6 +23,11 @@
     border: none;
   }
 }
+.mobileSheetBox {
+  iframe {
+    height: 100vh;
+  }
+}
 .top {
   display: flex;
   justify-content: space-between;
@@ -47,14 +53,14 @@
 .historyList {
   padding: 0 10px;
 }
-.curTitle  {
+.curTitle {
   margin-left: 20px;
- span {
-  color: #1890FF;
-  margin-right: 10px;
- }
+  span {
+    color: #1890ff;
+    margin-right: 10px;
+  }
 }
-.topF{
+.topF {
   margin: 20px;
 }
 .content {
@@ -62,4 +68,4 @@
   flex-direction: column;
   // justify-content: center;
   // align-items: center;
-}
+}

+ 38 - 0
src/pages/Detail/LuckySheet.js

@@ -159,21 +159,59 @@ class LuckySheet extends React.Component {
         // },
       };
       console.log(version);
+
+      const unableEdit = option => {
+        option.showtoolbar = false;
+        option.enableAddRow = false;
+        option.sheetFormulaBar = false;
+        option.enableAddBackTop = false;
+        option.showsheetbarConfig = {
+          add: false,
+          sheet: false,
+        };
+        option.cellRightClickConfig = {
+          copy: false, // 复制
+          copyAs: false, // 复制为
+          paste: false, // 粘贴
+          insertRow: false, // 插入行
+          insertColumn: false, // 插入列
+          deleteRow: false, // 删除选中行
+          deleteColumn: false, // 删除选中列
+          deleteCell: false, // 删除单元格
+          hideRow: false, // 隐藏选中行和显示选中行
+          hideColumn: false, // 隐藏选中列和显示选中列
+          rowHeight: false, // 行高
+          columnWidth: false, // 列宽
+          clear: false, // 清除内容
+          matrix: false, // 矩阵操作选区
+          sort: false, // 排序选区
+          filter: false, // 筛选选区
+          chart: false, // 图表生成
+          image: false, // 插入图片
+          link: false, // 插入链接
+          data: false, // 数据验证
+          cellFormat: false, // 设置单元格格式
+        };
+      };
+
       if (version.flow_id) {
         option.authority = {
           sheet: true,
           hintText: '当前处于审批节点,禁止编辑!',
         };
+        unableEdit(option);
       } else if (version.last_version) {
         option.authority = {
           sheet: true,
           hintText: '该清单已设置为最终版本,禁止编辑!',
         };
+        unableEdit(option);
       } else if (version.audit_status != 0 || version.status == 1) {
         option.authority = {
           sheet: true,
           hintText: '当前清单不可编辑!',
         };
+        unableEdit(option);
       }
     } else if (data && data.length > 0) {
       option.data = JSON.parse(JSON.stringify(data));

+ 21 - 0
src/pages/Detail/Mobile.js

@@ -0,0 +1,21 @@
+import React from 'react';
+import styles from './Index.less';
+import LuckySheet from './LuckySheet';
+
+function Mobile(props) {
+  const {
+    match: { params },
+  } = props;
+
+  const projectId = parseInt(params.projectId);
+  const templateId = parseInt(params.templateId);
+  const version = { id: parseInt(params.versionId), flow_id: true };
+
+  return (
+    <div className={styles.mobileSheetBox}>
+      <LuckySheet className={styles.sheet} version={version} templateId={templateId} />
+    </div>
+  );
+}
+
+export default Mobile;