|
|
@@ -1,13 +1,26 @@
|
|
|
<template>
|
|
|
- <BasicDrawer
|
|
|
- v-bind="$attrs"
|
|
|
- destroyOnClose
|
|
|
- @register="registerDrawer"
|
|
|
- :title="getTitle"
|
|
|
- :width="width"
|
|
|
- >
|
|
|
- <Description @register="registerDesc" :data="descData" />
|
|
|
- </BasicDrawer>
|
|
|
+ <div>
|
|
|
+ <BasicDrawer
|
|
|
+ v-bind="$attrs"
|
|
|
+ destroyOnClose
|
|
|
+ @register="registerDrawer"
|
|
|
+ :title="getTitle"
|
|
|
+ :width="width"
|
|
|
+ >
|
|
|
+ <Description @register="registerDesc" :data="descData" />
|
|
|
+ </BasicDrawer>
|
|
|
+ <template>
|
|
|
+ <Button
|
|
|
+ v-auth="['storage:config:add']"
|
|
|
+ type="primary"
|
|
|
+ @click="handleCreate"
|
|
|
+ preIcon="icon-plus|iconfont"
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </Button>
|
|
|
+ </template>
|
|
|
+ <FormModal @register="registerModal" @success="handleSuccess" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { onBeforeMount, ref } from 'vue'; // onBeforeMount,
|
|
|
@@ -17,16 +30,25 @@
|
|
|
|
|
|
import { archivesPatrolWardDetail } from '/@/api/biz/archives/patrolWardApi';
|
|
|
import { listDictModel } from '/@/api/common';
|
|
|
+ import FormModal from './formModal.vue';
|
|
|
import { formatDictValue } from '/@/utils';
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
|
|
|
|
const descData = ref({});
|
|
|
const getTitle = '查看查房记录';
|
|
|
const width = '45%';
|
|
|
+ const [registerModal, { openModal }] = useModal();
|
|
|
|
|
|
const typeOptions = ref();
|
|
|
onBeforeMount(async () => {
|
|
|
typeOptions.value = await listDictModel({ dictCode: 'sys_login_log_type' });
|
|
|
});
|
|
|
+ // 新增按钮事件
|
|
|
+ function handleCreate() {
|
|
|
+ openModal(true, {
|
|
|
+ isUpdate: false,
|
|
|
+ });
|
|
|
+ }
|
|
|
const [registerDrawer] = useDrawerInner(async data => {
|
|
|
console.log('::::::::::', data.record);
|
|
|
const resData = await archivesPatrolWardDetail(data.record.id);
|
|
|
@@ -37,10 +59,15 @@
|
|
|
});
|
|
|
const [registerDesc] = useDescription({
|
|
|
schema: viewSchema,
|
|
|
- column: 2,
|
|
|
+ column: 1,
|
|
|
size: 'middle',
|
|
|
labelStyle: {
|
|
|
width: '120px',
|
|
|
},
|
|
|
});
|
|
|
+ // 弹窗回调事件
|
|
|
+ async function handleSuccess({ isUpdate, values }) {
|
|
|
+ console.log(isUpdate);
|
|
|
+ console.log(values);
|
|
|
+ }
|
|
|
</script>
|