han 2 роки тому
батько
коміт
292ee77836

+ 1 - 1
src/api/biz/archives/patrolWardApi.ts

@@ -14,7 +14,7 @@ enum Api {
 
 /**
  *
- * @author fan
+ * @author  fan
  * @date  2023/06/30 17:39
  * @description: 根据条件查询查房列表,权限 - biz:patrolward:query
  * @method: POST

+ 1 - 1
src/views/biz/visit/check/formModal.vue

@@ -55,7 +55,7 @@
     }
   });
 
-  // 提交按钮事件
+  //提交按钮事件
   async function handleSubmit() {
     try {
       const values = await validate();

+ 1 - 1
src/views/biz/visit/check/index.vue

@@ -93,7 +93,7 @@
   import { useDrawer } from '@/components/Drawer';
 
   // const bizDictOptions = reactive<any>({});
-  // 路由跳转
+  //路由跳转
   // const router = useRouter();
   const activeKey = ref(BasicTabActive);
   const tabData = ref(BasicTab);

+ 37 - 10
src/views/biz/visit/check/viewDrawer.vue

@@ -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>