refactor(css): 重构样式文件并优化主题样式

- 新增 theme.scss 文件,定义主题颜色- 新增 public.scss 文件,统一公共样式
- 修改 main.scss 文件,引入新的样式文件
-优化容器背景色渐变效果- 调整导航栏样式,增加面包屑导航
-统一问题类型样式,优化选择题样式
This commit is contained in:
陈昱达
2025-03-14 13:42:32 +08:00
parent b46104fa10
commit 10981d439f
15 changed files with 240 additions and 468 deletions

View File

@@ -6,6 +6,11 @@
:class="chooseQuestionId === element.id ? 'choose-question-active' : ''"
@click="chooseItem"
>
<van-cell>
<template #title>
<span class="title"> {{ getQuestionType(element.question_type) }}</span>
</template>
</van-cell>
<slot></slot>
<!-- 题目操作-->
<van-cell v-if="chooseQuestionId === element.id" class="choose-question-active-container">
@@ -36,6 +41,8 @@
import QuestionAction from '@/views/Design/components/ActionCompoents/QuestionAction.vue';
import { ref } from 'vue';
import { basicQuesTypeList } from '@/utils/common.js';
const props = defineProps({
element: {
type: Object,
@@ -60,6 +67,18 @@ const props = defineProps({
default: true
}
});
// 获取题目选项
const getQuestionType = (type) => {
let typeName = null;
basicQuesTypeList.map((item) => {
if (Number(item.question_type) === Number(type)) {
typeName = item.name;
}
});
return typeName;
};
const element = ref(props.element);
// 选中题目后出现的操作
@@ -72,12 +91,35 @@ const chooseItem = () => {
};
</script>
<style scoped lang="scss">
@import '@/assets/css/theme';
.choose-question-container {
padding: 5px;
padding: 12px;
& .choose-question-context {
overflow: hidden;
border-radius: 5px;
padding: 10px;
border-radius: 8px;
background: #fff;
& .title {
position: relative;
font-weight: 700;
font-size: 14px;
&::after {
content: ' ';
position: absolute;
//padding: 0 5px;
bottom: -4px;
left: -1px;
width: 100%;
height: 7px;
border-radius: 5px;
background: linear-gradient(to right, $theme-color 10%, #f2f2f2 100%);
}
}
}
& .choose-question-active {