
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
@codernote/plan-hours
Advanced tools
计划软件右侧hours
npm install @codernote/plan-hours
// 组件使用示例
<template>
<PlanHours
ref="hoursPanel"
:day="hoursFocusIdx"
:data="tempInfo"
:show="showHours"
:dragTaskInfo="dragTaskInfo"
:isDragBlockMove="isDragBlockMove"
:dragOverConfig="dragOverConfig"
:importType="1"
@hide="handleHideHours"
@moveAreaChange="moveAreaChange"
@changeTaskInfo="changeTaskInfo"
/>
</template>
<script>
import {
PlanHours, // 组件
dragTaskMixin, // mixin
hoursConstant, // 常量
} from "@codernote/record-list";
export default {
components: {
HoursPanel,
},
mixins: [
dragTaskMixin
],
data() {
return {
showHours: false,
tempInfo: {}, // 所有已经安排的任务:{hoursFocusIdx: {level1:[任务], level2:[任务], level3:[任务]}}
hoursFocusIdx: -1, // 任务所属时间天数
goalTable: {
goalMap: new Map(), // 储存所有项目的微观任务{hoursFocusIdx:{任务所属项目Id:任务}} (只有level1和level2任务)
hoursInfo: { // 所有已经安排的任务:{hoursFocusIdx: {level1:[任务], level2:[任务], level3:[任务]}}
},
}
}
},
mounted() {
// 初始化测试数据
this.initData()
},
methods: {
initData() {
this.hoursFocusIdx = 13538
this.goalTable = {
goalMap: {
13538: { // key为当前天数
'1705142510832': { // key为任务所属项目Id
bold: 1, // 非0 即是level1
finish: 0, // 非0 即是完成
desc: 'level1--111', // 内容
idx: 13538,
item_id: '1705142510832',
isAssigned: 1, // 是否被安排
assignStartTime: '', // 所安排的开始时间
assignEndTime: '', // 所安排的结束时间
created_at: 1706334306212,
type: MEASURE_ENUM.day, // 尺度枚举(同步下标)
},
'1705142510831': { // key为任务所属项目Id
bold: 0, // 非0 即是level1
finish: 0, // 非0 即是完成
desc: 'level2--222', // 内容
idx: 13538,
item_id: '1705142510831',
isAssigned: 0, // 是否被安排
assignStartTime: '', // 所安排的开始时间
assignEndTime: '', // 所安排的结束时间
created_at: 1706334306212,
type: MEASURE_ENUM.day, // 尺度枚举(同步下标)
}
}
},
hoursInfo: {
13538: {
level1: [
{
"bold": 1,
"finish": 0,
"desc": "level1--111",
"idx": 13538,
"item_id": "1705142510832",
"isAssigned": 1,
"assignStartTime": "8:59",
"assignEndTime": "9:59",
"type": 6,
"level": "level1",
created_at: 1706334306212,
"height": 45.470588235294116,
"top": 90.26470588235294
}
],
level2: [],
level3: [
{
assignEndTime: "11:31",
assignStartTime: "10:31",
desc: "level3-test",
finish: 0,
height: 45.470588235294116,
idx: 13538,
inputFocus: false,
isAssigned: 1,
item_id: "1706406040037",
created_at: 1706334306212,
level: "level3",
top: 160,
}
],
}
}
}
this.tempInfo = this.goalTable.hoursInfo[this.hoursFocusIdx]
},
/**
* 任务状态变更
* @param {Number} type 任务类型 1:添加 2:修改 3:取消
* @param {Object} item 任务详情
* @param {String} level 任务等级 level1/level2/level3
*/
taskStatusChange(type, item = {}, level = '') {
switch(type) {
case hoursConstant.ARRANGE_TASK_TYPE.add:
console.log('添加')
break;
case hoursConstant.ARRANGE_TASK_TYPE.update:
console.log('修改')
break;
case hoursConstant.ARRANGE_TASK_TYPE.del:
console.log('删除')
break;
}
}
}
}
</script>
<PlanHours
{/* 必需,写死,mixins调用 */}
ref="hoursPanel"
{/* 必需,任务所属天数 */}
:day="noteList"
{/* 必需,所有已经安排的任务:{hoursFocusIdx: {level1:[任务], level2:[任务], level3:[任务]}} */}
:data="activeNote"
{/* 是否显示当前组件,默认false */}
:show="true"
{/* 必需,引入mixins后,写死 */}
:dragTaskInfo="dragTaskInfo"
{/* 必需,引入mixins后,写死 */}
:isDragBlockMove="isDragBlockMove"
{/* 必需,引入mixins后,写死 */}
:dragOverConfig="dragOverConfig"
{/* 选传,引入端类型, 1: electron 2、H5; 默认为1 */}
:importType="1"
{/* 事件:关闭窗口 */}
@hide="handleHideHours"
{/* 必需,引入mixins后,写死 */}
@moveAreaChange="moveAreaChange"
{/* 必需,引入mixins后,写死 */}
@changeTaskInfo="changeTaskInfo"
/>
npm publish
FAQs
计划软件右侧hours
The npm package @codernote/plan-hours receives a total of 61 weekly downloads. As such, @codernote/plan-hours popularity was classified as not popular.
We found that @codernote/plan-hours demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.