项目任务

No data found.

项目待办列表

关联待办

// 链接到当前文件的链接正则表达式
const regex = new RegExp(`\\[\\[${dv.current().file.name}(\\|.*)?\\]\\]`);
dv.taskList(
    // 当前文件待办
    dv.current().file.tasks.concat(
    // 其它文件引用到当前文件的待办
    dv.pages()
        .where(p => p.file.outlinks.some(link => link.path === dv.current().file.path))
        .file.tasks
        .where(t => regex.test(t.text))))

任务待办

const name = dv.current().file.name;
const taskFiles = dv.pages()
        .where(p => {
        const taksProjMatch = p.file.frontmatter['para-project']?.includes(name)
        return taksProjMatch;
        }).file.name;
const tasksJson = JSON.stringify(taskFiles.values);
console.log('name', name, taskFiles,tasksJson);
 
dv.span('**任务待办**');
dv.span(`\`\`\`tasks
filter by function \
const projs = task.file.frontmatter['para-project']; \
return Array.isArray(projs) ? projs.some(item => item.includes("${name}"))  : projs?.includes("${name}") ?? false
\`\`\``);
 
dv.span('**任务关联待办**');
dv.span(`\`\`\`tasks
filter by function \
const outlinks = task.outlinks; \
outlinks.length && console.log('debug1', outlinks, task); \
outlinks.some(link => link.pathContainingLink.includes("20251104023556")) && console.log('debug2', outlinks); \
return  outlinks.some(link => ${tasksJson}.includes(link.rawLink.link))
\`\`\``);