From ffd0793f26fabf6c17eb8e6eac417f8171b5dd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= <2270033969@qq.com> Date: Wed, 29 May 2024 16:56:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=92=9A=20=E5=A2=9E=E5=8A=A0=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E4=BB=93=E5=BA=93=E5=90=8C=E6=AD=A5=20github=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/mirror.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/mirror.yml diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 00000000..939c1914 --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,18 @@ +name: 同步代码 + +on: + push: + branches: [ master,jdk17 ] + pull_request: + branches: [ master,jdk17 ] + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: wearerequired/git-mirror-action@master #同步至 gitee + env: + SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + with: + source-repo: "git@github.com:pig-mesh/pig-ui.git" + destination-repo: "git@gitee.com:log4j/pig-ui.git" -- Gitee From 9ee72407ec1e67d1bfbce116e8fba4d4bfcdde02 Mon Sep 17 00:00:00 2001 From: lbw Date: Wed, 3 Jul 2024 04:29:25 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Refac:=20=E7=AE=80=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lbw --- src/views/gen/table/index.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/gen/table/index.vue b/src/views/gen/table/index.vue index 444fc654..166a12eb 100644 --- a/src/views/gen/table/index.vue +++ b/src/views/gen/table/index.vue @@ -92,7 +92,9 @@ onMounted(() => { list().then((res) => { datasourceList.value = res.data; // 默认去第一个数据源 - state.queryForm.dsName =datasourceList.value.length>0?datasourceList.value[0].name:state.queryForm.dsName; + if (datasourceList.value.length > 0) { + state.queryForm.dsName = datasourceList.value[0].name; + } getDataList(); }); }); -- Gitee From f05d1730f5ca9ec6299b810b8443d0d4510b3c38 Mon Sep 17 00:00:00 2001 From: dmw Date: Sun, 7 Jul 2024 12:49:08 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=B0=81=E8=A3=85=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=90=88=E5=B9=B6=E5=A4=84=E7=90=86?= =?UTF-8?q?=E3=80=81=E6=96=B0=E5=A2=9E=E8=A1=8C=E6=A0=B7=E5=BC=8F=E3=80=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=92=E9=99=A4=E7=A9=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/table.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/hooks/table.ts b/src/hooks/table.ts index e46e767c..d4693d13 100644 --- a/src/hooks/table.ts +++ b/src/hooks/table.ts @@ -31,12 +31,15 @@ export interface BasicTableProps { ascs?: string[]; // props属性对象,类型为any props?: any; + // 合并行列,类型为函数 + spanMethod?: Function } /** * 表格样式。 */ export interface TableStyle { + rowStyle: CellStyle; cellStyle: CellStyle; headerCellStyle: CellStyle; } @@ -58,7 +61,7 @@ export interface Pagination { } export function useTable(options?: BasicTableProps) { - const defaultOptions: BasicTableProps = { + const defaultOptions: { createdIsNeed: boolean; pagination: Pagination; queryForm: {}; loading: boolean; dataListSelections: any[]; ascs: any[]; props: { item: string; totalCount: string }; selectObjs: any[]; descs: any[]; dataListLoading: boolean; dataList: any[]; isPage: boolean } = { // 列表数据是否正在加载中,默认为false dataListLoading: false, // 是否需要自动请求创建接口来获取表格数据,默认为true @@ -121,7 +124,12 @@ export function useTable(options?: BasicTableProps) { try { // 开始加载数据,设置state.loading为true state.loading = true; - + // 参数排除空字段 + for (let key in state.queryForm) { + if (state.queryForm[key] === "" || state.queryForm[key] === null) { + delete state.queryForm[key] + } + } // 调用state.pageList方法发起分页查询 const res = await state.pageList({ ...state.queryForm, @@ -133,6 +141,10 @@ export function useTable(options?: BasicTableProps) { // 设置表格展示的数据数组 state.dataList = state.isPage ? res.data[state.props.item] : res.data; + // 处理合并 + if (state.spanMethod){ + state.spanMethod() + } // 设置分页信息中的总数据条数 state.pagination!.total = state.isPage ? res.data[state.props.totalCount] : 0; } catch (err: any) { @@ -233,6 +245,7 @@ export function useTable(options?: BasicTableProps) { background: 'var(--el-table-row-hover-bg-color)', color: 'var(--el-text-color-primary)', }, + rowStyle: { textAlign: 'center' }, }; return { -- Gitee