utiller 1.0.357 → 1.0.359

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.
@@ -4156,10 +4156,10 @@ var Utiller = /*#__PURE__*/function () {
4156
4156
  value: function checkPeriodConflict(newTask, existingTasks) {
4157
4157
  var resourceCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
4158
4158
  // 1️⃣ 解析 timeSlot 拆成日期與時間
4159
- var _newTask$timeSlot$spl = newTask.timeSlot.split("|"),
4160
- _newTask$timeSlot$spl2 = (0, _slicedToArray2["default"])(_newTask$timeSlot$spl, 2),
4161
- datePart = _newTask$timeSlot$spl2[0],
4162
- timePart = _newTask$timeSlot$spl2[1];
4159
+ var _newTask$content$spli = newTask.content.split("|"),
4160
+ _newTask$content$spli2 = (0, _slicedToArray2["default"])(_newTask$content$spli, 2),
4161
+ datePart = _newTask$content$spli2[0],
4162
+ timePart = _newTask$content$spli2[1];
4163
4163
  var date = (0, _momentTimezone["default"])(datePart.split(" ")[0], "YYYY/MM/DD");
4164
4164
  var _timePart$split = timePart.split("-"),
4165
4165
  _timePart$split2 = (0, _slicedToArray2["default"])(_timePart$split, 2),
@@ -4191,63 +4191,48 @@ var Utiller = /*#__PURE__*/function () {
4191
4191
  items: conflictItems // 衝突的任務列表
4192
4192
  };
4193
4193
  }
4194
- }, {
4195
- key: "testOfConflict",
4196
- value: function testOfConflict() {
4197
- // ===== 測試資料 =====
4198
- var newTask = {
4199
- timeSlot: "2025/08/20 (三)|16:00-17:00",
4200
- // 格式: YYYY/MM/DD (週)|HH:mm-HH:mm
4201
- id: "JOB001",
4202
- description: "安裝冷氣"
4203
- };
4204
- var existingTasks = [{
4205
- id: "T001",
4206
- period: "202508151400-202508151500"
4207
- }, {
4208
- id: "T002",
4209
- period: "202508151600-202508151700"
4210
- }, {
4211
- id: "T003",
4212
- period: "202508161400-202508161500"
4213
- }, {
4214
- id: "T004",
4215
- period: "202508171600-202508171700"
4216
- }, {
4217
- id: "T005",
4218
- period: "202508201630-202508201700"
4219
- },
4220
- // 衝突
4221
- {
4222
- id: "T006",
4223
- period: "202508201645-202508201700"
4224
- } // 衝突
4225
- ];
4226
-
4227
- // 測試:一人資源
4228
- console.log(checkPeriodConflict(newTask, existingTasks, 1));
4229
- /*
4230
- {
4231
- conflict: true,
4232
- items: [
4233
- { id: 'T005', period: '202508201630-202508201700' },
4234
- { id: 'T006', period: '202508201645-202508201700' }
4235
- ]
4236
- }
4237
- */
4238
-
4239
- // 測試:兩人資源
4240
- console.log(checkPeriodConflict(newTask, existingTasks, 2));
4241
- /*
4242
- {
4243
- conflict: false,
4244
- items: [
4245
- { id: 'T005', period: '202508201630-202508201700' },
4246
- { id: 'T006', period: '202508201645-202508201700' }
4247
- ]
4248
- }
4249
- */
4250
- }
4194
+
4195
+ // testOfConflict() {
4196
+ // // ===== 測試資料 =====
4197
+ // const newTask = {
4198
+ // timeSlot: "2025/08/20 (三)|16:00-17:00", // 格式: YYYY/MM/DD (週)|HH:mm-HH:mm
4199
+ // id: "JOB001",
4200
+ // description: "安裝冷氣"
4201
+ // };
4202
+ //
4203
+ // const existingTasks = [
4204
+ // { id: "T001", period: "202508151400-202508151500" },
4205
+ // { id: "T002", period: "202508151600-202508151700" },
4206
+ // { id: "T003", period: "202508161400-202508161500" },
4207
+ // { id: "T004", period: "202508171600-202508171700" },
4208
+ // { id: "T005", period: "202508201630-202508201700" }, // 衝突
4209
+ // { id: "T006", period: "202508201645-202508201700" } // 衝突
4210
+ // ];
4211
+ //
4212
+ // // 測試:一人資源
4213
+ // console.log(this.checkPeriodConflict(newTask, existingTasks, 1));
4214
+ // /*
4215
+ // {
4216
+ // conflict: true,
4217
+ // items: [
4218
+ // { id: 'T005', period: '202508201630-202508201700' },
4219
+ // { id: 'T006', period: '202508201645-202508201700' }
4220
+ // ]
4221
+ // }
4222
+ // */
4223
+ //
4224
+ // // 測試:兩人資源
4225
+ // console.log(this.checkPeriodConflict(newTask, existingTasks, 2));
4226
+ // /*
4227
+ // {
4228
+ // conflict: false,
4229
+ // items: [
4230
+ // { id: 'T005', period: '202508201630-202508201700' },
4231
+ // { id: 'T006', period: '202508201645-202508201700' }
4232
+ // ]
4233
+ // }
4234
+ // */
4235
+ // }
4251
4236
  /** ============== 排課系統公式 結束 ============== */
4252
4237
  }]);
4253
4238
  }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utiller",
3
- "version": "1.0.357",
3
+ "version": "1.0.359",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "configerer": "^1.0.11",
14
- "utiller": "^1.0.356",
14
+ "utiller": "^1.0.358",
15
15
  "linepayer": "^1.0.4",
16
16
  "databazer": "^1.0.12",
17
17
  "lodash": "^4.17.20",