update export method
This commit is contained in:
+20
-16
@@ -54,9 +54,11 @@ class BcmTool
|
||||
{
|
||||
const lstAttributes = [...this.attributes];
|
||||
const form = new Form();
|
||||
form.SetCell(0, 0, "姓名");
|
||||
form.SetCell(0, 1, "球队");
|
||||
for (let i = 0; i != lstAttributes.length; ++i)
|
||||
{
|
||||
form.SetCell(i + 1, 0, lstAttributes[i][0] as string);
|
||||
form.SetCell(0, i + 2, lstAttributes[i][0] as string);
|
||||
}
|
||||
for (let i = 0; i != playersToQuery.length; ++i)
|
||||
{
|
||||
@@ -66,11 +68,12 @@ class BcmTool
|
||||
console.log('找不到id', playerId);
|
||||
continue;
|
||||
}
|
||||
form.SetCell(0, i + 1, this.QueryName(playerId));
|
||||
form.SetCell(i + 1, 0, this.QueryName(playerId));
|
||||
form.SetCell(i + 1, 1, this.QueryOwner(playerId));
|
||||
for (let j = 0; j != lstAttributes.length; ++j)
|
||||
{
|
||||
const record = this.QueryInfo(playerId, lstAttributes[j][1] as number);
|
||||
form.SetCell(j + 1, i + 1, record.toString());
|
||||
form.SetCell(i + 2, j + 1, record.toString());
|
||||
}
|
||||
}
|
||||
console.log(form);
|
||||
@@ -157,18 +160,19 @@ class BcmTool
|
||||
results.push(info);
|
||||
}
|
||||
}
|
||||
const displays = new Set<number>(requireAttributes);
|
||||
for (const result of results)
|
||||
{
|
||||
const displayStr = [...displays].map(e =>
|
||||
{
|
||||
const idx = requireAttributes.indexOf(e);
|
||||
const search = requireSearch[idx];
|
||||
const value = this.QueryInfo(result.playerId, requireAttributes[idx]);
|
||||
return `${search}:${value}`;
|
||||
});
|
||||
console.log(`${result.playerName}(${this.QueryOwner(result.playerId)})`, ...displayStr);
|
||||
}
|
||||
// const displays = new Set<number>(requireAttributes);
|
||||
// for (const result of results)
|
||||
// {
|
||||
// const displayStr = [...displays].map(e =>
|
||||
// {
|
||||
// const idx = requireAttributes.indexOf(e);
|
||||
// const search = requireSearch[idx];
|
||||
// const value = this.QueryInfo(result.playerId, requireAttributes[idx]);
|
||||
// return `${search}:${value}`;
|
||||
// });
|
||||
// console.log(`${result.playerName}(${this.QueryOwner(result.playerId)})`, ...displayStr);
|
||||
// }
|
||||
this.ExportPlayerInfo(results.map(e => e.playerId));
|
||||
}
|
||||
|
||||
private OpenPlayerInTransaction(teamId: string, playerId: string)
|
||||
@@ -202,7 +206,7 @@ class BcmTool
|
||||
public QueryInfo(playerId: string, attri: number)
|
||||
{
|
||||
const data = this.mgrPlayers.GetPlayerData(playerId);
|
||||
return data?.GetSingleAttribute(attri);
|
||||
return data?.GetSingleAttribute(attri, true);
|
||||
}
|
||||
|
||||
public QueryOwner(playerId: string)
|
||||
|
||||
Reference in New Issue
Block a user