Forráskód Böngészése

fix(airobot): 修改config配置,增加base

hongk 1 hete
szülő
commit
334088c23f

+ 6 - 0
package/packages/AIRobot/CHANGELOG.md

@@ -1,5 +1,11 @@
 # @component-lib/ai-robot
 
+## 1.0.1
+
+### Patch Changes
+
+- config 配置 base
+
 ## 1.0.3
 
 ### Patch Changes

+ 2 - 1
package/packages/AIRobot/README.md

@@ -9,7 +9,7 @@
 > 本地npm仓库 verdaccio+docker搭建
 
 ```
-npm install ai-robot
+npm install @component-lib/ai-robot
 ```
 
 2. 在需要展示ai管家的地方引入并使用:
@@ -67,3 +67,4 @@ AIRobotRef.value.handleResponse({ text: '回答内容' })
 ### 相关模块
 
 1. 支持语音转写,采用讯飞平台相关功能
+2. 相关依赖:`crypto-js`项目需要安装此依赖

BIN
package/packages/AIRobot/img/layout/ai-figure-base.png


+ 1 - 1
package/packages/AIRobot/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@component-lib/ai-robot",
-  "version": "1.0.0",
+  "version": "1.0.1",
   "description": "一款智能问答机器人模块",
   "author": "hongkai",
   "main": "dist/index.es.js",

+ 1 - 0
package/packages/AIRobot/vite.config.js

@@ -3,6 +3,7 @@ import vue from '@vitejs/plugin-vue';
 import VitePluginStyleInject from 'vite-plugin-style-inject';
 
 export default defineConfig({
+    base: './',
     plugins: [
         vue(), // 添加 Vue 插件
         VitePluginStyleInject() // 添加样式注入插件

+ 0 - 193
page/src/views/CurdPageTemplate/Page.vue

@@ -1,193 +0,0 @@
-<script setup lang="tsx">
-import { ContentWrap } from '@common/src/components/ContentWrap'
-import { Search } from '@common/src/components/Search'
-import { Table, TableColumn } from '@common/src/components/Table'
-import { BaseButton } from '@common/src/components/Button'
-import { useTable } from '@common/src/hooks/web/useTable'
-import { FormSchema } from '@common/src/components/Form'
-import { ref, unref, reactive } from 'vue'
-import { list, del } from '@/api/xxx'
-import { useRouter } from 'vue-router'
-
-const { push } = useRouter()
-
-const props = defineProps({
-  tabName: {
-    type: String,
-    default: '1'
-  }
-})
-
-const { tableRegister, tableState, tableMethods } = useTable({
-  fetchDataApi: async () => {
-    const { currentPage, pageSize } = tableState
-    const res = await list({
-      current: unref(currentPage),
-      size: unref(pageSize),
-      ...unref(searchParams)
-    })
-    return {
-      list: res.data.list,
-      total: res.data.totalCount
-    }
-  }
-})
-const { loading, dataList, total, currentPage, pageSize } = tableState
-const { getList } = tableMethods
-
-interface ISearch {
-  caseId?: string
-  userName?: string
-  createTimeStart?: string
-  createTimeEnd?: string
-}
-const searchParams = ref<ISearch>({})
-const setSearchParams = (params: any) => {
-  searchParams.value = params
-  if (params.time) {
-    searchParams.value.createTimeStart = params.time[0]
-    searchParams.value.createTimeEnd = params.time[1]
-  }
-  getList()
-}
-const searchSchema = reactive<FormSchema[]>([
-  {
-    field: 'caseId',
-    label: '病例ID',
-    component: 'Input',
-    componentProps: {
-      placeholder: '请输入'
-    }
-  },
-  {
-    field: 'userName',
-    label: '对象名称',
-    component: 'Input',
-    componentProps: {
-      placeholder: '请输入'
-    }
-  },
-  {
-    field: 'time',
-    component: 'DatePicker',
-    label: '创建时间段',
-    componentProps: {
-      type: 'datetimerange',
-      ...window.dateRangeProps
-    }
-  }
-])
-const tableColumns = reactive<TableColumn[]>([
-  {
-    field: 'index',
-    label: '序号',
-    type: 'index'
-  },
-  {
-    field: 'caseId',
-    label: '病例ID'
-  },
-  {
-    field: 'userName',
-    label: '对象名称'
-  },
-  {
-    field: 'taskNo',
-    label: '关联事件编号'
-  },
-  {
-    field: 'createTime',
-    label: '创建时间'
-  },
-  {
-    field: 'action',
-    width: '220px',
-    label: '操作',
-    slots: {
-      default: (data: any) => {
-        return (
-          <>
-            <BaseButton size="small" type="primary" onClick={() => action(data.row, 'detail')}>
-              查看详情
-            </BaseButton>
-            <BaseButton size="small" type="primary" onClick={() => action(data.row, 'edit')}>
-              编辑
-            </BaseButton>
-            <BaseButton size="small" type="danger" onClick={() => delData(data.row)}>
-              删除
-            </BaseButton>
-          </>
-        )
-      }
-    }
-  }
-])
-
-const actionType = ref('')
-
-const AddAction = () => {
-  actionType.value = 'add'
-  push({
-    path: '/survey-case-manage/write',
-    query: {
-      actionType: 'add',
-      tabName: props.tabName
-    }
-  })
-}
-
-const delData = async (row) => {
-  ElMessageBox.confirm('确认删除?', '提示', {
-    confirmButtonText: '确认',
-    cancelButtonText: '取消',
-    type: 'warning'
-  }).then(async () => {
-    await del({
-      caseId: row?.caseId
-    })
-    getList()
-  })
-}
-
-const action = (row, type: string) => {
-  actionType.value = type
-  if (type === 'edit') {
-    push({
-      path: '/survey-case-manage/write',
-      query: {
-        actionType: 'edit',
-        caseId: row?.caseId
-      }
-    })
-  } else {
-    push({
-      path: '/survey-case-manage/detail',
-      query: {
-        caseId: row?.caseId
-      }
-    })
-  }
-}
-</script>
-
-<template>
-  <ContentWrap>
-    <Search :schema="searchSchema" @search="setSearchParams" @reset="setSearchParams" />
-
-    <div class="mb-10px">
-      <BaseButton type="primary" @click="AddAction">新增</BaseButton>
-    </div>
-
-    <Table
-      v-model:pageSize="pageSize"
-      v-model:currentPage="currentPage"
-      :columns="tableColumns"
-      :data="dataList"
-      :loading="loading"
-      :pagination="{
-        total: total
-      }"
-      @register="tableRegister"
-    />
-  </ContentWrap>
-</template>

+ 0 - 238
page/src/views/CurdPageTemplate/components/Detail.vue

@@ -1,238 +0,0 @@
-<script setup lang="ts">
-import { ContentWrap } from '@common/src/components/ContentWrap'
-import { reactive, ref, watch } from 'vue'
-import { Descriptions, DescriptionsSchema } from '@common/src/components/Descriptions'
-import { useRouter, useRoute } from 'vue-router'
-import { personCaseFind } from '@/api/caseManage'
-import { getCodeByType } from '@common/src/utils'
-const { go } = useRouter()
-const { query } = useRoute()
-
-const detailSchema = reactive<DescriptionsSchema[]>([
-  {
-    field: 'caseId',
-    label: '病例ID'
-  },
-  {
-    field: 'taskNo',
-    label: '关联事件编号'
-  },
-  {
-    field: 'userName',
-    label: '姓名'
-  },
-  {
-    field: 'age',
-    label: '年龄'
-  },
-  {
-    field: 'sex',
-    label: '性别',
-    slots: {
-      default: (data) => {
-        return (data.sex && getCodeByType('SEX', data.sex)) || '-'
-      }
-    }
-  },
-  {
-    field: 'career',
-    label: '职业',
-    slots: {
-      default: (data) => {
-        return (data.career && getCodeByType('CAREER', data.career)) || '-'
-      }
-    }
-  },
-  {
-    field: 'educationDegree',
-    label: '文化程度',
-    slots: {
-      default: (data) => {
-        console.log(data)
-        return (
-          (data.educationDegree && getCodeByType('EDUCATION_DEGREE', data.educationDegree)) || '-'
-        )
-      }
-    }
-  },
-  {
-    field: 'currentAddress',
-    label: '现住址',
-    slots: {
-      default(data) {
-        return data.currentAddress && JSON.parse(data.currentAddress).value
-      }
-    }
-  },
-  {
-    field: 'currentDetail',
-    label: '详细地址'
-  },
-  {
-    field: 'resident',
-    label: '户口地'
-  },
-  {
-    field: 'workUnit',
-    label: '工作(学习)单位'
-  },
-  {
-    field: 'contacts',
-    label: '联系人'
-  },
-  {
-    field: 'telephone',
-    label: '联系电话'
-  }
-])
-
-const detail = ref({})
-const getDetail = async () => {
-  const { data } = await personCaseFind({
-    caseId: query.caseId
-  })
-  detail.value = data
-}
-getDetail()
-
-const activeName = ref('1')
-</script>
-
-<template>
-  <ContentWrap title="病例详情">
-    <el-tabs v-model="activeName" class="demo-tabs">
-      <el-tab-pane label="病例基本信息" name="1">
-        <Descriptions :schema="detailSchema" :data="detail" :column="1" />
-      </el-tab-pane>
-      <el-tab-pane label="疫苗接种记录" name="2">
-        <div class="record-list">
-          <div class="record-list-item">
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">接种疫苗种类</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">接种日期</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">接种地点</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">详细地址</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <el-divider border-style="dashed" />
-          </div>
-        </div>
-      </el-tab-pane>
-      <el-tab-pane label="就诊记录" name="3">
-        <div class="record-list">
-          <div class="record-list-item">
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">就诊原因</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">诊断结果</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">就诊日期</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">就诊地点</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">详细地址</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <el-divider border-style="dashed" />
-          </div>
-        </div>
-      </el-tab-pane>
-      <el-tab-pane label="购药记录" name="4">
-        <div class="record-list">
-          <div class="record-list-item">
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">购药原因</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">购药清单</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">购药日期</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">购药地点</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">详细地址</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <el-divider border-style="dashed" />
-          </div>
-        </div>
-      </el-tab-pane>
-      <el-tab-pane label="检测记录" name="5">
-        <div class="record-list">
-          <div class="record-list-item">
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">检测原因</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">检测结果</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">检测日期</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">检测地点</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <div class="record-list-item__row">
-              <div class="record-list-item__label">详细地址</div>
-              <div class="record-list-item__content">xxx</div>
-            </div>
-            <el-divider border-style="dashed" />
-          </div>
-        </div>
-      </el-tab-pane>
-      <el-tab-pane label="活动轨迹" name="6">待接入</el-tab-pane>
-    </el-tabs>
-
-    <div class="btns text-right mt10px">
-      <BaseButton @click="go(-1)">返回</BaseButton>
-    </div>
-  </ContentWrap>
-</template>
-
-<style lang="less">
-.record-list {
-  &-item {
-    &__row {
-      display: flex;
-      align-items: center;
-      padding: 10px 0;
-    }
-    &__label {
-      width: 150px;
-      text-align: right;
-      margin-right: 16px;
-    }
-    &__content {
-      color: var(--el-text-color-regular);
-    }
-  }
-}
-</style>

+ 0 - 186
page/src/views/CurdPageTemplate/components/Write.vue

@@ -1,186 +0,0 @@
-<script setup lang="tsx">
-import { ContentWrap } from '@common/src/components/ContentWrap'
-import { Form, FormSchema } from '@common/src/components/Form'
-import { useForm } from '@common/src/hooks/web/useForm'
-import { PropType, reactive, watch, ref } from 'vue'
-import { useValidator } from '@common/src/hooks/web/useValidator'
-import { getCodeByType } from '@common/src/utils'
-import { useRouter, useRoute } from 'vue-router'
-import { personCaseCreate, personCaseUpdate, personCaseFind } from '@/api/xxx'
-import Map from '@common/src/business-components/DynamicForm/src/components/Map.vue'
-
-const { replace } = useRouter()
-const { query } = useRoute()
-
-const { required, phone } = useValidator()
-const rules = reactive({
-  telephone: [phone()]
-})
-const mapValue = ref('')
-const formSchema = reactive<FormSchema[]>([
-  {
-    field: 'taskNo',
-    label: '选择流调任务',
-    component: 'Select'
-  },
-  {
-    field: 'userName',
-    label: '姓名',
-    component: 'Input'
-  },
-  {
-    field: 'age',
-    label: '年龄',
-    component: 'Input'
-  },
-  {
-    field: 'sex',
-    label: '性别',
-    component: 'RadioGroup',
-    componentProps: {
-      options: getCodeByType('SEX')
-    }
-  },
-  {
-    field: 'career',
-    label: '职业',
-    component: 'Select',
-    componentProps: {
-      options: getCodeByType('CAREER')
-    }
-  },
-  {
-    field: 'educationDegree',
-    label: '文化程度',
-    component: 'Select',
-    componentProps: {
-      options: getCodeByType('EDUCATION_DEGREE')
-    }
-  },
-  {
-    field: 'currentAddress',
-    label: '现住址',
-    formItemProps: {
-      slots: {
-        default: () => {
-          return (
-            <>
-              <Map ref="MapRef" v-model={mapValue.value} />
-            </>
-          )
-        }
-      }
-    }
-  },
-  {
-    field: 'currentDetail',
-    label: '详细地址',
-    component: 'Input',
-    componentProps: {
-      placeholder: '请输入,如楼层、门牌号'
-    }
-  },
-  {
-    field: 'resident',
-    label: '户口地',
-    component: 'Input'
-  },
-  {
-    field: 'workUnit',
-    label: '工作(学习)单位',
-    component: 'Input'
-  },
-  {
-    field: 'contacts',
-    label: '联系人',
-    component: 'Input'
-  },
-  {
-    field: 'telephone',
-    label: '联系电话',
-    component: 'Input'
-  }
-])
-
-const { formRegister, formMethods } = useForm()
-const { setValues, getFormData, getElFormExpose, setSchema } = formMethods
-
-const detail = ref()
-const getDetail = async () => {
-  const { data } = await personCaseFind({
-    caseId: query.caseId
-  })
-  detail.value = data
-  if (data.currentAddress) {
-    mapValue.value = data.currentAddress
-  }
-  setValues(data)
-}
-
-watch(
-  () => query.caseId,
-  (val) => {
-    if (!val) return
-    getDetail()
-  },
-  {
-    immediate: true
-  }
-)
-
-const submit = async () => {
-  const elForm = await getElFormExpose()
-  const valid = await elForm?.validate().catch((err) => {
-    console.log(err)
-  })
-  if (valid) {
-    const formData = await getFormData()
-    console.log('formData', formData)
-    let data = formData
-    if (mapValue.value) {
-      const map = JSON.parse(mapValue.value)
-      data = {
-        ...data,
-        currentAddress: mapValue.value,
-        districtNo: map.district_no
-      }
-    }
-    let res
-    if (query.actionType === 'edit') {
-      res = await personCaseUpdate({
-        ...data,
-        caseId: query.caseId
-      })
-    } else {
-      res = await personCaseCreate(data)
-    }
-    if (res.success) {
-      back()
-    }
-  }
-}
-const back = () => {
-  replace({
-    path: '/survey-case-manage/page',
-    query: {
-      tabName: query.tabName
-    }
-  })
-}
-</script>
-
-<template>
-  <ContentWrap title="病例详情">
-    <Form
-      :rules="rules"
-      @register="formRegister"
-      :schema="formSchema"
-      :isCol="false"
-      class="w-700px"
-    />
-    <div class="btns text-right mt10px">
-      <BaseButton type="primary" @click="submit">确认并提交</BaseButton>
-      <BaseButton @click="back">返回</BaseButton>
-    </div>
-  </ContentWrap>
-</template>

+ 0 - 226
page/src/views/CurdTemplate/Page.vue

@@ -1,226 +0,0 @@
-<script setup lang="tsx">
-import { ContentWrap } from '@common/src/components/ContentWrap'
-import { Search } from '@common/src/components/Search'
-import { Dialog } from '@common/src/components/Dialog'
-import { Table } from '@common/src/components/Table'
-import { BaseButton } from '@common/src/components/Button'
-import { useTable } from '@common/src/hooks/web/useTable'
-import { CrudSchema, useCrudSchemas } from '@common/src/hooks/web/useCrudSchemas'
-import Write from './components/Write.vue'
-import Detail from './components/Detail.vue'
-
-import { ref, unref, reactive } from 'vue'
-
-const { tableRegister, tableState, tableMethods } = useTable({
-  fetchDataApi: async () => {
-    const { currentPage, pageSize } = tableState
-    const res = await Api({
-      current: unref(currentPage),
-      size: unref(pageSize),
-      ...unref(searchParams)
-    })
-    return {
-      list: res.data.list,
-      total: res.data.totalCount
-    }
-  }
-})
-const { loading, dataList, total, currentPage, pageSize } = tableState
-const { getList } = tableMethods
-
-const searchParams = ref({})
-const setSearchParams = (params: any) => {
-  searchParams.value = params
-  getList()
-}
-
-const crudSchemas = reactive<CrudSchema[]>([
-  {
-    field: 'index',
-    label: '序号',
-    type: 'index',
-    search: {
-      hidden: true
-    },
-    form: {
-      hidden: true
-    },
-    detail: {
-      hidden: true
-    }
-  },
-  {
-    field: 'no',
-    label: '编号',
-    search: {
-      hidden: true
-    },
-    form: {
-      hidden: true
-    },
-    detail: {
-      hidden: true
-    }
-  },
-  {
-    field: 'serviceName',
-    label: '业务表名称',
-    search: {
-      hidden: true
-    },
-    table: {
-      slots: {
-        default: (data: any) => {
-          return <>{data.row.serviceName}</>
-        }
-      }
-    },
-    form: {
-      component: 'Input'
-    }
-  },
-  {
-    field: 'serviceNo',
-    label: '业务编码',
-    search: {
-      hidden: true
-    },
-    table: {
-      hidden: true
-    },
-    form: {
-      component: 'Input'
-    }
-  },
-  {
-    field: 'action',
-    width: '220px',
-    label: '操作',
-    search: {
-      hidden: true
-    },
-    form: {
-      hidden: true
-    },
-    detail: {
-      hidden: true
-    },
-    table: {
-      slots: {
-        default: (data: any) => {
-          return (
-            <>
-              <BaseButton size="small" type="primary" onClick={() => action(data.row, 'detail')}>
-                查看详情
-              </BaseButton>
-              <BaseButton size="small" type="primary" onClick={() => action(data.row, 'edit')}>
-                编辑
-              </BaseButton>
-              <BaseButton size="small" type="danger" onClick={() => delData(data.row)}>
-                删除
-              </BaseButton>
-            </>
-          )
-        }
-      }
-    }
-  }
-])
-
-// @ts-ignore
-const { allSchemas } = useCrudSchemas(crudSchemas)
-
-const dialogVisible = ref(false)
-const dialogTitle = ref('')
-
-const currentRow = ref()
-const actionType = ref('')
-
-const AddAction = () => {
-  dialogTitle.value = '新增'
-  currentRow.value = null
-  dialogVisible.value = true
-  actionType.value = 'add'
-}
-
-const delData = async (row) => {
-  ElMessageBox.confirm('确认删除?', '提示', {
-    confirmButtonText: '确认',
-    cancelButtonText: '取消',
-    type: 'warning'
-  }).then(async () => {
-    await del(row?.id)
-    getList()
-  })
-}
-
-const action = (row, type: string) => {
-  currentRow.value = row
-  actionType.value = type
-  dialogTitle.value = type === 'edit' ? '编辑' : '详情'
-  dialogVisible.value = true
-}
-
-const writeRef = ref<ComponentRef<typeof Write>>()
-
-const saveLoading = ref(false)
-
-const save = async () => {
-  const write = unref(writeRef)
-  const formData = await write?.submit()
-  if (formData) {
-    saveLoading.value = true
-    const res = await (actionType.value === 'add'
-      ? createBusinessTable(formData)
-      : updateBusinessTable(formData))
-    saveLoading.value = false
-    if (res.success) {
-      dialogVisible.value = false
-      getList()
-    }
-  }
-}
-</script>
-
-<template>
-  <ContentWrap>
-    <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
-
-    <div class="mb-10px">
-      <BaseButton type="primary" @click="AddAction">新增</BaseButton>
-    </div>
-
-    <Table
-      v-model:pageSize="pageSize"
-      v-model:currentPage="currentPage"
-      :columns="allSchemas.tableColumns"
-      :data="dataList"
-      :loading="loading"
-      :pagination="{
-        total: total
-      }"
-      @register="tableRegister"
-    />
-  </ContentWrap>
-
-  <Dialog v-model="dialogVisible" :title="dialogTitle" width="600px">
-    <Detail
-      v-if="actionType === 'detail'"
-      :detail-schema="allSchemas.detailSchema"
-      :current-row="currentRow"
-    />
-    <Write
-      v-else
-      :action-type="actionType"
-      ref="writeRef"
-      :form-schema="allSchemas.formSchema"
-      :current-row="currentRow"
-    />
-    <template #footer>
-      <BaseButton v-if="actionType !== 'detail'" type="primary" :loading="saveLoading" @click="save"
-        >保存</BaseButton
-      >
-      <BaseButton @click="dialogVisible = false">关闭</BaseButton>
-    </template>
-  </Dialog>
-</template>

+ 0 - 19
page/src/views/CurdTemplate/components/Detail.vue

@@ -1,19 +0,0 @@
-<script setup lang="ts">
-import { PropType } from 'vue'
-import { Descriptions, DescriptionsSchema } from '@common/src/components/Descriptions'
-
-defineProps({
-  currentRow: {
-    type: Object,
-    default: () => {}
-  },
-  detailSchema: {
-    type: Array as PropType<DescriptionsSchema[]>,
-    default: () => []
-  }
-})
-</script>
-
-<template>
-  <Descriptions :schema="detailSchema" :data="currentRow" />
-</template>

+ 0 - 66
page/src/views/CurdTemplate/components/Write.vue

@@ -1,66 +0,0 @@
-<script setup lang="ts">
-import { Form, FormSchema } from '@common/src/components/Form'
-import { useForm } from '@common/src/hooks/web/useForm'
-import { PropType, reactive, watch } from 'vue'
-import { useValidator } from '@common/src/hooks/web/useValidator'
-
-const props = defineProps({
-  currentRow: {
-    type: Object,
-    default: () => null
-  },
-  formSchema: {
-    type: Array as PropType<FormSchema[]>,
-    default: () => []
-  },
-  actionType: {
-    type: String,
-    default: ''
-  }
-})
-const { required } = useValidator()
-const rules = reactive({
-  field: [required()]
-})
-
-const { formRegister, formMethods } = useForm()
-const { setValues, getFormData, getElFormExpose, setSchema } = formMethods
-
-const submit = async () => {
-  const elForm = await getElFormExpose()
-  const valid = await elForm?.validate().catch((err) => {
-    console.log(err)
-  })
-  if (valid) {
-    const formData = await getFormData()
-    return formData
-  }
-}
-
-const getDetail = async () => {
-  const { success, data } = await find(props.currentRow?.id || null)
-  if (success) {
-    setValues(data)
-  }
-}
-
-watch(
-  () => props.currentRow,
-  (currentRow) => {
-    if (!currentRow) return
-    getDetail()
-  },
-  {
-    deep: true,
-    immediate: true
-  }
-)
-
-defineExpose({
-  submit
-})
-</script>
-
-<template>
-  <Form :rules="rules" @register="formRegister" :schema="formSchema" :is-col="false" />
-</template>