合并
This commit is contained in:
@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源项目管理平台
|
||||
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 useNoticeStore from '@/store/modules/notice';
|
||||
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const noticeStore = storeToRefs(useNoticeStore());
|
||||
const { readAll } = useNoticeStore();
|
||||
|
||||
@ -50,6 +53,11 @@ const onNewsClick = (item: any) => {
|
||||
newsList.value[item].read = true;
|
||||
//并且写入pinia
|
||||
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;
|
||||
message: any;
|
||||
time: string;
|
||||
formPath?: string;
|
||||
businessId?: string;
|
||||
}
|
||||
|
||||
export const useNoticeStore = defineStore('notice', () => {
|
||||
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) => {
|
||||
|
@ -3,19 +3,31 @@
|
||||
<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">
|
||||
<approvalButton @submitForm="submitForm" @approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord" :buttonLoading="buttonLoading" :id="form.versions"
|
||||
:status="form.status" :pageType="routeParams.type" />
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.versions"
|
||||
:status="form.status"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 表单区域 -->
|
||||
<el-card
|
||||
class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||
<el-card 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">
|
||||
<h3 class="text-lg font-semibold text-gray-800">设计原则</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form ref="leaveFormRef" v-loading="loading" :disabled="routeParams.type === 'view'" :model="form"
|
||||
:rules="rules" label-width="100px" class="space-y-4">
|
||||
<el-form
|
||||
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">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
@ -26,8 +38,7 @@
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-table :data="tableData"
|
||||
style="width: 100%; margin-bottom: 20px;height: calc(100vh - 305px);" row-key="id" border>
|
||||
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
@ -41,8 +52,14 @@
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||
<!-- 流程选择对话框 -->
|
||||
<el-dialog draggable v-model="dialogVisible.visible" :title="dialogVisible.title" :before-close="handleClose"
|
||||
width="500" class="rounded-lg shadow-lg">
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible.visible"
|
||||
:title="dialogVisible.title"
|
||||
:before-close="handleClose"
|
||||
width="500"
|
||||
class="rounded-lg shadow-lg"
|
||||
>
|
||||
<div class="p-4">
|
||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||
@ -51,10 +68,12 @@
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||
<el-button @click="handleClose"
|
||||
class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 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>
|
||||
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 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>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -95,8 +114,8 @@ const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_equipmentList',
|
||||
label: '物资设备清单审核'
|
||||
},
|
||||
label: '工程量清单审核'
|
||||
}
|
||||
];
|
||||
|
||||
const leaveFormRef = ref<ElFormInstance>();
|
||||
@ -228,7 +247,6 @@ onMounted(() => {
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
console.log('routeParams.value', routeParams.value);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -10,9 +10,6 @@
|
||||
<el-form-item label="消息标识" prop="msgKey">
|
||||
<el-input v-model="queryParams.msgKey" placeholder="请输入消息标识" clearable @keyup.enter="handleQuery" />
|
||||
</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-input v-model="queryParams.userId" placeholder="请输入通知人" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
@ -41,7 +38,7 @@
|
||||
<el-table-column label="消息名称" align="center" prop="msgName" />
|
||||
<el-table-column label="消息模板" align="center" prop="msgContent" />
|
||||
<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" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
@ -73,9 +70,15 @@
|
||||
<el-input v-model="form.route" placeholder="请输入跳转路由" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通知部门" prop="deptId">
|
||||
<el-select v-model="form.deptId" placeholder="请选择通知部门" filterable @change="getUser">
|
||||
<el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
|
||||
</el-select>
|
||||
<el-tree-select
|
||||
v-model="form.deptId"
|
||||
:data="deptList"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
value-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
check-strictly
|
||||
@change="handleDeptChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通知人" prop="userId">
|
||||
<el-select v-model="form.userId" placeholder="请选择通知人" multiple filterable :disabled="!form.deptId">
|
||||
@ -96,7 +99,8 @@
|
||||
<script setup name="Config" lang="ts">
|
||||
import { listConfig, getConfig, delConfig, addConfig, updateConfig, listUsers } from '@/api/message/config';
|
||||
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';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@ -225,6 +229,7 @@ const submitForm = () => {
|
||||
if (form.value.id) {
|
||||
await updateConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
form.value.userId = form.value.userId.join(',');
|
||||
await addConfig(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
@ -254,24 +259,42 @@ const handleExport = () => {
|
||||
);
|
||||
};
|
||||
|
||||
/** 获取用户列表 */
|
||||
const getDept = async () => {
|
||||
const res = await listUsers({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
deptId.value = res.data.deptId;
|
||||
getListDept();
|
||||
// /** 获取用户列表 */
|
||||
// const getDept = async () => {
|
||||
// const res = await listUsers({
|
||||
// pageNum: 1,
|
||||
// pageSize: 1000,
|
||||
// projectId: currentProject.value?.id
|
||||
// });
|
||||
// deptId.value = res.data.deptId;
|
||||
// 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({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
deptId: deptId.value
|
||||
deptId: value
|
||||
});
|
||||
deptList.value = res.rows;
|
||||
userList.value = res.rows;
|
||||
};
|
||||
const getUser = async () => {
|
||||
const res = await listUser({
|
||||
@ -284,7 +307,7 @@ const getUser = async () => {
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getDept();
|
||||
getDeptTree();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
|
Reference in New Issue
Block a user