阅片关键点系统添加
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-11-14 11:43:12 +08:00
parent c7740493f8
commit cf1af92c2f
5 changed files with 145 additions and 48 deletions

View File

@ -1451,3 +1451,26 @@ export function getCurrentVersionUserAgreements(data) {
data
})
}
// 获取系统阅片关键点文件列表
export function getSystemCriterionKeyFileList(data) {
return request({
url: `/SystemCriterionKeyFile/getSystemCriterionKeyFileList`,
method: 'post',
data
})
}
// 新增/修改系统阅片关键点文件
export function addOrUpdateSystemCriterionKeyFile(data) {
return request({
url: `/SystemCriterionKeyFile/addOrUpdateSystemCriterionKeyFile`,
method: 'post',
data
})
}
// 删除系统阅片关键点文件
export function deleteSystemCriterionKeyFile(systemCriterionKeyFileId) {
return request({
url: `/SystemCriterionKeyFile/deleteSystemCriterionKeyFile/${systemCriterionKeyFileId}`,
method: 'delete'
})
}

View File

@ -4,7 +4,7 @@ import Preview from "./index.vue";
const PreviewConstructor = Vue.extend(Preview);
const preview = options => {
const { path, type, title } = options;
const { path, type, title, isLocal = false } = options;
if (!path) throw `path is requred.but ${path}`
const id = `Preview_${new Date().getTime()}`;
const instance = new PreviewConstructor();
@ -12,7 +12,7 @@ const preview = options => {
instance.vm = instance.$mount();
if (instance.vm.visible) return;
document.body.appendChild(instance.vm.$el);
instance.vm.open(path, type, title);
instance.vm.open(path, type, title, isLocal);
instance.vm.$on("closed", () => {
document.body.removeChild(instance.vm.$el);
instance.vm.$destroy();

View File

@ -1,15 +1,8 @@
<template>
<el-dialog
v-if="visible"
:visible.sync="visible"
:title="title"
:fullscreen="true"
append-to-body
custom-class="base-dialog-wrapper"
@close="handleClose"
>
<el-dialog v-if="visible" :visible.sync="visible" :title="title" :fullscreen="true" append-to-body
custom-class="base-dialog-wrapper" @close="handleClose">
<div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
<PreviewFile v-if="visible" :file-path="path" :file-type="type" />
<PreviewFile v-if="visible" :file-path="path" :file-type="type" :is-local="isLocal" />
</div>
</el-dialog>
</template>
@ -24,13 +17,15 @@ export default {
path: null,
type: null,
title: null,
isLocal: false
};
},
methods: {
open(path, type, title) {
open(path, type, title, isLocal) {
this.path = path;
this.type = type;
this.title = title;
this.isLocal = isLocal;
this.visible = true;
},
handleClose() {

View File

@ -5,16 +5,17 @@
<!-- <embed v-else-if="fileType.indexOf('pdf') !== -1" :src="filePath+'#toolbar=0'" style="width: 100%; height: 100%"> -->
<!-- <iframe v-else-if="fileType.indexOf('pdf') !== -1" :src="filePath+'#toolbar=0'" width="100%" height="100%" frameborder="0" /> -->
<iframe v-else-if="fileType.indexOf('pdf') !== -1"
:src="`/static/pdfjs/web/viewer.html?file=${OSSclientConfig.basePath}${filePath}?userName=${currentUser}&COMPANY=${COMPANY}`"
:src="`/static/pdfjs/web/viewer.html?file=${isLocal ? window.location.origin : OSSclientConfig.basePath}${filePath}?userName=${currentUser}&COMPANY=${COMPANY}`"
width="100%" height="100%" frameborder="0" crossorigin="anonymous" />
<!-- <pdf-->
<!-- v-else-if="fileType.indexOf('pdf') !== -1"-->
<!-- :src="`/static/pdfjs/web/viewer.html?file=${filePath}`">-->
<!-- </pdf>-->
<video :src="`${OSSclientConfig.basePath}${filePath}`" style="width: 100%;height: 99%;" autoplay controls
controlsList="nodownload" v-else-if="fileType.indexOf('mp4') !== -1"></video>
<video :src="`${isLocal ? window.location.origin : OSSclientConfig.basePath}${filePath}`"
style="width: 100%;height: 99%;" autoplay controls controlsList="nodownload"
v-else-if="fileType.indexOf('mp4') !== -1"></video>
<iframe v-else
:src="`/static/onlyOffice/viewer.html?url=${OSSclientConfig.basePath}${filePath}?onlyOffice_url=${onlyOffice_url}&type=${fileType}&title=${title}&documentType=${documentType}&userName=${currentUser}`"
:src="`/static/onlyOffice/viewer.html?url=${isLocal ? window.location.origin : OSSclientConfig.basePath}${filePath}?onlyOffice_url=${onlyOffice_url}&type=${fileType}&title=${title}&documentType=${documentType}&userName=${currentUser}`"
width="100%" height="100%" frameborder="0" crossorigin="anonymous" />
<!-- <div v-else>
{{ $t('common:message:downloadFile') }}
@ -43,12 +44,17 @@ export default {
type: String,
default: ''
},
isLocal: {
type: Boolean,
default: false
}
},
data() {
return {
currentUser: zzSessionStorage.getItem('userName'),
COMPANY: process.env.VUE_APP_COMPANY_NAME,
onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL
onlyOffice_url: process.env.VUE_APP_ONLYOFFICE_URL,
window,
}
},
computed: {

View File

@ -3,6 +3,9 @@
<!-- 搜索框 -->
<template slot="search-container">
<el-form :inline="true" size="mini">
<el-form-item :label="$t('dictionary:template:keyDocList:FileName')">
<el-input clearable v-model="searchData.FileName"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearch">
{{ $t('common:button:search') }}
@ -13,8 +16,8 @@
</el-form-item>
<el-form-item>
<div class="upload">
<input multiple="multiple" webkitdirectory="" directory accept=".pdf" type="file"
name="uploadFolder" class="select-file" title="" @change="beginScanFiles($event)" />
<input directory accept=".pdf" type="file" name="uploadFolder" class="select-file" title=""
@change="beginScanFiles($event)" />
<div class="btn-select">
{{ $t('dictionary:template:basicData:button:selectFile') }}
</div>
@ -24,22 +27,27 @@
</template>
<template slot="main-container">
<el-table ref="keyDocList" v-loading="loading" v-adaptive="{ bottomOffset: 80 }" :data="list" width="100%"
style="width: 100%;min-width: 300px" stripe height="100" @sort-change="handleSortByColumn">
<el-table-column type="index" min-width="90" />
<el-table-column prop="FileName" :label="$t('dictionary:template:keyDocList:FileName')"
show-overflow-tooltip />
<el-table-column prop="CreateTime" :label="$t('dictionary:template:keyDocList:CreateTime')"
show-overflow-tooltip />
<el-table-column :label="$t('common:action:action')" align="left" fixed="right">
<template slot-scope="scope">
<el-button circle icon="el-icon-view" :title="$t('dictionary:template:keyDocList:button:view')"
@click.stop="view(scope.row)" />
<el-button circle icon="el-icon-delete" :title="$t('dictionary:template:keyDocList:button:del')"
@click.stop="del(scope.row)" />
</template>
</el-table-column>
</el-table>
<div class="drag" ref="drag" @dragover="handleDragover" @drop="handleDrop">
<el-table ref="keyDocList" v-loading="loading" v-adaptive="{ bottomOffset: 80 }" :data="list"
width="100%" style="width: 100%;min-width: 300px" stripe height="100"
@sort-change="handleSortByColumn">
<el-table-column type="index" min-width="90" />
<el-table-column prop="FileName" :label="$t('dictionary:template:keyDocList:FileName')"
show-overflow-tooltip />
<el-table-column prop="CreateTime" :label="$t('dictionary:template:keyDocList:CreateTime')"
show-overflow-tooltip />
<el-table-column :label="$t('common:action:action')" align="left" fixed="right">
<template slot-scope="scope">
<el-button circle icon="el-icon-view"
:title="$t('dictionary:template:keyDocList:button:view')"
@click.stop="view(scope.row)" />
<el-button circle icon="el-icon-delete"
:title="$t('dictionary:template:keyDocList:button:del')" @click.stop="del(scope.row)" />
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页组件 -->
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
@pagination="getList" />
@ -51,20 +59,29 @@
import { Upload } from '@/api/dictionary'
import BaseContainer from '@/components/BaseContainer'
import Pagination from '@/components/Pagination'
import { getSystemCriterionKeyFileList, addOrUpdateSystemCriterionKeyFile, deleteSystemCriterionKeyFile } from '@/api/dictionary'
const searchDataDefault = () => {
return {
CriterionId: '',
TargetLesion: null,
NonTargetLesions: null,
NewLesion: null,
OverallEfficacy: null,
FileName: '',
PageIndex: 1,
PageSize: 20
PageSize: 20,
Asc: false,
SortField: ''
}
}
export default {
name: "KeyDocument",
components: { BaseContainer, Pagination },
props: {
criterionId: {
type: String,
required: true
},
isCompleteConfig: {
type: Boolean,
required: true
},
},
data() {
return {
searchData: searchDataDefault(),
@ -122,11 +139,13 @@ export default {
if (!this.checkFileSuffix(file.name)) continue
const formData = new FormData();
formData.append("file", file);
await Upload(formData, 5)
if (i === files.length - 1) {
this.loading = false;
this.getList()
let res = await Upload(formData, 5)
let data = {
FilePath: res.Result.FilePath,
FileName: file.name
}
await this.addKeyDoc(data)
}
} catch (err) {
console.log(err)
@ -136,13 +155,67 @@ export default {
checkFileSuffix(fileName) {
var index = fileName.lastIndexOf('.')
var suffix = fileName.substring(index + 1, fileName.length)
if (['.pdf'].toLocaleLowerCase().search(suffix.toLocaleLowerCase()) === -1) {
if ('.pdf'.toLocaleLowerCase().search(suffix.toLocaleLowerCase()) === -1) {
return false
} else {
return true
}
},
getList() { },
async getList() {
try {
this.searchData.SystemCriterionId = this.criterionId
this.loading = true
let res = await getSystemCriterionKeyFileList(this.searchData)
this.loading = false
if (res.IsSuccess) {
this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount
}
} catch (err) {
this.loading = false
console.log(err)
}
},
async addKeyDoc(row) {
try {
let { FileName, FilePath } = row
let data = {
FileName,
FilePath,
SystemCriterionId: this.criterionId
}
this.loading = true
let res = await addOrUpdateSystemCriterionKeyFile(data)
this.loading = false
if (res.IsSuccess) {
this.getList()
}
} catch (err) {
this.loading = false
console.log(err)
}
},
async del(row) {
try {
this.loading = true
let res = await deleteSystemCriterionKeyFile(row.Id)
this.loading = false
if (res.IsSuccess) {
this.getList()
}
} catch (err) {
console.log(err)
this.loading = false
}
},
view(row) {
this.$preview({
path: row.FilePath,
type: 'pdf',
isLocal: true,
title: row.FileName,
})
},
//
handleSearch() {
this.searchData.PageIndex = 1