fix: 修复Result Display中数据顺序不固定的问题
This commit is contained in:
parent
1abbfbb36a
commit
5177f85677
|
@ -46,6 +46,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { cloneDeep } from 'lodash'
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: 'Flag',
|
title: 'Flag',
|
||||||
|
@ -94,6 +96,8 @@ const columns = [
|
||||||
width: 34,
|
width: 34,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const sortList = ['Xe131m', 'Xe133', 'Xe133m', 'Xe135']
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
data: {
|
data: {
|
||||||
|
@ -121,7 +125,8 @@ export default {
|
||||||
data: {
|
data: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val && Array.isArray(val)) {
|
if (val && Array.isArray(val)) {
|
||||||
val.forEach((item) => {
|
const list = cloneDeep(val)
|
||||||
|
list.forEach((item) => {
|
||||||
if (item.conc < 0) {
|
if (item.conc < 0) {
|
||||||
item.className = 'error'
|
item.className = 'error'
|
||||||
} else if (item.conc > 0 && item.conc < item.mdc) {
|
} else if (item.conc > 0 && item.conc < item.mdc) {
|
||||||
|
@ -130,8 +135,15 @@ export default {
|
||||||
item.className = 'success'
|
item.className = 'success'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.source1 = val.slice(0, 2)
|
|
||||||
this.source2 = val.slice(2, 4)
|
list.sort((a, b) => {
|
||||||
|
const index1 = sortList.indexOf(a.nuclideName)
|
||||||
|
const index2 = sortList.indexOf(b.nuclideName)
|
||||||
|
return index1 - index2
|
||||||
|
})
|
||||||
|
|
||||||
|
this.source1 = list.slice(0, 2)
|
||||||
|
this.source2 = list.slice(2, 4)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user