非dicom阅片排序修改、IVUS添加多选字段
continuous-integration/drone/push Build encountered an error Details

uat
wangxiaoshuang 2025-12-25 14:50:44 +08:00
parent 6cd5e7b957
commit 17b1cc476f
7 changed files with 473 additions and 158 deletions

346
src/utils/customSort.js Normal file
View File

@ -0,0 +1,346 @@
class FileNameSorter {
/**
* 判断是否为纯数字字符串
* @param {any} value - 要检查的值
* @returns {boolean} 是否为纯数字
*/
static isPureNumber(value) {
if (typeof value !== 'string') return false;
return /^\d+$/.test(value);
}
/**
* 获取排序键值
* @param {any} item - 要排序的项目
* @returns {Array} 排序键值数组
*/
static getSortKey(item) {
const str = String(item);
const isNumber = this.isPureNumber(str);
// 排序优先级: [类型优先级, 数字值/字符串值]
if (isNumber) {
// 纯数字: 类型优先级为0, 使用数字值排序
return [0, BigInt(str)];
} else {
// 非纯数字: 类型优先级为1, 使用字符串排序
return [1, str.toLowerCase()];
}
}
/**
* 文件名排序
* @param {Array} arr - 要排序的数组
* @param {Object} options - 排序选项
* @returns {Array} 排序后的数组
*/
static sortFileNames(arr, options = {}) {
if (!Array.isArray(arr)) {
throw new TypeError('输入必须是一个数组');
}
const {
direction = 'asc', // 'asc' 升序, 'desc' 降序
caseSensitive = false, // 是否区分大小写
trim = true, // 是否去除前后空格
key = null
} = options;
// 创建数组的副本
const result = [...arr];
return result.sort((a, b) => {
let aStr = key ? String(a[key]).split(".")[0] : String(a);
let bStr = key ? String(b[key]).split(".")[0] : String(b);
// 处理空格
if (trim) {
aStr = aStr.trim();
bStr = bStr.trim();
}
// 处理大小写
if (!caseSensitive) {
aStr = aStr.toLowerCase();
bStr = bStr.toLowerCase();
}
// 获取排序键值
const aKey = this.getSortKey(aStr);
const bKey = this.getSortKey(bStr);
// 比较类型优先级
if (aKey[0] !== bKey[0]) {
// 纯数字(0) < 非纯数字(1)
return direction === 'asc' ? aKey[0] - bKey[0] : bKey[0] - aKey[0];
}
// 相同类型下的比较
if (aKey[0] === 0) {
// 都是纯数字,按数字大小比较
if (aKey[1] < bKey[1]) return direction === 'asc' ? -1 : 1;
if (aKey[1] > bKey[1]) return direction === 'asc' ? 1 : -1;
return 0;
} else {
// 都是非纯数字,按字符串比较
if (aStr < bStr) return direction === 'asc' ? -1 : 1;
if (aStr > bStr) return direction === 'asc' ? 1 : -1;
return 0;
}
});
}
/**
* 自然排序 - 处理文件名中的数字序列
* 例如: file1, file2, file10
* @param {Array} arr - 要排序的数组
* @param {Object} options - 排序选项
* @returns {Array} 排序后的数组
*/
static naturalSort(arr, options = {}) {
const {
direction = 'asc',
caseSensitive = false
} = options;
return [...arr].sort((a, b) => {
const aStr = String(a);
const bStr = String(b);
// 检查是否都是纯数字
const aIsPureNumber = this.isPureNumber(aStr);
const bIsPureNumber = this.isPureNumber(bStr);
// 如果一个纯数字,一个非纯数字
if (aIsPureNumber && !bIsPureNumber) {
return direction === 'asc' ? -1 : 1;
}
if (!aIsPureNumber && bIsPureNumber) {
return direction === 'asc' ? 1 : -1;
}
// 都是纯数字,按数字比较
if (aIsPureNumber && bIsPureNumber) {
const aNum = BigInt(aStr);
const bNum = BigInt(bStr);
if (aNum < bNum) return direction === 'asc' ? -1 : 1;
if (aNum > bNum) return direction === 'asc' ? 1 : -1;
return 0;
}
// 都是非纯数字,使用自然排序算法
return this.naturalCompare(aStr, bStr, direction, caseSensitive);
});
}
/**
* 自然比较算法
* @private
*/
static naturalCompare(a, b, direction = 'asc', caseSensitive = false) {
let aStr = caseSensitive ? a : a.toLowerCase();
let bStr = caseSensitive ? b : b.toLowerCase();
const regex = /(\d+|\D+)/g;
const aParts = aStr.match(regex) || [];
const bParts = bStr.match(regex) || [];
const maxLength = Math.max(aParts.length, bParts.length);
for (let i = 0; i < maxLength; i++) {
const aPart = aParts[i] || '';
const bPart = bParts[i] || '';
const aIsNumber = /^\d+$/.test(aPart);
const bIsNumber = /^\d+$/.test(bPart);
// 如果都是数字,按数字比较
if (aIsNumber && bIsNumber) {
const aNum = BigInt(aPart);
const bNum = BigInt(bPart);
if (aNum < bNum) return direction === 'asc' ? -1 : 1;
if (aNum > bNum) return direction === 'asc' ? 1 : -1;
continue;
}
// 都是文本,按字符串比较
if (aPart < bPart) return direction === 'asc' ? -1 : 1;
if (aPart > bPart) return direction === 'asc' ? 1 : -1;
}
return 0;
}
/**
* 分组排序 - 将纯数字和非纯数字分开显示
* @param {Array} arr - 要排序的数组
* @param {Object} options - 排序选项
* @returns {Array} 排序后的数组
*/
static groupSort(arr, options = {}) {
const {
direction = 'asc',
groupOrder = 'numbers-first' // 'numbers-first' 或 'names-first'
} = options;
// 分组
const numbers = [];
const names = [];
arr.forEach(item => {
const str = String(item);
if (this.isPureNumber(str)) {
numbers.push(item);
} else {
names.push(item);
}
});
// 对各组排序
const sortedNumbers = this.sortFileNames(numbers, { direction });
const sortedNames = this.sortFileNames(names, { direction });
// 按指定顺序合并
if (groupOrder === 'numbers-first') {
return [...sortedNumbers, ...sortedNames];
} else {
return [...sortedNames, ...sortedNumbers];
}
}
/**
* 文件扩展名排序 - 先按扩展名排序再按文件名排序
* @param {Array} arr - 要排序的数组
* @param {Object} options - 排序选项
* @returns {Array} 排序后的数组
*/
static sortByExtension(arr, options = {}) {
const {
direction = 'asc',
extensionsFirst = false // 扩展名优先还是文件名优先
} = options;
return [...arr].sort((a, b) => {
const aStr = String(a);
const bStr = String(b);
// 分离文件名和扩展名
const getFileParts = (str) => {
const lastDotIndex = str.lastIndexOf('.');
if (lastDotIndex > 0) {
return {
name: str.substring(0, lastDotIndex),
ext: str.substring(lastDotIndex + 1)
};
}
return { name: str, ext: '' };
};
const aParts = getFileParts(aStr);
const bParts = getFileParts(bStr);
let compareResult;
if (extensionsFirst) {
// 先比较扩展名
compareResult = this.sortFileNames([aParts.ext, bParts.ext], { direction })[0] === aParts.ext ? -1 : 1;
if (compareResult !== 0) return compareResult;
// 扩展名相同,再比较文件名
return this.sortFileNames([aParts.name, bParts.name], { direction })[0] === aParts.name ? -1 : 1;
} else {
// 先比较文件名
compareResult = this.sortFileNames([aParts.name, bParts.name], { direction })[0] === aParts.name ? -1 : 1;
if (compareResult !== 0) return compareResult;
// 文件名相同,再比较扩展名
return this.sortFileNames([aParts.ext, bParts.ext], { direction })[0] === aParts.ext ? -1 : 1;
}
});
}
/**
* 测试和演示函数
*/
static demonstrate() {
const testData = [
'100',
'23',
'1',
'003',
'file.txt',
'10',
'5',
'alpha',
'beta',
'gamma',
'00100',
'zebra',
'apple',
'banana',
'123',
'file10.txt',
'file2.txt',
'File1.txt',
'file20.txt',
'image.jpg',
'document.pdf',
'data.xlsx'
];
console.log('=== 文件名排序演示 ===\n');
console.log('原始数据:');
console.log(testData);
console.log('\n1. 基本排序 (纯数字 < 非纯数字):');
const basicSorted = this.sortFileNames(testData);
console.log(basicSorted);
console.log('\n2. 自然排序 (智能数字识别):');
const naturalSorted = this.naturalSort(testData);
console.log(naturalSorted);
console.log('\n3. 分组排序 (数字组和文件组):');
const groupSorted = this.groupSort(testData);
console.log(groupSorted);
console.log('\n4. 降序排序:');
const descSorted = this.sortFileNames(testData, { direction: 'desc' });
console.log(descSorted);
console.log('\n5. 按扩展名排序:');
const extSorted = this.sortByExtension(testData);
console.log(extSorted);
console.log('\n6. 大小写敏感排序:');
const caseSensitiveSorted = this.sortFileNames(testData, { caseSensitive: true });
console.log(caseSensitiveSorted);
// 验证排序规则
console.log('\n=== 排序规则验证 ===');
const validationData = ['100', '23', 'file.txt', '1', 'alpha', '003', '10'];
console.log('验证数据:', validationData);
console.log('排序结果:', this.sortFileNames(validationData));
console.log('规则验证:');
console.log(' - 纯数字: 1, 3(003), 10, 23, 100 (按数字大小)');
console.log(' - 非纯数字: alpha, file.txt (按字母顺序)');
console.log(' - 非纯数字 > 纯数字');
return {
basic: basicSorted,
natural: naturalSorted,
group: groupSorted,
descending: descSorted,
byExtension: extSorted,
caseSensitive: caseSensitiveSorted
};
}
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = FileNameSorter;
} else if (typeof window !== 'undefined') {
window.FileNameSorter = FileNameSorter;
}

View File

@ -3,8 +3,10 @@
<el-card class="box-card left">
<div class="title" style="display: flex;align-items: center;">
<div style="margin-right: 5px;cursor: pointer;" @click.stop="sortFile">
<i :class="['el-icon-caret-top', Asc ? '' : 'icon_check']" style="display: block;margin-bottom: -5px;"></i>
<i :class="['el-icon-caret-bottom', !Asc ? '' : 'icon_check']" style="display: block; margin-top: -5px;"></i>
<i :class="['el-icon-caret-top', Asc === false || Asc === null ? '' : 'icon_check']"
style="display: block;margin-bottom: -5px;"></i>
<i :class="['el-icon-caret-bottom', Asc === true || Asc === null ? '' : 'icon_check']"
style="display: block; margin-top: -5px;"></i>
</div>
{{ $t('trials:none-dicom-show:fileList') }}
</div>
@ -103,6 +105,7 @@ import zip from '@/assets/zip.jpg'
import { changeURLStatic } from '@/utils/history.js'
import Preview from './components/preview'
import PreviewFile from '@/components/PreviewFile'
import FileNameSorter from "@/utils/customSort";
// import CheckForm from './components/form'
export default {
name: 'Notice',
@ -162,6 +165,11 @@ export default {
this.getNoneDicomList()
//
},
computed: {
CriterionType() {
return this.OtherInfo.CriterionType ? this.OtherInfo.CriterionType : 0
}
},
methods: {
sortFile() {
if (this.Asc) {
@ -169,15 +177,13 @@ export default {
} else {
this.Asc = true
}
console.log(this.Asc, 'Asc')
console.log(this.Asc, 'this.Asc')
this.studyList.forEach(study => {
if (study.NoneDicomStudyFileList.length > 0) {
if (this.Asc) {
study.NoneDicomStudyFileList.sort((a, b) => b.FileName.localeCompare(a.FileName))
} else {
study.NoneDicomStudyFileList.sort((a, b) => a.FileName.localeCompare(b.FileName))
}
study.NoneDicomStudyFileList = FileNameSorter.sortFileNames(study.NoneDicomStudyFileList, {
direction: this.Asc ? 'asc' : 'desc',
key: 'FileName'
})
}
})
this.previewImage.imgList = this.studyList[this.currentStudyIndex].NoneDicomStudyFileList
@ -316,11 +322,13 @@ export default {
return item.NoneDicomStudyFileList.length > 0
})
this.activeNames = this.studyList.map((item) => item.CodeView)
console.log(this.activeNames)
if (studyIndex > -1) {
var fileObj = this.studyList[studyIndex]['NoneDicomStudyFileList']
this.selected(fileObj[0], studyIndex, 0, true)
}
if (this.CriterionType === 19 || this.CriterionType === 20) {
this.sortFile()
}
})
.catch(() => {
this.loading = false

View File

@ -65,7 +65,11 @@
{{ `${scope.row[q.Id]} ${$fd('ValueUnit', parseInt(q.Unit))}` }}
</span>
<span v-else-if="q.DictionaryCode">
{{ `${$fd(q.DictionaryCode, parseInt(scope.row[q.Id]))}` }}
{{`${scope.row[q.Id] instanceof Array ? scope.row[q.Id].map(item => $fd(q.DictionaryCode,
parseInt(item))).join(',') : $fd(q.DictionaryCode, parseInt(scope.row[q.Id]))}`}}
</span>
<span v-else-if="q.OptionTypeEnum === 1">
{{ `${scope.row[q.Id] instanceof Array ? scope.row[q.Id].join(',') : scope.row[q.Id]}` }}
</span>
<span v-else>
{{ `${scope.row[q.Id]}` }}
@ -108,7 +112,7 @@
</template>
<template v-if="item.Type === 'select'">
<el-select v-model="questionForm[item.Id]" :disabled="!isCurrentTask || readingTaskState >= 2"
@change="((val) => { formItemChange(val, item) })">
:multiple="item.OptionTypeEnum === 1" @change="((val) => { formItemChange(val, item) })">
<el-option v-for="dict of $d[item.DictionaryCode]" :key="dict.id" :value="String(dict.value)"
:label="dict.label" />
</el-select>
@ -117,10 +121,10 @@
<template v-if="item.Childrens && item.Childrens.length > 0">
<template v-for="child in item.Childrens">
<el-form-item :key="child.Id"
v-if="(child.ShowQuestion === 1 && child.ParentTriggerValueList.includes(String(questionForm[item.Id]))) || child.ShowQuestion === 0"
v-if="(child.ShowQuestion === 1 && (child.ParentTriggerValueList.includes(String(questionForm[item.Id])) || (Array.isArray(questionForm[item.Id]) && child.ParentTriggerValueList.some(da => questionForm[item.Id].includes(da))))) || child.ShowQuestion === 0"
:label="`${child.QuestionName}`" :prop="child.Id" :rules="[
{
required: (child.IsRequired === 0 || (child.IsRequired === 1 && child.RelevanceId && (child.RelevanceValue.includes(questionForm[child.RelevanceId])))) && child.Type !== 'group' && child.Type !== 'summary',
required: (child.IsRequired === 0 || (child.IsRequired === 1 && child.RelevanceId && ((child.RelevanceValue.includes(questionForm[child.RelevanceId])) || (Array.isArray(questionForm[child.RelevanceId]) && child.RelevanceValueList.some(da => questionForm[child.RelevanceId].includes(da)))))) && child.Type !== 'group' && child.Type !== 'summary',
message: ['radio', 'select', 'checkbox'].includes(child.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur', 'change']
},
]">
@ -326,7 +330,7 @@ export default {
const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation']
questions.forEach(item => {
if (type.includes(item.Type)) {
const answer = item.Type === 'number' || item.Type === 'calculation' ? isNaN(parseFloat(item.Answer)) ? null : parseFloat(item.Answer) : item.Answer
const answer = item.Type === 'select' && item.OptionTypeEnum === 1 && item.Answer ? JSON.parse(item.Answer) : item.Type === 'number' || item.Type === 'calculation' ? isNaN(parseFloat(item.Answer)) ? null : parseFloat(item.Answer) : item.Answer
this.$set(this.questionForm, item.Id, answer)
}
if (item.Childrens.length > 0) {
@ -486,7 +490,7 @@ export default {
const loading = this.$loading({ fullscreen: true })
var answers = []
for (const k in this.questionForm) {
answers.push({ id: k, answer: this.questionForm[k] })
answers.push({ id: k, answer: Array.isArray(this.questionForm[k]) ? JSON.stringify(this.questionForm[k]) : this.questionForm[k] })
}
var params = {
visitTaskId: this.visitTaskId,
@ -610,7 +614,7 @@ export default {
for (const k in this.qsForm) {
if (reg.test(k)) {
if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
answers.push({ tableQuestionId: k, answer: this.qsForm[k] })
answers.push({ tableQuestionId: k, answer: Array.isArray(this.qsForm[k]) ? JSON.stringify(this.qsForm[k]) : this.qsForm[k] })
}
}
}

View File

@ -1,119 +1,66 @@
<template>
<div>
<div
v-if="!!question.GroupName && question.Type==='group'"
>
<div v-if="!!question.GroupName && question.Type === 'group'">
<h4 style="color: #ddd;padding: 5px 0px;margin: 0;">
{{ language==='en'?question.GroupEnName:question.GroupName }}
{{ language === 'en' ? question.GroupEnName : question.GroupName }}
</h4>
</div>
<template v-else>
<el-form-item
v-if="(question.ShowQuestion===1 && question.ParentTriggerValueList.includes(String(questionForm[question.ParentId]))) || question.ShowQuestion===0 "
:label="`${question.QuestionName}`"
:prop="question.Id"
:rules="[
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (questionForm[question.RelevanceId] === question.RelevanceValue))) && question.Type!=='group' && question.Type!=='summary',
message: ['radio', 'select', 'checkbox'].includes(question.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
v-if="(question.ShowQuestion === 1 && question.ParentTriggerValueList.includes(String(questionForm[question.ParentId]))) || question.ShowQuestion === 0"
:label="`${question.QuestionName}`" :prop="question.Id" :rules="[
{
required: (question.IsRequired === 0 || (question.IsRequired === 1 && question.RelevanceId && (questionForm[question.RelevanceId] === question.RelevanceValue))) && question.Type !== 'group' && question.Type !== 'summary',
message: ['radio', 'select', 'checkbox'].includes(question.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur', 'change']
},
]"
:class="[question.Type==='group' ? 'mb' : (question.Type==='upload' || question.QuestionName.length > 15) ?'uploadWrapper' : '']"
>
:class="[question.Type === 'group' ? 'mb' : (question.Type === 'upload' || question.QuestionName.length > 15) ? 'uploadWrapper' : '']">
<!-- 输入框 -->
<el-input
v-if="question.Type==='input'"
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2"
@change="((val)=>{formItemChange(val, question)})"
/>
<el-input v-if="question.Type === 'input'" v-model="questionForm[question.Id]" :disabled="readingTaskState >= 2"
@change="((val) => { formItemChange(val, question) })" />
<!-- 多行文本输入框 -->
<el-input
v-else-if="question.Type==='textarea'"
v-model="questionForm[question.Id]"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
maxlength="500"
:disabled="readingTaskState >= 2"
@change="((val)=>{formItemChange(val, question)})"
/>
<el-input v-else-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }" maxlength="500" :disabled="readingTaskState >= 2"
@change="((val) => { formItemChange(val, question) })" />
<!-- 下拉框 -->
<el-select
v-else-if="question.Type==='select'"
v-model="questionForm[question.Id]"
<el-select v-else-if="question.Type === 'select'" v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2 || ((question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode)"
clearable
@change="((val)=>{formItemChange(val, question)})"
>
clearable :multiple="question.OptionTypeEnum === 1" @change="((val) => { formItemChange(val, question) })">
<template v-if="question.TableQuestionType === 1">
<el-option
v-for="item in organList"
:key="item.Id"
:label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]"
/>
<el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]" />
</template>
<template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3">
<el-option
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:value="String(item.value)"
:label="item.label"
/>
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="String(item.value)"
:label="item.label" />
</template>
<template v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
<el-option
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:value="String(item.value)"
:label="item.label"
/>
<template
v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="String(item.value)"
:label="item.label" />
</template>
<template v-else>
<el-option
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val" :value="val" />
</template>
</el-select>
<!-- 单选 -->
<el-radio-group
v-else-if="question.Type==='radio'"
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2"
@change="((val)=>{formItemChange(val, question)})"
>
<el-radio-group v-else-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2" @change="((val) => { formItemChange(val, question) })">
<template v-if="question.DictionaryCode">
<el-radio
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:label="String(item.value)"
>
<el-radio v-for="item of $d[question.DictionaryCode]" :key="item.id" :label="String(item.value)">
{{ item.label }}
</el-radio>
</template>
<template v-else-if="question.TypeValue">
<el-radio
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
>
<el-radio v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
{{ val }}
</el-radio>
</template>
</el-radio-group>
<!-- 复选框 -->
<el-checkbox-group
v-else-if="question.Type==='checkbox'"
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2"
@change="((val)=>{formItemChange(val, question)})"
>
<el-checkbox
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
>
<el-checkbox-group v-else-if="question.Type === 'checkbox'" v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2" @change="((val) => { formItemChange(val, question) })">
<el-checkbox v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
{{ val }}
</el-checkbox>
</el-checkbox-group>
@ -144,24 +91,15 @@
/>
</template> -->
<!-- 数值类型 -->
<el-input
v-else-if="question.Type==='number'"
v-model="questionForm[question.Id]"
:disabled="readingTaskState>=2 "
type="number"
@change="((val)=>{formItemChange(val, question)})"
>
<el-input v-else-if="question.Type === 'number'" v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2" type="number" @change="((val) => { formItemChange(val, question) })">
<template v-if="question.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(question.Unit)) }}
</template>
</el-input>
<el-input
v-else-if="question.Type==='calculation'"
v-model="questionForm[question.Id]"
disabled
@change="((val)=>{formItemChange(val, question)})"
>
<el-input v-else-if="question.Type === 'calculation'" v-model="questionForm[question.Id]" disabled
@change="((val) => { formItemChange(val, question) })">
<template v-if="question.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(question.Unit)) }}
</template>
@ -169,15 +107,9 @@
</el-form-item>
</template>
<QuestionTableFormItem
v-for="item in question.Childrens"
:key="item.Id"
:question="item"
:question-form="questionForm"
:reading-task-state="readingTaskState"
@setFormItemData="setFormItemData"
@resetFormItemData="resetFormItemData"
/>
<QuestionTableFormItem v-for="item in question.Childrens" :key="item.Id" :question="item"
:question-form="questionForm" :reading-task-state="readingTaskState" @setFormItemData="setFormItemData"
@resetFormItemData="resetFormItemData" />
</div>
</template>
<script>
@ -269,29 +201,36 @@ export default {
}
</script>
<style lang="scss" scoped>
.mb{
.mb {
margin-bottom: 0px;
}
.disabled{
.disabled {
::v-deep .el-upload--picture-card {
display: none;
}
}
.uploadWrapper{
.uploadWrapper {
display: flex;
flex-direction: column !important;
align-items: flex-start;
}
::v-deep .el-input.is-disabled .el-input__inner{
::v-deep .el-input.is-disabled .el-input__inner {
background-color: #646464a1;
}
::v-deep .el-input-group__append, .el-input-group__prepend{
}
::v-deep .el-input-group__append,
.el-input-group__prepend {
padding: 0 10px;
}
::v-deep .el-form-item__content {
}
::v-deep .el-form-item__content {
width: 100%;
}
::v-deep .el-select.is-disabled .el-input__inner{
}
::v-deep .el-select.is-disabled .el-input__inner {
background-color: #646464a1;
}
}
</style>

View File

@ -107,7 +107,7 @@
</template>
<template v-if="item.Type === 'select'">
<el-select v-model="questionForm[item.Id]" :disabled="!isCurrentTask || readingTaskState >= 2"
@change="((val) => { formItemChange(val, item) })">
:multiple="item.OptionTypeEnum === 1" @change="((val) => { formItemChange(val, item) })">
<el-option v-for="dict of $d[item.DictionaryCode]" :key="dict.id" :value="String(dict.value)"
:label="dict.label" />
</el-select>
@ -116,10 +116,10 @@
<template v-if="item.Childrens && item.Childrens.length > 0">
<template v-for="child in item.Childrens">
<el-form-item :key="child.Id"
v-if="(child.ShowQuestion === 1 && child.ParentTriggerValueList.includes(String(questionForm[item.Id]))) || child.ShowQuestion === 0"
v-if="(child.ShowQuestion === 1 && (child.ParentTriggerValueList.includes(String(questionForm[item.Id])) || (Array.isArray(questionForm[item.Id]) && child.ParentTriggerValueList.some(da => questionForm[item.Id].includes(da))))) || child.ShowQuestion === 0"
:label="`${child.QuestionName}`" :prop="child.Id" :rules="[
{
required: (child.IsRequired === 0 || (child.IsRequired === 1 && child.RelevanceId && (child.RelevanceValue.includes(questionForm[child.RelevanceId])))) && child.Type !== 'group' && child.Type !== 'summary',
required: (child.IsRequired === 0 || (child.IsRequired === 1 && child.RelevanceId && ((child.RelevanceValue.includes(questionForm[child.RelevanceId])) || (Array.isArray(questionForm[child.RelevanceId]) && child.RelevanceValueList.some(da => questionForm[child.RelevanceId].includes(da)))))) && child.Type !== 'group' && child.Type !== 'summary',
message: ['radio', 'select', 'checkbox'].includes(child.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur', 'change']
},
]">
@ -482,7 +482,7 @@ export default {
const loading = this.$loading({ fullscreen: true })
var answers = []
for (const k in this.questionForm) {
answers.push({ id: k, answer: this.questionForm[k] })
answers.push({ id: k, answer: Array.isArray(this.questionForm[k]) ? JSON.stringify(this.questionForm[k]) : this.questionForm[k] })
}
var params = {
visitTaskId: this.visitTaskId,

View File

@ -4,8 +4,10 @@
<div v-if="otherInfo && otherInfo.IsReadingShowSubjectInfo" class="title"
style="display: flex;align-items: center;flex-wrap: wrap;">
<div style="margin-right: 5px;cursor: pointer;display: inline-block" @click.stop="sortFile">
<i :class="['el-icon-caret-top', Asc ? '' : 'icon_check']" style="display: block;margin-bottom: -5px;"></i>
<i :class="['el-icon-caret-bottom', !Asc ? '' : 'icon_check']" style="display: block; margin-top: -5px;"></i>
<i :class="['el-icon-caret-top', Asc === false || Asc === null ? '' : 'icon_check']"
style="display: block;margin-bottom: -5px;"></i>
<i :class="['el-icon-caret-bottom', Asc === true || Asc === null ? '' : 'icon_check']"
style="display: block; margin-top: -5px;"></i>
</div>
<span>{{ otherInfo.SubjectCode }} </span>
<span>({{ otherInfo.TaskBlindName }})</span>
@ -59,6 +61,7 @@ import { getReadingImageFile } from '@/api/trials'
import { changeURLStatic } from '@/utils/history.js'
import store from '@/store'
import NoneDicomsViewer from './components/NoneDicomsViewer'
import FileNameSorter from "@/utils/customSort";
export default {
name: 'VisitReview',
components: {
@ -99,6 +102,11 @@ export default {
Asc: null
}
},
computed: {
CriterionType() {
return this.otherInfo.CriterionType ? this.otherInfo.CriterionType : 0
}
},
async mounted() {
this.BodyPart.Bodypart = await this.$getBodyPart(this.$route.query.trialId)
if (this.$router.currentRoute.query.TokenKey) {
@ -127,11 +135,10 @@ export default {
}
this.studyList.forEach(study => {
if (study.NoneDicomStudyFileList.length > 0) {
if (this.Asc) {
study.NoneDicomStudyFileList.sort((a, b) => b.FileName.localeCompare(a.FileName))
} else {
study.NoneDicomStudyFileList.sort((a, b) => a.FileName.localeCompare(b.FileName))
}
study.NoneDicomStudyFileList = FileNameSorter.sortFileNames(study.NoneDicomStudyFileList, {
direction: this.Asc ? 'asc' : 'desc',
key: 'FileName'
})
}
})
@ -159,6 +166,9 @@ export default {
}
}
this.loading = false
if (this.CriterionType === 19 || this.CriterionType === 20) {
this.sortFile()
}
}).catch(() => { this.loading = false })
},
selected(file, studyIndex, fileIndex, isChangeSub = false) {

View File

@ -3,8 +3,10 @@
<el-card v-loading="loading" class="box-card left">
<div v-if="isReadingShowSubjectInfo" class="title" style="display: flex;align-items: center;">
<div style="margin-right: 5px;cursor: pointer;" @click.stop="sortFile">
<i :class="['el-icon-caret-top', Asc ? '' : 'icon_check']" style="display: block;margin-bottom: -5px;"></i>
<i :class="['el-icon-caret-bottom', !Asc ? '' : 'icon_check']" style="display: block; margin-top: -5px;"></i>
<i :class="['el-icon-caret-top', Asc === false || Asc === null ? '' : 'icon_check']"
style="display: block;margin-bottom: -5px;"></i>
<i :class="['el-icon-caret-bottom', Asc === true || Asc === null ? '' : 'icon_check']"
style="display: block; margin-top: -5px;"></i>
</div>
<h4>{{ subjectCode }} </h4>
<h4>{{ taskBlindName }}</h4>
@ -102,6 +104,7 @@ import { getReadingImageFile, getReadingPastResultList } from '@/api/trials'
import { getToken } from '@/utils/auth'
import Preview from '@/views/none-dicom-show/components/preview'
import Criterions from './Criterions'
import FileNameSorter from "@/utils/customSort";
export default {
name: 'VisitReview',
components: {
@ -190,6 +193,9 @@ export default {
computed: {
showOtherTask() {
return this.otherInfo && this.otherInfo.IsReadingShowPreviousResults && this.isReadingShowPreviousResults
},
CriterionType() {
return this.otherInfo.CriterionType ? this.otherInfo.CriterionType : 0
}
},
async mounted() {
@ -209,14 +215,13 @@ export default {
} else {
this.Asc = true
}
console.log(this.Asc, 'this.Asc')
this.studyList.forEach(study => {
if (study.NoneDicomStudyFileList.length > 0) {
if (this.Asc) {
study.NoneDicomStudyFileList.sort((a, b) => b.FileName.localeCompare(a.FileName))
} else {
study.NoneDicomStudyFileList.sort((a, b) => a.FileName.localeCompare(b.FileName))
}
study.NoneDicomStudyFileList = FileNameSorter.sortFileNames(study.NoneDicomStudyFileList, {
direction: this.Asc ? 'asc' : 'desc',
key: 'FileName'
})
}
})
},
@ -243,6 +248,9 @@ export default {
// this.$alert('PM')
}
this.loading = false
if (this.CriterionType === 19 || this.CriterionType === 20) {
this.sortFile()
}
}).catch(() => { this.loading = false })
},
selected(file, studyIndex, fileIndex, isChangeSub = false) {