update 首页待审核数量展示
This commit is contained in:
@@ -65,8 +65,12 @@
|
||||
</template>
|
||||
</el-popover> -->
|
||||
</div>
|
||||
<!-- SPDM CODE -->
|
||||
<div class="layout-navbars-breadcrumb-user-icon" @click="gotoApprove" :title="$t('user.title7')">
|
||||
<img src="/@/assets/approve.svg" class="approve-img" />
|
||||
<el-badge v-if="approveNum" :value="approveNum" :max="99">
|
||||
<img src="/@/assets/approve.svg" class="approve-img" />
|
||||
</el-badge>
|
||||
<img v-else src="/@/assets/approve.svg" class="approve-img" />
|
||||
</div>
|
||||
<div
|
||||
class="layout-navbars-breadcrumb-user-icon mr10"
|
||||
@@ -75,7 +79,8 @@
|
||||
>
|
||||
<i class="iconfont" :class="!state.isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"></i>
|
||||
</div>
|
||||
<div class="mr-3 min-w-24 layout-navbars-breadcrumb-user-text" @click="onTenantClick">
|
||||
<!-- SPDM CODE -->
|
||||
<div v-if="!enableConfigByTenant(['lyric'])" class="mr-3 min-w-24 layout-navbars-breadcrumb-user-text" @click="onTenantClick">
|
||||
{{ currentUser }}
|
||||
</div>
|
||||
<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
|
||||
@@ -120,6 +125,7 @@ import pdmIco from '/@/assets/pdm.ico';
|
||||
import clientCid from '/@/assets/client-cid.svg';
|
||||
import WujieVue from 'wujie-vue3';
|
||||
import { queryMineTask } from '/@/api/flow/task';
|
||||
import { enableConfigByTenant } from '/@/spdm/utils/index'; // SPDM CODE
|
||||
|
||||
const { bus } = WujieVue;
|
||||
// import {fetchUserMessageList} from '/@/api/admin/message';
|
||||
@@ -145,6 +151,24 @@ const tenantRef = ref();
|
||||
const personalDrawerRef = ref();
|
||||
const newsListRef = ref<InstanceType<typeof NewsLists>>();
|
||||
|
||||
// SPDM CODE 审批数量
|
||||
const approveNum = ref(0);
|
||||
const getApproveNum = async () => {
|
||||
const res = await queryMineTask({ current: 1, size: 1 });
|
||||
approveNum.value = res.data.total;
|
||||
};
|
||||
mittBus.on('updateApproveNum', (value) => {
|
||||
approveNum.value = Number(approveNum.value) + Number(value);
|
||||
});
|
||||
// 定时刷新
|
||||
const timer = setInterval(() => {
|
||||
getApproveNum();
|
||||
}, 15 * 60 * 1000); // 15分钟更新一次
|
||||
onUnmounted(() => {
|
||||
mittBus.off('updateApproveNum');
|
||||
timer && clearInterval(timer);
|
||||
});
|
||||
|
||||
const currentUser = computed(() => {
|
||||
return useUserInfo().userInfos.user.tenantName || '无公司';
|
||||
});
|
||||
@@ -316,6 +340,7 @@ onMounted(() => {
|
||||
initI18nOrSize('globalI18n', 'disabledI18n');
|
||||
}
|
||||
getUnreadNum();
|
||||
getApproveNum();
|
||||
// getIsDot();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { editMessageUserIsRead, msgSSE, getMessageUserUnreadNum, taskAdjust } fr
|
||||
import { ElNotification } from 'element-plus';
|
||||
import { useUserInfo } from '/@/stores/userInfo';
|
||||
import { ref } from 'vue';
|
||||
import mittBus from '/@/utils/mitt';
|
||||
export const useMsg = defineStore('msg', () => {
|
||||
const msgArray = ref<any[]>([]);
|
||||
const unreadNum = ref(0);
|
||||
@@ -35,6 +36,10 @@ export const useMsg = defineStore('msg', () => {
|
||||
const connectToMsgSSE = (router: any) => {
|
||||
msgSSE(useUserInfo().userInfos.user.userId, (event) => {
|
||||
const msg = JSON.parse(event.data);
|
||||
// SPDM CODE
|
||||
if (msg.msgTitle === '审批通知') {
|
||||
mittBus.emit('updateApproveNum', 1);
|
||||
}
|
||||
const notification = ElNotification({
|
||||
title: msg.msgTitle,
|
||||
message: msg.msgBody,
|
||||
@@ -42,12 +47,12 @@ export const useMsg = defineStore('msg', () => {
|
||||
onClick: () => {
|
||||
editMessageUserIsRead({
|
||||
id: msg.id,
|
||||
isRead: 1
|
||||
isRead: 1,
|
||||
});
|
||||
useMsg().setUnreadNum(-1);
|
||||
notification.close();
|
||||
taskAdjust(msg)
|
||||
}
|
||||
taskAdjust(msg);
|
||||
},
|
||||
});
|
||||
updateMsgNum();
|
||||
});
|
||||
@@ -62,6 +67,6 @@ export const useMsg = defineStore('msg', () => {
|
||||
setUnreadNum,
|
||||
readAll,
|
||||
updateMsgNum,
|
||||
connectToMsgSSE
|
||||
connectToMsgSSE,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import {completeTask} from '/@/api/flow/task';
|
||||
import { completeTask } from '/@/api/flow/task';
|
||||
import mittBus from '/@/utils/mitt';
|
||||
|
||||
const props = defineProps({
|
||||
nodeId: {
|
||||
@@ -22,7 +23,7 @@ const handle = (row: Record<string, any>, formData: any[]) => {
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
|
||||
defineExpose({handle});
|
||||
defineExpose({ handle });
|
||||
const emit = defineEmits(['taskSubmitEvent']);
|
||||
|
||||
const submit = () => {
|
||||
@@ -60,7 +61,7 @@ const submit = () => {
|
||||
|
||||
completeTask(param).then((res) => {
|
||||
dialogVisible.value = false;
|
||||
|
||||
mittBus.emit('updateApproveNum', -1);
|
||||
emit('taskSubmitEvent');
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import {completeTask} from '/@/api/flow/task';
|
||||
import { completeTask } from '/@/api/flow/task';
|
||||
import mittBus from '/@/utils/mitt';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
nodeId: {
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
@@ -14,12 +15,12 @@ const dialogVisible = ref(false);
|
||||
const submitDesc = ref('');
|
||||
|
||||
const currentData = ref();
|
||||
const currentProcessInstanceId = ref('')
|
||||
const currentProcessInstanceId = ref('');
|
||||
const currentOpenFlowForm = ref();
|
||||
|
||||
const handle = (row, formData) => {
|
||||
submitDesc.value = '';
|
||||
currentProcessInstanceId.value = row.processInstanceId;
|
||||
submitDesc.value = '';
|
||||
currentProcessInstanceId.value = row.processInstanceId;
|
||||
currentData.value = row;
|
||||
currentOpenFlowForm.value = formData;
|
||||
|
||||
@@ -44,7 +45,7 @@ const submit = () => {
|
||||
var v = {};
|
||||
|
||||
for (var subItem of array) {
|
||||
v[subItem.id] = subItem.props.value;
|
||||
v[subItem.id] = subItem.props.value;
|
||||
}
|
||||
d.push(v);
|
||||
}
|
||||
@@ -54,17 +55,18 @@ const submit = () => {
|
||||
|
||||
formData[`${props.nodeId || currentData.value.nodeId}_approve_condition`] = false;
|
||||
|
||||
const param = {
|
||||
paramMap: formData,
|
||||
taskId: currentData.value.taskId,
|
||||
taskLocalParamMap: {
|
||||
approveDesc: t('handler.refuse.09123351-0') + submitDesc.value,
|
||||
},
|
||||
};
|
||||
const param = {
|
||||
paramMap: formData,
|
||||
taskId: currentData.value.taskId,
|
||||
taskLocalParamMap: {
|
||||
approveDesc: t('handler.refuse.09123351-0') + submitDesc.value,
|
||||
},
|
||||
};
|
||||
|
||||
completeTask(param).then((res) => {
|
||||
completeTask(param).then((res) => {
|
||||
dialogVisible.value = false;
|
||||
emit('taskSubmitEvent');
|
||||
mittBus.emit('updateApproveNum', -1);
|
||||
emit('taskSubmitEvent');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user