feat(cms): 新增网站密钥和字段加密功能- 在 CMS 网站模型中新增 websiteSecret 字段用于存储小程序密钥

- 为 CMS 网站字段添加 encrypted 字段以支持内容加密- 实现字段值的加密和解密功能,提升数据安全性- 更新网站编辑组件以支持密钥的输入和存储- 调整字段编辑组件,增加加密开关和类型选项
-优化字段列表展示逻辑,支持加密字段的特殊处理- 修改字段值类型为 any以适应多种数据格式
- 完善字段编辑表单验证规则和保存逻辑
- 更新相关组件的类型定义和事件处理- 调整界面布局和交互细节,提升用户体验
This commit is contained in:
2025-09-30 17:25:23 +08:00
parent cdb90cb60f
commit db143a73d6
15 changed files with 1528 additions and 300 deletions

View File

@@ -8,7 +8,9 @@
:placeholder="placeholder"
/>
<a-button @click="openEdit">
<template #icon><BulbOutlined class="ele-text-warning" /></template>
<template #icon>
<BulbOutlined class="ele-text-warning"/>
</template>
</a-button>
</a-input-group>
<!-- 选择弹窗 -->
@@ -23,40 +25,40 @@
</template>
<script lang="ts" setup>
import { BulbOutlined } from '@ant-design/icons-vue';
import { ref } from 'vue';
import SelectData from './components/select-data.vue';
import { Company } from '@/api/system/company/model';
import {BulbOutlined} from '@ant-design/icons-vue';
import {ref} from 'vue';
import SelectData from './components/select-data.vue';
import {CmsWebsiteField} from "@/api/cms/cmsWebsiteField/model";
const props = withDefaults(
defineProps<{
value?: any;
customerType?: string;
placeholder?: string;
}>(),
{
placeholder: '请选择数据'
}
);
defineProps<{
value?: any;
customerType?: string;
placeholder?: string;
}>(),
{
placeholder: '请选择数据'
}
);
const emit = defineEmits<{
(e: 'done', Customer): void;
(e: 'clear'): void;
}>();
const emit = defineEmits<{
(e: 'done', data: CmsWebsiteField): void;
(e: 'clear'): void;
}>();
// 是否显示编辑弹窗
const showEdit = ref(false);
// 当前编辑数据
const current = ref<Company | null>(null);
const content = ref<any>(props.value)
// 是否显示编辑弹窗
const showEdit = ref(false);
// 当前编辑数据
const current = ref<CmsWebsiteField | null>(null);
const content = ref<any>(props.value)
/* 打开编辑弹窗 */
const openEdit = (row?: Company) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开编辑弹窗 */
const openEdit = (row?: CmsWebsiteField) => {
current.value = row ?? null;
showEdit.value = true;
};
const onChange = () => {
emit('done', content.value);
};
const onChange = (item: CmsWebsiteField) => {
emit('done', item);
};
</script>