晏有为
2024-05-16 781e1ea65273cf10d6e5ed39e435107d67a8c667
src/components/view/b1-report-preparation.vue
@@ -181,15 +181,15 @@
          showSelect: false,
          select: false,
          do: [
            //   {
            //   id: 'handleWeave',
            //   font: '在线编制',
            //   type: 'text',
            //   method: 'handleWeave',
            //   disabFun: (row, index) => {
            //     return row.isExamine != null
            //   }
            // },
              {
              id: 'handleWeave',
              font: '在线编制',
              type: 'text',
              method: 'handleWeave',
              disabFun: (row, index) => {
                return row.isExamine != null
              }
            },
            {
              id: 'download',
              font: '下载',
@@ -243,9 +243,9 @@
            }
          ],
          linkEvent: {
            // code: {
            //   method: 'selectAllByOne'
            // }
            code: {
              method: 'selectAllByOne'
            }
          },
          tagField: {
            isRatify: {
@@ -344,22 +344,22 @@
        this.upIndex++
      },
      async handleWeave(row) {
        // this.value = await file.convertFileToHtml(row.url)
        // this.claimVisible = true;
        this.$axios.post(this.$api.insReport.wordToHtml, {
          path: row.urlS ? row.urlS : row.url
        }).then(res => {
          if (res.code === 200) {
            // console.log(11111111,res.data)
            this.value = res.data
              .replace(/<a [^>]*>/g, "")
              .replace(/<\/a>/g, "")
              .replace(/&nbsp;/g, "&nbsp;&nbsp;");
            this.claimVisible = true;
        const userName = JSON.parse(localStorage.getItem("user")).name;
        //参考vabOnlyOffice组件参数配置
        const { href } = this.$router.resolve({
          path: `/wordEdit`,
          query: {
            url: this.javaApi + "/word/" + row.entrustCode + ".docx",
            isEdit: true,
            fileType: "docx",
            title: row.entrustCode + ".docx",
            lang: 'zh-CN',
            isPrint: true,
            user:  { id: 1, name: userName},
            editUrl: this.javaApi + "/insReport/onlyOffice/save?fileName=" + row.entrustCode + ".docx"
          }
        }).catch(error => {
          console.error(error)
        })
        window.open(href, '_blank');
      },
      // 权限分配
      getPower(radio) {
@@ -407,7 +407,23 @@
        // console.log(this.$refs.Word.getValue())
      },
      async selectAllByOne(row) {
        console.log(row, await file.convertFileToHtml(row.url));
        const userName = JSON.parse(localStorage.getItem("user")).name;
        //参考vabOnlyOffice组件参数配置
        const { href } = this.$router.resolve({
          path: `/wordEdit`,
          query: {
            url: this.javaApi + "/word/" + row.entrustCode + ".docx",
            isEdit: "false",
            fileType: "docx",
            title: row.entrustCode + ".docx",
            lang: 'zh-CN',
            isPrint: true,
            user_id: 1,
            user_name: userName
          }
        })
        window.open(href, '_blank');
        console.log(`output->row`,row)
      },
      download(row) {
        let url = row.urlS ? row.urlS : row.url;