This commit is contained in:
zoujing
2026-01-05 18:14:52 +08:00
5 changed files with 180 additions and 16 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>

View File

@@ -2,17 +2,153 @@
* @Author: kongbeiwu lishaohua-520@qq.com
* @Date: 2025-12-22 01:11:57
* @LastEditors: kongbeiwu lishaohua-520@qq.com
* @LastEditTime: 2025-12-22 01:24:19
* @LastEditTime: 2026-01-04 17:01:44
* @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
-->
<template>
<div>房型管理22</div>
<div class="mt-[10px]">
<div>
<el-input v-model="input1" style="width: 240px" size="large" placeholder="请输入" :prefix-icon="Search" />
<el-button type="primary" class="ml-[20px]" size="large">搜索</el-button>
</div>
<div class="zn-table mt-[20px]">
<el-table :data="tableData" class="zn-table" style="width: 100%">
<el-table-column prop="pms" label="PMS" align="center" />
<el-table-column prop="xc" label="携程" align="center">
<template #default="scope">
<el-tag v-for="(tag, index) in scope.row.xc" :key="index" type="info" closable :disable-transitions="false"
@close="handleClose(scope.$index, index, 'xc')" class="mb-[10px] mr-[8px]">
{{ tag }}
</el-tag>
<div>
<el-input v-if="tableIndex === scope.$index + 'xc'" ref="InputRef" v-model="inputValue" class="w-20" size="small"
@keyup.enter="handleInputConfirm(scope.$index, 'xc')" @blur="handleInputConfirm(scope.$index, 'xc')" />
<el-button v-else class="button-new-tag" size="small" @click="showInput(scope.$index, 'xc')" :icon="Plus" />
</div>
</template>
</el-table-column>
<el-table-column prop="fz" label="飞猪" align="center">
<template #default="scope">
<el-tag v-for="(tag, index) in scope.row.fz" :key="index" type="info" closable :disable-transitions="false"
@close="handleClose(scope.$index, index, 'fz')" class="mb-[10px] mr-[8px]">
{{ tag }}
</el-tag>
<div>
<el-input v-if="tableIndex === scope.$index + 'fz'" ref="InputRef" v-model="inputValue" class="w-20" size="small"
@keyup.enter="handleInputConfirm(scope.$index, 'fz')" @blur="handleInputConfirm(scope.$index, 'fz')" />
<el-button v-else class="button-new-tag" size="small" @click="showInput(scope.$index, 'fz')" :icon="Plus" />
</div>
</template>
</el-table-column>
<el-table-column prop="qne" label="去哪儿" align="center">
<template #default="scope">
<el-tag v-for="(tag, index) in scope.row.qne" :key="index" type="info" closable :disable-transitions="false"
@close="handleClose(scope.$index, index, 'qne')" class="mb-[10px] mr-[8px]">
{{ tag }}
</el-tag>
<div>
<el-input v-if="tableIndex === scope.$index + 'qne'" ref="InputRef" v-model="inputValue" class="w-20" size="small"
@keyup.enter="handleInputConfirm(scope.$index, 'qne')" @blur="handleInputConfirm(scope.$index, 'qne')" />
<el-button v-else class="button-new-tag" size="small" @click="showInput(scope.$index, 'qne')" :icon="Plus" />
</div>
</template>
</el-table-column>
<el-table-column prop="dy" label="抖音" align="center">
<template #default="scope">
<el-tag v-for="(tag, index) in scope.row.dy" :key="index" type="info" closable :disable-transitions="false"
@close="handleClose(scope.$index, index, 'dy')" class="mb-[10px] mr-[8px]">
{{ tag }}
</el-tag>
<div>
<el-input v-if="tableIndex === scope.$index + 'dy'" ref="InputRef" v-model="inputValue" class="w-20" size="small"
@keyup.enter="handleInputConfirm(scope.$index, 'dy')" @blur="handleInputConfirm(scope.$index, 'dy')" />
<el-button v-else class="button-new-tag" size="small" @click="showInput(scope.$index, 'dy')" :icon="Plus" />
</div>
</template>
</el-table-column>
<el-table-column prop="mt" label="美团" align="center">
<template #default="scope">
<el-tag v-for="(tag, index) in scope.row.mt" :key="index" type="info" closable :disable-transitions="false"
@close="handleClose(scope.$index, index, 'mt')" class="mb-[10px] mr-[8px]">
{{ tag }}
</el-tag>
<div>
<el-input v-if="tableIndex === scope.$index + 'mt'" ref="InputRef" v-model="inputValue" class="w-20" size="small"
@keyup.enter="handleInputConfirm(scope.$index, 'mt')" @blur="handleInputConfirm(scope.$index, 'mt')" />
<el-button v-else class="button-new-tag" size="small" @click="showInput(scope.$index, 'mt')" :icon="Plus" />
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, nextTick } from 'vue';
import { Search, Plus } from '@element-plus/icons-vue';
import type { InputInstance } from 'element-plus';
const input1 = ref('');
type TableData = {
pms: string
xc: string[]
fz: string[]
qne: string[]
dy: string[]
mt: string[]
}
const tableData: TableData[] = ref([
{
pms: '大床房',
xc: ['雅致大床房', '标准间'],
mt: ['雅致大床房'],
fz: ['雅致大床房'],
qne: ['雅致大床房'],
dy: ['雅致大床房'],
},
{
pms: '标准间',
xc: ['雅致大床房'],
mt: ['雅致大床房'],
fz: ['雅致大床房'],
qne: ['雅致大床房'],
dy: ['雅致大床房'],
},
]);
const inputValue = ref('');
const InputRef = ref<InputInstance>()
const handleClose = (row: number, index: number, key: string) => {
tableData.value[row][key].splice(index, 1);
};
const tableIndex = ref('');
const showInput = (index: any, key: string) => {
tableIndex.value = index + key;
nextTick(() => {
InputRef.value!.input!.focus();
});
};
const handleInputConfirm = (index: number, key: string) => {
if (inputValue.value) {
tableData.value[index][key].push(inputValue.value);
}
tableIndex.value = '';
inputValue.value = '';
};
</script>
<style lang="less" scoped>
<style scoped>
:deep(.el-table tr td:nth-of-type(1)) {
background: #EFF6FF !important;
}
:deep(.el-tag) {
background: #FFFFFF!important;
border-radius: 6px!important;
border: 1px solid #E5E8EE!important;
color: #525866;
}
</style>