kz-ui-base 1.0.2 → 1.0.4

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.
Files changed (283) hide show
  1. package/package.json +1 -1
  2. package/common/package-lock.json +0 -18
  3. package/common/package.json +0 -51
  4. package/common/src/api/common/cacher.js +0 -15
  5. package/common/src/api/common/common.js +0 -299
  6. package/common/src/api/common/material.js +0 -71
  7. package/common/src/api/login.js +0 -103
  8. package/common/src/api/menu.js +0 -18
  9. package/common/src/assets/401_images/401.gif +0 -0
  10. package/common/src/assets/404_images/404.png +0 -0
  11. package/common/src/assets/404_images/404_cloud.png +0 -0
  12. package/common/src/assets/icons/file-config.png +0 -0
  13. package/common/src/assets/icons/file-doc.png +0 -0
  14. package/common/src/assets/icons/file-exe.png +0 -0
  15. package/common/src/assets/icons/file-ini.png +0 -0
  16. package/common/src/assets/icons/file-jpg.png +0 -0
  17. package/common/src/assets/icons/file-mpg.png +0 -0
  18. package/common/src/assets/icons/file-none.png +0 -0
  19. package/common/src/assets/icons/file-pdf.png +0 -0
  20. package/common/src/assets/icons/file-png.png +0 -0
  21. package/common/src/assets/icons/file-ppt.png +0 -0
  22. package/common/src/assets/icons/file-rar.png +0 -0
  23. package/common/src/assets/icons/file-txt.png +0 -0
  24. package/common/src/assets/icons/file-wav.png +0 -0
  25. package/common/src/assets/icons/file-xls.png +0 -0
  26. package/common/src/assets/icons/index.js +0 -9
  27. package/common/src/assets/icons/svg/404.svg +0 -1
  28. package/common/src/assets/icons/svg/bug.svg +0 -1
  29. package/common/src/assets/icons/svg/build.svg +0 -1
  30. package/common/src/assets/icons/svg/button.svg +0 -1
  31. package/common/src/assets/icons/svg/cascader.svg +0 -1
  32. package/common/src/assets/icons/svg/chart.svg +0 -1
  33. package/common/src/assets/icons/svg/checkbox.svg +0 -1
  34. package/common/src/assets/icons/svg/client.svg +0 -1
  35. package/common/src/assets/icons/svg/clipboard.svg +0 -1
  36. package/common/src/assets/icons/svg/code.svg +0 -1
  37. package/common/src/assets/icons/svg/color.svg +0 -1
  38. package/common/src/assets/icons/svg/component.svg +0 -1
  39. package/common/src/assets/icons/svg/dashboard.svg +0 -1
  40. package/common/src/assets/icons/svg/date-range.svg +0 -1
  41. package/common/src/assets/icons/svg/date.svg +0 -1
  42. package/common/src/assets/icons/svg/dict.svg +0 -1
  43. package/common/src/assets/icons/svg/documentation.svg +0 -1
  44. package/common/src/assets/icons/svg/download.svg +0 -1
  45. package/common/src/assets/icons/svg/drag.svg +0 -1
  46. package/common/src/assets/icons/svg/druid.svg +0 -1
  47. package/common/src/assets/icons/svg/edit.svg +0 -1
  48. package/common/src/assets/icons/svg/education.svg +0 -1
  49. package/common/src/assets/icons/svg/email.svg +0 -1
  50. package/common/src/assets/icons/svg/example.svg +0 -1
  51. package/common/src/assets/icons/svg/excel.svg +0 -1
  52. package/common/src/assets/icons/svg/exit-fullscreen.svg +0 -1
  53. package/common/src/assets/icons/svg/eye-open.svg +0 -1
  54. package/common/src/assets/icons/svg/eye.svg +0 -1
  55. package/common/src/assets/icons/svg/form.svg +0 -1
  56. package/common/src/assets/icons/svg/fullscreen.svg +0 -1
  57. package/common/src/assets/icons/svg/github.svg +0 -1
  58. package/common/src/assets/icons/svg/guide.svg +0 -1
  59. package/common/src/assets/icons/svg/icon.svg +0 -1
  60. package/common/src/assets/icons/svg/input.svg +0 -1
  61. package/common/src/assets/icons/svg/international.svg +0 -1
  62. package/common/src/assets/icons/svg/job.svg +0 -1
  63. package/common/src/assets/icons/svg/kz_authority.svg +0 -1
  64. package/common/src/assets/icons/svg/kz_build.svg +0 -1
  65. package/common/src/assets/icons/svg/kz_code.svg +0 -1
  66. package/common/src/assets/icons/svg/kz_config.svg +0 -1
  67. package/common/src/assets/icons/svg/kz_creatTime.svg +0 -1
  68. package/common/src/assets/icons/svg/kz_dept.svg +0 -1
  69. package/common/src/assets/icons/svg/kz_dept_profile.svg +0 -1
  70. package/common/src/assets/icons/svg/kz_dict.svg +0 -1
  71. package/common/src/assets/icons/svg/kz_edit.svg +0 -1
  72. package/common/src/assets/icons/svg/kz_enlarge.svg +0 -1
  73. package/common/src/assets/icons/svg/kz_enterprise.svg +0 -1
  74. package/common/src/assets/icons/svg/kz_fold.svg +0 -2
  75. package/common/src/assets/icons/svg/kz_job.svg +0 -1
  76. package/common/src/assets/icons/svg/kz_layout.svg +0 -1
  77. package/common/src/assets/icons/svg/kz_log.svg +0 -1
  78. package/common/src/assets/icons/svg/kz_log_loginInfo.svg +0 -1
  79. package/common/src/assets/icons/svg/kz_log_operation.svg +0 -1
  80. package/common/src/assets/icons/svg/kz_master-slave.svg +0 -2
  81. package/common/src/assets/icons/svg/kz_menu.svg +0 -1
  82. package/common/src/assets/icons/svg/kz_menu_analyse.svg +0 -22
  83. package/common/src/assets/icons/svg/kz_message.svg +0 -1
  84. package/common/src/assets/icons/svg/kz_monitor.svg +0 -1
  85. package/common/src/assets/icons/svg/kz_nacos.svg +0 -1
  86. package/common/src/assets/icons/svg/kz_narrow.svg +0 -1
  87. package/common/src/assets/icons/svg/kz_notice.svg +0 -2
  88. package/common/src/assets/icons/svg/kz_online.svg +0 -1
  89. package/common/src/assets/icons/svg/kz_open.svg +0 -2
  90. package/common/src/assets/icons/svg/kz_organization.svg +0 -1
  91. package/common/src/assets/icons/svg/kz_post.svg +0 -1
  92. package/common/src/assets/icons/svg/kz_post_profile.svg +0 -1
  93. package/common/src/assets/icons/svg/kz_productCenter.svg +0 -1
  94. package/common/src/assets/icons/svg/kz_rabbit.svg +0 -1
  95. package/common/src/assets/icons/svg/kz_refresh.svg +0 -2
  96. package/common/src/assets/icons/svg/kz_renovation.svg +0 -1
  97. package/common/src/assets/icons/svg/kz_role.svg +0 -1
  98. package/common/src/assets/icons/svg/kz_roleGroup.svg +0 -1
  99. package/common/src/assets/icons/svg/kz_search.svg +0 -1
  100. package/common/src/assets/icons/svg/kz_sentinel.svg +0 -1
  101. package/common/src/assets/icons/svg/kz_server.svg +0 -1
  102. package/common/src/assets/icons/svg/kz_setting.svg +0 -1
  103. package/common/src/assets/icons/svg/kz_sex.svg +0 -1
  104. package/common/src/assets/icons/svg/kz_source.svg +0 -2
  105. package/common/src/assets/icons/svg/kz_strategy.svg +0 -2
  106. package/common/src/assets/icons/svg/kz_swagger.svg +0 -1
  107. package/common/src/assets/icons/svg/kz_system.svg +0 -1
  108. package/common/src/assets/icons/svg/kz_tenant.svg +0 -1
  109. package/common/src/assets/icons/svg/kz_tool.svg +0 -1
  110. package/common/src/assets/icons/svg/kz_user.svg +0 -1
  111. package/common/src/assets/icons/svg/language.svg +0 -1
  112. package/common/src/assets/icons/svg/link.svg +0 -1
  113. package/common/src/assets/icons/svg/list.svg +0 -1
  114. package/common/src/assets/icons/svg/lock.svg +0 -1
  115. package/common/src/assets/icons/svg/log.svg +0 -1
  116. package/common/src/assets/icons/svg/logininfor.svg +0 -1
  117. package/common/src/assets/icons/svg/mes-ad.svg +0 -21
  118. package/common/src/assets/icons/svg/mes-ic.svg +0 -16
  119. package/common/src/assets/icons/svg/mes-mfg-order.svg +0 -22
  120. package/common/src/assets/icons/svg/mes-tm.svg +0 -15
  121. package/common/src/assets/icons/svg/message.svg +0 -1
  122. package/common/src/assets/icons/svg/money.svg +0 -1
  123. package/common/src/assets/icons/svg/monitor.svg +0 -2
  124. package/common/src/assets/icons/svg/nacos.svg +0 -1
  125. package/common/src/assets/icons/svg/nested.svg +0 -1
  126. package/common/src/assets/icons/svg/number.svg +0 -1
  127. package/common/src/assets/icons/svg/online.svg +0 -1
  128. package/common/src/assets/icons/svg/password.svg +0 -1
  129. package/common/src/assets/icons/svg/pdf.svg +0 -1
  130. package/common/src/assets/icons/svg/people.svg +0 -1
  131. package/common/src/assets/icons/svg/peoples.svg +0 -1
  132. package/common/src/assets/icons/svg/phone.svg +0 -1
  133. package/common/src/assets/icons/svg/post.svg +0 -1
  134. package/common/src/assets/icons/svg/qq.svg +0 -1
  135. package/common/src/assets/icons/svg/question.svg +0 -1
  136. package/common/src/assets/icons/svg/radio.svg +0 -1
  137. package/common/src/assets/icons/svg/rate.svg +0 -1
  138. package/common/src/assets/icons/svg/row.svg +0 -1
  139. package/common/src/assets/icons/svg/search.svg +0 -1
  140. package/common/src/assets/icons/svg/select.svg +0 -1
  141. package/common/src/assets/icons/svg/sentinel.svg +0 -1
  142. package/common/src/assets/icons/svg/server.svg +0 -1
  143. package/common/src/assets/icons/svg/shop-call.svg +0 -14
  144. package/common/src/assets/icons/svg/shopping.svg +0 -1
  145. package/common/src/assets/icons/svg/size.svg +0 -1
  146. package/common/src/assets/icons/svg/skill.svg +0 -1
  147. package/common/src/assets/icons/svg/slider.svg +0 -1
  148. package/common/src/assets/icons/svg/star.svg +0 -1
  149. package/common/src/assets/icons/svg/stock-query.svg +0 -14
  150. package/common/src/assets/icons/svg/stock-report.svg +0 -14
  151. package/common/src/assets/icons/svg/stock-take.svg +0 -14
  152. package/common/src/assets/icons/svg/swagger.svg +0 -1
  153. package/common/src/assets/icons/svg/switch.svg +0 -1
  154. package/common/src/assets/icons/svg/system.svg +0 -2
  155. package/common/src/assets/icons/svg/tab.svg +0 -1
  156. package/common/src/assets/icons/svg/table.svg +0 -1
  157. package/common/src/assets/icons/svg/textarea.svg +0 -1
  158. package/common/src/assets/icons/svg/theme.svg +0 -1
  159. package/common/src/assets/icons/svg/time-range.svg +0 -1
  160. package/common/src/assets/icons/svg/time.svg +0 -1
  161. package/common/src/assets/icons/svg/tool.svg +0 -1
  162. package/common/src/assets/icons/svg/tree-table.svg +0 -1
  163. package/common/src/assets/icons/svg/tree.svg +0 -1
  164. package/common/src/assets/icons/svg/upload.svg +0 -1
  165. package/common/src/assets/icons/svg/user.svg +0 -1
  166. package/common/src/assets/icons/svg/validCode.svg +0 -1
  167. package/common/src/assets/icons/svg/wechat.svg +0 -1
  168. package/common/src/assets/icons/svg/xy-cancel.svg +0 -1
  169. package/common/src/assets/icons/svg/xy-choice.svg +0 -1
  170. package/common/src/assets/icons/svg/xy-choice2.svg +0 -31
  171. package/common/src/assets/icons/svg/zip.svg +0 -1
  172. package/common/src/assets/icons/svgo.yml +0 -22
  173. package/common/src/assets/images/dark.svg +0 -39
  174. package/common/src/assets/images/light.svg +0 -39
  175. package/common/src/assets/images/login-background.jpg +0 -0
  176. package/common/src/assets/images/logo.jpg +0 -0
  177. package/common/src/assets/images/profile.jpg +0 -0
  178. package/common/src/assets/images/xy-folder.png +0 -0
  179. package/common/src/assets/images/xy_email.png +0 -0
  180. package/common/src/assets/images/xy_message.png +0 -0
  181. package/common/src/assets/images/xy_notice.png +0 -0
  182. package/common/src/assets/logo/logo.png +0 -0
  183. package/common/src/assets/styles/btn.scss +0 -99
  184. package/common/src/assets/styles/element-ui.scss +0 -84
  185. package/common/src/assets/styles/element-variables.scss +0 -31
  186. package/common/src/assets/styles/index.scss +0 -207
  187. package/common/src/assets/styles/kezhi.scss +0 -100
  188. package/common/src/assets/styles/mixin.scss +0 -66
  189. package/common/src/assets/styles/ruoyi.scss +0 -350
  190. package/common/src/assets/styles/sidebar.scss +0 -185
  191. package/common/src/assets/styles/transition.scss +0 -48
  192. package/common/src/assets/styles/variables.scss +0 -52
  193. package/common/src/components/base/dialog/BaseDialog.vue +0 -140
  194. package/common/src/components/base/dialog/Dialog.js +0 -118
  195. package/common/src/components/base/dialog/dialogSetting.js +0 -65
  196. package/common/src/components/base/dialog/dialogType.js +0 -80
  197. package/common/src/components/base/dialog/index.js +0 -42
  198. package/common/src/components/base/dialog/printDialog.vue +0 -324
  199. package/common/src/components/base/dialog/tableDialog.vue +0 -187
  200. package/common/src/components/base/dialog/uploadDialog.vue +0 -149
  201. package/common/src/components/base/menuTab.js +0 -130
  202. package/common/src/components/basics/Breadcrumb/index.vue +0 -77
  203. package/common/src/components/basics/Crontab/day.vue +0 -179
  204. package/common/src/components/basics/Crontab/hour.vue +0 -122
  205. package/common/src/components/basics/Crontab/index.vue +0 -425
  206. package/common/src/components/basics/Crontab/min.vue +0 -120
  207. package/common/src/components/basics/Crontab/mouth.vue +0 -128
  208. package/common/src/components/basics/Crontab/result.vue +0 -566
  209. package/common/src/components/basics/Crontab/second.vue +0 -133
  210. package/common/src/components/basics/Crontab/week.vue +0 -167
  211. package/common/src/components/basics/Crontab/year.vue +0 -144
  212. package/common/src/components/basics/DictData/index.js +0 -24
  213. package/common/src/components/basics/DictTag/index.vue +0 -52
  214. package/common/src/components/basics/Editor/index.vue +0 -286
  215. package/common/src/components/basics/FileUpload/index.vue +0 -197
  216. package/common/src/components/basics/Hamburger/index.vue +0 -35
  217. package/common/src/components/basics/HeaderSearch/index.vue +0 -206
  218. package/common/src/components/basics/IconSelect/index.vue +0 -84
  219. package/common/src/components/basics/IconSelect/requireIcons.js +0 -10
  220. package/common/src/components/basics/Iframe/index.vue +0 -36
  221. package/common/src/components/basics/ImageUpload/index.vue +0 -204
  222. package/common/src/components/basics/Pagination/index.vue +0 -107
  223. package/common/src/components/basics/PanThumb/index.vue +0 -142
  224. package/common/src/components/basics/ParentView/index.vue +0 -3
  225. package/common/src/components/basics/RightPanel/index.vue +0 -149
  226. package/common/src/components/basics/RightToolbar/index.vue +0 -111
  227. package/common/src/components/basics/Screenfull/index.vue +0 -60
  228. package/common/src/components/basics/SizeSelect/index.vue +0 -60
  229. package/common/src/components/basics/SvgIcon/index.vue +0 -61
  230. package/common/src/components/basics/ThemePicker/index.vue +0 -183
  231. package/common/src/components/basics/TopNav/index.vue +0 -476
  232. package/common/src/components/custom/Editor/index.vue +0 -267
  233. package/common/src/components/custom/FileBox/index.vue +0 -293
  234. package/common/src/components/custom/FileBox/indexTs.vue +0 -280
  235. package/common/src/components/custom/ImageBox/index.vue +0 -208
  236. package/common/src/components/custom/Material/fileNameHelper.js +0 -38
  237. package/common/src/components/custom/Material/index.vue +0 -893
  238. package/common/src/components/custom/Material/indexTs.vue +0 -890
  239. package/common/src/components/custom/Notice/index.vue +0 -244
  240. package/common/src/plugins/auth.js +0 -60
  241. package/common/src/plugins/cache.js +0 -77
  242. package/common/src/plugins/download.js +0 -31
  243. package/common/src/plugins/index.js +0 -82
  244. package/common/src/plugins/modal.js +0 -75
  245. package/common/src/plugins/tab.js +0 -66
  246. package/common/src/utils/auth.js +0 -29
  247. package/common/src/utils/cache/bdCache.js +0 -202
  248. package/common/src/utils/cache/fdCache.js +0 -407
  249. package/common/src/utils/common.js +0 -141
  250. package/common/src/utils/dateHelper.js +0 -122
  251. package/common/src/utils/dialog.js +0 -35
  252. package/common/src/utils/dict/Dict.js +0 -82
  253. package/common/src/utils/dict/DictConverter.js +0 -17
  254. package/common/src/utils/dict/DictData.js +0 -13
  255. package/common/src/utils/dict/DictMeta.js +0 -38
  256. package/common/src/utils/dict/DictOptions.js +0 -51
  257. package/common/src/utils/dict/index.js +0 -33
  258. package/common/src/utils/element.js +0 -49
  259. package/common/src/utils/errorCode.js +0 -6
  260. package/common/src/utils/eventHub.js +0 -3
  261. package/common/src/utils/file.js +0 -38
  262. package/common/src/utils/index.js +0 -390
  263. package/common/src/utils/jsencrypt.js +0 -30
  264. package/common/src/utils/kezhi.js +0 -311
  265. package/common/src/utils/kezhiToolLibrary.js +0 -51
  266. package/common/src/utils/permission.js +0 -51
  267. package/common/src/utils/printService.js +0 -749
  268. package/common/src/utils/request.js +0 -209
  269. package/common/src/utils/ruoyi.js +0 -317
  270. package/common/src/utils/scroll-to.js +0 -58
  271. package/common/src/utils/supers.js +0 -25
  272. package/common/src/utils/utils.js +0 -614
  273. package/common/src/utils/validate.js +0 -105
  274. package/common/src/utils/websoketservice.js +0 -161
  275. package/common/src/utils/zipdownload.js +0 -42
  276. package/common/src/views/authorize.vue +0 -270
  277. package/common/src/views/error/401.vue +0 -88
  278. package/common/src/views/error/404.vue +0 -248
  279. package/common/src/views/login.vue +0 -350
  280. package/common/src/views/register.vue +0 -208
  281. package/common/src/views/sample/dialog/sampleEditDialog.vue +0 -279
  282. package/common/src/views/tenantLogin.vue +0 -331
  283. package/common/vue.config.js +0 -130
@@ -1,566 +0,0 @@
1
- <template>
2
- <div class="popup-result">
3
- <p class="title">最近5次运行时间</p>
4
- <ul class="popup-result-scroll">
5
- <template v-if='isShow'>
6
- <li v-for='item in resultList' :key="item">{{item}}</li>
7
- </template>
8
- <li v-else>计算结果中...</li>
9
- </ul>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- export default {
15
- data() {
16
- return {
17
- dayRule: '',
18
- dayRuleSup: '',
19
- dateArr: [],
20
- resultList: [],
21
- isShow: false
22
- }
23
- },
24
- name: 'crontab-result',
25
- methods: {
26
- // 表达式值变化时,开始去计算结果
27
- expressionChange() {
28
-
29
- // 计算开始-隐藏结果
30
- this.isShow = false;
31
- // 获取规则数组[0秒、1分、2时、3日、4月、5星期、6年]
32
- let ruleArr = this.$options.propsData.ex.split(' ');
33
- // 用于记录进入循环的次数
34
- let nums = 0;
35
- // 用于暂时存符号时间规则结果的数组
36
- let resultArr = [];
37
- // 获取当前时间精确至[年、月、日、时、分、秒]
38
- let nTime = new Date();
39
- let nYear = nTime.getFullYear();
40
- let nMouth = nTime.getMonth() + 1;
41
- let nDay = nTime.getDate();
42
- let nHour = nTime.getHours();
43
- let nMin = nTime.getMinutes();
44
- let nSecond = nTime.getSeconds();
45
- // 根据规则获取到近100年可能年数组、月数组等等
46
- this.getSecondArr(ruleArr[0]);
47
- this.getMinArr(ruleArr[1]);
48
- this.getHourArr(ruleArr[2]);
49
- this.getDayArr(ruleArr[3]);
50
- this.getMouthArr(ruleArr[4]);
51
- this.getWeekArr(ruleArr[5]);
52
- this.getYearArr(ruleArr[6], nYear);
53
- // 将获取到的数组赋值-方便使用
54
- let sDate = this.dateArr[0];
55
- let mDate = this.dateArr[1];
56
- let hDate = this.dateArr[2];
57
- let DDate = this.dateArr[3];
58
- let MDate = this.dateArr[4];
59
- let YDate = this.dateArr[5];
60
- // 获取当前时间在数组中的索引
61
- let sIdx = this.getIndex(sDate, nSecond);
62
- let mIdx = this.getIndex(mDate, nMin);
63
- let hIdx = this.getIndex(hDate, nHour);
64
- let DIdx = this.getIndex(DDate, nDay);
65
- let MIdx = this.getIndex(MDate, nMouth);
66
- let YIdx = this.getIndex(YDate, nYear);
67
- // 重置月日时分秒的函数(后面用的比较多)
68
- const resetSecond = function () {
69
- sIdx = 0;
70
- nSecond = sDate[sIdx]
71
- }
72
- const resetMin = function () {
73
- mIdx = 0;
74
- nMin = mDate[mIdx]
75
- resetSecond();
76
- }
77
- const resetHour = function () {
78
- hIdx = 0;
79
- nHour = hDate[hIdx]
80
- resetMin();
81
- }
82
- const resetDay = function () {
83
- DIdx = 0;
84
- nDay = DDate[DIdx]
85
- resetHour();
86
- }
87
- const resetMouth = function () {
88
- MIdx = 0;
89
- nMouth = MDate[MIdx]
90
- resetDay();
91
- }
92
- // 如果当前年份不为数组中当前值
93
- if (nYear !== YDate[YIdx]) {
94
- resetMouth();
95
- }
96
- // 如果当前月份不为数组中当前值
97
- if (nMouth !== MDate[MIdx]) {
98
- resetDay();
99
- }
100
- // 如果当前“日”不为数组中当前值
101
- if (nDay !== DDate[DIdx]) {
102
- resetHour();
103
- }
104
- // 如果当前“时”不为数组中当前值
105
- if (nHour !== hDate[hIdx]) {
106
- resetMin();
107
- }
108
- // 如果当前“分”不为数组中当前值
109
- if (nMin !== mDate[mIdx]) {
110
- resetSecond();
111
- }
112
-
113
- // 循环年份数组
114
- goYear: for (let Yi = YIdx; Yi < YDate.length; Yi++) {
115
- let YY = YDate[Yi];
116
- // 如果到达最大值时
117
- if (nMouth > MDate[MDate.length - 1]) {
118
- resetMouth();
119
- continue;
120
- }
121
- // 循环月份数组
122
- goMouth: for (let Mi = MIdx; Mi < MDate.length; Mi++) {
123
- // 赋值、方便后面运算
124
- let MM = MDate[Mi];
125
- MM = MM < 10 ? '0' + MM : MM;
126
- // 如果到达最大值时
127
- if (nDay > DDate[DDate.length - 1]) {
128
- resetDay();
129
- if (Mi == MDate.length - 1) {
130
- resetMouth();
131
- continue goYear;
132
- }
133
- continue;
134
- }
135
- // 循环日期数组
136
- goDay: for (let Di = DIdx; Di < DDate.length; Di++) {
137
- // 赋值、方便后面运算
138
- let DD = DDate[Di];
139
- let thisDD = DD < 10 ? '0' + DD : DD;
140
-
141
- // 如果到达最大值时
142
- if (nHour > hDate[hDate.length - 1]) {
143
- resetHour();
144
- if (Di == DDate.length - 1) {
145
- resetDay();
146
- if (Mi == MDate.length - 1) {
147
- resetMouth();
148
- continue goYear;
149
- }
150
- continue goMouth;
151
- }
152
- continue;
153
- }
154
-
155
- // 判断日期的合法性,不合法的话也是跳出当前循环
156
- if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true && this.dayRule !== 'workDay' && this.dayRule !== 'lastWeek' && this.dayRule !== 'lastDay') {
157
- resetDay();
158
- continue goMouth;
159
- }
160
- // 如果日期规则中有值时
161
- if (this.dayRule == 'lastDay') {
162
- //如果不是合法日期则需要将前将日期调到合法日期即月末最后一天
163
-
164
- if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
165
- while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
166
- DD--;
167
-
168
- thisDD = DD < 10 ? '0' + DD : DD;
169
- }
170
- }
171
- } else if (this.dayRule == 'workDay') {
172
- //校验并调整如果是2月30号这种日期传进来时需调整至正常月底
173
- if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
174
- while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
175
- DD--;
176
- thisDD = DD < 10 ? '0' + DD : DD;
177
- }
178
- }
179
- // 获取达到条件的日期是星期X
180
- let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week');
181
- // 当星期日时
182
- if (thisWeek == 0) {
183
- //先找下一个日,并判断是否为月底
184
- DD++;
185
- thisDD = DD < 10 ? '0' + DD : DD;
186
- //判断下一日已经不是合法日期
187
- if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
188
- DD -= 3;
189
- }
190
- } else if (thisWeek == 6) {
191
- //当星期6时只需判断不是1号就可进行操作
192
- if (this.dayRuleSup !== 1) {
193
- DD--;
194
- } else {
195
- DD += 2;
196
- }
197
- }
198
- } else if (this.dayRule == 'weekDay') {
199
- //如果指定了是星期几
200
- //获取当前日期是属于星期几
201
- let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
202
- //校验当前星期是否在星期池(dayRuleSup)中
203
- if (Array.indexOf(this.dayRuleSup, thisWeek) < 0) {
204
- // 如果到达最大值时
205
- if (Di == DDate.length - 1) {
206
- resetDay();
207
- if (Mi == MDate.length - 1) {
208
- resetMouth();
209
- continue goYear;
210
- }
211
- continue goMouth;
212
- }
213
- continue;
214
- }
215
- } else if (this.dayRule == 'assWeek') {
216
- //如果指定了是第几周的星期几
217
- //获取每月1号是属于星期几
218
- let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
219
- if (this.dayRuleSup[1] >= thisWeek) {
220
- DD = (this.dayRuleSup[0] - 1) * 7 + this.dayRuleSup[1] - thisWeek + 1;
221
- } else {
222
- DD = this.dayRuleSup[0] * 7 + this.dayRuleSup[1] - thisWeek + 1;
223
- }
224
- } else if (this.dayRule == 'lastWeek') {
225
- //如果指定了每月最后一个星期几
226
- //校验并调整如果是2月30号这种日期传进来时需调整至正常月底
227
- if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
228
- while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
229
- DD--;
230
- thisDD = DD < 10 ? '0' + DD : DD;
231
- }
232
- }
233
- //获取月末最后一天是星期几
234
- let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week');
235
- //找到要求中最近的那个星期几
236
- if (this.dayRuleSup < thisWeek) {
237
- DD -= thisWeek - this.dayRuleSup;
238
- } else if (this.dayRuleSup > thisWeek) {
239
- DD -= 7 - (this.dayRuleSup - thisWeek)
240
- }
241
- }
242
- // 判断时间值是否小于10置换成“05”这种格式
243
- DD = DD < 10 ? '0' + DD : DD;
244
-
245
- // 循环“时”数组
246
- goHour: for (let hi = hIdx; hi < hDate.length; hi++) {
247
- let hh = hDate[hi] < 10 ? '0' + hDate[hi] : hDate[hi]
248
-
249
- // 如果到达最大值时
250
- if (nMin > mDate[mDate.length - 1]) {
251
- resetMin();
252
- if (hi == hDate.length - 1) {
253
- resetHour();
254
- if (Di == DDate.length - 1) {
255
- resetDay();
256
- if (Mi == MDate.length - 1) {
257
- resetMouth();
258
- continue goYear;
259
- }
260
- continue goMouth;
261
- }
262
- continue goDay;
263
- }
264
- continue;
265
- }
266
- // 循环"分"数组
267
- goMin: for (let mi = mIdx; mi < mDate.length; mi++) {
268
- let mm = mDate[mi] < 10 ? '0' + mDate[mi] : mDate[mi];
269
-
270
- // 如果到达最大值时
271
- if (nSecond > sDate[sDate.length - 1]) {
272
- resetSecond();
273
- if (mi == mDate.length - 1) {
274
- resetMin();
275
- if (hi == hDate.length - 1) {
276
- resetHour();
277
- if (Di == DDate.length - 1) {
278
- resetDay();
279
- if (Mi == MDate.length - 1) {
280
- resetMouth();
281
- continue goYear;
282
- }
283
- continue goMouth;
284
- }
285
- continue goDay;
286
- }
287
- continue goHour;
288
- }
289
- continue;
290
- }
291
- // 循环"秒"数组
292
- goSecond: for (let si = sIdx; si <= sDate.length - 1; si++) {
293
- let ss = sDate[si] < 10 ? '0' + sDate[si] : sDate[si];
294
- // 添加当前时间(时间合法性在日期循环时已经判断)
295
- if (MM !== '00' && DD !== '00') {
296
- resultArr.push(YY + '-' + MM + '-' + DD + ' ' + hh + ':' + mm + ':' + ss)
297
- nums++;
298
- }
299
- //如果条数满了就退出循环
300
- if (nums == 5) break goYear;
301
- //如果到达最大值时
302
- if (si == sDate.length - 1) {
303
- resetSecond();
304
- if (mi == mDate.length - 1) {
305
- resetMin();
306
- if (hi == hDate.length - 1) {
307
- resetHour();
308
- if (Di == DDate.length - 1) {
309
- resetDay();
310
- if (Mi == MDate.length - 1) {
311
- resetMouth();
312
- continue goYear;
313
- }
314
- continue goMouth;
315
- }
316
- continue goDay;
317
- }
318
- continue goHour;
319
- }
320
- continue goMin;
321
- }
322
- } //goSecond
323
- } //goMin
324
- }//goHour
325
- }//goDay
326
- }//goMouth
327
- }
328
- // 判断100年内的结果条数
329
- if (resultArr.length == 0) {
330
- this.resultList = ['没有达到条件的结果!'];
331
- } else {
332
- this.resultList = resultArr;
333
- if (resultArr.length !== 5) {
334
- this.resultList.push('最近100年内只有上面' + resultArr.length + '条结果!')
335
- }
336
- }
337
- // 计算完成-显示结果
338
- this.isShow = true;
339
-
340
-
341
- },
342
- //用于计算某位数字在数组中的索引
343
- getIndex(arr, value) {
344
- if (value <= arr[0] || value > arr[arr.length - 1]) {
345
- return 0;
346
- } else {
347
- for (let i = 0; i < arr.length - 1; i++) {
348
- if (value > arr[i] && value <= arr[i + 1]) {
349
- return i + 1;
350
- }
351
- }
352
- }
353
- },
354
- // 获取"年"数组
355
- getYearArr(rule, year) {
356
- this.dateArr[5] = this.getOrderArr(year, year + 100);
357
- if (rule !== undefined) {
358
- if (rule.indexOf('-') >= 0) {
359
- this.dateArr[5] = this.getCycleArr(rule, year + 100, false)
360
- } else if (rule.indexOf('/') >= 0) {
361
- this.dateArr[5] = this.getAverageArr(rule, year + 100)
362
- } else if (rule !== '*') {
363
- this.dateArr[5] = this.getAssignArr(rule)
364
- }
365
- }
366
- },
367
- // 获取"月"数组
368
- getMouthArr(rule) {
369
- this.dateArr[4] = this.getOrderArr(1, 12);
370
- if (rule.indexOf('-') >= 0) {
371
- this.dateArr[4] = this.getCycleArr(rule, 12, false)
372
- } else if (rule.indexOf('/') >= 0) {
373
- this.dateArr[4] = this.getAverageArr(rule, 12)
374
- } else if (rule !== '*') {
375
- this.dateArr[4] = this.getAssignArr(rule)
376
- }
377
- },
378
- // 获取"日"数组-主要为日期规则
379
- getWeekArr(rule) {
380
- //只有当日期规则的两个值均为“”时则表达日期是有选项的
381
- if (this.dayRule == '' && this.dayRuleSup == '') {
382
- if (rule.indexOf('-') >= 0) {
383
- this.dayRule = 'weekDay';
384
- this.dayRuleSup = this.getCycleArr(rule, 7, false)
385
- } else if (rule.indexOf('#') >= 0) {
386
- this.dayRule = 'assWeek';
387
- let matchRule = rule.match(/[0-9]{1}/g);
388
- this.dayRuleSup = [Number(matchRule[0]), Number(matchRule[1])];
389
- this.dateArr[3] = [1];
390
- if (this.dayRuleSup[1] == 7) {
391
- this.dayRuleSup[1] = 0;
392
- }
393
- } else if (rule.indexOf('L') >= 0) {
394
- this.dayRule = 'lastWeek';
395
- this.dayRuleSup = Number(rule.match(/[0-9]{1,2}/g)[0]);
396
- this.dateArr[3] = [31];
397
- if (this.dayRuleSup == 7) {
398
- this.dayRuleSup = 0;
399
- }
400
- } else if (rule !== '*' && rule !== '?') {
401
- this.dayRule = 'weekDay';
402
- this.dayRuleSup = this.getAssignArr(rule)
403
- }
404
- //如果weekDay时将7调整为0【week值0即是星期日】
405
- if (this.dayRule == 'weekDay') {
406
- for (let i = 0; i < this.dayRuleSup.length; i++) {
407
- if (this.dayRuleSup[i] == 7) {
408
- this.dayRuleSup[i] = 0;
409
- }
410
- }
411
- }
412
- }
413
- },
414
- // 获取"日"数组-少量为日期规则
415
- getDayArr(rule) {
416
- this.dateArr[3] = this.getOrderArr(1, 31);
417
- this.dayRule = '';
418
- this.dayRuleSup = '';
419
- if (rule.indexOf('-') >= 0) {
420
- this.dateArr[3] = this.getCycleArr(rule, 31, false)
421
- this.dayRuleSup = 'null';
422
- } else if (rule.indexOf('/') >= 0) {
423
- this.dateArr[3] = this.getAverageArr(rule, 31)
424
- this.dayRuleSup = 'null';
425
- } else if (rule.indexOf('W') >= 0) {
426
- this.dayRule = 'workDay';
427
- this.dayRuleSup = Number(rule.match(/[0-9]{1,2}/g)[0]);
428
- this.dateArr[3] = [this.dayRuleSup];
429
- } else if (rule.indexOf('L') >= 0) {
430
- this.dayRule = 'lastDay';
431
- this.dayRuleSup = 'null';
432
- this.dateArr[3] = [31];
433
- } else if (rule !== '*' && rule !== '?') {
434
- this.dateArr[3] = this.getAssignArr(rule)
435
- this.dayRuleSup = 'null';
436
- } else if (rule == '*') {
437
- this.dayRuleSup = 'null';
438
- }
439
- },
440
- // 获取"时"数组
441
- getHourArr(rule) {
442
- this.dateArr[2] = this.getOrderArr(0, 23);
443
- if (rule.indexOf('-') >= 0) {
444
- this.dateArr[2] = this.getCycleArr(rule, 24, true)
445
- } else if (rule.indexOf('/') >= 0) {
446
- this.dateArr[2] = this.getAverageArr(rule, 23)
447
- } else if (rule !== '*') {
448
- this.dateArr[2] = this.getAssignArr(rule)
449
- }
450
- },
451
- // 获取"分"数组
452
- getMinArr(rule) {
453
- this.dateArr[1] = this.getOrderArr(0, 59);
454
- if (rule.indexOf('-') >= 0) {
455
- this.dateArr[1] = this.getCycleArr(rule, 60, true)
456
- } else if (rule.indexOf('/') >= 0) {
457
- this.dateArr[1] = this.getAverageArr(rule, 59)
458
- } else if (rule !== '*') {
459
- this.dateArr[1] = this.getAssignArr(rule)
460
- }
461
- },
462
- // 获取"秒"数组
463
- getSecondArr(rule) {
464
- this.dateArr[0] = this.getOrderArr(0, 59);
465
- if (rule.indexOf('-') >= 0) {
466
- this.dateArr[0] = this.getCycleArr(rule, 60, true)
467
- } else if (rule.indexOf('/') >= 0) {
468
- this.dateArr[0] = this.getAverageArr(rule, 59)
469
- } else if (rule !== '*') {
470
- this.dateArr[0] = this.getAssignArr(rule)
471
- }
472
- },
473
- // 根据传进来的min-max返回一个顺序的数组
474
- getOrderArr(min, max) {
475
- let arr = [];
476
- for (let i = min; i <= max; i++) {
477
- arr.push(i);
478
- }
479
- return arr;
480
- },
481
- // 根据规则中指定的零散值返回一个数组
482
- getAssignArr(rule) {
483
- let arr = [];
484
- let assiginArr = rule.split(',');
485
- for (let i = 0; i < assiginArr.length; i++) {
486
- arr[i] = Number(assiginArr[i])
487
- }
488
- arr.sort(this.compare)
489
- return arr;
490
- },
491
- // 根据一定算术规则计算返回一个数组
492
- getAverageArr(rule, limit) {
493
- let arr = [];
494
- let agArr = rule.split('/');
495
- let min = Number(agArr[0]);
496
- let step = Number(agArr[1]);
497
- while (min <= limit) {
498
- arr.push(min);
499
- min += step;
500
- }
501
- return arr;
502
- },
503
- // 根据规则返回一个具有周期性的数组
504
- getCycleArr(rule, limit, status) {
505
- //status--表示是否从0开始(则从1开始)
506
- let arr = [];
507
- let cycleArr = rule.split('-');
508
- let min = Number(cycleArr[0]);
509
- let max = Number(cycleArr[1]);
510
- if (min > max) {
511
- max += limit;
512
- }
513
- for (let i = min; i <= max; i++) {
514
- let add = 0;
515
- if (status == false && i % limit == 0) {
516
- add = limit;
517
- }
518
- arr.push(Math.round(i % limit + add))
519
- }
520
- arr.sort(this.compare)
521
- return arr;
522
- },
523
- //比较数字大小(用于Array.sort)
524
- compare(value1, value2) {
525
- if (value2 - value1 > 0) {
526
- return -1;
527
- } else {
528
- return 1;
529
- }
530
- },
531
- // 格式化日期格式如:2017-9-19 18:04:33
532
- formatDate(value, type) {
533
- // 计算日期相关值
534
- let time = typeof value == 'number' ? new Date(value) : value;
535
- let Y = time.getFullYear();
536
- let M = time.getMonth() + 1;
537
- let D = time.getDate();
538
- let h = time.getHours();
539
- let m = time.getMinutes();
540
- let s = time.getSeconds();
541
- let week = time.getDay();
542
- // 如果传递了type的话
543
- if (type == undefined) {
544
- return Y + '-' + (M < 10 ? '0' + M : M) + '-' + (D < 10 ? '0' + D : D) + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
545
- } else if (type == 'week') {
546
- return week;
547
- }
548
- },
549
- // 检查日期是否存在
550
- checkDate(value) {
551
- let time = new Date(value);
552
- let format = this.formatDate(time)
553
- return value == format ? true : false;
554
- }
555
- },
556
- watch: {
557
- 'ex': 'expressionChange'
558
- },
559
- props: ['ex'],
560
- mounted: function () {
561
- // 初始化 获取一次结果
562
- this.expressionChange();
563
- }
564
- }
565
-
566
- </script>
@@ -1,133 +0,0 @@
1
- <template>
2
- <el-form size="small">
3
- <el-form-item>
4
- <el-radio v-model='radioValue' :label="1">
5
- 秒,允许的通配符[, - * /]
6
- </el-radio>
7
- </el-form-item>
8
-
9
- <el-form-item>
10
- <el-radio v-model='radioValue' :label="2">
11
- 周期从
12
- <el-input-number v-model='cycle01' :min="0" :max="60" /> -
13
- <el-input-number v-model='cycle02' :min="0" :max="60" /> 秒
14
- </el-radio>
15
- </el-form-item>
16
-
17
- <el-form-item>
18
- <el-radio v-model='radioValue' :label="3">
19
-
20
- <el-input-number v-model='average01' :min="0" :max="60" /> 秒开始,每
21
- <el-input-number v-model='average02' :min="0" :max="60" /> 秒执行一次
22
- </el-radio>
23
- </el-form-item>
24
-
25
- <el-form-item>
26
- <el-radio v-model='radioValue' :label="4">
27
- 指定
28
- <el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
29
- <el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
30
- </el-select>
31
- </el-radio>
32
- </el-form-item>
33
- </el-form>
34
- </template>
35
-
36
- <script>
37
- export default {
38
- data() {
39
- return {
40
- radioValue: 1,
41
- cycle01: 1,
42
- cycle02: 2,
43
- average01: 0,
44
- average02: 1,
45
- checkboxList: [],
46
- checkNum: this.$options.propsData.check
47
- }
48
- },
49
- name: 'crontab-second',
50
- props: ['check', 'radioParent'],
51
- methods: {
52
- // 单选按钮值变化时
53
- radioChange() {
54
- switch (this.radioValue) {
55
- case 1:
56
- this.$emit('update', 'second', '*', 'second');
57
- this.$emit('update', 'min', '*', 'second');
58
- break;
59
- case 2:
60
- this.$emit('update', 'second', this.cycle01 + '-' + this.cycle02);
61
- break;
62
- case 3:
63
- this.$emit('update', 'second', this.average01 + '/' + this.average02);
64
- break;
65
- case 4:
66
- this.$emit('update', 'second', this.checkboxString);
67
- break;
68
- }
69
- },
70
- // 周期两个值变化时
71
- cycleChange() {
72
- if (this.radioValue == '2') {
73
- this.$emit('update', 'second', this.cycleTotal);
74
- }
75
- },
76
- // 平均两个值变化时
77
- averageChange() {
78
- if (this.radioValue == '3') {
79
- this.$emit('update', 'second', this.averageTotal);
80
- }
81
- },
82
- // checkbox值变化时
83
- checkboxChange() {
84
- if (this.radioValue == '4') {
85
- this.$emit('update', 'second', this.checkboxString);
86
- }
87
- },
88
- othChange() {
89
- //反解析
90
- let ins = this.cron.second
91
- ('反解析 second', ins);
92
- if (ins === '*') {
93
- this.radioValue = 1;
94
- } else if (ins.indexOf('-') > -1) {
95
- this.radioValue = 2
96
- } else if (ins.indexOf('/') > -1) {
97
- this.radioValue = 3
98
- } else {
99
- this.radioValue = 4
100
- this.checkboxList = ins.split(',')
101
- }
102
- }
103
- },
104
- watch: {
105
- "radioValue": "radioChange",
106
- 'cycleTotal': 'cycleChange',
107
- 'averageTotal': 'averageChange',
108
- 'checkboxString': 'checkboxChange',
109
- radioParent() {
110
- this.radioValue = this.radioParent
111
- }
112
- },
113
- computed: {
114
- // 计算两个周期值
115
- cycleTotal: function () {
116
- this.cycle01 = this.checkNum(this.cycle01, 0, 59)
117
- this.cycle02 = this.checkNum(this.cycle02, 0, 59)
118
- return this.cycle01 + '-' + this.cycle02;
119
- },
120
- // 计算平均用到的值
121
- averageTotal: function () {
122
- this.average01 = this.checkNum(this.average01, 0, 59)
123
- this.average02 = this.checkNum(this.average02, 1, 59)
124
- return this.average01 + '/' + this.average02;
125
- },
126
- // 计算勾选的checkbox值合集
127
- checkboxString: function () {
128
- let str = this.checkboxList.join();
129
- return str == '' ? '*' : str;
130
- }
131
- }
132
- }
133
- </script>