guci-date 1.0.0
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/Export.js +62 -0
- package/GuciI18n.js +19 -0
- package/GuciTable.js +81 -0
- package/Interceptor.js +295 -0
- package/asyncImport.js +80 -0
- package/canvas2d.js +53 -0
- package/console.js +17 -0
- package/date.js +93 -0
- package/index.js +1235 -0
- package/javascriptEvent.js +33 -0
- package/loading.js +22 -0
- package/loding.js +112 -0
- package/max.js +50 -0
- package/oss.js +40 -0
- package/ossFP.js +82 -0
- package/package.json +54 -0
- package/publicInterface.js +39 -0
- package/recursion-router.js +28 -0
- package/request.js +52 -0
- package/retnue.js +19 -0
- package/util.js +18 -0
package/Export.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as XLSX from 'xlsx';
|
|
4
|
+
import { saveAs } from 'file-saver';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param { 通过自定义导出Excel表格 }
|
|
11
|
+
* @blob 返回的blob对象
|
|
12
|
+
* **/
|
|
13
|
+
export function ExportExcel(list){
|
|
14
|
+
|
|
15
|
+
const worksheet = XLSX.utils.aoa_to_sheet(list);
|
|
16
|
+
|
|
17
|
+
// 创建工作簿并添加工作表
|
|
18
|
+
const workbook = XLSX.utils.book_new();
|
|
19
|
+
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
|
20
|
+
|
|
21
|
+
// 生成Excel文件
|
|
22
|
+
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
|
23
|
+
|
|
24
|
+
// 使用blob和FileReader创建一个Blob URL
|
|
25
|
+
const dataBlob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' });
|
|
26
|
+
const blobUrl = window.URL.createObjectURL(dataBlob);
|
|
27
|
+
|
|
28
|
+
// 使用saveAs下载文件
|
|
29
|
+
saveAs(dataBlob, 'export.xlsx');
|
|
30
|
+
|
|
31
|
+
// 清理
|
|
32
|
+
window.URL.revokeObjectURL(blobUrl);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param { 用来处理 用过接口下载的blob对象进行下载 }
|
|
37
|
+
* @blob 返回的blob对象
|
|
38
|
+
* **/
|
|
39
|
+
export function ExportApiExcel(blob){
|
|
40
|
+
|
|
41
|
+
// 创建A标签
|
|
42
|
+
const link = document.createElement('a')
|
|
43
|
+
link.style.display = 'none'
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// 创建blob对象
|
|
47
|
+
link.href = URL.createObjectURL(blob)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// 下载xlsx文件名称
|
|
51
|
+
link.download = 'export.xlsx';
|
|
52
|
+
|
|
53
|
+
// 添加链接
|
|
54
|
+
document.body.appendChild(link)
|
|
55
|
+
|
|
56
|
+
// 下载
|
|
57
|
+
link.click()
|
|
58
|
+
|
|
59
|
+
// 清理
|
|
60
|
+
URL.revokeObjectURL(link.href)
|
|
61
|
+
document.body.removeChild(link)
|
|
62
|
+
}
|
package/GuciI18n.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import Vue from "vue";
|
|
5
|
+
import GuciI18n from "vue-i18n";
|
|
6
|
+
Vue.use(GuciI18n);
|
|
7
|
+
|
|
8
|
+
import { zh } from "../i18n/zh";
|
|
9
|
+
import { en } from "../i18n/en";
|
|
10
|
+
|
|
11
|
+
export const GuciLan = new GuciI18n({
|
|
12
|
+
locale: localStorage.getItem("locale") || "zh",
|
|
13
|
+
messages: {
|
|
14
|
+
en:{ en },
|
|
15
|
+
zh:{ zh }
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export default GuciLan;
|
package/GuciTable.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import GuciTable from "vxe-table";
|
|
2
|
+
|
|
3
|
+
GuciTable.setIcon({
|
|
4
|
+
// loading
|
|
5
|
+
LOADING: "vxe-icon-spinner roll vxe-loading--default-icon",
|
|
6
|
+
|
|
7
|
+
// table
|
|
8
|
+
TABLE_SORT_ASC: "vxe-icon-caret-up",
|
|
9
|
+
TABLE_SORT_DESC: "vxe-icon-caret-down",
|
|
10
|
+
TABLE_FILTER_NONE: "vxe-icon-funnel",
|
|
11
|
+
TABLE_FILTER_MATCH: "vxe-icon-funnel",
|
|
12
|
+
TABLE_EDIT: "vxe-icon-edit",
|
|
13
|
+
TABLE_HELP: "vxe-icon-question-circle-fill",
|
|
14
|
+
TABLE_TREE_LOADED: "vxe-icon-spinner roll",
|
|
15
|
+
TABLE_TREE_OPEN: "vxe-icon-caret-right rotate90",
|
|
16
|
+
TABLE_TREE_CLOSE: "vxe-icon-caret-right",
|
|
17
|
+
TABLE_EXPAND_LOADED: "vxe-icon-spinner roll",
|
|
18
|
+
TABLE_EXPAND_OPEN: "vxe-icon-arrow-right rotate90",
|
|
19
|
+
TABLE_EXPAND_CLOSE: "vxe-icon-arrow-right",
|
|
20
|
+
TABLE_CHECKBOX_CHECKED: "vxe-icon-checkbox-checked",
|
|
21
|
+
TABLE_CHECKBOX_UNCHECKED: "vxe-icon-checkbox-unchecked",
|
|
22
|
+
TABLE_CHECKBOX_INDETERMINATE: "vxe-icon-checkbox-indeterminate",
|
|
23
|
+
TABLE_RADIO_CHECKED: "vxe-icon-radio-checked",
|
|
24
|
+
TABLE_RADIO_UNCHECKED: "vxe-icon-radio-unchecked",
|
|
25
|
+
|
|
26
|
+
// button
|
|
27
|
+
BUTTON_DROPDOWN: "vxe-icon-arrow-down",
|
|
28
|
+
BUTTON_LOADING: "vxe-icon-spinner roll",
|
|
29
|
+
|
|
30
|
+
// select
|
|
31
|
+
SELECT_LOADED: "vxe-icon-spinner roll",
|
|
32
|
+
SELECT_OPEN: "vxe-icon-caret-down rotate180",
|
|
33
|
+
SELECT_CLOSE: "vxe-icon-caret-down",
|
|
34
|
+
|
|
35
|
+
// pager
|
|
36
|
+
PAGER_JUMP_PREV: "vxe-icon-arrow-double-left",
|
|
37
|
+
PAGER_JUMP_NEXT: "vxe-icon-arrow-double-right",
|
|
38
|
+
PAGER_PREV_PAGE: "vxe-icon-arrow-left",
|
|
39
|
+
PAGER_NEXT_PAGE: "vxe-icon-arrow-right",
|
|
40
|
+
PAGER_JUMP_MORE: "vxe-icon-ellipsis-h",
|
|
41
|
+
|
|
42
|
+
// input
|
|
43
|
+
INPUT_CLEAR: "vxe-icon-error-circle-fill",
|
|
44
|
+
INPUT_PWD: "vxe-icon-eye-fill",
|
|
45
|
+
INPUT_SHOW_PWD: "vxe-icon-eye-fill-close",
|
|
46
|
+
INPUT_PREV_NUM: "vxe-icon-caret-up",
|
|
47
|
+
INPUT_NEXT_NUM: "vxe-icon-caret-down",
|
|
48
|
+
INPUT_DATE: "vxe-icon-calendar",
|
|
49
|
+
INPUT_SEARCH: "vxe-icon-search",
|
|
50
|
+
|
|
51
|
+
// modal
|
|
52
|
+
MODAL_ZOOM_IN: "vxe-icon-square",
|
|
53
|
+
MODAL_ZOOM_OUT: "vxe-icon-maximize",
|
|
54
|
+
MODAL_CLOSE: "vxe-icon-close",
|
|
55
|
+
MODAL_INFO: "vxe-icon-info-circle-fill",
|
|
56
|
+
MODAL_SUCCESS: "vxe-icon-success-circle-fill",
|
|
57
|
+
MODAL_WARNING: "vxe-icon-warnion-circle-fill",
|
|
58
|
+
MODAL_ERROR: "vxe-icon-error-circle-fill",
|
|
59
|
+
MODAL_QUESTION: "vxe-icon-question-circle-fill",
|
|
60
|
+
MODAL_LOADING: "vxe-icon-spinner roll",
|
|
61
|
+
|
|
62
|
+
// toolbar
|
|
63
|
+
TOOLBAR_TOOLS_REFRESH: "vxe-icon-repeat",
|
|
64
|
+
TOOLBAR_TOOLS_REFRESH_LOADING: "vxe-icon-repeat roll",
|
|
65
|
+
TOOLBAR_TOOLS_IMPORT: "vxe-icon-upload",
|
|
66
|
+
TOOLBAR_TOOLS_EXPORT: "vxe-icon-download",
|
|
67
|
+
TOOLBAR_TOOLS_PRINT: "vxe-icon-print",
|
|
68
|
+
TOOLBAR_TOOLS_FULLSCREEN: "vxe-icon-fullscreen",
|
|
69
|
+
TOOLBAR_TOOLS_MINIMIZE: "vxe-icon-minimize",
|
|
70
|
+
TOOLBAR_TOOLS_CUSTOM: "vxe-icon-custom-column",
|
|
71
|
+
TOOLBAR_TOOLS_FIXED_LEFT: "vxe-icon-fixed-left",
|
|
72
|
+
TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED: "vxe-icon-fixed-left-fill",
|
|
73
|
+
TOOLBAR_TOOLS_FIXED_RIGHT: "vxe-icon-fixed-right",
|
|
74
|
+
TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED: "vxe-icon-fixed-right-fill",
|
|
75
|
+
|
|
76
|
+
// form
|
|
77
|
+
FORM_PREFIX: "vxe-icon-question-circle-fill",
|
|
78
|
+
FORM_SUFFIX: "vxe-icon-question-circle-fill",
|
|
79
|
+
FORM_FOLDING: "vxe-icon-arrow-up rotate180",
|
|
80
|
+
FORM_UNFOLDING: "vxe-icon-arrow-up"
|
|
81
|
+
});
|
package/Interceptor.js
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import FullCalendar from "@fullcalendar/vue";
|
|
4
|
+
import dayGridPlugin from "@fullcalendar/daygrid";
|
|
5
|
+
import timeGridPlugin from "@fullcalendar/timegrid";
|
|
6
|
+
import interactionPlugin, { Draggable } from "@fullcalendar/interaction";
|
|
7
|
+
|
|
8
|
+
import apiBaseUrl from "../../config/api";
|
|
9
|
+
import axios from "axios";
|
|
10
|
+
|
|
11
|
+
export function beforeRouteLeave(to, from, next){
|
|
12
|
+
if (to.name !== "ScheduleDetails") {
|
|
13
|
+
from.meta.keepAlive = false;
|
|
14
|
+
} else {
|
|
15
|
+
from.meta.keepAlive = true;
|
|
16
|
+
}
|
|
17
|
+
next();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function data(){
|
|
21
|
+
return {
|
|
22
|
+
gridData: [],
|
|
23
|
+
dialogTableVisible: false,
|
|
24
|
+
file: `${apiBaseUrl}/schedule/import`,
|
|
25
|
+
isHideDetails: false,
|
|
26
|
+
time: [],
|
|
27
|
+
num: 0,
|
|
28
|
+
educationType: 2, //教育类型
|
|
29
|
+
relativeTime: "4", //自定义
|
|
30
|
+
isFirst: 2,
|
|
31
|
+
relativeTimes: [
|
|
32
|
+
{
|
|
33
|
+
value: "1",
|
|
34
|
+
label: "每天",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: "2",
|
|
38
|
+
label: "每周",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: "3",
|
|
42
|
+
label: "自定义",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
value: "4",
|
|
46
|
+
label: "无",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
categoryId: "", //课程类型ID
|
|
50
|
+
checkList: [],
|
|
51
|
+
id1: "",
|
|
52
|
+
teachers: [], //下拉框默认值
|
|
53
|
+
query: "", // 查询关键字
|
|
54
|
+
courses: [], //拖拽课程
|
|
55
|
+
studentIds: [],
|
|
56
|
+
counter: "",
|
|
57
|
+
startTime: "", // 开始时间变量
|
|
58
|
+
endTime: "", // 结束时间变量
|
|
59
|
+
startTime1: "",
|
|
60
|
+
endTime1: "",
|
|
61
|
+
courseId: null,
|
|
62
|
+
courseScheduleData: null, //存储回显的排课信息数据
|
|
63
|
+
studentList: [], // 存储学生列表数据的变量
|
|
64
|
+
selectedTeacher: null, // 如果需要预先选中某个选项,可以在这里设置默认值
|
|
65
|
+
dialogVisible: false, // 控制弹层显示状态的数据属性
|
|
66
|
+
ruleForm: {
|
|
67
|
+
startTime: "",
|
|
68
|
+
endTime: "",
|
|
69
|
+
selectedTeacher: "",
|
|
70
|
+
},
|
|
71
|
+
// teacherId:this.ruleForm.selectedTeacher,
|
|
72
|
+
rules: {
|
|
73
|
+
startTime: [
|
|
74
|
+
{ required: true, message: "请选择开始时间", trigger: "blur" },
|
|
75
|
+
],
|
|
76
|
+
endTime: [
|
|
77
|
+
{ required: true, message: "请选择结束时间", trigger: "blur" },
|
|
78
|
+
{ validator: this.checkEndTime, trigger: "change" },
|
|
79
|
+
],
|
|
80
|
+
selectedTeacher: [
|
|
81
|
+
{ required: true, message: "请选择教师", trigger: "change" },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
calendarOptions: {
|
|
85
|
+
handleWindowResize: true,
|
|
86
|
+
eventColor: this.getEventColor, // 使用方法来确定颜色
|
|
87
|
+
firstDay: 1,
|
|
88
|
+
allDaySlot: false, // 不显示all-day
|
|
89
|
+
firstHour: 6,
|
|
90
|
+
slotMinTime: "06:00:00",
|
|
91
|
+
slotMaxTime: "24:00:00",
|
|
92
|
+
plugins: [
|
|
93
|
+
dayGridPlugin,
|
|
94
|
+
timeGridPlugin,
|
|
95
|
+
interactionPlugin, // needed for dateClick
|
|
96
|
+
],
|
|
97
|
+
datesSet: this.handleDatesSet,
|
|
98
|
+
headerToolbar: {
|
|
99
|
+
left: "prev,next today",
|
|
100
|
+
center: "title",
|
|
101
|
+
right: "dayGridMonth,timeGridWeek,timeGridDay",
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
/* 设置按钮文字 */
|
|
105
|
+
buttonText: {
|
|
106
|
+
today: "今天",
|
|
107
|
+
dayGridMonth: "月",
|
|
108
|
+
timeGridWeek: "周",
|
|
109
|
+
timeGridDay: "日",
|
|
110
|
+
},
|
|
111
|
+
locale: "zh-cn",
|
|
112
|
+
// dayGridMonth, timeGridWeek,timeGridDay
|
|
113
|
+
initialView: "dayGridMonth",
|
|
114
|
+
// initialEvents: INITIAL_EVENTS, // alternatively, use the `events` setting to fetch from a feed
|
|
115
|
+
editable: true,
|
|
116
|
+
selectable: true,
|
|
117
|
+
selectMirror: true,
|
|
118
|
+
dayMaxEvents: true,
|
|
119
|
+
weekends: true,
|
|
120
|
+
// handleViewRender,
|
|
121
|
+
eventDidMount: function (info) {
|
|
122
|
+
if (info.event.extendedProps.isShowbgcColor) {
|
|
123
|
+
info.el.style.background = "darkgray";
|
|
124
|
+
} else {
|
|
125
|
+
info.el.style.background = "#3788d8";
|
|
126
|
+
}
|
|
127
|
+
if (
|
|
128
|
+
info.event.extendedProps.classEnding == 1 &&
|
|
129
|
+
info.event.extendedProps.isFirst !== 1
|
|
130
|
+
) {
|
|
131
|
+
info.el.style.background = "orange";
|
|
132
|
+
info.el.style.borderColor = "orange";
|
|
133
|
+
}
|
|
134
|
+
if (
|
|
135
|
+
info.event.extendedProps.isFirst == 1 &&
|
|
136
|
+
info.event.extendedProps.classEnding == 1
|
|
137
|
+
) {
|
|
138
|
+
info.el.style.background = "#E380E3";
|
|
139
|
+
info.el.style.borderColor = "#E380E3";
|
|
140
|
+
}
|
|
141
|
+
if (
|
|
142
|
+
info.event.extendedProps.isFirst == 1 &&
|
|
143
|
+
info.event.extendedProps.classEnding !== 1
|
|
144
|
+
) {
|
|
145
|
+
info.el.style.background = "#54bcbd";
|
|
146
|
+
info.el.style.borderColor = "#54bcbd";
|
|
147
|
+
}
|
|
148
|
+
}, //事件挂载
|
|
149
|
+
events: [],
|
|
150
|
+
customButtons: {
|
|
151
|
+
next: {
|
|
152
|
+
click: this.nextClick,
|
|
153
|
+
},
|
|
154
|
+
prev: {
|
|
155
|
+
click: this.prevClick,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
eventColor: function (event) {
|
|
159
|
+
if (event.start.isBefore(new Date())) {
|
|
160
|
+
return "f0f0f0"; // 过去事件的背景颜色
|
|
161
|
+
} else {
|
|
162
|
+
return "#008000"; // 未来事件的背景颜色
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
// select: this.handleDateSelect,
|
|
167
|
+
eventClick: this.handleEventClick,
|
|
168
|
+
eventsSet: this.handleEvents,
|
|
169
|
+
/* you can update a remote database when these fire:
|
|
170
|
+
eventAdd:
|
|
171
|
+
eventChange:
|
|
172
|
+
eventRemove:
|
|
173
|
+
*/
|
|
174
|
+
},
|
|
175
|
+
pickerOptions: {
|
|
176
|
+
shortcuts: [
|
|
177
|
+
{
|
|
178
|
+
text: "最近一周",
|
|
179
|
+
onClick(picker) {
|
|
180
|
+
const end = new Date();
|
|
181
|
+
const start = new Date();
|
|
182
|
+
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
183
|
+
picker.$emit("pick", [start, end]);
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
text: "最近一个月",
|
|
188
|
+
onClick(picker) {
|
|
189
|
+
const end = new Date();
|
|
190
|
+
const start = new Date();
|
|
191
|
+
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
192
|
+
picker.$emit("pick", [start, end]);
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
text: "最近三个月",
|
|
197
|
+
onClick(picker) {
|
|
198
|
+
const end = new Date();
|
|
199
|
+
const start = new Date();
|
|
200
|
+
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
201
|
+
picker.$emit("pick", [start, end]);
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
value1: "", //日期绑定
|
|
207
|
+
value2: "",
|
|
208
|
+
currentEvents: [],
|
|
209
|
+
lockLoading: false,
|
|
210
|
+
btnInitialViewSelect: "",
|
|
211
|
+
loadingFalg: false,
|
|
212
|
+
monStatus: "",
|
|
213
|
+
satNum: "",
|
|
214
|
+
sunNum: "",
|
|
215
|
+
address: "",
|
|
216
|
+
studentName: "",
|
|
217
|
+
studentName_s: "",
|
|
218
|
+
studentsList: [],
|
|
219
|
+
studentsList_s: [],
|
|
220
|
+
timeTeachers: [],
|
|
221
|
+
parentScheduleId: "",
|
|
222
|
+
jsonShow: true,
|
|
223
|
+
dialogVisibles: false,
|
|
224
|
+
courseDate1: "", //一键结课日期
|
|
225
|
+
renderShow: false,
|
|
226
|
+
eventBtn: false,
|
|
227
|
+
listJsonString: "",
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
export function created(){
|
|
233
|
+
this.fetchTeachers();
|
|
234
|
+
this.fetchCourses();
|
|
235
|
+
this.getStudenList();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
export function mounted(){
|
|
240
|
+
axios.post(`${apiBaseUrl}/student/getStudentList`, {
|
|
241
|
+
studentType: 1,
|
|
242
|
+
})
|
|
243
|
+
.then((res) => {
|
|
244
|
+
let { data } = res;
|
|
245
|
+
if (data.code == 200) {
|
|
246
|
+
this.studentsList = data.data
|
|
247
|
+
sessionStorage.setItem(
|
|
248
|
+
"getStudentList_Jons",
|
|
249
|
+
JSON.stringify(data.data)
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
axios.post(`${apiBaseUrl}/student/getStudentList`, {
|
|
254
|
+
studentType: 2,
|
|
255
|
+
})
|
|
256
|
+
.then((res) => {
|
|
257
|
+
let { data } = res;
|
|
258
|
+
if (data.code == 200) {
|
|
259
|
+
sessionStorage.setItem(
|
|
260
|
+
"getStudentList_Jons_s",
|
|
261
|
+
JSON.stringify(data.data)
|
|
262
|
+
);
|
|
263
|
+
this.studentsList_s = data.data
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
let containerEl = document.getElementById("external-events");
|
|
268
|
+
new Draggable(containerEl, {
|
|
269
|
+
itemSelector: ".fc-event",
|
|
270
|
+
eventData: function (eventEl) {
|
|
271
|
+
//自定id
|
|
272
|
+
let eventId = eventEl.querySelector(".fcevent").getAttribute("data-id");
|
|
273
|
+
|
|
274
|
+
return {
|
|
275
|
+
title: eventEl.innerText,
|
|
276
|
+
id: eventId,
|
|
277
|
+
};
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
this.jsonShow = false;
|
|
283
|
+
this.renderShow = false;
|
|
284
|
+
this.listdate();
|
|
285
|
+
|
|
286
|
+
// 重写 今天按钮
|
|
287
|
+
const Dom = document.getElementsByClassName("fc-today-button")[0];
|
|
288
|
+
Dom.addEventListener("click", (e) => {
|
|
289
|
+
e.preventDefault();
|
|
290
|
+
this.jsonShow = false;
|
|
291
|
+
this.renderShow = false;
|
|
292
|
+
this.listdate();
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
}
|
package/asyncImport.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const listScripts = [
|
|
5
|
+
'https://at.alicdn.com/t/c/font_4347391_g1mrtnc8chn.js',
|
|
6
|
+
'https://at.alicdn.com/t/c/font_4347391_842vzbhsm8k.js',
|
|
7
|
+
'https://unpkg.com/default-passive-events',
|
|
8
|
+
'https://cdn.bootcdn.net/ajax/libs/vConsole/3.9.0/vconsole.min.js',
|
|
9
|
+
'https://api.vvhan.com/api/script/denglong',
|
|
10
|
+
'https://map.qq.com/api/gljs?v=1.exp&key=LNZBZ-AJAKJ-E2PFB-X67PO-UYN2S-S5BM5',
|
|
11
|
+
'https://unpkg.com/@jiaminghi/data-view/dist/datav.min.vue.js',
|
|
12
|
+
'https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js',
|
|
13
|
+
'https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js',
|
|
14
|
+
'https://cdn.bootcdn.net/ajax/libs/html2canvas/1.4.1/html2canvas.min.js',
|
|
15
|
+
'https://cdn.jsdelivr.net/npm/lodash/lodash.min.js',
|
|
16
|
+
'https://code.jquery.com/jquery-3.6.0.min.js',
|
|
17
|
+
'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css',
|
|
18
|
+
'https://cdn.bootcss.com/waypoints/4.0.1/jquery.waypoints.min.js',
|
|
19
|
+
'https://cdn.bootcss.com/jquery-easing/1.4.1/jquery.easing.min.js',
|
|
20
|
+
'https://cdn.bootcss.com/salvattore/1.0.9/salvattore.min.js',
|
|
21
|
+
'ps://cdn.bootcss.com/magnific-popup.js/1.1.0/magnific-popup.min.css',
|
|
22
|
+
'https://cdn.bootcss.com/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js',
|
|
23
|
+
'https://unpkg.com/vee-validate',
|
|
24
|
+
'https://cdn.bootcss.com/modernizr/2010.07.06dev/modernizr.min.js',
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
const newList = []
|
|
28
|
+
|
|
29
|
+
function asyncImport(url) {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const script = document.createElement('script')
|
|
32
|
+
script.src = url
|
|
33
|
+
script.async = true
|
|
34
|
+
script.onload = () => resolve(true)
|
|
35
|
+
script.onerror = () => reject(new Error(`Failed to asynchronously import: ${url}`))
|
|
36
|
+
document.head.appendChild(script)
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
listScripts.map((itme)=>{
|
|
42
|
+
asyncImport(itme).then(() =>
|
|
43
|
+
console.log('插件异步引入成功')
|
|
44
|
+
).catch(error =>
|
|
45
|
+
console.error(error)
|
|
46
|
+
)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
function arraysHaveSameElements(arr1, arr2) {
|
|
50
|
+
if (arr1.length !== arr2.length) {
|
|
51
|
+
return false
|
|
52
|
+
}
|
|
53
|
+
const sortedArr1 = arr1.slice().sort()
|
|
54
|
+
const sortedArr2 = arr2.slice().sort()
|
|
55
|
+
|
|
56
|
+
for (let i = 0; i < sortedArr1.length; i++) {
|
|
57
|
+
if (sortedArr1[i] !== sortedArr2[i]) {
|
|
58
|
+
return false
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return true
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
function hasDuplicates(arr) {
|
|
66
|
+
const seen = new Set()
|
|
67
|
+
|
|
68
|
+
for (let value of arr) {
|
|
69
|
+
if (seen.has(value)) {
|
|
70
|
+
return true
|
|
71
|
+
}
|
|
72
|
+
seen.add(value)
|
|
73
|
+
}
|
|
74
|
+
return false
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
arraysHaveSameElements(listScripts,newList)
|
|
78
|
+
hasDuplicates(listScripts)
|
|
79
|
+
|
|
80
|
+
|
package/canvas2d.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
*@string
|
|
4
|
+
* **/
|
|
5
|
+
|
|
6
|
+
import { Loading } from 'element-ui';
|
|
7
|
+
|
|
8
|
+
const captureCanvas = (elemnt) =>{
|
|
9
|
+
|
|
10
|
+
this.showBtns = false
|
|
11
|
+
|
|
12
|
+
const loadingObj = Loading.service({ lock: true, text: '下载中请稍等...', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.6)'})
|
|
13
|
+
|
|
14
|
+
const canvas2d = document.getElementById(elemnt)
|
|
15
|
+
const scrollHeight = this.titleis === '(咨询单)家庭教育一站式落地陪跑' ? 5500 : 3000
|
|
16
|
+
const scrollWidth = 500
|
|
17
|
+
|
|
18
|
+
const fullCanvas = document.createElement('canvas')
|
|
19
|
+
fullCanvas.width = scrollWidth
|
|
20
|
+
fullCanvas.height = scrollHeight
|
|
21
|
+
const fullCtx = fullCanvas.getContext('2d')
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
for (let y = 0; y < scrollHeight; y += fullCanvas.height) {
|
|
25
|
+
for (let x = 0; x < scrollWidth; x += fullCanvas.width) {
|
|
26
|
+
html2canvas(canvas2d, {
|
|
27
|
+
scrollX: x,
|
|
28
|
+
scrollY: y,
|
|
29
|
+
width: fullCanvas.width,
|
|
30
|
+
height: fullCanvas.height,
|
|
31
|
+
useCORS: true
|
|
32
|
+
}).then((canvas) => {
|
|
33
|
+
fullCtx.drawImage(canvas, x, y)
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
let imgData = fullCanvas.toDataURL('image/jpg')
|
|
40
|
+
let link = document.createElement('a')
|
|
41
|
+
link.href = imgData
|
|
42
|
+
link.download = this.titleis + '.jpg'
|
|
43
|
+
link.click()
|
|
44
|
+
fullCanvas.remove()
|
|
45
|
+
loadingObj.close()
|
|
46
|
+
return true
|
|
47
|
+
}, 3000)
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
captureCanvas
|
|
53
|
+
}
|
package/console.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 卷柏 1350797548@qq.com
|
|
3
|
+
* @Date: 2024-07-11 18:24:39
|
|
4
|
+
* @LastEditors: 卷柏 1350797548@qq.com
|
|
5
|
+
* @LastEditTime: 2024-07-11 19:22:12
|
|
6
|
+
* @FilePath: \pc\coursearrange\src\utils\console.js
|
|
7
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
*/
|
|
9
|
+
// console.log("%c 大鹏一日同风起,扶摇直上九万里。假令风歇时下来,犹能簸却沧溟水。世人见我恒殊调,闻余大言皆冷笑。宣父犹能畏后生,丈夫未可轻年少。","background: rgba(252,234,187,1);background: -moz-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%,rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -webkit-gradient(left top, right top, color-stop(0%, rgba(252,234,187,1)), color-stop(12%, rgba(175,250,77,1)), color-stop(28%, rgba(0,247,49,1)), color-stop(39%, rgba(0,210,247,1)), color-stop(51%, rgba(0,189,247,1)), color-stop(64%, rgba(133,108,217,1)), color-stop(78%, rgba(177,0,247,1)), color-stop(87%, rgba(247,0,189,1)), color-stop(100%, rgba(245,22,52,1)));background: -webkit-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12 大专栏 console.log添加样式及图片%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -o-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -ms-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: linear-gradient(to right, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#f51634', GradientType=1 );font-size:5em")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// console.log("%c", "padding:50px 300px;line-height:120px;background:url('https://www.gif.cn/Upload/newsucai/2022-09-01/286.gif') no-repeat;");
|