system-clients 4.0.15 → 4.0.17
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.
- package/package.json +1 -1
- package/src/components/Util.js +343 -343
- package/src/components/server/Login.vue +5 -0
- package/src/components/server/Menu.vue +188 -188
- package/src/filiale/qianneng/Main.vue +2 -2
- package/src/util/dateUtil.js +44 -0
package/package.json
CHANGED
package/src/components/Util.js
CHANGED
|
@@ -1,343 +1,343 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
// 登录后获取的所有数据,需要自行获取
|
|
3
|
-
export var f
|
|
4
|
-
|
|
5
|
-
export function getAttendanceState (item, timeToWork, timeToGo) {
|
|
6
|
-
item.f_state = ''
|
|
7
|
-
if (!item.f_signin_time || !item.f_knockoff_time) {
|
|
8
|
-
item.f_state = '缺勤'
|
|
9
|
-
} else {
|
|
10
|
-
let signin_time = item.f_signin_time.substring(11, 16)
|
|
11
|
-
let knockoff_time = item.f_knockoff_time.substring(11, 16)
|
|
12
|
-
if (signin_time > timeToWork) {
|
|
13
|
-
item.f_state = '迟到'
|
|
14
|
-
}
|
|
15
|
-
if (knockoff_time < timeToGo) {
|
|
16
|
-
item.f_state = item.f_state + '早退'
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (!item.f_state) {
|
|
20
|
-
item.f_state = '正常'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function toStandardYearMonth () {
|
|
25
|
-
let dt = new Date()
|
|
26
|
-
let month = dt.getMonth() + 1
|
|
27
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month)
|
|
28
|
-
}
|
|
29
|
-
export function toStandardYearMonth1 () {
|
|
30
|
-
let dt = new Date()
|
|
31
|
-
let month = dt.getMonth() + 1
|
|
32
|
-
return dt.getFullYear() + (month < 10 ? '0' + month : month)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function toStandardDateString () {
|
|
36
|
-
let dt = new Date()
|
|
37
|
-
let month = dt.getMonth() + 1
|
|
38
|
-
let date = dt.getDate()
|
|
39
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function toStartAndEndDateString () {
|
|
43
|
-
let dt = new Date()
|
|
44
|
-
let month = dt.getMonth() + 1
|
|
45
|
-
// let date = dt.getDate()
|
|
46
|
-
return [dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-01',
|
|
47
|
-
dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())]
|
|
48
|
-
// return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function toStandardTimeString () {
|
|
52
|
-
let dt = new Date()
|
|
53
|
-
let month = dt.getMonth() + 1
|
|
54
|
-
let date = dt.getDate()
|
|
55
|
-
let hour = dt.getHours()
|
|
56
|
-
let min = dt.getMinutes()
|
|
57
|
-
let sec = dt.getSeconds()
|
|
58
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
|
|
59
|
-
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function to3339TimeString () {
|
|
63
|
-
let dt = new Date()
|
|
64
|
-
let month = dt.getMonth() + 1
|
|
65
|
-
let date = dt.getDate()
|
|
66
|
-
let hour = dt.getHours()
|
|
67
|
-
let min = dt.getMinutes()
|
|
68
|
-
let sec = dt.getSeconds()
|
|
69
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
|
|
70
|
-
'T' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function parse3339String (strDate) {
|
|
74
|
-
return new Date(
|
|
75
|
-
strDate.substr(0, 4), strDate.substr(5, 2) - 1, strDate.substr(8, 2),
|
|
76
|
-
strDate.substr(11, 2), strDate.substr(14, 2), strDate.substr(17, 2)
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function format3339TimeString (dt) {
|
|
81
|
-
let month = dt.getMonth() + 1
|
|
82
|
-
let date = dt.getDate()
|
|
83
|
-
let hour = dt.getHours()
|
|
84
|
-
let min = dt.getMinutes()
|
|
85
|
-
let sec = dt.getSeconds()
|
|
86
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
87
|
-
+ 'T' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export function guid () {
|
|
91
|
-
let buf = new Uint16Array(8)
|
|
92
|
-
window.crypto.getRandomValues(buf)
|
|
93
|
-
let S4 = function (num) {
|
|
94
|
-
let ret = num.toString(16)
|
|
95
|
-
while (ret.length < 4) {
|
|
96
|
-
ret = '0' + ret
|
|
97
|
-
}
|
|
98
|
-
return ret
|
|
99
|
-
}
|
|
100
|
-
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]))
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function choices (role, param, hasBlank = false, blankHint = '请选择') {
|
|
104
|
-
if (role == 'view') {
|
|
105
|
-
Vue.getParams(param, [null])
|
|
106
|
-
} else {
|
|
107
|
-
let result = []
|
|
108
|
-
if (hasBlank)
|
|
109
|
-
result.push({label: blankHint, value: null})
|
|
110
|
-
if (!Vue.param || !Vue.param[param])
|
|
111
|
-
result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
|
|
112
|
-
else {
|
|
113
|
-
let p = Vue.param[param]
|
|
114
|
-
p.forEach(function (item) {
|
|
115
|
-
result.push({label: item.name, value: item.name})
|
|
116
|
-
})
|
|
117
|
-
}
|
|
118
|
-
return result
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export function required (param) {
|
|
123
|
-
if (typeof param === 'number' && param == 0)
|
|
124
|
-
return false
|
|
125
|
-
if (!param)
|
|
126
|
-
return true
|
|
127
|
-
param = param + ''
|
|
128
|
-
param = param.trim()
|
|
129
|
-
if (!param)
|
|
130
|
-
return true
|
|
131
|
-
return false
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export function isInt (n) {
|
|
135
|
-
return !window.isNaN(n) && n % 1 === 0
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export function isFloat (n) {
|
|
139
|
-
return !window.isNaN(n)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// this will convert all true/false to boolean
|
|
143
|
-
export function booleanFilter (paper) {
|
|
144
|
-
for (let key in paper) {
|
|
145
|
-
if (!paper.hasOwnProperty(key))
|
|
146
|
-
continue
|
|
147
|
-
if (typeof paper[key] == 'object' && paper[key] != null) {
|
|
148
|
-
booleanFilter(paper[key])
|
|
149
|
-
} else {
|
|
150
|
-
if (paper[key] === 'true' || paper[key] == 'false')
|
|
151
|
-
paper[key] = (paper[key] === 'true')
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
// recursively traverse through each path
|
|
156
|
-
export function ratifyPics (paper) {
|
|
157
|
-
for (let key in paper) {
|
|
158
|
-
if (key.endsWith('_path')) {
|
|
159
|
-
if (!paper[key]) {
|
|
160
|
-
paper[key] = 'rs/db/file/nopic.png'
|
|
161
|
-
} else {
|
|
162
|
-
paper[key] = 'rs/db/file/' + paper[key]
|
|
163
|
-
}
|
|
164
|
-
} else if (paper[key] !== null && typeof (paper[key]) == 'object') {
|
|
165
|
-
ratifyPics(paper[key])
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// load script and other stuff
|
|
171
|
-
export function loadscript (type, fileName) {
|
|
172
|
-
return new Promise((resolve, reject) => {
|
|
173
|
-
let element
|
|
174
|
-
if (type == 'css') {
|
|
175
|
-
element = document.createElement('link')
|
|
176
|
-
element.setAttribute('rel', 'stylesheet')
|
|
177
|
-
element.setAttribute('type', 'text/css')
|
|
178
|
-
element.setAttribute('href', fileName)
|
|
179
|
-
} else if (type == 'js') {
|
|
180
|
-
element = document.createElement('script')
|
|
181
|
-
element.setAttribute('type', 'text/javascript')
|
|
182
|
-
element.setAttribute('src', fileName)
|
|
183
|
-
}
|
|
184
|
-
if (element) {
|
|
185
|
-
element.setAttribute('async', '')
|
|
186
|
-
element.setAttribute('defer', '')
|
|
187
|
-
element.addEventListener('load', function () {
|
|
188
|
-
resolve(element)
|
|
189
|
-
}, false)
|
|
190
|
-
element.addEventListener('error', function () {
|
|
191
|
-
reject(element)
|
|
192
|
-
}, false)
|
|
193
|
-
document.body.appendChild(element)
|
|
194
|
-
}
|
|
195
|
-
})
|
|
196
|
-
}
|
|
197
|
-
// 不能选择器中截取掉多余的字符
|
|
198
|
-
export function orgName (name) {
|
|
199
|
-
return name.substring(10)
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export function getNowDate (name) {
|
|
203
|
-
// 求取当前时间的工具
|
|
204
|
-
let myweekday = ''
|
|
205
|
-
let year = ''
|
|
206
|
-
let mydate = new Date()
|
|
207
|
-
myweekday = mydate.getDay()
|
|
208
|
-
let mymonth = mydate.getMonth() + 1
|
|
209
|
-
let myday = mydate.getDate()
|
|
210
|
-
let myyear = mydate.getYear()
|
|
211
|
-
year = (myyear > 200) ? myyear : 1900 + myyear
|
|
212
|
-
let week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期日', '星期六']
|
|
213
|
-
// document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
|
|
214
|
-
return year + '年' + mymonth + '月' + myday + '日 ' + week[myweekday]
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export function addDate (date, days) {
|
|
218
|
-
// 求取当前时间的工具
|
|
219
|
-
let endDate = new Date(date)
|
|
220
|
-
endDate = endDate.valueOf()
|
|
221
|
-
endDate = endDate + days * 24 * 60 * 60 * 1000
|
|
222
|
-
endDate = new Date(endDate)
|
|
223
|
-
let month = endDate.getMonth() + 1
|
|
224
|
-
let day = endDate.getDate()
|
|
225
|
-
let hour = endDate.getHours()
|
|
226
|
-
let min = endDate.getMinutes()
|
|
227
|
-
let sec = endDate.getSeconds()
|
|
228
|
-
return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
|
|
229
|
-
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
230
|
-
// return a
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// 通过地址栏的参数获取参数内容
|
|
234
|
-
export function getUrlParames (param) {
|
|
235
|
-
var query = window.location.search
|
|
236
|
-
var iLen = param.length
|
|
237
|
-
var iStart = query.indexOf(param)
|
|
238
|
-
if (iStart === -1) {
|
|
239
|
-
return ''
|
|
240
|
-
}
|
|
241
|
-
iStart += iLen + 1
|
|
242
|
-
var iEnd = query.indexOf('&', iStart)
|
|
243
|
-
if (iEnd === -1) {
|
|
244
|
-
return query.substring(iStart)
|
|
245
|
-
}
|
|
246
|
-
return query.substring(iStart, iEnd)
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// 从地址栏获取加密的参数
|
|
250
|
-
export function getUrlCompileParames (param) {
|
|
251
|
-
var query = uncompileStr(window.location.search.slice(1, window.location.search.length))
|
|
252
|
-
var iLen = param.length
|
|
253
|
-
var iStart = query.indexOf(param)
|
|
254
|
-
if (iStart === -1) {
|
|
255
|
-
return ''
|
|
256
|
-
}
|
|
257
|
-
iStart += iLen + 1
|
|
258
|
-
var iEnd = query.indexOf('&', iStart)
|
|
259
|
-
if (iEnd === -1) {
|
|
260
|
-
return query.substring(iStart)
|
|
261
|
-
}
|
|
262
|
-
return query.substring(iStart, iEnd)
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// 对字符串进行加密
|
|
266
|
-
export function compileStr (code) {
|
|
267
|
-
let c = String.fromCharCode(code.charCodeAt(0) + code.length)
|
|
268
|
-
for (let i = 1; i < code.length; i++) {
|
|
269
|
-
c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
|
|
270
|
-
}
|
|
271
|
-
return escape(c)
|
|
272
|
-
}
|
|
273
|
-
// 字符串进行解密
|
|
274
|
-
export function uncompileStr (code) {
|
|
275
|
-
code = unescape(code)
|
|
276
|
-
let c = String.fromCharCode(code.charCodeAt(0) - code.length)
|
|
277
|
-
for (var i = 1; i < code.length; i++) {
|
|
278
|
-
c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
|
|
279
|
-
}
|
|
280
|
-
return c
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export function dateDescripte (date) {
|
|
284
|
-
let nowTime = new Date().getTime()
|
|
285
|
-
let oldTime = new Date(date).getTime()
|
|
286
|
-
let timeDiff = nowTime - oldTime
|
|
287
|
-
// 规则说明
|
|
288
|
-
// 小于等于2分钟为刚刚
|
|
289
|
-
// 大于2分钟小于等于1小时为取整的分钟前(例如:35分钟前)
|
|
290
|
-
// 大于1小时小于等于24小时为取整的小时前(例如:15小时前)
|
|
291
|
-
// 大于24小时小于等于30天为取整的天前(例如:12天前)
|
|
292
|
-
// 大于30天小于等于12月为取整的月前,月份统一为30天一月,不做额外处理(例如:3个月前)
|
|
293
|
-
// 大于365取整的年前,(例如:2年前)
|
|
294
|
-
let minute = 1000 * 60
|
|
295
|
-
let hour = minute * 60
|
|
296
|
-
let day = hour * 24
|
|
297
|
-
let month = day * 30
|
|
298
|
-
let year = month * 12
|
|
299
|
-
let des = ''
|
|
300
|
-
if (timeDiff <= minute * 2) {
|
|
301
|
-
des = '刚刚'
|
|
302
|
-
} else if (minute * 2 < timeDiff && timeDiff < hour) {
|
|
303
|
-
des = `${Math.floor(timeDiff / minute)}分钟前`
|
|
304
|
-
} else if (hour < timeDiff && timeDiff <= day) {
|
|
305
|
-
des = `${Math.floor(timeDiff / hour)}小时前`
|
|
306
|
-
} else if (day < timeDiff && timeDiff <= month) {
|
|
307
|
-
des = `${Math.floor(timeDiff / day)}天前`
|
|
308
|
-
} else if (month < timeDiff && timeDiff <= year) {
|
|
309
|
-
des = `${Math.floor(timeDiff / month)}个月前`
|
|
310
|
-
} else if (year < timeDiff) {
|
|
311
|
-
des = `${Math.floor(timeDiff / year)}年前`
|
|
312
|
-
}
|
|
313
|
-
return des
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export function nextMonth20 (date) {
|
|
317
|
-
let ds = date.split('-')
|
|
318
|
-
let nextMonth = ds[1] - 0 + 1
|
|
319
|
-
return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// export function getNowDate () {
|
|
323
|
-
// // 求取当前时间的工具
|
|
324
|
-
// let myweekday = ''
|
|
325
|
-
// let year = ''
|
|
326
|
-
// let mydate = new Date()
|
|
327
|
-
// myweekday = mydate.getDay()
|
|
328
|
-
// let mymonth = mydate.getMonth() + 1
|
|
329
|
-
// let myday = mydate.getDate()
|
|
330
|
-
// let myyear = mydate.getYear()
|
|
331
|
-
// year = (myyear > 200) ? myyear : 1900 + myyear
|
|
332
|
-
// let week = ['星期日','星期一','星期二','星期三','星期四','星期五','星期日','星期六']
|
|
333
|
-
// let weekday = week[myweekday]
|
|
334
|
-
//
|
|
335
|
-
// // document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
|
|
336
|
-
// return year + '年' + mymonth + '月' + myday + '日 ' + weekday
|
|
337
|
-
// }
|
|
338
|
-
//
|
|
339
|
-
// export function getImgsrc (name) {
|
|
340
|
-
// return "http://127.0.0.1:8081/images/"+name+".gif"
|
|
341
|
-
// }
|
|
342
|
-
//
|
|
343
|
-
// export var f;
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
// 登录后获取的所有数据,需要自行获取
|
|
3
|
+
export var f
|
|
4
|
+
|
|
5
|
+
export function getAttendanceState (item, timeToWork, timeToGo) {
|
|
6
|
+
item.f_state = ''
|
|
7
|
+
if (!item.f_signin_time || !item.f_knockoff_time) {
|
|
8
|
+
item.f_state = '缺勤'
|
|
9
|
+
} else {
|
|
10
|
+
let signin_time = item.f_signin_time.substring(11, 16)
|
|
11
|
+
let knockoff_time = item.f_knockoff_time.substring(11, 16)
|
|
12
|
+
if (signin_time > timeToWork) {
|
|
13
|
+
item.f_state = '迟到'
|
|
14
|
+
}
|
|
15
|
+
if (knockoff_time < timeToGo) {
|
|
16
|
+
item.f_state = item.f_state + '早退'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (!item.f_state) {
|
|
20
|
+
item.f_state = '正常'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function toStandardYearMonth () {
|
|
25
|
+
let dt = new Date()
|
|
26
|
+
let month = dt.getMonth() + 1
|
|
27
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month)
|
|
28
|
+
}
|
|
29
|
+
export function toStandardYearMonth1 () {
|
|
30
|
+
let dt = new Date()
|
|
31
|
+
let month = dt.getMonth() + 1
|
|
32
|
+
return dt.getFullYear() + (month < 10 ? '0' + month : month)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function toStandardDateString () {
|
|
36
|
+
let dt = new Date()
|
|
37
|
+
let month = dt.getMonth() + 1
|
|
38
|
+
let date = dt.getDate()
|
|
39
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function toStartAndEndDateString () {
|
|
43
|
+
let dt = new Date()
|
|
44
|
+
let month = dt.getMonth() + 1
|
|
45
|
+
// let date = dt.getDate()
|
|
46
|
+
return [dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-01',
|
|
47
|
+
dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())]
|
|
48
|
+
// return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function toStandardTimeString () {
|
|
52
|
+
let dt = new Date()
|
|
53
|
+
let month = dt.getMonth() + 1
|
|
54
|
+
let date = dt.getDate()
|
|
55
|
+
let hour = dt.getHours()
|
|
56
|
+
let min = dt.getMinutes()
|
|
57
|
+
let sec = dt.getSeconds()
|
|
58
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
|
|
59
|
+
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function to3339TimeString () {
|
|
63
|
+
let dt = new Date()
|
|
64
|
+
let month = dt.getMonth() + 1
|
|
65
|
+
let date = dt.getDate()
|
|
66
|
+
let hour = dt.getHours()
|
|
67
|
+
let min = dt.getMinutes()
|
|
68
|
+
let sec = dt.getSeconds()
|
|
69
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
|
|
70
|
+
'T' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function parse3339String (strDate) {
|
|
74
|
+
return new Date(
|
|
75
|
+
strDate.substr(0, 4), strDate.substr(5, 2) - 1, strDate.substr(8, 2),
|
|
76
|
+
strDate.substr(11, 2), strDate.substr(14, 2), strDate.substr(17, 2)
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function format3339TimeString (dt) {
|
|
81
|
+
let month = dt.getMonth() + 1
|
|
82
|
+
let date = dt.getDate()
|
|
83
|
+
let hour = dt.getHours()
|
|
84
|
+
let min = dt.getMinutes()
|
|
85
|
+
let sec = dt.getSeconds()
|
|
86
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
87
|
+
+ 'T' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function guid () {
|
|
91
|
+
let buf = new Uint16Array(8)
|
|
92
|
+
window.crypto.getRandomValues(buf)
|
|
93
|
+
let S4 = function (num) {
|
|
94
|
+
let ret = num.toString(16)
|
|
95
|
+
while (ret.length < 4) {
|
|
96
|
+
ret = '0' + ret
|
|
97
|
+
}
|
|
98
|
+
return ret
|
|
99
|
+
}
|
|
100
|
+
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]))
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function choices (role, param, hasBlank = false, blankHint = '请选择') {
|
|
104
|
+
if (role == 'view') {
|
|
105
|
+
Vue.getParams(param, [null])
|
|
106
|
+
} else {
|
|
107
|
+
let result = []
|
|
108
|
+
if (hasBlank)
|
|
109
|
+
result.push({label: blankHint, value: null})
|
|
110
|
+
if (!Vue.param || !Vue.param[param])
|
|
111
|
+
result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
|
|
112
|
+
else {
|
|
113
|
+
let p = Vue.param[param]
|
|
114
|
+
p.forEach(function (item) {
|
|
115
|
+
result.push({label: item.name, value: item.name})
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
return result
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function required (param) {
|
|
123
|
+
if (typeof param === 'number' && param == 0)
|
|
124
|
+
return false
|
|
125
|
+
if (!param)
|
|
126
|
+
return true
|
|
127
|
+
param = param + ''
|
|
128
|
+
param = param.trim()
|
|
129
|
+
if (!param)
|
|
130
|
+
return true
|
|
131
|
+
return false
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function isInt (n) {
|
|
135
|
+
return !window.isNaN(n) && n % 1 === 0
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function isFloat (n) {
|
|
139
|
+
return !window.isNaN(n)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// this will convert all true/false to boolean
|
|
143
|
+
export function booleanFilter (paper) {
|
|
144
|
+
for (let key in paper) {
|
|
145
|
+
if (!paper.hasOwnProperty(key))
|
|
146
|
+
continue
|
|
147
|
+
if (typeof paper[key] == 'object' && paper[key] != null) {
|
|
148
|
+
booleanFilter(paper[key])
|
|
149
|
+
} else {
|
|
150
|
+
if (paper[key] === 'true' || paper[key] == 'false')
|
|
151
|
+
paper[key] = (paper[key] === 'true')
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// recursively traverse through each path
|
|
156
|
+
export function ratifyPics (paper) {
|
|
157
|
+
for (let key in paper) {
|
|
158
|
+
if (key.endsWith('_path')) {
|
|
159
|
+
if (!paper[key]) {
|
|
160
|
+
paper[key] = 'rs/db/file/nopic.png'
|
|
161
|
+
} else {
|
|
162
|
+
paper[key] = 'rs/db/file/' + paper[key]
|
|
163
|
+
}
|
|
164
|
+
} else if (paper[key] !== null && typeof (paper[key]) == 'object') {
|
|
165
|
+
ratifyPics(paper[key])
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// load script and other stuff
|
|
171
|
+
export function loadscript (type, fileName) {
|
|
172
|
+
return new Promise((resolve, reject) => {
|
|
173
|
+
let element
|
|
174
|
+
if (type == 'css') {
|
|
175
|
+
element = document.createElement('link')
|
|
176
|
+
element.setAttribute('rel', 'stylesheet')
|
|
177
|
+
element.setAttribute('type', 'text/css')
|
|
178
|
+
element.setAttribute('href', fileName)
|
|
179
|
+
} else if (type == 'js') {
|
|
180
|
+
element = document.createElement('script')
|
|
181
|
+
element.setAttribute('type', 'text/javascript')
|
|
182
|
+
element.setAttribute('src', fileName)
|
|
183
|
+
}
|
|
184
|
+
if (element) {
|
|
185
|
+
element.setAttribute('async', '')
|
|
186
|
+
element.setAttribute('defer', '')
|
|
187
|
+
element.addEventListener('load', function () {
|
|
188
|
+
resolve(element)
|
|
189
|
+
}, false)
|
|
190
|
+
element.addEventListener('error', function () {
|
|
191
|
+
reject(element)
|
|
192
|
+
}, false)
|
|
193
|
+
document.body.appendChild(element)
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
// 不能选择器中截取掉多余的字符
|
|
198
|
+
export function orgName (name) {
|
|
199
|
+
return name.substring(10)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export function getNowDate (name) {
|
|
203
|
+
// 求取当前时间的工具
|
|
204
|
+
let myweekday = ''
|
|
205
|
+
let year = ''
|
|
206
|
+
let mydate = new Date()
|
|
207
|
+
myweekday = mydate.getDay()
|
|
208
|
+
let mymonth = mydate.getMonth() + 1
|
|
209
|
+
let myday = mydate.getDate()
|
|
210
|
+
let myyear = mydate.getYear()
|
|
211
|
+
year = (myyear > 200) ? myyear : 1900 + myyear
|
|
212
|
+
let week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期日', '星期六']
|
|
213
|
+
// document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
|
|
214
|
+
return year + '年' + mymonth + '月' + myday + '日 ' + week[myweekday]
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export function addDate (date, days) {
|
|
218
|
+
// 求取当前时间的工具
|
|
219
|
+
let endDate = new Date(date)
|
|
220
|
+
endDate = endDate.valueOf()
|
|
221
|
+
endDate = endDate + days * 24 * 60 * 60 * 1000
|
|
222
|
+
endDate = new Date(endDate)
|
|
223
|
+
let month = endDate.getMonth() + 1
|
|
224
|
+
let day = endDate.getDate()
|
|
225
|
+
let hour = endDate.getHours()
|
|
226
|
+
let min = endDate.getMinutes()
|
|
227
|
+
let sec = endDate.getSeconds()
|
|
228
|
+
return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
|
|
229
|
+
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
230
|
+
// return a
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// 通过地址栏的参数获取参数内容
|
|
234
|
+
export function getUrlParames (param) {
|
|
235
|
+
var query = window.location.search
|
|
236
|
+
var iLen = param.length
|
|
237
|
+
var iStart = query.indexOf(param)
|
|
238
|
+
if (iStart === -1) {
|
|
239
|
+
return ''
|
|
240
|
+
}
|
|
241
|
+
iStart += iLen + 1
|
|
242
|
+
var iEnd = query.indexOf('&', iStart)
|
|
243
|
+
if (iEnd === -1) {
|
|
244
|
+
return query.substring(iStart)
|
|
245
|
+
}
|
|
246
|
+
return query.substring(iStart, iEnd)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// 从地址栏获取加密的参数
|
|
250
|
+
export function getUrlCompileParames (param) {
|
|
251
|
+
var query = uncompileStr(window.location.search.slice(1, window.location.search.length))
|
|
252
|
+
var iLen = param.length
|
|
253
|
+
var iStart = query.indexOf(param)
|
|
254
|
+
if (iStart === -1) {
|
|
255
|
+
return ''
|
|
256
|
+
}
|
|
257
|
+
iStart += iLen + 1
|
|
258
|
+
var iEnd = query.indexOf('&', iStart)
|
|
259
|
+
if (iEnd === -1) {
|
|
260
|
+
return query.substring(iStart)
|
|
261
|
+
}
|
|
262
|
+
return query.substring(iStart, iEnd)
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// 对字符串进行加密
|
|
266
|
+
export function compileStr (code) {
|
|
267
|
+
let c = String.fromCharCode(code.charCodeAt(0) + code.length)
|
|
268
|
+
for (let i = 1; i < code.length; i++) {
|
|
269
|
+
c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
|
|
270
|
+
}
|
|
271
|
+
return escape(c)
|
|
272
|
+
}
|
|
273
|
+
// 字符串进行解密
|
|
274
|
+
export function uncompileStr (code) {
|
|
275
|
+
code = unescape(code)
|
|
276
|
+
let c = String.fromCharCode(code.charCodeAt(0) - code.length)
|
|
277
|
+
for (var i = 1; i < code.length; i++) {
|
|
278
|
+
c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
|
|
279
|
+
}
|
|
280
|
+
return c
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function dateDescripte (date) {
|
|
284
|
+
let nowTime = new Date().getTime()
|
|
285
|
+
let oldTime = new Date(date).getTime()
|
|
286
|
+
let timeDiff = nowTime - oldTime
|
|
287
|
+
// 规则说明
|
|
288
|
+
// 小于等于2分钟为刚刚
|
|
289
|
+
// 大于2分钟小于等于1小时为取整的分钟前(例如:35分钟前)
|
|
290
|
+
// 大于1小时小于等于24小时为取整的小时前(例如:15小时前)
|
|
291
|
+
// 大于24小时小于等于30天为取整的天前(例如:12天前)
|
|
292
|
+
// 大于30天小于等于12月为取整的月前,月份统一为30天一月,不做额外处理(例如:3个月前)
|
|
293
|
+
// 大于365取整的年前,(例如:2年前)
|
|
294
|
+
let minute = 1000 * 60
|
|
295
|
+
let hour = minute * 60
|
|
296
|
+
let day = hour * 24
|
|
297
|
+
let month = day * 30
|
|
298
|
+
let year = month * 12
|
|
299
|
+
let des = ''
|
|
300
|
+
if (timeDiff <= minute * 2) {
|
|
301
|
+
des = '刚刚'
|
|
302
|
+
} else if (minute * 2 < timeDiff && timeDiff < hour) {
|
|
303
|
+
des = `${Math.floor(timeDiff / minute)}分钟前`
|
|
304
|
+
} else if (hour < timeDiff && timeDiff <= day) {
|
|
305
|
+
des = `${Math.floor(timeDiff / hour)}小时前`
|
|
306
|
+
} else if (day < timeDiff && timeDiff <= month) {
|
|
307
|
+
des = `${Math.floor(timeDiff / day)}天前`
|
|
308
|
+
} else if (month < timeDiff && timeDiff <= year) {
|
|
309
|
+
des = `${Math.floor(timeDiff / month)}个月前`
|
|
310
|
+
} else if (year < timeDiff) {
|
|
311
|
+
des = `${Math.floor(timeDiff / year)}年前`
|
|
312
|
+
}
|
|
313
|
+
return des
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export function nextMonth20 (date) {
|
|
317
|
+
let ds = date.split('-')
|
|
318
|
+
let nextMonth = ds[1] - 0 + 1
|
|
319
|
+
return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// export function getNowDate () {
|
|
323
|
+
// // 求取当前时间的工具
|
|
324
|
+
// let myweekday = ''
|
|
325
|
+
// let year = ''
|
|
326
|
+
// let mydate = new Date()
|
|
327
|
+
// myweekday = mydate.getDay()
|
|
328
|
+
// let mymonth = mydate.getMonth() + 1
|
|
329
|
+
// let myday = mydate.getDate()
|
|
330
|
+
// let myyear = mydate.getYear()
|
|
331
|
+
// year = (myyear > 200) ? myyear : 1900 + myyear
|
|
332
|
+
// let week = ['星期日','星期一','星期二','星期三','星期四','星期五','星期日','星期六']
|
|
333
|
+
// let weekday = week[myweekday]
|
|
334
|
+
//
|
|
335
|
+
// // document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
|
|
336
|
+
// return year + '年' + mymonth + '月' + myday + '日 ' + weekday
|
|
337
|
+
// }
|
|
338
|
+
//
|
|
339
|
+
// export function getImgsrc (name) {
|
|
340
|
+
// return "http://127.0.0.1:8081/images/"+name+".gif"
|
|
341
|
+
// }
|
|
342
|
+
//
|
|
343
|
+
// export var f;
|
|
@@ -152,6 +152,7 @@ import co from 'co'
|
|
|
152
152
|
import $ from 'jquery'
|
|
153
153
|
import Vue from 'vue'
|
|
154
154
|
import {HttpResetClass} from 'vue-client'
|
|
155
|
+
import {isPasswordUpdateTimeExpired} from '../../util/dateUtil.js'
|
|
155
156
|
|
|
156
157
|
let daibanJson = require('../../util/Daiban.json')
|
|
157
158
|
|
|
@@ -216,6 +217,10 @@ let saveGen = function *(self) {
|
|
|
216
217
|
self.$showMessage('登录系统: 此账户的密码过于简单,请修改密码后重新登陆!!!', ['confirm']).then((res) => {
|
|
217
218
|
self.modifyPwShow = true
|
|
218
219
|
})
|
|
220
|
+
} else if ((!self.otherLogin) && self.$login.f.update_time && isPasswordUpdateTimeExpired(self.$login.f.update_time)) {
|
|
221
|
+
self.$showMessage('登录系统: 您的密码已超过3个月未修改,为了账户安全,建议您及时修改密码。', ['confirm']).then((res) => {
|
|
222
|
+
self.modifyPwShow = true
|
|
223
|
+
})
|
|
219
224
|
} else if ((!self.otherLogin) && self.$login.depPrompt) {
|
|
220
225
|
self.depPromptShow = true
|
|
221
226
|
if (self.$login.showDaiBan && self.$login.r.includes('展示预约信息')){
|
|
@@ -1,188 +1,188 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="auto">
|
|
3
|
-
<div class="head">
|
|
4
|
-
<img src="../../../static/loginlogo.png" alt="图片加载未完成"
|
|
5
|
-
style="float:left;width: 100px; height: 80px; margin: 10px 20px 20px 20px;"/>
|
|
6
|
-
<div style="float:left;width:auto;height:130px;padding-top:10px;">
|
|
7
|
-
<h3 style="font-size: 22px;">欢迎使用陕西燃气管理系统</h3>
|
|
8
|
-
<h5 style="font-size: 15px;">Welcome to ShanXi GAS Manage System</h5>
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<h5 style="float:right;margin-top:70px;margin-right:80px;">
|
|
12
|
-
|
|
13
|
-
<span class="glyphicon glyphicon-calendar"></span>
|
|
14
|
-
{{ date }}
|
|
15
|
-
|
|
16
|
-
<span class="glyphicon glyphicon-copyright-mark"></span>
|
|
17
|
-
系统版本:V1.0.0
|
|
18
|
-
|
|
19
|
-
<span class="glyphicon glyphicon-th-large"></span>
|
|
20
|
-
蓝色主题
|
|
21
|
-
<a href="#" style="color:#fff;text-decoration:none;" @click.stop.prevent="modify=true">
|
|
22
|
-
<span class="glyphicon glyphicon-cog"></span>
|
|
23
|
-
修改密码
|
|
24
|
-
</a>
|
|
25
|
-
</h5>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="auto">
|
|
28
|
-
<!-- 白线div -->
|
|
29
|
-
<div class="whiteline">
|
|
30
|
-
</div>
|
|
31
|
-
<select-menu :model="functions.functions"></select-menu>
|
|
32
|
-
</div>
|
|
33
|
-
<modal v-ref:modal :show.sync="modify" :backdrop="false" class="auto">
|
|
34
|
-
<header slot="modal-header" class="modal-header">
|
|
35
|
-
<h4 class="modal-title">修改密码</h4>
|
|
36
|
-
</header>
|
|
37
|
-
<article slot="modal-body" class="modal-body modifystyle">
|
|
38
|
-
<validator name="v">
|
|
39
|
-
|
|
40
|
-
<div class="has-feedback"
|
|
41
|
-
:class="{'has-warning':$v.password.required,'has-error':$v.password.equalValid && !($v.password.required),
|
|
42
|
-
'has-success': !$v.password.required && !($v.password.equalValid && !($v.password.required))}">
|
|
43
|
-
<label for="password" class="control-label">原始密码: </label>
|
|
44
|
-
<input type="password" v-model="deliver.password" class="form-control" id="password" v-validate:password="{ required: true, equalValid: functions.password }">
|
|
45
|
-
<span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.password.required && !($v.password.equalValid && !($v.password.required))"></span>
|
|
46
|
-
<!-- <span class="glyphicon form-control-feedback"
|
|
47
|
-
:class="{'glyphicon-warning-sign':$v.password.required,'glyphicon-remove'$v.password.equalValid && !($v.password.required):,
|
|
48
|
-
'glyphicon-ok':!$v.password.required && !($v.password.equalValid && !($v.password.required))}"></span> -->
|
|
49
|
-
<span v-if="$v.password.required">不能为空</span>
|
|
50
|
-
<span v-if="$v.password.equalValid && !($v.password.required)">原始密码错误 !!</span>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<div class="has-feedback"
|
|
54
|
-
:class="{'has-warning':$v.newpassword.required, 'has-success': !$v.newpassword.required}">
|
|
55
|
-
<label for="newpassword" class="control-label">新的密码: </label>
|
|
56
|
-
<input type="password" v-model="deliver.newpassword" class="form-control" id="newpassword" v-validate:newpassword='{ required: true }'>
|
|
57
|
-
<span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.newpassword.required"></span>
|
|
58
|
-
<!-- <span class="glyphicon form-control-feedback"
|
|
59
|
-
:class="{'glyphicon-warning-sign':$v.newpassword.required,'glyphicon-ok':!$v.newpassword.required }"></span> -->
|
|
60
|
-
<span v-if="$v.newpassword.required">不能为空</span>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<div class="has-feedback"
|
|
64
|
-
:class="{'has-warning':$v.affirmpassword.required,'has-error':$v.affirmpassword.equalValid && !($v.affirmpassword.required),
|
|
65
|
-
'has-success': !$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))}">
|
|
66
|
-
<label for="affirmpassword" class="control-label">确认密码: </label>
|
|
67
|
-
<input type="password" v-model="deliver.affirmpassword" class="form-control" id="affirmpassword" v-validate:affirmpassword="{ required: true, equalValid: deliver.newpassword }">
|
|
68
|
-
<span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))"></span>
|
|
69
|
-
<!-- <span class="glyphicon form-control-feedback"
|
|
70
|
-
:class="{'glyphicon-warning-sign':$v.affirmpassword.required,'glyphicon-remove'$v.affirmpassword.equalValid && !($v.affirmpassword.required):,
|
|
71
|
-
'glyphicon-ok':!$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))}"></span> -->
|
|
72
|
-
<span v-if="$v.affirmpassword.required">不能为空</span>
|
|
73
|
-
<span v-if="$v.affirmpassword.equalValid && !($v.affirmpassword.required)">两次密码不一致 !!</span>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
</validator>
|
|
77
|
-
</article>
|
|
78
|
-
<footer slot="modal-footer" class="footerbtn">
|
|
79
|
-
<button type="button" class="btn btn-success" @click='confirm' :disabled="!$v.valid">确认</button>
|
|
80
|
-
<button type="button" class="btn btn-default" @click='close'>取消</button>
|
|
81
|
-
</footer>
|
|
82
|
-
<modal>
|
|
83
|
-
<!-- modifyPassword() -->
|
|
84
|
-
</modal>
|
|
85
|
-
</modal>
|
|
86
|
-
</div>
|
|
87
|
-
</template>
|
|
88
|
-
|
|
89
|
-
<script>
|
|
90
|
-
import co from 'co'
|
|
91
|
-
import * as Util from '../Util'
|
|
92
|
-
|
|
93
|
-
let saveGen = function * (self) {
|
|
94
|
-
self.deliver.ename = self.functions.ename
|
|
95
|
-
// let res = yield self.$post('rs/user/entity', {data: self.deliver})
|
|
96
|
-
// let res = yield self.$post('rs/db/modifypassword', {data: self.deliver})
|
|
97
|
-
let res = yield self.$post('rs/db/modifypwd', {data: self.deliver})
|
|
98
|
-
if (res.status === 200 || res.status === 204) {
|
|
99
|
-
self.modify = false
|
|
100
|
-
self.deliver.password = ''
|
|
101
|
-
self.deliver.newpassword = ''
|
|
102
|
-
self.deliver.affirmpassword = ''
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export default {
|
|
107
|
-
title: '菜单选择',
|
|
108
|
-
props: ['functions'],
|
|
109
|
-
data () {
|
|
110
|
-
return {
|
|
111
|
-
modify: false,
|
|
112
|
-
deliver: {
|
|
113
|
-
password: '',
|
|
114
|
-
newpassword: '',
|
|
115
|
-
affirmpassword: ''
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
computed: {
|
|
120
|
-
date () {
|
|
121
|
-
return Util.getNowDate()
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
methods: {
|
|
125
|
-
open (row) {
|
|
126
|
-
if (row.link) {
|
|
127
|
-
// this.$goto(row.link, {userid: this.functions, source: {isRead: 'modify'}}, 'home-page')
|
|
128
|
-
this.$goto(row.link, {f: this.functions}, 'home-page')
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
// 修改密码操作
|
|
132
|
-
close () {
|
|
133
|
-
this.modify = false
|
|
134
|
-
},
|
|
135
|
-
confirm () {
|
|
136
|
-
let gen = saveGen(this)
|
|
137
|
-
co(gen)
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
events: {
|
|
141
|
-
'select-changed': function (data) {
|
|
142
|
-
// 事件回调内的 `this` 自动绑定到注册它的实例上
|
|
143
|
-
this.open(data.val)
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
</script>
|
|
148
|
-
<style>
|
|
149
|
-
/* 头部样式,大部分使用放在标签内 */
|
|
150
|
-
.head {
|
|
151
|
-
color: #fff;
|
|
152
|
-
height: 110px;
|
|
153
|
-
width: 100%;
|
|
154
|
-
}
|
|
155
|
-
/* 菜单头部与内容区域的中间的白色线 */
|
|
156
|
-
.whiteline {
|
|
157
|
-
height: 1px;
|
|
158
|
-
background: #fff;
|
|
159
|
-
margin: 0px 30px;
|
|
160
|
-
}
|
|
161
|
-
/*修改密码body界面样式*/
|
|
162
|
-
.modifystyle {
|
|
163
|
-
background: #FCFEEE;
|
|
164
|
-
}
|
|
165
|
-
.modifystyle div{
|
|
166
|
-
height: auto;
|
|
167
|
-
margin-bottom: 15px;
|
|
168
|
-
/*text-align: center;*/
|
|
169
|
-
margin-left: 20%;
|
|
170
|
-
}
|
|
171
|
-
/*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
|
|
172
|
-
.modifystyle div input + span{
|
|
173
|
-
top: 0!important;
|
|
174
|
-
right: 32%;
|
|
175
|
-
}
|
|
176
|
-
.modifystyle span{
|
|
177
|
-
color: red;
|
|
178
|
-
}
|
|
179
|
-
/*修改密码底部按钮部分样式*/
|
|
180
|
-
.footerbtn {
|
|
181
|
-
text-align: center;
|
|
182
|
-
padding: 15px;
|
|
183
|
-
}
|
|
184
|
-
.footerbtn button {
|
|
185
|
-
width: 100px;
|
|
186
|
-
margin-left: 20px;
|
|
187
|
-
}
|
|
188
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="auto">
|
|
3
|
+
<div class="head">
|
|
4
|
+
<img src="../../../static/loginlogo.png" alt="图片加载未完成"
|
|
5
|
+
style="float:left;width: 100px; height: 80px; margin: 10px 20px 20px 20px;"/>
|
|
6
|
+
<div style="float:left;width:auto;height:130px;padding-top:10px;">
|
|
7
|
+
<h3 style="font-size: 22px;">欢迎使用陕西燃气管理系统</h3>
|
|
8
|
+
<h5 style="font-size: 15px;">Welcome to ShanXi GAS Manage System</h5>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<h5 style="float:right;margin-top:70px;margin-right:80px;">
|
|
12
|
+
|
|
13
|
+
<span class="glyphicon glyphicon-calendar"></span>
|
|
14
|
+
{{ date }}
|
|
15
|
+
|
|
16
|
+
<span class="glyphicon glyphicon-copyright-mark"></span>
|
|
17
|
+
系统版本:V1.0.0
|
|
18
|
+
|
|
19
|
+
<span class="glyphicon glyphicon-th-large"></span>
|
|
20
|
+
蓝色主题
|
|
21
|
+
<a href="#" style="color:#fff;text-decoration:none;" @click.stop.prevent="modify=true">
|
|
22
|
+
<span class="glyphicon glyphicon-cog"></span>
|
|
23
|
+
修改密码
|
|
24
|
+
</a>
|
|
25
|
+
</h5>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="auto">
|
|
28
|
+
<!-- 白线div -->
|
|
29
|
+
<div class="whiteline">
|
|
30
|
+
</div>
|
|
31
|
+
<select-menu :model="functions.functions"></select-menu>
|
|
32
|
+
</div>
|
|
33
|
+
<modal v-ref:modal :show.sync="modify" :backdrop="false" class="auto">
|
|
34
|
+
<header slot="modal-header" class="modal-header">
|
|
35
|
+
<h4 class="modal-title">修改密码</h4>
|
|
36
|
+
</header>
|
|
37
|
+
<article slot="modal-body" class="modal-body modifystyle">
|
|
38
|
+
<validator name="v">
|
|
39
|
+
|
|
40
|
+
<div class="has-feedback"
|
|
41
|
+
:class="{'has-warning':$v.password.required,'has-error':$v.password.equalValid && !($v.password.required),
|
|
42
|
+
'has-success': !$v.password.required && !($v.password.equalValid && !($v.password.required))}">
|
|
43
|
+
<label for="password" class="control-label">原始密码: </label>
|
|
44
|
+
<input type="password" v-model="deliver.password" class="form-control" id="password" v-validate:password="{ required: true, equalValid: functions.password }">
|
|
45
|
+
<span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.password.required && !($v.password.equalValid && !($v.password.required))"></span>
|
|
46
|
+
<!-- <span class="glyphicon form-control-feedback"
|
|
47
|
+
:class="{'glyphicon-warning-sign':$v.password.required,'glyphicon-remove'$v.password.equalValid && !($v.password.required):,
|
|
48
|
+
'glyphicon-ok':!$v.password.required && !($v.password.equalValid && !($v.password.required))}"></span> -->
|
|
49
|
+
<span v-if="$v.password.required">不能为空</span>
|
|
50
|
+
<span v-if="$v.password.equalValid && !($v.password.required)">原始密码错误 !!</span>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="has-feedback"
|
|
54
|
+
:class="{'has-warning':$v.newpassword.required, 'has-success': !$v.newpassword.required}">
|
|
55
|
+
<label for="newpassword" class="control-label">新的密码: </label>
|
|
56
|
+
<input type="password" v-model="deliver.newpassword" class="form-control" id="newpassword" v-validate:newpassword='{ required: true }'>
|
|
57
|
+
<span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.newpassword.required"></span>
|
|
58
|
+
<!-- <span class="glyphicon form-control-feedback"
|
|
59
|
+
:class="{'glyphicon-warning-sign':$v.newpassword.required,'glyphicon-ok':!$v.newpassword.required }"></span> -->
|
|
60
|
+
<span v-if="$v.newpassword.required">不能为空</span>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div class="has-feedback"
|
|
64
|
+
:class="{'has-warning':$v.affirmpassword.required,'has-error':$v.affirmpassword.equalValid && !($v.affirmpassword.required),
|
|
65
|
+
'has-success': !$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))}">
|
|
66
|
+
<label for="affirmpassword" class="control-label">确认密码: </label>
|
|
67
|
+
<input type="password" v-model="deliver.affirmpassword" class="form-control" id="affirmpassword" v-validate:affirmpassword="{ required: true, equalValid: deliver.newpassword }">
|
|
68
|
+
<span class="glyphicon glyphicon-ok form-control-feedback" v-if="!$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))"></span>
|
|
69
|
+
<!-- <span class="glyphicon form-control-feedback"
|
|
70
|
+
:class="{'glyphicon-warning-sign':$v.affirmpassword.required,'glyphicon-remove'$v.affirmpassword.equalValid && !($v.affirmpassword.required):,
|
|
71
|
+
'glyphicon-ok':!$v.affirmpassword.required && !($v.affirmpassword.equalValid && !($v.affirmpassword.required))}"></span> -->
|
|
72
|
+
<span v-if="$v.affirmpassword.required">不能为空</span>
|
|
73
|
+
<span v-if="$v.affirmpassword.equalValid && !($v.affirmpassword.required)">两次密码不一致 !!</span>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
</validator>
|
|
77
|
+
</article>
|
|
78
|
+
<footer slot="modal-footer" class="footerbtn">
|
|
79
|
+
<button type="button" class="btn btn-success" @click='confirm' :disabled="!$v.valid">确认</button>
|
|
80
|
+
<button type="button" class="btn btn-default" @click='close'>取消</button>
|
|
81
|
+
</footer>
|
|
82
|
+
<modal>
|
|
83
|
+
<!-- modifyPassword() -->
|
|
84
|
+
</modal>
|
|
85
|
+
</modal>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
<script>
|
|
90
|
+
import co from 'co'
|
|
91
|
+
import * as Util from '../Util'
|
|
92
|
+
|
|
93
|
+
let saveGen = function * (self) {
|
|
94
|
+
self.deliver.ename = self.functions.ename
|
|
95
|
+
// let res = yield self.$post('rs/user/entity', {data: self.deliver})
|
|
96
|
+
// let res = yield self.$post('rs/db/modifypassword', {data: self.deliver})
|
|
97
|
+
let res = yield self.$post('rs/db/modifypwd', {data: self.deliver})
|
|
98
|
+
if (res.status === 200 || res.status === 204) {
|
|
99
|
+
self.modify = false
|
|
100
|
+
self.deliver.password = ''
|
|
101
|
+
self.deliver.newpassword = ''
|
|
102
|
+
self.deliver.affirmpassword = ''
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export default {
|
|
107
|
+
title: '菜单选择',
|
|
108
|
+
props: ['functions'],
|
|
109
|
+
data () {
|
|
110
|
+
return {
|
|
111
|
+
modify: false,
|
|
112
|
+
deliver: {
|
|
113
|
+
password: '',
|
|
114
|
+
newpassword: '',
|
|
115
|
+
affirmpassword: ''
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
computed: {
|
|
120
|
+
date () {
|
|
121
|
+
return Util.getNowDate()
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
open (row) {
|
|
126
|
+
if (row.link) {
|
|
127
|
+
// this.$goto(row.link, {userid: this.functions, source: {isRead: 'modify'}}, 'home-page')
|
|
128
|
+
this.$goto(row.link, {f: this.functions}, 'home-page')
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
// 修改密码操作
|
|
132
|
+
close () {
|
|
133
|
+
this.modify = false
|
|
134
|
+
},
|
|
135
|
+
confirm () {
|
|
136
|
+
let gen = saveGen(this)
|
|
137
|
+
co(gen)
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
events: {
|
|
141
|
+
'select-changed': function (data) {
|
|
142
|
+
// 事件回调内的 `this` 自动绑定到注册它的实例上
|
|
143
|
+
this.open(data.val)
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</script>
|
|
148
|
+
<style>
|
|
149
|
+
/* 头部样式,大部分使用放在标签内 */
|
|
150
|
+
.head {
|
|
151
|
+
color: #fff;
|
|
152
|
+
height: 110px;
|
|
153
|
+
width: 100%;
|
|
154
|
+
}
|
|
155
|
+
/* 菜单头部与内容区域的中间的白色线 */
|
|
156
|
+
.whiteline {
|
|
157
|
+
height: 1px;
|
|
158
|
+
background: #fff;
|
|
159
|
+
margin: 0px 30px;
|
|
160
|
+
}
|
|
161
|
+
/*修改密码body界面样式*/
|
|
162
|
+
.modifystyle {
|
|
163
|
+
background: #FCFEEE;
|
|
164
|
+
}
|
|
165
|
+
.modifystyle div{
|
|
166
|
+
height: auto;
|
|
167
|
+
margin-bottom: 15px;
|
|
168
|
+
/*text-align: center;*/
|
|
169
|
+
margin-left: 20%;
|
|
170
|
+
}
|
|
171
|
+
/*bootstrap字体图标要手动调整,所以使用字体图标的span必须紧跟在input后面,负责会错位*/
|
|
172
|
+
.modifystyle div input + span{
|
|
173
|
+
top: 0!important;
|
|
174
|
+
right: 32%;
|
|
175
|
+
}
|
|
176
|
+
.modifystyle span{
|
|
177
|
+
color: red;
|
|
178
|
+
}
|
|
179
|
+
/*修改密码底部按钮部分样式*/
|
|
180
|
+
.footerbtn {
|
|
181
|
+
text-align: center;
|
|
182
|
+
padding: 15px;
|
|
183
|
+
}
|
|
184
|
+
.footerbtn button {
|
|
185
|
+
width: 100px;
|
|
186
|
+
margin-left: 20px;
|
|
187
|
+
}
|
|
188
|
+
</style>
|
|
@@ -360,12 +360,12 @@ export default {
|
|
|
360
360
|
const data = {
|
|
361
361
|
"condition":
|
|
362
362
|
{
|
|
363
|
-
"condition"
|
|
363
|
+
"condition":` 1=1 and tswo.f_filiale_id = '${this.$login.f.orgid}' `,
|
|
364
364
|
"sign":"1=1"
|
|
365
365
|
},
|
|
366
366
|
"userid":this.functions.name
|
|
367
367
|
}
|
|
368
|
-
new HttpResetClass().load('POST','rs/
|
|
368
|
+
new HttpResetClass().load('POST','rs/sql/operatorService/n', {data}, {resolveMsg: null, rejectMsg: null}).then(res=>{
|
|
369
369
|
if(res.data && res.data.n !== 0){
|
|
370
370
|
this.$showMessage('你有'+res.data.n+'个工单待处理,请尽快前往站点工单页面进行处理')
|
|
371
371
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 日期工具函数
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 检查给定日期是否超过指定月数
|
|
7
|
+
* @param {string} dateString - 日期字符串,格式: YYYY-MM-DD HH:mm:ss
|
|
8
|
+
* @param {number} months - 月数,默认为3
|
|
9
|
+
* @returns {boolean} 如果超过指定月数返回true,否则返回false
|
|
10
|
+
*/
|
|
11
|
+
export function isDateOlderThanMonths(dateString, months = 3) {
|
|
12
|
+
if (!dateString) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const targetDate = new Date(dateString);
|
|
18
|
+
const currentDate = new Date();
|
|
19
|
+
|
|
20
|
+
// 检查日期是否有效
|
|
21
|
+
if (isNaN(targetDate.getTime())) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 计算指定月数前的日期
|
|
26
|
+
const monthsAgo = new Date();
|
|
27
|
+
monthsAgo.setMonth(monthsAgo.getMonth() - months);
|
|
28
|
+
|
|
29
|
+
// 如果目标日期早于指定月数前的日期,则返回true
|
|
30
|
+
return targetDate < monthsAgo;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('日期比较出错:', error);
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 检查密码更新时间是否超过3个月
|
|
39
|
+
* @param {string} updateTime - 密码更新时间字符串
|
|
40
|
+
* @returns {boolean} 如果超过3个月返回true,否则返回false
|
|
41
|
+
*/
|
|
42
|
+
export function isPasswordUpdateTimeExpired(updateTime) {
|
|
43
|
+
return isDateOlderThanMonths(updateTime, 3);
|
|
44
|
+
}
|