合并
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
|
|||||||
VITE_APP_ENV = 'development'
|
VITE_APP_ENV = 'development'
|
||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API = 'http://192.168.110.180:8898'
|
VITE_APP_BASE_API = 'http://192.168.110.159:8898'
|
||||||
|
|
||||||
# 无人机接口地址
|
# 无人机接口地址
|
||||||
|
|
||||||
|
@ -26,6 +26,9 @@
|
|||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import useNoticeStore from '@/store/modules/notice';
|
import useNoticeStore from '@/store/modules/notice';
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
const noticeStore = storeToRefs(useNoticeStore());
|
const noticeStore = storeToRefs(useNoticeStore());
|
||||||
const { readAll } = useNoticeStore();
|
const { readAll } = useNoticeStore();
|
||||||
|
|
||||||
@ -50,6 +53,11 @@ const onNewsClick = (item: any) => {
|
|||||||
newsList.value[item].read = true;
|
newsList.value[item].read = true;
|
||||||
//并且写入pinia
|
//并且写入pinia
|
||||||
noticeStore.state.value.notices = newsList.value;
|
noticeStore.state.value.notices = newsList.value;
|
||||||
|
//如果有formPath,就前往
|
||||||
|
console.log('🚀 ~ onNewsClick ~ item.formPath:', item.formPath, newsList.value);
|
||||||
|
if (newsList.value[item].formPath) {
|
||||||
|
proxy?.$tab.openPage('/' + newsList.value[item].formPath, '', { id: newsList.value[item].businessId, type: 'view' });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 前往通知中心点击
|
// 前往通知中心点击
|
||||||
|
@ -5,11 +5,22 @@ interface NoticeItem {
|
|||||||
read: boolean;
|
read: boolean;
|
||||||
message: any;
|
message: any;
|
||||||
time: string;
|
time: string;
|
||||||
|
formPath?: string;
|
||||||
|
businessId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useNoticeStore = defineStore('notice', () => {
|
export const useNoticeStore = defineStore('notice', () => {
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
notices: [] as NoticeItem[]
|
notices: [
|
||||||
|
{
|
||||||
|
title: '通知公告',
|
||||||
|
read: false,
|
||||||
|
message: '这是一条通知公告',
|
||||||
|
time: '2023-01-01',
|
||||||
|
formPath: 'design-management/scheme/indexEdit',
|
||||||
|
businessId: '1955636050617094146'
|
||||||
|
}
|
||||||
|
] as NoticeItem[]
|
||||||
});
|
});
|
||||||
|
|
||||||
const addNotice = (notice: NoticeItem) => {
|
const addNotice = (notice: NoticeItem) => {
|
||||||
|
@ -3,19 +3,31 @@
|
|||||||
<div class="max-w-4xl mx-auto">
|
<div class="max-w-4xl mx-auto">
|
||||||
<!-- 顶部按钮区域 -->
|
<!-- 顶部按钮区域 -->
|
||||||
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||||
<approvalButton @submitForm="submitForm" @approvalVerifyOpen="approvalVerifyOpen"
|
<approvalButton
|
||||||
@handleApprovalRecord="handleApprovalRecord" :buttonLoading="buttonLoading" :id="form.versions"
|
@submitForm="submitForm"
|
||||||
:status="form.status" :pageType="routeParams.type" />
|
@approvalVerifyOpen="approvalVerifyOpen"
|
||||||
|
@handleApprovalRecord="handleApprovalRecord"
|
||||||
|
:buttonLoading="buttonLoading"
|
||||||
|
:id="form.versions"
|
||||||
|
:status="form.status"
|
||||||
|
:pageType="routeParams.type"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<el-card
|
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||||
class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
|
||||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||||
<h3 class="text-lg font-semibold text-gray-800">设计原则</h3>
|
<h3 class="text-lg font-semibold text-gray-800">设计原则</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-6">
|
<div class="p-6">
|
||||||
<el-form ref="leaveFormRef" v-loading="loading" :disabled="routeParams.type === 'view'" :model="form"
|
<el-form
|
||||||
:rules="rules" label-width="100px" class="space-y-4">
|
ref="leaveFormRef"
|
||||||
|
v-loading="loading"
|
||||||
|
:disabled="routeParams.type === 'view'"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="100px"
|
||||||
|
class="space-y-4"
|
||||||
|
>
|
||||||
<div class="grid grid-cols-1 gap-4">
|
<div class="grid grid-cols-1 gap-4">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -26,8 +38,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table :data="tableData"
|
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
|
||||||
style="width: 100%; margin-bottom: 20px;height: calc(100vh - 305px);" row-key="id" border>
|
|
||||||
<el-table-column prop="num" label="编号" />
|
<el-table-column prop="num" label="编号" />
|
||||||
<el-table-column prop="name" label="名称" />
|
<el-table-column prop="name" label="名称" />
|
||||||
<el-table-column prop="specification" label="规格" />
|
<el-table-column prop="specification" label="规格" />
|
||||||
@ -41,8 +52,14 @@
|
|||||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||||
<!-- 流程选择对话框 -->
|
<!-- 流程选择对话框 -->
|
||||||
<el-dialog draggable v-model="dialogVisible.visible" :title="dialogVisible.title" :before-close="handleClose"
|
<el-dialog
|
||||||
width="500" class="rounded-lg shadow-lg">
|
draggable
|
||||||
|
v-model="dialogVisible.visible"
|
||||||
|
:title="dialogVisible.title"
|
||||||
|
:before-close="handleClose"
|
||||||
|
width="500"
|
||||||
|
class="rounded-lg shadow-lg"
|
||||||
|
>
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||||
@ -51,10 +68,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||||
<el-button @click="handleClose"
|
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||||
class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors">取消</el-button>
|
>取消</el-button
|
||||||
<el-button type="primary" @click="submitFlow()"
|
>
|
||||||
class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors">确认</el-button>
|
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||||
|
>确认</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -95,8 +114,8 @@ const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
|||||||
const flowCodeOptions = [
|
const flowCodeOptions = [
|
||||||
{
|
{
|
||||||
value: currentProject.value?.id + '_equipmentList',
|
value: currentProject.value?.id + '_equipmentList',
|
||||||
label: '物资设备清单审核'
|
label: '工程量清单审核'
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const leaveFormRef = ref<ElFormInstance>();
|
const leaveFormRef = ref<ElFormInstance>();
|
||||||
@ -121,7 +140,7 @@ const initFormData = {
|
|||||||
};
|
};
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
tableData:[],
|
tableData: [],
|
||||||
rules: {}
|
rules: {}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -130,7 +149,7 @@ const handleClose = () => {
|
|||||||
flowCode.value = '';
|
flowCode.value = '';
|
||||||
buttonLoading.value = false;
|
buttonLoading.value = false;
|
||||||
};
|
};
|
||||||
const { form, rules,tableData } = toRefs(data);
|
const { form, rules, tableData } = toRefs(data);
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
@ -144,11 +163,11 @@ const getInfo = () => {
|
|||||||
buttonLoading.value = false;
|
buttonLoading.value = false;
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
const res = await detailsMaterialAndEquipmentApproval(routeParams.value.id);
|
const res = await detailsMaterialAndEquipmentApproval(routeParams.value.id);
|
||||||
console.log('res.data',res.data);
|
console.log('res.data', res.data);
|
||||||
|
|
||||||
Object.assign(form.value, res.data);
|
Object.assign(form.value, res.data);
|
||||||
console.log('form',form.value);
|
console.log('form', form.value);
|
||||||
|
|
||||||
tableData.value = res.data.auditData;
|
tableData.value = res.data.auditData;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
buttonLoading.value = false;
|
buttonLoading.value = false;
|
||||||
@ -227,8 +246,7 @@ onMounted(() => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||||
getInfo();
|
getInfo();
|
||||||
console.log('routeParams.value',routeParams.value);
|
console.log('routeParams.value', routeParams.value);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -10,9 +10,6 @@
|
|||||||
<el-form-item label="消息标识" prop="msgKey">
|
<el-form-item label="消息标识" prop="msgKey">
|
||||||
<el-input v-model="queryParams.msgKey" placeholder="请输入消息标识" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.msgKey" placeholder="请输入消息标识" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="跳转路由" prop="route">
|
|
||||||
<el-input v-model="queryParams.route" placeholder="请输入跳转路由" clearable @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="通知人" prop="userId">
|
<el-form-item label="通知人" prop="userId">
|
||||||
<el-input v-model="queryParams.userId" placeholder="请输入通知人" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.userId" placeholder="请输入通知人" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -41,7 +38,7 @@
|
|||||||
<el-table-column label="消息名称" align="center" prop="msgName" />
|
<el-table-column label="消息名称" align="center" prop="msgName" />
|
||||||
<el-table-column label="消息模板" align="center" prop="msgContent" />
|
<el-table-column label="消息模板" align="center" prop="msgContent" />
|
||||||
<el-table-column label="消息标识" align="center" prop="msgKey" />
|
<el-table-column label="消息标识" align="center" prop="msgKey" />
|
||||||
<el-table-column label="跳转路由" align="center" prop="route" />
|
<!-- <el-table-column label="跳转路由" align="center" prop="route" /> -->
|
||||||
<el-table-column label="通知人" align="center" prop="userId" />
|
<el-table-column label="通知人" align="center" prop="userId" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@ -73,9 +70,15 @@
|
|||||||
<el-input v-model="form.route" placeholder="请输入跳转路由" />
|
<el-input v-model="form.route" placeholder="请输入跳转路由" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通知部门" prop="deptId">
|
<el-form-item label="通知部门" prop="deptId">
|
||||||
<el-select v-model="form.deptId" placeholder="请选择通知部门" filterable @change="getUser">
|
<el-tree-select
|
||||||
<el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
|
v-model="form.deptId"
|
||||||
</el-select>
|
:data="deptList"
|
||||||
|
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||||
|
value-key="id"
|
||||||
|
placeholder="请选择归属部门"
|
||||||
|
check-strictly
|
||||||
|
@change="handleDeptChange"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通知人" prop="userId">
|
<el-form-item label="通知人" prop="userId">
|
||||||
<el-select v-model="form.userId" placeholder="请选择通知人" multiple filterable :disabled="!form.deptId">
|
<el-select v-model="form.userId" placeholder="请选择通知人" multiple filterable :disabled="!form.deptId">
|
||||||
@ -96,7 +99,8 @@
|
|||||||
<script setup name="Config" lang="ts">
|
<script setup name="Config" lang="ts">
|
||||||
import { listConfig, getConfig, delConfig, addConfig, updateConfig, listUsers } from '@/api/message/config';
|
import { listConfig, getConfig, delConfig, addConfig, updateConfig, listUsers } from '@/api/message/config';
|
||||||
import { ConfigVO, ConfigQuery, ConfigForm } from '@/api/message/config/types';
|
import { ConfigVO, ConfigQuery, ConfigForm } from '@/api/message/config/types';
|
||||||
import { listUser } from '@/api/system/user';
|
import { DeptTreeVO } from '@/api/system/dept/types';
|
||||||
|
import { deptTreeSelect, listUser } from '@/api/system/user';
|
||||||
import { useUserStoreHook } from '@/store/modules/user';
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
@ -225,6 +229,7 @@ const submitForm = () => {
|
|||||||
if (form.value.id) {
|
if (form.value.id) {
|
||||||
await updateConfig(form.value).finally(() => (buttonLoading.value = false));
|
await updateConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||||
} else {
|
} else {
|
||||||
|
form.value.userId = form.value.userId.join(',');
|
||||||
await addConfig(form.value).finally(() => (buttonLoading.value = false));
|
await addConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||||
}
|
}
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
@ -254,24 +259,42 @@ const handleExport = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 获取用户列表 */
|
// /** 获取用户列表 */
|
||||||
const getDept = async () => {
|
// const getDept = async () => {
|
||||||
const res = await listUsers({
|
// const res = await listUsers({
|
||||||
pageNum: 1,
|
// pageNum: 1,
|
||||||
pageSize: 1000,
|
// pageSize: 1000,
|
||||||
projectId: currentProject.value?.id
|
// projectId: currentProject.value?.id
|
||||||
});
|
// });
|
||||||
deptId.value = res.data.deptId;
|
// deptId.value = res.data.deptId;
|
||||||
getListDept();
|
// getListDept();
|
||||||
|
// };
|
||||||
|
/** 查询部门下拉树结构 */
|
||||||
|
const getDeptTree = async () => {
|
||||||
|
const res = await deptTreeSelect({ isShow: '1' });
|
||||||
|
deptList.value = filterDisabledDept(res.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getListDept = async () => {
|
/** 过滤禁用的部门 */
|
||||||
|
const filterDisabledDept = (deptList: DeptTreeVO[]) => {
|
||||||
|
return deptList.filter((dept) => {
|
||||||
|
if (dept.disabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (dept.children && dept.children.length) {
|
||||||
|
dept.children = filterDisabledDept(dept.children);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeptChange = async (value) => {
|
||||||
const res = await listUser({
|
const res = await listUser({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 1000,
|
pageSize: 1000,
|
||||||
deptId: deptId.value
|
deptId: value
|
||||||
});
|
});
|
||||||
deptList.value = res.rows;
|
userList.value = res.rows;
|
||||||
};
|
};
|
||||||
const getUser = async () => {
|
const getUser = async () => {
|
||||||
const res = await listUser({
|
const res = await listUser({
|
||||||
@ -284,7 +307,7 @@ const getUser = async () => {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
getDept();
|
getDeptTree();
|
||||||
});
|
});
|
||||||
|
|
||||||
//监听项目id刷新数据
|
//监听项目id刷新数据
|
||||||
|
Reference in New Issue
Block a user