8 changed files with 133 additions and 17 deletions
-
2src/apis/crafts.ts
-
1src/apis/system.ts
-
12src/components/home/Receive/index.vue
-
64src/components/system/Delay/index.vue
-
38src/layouts/default.vue
-
2src/types/log.d.ts
-
23src/views/home/index.vue
-
8src/views/setting/index.vue
@ -0,0 +1,64 @@ |
|||||
|
<script setup lang="ts"> |
||||
|
import { editSols, saveSols } from 'apis/solution' |
||||
|
import { sync } from 'apis/system' |
||||
|
import { FtMessage } from 'libs/message' |
||||
|
import { inject, ref } from 'vue' |
||||
|
|
||||
|
const emits = defineEmits(['ok', 'cancel']) |
||||
|
|
||||
|
const form = ref({ delay: 1 }) |
||||
|
const formRef = ref() |
||||
|
|
||||
|
const rules = { |
||||
|
delay: [ |
||||
|
{ required: true, message: '请选择间隔时间', trigger: 'change' }, |
||||
|
], |
||||
|
} |
||||
|
|
||||
|
const okHandle = async () => { |
||||
|
try { |
||||
|
const valid = await formRef.value.validate() |
||||
|
if (!valid) { |
||||
|
return |
||||
|
} |
||||
|
await sync(form.value) |
||||
|
FtMessage.success('保存成功') |
||||
|
emits('ok') |
||||
|
} |
||||
|
catch (error) { |
||||
|
console.log(error) |
||||
|
} |
||||
|
} |
||||
|
const cancel = () => { |
||||
|
emits('cancel') |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<template lang="pug"> |
||||
|
FtDialog(visible title="修改间隔时间" width="30%" :ok-handle="okHandle" @cancel="cancel") |
||||
|
el-form(ref="formRef" label-width="auto" :model="form" :rules="rules") |
||||
|
el-form-item(label="间隔时间" prop="delay") |
||||
|
div.form-item_content |
||||
|
el-select(v-model="form.delay" placeholder="请选择间隔时间" style="width: 100%") |
||||
|
el-option(v-for="item in 30" :key="item" :label="item" :value="item") |
||||
|
p 秒 |
||||
|
</template> |
||||
|
|
||||
|
<style lang="stylus" scoped> |
||||
|
.el-form-item |
||||
|
align-items center |
||||
|
.form-item_content |
||||
|
width 100% |
||||
|
display flex |
||||
|
align-items center |
||||
|
p |
||||
|
padding 0 10px |
||||
|
height 32px |
||||
|
line-height 32px |
||||
|
border 1px solid #dcdfe6 |
||||
|
background-color #F5F7FA |
||||
|
border-left none |
||||
|
border-radius 0 4px 4px 0 |
||||
|
:deep(.el-select__wrapper) |
||||
|
border-radius 4px 0 0 4px |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue