[Feature][UI] Support to view and manage all timing settings of a project. (#14178)
This commit is contained in:
parent
5c4ba4105d
commit
4c2e57cfb3
|
|
@ -250,7 +250,7 @@ public class SchedulerController extends BaseController {
|
|||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
public Result queryScheduleListPaging(@Parameter(hidden = true) @RequestAttribute(value = SESSION_USER) User loginUser,
|
||||
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
|
||||
@RequestParam long processDefinitionCode,
|
||||
@RequestParam(value = "processDefinitionCode", required = false, defaultValue = "0") long processDefinitionCode,
|
||||
@RequestParam(value = "searchVal", required = false) String searchVal,
|
||||
@RequestParam("pageNo") Integer pageNo,
|
||||
@RequestParam("pageSize") Integer pageSize) {
|
||||
|
|
|
|||
|
|
@ -568,16 +568,20 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
|
|||
return result;
|
||||
}
|
||||
|
||||
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefineCode);
|
||||
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
|
||||
log.error("Process definition does not exist, processDefinitionCode:{}.", processDefineCode);
|
||||
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(processDefineCode));
|
||||
return result;
|
||||
if (processDefineCode != 0) {
|
||||
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefineCode);
|
||||
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
|
||||
log.error("Process definition does not exist, processDefinitionCode:{}.", processDefineCode);
|
||||
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(processDefineCode));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Page<Schedule> page = new Page<>(pageNo, pageSize);
|
||||
|
||||
IPage<Schedule> schedulePage =
|
||||
scheduleMapper.queryByProcessDefineCodePaging(page, processDefineCode, searchVal);
|
||||
scheduleMapper.queryByProjectAndProcessDefineCodePaging(page, projectCode, processDefineCode,
|
||||
searchVal);
|
||||
|
||||
List<ScheduleVo> scheduleList = new ArrayList<>();
|
||||
for (Schedule schedule : schedulePage.getRecords()) {
|
||||
|
|
|
|||
|
|
@ -63,6 +63,20 @@ public interface ScheduleMapper extends BaseMapper<Schedule> {
|
|||
@Param("processDefinitionCode") long processDefinitionCode,
|
||||
@Param("searchVal") String searchVal);
|
||||
|
||||
/**
|
||||
* scheduler page
|
||||
*
|
||||
* @param page page
|
||||
* @param projectCode projectCode
|
||||
* @param processDefinitionCode processDefinitionCode
|
||||
* @param searchVal searchVal
|
||||
* @return scheduler IPage
|
||||
*/
|
||||
IPage<Schedule> queryByProjectAndProcessDefineCodePaging(IPage<Schedule> page,
|
||||
@Param("projectCode") long projectCode,
|
||||
@Param("processDefinitionCode") long processDefinitionCode,
|
||||
@Param("searchVal") String searchVal);
|
||||
|
||||
/**
|
||||
* Filter schedule
|
||||
*
|
||||
|
|
|
|||
|
|
@ -44,6 +44,25 @@
|
|||
</if>
|
||||
order by s.update_time desc
|
||||
</select>
|
||||
<select id="queryByProjectAndProcessDefineCodePaging" resultType="org.apache.dolphinscheduler.dao.entity.Schedule">
|
||||
select p_f.name as process_definition_name, p.name as project_name,u.user_name,e.name as environment_name,
|
||||
<include refid="baseSqlV2">
|
||||
<property name="alias" value="s"/>
|
||||
</include>
|
||||
from t_ds_schedules s
|
||||
join t_ds_process_definition p_f on s.process_definition_code = p_f.code
|
||||
join t_ds_project as p on p_f.project_code = p.code
|
||||
join t_ds_user as u on s.user_id = u.id
|
||||
left join t_ds_environment as e on s.environment_code = e.code
|
||||
where 1=1
|
||||
<if test="projectCode != 0">
|
||||
and p.code = #{projectCode}
|
||||
</if>
|
||||
<if test="processDefinitionCode != 0">
|
||||
and s.process_definition_code = #{processDefinitionCode}
|
||||
</if>
|
||||
order by s.update_time desc
|
||||
</select>
|
||||
<select id="querySchedulerListByProjectName" resultType="org.apache.dolphinscheduler.dao.entity.Schedule">
|
||||
select p_f.name as process_definition_name, p_f.description as definition_description, p.name as project_name,u.user_name, s.*
|
||||
from t_ds_schedules s
|
||||
|
|
|
|||
|
|
@ -141,6 +141,44 @@ public class ScheduleMapperTest extends BaseDaoTest {
|
|||
Assertions.assertNotEquals(scheduleIPage.getSize(), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* test page
|
||||
*/
|
||||
@Test
|
||||
public void testQueryByProjectAndProcessDefineIdPaging() {
|
||||
|
||||
User user = new User();
|
||||
user.setUserName("ut name");
|
||||
userMapper.insert(user);
|
||||
|
||||
Project project = new Project();
|
||||
project.setName("ut project");
|
||||
project.setUserId(user.getId());
|
||||
project.setCode(1L);
|
||||
project.setUpdateTime(new Date());
|
||||
project.setCreateTime(new Date());
|
||||
projectMapper.insert(project);
|
||||
|
||||
ProcessDefinition processDefinition = new ProcessDefinition();
|
||||
processDefinition.setCode(1L);
|
||||
processDefinition.setProjectCode(project.getCode());
|
||||
processDefinition.setUserId(user.getId());
|
||||
processDefinition.setLocations("");
|
||||
processDefinition.setCreateTime(new Date());
|
||||
processDefinition.setUpdateTime(new Date());
|
||||
processDefinitionMapper.insert(processDefinition);
|
||||
|
||||
Schedule schedule = insertOne();
|
||||
schedule.setUserId(user.getId());
|
||||
schedule.setProcessDefinitionCode(processDefinition.getCode());
|
||||
scheduleMapper.updateById(schedule);
|
||||
|
||||
Page<Schedule> page = new Page(1, 3);
|
||||
IPage<Schedule> scheduleIPage = scheduleMapper.queryByProjectAndProcessDefineCodePaging(page, project.getCode(),
|
||||
processDefinition.getCode(), "");
|
||||
Assertions.assertNotEquals(scheduleIPage.getSize(), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* test query schedule list by project name
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ export const COLUMN_WIDTH_CONFIG = {
|
|||
tag: {
|
||||
width: 160
|
||||
},
|
||||
checkbox:{
|
||||
checkbox: {
|
||||
width: 20
|
||||
},
|
||||
copy: {
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ export const workflowExecutionStateType = (t: any) => [
|
|||
}))
|
||||
]
|
||||
|
||||
|
||||
/**
|
||||
* Stream task state
|
||||
*/
|
||||
|
|
@ -271,7 +270,7 @@ export const tasksState = (t: any): ITaskStateConfig => ({
|
|||
icon: SendOutlined,
|
||||
isSpin: false,
|
||||
classNames: 'dispatch'
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
|
|
@ -282,7 +281,9 @@ export const tasksState = (t: any): ITaskStateConfig => ({
|
|||
* @icon icon
|
||||
* @isSpin is loading (Need to execute the code block to write if judgment)
|
||||
*/
|
||||
export const workflowExecutionState = (t: any): IWorkflowExecutionStateConfig => ({
|
||||
export const workflowExecutionState = (
|
||||
t: any
|
||||
): IWorkflowExecutionStateConfig => ({
|
||||
SUBMITTED_SUCCESS: {
|
||||
id: 0,
|
||||
desc: `${t('project.workflow.submit_success')}`,
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ const props = {
|
|||
|
||||
const Search = defineComponent({
|
||||
name: 'Search',
|
||||
emits: ['search','clear'],
|
||||
props: props,
|
||||
emits: ['search', 'clear'],
|
||||
setup(props, ctx) {
|
||||
const { t } = useI18n()
|
||||
|
||||
|
|
@ -40,14 +40,15 @@ const Search = defineComponent({
|
|||
ctx.emit('clear', (ev.target as HTMLInputElement)?.value || '')
|
||||
}
|
||||
return () => (
|
||||
|
||||
<NInput
|
||||
size='small'
|
||||
clearable
|
||||
placeholder = {props.placeholder?props.placeholder:t('input_search.placeholder')}
|
||||
onKeydown={withKeys(onKeyDown, ['enter'])}
|
||||
onClear = {onClear}
|
||||
/>
|
||||
<NInput
|
||||
size='small'
|
||||
clearable
|
||||
placeholder={
|
||||
props.placeholder ? props.placeholder : t('input_search.placeholder')
|
||||
}
|
||||
onKeydown={withKeys(onKeyDown, ['enter'])}
|
||||
onClear={onClear}
|
||||
/>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -85,9 +85,11 @@ const Navbar = defineComponent({
|
|||
<div class={styles.settings}>
|
||||
<NButton quaternary onClick={this.handleUISettingClick}>
|
||||
{{
|
||||
icon: () => <NIcon size='16'>
|
||||
<SettingOutlined />
|
||||
</NIcon>,
|
||||
icon: () => (
|
||||
<NIcon size='16'>
|
||||
<SettingOutlined />
|
||||
</NIcon>
|
||||
),
|
||||
default: this.t('menu.ui_setting')
|
||||
}}
|
||||
</NButton>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {LocationQueryRaw, useRouter} from 'vue-router'
|
||||
import { LocationQueryRaw, useRouter } from 'vue-router'
|
||||
import type { Router } from 'vue-router'
|
||||
import { MenuOption } from 'naive-ui'
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ export function useMenuClick() {
|
|||
const handleMenuClick = (key: string, menuOption: MenuOption) => {
|
||||
router.push({
|
||||
path: `${key}`,
|
||||
query: menuOption.payload? menuOption.payload as LocationQueryRaw: {}
|
||||
query: menuOption.payload ? (menuOption.payload as LocationQueryRaw) : {}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,10 +102,12 @@ export function useDataList() {
|
|||
icon: renderIcon(ProfileOutlined),
|
||||
children: [
|
||||
{
|
||||
label: t('menu.project_overview') + (projectName? `[${projectName}]` : ''),
|
||||
label:
|
||||
t('menu.project_overview') +
|
||||
(projectName ? `[${projectName}]` : ''),
|
||||
key: `/projects/${projectCode}`,
|
||||
icon: renderIcon(FundProjectionScreenOutlined),
|
||||
payload: {projectName:projectName}
|
||||
payload: { projectName: projectName }
|
||||
},
|
||||
{
|
||||
label: t('menu.workflow'),
|
||||
|
|
@ -115,17 +117,22 @@ export function useDataList() {
|
|||
{
|
||||
label: t('menu.workflow_relation'),
|
||||
key: `/projects/${projectCode}/workflow/relation`,
|
||||
payload: {projectName:projectName}
|
||||
payload: { projectName: projectName }
|
||||
},
|
||||
{
|
||||
label: t('menu.workflow_definition'),
|
||||
key: `/projects/${projectCode}/workflow-definition`,
|
||||
payload: {projectName:projectName}
|
||||
payload: { projectName: projectName }
|
||||
},
|
||||
{
|
||||
label: t('menu.workflow_instance'),
|
||||
key: `/projects/${projectCode}/workflow/instances`,
|
||||
payload: {projectName:projectName}
|
||||
payload: { projectName: projectName }
|
||||
},
|
||||
{
|
||||
label: t('menu.workflow_timing'),
|
||||
key: `/projects/${projectCode}/workflow/timings`,
|
||||
payload: { projectName: projectName }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -137,12 +144,12 @@ export function useDataList() {
|
|||
{
|
||||
label: t('menu.task_definition'),
|
||||
key: `/projects/${projectCode}/task/definitions`,
|
||||
payload: {projectName:projectName}
|
||||
payload: { projectName: projectName }
|
||||
},
|
||||
{
|
||||
label: t('menu.task_instance'),
|
||||
key: `/projects/${projectCode}/task/instances`,
|
||||
payload: {projectName:projectName}
|
||||
payload: { projectName: projectName }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,10 +90,10 @@ export default {
|
|||
clientSecret: 'ClientSecret',
|
||||
OAuth_token_endpoint: 'OAuth 2.0 token endpoint',
|
||||
endpoint_tips: 'Please enter OAuth Token',
|
||||
AccessKeyID:'AccessKeyID',
|
||||
AccessKeyID_tips:'Please input AccessKeyID',
|
||||
SecretAccessKey:'SecretAccessKey',
|
||||
SecretAccessKey_tips:'Please input SecretAccessKey',
|
||||
dbUser:'DbUser',
|
||||
dbUser_tips:'Please input DbUser',
|
||||
AccessKeyID: 'AccessKeyID',
|
||||
AccessKeyID_tips: 'Please input AccessKeyID',
|
||||
SecretAccessKey: 'SecretAccessKey',
|
||||
SecretAccessKey_tips: 'Please input SecretAccessKey',
|
||||
dbUser: 'DbUser',
|
||||
dbUser_tips: 'Please input DbUser'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@
|
|||
*/
|
||||
|
||||
export default {
|
||||
placeholder: 'Please enter keyword'
|
||||
}
|
||||
placeholder: 'Please enter keyword'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export default {
|
|||
workflow: 'Workflow',
|
||||
workflow_definition: 'Workflow Definition',
|
||||
workflow_instance: 'Workflow Instance',
|
||||
workflow_timing: 'Workflow Timing',
|
||||
task: 'Task',
|
||||
task_instance: 'Task Instance',
|
||||
task_definition: 'Task Definition',
|
||||
|
|
@ -57,5 +58,5 @@ export default {
|
|||
data_quality: 'Data Quality',
|
||||
task_result: 'Task Result',
|
||||
rule: 'Rule management',
|
||||
ui_setting: 'UI Setting',
|
||||
ui_setting: 'UI Setting'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ export default {
|
|||
workflow_publish_status: 'Workflow Publish Status',
|
||||
schedule_publish_status: 'Schedule Publish Status',
|
||||
workflow_definition: 'Workflow Definition',
|
||||
workflow_timing: 'Workflow Timing',
|
||||
workflow_instance: 'Workflow Instance',
|
||||
status: 'Status',
|
||||
create_time: 'Create Time',
|
||||
|
|
@ -82,7 +83,7 @@ export default {
|
|||
copy_workflow: 'Copy Workflow',
|
||||
copy_workflow_name: 'Copy workflow name',
|
||||
visit_workflow_instances: 'Visit workflow instances',
|
||||
cron_manage: 'Cron manage',
|
||||
cron_manage: 'Timing Management',
|
||||
delete: 'Delete',
|
||||
tree_view: 'Tree View',
|
||||
tree_limit: 'Limit Size',
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export default {
|
|||
udf_resources: 'UDF resources',
|
||||
upload_udf_resources: 'Upload UDF Resources',
|
||||
udf_source_name: 'UDF Resource Name',
|
||||
user_name: 'Resource userName',
|
||||
user_name: 'Resource userName'
|
||||
},
|
||||
function: {
|
||||
udf_function: 'UDF Function',
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ export default {
|
|||
namespace: 'Namespace',
|
||||
revoke_auth: 'Revoke',
|
||||
grant_read: 'Grant Read',
|
||||
grant_all:'Grant All',
|
||||
grant_all: 'Grant All',
|
||||
authorize_project: 'Project Authorize',
|
||||
authorize_resource: 'Resource Authorize',
|
||||
authorize_namespace: 'Namespace Authorize',
|
||||
|
|
|
|||
|
|
@ -87,10 +87,10 @@ export default {
|
|||
clientSecret: 'ClientSecret',
|
||||
OAuth_token_endpoint: 'OAuth 2.0 token endpoint',
|
||||
endpoint_tips: '请输入OAuth',
|
||||
AccessKeyID:'AccessKeyID',
|
||||
AccessKeyID_tips:'请输入AccessKeyID',
|
||||
SecretAccessKey:'SecretAccessKey',
|
||||
SecretAccessKey_tips:'请输入SecretAccessKey',
|
||||
dbUser:'DbUser',
|
||||
dbUser_tips:'请输入DbUser',
|
||||
AccessKeyID: 'AccessKeyID',
|
||||
AccessKeyID_tips: '请输入AccessKeyID',
|
||||
SecretAccessKey: 'SecretAccessKey',
|
||||
SecretAccessKey_tips: '请输入SecretAccessKey',
|
||||
dbUser: 'DbUser',
|
||||
dbUser_tips: '请输入DbUser'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@
|
|||
*/
|
||||
|
||||
export default {
|
||||
placeholder: '请输入关键词'
|
||||
}
|
||||
placeholder: '请输入关键词'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ export default {
|
|||
workflow: '工作流',
|
||||
workflow_definition: '工作流定义',
|
||||
workflow_instance: '工作流实例',
|
||||
workflow_timing: '工作流定时',
|
||||
task: '任务',
|
||||
task_instance: '任务实例',
|
||||
task_definition: '任务定义',
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ export default {
|
|||
schedule_publish_status: '定时状态',
|
||||
workflow_definition: '工作流定义',
|
||||
workflow_instance: '工作流实例',
|
||||
workflow_timing: '工作流定时',
|
||||
status: '状态',
|
||||
create_time: '创建时间',
|
||||
update_time: '更新时间',
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ export default {
|
|||
namespace: '命名空间',
|
||||
revoke_auth: '撤销权限',
|
||||
grant_read: '授予读权限',
|
||||
grant_all:'授予所有权限',
|
||||
grant_all: '授予所有权限',
|
||||
authorize_project: '项目授权',
|
||||
authorize_resource: '资源授权',
|
||||
authorize_namespace: '命名空间授权',
|
||||
|
|
|
|||
|
|
@ -111,6 +111,17 @@ export default {
|
|||
auth: []
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/projects/:projectCode/workflow/timings',
|
||||
name: 'workflow-timing-list',
|
||||
component: components['projects-workflow-timing'],
|
||||
meta: {
|
||||
title: '工作流定时管理',
|
||||
activeMenu: 'projects',
|
||||
showSide: true,
|
||||
auth: []
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/projects/:projectCode/workflow/instances',
|
||||
name: 'workflow-instance-list',
|
||||
|
|
|
|||
|
|
@ -37,23 +37,23 @@ type IDataBase =
|
|||
| 'SNOWFLAKE'
|
||||
|
||||
type IDataBaseLabel =
|
||||
| 'MYSQL'
|
||||
| 'POSTGRESQL'
|
||||
| 'HIVE'
|
||||
| 'SPARK'
|
||||
| 'CLICKHOUSE'
|
||||
| 'ORACLE'
|
||||
| 'SQLSERVER'
|
||||
| 'DB2'
|
||||
| 'PRESTO'
|
||||
| 'REDSHIFT'
|
||||
| 'ATHENA'
|
||||
| 'TRINO'
|
||||
| 'AZURESQL'
|
||||
| 'STARROCKS'
|
||||
| 'DAMENG'
|
||||
| 'OCEANBASE'
|
||||
| 'SSH'
|
||||
| 'MYSQL'
|
||||
| 'POSTGRESQL'
|
||||
| 'HIVE'
|
||||
| 'SPARK'
|
||||
| 'CLICKHOUSE'
|
||||
| 'ORACLE'
|
||||
| 'SQLSERVER'
|
||||
| 'DB2'
|
||||
| 'PRESTO'
|
||||
| 'REDSHIFT'
|
||||
| 'ATHENA'
|
||||
| 'TRINO'
|
||||
| 'AZURESQL'
|
||||
| 'STARROCKS'
|
||||
| 'DAMENG'
|
||||
| 'OCEANBASE'
|
||||
| 'SSH'
|
||||
|
||||
interface IDataSource {
|
||||
id?: number
|
||||
|
|
|
|||
|
|
@ -36,4 +36,4 @@ export function queryDynamicTaskResource(url: string): any {
|
|||
url,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,4 +31,4 @@ export function ssoLoginUrl(): any {
|
|||
url: '/login/sso',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,10 +248,12 @@ export function viewTree(
|
|||
})
|
||||
}
|
||||
|
||||
export function viewProcessDefinitionVariables(code: number, processCode: number): any {
|
||||
export function viewProcessDefinitionVariables(
|
||||
code: number,
|
||||
processCode: number
|
||||
): any {
|
||||
return axios({
|
||||
url: `/projects/${code}/process-definition/${processCode}/view-variables`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,4 +130,3 @@ export function viewVariables(id: number, code: number): any {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,13 @@
|
|||
*/
|
||||
|
||||
import { axios } from '@/service/service'
|
||||
import { ListReq, ListIdReq, ProjectsReq, UserIdReq, UpdateProjectsReq } from './types'
|
||||
import {
|
||||
ListReq,
|
||||
ListIdReq,
|
||||
ProjectsReq,
|
||||
UserIdReq,
|
||||
UpdateProjectsReq
|
||||
} from './types'
|
||||
|
||||
export function queryProjectListPaging(params: ListReq): any {
|
||||
return axios({
|
||||
|
|
@ -26,7 +32,9 @@ export function queryProjectListPaging(params: ListReq): any {
|
|||
})
|
||||
}
|
||||
|
||||
export function queryProjectWithAuthorizedLevelListPaging(params: ListIdReq): any {
|
||||
export function queryProjectWithAuthorizedLevelListPaging(
|
||||
params: ListIdReq
|
||||
): any {
|
||||
return axios({
|
||||
url: '/projects/project-with-authorized-level-list-paging',
|
||||
method: 'get',
|
||||
|
|
|
|||
|
|
@ -45,9 +45,7 @@ export function queryResourceListPaging(
|
|||
})
|
||||
}
|
||||
|
||||
export function queryBaseDir(
|
||||
params: ResourceTypeReq
|
||||
): any {
|
||||
export function queryBaseDir(params: ResourceTypeReq): any {
|
||||
return axios({
|
||||
url: '/resources/base-dir',
|
||||
method: 'get',
|
||||
|
|
@ -56,20 +54,20 @@ export function queryBaseDir(
|
|||
}
|
||||
|
||||
export function queryCurrentResourceByFileName(
|
||||
params: ResourceTypeReq & FileNameReq & TenantCodeReq,
|
||||
params: ResourceTypeReq & FileNameReq & TenantCodeReq
|
||||
): any {
|
||||
return axios({
|
||||
url: `/resources/query-file-name`,
|
||||
url: '/resources/query-file-name',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryCurrentResourceByFullName(
|
||||
params: ResourceTypeReq & FullNameReq & TenantCodeReq,
|
||||
params: ResourceTypeReq & FullNameReq & TenantCodeReq
|
||||
): any {
|
||||
return axios({
|
||||
url: `/resources/query-full-name`,
|
||||
url: '/resources/query-full-name',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
|
|
@ -195,21 +193,19 @@ export function verifyResourceName(params: FullNameReq & ResourceTypeReq): any {
|
|||
})
|
||||
}
|
||||
|
||||
export function doesResourceExist(
|
||||
params: FullNameReq & ResourceTypeReq,
|
||||
): any {
|
||||
export function doesResourceExist(params: FullNameReq & ResourceTypeReq): any {
|
||||
return axios({
|
||||
url: `/resources/verify-name`,
|
||||
url: '/resources/verify-name',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateResource(
|
||||
data: NameReq & ResourceTypeReq & DescriptionReq & FullNameReq & TenantCodeReq,
|
||||
data: NameReq & ResourceTypeReq & DescriptionReq & FullNameReq & TenantCodeReq
|
||||
): any {
|
||||
return axios({
|
||||
url: `/resources`,
|
||||
url: '/resources',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
|
|
@ -217,14 +213,14 @@ export function updateResource(
|
|||
|
||||
export function deleteResource(params: FullNameReq & TenantCodeReq): any {
|
||||
return axios({
|
||||
url: `/resources`,
|
||||
url: '/resources',
|
||||
method: 'delete',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function downloadResource(params: FullNameReq): void {
|
||||
utils.downloadFile(`resources/download`, params)
|
||||
utils.downloadFile('resources/download', params)
|
||||
}
|
||||
|
||||
export function viewUIUdfFunction(id: IdReq): any {
|
||||
|
|
@ -234,36 +230,35 @@ export function viewUIUdfFunction(id: IdReq): any {
|
|||
})
|
||||
}
|
||||
|
||||
export function updateResourceContent(data: ContentReq & TenantCodeReq & FullNameReq): any {
|
||||
export function updateResourceContent(
|
||||
data: ContentReq & TenantCodeReq & FullNameReq
|
||||
): any {
|
||||
return axios({
|
||||
url: `/resources/update-content`,
|
||||
url: '/resources/update-content',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function viewResource(params: ViewResourceReq & FullNameReq & TenantCodeReq): any {
|
||||
export function viewResource(
|
||||
params: ViewResourceReq & FullNameReq & TenantCodeReq
|
||||
): any {
|
||||
return axios({
|
||||
url: `/resources/view`,
|
||||
url: '/resources/view',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function createUdfFunc(
|
||||
data: UdfFuncReq
|
||||
): any {
|
||||
export function createUdfFunc(data: UdfFuncReq): any {
|
||||
return axios({
|
||||
url: `/resources/udf-func`,
|
||||
url: '/resources/udf-func',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUdfFunc(
|
||||
data: UdfFuncReq,
|
||||
id: number
|
||||
): any {
|
||||
export function updateUdfFunc(data: UdfFuncReq, id: number): any {
|
||||
return axios({
|
||||
url: `/resources/udf-func/${id}`,
|
||||
method: 'put',
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ interface FileNameReq {
|
|||
fileName: string
|
||||
}
|
||||
|
||||
interface TenantCodeReq{
|
||||
interface TenantCodeReq {
|
||||
tenantCode: string
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ interface ListReq {
|
|||
}
|
||||
|
||||
interface ProcessDefinitionCodeReq {
|
||||
processDefinitionCode: number
|
||||
processDefinitionCode?: number
|
||||
}
|
||||
|
||||
interface ScheduleReq {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,10 @@ export function savePoint(projectCode: number, taskId: number): any {
|
|||
})
|
||||
}
|
||||
|
||||
export function removeTaskInstanceCache(projectCode: number, taskId: number): any {
|
||||
export function removeTaskInstanceCache(
|
||||
projectCode: number,
|
||||
taskId: number
|
||||
): any {
|
||||
return axios({
|
||||
url: `projects/${projectCode}/task-instances/${taskId}/remove-cache`,
|
||||
method: 'delete'
|
||||
|
|
|
|||
|
|
@ -34,4 +34,4 @@ export const useDagStore = defineStore({
|
|||
this.tasks = tasks
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -19,4 +19,4 @@ interface DagStore {
|
|||
tasks: Array<any>
|
||||
}
|
||||
|
||||
export { DagStore }
|
||||
export { DagStore }
|
||||
|
|
|
|||
|
|
@ -15,31 +15,30 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {h} from "vue";
|
||||
import {NTag} from "naive-ui";
|
||||
import { h } from 'vue'
|
||||
import { NTag } from 'naive-ui'
|
||||
|
||||
export function renderEnvironmentalDistinctionCell(
|
||||
testFlag: number | undefined,
|
||||
t: Function
|
||||
testFlag: number | undefined,
|
||||
t: Function
|
||||
) {
|
||||
if (testFlag === 0) {
|
||||
return h(
|
||||
NTag,
|
||||
{ type: 'success', size: 'small' },
|
||||
{
|
||||
default: () => t('datasource.on_line')
|
||||
}
|
||||
)
|
||||
} else if (testFlag === 1) {
|
||||
return h(
|
||||
NTag,
|
||||
{ type: 'warning', size: 'small' },
|
||||
{
|
||||
default: () => t('datasource.test')
|
||||
}
|
||||
)
|
||||
} else {
|
||||
return '-'
|
||||
}
|
||||
if (testFlag === 0) {
|
||||
return h(
|
||||
NTag,
|
||||
{ type: 'success', size: 'small' },
|
||||
{
|
||||
default: () => t('datasource.on_line')
|
||||
}
|
||||
)
|
||||
} else if (testFlag === 1) {
|
||||
return h(
|
||||
NTag,
|
||||
{ type: 'warning', size: 'small' },
|
||||
{
|
||||
default: () => t('datasource.test')
|
||||
}
|
||||
)
|
||||
} else {
|
||||
return '-'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,12 @@
|
|||
*/
|
||||
|
||||
const removeUselessChildren = (
|
||||
list: { children?: []; directory?: boolean; disabled?: boolean; dirctory?: boolean }[]
|
||||
list: {
|
||||
children?: []
|
||||
directory?: boolean
|
||||
disabled?: boolean
|
||||
dirctory?: boolean
|
||||
}[]
|
||||
) => {
|
||||
if (!list.length) return
|
||||
list.forEach((item) => {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import {
|
|||
ref,
|
||||
toRefs
|
||||
} from 'vue'
|
||||
import {NSpace, NButton, NIcon, NDataTable, NPagination} from 'naive-ui'
|
||||
import { NSpace, NButton, NIcon, NDataTable, NPagination } from 'naive-ui'
|
||||
import { SearchOutlined } from '@vicons/antd'
|
||||
import { useTable } from './use-table'
|
||||
import Card from '@/components/card'
|
||||
|
|
@ -113,11 +113,7 @@ const TaskResult = defineComponent({
|
|||
placeholder={t('data_quality.rule.name')}
|
||||
onSearch={onSearch}
|
||||
/>
|
||||
<NButton
|
||||
size='small'
|
||||
type='primary'
|
||||
onClick={onSearch}
|
||||
>
|
||||
<NButton size='small' type='primary' onClick={onSearch}>
|
||||
<NIcon>
|
||||
<SearchOutlined />
|
||||
</NIcon>
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ const TaskResult = defineComponent({
|
|||
<Card>
|
||||
<NSpace justify='end'>
|
||||
<Search
|
||||
v-model:value={this.searchVal}
|
||||
placeholder={t('data_quality.task_result.task_name')}
|
||||
onSearch={onSearch}
|
||||
v-model:value={this.searchVal}
|
||||
placeholder={t('data_quality.task_result.task_name')}
|
||||
onSearch={onSearch}
|
||||
/>
|
||||
<NSelect
|
||||
v-model={[this.ruleType, 'value']}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ const DetailModal = defineComponent({
|
|||
() => props.show,
|
||||
async () => {
|
||||
state.detailForm.type = props.selectType
|
||||
state.detailForm.label = props.selectType === 'HIVE' ? 'HIVE/IMPALA' : props.selectType
|
||||
state.detailForm.label =
|
||||
props.selectType === 'HIVE' ? 'HIVE/IMPALA' : props.selectType
|
||||
props.show &&
|
||||
state.detailForm.type &&
|
||||
(await changeType(
|
||||
|
|
@ -116,7 +117,9 @@ const DetailModal = defineComponent({
|
|||
datasourceType[state.detailForm.type]
|
||||
))
|
||||
props.show && props.id && setFieldsValue(await queryById(props.id))
|
||||
props.show && state.detailForm.testFlag == 0 && await getSameTypeTestDataSource()
|
||||
props.show &&
|
||||
state.detailForm.testFlag == 0 &&
|
||||
(await getSameTypeTestDataSource())
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -124,12 +127,13 @@ const DetailModal = defineComponent({
|
|||
() => props.selectType,
|
||||
async () => {
|
||||
state.detailForm.type = props.selectType
|
||||
state.detailForm.label = props.selectType === 'HIVE' ? 'HIVE/IMPALA' : props.selectType
|
||||
state.detailForm.label =
|
||||
props.selectType === 'HIVE' ? 'HIVE/IMPALA' : props.selectType
|
||||
state.detailForm.type &&
|
||||
(await changeType(
|
||||
state.detailForm.type,
|
||||
datasourceType[state.detailForm.type]
|
||||
))
|
||||
(await changeType(
|
||||
state.detailForm.type,
|
||||
datasourceType[state.detailForm.type]
|
||||
))
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -205,8 +209,18 @@ const DetailModal = defineComponent({
|
|||
show-require-mark
|
||||
>
|
||||
<div class={[styles.typeBox, !!id && styles.disabledBox]}>
|
||||
<div v-model={[detailForm.type, 'value']}>{detailForm.label}</div>
|
||||
<div class={[styles['text-color'], 'btn-data-source-type-drop-down']} onClick={handleSourceModalOpen}>{t('datasource.select')}</div>
|
||||
<div v-model={[detailForm.type, 'value']}>
|
||||
{detailForm.label}
|
||||
</div>
|
||||
<div
|
||||
class={[
|
||||
styles['text-color'],
|
||||
'btn-data-source-type-drop-down'
|
||||
]}
|
||||
onClick={handleSourceModalOpen}
|
||||
>
|
||||
{t('datasource.select')}
|
||||
</div>
|
||||
</div>
|
||||
</NFormItem>
|
||||
<NFormItem
|
||||
|
|
@ -290,14 +304,18 @@ const DetailModal = defineComponent({
|
|||
</NFormItem>
|
||||
{/* 验证条件选择 */}
|
||||
<NFormItem
|
||||
v-show={showMode}
|
||||
label={t('datasource.validation')}
|
||||
path='mode'
|
||||
show-require-mark
|
||||
v-show={showMode}
|
||||
label={t('datasource.validation')}
|
||||
path='mode'
|
||||
show-require-mark
|
||||
>
|
||||
<NSelect
|
||||
v-model={[detailForm.mode, 'value']}
|
||||
options={detailForm.type === 'REDSHIFT' ? redShitModeOptions : modeOptions}
|
||||
v-model={[detailForm.mode, 'value']}
|
||||
options={
|
||||
detailForm.type === 'REDSHIFT'
|
||||
? redShitModeOptions
|
||||
: modeOptions
|
||||
}
|
||||
></NSelect>
|
||||
</NFormItem>
|
||||
{/* SqlPassword */}
|
||||
|
|
@ -329,7 +347,9 @@ const DetailModal = defineComponent({
|
|||
</NFormItem>
|
||||
{/* ActiveDirectoryPassword */}
|
||||
<NFormItem
|
||||
v-show={showMode && detailForm.mode === 'ActiveDirectoryPassword'}
|
||||
v-show={
|
||||
showMode && detailForm.mode === 'ActiveDirectoryPassword'
|
||||
}
|
||||
label={t('datasource.Azure_AD_username')}
|
||||
path='userName'
|
||||
show-require-mark
|
||||
|
|
@ -342,7 +362,9 @@ const DetailModal = defineComponent({
|
|||
/>
|
||||
</NFormItem>
|
||||
<NFormItem
|
||||
v-show={showMode && detailForm.mode === 'ActiveDirectoryPassword'}
|
||||
v-show={
|
||||
showMode && detailForm.mode === 'ActiveDirectoryPassword'
|
||||
}
|
||||
label={t('datasource.Azure_AD_password')}
|
||||
path='password'
|
||||
show-require-mark
|
||||
|
|
@ -369,7 +391,10 @@ const DetailModal = defineComponent({
|
|||
</NFormItem>
|
||||
{/* ActiveDirectoryServicePrincipal */}
|
||||
<NFormItem
|
||||
v-show={showMode && detailForm.mode === 'ActiveDirectoryServicePrincipal'}
|
||||
v-show={
|
||||
showMode &&
|
||||
detailForm.mode === 'ActiveDirectoryServicePrincipal'
|
||||
}
|
||||
label={t('datasource.clientId')}
|
||||
path='userName'
|
||||
show-require-mark
|
||||
|
|
@ -382,7 +407,10 @@ const DetailModal = defineComponent({
|
|||
/>
|
||||
</NFormItem>
|
||||
<NFormItem
|
||||
v-show={showMode && detailForm.mode === 'ActiveDirectoryServicePrincipal'}
|
||||
v-show={
|
||||
showMode &&
|
||||
detailForm.mode === 'ActiveDirectoryServicePrincipal'
|
||||
}
|
||||
label={t('datasource.clientSecret')}
|
||||
path='password'
|
||||
show-require-mark
|
||||
|
|
@ -528,17 +556,17 @@ const DetailModal = defineComponent({
|
|||
/>
|
||||
</NFormItem>
|
||||
<NFormItem
|
||||
v-show={showAwsRegion}
|
||||
label={t('datasource.aws_region')}
|
||||
path='awsRegion'
|
||||
show-require-mark
|
||||
v-show={showAwsRegion}
|
||||
label={t('datasource.aws_region')}
|
||||
path='awsRegion'
|
||||
show-require-mark
|
||||
>
|
||||
<NInput
|
||||
allowInput={this.trim}
|
||||
v-model={[detailForm.awsRegion, 'value']}
|
||||
type='text'
|
||||
maxlength={60}
|
||||
placeholder={t('datasource.aws_region_tips')}
|
||||
allowInput={this.trim}
|
||||
v-model={[detailForm.awsRegion, 'value']}
|
||||
type='text'
|
||||
maxlength={60}
|
||||
placeholder={t('datasource.aws_region_tips')}
|
||||
/>
|
||||
</NFormItem>
|
||||
<NFormItem
|
||||
|
|
@ -557,19 +585,19 @@ const DetailModal = defineComponent({
|
|||
/>
|
||||
</NFormItem>
|
||||
{detailForm.type === 'SNOWFLAKE' && (
|
||||
<NFormItem
|
||||
label={t('datasource.datawarehouse')}
|
||||
path='datawarehouse'
|
||||
show-require-mark
|
||||
>
|
||||
<NInput
|
||||
allowInput={this.trim}
|
||||
class='input-datawarehouse'
|
||||
v-model={[detailForm.datawarehouse, 'value']}
|
||||
maxlength={60}
|
||||
placeholder={t('datasource.datawarehouse_tips')}
|
||||
/>
|
||||
</NFormItem>
|
||||
<NFormItem
|
||||
label={t('datasource.datawarehouse')}
|
||||
path='datawarehouse'
|
||||
show-require-mark
|
||||
>
|
||||
<NInput
|
||||
allowInput={this.trim}
|
||||
class='input-datawarehouse'
|
||||
v-model={[detailForm.datawarehouse, 'value']}
|
||||
maxlength={60}
|
||||
placeholder={t('datasource.datawarehouse_tips')}
|
||||
/>
|
||||
</NFormItem>
|
||||
)}
|
||||
<NFormItem
|
||||
v-show={showConnectType}
|
||||
|
|
@ -655,16 +683,16 @@ const DetailModal = defineComponent({
|
|||
/>
|
||||
</NFormItem>
|
||||
<NFormItem
|
||||
v-show={showPublicKey}
|
||||
label='PublicKey'
|
||||
path='publicKey'
|
||||
v-show={showPublicKey}
|
||||
label='PublicKey'
|
||||
path='publicKey'
|
||||
>
|
||||
<NInput
|
||||
v-model={[detailForm.publicKey, 'value']}
|
||||
type='textarea'
|
||||
autosize={{
|
||||
minRows: 4
|
||||
}}
|
||||
v-model={[detailForm.publicKey, 'value']}
|
||||
type='textarea'
|
||||
autosize={{
|
||||
minRows: 4
|
||||
}}
|
||||
/>
|
||||
</NFormItem>
|
||||
</NForm>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import {
|
|||
calculateTableWidth,
|
||||
DefaultTableWidth
|
||||
} from '@/common/column-width-config'
|
||||
import {renderEnvironmentalDistinctionCell} from "@/utils/environmental-distinction";
|
||||
import { renderEnvironmentalDistinctionCell } from '@/utils/environmental-distinction'
|
||||
|
||||
export function useColumns(onCallback: Function) {
|
||||
const { t } = useI18n()
|
||||
|
|
@ -118,7 +118,8 @@ export function useColumns(onCallback: Function) {
|
|||
circle: true,
|
||||
type: 'info',
|
||||
size: 'small',
|
||||
onClick: () => void onCallback(rowData.id, 'edit', rowData)
|
||||
onClick: () =>
|
||||
void onCallback(rowData.id, 'edit', rowData)
|
||||
},
|
||||
{
|
||||
default: () =>
|
||||
|
|
|
|||
|
|
@ -220,25 +220,25 @@ export function useForm(id?: number) {
|
|||
} as FormRules,
|
||||
modeOptions: [
|
||||
{
|
||||
label: "SqlPassword",
|
||||
value: 'SqlPassword',
|
||||
label: 'SqlPassword',
|
||||
value: 'SqlPassword'
|
||||
},
|
||||
{
|
||||
label: "ActiveDirectoryPassword",
|
||||
value: 'ActiveDirectoryPassword',
|
||||
label: 'ActiveDirectoryPassword',
|
||||
value: 'ActiveDirectoryPassword'
|
||||
},
|
||||
{
|
||||
label: "ActiveDirectoryMSI",
|
||||
value: 'ActiveDirectoryMSI',
|
||||
label: 'ActiveDirectoryMSI',
|
||||
value: 'ActiveDirectoryMSI'
|
||||
},
|
||||
{
|
||||
label: "ActiveDirectoryServicePrincipal",
|
||||
value: 'ActiveDirectoryServicePrincipal',
|
||||
label: 'ActiveDirectoryServicePrincipal',
|
||||
value: 'ActiveDirectoryServicePrincipal'
|
||||
},
|
||||
{
|
||||
label: "accessToken",
|
||||
value: 'accessToken',
|
||||
},
|
||||
label: 'accessToken',
|
||||
value: 'accessToken'
|
||||
}
|
||||
],
|
||||
redShitModeOptions: [
|
||||
{
|
||||
|
|
@ -256,7 +256,7 @@ export function useForm(id?: number) {
|
|||
state.detailForm.port = options.previousPort || options.defaultPort
|
||||
state.detailForm.type = type
|
||||
|
||||
state.requiredDataBase = (type !== 'POSTGRESQL' && type !== 'ATHENA')
|
||||
state.requiredDataBase = type !== 'POSTGRESQL' && type !== 'ATHENA'
|
||||
|
||||
state.showHost = type !== 'ATHENA'
|
||||
state.showPort = type !== 'ATHENA'
|
||||
|
|
@ -280,12 +280,11 @@ export function useForm(id?: number) {
|
|||
state.requiredDataBase = false
|
||||
state.showJDBCConnectParameters = false
|
||||
state.showPublicKey = true
|
||||
}else {
|
||||
} else {
|
||||
state.showDataBaseName = true
|
||||
state.requiredDataBase = true
|
||||
state.showJDBCConnectParameters = true
|
||||
state.showPublicKey = false
|
||||
|
||||
}
|
||||
|
||||
if (state.detailForm.id === undefined) {
|
||||
|
|
@ -312,13 +311,13 @@ export function useForm(id?: number) {
|
|||
const params = { type: state.detailForm.type, testFlag: 1 } as TypeReq
|
||||
const result = await queryDataSourceList(params)
|
||||
state.bindTestDataSourceExample = result
|
||||
.filter((value: { label: string; value: string }) => {
|
||||
// @ts-ignore
|
||||
if (state.detailForm.id && state.detailForm.id === value.id)
|
||||
return false
|
||||
return true
|
||||
})
|
||||
.map((TestDataSourceExample: { name: string; id: number }) => ({
|
||||
.filter((value: { label: string; value: string }) => {
|
||||
// @ts-ignore
|
||||
if (state.detailForm.id && state.detailForm.id === value.id)
|
||||
return false
|
||||
return true
|
||||
})
|
||||
.map((TestDataSourceExample: { name: string; id: number }) => ({
|
||||
label: TestDataSourceExample.name,
|
||||
value: TestDataSourceExample.id
|
||||
}))
|
||||
|
|
@ -338,7 +337,6 @@ export function useForm(id?: number) {
|
|||
|
||||
const getFieldsValue = () => state.detailForm
|
||||
|
||||
|
||||
return {
|
||||
state,
|
||||
changeType,
|
||||
|
|
@ -418,9 +416,9 @@ export const datasourceType: IDataBaseOptionKeys = {
|
|||
defaultPort: 1433
|
||||
},
|
||||
STARROCKS: {
|
||||
value: 'STARROCKS',
|
||||
label: 'STARROCKS',
|
||||
defaultPort: 9030
|
||||
value: 'STARROCKS',
|
||||
label: 'STARROCKS',
|
||||
defaultPort: 9030
|
||||
},
|
||||
DAMENG: {
|
||||
value: 'DAMENG',
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {reactive, ref} from 'vue'
|
||||
import { reactive, ref } from 'vue'
|
||||
import {
|
||||
queryDataSourceListPaging,
|
||||
deleteDataSource
|
||||
|
|
|
|||
|
|
@ -15,7 +15,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {defineComponent, getCurrentInstance, onMounted, toRefs, withKeys} from 'vue'
|
||||
import {
|
||||
defineComponent,
|
||||
getCurrentInstance,
|
||||
onMounted,
|
||||
toRefs,
|
||||
withKeys
|
||||
} from 'vue'
|
||||
import styles from './index.module.scss'
|
||||
import {
|
||||
NInput,
|
||||
|
|
@ -31,7 +37,7 @@ import { useLogin } from './use-login'
|
|||
import { useLocalesStore } from '@/store/locales/locales'
|
||||
import { useThemeStore } from '@/store/theme/theme'
|
||||
import cookies from 'js-cookie'
|
||||
import {ssoLoginUrl} from "@/service/modules/login";
|
||||
import { ssoLoginUrl } from '@/service/modules/login'
|
||||
|
||||
const login = defineComponent({
|
||||
name: 'login',
|
||||
|
|
@ -57,8 +63,8 @@ const login = defineComponent({
|
|||
state.loginForm.ssoLoginUrl = ssoLoginUrlRes
|
||||
if (state.loginForm.ssoLoginUrl) {
|
||||
const url = new URL(window.location.href)
|
||||
let ssoState = url.searchParams.get('state')
|
||||
let ssoCode = url.searchParams.get('code')
|
||||
const ssoState = url.searchParams.get('state')
|
||||
const ssoCode = url.searchParams.get('code')
|
||||
if (ssoState && ssoCode) {
|
||||
state.loginForm.userName = ssoState
|
||||
state.loginForm.userPassword = ssoCode
|
||||
|
|
@ -98,7 +104,10 @@ const login = defineComponent({
|
|||
<div class={styles.logo}>
|
||||
<div class={styles['logo-img']} />
|
||||
</div>
|
||||
<div class={styles['form-model']} v-show={this.loginForm.ssoLoginUrl.length === 0}>
|
||||
<div
|
||||
class={styles['form-model']}
|
||||
v-show={this.loginForm.ssoLoginUrl.length === 0}
|
||||
>
|
||||
<NForm rules={this.rules} ref='loginFormRef'>
|
||||
<NFormItem
|
||||
label={this.t('login.userName')}
|
||||
|
|
@ -145,14 +154,17 @@ const login = defineComponent({
|
|||
{this.t('login.login')}
|
||||
</NButton>
|
||||
</div>
|
||||
<div class={styles['form-model']} v-show={this.loginForm.ssoLoginUrl.length !== 0}>
|
||||
<a href={this.loginForm.ssoLoginUrl} style="text-decoration:none">
|
||||
<div
|
||||
class={styles['form-model']}
|
||||
v-show={this.loginForm.ssoLoginUrl.length !== 0}
|
||||
>
|
||||
<a href={this.loginForm.ssoLoginUrl} style='text-decoration:none'>
|
||||
<NButton
|
||||
class='btn-login-sso'
|
||||
round
|
||||
type='info'
|
||||
style={{width: '100%', marginTop: '30px'}}
|
||||
onClick={this.handleLogin}
|
||||
class='btn-login-sso'
|
||||
round
|
||||
type='info'
|
||||
style={{ width: '100%', marginTop: '30px' }}
|
||||
onClick={this.handleLogin}
|
||||
>
|
||||
{this.t('login.ssoLogin')}
|
||||
</NButton>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import type { UserInfoRes } from '@/service/modules/users/types'
|
|||
import { useRouteStore } from '@/store/route/route'
|
||||
import { useTimezoneStore } from '@/store/timezone/timezone'
|
||||
import cookies from 'js-cookie'
|
||||
import {queryBaseDir} from "@/service/modules/resources";
|
||||
import { queryBaseDir } from '@/service/modules/resources'
|
||||
|
||||
export function useLogin(state: any) {
|
||||
const router: Router = useRouter()
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export function useForm() {
|
|||
profileForm: {
|
||||
username: userInfo.userName,
|
||||
email: userInfo.email,
|
||||
phone: userInfo.phone,
|
||||
phone: userInfo.phone
|
||||
},
|
||||
saving: false,
|
||||
rules: {
|
||||
|
|
@ -63,7 +63,7 @@ export function useForm() {
|
|||
state.profileForm = {
|
||||
username: userInfo.userName,
|
||||
email: userInfo.email,
|
||||
phone: userInfo.phone,
|
||||
phone: userInfo.phone
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -16,13 +16,7 @@
|
|||
*/
|
||||
|
||||
import { SearchOutlined } from '@vicons/antd'
|
||||
import {
|
||||
NButton,
|
||||
NDataTable,
|
||||
NIcon,
|
||||
NPagination,
|
||||
NSpace
|
||||
} from 'naive-ui'
|
||||
import { NButton, NDataTable, NIcon, NPagination, NSpace } from 'naive-ui'
|
||||
import {
|
||||
defineComponent,
|
||||
getCurrentInstance,
|
||||
|
|
@ -33,7 +27,7 @@ import {
|
|||
import { useI18n } from 'vue-i18n'
|
||||
import { useTable } from './use-table'
|
||||
import Card from '@/components/card'
|
||||
import Search from "@/components/input-search";
|
||||
import Search from '@/components/input-search'
|
||||
import ProjectModal from './components/project-modal'
|
||||
|
||||
const list = defineComponent({
|
||||
|
|
@ -122,10 +116,10 @@ const list = defineComponent({
|
|||
</NButton>
|
||||
<NSpace>
|
||||
<Search
|
||||
v-model:value = {this.searchVal}
|
||||
placeholder={t('project.list.project_tips')}
|
||||
onSearch={this.handleSearch}
|
||||
onClear={this.onClearSearch}
|
||||
v-model:value={this.searchVal}
|
||||
placeholder={t('project.list.project_tips')}
|
||||
onSearch={this.handleSearch}
|
||||
onClear={this.onClearSearch}
|
||||
/>
|
||||
|
||||
<NButton size='small' type='primary' onClick={this.handleSearch}>
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export function useTable() {
|
|||
onClick: () => {
|
||||
router.push({
|
||||
path: `/projects/${row.code}`,
|
||||
query: {projectName: row.name}
|
||||
query: { projectName: row.name }
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ import { useI18n } from 'vue-i18n'
|
|||
import type { IJsonItem } from '../types'
|
||||
|
||||
export function useCache(): IJsonItem {
|
||||
const { t } = useI18n()
|
||||
return {
|
||||
type: 'switch',
|
||||
field: 'isCache',
|
||||
name: t('project.node.is_cache'),
|
||||
span: 12
|
||||
}
|
||||
const { t } = useI18n()
|
||||
return {
|
||||
type: 'switch',
|
||||
field: 'isCache',
|
||||
name: t('project.node.is_cache'),
|
||||
span: 12
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,64 +19,64 @@ import { useI18n } from 'vue-i18n'
|
|||
import type { IJsonItem } from '../types'
|
||||
|
||||
export function useCustomLabels({
|
||||
model,
|
||||
field,
|
||||
name = 'custom_labels',
|
||||
span = 24
|
||||
}: {
|
||||
model: { [field: string]: any }
|
||||
field: string
|
||||
name?: string
|
||||
span?: Ref | number
|
||||
model,
|
||||
field,
|
||||
name = 'custom_labels',
|
||||
span = 24
|
||||
}: {
|
||||
model: { [field: string]: any }
|
||||
field: string
|
||||
name?: string
|
||||
span?: Ref | number
|
||||
}): IJsonItem[] {
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n()
|
||||
|
||||
return [
|
||||
return [
|
||||
{
|
||||
type: 'custom-parameters',
|
||||
field: field,
|
||||
name: t(`project.node.${name}`),
|
||||
class: 'btn-custom-parameters',
|
||||
span,
|
||||
children: [
|
||||
{
|
||||
type: 'custom-parameters',
|
||||
field: field,
|
||||
name: t(`project.node.${name}`),
|
||||
class: 'btn-custom-parameters',
|
||||
span,
|
||||
children: [
|
||||
{
|
||||
type: 'input',
|
||||
field: 'label',
|
||||
span: 8,
|
||||
class: 'customized-label-name',
|
||||
props: {
|
||||
placeholder: t('project.node.label_name_tips'),
|
||||
maxLength: 256
|
||||
},
|
||||
validate: {
|
||||
trigger: ['input', 'blur'],
|
||||
required: true,
|
||||
validator(validate: any, value: string) {
|
||||
if (!value) {
|
||||
return new Error(t('project.node.label_name_tips'))
|
||||
}
|
||||
type: 'input',
|
||||
field: 'label',
|
||||
span: 8,
|
||||
class: 'customized-label-name',
|
||||
props: {
|
||||
placeholder: t('project.node.label_name_tips'),
|
||||
maxLength: 256
|
||||
},
|
||||
validate: {
|
||||
trigger: ['input', 'blur'],
|
||||
required: true,
|
||||
validator(validate: any, value: string) {
|
||||
if (!value) {
|
||||
return new Error(t('project.node.label_name_tips'))
|
||||
}
|
||||
|
||||
const sameItems = model[field].filter(
|
||||
(item: { label: string }) => item.label === value
|
||||
)
|
||||
const sameItems = model[field].filter(
|
||||
(item: { label: string }) => item.label === value
|
||||
)
|
||||
|
||||
if (sameItems.length > 1) {
|
||||
return new Error(t('project.node.label_repeat'))
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'value',
|
||||
span: 14,
|
||||
class: 'customized-label-value',
|
||||
props: {
|
||||
placeholder: t('project.node.label_value_tips'),
|
||||
maxLength: 256
|
||||
}
|
||||
}
|
||||
]
|
||||
if (sameItems.length > 1) {
|
||||
return new Error(t('project.node.label_repeat'))
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'value',
|
||||
span: 14,
|
||||
class: 'customized-label-value',
|
||||
props: {
|
||||
placeholder: t('project.node.label_value_tips'),
|
||||
maxLength: 256
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ export function useDatasource(
|
|||
id: 16,
|
||||
code: 'DATABEND',
|
||||
disabled: false
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
const getDatasourceTypes = async () => {
|
||||
|
|
|
|||
|
|
@ -20,67 +20,66 @@ import { watch, ref } from 'vue'
|
|||
import { useCustomParams } from '.'
|
||||
|
||||
export function useDatasync(model: { [field: string]: any }): IJsonItem[] {
|
||||
const jsonSpan = ref(0)
|
||||
const destinationLocationArnSpan = ref(0)
|
||||
const sourceLocationArnSpan = ref(0)
|
||||
const nameSpan = ref(0)
|
||||
const cloudWatchLogGroupArnSpan = ref(0)
|
||||
|
||||
const jsonSpan = ref(0)
|
||||
const destinationLocationArnSpan = ref(0)
|
||||
const sourceLocationArnSpan = ref(0)
|
||||
const nameSpan = ref(0)
|
||||
const cloudWatchLogGroupArnSpan = ref(0)
|
||||
const resetSpan = () => {
|
||||
jsonSpan.value = model.jsonFormat ? 24 : 0
|
||||
destinationLocationArnSpan.value = model.jsonFormat ? 0 : 24
|
||||
sourceLocationArnSpan.value = model.jsonFormat ? 0 : 24
|
||||
nameSpan.value = model.jsonFormat ? 0 : 24
|
||||
cloudWatchLogGroupArnSpan.value = model.jsonFormat ? 0 : 24
|
||||
}
|
||||
|
||||
const resetSpan = () => {
|
||||
jsonSpan.value = model.jsonFormat ? 24 : 0
|
||||
destinationLocationArnSpan.value = model.jsonFormat ? 0 : 24
|
||||
sourceLocationArnSpan.value = model.jsonFormat ? 0 : 24
|
||||
nameSpan.value = model.jsonFormat ? 0 : 24
|
||||
cloudWatchLogGroupArnSpan.value = model.jsonFormat ? 0 : 24
|
||||
watch(
|
||||
() => [model.jsonFormat],
|
||||
() => {
|
||||
resetSpan()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => [model.jsonFormat],
|
||||
() => {
|
||||
resetSpan()
|
||||
}
|
||||
)
|
||||
resetSpan()
|
||||
|
||||
resetSpan()
|
||||
|
||||
return [
|
||||
{
|
||||
type: 'switch',
|
||||
field: 'jsonFormat',
|
||||
name: 'jsonFormat',
|
||||
span: 12
|
||||
},
|
||||
{
|
||||
type: 'editor',
|
||||
field: 'json',
|
||||
name: 'json',
|
||||
span: jsonSpan
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'destinationLocationArn',
|
||||
name: 'destinationLocationArn',
|
||||
span: destinationLocationArnSpan
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'sourceLocationArn',
|
||||
name: 'sourceLocationArn',
|
||||
span: sourceLocationArnSpan
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'name',
|
||||
name: 'name',
|
||||
span: nameSpan
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'cloudWatchLogGroupArn',
|
||||
name: 'cloudWatchLogGroupArn',
|
||||
span: cloudWatchLogGroupArnSpan
|
||||
},
|
||||
...useCustomParams({ model, field: 'localParams', isSimple: false })
|
||||
]
|
||||
}
|
||||
return [
|
||||
{
|
||||
type: 'switch',
|
||||
field: 'jsonFormat',
|
||||
name: 'jsonFormat',
|
||||
span: 12
|
||||
},
|
||||
{
|
||||
type: 'editor',
|
||||
field: 'json',
|
||||
name: 'json',
|
||||
span: jsonSpan
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'destinationLocationArn',
|
||||
name: 'destinationLocationArn',
|
||||
span: destinationLocationArnSpan
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'sourceLocationArn',
|
||||
name: 'sourceLocationArn',
|
||||
span: sourceLocationArnSpan
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'name',
|
||||
name: 'name',
|
||||
span: nameSpan
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
field: 'cloudWatchLogGroupArn',
|
||||
name: 'cloudWatchLogGroupArn',
|
||||
span: cloudWatchLogGroupArnSpan
|
||||
},
|
||||
...useCustomParams({ model, field: 'localParams', isSimple: false })
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,243 +14,243 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {ref, onMounted, watch} from 'vue'
|
||||
import {useI18n} from 'vue-i18n'
|
||||
import {useCustomParams, useDatasource, useResources} from '.'
|
||||
import type {IJsonItem} from '../types'
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useCustomParams, useDatasource, useResources } from '.'
|
||||
import type { IJsonItem } from '../types'
|
||||
|
||||
export function useDataX(model: { [field: string]: any }): IJsonItem[] {
|
||||
const {t} = useI18n()
|
||||
const jobSpeedByteOptions: any[] = [
|
||||
{
|
||||
label: `0(${t('project.node.unlimited')})`,
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '1KB',
|
||||
value: 1024
|
||||
},
|
||||
{
|
||||
label: '10KB',
|
||||
value: 10240
|
||||
},
|
||||
{
|
||||
label: '50KB',
|
||||
value: 51200
|
||||
},
|
||||
{
|
||||
label: '100KB',
|
||||
value: 102400
|
||||
},
|
||||
{
|
||||
label: '512KB',
|
||||
value: 524288
|
||||
}
|
||||
]
|
||||
const jobSpeedRecordOptions: any[] = [
|
||||
{
|
||||
label: `0(${t('project.node.unlimited')})`,
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '500',
|
||||
value: 500
|
||||
},
|
||||
{
|
||||
label: '1000',
|
||||
value: 1000
|
||||
},
|
||||
{
|
||||
label: '1500',
|
||||
value: 1500
|
||||
},
|
||||
{
|
||||
label: '2000',
|
||||
value: 2000
|
||||
},
|
||||
{
|
||||
label: '2500',
|
||||
value: 2500
|
||||
},
|
||||
{
|
||||
label: '3000',
|
||||
value: 3000
|
||||
}
|
||||
]
|
||||
const memoryLimitOptions = [
|
||||
{
|
||||
label: '1G',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '2G',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '3G',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
label: '4G',
|
||||
value: 4
|
||||
}
|
||||
]
|
||||
|
||||
const sqlEditorSpan = ref(24)
|
||||
const jsonEditorSpan = ref(0)
|
||||
const datasourceSpan = ref(12)
|
||||
const destinationDatasourceSpan = ref(8)
|
||||
const otherStatementSpan = ref(22)
|
||||
const jobSpeedSpan = ref(12)
|
||||
const useResourcesSpan = ref(0)
|
||||
|
||||
const initConstants = () => {
|
||||
if (model.customConfig) {
|
||||
sqlEditorSpan.value = 0
|
||||
jsonEditorSpan.value = 24
|
||||
datasourceSpan.value = 0
|
||||
destinationDatasourceSpan.value = 0
|
||||
otherStatementSpan.value = 0
|
||||
jobSpeedSpan.value = 0
|
||||
useResourcesSpan.value = 24
|
||||
} else {
|
||||
sqlEditorSpan.value = 24
|
||||
jsonEditorSpan.value = 0
|
||||
datasourceSpan.value = 12
|
||||
destinationDatasourceSpan.value = 8
|
||||
otherStatementSpan.value = 22
|
||||
jobSpeedSpan.value = 12
|
||||
useResourcesSpan.value = 0
|
||||
}
|
||||
const { t } = useI18n()
|
||||
const jobSpeedByteOptions: any[] = [
|
||||
{
|
||||
label: `0(${t('project.node.unlimited')})`,
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '1KB',
|
||||
value: 1024
|
||||
},
|
||||
{
|
||||
label: '10KB',
|
||||
value: 10240
|
||||
},
|
||||
{
|
||||
label: '50KB',
|
||||
value: 51200
|
||||
},
|
||||
{
|
||||
label: '100KB',
|
||||
value: 102400
|
||||
},
|
||||
{
|
||||
label: '512KB',
|
||||
value: 524288
|
||||
}
|
||||
const supportedDatasourceType = [
|
||||
'MYSQL',
|
||||
'POSTGRESQL',
|
||||
'ORACLE',
|
||||
'SQLSERVER',
|
||||
'CLICKHOUSE',
|
||||
'DATABEND',
|
||||
'HIVE',
|
||||
'PRESTO'
|
||||
]
|
||||
onMounted(() => {
|
||||
initConstants()
|
||||
})
|
||||
watch(
|
||||
() => model.customConfig,
|
||||
() => {
|
||||
initConstants()
|
||||
}
|
||||
)
|
||||
]
|
||||
const jobSpeedRecordOptions: any[] = [
|
||||
{
|
||||
label: `0(${t('project.node.unlimited')})`,
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '500',
|
||||
value: 500
|
||||
},
|
||||
{
|
||||
label: '1000',
|
||||
value: 1000
|
||||
},
|
||||
{
|
||||
label: '1500',
|
||||
value: 1500
|
||||
},
|
||||
{
|
||||
label: '2000',
|
||||
value: 2000
|
||||
},
|
||||
{
|
||||
label: '2500',
|
||||
value: 2500
|
||||
},
|
||||
{
|
||||
label: '3000',
|
||||
value: 3000
|
||||
}
|
||||
]
|
||||
const memoryLimitOptions = [
|
||||
{
|
||||
label: '1G',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '2G',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '3G',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
label: '4G',
|
||||
value: 4
|
||||
}
|
||||
]
|
||||
|
||||
return [
|
||||
{
|
||||
type: 'switch',
|
||||
field: 'customConfig',
|
||||
name: t('project.node.datax_custom_template')
|
||||
},
|
||||
...useDatasource(model, {
|
||||
typeField: 'dsType',
|
||||
sourceField: 'dataSource',
|
||||
span: datasourceSpan,
|
||||
supportedDatasourceType
|
||||
}),
|
||||
{
|
||||
type: 'editor',
|
||||
field: 'sql',
|
||||
name: t('project.node.sql_statement'),
|
||||
span: sqlEditorSpan,
|
||||
validate: {
|
||||
trigger: ['input', 'trigger'],
|
||||
required: true,
|
||||
message: t('project.node.sql_empty_tips')
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'editor',
|
||||
field: 'json',
|
||||
name: t('project.node.datax_json_template'),
|
||||
span: jsonEditorSpan,
|
||||
validate: {
|
||||
trigger: ['input', 'trigger'],
|
||||
required: true,
|
||||
message: t('project.node.sql_empty_tips')
|
||||
}
|
||||
},
|
||||
useResources(useResourcesSpan),
|
||||
...useDatasource(model, {
|
||||
typeField: 'dtType',
|
||||
sourceField: 'dataTarget',
|
||||
span: destinationDatasourceSpan,
|
||||
supportedDatasourceType
|
||||
}),
|
||||
{
|
||||
type: 'input',
|
||||
field: 'targetTable',
|
||||
name: t('project.node.datax_target_table'),
|
||||
span: destinationDatasourceSpan,
|
||||
props: {
|
||||
placeholder: t('project.node.datax_target_table_tips')
|
||||
},
|
||||
validate: {
|
||||
trigger: ['input', 'blur'],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'multi-input',
|
||||
field: 'preStatements',
|
||||
name: t('project.node.datax_target_database_pre_sql'),
|
||||
span: otherStatementSpan,
|
||||
props: {
|
||||
placeholder: t('project.node.datax_non_query_sql_tips'),
|
||||
type: 'textarea',
|
||||
autosize: {minRows: 1}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'multi-input',
|
||||
field: 'postStatements',
|
||||
name: t('project.node.datax_target_database_post_sql'),
|
||||
span: otherStatementSpan,
|
||||
props: {
|
||||
placeholder: t('project.node.datax_non_query_sql_tips'),
|
||||
type: 'textarea',
|
||||
autosize: {minRows: 1}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
field: 'jobSpeedByte',
|
||||
name: t('project.node.datax_job_speed_byte'),
|
||||
span: jobSpeedSpan,
|
||||
options: jobSpeedByteOptions,
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
field: 'jobSpeedRecord',
|
||||
name: t('project.node.datax_job_speed_record'),
|
||||
span: jobSpeedSpan,
|
||||
options: jobSpeedRecordOptions,
|
||||
value: 1000
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
field: 'xms',
|
||||
name: t('project.node.datax_job_runtime_memory_xms'),
|
||||
span: 12,
|
||||
options: memoryLimitOptions,
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
field: 'xmx',
|
||||
name: t('project.node.datax_job_runtime_memory_xmx'),
|
||||
span: 12,
|
||||
options: memoryLimitOptions,
|
||||
value: 1
|
||||
},
|
||||
...useCustomParams({model, field: 'localParams', isSimple: true})
|
||||
]
|
||||
const sqlEditorSpan = ref(24)
|
||||
const jsonEditorSpan = ref(0)
|
||||
const datasourceSpan = ref(12)
|
||||
const destinationDatasourceSpan = ref(8)
|
||||
const otherStatementSpan = ref(22)
|
||||
const jobSpeedSpan = ref(12)
|
||||
const useResourcesSpan = ref(0)
|
||||
|
||||
const initConstants = () => {
|
||||
if (model.customConfig) {
|
||||
sqlEditorSpan.value = 0
|
||||
jsonEditorSpan.value = 24
|
||||
datasourceSpan.value = 0
|
||||
destinationDatasourceSpan.value = 0
|
||||
otherStatementSpan.value = 0
|
||||
jobSpeedSpan.value = 0
|
||||
useResourcesSpan.value = 24
|
||||
} else {
|
||||
sqlEditorSpan.value = 24
|
||||
jsonEditorSpan.value = 0
|
||||
datasourceSpan.value = 12
|
||||
destinationDatasourceSpan.value = 8
|
||||
otherStatementSpan.value = 22
|
||||
jobSpeedSpan.value = 12
|
||||
useResourcesSpan.value = 0
|
||||
}
|
||||
}
|
||||
const supportedDatasourceType = [
|
||||
'MYSQL',
|
||||
'POSTGRESQL',
|
||||
'ORACLE',
|
||||
'SQLSERVER',
|
||||
'CLICKHOUSE',
|
||||
'DATABEND',
|
||||
'HIVE',
|
||||
'PRESTO'
|
||||
]
|
||||
onMounted(() => {
|
||||
initConstants()
|
||||
})
|
||||
watch(
|
||||
() => model.customConfig,
|
||||
() => {
|
||||
initConstants()
|
||||
}
|
||||
)
|
||||
|
||||
return [
|
||||
{
|
||||
type: 'switch',
|
||||
field: 'customConfig',
|
||||
name: t('project.node.datax_custom_template')
|
||||
},
|
||||
...useDatasource(model, {
|
||||
typeField: 'dsType',
|
||||
sourceField: 'dataSource',
|
||||
span: datasourceSpan,
|
||||
supportedDatasourceType
|
||||
}),
|
||||
{
|
||||
type: 'editor',
|
||||
field: 'sql',
|
||||
name: t('project.node.sql_statement'),
|
||||
span: sqlEditorSpan,
|
||||
validate: {
|
||||
trigger: ['input', 'trigger'],
|
||||
required: true,
|
||||
message: t('project.node.sql_empty_tips')
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'editor',
|
||||
field: 'json',
|
||||
name: t('project.node.datax_json_template'),
|
||||
span: jsonEditorSpan,
|
||||
validate: {
|
||||
trigger: ['input', 'trigger'],
|
||||
required: true,
|
||||
message: t('project.node.sql_empty_tips')
|
||||
}
|
||||
},
|
||||
useResources(useResourcesSpan),
|
||||
...useDatasource(model, {
|
||||
typeField: 'dtType',
|
||||
sourceField: 'dataTarget',
|
||||
span: destinationDatasourceSpan,
|
||||
supportedDatasourceType
|
||||
}),
|
||||
{
|
||||
type: 'input',
|
||||
field: 'targetTable',
|
||||
name: t('project.node.datax_target_table'),
|
||||
span: destinationDatasourceSpan,
|
||||
props: {
|
||||
placeholder: t('project.node.datax_target_table_tips')
|
||||
},
|
||||
validate: {
|
||||
trigger: ['input', 'blur'],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'multi-input',
|
||||
field: 'preStatements',
|
||||
name: t('project.node.datax_target_database_pre_sql'),
|
||||
span: otherStatementSpan,
|
||||
props: {
|
||||
placeholder: t('project.node.datax_non_query_sql_tips'),
|
||||
type: 'textarea',
|
||||
autosize: { minRows: 1 }
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'multi-input',
|
||||
field: 'postStatements',
|
||||
name: t('project.node.datax_target_database_post_sql'),
|
||||
span: otherStatementSpan,
|
||||
props: {
|
||||
placeholder: t('project.node.datax_non_query_sql_tips'),
|
||||
type: 'textarea',
|
||||
autosize: { minRows: 1 }
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
field: 'jobSpeedByte',
|
||||
name: t('project.node.datax_job_speed_byte'),
|
||||
span: jobSpeedSpan,
|
||||
options: jobSpeedByteOptions,
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
field: 'jobSpeedRecord',
|
||||
name: t('project.node.datax_job_speed_record'),
|
||||
span: jobSpeedSpan,
|
||||
options: jobSpeedRecordOptions,
|
||||
value: 1000
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
field: 'xms',
|
||||
name: t('project.node.datax_job_runtime_memory_xms'),
|
||||
span: 12,
|
||||
options: memoryLimitOptions,
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
field: 'xmx',
|
||||
name: t('project.node.datax_job_runtime_memory_xmx'),
|
||||
span: 12,
|
||||
options: memoryLimitOptions,
|
||||
value: 1
|
||||
},
|
||||
...useCustomParams({ model, field: 'localParams', isSimple: true })
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ export function useDependentTimeout(model: {
|
|||
}): IJsonItem[] {
|
||||
const { t } = useI18n()
|
||||
const timeCompleteSpan = computed(() => (model.timeoutShowFlag ? 24 : 0))
|
||||
const timeCompleteEnableSpan = computed(() => (model.timeoutFlag && model.timeoutShowFlag ? 12 : 0))
|
||||
const timeCompleteEnableSpan = computed(() =>
|
||||
model.timeoutFlag && model.timeoutShowFlag ? 12 : 0
|
||||
)
|
||||
|
||||
const strategyOptions = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import { watch, ref } from 'vue'
|
|||
import { useCustomParams, useResources } from '.'
|
||||
|
||||
export function useDms(model: { [field: string]: any }): IJsonItem[] {
|
||||
|
||||
const jsonDataSpan = ref(0)
|
||||
const replicationTaskArnSpan = ref(0)
|
||||
const replicationTaskIdentifierSpan = ref(0)
|
||||
|
|
@ -31,8 +30,10 @@ export function useDms(model: { [field: string]: any }): IJsonItem[] {
|
|||
const tableMappingsSpan = ref(0)
|
||||
|
||||
const setFlag = () => {
|
||||
model.isCreateAndNotJson = !model.isRestartTask && !model.isJsonFormat ? true : false
|
||||
model.isRestartAndNotJson = model.isRestartTask && !model.isJsonFormat ? true : false
|
||||
model.isCreateAndNotJson =
|
||||
!model.isRestartTask && !model.isJsonFormat ? true : false
|
||||
model.isRestartAndNotJson =
|
||||
model.isRestartTask && !model.isJsonFormat ? true : false
|
||||
}
|
||||
|
||||
const resetSpan = () => {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ export function useEnvironmentName(
|
|||
if (options.value.length === 0) {
|
||||
model.environmentCode = null
|
||||
} else {
|
||||
(isCreate && !model.environmentCode) && (model.environmentCode = options.value[0].value)
|
||||
isCreate &&
|
||||
!model.environmentCode &&
|
||||
(model.environmentCode = options.value[0].value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +85,7 @@ export function useEnvironmentName(
|
|||
name: t('project.node.environment_name'),
|
||||
props: {
|
||||
loading: loading,
|
||||
clearable: true,
|
||||
clearable: true
|
||||
},
|
||||
options: options
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ export function useFlink(model: { [field: string]: any }): IJsonItem[] {
|
|||
)
|
||||
|
||||
watchEffect(() => {
|
||||
model.flinkVersion = model.programType === 'SQL' ? '>=1.13' : model.flinkVersion
|
||||
model.flinkVersion =
|
||||
model.programType === 'SQL' ? '>=1.13' : model.flinkVersion
|
||||
})
|
||||
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -14,16 +14,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useCustomParams, useResources } from '.'
|
||||
import type { IJsonItem } from '../types'
|
||||
|
||||
export function useHiveCli(model: { [field: string]: any }): IJsonItem[] {
|
||||
const { t } = useI18n()
|
||||
const hiveSqlScriptSpan = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? 24 : 0))
|
||||
const resourcesRequired = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? false : true))
|
||||
const resourcesLimit = computed(() => (model.hiveCliTaskExecutionType === 'SCRIPT' ? -1 : 1))
|
||||
const hiveSqlScriptSpan = computed(() =>
|
||||
model.hiveCliTaskExecutionType === 'SCRIPT' ? 24 : 0
|
||||
)
|
||||
const resourcesRequired = computed(() =>
|
||||
model.hiveCliTaskExecutionType === 'SCRIPT' ? false : true
|
||||
)
|
||||
const resourcesLimit = computed(() =>
|
||||
model.hiveCliTaskExecutionType === 'SCRIPT' ? -1 : 1
|
||||
)
|
||||
|
||||
return [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export function useLinkis(model: { [field: string]: any }): IJsonItem[] {
|
|||
|
||||
const configEditorSpan = computed(() => (model.useCustom ? 24 : 0))
|
||||
const parmaEditorSpan = computed(() => (model.useCustom ? 0 : 24))
|
||||
computed(() => (model.useCustom ? 0 : 24));
|
||||
computed(() => (model.useCustom ? 0 : 24))
|
||||
return [
|
||||
{
|
||||
type: 'switch',
|
||||
|
|
@ -54,7 +54,7 @@ export function useLinkis(model: { [field: string]: any }): IJsonItem[] {
|
|||
}
|
||||
|
||||
const sameItems = model.localParams.filter(
|
||||
(item: { prop: string }) => item.prop === value
|
||||
(item: { prop: string }) => item.prop === value
|
||||
)
|
||||
|
||||
if (sameItems.length > 1) {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ export function useNamespace(): IJsonItem {
|
|||
props: {
|
||||
loading,
|
||||
'render-label': renderLabel,
|
||||
'clearable': true
|
||||
clearable: true
|
||||
},
|
||||
options: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export function useResources(
|
|||
}
|
||||
if (resourcesLoading.value) return
|
||||
resourcesLoading.value = true
|
||||
const res = await queryResourceList({ type: 'FILE', fullName:"" })
|
||||
const res = await queryResourceList({ type: 'FILE', fullName: '' })
|
||||
utils.removeUselessChildren(res)
|
||||
resourcesOptions.value = res || []
|
||||
resourcesLoading.value = false
|
||||
|
|
|
|||
|
|
@ -24,19 +24,35 @@ export function useSeaTunnel(model: { [field: string]: any }): IJsonItem[] {
|
|||
|
||||
const configEditorSpan = computed(() => (model.useCustom ? 24 : 0))
|
||||
const resourceEditorSpan = computed(() => (model.useCustom ? 0 : 24))
|
||||
const flinkSpan = computed(() => (model.startupScript.includes("flink") ? 24 : 0))
|
||||
const deployModeSpan = computed(() => (model.startupScript.includes("spark") || model.startupScript === "seatunnel.sh" ? 24 : 0))
|
||||
const masterSpan = computed(() => (model.startupScript.includes("spark")) && model.deployMode !== 'local' ? 12 : 0)
|
||||
const flinkSpan = computed(() =>
|
||||
model.startupScript.includes('flink') ? 24 : 0
|
||||
)
|
||||
const deployModeSpan = computed(() =>
|
||||
model.startupScript.includes('spark') ||
|
||||
model.startupScript === 'seatunnel.sh'
|
||||
? 24
|
||||
: 0
|
||||
)
|
||||
const masterSpan = computed(() =>
|
||||
model.startupScript.includes('spark') && model.deployMode !== 'local'
|
||||
? 12
|
||||
: 0
|
||||
)
|
||||
const masterUrlSpan = computed(() =>
|
||||
(model.startupScript.includes("spark")) &&
|
||||
model.startupScript.includes('spark') &&
|
||||
model.deployMode !== 'local' &&
|
||||
(model.master === 'SPARK' || model.master === 'MESOS')
|
||||
? 12
|
||||
: 0
|
||||
)
|
||||
const showClient = computed(() => model.startupScript.includes("spark"))
|
||||
const showClient = computed(() => model.startupScript.includes('spark'))
|
||||
const showLocal = computed(() => model.startupScript === 'seatunnel.sh')
|
||||
const othersSpan = computed(() => (model.startupScript.includes("flink") || model.startupScript === 'seatunnel.sh' ? 24 : 0))
|
||||
const othersSpan = computed(() =>
|
||||
model.startupScript.includes('flink') ||
|
||||
model.startupScript === 'seatunnel.sh'
|
||||
? 24
|
||||
: 0
|
||||
)
|
||||
|
||||
return [
|
||||
{
|
||||
|
|
@ -56,12 +72,12 @@ export function useSeaTunnel(model: { [field: string]: any }): IJsonItem[] {
|
|||
if (model.startupScript === 'seatunnel.sh') {
|
||||
model.deployMode = 'local'
|
||||
}
|
||||
if (model.startupScript.includes("spark")) {
|
||||
if (model.startupScript.includes('spark')) {
|
||||
model.deployMode = 'client'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
// SeaTunnel flink parameter
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ export function useZeppelin(model: { [field: string]: any }): IJsonItem[] {
|
|||
field: 'password',
|
||||
name: t('project.node.zeppelin_password'),
|
||||
props: {
|
||||
placeholder: t('project.node.zeppelin_password_tips')
|
||||
placeholder: t('project.node.zeppelin_password_tips')
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -218,16 +218,16 @@ export function formatParams(data: INodeData): {
|
|||
taskParams.startupScript = data.startupScript
|
||||
taskParams.useCustom = data.useCustom
|
||||
taskParams.rawScript = data.rawScript
|
||||
if (data.startupScript?.includes("flink")) {
|
||||
if (data.startupScript?.includes('flink')) {
|
||||
taskParams.runMode = data.runMode
|
||||
taskParams.others = data.others
|
||||
}
|
||||
if (data.startupScript?.includes("spark")) {
|
||||
if (data.startupScript?.includes('spark')) {
|
||||
taskParams.deployMode = data.deployMode
|
||||
taskParams.master = data.master
|
||||
taskParams.masterUrl = data.masterUrl
|
||||
}
|
||||
if (data.startupScript === "seatunnel.sh") {
|
||||
if (data.startupScript === 'seatunnel.sh') {
|
||||
taskParams.deployMode = data.deployMode
|
||||
taskParams.others = data.others
|
||||
}
|
||||
|
|
@ -502,7 +502,7 @@ export function formatParams(data: INodeData): {
|
|||
: '0',
|
||||
failRetryTimes: data.failRetryTimes ? String(data.failRetryTimes) : '0',
|
||||
flag: data.flag,
|
||||
isCache: data.isCache ? "YES" : "NO",
|
||||
isCache: data.isCache ? 'YES' : 'NO',
|
||||
name: data.name,
|
||||
taskGroupId: data.taskGroupId,
|
||||
taskGroupPriority: data.taskGroupPriority,
|
||||
|
|
@ -514,7 +514,9 @@ export function formatParams(data: INodeData): {
|
|||
initScript: data.initScript,
|
||||
rawScript: data.rawScript,
|
||||
resourceList: data.resourceList?.length
|
||||
? data.resourceList.map((fullName: string) => ({ resourceName: `${fullName}` }))
|
||||
? data.resourceList.map((fullName: string) => ({
|
||||
resourceName: `${fullName}`
|
||||
}))
|
||||
: [],
|
||||
...taskParams
|
||||
},
|
||||
|
|
@ -563,7 +565,7 @@ export function formatModel(data: ITaskData) {
|
|||
}
|
||||
if (data.taskParams?.resourceList) {
|
||||
params.resourceList = data.taskParams.resourceList.map(
|
||||
(item: { resourceName: string }) => (`${item.resourceName}`)
|
||||
(item: { resourceName: string }) => `${item.resourceName}`
|
||||
)
|
||||
}
|
||||
if (data.taskParams?.mainJar) {
|
||||
|
|
|
|||
|
|
@ -20,64 +20,64 @@ import * as Fields from '../fields/index'
|
|||
import type { IJsonItem, INodeData, ITaskData } from '../types'
|
||||
|
||||
export function useDatasync({
|
||||
projectCode,
|
||||
from = 0,
|
||||
readonly,
|
||||
data
|
||||
projectCode,
|
||||
from = 0,
|
||||
readonly,
|
||||
data
|
||||
}: {
|
||||
projectCode: number
|
||||
from?: number
|
||||
readonly?: boolean
|
||||
data?: ITaskData
|
||||
projectCode: number
|
||||
from?: number
|
||||
readonly?: boolean
|
||||
data?: ITaskData
|
||||
}) {
|
||||
const model = reactive({
|
||||
name: '',
|
||||
taskType: 'DATASYNC',
|
||||
flag: 'YES',
|
||||
description: '',
|
||||
timeoutFlag: false,
|
||||
localParams: [],
|
||||
environmentCode: null,
|
||||
failRetryInterval: 1,
|
||||
failRetryTimes: 0,
|
||||
workerGroup: 'default',
|
||||
delayTime: 0,
|
||||
timeout: 30,
|
||||
timeoutNotifyStrategy: ['WARN'],
|
||||
const model = reactive({
|
||||
name: '',
|
||||
taskType: 'DATASYNC',
|
||||
flag: 'YES',
|
||||
description: '',
|
||||
timeoutFlag: false,
|
||||
localParams: [],
|
||||
environmentCode: null,
|
||||
failRetryInterval: 1,
|
||||
failRetryTimes: 0,
|
||||
workerGroup: 'default',
|
||||
delayTime: 0,
|
||||
timeout: 30,
|
||||
timeoutNotifyStrategy: ['WARN']
|
||||
} as INodeData)
|
||||
|
||||
let extra: IJsonItem[] = []
|
||||
if (from === 1) {
|
||||
extra = [
|
||||
Fields.useTaskType(model, readonly),
|
||||
Fields.useProcessName({
|
||||
model,
|
||||
projectCode,
|
||||
isCreate: !data?.id,
|
||||
from,
|
||||
processName: data?.processName
|
||||
})
|
||||
]
|
||||
}
|
||||
let extra: IJsonItem[] = []
|
||||
if (from === 1) {
|
||||
extra = [
|
||||
Fields.useTaskType(model, readonly),
|
||||
Fields.useProcessName({
|
||||
model,
|
||||
projectCode,
|
||||
isCreate: !data?.id,
|
||||
from,
|
||||
processName: data?.processName
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
return {
|
||||
json: [
|
||||
Fields.useName(from),
|
||||
...extra,
|
||||
Fields.useRunFlag(),
|
||||
Fields.useCache(),
|
||||
Fields.useDescription(),
|
||||
Fields.useTaskPriority(),
|
||||
Fields.useWorkerGroup(),
|
||||
Fields.useEnvironmentName(model, !model.id),
|
||||
...Fields.useTaskGroup(model, projectCode),
|
||||
...Fields.useFailed(),
|
||||
...Fields.useResourceLimit(),
|
||||
Fields.useDelayTime(model),
|
||||
...Fields.useTimeoutAlarm(model),
|
||||
...Fields.useDatasync(model),
|
||||
Fields.usePreTasks()
|
||||
] as IJsonItem[],
|
||||
model
|
||||
}
|
||||
return {
|
||||
json: [
|
||||
Fields.useName(from),
|
||||
...extra,
|
||||
Fields.useRunFlag(),
|
||||
Fields.useCache(),
|
||||
Fields.useDescription(),
|
||||
Fields.useTaskPriority(),
|
||||
Fields.useWorkerGroup(),
|
||||
Fields.useEnvironmentName(model, !model.id),
|
||||
...Fields.useTaskGroup(model, projectCode),
|
||||
...Fields.useFailed(),
|
||||
...Fields.useResourceLimit(),
|
||||
Fields.useDelayTime(model),
|
||||
...Fields.useTimeoutAlarm(model),
|
||||
...Fields.useDatasync(model),
|
||||
Fields.usePreTasks()
|
||||
] as IJsonItem[],
|
||||
model
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export function useDms({
|
|||
delayTime: 0,
|
||||
timeout: 30,
|
||||
timeoutNotifyStrategy: ['WARN'],
|
||||
isRestartTask: false,
|
||||
isRestartTask: false
|
||||
} as INodeData)
|
||||
|
||||
let extra: IJsonItem[] = []
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ export function useLinkis({
|
|||
{
|
||||
prop: '',
|
||||
value: ''
|
||||
},
|
||||
}
|
||||
],
|
||||
rawScript: ''
|
||||
} as INodeData)
|
||||
|
|
|
|||
|
|
@ -56,29 +56,29 @@ export function useSeaTunnel({
|
|||
timeoutNotifyStrategy: ['WARN'],
|
||||
rawScript:
|
||||
'env {\n' +
|
||||
' execution.parallelism = 2\n' +
|
||||
' job.mode = "BATCH"\n' +
|
||||
' checkpoint.interval = 10000\n' +
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'source {\n' +
|
||||
' FakeSource {\n' +
|
||||
' parallelism = 2\n' +
|
||||
' result_table_name = "fake"\n' +
|
||||
' row.num = 16\n' +
|
||||
' schema = {\n' +
|
||||
' fields {\n' +
|
||||
' name = "string"\n' +
|
||||
' age = "int"\n' +
|
||||
' }\n' +
|
||||
' }\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'sink {\n' +
|
||||
' Console {\n' +
|
||||
' }\n' +
|
||||
'}'
|
||||
' execution.parallelism = 2\n' +
|
||||
' job.mode = "BATCH"\n' +
|
||||
' checkpoint.interval = 10000\n' +
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'source {\n' +
|
||||
' FakeSource {\n' +
|
||||
' parallelism = 2\n' +
|
||||
' result_table_name = "fake"\n' +
|
||||
' row.num = 16\n' +
|
||||
' schema = {\n' +
|
||||
' fields {\n' +
|
||||
' name = "string"\n' +
|
||||
' age = "int"\n' +
|
||||
' }\n' +
|
||||
' }\n' +
|
||||
' }\n' +
|
||||
'}\n' +
|
||||
'\n' +
|
||||
'sink {\n' +
|
||||
' Console {\n' +
|
||||
' }\n' +
|
||||
'}'
|
||||
} as INodeData)
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ interface IDependentParameters {
|
|||
* res: resource file name
|
||||
*/
|
||||
interface ISourceItem {
|
||||
id?: number,
|
||||
resourceName: string,
|
||||
id?: number
|
||||
resourceName: string
|
||||
res?: string
|
||||
}
|
||||
|
||||
|
|
@ -495,7 +495,7 @@ interface ITaskData
|
|||
> {
|
||||
name?: string
|
||||
taskPriority?: string
|
||||
isCache?: "YES" | "NO"
|
||||
isCache?: 'YES' | 'NO'
|
||||
timeoutFlag?: 'OPEN' | 'CLOSE'
|
||||
timeoutNotifyStrategy?: string | []
|
||||
taskParams?: ITaskParams
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@ export function useTable(onEdit: Function) {
|
|||
},
|
||||
{
|
||||
default: () =>
|
||||
h(
|
||||
NEllipsis,
|
||||
{
|
||||
style: 'max-width: 580px;line-height: 1.5'
|
||||
},
|
||||
() => row.taskName
|
||||
)
|
||||
h(
|
||||
NEllipsis,
|
||||
{
|
||||
style: 'max-width: 580px;line-height: 1.5'
|
||||
},
|
||||
() => row.taskName
|
||||
)
|
||||
}
|
||||
)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ const BatchTaskInstance = defineComponent({
|
|||
variables.showModalRef = false
|
||||
}
|
||||
|
||||
var getLogsID: number
|
||||
let getLogsID: number
|
||||
|
||||
const getLogs = (row: any, logTimer: number) => {
|
||||
const { state } = useAsyncState(
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import { NTabPane, NTabs } from 'naive-ui'
|
|||
import BatchTaskInstance from './batch-task'
|
||||
import StreamTaskInstance from './stream-task'
|
||||
|
||||
|
||||
const TaskDefinition = defineComponent({
|
||||
name: 'task-instance',
|
||||
setup() {
|
||||
|
|
@ -39,4 +38,4 @@ const TaskDefinition = defineComponent({
|
|||
}
|
||||
})
|
||||
|
||||
export default TaskDefinition
|
||||
export default TaskDefinition
|
||||
|
|
|
|||
|
|
@ -23,14 +23,7 @@ import {
|
|||
forceSuccess,
|
||||
downloadLog
|
||||
} from '@/service/modules/task-instances'
|
||||
import {
|
||||
NButton,
|
||||
NIcon,
|
||||
NSpace,
|
||||
NTooltip,
|
||||
NSpin,
|
||||
NEllipsis
|
||||
} from 'naive-ui'
|
||||
import { NButton, NIcon, NSpace, NTooltip, NSpin, NEllipsis } from 'naive-ui'
|
||||
import ButtonLink from '@/components/button-link'
|
||||
import {
|
||||
AlignLeftOutlined,
|
||||
|
|
@ -39,19 +32,14 @@ import {
|
|||
} from '@vicons/antd'
|
||||
import { format } from 'date-fns'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import {
|
||||
parseTime,
|
||||
renderTableTime,
|
||||
tasksState
|
||||
} from '@/common/common'
|
||||
import { parseTime, renderTableTime, tasksState } from '@/common/common'
|
||||
import {
|
||||
COLUMN_WIDTH_CONFIG,
|
||||
calculateTableWidth,
|
||||
DefaultTableWidth
|
||||
} from '@/common/column-width-config'
|
||||
import type { Router, TaskInstancesRes, IRecord, ITaskState } from './types'
|
||||
import {renderEnvironmentalDistinctionCell} from "@/utils/environmental-distinction";
|
||||
|
||||
import { renderEnvironmentalDistinctionCell } from '@/utils/environmental-distinction'
|
||||
|
||||
export function useTable() {
|
||||
const { t } = useI18n()
|
||||
|
|
@ -98,7 +86,7 @@ export function useTable() {
|
|||
...COLUMN_WIDTH_CONFIG['name'],
|
||||
resizable: true,
|
||||
minWidth: 200,
|
||||
maxWidth: 600,
|
||||
maxWidth: 600
|
||||
},
|
||||
{
|
||||
title: t('project.task.workflow_instance'),
|
||||
|
|
@ -115,7 +103,7 @@ export function useTable() {
|
|||
ButtonLink,
|
||||
{
|
||||
onClick: () => {
|
||||
let routeUrl = router.resolve({
|
||||
const routeUrl = router.resolve({
|
||||
name: 'workflow-instance-detail',
|
||||
params: { id: row.processInstanceId },
|
||||
query: { code: projectCode }
|
||||
|
|
@ -127,9 +115,9 @@ export function useTable() {
|
|||
default: () =>
|
||||
h(
|
||||
NEllipsis,
|
||||
{
|
||||
style: 'max-width: 580px;line-height: 1.5'
|
||||
},
|
||||
{
|
||||
style: 'max-width: 580px;line-height: 1.5'
|
||||
},
|
||||
() => row.processInstanceName
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ export const EDGE = {
|
|||
router: {
|
||||
name: 'er',
|
||||
args: {
|
||||
offset: 12,
|
||||
offset: 12
|
||||
}
|
||||
},
|
||||
defaultLabel: {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,16 @@ const props = {
|
|||
export default defineComponent({
|
||||
name: 'dag-context-menu',
|
||||
props,
|
||||
emits: ['hide', 'start', 'edit', 'viewLog', 'copyTask', 'removeTasks', 'executeTask', 'removeTaskInstanceCache'],
|
||||
emits: [
|
||||
'hide',
|
||||
'start',
|
||||
'edit',
|
||||
'viewLog',
|
||||
'copyTask',
|
||||
'removeTasks',
|
||||
'executeTask',
|
||||
'removeTaskInstanceCache'
|
||||
],
|
||||
setup(props, ctx) {
|
||||
const graph = inject('graph', ref())
|
||||
const route = useRoute()
|
||||
|
|
@ -188,42 +197,42 @@ export default defineComponent({
|
|||
</>
|
||||
)}
|
||||
{this.taskInstance && (
|
||||
<>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleViewLog}
|
||||
>
|
||||
{t('project.node.view_log')}
|
||||
</NButton>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleRemoveTaskInstanceCache}
|
||||
>
|
||||
{t('project.task.remove_task_cache')}
|
||||
</NButton>
|
||||
</>
|
||||
<>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleViewLog}
|
||||
>
|
||||
{t('project.node.view_log')}
|
||||
</NButton>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleRemoveTaskInstanceCache}
|
||||
>
|
||||
{t('project.task.remove_task_cache')}
|
||||
</NButton>
|
||||
</>
|
||||
)}
|
||||
{this.executeTaskDisplay && (
|
||||
<>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleExecuteTaskOnly}
|
||||
>
|
||||
{t('project.workflow.current_node_execution_task')}
|
||||
</NButton>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleExecuteTaskPOST}
|
||||
>
|
||||
{t('project.workflow.backward_execution_task')}
|
||||
</NButton>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleExecuteTaskPRE}
|
||||
>
|
||||
{t('project.workflow.forward_execution_task')}
|
||||
</NButton>
|
||||
</>
|
||||
<>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleExecuteTaskOnly}
|
||||
>
|
||||
{t('project.workflow.current_node_execution_task')}
|
||||
</NButton>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleExecuteTaskPOST}
|
||||
>
|
||||
{t('project.workflow.backward_execution_task')}
|
||||
</NButton>
|
||||
<NButton
|
||||
class={`${styles['menu-item']}`}
|
||||
onClick={this.handleExecuteTaskPRE}
|
||||
>
|
||||
{t('project.workflow.forward_execution_task')}
|
||||
</NButton>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ export default defineComponent({
|
|||
handleDagMenu()
|
||||
})
|
||||
|
||||
return () =>
|
||||
return () => (
|
||||
<div class={styles.sidebar}>
|
||||
<NCollapse default-expanded-names='1' accordion>
|
||||
{variables.fav.length > 0 && (
|
||||
|
|
@ -139,11 +139,7 @@ export default defineComponent({
|
|||
: '#ccc'
|
||||
}
|
||||
>
|
||||
{task.collection ? (
|
||||
<StarFilled />
|
||||
) : (
|
||||
<StarOutlined />
|
||||
)}
|
||||
{task.collection ? <StarFilled /> : <StarOutlined />}
|
||||
</NIcon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -192,11 +188,7 @@ export default defineComponent({
|
|||
: '#ccc'
|
||||
}
|
||||
>
|
||||
{task.collection ? (
|
||||
<StarFilled />
|
||||
) : (
|
||||
<StarOutlined />
|
||||
)}
|
||||
{task.collection ? <StarFilled /> : <StarOutlined />}
|
||||
</NIcon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -245,11 +237,7 @@ export default defineComponent({
|
|||
: '#ccc'
|
||||
}
|
||||
>
|
||||
{task.collection ? (
|
||||
<StarFilled />
|
||||
) : (
|
||||
<StarOutlined />
|
||||
)}
|
||||
{task.collection ? <StarFilled /> : <StarOutlined />}
|
||||
</NIcon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -298,11 +286,7 @@ export default defineComponent({
|
|||
: '#ccc'
|
||||
}
|
||||
>
|
||||
{task.collection ? (
|
||||
<StarFilled />
|
||||
) : (
|
||||
<StarOutlined />
|
||||
)}
|
||||
{task.collection ? <StarFilled /> : <StarOutlined />}
|
||||
</NIcon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -351,11 +335,7 @@ export default defineComponent({
|
|||
: '#ccc'
|
||||
}
|
||||
>
|
||||
{task.collection ? (
|
||||
<StarFilled />
|
||||
) : (
|
||||
<StarOutlined />
|
||||
)}
|
||||
{task.collection ? <StarFilled /> : <StarOutlined />}
|
||||
</NIcon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -404,11 +384,7 @@ export default defineComponent({
|
|||
: '#ccc'
|
||||
}
|
||||
>
|
||||
{task.collection ? (
|
||||
<StarFilled />
|
||||
) : (
|
||||
<StarOutlined />
|
||||
)}
|
||||
{task.collection ? <StarFilled /> : <StarOutlined />}
|
||||
</NIcon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -457,11 +433,7 @@ export default defineComponent({
|
|||
: '#ccc'
|
||||
}
|
||||
>
|
||||
{task.collection ? (
|
||||
<StarFilled />
|
||||
) : (
|
||||
<StarOutlined />
|
||||
)}
|
||||
{task.collection ? <StarFilled /> : <StarOutlined />}
|
||||
</NIcon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -510,11 +482,7 @@ export default defineComponent({
|
|||
: '#ccc'
|
||||
}
|
||||
>
|
||||
{task.collection ? (
|
||||
<StarFilled />
|
||||
) : (
|
||||
<StarOutlined />
|
||||
)}
|
||||
{task.collection ? <StarFilled /> : <StarOutlined />}
|
||||
</NIcon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -525,5 +493,6 @@ export default defineComponent({
|
|||
)}
|
||||
</NCollapse>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -217,37 +217,33 @@ export default defineComponent({
|
|||
)}
|
||||
{props.definition?.processDefinition?.name && (
|
||||
<NTooltip
|
||||
v-slots={{
|
||||
trigger: () => (
|
||||
<NPopover
|
||||
placement='bottom'
|
||||
trigger='click'
|
||||
scrollable
|
||||
style={{ maxWidth: '50vw', maxHeight: '70vh' }}
|
||||
>
|
||||
{{
|
||||
trigger: () => (
|
||||
<NButton
|
||||
quaternary
|
||||
circle
|
||||
class={Styles['toolbar-btn']}
|
||||
>
|
||||
<NIcon>
|
||||
<FundViewOutlined />
|
||||
</NIcon>
|
||||
</NButton>
|
||||
),
|
||||
header: () => (
|
||||
<NText strong depth={1}>
|
||||
{t('project.workflow.parameters_variables')}
|
||||
</NText>
|
||||
),
|
||||
default: () => <VariablesView onCopy={copy} />
|
||||
}}
|
||||
</NPopover>
|
||||
),
|
||||
default: () => t('project.dag.view_variables')
|
||||
}}
|
||||
v-slots={{
|
||||
trigger: () => (
|
||||
<NPopover
|
||||
placement='bottom'
|
||||
trigger='click'
|
||||
scrollable
|
||||
style={{ maxWidth: '50vw', maxHeight: '70vh' }}
|
||||
>
|
||||
{{
|
||||
trigger: () => (
|
||||
<NButton quaternary circle class={Styles['toolbar-btn']}>
|
||||
<NIcon>
|
||||
<FundViewOutlined />
|
||||
</NIcon>
|
||||
</NButton>
|
||||
),
|
||||
header: () => (
|
||||
<NText strong depth={1}>
|
||||
{t('project.workflow.parameters_variables')}
|
||||
</NText>
|
||||
),
|
||||
default: () => <VariablesView onCopy={copy} />
|
||||
}}
|
||||
</NPopover>
|
||||
),
|
||||
default: () => t('project.dag.view_variables')
|
||||
}}
|
||||
></NTooltip>
|
||||
)}
|
||||
<div class={Styles['toolbar-left-part']}>
|
||||
|
|
|
|||
|
|
@ -139,9 +139,7 @@ export default defineComponent({
|
|||
|
||||
// execute task buttons in the dag node menu
|
||||
const executeTaskDisplay = computed(() => {
|
||||
return (
|
||||
route.name === 'workflow-instance-detail'
|
||||
)
|
||||
return route.name === 'workflow-instance-detail'
|
||||
})
|
||||
|
||||
// other button in the dag node menu
|
||||
|
|
@ -250,7 +248,7 @@ export default defineComponent({
|
|||
getLogs(logTimer)
|
||||
}
|
||||
|
||||
var getLogsID: number
|
||||
let getLogsID: number
|
||||
|
||||
const getLogs = (logTimer: number) => {
|
||||
const { state } = useAsyncState(
|
||||
|
|
@ -259,7 +257,6 @@ export default defineComponent({
|
|||
limit: nodeVariables.limit,
|
||||
skipLineNum: nodeVariables.skipLineNum
|
||||
}).then((res: any) => {
|
||||
|
||||
nodeVariables.logRef += res.message || ''
|
||||
if (res && res.message !== '') {
|
||||
nodeVariables.limit += 1000
|
||||
|
|
@ -292,18 +289,23 @@ export default defineComponent({
|
|||
getLogs(logTimer)
|
||||
}
|
||||
|
||||
const handleExecuteTask = (startNodeList: number, taskDependType: string) => {
|
||||
executeTask({
|
||||
processInstanceId: Number(route.params.id),
|
||||
startNodeList: startNodeList,
|
||||
taskDependType: taskDependType,
|
||||
},
|
||||
props.projectCode).then(() => {
|
||||
window.$message.success(t('project.workflow.success'))
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
})
|
||||
const handleExecuteTask = (
|
||||
startNodeList: number,
|
||||
taskDependType: string
|
||||
) => {
|
||||
executeTask(
|
||||
{
|
||||
processInstanceId: Number(route.params.id),
|
||||
startNodeList: startNodeList,
|
||||
taskDependType: taskDependType
|
||||
},
|
||||
props.projectCode
|
||||
).then(() => {
|
||||
window.$message.success(t('project.workflow.success'))
|
||||
setTimeout(() => {
|
||||
window.location.reload()
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
|
||||
const handleRemoveTaskInstanceCache = (taskId: number) => {
|
||||
|
|
@ -450,4 +452,3 @@ export default defineComponent({
|
|||
)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -108,10 +108,10 @@ export function useCanvasInit(options: Options) {
|
|||
const { sourceCell, targetCell } = data
|
||||
|
||||
if (
|
||||
sourceCell &&
|
||||
targetCell &&
|
||||
sourceCell.isNode() &&
|
||||
targetCell.isNode()
|
||||
sourceCell &&
|
||||
targetCell &&
|
||||
sourceCell.isNode() &&
|
||||
targetCell.isNode()
|
||||
) {
|
||||
const sourceData = sourceCell.getData()
|
||||
if (!sourceData) return true
|
||||
|
|
@ -135,10 +135,10 @@ export function useCanvasInit(options: Options) {
|
|||
edge?.setAttrs({
|
||||
line: {
|
||||
strokeDasharray:
|
||||
sourceData.taskExecuteType === 'STREAM' ||
|
||||
targetData.taskExecuteType === 'STREAM'
|
||||
? '5 5'
|
||||
: 'none'
|
||||
sourceData.taskExecuteType === 'STREAM' ||
|
||||
targetData.taskExecuteType === 'STREAM'
|
||||
? '5 5'
|
||||
: 'none'
|
||||
}
|
||||
})
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ const DagCanvas = defineComponent({
|
|||
})
|
||||
|
||||
watch(dagTasks, () => {
|
||||
useAddDagShape((graph.value as Graph))
|
||||
useAddDagShape(graph.value as Graph)
|
||||
})
|
||||
|
||||
return {
|
||||
|
|
@ -74,19 +74,22 @@ const DagCanvas = defineComponent({
|
|||
}
|
||||
},
|
||||
render() {
|
||||
return(
|
||||
return (
|
||||
<>
|
||||
<div ref='container' class={styles.container}
|
||||
onDrop={this.handleDrop}
|
||||
onDragenter={this.handlePreventDefault}
|
||||
onDragover={this.handlePreventDefault}
|
||||
onDragleave={this.handlePreventDefault}>
|
||||
<div ref='dag-container' class={styles['dag-container']}/>
|
||||
<div
|
||||
ref='container'
|
||||
class={styles.container}
|
||||
onDrop={this.handleDrop}
|
||||
onDragenter={this.handlePreventDefault}
|
||||
onDragover={this.handlePreventDefault}
|
||||
onDragleave={this.handlePreventDefault}
|
||||
>
|
||||
<div ref='dag-container' class={styles['dag-container']} />
|
||||
</div>
|
||||
<div ref='minimapContainer' class={styles.minimap}/>
|
||||
<div ref='minimapContainer' class={styles.minimap} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
export { DagCanvas }
|
||||
export { DagCanvas }
|
||||
|
|
|
|||
|
|
@ -41,18 +41,20 @@ const DagSidebar = defineComponent({
|
|||
render() {
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
this.taskList.map((task: any) => {
|
||||
return (
|
||||
<div class={styles['task-item']} draggable='true' onDragstart={() => this.handleDragstart(task)}>
|
||||
{task.name}
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
{this.taskList.map((task: any) => {
|
||||
return (
|
||||
<div
|
||||
class={styles['task-item']}
|
||||
draggable='true'
|
||||
onDragstart={() => this.handleDragstart(task)}
|
||||
>
|
||||
{task.name}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
export { DagSidebar }
|
||||
export { DagSidebar }
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const DynamicDag = defineComponent({
|
|||
}
|
||||
|
||||
const handelDrop = (e: DragEvent) => {
|
||||
if (!draggedTask) return
|
||||
if (!draggedTask.value) return
|
||||
|
||||
const shapes = useDagStore().getDagTasks
|
||||
|
||||
|
|
@ -73,21 +73,21 @@ const DynamicDag = defineComponent({
|
|||
return (
|
||||
<>
|
||||
<div class={styles['workflow-dag']}>
|
||||
<DagSidebar onDragstart={this.handelDragstart}/>
|
||||
<DagCanvas onDrop={this.handelDrop}/>
|
||||
<DagSidebar onDragstart={this.handelDragstart} />
|
||||
<DagCanvas onDrop={this.handelDrop} />
|
||||
</div>
|
||||
{
|
||||
this.draggedTask && this.formData && <TaskForm
|
||||
{this.draggedTask && this.formData && (
|
||||
<TaskForm
|
||||
task={this.draggedTask}
|
||||
formData={this.formData}
|
||||
showModal={this.showModal}
|
||||
onCancelModal={() => this.showModal = false}
|
||||
onConfirmModal={() => this.showModal = false}
|
||||
onCancelModal={() => (this.showModal = false)}
|
||||
onConfirmModal={() => (this.showModal = false)}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
export { DynamicDag }
|
||||
export { DynamicDag }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { defineComponent, getCurrentInstance, PropType, toRefs, watch } from 'vue'
|
||||
import {
|
||||
defineComponent,
|
||||
getCurrentInstance,
|
||||
PropType,
|
||||
toRefs,
|
||||
watch
|
||||
} from 'vue'
|
||||
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui'
|
||||
import { useTaskForm } from './use-task-form'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
|
@ -55,15 +61,19 @@ const TaskForm = defineComponent({
|
|||
}
|
||||
|
||||
const onUpdateValue = (v: any, f: any) => {
|
||||
f.modelField.indexOf('.') >= 0 ?
|
||||
(variables.model as any)[f.modelField.split('.')[0]][f.modelField.split('.')[1]] = v :
|
||||
(variables.model as any)[f.modelField] = v
|
||||
f.modelField.indexOf('.') >= 0
|
||||
? ((variables.model as any)[f.modelField.split('.')[0]][
|
||||
f.modelField.split('.')[1]
|
||||
] = v)
|
||||
: ((variables.model as any)[f.modelField] = v)
|
||||
}
|
||||
|
||||
const setDefaultValue = (f: any) => {
|
||||
return f.modelField.indexOf('.') >= 0 ?
|
||||
(variables.model as any)[f.modelField.split('.')[0]][f.modelField.split('.')[1]] :
|
||||
(variables.model as any)[f.modelField]
|
||||
return f.modelField.indexOf('.') >= 0
|
||||
? (variables.model as any)[f.modelField.split('.')[0]][
|
||||
f.modelField.split('.')[1]
|
||||
]
|
||||
: (variables.model as any)[f.modelField]
|
||||
}
|
||||
|
||||
watch(variables.model, () => {
|
||||
|
|
@ -86,56 +96,51 @@ const TaskForm = defineComponent({
|
|||
title={this.task}
|
||||
show={this.showModal}
|
||||
onCancel={this.cancelModal}
|
||||
onConfirm={this.confirmModal}>
|
||||
<NForm
|
||||
model={this.model}
|
||||
rules={this.rules}
|
||||
ref={'taskForm'}>
|
||||
{
|
||||
(this.formStructure as Array<any>).map(f => {
|
||||
return <NFormItem
|
||||
label={this.t(f.label)}
|
||||
path={f.field}
|
||||
>
|
||||
{
|
||||
f.type === 'input' && <NInput
|
||||
onConfirm={this.confirmModal}
|
||||
>
|
||||
<NForm model={this.model} rules={this.rules} ref={'taskForm'}>
|
||||
{(this.formStructure as Array<any>).map((f) => {
|
||||
return (
|
||||
<NFormItem label={this.t(f.label)} path={f.field}>
|
||||
{f.type === 'input' && (
|
||||
<NInput
|
||||
allowInput={this.trim}
|
||||
placeholder={f.placeholder ? this.t(f.placeholder) : ''}
|
||||
defaultValue={this.setDefaultValue(f)}
|
||||
onUpdateValue={(v) => this.onUpdateValue(v, f)}
|
||||
clearable={f.clearable}
|
||||
/>
|
||||
}
|
||||
{
|
||||
f.type === 'select' && <NSelect
|
||||
)}
|
||||
{f.type === 'select' && (
|
||||
<NSelect
|
||||
placeholder={f.placeholder ? this.t(f.placeholder) : ''}
|
||||
defaultValue={this.setDefaultValue(f)}
|
||||
onUpdateValue={(v) => this.onUpdateValue(v, f)}
|
||||
options={
|
||||
f.optionsLocale ?
|
||||
f.options.map((o: SelectOption) => {
|
||||
return {
|
||||
label: this.t(o.label as string),
|
||||
value: o.value
|
||||
}
|
||||
}) :
|
||||
f.options
|
||||
f.optionsLocale
|
||||
? f.options.map((o: SelectOption) => {
|
||||
return {
|
||||
label: this.t(o.label as string),
|
||||
value: o.value
|
||||
}
|
||||
})
|
||||
: f.options
|
||||
}
|
||||
/>
|
||||
}
|
||||
{
|
||||
f.type === 'studio' && <MonacoEditor
|
||||
)}
|
||||
{f.type === 'studio' && (
|
||||
<MonacoEditor
|
||||
defaultValue={this.setDefaultValue(f)}
|
||||
onUpdateValue={(v) => this.onUpdateValue(v, f)}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
</NFormItem>
|
||||
})
|
||||
}
|
||||
)
|
||||
})}
|
||||
</NForm>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
export { TaskForm }
|
||||
export { TaskForm }
|
||||
|
|
|
|||
|
|
@ -26,4 +26,4 @@ interface TaskDynamic {
|
|||
items: Array<any>
|
||||
}
|
||||
|
||||
export { DynamicLocales, TaskDynamic }
|
||||
export { DynamicLocales, TaskDynamic }
|
||||
|
|
|
|||
|
|
@ -21,4 +21,4 @@ import type { DynamicLocales } from './types'
|
|||
export function useDynamicLocales(locales: DynamicLocales): void {
|
||||
useI18n().mergeLocaleMessage('zh_CN', { task_components: locales.zh_CN })
|
||||
useI18n().mergeLocaleMessage('en_US', { task_components: locales.en_US })
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,12 +22,7 @@ export function useFormField(forms: Array<any>) {
|
|||
const model: any = {}
|
||||
|
||||
const setField = (value: string, type: string): Ref<null | string> => {
|
||||
return ref(value ?
|
||||
value :
|
||||
type === 'select' ?
|
||||
null :
|
||||
''
|
||||
)
|
||||
return ref(value ? value : type === 'select' ? null : '')
|
||||
}
|
||||
|
||||
forms.forEach((f: any) => {
|
||||
|
|
@ -42,4 +37,4 @@ export function useFormField(forms: Array<any>) {
|
|||
})
|
||||
|
||||
return model
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const reqFunction = (url: string, method: string) => {
|
|||
}
|
||||
|
||||
export function useFormRequest(apis: any, forms: Array<any>): Array<any> {
|
||||
forms.map(f => {
|
||||
forms.map((f) => {
|
||||
if (f.api) {
|
||||
reqFunction(apis[f.api].url, apis[f.api].method).then((res: any) => {
|
||||
f.options = res.map((r: any) => {
|
||||
|
|
@ -36,4 +36,4 @@ export function useFormRequest(apis: any, forms: Array<any>): Array<any> {
|
|||
})
|
||||
|
||||
return forms
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,4 +29,4 @@ export function useFormStructure(forms: Array<any>): Array<any> {
|
|||
|
||||
return f
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,4 @@ export function useFormValidate(forms: Array<any>, model: any) {
|
|||
})
|
||||
|
||||
return validate
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ export function useTaskForm(data: any) {
|
|||
useDynamicLocales(data.locales)
|
||||
variables.model = useFormField(data.forms)
|
||||
variables.rules = useFormValidate(data.forms, variables.model)
|
||||
variables.formStructure = useFormStructure(useFormRequest(data.apis, data.forms))
|
||||
variables.formStructure = useFormStructure(
|
||||
useFormRequest(data.apis, data.forms)
|
||||
)
|
||||
|
||||
const handleValidate = () => {
|
||||
variables.taskForm.validate((err: any) => {
|
||||
|
|
|
|||
|
|
@ -22,4 +22,4 @@ export function useAddDagShape(graph: Graph) {
|
|||
const cells: Array<Cell> = useDagStore().getDagTasks
|
||||
|
||||
;(graph as Graph).addNode(cells.at(-1) as any)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,4 +27,4 @@ export function useDagEdge() {
|
|||
name: 'orth'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,4 +32,4 @@ export function useDagGraph(container: any, minimapContainer: any) {
|
|||
container: minimapContainer
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,4 @@ export function useDagNode() {
|
|||
return {
|
||||
inherit: NodeShape
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,4 +29,4 @@ export function useDagResize(dagContainer: any, graph: Graph) {
|
|||
}, 200)
|
||||
|
||||
useResizeObserver(dagContainer, resize)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@
|
|||
*/
|
||||
|
||||
import { reactive } from 'vue'
|
||||
import { queryDynamicTaskCategories, queryDynamicTaskResourceList } from '@/service/modules/dynamic-dag'
|
||||
import {
|
||||
queryDynamicTaskCategories,
|
||||
queryDynamicTaskResourceList
|
||||
} from '@/service/modules/dynamic-dag'
|
||||
|
||||
export function useSidebar() {
|
||||
const variables = reactive({
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ export function useModal(
|
|||
}
|
||||
}
|
||||
|
||||
const handleStartDefinition = async (code: number,version: number) => {
|
||||
const handleStartDefinition = async (code: number, version: number) => {
|
||||
await state.startFormRef.validate()
|
||||
|
||||
if (state.saving) return
|
||||
|
|
|
|||
|
|
@ -88,9 +88,11 @@ export default defineComponent({
|
|||
theme.darkTheme ? Styles['dark'] : Styles['light']
|
||||
]}
|
||||
>
|
||||
{
|
||||
route.query.dynamic === 'true' ? <DynamicDag /> : <Dag projectCode={projectCode} onSave={onSave} />
|
||||
}
|
||||
{route.query.dynamic === 'true' ? (
|
||||
<DynamicDag />
|
||||
) : (
|
||||
<Dag projectCode={projectCode} onSave={onSave} />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import TimingModal from './components/timing-modal'
|
|||
import VersionModal from './components/version-modal'
|
||||
import CopyModal from './components/copy-modal'
|
||||
import type { Router } from 'vue-router'
|
||||
import Search from "@/components/input-search";
|
||||
import Search from '@/components/input-search'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'WorkflowDefinitionList',
|
||||
|
|
@ -158,15 +158,15 @@ export default defineComponent({
|
|||
>
|
||||
{t('project.workflow.create_workflow')}
|
||||
</NButton>
|
||||
{
|
||||
this.uiSettingStore.getDynamicTask && <NButton
|
||||
{this.uiSettingStore.getDynamicTask && (
|
||||
<NButton
|
||||
type='warning'
|
||||
size='small'
|
||||
onClick={this.createDefinitionDynamic}
|
||||
>
|
||||
{t('project.workflow.create_workflow_dynamic')}
|
||||
</NButton>
|
||||
}
|
||||
)}
|
||||
<NButton
|
||||
strong
|
||||
secondary
|
||||
|
|
@ -178,7 +178,7 @@ export default defineComponent({
|
|||
</NSpace>
|
||||
<NSpace>
|
||||
<Search
|
||||
placeholder = {t('resource.function.enter_keyword_tips')}
|
||||
placeholder={t('resource.function.enter_keyword_tips')}
|
||||
v-model:value={this.searchVal}
|
||||
onSearch={this.handleSearch}
|
||||
onClear={this.onClearSearch}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ export default defineComponent({
|
|||
getTableData({
|
||||
pageSize: variables.pageSize,
|
||||
pageNo: variables.page,
|
||||
searchVal: variables.searchVal
|
||||
searchVal: variables.searchVal,
|
||||
projectCode: variables.projectCode,
|
||||
processDefinitionCode: variables.processDefinitionCode
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue