自定义阅片更改
continuous-integration/drone/push Build is passing Details

uat_us
caiyiling 2024-10-25 13:36:46 +08:00
parent 9c156ec1e6
commit 70fcd15ab7
8 changed files with 208 additions and 70 deletions

View File

@ -1091,11 +1091,7 @@ export default {
if (val !== 'select' && val !== 'radio') {
data.IsJudgeQuestion = false
}
if (val === 'table' || val === 'basicTable') {
data.IsRequired = 2
} else {
data.LesionType = null
}
if (val === 'number' || val === 'calculation') {
data.Unit = 0
} else {
@ -1106,6 +1102,8 @@ export default {
} else {
data.MaxAnswerLength = null
}
data.IsRequired = 2
data.LesionType = null
data.QuestionGenre = null
data.DictionaryCode = ''
data.TypeValue = ''

View File

@ -583,7 +583,7 @@ export default {
ParentTriggerValue: '',
ShowOrder: 0,
ShowQuestion: 0,
IsRequired: true,
IsRequired: 2,
Remark: '',
RelevanceId: '',
RelevanceValue: '',
@ -875,7 +875,7 @@ export default {
}
form.TypeValue = ''
form.ValueType = ''
form.IsRequired = 2
form.TableQuestionType = null
form.DependParentId = ''
form.DataTableColumn = ''

View File

@ -120,9 +120,9 @@
<template v-else>
<el-option
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
:key="val.trim()"
:label="val.trim()"
:value="val.trim()"
/>
</template>
@ -135,10 +135,10 @@
>
<el-radio
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
:key="val.trim()"
:label="val.trim()"
>
{{ val }}
{{ val.trim() }}
</el-radio>
</el-radio-group>
<!-- 复选框 -->
@ -149,17 +149,30 @@
<el-checkbox
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
:label="val.trim()"
>
{{ val }}
{{ val.trim() }}
</el-checkbox>
</el-checkbox-group>
<!-- 自动分类 -->
<el-input
v-if="question.Type === 'class'"
v-if="question.Type === 'class' && !question.TypeValue"
v-model="questionForm[question.Id]"
disabled
/>
<el-radio-group
v-if="question.Type === 'class' && question.TypeValue"
v-model="questionForm[question.Id]"
disabled
>
<el-radio
v-for="item of question.TypeValue.split('|')"
:key="item.trim()"
:label="item.trim()"
>
{{ item.trim() }}
</el-radio>
</el-radio-group>
<!-- 自动计算 -->
<!-- :precision="2" :step="0.1" :max="10" -->
<el-input
@ -308,9 +321,8 @@
:type="addOrEdit.type"
:CalculationList="CalculationTabelList"
@formItemTableNumberChange="formItemTableNumberChange"
@setFormItemData="setFormItemData"
@resetFormItemData="resetFormItemData"
@setFormTableItemData="setFormTableItemData"
@resetFormItemData="resetTableFormItemData"
@setFormItemData="setFormTableItemData"
/>
</el-form>
</template>
@ -387,7 +399,8 @@ export default {
RowIndex: 0,
RowId: null,
digitPlaces: 0,
CalculationTabelList: []
CalculationTabelList: [],
classArr: []
}
},
watch: {
@ -395,31 +408,31 @@ export default {
deep: true,
immediate: true,
handler(v, oldv) {
try {
if (!v[this.question.Id] || !oldv[this.question.Id]) return
} catch (e) {
}
this.formItemNumberChange(this.question.Id, false)
// try {
// if (!v[this.question.Id] || !oldv[this.question.Id]) return
// } catch (e) {
// }
// this.formItemNumberChange(this.question.Id, false)
}
},
},
mounted() {
this.digitPlaces = localStorage.getItem('digitPlaces') ? parseInt(localStorage.getItem('digitPlaces')) : 0
if (this.question.Type === 'class') {
this.ClassifyAlgorithmsList = JSON.parse(this.question.ClassifyAlgorithms)
}
setInterval(()=> {
if (this.question.Type === 'class') {
let o = this.ClassifyAlgorithmsList.find(v => {
return this.questionForm[this.question.ClassifyQuestionId] >= v.gt && this.questionForm[this.question.ClassifyQuestionId] < v.lt
})
if (this.questionForm[this.question.ClassifyQuestionId]) {
this.questionForm[this.question.Id] = o ? o.label : null
} else {
this.questionForm[this.question.Id] = null
}
}
}, 300)
// if (this.question.Type === 'class') {
// this.ClassifyAlgorithmsList = JSON.parse(this.question.ClassifyAlgorithms)
// }
// setInterval(()=> {
// if (this.question.Type === 'class') {
// let o = this.ClassifyAlgorithmsList.find(v => {
// return this.questionForm[this.question.ClassifyQuestionId] >= v.gt && this.questionForm[this.question.ClassifyQuestionId] < v.lt
// })
// if (this.questionForm[this.question.ClassifyQuestionId]) {
// this.questionForm[this.question.Id] = o ? o.label : null
// } else {
// this.questionForm[this.question.Id] = null
// }
// }
// }, 300)
if (this.question.Type === 'upload') {
if (this.questionForm[this.question.Id]) {
this.urls = this.questionForm[this.question.Id].split('|')
@ -474,8 +487,32 @@ export default {
})
},
setFormTableItemData(id, url) {
this.$set(this.QuestionsForm, id, url)
setFormTableItemData(obj) {
this.$set(this.QuestionsForm, obj.key, obj.val)
if (this.classArr.length > 0) {
let qs = this.classArr.find(i=>i.triggerId === obj.key)
if (!qs) return
let answer = null
let list = JSON.parse(qs.classifyAlgorithms)
if (qs.classifyType === 0) {
let o = list.find(v => {
return (
parseFloat(obj.val) >= parseFloat(v.gt) &&
parseFloat(obj.val) < parseFloat(v.lt)
)
})
answer = o ? o.label : null
} else if (qs.classifyType === 1) {
let o = list.find(v => {
return v.val.includes(obj.val)
})
answer = o ? o.label : null
}
this.$set(this.QuestionsForm, qs.classId, answer)
}
},
resetTableFormItemData(obj) {
this.$set(this.QuestionsForm, obj.key, null)
},
handleSave() {
console.log(this.QuestionsForm)
@ -556,9 +593,10 @@ export default {
if (rules.CalculateQuestionList.length === 0) {
return false
}
let dataArr = []
rules.CalculateQuestionList.forEach((o, i) => {
if (i === 0) {
if (rules.CustomCalculateMark > 4) {
if (rules.CustomCalculateMark > 4 && rules.CustomCalculateMark < 10) {
switch (rules.CustomCalculateMark) {
case 5:
this.questionForm[o.QuestionId].forEach((q, qi) => {
@ -605,6 +643,7 @@ export default {
}
} else {
num = parseFloat(this.questionForm[o.TableQuestionId])
dataArr.push(num)
}
} else {
switch (rules.CustomCalculateMark) {
@ -624,6 +663,26 @@ export default {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
return acc + (typeof curr === "number" ? curr : 0);
}, 0) / dataArr.length;
break;
case 11:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = Math.max(...dataArr);
break;
case 12:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = Math.min(...dataArr);
break;
}
}
})
@ -700,6 +759,11 @@ export default {
this.addOrEdit.visible = true
this.addOrEdit.title = row.QuestionName + this.$t('trials:readingUnit:qsList:title:tableQs')
this.QuestionsList = row.TableQuestions.Questions
row.TableQuestions.Questions.map(v=>{
if (v.Type === 'class') {
this.classArr.push({triggerId: v.ClassifyTableQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType})
}
})
this.AnswersList = row.TableQuestions.Answers
if (!index && index !== 0) {
this.addOrEdit.type = 'add'
@ -739,6 +803,8 @@ export default {
// }
this.$emit('setFormItemData', { key: qs.Id, val: val })
})
} else {
this.$emit('setFormItemData', { key: question.Id, val: v })
}
},
resetChild(obj) {
@ -754,6 +820,7 @@ export default {
},
setFormItemData(obj) {
this.$emit('setFormItemData', obj)
},
async uploadScreenshot(param) {
console.log('uploadScreenshot')

View File

@ -95,7 +95,25 @@
{{ val }}
</el-checkbox>
</el-checkbox-group>
<!-- 自动分类 -->
<el-input
v-if="question.Type === 'class' && !question.TypeValue"
v-model="questionForm[question.Id]"
disabled
/>
<el-radio-group
v-if="question.Type === 'class' && question.TypeValue"
v-model="questionForm[question.Id]"
disabled
>
<el-radio
v-for="item of question.TypeValue.split('|')"
:key="item.trim()"
:label="item.trim()"
>
{{ item.trim() }}
</el-radio>
</el-radio-group>
<!-- 自动计算 -->
<!-- :precision="2" :step="0.1" :max="10" -->
<el-input
@ -282,11 +300,11 @@ export default {
deep: true,
immediate: true,
handler(v, oldv) {
try {
if (!v[this.question.Id] || !oldv[this.question.Id]) return
} catch (e) {
}
this.formItemNumberChange(this.question.Id, false)
// try {
// if (!v[this.question.Id] || !oldv[this.question.Id]) return
// } catch (e) {
// }
// this.formItemNumberChange(this.question.Id, false)
}
},
},
@ -302,12 +320,12 @@ export default {
}
}
if (this.type === 'edit') return
if (this.question.Type === 'number') {
console.log(this.questionForm)
this.$set(this.questionForm, this.question.Id, null)
} else {
this.$set(this.questionForm, this.question.Id, '')
}
// if (this.question.Type === 'number') {
// console.log(this.questionForm)
// this.$set(this.questionForm, this.question.Id, null)
// } else {
// this.$set(this.questionForm, this.question.Id, '')
// }
},
methods: {
save() {
@ -345,6 +363,8 @@ export default {
// }
this.$emit('setFormItemData', { key: qs.Id, val: val })
})
} else {
this.$emit('setFormItemData', { key: question.Id, val: v })
}
},
limitInput(value, q) {
@ -361,10 +381,11 @@ export default {
if (rules.CalculateQuestionList.length === 0) {
return false
}
let dataArr = []
var count = 0
var maxList = [], minList = []
rules.CalculateQuestionList.forEach((o, i) => {
if (rules.CustomCalculateMark > 4) {
if (rules.CustomCalculateMark > 4 && rules.CustomCalculateMark < 10) {
if (i !== 0) {
switch (rules.CustomCalculateMark) {
case 7:
@ -391,6 +412,7 @@ export default {
minList.push(this.questionForm[o.TableQuestionId])
count = parseFloat(this.questionForm[o.TableQuestionId])
num = parseFloat(this.questionForm[o.TableQuestionId])
dataArr.push(num)
}
} else {
if (i !== 0) {
@ -411,6 +433,26 @@ export default {
num /= parseFloat(this.questionForm[o.TableQuestionId])
}
break;
case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
return acc + (typeof curr === "number" ? curr : 0);
}, 0) / dataArr.length;
break;
case 11:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = Math.max(...dataArr);
break;
case 12:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
}
num = Math.min(...dataArr);
break;
}
} else {
num = parseFloat(this.questionForm[o.TableQuestionId])
@ -427,7 +469,6 @@ export default {
return num.toFixed(digitPlaces)
},
formItemNumberChange(v, question) {
console.log(this.CalculationList)
this.CalculationList.forEach((v, i) => {
console.log('v', v)
var find = v.CalculateQuestionList.filter(o => {
@ -476,7 +517,7 @@ export default {
console.log(res)
this.fileList.push({ name: param.file.name, path: this.$getObjectName(res.url), url: this.$getObjectName(res.url)})
this.urls.push(this.$getObjectName(res.url))
this.$emit('setFormTableItemData', this.question.Id, this.urls.length > 0 ? this.urls.join('|') : '')
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
loading.close()
},
handleBeforeUpload(file) {
@ -516,7 +557,7 @@ export default {
this.imageUrl = ''
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === file.url), 1)
this.$emit('setFormTableItemData', this.question.Id, this.urls.length > 0 ? this.urls.join('|') : '')
this.$emit('setFormItemData', { key:this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
}
}
}

View File

@ -57,7 +57,8 @@ export default {
readingTaskState: 0,
activeName: 0,
CalculationList: [],
IsBaseline: true
IsBaseline: true,
classArr: []
}
},
mounted() {
@ -128,6 +129,9 @@ export default {
if (v.Type === 'table' || v.Type === 'basicTable') {
this.$set(this.questionForm, v.Id, v.TableQuestions.Answers)
}
if (v.Type === 'class') {
this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType})
}
if (v.Type === 'number') {
this.$set(this.questionForm, v.Id, v.Answer === '' ? '' : parseFloat(v.Answer).toFixed(localStorage.getItem('digitPlaces')))
}
@ -136,7 +140,6 @@ export default {
}
})
this.questions = res.Result.SinglePage
console.log(this.questions)
this.isRender = true
this.loading = false
})
@ -211,6 +214,9 @@ export default {
})
this.$set(this.questionForm, i.Id, i.TableQuestions.Answers)
}
if (i.Type === 'class') {
this.classArr.push({triggerId: i.ClassifyQuestionId, classId: i.Id, classifyAlgorithms: i.ClassifyAlgorithms, classifyType: i.ClassifyType})
}
if (i.Type === 'number') {
this.$set(this.questionForm, i.Id, i.Answer === '' ? '' : parseFloat(i.Answer).toFixed(localStorage.getItem('digitPlaces')))
}
@ -224,6 +230,28 @@ export default {
},
setFormItemData(obj) {
this.$set(this.questionForm, obj.key, JSON.parse(JSON.stringify(obj.val)))
if (this.classArr.length > 0) {
let qs = this.classArr.find(i=>i.triggerId === obj.key)
if (!qs) return
let answer = null
let list = JSON.parse(qs.classifyAlgorithms)
if (qs.classifyType === 0) {
let o = list.find(v => {
return (
parseFloat(obj.val) >= parseFloat(v.gt) &&
parseFloat(obj.val) < parseFloat(v.lt)
)
})
answer = o ? o.label : null
} else if (qs.classifyType === 1) {
let o = list.find(v => {
return v.val.includes(obj.val)
})
answer = o ? o.label.trim() : null
}
console.log(this.questionForm, qs.classId, answer)
this.$set(this.questionForm, qs.classId, answer)
}
}
}
}

View File

@ -80,7 +80,7 @@
</div>
</template>
<template slot-scope="scope">
<template v-if="readingTaskState<2 && task.VisitTaskId === visitTaskId && (scope.row.Type==='input' || scope.row.Type==='number' || scope.row.Type==='select' || scope.row.Type==='textarea' || scope.row.Type==='radio')">
<template v-if="readingTaskState<2 && task.VisitTaskId === visitTaskId && (scope.row.Type==='input' || scope.row.Type==='number' || scope.row.Type==='select' || scope.row.Type==='textarea' || scope.row.Type==='radio' || scope.row.Type === 'class')">
<template>
<!-- 输入框 -->
<div>
@ -117,7 +117,7 @@
/>
</template>
</el-select>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='select'">
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='select' || scope.row.Type==='radio'">
{{questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}}
</span>
<el-select
@ -138,6 +138,12 @@
<span v-else-if="scope.row.Type==='select' || scope.row.Type==='radio'">
{{questionForm[scope.row.QuestionId]}}
</span>
<span v-else-if="questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='class'">
{{questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]}}
</span>
<span v-else-if="scope.row.Type==='class'">
{{questionForm[scope.row.QuestionId]}}
</span>
<el-input
v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type==='number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"

View File

@ -991,7 +991,7 @@ export default {
ParentTriggerValueList: [],
ShowOrder: 0,
ShowQuestion: 0,
IsRequired: 0,
IsRequired: 2,
IsJudgeQuestion: false,
GroupName: '',
GroupEnName: '',
@ -1469,11 +1469,6 @@ export default {
form.IsJudgeQuestion = false
form.TypeValue = ''
}
if (val === 'table') {
form.IsRequired = 2
} else {
form.LesionType = null
}
if (val === 'number') {
form.Unit = 0
} else {
@ -1484,6 +1479,8 @@ export default {
} else {
form.MaxAnswerLength = null
}
form.IsRequired = 2
form.LesionType = null
form.ImageCount = 0
form.QuestionGenre = null
form.CalculateQuestions = []

View File

@ -819,7 +819,7 @@ export default {
ParentTriggerValueList: [],
ShowOrder: 0,
ShowQuestion: 0,
IsRequired: 0,
IsRequired: 2,
Remark: '',
RelevanceId: '',
RelevanceValueList: [],
@ -1238,6 +1238,7 @@ export default {
} else {
form.MaxAnswerLength = null
}
form.IsRequired = 2
form.TypeValue = ''
form.TableQuestionType = null
form.DependParentId = ''