@winjs-dev/create-win 1.0.0-alpha.2

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 (150) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +195 -0
  3. package/bin/create-win.js +4 -0
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +23 -0
  6. package/dist/index.d.ts +45 -0
  7. package/dist/index.js +396 -0
  8. package/dist/template.d.ts +13 -0
  9. package/dist/template.js +123 -0
  10. package/package.json +36 -0
  11. package/templates/app/.cursor/rules/clean-code.mdc +55 -0
  12. package/templates/app/.cursor/rules/general.mdc +51 -0
  13. package/templates/app/.cursor/rules/git-conventional-commit-messages.mdc +127 -0
  14. package/templates/app/.cursor/rules/gitflow.mdc +111 -0
  15. package/templates/app/.cursor/rules/project-structure.mdc +69 -0
  16. package/templates/app/.cursor/rules/typescript.mdc +57 -0
  17. package/templates/app/.cursor/rules/vue.mdc +86 -0
  18. package/templates/app/.editorconfig.tpl +23 -0
  19. package/templates/app/.eslintignore +13 -0
  20. package/templates/app/.eslintrc.js +9 -0
  21. package/templates/app/.gitignore.tpl +55 -0
  22. package/templates/app/.husky/commit-msg +6 -0
  23. package/templates/app/.husky/pre-commit +5 -0
  24. package/templates/app/.lintstagedrc.tpl +5 -0
  25. package/templates/app/.npmrc.tpl +2 -0
  26. package/templates/app/.prettierignore +13 -0
  27. package/templates/app/.prettierrc.js +4 -0
  28. package/templates/app/.stylelintignore +6 -0
  29. package/templates/app/.stylelintrc.js +16 -0
  30. package/templates/app/.winrc.ts.tpl +95 -0
  31. package/templates/app/README.md +244 -0
  32. package/templates/app/commitlint.config.js +3 -0
  33. package/templates/app/f2elint.config.js +6 -0
  34. package/templates/app/package.json.tpl +34 -0
  35. package/templates/app/plugin.ts.tpl +23 -0
  36. package/templates/app/src/app.js +55 -0
  37. package/templates/app/src/assets/fonts/demo.css +412 -0
  38. package/templates/app/src/assets/fonts/demo_fontclass.html +42 -0
  39. package/templates/app/src/assets/fonts/demo_symbol.html +69 -0
  40. package/templates/app/src/assets/fonts/demo_unicode.html +77 -0
  41. package/templates/app/src/assets/fonts/iconfont.css +20 -0
  42. package/templates/app/src/assets/fonts/iconfont.eot +0 -0
  43. package/templates/app/src/assets/fonts/iconfont.js +96 -0
  44. package/templates/app/src/assets/fonts/iconfont.svg +36 -0
  45. package/templates/app/src/assets/fonts/iconfont.ttf +0 -0
  46. package/templates/app/src/assets/fonts/iconfont.woff +0 -0
  47. package/templates/app/src/assets/img/logo.png +0 -0
  48. package/templates/app/src/assets/js/.gitkeep +0 -0
  49. package/templates/app/src/assets/style/app.less +5 -0
  50. package/templates/app/src/assets/style/main.less +39 -0
  51. package/templates/app/src/assets/style/variable.less +53 -0
  52. package/templates/app/src/constant.js +5 -0
  53. package/templates/app/src/global.less +1 -0
  54. package/templates/app/src/icons/cat.svg +1 -0
  55. package/templates/app/src/icons/dog.svg +1 -0
  56. package/templates/app/src/layouts/index.vue +15 -0
  57. package/templates/app/src/pages/docs.vue +5 -0
  58. package/templates/app/src/pages/hello/index.vue +88 -0
  59. package/templates/app/src/pages/hello/style.less +41 -0
  60. package/templates/app/src/pages/index.vue +9 -0
  61. package/templates/app/src/services/RESTFULURL.js +3 -0
  62. package/templates/app/src/services/autoMatchBaseUrl.js +18 -0
  63. package/templates/app/src/services/index.js +11 -0
  64. package/templates/app/src/services/request.js +178 -0
  65. package/templates/app/tsconfig.json.tpl +3 -0
  66. package/templates/app/typings.d.ts +1 -0
  67. package/templates/pc/.cursor/rules/clean-code.mdc +55 -0
  68. package/templates/pc/.cursor/rules/general.mdc +51 -0
  69. package/templates/pc/.cursor/rules/git-conventional-commit-messages.mdc +127 -0
  70. package/templates/pc/.cursor/rules/gitflow.mdc +111 -0
  71. package/templates/pc/.cursor/rules/project-structure.mdc +69 -0
  72. package/templates/pc/.cursor/rules/typescript.mdc +57 -0
  73. package/templates/pc/.cursor/rules/vue.mdc +86 -0
  74. package/templates/pc/.editorconfig.tpl +23 -0
  75. package/templates/pc/.eslintignore +13 -0
  76. package/templates/pc/.eslintrc.js +9 -0
  77. package/templates/pc/.gitignore.tpl +54 -0
  78. package/templates/pc/.husky/commit-msg +6 -0
  79. package/templates/pc/.husky/pre-commit +5 -0
  80. package/templates/pc/.lintstagedrc.tpl +5 -0
  81. package/templates/pc/.npmrc.tpl +2 -0
  82. package/templates/pc/.prettierignore +13 -0
  83. package/templates/pc/.prettierrc.js +4 -0
  84. package/templates/pc/.stylelintignore +6 -0
  85. package/templates/pc/.stylelintrc.js +16 -0
  86. package/templates/pc/.winrc.ts.tpl +74 -0
  87. package/templates/pc/README.md +255 -0
  88. package/templates/pc/commitlint.config.js +3 -0
  89. package/templates/pc/f2elint.config.js +6 -0
  90. package/templates/pc/package.json.tpl +33 -0
  91. package/templates/pc/plugin.ts.tpl +23 -0
  92. package/templates/pc/src/app.js +55 -0
  93. package/templates/pc/src/assets/fonts/demo.css +412 -0
  94. package/templates/pc/src/assets/fonts/demo_fontclass.html +42 -0
  95. package/templates/pc/src/assets/fonts/demo_symbol.html +69 -0
  96. package/templates/pc/src/assets/fonts/demo_unicode.html +77 -0
  97. package/templates/pc/src/assets/fonts/iconfont.css +20 -0
  98. package/templates/pc/src/assets/fonts/iconfont.eot +0 -0
  99. package/templates/pc/src/assets/fonts/iconfont.js +96 -0
  100. package/templates/pc/src/assets/fonts/iconfont.svg +36 -0
  101. package/templates/pc/src/assets/fonts/iconfont.ttf +0 -0
  102. package/templates/pc/src/assets/fonts/iconfont.woff +0 -0
  103. package/templates/pc/src/assets/img/logo.png +0 -0
  104. package/templates/pc/src/assets/js/.gitkeep +0 -0
  105. package/templates/pc/src/assets/style/app.less +5 -0
  106. package/templates/pc/src/assets/style/main.less +39 -0
  107. package/templates/pc/src/assets/style/variable.less +53 -0
  108. package/templates/pc/src/constant.js +5 -0
  109. package/templates/pc/src/global.less +1 -0
  110. package/templates/pc/src/icons/cat.svg +1 -0
  111. package/templates/pc/src/icons/dog.svg +1 -0
  112. package/templates/pc/src/layouts/index.vue +16 -0
  113. package/templates/pc/src/pages/docs.vue +5 -0
  114. package/templates/pc/src/pages/hello/index.vue +88 -0
  115. package/templates/pc/src/pages/hello/style.less +41 -0
  116. package/templates/pc/src/pages/index.vue +9 -0
  117. package/templates/pc/src/services/RESTFULURL.js +3 -0
  118. package/templates/pc/src/services/autoMatchBaseUrl.js +18 -0
  119. package/templates/pc/src/services/index.js +11 -0
  120. package/templates/pc/src/services/request.js +178 -0
  121. package/templates/pc/tsconfig.json.tpl +3 -0
  122. package/templates/pc/typings.d.ts +1 -0
  123. package/templates/plugin/.fatherrc.ts +5 -0
  124. package/templates/plugin/.gitignore.tpl +2 -0
  125. package/templates/plugin/.npmrc.tpl +2 -0
  126. package/templates/plugin/README.md.tpl +29 -0
  127. package/templates/plugin/package.json.tpl +26 -0
  128. package/templates/plugin/src/index.ts.tpl +5 -0
  129. package/templates/plugin/tsconfig.json +19 -0
  130. package/templates/sample/.cursor/rules/clean-code.mdc +55 -0
  131. package/templates/sample/.cursor/rules/general.mdc +51 -0
  132. package/templates/sample/.cursor/rules/git-conventional-commit-messages.mdc +127 -0
  133. package/templates/sample/.cursor/rules/gitflow.mdc +111 -0
  134. package/templates/sample/.cursor/rules/project-structure.mdc +69 -0
  135. package/templates/sample/.cursor/rules/typescript.mdc +57 -0
  136. package/templates/sample/.cursor/rules/vue.mdc +86 -0
  137. package/templates/sample/.editorconfig.tpl +23 -0
  138. package/templates/sample/.gitignore.tpl +19 -0
  139. package/templates/sample/.npmrc.tpl +2 -0
  140. package/templates/sample/.winrc.ts.tpl +7 -0
  141. package/templates/sample/package.json.tpl +21 -0
  142. package/templates/sample/plugin.ts.tpl +7 -0
  143. package/templates/sample/src/assets/img/logo.png +0 -0
  144. package/templates/sample/src/layouts/index.vue +8 -0
  145. package/templates/sample/src/pages/docs.vue +5 -0
  146. package/templates/sample/src/pages/hello/index.vue +77 -0
  147. package/templates/sample/src/pages/hello/style.less +41 -0
  148. package/templates/sample/src/pages/index.vue +9 -0
  149. package/templates/sample/tsconfig.json.tpl +3 -0
  150. package/templates/sample/typings.d.ts +1 -0
@@ -0,0 +1,96 @@
1
+ (function (window) {
2
+ var svgSprite =
3
+ '<svg>' +
4
+ '' +
5
+ '<symbol id="icon-clock" viewBox="0 0 1024 1024">' +
6
+ '' +
7
+ '<path d="M821.76 875.712l33.344 33.28c18.688 18.56 37.568 37.056 56 55.936a33.792 33.792 0 0 1-15.36 57.088 33.984 33.984 0 0 1-34.112-10.24l-89.984-89.92c-1.792-1.792-2.88-4.288-3.52-5.312-171.584 97.152-340.864 97.088-511.04 0.768-1.152 1.088-3.072 2.816-4.864 4.672-30.4 30.272-60.544 60.672-91.136 90.752a33.92 33.92 0 0 1-56.96-13.568c-4.096-13.632-0.32-25.408 9.728-35.456l82.56-82.304c1.856-1.792 4.224-3.072 6.4-4.672C88.576 774.144 30.08 648.192 34.944 496c4.224-133.376 57.6-245.888 155.904-336.32C380.608-14.848 678.72-3.84 857.984 183.68a476.8 476.8 0 0 1-36.224 692.032zM102.4 512.32c0 225.024 183.232 408.64 407.872 408.768 227.648 0.128 410.688-181.632 411.072-408.192 0.384-225.856-183.424-409.472-409.472-409.216C285.696 103.936 102.4 286.848 102.4 512.32zM199.872 0.768c5.888 1.152 12.16 1.472 17.728 3.584 14.72 5.44 23.552 21.248 21.12 36.096a33.472 33.472 0 0 1-32.448 29.056c-30.592 0.576-58.624 8.832-83.008 27.52-35.968 27.456-53.888 64.256-55.04 109.312a32.448 32.448 0 0 1-19.52 30.272 32.192 32.192 0 0 1-34.688-3.392 32.512 32.512 0 0 1-13.824-28.608C2.304 132.48 32.896 75.84 92.672 35.2 124.8 13.44 160.832 3.008 199.872 0.768zM1023.744 202.496a34.368 34.368 0 0 1-44.16 36.096 33.984 33.984 0 0 1-24.064-33.024 131.84 131.84 0 0 0-20.416-70.848c-26.88-41.984-65.664-63.36-115.456-65.024-24.576-0.832-40.64-22.912-32.768-45.312a33.536 33.536 0 0 1 33.28-22.592c76.288 2.048 134.72 35.648 174.976 100.288 18.24 29.312 27.072 61.76 28.608 100.416z" ></path>' +
8
+ '' +
9
+ '<path d="M477.952 409.984c0-33.92-0.128-67.84 0-101.696a33.472 33.472 0 0 1 22.848-32.384 34.176 34.176 0 0 1 37.632 10.88c5.76 7.04 7.744 15.36 7.744 24.32 0 60.032 0 120-0.128 180.032 0 5.12 1.344 8.704 5.056 12.288 40.128 39.808 80.128 79.744 120.064 119.808 15.36 15.36 14.976 38.016-0.448 51.2a33.856 33.856 0 0 1-45.76-1.216c-9.408-8.896-18.368-18.24-27.52-27.392-35.2-35.072-70.272-70.4-105.664-105.216a43.648 43.648 0 0 1-14.016-33.92c0.512-32.256 0.192-64.448 0.192-96.704z" ></path>' +
10
+ '' +
11
+ '</symbol>' +
12
+ '' +
13
+ '</svg>';
14
+ var script = (function () {
15
+ var scripts = document.getElementsByTagName('script');
16
+ return scripts[scripts.length - 1];
17
+ })();
18
+ var shouldInjectCss = script.getAttribute('data-injectcss');
19
+ var ready = function (fn) {
20
+ if (document.addEventListener) {
21
+ if (~['complete', 'loaded', 'interactive'].indexOf(document.readyState)) {
22
+ setTimeout(fn, 0);
23
+ } else {
24
+ var loadFn = function () {
25
+ document.removeEventListener('DOMContentLoaded', loadFn, false);
26
+ fn();
27
+ };
28
+ document.addEventListener('DOMContentLoaded', loadFn, false);
29
+ }
30
+ } else if (document.attachEvent) {
31
+ IEContentLoaded(window, fn);
32
+ }
33
+ function IEContentLoaded(w, fn) {
34
+ var d = w.document,
35
+ done = false,
36
+ init = function () {
37
+ if (!done) {
38
+ done = true;
39
+ fn();
40
+ }
41
+ };
42
+ var polling = function () {
43
+ try {
44
+ d.documentElement.doScroll('left');
45
+ } catch (e) {
46
+ setTimeout(polling, 50);
47
+ return;
48
+ }
49
+ init();
50
+ };
51
+ polling();
52
+ d.onreadystatechange = function () {
53
+ if (d.readyState == 'complete') {
54
+ d.onreadystatechange = null;
55
+ init();
56
+ }
57
+ };
58
+ }
59
+ };
60
+ var before = function (el, target) {
61
+ target.parentNode.insertBefore(el, target);
62
+ };
63
+ var prepend = function (el, target) {
64
+ if (target.firstChild) {
65
+ before(el, target.firstChild);
66
+ } else {
67
+ target.appendChild(el);
68
+ }
69
+ };
70
+ function appendSvg() {
71
+ var div, svg;
72
+ div = document.createElement('div');
73
+ div.innerHTML = svgSprite;
74
+ svgSprite = null;
75
+ svg = div.getElementsByTagName('svg')[0];
76
+ if (svg) {
77
+ svg.setAttribute('aria-hidden', 'true');
78
+ svg.style.position = 'absolute';
79
+ svg.style.width = 0;
80
+ svg.style.height = 0;
81
+ svg.style.overflow = 'hidden';
82
+ prepend(svg, document.body);
83
+ }
84
+ }
85
+ if (shouldInjectCss && !window.__iconfont__svg__cssinject__) {
86
+ window.__iconfont__svg__cssinject__ = true;
87
+ try {
88
+ document.write(
89
+ '<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>'
90
+ );
91
+ } catch (e) {
92
+ console && console.log(e);
93
+ }
94
+ }
95
+ ready(appendSvg);
96
+ })(window);
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <!--
4
+ 2013-9-30: Created.
5
+ -->
6
+ <svg>
7
+ <metadata>
8
+ Created by iconfont
9
+ </metadata>
10
+ <defs>
11
+
12
+ <font id="iconfont" horiz-adv-x="1024" >
13
+ <font-face
14
+ font-family="iconfont"
15
+ font-weight="500"
16
+ font-stretch="normal"
17
+ units-per-em="1024"
18
+ ascent="896"
19
+ descent="-128"
20
+ />
21
+ <missing-glyph />
22
+
23
+ <glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
24
+ d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
25
+ t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
26
+ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
27
+
28
+
29
+
30
+ <glyph glyph-name="clock" unicode="&#58886;" d="M821.76 20.28800000000001l33.344-33.28c18.688-18.56 37.568-37.056 56-55.936a33.792 33.792 0 0 0-15.36-57.088 33.984 33.984 0 0 0-34.112 10.24l-89.984 89.92c-1.792 1.792-2.88 4.288-3.52 5.312-171.584-97.152-340.864-97.088-511.04-0.768-1.152-1.088-3.072-2.816-4.864-4.672-30.4-30.272-60.544-60.672-91.136-90.752a33.92 33.92 0 0 0-56.96 13.568c-4.096 13.632-0.32 25.408 9.728 35.456l82.56 82.304c1.856 1.792 4.224 3.072 6.4 4.672C88.576 121.856 30.08 247.808 34.944 400c4.224 133.376 57.6 245.888 155.904 336.32C380.608 910.848 678.72 899.84 857.984 712.3199999999999a476.8 476.8 0 0 0-36.224-692.032zM102.4 383.67999999999995c0-225.024 183.232-408.64 407.872-408.768 227.648-0.128 410.688 181.632 411.072 408.192 0.384 225.856-183.424 409.472-409.472 409.216C285.696 792.064 102.4 609.152 102.4 383.67999999999995zM199.872 895.232c5.888-1.152 12.16-1.472 17.728-3.584 14.72-5.44 23.552-21.248 21.12-36.096a33.472 33.472 0 0 0-32.448-29.056c-30.592-0.576-58.624-8.832-83.008-27.52-35.968-27.456-53.888-64.256-55.04-109.312a32.448 32.448 0 0 0-19.52-30.272 32.192 32.192 0 0 0-34.688 3.392 32.512 32.512 0 0 0-13.824 28.608C2.304 763.52 32.896 820.16 92.672 860.8 124.8 882.56 160.832 892.992 199.872 895.232zM1023.744 693.504a34.368 34.368 0 0 0-44.16-36.096 33.984 33.984 0 0 0-24.064 33.024 131.84 131.84 0 0 1-20.416 70.848c-26.88 41.984-65.664 63.36-115.456 65.024-24.576 0.832-40.64 22.912-32.768 45.312a33.536 33.536 0 0 0 33.28 22.592c76.288-2.048 134.72-35.648 174.976-100.288 18.24-29.312 27.072-61.76 28.608-100.416zM477.952 486.016c0 33.92-0.128 67.84 0 101.696a33.472 33.472 0 0 0 22.848 32.384 34.176 34.176 0 0 0 37.632-10.88c5.76-7.04 7.744-15.36 7.744-24.32 0-60.032 0-120-0.128-180.032 0-5.12 1.344-8.704 5.056-12.288 40.128-39.808 80.128-79.744 120.064-119.808 15.36-15.36 14.976-38.016-0.448-51.2a33.856 33.856 0 0 0-45.76 1.216c-9.408 8.896-18.368 18.24-27.52 27.392-35.2 35.072-70.272 70.4-105.664 105.216a43.648 43.648 0 0 0-14.016 33.92c0.512 32.256 0.192 64.448 0.192 96.704z" horiz-adv-x="1024" />
31
+
32
+
33
+
34
+
35
+ </font>
36
+ </defs></svg>
File without changes
@@ -0,0 +1,5 @@
1
+ @import "./variable";
2
+ @import "@winner-fed/magicless/magicless.less";
3
+ @import "@winner-fed/magicless/reset.less";
4
+ @import (less) "../fonts/iconfont.css";
5
+ @import "./main";
@@ -0,0 +1,39 @@
1
+ .iconfont {
2
+ position: relative;
3
+ display: inline-block;
4
+ vertical-align: middle;
5
+ }
6
+
7
+ .no-data {
8
+ padding: 10px 0;
9
+ font-size: 16px;
10
+ color: #999;
11
+ text-align: center;
12
+ }
13
+
14
+ .pages {
15
+ position: relative;
16
+ width: 100%;
17
+ height: 100%;
18
+ overflow: hidden;
19
+ font-size: @fontSizeH3;
20
+ }
21
+
22
+ .page {
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ width: 100%;
27
+ height: 100%;
28
+ transform: translate3d(0, 0, 0);
29
+ box-sizing: border-box;
30
+ }
31
+
32
+ .page-content {
33
+ position: relative;
34
+ z-index: 1;
35
+ height: 100%;
36
+ background-color: @colorWhite;
37
+ box-sizing: border-box;
38
+ .scrollable();
39
+ }
@@ -0,0 +1,53 @@
1
+ // color
2
+ @colorBlueMain: #43a9f1;
3
+ @colorBlueLight: #49b2f5;
4
+ @colorBlueText: #0076ff;
5
+
6
+ @colorGrayMain: #414141;
7
+ @colorGrayLight: #f3f3f3;
8
+ @colorGrayAssist: #e1e1e1;
9
+ @colorBorder: #e9e9e9;
10
+ @colorGray: #c8c8c8;
11
+ @colorAfter: #eee;
12
+ @tabBorder: #d9d9d9;
13
+
14
+ @colorWhite: #fff;
15
+ @colorBlack: #333;
16
+
17
+ // font
18
+ @fontColor: @colorGrayMain;
19
+ @fontColorBlack: @colorBlack;
20
+ @fontColorLight: @colorGrayLight;
21
+ @fontColorAssist: @colorGrayAssist;
22
+
23
+ // bg
24
+ @bgColor: #f2f2f2;
25
+ @bgColorLight: #f7f7f7;
26
+
27
+ //line
28
+ @colorLine: @colorGrayAssist;
29
+
30
+ //colorAssist
31
+ @colorRed: #ff5648;
32
+ @colorGreen: #47b34f;
33
+ @colorOrange: #ffaf32;
34
+ @colorOrangeLight: #ffb42f;
35
+
36
+ //fontSize
37
+ @fontSizeH1: 20px;
38
+ @fontSizeH2: 16px;
39
+ @fontSizeH3: 14px;
40
+ @fontSizeH4: 12px;
41
+
42
+ // mobile
43
+ @fontFamilyUltralight: "PingFangSC-Ultralight", "Source Han Sans CN", "Helvetica Neue";
44
+ @fontFamilyRegular: "PingFangSC-Regular", "Source Han Sans CN", "Helvetica Neue";
45
+ @fontFamilyMedium: "PingFangSC-Medium", "Source Han Sans CN Medium", "Helvetica Neue";
46
+ @fontFamilyThin: "PingFangSC-Thin", "Source Han Sans CN Thin", "Helvetica Neue";
47
+ @fontFamilyLight: "PingFangSC-Light", "Source Han Sans CN Light", "Helvetica Neue";
48
+ @fontFamilySemibold: "PingFangSC-Semibold", "Source Han Sans CN Light", "Helvetica Neue";
49
+
50
+ // pc
51
+ @fontFamilyMedium: "PingFang-SC-medium", Helvetica, Tahoma, Arial, "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
52
+ @fontFamilyRegular: "PingFang-SC-regular", Helvetica, Tahoma, Arial, "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
53
+ @priceIntegerFontFamily: Avenir-Heavy, PingFang SC, Helvetica Neue, Arial, sans-serif;
@@ -0,0 +1,5 @@
1
+ export const TIMEOUT = 25000;
2
+ export const PAGE_NUM = 15;
3
+ export const UPLOAD_PREFIX = 'upload/';
4
+ export const HOME_PREFIX = 'home/';
5
+
@@ -0,0 +1 @@
1
+ @import "assets/style/app";
@@ -0,0 +1 @@
1
+ <svg class="icon" viewBox="0 0 1158 1024" xmlns="http://www.w3.org/2000/svg" width="226.172" height="200"><defs><style/></defs><path d="M57.6 838.4c-6.4 0-12.8-6.4-12.8-12.8-6.4-6.4 0-19.2 6.4-19.2L256 723.2c6.4-6.4 19.2 0 19.2 6.4 6.4 6.4 0 19.2-6.4 19.2L57.6 838.4c6.4 0 0 0 0 0zm492.8 140.8c-108.8 0-224-38.4-313.6-115.2-6.4-6.4-6.4-19.2 0-25.6 6.4-6.4 19.2-6.4 25.6 0 83.2 64 185.6 102.4 288 102.4 115.2 0 230.4-44.8 294.4-115.2 6.4-6.4 19.2-6.4 25.6 0 6.4 6.4 6.4 19.2 0 25.6-70.4 76.8-192 128-320 128zm409.6-352c-6.4 0-19.2-6.4-19.2-19.2 0-179.2-179.2-332.8-390.4-332.8S160 428.8 160 608c0 6.4-6.4 19.2-19.2 19.2s-19.2-12.8-19.2-19.2c0-198.4 192-371.2 428.8-371.2 230.4 0 428.8 166.4 428.8 371.2 0 6.4-12.8 19.2-19.2 19.2zm-940.8 64c-6.4 0-12.8-6.4-19.2-19.2 0-6.4 6.4-19.2 12.8-19.2l204.8-19.2c6.4 0 19.2 6.4 19.2 12.8s0 19.2-12.8 25.6L19.2 691.2zm1049.6 147.2h-6.4l-211.2-89.6c-6.4-6.4-12.8-12.8-6.4-19.2 6.4-6.4 12.8-12.8 19.2-6.4l211.2 89.6c6.4 6.4 12.8 12.8 6.4 19.2 0 0-6.4 6.4-12.8 6.4zm12.8-147.2L864 665.6c-6.4 0-12.8-6.4-12.8-19.2 0-6.4 6.4-12.8 19.2-12.8l217.6 25.6c6.4 0 12.8 6.4 12.8 19.2-6.4 6.4-12.8 12.8-19.2 12.8zm-608 89.6c-19.2 0-38.4-12.8-51.2-25.6-12.8-19.2-19.2-38.4-19.2-64 0-6.4 12.8-12.8 19.2-12.8 6.4 0 12.8 12.8 12.8 19.2 0 12.8 0 32 12.8 38.4 6.4 6.4 12.8 6.4 25.6 6.4s51.2 0 51.2-70.4c0-6.4 6.4-19.2 19.2-19.2s19.2 6.4 19.2 19.2c0 70.4-32 108.8-89.6 108.8z"/><path d="M614.4 787.2c-38.4 0-83.2-19.2-83.2-115.2 0-6.4 6.4-19.2 19.2-19.2s19.2 6.4 19.2 19.2c0 70.4 25.6 76.8 44.8 76.8 12.8 0 25.6-6.4 32-12.8 6.4-6.4 12.8-19.2 12.8-38.4 0-6.4 6.4-19.2 12.8-19.2s19.2 6.4 19.2 12.8c6.4 19.2 0 44.8-19.2 64-12.8 19.2-38.4 32-57.6 32zM345.6 486.4a44.8 44.8 0 1 0 89.6 0 44.8 44.8 0 1 0-89.6 0zm313.6 0a44.8 44.8 0 1 0 89.6 0 44.8 44.8 0 1 0-89.6 0zm-486.4-12.8c-12.8 0-12.8-6.4-19.2-12.8-25.6-147.2-6.4-262.4 44.8-339.2 0-6.4 6.4-6.4 12.8-6.4s12.8 0 12.8 6.4l6.4 6.4 172.8 147.2c6.4 6.4 6.4 12.8 6.4 12.8 0 6.4-6.4 12.8-12.8 12.8-76.8 19.2-147.2 76.8-211.2 160 0 6.4-6.4 12.8-12.8 12.8zm44.8-320c-38.4 64-44.8 153.6-32 262.4 51.2-64 108.8-115.2 172.8-140.8L217.6 153.6zm704 320c-6.4 0-12.8 0-12.8-6.4-51.2-83.2-128-140.8-211.2-166.4-6.4 0-12.8-6.4-12.8-12.8s0-12.8 6.4-12.8l179.2-153.6c6.4-6.4 6.4-6.4 12.8-6.4s6.4 0 12.8 6.4c51.2 76.8 64 179.2 38.4 339.2 0 0 0 6.4-12.8 12.8zM736 275.2c64 25.6 128 70.4 172.8 134.4 12.8-115.2 0-198.4-32-256L736 275.2z"/></svg>
@@ -0,0 +1 @@
1
+ <svg class="icon" viewBox="0 0 1152 1024" xmlns="http://www.w3.org/2000/svg" width="225" height="200"><defs><style/></defs><path d="M960 806.4c-32 0-57.6-6.4-76.8-25.6-32-19.2-51.2-51.2-51.2-76.8V377.6h32V704c0 12.8 12.8 38.4 32 51.2 19.2 12.8 51.2 25.6 96 12.8 25.6-6.4 44.8-25.6 57.6-51.2 32-57.6 25.6-153.6-12.8-249.6-64-134.4-230.4-332.8-460.8-326.4-262.4 19.2-390.4 192-454.4 332.8-44.8 108.8-51.2 204.8-19.2 256 19.2 25.6 44.8 38.4 83.2 38.4 76.8 0 102.4-25.6 102.4-83.2V384h32v300.8c0 76.8-44.8 115.2-134.4 115.2-44.8 0-83.2-19.2-108.8-51.2-38.4-64-32-172.8 12.8-288C160 307.2 294.4 128 576 115.2c243.2-12.8 428.8 198.4 486.4 352 44.8 102.4 44.8 211.2 12.8 275.2-19.2 32-44.8 57.6-76.8 64H960z"/><path d="M684.8 505.6a44.8 44.8 0 1 0 89.6 0 44.8 44.8 0 1 0-89.6 0zm-307.2 0a44.8 44.8 0 1 0 89.6 0 44.8 44.8 0 1 0-89.6 0zm32 371.2c-64 0-121.6-38.4-147.2-108.8l32-12.8c25.6 64 70.4 89.6 128 83.2 96 0 147.2-64 147.2-128h32c0 32 12.8 64 38.4 89.6 25.6 25.6 64 38.4 108.8 38.4 64-6.4 102.4-32 128-89.6l32 12.8c-25.6 64-76.8 96-153.6 102.4-51.2 0-96-12.8-134.4-44.8-12.8-12.8-25.6-25.6-32-44.8-25.6 51.2-76.8 89.6-160 89.6-12.8 12.8-19.2 12.8-19.2 12.8z"/><path d="M582.4 736l-140.8-76.8 64-70.4h147.2l51.2 76.8L582.4 736zm-89.6-89.6l89.6 51.2 76.8-44.8-19.2-32H518.4l-25.6 25.6zm96 332.8H576c-44.8-6.4-102.4-32-89.6-134.4h32c-6.4 83.2 32 96 64 96 19.2 0 38.4 0 44.8-12.8 12.8-12.8 25.6-44.8 19.2-83.2h32c6.4 51.2-6.4 89.6-32 108.8-12.8 12.8-32 25.6-57.6 25.6z"/><path d="M582.4 896c-6.4 0-12.8-6.4-12.8-12.8V742.4c0-6.4 6.4-12.8 12.8-12.8s12.8 6.4 12.8 12.8v140.8c6.4 6.4-6.4 12.8-12.8 12.8z"/></svg>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div class="pages">
3
+ <router-view v-slot="{ Component, route }">
4
+ <keep-alive>
5
+ <component v-if="route.meta.keepAlive" :key="route.path" :is="Component" />
6
+ </keep-alive>
7
+ <component v-if="!route.meta.keepAlive" :key="route.path" :is="Component" />
8
+ </router-view>
9
+ <!-- Vue2 Vue-router3.x 使用如下代码-->
10
+ <!-- <keep-alive>-->
11
+ <!-- <router-view v-if="$route.meta.keepAlive" />-->
12
+ <!-- </keep-alive>-->
13
+ <!-- <router-view v-if="!$route.meta.keepAlive" />-->
14
+ </div>
15
+ </template>
16
+ <script setup></script>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div>
3
+ <p>This is win docs.</p>
4
+ </div>
5
+ </template>
@@ -0,0 +1,88 @@
1
+ <script setup>
2
+ import { ref } from 'vue';
3
+ /**
4
+ * 以下仅为事例代码,可以随意扩展修改
5
+ */
6
+ import services from '@/services';
7
+
8
+ const title = ref('Welcome to Your Vue.js App.');
9
+
10
+ function movieComingSoon() {
11
+ const data = {};
12
+ services
13
+ .octocat({
14
+ method: 'get',
15
+ data
16
+ })
17
+ .then((res) => {
18
+ console.log('接口请求成功:' + JSON.stringify(res, null, 2));
19
+ })
20
+ .catch((err) => {
21
+ console.log('接口请求异常:' + err);
22
+ });
23
+ }
24
+
25
+ movieComingSoon();
26
+ </script>
27
+ <template>
28
+ <div class="page page-hello">
29
+ <div class="page-content">
30
+ <!-- 静态资源路径写法事例 -->
31
+ <img class="logo" src="@/assets/img/logo.png" alt="logo" />
32
+ <icon-win name="dog" class="icons" />
33
+ <h1>{{ title }}</h1>
34
+ <div class="demo">
35
+ <h3>方法示例</h3>
36
+ <pre>
37
+ &lt;script setup&gt;
38
+ /**
39
+ * 以下仅为事例代码,可以随意扩展修改
40
+ */
41
+ // 工具类
42
+ import { formatDate } from &#x27;
43
+ import { ref } from &#x27;
44
+ import services from &#x27;
45
+ utils&#x27;;
46
+ vue&#x27;;
47
+ @/services&#x27;;
48
+
49
+ const msg = ref(&#x27;Welcome to Your Vue.js App.This a composition-api and setup demo&#x27;);
50
+ const message = ref(&#x27;现在时间是:&#x27; + formatDate(Date.now()));
51
+
52
+ function movieComingSoon () {
53
+ const data = {};
54
+ services
55
+ .octocat({
56
+ method: &#x27;get&#x27;,
57
+ data
58
+ })
59
+ .then((res) =&gt; {
60
+ console.log(&#x27;接口请求成功:&#x27; + JSON.stringify(res, null, 2));
61
+ })
62
+ .catch((err) =&gt; {
63
+ console.log(&#x27;接口请求异常:&#x27; + err);
64
+ });
65
+ }
66
+
67
+ movieComingSoon();
68
+ &lt;/script&gt;
69
+ &lt;template&gt;
70
+ &lt;div class=&quot;page page-hello&quot;&gt;
71
+ &lt;div class=&quot;page-content&quot;&gt;
72
+ &lt;!-- 静态资源路径写法事例 --&gt;
73
+ &lt;img src=&quot;@/assets/img/logo.png&quot; /&gt;
74
+ &lt;h1 v-text=&quot;msg&quot;&gt;&lt;/h1&gt;
75
+ &lt;h2 v-text=&quot;message&quot;&gt;&lt;/h2&gt;
76
+ &lt;svg-icon icon-name=&quot;dog&quot;&gt;&lt;/svg-icon&gt;
77
+ &lt;/div&gt;
78
+ &lt;/div&gt;
79
+ &lt;/template&gt;
80
+
81
+ &lt;style lang=&quot;less&quot; scoped src=&quot;./style.less&quot;&gt;&lt;/style&gt;
82
+ </pre>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ </template>
87
+
88
+ <style lang="less" scoped src="./style.less"></style>
@@ -0,0 +1,41 @@
1
+ .page-hello {
2
+ font-family: Avenir, Helvetica, Arial, sans-serif;
3
+ -webkit-font-smoothing: antialiased;
4
+ -moz-osx-font-smoothing: grayscale;
5
+ color: #2c3e50;
6
+
7
+ .icons {
8
+ font-size: 30px;
9
+ color: #ff0000;
10
+ }
11
+
12
+ .page-content {
13
+ padding: 0 15px;
14
+ }
15
+
16
+ h1 {
17
+ margin-bottom: 20px;
18
+ text-align: center;
19
+ }
20
+
21
+ p {
22
+ line-height: 23px;
23
+ }
24
+
25
+ a {
26
+ color: #42b983;
27
+ }
28
+
29
+ .logo {
30
+ width: 200px;
31
+ height: 200px;
32
+ display: block;
33
+ margin: 30px auto;
34
+ }
35
+
36
+ .demo {
37
+ padding-top: 25px;
38
+ margin: 0 auto;
39
+ text-align: left;
40
+ }
41
+ }
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div>
3
+ <h2>Hi! Welcome to Winjs ❤️ vue!</h2>
4
+ <p>
5
+ <img src="@/assets/img/logo.png" width="200" height="200" alt="logo" />
6
+ </p>
7
+ <p>To get started, edit <code>pages/index.vue</code> and save to reload.</p>
8
+ </div>
9
+ </template>
@@ -0,0 +1,3 @@
1
+ export default {
2
+ octocat: 'octocat'
3
+ };
@@ -0,0 +1,18 @@
1
+ import { UPLOAD_PREFIX } from '@/constant';
2
+
3
+ /**
4
+ * 根据前缀,自动匹配基础的url
5
+ * 根据项目所需,自己扩展
6
+ * @param prefix
7
+ * @returns {string}
8
+ */
9
+ export default function autoMatchBaseUrl(prefix = '') {
10
+ let baseUrl = '';
11
+ if (prefix === UPLOAD_PREFIX) {
12
+ baseUrl = window.LOCAL_CONFIG.API_UPLOAD;
13
+ } else {
14
+ baseUrl = window.LOCAL_CONFIG.API_HOME;
15
+ }
16
+
17
+ return baseUrl;
18
+ }
@@ -0,0 +1,11 @@
1
+ import request from './request';
2
+ import urls from './RESTFULURL';
3
+
4
+ const FUNS = {};
5
+
6
+ Object.keys(urls).forEach((key) => {
7
+ FUNS[key] = (options = {}) => {
8
+ return request(urls[key], options);
9
+ };
10
+ });
11
+ export default FUNS;
@@ -0,0 +1,178 @@
1
+ import { TIMEOUT } from '@/constant';
2
+ import { request } from 'winjs';
3
+ import autoMatchBaseUrl from './autoMatchBaseUrl';
4
+
5
+ const codeMessage = {
6
+ 200: '服务器成功返回请求的数据。',
7
+ 201: '新建或修改数据成功。',
8
+ 202: '一个请求已经进入后台排队(异步任务)。',
9
+ 204: '删除数据成功。',
10
+ 400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
11
+ 401: '用户没有权限(令牌、用户名、密码错误)。',
12
+ 403: '用户得到授权,但是访问是被禁止的。',
13
+ 404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
14
+ 406: '请求的格式不可得。',
15
+ 410: '请求的资源被永久删除,且不会再得到的。',
16
+ 422: '当创建一个对象时,发生一个验证错误。',
17
+ 500: '服务器发生错误,请检查服务器。',
18
+ 502: '网关错误。',
19
+ 503: '服务不可用,服务器暂时过载或维护。',
20
+ 504: '网关超时。'
21
+ };
22
+
23
+ export function responseLog(response) {
24
+ if (process.env.NODE_ENV === 'development') {
25
+ const randomColor = `rgba(${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.round(
26
+ Math.random() * 255
27
+ )})`;
28
+ console.log('%c┍------------------------------------------------------------------┑', `color:${randomColor};`);
29
+ console.log('| 请求地址:', response.config.url);
30
+ console.log('| 请求参数:', JSON.parse(response.config.data));
31
+ console.log('| 返回数据:', response.data);
32
+ console.log('%c┕------------------------------------------------------------------┙', `color:${randomColor};`);
33
+ } else {
34
+ console.log('| 请求地址:', response.config.url);
35
+ console.log('| 请求参数:', JSON.parse(response.config.data));
36
+ console.log('| 返回数据:', response.data);
37
+ }
38
+ }
39
+
40
+ export function checkStatus(response) {
41
+ // 如果http状态码正常,则直接返回数据
42
+ if (response) {
43
+ const { status, statusText } = response;
44
+ if ((status >= 200 && status < 300) || status === 304) {
45
+ // 如果不需要除了data之外的数据,可以直接 return response.data
46
+ return response;
47
+ }
48
+ return {
49
+ status,
50
+ msg: codeMessage[status] || statusText
51
+ };
52
+ }
53
+ // 异常状态下,把错误信息返回去
54
+ return {
55
+ status: -404,
56
+ msg: '网络异常'
57
+ };
58
+ }
59
+
60
+ /**
61
+ * requestInstance 实例全局请求扩展配置
62
+ * 添加一个请求拦截器 (于transformRequest之前处理)
63
+ */
64
+ export const httpRequest = {
65
+ success: (config) => {
66
+ // 以下代码,鉴权token,可根据具体业务增删。
67
+ // demo示例:
68
+ if (config['url'].indexOf('operatorQry') !== -1) {
69
+ config.headers['accessToken'] = 'de4738c67e1bb450be71b660f0716aa4675860cec1ff9bc23d800efb40519cf3';
70
+ }
71
+ return config;
72
+ },
73
+ error: (error) => Promise.reject(error)
74
+ };
75
+
76
+ /**
77
+ * requestInstance 实例全局请求响应处理
78
+ * 添加一个返回拦截器 (于transformResponse之后处理)
79
+ * 返回的数据类型默认是json,若是其他类型(text)就会出现问题,因此用try,catch捕获异常
80
+ */
81
+ export const httpResponse = {
82
+ success: (response) => {
83
+ responseLog(response);
84
+ return checkStatus(response);
85
+ },
86
+ error: (error) => {
87
+ const { response, code } = error;
88
+ // 接口请求异常统一处理
89
+ if (code === 'ECONNABORTED') {
90
+ // Timeout error
91
+ console.log('Timeout error', code);
92
+ }
93
+ if (response) {
94
+ // 请求已发出,但是不在2xx的范围
95
+ // 对返回的错误进行一些处理
96
+ return Promise.reject(checkStatus(response));
97
+ } else {
98
+ // 处理断网的情况
99
+ // eg:请求超时或断网时,更新state的network状态
100
+ // network状态在app.vue中控制着一个全局的断网提示组件的显示隐藏
101
+ // 关于断网组件中的刷新重新获取数据,会在断网组件中说明
102
+ console.log('断网了~');
103
+ }
104
+ }
105
+ };
106
+
107
+ // 兼容处理
108
+ // 格式化 restful 接口形式
109
+ function formatURL(path, queryParams) {
110
+ const params = {
111
+ ...(queryParams || {})
112
+ };
113
+
114
+ const url = path.replace(/\{([^\\}]*(?:\\.[^\\}]*)*)\}/gm, (match, key) => {
115
+ // eslint-disable-next-line no-param-reassign
116
+ key = key.trim();
117
+
118
+ if (params[key] !== undefined) {
119
+ const value = params[key];
120
+ delete params[key];
121
+ return value;
122
+ }
123
+ console.warn('Please set value for template key: ', key);
124
+ return '';
125
+ });
126
+
127
+ return url;
128
+ }
129
+
130
+ /**
131
+ * 基于 request 请求
132
+ * @param url
133
+ * @param method
134
+ * @param timeout
135
+ * @param prefix 用来拼接url地址
136
+ * @param data
137
+ * @param headers
138
+ * @param dataType
139
+ * @returns {Promise.<T>}
140
+ */
141
+ export default function (
142
+ url,
143
+ { method = 'post', timeout = TIMEOUT, prefix = '', data = {}, headers = {}, dataType = 'json' }
144
+ ) {
145
+ const baseURL = autoMatchBaseUrl(prefix);
146
+
147
+ const formatHeaders = {
148
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
149
+ ...headers
150
+ };
151
+
152
+ const defaultConfig = {
153
+ baseURL,
154
+ url: formatURL(url, data),
155
+ method,
156
+ params: data,
157
+ data,
158
+ timeout,
159
+ headers: formatHeaders,
160
+ responseType: dataType
161
+ };
162
+
163
+ if (method.toLowerCase() === 'get') {
164
+ // 给 get 请求加上时间戳参数,避免从缓存中拿数据。
165
+ defaultConfig.params = Object.assign(defaultConfig.params || {}, { _t: new Date().getTime() });
166
+ }
167
+
168
+ return request(defaultConfig.url, defaultConfig);
169
+ }
170
+
171
+ // 上传文件封装
172
+ export const uploadFile = (url, formData) => {
173
+ return request(url, {
174
+ method: 'post',
175
+ data: formData,
176
+ headers: { 'Content-Type': 'multipart/form-data' }
177
+ });
178
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "./src/.win/tsconfig.json"
3
+ }
@@ -0,0 +1 @@
1
+ import 'win/typings';
@@ -0,0 +1,5 @@
1
+ import { defineConfig } from 'father';
2
+
3
+ export default defineConfig({
4
+ cjs: {},
5
+ });
@@ -0,0 +1,2 @@
1
+ node_modules
2
+ /dist
@@ -0,0 +1,2 @@
1
+ registry={{{ registry }}}
2
+ {{{ extraNpmrc }}}