|
@@ -148,23 +148,27 @@ watch(
|
|
{ deep: true }
|
|
{ deep: true }
|
|
);
|
|
);
|
|
|
|
|
|
-const colors = ["red", "blue", "gray"];
|
|
|
|
|
|
+const colors = ["red", "blue", "green"];
|
|
let colorMap = {};
|
|
let colorMap = {};
|
|
-function addTrackColorAttr(tList: Track[]): Track[] {
|
|
|
|
|
|
+function addTrackColorAttr(tList: Track[], groupNumber: number): Track[] {
|
|
let userIds: (number | undefined)[] = tList
|
|
let userIds: (number | undefined)[] = tList
|
|
- .map((v) => v.userId + "")
|
|
|
|
|
|
+ .map((v) => v.userId)
|
|
.filter((x) => !!x);
|
|
.filter((x) => !!x);
|
|
userIds = Array.from(new Set(userIds));
|
|
userIds = Array.from(new Set(userIds));
|
|
-
|
|
|
|
- let userNo = Object.keys(colorMap).length;
|
|
|
|
- userIds.forEach((mid) => {
|
|
|
|
- // 双评的时候保证同一个人的轨迹颜色是一致的
|
|
|
|
- colorMap[mid] = colorMap[mid] || colors[userNo] || "gray";
|
|
|
|
- });
|
|
|
|
- const isByMultMark = Object.keys(colorMap).length > 1;
|
|
|
|
|
|
+ const isByMultMark = userIds.length > 1;
|
|
|
|
|
|
tList = tList.map((item) => {
|
|
tList = tList.map((item) => {
|
|
- item.color = colorMap[item.userId] || "gray";
|
|
|
|
|
|
+ const uid = item.userId;
|
|
|
|
+ if (item.headerMarkScore) {
|
|
|
|
+ item.color = "green";
|
|
|
|
+ } else {
|
|
|
|
+ if (!colorMap[groupNumber]) colorMap[groupNumber] = {};
|
|
|
|
+ if (!colorMap[groupNumber][uid]) {
|
|
|
|
+ colorMap[groupNumber][uid] =
|
|
|
|
+ colors[Object.keys(colorMap[groupNumber]).length] || "green";
|
|
|
|
+ }
|
|
|
|
+ item.color = colorMap[groupNumber][uid];
|
|
|
|
+ }
|
|
item.isByMultMark = isByMultMark;
|
|
item.isByMultMark = isByMultMark;
|
|
return item;
|
|
return item;
|
|
});
|
|
});
|
|
@@ -173,6 +177,7 @@ function addTrackColorAttr(tList: Track[]): Track[] {
|
|
|
|
|
|
async function processImage() {
|
|
async function processImage() {
|
|
if (!store.currentTask) return;
|
|
if (!store.currentTask) return;
|
|
|
|
+ colorMap = {};
|
|
const images = [];
|
|
const images = [];
|
|
const urls = store.currentTask.sheetUrls || [];
|
|
const urls = store.currentTask.sheetUrls || [];
|
|
for (const url of urls) {
|
|
for (const url of urls) {
|
|
@@ -185,7 +190,7 @@ async function processImage() {
|
|
sliceImagesWithTrackList.splice(0);
|
|
sliceImagesWithTrackList.splice(0);
|
|
|
|
|
|
let trackLists = store.currentTask.questionList
|
|
let trackLists = store.currentTask.questionList
|
|
- .map((q) => addTrackColorAttr(q.trackList))
|
|
|
|
|
|
+ .map((q) => addTrackColorAttr(q.trackList, q.groupNumber))
|
|
.flat();
|
|
.flat();
|
|
let tagLists = store.currentTask.specialTagList ?? [];
|
|
let tagLists = store.currentTask.specialTagList ?? [];
|
|
tagLists = addTrackColorAttr(tagLists);
|
|
tagLists = addTrackColorAttr(tagLists);
|