mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-23 23:39:47 +08:00
Compare commits
5 Commits
1eb0a3dac2
...
34ad79e815
Author | SHA1 | Date | |
---|---|---|---|
34ad79e815 | |||
7de471aa68 | |||
378aa869bf | |||
4a4244b5c4 | |||
ecad1c3e78 |
@ -2,6 +2,7 @@
|
||||
import { computed } from 'vue';
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
import json from 'highlight.js/lib/languages/json';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
hljs.registerLanguage('json', json);
|
||||
|
||||
@ -10,15 +11,19 @@ defineOptions({
|
||||
});
|
||||
|
||||
interface Props {
|
||||
class?: string;
|
||||
code?: string;
|
||||
showLineNumbers?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
class: '',
|
||||
code: '',
|
||||
showLineNumbers: false
|
||||
});
|
||||
|
||||
const DEFAULT_CLASS = 'max-h-500px';
|
||||
|
||||
/** 格式化JSON数据 */
|
||||
const jsonData = computed<string>(() => {
|
||||
if (!props.code) return '';
|
||||
@ -33,9 +38,9 @@ const jsonData = computed<string>(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="json-preview">
|
||||
<NCode :code="jsonData" :hljs="hljs" language="json" :show-line-numbers="showLineNumbers" />
|
||||
</div>
|
||||
<NScrollbar :class="twMerge(DEFAULT_CLASS, props.class)">
|
||||
<NCode :code="jsonData" :hljs="hljs" language="json" :show-line-numbers="showLineNumbers" :word-wrap="true" />
|
||||
</NScrollbar>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
@ -44,18 +49,4 @@ html[class='dark'] {
|
||||
background-color: #7c7777;
|
||||
}
|
||||
}
|
||||
.json-preview {
|
||||
width: 100%;
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
@include scrollbar();
|
||||
.empty-data {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -150,7 +150,13 @@ watch(visible, () => {
|
||||
:native-scrollbar="false"
|
||||
>
|
||||
<NSpin :show="loading">
|
||||
<NDescriptions :title="taskInfo?.flowName" label-placement="left" :column="2" size="small" bordered>
|
||||
<NDescriptions
|
||||
:title="`${taskInfo?.flowName} (${taskInfo?.flowCode})`"
|
||||
label-placement="left"
|
||||
:column="2"
|
||||
size="small"
|
||||
bordered
|
||||
>
|
||||
<NDescriptionsItem label="任务名称">
|
||||
{{ taskInfo?.nodeName }}
|
||||
</NDescriptionsItem>
|
||||
|
@ -112,6 +112,7 @@ function createDefaultStartWorkflowModel(): StartWorkflowModel {
|
||||
return {
|
||||
flowCode: null,
|
||||
businessId: null,
|
||||
flowInstanceBizExtBo: null,
|
||||
variables: {}
|
||||
};
|
||||
}
|
||||
@ -205,6 +206,10 @@ async function handleSubmit() {
|
||||
// 提交流程
|
||||
startWorkflowModel.businessId = respLeave.value?.id;
|
||||
startWorkflowModel.flowCode = model.flowCode;
|
||||
startWorkflowModel.flowInstanceBizExtBo = {
|
||||
businessCode: respLeave.value?.applyCode,
|
||||
businessTitle: '请假申请'
|
||||
};
|
||||
taskVariables.value = {
|
||||
leaveDays: respLeave.value?.leaveDays,
|
||||
userList: ['1', '3', '4']
|
||||
|
@ -33,7 +33,7 @@ const toGitee = () => {
|
||||
</NBadge>
|
||||
</NButton>
|
||||
</template>
|
||||
消息
|
||||
{{ $t('page.home.message') }}
|
||||
</NTooltip>
|
||||
</template>
|
||||
<NCard
|
||||
|
@ -6,6 +6,7 @@ html,
|
||||
body,
|
||||
#app {
|
||||
height: 100%;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
html {
|
||||
|
12
src/typings/api/workflow.api.d.ts
vendored
12
src/typings/api/workflow.api.d.ts
vendored
@ -22,8 +22,8 @@ declare namespace Api {
|
||||
type Leave = Common.CommonRecord<{
|
||||
/** id */
|
||||
id: CommonType.IdType;
|
||||
/** 租户编号 */
|
||||
tenantId: CommonType.IdType;
|
||||
/** 申请编码 */
|
||||
applyCode: string;
|
||||
/** 请假类型 */
|
||||
leaveType: LeaveType;
|
||||
/** 开始时间 */
|
||||
@ -275,12 +275,20 @@ declare namespace Api {
|
||||
message: string;
|
||||
}>;
|
||||
|
||||
type BusinessInfo = CommonType.RecordNullable<{
|
||||
/** 业务编码 */
|
||||
businessCode: string;
|
||||
/** 业务名称 */
|
||||
businessTitle: string;
|
||||
}>;
|
||||
/** 启动流程操作参数 */
|
||||
type StartWorkflowOperateParams = CommonType.RecordNullable<{
|
||||
/** 流程定义ID */
|
||||
flowCode: string;
|
||||
/** 业务ID */
|
||||
businessId: CommonType.IdType;
|
||||
/** 业务信息 */
|
||||
flowInstanceBizExtBo: BusinessInfo;
|
||||
/** 变量 */
|
||||
variables: { [key: string]: any };
|
||||
}>;
|
||||
|
8
src/typings/components.d.ts
vendored
8
src/typings/components.d.ts
vendored
@ -47,15 +47,10 @@ declare module 'vue' {
|
||||
'IconMaterialSymbols:deleteOutline': typeof import('~icons/material-symbols/delete-outline')['default']
|
||||
'IconMaterialSymbols:downloadRounded': typeof import('~icons/material-symbols/download-rounded')['default']
|
||||
'IconMaterialSymbols:driveFileRenameOutlineOutline': typeof import('~icons/material-symbols/drive-file-rename-outline-outline')['default']
|
||||
'IconMaterialSymbols:editDocument': typeof import('~icons/material-symbols/edit-document')['default']
|
||||
'IconMaterialSymbols:imageOutline': typeof import('~icons/material-symbols/image-outline')['default']
|
||||
'IconMaterialSymbols:refreshRounded': typeof import('~icons/material-symbols/refresh-rounded')['default']
|
||||
'IconMaterialSymbols:syncOutline': typeof import('~icons/material-symbols/sync-outline')['default']
|
||||
'IconMaterialSymbols:uploadRounded': typeof import('~icons/material-symbols/upload-rounded')['default']
|
||||
'IconMaterialSymbols:warningOutlineRounded': typeof import('~icons/material-symbols/warning-outline-rounded')['default']
|
||||
IconMaterialSymbolsAddRounded: typeof import('~icons/material-symbols/add-rounded')['default']
|
||||
IconMaterialSymbolsDeleteOutline: typeof import('~icons/material-symbols/delete-outline')['default']
|
||||
IconMaterialSymbolsDriveFileRenameOutlineOutline: typeof import('~icons/material-symbols/drive-file-rename-outline-outline')['default']
|
||||
'IconMdi:github': typeof import('~icons/mdi/github')['default']
|
||||
IconMdiArrowDownThin: typeof import('~icons/mdi/arrow-down-thin')['default']
|
||||
IconMdiArrowUpThin: typeof import('~icons/mdi/arrow-up-thin')['default']
|
||||
@ -97,8 +92,6 @@ declare module 'vue' {
|
||||
NDrawer: typeof import('naive-ui')['NDrawer']
|
||||
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
|
||||
NDropdown: typeof import('naive-ui')['NDropdown']
|
||||
NDynamicInput: typeof import('naive-ui')['NDynamicInput']
|
||||
NDynamicTags: typeof import('naive-ui')['NDynamicTags']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NEmpty: typeof import('naive-ui')['NEmpty']
|
||||
NForm: typeof import('naive-ui')['NForm']
|
||||
@ -109,7 +102,6 @@ declare module 'vue' {
|
||||
NGridItem: typeof import('naive-ui')['NGridItem']
|
||||
NInput: typeof import('naive-ui')['NInput']
|
||||
NInputGroup: typeof import('naive-ui')['NInputGroup']
|
||||
NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']
|
||||
NInputNumber: typeof import('naive-ui')['NInputNumber']
|
||||
NLayout: typeof import('naive-ui')['NLayout']
|
||||
NLayoutContent: typeof import('naive-ui')['NLayoutContent']
|
||||
|
Reference in New Issue
Block a user