safecheck-client 3.0.33-43 → 3.0.33-45

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.
@@ -1,337 +1,337 @@
1
- import Vue from 'vue'
2
- // import AppData from '../stores/AppData'
3
-
4
- // 登录后获取的所有数据,需要自行获取
5
- export var f
6
-
7
- export function getAttendanceState(item, timeToWork, timeToGo) {
8
- item.f_state = ''
9
- if(!item.f_signin_time || !item.f_knockoff_time)
10
- item.f_state = '缺勤'
11
- else {
12
- let signin_time = item.f_signin_time.substring(11, 16)
13
- let knockoff_time = item.f_knockoff_time.substring(11, 16)
14
- if(signin_time > timeToWork)
15
- item.f_state = '迟到'
16
- if(knockoff_time < timeToGo)
17
- item.f_state = item.f_state + '早退'
18
- }
19
- if(!item.f_state)
20
- item.f_state = '正常'
21
- }
22
-
23
- export function isEmpty (str) {
24
- return str === undefined || str === null || str.toString().trim() === ''
25
- }
26
-
27
-
28
- export function dateAddDay (date, day) {
29
- date.setDate(date.getDate() + Number.parseInt(day));
30
- let month = date.getMonth()+1
31
- let date2 = date.getDate()
32
- return date.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date2<10? '0'+ date2 : date2)
33
- }
34
-
35
- // 字符串进行解密
36
- export function uncompileStr (code) {
37
- code = unescape(code)
38
- let c = String.fromCharCode(code.charCodeAt(0) - code.length)
39
- for (var i = 1; i < code.length; i++) {
40
- c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
41
- }
42
- return c
43
- }
44
-
45
- // 通过地址栏的参数获取参数内容
46
- export function getUrlParames (param) {
47
- var query = window.location.search
48
- var iLen = param.length
49
- var iStart = query.indexOf(param)
50
- if (iStart === -1) {
51
- return ''
52
- }
53
- iStart += iLen + 1
54
- var iEnd = query.indexOf('&', iStart)
55
- if (iEnd === -1) {
56
- return query.substring(iStart)
57
- }
58
- return query.substring(iStart, iEnd)
59
- }
60
-
61
- // 从地址栏获取加密的参数
62
- export function getUrlCompileParames (param) {
63
- var query = uncompileStr(window.location.search.slice(1, window.location.search.length))
64
- var iLen = param.length
65
- var iStart = query.indexOf(param)
66
- if (iStart === -1) {
67
- return ''
68
- }
69
- iStart += iLen + 1
70
- var iEnd = query.indexOf('&', iStart)
71
- if (iEnd === -1) {
72
- return query.substring(iStart)
73
- }
74
- return query.substring(iStart, iEnd)
75
- }
76
-
77
- export function toStandardYearMonth() {
78
- let dt = new Date()
79
- let month = dt.getMonth()+1
80
- return dt.getFullYear() + '-' + (month<10? '0'+ month : month)
81
- }
82
-
83
- export function toStandardDateString() {
84
- let dt = new Date()
85
- let month = dt.getMonth()+1
86
- let date = dt.getDate()
87
- return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
88
- }
89
- //获取当前月第一天
90
- export function toStartDateString () {
91
- let dt = new Date()
92
- let month = dt.getMonth() + 1
93
- let date = dt.getDate()
94
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + '01'
95
- }
96
- //获取当前月最后一天
97
- export function toEndDateString () {
98
- let dt = new Date()
99
- let month = dt.getMonth() + 1
100
- // let date = dt.getDate()
101
- return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())
102
- // return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
103
- }
104
-
105
- //获取当前年份1月1号
106
- export function toStartDateYearString () {
107
- let dt = new Date()
108
- let date = dt.getDate()
109
- return dt.getFullYear() + '-' + '01' + '-' + '01'
110
- }
111
- export function toStandardTimeString() {
112
- let dt = new Date()
113
- let month = dt.getMonth()+1
114
- let date = dt.getDate()
115
- let hour = dt.getHours()
116
- let min = dt.getMinutes()
117
- let sec = dt.getSeconds()
118
- return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
119
- + ' ' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
120
- }
121
-
122
- export function to3339TimeString() {
123
- let dt = new Date()
124
- let month = dt.getMonth()+1
125
- let date = dt.getDate()
126
- let hour = dt.getHours()
127
- let min = dt.getMinutes()
128
- let sec = dt.getSeconds()
129
- return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
130
- + 'T' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
131
- }
132
-
133
- export function parse3339String(strDate) {
134
- return new Date(
135
- strDate.substr(0, 4), strDate.substr(5, 2)-1, strDate.substr(8, 2)
136
- ,strDate.substr(11, 2), strDate.substr(14, 2), strDate.substr(17, 2)
137
- )
138
- }
139
-
140
- export function format3339TimeString(dt) {
141
- let month = dt.getMonth()+1
142
- let date = dt.getDate()
143
- let hour = dt.getHours()
144
- let min = dt.getMinutes()
145
- let sec = dt.getSeconds()
146
- return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
147
- + 'T' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
148
- }
149
-
150
- export function guid() {
151
- let buf = new Uint16Array(8)
152
- window.crypto.getRandomValues(buf)
153
- let S4 = function(num) {
154
- let ret = num.toString(16)
155
- while(ret.length < 4){
156
- ret = '0' + ret
157
- }
158
- return ret
159
- }
160
- return (S4(buf[0])+S4(buf[1])+S4(buf[2])+S4(buf[3])+S4(buf[4])+S4(buf[5])+S4(buf[6])+S4(buf[7]))
161
- }
162
-
163
- export function choices (role, param, hasBlank = false, blankHint = '请选择') {
164
- if (role === 'view') {
165
- Vue.$appdata.getParam(param, [null])
166
- } else {
167
- let result = []
168
- if(hasBlank)
169
- result.push({label: blankHint, value: null})
170
- if(!Vue.param || !Vue.param[param])
171
- result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
172
- else {
173
- ////tag
174
- ////tag)
175
- let p = Vue.param[param]
176
- p.forEach(function(item) {
177
- result.push({label: item.name, value: item.name})
178
- })
179
- }
180
- return result
181
- }
182
- }
183
-
184
- export function required(param) {
185
- if(typeof param === 'number' && param === 0)
186
- return false
187
- if(!param)
188
- return true
189
- param = param + ''
190
- param = param.trim()
191
- if(!param)
192
- return true
193
- // if(param === '')
194
- // return true
195
- // if(param == null)
196
- // return true
197
- // if(typeof param == 'undefined')
198
- // return true
199
- return false
200
- }
201
-
202
- export function isInt(n){
203
- //tag
204
- return !window.isNaN(n) && n % 1 === 0
205
- }
206
-
207
- export function isFloat(n){
208
- //tag
209
- return !window.isNaN(n)
210
- }
211
-
212
- // this will convert all true/false to boolean
213
- export function booleanFilter(paper) {
214
- for(let key in paper) {
215
- if(!paper.hasOwnProperty(key))
216
- continue
217
- if(typeof paper[key] == "object" && paper[key] != null) {
218
- booleanFilter(paper[key]);
219
- } else {
220
- if(paper[key] === "true" || paper[key] == "false")
221
- paper[key] = (paper[key] === "true")
222
- }
223
- }
224
- }
225
- // recursively traverse through each path
226
- export function ratifyPics(paper) {
227
- for (let key in paper) {
228
- if (key.endsWith('_path') && !(JSON.stringify(paper[key]).startsWith('"rs'))) {
229
- if (!paper[key]) {
230
- paper[key] = ''
231
- } else {
232
- paper[key] = 'rs/image/file/' + paper[key]
233
- }
234
- } else if (paper[key] !== null && typeof(paper[key]) == "object") {
235
- ratifyPics(paper[key])
236
- }
237
- }
238
- }
239
- export function androidRatifyPics(paper,url) {
240
- //tag)
241
- for (let key in paper) {
242
- if (key.endsWith('_path') && !(JSON.stringify(paper[key]).startsWith(`"${url}`))) {
243
- //tag
244
- if (!paper[key]) {
245
- paper[key] = ''
246
- } else {
247
- paper[key] = `${url}/rs/image/file/` + paper[key]
248
- }
249
- } else if (paper[key] !== null && typeof(paper[key]) == "object") {
250
- androidRatifyPics(paper[key],url)
251
- }
252
- }
253
- }
254
-
255
- // load script and other stuff
256
- export function loadscript(type, fileName) {
257
- return new Promise((resolve, reject)=> {
258
- let element
259
- if(type == 'css') {
260
- element = document.createElement('link')
261
- element.setAttribute("rel", "stylesheet")
262
- element.setAttribute("type", "text/css")
263
- element.setAttribute("href", fileName)
264
- } else if(type == 'js') {
265
- element = document.createElement('script')
266
- element.setAttribute("type","text/javascript")
267
- element.setAttribute("src", fileName)
268
- }
269
- if(element) {
270
- element.setAttribute('async', '')
271
- element.setAttribute('defer', '')
272
- element.addEventListener('load', function() {
273
- resolve(element)
274
- //tag
275
- }, false)
276
- element.addEventListener('error', function() {
277
- reject(element)
278
- //tag
279
- }, false)
280
- document.body.appendChild(element)
281
- }
282
- })
283
- }
284
-
285
- export function getFileName(fileName) {
286
- let pos = fileName.indexOf('?')
287
- if(pos == -1) {
288
- let pos2 = fileName.lastIndexOf('/')
289
- if(pos2 == -1) {
290
- return fileName
291
- } else {
292
- return fileName.substring(pos2 + 1)
293
- }
294
- } else {
295
- if(pos2 == -1) {
296
- return fileName
297
- } else {
298
- return fileName.substring(pos2 + 1, pos)
299
- }
300
- }
301
- }
302
-
303
- export function replaceFalse(paper) {
304
- for (let key in paper) {
305
- if (paper[key]) {
306
- if (paper[key] == "false" ) {
307
- paper[key] = null
308
- } else if (paper[key] !== null && typeof(paper[key]) == "object") {
309
- replaceFalse(paper[key])
310
- }
311
- }
312
- }
313
- }
314
-
315
- export function getNowDate (name) {
316
- let year = ''
317
- let month = ''
318
- let day = ''
319
- let hour = ''
320
- let minutes = ''
321
- let seconds = ''
322
- let mydate = new Date()
323
- let mymonth = mydate.getMonth() + 1
324
- let myday = mydate.getDate()
325
- let myyear = mydate.getYear()
326
- let myhour = mydate.getHours()
327
- let myminutes = mydate.getMinutes()
328
- let myseconds = mydate.getSeconds()
329
- year = (myyear > 200) ? myyear : 1900 + myyear
330
- month = (mymonth > 9) ? mymonth : '0' + mymonth
331
- day = (myday > 9) ? myday : '0' + myday
332
- hour = (myhour > 9) ? myhour : '0' + myhour
333
- minutes = (myminutes > 9) ? myminutes : '0' + myminutes
334
- seconds = (myseconds > 9) ? myseconds : '0' + myseconds
335
- // document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
336
- return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
337
- }
1
+ import Vue from 'vue'
2
+ // import AppData from '../stores/AppData'
3
+
4
+ // 登录后获取的所有数据,需要自行获取
5
+ export var f
6
+
7
+ export function getAttendanceState(item, timeToWork, timeToGo) {
8
+ item.f_state = ''
9
+ if(!item.f_signin_time || !item.f_knockoff_time)
10
+ item.f_state = '缺勤'
11
+ else {
12
+ let signin_time = item.f_signin_time.substring(11, 16)
13
+ let knockoff_time = item.f_knockoff_time.substring(11, 16)
14
+ if(signin_time > timeToWork)
15
+ item.f_state = '迟到'
16
+ if(knockoff_time < timeToGo)
17
+ item.f_state = item.f_state + '早退'
18
+ }
19
+ if(!item.f_state)
20
+ item.f_state = '正常'
21
+ }
22
+
23
+ export function isEmpty (str) {
24
+ return str === undefined || str === null || str.toString().trim() === ''
25
+ }
26
+
27
+
28
+ export function dateAddDay (date, day) {
29
+ date.setDate(date.getDate() + Number.parseInt(day));
30
+ let month = date.getMonth()+1
31
+ let date2 = date.getDate()
32
+ return date.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date2<10? '0'+ date2 : date2)
33
+ }
34
+
35
+ // 字符串进行解密
36
+ export function uncompileStr (code) {
37
+ code = unescape(code)
38
+ let c = String.fromCharCode(code.charCodeAt(0) - code.length)
39
+ for (var i = 1; i < code.length; i++) {
40
+ c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
41
+ }
42
+ return c
43
+ }
44
+
45
+ // 通过地址栏的参数获取参数内容
46
+ export function getUrlParames (param) {
47
+ var query = window.location.search
48
+ var iLen = param.length
49
+ var iStart = query.indexOf(param)
50
+ if (iStart === -1) {
51
+ return ''
52
+ }
53
+ iStart += iLen + 1
54
+ var iEnd = query.indexOf('&', iStart)
55
+ if (iEnd === -1) {
56
+ return query.substring(iStart)
57
+ }
58
+ return query.substring(iStart, iEnd)
59
+ }
60
+
61
+ // 从地址栏获取加密的参数
62
+ export function getUrlCompileParames (param) {
63
+ var query = uncompileStr(window.location.search.slice(1, window.location.search.length))
64
+ var iLen = param.length
65
+ var iStart = query.indexOf(param)
66
+ if (iStart === -1) {
67
+ return ''
68
+ }
69
+ iStart += iLen + 1
70
+ var iEnd = query.indexOf('&', iStart)
71
+ if (iEnd === -1) {
72
+ return query.substring(iStart)
73
+ }
74
+ return query.substring(iStart, iEnd)
75
+ }
76
+
77
+ export function toStandardYearMonth() {
78
+ let dt = new Date()
79
+ let month = dt.getMonth()+1
80
+ return dt.getFullYear() + '-' + (month<10? '0'+ month : month)
81
+ }
82
+
83
+ export function toStandardDateString() {
84
+ let dt = new Date()
85
+ let month = dt.getMonth()+1
86
+ let date = dt.getDate()
87
+ return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
88
+ }
89
+ //获取当前月第一天
90
+ export function toStartDateString () {
91
+ let dt = new Date()
92
+ let month = dt.getMonth() + 1
93
+ let date = dt.getDate()
94
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + '01'
95
+ }
96
+ //获取当前月最后一天
97
+ export function toEndDateString () {
98
+ let dt = new Date()
99
+ let month = dt.getMonth() + 1
100
+ // let date = dt.getDate()
101
+ return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())
102
+ // return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
103
+ }
104
+
105
+ //获取当前年份1月1号
106
+ export function toStartDateYearString () {
107
+ let dt = new Date()
108
+ let date = dt.getDate()
109
+ return dt.getFullYear() + '-' + '01' + '-' + '01'
110
+ }
111
+ export function toStandardTimeString() {
112
+ let dt = new Date()
113
+ let month = dt.getMonth()+1
114
+ let date = dt.getDate()
115
+ let hour = dt.getHours()
116
+ let min = dt.getMinutes()
117
+ let sec = dt.getSeconds()
118
+ return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
119
+ + ' ' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
120
+ }
121
+
122
+ export function to3339TimeString() {
123
+ let dt = new Date()
124
+ let month = dt.getMonth()+1
125
+ let date = dt.getDate()
126
+ let hour = dt.getHours()
127
+ let min = dt.getMinutes()
128
+ let sec = dt.getSeconds()
129
+ return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
130
+ + 'T' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
131
+ }
132
+
133
+ export function parse3339String(strDate) {
134
+ return new Date(
135
+ strDate.substr(0, 4), strDate.substr(5, 2)-1, strDate.substr(8, 2)
136
+ ,strDate.substr(11, 2), strDate.substr(14, 2), strDate.substr(17, 2)
137
+ )
138
+ }
139
+
140
+ export function format3339TimeString(dt) {
141
+ let month = dt.getMonth()+1
142
+ let date = dt.getDate()
143
+ let hour = dt.getHours()
144
+ let min = dt.getMinutes()
145
+ let sec = dt.getSeconds()
146
+ return dt.getFullYear() + '-' + (month<10? '0'+ month : month) + '-' + (date<10? '0'+ date : date)
147
+ + 'T' + (hour<10? '0'+ hour : hour) + ':' + (min<10? '0'+ min : min) + ':' + (sec<10? '0'+ sec : sec)
148
+ }
149
+
150
+ export function guid() {
151
+ let buf = new Uint16Array(8)
152
+ window.crypto.getRandomValues(buf)
153
+ let S4 = function(num) {
154
+ let ret = num.toString(16)
155
+ while(ret.length < 4){
156
+ ret = '0' + ret
157
+ }
158
+ return ret
159
+ }
160
+ return (S4(buf[0])+S4(buf[1])+S4(buf[2])+S4(buf[3])+S4(buf[4])+S4(buf[5])+S4(buf[6])+S4(buf[7]))
161
+ }
162
+
163
+ export function choices (role, param, hasBlank = false, blankHint = '请选择') {
164
+ if (role === 'view') {
165
+ Vue.$appdata.getParam(param, [null])
166
+ } else {
167
+ let result = []
168
+ if(hasBlank)
169
+ result.push({label: blankHint, value: null})
170
+ if(!Vue.param || !Vue.param[param])
171
+ result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
172
+ else {
173
+ ////tag
174
+ ////tag)
175
+ let p = Vue.param[param]
176
+ p.forEach(function(item) {
177
+ result.push({label: item.name, value: item.name})
178
+ })
179
+ }
180
+ return result
181
+ }
182
+ }
183
+
184
+ export function required(param) {
185
+ if(typeof param === 'number' && param === 0)
186
+ return false
187
+ if(!param)
188
+ return true
189
+ param = param + ''
190
+ param = param.trim()
191
+ if(!param)
192
+ return true
193
+ // if(param === '')
194
+ // return true
195
+ // if(param == null)
196
+ // return true
197
+ // if(typeof param == 'undefined')
198
+ // return true
199
+ return false
200
+ }
201
+
202
+ export function isInt(n){
203
+ //tag
204
+ return !window.isNaN(n) && n % 1 === 0
205
+ }
206
+
207
+ export function isFloat(n){
208
+ //tag
209
+ return !window.isNaN(n)
210
+ }
211
+
212
+ // this will convert all true/false to boolean
213
+ export function booleanFilter(paper) {
214
+ for(let key in paper) {
215
+ if(!paper.hasOwnProperty(key))
216
+ continue
217
+ if(typeof paper[key] == "object" && paper[key] != null) {
218
+ booleanFilter(paper[key]);
219
+ } else {
220
+ if(paper[key] === "true" || paper[key] == "false")
221
+ paper[key] = (paper[key] === "true")
222
+ }
223
+ }
224
+ }
225
+ // recursively traverse through each path
226
+ export function ratifyPics(paper) {
227
+ for (let key in paper) {
228
+ if (key.endsWith('_path') && !(JSON.stringify(paper[key]).startsWith('"rs'))) {
229
+ if (!paper[key]) {
230
+ paper[key] = ''
231
+ } else {
232
+ paper[key] = 'rs/image/file/' + paper[key]
233
+ }
234
+ } else if (paper[key] !== null && typeof(paper[key]) == "object") {
235
+ ratifyPics(paper[key])
236
+ }
237
+ }
238
+ }
239
+ export function androidRatifyPics(paper,url) {
240
+ //tag)
241
+ for (let key in paper) {
242
+ if (key.endsWith('_path') && !(JSON.stringify(paper[key]).startsWith(`"${url}`))) {
243
+ //tag
244
+ if (!paper[key]) {
245
+ paper[key] = ''
246
+ } else {
247
+ paper[key] = `${url}/rs/image/file/` + paper[key]
248
+ }
249
+ } else if (paper[key] !== null && typeof(paper[key]) == "object") {
250
+ androidRatifyPics(paper[key],url)
251
+ }
252
+ }
253
+ }
254
+
255
+ // load script and other stuff
256
+ export function loadscript(type, fileName) {
257
+ return new Promise((resolve, reject)=> {
258
+ let element
259
+ if(type == 'css') {
260
+ element = document.createElement('link')
261
+ element.setAttribute("rel", "stylesheet")
262
+ element.setAttribute("type", "text/css")
263
+ element.setAttribute("href", fileName)
264
+ } else if(type == 'js') {
265
+ element = document.createElement('script')
266
+ element.setAttribute("type","text/javascript")
267
+ element.setAttribute("src", fileName)
268
+ }
269
+ if(element) {
270
+ element.setAttribute('async', '')
271
+ element.setAttribute('defer', '')
272
+ element.addEventListener('load', function() {
273
+ resolve(element)
274
+ //tag
275
+ }, false)
276
+ element.addEventListener('error', function() {
277
+ reject(element)
278
+ //tag
279
+ }, false)
280
+ document.body.appendChild(element)
281
+ }
282
+ })
283
+ }
284
+
285
+ export function getFileName(fileName) {
286
+ let pos = fileName.indexOf('?')
287
+ if(pos == -1) {
288
+ let pos2 = fileName.lastIndexOf('/')
289
+ if(pos2 == -1) {
290
+ return fileName
291
+ } else {
292
+ return fileName.substring(pos2 + 1)
293
+ }
294
+ } else {
295
+ if(pos2 == -1) {
296
+ return fileName
297
+ } else {
298
+ return fileName.substring(pos2 + 1, pos)
299
+ }
300
+ }
301
+ }
302
+
303
+ export function replaceFalse(paper) {
304
+ for (let key in paper) {
305
+ if (paper[key]) {
306
+ if (paper[key] == "false" ) {
307
+ paper[key] = null
308
+ } else if (paper[key] !== null && typeof(paper[key]) == "object") {
309
+ replaceFalse(paper[key])
310
+ }
311
+ }
312
+ }
313
+ }
314
+
315
+ export function getNowDate (name) {
316
+ let year = ''
317
+ let month = ''
318
+ let day = ''
319
+ let hour = ''
320
+ let minutes = ''
321
+ let seconds = ''
322
+ let mydate = new Date()
323
+ let mymonth = mydate.getMonth() + 1
324
+ let myday = mydate.getDate()
325
+ let myyear = mydate.getYear()
326
+ let myhour = mydate.getHours()
327
+ let myminutes = mydate.getMinutes()
328
+ let myseconds = mydate.getSeconds()
329
+ year = (myyear > 200) ? myyear : 1900 + myyear
330
+ month = (mymonth > 9) ? mymonth : '0' + mymonth
331
+ day = (myday > 9) ? myday : '0' + myday
332
+ hour = (myhour > 9) ? myhour : '0' + myhour
333
+ minutes = (myminutes > 9) ? myminutes : '0' + myminutes
334
+ seconds = (myseconds > 9) ? myseconds : '0' + myseconds
335
+ // document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
336
+ return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
337
+ }