阅片关键点系统添加
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 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 PreviewConstructor = Vue.extend(Preview);
const preview = options => { const preview = options => {
const { path, type, title } = options; const { path, type, title, isLocal = false } = options;
if (!path) throw `path is requred.but ${path}` if (!path) throw `path is requred.but ${path}`
const id = `Preview_${new Date().getTime()}`; const id = `Preview_${new Date().getTime()}`;
const instance = new PreviewConstructor(); const instance = new PreviewConstructor();
@ -12,7 +12,7 @@ const preview = options => {
instance.vm = instance.$mount(); instance.vm = instance.$mount();
if (instance.vm.visible) return; if (instance.vm.visible) return;
document.body.appendChild(instance.vm.$el); document.body.appendChild(instance.vm.$el);
instance.vm.open(path, type, title); instance.vm.open(path, type, title, isLocal);
instance.vm.$on("closed", () => { instance.vm.$on("closed", () => {
document.body.removeChild(instance.vm.$el); document.body.removeChild(instance.vm.$el);
instance.vm.$destroy(); instance.vm.$destroy();

View File

@ -1,15 +1,8 @@
<template> <template>
<el-dialog <el-dialog v-if="visible" :visible.sync="visible" :title="title" :fullscreen="true" append-to-body
v-if="visible" custom-class="base-dialog-wrapper" @close="handleClose">
: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"> <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> </div>
</el-dialog> </el-dialog>
</template> </template>
@ -24,13 +17,15 @@ export default {
path: null, path: null,
type: null, type: null,
title: null, title: null,
isLocal: false
}; };
}, },
methods: { methods: {
open(path, type, title) { open(path, type, title, isLocal) {
this.path = path; this.path = path;
this.type = type; this.type = type;
this.title = title; this.title = title;
this.isLocal = isLocal;
this.visible = true; this.visible = true;
}, },
handleClose() { handleClose() {

View File

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

View File

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