Skip to content

Commit

Permalink
Merge branch 'WeBankFinTech:dev-1.0.0' into dev-1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidhua1996 authored Feb 26, 2022
2 parents 44d90ed + 9b1ee51 commit aadb1ee
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 14 deletions.
4 changes: 4 additions & 0 deletions web/src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export const genFileURL = (fileId, fileHash) =>

export const dateFormat = (timestamp) => {
return moment(timestamp).format("YYYY-MM-DD HH:mm");
}

export const dateFormatSeconds = (timestamp) => {
return moment(timestamp).format("YYYY-MM-DD HH:mm:ss");
};

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const typesMap = {
// dataSource: 'options',
dataSource: (data, source, self)=>{
const fApi = self.fApi;
if(/^https?:/.test(data.dataSource)){
if(typeof data.dataSource === 'string'){
///^https?:/.test(data.dataSource)
request(data.dataSource, {}, {
method: "GET",
}).then(result=>{
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/jobManagement/components/bottomLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div v-if="jobProgress.tasks" class="job-progress-percent job-progress-wrap">
<span>总进度<span style="font-size: 11px;color:rgba(0,0,0,0.5)">({{statusMap[jobStatus]}})</span></span>
<a-tooltip :title="jobProgress.title">
<a-progress :percent="jobProgress.percent" :success-percent="jobProgress.successPercent"/>
<a-progress :percent="jobProgress.percent" />
</a-tooltip>
</div>
<div v-if="jobProgress.tasks && jobProgress.tasks.Running" class="job-progress-wrap">
Expand Down
31 changes: 25 additions & 6 deletions web/src/pages/jobManagement/components/dyncRender.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:options="checkOptions"
@change="emitData(value)"
:style="style"
:placeholder="description"
>
</a-select>
<template v-if="type === 'MAP'">
Expand Down Expand Up @@ -38,6 +39,7 @@
v-model:value="value"
@change="emitData(value)"
:style="style"
:placeholder="description"
/>
<span style="margin-left: 5px">{{unit}}</span>
</template>
Expand All @@ -62,12 +64,21 @@ export default defineComponent({
},
emits: ["updateInfo"],
setup(props, context) {
let { type, field, value, unit, source} = props.param;
let { type, field, value, unit, source, description} = props.param;
value = ref(value)
//let tmlName = field.split(".").pop();
const newProps = computed(() => JSON.parse(JSON.stringify(props.param)))
watch(newProps, (val, oldVal) => {
value.value = val.value
if (type === 'OPTION'){
checkOptions.value = []
val.values.map((item) => {
checkOptions.value.push({
value: item,
label: item
})
})
}
/*if (type === 'MAP') {
value.value = value.value || {}
if (val.source === oldVal.source) {
Expand All @@ -89,10 +100,11 @@ export default defineComponent({
}
}
})
let checkOptions = []
let checkOptions = ref([])
if (type === 'OPTION'){
checkOptions.value = []
props.param.values.map((item) => {
checkOptions.push({
checkOptions.value.push({
value: item,
label: item
})
Expand All @@ -101,7 +113,13 @@ export default defineComponent({
let partitionArr = ref([])
const _buildMap = function () {
partitionArr.value = []
let url = source.split('?')[0]
let url
const source_reg = new RegExp('^http');
if (source_reg.test(source.value)) {
url = source.split('?')[0]
} else {
url = window.location.origin + source.split('?')[0]
}
getPartitionInfo({
source: url,
dataSourceId: props.data.id,
Expand Down Expand Up @@ -177,13 +195,14 @@ export default defineComponent({
}
return {
checkOptions: ref(checkOptions),
checkOptions,
type,
value: value,
value,
emitData,
unit,
source,
partitionArr,
description,
handleChange
}
}
Expand Down
3 changes: 3 additions & 0 deletions web/src/pages/jobManagement/components/executionLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ export default defineComponent({
} else {
lastRows.value = ''
if (!pauseLog.pauseIsEnd) {
logs.logs = {}
logs.endLine = 0
logs.isEnd = false
/*resetData({
endLine: pauseLog.pauseEndLine,
isEnd: pauseLog.pauseIsEnd
Expand Down
3 changes: 2 additions & 1 deletion web/src/pages/jobManagement/components/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
{{ item.subJobName }}
</div>
<a-input
style="width: 115px"
@pressEnter="nameEditable = false"
@blur="nameEditable = false"
ref="currentInput"
Expand Down Expand Up @@ -239,7 +240,7 @@
<span>总进度<span style="font-size: 11px;color:rgba(0,0,0,0.5)">({{statusMap[jobStatus]}})</span></span>
<a-tooltip :title="jobProgress.title">
<a-progress v-if="jobProgress.failedTasks" :percent="jobProgress.percent" status="exception"/>
<a-progress v-else :percent="jobProgress.percent" :success-percent="jobProgress.successPercent"/>
<a-progress v-else :percent="jobProgress.percent"/>
</a-tooltip>
</div>
<div v-if="jobProgress.tasks && jobProgress.tasks.Running" class="job-progress-wrap">
Expand Down
5 changes: 3 additions & 2 deletions web/src/pages/jobManagement/components/jobDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
{{ item.subJobName }}
</div>
<a-input
style="width: 115px"
@pressEnter="nameEditable = false"
@blur="nameEditable = false"
ref="currentInput"
Expand Down Expand Up @@ -239,7 +240,7 @@
<span>总进度<span style="font-size: 11px;color:rgba(0,0,0,0.5)">({{statusMap[jobStatus]}})</span></span>
<a-tooltip :title="jobProgress.title">
<a-progress v-if="jobProgress.failedTasks" :percent="jobProgress.percent" status="exception"/>
<a-progress v-else :percent="jobProgress.percent" :success-percent="jobProgress.successPercent"/>
<a-progress v-else :percent="jobProgress.percent"/>
</a-tooltip>
</div>
<div v-if="jobProgress.tasks && jobProgress.tasks.Running" class="job-progress-wrap">
Expand Down Expand Up @@ -962,7 +963,7 @@ export default {
this.spinning = false
clearInterval(this.jobStatusTimer)
clearInterval(this.progressTimer)
//this.visibleLog = false
this.visibleLog = false
// 更新执行历史状态
for (let i = this.ehTableData.length; i > 0; i--) {
Expand Down
6 changes: 3 additions & 3 deletions web/src/pages/synchronizationHistory/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ import {
killJob
} from "@/common/service";
import { message } from "ant-design-vue";
import { dateFormat } from "@/common/utils";
import { dateFormat, dateFormatSeconds } from "@/common/utils";
import bottomLog from '../jobManagement/components/bottomLog';
const columns = [
Expand Down Expand Up @@ -292,8 +292,8 @@ export default {
.then((res) => {
const { jobList } = res;
jobList.forEach((item) => {
item["createTime"] = item["createTime"] ? dateFormat(item["createTime"]) : '';
item["lastUpdateTime"] = item["lastUpdateTime"] ? dateFormat(item["lastUpdateTime"]): '';
item["createTime"] = item["createTime"] ? dateFormatSeconds(item["createTime"]) : '';
item["lastUpdateTime"] = item["lastUpdateTime"] ? dateFormatSeconds(item["lastUpdateTime"]): '';
/*switch (item["status"]) {
case "SUCCESS":
item["status"] = "执行成功";
Expand Down

0 comments on commit aadb1ee

Please sign in to comment.