Skip to content

Commit

Permalink
Merge pull request #73 from Kabimon/feature/ui_refactory
Browse files Browse the repository at this point in the history
fix bug & list 139-142
  • Loading branch information
mingfengwang authored Feb 28, 2022
2 parents c595fba + 9e9ee86 commit cea0e82
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 13 deletions.
4 changes: 4 additions & 0 deletions web/src/common/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export const testDataSourceConnect = (type, id) => {
return request(`/datasources/${type}/${id}/connect`, {}, { method: "PUT" });
};

export const testDataSourceNotSavedConnect = (params) => {
return request(`/datasources/op/connect`, { ...params }, { method: "POST" });
};

export const getDataSourceById = (id, versionId) => {
return request(`/datasources/${id}`, {versionId}, { method: "GET" });
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="table-warp" style="padding-bottom: 32px;">
<form-create :rule="rule" v-model:api="fApi" :option="options" v-model="formData"/>
<a-button v-if="data.mode === 'edit'" @click="handleTestConnect(row)" type="primary">{{
<a-button v-if="data.mode !== 'read'" @click="handleTestConnect(row)" type="primary">{{
$t("dataSource.table.list.columns.actions.testConnectButton")
}}</a-button>
<a-button type="primary" @click="submit" style="float: right;margin: 0 0 0 10px;" v-if="data.mode !== 'read'">确定</a-button>
Expand All @@ -10,9 +10,10 @@
</template>
<script>
import _, { merge, mergeWith} from 'lodash-es';
import {getKeyDefine, getDataSourceById, testDataSourceConnect} from "@/common/service";
import {getKeyDefine, getDataSourceById} from "@/common/service";
import { request } from "@fesjs/fes";
import { message } from "ant-design-vue"
import { toRaw } from "vue";
const type = {
TEXT: {type: 'input'},
Expand Down Expand Up @@ -280,14 +281,12 @@ export default {
},
submit(){
this.fApi.submit((formData, fApi)=>{
console.log(JSON.stringify(formData))
this.$emit("submit", JSON.stringify(formData), this.originalDefine);
})
},
// 测试链接
async handleTestConnect() {
await testDataSourceConnect(this.data.id, this.data.versionId);
message.success("连接成功");
handleTestConnect() {
this.$emit('connect', JSON.stringify(toRaw(this.formData)), this.originalDefine)
}
}
}
Expand Down
24 changes: 22 additions & 2 deletions web/src/pages/dataSourceManage/components/editModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@cancel="$emit('update:visible', false)"
:width="600">
<a-spin :spinning="confirmLoading">
<DatasourceForm :data="modalCfg" ref="datasourceForm" @submit="handleOk" @cancel="$emit('update:visible', false)"/>
<DatasourceForm :data="modalCfg" ref="datasourceForm" @connect="handleConnect" @submit="handleOk" @cancel="$emit('update:visible', false)"/>
<div class="mark-layer" v-if="mode === 'read'"></div>
<!--<a-form ref="formRef" :model="formState" :label-col="{ span: 6 }">-->
<!--<a-form-item :label="$t(`dataSource.editModal.form.fields.dataSourceName.label`)" name="dataSourceName">-->
Expand Down Expand Up @@ -43,7 +43,7 @@
</template>

<script>
import { createDataSource, updateDataSource } from "@/common/service";
import { createDataSource, updateDataSource, testDataSourceNotSavedConnect } from "@/common/service";
import { toRaw } from "vue";
import { message } from "ant-design-vue";
import DatasourceForm from './datasourceForm/index';
Expand Down Expand Up @@ -155,6 +155,26 @@ export default {
comment: info.comment || "",
};
},*/
async handleConnect(formState, originalDefine) {
formState = JSON.parse(formState)
let connectParams = {}
originalDefine.forEach(item => {
connectParams[item.key] = formState[item.key]
})
await testDataSourceNotSavedConnect({
dataSourceTypeId: this.type,
createSystem: this.modalCfg.createSystem,
createIdentify: "",
dataSourceName: formState.dataSourceName,
dataSourceDesc: formState.dataSourceDesc || "",
labels: formState.labels || "",
comment: formState.comment || "更新",
connectParams: {
...connectParams
}
});
message.success("连接成功")
},
// modal完成
async handleOk(formState, originalDefine) {
formState = JSON.parse(formState)
Expand Down
5 changes: 3 additions & 2 deletions web/src/pages/dataSourceManage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<div class="dsm-name" :title="text.name">{{ text.name }}</div>
</template>
<template #modifyTime="{ text }">
{{ text && dateFormat(text) }}
{{ text && dateFormatSeconds(text) }}
</template>
</a-table>
</a-col>
Expand Down Expand Up @@ -151,7 +151,7 @@ import {
testDataSourceConnect,
} from "@/common/service";
import { message } from "ant-design-vue";
import { dateFormat } from "@/common/utils";
import { dateFormat, dateFormatSeconds } from "@/common/utils";
const data = [];
export default {
Expand Down Expand Up @@ -237,6 +237,7 @@ export default {
return {
// 时间格式化
dateFormat,
dateFormatSeconds,
// 数据源列表
dataSourceList: data,
// 数据源类型选择弹窗
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/jobManagement/components/fieldMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<div
style="
position: relative;
height: 66px;
height: 65px;
float: left;
width: 200px;
"
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/jobManagement/components/jobDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ export default {
clearInterval(this.jobStatusTimer)
clearInterval(this.progressTimer)
this.visibleLog = false
this.jobStatus = 'Cancelled'
// 更新执行历史状态
for (let i = this.ehTableData.length; i > 0; i--) {
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/projectManage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default {
await deleteProject(id);
message.success("删除成功");
this.pageCfg.current = 1;
this.getDataList();
this.getDataList(this.projectName);
},
// 编辑项目
handleOnEditProject(id) {
Expand Down
8 changes: 7 additions & 1 deletion web/src/pages/synchronizationHistory/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
<template #jobExecutionId="{ record }">
<a @click="showInfoLog(record.jobExecutionId)">{{record.jobExecutionId}}</a>
</template>
<template #flow="{ record }">
<span>{{record.flow}} Records/S</span>
</template>
</a-table>
<!-- 分页 -->
<!--<div class="sh-b-pagination"></div>-->
Expand Down Expand Up @@ -177,6 +180,9 @@ const columns = [
{
title: "速率",
dataIndex: "flow",
slots: {
customRender: "flow",
}
},
{
title: "创建用户",
Expand All @@ -191,7 +197,7 @@ const columns = [
dataIndex: "status",
slots: {
customRender: "status",
},
}
},
{
title: "最后更新时间",
Expand Down

0 comments on commit cea0e82

Please sign in to comment.