|
|
@@ -0,0 +1,55 @@
|
|
|
+<!-- 系统设置 -->
|
|
|
+<template>
|
|
|
+ <app-drawer title="设置" width="400" v-model:show="show">
|
|
|
+ <el-form ref="formRef" class="el-form--vertical" label-width="80px" :model="formData">
|
|
|
+ <el-form-item prop="orderFocusType" label="订单焦点">
|
|
|
+ <el-select placeholder="请选择" v-model="formData.orderFocusType">
|
|
|
+ <el-option label="价格" :value="1" />
|
|
|
+ <el-option label="数量" :value="2" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="orderFocusType" label="价格类型">
|
|
|
+ <el-select placeholder="请选择" v-model="formData.orderPriceType">
|
|
|
+ <el-option label="现价" :value="1" />
|
|
|
+ <el-option label="对手价" :value="2" />
|
|
|
+ <el-option label="实时价" :value="3" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <el-button type="info" @click="resetSettings">恢复默认</el-button>
|
|
|
+ <el-button type="primary" @click="updateSettings">保存设置</el-button>
|
|
|
+ </template>
|
|
|
+ </app-drawer>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { ref } from 'vue'
|
|
|
+import { ElMessageBox, FormInstance } from 'element-plus'
|
|
|
+import { useSettingStore } from '@/stores'
|
|
|
+import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
+
|
|
|
+const settingStore = useSettingStore()
|
|
|
+const formRef = ref<FormInstance>()
|
|
|
+const show = ref(true)
|
|
|
+const formData = ref({ ...settingStore.userSetting })
|
|
|
+
|
|
|
+const onCancel = () => {
|
|
|
+ show.value = false
|
|
|
+}
|
|
|
+
|
|
|
+const updateSettings = () => {
|
|
|
+ settingStore.updateSettings(formData.value)
|
|
|
+ onCancel()
|
|
|
+}
|
|
|
+
|
|
|
+const resetSettings = () => {
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '是否恢复到默认设置?',
|
|
|
+ '提示'
|
|
|
+ ).then(() => {
|
|
|
+ settingStore.resetSettings()
|
|
|
+ onCancel()
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|