!4 修改xispeak前端代码

Merge pull request !4 from new_new_new/feature/20260506-branch
This commit is contained in:
new_new_new
2026-05-06 00:56:20 +00:00
committed by Gitee
8 changed files with 1551 additions and 110 deletions
+154
View File
@@ -0,0 +1,154 @@
import { defHttp } from "/@/utils/http/axios";
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/bg/xispeak/bgXiSpeak/rootList',
save='/bg/xispeak/bgXiSpeak/add',
edit='/bg/xispeak/bgXiSpeak/edit',
deleteBgXiSpeak = '/bg/xispeak/bgXiSpeak/delete',
importExcel = '/bg/xispeak/bgXiSpeak/importExcel',
exportXls = '/bg/xispeak/bgXiSpeak/exportXls',
loadTreeData = '/bg/xispeak/bgXiSpeak/loadTreeRoot',
getChildList = '/bg/xispeak/bgXiSpeak/childList',
getChildListBatch = '/bg/xispeak/bgXiSpeak/getChildListBatch',
}
/**
* 导出api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* 导入api
* @param params
*/
export const getImportUrl = Api.importExcel;
/**
* 列表接口
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
* 删除
* @param params
* @param handleSuccess
*/
export const deleteBgXiSpeak = (params,handleSuccess) => {
return defHttp.delete({ url: Api.deleteBgXiSpeak, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
}
/**
* 批量删除
* @param params
* @param handleSuccess
*/
export const batchDeleteBgXiSpeak = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({ url: Api.deleteBgXiSpeak, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
}
});
}
/**
* 保存或者更新
* @param params
* @param isUpdate
*/
export const saveOrUpdateDict = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params },{ isTransformResponse:false });
}
/**
* 查询全部树形节点数据
* @param params
*/
export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData,params });
/**
* 查询子节点数据
* @param params
*/
export const getChildList = (params) => defHttp.get({ url: Api.getChildList, params });
/**
* 批量查询子节点数据
* @param params
*/
export const getChildListBatch = (params) => defHttp.get({ url: Api.getChildListBatch, params },{ isTransformResponse:false });
// ====================== 子表反馈相关API ======================
/**
* 子表列表接口
* @param params
*/
export const bgXiSpeakFeedbackList = (params) => {
if (params['mainId']) {
return defHttp.get({ url: '/bg/xispeak/bgXiSpeak/listBgXiSpeakFeedbackByMainId', params });
}
return Promise.resolve({});
};
/**
* 子表删除单个
*/
export const bgXiSpeakFeedbackDelete = (params, handleSuccess) => {
return defHttp.delete({ url: '/bg/xispeak/bgXiSpeak/deleteBgXiSpeakFeedback', params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
};
/**
* 子表批量删除
* @param params
*/
export const bgXiSpeakFeedbackDeleteBatch = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({ url: '/bg/xispeak/bgXiSpeak/deleteBatchBgXiSpeakFeedback', data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
},
});
};
/**
* 子表保存或者更新
* @param params
* @param isUpdate
*/
export const bgXiSpeakFeedbackSaveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? '/bg/xispeak/bgXiSpeak/editBgXiSpeakFeedback' : '/bg/xispeak/bgXiSpeak/addBgXiSpeakFeedback';
return defHttp.post({ url: url, params }, { isTransformResponse: false });
};
/**
* 子表导入
*/
export const bgXiSpeakFeedbackImportUrl = '/bg/xispeak/bgXiSpeak/importBgXiSpeakFeedback';
/**
* 子表导出
*/
export const bgXiSpeakFeedbackExportXlsUrl = '/bg/xispeak/bgXiSpeak/exportBgXiSpeakFeedback';
+190
View File
@@ -0,0 +1,190 @@
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: '习近平总书记重要讲话指示批示情况',
align: 'center',
dataIndex: 'speakStatus'
},
{
title: '时间',
align: 'center',
dataIndex: 'time',
customRender:({text}) =>{
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
return text;
},
},
{
title: '企业负责同志批示情况',
align: 'center',
dataIndex: 'elmComment'
},
{
title: '学习传达研究部署情况',
align: 'center',
dataIndex: 'status'
},
{
title: '责任人',
align: 'center',
dataIndex: 'responsiblePerson_dictText'
},
{
title: '落实方案',
align: 'center',
dataIndex: 'implPlan'
},
{
title: '牵头部门',
align: 'center',
dataIndex: 'leadDepartment_dictText'
},
{
title: '贯彻落实措施',
align: 'center',
dataIndex: 'implMeasures'
},
{
title: '会议决策数',
align: 'center',
dataIndex: 'numberOfResolutions'
},
{
title: '落实情况',
align: 'left',
dataIndex: 'implStatus'
},
{
title: '落实条数',
align: 'center',
dataIndex: 'implCount'
},
{
title: '已闭环数量',
align: 'center',
dataIndex: 'closedCount'
},
{
title: '报告反馈情况',
align: 'center',
dataIndex: 'reportFeedbackStatus'
},
{
title: '是否存在完成风险(0不存在,1存在)',
align: 'center',
dataIndex: 'isCompletionRisk'
},
{
title: '拖期风险应对措施',
align: 'center',
dataIndex: 'delayRiskMitigation'
},
{
title: '完成状态(0推进中,1已完成)',
align: 'center',
dataIndex: 'completionStatus'
},
{
title: '落实部门id',
align: 'center',
dataIndex: 'implDept_dictText'
},
{
title: '层深(最顶层节点层深为0)',
align: 'center',
dataIndex: 'treeDepth'
},
{
title: '同级数据排序号',
align: 'center',
dataIndex: 'sortOrder'
},
{
title: '流程引擎状态字段',
align: 'center',
dataIndex: 'bpmStatus'
},
{
title: '督办次数',
align: 'center',
dataIndex: 'supervisionCount'
},
];
//子表列表数据
export const bgXiSpeakFeedbackColumns: BasicColumn[] = [
{
title: '反馈部门id',
align: 'center',
dataIndex: 'responDeptid',
},
{
title: '反馈部门名称',
align: 'center',
dataIndex: 'responDeptname',
},
{
title: '反馈人id',
align: 'center',
dataIndex: 'responPersonid',
},
{
title: '反馈人姓名',
align: 'center',
dataIndex: 'responPersonname',
},
{
title: '反馈时间',
align: 'center',
dataIndex: 'responTime',
customRender: ({ text }) => {
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
return text;
},
},
{
title: '落实情况',
align: 'center',
dataIndex: 'implStatus',
},
{
title: '完成状态',
align: 'center',
dataIndex: 'completionStatus',
},
{
title: '外键',
align: 'center',
dataIndex: 'mainId',
},
];
// 高级查询数据
export const superQuerySchema = {
speakStatus: {title: '习近平总书记重要讲话指示批示情况',order: 1,view: 'text', type: 'string',},
time: {title: '时间',order: 2,view: 'date', type: 'string',},
elmComment: {title: '企业负责同志批示情况',order: 3,view: 'text', type: 'string',},
status: {title: '学习传达研究部署情况',order: 4,view: 'text', type: 'string',},
responsiblePerson: {title: '责任人',order: 5,view: 'sel_user', type: 'string',},
implPlan: {title: '落实方案',order: 6,view: 'text', type: 'string',},
leadDepartment: {title: '牵头部门',order: 7,view: 'sel_depart', type: 'string',},
implMeasures: {title: '贯彻落实措施',order: 8,view: 'text', type: 'string',},
numberOfResolutions: {title: '会议决策数',order: 9,view: 'number', type: 'number',},
implStatus: {title: '落实情况',order: 10,view: 'text', type: 'string',},
implCount: {title: '落实条数',order: 11,view: 'number', type: 'number',},
closedCount: {title: '已闭环数量',order: 12,view: 'number', type: 'number',},
reportFeedbackStatus: {title: '报告反馈情况',order: 13,view: 'text', type: 'string',},
isCompletionRisk: {title: '是否存在完成风险(0不存在,1存在)',order: 14,view: 'number', type: 'number',},
delayRiskMitigation: {title: '拖期风险应对措施',order: 15,view: 'text', type: 'string',},
completionStatus: {title: '完成状态(0推进中,1已完成)',order: 16,view: 'number', type: 'number',},
implDept: {title: '落实部门id',order: 17,view: 'sel_depart', type: 'string',},
treeDepth: {title: '层深(最顶层节点层深为0)',order: 18,view: 'number', type: 'number',},
sortOrder: {title: '同级数据排序号',order: 19,view: 'number', type: 'number',},
bpmStatus: {title: '流程引擎状态字段',order: 21,view: 'number', type: 'number',},
supervisionCount: {title: '督办次数',order: 22,view: 'number', type: 'number',},
};
+639
View File
@@ -0,0 +1,639 @@
<template>
<div class="erpNativeList">
<div class="content">
<!--引用表格-->
<BasicTable
@register="registerTable"
:rowSelection="rowSelection"
:expandedRowKeys="expandedRowKeys"
@expand="handleExpand"
@fetch-success="onFetchSuccess"
>
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:add'" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button>
<j-upload-button type="primary" v-auth="'bg.xispeak:bg_xi_speak: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="'bg.xispeak:bg_xi_speak:deleteBatch'"
>批量操作
<Icon icon="ant-design:down-outlined"></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>
</BasicTable>
<!--子表表格tab-->
<a-tabs defaultActiveKey="1">
<a-tab-pane tab="习总书记重要讲话反馈表" key="1">
<BgXiSpeakFeedbackList />
</a-tab-pane>
</a-tabs>
</div>
<!-- 表单区域 -->
<BgXiSpeakModal ref="registerModal" @success="handleSuccess"></BgXiSpeakModal>
<!-- 审批记录 -->
<BpmPictureModal @register="registerBpmModal" />
<FlowScheduleStartModal ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
<BusinessProcessListModal ref="businessProcessListModalRef" />
</div>
</template>
<script lang="ts" name="bg.xispeak-bgXiSpeak" setup>
import { ref, reactive, unref, computed, provide } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { useModal } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { startProcessSchedules } from '/@/api/common/api';
import { dateUtil } from '/@/utils/dateUtil';
import BgXiSpeakModal from './components/BgXiSpeakModal.vue';
import BgXiSpeakFeedbackList from './BgXiSpeakFeedbackList.vue';
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue';
import { columns as taskTaskColumns } from '/@/views/taskProcess/TaskTask.data';
import { columns, superQuerySchema } from './BgXiSpeak.data';
import { list, deleteBgXiSpeak, batchDeleteBgXiSpeak, getExportUrl, getImportUrl, getChildList, getChildListBatch } from './BgXiSpeak.api';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
const FLOW_CODE = 'dev_bg_xi_speak_001';
const FLOW_NAME = '习总书记重要讲话指示批示';
const BUSINESS_TABLE_NAME = 'bg_xi_speak';
const FORM_URL = 'bg/xispeak/components/BgXiSpeakForm';
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
const { createMessage } = useMessage();
const expandedRowKeys = ref([]);
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const flowScheduleModalRef = ref();
const businessProcessListModalRef = ref();
const processColumns = taskTaskColumns;
// 是否显示DW领导列表选择
const showSdwLeaderSelect = computed(() => queryParam.value.needSdwApproval === '1');
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '习总书记重要讲话指示批示情况',
api: list,
columns,
canResize: false,
useSearchForm: false,
isTreeTable: true,
clickToRowSelect: true,
rowSelection: { type: 'radio' },
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
params.hasQuery = 'true';
return Object.assign(params, queryParam.value);
},
pagination: {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20'],
},
},
exportConfig: {
name: '习总书记重要讲话指示批示情况',
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: success,
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
provide('mainId', mainId);
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4,
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
// 高级查询配置
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam.value[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
async function handleEdit(record) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
async function handleDetail(record) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteBgXiSpeak({ id: record.id }, success);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
const ids = selectedRowKeys.value.filter((item) => !item.includes('loadChild'));
await batchDeleteBgXiSpeak({ id: ids }, success);
}
/**
* 成功回调刷新页面
*/
function success() {
selectedRowKeys.value = [];
reload();
}
/**
* 成功回调
*/
async function handleSuccess({ isUpdate, values, expandedArr, changeParent }) {
if (isUpdate) {
if (changeParent) {
reload();
} else {
let data = await list({ id: values.id, pageSize: 1, pageNo: 1, pid: values['pid'] });
if (data && data.records && data.records.length > 0) {
updateTableDataRecord(values.id, data.records[0]);
} else {
updateTableDataRecord(values.id, values);
}
}
} else {
if (!values['id'] || !values['pid']) {
reload();
} else {
expandedRowKeys.value = [];
for (let key of unref(expandedArr)) {
await expandTreeNode(key);
}
}
}
}
/**
* 添加下级
*/
function handleAddSub(record) {
registerModal.value.disableSubmit = false;
registerModal.value.add(record);
}
/**
* 接口请求成功后回调
*/
function onFetchSuccess(result) {
getDataByResult(result.items) && loadDataByExpandedRows();
}
/**
* 根据已展开的行查询数据
*/
async function loadDataByExpandedRows() {
if (unref(expandedRowKeys).length > 0) {
const res = await getChildListBatch({ parentIds: unref(expandedRowKeys).join(',') });
if (res.success && res.result.records.length > 0) {
let records = res.result.records;
const listMap = new Map();
for (let item of records) {
let pid = item['pid'];
if (unref(expandedRowKeys).includes(pid)) {
let mapList = listMap.get(pid);
if (mapList == null) {
mapList = [];
}
mapList.push(item);
listMap.set(pid, mapList);
}
}
let childrenMap = listMap;
let fn = (list) => {
if (list) {
list.forEach((data) => {
if (unref(expandedRowKeys).includes(data.id)) {
data.children = getDataByResult(childrenMap.get(data.id));
fn(data.children);
}
});
}
};
fn(getDataSource());
}
}
}
/**
* 处理数据集
*/
function getDataByResult(result) {
if (result && result.length > 0) {
return result.map((item) => {
if (item['hasChild'] == '1') {
let loadChild = { id: item.id + '_loadChild', name: 'loading...', isLoading: true };
item.children = [loadChild];
}
return item;
});
}
}
/**
* 树节点展开合并
*/
async function handleExpand(expanded, record) {
if (expanded) {
expandedRowKeys.value.push(record.id);
if (record.children.length > 0 && !!record.children[0].isLoading) {
let result = await getChildList({ pid: record.id });
result = result.records ? result.records : result;
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null;
record.hasChild = '0';
}
}
} else {
let keyIndex = expandedRowKeys.value.indexOf(record.id);
if (keyIndex >= 0) {
expandedRowKeys.value.splice(keyIndex, 1);
}
}
}
/**
* 操作表格后处理树节点展开合并
*/
async function expandTreeNode(key) {
let record = findTableDataRecord(key);
expandedRowKeys.value.push(key);
let result = await getChildList({ pid: key });
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null;
record.hasChild = '0';
}
updateTableDataRecord(key, record);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'bg.xispeak:bg_xi_speak:edit',
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
let dropDownAction = [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '添加下级',
onClick: handleAddSub.bind(null, { pid: record.id }),
},
{
label: '删除',
popConfirm: {
title: '确定删除吗?',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'bg.xispeak:bg_xi_speak:delete',
},
{
label: '审批进度',
onClick: handlePreviewPic.bind(null, record),
ifShow: !!record.bpmStatus && record.bpmStatus !== '1',
},
{
label: '查询督办流程',
onClick: handleQueryProcess.bind(null, record),
},
];
if (record.bpmStatus == '1' || !record.bpmStatus) {
dropDownAction.push({
label: '发起流程',
onClick: handleProcess.bind(null, record),
});
}
return dropDownAction;
}
function handleProcess(record) {
flowScheduleModalRef.value?.open({
title: '发起流程',
payload: { record },
});
}
function handleQueryProcess(record) {
businessProcessListModalRef.value?.open({
title: '流程列表',
businessId: record.id,
columns: '',
});
}
async function handleFlowScheduleConfirm({ payload, options }) {
const record = payload?.record || {};
const formatDate = (value, format) => {
return value ? dateUtil(value).format(format) : undefined;
};
// 合并选中的DW领导列表到record中
const recordWithSdwLeader = {
...record,
sdwLeaderList: queryParam.value.sdwLeaderList || '',
needSdwApproval: queryParam.value.needSdwApproval || '',
};
const params = {
intervalType: options.intervalType,
startCount: options.startCount,
taskTask: {
triggerType: options.triggerType,
startTime: options.intervalStartTime,
flowCode: FLOW_CODE,
formUrl: FORM_URL,
flowName: FLOW_NAME,
jsonData: recordWithSdwLeader,
businessTablename: BUSINESS_TABLE_NAME,
businessId: record.id,
title: record.speakStatus,
content: record.implStatus,
urgencyLevel: record.completionStatus,
deptId: record.leadDepartment,
deptLeaderId: record.responsiblePerson,
requireFinishDate: formatDate(record.time, 'YYYY-MM-DD'),
deadline: formatDate(record.time, 'YYYY-MM-DD HH:mm:ss'),
},
};
await startProcessSchedules(params);
handleSuccess({ isUpdate: false, values: {}, expandedArr: [], changeParent: false });
}
async function handlePreviewPic(record) {
bpmPicModal(true, {
flowCode: FLOW_CODE,
dataId: record.id,
});
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
reload();
}
/**
* form点击事件(以逗号分割)
*/
function handleFormJoinChange(key, value) {
if (typeof value != 'string') {
queryParam.value[key] = value.join(',');
}
}
</script>
<style lang="less" scoped>
.erpNativeList {
height: 100%;
padding: 16px;
background: #f5f7fa;
// 查询区域卡片
.search-card {
background: #fff;
border-radius: 8px;
padding: 20px 24px;
margin-bottom: 16px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
transition: box-shadow 0.3s ease;
&:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
:deep(.ant-form-item) {
margin-bottom: 0;
}
:deep(.ant-select),
:deep(.ant-picker) {
border-radius: 6px;
}
}
// 内容区域
.content {
background: #fff;
border-radius: 8px;
padding: 0;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
overflow: hidden;
}
// 表格标题区域
:deep(.ant-table-title) {
padding: 16px 20px !important;
border-bottom: 1px solid #f0f0f0;
background: #fafafa;
.ant-btn {
height: 32px;
padding: 0 16px;
border-radius: 6px;
font-size: 13px;
margin-right: 8px;
border: none;
transition: all 0.2s ease;
&:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}
&:active {
transform: translateY(0);
}
}
.ant-btn-primary {
background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
&:hover {
background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
}
}
}
// 表格样式优化
:deep(.ant-table-thead > tr > th) {
background: #fafafa;
font-weight: 600;
color: #333;
border-bottom: 1px solid #f0f0f0;
padding: 12px 16px;
}
:deep(.ant-table-tbody > tr > td) {
padding: 14px 16px;
border-bottom: 1px solid #f5f5f5;
transition: background 0.2s ease;
}
:deep(.ant-table-tbody > tr:hover > td) {
background: #f5f7fa;
}
// 操作按钮样式
:deep(.ant-btn-link) {
padding: 4px 8px;
height: auto;
border-radius: 4px;
&:hover {
background: rgba(24, 144, 255, 0.1);
}
}
// 标签页样式
:deep(.ant-tabs) {
margin: 16px;
.ant-tabs-nav {
margin-bottom: 12px;
}
.ant-tabs-tab {
padding: 8px 0;
font-size: 14px;
&:hover {
color: #1890ff;
}
}
.ant-tabs-tab-active .ant-tabs-tab-btn {
color: #1890ff;
font-weight: 500;
}
}
// 下拉菜单样式
:deep(.ant-dropdown-menu-item) {
border-radius: 4px;
margin: 2px 4px;
&:hover {
background: #e6f7ff;
}
}
// 分页样式
:deep(.ant-pagination) {
padding: 16px 20px;
margin: 0 !important;
border-top: 1px solid #f0f0f0;
background: #fafafa;
}
// 搜索和重置按钮
:deep(.ant-form-item-with-search) {
display: flex;
justify-content: flex-end;
gap: 8px;
}
}
// 响应式适配
@media (max-width: 768px) {
.erpNativeList {
padding: 12px;
.search-card {
padding: 16px;
}
}
}
</style>
@@ -0,0 +1,365 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BgXiSpeakForm">
<a-row :gutter="20">
<a-col :span="24">
<a-form-item label="习近平总书记重要讲话指示批示情况" v-bind="validateInfos.speakStatus">
<a-input v-model:value="formData.speakStatus" placeholder="请输入重要指示批示情况" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="时间" v-bind="validateInfos.time">
<a-date-picker placeholder="请选择时间" v-model:value="formData.time" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="责任人" v-bind="validateInfos.responsiblePerson">
<j-select-user v-model:value="formData.responsiblePerson" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="是否需要督办领导" v-bind="validateInfos.needSdwApproval">
<a-radio-group v-model:value="formData.needSdwApproval" class="radio-group">
<a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="24" v-if="formData.needSdwApproval === 1">
<a-form-item label="督导领导列表" v-bind="validateInfos.sdwLeaderList">
<j-select-user v-model:value="formData.sdwLeaderList" :multiple="true" allow-clear placeholder="请选择督导领导" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="企业负责同志批示情况" v-bind="validateInfos.elmComment">
<a-input v-model:value="formData.elmComment" placeholder="请输入" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学习传达研究部署情况" v-bind="validateInfos.status">
<a-input v-model:value="formData.status" placeholder="请输入" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="牵头部门" v-bind="validateInfos.leadDepartment">
<j-select-dept v-model:value="formData.leadDepartment" :multiple="true" checkStrictly allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="落实部门" v-bind="validateInfos.implDept">
<j-select-dept v-model:value="formData.implDept" :multiple="true" checkStrictly allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="落实方案" v-bind="validateInfos.implPlan">
<a-input v-model:value="formData.implPlan" placeholder="请输入" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="贯彻落实措施" v-bind="validateInfos.implMeasures">
<a-input v-model:value="formData.implMeasures" placeholder="请输入" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="会议决策数" v-bind="validateInfos.numberOfResolutions">
<a-input-number v-model:value="formData.numberOfResolutions" placeholder="请输入" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="落实条数" v-bind="validateInfos.implCount">
<a-input-number v-model:value="formData.implCount" placeholder="请输入" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="已闭环数量" v-bind="validateInfos.closedCount">
<a-input-number v-model:value="formData.closedCount" placeholder="请输入" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="落实情况" v-bind="validateInfos.implStatus">
<a-input v-model:value="formData.implStatus" placeholder="请输入" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="报告反馈情况" v-bind="validateInfos.reportFeedbackStatus">
<a-input v-model:value="formData.reportFeedbackStatus" placeholder="请输入" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="是否存在完成风险">
<a-radio-group v-model:value="formData.isCompletionRisk" class="radio-group">
<a-radio :value="0">不存在</a-radio>
<a-radio :value="1">存在</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="完成状态">
<a-radio-group v-model:value="formData.completionStatus" class="radio-group">
<a-radio :value="0">推进中</a-radio>
<a-radio :value="1">已完成</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="拖期风险应对措施" v-bind="validateInfos.delayRiskMitigation">
<a-input v-model:value="formData.delayRiskMitigation" placeholder="请输入" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="督办次数" v-bind="validateInfos.supervisionCount">
<a-input-number v-model:value="formData.supervisionCount" placeholder="请输入" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="父级节点" v-bind="validateInfos.pid">
<j-tree-select
v-model:value="formData.pid"
dict="bg_xi_speak,impl_status,id"
pidField="pid"
pidValue="0"
hasChildField="has_child"
:disabled="disabled"
/>
</a-form-item>
</a-col>
<a-col v-if="showFlowSubmitButton" :span="24" class="submit-area">
<a-button preIcon="ant-design:check-outlined" style="width: 140px; height: 40px" type="primary" @click="submitForm"> </a-button>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, unref, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
import JTreeSelect from '/@/components/Form/src/jeecg/components/JTreeSelect.vue';
import { getValueType } from '/@/utils';
import { loadTreeData, saveOrUpdateDict } from '../BgXiSpeak.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import { usePermission } from '/@/hooks/web/usePermission';
const { initBpmFormData } = usePermission();
const useForm = Form.useForm;
const formRef = ref();
const expandedRowKeys = ref([]);
const treeData = ref([]);
const emit = defineEmits(['register', 'ok']);
let model: Nullable<Recordable> = null;
// 1. 初始化值修改:needSdwApproval 默认为 0
const formData = reactive<Record<string, any>>({
id: '',
pid: '',
speakStatus: '',
time: '',
elmComment: '',
status: '',
responsiblePerson: '',
needSdwApproval: 0,
sdwLeaderList: '',
implPlan: '',
leadDepartment: '',
implMeasures: '',
numberOfResolutions: undefined,
implStatus: '',
implCount: undefined,
closedCount: undefined,
reportFeedbackStatus: '',
isCompletionRisk: undefined,
delayRiskMitigation: '',
completionStatus: undefined,
implDept: '',
treeDepth: undefined,
sortOrder: undefined,
delFlag: undefined,
bpmStatus: undefined,
supervisionCount: undefined,
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 18 } });
const confirmLoading = ref<boolean>(false);
// 2. 表单验证:明确 needSdwApproval 的验证
const validatorRules = reactive({
needSdwApproval: [{ required: true, message: '请选择是否需要督办领导' }],
speakStatus: [{ required: true, message: '请输入指示批示情况' }],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true },
});
const disabled = computed(() => {
if (props.formBpm === true) {
return props.formData.disabled !== false;
}
return props.formDisabled;
});
onMounted(() => {
initBpmFormData(props.formData);
initFormData();
});
const queryByIdUrl = '/bg/xispeak/bgXiSpeak/queryById';
async function initFormData() {
if (props.formBpm === true && props.formData.dataId) {
let params = { id: props.formData.dataId };
const data = await defHttp.get({ url: queryByIdUrl, params });
edit({ ...data });
}
}
const showFlowSubmitButton = computed(() => {
if (props.formBpm === true) {
return props.formData.disabled === false;
}
return false;
});
function add(obj = {}) {
edit(obj);
}
function edit(record) {
nextTick(async () => {
resetFields();
expandedRowKeys.value = [];
treeData.value = await loadTreeData({ async: false, pcode: '' });
const tmpData = {};
Object.keys(formData).forEach((key) => {
// 3. 赋值增强:处理后端返回 null 的情况
if (record.hasOwnProperty(key)) {
tmpData[key] = record[key] === null ? (key === 'needSdwApproval' ? 0 : '') : record[key];
}
});
Object.assign(formData, tmpData);
model = { ...tmpData };
});
}
function getExpandKeysByPid(pid, arr) {
if (pid && arr && arr.length > 0) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].key == pid && unref(expandedRowKeys).indexOf(pid) < 0) {
expandedRowKeys.value.push(arr[i].key);
getExpandKeysByPid(arr[i]['parentId'], unref(treeData));
} else if (arr[i].children) {
getExpandKeysByPid(pid, arr[i].children);
}
}
}
}
async function submitForm() {
try {
await validate();
} catch ({ errorFields }) {
if (errorFields && errorFields[0]) {
formRef.value.scrollToField(errorFields[0].name, { behavior: 'smooth', block: 'center' });
}
return Promise.reject(errorFields);
}
// 4. 提交兜底:确保数值有效
if (formData.needSdwApproval === undefined || formData.needSdwApproval === null) {
formData.needSdwApproval = 0;
}
confirmLoading.value = true;
const isUpdate = !!formData.id;
// 拷贝一份数据进行转换,避免污染原始响应式对象
const params = { ...formData };
for (let key in params) {
if (params[key] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, key);
if (valueType === 'string') {
params[key] = params[key].join(',');
}
}
}
await saveOrUpdateDict(params, isUpdate)
.then(async (res) => {
if (res.success) {
await getExpandKeysByPid(params['pid'], unref(treeData));
delete params['children'];
emit('ok', {
isUpdate: isUpdate,
values: { ...params },
expandedArr: unref(expandedRowKeys).reverse(),
changeParent: model != null && model['pid'] != params['pid'],
});
createMessage.success(res.message);
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({ add, edit, submitForm });
</script>
<style lang="less" scoped>
/* 保持原有样式不变 */
.antd-modal-form {
padding: 20px;
.submit-area {
text-align: center;
padding-top: 16px;
margin-top: 8px;
border-top: 1px dashed #e8e8e8;
}
:deep(.ant-form-item-label > label) {
font-weight: 500;
color: #333;
}
:deep(.ant-radio-group.radio-group .ant-radio-wrapper) {
margin-right: 16px;
font-size: 14px;
}
:deep(.ant-input),
:deep(.ant-input-number),
:deep(.ant-select),
:deep(.ant-picker) {
border-radius: 6px;
transition: all 0.3s ease;
&:hover {
border-color: #40a9ff;
}
}
:deep(.ant-btn-primary) {
height: 40px;
padding: 0 32px;
border-radius: 6px;
background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
border: none;
font-size: 15px;
&:hover {
background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
}
}
}
</style>
@@ -0,0 +1,89 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<BgXiSpeakForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></BgXiSpeakForm>
<template #footer>
<a-button @click="handleCancel">取消</a-button>
<a-button :class="{ 'jee-hidden': disableSubmit }" type="primary" @click="handleOk">确认</a-button>
</template>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import BgXiSpeakForm from './BgXiSpeakForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';
const { createMessage } = useMessage();
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add(obj={}) {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add(obj);
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback({ isUpdate, values, expandedArr, changeParent }) {
handleCancel();
emit('success', {
isUpdate: isUpdate,
values: values,
expandedArr: expandedArr,
// 是否更改了父级节点
changeParent: changeParent,
});
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>