f70b37c2 by 任超

style:popup

1 parent 0b03afa8
......@@ -9,6 +9,7 @@ export default {
Vue.component('lbTable', LbTable);
Vue.component('Theme', Theme);
Vue.prototype.$popup = Popup.install;
Vue.prototype.$popupClose = Popup.close;
Vue.prototype.$alertMes = MessageBox.alert;
}
}
\ No newline at end of file
......
......@@ -16,4 +16,11 @@ Popup.install = function (title, editItem, data, formData) {
instance.isShow = true
})
}
Popup.close = function () {
let instance = new PopupBox().$mount()
Vue.nextTick(() => {
instance.isShow = false
})
}
export default Popup
......
<template>
<transition name="dialog-fade" mode="out-in" v-if="isShow">
<div class="ls-mask" v-loading="loading">
<div class="ls-mask-window" :style="{ 'width': width, 'height': height }">
<div class="ls-mask-window" :style="{ 'width': width }">
<div class="ls-head">
<div class="ls-title" :style="{ 'text-align': titleStyle }">
<svg-icon v-if="iconClass != ''" :icon-class='iconClass' />
......@@ -9,7 +9,7 @@
</div>
<svg-icon icon-class='close' class="closeStyle" @click="onCancel" />
</div>
<div class="ls-mask-content" ref='contentRef' :style="{ 'height': contentHeight }">
<div class="mask-content" ref='contentRef' :style="{ 'height': contentHeight }">
<component :is="editItem" ref='childRef' @loading='loadingFn' :key="key" :formData='formData' />
</div>
<div class="ls-mask-footer" v-if='btnShow'>
......@@ -58,13 +58,13 @@ export default {
setTimeout(() => {
if (this.btnShow) {
if (this.height == 'auto') {
this.contentHeight = (this.$refs.contentRef.offsetHeight - 200) + 'px'
this.contentHeight = (this.$refs.contentRef.offsetHeight + 20) + 'px'
} else {
this.contentHeight = this.height
}
} else {
if (this.height == 'auto') {
this.contentHeight = this.$refs.contentRef.offsetHeight
this.contentHeight = (this.$refs.contentRef.offsetHeight + 20) + 'px'
} else {
this.contentHeight = this.height
}
......@@ -122,7 +122,8 @@ export default {
top: 50%;
min-height: 200px;
transform: translate(-50%, -50%);
border-radius: 10px;
border-radius: 5px;
overflow: hidden;
}
.ls-mask-window b {
......@@ -133,21 +134,18 @@ export default {
padding: 16px;
color: #ffffff;
background: linear-gradient(3deg, #409EFF, #a7cbee);
border-top-left-radius: 5px;
border-top-right-radius: 5px;
overflow: hidden;
}
.ls-title .svg-icon {
font-size: 18px;
}
.ls-mask-content {
.mask-content {
padding: 20px;
width: 100%;
min-height: 30%;
max-height: 95%;
overflow: scroll;
overflow-y: scroll;
}
.ls-mask-footer {
......
......@@ -81,7 +81,7 @@ import {
getStepFormInfo,
} from "@/api/fqsq.js";
import { mapGetters } from "vuex"
import { deleteFlow,unClaimTask} from "@/api/ywbl.js";
import { deleteFlow, unClaimTask } from "@/api/ywbl.js";
import ProcessViewer from './components/processViewer.vue'
import { getWorkFlowImage } from "@/api/jsydsyqFlow.js";
import { getForm } from "./flowform.js";
......@@ -143,7 +143,7 @@ export default {
window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
window.addEventListener('unload', e => this.unloadHandler(e))
},
destroyed() {
destroyed () {
window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
window.removeEventListener('unload', e => this.unloadHandler(e))
},
......@@ -151,16 +151,16 @@ export default {
...mapGetters(["oldDetail", "newDetail"])
},
methods: {
beforeunloadHandler() {
beforeunloadHandler () {
this._beforeUnload_time = new Date().getTime()
},
unloadHandler(e) {
unloadHandler (e) {
thsi.$alert("234234");
this._gap_time = new Date().getTime() - this._beforeUnload_time
//判断是窗口关闭还是刷新
if (this._gap_time <= 10) {
//取消认领
unClaimTask(this.bsmSlsq,this.bestepid)
unClaimTask(this.bsmSlsq, this.bestepid)
}
},
changeLoadIndex () {
......@@ -287,12 +287,10 @@ export default {
}
break;
case "B4":
this.$popup("登记簿详情","registerBook/djbFrame",{
this.$popup("登记簿详情", "registerBook/djbFrame", {
formData: this.currentSelectProps,
width: "1220px",
height: "790px",
// cancelText: '取消摆烂', // 右边按钮文本
// confirmText: '确定点击', //左边按钮文本
cancel: () => {
console.log("取消回调");
},
......@@ -302,7 +300,7 @@ export default {
});
break;
case "B5":
this.$popup( "证书预览","workflow/components/zsyl",{
this.$popup("证书预览", "workflow/components/zsyl", {
height: "600px",
width: "800px",
formData: {
......@@ -318,16 +316,9 @@ export default {
})
break;
case "B7":
this.$popup("证书领取", "workflow/components/zslq",{
height: "700px",
formData: {bsmSlsq:this.$route.query.bsmSlsq},
btnShow: true,
cancel: () => {
console.log("取消回调");
},
confirm: () => {
this.submitForm();
},
this.$popup("证书领取", "workflow/components/zslq", {
width: '900px',
formData: { bsmSlsq: this.$route.query.bsmSlsq },
})
break;
case "back": //退回按钮
......@@ -381,7 +372,7 @@ export default {
case "signout":
window.close();
//取消认领
unClaimTask(this.bsmSlsq,this.bestepid)
unClaimTask(this.bsmSlsq, this.bestepid)
break;
case "B9":
var formdata = new FormData();
......