|
@@ -1,76 +1,77 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <n-modal class="go-modal-card" v-model:show="showModal">
|
|
|
|
|
- <slot name="default">
|
|
|
|
|
- <n-card hoverable size="small">
|
|
|
|
|
- <div class="list-content">
|
|
|
|
|
- <!-- 顶部按钮 -->
|
|
|
|
|
- <n-space class="list-content-top">
|
|
|
|
|
- <AppleControlBtn
|
|
|
|
|
- :narrow="true"
|
|
|
|
|
- :hidden="['close']"
|
|
|
|
|
- @remove="closeHandle"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <!-- mask-closable 暂时是失效的,不知道为啥 -->
|
|
|
|
|
+ <n-modal
|
|
|
|
|
+ class="go-modal-box"
|
|
|
|
|
+ v-model:show="show"
|
|
|
|
|
+ @on-after-leave="closeHandle"
|
|
|
|
|
+ >
|
|
|
|
|
+ <n-card hoverable size="small">
|
|
|
|
|
+ <div class="list-content">
|
|
|
|
|
+ <!-- 标题 -->
|
|
|
|
|
+ <n-space class="list-content-top go-px-0" justify="center">
|
|
|
|
|
+ <n-space>
|
|
|
|
|
+ <n-text>
|
|
|
|
|
+ {{ cardData?.title || '' }}
|
|
|
|
|
+ </n-text>
|
|
|
</n-space>
|
|
</n-space>
|
|
|
- <!-- 中间 -->
|
|
|
|
|
- <div class="list-content-img">
|
|
|
|
|
- <img
|
|
|
|
|
- :src="
|
|
|
|
|
- requireUrl(
|
|
|
|
|
- '../assets/images/project',
|
|
|
|
|
- 'moke-20211219181327.png'
|
|
|
|
|
- )
|
|
|
|
|
- "
|
|
|
|
|
- :alt="cardData?.title"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </n-space>
|
|
|
|
|
+ <!-- 顶部按钮 -->
|
|
|
|
|
+ <n-space class="list-content-top">
|
|
|
|
|
+ <AppleControlBtn
|
|
|
|
|
+ :narrow="true"
|
|
|
|
|
+ :hidden="['close']"
|
|
|
|
|
+ @remove="closeHandle"
|
|
|
|
|
+ />
|
|
|
|
|
+ </n-space>
|
|
|
|
|
+ <!-- 中间 -->
|
|
|
|
|
+ <div class="list-content-img">
|
|
|
|
|
+ <img
|
|
|
|
|
+ :src="
|
|
|
|
|
+ requireUrl('../assets/images/project', 'moke-20211219181327.png')
|
|
|
|
|
+ "
|
|
|
|
|
+ :alt="cardData?.title"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
- <template #action>
|
|
|
|
|
- <n-space class="list-footer" justify="space-between">
|
|
|
|
|
- <n-space>
|
|
|
|
|
- <n-text>
|
|
|
|
|
- {{ cardData?.title || '' }}
|
|
|
|
|
- </n-text>
|
|
|
|
|
- <n-text depth="3">
|
|
|
|
|
- 最后编辑于:
|
|
|
|
|
- <n-time
|
|
|
|
|
- :time="new Date()"
|
|
|
|
|
- format="yyyy-MM-dd hh:mm"
|
|
|
|
|
- />
|
|
|
|
|
- </n-text>
|
|
|
|
|
- </n-space>
|
|
|
|
|
- <!-- 工具 -->
|
|
|
|
|
- <n-space>
|
|
|
|
|
- <n-text>
|
|
|
|
|
- <n-badge
|
|
|
|
|
- class="animation-twinkle"
|
|
|
|
|
- dot
|
|
|
|
|
- :color="cardData?.release ? '#34c749' : '#fcbc40'"
|
|
|
|
|
- />
|
|
|
|
|
- {{ cardData?.release ? '已发布' : '未发布' }}
|
|
|
|
|
- </n-text>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <template #action>
|
|
|
|
|
+ <n-space class="list-footer" justify="space-between">
|
|
|
|
|
+ <n-text depth="3">
|
|
|
|
|
+ 最后编辑于:
|
|
|
|
|
+ <n-time :time="new Date()" format="yyyy-MM-dd hh:mm" />
|
|
|
|
|
+ </n-text>
|
|
|
|
|
+ <!-- 工具 -->
|
|
|
|
|
+ <n-space>
|
|
|
|
|
+ <n-text>
|
|
|
|
|
+ <n-badge
|
|
|
|
|
+ class="animation-twinkle"
|
|
|
|
|
+ dot
|
|
|
|
|
+ :color="cardData?.release ? '#34c749' : '#fcbc40'"
|
|
|
|
|
+ />
|
|
|
|
|
+ {{ cardData?.release ? '已发布' : '未发布' }}
|
|
|
|
|
+ </n-text>
|
|
|
|
|
|
|
|
- <template v-for="item in fnBtnList" :key="item.key">
|
|
|
|
|
- <n-tooltip placement="bottom" trigger="hover">
|
|
|
|
|
- <template #trigger>
|
|
|
|
|
- <n-button size="small">
|
|
|
|
|
- <template #icon>
|
|
|
|
|
- <component :is="item.icon" />
|
|
|
|
|
- </template>
|
|
|
|
|
- </n-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- <span> {{ item.label }}</span>
|
|
|
|
|
- </n-tooltip>
|
|
|
|
|
- </template>
|
|
|
|
|
- </n-space>
|
|
|
|
|
- <!-- end -->
|
|
|
|
|
|
|
+ <template v-for="item in fnBtnList" :key="item.key">
|
|
|
|
|
+ <n-tooltip placement="bottom" trigger="hover">
|
|
|
|
|
+ <template #trigger>
|
|
|
|
|
+ <n-button size="small">
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <component :is="item.icon" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </n-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <span> {{ item.label }}</span>
|
|
|
|
|
+ </n-tooltip>
|
|
|
|
|
+ </template>
|
|
|
</n-space>
|
|
</n-space>
|
|
|
- </template>
|
|
|
|
|
- </n-card>
|
|
|
|
|
- </slot>
|
|
|
|
|
|
|
+ <!-- end -->
|
|
|
|
|
+ </n-space>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </n-card>
|
|
|
</n-modal>
|
|
</n-modal>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
|
+import { watchEffect } from 'vue'
|
|
|
import { renderIcon, requireUrl, requireFallbackImg } from '@/utils'
|
|
import { renderIcon, requireUrl, requireFallbackImg } from '@/utils'
|
|
|
import { icon } from '@/plugins'
|
|
import { icon } from '@/plugins'
|
|
|
import { AppleControlBtn } from '@/components/AppleControlBtn'
|
|
import { AppleControlBtn } from '@/components/AppleControlBtn'
|
|
@@ -79,13 +80,17 @@ const { HammerIcon } = icon.ionicons5
|
|
|
const emit = defineEmits(['close'])
|
|
const emit = defineEmits(['close'])
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
- modalShow: Boolean,
|
|
|
|
|
|
|
+ show: Boolean,
|
|
|
cardData: Object
|
|
cardData: Object
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const handleSelect = (key: string) => {
|
|
|
|
|
- console.log(key)
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// 解决点击模态层不会触发 @on-after-leave 的问题
|
|
|
|
|
+watchEffect(() => {
|
|
|
|
|
+ if (!props.show && props.cardData) {
|
|
|
|
|
+ closeHandle()
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const fnBtnList = [
|
|
const fnBtnList = [
|
|
|
{
|
|
{
|
|
|
label: '编辑',
|
|
label: '编辑',
|
|
@@ -93,8 +98,6 @@ const fnBtnList = [
|
|
|
icon: renderIcon(HammerIcon)
|
|
icon: renderIcon(HammerIcon)
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
-// 放大处理
|
|
|
|
|
-const resizeHandle = () => {}
|
|
|
|
|
|
|
|
|
|
// 关闭对话框
|
|
// 关闭对话框
|
|
|
const closeHandle = () => {
|
|
const closeHandle = () => {
|
|
@@ -105,9 +108,10 @@ const closeHandle = () => {
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
$padding: 30px;
|
|
$padding: 30px;
|
|
|
$contentHeight: calc(80vh);
|
|
$contentHeight: calc(80vh);
|
|
|
-@include go('modal-card') {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- width: 82vw;
|
|
|
|
|
|
|
+$contentWidth: calc(82vw);
|
|
|
|
|
+
|
|
|
|
|
+@include go('modal-box') {
|
|
|
|
|
+ width: $contentWidth;
|
|
|
.list-content {
|
|
.list-content {
|
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
|
border-radius: $--border-radius-base;
|
|
border-radius: $--border-radius-base;
|
|
@@ -116,14 +120,18 @@ $contentHeight: calc(80vh);
|
|
|
@extend .go-point-bg;
|
|
@extend .go-point-bg;
|
|
|
&-top {
|
|
&-top {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- top: 10px;
|
|
|
|
|
- left: 10px;
|
|
|
|
|
|
|
+ top: 7px;
|
|
|
|
|
+ left: 0px;
|
|
|
|
|
+ padding-left: 10px;
|
|
|
height: 22px;
|
|
height: 22px;
|
|
|
|
|
+ width: $contentWidth;
|
|
|
}
|
|
}
|
|
|
&-img {
|
|
&-img {
|
|
|
@extend .go-flex-center;
|
|
@extend .go-flex-center;
|
|
|
img {
|
|
img {
|
|
|
- height: $contentHeight;
|
|
|
|
|
|
|
+ max-height: $contentHeight;
|
|
|
|
|
+ min-height: 200px;
|
|
|
|
|
+ max-width: 100%;
|
|
|
@extend .go-border-radius;
|
|
@extend .go-border-radius;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|