>>2]|=(f[g>>>2]>>>24-8*(g%4)&255)<<24-8*((b+g)%4);else if(65535 >>0?1:0);R=m.low=R+I;m.high=ea+U+(R>>>0>>0?1:0);
23 | S=L.low=S+J;L.high=fa+V+(S>>>0 >>0?1:0);T=m.low=T+J;m.high=fa+W+(T>>>0>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((e+b)%4);else if(65535
这是另一个文件
9 |
10 |
--------------------------------------------------------------------------------
/src/assets/html/about.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 关于我们静态文件
9 |
10 |
--------------------------------------------------------------------------------
/src/commonvue/side.vue:
--------------------------------------------------------------------------------
1 |
116 |
117 |
118 |
158 |
159 |
160 |
--------------------------------------------------------------------------------
/src/commonvue/top.vue:
--------------------------------------------------------------------------------
1 |
115 |
116 |
127 |
128 |
--------------------------------------------------------------------------------
/src/commonvue/zane-calendar.vue:
--------------------------------------------------------------------------------
1 |
13 |
14 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/src/components/page.vue:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
4 |
5 |
6 |
33 |
--------------------------------------------------------------------------------
/src/components/utils/NodeList.js:
--------------------------------------------------------------------------------
1 | const ArrayProto = Array.prototype
2 | const nodeError = new Error('Passed arguments must be of Node')
3 | let blurEvent
4 | let blurList = []
5 | let Events = []
6 |
7 | class NodeList {
8 | constructor (args) {
9 | var i = 0, l, nodes = args;
10 | if (args[0] === window) {
11 | nodes = [window]
12 | } else if (typeof args[0] === 'string') {
13 | nodes = (args[1] || document).querySelectorAll(args[0])
14 | if (args[1]) { this.owner = args[1] }
15 | } else if (0 in args && !(args[0] instanceof Node) && args[0] && 'length' in args[0]) {
16 | nodes = args[0];
17 | if (args[1]) { this.owner = args[1] }
18 | }
19 | if (nodes) {
20 | for(let i in nodes) {
21 | this[i] = nodes[i]
22 | }
23 | this.length = nodes.length
24 | } else {
25 | this.length = 0
26 | }
27 | }
28 |
29 | concat () {
30 | let nodes = ArrayProto.slice.call(this)
31 | function flatten(arr) {
32 | for (let el of arr) {
33 | if (el instanceof Node) {
34 | if (!~nodes.indexOf(el)) nodes.push(el)
35 | } else if (el) {
36 | flatten(el)
37 | }
38 | }
39 | }
40 | for (let arg of arguments) {
41 | if (arg instanceof Node) {
42 | if (!~nodes.indexOf(arg)) nodes.push(arg)
43 | } else if (arg instanceof window.NodeList || arg instanceof NodeList || arg instanceof HTMLCollection || arg instanceof Array) {
44 | flatten(arg)
45 | } else {
46 | throw Error('Concat arguments must be of a Node, NodeList, HTMLCollection, or Array of (Node, NodeList, HTMLCollection, Array)')
47 | }
48 | }
49 | return new NodeList([nodes, this])
50 | }
51 | each () {
52 | ArrayProto.forEach.apply(this, arguments)
53 | return this
54 | }
55 | parent () {
56 | return this.map(el => { return el.parentNode })
57 | }
58 | filter () {
59 | return new NodeList([ArrayProto.filter.apply(this, arguments), this])
60 | }
61 | find (element) {
62 | let nodes = []
63 | for (let el of flatten(this)) {
64 | let node = el.querySelectorAll(element)
65 | if (node && node.length) nodes.push(node)
66 | }
67 | return flatten(nodes, this.owner)
68 | }
69 | findChildren (element) {
70 | return this.find(element).filter(el => {
71 | return this.includes(el.parentElement)
72 | })
73 | }
74 | forEach () {
75 | ArrayProto.forEach.apply(this, arguments)
76 | return this
77 | }
78 | includes (element, index) {
79 | return ~this.indexOf(element, index)
80 | }
81 | map (...args) {
82 | return flatten(ArrayProto.map.apply(this, args), this)
83 | }
84 | pop (amount) {
85 | if (typeof amount !== 'number') { amount = 1 }
86 | let nodes = []
87 | let pop = ArrayProto.pop.bind(this)
88 | while (amount--) nodes.push(pop())
89 | return new NodeList([nodes, this])
90 | }
91 | push () {
92 | for (let arg of arguments) {
93 | if (!(arg instanceof Node)) throw nodeError
94 | if (!~this.indexOf(arg)) ArrayProto.push.call(this, arg)
95 | }
96 | return this
97 | }
98 | delete () {
99 | let list = new NodeList([[],this.owner])
100 | let splice = index => ArrayProto.splice.apply()
101 | let i = this.length - 1
102 | for(let el = this[i]; el; el = this[--i]) {
103 | if (el.remove) {
104 | el.remove()
105 | ArrayProto.splice.call(this, i, 1)
106 | } else if (el.parentNode) {
107 | el.parentNode.removeChild(el)
108 | ArrayProto.splice.call(this, i, 1)
109 | }
110 | }
111 | return this
112 | }
113 | shift (amount) {
114 | if (typeof amount !== 'number') { amount = 1 }
115 | let nodes = []
116 | let shift = ArrayProto.shift.bind(this)
117 | while (amount--) nodes.push(shift())
118 | return new NodeList([nodes, this])
119 | }
120 | slice () {
121 | return new NodeList([ArrayProto.slice.apply(this, arguments), this])
122 | }
123 | splice () {
124 | for(let i = 2, l = arguments.length; i < l; i++) {
125 | if (!(arguments[i] instanceof Node)) throw nodeError
126 | }
127 | return new NodeList([ArrayProto.splice.apply(this, arguments), this])
128 | }
129 | unshift () {
130 | let unshift = ArrayProto.unshift.bind(this)
131 | for (let arg of arguments) {
132 | if (!(arg instanceof Node)) throw nodeError
133 | if (!~this.indexOf(arg)) unshift(arg)
134 | }
135 | return this
136 | }
137 |
138 | addClass (classes) {
139 | return this.toggleClass(classes, true)
140 | }
141 | removeClass (classes) {
142 | return this.toggleClass(classes, false)
143 | }
144 | toggleClass (classes, value) {
145 | const method = (value === undefined || value === null) ? 'toggle' : value ? 'add' : 'remove'
146 | if (typeof classes === 'string') {
147 | classes = classes.trim().replace(/\s+/,' ').split(' ')
148 | }
149 | classes.forEach(c => this.each(el => el.classList[method](c)))
150 | return this
151 | }
152 |
153 | get (prop) {
154 | let arr = []
155 | for (let el of this) {
156 | if (el !== null) {
157 | el = el[prop]
158 | }
159 | arr.push(el)
160 | }
161 | return flatten(arr, this)
162 | }
163 | set (prop, value) {
164 | if (prop.constructor === Object) {
165 | for (let el of this) {
166 | if (el) {
167 | for (key in prop) {
168 | if (key in el) {
169 | el[key] = prop[key]
170 | }
171 | }
172 | }
173 | }
174 | } else {
175 | for (let el of this) {
176 | if (prop in el) {
177 | el[prop] = value
178 | }
179 | }
180 | }
181 | return this
182 | }
183 | call (...args) {
184 | const method = ArrayProto.shift.call(args)
185 | let arr = []
186 | let returnThis = true
187 | for (let el of this) {
188 | if (el && el[method] instanceof Function) {
189 | el = el[method].apply(el, args)
190 | arr.push(el)
191 | if (returnThis && el !== undefined) {
192 | returnThis = false
193 | }
194 | } else {
195 | arr.push(undefined)
196 | }
197 | }
198 | return returnThis ? this : flatten(arr, this)
199 | }
200 | item (index) {
201 | return new NodeList([[this[index]], this])
202 | }
203 | get asArray () {
204 | return ArrayProto.slice.call(this)
205 | }
206 |
207 | // event handlers
208 | on (events, selector, callback) {
209 | if (typeof events === 'string') { events = events.trim().replace(/\s+/,' ').split(' ') }
210 | if (!this || !this.length) return this
211 | if (callback === undefined) {
212 | callback = selector
213 | selector = null
214 | }
215 | if (!callback) return this
216 | const fn = callback
217 | callback = selector ? function (e) {
218 | let els = new NodeList([selector,this])
219 | if (!els.length) { return }
220 | els.some(el => {
221 | let target = el.contains(e.target)
222 | if (target) fn.call(el, e, el)
223 | return target;
224 | })
225 | } : function (e) {
226 | fn.apply(this, [e, this])
227 | }
228 | for (let event of events) {
229 | for (let el of this) if (el) {
230 | el.addEventListener(event, callback, false)
231 | Events.push({
232 | el: el,
233 | event: event,
234 | callback: callback
235 | })
236 | }
237 | }
238 | return this
239 | }
240 | off (events, callback) {
241 | if (events instanceof Function) {
242 | callback = events
243 | events = null
244 | }
245 | if (typeof events === 'string' && callback instanceof Function) {
246 | for (let el of this) {
247 | for(let e in Events) {
248 | for (let event of events.split(' ')) {
249 | if(Events[e] && Events[e].el === el && Events[e].event === event && Events[e].callback === callback) {
250 | Events[e].el.removeEventListener(Events[e].event, Events[e].callback)
251 | delete Events[e]
252 | }
253 | }
254 | }
255 | }
256 | } else if (typeof events === 'string') {
257 | for (let el of this) {
258 | for (let e in Events) {
259 | for (let event of events.split(' ')) {
260 | if (Events[e] && Events[e].el === el && Events[e].event === event) {
261 | Events[e].el.removeEventListener(Events[e].event, Events[e].callback)
262 | delete Events[e]
263 | }
264 | }
265 | }
266 | }
267 | } else if (callback instanceof Function) {
268 | for (let el of this) {
269 | for (let e in Events) {
270 | if (Events[e] && Events[e].el === el && Events[e].callback === callback) {
271 | Events[e].el.removeEventListener(Events[e].event, Events[e].callback)
272 | delete Events[e]
273 | }
274 | }
275 | }
276 | } else {
277 | for (let el of this) {
278 | for (let e in Events) {
279 | if (Events[e] && Events[e].el === el) {
280 | Events[e].el.removeEventListener(Events[e].event, Events[e].callback)
281 | delete Events[e]
282 | }
283 | }
284 | }
285 | }
286 | Events = Events.filter(el => { return el !== undefined })
287 | return this
288 | }
289 | onBlur (callback) {
290 | if (!this || !this.length) return this
291 | if (!callback) return this
292 | this.each((el) => {
293 | blurList.push({
294 | el: el,
295 | callback: callback
296 | })
297 | })
298 | if (!blurEvent) {
299 | blurEvent = e => {
300 | for (let item of blurList) {
301 | let target = item.el.contains(e.target) || item.el === e.target
302 | if (!target) item.callback.call(item.el, e, item.el)
303 | }
304 | }
305 | document.addEventListener('click', blurEvent, false)
306 | document.addEventListener('touchstart', blurEvent, false)
307 | }
308 | return this
309 | }
310 | offBlur (callback) {
311 | this.each(el => {
312 | for (let e in blurList) {
313 | if (blurList[e] && blurList[e].el === el && (!callback || blurList[e].callback === callback)) {
314 | delete blurList[e]
315 | }
316 | }
317 | })
318 | blurList = blurList.filter(el => { return el !== undefined })
319 | return this
320 | }
321 | }
322 |
323 | let NL = NodeList.prototype
324 |
325 | function flatten (arr, owner) {
326 | let list = []
327 | for (let el of arr) {
328 | if (el instanceof Node || el === null) {
329 | if (!~list.indexOf(el)) list.push(el)
330 | } else if (el instanceof window.NodeList || el instanceof NodeList || el instanceof HTMLCollection || el instanceof Array) {
331 | for(let el2 of el) list.push(el2)
332 | } else {
333 | arr.get = NL.get
334 | arr.set = NL.set
335 | arr.call = NL.call
336 | arr.owner = owner
337 | return arr
338 | }
339 | }
340 | return new NodeList([list, owner])
341 | }
342 |
343 | Object.getOwnPropertyNames(ArrayProto).forEach(key => {
344 | if (key !== 'join' && key !== 'copyWithin' && key !== 'fill' && NL[key] === undefined) {
345 | NL[key] = ArrayProto[key]
346 | }
347 | })
348 | if (window.Symbol && Symbol.iterator) {
349 | NL[Symbol.iterator] = NL.values = ArrayProto[Symbol.iterator]
350 | }
351 | const div = document.createElement('div')
352 | function setterGetter (prop) {
353 | if (div[prop] instanceof Function) {
354 | NL[prop] = () => {
355 | let arr = []
356 | let returnThis = true
357 | for (let el of NL) {
358 | if (el && el[prop] instanceof Function) {
359 | el = el[prop].apply(el, arguments)
360 | arr.push(el)
361 | if (returnThis && el !== undefined) {
362 | returnThis = false
363 | }
364 | } else {
365 | arr.push(undefined)
366 | }
367 | }
368 | return returnThis ? this : flatten(arr, this)
369 | }
370 | } else {
371 | Object.defineProperty(NL, prop, {
372 | get: function () {
373 | let arr = []
374 | for (let el of this) {
375 | if (el !== null) {
376 | el = el[prop]
377 | }
378 | arr.push(el)
379 | }
380 | return flatten(arr, this)
381 | },
382 | set: function (value) {
383 | for (let el of this) {
384 | if (el && prop in el) {
385 | el[prop] = value
386 | }
387 | }
388 | }
389 | })
390 | }
391 | }
392 | for (let prop in div) setterGetter(prop)
393 |
394 | function NodeListJS () {
395 | return new NodeList(arguments)
396 | }
397 | window.NL = NodeListJS
398 |
399 | export default NodeListJS
400 |
--------------------------------------------------------------------------------
/src/components/utils/utils.js:
--------------------------------------------------------------------------------
1 | // coerce convert som types of data into another type
2 | export const coerce = {
3 | // Convert a string to booleam. Otherwise, return the value without modification, so if is not boolean, Vue throw a warning.
4 | boolean: val => (typeof val === 'string' ? (val === 'false' || val === 'null' || val === 'undefined' ? false : val === 'true' ? true : val) : val),
5 | // Attempt to convert a string value to a Number. Otherwise, return 0.
6 | number: (val, alt = null) => (typeof val === 'number' ? val : val === undefined || val === null || isNaN(Number(val)) ? alt : Number(val)),
7 | // Attempt to convert to string any value, except for null or undefined.
8 | string: val => (val === undefined || val === null ? '' : val + ''),
9 | // Pattern accept RegExp, function, or string (converted to RegExp). Otherwise return null.
10 | pattern: val => (val instanceof Function || val instanceof RegExp ? val : typeof val === 'string' ? new RegExp(val) : null)
11 | }
12 |
13 | export function getJSON (url) {
14 | let request = new window.XMLHttpRequest()
15 | let data = {}
16 | // p (-simulated- promise)
17 | let p = {
18 | then (fn1, fn2) { return p.done(fn1).fail(fn2) },
19 | catch (fn) { return p.fail(fn) },
20 | always (fn) { return p.done(fn).fail(fn) }
21 | }
22 | for (let name of ['done', 'fail']) {
23 | data[name] = []
24 | p[name] = (fn) => {
25 | if (fn instanceof Function) data[name].push(fn)
26 | return p
27 | }
28 | }
29 | p.done(JSON.parse)
30 | request.onreadystatechange = () => {
31 | if (request.readyState === 4) {
32 | let e = {status: request.status}
33 | if (request.status === 200) {
34 | try {
35 | let value, response = request.responseText
36 | for (let done of data.done) {
37 | if ((value = done(response)) !== undefined) { response = value }
38 | }
39 | } catch (e) {
40 | for (let fail of data.fail) fail(e)
41 | }
42 | } else {
43 | for (let fail of data.fail) fail(e)
44 | }
45 | }
46 | }
47 | request.open('GET', url)
48 | request.setRequestHeader('Accept', 'application/json')
49 | request.send()
50 | return p
51 | }
52 |
53 | export function getScrollBarWidth () {
54 | if (document.documentElement.scrollHeight <= document.documentElement.clientHeight) {
55 | return 0
56 | }
57 | let inner = document.createElement('p')
58 | inner.style.width = '100%'
59 | inner.style.height = '200px'
60 |
61 | let outer = document.createElement('div')
62 | outer.style.position = 'absolute'
63 | outer.style.top = '0px'
64 | outer.style.left = '0px'
65 | outer.style.visibility = 'hidden'
66 | outer.style.width = '200px'
67 | outer.style.height = '150px'
68 | outer.style.overflow = 'hidden'
69 | outer.appendChild(inner)
70 |
71 | document.body.appendChild(outer)
72 | let w1 = inner.offsetWidth
73 | outer.style.overflow = 'scroll'
74 | let w2 = inner.offsetWidth
75 | if (w1 === w2) w2 = outer.clientWidth
76 |
77 | document.body.removeChild(outer)
78 |
79 | return (w1 - w2)
80 | }
81 |
82 | // return all the translations or the default language (english)
83 | export function translations (lang) {
84 | lang = lang || 'en'
85 | let text = {
86 | daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
87 | limit: 'Limit reached ({{limit}} items max).',
88 | loading: 'Loading...',
89 | minLength: 'Min. Length',
90 | months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
91 | notSelected: 'Nothing Selected',
92 | required: 'Required',
93 | search: 'Search'
94 | }
95 | return window.VueStrapLang ? window.VueStrapLang(lang) : text
96 | }
--------------------------------------------------------------------------------
/src/filter.js:
--------------------------------------------------------------------------------
1 | //filter.js 过滤器集合
2 | import util from 'common/js/util'
3 | import accounting from 'accounting'
4 |
5 | //定义用的路由集合
6 | let arrFilder = [
7 | require('pages/index/filter'),
8 | ];
9 |
10 | let json = {};
11 |
12 | //合并过滤器
13 | if (arrFilder.length) {
14 | for (var i = 0; i < arrFilder.length; i++) {
15 | json = Object.assign(json, arrFilder[i]);
16 | };
17 | };
18 | json = Object.assign(json, {
19 | // 转换为大写
20 | uppercase(value) {
21 | if (!value) return;
22 | return value.toString().toUpperCase();
23 | },
24 | // 转换为小写
25 | lowercase(value) {
26 | if (!value) return;
27 | return value.toString().toLowerCase();
28 | },
29 | //货币过滤器
30 | currency(value, symbol, digit, bwf, gwf) {
31 | if (!value) return;
32 | return accounting.formatMoney(value, symbol || '¥', digit || 2, bwf || ',', gwf || '.'); // ¥4,999.99
33 | },
34 | // 时间过滤器
35 | date(value, gengefu, full) {
36 | if (!value) return;
37 | let ty = gengefu || '-';
38 | if (full) {
39 | return new Date(value).format('yyyy' + ty + 'MM' + ty + 'dd hh:mm:ss');
40 | } else {
41 | return new Date(value).format('yyyy' + ty + 'MM' + ty + 'dd');
42 | };
43 | },
44 | //limitTo过滤器
45 | limitTo(value, num) {
46 | if (!value) return;
47 | var text = "";
48 | if (value.length < num) {
49 | text = value;
50 | } else {
51 | text = value.substring(0, num) + '···';
52 | }
53 | return text;
54 | },
55 | });
56 |
57 | module.exports = json;
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
13 |