提交 c77f1804 authored 作者: kxjia's avatar kxjia

完善功能

上级 401f07d4
...@@ -289,8 +289,10 @@ alert(1111) ...@@ -289,8 +289,10 @@ alert(1111)
}); });
const setCurrentNodeById = async (nodeId: string) =>{ const setCurrentNodeById = async (nodeId: string) =>{
alert(nodeId)
const nodes = workflowNodes.value; const nodes = workflowNodes.value;
const index = nodes.findIndex(node => node.id === nodeId); const index = nodes.findIndex(node => node.id === nodeId);
alert(index)
if (index !== -1) { if (index !== -1) {
currentMultiFormIndex.value = index; currentMultiFormIndex.value = index;
currentNode.value = nodes[index]; currentNode.value = nodes[index];
......
...@@ -62,6 +62,9 @@ interface Props { ...@@ -62,6 +62,9 @@ interface Props {
getDropDownActions?: (record: any) => ActionItem[]; getDropDownActions?: (record: any) => ActionItem[];
deleteApi?: (data: any) => Promise<any>; deleteApi?: (data: any) => Promise<any>;
batchDeleteApi?: (data: any) => Promise<any>; batchDeleteApi?: (data: any) => Promise<any>;
delDeployment?: (data: any) => Promise<any>;
procInsIds?: string[];
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
...@@ -113,6 +116,9 @@ function handleAdd() { ...@@ -113,6 +116,9 @@ function handleAdd() {
async function handleDelete(record: any) { async function handleDelete(record: any) {
if (props.deleteApi) { if (props.deleteApi) {
await props.deleteApi({ id: record.id }); await props.deleteApi({ id: record.id });
if(props.delDeployment) {
await props.delDeployment(props.procInsIds?.[0]);
}
handleSuccess(); handleSuccess();
} }
} }
...@@ -120,6 +126,11 @@ async function handleDelete(record: any) { ...@@ -120,6 +126,11 @@ async function handleDelete(record: any) {
async function batchHandleDelete() { async function batchHandleDelete() {
if (props.batchDeleteApi) { if (props.batchDeleteApi) {
await props.batchDeleteApi({ ids: selectedRowKeys.value }); await props.batchDeleteApi({ ids: selectedRowKeys.value });
if(props.delDeployment) {
(props.procInsIds || []).forEach(async (item) => {
await props.delDeployment?.(item);
});
}
handleSuccess(); handleSuccess();
} }
} }
...@@ -138,10 +149,14 @@ function tableActions(record: any) { ...@@ -138,10 +149,14 @@ function tableActions(record: any) {
} }
function dropDownActions(record: any) { function dropDownActions(record: any) {
const actions: ActionItem[] = [];
// 如果父组件提供了自定义操作,合并到默认操作前面
if (props.getDropDownActions) { if (props.getDropDownActions) {
return props.getDropDownActions(record); return [...props.getDropDownActions(record), ...actions];
} }
return [];
return actions;
} }
defineExpose({ defineExpose({
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
:getDropDownActions="getDropDownAction" :getDropDownActions="getDropDownAction"
:deleteApi="deleteOne" :deleteApi="deleteOne"
:batchDeleteApi="batchDelete" :batchDeleteApi="batchDelete"
:delDeployment="delDeployment"
@add="handleAdd" @add="handleAdd"
@register="handleRegister" @register="handleRegister"
> >
...@@ -35,6 +37,7 @@ import TaskAssigneeDrawer from '/@/views/common/TaskAssigneeDrawer.vue'; ...@@ -35,6 +37,7 @@ import TaskAssigneeDrawer from '/@/views/common/TaskAssigneeDrawer.vue';
import FlowHistoryDrawer from '/@/views/common/FlowHistoryDrawer.vue'; import FlowHistoryDrawer from '/@/views/common/FlowHistoryDrawer.vue';
import BaosongTaskDrawer from '/@/views/baosong/task/components/BaosongTaskDrawer.vue'; import BaosongTaskDrawer from '/@/views/baosong/task/components/BaosongTaskDrawer.vue';
import DynamicList from '../components/DynamicList.vue'; import DynamicList from '../components/DynamicList.vue';
import { delDeployment } from "/@/components/Process/api/finished";
const [refFlowHistoryDrawer, { openDrawer }] = useDrawer(); const [refFlowHistoryDrawer, { openDrawer }] = useDrawer();
const [registerAssigneeDrawer, { openDrawer: openAssigneeDrawer }] = useDrawer(); const [registerAssigneeDrawer, { openDrawer: openAssigneeDrawer }] = useDrawer();
...@@ -89,6 +92,10 @@ function handleDetail(record: Recordable) { ...@@ -89,6 +92,10 @@ function handleDetail(record: Recordable) {
} }
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
alert(2222)
if(record.procInsId) {
await delDeployment(record.procInsId);
}
await deleteOne({ id: record.id }, handleSuccess); await deleteOne({ id: record.id }, handleSuccess);
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
:deleteApi="deleteOne" :deleteApi="deleteOne"
:batchDeleteApi="batchDelete" :batchDeleteApi="batchDelete"
:showBatch="false" :showBatch="false"
:showAdd="false"
@add="handleAdd" @add="handleAdd"
@register="handleRegister" @register="handleRegister"
> >
......
...@@ -100,6 +100,9 @@ public class JwtUtil { ...@@ -100,6 +100,9 @@ public class JwtUtil {
*/ */
public static String getUsername(String token) { public static String getUsername(String token) {
try { try {
if(token==null) {
return "";
}
DecodedJWT jwt = JWT.decode(token); DecodedJWT jwt = JWT.decode(token);
return jwt.getClaim("username").asString(); return jwt.getClaim("username").asString();
} catch (JWTDecodeException e) { } catch (JWTDecodeException e) {
......
...@@ -68,14 +68,20 @@ public class JimuReportTokenService implements JmReportTokenServiceI { ...@@ -68,14 +68,20 @@ public class JimuReportTokenService implements JmReportTokenServiceI {
try { try {
userInfo = sysBaseApi.getCacheUser(username); userInfo = sysBaseApi.getCacheUser(username);
} catch (Exception e) { } catch (Exception e) {
log.error("获取用户信息异常:"+ e.getMessage());
return map; return map;
} }
//设置账号名 //设置账号名
if(userInfo ==null) {
return map;
}
if(userInfo.getSysUserCode()!=null){
map.put(SYS_USER_CODE, userInfo.getSysUserCode()); map.put(SYS_USER_CODE, userInfo.getSysUserCode());
}
//设置部门编码 //设置部门编码
if(userInfo.getSysOrgCode()!=null){
map.put(SYS_ORG_CODE, userInfo.getSysOrgCode()); map.put(SYS_ORG_CODE, userInfo.getSysOrgCode());
// 将所有信息存放至map 解析sql/api会根据map的键值解析 }
return map; return map;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论