commit
72f1a8be9a
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,104 @@
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { getToolsCount } from '@/api/home/main'
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
label: {
|
||||
type: String,
|
||||
default: 'xxx',
|
||||
},
|
||||
})
|
||||
const emit = defineEmits<{
|
||||
(e: 'tishiok')
|
||||
(e: 'reject', params: any)
|
||||
(e: 'viewrepeat')
|
||||
}>()
|
||||
|
||||
const showx = ref(false)
|
||||
const label=ref(props.label)
|
||||
const toolsData = ref({} as any)
|
||||
|
||||
async function getData() {
|
||||
const res = await getToolsCount()
|
||||
toolsData.value = res.data || {}
|
||||
if (res.code == 'OK')
|
||||
showModalx()
|
||||
}
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
|
||||
function showModalx() {
|
||||
showx.value = true
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
showx.value = false
|
||||
}
|
||||
function onok(){
|
||||
emit('tishiok')
|
||||
}
|
||||
async function reject() {
|
||||
emit('reject', { a: 'todo' })
|
||||
closeModal()
|
||||
}
|
||||
|
||||
async function viewRepeat(e: MouseEvent) {
|
||||
emit('viewrepeat')
|
||||
e.preventDefault()
|
||||
closeModal()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
showModalx,
|
||||
closeModal,
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-modal v-model:show="showx" transform-origin="center" class="modal_wrap">
|
||||
<div>
|
||||
<div class="title"> <SvgIcon size="21" class="icon" style="margin-right:17.5px" name="warn" @click="closeModal" />确认提示</div>
|
||||
<div class="content">{{label}}</div>
|
||||
<div class="footer">
|
||||
<n-button style="background: #507afd;width: 60px;
|
||||
height: 36px;" type="info" @click="onok">
|
||||
确定
|
||||
</n-button>
|
||||
<n-button secondary class="btn" style="margin-left: 15px;width: 60px;
|
||||
height: 36px;" @click="closeModal">
|
||||
取消
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</n-modal>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.modal_wrap{
|
||||
width: 424px;
|
||||
height: 192px;
|
||||
background: #ffffff;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.title{
|
||||
color: #333333;
|
||||
line-height: 24px;
|
||||
font-size: 16px;
|
||||
font-weight: 550;
|
||||
margin-top: 33.5px;
|
||||
margin-left: 33.5px;
|
||||
}
|
||||
.content{
|
||||
font-size: 14px;
|
||||
color: #666666;
|
||||
margin-top: 12px;
|
||||
margin-left: 72px;
|
||||
}
|
||||
.footer{
|
||||
position: absolute;
|
||||
bottom: 24px;
|
||||
right: 32px;
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue