Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
36751e5b
authored
2022-11-08 10:24:27 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:弹窗
1 parent
b58dc9af
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
42 deletions
src/api/config.js
src/components/tanchuang/index.js
src/components/tanchuang/index.vue
src/components/tanchuang/redeme.md
src/views/zhcx/djbcx/djbcx.vue
src/api/config.js
View file @
36751e5
export
default
{
SERVERAPI
:
'/service-bdcdj
-Tian
'
,
SERVERCAI
:
'/service-bdcdj-Tian'
SERVERAPI
:
'/service-bdcdj
9
'
,
//
SERVERCAI: '/service-bdcdj-Tian'
}
\ No newline at end of file
...
...
src/components/tanchuang/index.js
View file @
36751e5
...
...
@@ -13,5 +13,4 @@ Popup.install = function (title, editItem, data) {
instance
.
isShow
=
true
})
}
export
default
Popup
\ No newline at end of file
export
default
Popup
...
...
src/components/tanchuang/index.vue
View file @
36751e5
...
...
@@ -55,21 +55,21 @@ export default {
},
mounted
()
{
// 计算滚动条高度
//
setTimeout(() => {
//
if (this.btnShow) {
//
if (this.height == 'auto') {
//
this.contentHeight = (this.$refs.contentRef.offsetHeight - 200) + 'px'
//
} else {
//
this.contentHeight = this.height
//
}
//
} else {
//
if (this.height == 'auto') {
//
this.contentHeight = this.$refs.contentRef.offsetHeight
//
} else {
//
this.contentHeight = this.height
//
}
//
}
// }, 5
00)
setTimeout
(()
=>
{
if
(
this
.
btnShow
)
{
if
(
this
.
height
==
'auto'
)
{
this
.
contentHeight
=
(
this
.
$refs
.
contentRef
.
offsetHeight
-
200
)
+
'px'
}
else
{
this
.
contentHeight
=
this
.
height
}
}
else
{
if
(
this
.
height
==
'auto'
)
{
this
.
contentHeight
=
this
.
$refs
.
contentRef
.
offsetHeight
}
else
{
this
.
contentHeight
=
this
.
height
}
}
},
3
00
)
},
methods
:
{
onCancel
()
{
...
...
@@ -78,12 +78,12 @@ export default {
},
onConfirm
()
{
this
.
loading
=
true
let
isOk
=
this
.
$refs
.
childRef
.
childFn
()
//子组件方法 必须命名一致
if
(
isOk
||
isOk
==
undefined
)
{
//如果子组件没有 return false 就代表子组件方法一切正常
this
.
isShow
=
false
let
res
=
new
Promise
((
resolve
,
reject
)
=>
{
this
.
confirm
()
}
else
{
//否则
console
.
log
(
'弹窗不关闭'
)
resolve
(
true
)
})
if
(
res
)
{
this
.
isShow
=
false
}
},
loadingFn
(
e
)
{
//加载状态
...
...
@@ -93,7 +93,7 @@ export default {
return
(
r
)
=>
require
.
ensure
([],
()
=>
r
(
require
(
`@/views/
${
view
}
.vue`
))
)
;
)
}
},
destroyed
()
{
...
...
@@ -146,6 +146,8 @@ export default {
.ls-mask-content
{
padding
:
20px
;
width
:
100%
;
min-height
:
30%
;
max-height
:
95%
;
overflow
:
scroll
;
}
...
...
src/components/tanchuang/redeme.md
View file @
36751e5
弹窗封装
2.
用法以及参数:
this.$popup('提示','ywbl/dbx/aa',{
formData:this.formData, //父组件传给子组件的参数
cancel: function () {}, //取消事件的回调
confirm: function () {}, //确认事件的回调
})
3.
子组件的方法名字必须统一为 childFn()
4.
子组件切记props接收 父组件传参formData
以及在使用结束后传loading状态给父组件
this.$popup('提示','ywbl/dbx/aa',{
width: '75%', // 初始化75% 不需要改的话 可以直接不要
formData: this.formData, //父组件传给子组件的参数
cancel: function () {}, //取消事件的回调 没有按钮可以不需要
confirm: function () {} //确认事件的回调 没有按钮可以不需要
})
5.
后续有修改请添加在此处文档说明作用
\ No newline at end of file
...
...
src/views/zhcx/djbcx/djbcx.vue
View file @
36751e5
...
...
@@ -111,15 +111,8 @@ export default {
moreQueryClick
()
{
},
openDialog
(
scroll
)
{
this
.
$popup
(
'登记簿详情'
,
'registerBook/djbFrame'
,
{
formData
:
scroll
,
width
:
"1220px"
,
height
:
"790px"
,
cancel
:
()
=>
{
console
.
log
(
"取消回调"
);
},
confirm
:
()
=>
{
console
.
log
(
"确认回调"
);
},
width
:
'90%'
,
formData
:
scroll
});
},
handleLpbClick
(
item
)
{
...
...
Please
register
or
sign in
to post a comment