mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-04 12:58:24 +08:00
fix bug for edit project add replica feature
This commit is contained in:
parent
39211f1fd5
commit
914466a800
@ -35,6 +35,34 @@ export function editDispatch(params) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑分发项目
|
||||
* @param {
|
||||
* id: 分发 ID
|
||||
* name: 分发名称
|
||||
* reqId: 请求 ID
|
||||
* type: 类型 add | edit
|
||||
* afterOpt: 发布后操作
|
||||
* runMode: 运行方式
|
||||
* mainClass: 启动类
|
||||
* javaExtDirsCp: 目录地址
|
||||
* whitelistDirectory: 白名单地址
|
||||
* lib: lib
|
||||
* add_xxx: xxx 表示添加的节点信息
|
||||
* xxx_token: xxx 节点的 webhook 地址
|
||||
* xxx_jvm: jvm 参数
|
||||
* xxx_args: args 参数
|
||||
* xxx_javaCopyIds: xxx 节点副本 ID (如果有副本,还需要加上 xxx_jvm_${副本ID} | xxx_args_${副本ID} 参数)
|
||||
* } params
|
||||
*/
|
||||
export function editDispatchProject(params) {
|
||||
return axios({
|
||||
url: '/outgiving/save_project',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分发
|
||||
* @param {*} id 分发 ID
|
||||
|
@ -20,7 +20,8 @@
|
||||
</template>
|
||||
<template slot="operation" slot-scope="text, record">
|
||||
<a-button type="primary" @click="handleDispatch(record)">分发文件</a-button>
|
||||
<a-button type="primary" @click="handleEdit(record)">编辑</a-button>
|
||||
<a-button type="primary" v-if="record.outGivingProject" @click="handleEditDispatchProject(record)">编辑</a-button>
|
||||
<a-button type="primary" v-else @click="handleEditDispatch(record)">编辑</a-button>
|
||||
<a-button type="danger" @click="handleDelete(record)">删除</a-button>
|
||||
</template>
|
||||
<!-- 嵌套表格 -->
|
||||
@ -109,6 +110,7 @@
|
||||
<a-select-option :key="3">顺序重启(有重启失败将继续)</a-select-option>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
<!-- 项目文件组件 -->
|
||||
@ -126,7 +128,7 @@
|
||||
<script>
|
||||
import File from '../node/node-layout/project/project-file';
|
||||
import Console from '../node/node-layout/project/project-console';
|
||||
import { getDishPatchList, getReqId, editDispatch, getDispatchWhiteList, deleteDisPatch } from '../../api/dispatch';
|
||||
import { getDishPatchList, getReqId, editDispatch, /*editDispatchProject,*/ getDispatchWhiteList, deleteDisPatch } from '../../api/dispatch';
|
||||
import { getNodeProjectList } from '../../api/node'
|
||||
export default {
|
||||
components: {
|
||||
@ -270,7 +272,7 @@ export default {
|
||||
this.loadData();
|
||||
this.loadNodeProjectList();
|
||||
},
|
||||
// 关联
|
||||
// 关联分发
|
||||
handleLink() {
|
||||
this.temp = {
|
||||
type: 'add'
|
||||
@ -278,28 +280,22 @@ export default {
|
||||
this.loadReqId();
|
||||
this.linkDispatchVisible = true;
|
||||
},
|
||||
// 编辑
|
||||
handleEdit(record) {
|
||||
// 编辑分发
|
||||
handleEditDispatch(record) {
|
||||
this.temp = Object.assign({}, record)
|
||||
this.temp.type = 'edit';
|
||||
// 判断分发项目类型
|
||||
if (this.temp.outGivingProject) {
|
||||
this.loadAccesList();
|
||||
this.editDispatchVisible = true;
|
||||
} else {
|
||||
this.targetKeys = [];
|
||||
// 设置选中的项目和节点
|
||||
record.outGivingNodeProjectList.forEach(ele => {
|
||||
if (!this.temp.projectId) {
|
||||
this.temp.projectId = ele.projectId;
|
||||
}
|
||||
this.targetKeys.push(ele.nodeId);
|
||||
})
|
||||
this.loadReqId();
|
||||
this.linkDispatchVisible = true;
|
||||
}
|
||||
this.targetKeys = [];
|
||||
// 设置选中的项目和节点
|
||||
record.outGivingNodeProjectList.forEach(ele => {
|
||||
if (!this.temp.projectId) {
|
||||
this.temp.projectId = ele.projectId;
|
||||
}
|
||||
this.targetKeys.push(ele.nodeId);
|
||||
})
|
||||
this.loadReqId();
|
||||
this.linkDispatchVisible = true;
|
||||
},
|
||||
// 添加
|
||||
// 添加分发项目
|
||||
handleAdd() {
|
||||
this.temp = {
|
||||
type: 'add'
|
||||
@ -307,6 +303,14 @@ export default {
|
||||
this.loadAccesList();
|
||||
this.editDispatchVisible = true;
|
||||
},
|
||||
// 编辑分发项目
|
||||
handleEditDispatchProject(record) {
|
||||
this.temp = Object.assign({}, record)
|
||||
this.temp.type = 'edit';
|
||||
this.loadAccesList();
|
||||
this.loadReqId();
|
||||
this.editDispatchVisible = true;
|
||||
},
|
||||
// 选择项目
|
||||
selectProject(value) {
|
||||
this.targetKeys = [];
|
||||
|
@ -292,8 +292,16 @@ export default {
|
||||
}
|
||||
getProjectById(params).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.temp = res.data;
|
||||
this.temp.type = 'edit';
|
||||
this.temp = {
|
||||
...res.data,
|
||||
type: 'edit'
|
||||
};
|
||||
if (!this.temp.javaCopyItemList) {
|
||||
this.temp = {
|
||||
...this.temp,
|
||||
javaCopyItemList: []
|
||||
};
|
||||
}
|
||||
this.editProjectVisible = true;
|
||||
}
|
||||
})
|
||||
@ -313,6 +321,7 @@ export default {
|
||||
args: '',
|
||||
deleteAble: true
|
||||
})
|
||||
console.log(this.temp)
|
||||
},
|
||||
// 移除副本
|
||||
handleDeleteReplica(reeplica) {
|
||||
|
Loading…
Reference in New Issue
Block a user