Browse Source

support to use the clearable button of components to search (#12668)

3.2.0-release
calvin 2 years ago committed by GitHub
parent
commit
f889d855fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-ui/src/views/projects/list/index.tsx
  2. 21
      dolphinscheduler-ui/src/views/projects/task/definition/batch-task.tsx
  3. 42
      dolphinscheduler-ui/src/views/projects/task/instance/batch-task.tsx
  4. 42
      dolphinscheduler-ui/src/views/projects/task/instance/stream-task.tsx
  5. 12
      dolphinscheduler-ui/src/views/projects/workflow/definition/index.tsx
  6. 24
      dolphinscheduler-ui/src/views/projects/workflow/instance/components/process-instance-condition.tsx

10
dolphinscheduler-ui/src/views/projects/list/index.tsx

@ -60,6 +60,14 @@ const list = defineComponent({
requestData() requestData()
} }
const onClearSearch = () => {
variables.page = 1
getTableData({
pageSize: variables.pageSize,
pageNo: variables.page
})
}
const onCancelModal = () => { const onCancelModal = () => {
variables.showModalRef = false variables.showModalRef = false
} }
@ -93,6 +101,7 @@ const list = defineComponent({
handleSearch, handleSearch,
onCancelModal, onCancelModal,
onConfirmModal, onConfirmModal,
onClearSearch,
handleChangePageSize, handleChangePageSize,
trim trim
} }
@ -118,6 +127,7 @@ const list = defineComponent({
v-model={[this.searchVal, 'value']} v-model={[this.searchVal, 'value']}
placeholder={t('project.list.project_tips')} placeholder={t('project.list.project_tips')}
clearable clearable
onClear={this.onClearSearch}
/> />
<NButton size='small' type='primary' onClick={this.handleSearch}> <NButton size='small' type='primary' onClick={this.handleSearch}>
<NIcon> <NIcon>

21
dolphinscheduler-ui/src/views/projects/task/definition/batch-task.tsx

@ -75,6 +75,21 @@ const BatchTaskDefinition = defineComponent({
requestData() requestData()
} }
const onClearSearchTaskName = () => {
variables.searchTaskName = null
onSearch()
}
const onClearSearchWorkflowName = () => {
variables.searchWorkflowName = null
onSearch()
}
const onClearSearchTaskType = () => {
variables.taskType = null
onSearch()
}
const onRefresh = () => { const onRefresh = () => {
variables.showVersionModalRef = false variables.showVersionModalRef = false
variables.showMoveModalRef = false variables.showMoveModalRef = false
@ -110,6 +125,9 @@ const BatchTaskDefinition = defineComponent({
...toRefs(variables), ...toRefs(variables),
...toRefs(task), ...toRefs(task),
onSearch, onSearch,
onClearSearchTaskName,
onClearSearchWorkflowName,
onClearSearchTaskType,
requestData, requestData,
onUpdatePageSize, onUpdatePageSize,
onRefresh, onRefresh,
@ -145,6 +163,7 @@ const BatchTaskDefinition = defineComponent({
clearable clearable
v-model={[this.searchTaskName, 'value']} v-model={[this.searchTaskName, 'value']}
placeholder={t('project.task.task_name')} placeholder={t('project.task.task_name')}
onClear={this.onClearSearchTaskName}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
@ -152,6 +171,7 @@ const BatchTaskDefinition = defineComponent({
clearable clearable
v-model={[this.searchWorkflowName, 'value']} v-model={[this.searchWorkflowName, 'value']}
placeholder={t('project.task.workflow_name')} placeholder={t('project.task.workflow_name')}
onClear={this.onClearSearchWorkflowName}
/> />
<NSelect <NSelect
v-model={[this.taskType, 'value']} v-model={[this.taskType, 'value']}
@ -162,6 +182,7 @@ const BatchTaskDefinition = defineComponent({
placeholder={t('project.task.task_type')} placeholder={t('project.task.task_type')}
style={{ width: '180px' }} style={{ width: '180px' }}
clearable clearable
onClear={this.onClearSearchTaskType}
/> />
<NButton size='small' type='primary' onClick={onSearch}> <NButton size='small' type='primary' onClick={onSearch}>
<NIcon> <NIcon>

42
dolphinscheduler-ui/src/views/projects/task/instance/batch-task.tsx

@ -73,6 +73,36 @@ const BatchTaskInstance = defineComponent({
requestTableData() requestTableData()
} }
const onClearSearchTaskName = () => {
variables.searchVal = ''
onSearch()
}
const onClearSearchProcessInstanceName = () => {
variables.processInstanceName = null
onSearch()
}
const onClearSearchExecutorName = () => {
variables.executorName = null
onSearch()
}
const onClearSearchHost = () => {
variables.host = null
onSearch()
}
const onClearSearchStateType = () => {
variables.stateType = null
onSearch()
}
const onClearSearchTime = () => {
variables.datePickerRange = null
onSearch()
}
const onConfirmModal = () => { const onConfirmModal = () => {
variables.showModalRef = false variables.showModalRef = false
} }
@ -152,6 +182,12 @@ const BatchTaskInstance = defineComponent({
requestTableData, requestTableData,
onUpdatePageSize, onUpdatePageSize,
onSearch, onSearch,
onClearSearchTaskName,
onClearSearchProcessInstanceName,
onClearSearchExecutorName,
onClearSearchHost,
onClearSearchStateType,
onClearSearchTime,
onConfirmModal, onConfirmModal,
refreshLogs, refreshLogs,
trim trim
@ -178,6 +214,7 @@ const BatchTaskInstance = defineComponent({
size='small' size='small'
placeholder={t('project.task.task_name')} placeholder={t('project.task.task_name')}
clearable clearable
onClear={this.onClearSearchTaskName}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
@ -185,6 +222,7 @@ const BatchTaskInstance = defineComponent({
size='small' size='small'
placeholder={t('project.task.workflow_instance')} placeholder={t('project.task.workflow_instance')}
clearable clearable
onClear={this.onClearSearchProcessInstanceName}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
@ -192,6 +230,7 @@ const BatchTaskInstance = defineComponent({
size='small' size='small'
placeholder={t('project.task.executor')} placeholder={t('project.task.executor')}
clearable clearable
onClear={this.onClearSearchExecutorName}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
@ -199,6 +238,7 @@ const BatchTaskInstance = defineComponent({
size='small' size='small'
placeholder={t('project.task.host')} placeholder={t('project.task.host')}
clearable clearable
onClear={this.onClearSearchHost}
/> />
<NSelect <NSelect
v-model={[this.stateType, 'value']} v-model={[this.stateType, 'value']}
@ -207,6 +247,7 @@ const BatchTaskInstance = defineComponent({
placeholder={t('project.task.state')} placeholder={t('project.task.state')}
style={{ width: '180px' }} style={{ width: '180px' }}
clearable clearable
onClear={this.onClearSearchStateType}
/> />
<NDatePicker <NDatePicker
v-model={[this.datePickerRange, 'value']} v-model={[this.datePickerRange, 'value']}
@ -215,6 +256,7 @@ const BatchTaskInstance = defineComponent({
start-placeholder={t('project.task.start_time')} start-placeholder={t('project.task.start_time')}
end-placeholder={t('project.task.end_time')} end-placeholder={t('project.task.end_time')}
clearable clearable
onClear={this.onClearSearchTime}
/> />
<NButton size='small' type='primary' onClick={onSearch}> <NButton size='small' type='primary' onClick={onSearch}>
<NIcon> <NIcon>

42
dolphinscheduler-ui/src/views/projects/task/instance/stream-task.tsx

@ -61,6 +61,36 @@ const BatchTaskInstance = defineComponent({
getTableData() getTableData()
} }
const onClearSearchTaskName = () => {
variables.searchVal = null
onSearch()
}
const onClearSearchWorkFlowName = () => {
variables.processDefinitionName = null
onSearch()
}
const onClearSearchExecutorName = () => {
variables.executorName = null
onSearch()
}
const onClearSearchHost = () => {
variables.host = null
onSearch()
}
const onClearSearchStateType = () => {
variables.stateType = null
onSearch()
}
const onClearSearchTime = () => {
variables.datePickerRange = null
onSearch()
}
const onConfirmModal = () => { const onConfirmModal = () => {
variables.showModalRef = false variables.showModalRef = false
} }
@ -140,6 +170,12 @@ const BatchTaskInstance = defineComponent({
getTableData, getTableData,
onUpdatePageSize, onUpdatePageSize,
onSearch, onSearch,
onClearSearchTaskName,
onClearSearchWorkFlowName,
onClearSearchExecutorName,
onClearSearchHost,
onClearSearchStateType,
onClearSearchTime,
onConfirmModal, onConfirmModal,
refreshLogs, refreshLogs,
trim trim
@ -166,6 +202,7 @@ const BatchTaskInstance = defineComponent({
size='small' size='small'
placeholder={t('project.task.task_name')} placeholder={t('project.task.task_name')}
clearable clearable
onClear={this.onClearSearchTaskName}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
@ -173,6 +210,7 @@ const BatchTaskInstance = defineComponent({
size='small' size='small'
placeholder={t('project.task.workflow_name')} placeholder={t('project.task.workflow_name')}
clearable clearable
onClear={this.onClearSearchWorkFlowName}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
@ -180,6 +218,7 @@ const BatchTaskInstance = defineComponent({
size='small' size='small'
placeholder={t('project.task.executor')} placeholder={t('project.task.executor')}
clearable clearable
onClear={this.onClearSearchExecutorName}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
@ -187,6 +226,7 @@ const BatchTaskInstance = defineComponent({
size='small' size='small'
placeholder={t('project.task.host')} placeholder={t('project.task.host')}
clearable clearable
onClear={this.onClearSearchHost}
/> />
<NSelect <NSelect
v-model={[this.stateType, 'value']} v-model={[this.stateType, 'value']}
@ -195,6 +235,7 @@ const BatchTaskInstance = defineComponent({
placeholder={t('project.task.state')} placeholder={t('project.task.state')}
style={{ width: '180px' }} style={{ width: '180px' }}
clearable clearable
onClear={this.onClearSearchStateType}
/> />
<NDatePicker <NDatePicker
v-model={[this.datePickerRange, 'value']} v-model={[this.datePickerRange, 'value']}
@ -203,6 +244,7 @@ const BatchTaskInstance = defineComponent({
start-placeholder={t('project.task.start_time')} start-placeholder={t('project.task.start_time')}
end-placeholder={t('project.task.end_time')} end-placeholder={t('project.task.end_time')}
clearable clearable
onClear={this.onClearSearchTime}
/> />
<NButton size='small' type='primary' onClick={onSearch}> <NButton size='small' type='primary' onClick={onSearch}>
<NIcon> <NIcon>

12
dolphinscheduler-ui/src/views/projects/workflow/definition/index.tsx

@ -84,6 +84,15 @@ export default defineComponent({
requestData() requestData()
} }
const onClearSearch = () => {
variables.page = 1
getTableData({
pageSize: variables.pageSize,
pageNo: variables.page,
searchVal: ''
})
}
const handleChangePageSize = () => { const handleChangePageSize = () => {
variables.page = 1 variables.page = 1
requestData() requestData()
@ -118,6 +127,7 @@ export default defineComponent({
return { return {
requestData, requestData,
handleSearch, handleSearch,
onClearSearch,
handleUpdateList, handleUpdateList,
createDefinition, createDefinition,
createDefinitionDynamic, createDefinitionDynamic,
@ -172,6 +182,8 @@ export default defineComponent({
size='small' size='small'
placeholder={t('resource.function.enter_keyword_tips')} placeholder={t('resource.function.enter_keyword_tips')}
v-model={[this.searchVal, 'value']} v-model={[this.searchVal, 'value']}
clearable
onClear={this.onClearSearch}
/> />
<NButton type='primary' size='small' onClick={this.handleSearch}> <NButton type='primary' size='small' onClick={this.handleSearch}>
<NIcon> <NIcon>

24
dolphinscheduler-ui/src/views/projects/workflow/instance/components/process-instance-condition.tsx

@ -56,6 +56,21 @@ export default defineComponent({
}) })
} }
const onClearSearchVal = () => {
searchValRef.value = ''
handleSearch()
}
const onClearSearchHost = () => {
hostRef.value = ''
handleSearch()
}
const onClearSearchExecutor = () => {
executorNameRef.value = ''
handleSearch()
}
const trim = getCurrentInstance()?.appContext.config.globalProperties.trim const trim = getCurrentInstance()?.appContext.config.globalProperties.trim
return { return {
@ -65,6 +80,9 @@ export default defineComponent({
stateTypeRef, stateTypeRef,
startEndTimeRef, startEndTimeRef,
handleSearch, handleSearch,
onClearSearchVal,
onClearSearchExecutor,
onClearSearchHost,
trim trim
} }
}, },
@ -79,18 +97,24 @@ export default defineComponent({
size='small' size='small'
v-model:value={this.searchValRef} v-model:value={this.searchValRef}
placeholder={t('project.workflow.name')} placeholder={t('project.workflow.name')}
clearable
onClear={this.onClearSearchVal}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
size='small' size='small'
v-model:value={this.executorNameRef} v-model:value={this.executorNameRef}
placeholder={t('project.workflow.executor')} placeholder={t('project.workflow.executor')}
clearable
onClear={this.onClearSearchExecutor}
/> />
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
size='small' size='small'
v-model:value={this.hostRef} v-model:value={this.hostRef}
placeholder={t('project.workflow.host')} placeholder={t('project.workflow.host')}
clearable
onClear={this.onClearSearchHost}
/> />
<NSelect <NSelect
options={options} options={options}

Loading…
Cancel
Save