feat: 更新依赖和增强动态表单功能

- 在 package.json 中添加 hammerjs 和 tui-image-editor 依赖
- 在 DynamicForm.vue 中引入并实现装饰性图片功能,支持图片上传、删除和属性调整
- 优化颜色处理逻辑,支持 RGBA 格式
- 更新常量和类型定义,增强代码可读性和可维护性
This commit is contained in:
2025-04-29 05:31:00 +08:00
parent 0591d0575d
commit 968c34f57a
17 changed files with 1724 additions and 239 deletions

View File

@@ -28,6 +28,7 @@ import {
} from 'naive-ui'
import { computed, onMounted, onUnmounted, ref } from 'vue'
import VueTurnstile from 'vue-turnstile'
import { useRoute } from 'vue-router'
const { biliInfo, userInfo } = defineProps<{
biliInfo: any | undefined
@@ -49,6 +50,7 @@ const isGetting = ref(true) // 是否正在获取数据
// 验证码相关
const token = ref('')
const turnstile = ref()
const route = useRoute()
// 防刷控制
const nextSendQuestionTime = ref(Date.now())
@@ -184,6 +186,11 @@ function getTags() {
})
.finally(() => {
isGetting.value = false
// 检查 URL 参数中的 tag
const tagFromQuery = route.query.tag as string | undefined
if (tagFromQuery && tags.value.includes(tagFromQuery)) {
selectedTag.value = tagFromQuery
}
})
}
@@ -240,6 +247,7 @@ onUnmounted(() => {
class="tag-item"
:bordered="false"
:type="selectedTag === tag ? 'primary' : 'default'"
:clearable="false"
@click="onSelectTag(tag)"
>
{{ tag }}
@@ -495,6 +503,10 @@ onUnmounted(() => {
</template>
<style scoped>
.n-list {
background-color: transparent;
}
.question-box-container {
max-width: 700px;
margin: 0 auto;