Przeglądaj źródła

fix: 系统设置调整

Tong 2 lat temu
rodzic
commit
f1af001151

+ 6 - 2
src/components/Form/src/components/TextEditor.vue

@@ -3,7 +3,12 @@
 -->
 <template>
   <div v-bind="attrs" button-style="solid" class="text-editor">
-    <WangEditor :modelValue="state" :height="height" @change="handleChange" />
+    <WangEditor
+      :modelValue="state"
+      placeholder="请输入免责声明..."
+      :height="height"
+      @change="handleChange"
+    />
   </div>
 </template>
 <script lang="ts">
@@ -30,7 +35,6 @@
       console.log('🚀 ~ file: TextEditor.vue:30 ~ setup ~ state:', state);
 
       function handleChange(data) {
-        // console.log('data', data);
         emit('change', data);
       }
 

+ 45 - 0
src/views/sys/sysSetting/disclaimerConfig.vue

@@ -0,0 +1,45 @@
+<template>
+  <div class="disclaimerEditor">
+    <div>
+      <TextEditor :height="600" @change="handleChange" />
+    </div>
+    <div class="btn">
+      <a-button @click="handleReset" v-auth="['sys:config:edit']" class="mr-4">重置</a-button>
+      <a-button type="primary" @click="handleSubmit" v-auth="['sys:config:edit']">保存</a-button>
+    </div>
+  </div>
+</template>
+<script lang="ts" setup>
+  import { ref } from 'vue';
+  import TextEditor from '/@/components/Form/src/components/TextEditor.vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+
+  const { createMessage } = useMessage();
+
+  const disclaimerContent = ref();
+  function handleReset() {}
+
+  function handleSubmit() {
+    console.log(disclaimerContent.value);
+    if (!disclaimerContent.value) {
+      createMessage.error('请输入免责声明后提交');
+      return;
+    }
+  }
+
+  function handleChange(val) {
+    console.log(val);
+    disclaimerContent.value = val;
+  }
+</script>
+<style lang="less">
+  .disclaimerEditor {
+    width: 50%;
+    margin-left: 25%;
+  }
+
+  .btn {
+    margin-top: 30px;
+    float: right;
+  }
+</style>

+ 7 - 22
src/views/sys/sysSetting/index.vue

@@ -9,16 +9,17 @@
     <p v-if="noTitleKey === 'sysConfig'">
       <SysConfig />
     </p>
+
+    <p v-if="noTitleKey === 'disclaimerConfig'">
+      <DisclaimerConfig />
+    </p>
   </a-card>
 </template>
 
 <script setup lang="ts">
   import { ref } from 'vue';
   import SysConfig from './sysConfig.vue';
-
-  defineOptions({
-    name: 'SysSeting',
-  });
+  import DisclaimerConfig from './disclaimerConfig.vue';
   const key = ref('sysConfig');
   const noTitleKey = ref('sysConfig');
 
@@ -28,24 +29,8 @@
       tab: '系统配置',
     },
     {
-      key: 'emailConfig',
-      tab: '邮件配置',
-    },
-    {
-      key: 'smsConfig',
-      tab: '短信配置',
-    },
-    {
-      key: 'fileConfig',
-      tab: '文件配置',
-    },
-    {
-      key: 'thirdConfig',
-      tab: '第三方配置',
-    },
-    {
-      key: 'otherConfig',
-      tab: '其他配置',
+      key: 'disclaimerConfig',
+      tab: '免责声明',
     },
   ];