misc
This commit is contained in:
parent
9ca41cb629
commit
297cc5e07d
8
app.js
8
app.js
@ -35,6 +35,7 @@ const Work = DB({
|
||||
return ["", workObj];
|
||||
}
|
||||
});
|
||||
|
||||
/**@type {(work:WorkData)=>void} */
|
||||
const WorkMake =(work)=>
|
||||
{
|
||||
@ -46,10 +47,10 @@ const WorkMake =(work)=>
|
||||
part.make.forEach(itr);
|
||||
};
|
||||
|
||||
|
||||
/** @typedef {"all"|"one"} DeskMode*/
|
||||
/** @typedef {[need:Record<string, number>, make:string[], ...role:string[]]} DeskJSON */
|
||||
/** @typedef {{name:string, mode:DeskMode, need:Record<string, number>, make:string[], role:string[]}} DeskData */
|
||||
|
||||
/** @type {(desk:DeskData)=>[dirtyNeed:string[], dirtyMake:string[]]} */
|
||||
const Scan =(desk)=>
|
||||
{
|
||||
@ -93,14 +94,15 @@ const Scan =(desk)=>
|
||||
console.log("scan", dirtyNeed, dirtyMake);
|
||||
return [dirtyNeed, dirtyMake];
|
||||
};
|
||||
|
||||
const Desk = DB({
|
||||
path:"./db_desk.csv",
|
||||
cols:4,
|
||||
load(_i, id, name, /** @type {DeskMode}*/mode, data)
|
||||
load(_i, id, name, mode, data)
|
||||
{
|
||||
/**@type {DeskJSON} */
|
||||
const [need, make, ...role] = JSON.parse(data);
|
||||
const deskObj = { name, mode, need, make, role };
|
||||
const deskObj = { name, mode:/**@type{DeskMode}*/(mode), need, make, role };
|
||||
|
||||
make.forEach(partId=>Part.find(partId).make.push(id));
|
||||
Object.keys(need).forEach(partId=>Part.find(partId).need.push(id));
|
||||
|
||||
@ -1 +1 @@
|
||||
d1,Desk One,all,[{"p1":1, "p2":1},["p3"],"r1"]
|
||||
d1,Desk One,all,[{"p1":1, "p2":1, "p4":0},["p3"],"r1"]
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 1 and column 19.
|
@ -1,3 +1,4 @@
|
||||
p1,Part 1
|
||||
p2,Part 2
|
||||
p3,Part 3
|
||||
p4,Part Empty
|
||||
|
||||
|
1
db_pass.csv
Normal file
1
db_pass.csv
Normal file
@ -0,0 +1 @@
|
||||
August 2025,./db_part.csv,./db_work.csv,./db_desk.csv
|
||||
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"p1":{
|
||||
"u1":{
|
||||
"1":{"key1": "value1", "key2": "value2"}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user