| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <template>
- <com-head :options="[{ name: '系统设置', value: '2' }]" notContent> </com-head>
- <div class="body-layer" style="padding: 24px" v-loading="loading">
- <el-form :model="form" label-width="auto" style="max-width: 600px">
- <el-form-item label="系统标题">
- <el-input
- v-model="form.name"
- placeholder="请输入系统标题"
- :maxlength="100"
- show-word-limit
- />
- </el-form-item>
- <el-form-item label="系统主题色">
- <el-radio-group v-model="form.color">
- <el-radio :label="color" size="large" v-for="color in themeColors">
- <span class="radio-box" :style="{ 'background-color': '#' + color }"></span>
- </el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="onSubmit">提交</el-button>
- </el-form-item>
- </el-form>
- </div>
- </template>
- <script setup lang="ts">
- import comHead from "@/components/head/index.vue";
- import { setTheme, setTitle, systemData, themeColors } from "@/setSystem";
- import { reactive, ref } from "vue";
- // do not use same name with ref
- const form = reactive({
- ...systemData.value,
- });
- const loading = ref(false);
- const onSubmit = async () => {
- loading.value = true;
- await setTheme(form.color);
- await setTitle(form.name);
- loading.value = false;
- };
- </script>
- <style lang="scss" scoped>
- .radio-box {
- display: inline-block;
- width: 20px;
- height: 20px;
- vertical-align: middle;
- }
- </style>
|