mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2026-01-15 02:57:09 +08:00
refactor: 优化部分代码
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { addDictItem, getDictItem, updateDictItem } from '@/apis/system/dict'
|
||||
import { type Columns, GiForm, type Options } from '@/components/GiForm'
|
||||
import { useForm } from '@/hooks'
|
||||
@@ -31,6 +32,8 @@ const emit = defineEmits<{
|
||||
(e: 'save-success'): void
|
||||
}>()
|
||||
|
||||
const { width } = useWindowSize()
|
||||
|
||||
const dataId = ref('')
|
||||
const dictId = ref('')
|
||||
const visible = ref(false)
|
||||
@@ -43,6 +46,12 @@ const options: Options = {
|
||||
btns: { hide: true },
|
||||
}
|
||||
|
||||
const { form, resetForm } = useForm({
|
||||
color: 'blue',
|
||||
sort: 999,
|
||||
status: 1,
|
||||
})
|
||||
|
||||
const columns: Columns = reactive([
|
||||
{ label: '标签', field: 'label', type: 'input', rules: [{ required: true, message: '请输入标签' }] },
|
||||
{ label: '值', field: 'value', type: 'input', rules: [{ required: true, message: '请输入值' }] },
|
||||
@@ -79,12 +88,6 @@ const columns: Columns = reactive([
|
||||
},
|
||||
])
|
||||
|
||||
const { form, resetForm } = useForm({
|
||||
color: 'blue',
|
||||
sort: 999,
|
||||
status: 1,
|
||||
})
|
||||
|
||||
// 重置
|
||||
const reset = () => {
|
||||
formRef.value?.formRef?.resetFields()
|
||||
|
||||
Reference in New Issue
Block a user