From 3aedad63dd01f1fc5154cb520af32edab967d6e0 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周一, 12 5月 2025 09:15:26 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
---
PipeLineLems/pipelinelems_web/src/widgets/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx | 167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 167 insertions(+), 0 deletions(-)
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx b/PipeLineLems/pipelinelems_web/src/widgets/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
new file mode 100644
index 0000000..89ec310
--- /dev/null
+++ b/PipeLineLems/pipelinelems_web/src/widgets/MyPluginName/Views/Pages/MyEntityName/MyEntityName.tsx
@@ -0,0 +1,167 @@
+import { defineComponent } from 'vue'
+import type { Ref } from 'vue'
+import BaseTable from '@/components/Table/Table'
+import styles from './MyEntityName.module.scss'
+import { useMyEntityName } from '../../../Controllers/MyEntityName'
+import IconButton from '@/components/IconButton/IconButton'
+import MyEntityNameDrawer from '../Dialog/MyEntityNameDrawer/MyEntityNameDrawer'
+import Search from '@/components/Search/Search'
+import { columns } from './Config'
+import TdButton from '@/components/TdButton/TdButton'
+import { vPermission } from '@/libs/Permission/Permission'
+
+interface RenderTableType {
+ url?: string
+ dataSource: Ref<any[]>
+ isDrag?: boolean
+ isChecked?: boolean
+ isHidePagination?: boolean
+ params?: Record<string, any>
+ autoHeight?: boolean
+}
+
+export default defineComponent({
+ name: 'MyEntityName',
+ directives: {
+ permission: vPermission,
+ },
+ setup(props, ctx) {
+ const {
+ dataSource,
+ contextMenu,
+ dialogConfig,
+ tableRef,
+ current,
+ search,
+ sort,
+ headers,
+ onError,
+ onSearch,
+ onRowClick,
+ onConfirmMyEntityName,
+ onCheck,
+ onAddMyEntityName,
+ onExport,
+ openDetail,
+ onSuccess,
+ onBeforeUpload,
+ } = useMyEntityName(props, ctx)
+
+ /**
+ * @returns 琛ㄦ牸
+ */
+ const RenderBaseTable = (props: RenderTableType) => {
+ const {
+ url,
+ dataSource,
+ isDrag,
+ isChecked,
+ isHidePagination,
+ params,
+ autoHeight,
+ } = props
+
+ return (
+ <div
+ class={{
+ [styles.myEntityNameList]: true,
+ }}
+ >
+ <BaseTable
+ ref={tableRef}
+ url={url}
+ sortUrlTpl="/api/v1/myPluginName/myEntityName/{id}/adjustsort/{sort}"
+ v-model:dataSource={dataSource.value}
+ columns={columns}
+ contextMenu={contextMenu}
+ params={params}
+ isDrag={isDrag}
+ isChecked={isChecked}
+ autoHeight={autoHeight}
+ onCheck={onCheck}
+ onRowClick={onRowClick}
+ isHidePagination={isHidePagination}
+ pageSize={50}
+ v-slots={{
+ name: ({ row }: any) => {
+ return row?.name ? (
+ <TdButton
+ onClick={() => openDetail(row)}
+ text={<span style="color:#5a84ff">璇︽儏</span>}
+ icon="scale"
+ tip={row?.name}
+ hover
+ >
+ {row?.name}
+ </TdButton>
+ ) : (
+ '-'
+ )
+ },
+ }}
+ ></BaseTable>
+ </div>
+ )
+ }
+ return () => {
+ return (
+ <div class={styles.myEntityNameContent}>
+ {/* 娣诲姞/缂栬緫 */}
+ <MyEntityNameDrawer
+ v-model={dialogConfig.visible}
+ title={dialogConfig.title}
+ row={current.value}
+ sort={sort.value}
+ onConfirm={onConfirmMyEntityName}
+ />
+ <div class={styles.headerContent}>
+ <div class={styles.header}>
+ <IconButton
+ v-permission="myEntityName-add"
+ icon="add-p"
+ onClick={onAddMyEntityName}
+ type="primary"
+ >
+ 娣诲姞
+ </IconButton>
+ <el-divider direction="vertical" />
+ <el-upload
+ v-permission="myEntityName-import"
+ name="file"
+ accept=".xlsx,.xls,.csv"
+ show-file-list={false}
+ onError={onError}
+ onSuccess={onSuccess}
+ before-upload={onBeforeUpload}
+ headers={headers.value}
+ action="/api/v1/myPluginName/myEntityName/import"
+ >
+ <IconButton icon="in">瀵煎叆</IconButton>
+ </el-upload>
+
+ <IconButton
+ v-permission="myEntityName-output"
+ icon="out"
+ onClick={onExport}
+ >
+ 瀵煎嚭
+ </IconButton>
+ </div>
+ <Search
+ placeholder="璇疯緭鍏ュ叧閿瓧"
+ v-model={search.value}
+ onConfirm={onSearch}
+ style={{ marginTop: '-1px' }}
+ />
+ </div>
+ <RenderBaseTable
+ url="/api/v1/myPluginName/myEntityName"
+ dataSource={dataSource}
+ isChecked={true}
+ isDrag={true}
+ />
+ </div>
+ )
+ }
+ },
+})
--
Gitblit v1.9.3