ZaiZai 1 rok temu
rodzic
commit
5a48d9db7d
3 zmienionych plików z 25 dodań i 11 usunięć
  1. 1 1
      package.json
  2. 20 6
      src/views/transfer/write-report.vue
  3. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -18,7 +18,7 @@
         "dayjs": "^1.11.10",
         "echarts": "^5.4.2",
         "element-plus": "^2.4.1",
-        "hc-vue3-ui": "^2.5.4",
+        "hc-vue3-ui": "^2.5.6",
         "js-base64": "^3.7.5",
         "js-cookie": "^3.0.5",
         "js-fast-way": "^0.3.0",

+ 20 - 6
src/views/transfer/write-report.vue

@@ -16,12 +16,15 @@
                 <el-button v-if="state === 2" hc-btn type="primary" @click="onSubmitReportClick">查看验收意见</el-button>
                 <el-button v-if="state === 2" hc-btn type="primary">撤回提交</el-button>
                 <el-button v-if="state === 1" hc-btn type="primary" @click="submissionClick">确认提交</el-button>
-                <el-button hc-btn type="primary">暂存草稿</el-button>
+                <el-button hc-btn type="primary" @click="officeDraft">暂存草稿</el-button>
                 <el-button hc-btn @click="previousStep">上一步</el-button>
                 <el-button hc-btn @click="toBackClick">返回主页</el-button>
             </template>
-
-            <HcOnlineOffice :key1="dataKey" :src="docxUrl" title="测试的文档.docx" :url="saveUrl" :project-id="projectId" :token="token" :user-info="userInfo" />
+            <HcOnlineOffice
+                ref="officeRef" :key1="dataKey" :src="docxUrl" title="测试的文档.docx"
+                :url="saveUrl" :project-id="projectId" :token="token" :user-info="userInfo"
+                @download="officeDownload"
+            />
         </hc-new-card>
 
         <!-- 短信认证 -->
@@ -74,8 +77,6 @@ onMounted(() => {
     setTimeout(() => {
         geDocxUrl()
     }, 1000)
-   
-
 })
 
 const state = ref(1)
@@ -85,6 +86,19 @@ const dataKey = ref('')
 const datafile = ref({})
 //const docxUrl = ref('https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230317/e2bdc6581e397b810b46ac7cd71b111b.docx')
 
+//暂存草稿
+const officeRef = ref(null)
+const officeDraft = () => {
+    //执行下载命令
+    const xxx = officeRef.value.getDocRef()
+    xxx.downloadAs()
+}
+
+//office文件下载事件
+const officeDownload = (data) => {
+    console.log('文件地址:', data)
+}
+
 //获取文档地址
 const geDocxUrl = async ()=>{
     const { error, code, data } = await initialgApi.getArchiveConclusion({
@@ -95,7 +109,7 @@ const geDocxUrl = async ()=>{
         dataKey.value = data['id'] + '_' + Math.random() + ''
         console.log(dataKey.value, 'dataKey')
         datafile.value = data
-      
+
     } else {
         docxUrl.value = ''
     }

+ 4 - 4
yarn.lock

@@ -1449,10 +1449,10 @@ has@^1.0.3:
   dependencies:
     function-bind "^1.1.1"
 
-hc-vue3-ui@^2.5.4:
-  version "2.5.4"
-  resolved "http://47.110.251.215:9000/hc-vue3-ui/-/hc-vue3-ui-2.5.4.tgz#77d30f5832156dd73894261783ef3ef9612d7ea5"
-  integrity sha512-sd1Mapcc81/eMuhdT8W0P6FOAtc5ShFu72F7Tt9qVMZ0hT8x1tnoaOjES5f2zPDFd88mDdBxWBF/b1TIMEP90g==
+hc-vue3-ui@^2.5.6:
+  version "2.5.6"
+  resolved "http://47.110.251.215:9000/hc-vue3-ui/-/hc-vue3-ui-2.5.6.tgz#5636da1a865c76e6a0b695505aaddc1fbe24e342"
+  integrity sha512-L1NaQ7Q33k1d/JoUTnhvRSYvbYCNfb+yPkCkhB4jYHk7o7Vnm23gpI3thqNkUKFK9z7pa555Dk26PH0ICXpxMg==
   dependencies:
     axios "^1.6.2"
     dayjs "^1.11.10"