Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄瑜
VueElementTemplate
Commits
98d5f9a2
Commit
98d5f9a2
authored
Oct 31, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint:format code style
parent
3666148d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
307 additions
and
308 deletions
+307
-308
.eslintrc.js
.eslintrc.js
+1
-1
index.vue
src/components/Dropzone/index.vue
+10
-10
index.vue
src/components/Tinymce/index.vue
+33
-33
index.js
src/filters/index.js
+6
-6
main.js
src/main.js
+1
-1
_import_development.js
src/router/_import_development.js
+1
-1
fetch.js
src/utils/fetch.js
+25
-26
index.js
src/utils/index.js
+230
-230
No files found.
.eslintrc.js
View file @
98d5f9a2
...
...
@@ -52,7 +52,7 @@ module.exports = {
'no-class-assign'
:
2
,
'no-cond-assign'
:
2
,
'no-const-assign'
:
2
,
'no-control-regex'
:
2
,
'no-control-regex'
:
0
,
'no-delete-var'
:
2
,
'no-dupe-args'
:
2
,
'no-dupe-class-members'
:
2
,
...
...
src/components/Dropzone/index.vue
View file @
98d5f9a2
...
...
@@ -7,7 +7,7 @@
<
script
>
import
Dropzone
from
'dropzone'
import
'dropzone/dist/dropzone.css'
// import { getToken } from 'api/qiniu';
// import { getToken } from 'api/qiniu';
Dropzone
.
autoDiscover
=
false
...
...
src/components/Tinymce/index.vue
View file @
98d5f9a2
src/filters/index.js
View file @
98d5f9a2
src/main.js
View file @
98d5f9a2
src/router/_import_development.js
View file @
98d5f9a2
src/utils/fetch.js
View file @
98d5f9a2
...
...
@@ -29,29 +29,29 @@ service.interceptors.response.use(
* 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
* 如通过xmlhttprequest 状态码标识 逻辑可写在下面error中
*/
// const res = response.data;
// if (res.code !== 20000) {
// Message({
// message: res.message,
// type: 'error',
// duration: 5 * 1000
// });
// // 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
// if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
// confirmButtonText: '重新登录',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// store.dispatch('FedLogOut').then(() => {
// location.reload();// 为了重新实例化vue-router对象 避免bug
// });
// })
// }
// return Promise.reject('error');
// } else {
// return response.data;
// }
// const res = response.data;
// if (res.code !== 20000) {
// Message({
// message: res.message,
// type: 'error',
// duration: 5 * 1000
// });
// // 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
// if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
// confirmButtonText: '重新登录',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// store.dispatch('FedLogOut').then(() => {
// location.reload();// 为了重新实例化vue-router对象 避免bug
// });
// })
// }
// return Promise.reject('error');
// } else {
// return response.data;
// }
error
=>
{
console
.
log
(
'err'
+
error
)
// for debug
Message
({
...
...
@@ -60,7 +60,6 @@ service.interceptors.response.use(
duration
:
5
*
1000
})
return
Promise
.
reject
(
error
)
}
)
})
export
default
service
src/utils/index.js
View file @
98d5f9a2
...
...
@@ -2,7 +2,7 @@
* Created by jiachenpan on 16/11/18.
*/
export
function
parseTime
(
time
,
cFormat
)
{
export
function
parseTime
(
time
,
cFormat
)
{
if
(
arguments
.
length
===
0
)
{
return
null
}
...
...
@@ -32,9 +32,9 @@
return
value
||
0
})
return
time_str
}
}
export
function
formatTime
(
time
,
option
)
{
export
function
formatTime
(
time
,
option
)
{
time
=
+
time
*
1000
const
d
=
new
Date
(
time
)
const
now
=
Date
.
now
()
...
...
@@ -55,10 +55,10 @@
}
else
{
return
d
.
getMonth
()
+
1
+
'月'
+
d
.
getDate
()
+
'日'
+
d
.
getHours
()
+
'时'
+
d
.
getMinutes
()
+
'分'
}
}
}
// 格式化时间
export
function
getQueryObject
(
url
)
{
export
function
getQueryObject
(
url
)
{
url
=
url
==
null
?
window
.
location
.
href
:
url
const
search
=
url
.
substring
(
url
.
lastIndexOf
(
'?'
)
+
1
)
const
obj
=
{}
...
...
@@ -71,14 +71,14 @@
return
rs
})
return
obj
}
}
/**
*get getByteLen
* @param {Sting} val input value
* @returns {number} output value
*/
export
function
getByteLen
(
val
)
{
export
function
getByteLen
(
val
)
{
let
len
=
0
for
(
let
i
=
0
;
i
<
val
.
length
;
i
++
)
{
if
(
val
[
i
].
match
(
/
[^\x
00-
\x
ff
]
/ig
)
!=
null
)
{
...
...
@@ -86,9 +86,9 @@
}
else
{
len
+=
0.5
}
}
return
Math
.
floor
(
len
)
}
}
export
function
cleanArray
(
actual
)
{
export
function
cleanArray
(
actual
)
{
const
newArray
=
[]
for
(
let
i
=
0
;
i
<
actual
.
length
;
i
++
)
{
if
(
actual
[
i
])
{
...
...
@@ -96,32 +96,32 @@
}
}
return
newArray
}
}
export
function
param
(
json
)
{
export
function
param
(
json
)
{
if
(
!
json
)
return
''
return
cleanArray
(
Object
.
keys
(
json
).
map
(
key
=>
{
if
(
json
[
key
]
===
undefined
)
return
''
return
encodeURIComponent
(
key
)
+
'='
+
encodeURIComponent
(
json
[
key
])
})).
join
(
'&'
)
}
}
export
function
param2Obj
(
url
)
{
export
function
param2Obj
(
url
)
{
const
search
=
url
.
split
(
'?'
)[
1
]
if
(
!
search
)
{
return
{}
}
return
JSON
.
parse
(
'{"'
+
decodeURIComponent
(
search
).
replace
(
/"/g
,
'
\\
"'
).
replace
(
/&/g
,
'","'
).
replace
(
/=/g
,
'":"'
)
+
'"}'
)
}
}
export
function
html2Text
(
val
)
{
export
function
html2Text
(
val
)
{
const
div
=
document
.
createElement
(
'div'
)
div
.
innerHTML
=
val
return
div
.
textContent
||
div
.
innerText
}
}
export
function
objectMerge
(
target
,
source
)
{
export
function
objectMerge
(
target
,
source
)
{
/* Merges two objects,
giving the last one precedence */
...
...
@@ -142,9 +142,9 @@
}
}
return
target
}
}
export
function
scrollTo
(
element
,
to
,
duration
)
{
export
function
scrollTo
(
element
,
to
,
duration
)
{
if
(
duration
<=
0
)
return
const
difference
=
to
-
element
.
scrollTop
const
perTick
=
difference
/
duration
*
10
...
...
@@ -154,9 +154,9 @@
if
(
element
.
scrollTop
===
to
)
return
scrollTo
(
element
,
to
,
duration
-
10
)
},
10
)
}
}
export
function
toggleClass
(
element
,
className
)
{
export
function
toggleClass
(
element
,
className
)
{
if
(
!
element
||
!
className
)
{
return
}
...
...
@@ -168,9 +168,9 @@
classString
=
classString
.
substr
(
0
,
nameIndex
)
+
classString
.
substr
(
nameIndex
+
className
.
length
)
}
element
.
className
=
classString
}
}
export
const
pickerOptions
=
[
export
const
pickerOptions
=
[
{
text
:
'今天'
,
onClick
(
picker
)
{
...
...
@@ -205,15 +205,15 @@
}
}]
export
function
getTime
(
type
)
{
export
function
getTime
(
type
)
{
if
(
type
===
'start'
)
{
return
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
90
}
else
{
return
new
Date
(
new
Date
().
toDateString
())
}
}
}
export
function
debounce
(
func
,
wait
,
immediate
)
{
export
function
debounce
(
func
,
wait
,
immediate
)
{
let
timeout
,
args
,
context
,
timestamp
,
result
const
later
=
function
()
{
...
...
@@ -246,9 +246,9 @@
return
result
}
}
}
export
function
deepClone
(
source
)
{
export
function
deepClone
(
source
)
{
if
(
!
source
&&
typeof
source
!==
'object'
)
{
throw
new
Error
(
'error arguments'
,
'shallowClone'
)
}
...
...
@@ -264,4 +264,4 @@
}
}
return
targetObj
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment