增加新人引导按钮

This commit is contained in:
季圣华
2021-11-04 01:04:23 +08:00
parent 9905063c80
commit 7601fd076f
5 changed files with 36 additions and 6 deletions

View File

@@ -17,8 +17,13 @@
<a-col class="left"> <a-col class="left">
<slot name="title">{{ title }}</slot> <slot name="title">{{ title }}</slot>
</a-col> </a-col>
<a-col v-if="switchFullscreen" class="right" @click="toggleFullscreen"> <a-col class="right">
<a-button class="ant-modal-close ant-modal-close-x" ghost type="link" :icon="fullscreenButtonIcon"/> <a-tooltip title="新手引导">
<a-button v-if="switchHelp" @click="handleHelp" style="right:112px;" class="ant-modal-close ant-modal-close-x"
ghost type="link" icon="question-circle"/>
</a-tooltip>
<a-button v-if="switchFullscreen" @click="toggleFullscreen" class="ant-modal-close ant-modal-close-x"
ghost type="link" :icon="fullscreenButtonIcon"/>
</a-col> </a-col>
</a-row> </a-row>
</template> </template>
@@ -39,6 +44,8 @@
<script> <script>
import { getClass, getStyle } from '@/utils/props-util' import { getClass, getStyle } from '@/utils/props-util'
import { handleIntroJs } from "@/utils/util"
import Vue from 'vue'
export default { export default {
name: 'JModal', name: 'JModal',
@@ -46,11 +53,18 @@
title: String, title: String,
// 可使用 .sync 修饰符 // 可使用 .sync 修饰符
visible: Boolean, visible: Boolean,
// 前缀代号
prefixNo: String,
// 是否全屏弹窗,当全屏时无论如何都会禁止 body 滚动。可使用 .sync 修饰符 // 是否全屏弹窗,当全屏时无论如何都会禁止 body 滚动。可使用 .sync 修饰符
fullscreen: { fullscreen: {
type: Boolean, type: Boolean,
default: false default: false
}, },
// 是否允许展示新手引导(允许后右上角会出现一个按钮)
switchHelp: {
type: Boolean,
default: false
},
// 是否允许切换全屏(允许后右上角会出现一个按钮) // 是否允许切换全屏(允许后右上角会出现一个按钮)
switchFullscreen: { switchFullscreen: {
type: Boolean, type: Boolean,
@@ -148,6 +162,13 @@
this.close() this.close()
}, },
/** 新手引导 */
handleHelp() {
let element = 'intro_cache_' + this.prefixNo
Vue.ls.remove(element)
handleIntroJs(this.prefixNo, 1)
},
/** 切换全屏 */ /** 切换全屏 */
toggleFullscreen() { toggleFullscreen() {
this.innerFullscreen = !this.innerFullscreen this.innerFullscreen = !this.innerFullscreen

View File

@@ -7,6 +7,8 @@
:maskClosable="false" :maskClosable="false"
:keyboard="false" :keyboard="false"
:forceRender="true" :forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen switchFullscreen
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
@@ -60,6 +62,7 @@
:rowNumber="false" :rowNumber="false"
:rowSelection="true" :rowSelection="true"
:actionButton="true" :actionButton="true"
:dragSort="true"
@valueChange="onValueChange" @valueChange="onValueChange"
@added="onAdded" @added="onAdded"
@deleted="onDeleted"> @deleted="onDeleted">
@@ -298,7 +301,7 @@
this.addInit(this.prefixNo) this.addInit(this.prefixNo)
this.fileList = [] this.fileList = []
this.$nextTick(() => { this.$nextTick(() => {
handleIntroJs('purchaseIn', 11) handleIntroJs(this.prefixNo, 1)
}) })
} else { } else {
this.model.operTime = this.model.operTimeStr this.model.operTime = this.model.operTimeStr

View File

@@ -7,6 +7,8 @@
:maskClosable="false" :maskClosable="false"
:keyboard="false" :keyboard="false"
:forceRender="true" :forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen switchFullscreen
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
@@ -198,7 +200,7 @@
this.addInit(this.prefixNo) this.addInit(this.prefixNo)
this.fileList = [] this.fileList = []
this.$nextTick(() => { this.$nextTick(() => {
handleIntroJs('purchaseOrder', 2) handleIntroJs(this.prefixNo, 1)
}) })
} else { } else {
this.model.operTime = this.model.operTimeStr this.model.operTime = this.model.operTimeStr

View File

@@ -7,6 +7,8 @@
:maskClosable="false" :maskClosable="false"
:keyboard="false" :keyboard="false"
:forceRender="true" :forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen switchFullscreen
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
@@ -204,7 +206,7 @@
this.personList.value = '' this.personList.value = ''
this.fileList = [] this.fileList = []
this.$nextTick(() => { this.$nextTick(() => {
handleIntroJs('saleOrder', 2) handleIntroJs(this.prefixNo, 1)
}) })
} else { } else {
this.model.operTime = this.model.operTimeStr this.model.operTime = this.model.operTimeStr

View File

@@ -7,6 +7,8 @@
:maskClosable="false" :maskClosable="false"
:keyboard="false" :keyboard="false"
:forceRender="true" :forceRender="true"
v-bind:prefixNo="prefixNo"
switchHelp
switchFullscreen switchFullscreen
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
@@ -303,7 +305,7 @@
this.personList.value = '' this.personList.value = ''
this.fileList = [] this.fileList = []
this.$nextTick(() => { this.$nextTick(() => {
handleIntroJs('saleOut', 2) handleIntroJs(this.prefixNo, 1)
}) })
} else { } else {
this.model.operTime = this.model.operTimeStr this.model.operTime = this.model.operTimeStr