Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
24cd96ca
提交
24cd96ca
authored
1月 07, 2021
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
签名修改
上级
c6ded5f3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
135 行增加
和
102 行删除
+135
-102
app.vue
src/app.vue
+124
-0
navigation.vue
src/components/learnSysLayout/navigation.vue
+6
-101
index.js
src/store/index.js
+5
-1
没有找到文件。
src/app.vue
浏览文件 @
24cd96ca
<
template
>
<
template
>
<div
style=
"height: 100%; width: 100%"
>
<div
style=
"height: 100%; width: 100%"
>
<router-view></router-view>
<router-view></router-view>
<el-dialog
:title=
"$t('components.learnSysLayout.navigation.dialogTitle')"
:width=
"dialogWidth"
:visible
.
sync=
"dialogVisible"
:center=
"true"
:append-to-body=
"true"
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
@
closed=
"handleClose"
>
<div
class=
"sign"
>
<p>
{{
$t
(
'components.learnSysLayout.navigation.dialogMessage1'
)
}}
<a
:href=
"$t('components.learnSysLayout.navigation.dialogMessageHref')"
target=
"_blank"
>
{{
$t
(
'components.learnSysLayout.navigation.dialogMessage2'
)
}}
</a
>
{{
$t
(
'components.learnSysLayout.navigation.dialogMessage3'
)
}}
</p>
<el-checkbox
v-model=
"checked"
>
{{
$t
(
'components.learnSysLayout.navigation.dialogCheckbox'
)
}}
</el-checkbox>
</div>
<template
#
footer
>
<el-button
type=
"primary"
:disabled=
"!checked"
@
click=
"handlePrimary"
>
{{
$t
(
'components.learnSysLayout.navigation.dialogButton'
)
}}
</el-button>
</
template
>
</el-dialog>
</div>
</div>
</template>
</template>
<
script
>
import
cAction
from
'@/action'
export
default
{
data
()
{
const
UA
=
navigator
.
userAgent
return
{
isMobile
:
/iphone/i
.
test
(
UA
)
||
(
/android/i
.
test
(
UA
)
&&
/mobile/i
.
test
(
UA
)),
dialogVisible
:
false
,
checked
:
false
,
sign
:
{},
documentUrl
:
''
,
timer
:
null
}
},
computed
:
{
dialogWidth
()
{
return
this
.
isMobile
?
'90%'
:
'460px'
}
},
methods
:
{
createSign
()
{
cAction
.
Other
.
createSign
().
then
(
response
=>
{
const
{
code
,
data
}
=
response
if
(
code
===
1
)
{
this
.
sign
=
data
this
.
getSignDocument
(
data
.
flowid
).
then
(()
=>
{
if
(
!
this
.
documentUrl
)
{
this
.
dialogVisible
=
true
}
})
}
else
{
this
.
$message
.
error
(
'处理签名失败'
)
}
})
},
getSignDocument
(
flowid
)
{
return
cAction
.
Other
.
getSignDocument
({
flowid
}).
then
(
response
=>
{
const
{
code
,
data
}
=
response
if
(
code
===
1
)
{
this
.
documentUrl
=
data
.
url
this
.
$store
.
commit
(
'updateDocumentUrl'
,
data
.
url
)
}
return
response
})
},
setTimer
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
getSignDocument
(
this
.
sign
.
flowid
).
then
(
response
=>
{
if
(
response
.
code
===
1
)
{
this
.
clearTimer
()
this
.
dialogVisible
=
false
}
else
{
this
.
dialogVisible
=
true
}
})
},
5000
)
},
clearTimer
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
)
},
handlePrimary
()
{
this
.
setTimer
()
this
.
newWindowPreview
(
this
.
sign
.
shortUrl
)
},
handleClose
()
{
if
(
!
this
.
documentUrl
)
{
window
.
location
.
href
=
webConf
.
others
.
loginUrl
}
},
// 新窗口预览
newWindowPreview
(
url
)
{
const
a
=
document
.
createElement
(
'a'
)
a
.
href
=
url
a
.
target
=
'_blank'
document
.
body
.
appendChild
(
a
)
a
.
click
()
a
.
remove
()
}
},
beforeMount
()
{
this
.
createSign
()
},
destroyed
()
{
this
.
clearTimer
()
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.sign
{
p
{
text-indent
:
2em
;
line-height
:
24px
;
}
}
</
style
>
src/components/learnSysLayout/navigation.vue
浏览文件 @
24cd96ca
...
@@ -15,32 +15,6 @@
...
@@ -15,32 +15,6 @@
</div>
</div>
<language-switch
/>
<language-switch
/>
</div>
</div>
<el-dialog
:title=
"$t('components.learnSysLayout.navigation.dialogTitle')"
width=
"460px"
:visible
.
sync=
"dialogVisible"
:center=
"true"
:append-to-body=
"true"
:close-on-click-modal=
"false"
:close-on-press-escape=
"false"
@
closed=
"handleClose"
>
<div
class=
"sign"
>
<p>
{{
$t
(
'components.learnSysLayout.navigation.dialogMessage1'
)
}}
<a
:href=
"$t('components.learnSysLayout.navigation.dialogMessageHref')"
target=
"_blank"
>
{{
$t
(
'components.learnSysLayout.navigation.dialogMessage2'
)
}}
</a
>
{{
$t
(
'components.learnSysLayout.navigation.dialogMessage3'
)
}}
</p>
<el-checkbox
v-model=
"checked"
>
{{
$t
(
'components.learnSysLayout.navigation.dialogCheckbox'
)
}}
</el-checkbox>
</div>
<template
#
footer
>
<el-button
type=
"primary"
:disabled=
"!checked"
@
click=
"handlePrimary"
>
{{
$t
(
'components.learnSysLayout.navigation.dialogButton'
)
}}
</el-button>
</
template
>
</el-dialog>
</div>
</div>
</
template
>
</
template
>
...
@@ -52,12 +26,12 @@ export default {
...
@@ -52,12 +26,12 @@ export default {
components
:
{
LanguageSwitch
},
components
:
{
LanguageSwitch
},
data
()
{
data
()
{
return
{
return
{
num
:
this
.
$store
.
getters
.
myMsg
,
num
:
this
.
$store
.
getters
.
myMsg
dialogVisible
:
false
,
}
checked
:
false
,
}
,
sign
:
{},
computed
:
{
documentUrl
:
''
,
documentUrl
()
{
timer
:
nul
l
return
this
.
$store
.
state
.
documentUr
l
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -81,70 +55,7 @@ export default {
...
@@ -81,70 +55,7 @@ export default {
this
.
status
=
true
this
.
status
=
true
}
}
this
.
$root
.
$emit
(
'updateStatus'
,
this
.
status
)
this
.
$root
.
$emit
(
'updateStatus'
,
this
.
status
)
},
createSign
()
{
cAction
.
Other
.
createSign
().
then
(
response
=>
{
const
{
code
,
data
}
=
response
if
(
code
===
1
)
{
this
.
sign
=
data
this
.
getSignDocument
(
data
.
flowid
).
then
(()
=>
{
if
(
!
this
.
documentUrl
)
{
this
.
dialogVisible
=
true
}
})
}
else
{
this
.
$message
.
error
(
'处理签名失败'
)
}
})
},
getSignDocument
(
flowid
)
{
return
cAction
.
Other
.
getSignDocument
({
flowid
}).
then
(
response
=>
{
const
{
code
,
data
}
=
response
if
(
code
===
1
)
{
this
.
documentUrl
=
data
.
url
}
return
response
})
},
setTimer
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
getSignDocument
(
this
.
sign
.
flowid
).
then
(
response
=>
{
if
(
response
.
code
===
1
)
{
this
.
clearTimer
()
this
.
dialogVisible
=
false
}
else
{
this
.
dialogVisible
=
true
}
})
},
5000
)
},
clearTimer
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
)
},
handlePrimary
()
{
this
.
setTimer
()
this
.
newWindowPreview
(
this
.
sign
.
shortUrl
)
},
handleClose
()
{
if
(
!
this
.
documentUrl
)
{
window
.
location
.
href
=
webConf
.
others
.
loginUrl
}
},
// 新窗口预览
newWindowPreview
(
url
)
{
const
a
=
document
.
createElement
(
'a'
)
a
.
href
=
url
a
.
target
=
'_blank'
document
.
body
.
appendChild
(
a
)
a
.
click
()
a
.
remove
()
}
}
},
beforeMount
()
{
this
.
createSign
()
},
destroyed
()
{
this
.
clearTimer
()
}
}
}
}
</
script
>
</
script
>
...
@@ -214,12 +125,6 @@ export default {
...
@@ -214,12 +125,6 @@ export default {
}
}
}
}
}
}
.sign
{
p
{
text-indent
:
2em
;
line-height
:
24px
;
}
}
.nav-a
{
.nav-a
{
a
{
a
{
margin
:
0
10px
;
margin
:
0
10px
;
...
...
src/store/index.js
浏览文件 @
24cd96ca
...
@@ -4,7 +4,8 @@ Vue.use(Vuex)
...
@@ -4,7 +4,8 @@ Vue.use(Vuex)
export
default
new
Vuex
.
Store
({
export
default
new
Vuex
.
Store
({
state
:
{
state
:
{
myMsg
:
0
myMsg
:
0
,
documentUrl
:
''
},
},
getters
:
{
getters
:
{
myMsg
(
state
)
{
myMsg
(
state
)
{
...
@@ -14,6 +15,9 @@ export default new Vuex.Store({
...
@@ -14,6 +15,9 @@ export default new Vuex.Store({
mutations
:
{
mutations
:
{
myMsg
(
state
,
sum
)
{
myMsg
(
state
,
sum
)
{
state
.
myMsg
=
sum
state
.
myMsg
=
sum
},
updateDocumentUrl
(
state
,
url
)
{
state
.
documentUrl
=
url
}
}
},
},
actions
:
{}
actions
:
{}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论