|
@@ -1,5 +1,5 @@
|
|
|
import config from '@config/index.js';
|
|
|
-import {formatContinueDots,getLabelIndex,handleLocalDelTag,checkFullfillText,shiftLocalDelTag,getLifeLabels,getValuedLabels,removeRepeat} from '@utils/tools.js';
|
|
|
+import {formatContinueDots,getLabelIndex,handleLocalDelTag,checkFullfillText,shiftLocalDelTag,getLifeLabels,getValuedLabels,removeRepeat,getIds} from '@utils/tools.js';
|
|
|
|
|
|
export function preSetCheckbody(state,action) {
|
|
|
let res = Object.assign({},state);
|
|
@@ -345,7 +345,11 @@ export function reflashLabels(state,action) {
|
|
|
const oldValuedLabels = getValuedLabels(res.data); //旧已填值标签
|
|
|
const lifeLabels = removeRepeat(newLifeLabels,oldLifeLabels); //将被保留的生命体征标签
|
|
|
const newUnlifeLabels = getLifeLabels(action.data,true); //新非生命体征标签
|
|
|
- const addTextsArr = checkFullfillText([...lifeLabels,...oldValuedLabels,...newUnlifeLabels]);
|
|
|
+ const ids = getIds(oldValuedLabels);
|
|
|
+ const stayUnlifeLabels = newUnlifeLabels.filter((it)=>{ //已填值的相同标签已被移到上面,这里去重
|
|
|
+ return !ids.includes(it.id);
|
|
|
+ });
|
|
|
+ const addTextsArr = checkFullfillText([...lifeLabels,...oldValuedLabels,...stayUnlifeLabels]);
|
|
|
res.data = addTextsArr.newArr;
|
|
|
res.saveText = addTextsArr.saveText;
|
|
|
res.update = Math.random();
|