Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pudong-elevator-map
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
郭铭瑶
pudong-elevator-map
Commits
b61f1b8c
Commit
b61f1b8c
authored
Jun 04, 2020
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删改代码,添加注释
parent
35728540
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
216 additions
and
328 deletions
+216
-328
main.js
src/main.js
+1
-2
common.js
src/util/common.js
+28
-31
main.vue
src/views/main.vue
+187
-295
No files found.
src/main.js
View file @
b61f1b8c
...
@@ -6,14 +6,13 @@ import App from './App'
...
@@ -6,14 +6,13 @@ import App from './App'
import
router
from
'./router'
import
router
from
'./router'
import
common
from
'./util/common'
import
common
from
'./util/common'
import
api
from
'./util/api'
import
api
from
'./util/api'
import
{
Icon
,
Button
,
Collapse
,
Panel
,
Modal
,
Table
,
Drawer
}
from
'view-design'
import
{
Button
,
Collapse
,
Panel
,
Modal
,
Table
,
Drawer
}
from
'view-design'
import
'view-design/dist/styles/iview.css'
import
'view-design/dist/styles/iview.css'
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
Vue
.
prototype
.
$com
=
common
Vue
.
prototype
.
$com
=
common
Vue
.
prototype
.
$api
=
api
Vue
.
prototype
.
$api
=
api
Vue
.
component
(
'Button'
,
Button
)
Vue
.
component
(
'Button'
,
Button
)
Vue
.
component
(
'Icon'
,
Icon
)
Vue
.
component
(
'Collapse'
,
Collapse
)
Vue
.
component
(
'Collapse'
,
Collapse
)
Vue
.
component
(
'Panel'
,
Panel
)
Vue
.
component
(
'Panel'
,
Panel
)
Vue
.
component
(
'Modal'
,
Modal
)
Vue
.
component
(
'Modal'
,
Modal
)
...
...
src/util/common.js
View file @
b61f1b8c
...
@@ -11,6 +11,34 @@ export default{
...
@@ -11,6 +11,34 @@ export default{
return
[]
return
[]
}
}
},
},
switchImg
(
ratio
)
{
if
(
!
ratio
)
ratio
=
0
if
(
ratio
<
1
)
{
ratio
=
ratio
*
100
}
if
(
ratio
<=
10
)
return
1
if
(
ratio
<=
20
)
return
2
if
(
ratio
<=
30
)
return
3
if
(
ratio
<=
40
)
return
4
if
(
ratio
<=
50
)
return
5
if
(
ratio
<=
60
)
return
6
if
(
ratio
<=
70
)
return
7
if
(
ratio
<=
80
)
return
8
if
(
ratio
<=
90
)
return
9
if
(
ratio
<=
100
)
return
10
},
switchColor
(
color
)
{
if
(
!
color
)
return
null
if
(
color
.
indexOf
(
'绿'
)
>=
0
)
return
{
'background-color'
:
'#8fd618'
}
if
(
color
.
indexOf
(
'黄'
)
>=
0
)
return
{
'background-color'
:
'gold'
}
if
(
color
.
indexOf
(
'红'
)
>=
0
)
return
{
'background-color'
:
'red'
}
},
switchStarNum
(
intention
)
{
if
(
!
intention
)
return
0
if
(
intention
.
indexOf
(
'一'
)
>=
0
)
return
1
if
(
intention
.
indexOf
(
'二'
)
>=
0
||
intention
.
indexOf
(
'两'
)
>=
0
)
return
2
if
(
intention
.
indexOf
(
'三'
)
>=
0
)
return
3
},
switchStatus
(
status
)
{
switchStatus
(
status
)
{
status
=
Number
(
status
)
status
=
Number
(
status
)
switch
(
status
)
{
switch
(
status
)
{
...
@@ -26,35 +54,4 @@ export default{
...
@@ -26,35 +54,4 @@ export default{
return
'暂无状态'
return
'暂无状态'
}
}
},
},
similar
(
str1
,
str2
)
{
if
(
!
str1
||
!
str2
||
typeof
(
str1
)
!=
'string'
||
typeof
(
str2
)
!=
'string'
)
{
console
.
error
(
'参数需要是string类型!'
)
return
0
}
const
len1
=
str1
.
length
const
len2
=
str2
.
length
const
arr
=
[]
for
(
let
i
=
0
;
i
<=
len1
;
i
++
)
{
arr
[
i
]
=
[]
arr
[
i
][
0
]
=
i
}
for
(
let
i
=
0
;
i
<=
len2
;
i
++
)
{
arr
[
0
][
i
]
=
i
}
let
temp
for
(
let
i
=
1
;
i
<=
len1
;
i
++
)
{
for
(
let
j
=
1
;
j
<=
len2
;
j
++
)
{
if
(
str1
.
charAt
(
i
-
1
)
==
str2
.
charAt
(
j
-
1
))
{
temp
=
0
}
else
{
temp
=
1
}
arr
[
i
][
j
]
=
Math
.
min
(
arr
[
i
-
1
][
j
-
1
]
+
temp
,
arr
[
i
][
j
-
1
]
+
1
,
arr
[
i
-
1
][
j
]
+
1
)
}
}
return
(
1
-
arr
[
len1
][
len2
]
/
Math
.
max
(
len1
,
len2
)).
toFixed
(
3
)
}
}
}
src/views/main.vue
View file @
b61f1b8c
This diff is collapsed.
Click to expand it.
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