Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
001faf1f79
|
@ -217,3 +217,35 @@ export function uploadIVUSTemplate(param) {
|
|||
})
|
||||
}
|
||||
|
||||
export function getOCTFCTTemplate(param) {
|
||||
return requestDownload({
|
||||
url: '/OCTCalculate/getOCTFCTTemplate',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
export function uploadOCTFCTTemplate(param) {
|
||||
return request({
|
||||
url: `/OCTCalculate/uploadOCTFCTTemplate`,
|
||||
method: 'post',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
export function getOCTLipidAngleTemplate(param) {
|
||||
return requestDownload({
|
||||
url: '/OCTCalculate/getOCTLipidAngleTemplate',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
export function uploadOCTLipidAngleTemplate(param) {
|
||||
return request({
|
||||
url: `/OCTCalculate/uploadOCTLipidAngleTemplate`,
|
||||
method: 'post',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
|
|
@ -497,6 +497,25 @@
|
|||
<h2 v-else style="color:#ddd">
|
||||
Developing...
|
||||
</h2>
|
||||
<!-- iseCRFShowInDicomReading && currentReadingTaskState < 2 -->
|
||||
<div v-if="false">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="skipTask"
|
||||
>
|
||||
<!-- 跳过 -->
|
||||
{{ $t('trials:readingReport:button:skip') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="submit"
|
||||
>
|
||||
<!-- 提交 -->
|
||||
{{ $t('common:button:submit') }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -809,6 +828,10 @@ export default {
|
|||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
iseCRFShowInDicomReading: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
questionFormChangeState: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
|
@ -2190,6 +2213,8 @@ export default {
|
|||
this.isFullscreen = false
|
||||
this.manualsDialog.visible = true
|
||||
},
|
||||
skipTask(){},
|
||||
submit(){},
|
||||
handleFusion() {
|
||||
// https 或者 本地开发环境才是安全上下文
|
||||
// if (!window.isSecureContext) {
|
||||
|
@ -2522,6 +2547,7 @@ export default {
|
|||
width: 350px;
|
||||
height: 100%;
|
||||
border: 1px solid #727272;
|
||||
position: relative;
|
||||
// overflow-y: auto;
|
||||
}
|
||||
.viewer-container{
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<div class="add-icon" @click.prevent="downloadTpl">
|
||||
<i class="el-icon-download" />
|
||||
</div>
|
||||
<div class="add-icon" style="margin: 0 5px;" @click.prevent="uploadTpl">
|
||||
<div class="add-icon" style="margin: 0 5px;" @click.prevent="uploadTpl(item.LesionType)">
|
||||
<i class="el-icon-upload2" />
|
||||
</div>
|
||||
<div class="add-icon" @click.prevent="handleAddOrEdit('add',item)">
|
||||
|
@ -62,17 +62,16 @@
|
|||
v-if="item.Type === 'basicTable' && item.TableQuestions"
|
||||
:ref="item.Id"
|
||||
:data="item.TableQuestions.Answers"
|
||||
max-height="600"
|
||||
>
|
||||
<!-- <el-table-column :label="$t('CustomizeQuestionFormItem:label:OrderMark')" width="60px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ getLesionName(item.OrderMark,scope.row.RowIndex) }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
type="index"
|
||||
width="40px"
|
||||
/>
|
||||
/> -->
|
||||
<el-table-column
|
||||
v-for="q of item.TableQuestions.Questions"
|
||||
:key="q.Id"
|
||||
|
@ -80,11 +79,23 @@
|
|||
:label="q.QuestionName"
|
||||
show-overflow-tooltip
|
||||
:render-header="renderHeader"
|
||||
/>
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="q.Unit > 0">
|
||||
{{ `${scope.row[q.Id]}${$fd('ValueUnit', parseInt(q.Unit))}` }}
|
||||
</span>
|
||||
<span v-else-if="q.DictionaryCode">
|
||||
{{ `${$fd(q.DictionaryCode, parseInt(scope.row[q.Id]))}` }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{`${scope.row[q.Id]}`}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="readingTaskState < 2 && item.LesionType === 102"
|
||||
:label="$t('common:action:action')"
|
||||
width="100px"
|
||||
width="90px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
|
@ -162,6 +173,7 @@
|
|||
:is-qulity-issues="false"
|
||||
:group-classify="5"
|
||||
/>
|
||||
<!-- 新增、编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-if="addOrEdit.visible"
|
||||
:visible.sync="addOrEdit.visible"
|
||||
|
@ -269,7 +281,7 @@ export default {
|
|||
formChanged: false,
|
||||
digitPlaces: 2,
|
||||
addOrEdit: { visible: false, title: '' },
|
||||
upload: { visible: false, title: '导入' },
|
||||
upload: { visible: false, title: '' },
|
||||
qsList: [],
|
||||
answersList: [],
|
||||
qsForm: {},
|
||||
|
@ -302,8 +314,7 @@ export default {
|
|||
mounted() {
|
||||
// this.subjectCode = this.$router.currentRoute.query.subjectCode
|
||||
this.subjectCode = localStorage.getItem('subjectCode')
|
||||
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
||||
this.digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
window.addEventListener('message', this.receiveMsg)
|
||||
this.CriterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
DicomEvent.$on('setCollapseActive', measureData => {
|
||||
|
@ -493,12 +504,16 @@ export default {
|
|||
} else if (valueType === 3) {
|
||||
this.$set(this.questionForm, qId, parseFloat(value))
|
||||
} else {
|
||||
this.$set(this.questionForm, qId, parseFloat(value).toFixed(this.digitPlaces))
|
||||
this.$set(this.questionForm, qId, this.numberToFixed(value))
|
||||
}
|
||||
}
|
||||
},
|
||||
numberToFixed(v, unit) {
|
||||
return isNaN(parseFloat(v)) ? null : `${parseFloat(v).toFixed(this.digitPlaces)}${unit}`
|
||||
numberToFixed(v) {
|
||||
if (this.digitPlaces > -1) {
|
||||
return isNaN(parseFloat(v)) ? null : `${parseFloat(v).toFixed(this.digitPlaces)}`
|
||||
} else {
|
||||
return v
|
||||
}
|
||||
},
|
||||
async handleSave(index) {
|
||||
const refName = `questions${index}`
|
||||
|
@ -581,7 +596,7 @@ export default {
|
|||
this.$set(this.qsForm, this.diffId, null)
|
||||
} else {
|
||||
const diff = parseFloat(eem) - parseFloat(lumen)
|
||||
this.$set(this.qsForm, this.diffId, diff.toFixed(this.digitPlaces))
|
||||
this.$set(this.qsForm, this.diffId, this.numberToFixed(diff))
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -642,11 +657,15 @@ export default {
|
|||
}
|
||||
const res = await submitTableQuestion(params)
|
||||
if (res.IsSuccess) {
|
||||
// 保存成功!
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
this.addOrEdit.visible = false
|
||||
this.refreshQuestions()
|
||||
// this.refreshQuestions()
|
||||
await this.getReadingQuestionAndAnswer(this.visitTaskId)
|
||||
this.$refs['ecrf'].getQuestions(this.visitTaskId, true)
|
||||
this.$refs['ecrf2'].getQuestions(this.visitTaskId, true)
|
||||
this.$refs['ecrf3'].getQuestions(this.visitTaskId, true)
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
// 保存成功!
|
||||
this.addOrEdit.visible = false
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
}
|
||||
loading.close()
|
||||
} catch (e) {
|
||||
|
@ -685,7 +704,8 @@ export default {
|
|||
console.log(e)
|
||||
}
|
||||
},
|
||||
uploadTpl() {
|
||||
uploadTpl(lesionType) {
|
||||
this.upload.title = `导入( ${this.$fd('LesionType', lesionType)} )`
|
||||
this.upload.visible = true
|
||||
},
|
||||
async downloadTpl() {
|
||||
|
@ -707,7 +727,7 @@ export default {
|
|||
const span = document.createElement('span')
|
||||
span.innerText = column.label
|
||||
document.body.appendChild(span)
|
||||
column.minWidth = span.getBoundingClientRect().width + 15
|
||||
column.minWidth = span.getBoundingClientRect().width + 20
|
||||
document.body.removeChild(span)
|
||||
return h('span', column.label)
|
||||
}
|
||||
|
@ -852,6 +872,9 @@ export default {
|
|||
/deep/.el-table__fixed-body-wrapper tr:hover > td {
|
||||
background-color: #000 !important;
|
||||
}
|
||||
/deep/.el-table--scrollable-x .el-table__body-wrapper {
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -211,8 +211,7 @@ export default {
|
|||
...mapGetters(['language'])
|
||||
},
|
||||
mounted() {
|
||||
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : parseInt(digitPlaces)
|
||||
this.digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
},
|
||||
methods: {
|
||||
formItemChange(v, question) {
|
||||
|
@ -242,11 +241,18 @@ export default {
|
|||
} else if (valueType === 3) {
|
||||
value = parseFloat(value)
|
||||
} else {
|
||||
value = parseFloat(value).toFixed(this.digitPlaces)
|
||||
value = this.numberToFixed(value)
|
||||
}
|
||||
}
|
||||
return value
|
||||
},
|
||||
numberToFixed(v) {
|
||||
if (this.digitPlaces > -1) {
|
||||
return isNaN(parseFloat(v)) ? null : `${parseFloat(v).toFixed(this.digitPlaces)}`
|
||||
} else {
|
||||
return v
|
||||
}
|
||||
},
|
||||
resetFormItemData(v) {
|
||||
this.$emit('resetFormItemData', v)
|
||||
},
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
<div v-for="item in qs.Childrens" :key="item.Id">
|
||||
<div v-if="item.Type === 'basicTable'" class="flex-row" style="margin:3px 0;">
|
||||
<div class="title">{{ item.QuestionName }}</div>
|
||||
<div v-if="item.LesionType === 112 && readingTaskState < 2">
|
||||
<div class="add-icon">
|
||||
<div v-if="(item.LesionType === 112 || item.LesionType === 111) && readingTaskState < 2">
|
||||
<div class="add-icon" @click.prevent="downloadTpl(item.LesionType)">
|
||||
<i class="el-icon-download" />
|
||||
</div>
|
||||
<div class="add-icon" style="margin: 0 5px;">
|
||||
<div class="add-icon" style="margin: 0 5px;" @click.prevent="uploadTpl(item.LesionType)">
|
||||
<i class="el-icon-upload2" />
|
||||
</div>
|
||||
<div class="add-icon" @click.prevent="handleAddOrEdit('add',item)">
|
||||
|
@ -69,10 +69,10 @@
|
|||
{{ getLesionName(item.OrderMark,scope.row.RowIndex) }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
type="index"
|
||||
width="40px"
|
||||
/>
|
||||
/> -->
|
||||
<el-table-column
|
||||
v-for="q of item.TableQuestions.Questions"
|
||||
:key="q.Id"
|
||||
|
@ -80,18 +80,30 @@
|
|||
:label="q.QuestionName"
|
||||
show-overflow-tooltip
|
||||
:render-header="renderHeader"
|
||||
/>
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="q.Unit > 0">
|
||||
{{ `${scope.row[q.Id]}${$fd('ValueUnit', parseInt(q.Unit))}` }}
|
||||
</span>
|
||||
<span v-else-if="q.DictionaryCode">
|
||||
{{ `${$fd(q.DictionaryCode, parseInt(scope.row[q.Id]))}` }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ `${scope.row[q.Id]}` }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="readingTaskState < 2 && (item.LesionType === 112 || item.LesionType === 101)"
|
||||
v-if="readingTaskState < 2"
|
||||
:label="$t('common:action:action')"
|
||||
width="100px"
|
||||
width="90px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="handleAddOrEdit('edit',item, scope.$index)">
|
||||
{{ $t('common:button:edit') }}
|
||||
</el-button>
|
||||
<el-button v-if="item.LesionType === 112" type="text" size="mini" @click="handleDelete(item, scope.$index)">
|
||||
<el-button v-if="item.LesionType === 112 || item.LesionType === 111" type="text" size="mini" @click="handleDelete(item, scope.$index)">
|
||||
{{ $t('common:button:delete') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
@ -198,22 +210,38 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<!-- 导入 -->
|
||||
<el-dialog
|
||||
v-if="upload.visible"
|
||||
:visible.sync="upload.visible"
|
||||
:close-on-click-modal="false"
|
||||
:title="upload.title"
|
||||
width="500px"
|
||||
>
|
||||
<UploadExcel
|
||||
:visit-task-id="visitTaskId"
|
||||
:lesion-type="upload.lesionType"
|
||||
@close="uploadDlgClose"
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { saveTaskQuestion, submitTableQuestion, deleteReadingRowAnswer } from '@/api/trials'
|
||||
import { resetReadingTask } from '@/api/reading'
|
||||
import { resetReadingTask, getOCTFCTTemplate, getOCTLipidAngleTemplate } from '@/api/reading'
|
||||
import DicomEvent from './../DicomEvent'
|
||||
import store from '@/store'
|
||||
import { mapGetters } from 'vuex'
|
||||
import Questions from './../Questions'
|
||||
import QuestionTableFormItem from './QuestionTableFormItem'
|
||||
import UploadExcel from './UploadExcel'
|
||||
export default {
|
||||
name: 'MeasurementList',
|
||||
components: {
|
||||
Questions,
|
||||
QuestionTableFormItem
|
||||
QuestionTableFormItem,
|
||||
UploadExcel
|
||||
},
|
||||
props: {
|
||||
isShow: {
|
||||
|
@ -253,7 +281,8 @@ export default {
|
|||
questionForm: {},
|
||||
formChanged: false,
|
||||
digitPlaces: 2,
|
||||
addOrEdit: { visible: false, title: '' },
|
||||
addOrEdit: { visible: false, title: '', lesionType: null },
|
||||
upload: { visible: false, title: '', lesionType: null },
|
||||
qsList: [],
|
||||
answersList: [],
|
||||
qsForm: {},
|
||||
|
@ -287,8 +316,7 @@ export default {
|
|||
mounted() {
|
||||
// this.subjectCode = this.$router.currentRoute.query.subjectCode
|
||||
this.subjectCode = localStorage.getItem('subjectCode')
|
||||
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
||||
this.digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
window.addEventListener('message', this.receiveMsg)
|
||||
this.CriterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
DicomEvent.$on('setCollapseActive', measureData => {
|
||||
|
@ -476,11 +504,15 @@ export default {
|
|||
} else if (valueType === 3) {
|
||||
this.$set(this.questionForm, qId, parseFloat(value))
|
||||
} else {
|
||||
this.$set(this.questionForm, qId, parseFloat(value).toFixed(this.digitPlaces))
|
||||
this.$set(this.questionForm, qId, this.numberToFixed(value))
|
||||
}
|
||||
},
|
||||
numberToFixed(v, unit) {
|
||||
return isNaN(parseFloat(v)) ? null : `${parseFloat(v).toFixed(this.digitPlaces)}${unit}`
|
||||
numberToFixed(v) {
|
||||
if (this.digitPlaces > -1) {
|
||||
return isNaN(parseFloat(v)) ? null : `${parseFloat(v).toFixed(this.digitPlaces)}`
|
||||
} else {
|
||||
return v
|
||||
}
|
||||
},
|
||||
async handleSave(index) {
|
||||
const refName = `questions${index}`
|
||||
|
@ -564,7 +596,7 @@ export default {
|
|||
this.$set(this.qsForm, this.avgId, null)
|
||||
} else {
|
||||
const avg = (parseFloat(m1) + parseFloat(m2) + parseFloat(m3)) / 3
|
||||
this.$set(this.qsForm, this.avgId, avg.toFixed(this.digitPlaces))
|
||||
this.$set(this.qsForm, this.avgId, this.numberToFixed(avg))
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -602,6 +634,7 @@ export default {
|
|||
this.$set(this.qsForm, i.Id, v)
|
||||
})
|
||||
this.addOrEdit.visible = true
|
||||
this.addOrEdit.lesionType = row.LesionType
|
||||
},
|
||||
async saveFormData() {
|
||||
const valid = await this.$refs.tableQsForm.validate()
|
||||
|
@ -626,13 +659,20 @@ export default {
|
|||
trialId: this.trialId,
|
||||
answerList: answers
|
||||
}
|
||||
if (this.addOrEdit.lesionType === 101) {
|
||||
params.computationTrigger = 9
|
||||
}
|
||||
const res = await submitTableQuestion(params)
|
||||
if (res.IsSuccess) {
|
||||
// 保存成功!
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
this.addOrEdit.visible = false
|
||||
this.refreshQuestions()
|
||||
// this.refreshQuestions()
|
||||
await this.getReadingQuestionAndAnswer(this.visitTaskId)
|
||||
this.$refs['ecrf'].getQuestions(this.visitTaskId, true)
|
||||
this.$refs['ecrf2'].getQuestions(this.visitTaskId, true)
|
||||
this.$refs['ecrf3'].getQuestions(this.visitTaskId, true)
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
// 保存成功!
|
||||
this.addOrEdit.visible = false
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
}
|
||||
loading.close()
|
||||
} catch (e) {
|
||||
|
@ -671,11 +711,35 @@ export default {
|
|||
console.log(e)
|
||||
}
|
||||
},
|
||||
uploadTpl(lesionType) {
|
||||
this.upload.lesionType = lesionType
|
||||
this.upload.title = `导入( ${this.$fd('LesionType', lesionType)} )`
|
||||
this.upload.visible = true
|
||||
},
|
||||
async downloadTpl(lesionType) {
|
||||
try {
|
||||
const params = {
|
||||
visitTaskId: this.visitTaskId
|
||||
}
|
||||
if (lesionType === 112) {
|
||||
await getOCTFCTTemplate(params)
|
||||
} else {
|
||||
await getOCTLipidAngleTemplate(params)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async uploadDlgClose() {
|
||||
await this.getReadingQuestionAndAnswer(this.visitTaskId)
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
this.upload.visible = false
|
||||
},
|
||||
renderHeader(h, { column, $index }) {
|
||||
const span = document.createElement('span')
|
||||
span.innerText = column.label
|
||||
document.body.appendChild(span)
|
||||
column.minWidth = span.getBoundingClientRect().width + 15
|
||||
column.minWidth = span.getBoundingClientRect().width + 30
|
||||
document.body.removeChild(span)
|
||||
return h('span', column.label)
|
||||
}
|
||||
|
@ -820,6 +884,9 @@ export default {
|
|||
/deep/.el-table__fixed-body-wrapper tr:hover > td {
|
||||
background-color: #000 !important;
|
||||
}
|
||||
/deep/.el-table--scrollable-x .el-table__body-wrapper {
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -211,8 +211,7 @@ export default {
|
|||
...mapGetters(['language'])
|
||||
},
|
||||
mounted() {
|
||||
var digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : parseInt(digitPlaces)
|
||||
this.digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
},
|
||||
methods: {
|
||||
formItemChange(v, question) {
|
||||
|
@ -242,11 +241,18 @@ export default {
|
|||
} else if (valueType === 3) {
|
||||
value = parseFloat(value)
|
||||
} else {
|
||||
value = parseFloat(value).toFixed(this.digitPlaces)
|
||||
value = this.numberToFixed(value)
|
||||
}
|
||||
}
|
||||
return value
|
||||
},
|
||||
numberToFixed(v) {
|
||||
if (this.digitPlaces > -1) {
|
||||
return isNaN(parseFloat(v)) ? null : `${parseFloat(v).toFixed(this.digitPlaces)}`
|
||||
} else {
|
||||
return v
|
||||
}
|
||||
},
|
||||
resetFormItemData(v) {
|
||||
this.$emit('resetFormItemData', v)
|
||||
},
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
<template>
|
||||
<el-form
|
||||
ref="uploadExcel"
|
||||
class="upload-excel-file"
|
||||
>
|
||||
<!-- 文件 -->
|
||||
<el-form-item :label="$t('trials:consistencyCheck:label:file')">
|
||||
<div class="upload-container">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action
|
||||
accept=".xlsx,.xls,.csv"
|
||||
:before-upload="beforeUpload"
|
||||
:http-request="handleUploadFile"
|
||||
:on-preview="handlePreview"
|
||||
:show-file-list="true"
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
>
|
||||
<el-button size="small" type="primary">
|
||||
{{ $t('trials:consistencyCheck:dialogButton:upload') }}
|
||||
</el-button>
|
||||
<span
|
||||
slot="tip"
|
||||
style="margin-left:10px;"
|
||||
class="el-upload__tip"
|
||||
>
|
||||
({{ $t('trials:consistencyCheck:message:excelFileOnly') }})
|
||||
</span>
|
||||
</el-upload>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { uploadOCTFCTTemplate, uploadOCTLipidAngleTemplate } from '@/api/reading'
|
||||
export default {
|
||||
props: {
|
||||
visitTaskId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
lesionType: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeUpload(file) {
|
||||
// 检测文件类型是否符合要求
|
||||
if (this.checkFileSuffix(file.name)) {
|
||||
return true
|
||||
} else {
|
||||
// Must be xls or xlsx format
|
||||
this.$alert(this.$t('trials:consistencyCheck:message:xlsx'))
|
||||
|
||||
return false
|
||||
}
|
||||
},
|
||||
async handleUploadFile(param) {
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
try {
|
||||
var data = new FormData()
|
||||
data.append('file', param.file)
|
||||
data.append('visitTaskId', this.visitTaskId)
|
||||
if (this.lesionType === 112) {
|
||||
await uploadOCTFCTTemplate(data)
|
||||
} else {
|
||||
await uploadOCTLipidAngleTemplate(data)
|
||||
}
|
||||
this.$emit('close')
|
||||
this.$message.success('导入成功!')
|
||||
loading.close()
|
||||
} catch (e) {
|
||||
loading.close()
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
handlePreview(file) {
|
||||
if (file.fullPath) {
|
||||
window.open(file.fullPath, '_blank')
|
||||
}
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
// Upload is currently limited to 1 file
|
||||
this.$message.warning(this.$t('trials:consistencyCheck:message:onlyOneFile'))
|
||||
},
|
||||
checkFileSuffix(fileName) {
|
||||
var typeArr = ['xls', 'xlsx', 'csv']
|
||||
var extendName = fileName.substring(fileName.lastIndexOf('.') + 1).toLocaleLowerCase()
|
||||
if (typeArr.indexOf(extendName) !== -1) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.upload-excel-file{
|
||||
.upload-container .el-upload--text {
|
||||
border: none;
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
}
|
||||
.upload-container .el-input--small {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.upload-container .el-icon-circle-check {
|
||||
color: #428bca;
|
||||
font-size: 13px;
|
||||
}
|
||||
.account_item_clear{
|
||||
.el-tag__close{
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -57,6 +57,7 @@
|
|||
:is-reading-show-subject-info="isReadingShowSubjectInfo"
|
||||
:is-reading-task-view-in-order="isReadingTaskViewInOrder"
|
||||
:is-exists-manual="isExistsManual"
|
||||
:iseCRFShowInDicomReading="iseCRFShowInDicomReading"
|
||||
@previewCD="previewCD"
|
||||
/>
|
||||
</div>
|
||||
|
@ -136,6 +137,10 @@ export default {
|
|||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
iseCRFShowInDicomReading: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
questionFormChangeState: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
:is-exists-clinical-data="isExistsClinicalData"
|
||||
:is-exists-no-dicom-file="isExistsNoDicomFile"
|
||||
:is-exists-manual="isExistsManual"
|
||||
:iseCRFShowInDicomReading="IseCRFShowInDicomReading"
|
||||
@previewCD="previewCD"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
|
Loading…
Reference in New Issue