npmapps 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/files/part-002 +4 -0
- package/get.js +193 -0
- package/manifest.json +28 -0
- package/package.json +17 -10
- package/PUBLISH.md +0 -268
- package/app/wujie-wk/t.html +0 -90
- package/app/wujie-wk/wujie-vue2-child/.eslintrc.js +0 -19
- package/app/wujie-wk/wujie-vue2-child/README.md +0 -24
- package/app/wujie-wk/wujie-vue2-child/babel.config.js +0 -5
- package/app/wujie-wk/wujie-vue2-child/docs/superpowers/plans/2026-05-29-quill-editor.md +0 -836
- package/app/wujie-wk/wujie-vue2-child/docs/superpowers/specs/2026-05-29-quill-editor-design.md +0 -210
- package/app/wujie-wk/wujie-vue2-child/jsconfig.json +0 -19
- package/app/wujie-wk/wujie-vue2-child/package-lock.json +0 -21333
- package/app/wujie-wk/wujie-vue2-child/package.json +0 -63
- package/app/wujie-wk/wujie-vue2-child/postcss.config.js +0 -10
- package/app/wujie-wk/wujie-vue2-child/public/favicon.ico +0 -0
- package/app/wujie-wk/wujie-vue2-child/public/index.html +0 -17
- package/app/wujie-wk/wujie-vue2-child/public/rili.jpg +0 -0
- package/app/wujie-wk/wujie-vue2-child/public//344/270/200/351/224/256/351/273/221/346/232/227.html +0 -136
- package/app/wujie-wk/wujie-vue2-child/src/App.vue +0 -110
- package/app/wujie-wk/wujie-vue2-child/src/assets/bpmn-camunda.jpg +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/css/diagram.less +0 -17
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/Icon.less +0 -31
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app-codes.css +0 -26
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.eot +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.svg +0 -60
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.ttf +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.woff +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.woff2 +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/config.json +0 -248
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-bottom-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +0 -85
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-left-tool.svg +0 -84
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-right-tool.svg +0 -80
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-top-tool.svg +0 -84
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +0 -89
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +0 -95
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +0 -99
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/set-color-tool.svg +0 -111
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-bottom-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-left-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-right-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-top-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +0 -30
- package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/set-color-tool.svg +0 -63
- package/app/wujie-wk/wujie-vue2-child/src/assets/logo.png +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/README.md +0 -70
- package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/article.md +0 -184
- package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/index.js +0 -213
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/CalendarSkeleton.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/CodeBlock.vue +0 -199
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/MonthSelect.vue +0 -376
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/README.md +0 -485
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/example.vue +0 -1747
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/index.vue +0 -2720
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/mockData.js +0 -475
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/recruitmentAdapter.js +0 -51
- package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/utils.js +0 -202
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/FunctionSelector.vue +0 -123
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/OperatorSelector.vue +0 -184
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/ParameterSelector.vue +0 -123
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/api.js +0 -69
- package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/index.vue +0 -435
- package/app/wujie-wk/wujie-vue2-child/src/components/HelloWorld.vue +0 -58
- package/app/wujie-wk/wujie-vue2-child/src/components/PageHeader/index.vue +0 -158
- package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/README.md +0 -144
- package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/example.vue +0 -84
- package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/index.vue +0 -203
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/ToolBar.vue +0 -357
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/customTranslate/customTranslate.js +0 -12
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/customTranslate/translationsGerman.js +0 -241
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/index.vue +0 -261
- package/app/wujie-wk/wujie-vue2-child/src/components/diagram/xmlData.js +0 -29
- package/app/wujie-wk/wujie-vue2-child/src/directives/filldown.js +0 -155
- package/app/wujie-wk/wujie-vue2-child/src/directives/filldownTable.js +0 -291
- package/app/wujie-wk/wujie-vue2-child/src/main.js +0 -40
- package/app/wujie-wk/wujie-vue2-child/src/router/index.js +0 -72
- package/app/wujie-wk/wujie-vue2-child/src/store/index.js +0 -23
- package/app/wujie-wk/wujie-vue2-child/src/utils/winBox.js +0 -23
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/A.vue +0 -12
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/B.vue +0 -10
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/MagicalComponentsForELFormItem.vue +0 -78
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/index.vue +0 -59
- package/app/wujie-wk/wujie-vue2-child/src/views/Extend/tableMouseHorizontalWheel.vue +0 -184
- package/app/wujie-wk/wujie-vue2-child/src/views/Home.vue +0 -27
- package/app/wujie-wk/wujie-vue2-child/src/views/RouterJump.vue +0 -145
- package/app/wujie-wk/wujie-vue2-child/src/views/calendar/index.vue +0 -19
- package/app/wujie-wk/wujie-vue2-child/src/views/css.vue +0 -57
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/EllipsisText.vue +0 -73
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/HoverCard.vue +0 -69
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/TableHover.vue +0 -130
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/inputSlo.vue +0 -42
- package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/tableFixed.vue +0 -148
- package/app/wujie-wk/wujie-vue2-child/src/views/echarts/echart-dome.vue +0 -73
- package/app/wujie-wk/wujie-vue2-child/src/views/echarts/index.vue +0 -118
- package/app/wujie-wk/wujie-vue2-child/src/views/echarts/pei3d.vue +0 -658
- package/app/wujie-wk/wujie-vue2-child/src/views/element/bpmn/index.vue +0 -15
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendanceCycle/index.vue +0 -131
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendanceGroup/index.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendancePersonnel/index.vue +0 -158
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/companyCalendar/index.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/shift/index.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/views/element/components/shiftRotationSystem/index.vue +0 -147
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/columnManagement.vue +0 -340
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/dialogInput.vue +0 -71
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/elTableJsx.vue +0 -1826
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/formTable.vue +0 -595
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/index.vue +0 -29
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/simpleTable.vue +0 -189
- package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx.zip +0 -0
- package/app/wujie-wk/wujie-vue2-child/src/views/element/index.vue +0 -39
- package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/README.md +0 -163
- package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/example.vue +0 -307
- package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/index.vue +0 -409
- package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/toolbar.js +0 -122
- package/app/wujie-wk/wujie-vue2-child/vue.config.js +0 -15
|
@@ -1,475 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EventCalendar 模拟数据
|
|
3
|
-
* ------------------------------------------------------------------
|
|
4
|
-
* 用 setTimeout 模拟后端异步接口,便于演示「骨架屏 -> 真实数据」的过程。
|
|
5
|
-
* 真实接入时把 fetchXxx 换成自己的 request 即可,组件本身不关心数据来源。
|
|
6
|
-
*
|
|
7
|
-
* 注意:这里的字段名是「默认字段名」,若后端字段不同,
|
|
8
|
-
* 不需要改数据,只需给组件传 field-names(见 ALT_* 相关导出)。
|
|
9
|
-
* NodeQ 形状的原始响应见文件下方的 NODEQ_MOCK_RESPONSE,配合
|
|
10
|
-
* recruitmentAdapter.js 使用。
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/* -------------------------------------------------------------------------- */
|
|
14
|
-
/* 基础素材 */
|
|
15
|
-
/* -------------------------------------------------------------------------- */
|
|
16
|
-
|
|
17
|
-
/** 学校名池(取自设计图) */
|
|
18
|
-
const SCHOOLS = [
|
|
19
|
-
'香港中文大学(深圳)', '南方科技大学', '哈尔滨工业大学(深圳)',
|
|
20
|
-
'电子科技大学', '北京邮电大学', '厦门大学',
|
|
21
|
-
'四川大学', '中央财经大学', '东南大学',
|
|
22
|
-
'南京审计大学', '北京理工大学', '西南财经大学',
|
|
23
|
-
'中国人民大学', '南京大学', '武汉大学',
|
|
24
|
-
'华中科技大学', '复旦大学', '对外经济贸易大学', '北京师范大学',
|
|
25
|
-
'上海财经大学', '中南财经政法大学', '北京大学',
|
|
26
|
-
'华东师范大学', '清华大学', '西北工业大学', '南开大学',
|
|
27
|
-
'上海交通大学', '天津大学', '西安交通大学',
|
|
28
|
-
'浙江大学', '同济大学', '大连理工大学',
|
|
29
|
-
'中国科学技术大学', '吉林大学', '华南理工大学',
|
|
30
|
-
'中南大学', '山东大学', '重庆大学', '湖南大学', '兰州大学'
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
/** 条目类型(角标文案 + 类型标识,类型用于组件内 typeColors 配色) */
|
|
34
|
-
const EVENT_TYPES = [
|
|
35
|
-
{ badge: '宣讲', type: 'talk' },
|
|
36
|
-
{ badge: '双选', type: 'fair' },
|
|
37
|
-
{ badge: '直播', type: 'live' },
|
|
38
|
-
{ badge: '笔试', type: 'exam' }
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 线性同余伪随机数生成器
|
|
43
|
-
* ------------------------------------------------------------------
|
|
44
|
-
* 不用 Math.random 是为了让每次刷新拿到的模拟数据都一致,
|
|
45
|
-
* 这样调试样式 / 截图对比时不会因为数据抖动而困扰。
|
|
46
|
-
*/
|
|
47
|
-
function createRandom(seed) {
|
|
48
|
-
let s = seed >>> 0
|
|
49
|
-
return function random() {
|
|
50
|
-
s = (s * 1664525 + 1013904223) >>> 0
|
|
51
|
-
return s / 4294967296
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function pad2(n) {
|
|
56
|
-
return n < 10 ? '0' + n : String(n)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* 生成某个月的日期数据
|
|
61
|
-
* @param {String} monthKey '2026-09'
|
|
62
|
-
* @param {Object} options
|
|
63
|
-
* @param {Number} options.seed 随机种子
|
|
64
|
-
* @param {Number} options.maxItems 单日最多条目数
|
|
65
|
-
* @param {Number} options.density 有数据的日期占比 0~1
|
|
66
|
-
* @param {Boolean} options.skipWeekend 周末是否基本不排期(贴近真实业务)
|
|
67
|
-
*/
|
|
68
|
-
function createMonthDays(monthKey, options = {}) {
|
|
69
|
-
const { seed = 20260907, maxItems = 6, density = 0.62, skipWeekend = true } = options
|
|
70
|
-
const random = createRandom(seed)
|
|
71
|
-
|
|
72
|
-
const [year, month] = monthKey.split('-').map(Number)
|
|
73
|
-
const daysInMonth = new Date(year, month, 0).getDate()
|
|
74
|
-
|
|
75
|
-
const days = []
|
|
76
|
-
let uid = 0
|
|
77
|
-
|
|
78
|
-
for (let day = 1; day <= daysInMonth; day++) {
|
|
79
|
-
const date = new Date(year, month - 1, day)
|
|
80
|
-
const isWeekend = date.getDay() === 0 || date.getDay() === 6
|
|
81
|
-
|
|
82
|
-
// 周末排期概率大幅降低
|
|
83
|
-
const hit = random() < (skipWeekend && isWeekend ? density * 0.12 : density)
|
|
84
|
-
if (!hit) continue
|
|
85
|
-
|
|
86
|
-
// 单日条目数 1 ~ maxItems,故意让少数几天超过 4 条以演示滚动条
|
|
87
|
-
const count = 1 + Math.floor(random() * maxItems)
|
|
88
|
-
|
|
89
|
-
const items = []
|
|
90
|
-
for (let i = 0; i < count; i++) {
|
|
91
|
-
const school = SCHOOLS[Math.floor(random() * SCHOOLS.length)]
|
|
92
|
-
const evt = EVENT_TYPES[Math.floor(random() * EVENT_TYPES.length)]
|
|
93
|
-
items.push({
|
|
94
|
-
id: `${monthKey}-${day}-${uid++}`,
|
|
95
|
-
label: school,
|
|
96
|
-
badge: evt.badge,
|
|
97
|
-
type: evt.type,
|
|
98
|
-
// 冗余字段:演示插槽里可以拿到完整原始对象
|
|
99
|
-
address: `${school}就业指导中心`,
|
|
100
|
-
startTime: `${pad2(9 + (i % 8))}:30`
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
days.push({
|
|
105
|
-
date: `${monthKey}-${pad2(day)}`,
|
|
106
|
-
items
|
|
107
|
-
})
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return days
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/** 统一的异步包装:delay 毫秒后 resolve,模拟网络请求 */
|
|
114
|
-
function delayResolve(payload, delay) {
|
|
115
|
-
return new Promise((resolve) => {
|
|
116
|
-
setTimeout(() => resolve(payload), delay)
|
|
117
|
-
})
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* -------------------------------------------------------------------------- */
|
|
121
|
-
/* 默认字段名接口 */
|
|
122
|
-
/* -------------------------------------------------------------------------- */
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 拉取宣讲日历数据(默认字段名,组件开箱即用)
|
|
126
|
-
*
|
|
127
|
-
* @param {Object} options
|
|
128
|
-
* @param {Array} options.months 要生成的月份,默认 2026 年 9/10/11 月
|
|
129
|
-
* @param {Number} options.delay 模拟网络耗时(ms),默认 1500
|
|
130
|
-
* @returns {Promise<Array>} [{ month, monthLabel, days: [{ date, items: [] }] }]
|
|
131
|
-
*/
|
|
132
|
-
export function fetchCalendarData(options = {}) {
|
|
133
|
-
const {
|
|
134
|
-
months = ['2026-09', '2026-10', '2026-11'],
|
|
135
|
-
delay = 1500,
|
|
136
|
-
maxItems = 6,
|
|
137
|
-
density = 0.62
|
|
138
|
-
} = options
|
|
139
|
-
|
|
140
|
-
const data = months.map((monthKey, index) => {
|
|
141
|
-
const [year, month] = monthKey.split('-').map(Number)
|
|
142
|
-
return {
|
|
143
|
-
month: monthKey,
|
|
144
|
-
monthLabel: `${year}年${month}月`,
|
|
145
|
-
days: createMonthDays(monthKey, {
|
|
146
|
-
seed: year * 100 + month + index * 7,
|
|
147
|
-
maxItems,
|
|
148
|
-
density
|
|
149
|
-
})
|
|
150
|
-
}
|
|
151
|
-
})
|
|
152
|
-
|
|
153
|
-
return delayResolve(data, delay)
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* 跨年数据:2025-12 / 2026-01 / 2026-02
|
|
158
|
-
* ------------------------------------------------------------------
|
|
159
|
-
* 专门用于验证需求里点名的边界情况:
|
|
160
|
-
* - 1 月要往前补 2025 年 12 月的日期;
|
|
161
|
-
* - 2 月只有 28 天(2026 非闰年),末尾要补 3 月;
|
|
162
|
-
* - 12 月要往后补 2026 年 1 月。
|
|
163
|
-
*/
|
|
164
|
-
export function fetchCrossYearData(options = {}) {
|
|
165
|
-
const { delay = 1200 } = options
|
|
166
|
-
return fetchCalendarData({
|
|
167
|
-
months: ['2025-12', '2026-01', '2026-02'],
|
|
168
|
-
delay,
|
|
169
|
-
density: 0.55
|
|
170
|
-
})
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/** 空数据(演示空状态) */
|
|
174
|
-
export function fetchEmptyData(options = {}) {
|
|
175
|
-
const { delay = 900, months = ['2026-09'] } = options
|
|
176
|
-
const data = months.map((monthKey) => ({
|
|
177
|
-
month: monthKey,
|
|
178
|
-
monthLabel: monthKey,
|
|
179
|
-
days: []
|
|
180
|
-
}))
|
|
181
|
-
return delayResolve(data, delay)
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/* -------------------------------------------------------------------------- */
|
|
185
|
-
/* NodeQ 后端形状模拟数据 */
|
|
186
|
-
/* -------------------------------------------------------------------------- */
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* NodeQ 形状的模拟响应。
|
|
190
|
-
*
|
|
191
|
-
* 默认生成 2026-09 / 2026-10 / 2026-11 三个月,每个月 14 个有数据的日期,
|
|
192
|
-
* 每个日期固定 3~5 条记录。字段刻意使用截图中的
|
|
193
|
-
* `nbcbRecAnnJourneyMaps / publicityDate / publicityPlace`;额外加入独立的
|
|
194
|
-
* `publicityAddress` 字段,用来模拟本次新增的地址参数。
|
|
195
|
-
*/
|
|
196
|
-
const NODEQ_SCHOOLS = [
|
|
197
|
-
'大连理工大学', '北京大学深圳研究生院', '香港中文大学(深圳)',
|
|
198
|
-
'哈尔滨工业大学(深圳)', '南方科技大学', '电子科技大学',
|
|
199
|
-
'北京邮电大学', '华南理工大学', '中国人民大学', '西安交通大学',
|
|
200
|
-
'中南财经政法大学', '南京大学', '上海交通大学', '浙江大学',
|
|
201
|
-
'西北工业大学', '厦门大学', '武汉大学', '同济大学'
|
|
202
|
-
]
|
|
203
|
-
|
|
204
|
-
const NODEQ_CITIES = [
|
|
205
|
-
'北京市海淀区学院路', '上海市杨浦区四平路', '广东省深圳市南山区',
|
|
206
|
-
'江苏省南京市鼓楼区', '辽宁省大连市甘井子区', '四川省成都市高新区'
|
|
207
|
-
]
|
|
208
|
-
|
|
209
|
-
const NODEQ_ORGS = [
|
|
210
|
-
'总行、北京分行、上海分行',
|
|
211
|
-
'总行、深圳分行、广州分行',
|
|
212
|
-
'总行、南京分行、杭州分行',
|
|
213
|
-
'总行、成都分行、大连分行'
|
|
214
|
-
]
|
|
215
|
-
|
|
216
|
-
export function createNodeqMockResponse(options = {}) {
|
|
217
|
-
const {
|
|
218
|
-
months = ['2026-09', '2026-10', '2026-11'],
|
|
219
|
-
daysPerMonth = 14,
|
|
220
|
-
minItems = 3,
|
|
221
|
-
maxItems = 5,
|
|
222
|
-
includeBadge = false,
|
|
223
|
-
seed = 20260904
|
|
224
|
-
} = options
|
|
225
|
-
|
|
226
|
-
const journeyMaps = {}
|
|
227
|
-
|
|
228
|
-
months.forEach((monthKey, monthIndex) => {
|
|
229
|
-
const [year, month] = monthKey.split('-').map(Number)
|
|
230
|
-
const daysInMonth = new Date(year, month, 0).getDate()
|
|
231
|
-
const random = createRandom(seed + monthIndex * 97)
|
|
232
|
-
const wantedDays = Math.min(Math.max(10, Number(daysPerMonth) || 14), daysInMonth)
|
|
233
|
-
const dayNumbers = []
|
|
234
|
-
|
|
235
|
-
// 交错选取日期,让每个月都有「十几天」且分布不挤在一起。
|
|
236
|
-
for (let day = 1; day <= daysInMonth && dayNumbers.length < wantedDays; day++) {
|
|
237
|
-
if ((day + monthIndex) % 2 === 0) dayNumbers.push(day)
|
|
238
|
-
}
|
|
239
|
-
// 极短月份的兜底(默认月份不会走到这里)。
|
|
240
|
-
for (let day = 1; day <= daysInMonth && dayNumbers.length < wantedDays; day++) {
|
|
241
|
-
if (!dayNumbers.includes(day)) dayNumbers.push(day)
|
|
242
|
-
}
|
|
243
|
-
dayNumbers.sort((a, b) => a - b)
|
|
244
|
-
|
|
245
|
-
dayNumbers.forEach((day) => {
|
|
246
|
-
const dateKey = `${monthKey}-${pad2(day)}`
|
|
247
|
-
const range = Math.max(0, Number(maxItems) - Number(minItems) + 1)
|
|
248
|
-
const count = Number(minItems) + (range > 0 ? Math.floor(random() * range) : 0)
|
|
249
|
-
const records = []
|
|
250
|
-
|
|
251
|
-
for (let itemIndex = 0; itemIndex < count; itemIndex++) {
|
|
252
|
-
const school = NODEQ_SCHOOLS[Math.floor(random() * NODEQ_SCHOOLS.length)]
|
|
253
|
-
const city = NODEQ_CITIES[Math.floor(random() * NODEQ_CITIES.length)]
|
|
254
|
-
const campus = `${city}${itemIndex % 3 === 0 ? '就业指导中心' : '校区报告厅'}`
|
|
255
|
-
const record = {
|
|
256
|
-
enterpriseYear: year,
|
|
257
|
-
operateTime: `${dateKey} 08:30:00`,
|
|
258
|
-
operator: 'mock-nodeq',
|
|
259
|
-
participationOrg: NODEQ_ORGS[(day + itemIndex + monthIndex) % NODEQ_ORGS.length],
|
|
260
|
-
publicityDate: `${dateKey} 00:00:00`,
|
|
261
|
-
publicityDateStr: dateKey,
|
|
262
|
-
publicityPlace: school,
|
|
263
|
-
publicityAddress: campus
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// 可选角标字段;字段不存在时转换结果使用空字符串。
|
|
267
|
-
if (includeBadge && itemIndex % 3 === 0) {
|
|
268
|
-
record.publicityTypeName = itemIndex % 2 === 0 ? '宣讲直播' : '宣讲'
|
|
269
|
-
}
|
|
270
|
-
records.push(record)
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
journeyMaps[dateKey] = records
|
|
274
|
-
})
|
|
275
|
-
})
|
|
276
|
-
|
|
277
|
-
return {
|
|
278
|
-
data: {
|
|
279
|
-
content: 'NodeQ 宣讲日历模拟数据',
|
|
280
|
-
id: 'NODEQ-MOCK-CALENDAR',
|
|
281
|
-
nbcbRecAnnJourneyMaps: journeyMaps
|
|
282
|
-
},
|
|
283
|
-
message: 'ok',
|
|
284
|
-
msgType: null,
|
|
285
|
-
status: '0000'
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/** 直接可用于页面演示的三个月原始响应(部分记录带角标,部分不带)。 */
|
|
290
|
-
export const NODEQ_MOCK_RESPONSE = createNodeqMockResponse({ includeBadge: true })
|
|
291
|
-
// 兼容喜欢下划线命名的调用方。
|
|
292
|
-
export const NODE_Q_MOCK_RESPONSE = NODEQ_MOCK_RESPONSE
|
|
293
|
-
export const NODEQ_MOCK_DATA = NODEQ_MOCK_RESPONSE
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* 异步返回 NodeQ 原始响应,模拟真实 request 的 Promise。
|
|
297
|
-
* `includeBadge` 默认 false,便于验证没有角标时不会留下空白。
|
|
298
|
-
*/
|
|
299
|
-
export function fetchNodeqCalendarData(options = {}) {
|
|
300
|
-
const { delay = 0, ...mockOptions } = options
|
|
301
|
-
return delayResolve(createNodeqMockResponse(mockOptions), delay)
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export const fetchNodeqCalendarResponse = fetchNodeqCalendarData
|
|
305
|
-
export const fetchNodeQCalendarData = fetchNodeqCalendarData
|
|
306
|
-
|
|
307
|
-
/* -------------------------------------------------------------------------- */
|
|
308
|
-
/* 自定义字段名接口(演示 fieldNames) */
|
|
309
|
-
/* -------------------------------------------------------------------------- */
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* 与后端字段不一致时的映射配置。
|
|
313
|
-
* 把这个对象传给组件的 field-names,组件就能读懂下面 fetchCalendarDataV2 的数据。
|
|
314
|
-
*/
|
|
315
|
-
export const ALT_FIELD_NAMES = {
|
|
316
|
-
month: 'ym',
|
|
317
|
-
monthLabel: 'ymText',
|
|
318
|
-
days: 'dateList',
|
|
319
|
-
date: 'dayStr',
|
|
320
|
-
items: 'activityList',
|
|
321
|
-
itemKey: 'activityId',
|
|
322
|
-
itemLabel: 'schoolName',
|
|
323
|
-
itemAddress: 'rawAddress',
|
|
324
|
-
itemBadge: 'activityTypeName',
|
|
325
|
-
itemType: 'activityType',
|
|
326
|
-
itemDisabled: 'expired'
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* 「后端字段完全不同」的模拟接口。
|
|
331
|
-
* 数据结构故意与默认约定不一致:month -> ym、days -> dateList、label -> schoolName ...
|
|
332
|
-
*/
|
|
333
|
-
export function fetchCalendarDataV2(options = {}) {
|
|
334
|
-
const { months = ['2026-09', '2026-10'], delay = 1500 } = options
|
|
335
|
-
|
|
336
|
-
const data = months.map((monthKey, index) => {
|
|
337
|
-
const [year, month] = monthKey.split('-').map(Number)
|
|
338
|
-
const days = createMonthDays(monthKey, { seed: 999 + index * 31, maxItems: 5 })
|
|
339
|
-
|
|
340
|
-
return {
|
|
341
|
-
ym: monthKey,
|
|
342
|
-
ymText: `${month} 月场次`,
|
|
343
|
-
dateList: days.map((d) => ({
|
|
344
|
-
dayStr: d.date,
|
|
345
|
-
activityList: d.items.map((it) => ({
|
|
346
|
-
activityId: it.id,
|
|
347
|
-
schoolName: it.label,
|
|
348
|
-
activityTypeName: it.badge,
|
|
349
|
-
activityType: it.type,
|
|
350
|
-
expired: false,
|
|
351
|
-
rawAddress: it.address
|
|
352
|
-
}))
|
|
353
|
-
}))
|
|
354
|
-
}
|
|
355
|
-
})
|
|
356
|
-
|
|
357
|
-
return delayResolve(data, delay)
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/* -------------------------------------------------------------------------- */
|
|
361
|
-
/* 固定演示数据 */
|
|
362
|
-
/* -------------------------------------------------------------------------- */
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* 一份写死的小数据,用于「基础用法」示例,
|
|
366
|
-
* 便于阅读文档时一眼看清数据结构。
|
|
367
|
-
*/
|
|
368
|
-
export const SIMPLE_DATA = [
|
|
369
|
-
{
|
|
370
|
-
month: '2026-09',
|
|
371
|
-
monthLabel: '2026年9月',
|
|
372
|
-
days: [
|
|
373
|
-
{
|
|
374
|
-
date: '2026-09-09',
|
|
375
|
-
items: [
|
|
376
|
-
{ id: 'a1', label: '香港中文大学(深圳)', badge: '宣讲', type: 'talk' },
|
|
377
|
-
{ id: 'a2', label: '南方科技大学', badge: '宣讲', type: 'talk' },
|
|
378
|
-
{ id: 'a3', label: '哈尔滨工业大学(深圳)', badge: '宣讲', type: 'talk' }
|
|
379
|
-
]
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
date: '2026-09-10',
|
|
383
|
-
items: [
|
|
384
|
-
{ id: 'b1', label: '电子科技大学', badge: '宣讲', type: 'talk' },
|
|
385
|
-
{ id: 'b2', label: '北京邮电大学', badge: '宣讲', type: 'talk' },
|
|
386
|
-
{ id: 'b3', label: '厦门大学', badge: '宣讲', type: 'talk' }
|
|
387
|
-
]
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
date: '2026-09-11',
|
|
391
|
-
items: [
|
|
392
|
-
{ id: 'c1', label: '四川大学', badge: '宣讲', type: 'talk' },
|
|
393
|
-
{ id: 'c2', label: '中央财经大学', badge: '宣讲', type: 'talk' },
|
|
394
|
-
{ id: 'c3', label: '东南大学', badge: '宣讲', type: 'talk' }
|
|
395
|
-
]
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
date: '2026-09-12',
|
|
399
|
-
items: [
|
|
400
|
-
{ id: 'd1', label: '南京审计大学', badge: '双选', type: 'fair' },
|
|
401
|
-
{ id: 'd2', label: '北京理工大学', badge: '宣讲', type: 'talk' },
|
|
402
|
-
{ id: 'd3', label: '西南财经大学', badge: '宣讲', type: 'talk' }
|
|
403
|
-
]
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
date: '2026-09-14',
|
|
407
|
-
items: [
|
|
408
|
-
{ id: 'e1', label: '中央财经大学', badge: '双选', type: 'fair' },
|
|
409
|
-
{ id: 'e2', label: '中国人民大学', badge: '宣讲', type: 'talk' },
|
|
410
|
-
{ id: 'e3', label: '南京大学', badge: '宣讲', type: 'talk' },
|
|
411
|
-
{ id: 'e4', label: '武汉大学', badge: '宣讲', type: 'talk' },
|
|
412
|
-
{ id: 'e5', label: '山东大学', badge: '直播', type: 'live' },
|
|
413
|
-
{ id: 'e6', label: '重庆大学', badge: '笔试', type: 'exam' }
|
|
414
|
-
]
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
date: '2026-09-16',
|
|
418
|
-
items: [
|
|
419
|
-
{ id: 'f1', label: '华中科技大学', badge: '宣讲', type: 'talk' },
|
|
420
|
-
{ id: 'f2', label: '复旦大学', badge: '宣讲', type: 'talk' },
|
|
421
|
-
{ id: 'f3', label: '对外经济贸易大学', badge: '宣讲', type: 'talk' },
|
|
422
|
-
{ id: 'f4', label: '北京师范大学', badge: '宣讲', type: 'talk' }
|
|
423
|
-
]
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
date: '2026-09-17',
|
|
427
|
-
items: [
|
|
428
|
-
{ id: 'g1', label: '上海财经大学', badge: '宣讲', type: 'talk' },
|
|
429
|
-
{ id: 'g2', label: '中南财经政法大学', badge: '宣讲', type: 'talk' },
|
|
430
|
-
{ id: 'g3', label: '北京大学', badge: '宣讲', type: 'talk' }
|
|
431
|
-
]
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
date: '2026-09-18',
|
|
435
|
-
items: [
|
|
436
|
-
{ id: 'h1', label: '华东师范大学', badge: '宣讲', type: 'talk' },
|
|
437
|
-
{ id: 'h2', label: '清华大学', badge: '宣讲', type: 'talk' },
|
|
438
|
-
{ id: 'h3', label: '西北工业大学', badge: '宣讲', type: 'talk' },
|
|
439
|
-
{ id: 'h4', label: '南开大学', badge: '宣讲', type: 'talk' }
|
|
440
|
-
]
|
|
441
|
-
},
|
|
442
|
-
{
|
|
443
|
-
date: '2026-09-19',
|
|
444
|
-
items: [
|
|
445
|
-
{ id: 'i1', label: '上海交通大学', badge: '宣讲', type: 'talk' },
|
|
446
|
-
{ id: 'i2', label: '天津大学', badge: '宣讲', type: 'talk' },
|
|
447
|
-
{ id: 'i3', label: '西安交通大学', badge: '宣讲', type: 'talk' }
|
|
448
|
-
]
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
date: '2026-09-22',
|
|
452
|
-
items: [
|
|
453
|
-
{ id: 'j1', label: '浙江大学', badge: '宣讲', type: 'talk' },
|
|
454
|
-
{ id: 'j2', label: '同济大学', badge: '宣讲', type: 'talk' },
|
|
455
|
-
{ id: 'j3', label: '大连理工大学', badge: '宣讲', type: 'talk' }
|
|
456
|
-
]
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
date: '2026-09-23',
|
|
460
|
-
items: [
|
|
461
|
-
{ id: 'k1', label: '中国科学技术大学', badge: '宣讲', type: 'talk' },
|
|
462
|
-
{ id: 'k2', label: '吉林大学', badge: '宣讲', type: 'talk' },
|
|
463
|
-
{ id: 'k3', label: '华南理工大学', badge: '宣讲', type: 'talk' }
|
|
464
|
-
]
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
date: '2026-09-24',
|
|
468
|
-
items: [
|
|
469
|
-
{ id: 'l1', label: '中南大学', badge: '双选', type: 'fair' },
|
|
470
|
-
{ id: 'l2', label: '哈尔滨工业大学', badge: '宣讲', type: 'talk' }
|
|
471
|
-
]
|
|
472
|
-
}
|
|
473
|
-
]
|
|
474
|
-
}
|
|
475
|
-
]
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 把 NodeQ mock 响应转换成 EventCalendar 的默认数据结构。
|
|
3
|
-
*
|
|
4
|
-
* 输入:response.data.nbcbRecAnnJourneyMaps
|
|
5
|
-
* 输出:[{ month, monthLabel, days: [{ date, items }] }]
|
|
6
|
-
*/
|
|
7
|
-
export function transformNodeqCalendarResponse(response) {
|
|
8
|
-
const journeyMap = response && response.data
|
|
9
|
-
? response.data.nbcbRecAnnJourneyMaps
|
|
10
|
-
: null
|
|
11
|
-
|
|
12
|
-
if (!journeyMap || typeof journeyMap !== 'object') return []
|
|
13
|
-
|
|
14
|
-
const months = {}
|
|
15
|
-
|
|
16
|
-
Object.keys(journeyMap).sort().forEach((date) => {
|
|
17
|
-
const dateKey = String(date).slice(0, 10)
|
|
18
|
-
const monthKey = dateKey.slice(0, 7)
|
|
19
|
-
const records = Array.isArray(journeyMap[date]) ? journeyMap[date] : []
|
|
20
|
-
|
|
21
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(dateKey)) return
|
|
22
|
-
|
|
23
|
-
if (!months[monthKey]) {
|
|
24
|
-
const [year, month] = monthKey.split('-')
|
|
25
|
-
months[monthKey] = {
|
|
26
|
-
month: monthKey,
|
|
27
|
-
monthLabel: `${year}年${Number(month)}月`,
|
|
28
|
-
days: []
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
months[monthKey].days.push({
|
|
33
|
-
date: dateKey,
|
|
34
|
-
items: records.map((record, index) => {
|
|
35
|
-
const item = record || {}
|
|
36
|
-
return {
|
|
37
|
-
id: item.id || `${dateKey}-${index}`,
|
|
38
|
-
label: item.publicityPlace || '',
|
|
39
|
-
address: item.publicityAddress || '',
|
|
40
|
-
// badge: item.publicityTypeName || '',
|
|
41
|
-
type: item.type || '',
|
|
42
|
-
disabled: item.disabled || false
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
return Object.keys(months).sort().map((monthKey) => months[monthKey])
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default transformNodeqCalendarResponse
|