|
@@ -56,9 +56,12 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="mb20">
|
|
|
- <el-button type="primary" @click="onNoticeAdd" v-waves v-auth="'auxiliary:notice:add'">
|
|
|
+ <el-button type="primary" @click="onNoticeAdd" v-if="listType === '0'" v-auth="'auxiliary:notice:add'" title="新增通知">
|
|
|
<SvgIcon name="ele-Plus" class="mr5" />新增
|
|
|
</el-button>
|
|
|
+ <el-button type="primary" @click="onNoticeAdd" v-else v-auth="'auxiliary:bulletin:add'" title="新增公告">
|
|
|
+ <SvgIcon name="ele-Plus" class="mr5" />新增
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<!-- 表格 -->
|
|
|
<el-table :data="state.tableData" v-loading="state.loading" row-key="id" ref="multipleTableRef" @selection-change="handleSelectionChange">
|
|
@@ -69,33 +72,33 @@
|
|
|
<el-table-column prop="circularStateText" label="通知状态" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="title" label="通知标题" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="commonTypeText" label="必须阅读" show-overflow-tooltip>
|
|
|
- <template #default="{ row }">
|
|
|
- {{row.isMustRead ? '是' : '否'}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ row.isMustRead ? '是' : '否' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="commonTypeText" label="已阅读数" show-overflow-tooltip>
|
|
|
- <template #default="{ row }">
|
|
|
- <el-popover placement="right" :width="400" trigger="click">
|
|
|
- <template #reference>
|
|
|
- <el-button link type="primary">{{row.readedNum+'/'+row.needReadNum}}</el-button>
|
|
|
- </template>
|
|
|
- <el-table :data="row.circularReadGroups" v-loading="state.loading" row-key="id" ref="multipleTableRef">
|
|
|
- <el-table-column prop="userName" label="姓名" show-overflow-tooltip v-if="row.circularType === 1"></el-table-column>
|
|
|
- <el-table-column prop="orgName" label="部门名称" show-overflow-tooltip v-if="row.circularType === 2"></el-table-column>
|
|
|
- <el-table-column prop="isRead" label="阅读状态" show-overflow-tooltip>
|
|
|
- <template #default="{ row }">
|
|
|
- {{row.isRead ? '已读' : '未读'}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="isTimeOut" label="超时" show-overflow-tooltip>
|
|
|
- <template #default="{ row }">
|
|
|
- {{row.isTimeOut ? '已超时' : '未超时'}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-popover>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-popover placement="right" :width="400" trigger="click">
|
|
|
+ <template #reference>
|
|
|
+ <el-button link type="primary">{{ row.readedNum + '/' + row.needReadNum }}</el-button>
|
|
|
+ </template>
|
|
|
+ <el-table :data="row.circularReadGroups" v-loading="state.loading" row-key="id" ref="multipleTableRef">
|
|
|
+ <el-table-column prop="userName" label="姓名" show-overflow-tooltip v-if="row.circularType === 1"></el-table-column>
|
|
|
+ <el-table-column prop="orgName" label="部门名称" show-overflow-tooltip v-if="row.circularType === 2"></el-table-column>
|
|
|
+ <el-table-column prop="isRead" label="阅读状态" show-overflow-tooltip>
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ row.isRead ? '已读' : '未读' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="isTimeOut" label="超时" show-overflow-tooltip>
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ row.isTimeOut ? '已超时' : '未超时' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="circularTypeText" label="通知对象" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="commonTypeText" label="通知时间" show-overflow-tooltip width="170">
|
|
|
<template #default="{ row }">
|
|
@@ -128,12 +131,11 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="creatorOrgName" label="来源单位" show-overflow-tooltip></el-table-column>
|
|
|
</template>
|
|
|
- <el-table-column label="操作" width="140" fixed="right" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-button link type="primary" @click="onDetail(row)" v-auth="'auxiliary:notice:detail'"> 查看详情 </el-button>
|
|
|
- <el-button link type="primary" @click="onEdit(row)" v-auth="'auxiliary:notice:edit'"> 编辑 </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column label="操作" width="140" fixed="right" align="center">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-button link type="primary" @click="onDetail(row)" v-auth="'auxiliary:notice:detail'"> 查看详情 </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<template #empty>
|
|
|
<Empty />
|
|
|
</template>
|
|
@@ -148,14 +150,14 @@
|
|
|
</el-card>
|
|
|
<!-- 流程审批 -->
|
|
|
<process-audit ref="processAuditRef" @orderProcessSuccess="queryList" />
|
|
|
- <!-- 编辑通知公告 -->
|
|
|
- <notice-edit ref="noticeEditRef" />
|
|
|
+ <!-- 编辑通知公告 -->
|
|
|
+ <notice-edit ref="noticeEditRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup name="auxiliaryNotice">
|
|
|
-import {reactive, ref, onMounted, defineAsyncComponent} from 'vue';
|
|
|
-import {useRouter} from "vue-router";
|
|
|
+import { reactive, ref, onMounted, defineAsyncComponent } from 'vue';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
import { ElMessage, FormInstance } from 'element-plus';
|
|
|
import { shortcuts } from '/@/utils/constants';
|
|
|
import { formatDate } from '/@/utils/formatTime';
|
|
@@ -181,7 +183,7 @@ const state = reactive<any>({
|
|
|
exTime: [],
|
|
|
Time: [],
|
|
|
BulletinTypeId: null, //通知类型
|
|
|
- CircularTypeId:null,
|
|
|
+ CircularTypeId: null,
|
|
|
},
|
|
|
total: 0, // 总条数
|
|
|
tableData: [], // 表格数据
|
|
@@ -198,7 +200,7 @@ const handleTimeChange = (val: string[], startKey: string, endKey: string) => {
|
|
|
state.queryParams[startKey] = '';
|
|
|
state.queryParams[endKey] = '';
|
|
|
}
|
|
|
- queryList();
|
|
|
+ queryList();
|
|
|
};
|
|
|
// 甄别时间
|
|
|
const timeStartChangeCr = (val: string[]) => {
|
|
@@ -209,10 +211,10 @@ const timeStartChange = (val: string[]) => {
|
|
|
};
|
|
|
const getBaseData = async () => {
|
|
|
try {
|
|
|
- const resCircularType = await circularBaseData();
|
|
|
- circularType.value = resCircularType.result?.circularType ?? [];
|
|
|
- const res = await bulletinBaseData();
|
|
|
- bulletinType.value = res.result.bulletinType ?? [];
|
|
|
+ const resCircularType = await circularBaseData();
|
|
|
+ circularType.value = resCircularType.result?.circularType ?? [];
|
|
|
+ const res = await bulletinBaseData();
|
|
|
+ bulletinType.value = res.result.bulletinType ?? [];
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
}
|
|
@@ -220,16 +222,16 @@ const getBaseData = async () => {
|
|
|
// 获取参数列表
|
|
|
const queryList = () => {
|
|
|
state.loading = true;
|
|
|
- if (!auth('auxiliary:notice:query')) ElMessage.error('抱歉,您没有权限获取通知公告列表!');
|
|
|
- else {
|
|
|
- switch (listType.value) {
|
|
|
- case '0': //通知
|
|
|
- const requestCircular = {
|
|
|
- title: state.queryParams.Title,
|
|
|
- CircularTypeId: state.queryParams.CircularTypeId,
|
|
|
- CircularTimeStart: state.queryParams.CircularTimeStart,
|
|
|
- CircularTimeEnd: state.queryParams.CircularTimeEnd,
|
|
|
- }
|
|
|
+ switch (listType.value) {
|
|
|
+ case '0': //通知
|
|
|
+ if (!auth('auxiliary:notice:query')) ElMessage.error('抱歉,您没有权限获取通知公告列表!');
|
|
|
+ else {
|
|
|
+ const requestCircular = {
|
|
|
+ title: state.queryParams.Title,
|
|
|
+ CircularTypeId: state.queryParams.CircularTypeId,
|
|
|
+ CircularTimeStart: state.queryParams.CircularTimeStart,
|
|
|
+ CircularTimeEnd: state.queryParams.CircularTimeEnd,
|
|
|
+ };
|
|
|
circularList(requestCircular)
|
|
|
.then((res) => {
|
|
|
state.loading = false;
|
|
@@ -239,25 +241,28 @@ const queryList = () => {
|
|
|
.finally(() => {
|
|
|
state.loading = false;
|
|
|
});
|
|
|
- break;
|
|
|
- case '1': // 公告
|
|
|
- const requestBulletin = {
|
|
|
- title: state.queryParams.Title,
|
|
|
- BulletinTypeId: state.queryParams.BulletinTypeId,
|
|
|
- BulletinTimeStart: state.queryParams.BulletinTimeStart,
|
|
|
- BulletinTimeEnd: state.queryParams.BulletinTimeEnd,
|
|
|
- }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case '1': // 公告
|
|
|
+ if (!auth('auxiliary:bulletin:query')) ElMessage.error('抱歉,您没有权限获取通知公告列表!');
|
|
|
+ else {
|
|
|
+ const requestBulletin = {
|
|
|
+ title: state.queryParams.Title,
|
|
|
+ BulletinTypeId: state.queryParams.BulletinTypeId,
|
|
|
+ BulletinTimeStart: state.queryParams.BulletinTimeStart,
|
|
|
+ BulletinTimeEnd: state.queryParams.BulletinTimeEnd,
|
|
|
+ };
|
|
|
bulletinList(requestBulletin)
|
|
|
.then((res) => {
|
|
|
state.loading = false;
|
|
|
- state.tableData = res.result.items ?? []
|
|
|
+ state.tableData = res.result.items ?? [];
|
|
|
state.total = res.result.total ?? 0;
|
|
|
})
|
|
|
.finally(() => {
|
|
|
state.loading = false;
|
|
|
});
|
|
|
- break;
|
|
|
- }
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
};
|
|
|
// 重置表单
|
|
@@ -289,22 +294,22 @@ const onNoticeAdd = () => {
|
|
|
};
|
|
|
// 查看详情
|
|
|
const router = useRouter();
|
|
|
-const onDetail = (row:any)=>{
|
|
|
- const tagsViewName = listType.value === '0' ? '通知详情' : '公告详情';
|
|
|
- router.push({
|
|
|
- name:'auxiliaryNoticeDetail',
|
|
|
- params:{
|
|
|
- id:row.id,
|
|
|
- isRead:0,
|
|
|
- tagsViewName,
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
+const onDetail = (row: any) => {
|
|
|
+ const tagsViewName = listType.value === '0' ? '通知详情' : '公告详情';
|
|
|
+ router.push({
|
|
|
+ name: 'auxiliaryNoticeDetail',
|
|
|
+ params: {
|
|
|
+ id: row.id,
|
|
|
+ isRead: 0,
|
|
|
+ tagsViewName,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
// 编辑
|
|
|
const noticeEditRef = ref<RefType>(); // 通知公告编辑
|
|
|
-const onEdit = (row:any)=>{
|
|
|
- noticeEditRef.value.openDialog(row,listType.value);
|
|
|
-}
|
|
|
+const onEdit = (row: any) => {
|
|
|
+ noticeEditRef.value.openDialog(row, listType.value);
|
|
|
+};
|
|
|
// 表格多选
|
|
|
const multipleTableRef = ref<RefType>();
|
|
|
const multipleSelection = ref<any>([]);
|
|
@@ -313,7 +318,7 @@ const handleSelectionChange = (val: any[]) => {
|
|
|
};
|
|
|
// 页面加载时
|
|
|
onMounted(() => {
|
|
|
- getBaseData();
|
|
|
+ getBaseData();
|
|
|
queryList();
|
|
|
});
|
|
|
</script>
|