feat: 优化事件管理

This commit is contained in:
kongbeiwu
2026-01-04 10:47:17 +08:00
parent 4b46484cfe
commit b4b183ded2
4 changed files with 41 additions and 13 deletions

View File

@@ -2,12 +2,12 @@
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-21 23:02:06
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-30 01:19:20
* @LastEditTime: 2026-01-04 10:35:46
* @FilePath: /project/zn-ai/src/renderer/components/TitleSection/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="flex box-border border-b-[1px] border-b-[#E5E8EE] mb-[20px] pb-[20px]">
<div class="flex justify-between items-center box-border border-b-[1px] border-b-[#E5E8EE] mb-[20px] pb-[20px]">
<div class="flex">
<div class="flex items-center">
<el-icon v-if="attrs.onBackTo" @click="emits('back-to', true)" size="18px" color="#525866" class="mr-[15px] cursor-pointer">

View File

@@ -2,7 +2,7 @@
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-30 12:08:51
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2026-01-04 00:25:43
* @LastEditTime: 2026-01-04 10:30:54
* @FilePath: /project/zn-ai/src/renderer/views/knowledge/components/EventManager/addDialog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -63,7 +63,7 @@
import { UploadFilled } from '@element-plus/icons-vue';
import { RiMagicFill, RiDeleteBinLine } from '@remixicon/vue';
import { ElMessage } from 'element-plus'
import { ref, defineModel } from 'vue';
import { ref, defineModel, onMounted, watch } from 'vue';
const model = defineModel({ type: Boolean, default: false })
defineProps({
@@ -71,7 +71,14 @@ defineProps({
data: { type: Object, default: {} },
})
const activeIndex = ref(1);
// 监听 model 的变化
watch(model, (newVal, oldVal) => {
if (newVal) {
activeIndex.value = 0;
}
})
const activeIndex = ref(0);
// const dialogVisible = ref(false);
const handleClose = (done: () => void) => {
done();
@@ -93,9 +100,9 @@ const submitForm = async () => {
}
// 上传成功
const upSuccess = () => {
if (activeIndex.value === 1) {
activeIndex.value = 2;
} if (activeIndex.value === 2) {
if (activeIndex.value === 0) {
activeIndex.value = 1;
} else if (activeIndex.value === 1) {
model.value = false;
ElMessage({
message: '图片上传成功',
@@ -103,6 +110,8 @@ const upSuccess = () => {
})
}
}
onMounted(() => {
});
</script>
<style scoped>
:deep(.el-steps--simple) {
@@ -119,7 +128,7 @@ const upSuccess = () => {
background: #525866;
}
:deep(.el-step__icon.is-text) {
:deep(.el-step__head.is-process .el-step__icon.is-text) {
border-color: #2B7FFF;
}
:deep(.el-step__head.is-success) {

View File

@@ -2,7 +2,7 @@
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-22 01:11:57
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2026-01-03 22:09:31
* @LastEditTime: 2026-01-04 10:43:47
* @FilePath: /project/zn-ai/src/renderer/views/knowledge/components/EventManagement/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -84,5 +84,7 @@ const uploadImageChange = (row) => {
box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 1px rgba(255, 255, 255, 0.24);
border-radius: 8px 8px 8px 8px;
border: 1px solid #1447E6;
padding-top: 18px;
padding-bottom: 18px;
}
</style>

View File

@@ -2,13 +2,17 @@
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-29 13:45:28
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-30 11:58:46
* @LastEditTime: 2026-01-04 10:43:09
* @FilePath: /project/zn-ai/src/renderer/views/knowledge/page.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="bg-white box-border w-full h-full p-[20px]">
<TitleSection @back-to="handleBack" :title="data.date" :desc="data.name" />
<TitleSection @back-to="handleBack" :title="data.date" :desc="data.name">
<template #right>
<el-button class="button" type="primary" :icon="Plus" @click="dialogVisible = true">添加事件</el-button>
</template>
</TitleSection>
<div class="flex flex-wrap items-center">
<div v-for="item in 10" class="rounded-[12px] border border-[#E5E8EE] event-pic-item">
<img src="@assets/images/task/xc.png" />
@@ -39,14 +43,17 @@
</div>
</div>
</div>
<!-- 添加事件弹窗 -->
<UploadImage v-model="dialogVisible" />
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { ElMessage } from 'element-plus';
import { DocumentCopy } from '@element-plus/icons-vue';
import { DocumentCopy, Plus } from '@element-plus/icons-vue';
import { RiInformationLine, RiEditLine, RiDeleteBinLine } from '@remixicon/vue';
import TitleSection from '@renderer/components/TitleSection/index.vue';
import UploadImage from '../../components/EventManager/UploadImage.vue';
interface Props {
data: object;
@@ -55,6 +62,8 @@ const props = defineProps<Props>();
const emits = defineEmits(["update:change"]);
const dialogVisible = ref(false);
// 复制文本
const copyText = async (text) => {
try {
@@ -87,4 +96,12 @@ const handleBack = (val) => {
.event-pic-item:nth-child(4n) {
margin-right: 0;
}
:deep(.el-button.button) {
background: linear-gradient(180deg, #4A8FF9 0%, rgba(0, 0, 0, 0) 100%), #2B7FFF;
box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 1px rgba(255, 255, 255, 0.24);
border-radius: 8px 8px 8px 8px;
border: 1px solid #1447E6;
padding-top: 18px;
padding-bottom: 18px;
}
</style>