Procházet zdrojové kódy

修改在线office

yangbifan před 2 roky
rodič
revize
e73048cfdd
4 změnil soubory, kde provedl 89 přidání a 55 odebrání
  1. 2 2
      config/dev.env.js
  2. 2 2
      public/index.html
  3. 11 3
      src/http/index.js
  4. 74 48
      src/pages/main/onlineOffice/index.vue

+ 2 - 2
config/dev.env.js

@@ -7,9 +7,9 @@ module.exports = merge(prodEnv, {
   ENV_CONFIG: '"dev"',
   ENV_CONFIG: '"dev"',
   ctx:'"http://127.0.0.1:8080"',
   ctx:'"http://127.0.0.1:8080"',
   // ctxForm: '"http://10.149.85.91:8000/api"',//dev
   // ctxForm: '"http://10.149.85.91:8000/api"',//dev
-  // ctxForm: '"http://43.138.50.94:8880/api"',//test
+  ctxForm: '"http://43.138.50.94:8880/api"',//test
   // ctxForm: '"http://192.168.2.92:8880/api"',//test
   // ctxForm: '"http://192.168.2.92:8880/api"',//test
-  ctxForm: '"http://10.230.26.15:8000/api"',//生产
+  // ctxForm: '"http://10.230.26.15:8000/api"',//生产?
 
 
   excludeMeWhenSelectNextHandler:false,
   excludeMeWhenSelectNextHandler:false,
   excludeFormerHanlder:false,
   excludeFormerHanlder:false,

+ 2 - 2
public/index.html

@@ -31,9 +31,9 @@
   <div id="app"></div>
   <div id="app"></div>
   <!-- built files will be auto injected -->
   <!-- built files will be auto injected -->
   <script type="text/javascript">
   <script type="text/javascript">
-    window.staticHost = 'http://10.230.26.15:8000/mkt'; // 正式
+    // window.staticHost = 'http://10.230.26.15:8000/mkt'; // 正式
     // window.staticHost = 'http://10.149.85.91:8000/spfm'; // 测试
     // window.staticHost = 'http://10.149.85.91:8000/spfm'; // 测试
-    // window.staticHost = 'http://192.168.2.92:9600';
+    // window.staticHost = 'http://150.158.79.10:9600';
     // window.staticHost = 'http://43.138.50.94:9600/';
     // window.staticHost = 'http://43.138.50.94:9600/';
 
 
     // document.title = "hello";
     // document.title = "hello";

+ 11 - 3
src/http/index.js

@@ -8,16 +8,24 @@ axios.defaults.transformRequest = [function (data) {
     }
     }
     return data;
     return data;
 }],
 }],
+axios.defaults.baseURL = 'http://43.138.50.94:9600/';
     // 添加请求拦截器
     // 添加请求拦截器
     axios.interceptors.request.use(function (config) {
     axios.interceptors.request.use(function (config) {
+        console.log(config);
+        if(config.type === 'office'){
+            config.baseURL = 'http://150.158.79.10:7779'
+        }else{
+            config.baseURL = 'http://43.138.50.94:9600/'
+        }
         if (config.url.startsWith("http")) {
         if (config.url.startsWith("http")) {
             return config;
             return config;
         }
         }
         let localhost = ''
         let localhost = ''
-        if (process.env.NODE_ENV == "production") {
-            localhost = window.staticHost ? window.staticHost : "/spfm/"
-        }
+        // if (process.env.NODE_ENV == "production") {
+        //     localhost = window.staticHost ? window.staticHost : "/spfm/"
+        // }
         config.url = localhost + config.url
         config.url = localhost + config.url
+        console.log(config.url);
         let url = localhost + config.url
         let url = localhost + config.url
         if (url.indexOf('/sysmgr/sys/login/auth/captcha') == -1 && url.indexOf('/sysmgr/sys/login/auth/token') == -1) {
         if (url.indexOf('/sysmgr/sys/login/auth/captcha') == -1 && url.indexOf('/sysmgr/sys/login/auth/token') == -1) {
             let token = window.sessionStorage.agileauthtoken;
             let token = window.sessionStorage.agileauthtoken;

+ 74 - 48
src/pages/main/onlineOffice/index.vue

@@ -1,17 +1,19 @@
 <template>
 <template>
     <div>
     <div>
-    <el-button>新建</el-button>
-    <fromList :list="firstTable" />
-    </div>
+        <el-button>新建</el-button>
+        <fromList :list="firstTable" @clickDemand="clickDemand" />
+        <div>
+            <!-- <myUpload @uploadBack="uploadBack" :fileInfo="fileInfo" :fileList="fileInfo.fileList">
+        </myUpload> -->
+            <el-dialog :modal="false" title="提示" :visible.sync="officeStatus" style="height:100% ;" width="100%" height="100%" center>
+                <div id="DocEditor" v-if="officeStatus">
+                    <onlyoffice-editor editorId="DocEditor" :src="src" :config="config" @ready="onReady" />
+                </div>
+            </el-dialog>
 
 
-    <!-- <div>
-        <myUpload @uploadBack="uploadBack" :fileInfo="fileInfo" :fileList="fileInfo.fileList">
-        </myUpload>
-        <div id="DocEditor">
-            <onlyoffice-editor editorId="DocEditor" :src="src" :config="config" @ready="onReady" />
-        </div>
 
 
-    </div> -->
+        </div>
+    </div>
 </template>
 </template>
 
 
 <script>
 <script>
@@ -29,44 +31,31 @@ export default {
     },
     },
     data() {
     data() {
         return {
         return {
-            src: 'http://192.168.2.221:7778/web-apps/apps/api/documents/api.js',
-            config: {
-                documentType: 'cell',
-                document: {
-                    fileType: "xlsx",
-                    key: "e07e63993f3aaa920cbed74d8fc15794",
-                    title: "后评估模板.xlsx",
-                    url: "http://192.168.2.124:7779/api/file/download?id=e07e63993f3aaa920cbed74d8fc15794"
-                },
-                editorConfig: {
-                    user: {
-                        id: "78e1e841",
-                        name: "范岩"
-                    },
-                    callbackUrl: "http://192.168.2.124:7779/api/online/callback?type=callback&fileName=安装mysql-udf-http.docx&userIdfanyan&userName=范岩"
-                }
-            },
+            officeStatus: false,
+            src: '',
+            config: {},
             fileInfo: {
             fileInfo: {
                 limit: 10,
                 limit: 10,
                 url: '/aps/api/file/upload',
                 url: '/aps/api/file/upload',
                 fileList: []
                 fileList: []
             },
             },
             firstTable: {
             firstTable: {
+                height: '400',
                 name: "first",
                 name: "first",
                 titledata: [
                 titledata: [
                     {
                     {
                         label: "名称",
                         label: "名称",
-                        prop: "proposerTime",
+                        prop: "fileName",
                         width: 400,
                         width: 400,
                     },
                     },
                     {
                     {
-                        label: "所有者",
-                        prop: "predealman",
+                        label: "文件Id",
+                        prop: "id",
                         width: 400,
                         width: 400,
                     },
                     },
                     {
                     {
-                        label: "最近查看",
-                        prop: "taskName",
+                        label: "未确定字段",
+                        prop: "fileSize",
                         width: 400,
                         width: 400,
                     },
                     },
                 ], //表格头
                 ], //表格头
@@ -77,7 +66,7 @@ export default {
                     pageSize: 10, // 每页数量
                     pageSize: 10, // 每页数量
                     pageNum: 1, // 页码
                     pageNum: 1, // 页码
                 },
                 },
-                isSelection: true, // 表格有多选时设置
+                isSelection: false, // 表格有多选时设置
                 isOperation: false, // 表格有操作列时设置
                 isOperation: false, // 表格有操作列时设置
                 isIndex: false, // 列表序号
                 isIndex: false, // 列表序号
                 operation: {
                 operation: {
@@ -97,37 +86,63 @@ export default {
         }
         }
     },
     },
     mounted() {
     mounted() {
-        this.getList()
+        // this.getListEdit()
         this.getLists()
         this.getLists()
     },
     },
     methods: {
     methods: {
-        getList() {
+        //点击工单状态跳转需求流程显示页面
+        clickDemand(e, res) {
+            if (e == '名称') {
+                this.getListEdit(res)
+            }
+        },
+        getListEdit(e) {
             this.$http({
             this.$http({
-                url: "/aps/api/restfile/edit",
+                url: "/office/restfile/edit",
                 method: "post",
                 method: "post",
+                type:'office',
                 headers: {
                 headers: {
                     "Content-Type": "application/json",
                     "Content-Type": "application/json",
                 },
                 },
                 data: {
                 data: {
-                    id: '647f6c6cff4d05f18d1fbcc89769d5fb',
+                    id: e.id,
                     edit: true,
                     edit: true,
-                    userId: 'fanyan',
-                    userName: '范岩'
+                    userId: JSON.parse(window.sessionStorage.userInfo).loginNo,
+                    userName: JSON.parse(window.sessionStorage.userInfo).loginName
                 },
                 },
             }).then((res) => {
             }).then((res) => {
-                console.log(res);
-                let url = 'http://192.168.2.124:7779/api/online/callback?type=callback&fileName=%E5%AE%89%E8%A3%85mysql-udf-http.docx&userIdfanyan&userName=%E8%8C%83%E5%B2%A9'
-                let urls = decodeURIComponent(url)
-                // console.log(123);
-                console.log(urls);
-                // this.config.document.url = urls;
+                // console.log('[ res ] >', res)
+                let { docType, fileType, id, fileName, downloadUrl, userId, userName, configCallback, api } = res.data.body
+                this.src = api;
+                let config = {
+                    documentType: docType,
+                   height:'100%',
+                    width:'100%',
+                    document: {
+                        fileType: fileType,
+                        key: id,
+                        title: fileName,
+                        url: downloadUrl
+                    },
+                    editorConfig: {
+                        user: {
+                            id: userId,
+                            name: userName
+                        },
+                        callbackUrl: decodeURIComponent(configCallback)
+
+                    }
+                }
+                this.config = config;
+                this.officeStatus = true;
 
 
             });
             });
         },
         },
         getLists() {
         getLists() {
             this.$http({
             this.$http({
-                url: "/aps/api/restfile/list",
+                url: "/office/restfile/list",
                 method: "post",
                 method: "post",
+                type:'office',
                 headers: {
                 headers: {
                     "Content-Type": "application/json",
                     "Content-Type": "application/json",
                 },
                 },
@@ -135,7 +150,7 @@ export default {
 
 
                 },
                 },
             }).then((res) => {
             }).then((res) => {
-                console.log(res);
+                this.firstTable.data = res.data.body;
 
 
             });
             });
         },
         },
@@ -149,4 +164,15 @@ export default {
 };
 };
 </script>
 </script>
 
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+::v-deep .el-dialog--center{
+    height: 100%;
+    margin-top: 10px !important;
+}
+::v-deep .el-dialog__body{
+    height: 100%;
+}
+#DocEditor{
+    height: 100%;
+}
+</style>