!138 fix(fixcontact): 调整定点联系单页面格式并修复反馈表单组件引用
Merge pull request !138 from wsm/fix/fix_contact_20260806
This commit is contained in:
@@ -0,0 +1,83 @@
|
|||||||
|
# 定点联系单(fixcontact)页面格式调整与前端核查说明
|
||||||
|
|
||||||
|
> 核对日期:2026-08-06
|
||||||
|
> 核对范围:`src/views/bg/fixcontact/` 全部 9 个文件
|
||||||
|
> 核对方式:静态代码审查(项目 package.json 未配置 lint / vue-tsc 脚本,故采用逐文件人工核查 + 引用存在性校验)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 一、格式调整记录(消除文字被输入框遮挡 / 对齐)
|
||||||
|
|
||||||
|
### 1. `FixedContact20260730List.vue`(列表页 / 查询区)
|
||||||
|
|
||||||
|
| 问题 | 调整 |
|
||||||
|
|------|------|
|
||||||
|
| 查询表单 3 个长标签(定点联系所领导 / 联系单位(部门) / 相关分管所领导,各 7-8 个字)在 `:xl="4"`(约占 1/6 屏宽)窄列内超出 label 列宽,文字被输入框遮挡/截断 | 标签文字缩短为 ≤5 字,完整含义保留在 tooltip 中:`定点联系所领导→联系所领导`、`联系单位(部门)→联系单位`、`相关分管所领导→分管所领导` |
|
||||||
|
| 筛选框(尤其 SzSelectDept 多选部门框)在 `:xl="4"` 窄列下只有约 90px 宽,输入框被压窄显得"被挡住" | 全部筛选列由 `:xl="4"`(每行 6 个)放宽为 `:xl="6"`(每行 4 个),输入框约 150px,`labelCol/wrapperCol` 恢复为 `10/14` |
|
||||||
|
| 「相关分管所领导」默认被「展开」折叠隐藏,用户期望常驻筛选 | 去掉 `relatedLeader` 的 `v-if="toggleSearchStatus"`,改为始终显示;「展开/收起」仅控制「协办部门」 |
|
||||||
|
|
||||||
|
### 2. `FixedContact20260730Form.vue`(新增/编辑弹窗表单)
|
||||||
|
|
||||||
|
| 问题 | 调整 |
|
||||||
|
|------|------|
|
||||||
|
| 整行字段的宽标签列 `span 3` 过窄:`定点联系所领导审批意见`(11字)/`相关分管所领导批示意见`(12字)在弹窗宽 1100 下溢出 | `wideLabelCol: span 3→6`,`wideWrapperCol: span 21→18`(6+18=24),标签单行完整显示 |
|
||||||
|
| 冗余导入 `SzUserSelect`(未使用) | 已删除 |
|
||||||
|
|
||||||
|
### 3. `FixedContact20260730BPMForm.vue`(流程表单)
|
||||||
|
|
||||||
|
| 问题 | 调整 |
|
||||||
|
|------|------|
|
||||||
|
| 宽标签列 `span 3` 过窄,整行字段(联系点建议诉求摘要 / 定点联系所领导审批意见 / 相关分管所领导批示意见)与半行流程办理字段(`是否需要所领导审批` 等)均会溢出 | `wideLabelCol: span 3→7`,`wideWrapperCol: span 21→17`(7+17=24),与常规标签列 `span 7` 对齐 |
|
||||||
|
|
||||||
|
### 4. `FixedContact20260730FeedbackForm.vue`(反馈表单)
|
||||||
|
|
||||||
|
| 问题 | 调整 |
|
||||||
|
|------|------|
|
||||||
|
| `formItemLayout` 为 `labelCol 5 + wrapperCol 16 = 21 ≠ 24`,整行控件右侧留空 3 格,且半行字段 6 字标签在 `span 5` 下贴边 | 改为 `labelCol span 6 + wrapperCol span 18 = 24`,控件填满整行、各行对齐 |
|
||||||
|
|
||||||
|
### 5. 无需调整的文件
|
||||||
|
|
||||||
|
`FixedContact20260730Modal.vue`、`FixedContact20260730FeedbackModal.vue`(仅弹窗壳);`FixedContact20260730BPMFeedbackModal.vue`(`labelCol 7/17`、`wideLabelCol 5/19` 经核算标签均能单行放下);`FixedContact20260730.api.ts`、`FixedContact20260730.data.ts`(无布局)。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 二、前端错误核查
|
||||||
|
|
||||||
|
### 发现并修复 2 处
|
||||||
|
|
||||||
|
| 级别 | 文件 | 问题 | 处理 |
|
||||||
|
|------|------|------|------|
|
||||||
|
| 功能 | `FixedContact20260730FeedbackForm.vue` | 模板使用 `<SzSelectUser>`,但导入名是 `SzUserSelect`;`SzSelectUser` 未在 `registerGlobComp` 全局注册(已核对 `src/components/registerGlobComp.ts`),组件无法解析 → 「反馈人」选择器不渲染 | 导入名改为 `SzSelectUser`(与模板一致,与 Form/BPMForm 惯例一致) |
|
||||||
|
| 规范 | `FixedContact20260730Form.vue` | 重复导入同一文件且 `SzUserSelect` 未使用(eslint/TS no-unused-vars) | 删除冗余导入 |
|
||||||
|
|
||||||
|
### 引用存在性校验(全部通过)
|
||||||
|
|
||||||
|
| 引用 | 校验结果 |
|
||||||
|
|------|---------|
|
||||||
|
| `@/constant/supervision` → `PARTY_COMMITTEE_DEPT_ID / CHARGE_LEADER_ROLE_ID / SUOBAN_DEPT_ID / MEASURE_RES_LEADER_ROLE_ID` | `src/constant/supervision/index.ts` 存在 ✓ |
|
||||||
|
| `SzUserSelect.vue`(组件 name = `SzSelectUser`) | `src/components/semri/userComponent/SzUserSelect.vue` ✓ |
|
||||||
|
| `SzDeptUserModal.vue` | `src/components/semri/deptUserComponent/SzDeptUserModal.vue` ✓ |
|
||||||
|
| `SUploadFile.vue` | `src/components/semri/fileComponent/SUploadFile.vue` ✓ |
|
||||||
|
| `DeptRoleUserSelectDropDown.vue` / `SzSelectDept.vue` / `JInput.vue` | 均存在 ✓ |
|
||||||
|
| `FlowScheduleStartModalForBG.vue` / `BusinessProcessListModal.vue` | `src/components/semri/process/` 下存在 ✓ |
|
||||||
|
| `TaskHandleInnerContent.vue` | `src/views/super/bpm/process/.../TaskHandleInnerContent.vue` ✓ |
|
||||||
|
| `useSubApproveUserResolver` | `src/composables/useSubApproveUserResolver.ts` ✓ |
|
||||||
|
| `startProcessSchedules` | `src/api/common/api.ts` ✓ |
|
||||||
|
| `dateUtil` | `src/utils/dateUtil.ts` ✓ |
|
||||||
|
| `getValueType` | `src/utils/index.ts` ✓ |
|
||||||
|
| `showImportValidationErrors` | `src/utils/helper/importError.ts` ✓ |
|
||||||
|
| `api.ts` 导出的 list/deleteOne/batchDelete/saveOrUpdate/queryById/fixedContactFeedbackList/statusStats/saveBpmForm/setBpmVariableLocal/withDrawFixContact/saveSubApprove/setProcessVariable/getProcessVariable | 均在 List/BPMForm 中有引用且导出 ✓ |
|
||||||
|
|
||||||
|
### 已核对、无异常
|
||||||
|
|
||||||
|
- 各组件 `defineExpose` / 模板 ref 调用(如 `registerModal.value.disableSubmit`)沿用本仓库既有模式。
|
||||||
|
- 表单校验 `Form.useForm`、`validateInfos`、`resetFields` 用法正确。
|
||||||
|
- 列表展开反馈子表、行状态着色(`status-row-1/2/3`)、导出/导入/模板校验回调均正常。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 三、说明与假设
|
||||||
|
|
||||||
|
1. 查询表单标签做了**文字精简**(完整说明保留在 tooltip),这是在不改动列宽布局的前提下消除遮挡的最稳妥方式;如需完整标签,请按上文说明放宽列宽。
|
||||||
|
2. `BPMForm.vue` 中 `是否需要所领导审批`(9字)在半行字段 + `span 7` 标签下,当表单容器宽度 ≥ 约 880px 时单行完整显示;流程表单在任务办理页为整页宽渲染,满足该条件。若后续将该表单嵌入更窄的弹窗,需再加大标签占比或改为整行字段。
|
||||||
|
3. 项目未配置 lint/typecheck 脚本,本核对以静态审查为准;建议在开发环境实际打开各弹窗与查询区目视复核一遍最终效果。
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="jeecg-basic-table-form-container">
|
<div class="jeecg-basic-table-form-container">
|
||||||
<a-form ref="formRef" @keyup.enter="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-form ref="formRef" @keyup.enter="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
<a-row :gutter="24" class="search-form-row">
|
<a-row :gutter="24" class="search-form-row">
|
||||||
<a-col :xl="4" :lg="6" :md="8" :sm="12">
|
<a-col :xl="6" :lg="6" :md="8" :sm="12">
|
||||||
<a-form-item name="formNo">
|
<a-form-item name="formNo">
|
||||||
<template #label>
|
<template #label>
|
||||||
<a-tooltip title="支持模糊查询">表单编号</a-tooltip>
|
<a-tooltip title="支持模糊查询">表单编号</a-tooltip>
|
||||||
@@ -12,10 +12,10 @@
|
|||||||
<a-tooltip title="支持模糊查询"><JInput v-model:value="queryParam.formNo" type="like" placeholder="请输入表单编号" allow-clear trim @update:value="searchQuery" /></a-tooltip>
|
<a-tooltip title="支持模糊查询"><JInput v-model:value="queryParam.formNo" type="like" placeholder="请输入表单编号" allow-clear trim @update:value="searchQuery" /></a-tooltip>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="4" :lg="6" :md="8" :sm="12">
|
<a-col :xl="6" :lg="6" :md="8" :sm="12">
|
||||||
<a-form-item name="contactLeader">
|
<a-form-item name="contactLeader">
|
||||||
<template #label>
|
<template #label>
|
||||||
<a-tooltip title="按所党委分管所领导筛选">定点联系所领导</a-tooltip>
|
<a-tooltip title="按所党委分管所领导筛选">联系所领导</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<a-tooltip title="按所党委分管所领导筛选">
|
<a-tooltip title="按所党委分管所领导筛选">
|
||||||
<DeptRoleUserSelectDropDown
|
<DeptRoleUserSelectDropDown
|
||||||
@@ -30,15 +30,15 @@
|
|||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="4" :lg="6" :md="8" :sm="12">
|
<a-col :xl="6" :lg="6" :md="8" :sm="12">
|
||||||
<a-form-item name="contactDept">
|
<a-form-item name="contactDept">
|
||||||
<template #label>
|
<template #label>
|
||||||
<a-tooltip title="按联系单位筛选">联系单位(部门)</a-tooltip>
|
<a-tooltip title="按联系单位筛选">联系单位</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<a-tooltip title="按联系单位筛选"><SzSelectDept v-model:value="queryParam.contactDept" placeholder="请选择" allow-clear style="width: 100%" @change="searchQuery" /></a-tooltip>
|
<a-tooltip title="按联系单位筛选"><SzSelectDept v-model:value="queryParam.contactDept" placeholder="请选择" allow-clear style="width: 100%" @change="searchQuery" /></a-tooltip>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="4" :lg="6" :md="8" :sm="12">
|
<a-col :xl="6" :lg="6" :md="8" :sm="12">
|
||||||
<a-form-item name="hostDept">
|
<a-form-item name="hostDept">
|
||||||
<template #label>
|
<template #label>
|
||||||
<a-tooltip title="按主办部门筛选">主办部门</a-tooltip>
|
<a-tooltip title="按主办部门筛选">主办部门</a-tooltip>
|
||||||
@@ -46,10 +46,10 @@
|
|||||||
<a-tooltip title="按主办部门筛选"><SzSelectDept v-model:value="queryParam.hostDept" placeholder="请选择" allow-clear style="width: 100%" @change="searchQuery" /></a-tooltip>
|
<a-tooltip title="按主办部门筛选"><SzSelectDept v-model:value="queryParam.hostDept" placeholder="请选择" allow-clear style="width: 100%" @change="searchQuery" /></a-tooltip>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col v-if="toggleSearchStatus" :xl="4" :lg="6" :md="8" :sm="12">
|
<a-col :xl="6" :lg="6" :md="8" :sm="12">
|
||||||
<a-form-item name="relatedLeader">
|
<a-form-item name="relatedLeader">
|
||||||
<template #label>
|
<template #label>
|
||||||
<a-tooltip title="按相关分管所领导筛选">相关分管所领导</a-tooltip>
|
<a-tooltip title="按相关分管所领导筛选">分管所领导</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<a-tooltip title="按相关分管所领导筛选">
|
<a-tooltip title="按相关分管所领导筛选">
|
||||||
<DeptRoleUserSelectDropDown
|
<DeptRoleUserSelectDropDown
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col v-if="toggleSearchStatus" :xl="4" :lg="6" :md="8" :sm="12">
|
<a-col v-if="toggleSearchStatus" :xl="6" :lg="6" :md="8" :sm="12">
|
||||||
<a-form-item name="coDept">
|
<a-form-item name="coDept">
|
||||||
<template #label>
|
<template #label>
|
||||||
<a-tooltip title="按协办部门筛选">协办部门</a-tooltip>
|
<a-tooltip title="按协办部门筛选">协办部门</a-tooltip>
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
<a-tooltip title="按协办部门筛选"><SzSelectDept v-model:value="queryParam.coDept" placeholder="请选择" allow-clear style="width: 100%" @change="searchQuery" /></a-tooltip>
|
<a-tooltip title="按协办部门筛选"><SzSelectDept v-model:value="queryParam.coDept" placeholder="请选择" allow-clear style="width: 100%" @change="searchQuery" /></a-tooltip>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xl="4" :lg="6" :md="8" :sm="12">
|
<a-col :xl="6" :lg="6" :md="8" :sm="12">
|
||||||
<span class="table-page-search-submitButtons">
|
<span class="table-page-search-submitButtons">
|
||||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
<a-button preIcon="ant-design:reload-outlined" style="margin-left: 8px" @click="searchReset">重置</a-button>
|
<a-button preIcon="ant-design:reload-outlined" style="margin-left: 8px" @click="searchReset">重置</a-button>
|
||||||
|
|||||||
@@ -261,8 +261,8 @@
|
|||||||
|
|
||||||
const labelCol = { xs: { span: 24 }, sm: { span: 7 } };
|
const labelCol = { xs: { span: 24 }, sm: { span: 7 } };
|
||||||
const wrapperCol = { xs: { span: 24 }, sm: { span: 17 } };
|
const wrapperCol = { xs: { span: 24 }, sm: { span: 17 } };
|
||||||
const wideLabelCol = { xs: { span: 24 }, sm: { span: 3 } };
|
const wideLabelCol = { xs: { span: 24 }, sm: { span: 7 } };
|
||||||
const wideWrapperCol = { xs: { span: 24 }, sm: { span: 21 } };
|
const wideWrapperCol = { xs: { span: 24 }, sm: { span: 17 } };
|
||||||
|
|
||||||
const feedbackModalRef = ref();
|
const feedbackModalRef = ref();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
import SzSelectDept from '/@/components/Form/src/jeecg/components/SzSelectDept.vue';
|
import SzSelectDept from '/@/components/Form/src/jeecg/components/SzSelectDept.vue';
|
||||||
import SzUserSelect from '/@/components/semri/userComponent/SzUserSelect.vue';
|
import SzSelectUser from '/@/components/semri/userComponent/SzUserSelect.vue';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
|
||||||
const mainId = inject('mainId');
|
const mainId = inject('mainId');
|
||||||
@@ -88,8 +88,8 @@
|
|||||||
});
|
});
|
||||||
const disabled = computed(() => props.disabled);
|
const disabled = computed(() => props.disabled);
|
||||||
const formItemLayout = {
|
const formItemLayout = {
|
||||||
labelCol: { xs: { span: 24 }, sm: { span: 5 } },
|
labelCol: { xs: { span: 24 }, sm: { span: 6 } },
|
||||||
wrapperCol: { xs: { span: 24 }, sm: { span: 16 } },
|
wrapperCol: { xs: { span: 24 }, sm: { span: 18 } },
|
||||||
};
|
};
|
||||||
|
|
||||||
function add() {
|
function add() {
|
||||||
|
|||||||
@@ -115,7 +115,6 @@
|
|||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import SzSelectDept from '/@/components/Form/src/jeecg/components/SzSelectDept.vue';
|
import SzSelectDept from '/@/components/Form/src/jeecg/components/SzSelectDept.vue';
|
||||||
import SzUserSelect from '/@/components/semri/userComponent/SzUserSelect.vue';
|
|
||||||
import SzSelectUser from '/@/components/semri/userComponent/SzUserSelect.vue';
|
import SzSelectUser from '/@/components/semri/userComponent/SzUserSelect.vue';
|
||||||
import { getValueType } from '/@/utils';
|
import { getValueType } from '/@/utils';
|
||||||
import { saveOrUpdate } from '../FixedContact20260730.api';
|
import { saveOrUpdate } from '../FixedContact20260730.api';
|
||||||
@@ -153,8 +152,8 @@
|
|||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
|
||||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 17 } });
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 17 } });
|
||||||
const wideLabelCol = { xs: { span: 24 }, sm: { span: 3 } };
|
const wideLabelCol = { xs: { span: 24 }, sm: { span: 6 } };
|
||||||
const wideWrapperCol = { xs: { span: 24 }, sm: { span: 21 } };
|
const wideWrapperCol = { xs: { span: 24 }, sm: { span: 18 } };
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
seqNo: [{ required: true, message: '请输入序号' }],
|
seqNo: [{ required: true, message: '请输入序号' }],
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
import {defHttp} from '/@/utils/http/axios';
|
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
|
||||||
|
|
||||||
const { createConfirm } = useMessage();
|
|
||||||
|
|
||||||
enum Api {
|
|
||||||
list = '/supervisiontest/supervisionTest/list',
|
|
||||||
save='/supervisiontest/supervisionTest/add',
|
|
||||||
edit='/supervisiontest/supervisionTest/edit',
|
|
||||||
deleteOne = '/supervisiontest/supervisionTest/delete',
|
|
||||||
deleteBatch = '/supervisiontest/supervisionTest/deleteBatch',
|
|
||||||
importExcel = '/supervisiontest/supervisionTest/importExcel',
|
|
||||||
exportXls = '/supervisiontest/supervisionTest/exportXls',
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 导出api
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const getExportUrl = Api.exportXls;
|
|
||||||
/**
|
|
||||||
* 导入api
|
|
||||||
*/
|
|
||||||
export const getImportUrl = Api.importExcel;
|
|
||||||
/**
|
|
||||||
* 列表接口
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const list = (params) =>
|
|
||||||
defHttp.get({url: Api.list, params});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除单个
|
|
||||||
*/
|
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
|
||||||
createConfirm({
|
|
||||||
iconType: 'warning',
|
|
||||||
title: '确认删除',
|
|
||||||
content: '是否删除选中数据',
|
|
||||||
okText: '确认',
|
|
||||||
cancelText: '取消',
|
|
||||||
onOk: () => {
|
|
||||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
|
||||||
handleSuccess();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 保存或者更新
|
|
||||||
* @param params
|
|
||||||
*/
|
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
|
||||||
return defHttp.post({url: url, params});
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
import {BasicColumn} from '/@/components/Table';
|
|
||||||
import {FormSchema} from '/@/components/Table';
|
|
||||||
import { rules} from '/@/utils/helper/validator';
|
|
||||||
import { render } from '/@/utils/common/renderUtils';
|
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
|
||||||
//列表数据
|
|
||||||
export const columns: BasicColumn[] = [
|
|
||||||
{
|
|
||||||
title: '附件1',
|
|
||||||
align:"center",
|
|
||||||
dataIndex: 'fileurl1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '附件2',
|
|
||||||
align:"center",
|
|
||||||
dataIndex: 'fileurl2',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '督办标题',
|
|
||||||
align:"center",
|
|
||||||
dataIndex: 'supervisionTitle'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '督办人',
|
|
||||||
align:"center",
|
|
||||||
dataIndex: 'supervisionPerson_dictText'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '督办部门',
|
|
||||||
align:"center",
|
|
||||||
dataIndex: 'supervisionDepart_dictText'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '督办类型',
|
|
||||||
align:"center",
|
|
||||||
dataIndex: 'supervitionType'
|
|
||||||
},
|
|
||||||
];
|
|
||||||
//查询数据
|
|
||||||
export const searchFormSchema: FormSchema[] = [
|
|
||||||
];
|
|
||||||
//表单数据
|
|
||||||
export const formSchema: FormSchema[] = [
|
|
||||||
{
|
|
||||||
label: '附件1',
|
|
||||||
field: 'fileurl1',
|
|
||||||
component: 'JUpload',
|
|
||||||
componentProps:{
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '附件2',
|
|
||||||
field: 'fileurl2',
|
|
||||||
component: 'JUpload',
|
|
||||||
componentProps:{
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '督办标题',
|
|
||||||
field: 'supervisionTitle',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '督办人',
|
|
||||||
field: 'supervisionPerson',
|
|
||||||
component: 'JSelectUser',
|
|
||||||
componentProps:{
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '督办部门',
|
|
||||||
field: 'supervisionDepart',
|
|
||||||
component: 'JSelectDept',
|
|
||||||
componentProps:{
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '督办类型',
|
|
||||||
field: 'supervitionType',
|
|
||||||
component: 'JPopup',
|
|
||||||
componentProps: ({ formActionType }) => {
|
|
||||||
const {setFieldsValue} = formActionType;
|
|
||||||
return{
|
|
||||||
setFieldsValue:setFieldsValue,
|
|
||||||
code:"",
|
|
||||||
fieldConfig: [
|
|
||||||
{ source: '', target: '' },
|
|
||||||
],
|
|
||||||
multi:true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
// TODO 主键隐藏字段,目前写死为ID
|
|
||||||
{
|
|
||||||
label: '',
|
|
||||||
field: 'id',
|
|
||||||
component: 'Input',
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// 高级查询数据
|
|
||||||
export const superQuerySchema = {
|
|
||||||
fileurl1: {title: '附件1',order: 0,view: 'file', type: 'string',},
|
|
||||||
fileurl2: {title: '附件2',order: 1,view: 'file', type: 'string',},
|
|
||||||
supervisionTitle: {title: '督办标题',order: 2,view: 'text', type: 'string',},
|
|
||||||
supervisionPerson: {title: '督办人',order: 3,view: 'sel_user', type: 'string',},
|
|
||||||
supervisionDepart: {title: '督办部门',order: 4,view: 'sel_depart', type: 'string',},
|
|
||||||
supervitionType: {title: '督办类型',order: 5,view: 'popup', type: 'string',code: '', orgFields: '', destFields: 'supervitionType', popupMulti: false,},
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流程表单调用这个方法获取formSchema
|
|
||||||
* @param param
|
|
||||||
*/
|
|
||||||
export function getBpmFormSchema(_formData): FormSchema[]{
|
|
||||||
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
|
|
||||||
return formSchema;
|
|
||||||
}
|
|
||||||
@@ -1,216 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!--引用表格-->
|
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
|
||||||
<!--插槽:table标题-->
|
|
||||||
<template #tableTitle>
|
|
||||||
<a-button type="primary" v-auth="'supervisiontest:supervision_test:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
|
||||||
<a-button type="primary" v-auth="'supervisiontest:supervision_test:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
|
||||||
<j-upload-button type="primary" v-auth="'supervisiontest:supervision_test:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
|
||||||
|
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
||||||
<template #overlay>
|
|
||||||
<a-menu>
|
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
|
||||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
|
||||||
删除
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</template>
|
|
||||||
<a-button v-auth="'supervisiontest:supervision_test:deleteBatch'">批量操作
|
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
|
||||||
</a-button>
|
|
||||||
</a-dropdown>
|
|
||||||
<!-- 高级查询 -->
|
|
||||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
|
||||||
</template>
|
|
||||||
<!--操作栏-->
|
|
||||||
<template #action="{ record }">
|
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
|
||||||
</template>
|
|
||||||
<!--字段回显插槽-->
|
|
||||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
|
||||||
<template v-if="column.dataIndex==='fileurl1'">
|
|
||||||
<!--文件字段回显插槽-->
|
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
|
||||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex==='fileurl2'">
|
|
||||||
<!--文件字段回显插槽-->
|
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
|
||||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</BasicTable>
|
|
||||||
<!-- 表单区域 -->
|
|
||||||
<SupervisionTestModal @register="registerModal" @success="handleSuccess"></SupervisionTestModal>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="supervisiontest-supervisionTest" setup>
|
|
||||||
import {ref, reactive, computed, unref} from 'vue';
|
|
||||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
|
||||||
import {useModal} from '/@/components/Modal';
|
|
||||||
import { useListPage } from '/@/hooks/system/useListPage'
|
|
||||||
import SupervisionTestModal from './components/SupervisionTestModal.vue'
|
|
||||||
import {columns, searchFormSchema, superQuerySchema} from './SupervisionTest.data';
|
|
||||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './SupervisionTest.api';
|
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({
|
|
||||||
});
|
|
||||||
const queryParam = reactive<any>({});
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
const userStore = useUserStore();
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
//注册model
|
|
||||||
const [registerModal, {openModal}] = useModal();
|
|
||||||
//注册table数据
|
|
||||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
|
||||||
tableProps:{
|
|
||||||
title: 'supervision_test',
|
|
||||||
api: list,
|
|
||||||
columns,
|
|
||||||
canResize:true,
|
|
||||||
formConfig: {
|
|
||||||
//labelWidth: 120,
|
|
||||||
schemas: searchFormSchema,
|
|
||||||
autoSubmitOnEnter:true,
|
|
||||||
showAdvancedButton:true,
|
|
||||||
fieldMapToNumber: [
|
|
||||||
],
|
|
||||||
fieldMapToTime: [
|
|
||||||
],
|
|
||||||
},
|
|
||||||
actionColumn: {
|
|
||||||
width: 120,
|
|
||||||
fixed:'right'
|
|
||||||
},
|
|
||||||
beforeFetch: (params) => {
|
|
||||||
if (params && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (params[key]) {
|
|
||||||
params[key] = getDateByPicker(params[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Object.assign(params, queryParam);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
exportConfig: {
|
|
||||||
name:"supervision_test",
|
|
||||||
url: getExportUrl,
|
|
||||||
params: queryParam,
|
|
||||||
},
|
|
||||||
importConfig: {
|
|
||||||
url: getImportUrl,
|
|
||||||
success: handleSuccess
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
|
||||||
|
|
||||||
// 高级查询配置
|
|
||||||
const superQueryConfig = reactive(superQuerySchema);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 高级查询事件
|
|
||||||
*/
|
|
||||||
function handleSuperQuery(params) {
|
|
||||||
Object.keys(params).map((k) => {
|
|
||||||
queryParam[k] = params[k];
|
|
||||||
});
|
|
||||||
reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 新增事件
|
|
||||||
*/
|
|
||||||
function handleAdd() {
|
|
||||||
openModal(true, {
|
|
||||||
isUpdate: false,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 编辑事件
|
|
||||||
*/
|
|
||||||
function handleEdit(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
function handleDetail(record: Recordable) {
|
|
||||||
openModal(true, {
|
|
||||||
record,
|
|
||||||
isUpdate: true,
|
|
||||||
showFooter: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 删除事件
|
|
||||||
*/
|
|
||||||
async function handleDelete(record) {
|
|
||||||
await deleteOne({id: record.id}, handleSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 批量删除事件
|
|
||||||
*/
|
|
||||||
async function batchHandleDelete() {
|
|
||||||
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 成功回调
|
|
||||||
*/
|
|
||||||
function handleSuccess() {
|
|
||||||
(selectedRowKeys.value = []) && reload();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 操作栏
|
|
||||||
*/
|
|
||||||
function getTableAction(record){
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record),
|
|
||||||
auth: 'supervisiontest:supervision_test:edit'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 下拉操作栏
|
|
||||||
*/
|
|
||||||
function getDropDownAction(record){
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '详情',
|
|
||||||
onClick: handleDetail.bind(null, record),
|
|
||||||
}, {
|
|
||||||
label: '删除',
|
|
||||||
popConfirm: {
|
|
||||||
title: '是否确认删除',
|
|
||||||
confirm: handleDelete.bind(null, record),
|
|
||||||
placement: 'topLeft',
|
|
||||||
},
|
|
||||||
auth: 'supervisiontest:supervision_test:delete'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
:deep(.ant-picker),:deep(.ant-input-number){
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div style="min-height: 400px">
|
|
||||||
<BasicForm @register="registerForm"></BasicForm>
|
|
||||||
<div style="width: 100%;text-align: center" v-if="!formDisabled">
|
|
||||||
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
|
||||||
import {computed, defineComponent} from 'vue';
|
|
||||||
import {defHttp} from '/@/utils/http/axios';
|
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
|
||||||
import {getBpmFormSchema} from '../SupervisionTest.data';
|
|
||||||
import {saveOrUpdate} from '../SupervisionTest.api';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "SupervisionTestForm",
|
|
||||||
components:{
|
|
||||||
BasicForm
|
|
||||||
},
|
|
||||||
props:{
|
|
||||||
formData: propTypes.object.def({}),
|
|
||||||
formBpm: propTypes.bool.def(true),
|
|
||||||
},
|
|
||||||
setup(props){
|
|
||||||
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: getBpmFormSchema(props.formData),
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: {span: 24}
|
|
||||||
});
|
|
||||||
|
|
||||||
const formDisabled = computed(()=>{
|
|
||||||
if(props.formData.disabled === false){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
let formData = {};
|
|
||||||
const queryByIdUrl = '/supervisiontest/supervisionTest/queryById';
|
|
||||||
async function initFormData(){
|
|
||||||
let params = {id: props.formData.dataId};
|
|
||||||
const data = await defHttp.get({url: queryByIdUrl, params});
|
|
||||||
formData = {...data}
|
|
||||||
//设置表单的值
|
|
||||||
await setFieldsValue(formData);
|
|
||||||
//默认是禁用
|
|
||||||
await setProps({disabled: formDisabled.value})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submitForm() {
|
|
||||||
let data = getFieldsValue();
|
|
||||||
let params = Object.assign({}, formData, data);
|
|
||||||
console.log('表单数据', params)
|
|
||||||
await saveOrUpdate(params, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
initFormData();
|
|
||||||
|
|
||||||
return {
|
|
||||||
registerForm,
|
|
||||||
formDisabled,
|
|
||||||
submitForm,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
<template>
|
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
|
||||||
<BasicForm @register="registerForm" name="SupervisionTestForm" />
|
|
||||||
</BasicModal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import {ref, computed, unref, reactive} from 'vue';
|
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
|
||||||
import {formSchema} from '../SupervisionTest.data';
|
|
||||||
import {saveOrUpdate} from '../SupervisionTest.api';
|
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
|
||||||
import { getDateByPicker } from '/@/utils';
|
|
||||||
const { createMessage } = useMessage();
|
|
||||||
// Emits声明
|
|
||||||
const emit = defineEmits(['register','success']);
|
|
||||||
const isUpdate = ref(true);
|
|
||||||
const isDetail = ref(false);
|
|
||||||
//表单配置
|
|
||||||
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
|
|
||||||
labelWidth: 150,
|
|
||||||
schemas: formSchema,
|
|
||||||
showActionButtonGroup: false,
|
|
||||||
baseColProps: {span: 24}
|
|
||||||
});
|
|
||||||
//表单赋值
|
|
||||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
|
||||||
//重置表单
|
|
||||||
await resetFields();
|
|
||||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
|
|
||||||
isUpdate.value = !!data?.isUpdate;
|
|
||||||
isDetail.value = !!data?.showFooter;
|
|
||||||
if (unref(isUpdate)) {
|
|
||||||
//表单赋值
|
|
||||||
await setFieldsValue({
|
|
||||||
...data.record,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 隐藏底部时禁用整个表单
|
|
||||||
setProps({ disabled: !data?.showFooter })
|
|
||||||
});
|
|
||||||
//日期个性化选择
|
|
||||||
const fieldPickers = reactive({
|
|
||||||
});
|
|
||||||
//设置标题
|
|
||||||
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
|
|
||||||
//表单提交事件
|
|
||||||
async function handleSubmit(v) {
|
|
||||||
try {
|
|
||||||
let values = await validate();
|
|
||||||
// 预处理日期数据
|
|
||||||
changeDateValue(values);
|
|
||||||
setModalProps({confirmLoading: true});
|
|
||||||
//提交表单
|
|
||||||
await saveOrUpdate(values, isUpdate.value);
|
|
||||||
//关闭弹窗
|
|
||||||
closeModal();
|
|
||||||
//刷新列表
|
|
||||||
emit('success');
|
|
||||||
} catch ({ errorFields }) {
|
|
||||||
if (errorFields) {
|
|
||||||
const firstField = errorFields[0];
|
|
||||||
if (firstField) {
|
|
||||||
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.reject(errorFields);
|
|
||||||
} finally {
|
|
||||||
setModalProps({confirmLoading: false});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理日期值
|
|
||||||
* @param formData 表单数据
|
|
||||||
*/
|
|
||||||
const changeDateValue = (formData) => {
|
|
||||||
if (formData && fieldPickers) {
|
|
||||||
for (let key in fieldPickers) {
|
|
||||||
if (formData[key]) {
|
|
||||||
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
/** 时间和数字输入框样式 */
|
|
||||||
:deep(.ant-input-number) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-calendar-picker) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user