Showing
3 changed files
with
12 additions
and
3 deletions
| ... | ... | @@ -4,12 +4,12 @@ |
| 4 | 4 | <div style="height: 30px"></div> |
| 5 | 5 | <BasicForm @register="registerForm" /> |
| 6 | 6 | <div class="flex flex-end" style="float: right"> |
| 7 | - <a-button type="primary" @click="handleDeviceState">处理</a-button> | |
| 7 | + <a-button v-if="!isHandler" type="primary" @click="handleDeviceState">处理</a-button> | |
| 8 | 8 | </div> |
| 9 | 9 | </BasicDrawer> |
| 10 | 10 | </template> |
| 11 | 11 | <script lang="ts" setup> |
| 12 | - import { reactive } from 'vue'; | |
| 12 | + import { reactive, ref } from 'vue'; | |
| 13 | 13 | import { BasicForm, useForm } from '/@/components/Form'; |
| 14 | 14 | import { formHandleSchema, formDetailSchema } from './config.data'; |
| 15 | 15 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | obj: {}, |
| 27 | 27 | }); |
| 28 | 28 | |
| 29 | - const [registerForm, { resetFields, getFieldsValue }] = useForm({ | |
| 29 | + const [registerForm, { resetFields, getFieldsValue, setFieldsValue }] = useForm({ | |
| 30 | 30 | schemas: formHandleSchema, |
| 31 | 31 | showActionButtonGroup: false, |
| 32 | 32 | }); |
| ... | ... | @@ -37,11 +37,15 @@ |
| 37 | 37 | layout: 'vertical', |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | + const isHandler = ref(false); | |
| 41 | + | |
| 40 | 42 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
| 41 | 43 | await resetFields(); |
| 42 | 44 | setDrawerProps({ confirmLoading: false }); |
| 43 | 45 | record.obj = data.record; |
| 44 | 46 | setDescProps({ data: data.record }); |
| 47 | + isHandler.value = data?.record?.remark; | |
| 48 | + setFieldsValue(data.record); | |
| 45 | 49 | }); |
| 46 | 50 | |
| 47 | 51 | const handleDeviceState = async () => { | ... | ... |