@ajaxjs/ui 1.2.0 → 1.2.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 (44) hide show
  1. package/package.json +4 -3
  2. package/src/App.vue +0 -14
  3. package/src/index.ts +0 -50
  4. package/src/main.ts +0 -12
  5. package/src/pages/calendar.vue +0 -33
  6. package/src/pages/form.vue +0 -68
  7. package/src/pages/html-editor.vue +0 -44
  8. package/src/pages/index.vue +0 -150
  9. package/src/pages/play-ground.vue +0 -14
  10. package/src/pages/widgets.vue +0 -183
  11. package/src/router/index.ts +0 -19
  12. package/src/shims-vue.d.ts +0 -4
  13. package/src/style/common-functions.less +0 -294
  14. package/src/style/reset.less +0 -19
  15. package/src/util/cookies.ts +0 -43
  16. package/src/util/dom.ts +0 -47
  17. package/src/util/utils.ts +0 -184
  18. package/src/util/xhr-config.ts +0 -25
  19. package/src/util/xhr.ts +0 -296
  20. package/src/widget/AccordionMenu.vue +0 -140
  21. package/src/widget/AdjustFontSize.vue +0 -65
  22. package/src/widget/Article.vue +0 -59
  23. package/src/widget/EmptyContent.js +0 -4
  24. package/src/widget/Expander.vue +0 -65
  25. package/src/widget/FileUploader/FileUploader.less +0 -68
  26. package/src/widget/FileUploader/FileUploader.ts +0 -156
  27. package/src/widget/FileUploader/FileUploader.vue +0 -43
  28. package/src/widget/HtmlEditor/HtmlEditor.less +0 -345
  29. package/src/widget/HtmlEditor/HtmlEditor.ts +0 -339
  30. package/src/widget/HtmlEditor/HtmlEditor.vue +0 -70
  31. package/src/widget/HtmlEditor/html-editor-HtmlSanitizer.js +0 -103
  32. package/src/widget/ImageEnlarger.vue +0 -105
  33. package/src/widget/OpacityBanner.vue +0 -125
  34. package/src/widget/ProcessLine.vue +0 -133
  35. package/src/widget/Resize.ts +0 -152
  36. package/src/widget/Resize.vue +0 -104
  37. package/src/widget/TreeSelector.vue +0 -4
  38. package/src/widget/calendar/BetweenDate.vue +0 -63
  39. package/src/widget/calendar/Calendar.less +0 -210
  40. package/src/widget/calendar/Calendar.ts +0 -167
  41. package/src/widget/calendar/Calendar.vue +0 -52
  42. package/src/widget/calendar/CalendarInput.vue +0 -71
  43. package/src/widget/form/validator.ts +0 -289
  44. package/src/widget/play-ground/sku.vue +0 -93
package/src/util/xhr.ts DELETED
@@ -1,296 +0,0 @@
1
- import { XhrConfig } from './xhr-config';
2
-
3
- /**
4
- * 默认的请求配置
5
- */
6
- const DEFAULT_XHR_CFG: XhrConfig = {
7
- timeout: 5000,
8
- withCredentials: false,
9
- parseContentType: 'json'
10
- };
11
-
12
- /**
13
- * 处理响应的回调函数
14
- */
15
- type XhrCallback = (json: {}, text: string) => void;
16
-
17
- /**
18
- * 全局请求的 head 参数
19
- */
20
- let BASE_HEAD_PARAMS = null;
21
-
22
- /**
23
- * 设置全局请求的 head 参数
24
- *
25
- * @param param
26
- */
27
- export function setBaseHeadParams(params: any): void {
28
- if (BASE_HEAD_PARAMS === null)
29
- BASE_HEAD_PARAMS = {};
30
-
31
- Object.assign(BASE_HEAD_PARAMS, params);
32
- }
33
-
34
- /**
35
- *
36
- * @param getOrDel
37
- * @param url
38
- * @param cb
39
- * @param params
40
- * @param cfg
41
- */
42
- function getOrDel(getOrDel: 'get' | 'delete', url: string, cb: XhrCallback, params?: {}, cfg: XhrConfig = DEFAULT_XHR_CFG): void {
43
- let xhr: XMLHttpRequest = initXhr(cfg);
44
-
45
- if (params != null) {
46
- if (url.indexOf('?') != -1)
47
- url += '&' + toParams(params);
48
- else
49
- url += '?' + toParams(params);
50
- }
51
-
52
- xhr.open(getOrDel.toUpperCase(), url, true);
53
- xhr.onreadystatechange = function () {
54
- responseHandle(this, cb, cfg);
55
- }
56
-
57
- if (BASE_HEAD_PARAMS)// 设置自定义请求头
58
- for (let key in BASE_HEAD_PARAMS)
59
- xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
60
-
61
- xhr.send();
62
- }
63
-
64
- /**
65
- *
66
- * @param method
67
- * @param url
68
- * @param cb
69
- * @param params
70
- * @param cfg
71
- */
72
- function postOrPut(method: 'post' | 'put', url: string, cb: XhrCallback, params: string | {}, cfg: XhrConfig = DEFAULT_XHR_CFG): void {
73
- let xhr: XMLHttpRequest = initXhr(cfg);
74
- xhr.open(method, url, true);
75
- xhr.onreadystatechange = function () {
76
- responseHandle(this, cb, cfg);
77
- }
78
-
79
- if (BASE_HEAD_PARAMS) // 设置自定义请求头
80
- for (let key in BASE_HEAD_PARAMS)
81
- xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
82
-
83
- // 此方法必须在 open() 方法和 send() 之间调用
84
-
85
- if (!cfg.contentType) // 如未设置,默认为表单请求
86
- xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
87
- else
88
- xhr.setRequestHeader("Content-Type", cfg.contentType);
89
-
90
-
91
- let _params: string = typeof params != 'string' ? toParams(params) : <string>params;
92
-
93
- if (_params)
94
- xhr.send(_params);
95
- else
96
- xhr.send();
97
- }
98
-
99
- /**
100
- *
101
- * @param url
102
- * @param cb
103
- * @param params
104
- * @param cfg
105
- */
106
- export function xhr_post_upload(url: string, cb: XhrCallback, params: Document | XMLHttpRequestBodyInit, cfg: XhrConfig = DEFAULT_XHR_CFG): void {
107
- let xhr: XMLHttpRequest = initXhr(cfg);
108
- xhr.open('post', url, true);
109
- xhr.onreadystatechange = function () {
110
- responseHandle(this, cb, cfg);
111
- }
112
-
113
- if (BASE_HEAD_PARAMS) // 设置自定义请求头
114
- for (let key in BASE_HEAD_PARAMS)
115
- xhr.setRequestHeader(key, BASE_HEAD_PARAMS[key]);
116
-
117
- // 什么 Content-Type 都不设置
118
-
119
- xhr.send(params);
120
- }
121
-
122
- /**
123
- * XHR GET 请求
124
- *
125
- * @param url 请求地址
126
- * @param cb 回调函数 @example (json: {}, text: string) => void;
127
- * @param params 参数,必填,如无填空字符串 "";参数类型是json;参数值会进行 URL 编码,最后附加到 QueryString 中
128
- * @param cfg 配置,可选的
129
- */
130
- export function xhr_get(url: string, cb: XhrCallback, params?: {}, cfg: XhrConfig = DEFAULT_XHR_CFG): void {
131
- getOrDel('get', url, cb, params, cfg);
132
- }
133
-
134
- /**
135
- * XHR DELETE 请求
136
- *
137
- * @param url 请求地址
138
- * @param cb 回调函数 @example (json: {}, text: string) => void;
139
- * @param params 参数,必填,如无填空字符串 "";参数类型是json;参数值会进行 URL 编码,最后附加到 QueryString 中
140
- * @param cfg 配置,可选的
141
- */
142
- export function xhr_del(url: string, cb: XhrCallback, params?: {}, cfg: XhrConfig = DEFAULT_XHR_CFG): void {
143
- getOrDel('delete', url, cb, params, cfg);
144
- }
145
-
146
- /**
147
- * XHR POST 请求
148
- *
149
- * @param url 请求地址
150
- * @param cb 回调函数 @example (json: {}, text: string) => void;
151
- * @param params 参数,必填,如无填空字符串 "";参数类型可以是字符串或 json;参数值会进行 URL 编码
152
- * @param cfg 配置,可选的
153
- */
154
- export function xhr_post(url: string, cb: XhrCallback, params: string | {}, cfg: XhrConfig = DEFAULT_XHR_CFG): void {
155
- postOrPut('post', url, cb, params, cfg);
156
- }
157
-
158
- /**
159
- * XHR PUT 请求
160
- *
161
- * @param url 请求地址
162
- * @param cb 回调函数 @example (json: {}, text: string) => void;
163
- * @param params 参数,必填,如无填空字符串 "";参数类型可以是字符串或 json;参数值会进行 URL 编码
164
- * @param cfg 配置,可选的
165
- */
166
- export function xhr_put(url: string, cb: XhrCallback, params: string | {}, cfg: XhrConfig = DEFAULT_XHR_CFG): void {
167
- postOrPut('put', url, cb, params, cfg);
168
- }
169
-
170
- /**
171
- * 初始化 XHR
172
- *
173
- * @param cfg
174
- * @returns
175
- */
176
- function initXhr(cfg: XhrConfig): XMLHttpRequest {
177
- let xhr: XMLHttpRequest = new XMLHttpRequest();
178
-
179
- if (cfg && cfg.timeout) {
180
- xhr.timeout = cfg.timeout;
181
- xhr.ontimeout = (e: ProgressEvent<EventTarget>) => console.error('系统异常,XHR 连接服务超时');
182
- }
183
-
184
- if (cfg && cfg.withCredentials)
185
- xhr.withCredentials = true;
186
-
187
- return xhr;
188
- }
189
-
190
- /**
191
- * 错误处理
192
- *
193
- * @param xhr
194
- */
195
- function errHandle(xhr: XMLHttpRequest): void {
196
- let msg: string;
197
-
198
- if (xhr.status <= 400)
199
- msg = '请求参数错误或者权限不足。';
200
- else if (xhr.status <= 500)
201
- msg = '服务端异常。';
202
- else
203
- msg = `未知异常,HTTP code:${xhr.status}。`;
204
-
205
- if (!xhr.responseText)
206
- msg += " 服务端返回空的字符串!";
207
-
208
- console.error(msg, xhr.responseText);
209
- }
210
-
211
- /**
212
- * 响应处理
213
- *
214
- * @param xhr
215
- * @param cb
216
- * @param cfg
217
- */
218
- function responseHandle(xhr: XMLHttpRequest, cb: XhrCallback, cfg: XhrConfig): void {
219
- if (xhr.readyState == 4) {
220
- if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {
221
- let text: string = xhr.responseText;
222
- let json: any;
223
-
224
- if (!text)
225
- console.warn('服务端没有返回任何字符串');
226
-
227
- switch (cfg.parseContentType) {
228
- case 'text':
229
- break;
230
- case 'xml':
231
- json = xhr.responseXML;
232
- break;
233
- case 'json':
234
- default:
235
- try {
236
- json = JSON.parse(text);
237
- } catch (e) {
238
- console.error('解析 JSON 时候发生错误,非法 JSON');
239
- console.warn(e);
240
- }
241
- }
242
-
243
- cb && cb(json, text);
244
- } else errHandle(xhr);
245
- }
246
- }
247
-
248
- /**
249
- * 对象转换为 URL 参数列表,用 & 分隔
250
- *
251
- * @param {Object} param JSON 对象
252
- * @returns URL 参数列表
253
- */
254
- export function toParams(param: any): string {
255
- let result: string = "";
256
-
257
- for (let name in param) {
258
- if (typeof param[name] != "function")
259
- result += "&" + name + "=" + encodeURIComponent(param[name]);
260
- }
261
-
262
- return result.substring(1);
263
- }
264
-
265
- /**
266
- * 获取 QueryString 的某个参数
267
- *
268
- * @param val
269
- * @returns
270
- */
271
- export function getQuery(val: string): string {
272
- const w: number = location.hash.indexOf('?');
273
- const query: string = location.hash.substring(w + 1);
274
- let vars: string[] = query.split('&');
275
-
276
- for (let i = 0; i < vars.length; i++) {
277
- const pair = vars[i].split('=');
278
-
279
- if (pair[0] == val)
280
- return pair[1];
281
- }
282
-
283
- return '';
284
- }
285
-
286
- export function getPageList(self: any, listArray: any, callback?: Function): XhrCallback {
287
- return (j: any) => {
288
- if (j.status) {
289
- listArray.total = j.total;
290
- listArray.data = j.data;
291
-
292
- callback && callback();
293
- } else
294
- self.$Message.warning(j.message || '获取数据失败');
295
- }
296
- }
@@ -1,140 +0,0 @@
1
- <template>
2
- <ul class="aj-accordion-menu" @click="onClk">
3
- <slot></slot>
4
- </ul>
5
- </template>
6
-
7
- <script lang="ts">
8
- /**
9
- * 内部子菜单的高亮
10
- *
11
- * @param ev
12
- */
13
- function highlightSubItem(ev: Event) {
14
- let li: Element,
15
- el: Element = ev.target as Element;
16
-
17
- if (el.tagName == "A" && el.getAttribute("target")) {
18
- li = el.parentNode as Element;
19
- li.querySelectorAll("li").forEach((_el: Element) => {
20
- if (_el == li) _el.classList.add("selected");
21
- else _el.classList.remove("selected");
22
- });
23
- }
24
- }
25
-
26
- export default {
27
- methods: {
28
- onClk(ev: Event): void {
29
- let children: HTMLCollection = this.$el.children;
30
- highlightSubItem(ev);
31
- let _btn: Element = ev.target as Element;
32
-
33
- if (
34
- _btn &&
35
- _btn.tagName == "H3" &&
36
- (_btn.parentNode as Element).tagName == "LI"
37
- ) {
38
- _btn = _btn.parentNode as Element;
39
-
40
- for (let btn: Element, i: number = 0, j = children.length; i < j; i++) {
41
- btn = children[i];
42
- let ul = btn.querySelector("ul");
43
-
44
- if (btn == _btn) {
45
- if (btn.className.indexOf("pressed") != -1) {
46
- btn.classList.remove("pressed"); // 再次点击,隐藏!
47
- if (ul) ul.style.height = "0px";
48
- } else {
49
- if (ul) ul.style.height = ul.scrollHeight + "px";
50
- btn.classList.add("pressed");
51
- }
52
- } else {
53
- btn.classList.remove("pressed");
54
- if (ul) ul.style.height = "0px";
55
- }
56
- }
57
- } else return;
58
- },
59
- },
60
- };
61
- </script>
62
-
63
- <style lang="less" scoped>
64
- @import "../style/common-functions.less";
65
-
66
- // 折叠菜单 Accordion Menu
67
- .aj-accordion {
68
- & > li h3 {
69
- cursor: pointer;
70
- }
71
-
72
- .pressed {
73
- & h3 {
74
- color: black;
75
- }
76
- }
77
-
78
- & > li > ul {
79
- .transition (height .5s cubic-bezier(0, 1, 0.5, 1));;
80
- overflow: hidden;
81
- }
82
-
83
- ul {
84
- height: 0;
85
- }
86
- }
87
-
88
- .aj-accordion-menu {
89
- .aj-accordion ();
90
- overflow: hidden;
91
-
92
- & > li {
93
- border-top: 1px solid white;
94
- border-bottom: 1px solid lightgray;
95
-
96
- &.pressed {
97
- border-top: 0;
98
- border-bottom: 1px solid lightgray;
99
- box-shadow: inset 0px 10px 15px -15px gray;
100
-
101
- h3 {
102
- font-weight: bold;
103
- }
104
- }
105
-
106
- ul {
107
- li {
108
- // list-style-type: disc;
109
- padding-left: 15%;
110
-
111
- a {
112
- width: 100%;
113
- display: block;
114
- }
115
-
116
- &.selected {
117
- a {
118
- color: black;
119
- font-weight: bold;
120
- }
121
- }
122
- }
123
- }
124
-
125
- h3,
126
- li {
127
- padding: 5px 0 5px 15px;
128
- letter-spacing: 2px;
129
- line-height: 20px;
130
- color: #939da8;
131
- font-size: 12px;
132
-
133
- &:hover,
134
- a:hover {
135
- color: black;
136
- }
137
- }
138
- }
139
- }
140
- </style>
@@ -1,65 +0,0 @@
1
- <template>
2
- <div class="aj-adjust-font-size">
3
- <span>字体大小</span>
4
- <ul @click="onClk">
5
- <li><label><input type="radio" name="fontSize" /> 小</label></li>
6
- <li><label><input type="radio" name="fontSize" /> 中</label></li>
7
- <li><label><input type="radio" name="fontSize" /> 大</label></li>
8
- </ul>
9
- </div>
10
- </template>
11
-
12
- <script lang="ts">
13
- /**
14
- * 调整正文字体大小
15
- */
16
- export default {
17
- props: {
18
- articleTarget: { type: String, default: "article p" }, // 正文所在的位置,通过 CSS Selector 定位
19
- },
20
- methods: {
21
- onClk(ev: Event): void {
22
- let el: Element = ev.target as Element;
23
- let setFontSize = (fontSize: string): void => {
24
- document.body
25
- .querySelectorAll(this.$props.articleTarget)
26
- .forEach((p: HTMLParagraphElement) => (p.style.fontSize = fontSize));
27
- };
28
-
29
- if (el.tagName == "LABEL" || el.tagName == "INPUT") {
30
- if (el.tagName != "LABEL") el = el.parentNode as Element;
31
-
32
- if (el.innerHTML.indexOf("大") != -1) setFontSize("12pt");
33
- else if (el.innerHTML.indexOf("中") != -1) setFontSize("10.5pt");
34
- else if (el.innerHTML.indexOf("小") != -1) setFontSize("9pt");
35
- }
36
- },
37
- },
38
- };
39
- </script>
40
-
41
- <style lang="less" scoped>
42
- .aj-adjust-font-size {
43
- width: 210px;
44
- font-size: 0.8rem;
45
- padding: 2px 0;
46
-
47
- span {
48
- float: left;
49
- width: 35%;
50
- display: block;
51
- }
52
-
53
- ul {
54
- width: 65%;
55
- float: right;
56
- cursor: pointer;
57
-
58
- li {
59
- display: block;
60
- float: right;
61
- width: 33%;
62
- }
63
- }
64
- }
65
- </style>
@@ -1,59 +0,0 @@
1
- <template>
2
- <article>
3
- <h2>{{title}}</h2>
4
-
5
- <div class="toolbar">
6
- <span v-if="author">作者: {{author}}</span> &nbsp;
7
- <a :href="source" v-if="source" target="_blank">
8
-
9
- <svg width="16px" height="16px" viewBox="0 0 24 24" style="cursor:pointer;vertical-align: middle;">
10
- <g stroke-width="2.1" stroke="#666" fill="none" stroke-linecap="round" stroke-linejoin="round">
11
- <polyline points="17 13.5 17 19.5 5 19.5 5 7.5 11 7.5"></polyline>
12
- <path d="M14,4.5 L20,4.5 L20,10.5 M20,4.5 L11,13.5"></path>
13
- </g>
14
- </svg>
15
- 来源</a>
16
- <FontSize style="float:right;clear:both"></FontSize>
17
- </div>
18
- <slot></slot>
19
- </article>
20
- </template>
21
-
22
- <script>
23
- import FontSize from './AdjustFontSize.vue';
24
-
25
- export default {
26
- props: {
27
- title: String, author: String, source: String
28
- },
29
- components: { FontSize }
30
- }
31
- </script>
32
-
33
- <style lang="less" scoped>
34
- @import "../style/common-functions.less";
35
-
36
- article {
37
- & > p {
38
- .aj-text-function();
39
- text-indent: 2em;
40
- }
41
- & > img,
42
- & > p > img {
43
- max-width: 80%;
44
- margin: 0 auto;
45
- display: block;
46
- }
47
-
48
- h2 {
49
- .aj-text-title();
50
- }
51
-
52
- .toolbar {
53
- height: 15px;
54
- margin: 30px 0;
55
- font-size: 0.8rem;
56
- text-align: right;
57
- }
58
- }
59
- </style>
@@ -1,4 +0,0 @@
1
- export default {
2
- empty: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2U9IiNEQURFRTMiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTUwLjU5OCAxMS4wOTNDMjUuNTU0IDE1Ljc2IDExLjcyOCAyNC41NzMgOS4xMiAzNy41MzUgNS45OSA2OC42NDQgMTI4LjA4IDcwLjIgMTEzLjIxIDEwMi44NjNjLTcuODI2IDEwLjg4Ny0yNS41NjYgMTMuMjItNTMuMjE5IDYuOTk5IiBzdHJva2UtZGFzaGFycmF5PSIzIi8+PGcgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZmlsbD0iI0ZGRiIgZD0ibTU1IDY4LjI3IDQyLjE2Mi0xMi4zMjR2NDkuNTc3TDU1IDExNy41Njh6TTU1IDY4LjEwOCAxNi4wODEgNTUuOTQ2djQ5LjU3N0w1NSAxMTcuNTY4eiIvPjxwYXRoIGZpbGw9IiNGRkYiIGQ9Ik0xNi4wMTIgNTYuMDQgNTUgNjguMTA4IDQyLjUgODYuNzU3IDQuNzMgNzMuMDYzek05Ny4xNjIgNTUuOTQ2IDU1IDY4LjEwOGwxMi44MSAxOC42NDkgNDIuMzI1LTE0LjE2NnoiLz48cGF0aCBmaWxsPSIjRjZGN0Y4IiBkPSJtMTYuMDgxIDU1Ljk0NiA0My4zNDctMTIuMTYyIDM3LjczNCAxMi4xNjJMNTUgNjguMTA4eiIvPjwvZz48ZyBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBmaWxsPSIjRkZGIiBkPSJNNzguMDY4IDEwLjMxIDYwLjA0IDguOGwyLjc5LTUuMzF6Ii8+PHBhdGggZmlsbD0iI0Y2RjdGOCIgZD0iTTc4LjA2OCAxMC4zMSA1Ni40NSAxMy44OGwtMy44MzQtNS45MzR6Ii8+PC9nPjwvZz48L3N2Zz4=',
3
- emptyDrak: 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEyMCIgd2lkdGg9IjEyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2U9IiMzYTNjNDYiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTUwLjU5OCAxMS4wOTNDMjUuNTU0IDE1Ljc2IDExLjcyOCAyNC41NzMgOS4xMiAzNy41MzUgNS45OSA2OC42NDQgMTI4LjA4IDcwLjIgMTEzLjIxIDEwMi44NjNjLTcuODI2IDEwLjg4Ny0yNS41NjYgMTMuMjItNTMuMjE5IDYuOTk5IiBzdHJva2UtZGFzaGFycmF5PSIzIi8+PGcgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGcgZmlsbD0iIzFhMWIxZSI+PHBhdGggZD0ibTU1IDY4LjI3IDQyLjE2Mi0xMi4zMjR2NDkuNTc3TDU1IDExNy41Njh6TTU1IDY4LjEwOCAxNi4wODEgNTUuOTQ2djQ5LjU3N0w1NSAxMTcuNTY4eiIvPjxwYXRoIGQ9Ik0xNi4wMTIgNTYuMDQgNTUgNjguMTA4IDQyLjUgODYuNzU3IDQuNzMgNzMuMDYzek05Ny4xNjIgNTUuOTQ2IDU1IDY4LjEwOGwxMi44MSAxOC42NDkgNDIuMzI1LTE0LjE2NnoiLz48L2c+PHBhdGggZD0ibTE2LjA4MSA1NS45NDYgNDMuMzQ3LTEyLjE2MiAzNy43MzQgMTIuMTYyTDU1IDY4LjEwOHoiIGZpbGw9IiMxNDE1MTgiLz48L2c+PGcgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggZD0iTTc4LjA2OCAxMC4zMSA2MC4wNCA4LjhsMi43OS01LjMxeiIgZmlsbD0iIzFhMWIxZSIvPjxwYXRoIGQ9Ik03OC4wNjggMTAuMzEgNTYuNDUgMTMuODhsLTMuODM0LTUuOTM0eiIgZmlsbD0iIzE0MTUxOCIvPjwvZz48L2c+PC9zdmc+'
4
- };
@@ -1,65 +0,0 @@
1
- <template>
2
- <div class="aj-expander" :style="'height:' + (expended ? openHeight : closeHeight) + 'px;'">
3
- <div :class="expended ? 'closeBtn' : 'openBtn'" @click="expended = !expended;"></div>
4
- <slot></slot>
5
- </div>
6
- </template>
7
-
8
- <script lang="ts">
9
- /**
10
- * 展开闭合器
11
- */
12
- export default {
13
- props: {
14
- openHeight: { type: Number, default: 200 },
15
- closeHeight: { type: Number, default: 50 },
16
- },
17
- data(): any {
18
- return {
19
- expended: false,
20
- };
21
- },
22
- };
23
- </script>
24
-
25
- <style lang="less" scoped>
26
- .aj-expander {
27
- overflow: hidden;
28
- position: relative;
29
- clear: both;
30
- transition: height 200ms ease 0s;
31
-
32
- .mask-layer {
33
- position: absolute;
34
- bottom: 0;
35
- left: 0;
36
- height: 23px;
37
- width: 100%;
38
- background: -webkit-gradient(
39
- linear,
40
- center top,
41
- center bottom,
42
- from(transparent),
43
- to(white)
44
- );
45
- }
46
-
47
- .openBtn {
48
- background: url("https://ajaxjs.nos-eastchina1.126.net/images/openBtn.png");
49
- }
50
-
51
- .closeBtn {
52
- background: url("https://ajaxjs.nos-eastchina1.126.net/images/closeBtn.png");
53
- }
54
-
55
- .closeBtn,
56
- .openBtn {
57
- width: 45px;
58
- height: 32px;
59
- position: absolute;
60
- cursor: pointer;
61
- top: 0px;
62
- right: 0px;
63
- }
64
- }
65
- </style>
@@ -1,68 +0,0 @@
1
- .aj-file-uploader {
2
- width: 360px;
3
-
4
- &>* {
5
- display: inline-block;
6
- vertical-align: middle;
7
- }
8
-
9
- label {
10
- margin-right: 2%;
11
-
12
- &>div {
13
- border: 1px solid lightgray;
14
- border-radius: 5px;
15
- text-align: center;
16
- color: gray;
17
- cursor: pointer;
18
- font-size: 0.8rem;
19
- padding: 10px;
20
- padding-bottom: 25px;
21
- width: 100px;
22
- height: 70px;
23
- transition: border-color linear 300ms, color linear 300ms;
24
-
25
- &:hover {
26
- border-color: gray;
27
- color: black;
28
- }
29
-
30
- &>div {
31
- font-size: 2rem;
32
- }
33
- }
34
- }
35
-
36
- button {
37
- min-width: 110px;
38
- }
39
-
40
- input[type="file"] {
41
- display: none;
42
- }
43
-
44
- .msg {
45
- font-size: 0.8rem;
46
- color: gray;
47
- max-width: 50%;
48
- word-break: break-word;
49
- text-overflow: ellipsis;
50
-
51
- &>div {
52
- font-size: 0.75rem;
53
- }
54
- }
55
-
56
- .perviewImg {
57
- max-width: 260px;
58
- }
59
-
60
- .fileName {
61
- // display: inline-block;
62
- text-overflow: ellipsis; //溢出用省略号显示
63
- white-space: nowrap; //溢出不换行
64
- max-width: 120px;
65
- max-height: 20px;
66
- overflow: hidden;
67
- }
68
- }