Просмотр исходного кода

feat: 报告编辑 代码 保存代码

32197351@qq.com лет назад: 2
Родитель
Сommit
ebcca882e2

+ 1 - 1
itdmWeb/src/views/module-iTDM/baogao/ItdmBaogaoList.vue

@@ -123,7 +123,7 @@ import WordEdit from '@views/module-iTDM/baogao/modules/wordEdit'
 
 export default {
   name: 'ItdmBaogaoList',
-  mixins: [JeecgListMixin, mixinDevice,wordEdit],
+  mixins: [JeecgListMixin, mixinDevice],
   components: {
     WordEdit,
     ItdmBaogaoModal

+ 10 - 1
itdmWeb/src/views/module-iTDM/moban/ItdmMobanList.vue

@@ -91,6 +91,8 @@
           <a @click="handleEdit(record)">编辑</a>
 
           <a-divider type="vertical" />
+          <a @click="wordedit(record)">word编辑</a>
+          <a-divider type="vertical" />
           <a-dropdown>
             <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
             <a-menu slot="overlay">
@@ -110,6 +112,8 @@
     </div>
 
     <itdm-moban-modal ref="modalForm" @ok="modalFormOk"></itdm-moban-modal>
+    <word-edit ref="wordedit" @ok="modalFormOk"></word-edit>
+
   </a-card>
 </template>
 
@@ -121,12 +125,13 @@
   import ItdmMobanModal from './modules/ItdmMobanModal'
   import { filterMultiDictText } from '@comp/dict/JDictSelectUtil'
   import { ajaxGetDictItems } from '@api/api'
+  import wordEdit from './modules/wordEdit'
 
   export default {
     name: 'ItdmMobanList',
     mixins:[JeecgListMixin, mixinDevice],
     components: {
-      ItdmMobanModal
+      ItdmMobanModal,wordEdit
     },
     data () {
       return {
@@ -192,6 +197,10 @@
     },
 
     methods: {
+      wordedit(record){
+        this.$refs.wordedit.edit(record);
+        this.$refs.wordedit.visible=true
+      },
       initDictConfig(){
         ajaxGetDictItems('muban.type').then((res) => {
           if (res.success) {

+ 102 - 0
itdmWeb/src/views/module-iTDM/moban/modules/wordEdit.vue

@@ -0,0 +1,102 @@
+<template>
+
+  <a-modal
+    title="Title"
+    width="80%"
+    :visible="visible"
+    @ok="handleOk"
+  @cancel="handleOk"
+  >
+
+
+  <dev v-show="visible" id="monitorOffice" ></dev>
+
+  </a-modal>
+</template>
+
+<script>
+
+
+  import { getAction } from '@api/manage'
+
+  export default {
+    name: 'wordEdit',
+    created () {
+      //备份model原始值
+      this.config.document.key=""
+      this.config.document.fileType=""
+      this.config.document.url=""
+      this.config.document.title=""
+      this.config.editorConfig.callbackUrl=""
+    },
+    data () {
+      return {
+        docEditor: null,
+        visible: false,
+        queryById: '/moban/itdmMoban/wordById',
+        config: {
+          document: {
+            fileType: "docx",
+            key: "1685240820786",
+            title: "1685240820786.docx",
+            url: "http://192.168.1.14:8080/itdmServer/word/1685240820786.docx",
+            referenceData: {
+              "fileKey": "1685240820786",
+              "instanceId": "http://192.168.1.14:8080/itdmServer/word/1685240820786.docx"
+            },
+          },
+          documentType: "word",
+          width: "100%",
+          height: "600px",
+          editorConfig: {
+            lang:'zh',
+            callbackUrl: "http://192.168.1.14:8080/itdmServer/word/save"
+          }
+        },
+
+      }
+    },
+    methods: {
+      edit (record) {
+        if (this.docEditor) {
+          this.docEditor.destroyEditor()
+        }
+        console.log(record)
+        const select = { id: record.id }
+        getAction(this.queryById, select).then((res) => {
+          if (res.success) {
+
+
+            this.config.document.key=res.result.key
+            this.config.document.fileType=res.result.fileType
+            this.config.document.url=process.env.VUE_APP_API_BASE_URL+"/"+res.result.url
+            this.config.document.title=res.result.title
+            this.config.editorConfig.callbackUrl=process.env.VUE_APP_API_BASE_URL+"/"+"word/save"
+
+            console.log(this.config)
+            this.docEditor = new DocsAPI.DocEditor("monitorOffice", this.config);
+
+
+          } else {
+            this.$message.warning(res.message)
+          }
+        })
+
+      },
+      handleOk(){
+        this.visible=false
+        this.config.document.key=""
+        this.config.document.fileType=""
+        this.config.document.url=""
+        this.config.document.title=""
+        this.config.editorConfig.callbackUrl=""
+        if (this.docEditor) {
+          this.docEditor.destroyEditor()
+        }
+        this.$emit("ok");
+
+      }
+
+    }
+  }
+</script>