zs
2025-04-28 1f32ea02c1910c417f159cba81a296e66ae7484c
HIAWms/web/src/widgets/HIAWms/Controllers/WmsPlace.ts
copy from WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts copy to HIAWms/web/src/widgets/HIAWms/Controllers/WmsPlace.ts
Îļþ´Ó WMS/web/app/template/MyPluginName/Controllers/MyEntityName.ts ¸´ÖÆ
@@ -1,6 +1,6 @@
import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue'
import { injectModel } from '@/libs/Provider/Provider'
import { MyEntityName } from '../Models/MyEntityName'
import { WmsPlace } from '../Models/WmsPlace'
import { ElMessage } from 'element-plus'
import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
import { useFile } from './File'
@@ -9,8 +9,8 @@
  row: any
  index: number
}
export const useMyEntityName = (props: any, ctx?: any) => {
  const myEntityName = injectModel<MyEntityName>('myEntityName')
export const useWmsPlace = (props: any, ctx?: any) => {
  const wmsplace = injectModel<WmsPlace>('wmsplace')
  const { exportFile } = useFile()
  /**
   * å¤´éƒ¨é…ç½®
@@ -19,7 +19,7 @@
  /**
   * åŠ¨æ€åˆ—é…ç½®
   */
  const myEntityNameColumns = ref<Record<string, any>>([])
  const wmsplaceColumns = ref<Record<string, any>>([])
  /**
   * æœç´¢å€¼
   */
@@ -112,7 +112,7 @@
    {
      label: '创建副本',
      fn: async ({ row }: CurrentType) => {
        await myEntityName.cloneData([row.id])
        await wmsplace.cloneData([row.id])
        ElMessage.success('创建副本成功')
        tableRef.value?.getList()
      },
@@ -127,7 +127,7 @@
          `是否删除${names.length ? names.join(',') : c.row.name}`
        ).then(async () => {
          const ids = selection.value.map((item: { id: string }) => item.id)
          await myEntityName.deleteMyEntityNames(ids.length ? ids : [c.row.id])
          await wmsplace.deleteWmsPlaces(ids.length ? ids : [c.row.id])
          ElMessage.success('删除成功')
          tableRef.value.getList()
        })
@@ -140,7 +140,7 @@
    selection.value = records
  }
  const onAddMyEntityName = () => {
  const onAddWmsPlace = () => {
    const params = tableRef.value?.getPaginationParams()
    current.value = null
    dialogConfig.visible = true
@@ -149,7 +149,7 @@
    sort.value = params.totalCount + 1
  }
  const onConfirmMyEntityName = async () => {
  const onConfirmWmsPlace = async () => {
    dialogConfig.visible = false
    if (dialogConfig.isAdd) {
      tableRef.value?.scrollToRow({
@@ -173,9 +173,9 @@
  const onExport = () => {
    const params = tableRef.value?.getParams()
    exportFile(
      '/api/v1/myPluginName/myEntityName/export',
      '/api/v1/hiawms/wmsplace/export',
      params,
      'myPluginName'
      'hiawms'
    )
  }
@@ -245,7 +245,7 @@
    current,
    search,
    sort,
    myEntityNameColumns,
    wmsplaceColumns,
    paginationParams,
    headers,
    onBeforeUpload,
@@ -255,8 +255,8 @@
    onSearch,
    onExport,
    onRowClick,
    onConfirmMyEntityName,
    onConfirmWmsPlace,
    onCheck,
    onAddMyEntityName,
    onAddWmsPlace,
  }
}