Browse Source

feat:[试验管理][试验方法]导出

master
HanLong 4 days ago
parent
commit
c19bda632f
7 changed files with 93 additions and 11 deletions
  1. +3
    -0
      package.json
  2. +21
    -1
      src/api/business/study/studyMethod.js
  3. +4
    -0
      src/lang/en/business/study/studyMethod.js
  4. +4
    -0
      src/lang/zh/business/study/studyMethod.js
  5. +53
    -7
      src/views/business/study/comp/syff/Xq.vue
  6. +6
    -1
      src/views/business/study/comp/syffList.vue
  7. +2
    -2
      vue.config.js

+ 3
- 0
package.json View File

@ -33,12 +33,15 @@
"file-saver": "2.0.5", "file-saver": "2.0.5",
"fuse.js": "6.4.3", "fuse.js": "6.4.3",
"highlight.js": "9.18.5", "highlight.js": "9.18.5",
"html2canvas": "^1.4.1",
"js-beautify": "1.13.0", "js-beautify": "1.13.0",
"js-cookie": "3.0.1", "js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"jspdf": "^4.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"moment": "^2.30.1", "moment": "^2.30.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"pdf-lib": "^1.17.1",
"quill": "2.0.2", "quill": "2.0.2",
"screenfull": "5.0.2", "screenfull": "5.0.2",
"sortablejs": "1.10.2", "sortablejs": "1.10.2",

+ 21
- 1
src/api/business/study/studyMethod.js View File

@ -26,4 +26,24 @@ export function studyMethod_read(data) {
method: 'post', method: 'post',
data: data data: data
}) })
}
}
// 方法阅读汇总列表
export function studyMethod_readList(query) {
return request({
url: '/system/business/studyMethod/read/list',
method: 'get',
params: query
})
}
// 方法阅读导出
export function studyMethod_export(query) {
return request({
url: '/system/business/studyMethod/test',
method: 'get',
params: query
})
}

+ 4
- 0
src/lang/en/business/study/studyMethod.js View File

@ -13,4 +13,8 @@ export default {
qmhz: '签名汇总', qmhz: '签名汇总',
yidu: '已读', yidu: '已读',
weidu: '未读', weidu: '未读',
qmr: '签名人',
qmsj: '签名时间',
qmyy: '签名意义',
remark: '备注',
} }

+ 4
- 0
src/lang/zh/business/study/studyMethod.js View File

@ -13,4 +13,8 @@ export default {
qmhz: '签名汇总', qmhz: '签名汇总',
yidu: '已读', yidu: '已读',
weidu: '未读', weidu: '未读',
qmr: '签名人',
qmsj: '签名时间',
qmyy: '签名意义',
remark: '备注',
} }

+ 53
- 7
src/views/business/study/comp/syff/Xq.vue View File

@ -10,7 +10,9 @@
</div> </div>
<div class="right-top"> <div class="right-top">
<el-button @click="cancel()">{{ $t('form.cancel') }}</el-button> <el-button @click="cancel()">{{ $t('form.cancel') }}</el-button>
<el-button type="primary" @click="yuedu" v-if="form.zt == 0">{{
<el-button type="primary" @click="handleExport" v-if="showExportBtn">{{
$t('page.business.study.studyMethod.daochu') }}</el-button>
<el-button type="primary" @click="yuedu" v-if="form.zt == 0 && !showExportBtn">{{
$t('page.business.study.studyMethod.yuedu') }}</el-button> $t('page.business.study.studyMethod.yuedu') }}</el-button>
</div> </div>
</div> </div>
@ -29,14 +31,31 @@
class="el-icon-arrow-right el-icon--right"></i></el-button> class="el-icon-arrow-right el-icon--right"></i></el-button>
</el-button-group> </el-button-group>
</div> </div>
<div ref="contentToPdf">
<div class="content-title">
<div class="line"></div>
<div class="subtitle"> {{ $t('page.business.study.studyMethod.qmhz') }}</div>
</div>
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('page.business.study.studyMethod.qmr')" prop="qmrMc" />
<el-table-column :label="$t('page.business.study.studyMethod.qmsj')" prop="createTime" />
<el-table-column :label="$t('page.business.study.studyMethod.qmyy')" prop="qmyy" />
<el-table-column :label="$t('page.business.study.studyMethod.remark')" prop="remark" />
</el-table>
</div>
</div> </div>
</div> </div>
</div> </div>
<Yd ref="Yd" @callback="closeYd"/>
<Yd ref="Yd" @callback="closeYd" />
</div> </div>
</template> </template>
<script> <script>
import { studyMethod_readList, studyMethod_export } from '@/api/business/study/studyMethod'
import html2canvas from 'html2canvas';
import { PDFDocument } from 'pdf-lib'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import pdf from 'vue-pdf' import pdf from 'vue-pdf'
import Yd from './Yd.vue' import Yd from './Yd.vue'
@ -45,12 +64,15 @@ export default {
components: { pdf, Yd }, components: { pdf, Yd },
data() { data() {
return { return {
showExportBtn: false,
pdfSrc: '', pdfSrc: '',
open: false, open: false,
pageNum: 1, pageNum: 1,
loadedRatio: 0, // 0-1 1 loadedRatio: 0, // 0-1 1
totalPages: 0, //pdf totalPages: 0, //pdf
form: {}, form: {},
list: [],
loading: false,
} }
}, },
computed: { computed: {
@ -71,25 +93,42 @@ export default {
}, },
show(row) { show(row) {
this.showExportBtn = false
this.open = true this.open = true
this.form = row this.form = row
this.pdfSrc = process.env.VUE_APP_FILE_DOMAIN + row.fileUrl this.pdfSrc = process.env.VUE_APP_FILE_DOMAIN + row.fileUrl
this.getPageNum() this.getPageNum()
}, },
showExport(row) {
this.loading = true
this.open = true
this.showExportBtn = true
this.form = row
this.pdfSrc = process.env.VUE_APP_FILE_DOMAIN + row.fileUrl
studyMethod_readList({ studyMethodId: row.id }).then(response => {
this.list = response.data
this.loading = false
this.getPageNum()
})
},
// PDF // PDF
getPageNum() { getPageNum() {
let loadingTask = pdf.createLoadingTask(this.fileUrl);
let loadingTask = pdf.createLoadingTask(this.pdfSrc);
loadingTask.promise loadingTask.promise
.then((pdf) => { .then((pdf) => {
this.totalPages = pdf.numPages; this.totalPages = pdf.numPages;
this.$nextTick(() => {
this.setWatermarkContent();
});
this.loadPdfFromUrl()
// this.$nextTick(() => {
// this.setWatermarkContent();
// });
}) })
.catch((err) => { .catch((err) => {
this.$message.warning("pdf加载失败");
this.$message.msgError("pdf加载失败");
}); });
}, },
// //
prePage() { prePage() {
@ -109,7 +148,14 @@ export default {
closeYd(val) { closeYd(val) {
this.form.zt = val this.form.zt = val
},
handleExport() {
studyMethod_export({studyMethodId:6}).then(response => {
})
} }
} }
} }
</script> </script>

+ 6
- 1
src/views/business/study/comp/syffList.vue View File

@ -63,7 +63,7 @@
<el-button type="text" @click="detail(scope.row)">{{ <el-button type="text" @click="detail(scope.row)">{{
$t('page.business.study.studyMethod.yuedu') }}</el-button> $t('page.business.study.studyMethod.yuedu') }}</el-button>
<!-- 导出 --> <!-- 导出 -->
<el-button type="text" >{{
<el-button type="text" @click="showExport(scope.row)">{{
$t('page.business.study.studyMethod.daochu') }}</el-button> $t('page.business.study.studyMethod.daochu') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -174,6 +174,11 @@ export default {
this.$emit('showDetail', this.showDetail) this.$emit('showDetail', this.showDetail)
this.$refs.Xq.show(row) this.$refs.Xq.show(row)
}, },
showExport(row) {
this.showDetail = true
this.$emit('showDetail', this.showDetail)
this.$refs.Xq.showExport(row)
},
xqClose() { xqClose() {
this.showDetail = false this.showDetail = false
this.$emit('showDetail', this.showDetail) this.$emit('showDetail', this.showDetail)

+ 2
- 2
vue.config.js View File

@ -34,8 +34,8 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
//target: `http://localhost:8080`,
target: `http://39.99.251.173:8080`,
target: `http://localhost:8080`,
// target: `http://39.99.251.173:8080`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save