集成任务部署开发完成(curd)
This commit is contained in:
parent
97e527fc0b
commit
4f26dec9a4
|
@ -375,7 +375,6 @@ export default {
|
|||
},
|
||||
// 点击事件
|
||||
handleNodeClick(data,b,c) {
|
||||
console.log(data,b,c)
|
||||
this.$emit("handleNodeClick", data);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
:menuData="treeData"
|
||||
:filterShow="true"
|
||||
:Allshow="false"
|
||||
:treeButton="true"
|
||||
:filterButtonShow="true"
|
||||
:treeButton="false"
|
||||
:filterButtonShow="false"
|
||||
style="height: 100%"
|
||||
:treeProps="treeProps"
|
||||
@handleNodeClick="homeHandleNodeClick"
|
||||
|
@ -49,9 +49,16 @@
|
|||
:showIndex="true"
|
||||
:tabLoading="mainTabLoading"
|
||||
@onFunc="tableButtonHandle"
|
||||
:tableHeight="'60vh'"
|
||||
:tableHeight="'53vh'"
|
||||
:border="false"
|
||||
></BaseTable>
|
||||
>
|
||||
<template #taskStatus="{row}">
|
||||
{{ row.taskStatus == 1 ? '启用' : '停用' }}
|
||||
</template>
|
||||
<template #taskPlugin="{row}">
|
||||
{{ pluginDist[row.taskPlugin] }}
|
||||
</template>
|
||||
</BaseTable>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
|
@ -91,12 +98,14 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import basePage from "./compoments/basePage.vue";
|
||||
import BaseMenuTree from "./compoments/baseMenuTree";
|
||||
import BaseNewForm from "./compoments/baseNewForm";
|
||||
import BaseTable from "./compoments/baseTable";
|
||||
import { getUserModuleApi } from "@/api/integrationOption/integrationOption.js";
|
||||
import baseRightDialog from "@/components/base/baseRightDialog";
|
||||
import basePage from './compoments/basePage.vue'
|
||||
import BaseMenuTree from './compoments/baseMenuTree'
|
||||
import BaseNewForm from './compoments/baseNewForm'
|
||||
import BaseTable from './compoments/baseTable'
|
||||
import { getUserModuleApi } from '@/api/integrationOption/integrationOption.js'
|
||||
import baseRightDialog from '@/components/base/baseRightDialog'
|
||||
import { authApi } from '@/api/apis/auth'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -107,141 +116,167 @@ export default {
|
|||
//页码控制
|
||||
pageIndex: 1,
|
||||
total: 10,
|
||||
limit: 10,
|
||||
limit: 10
|
||||
},
|
||||
mainTabLoading: false, //表格loding控制
|
||||
treeData: [
|
||||
//左侧分类数据
|
||||
{
|
||||
label: "测试",
|
||||
label: '测试',
|
||||
id: 1,
|
||||
children: [
|
||||
{
|
||||
id: 3,
|
||||
label: "哈哈",
|
||||
},
|
||||
label: '哈哈'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
treeForm: { class_name: "", class_superiors: "", class_code: "" },
|
||||
treeForm: { class_name: '', class_superiors: '', class_code: '' },
|
||||
searchForm: {}, //搜索框数据
|
||||
SearchformRow: [
|
||||
//搜索框数据
|
||||
{
|
||||
elCol: [
|
||||
{
|
||||
type: "input",
|
||||
title: "任务编码",
|
||||
id: "task_code",
|
||||
row: 8,
|
||||
type: 'input',
|
||||
title: '任务编码',
|
||||
id: 'taskCode',
|
||||
row: 8
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
title: "任务名称",
|
||||
id: "task_name",
|
||||
type: 'input',
|
||||
title: '任务名称',
|
||||
id: 'taskName',
|
||||
row: 8
|
||||
},
|
||||
{
|
||||
type: 'radio',
|
||||
title: '任务状态',
|
||||
id: 'taskStatus',
|
||||
row: 8,
|
||||
options: [
|
||||
{
|
||||
label: '启用',
|
||||
id: '1'
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '停用',
|
||||
id: '2'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
,
|
||||
{
|
||||
elCol: [
|
||||
{
|
||||
type: 'select',
|
||||
title: '插件',
|
||||
id: 'taskPlugin',
|
||||
row: 8,
|
||||
options: []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
funData: [
|
||||
//table操作
|
||||
{
|
||||
type: "edit",
|
||||
text: "编辑",
|
||||
color: "#5a9cf8",
|
||||
type: 'edit',
|
||||
text: '编辑',
|
||||
color: '#5a9cf8'
|
||||
},
|
||||
{
|
||||
type: "view",
|
||||
text: "查看",
|
||||
color: "#5a9cf8",
|
||||
type: 'view',
|
||||
text: '查看',
|
||||
color: '#5a9cf8'
|
||||
},
|
||||
{
|
||||
type: "dele",
|
||||
text: "删除",
|
||||
color: "#e47470",
|
||||
},
|
||||
type: 'dele',
|
||||
text: '删除',
|
||||
color: '#e47470'
|
||||
}
|
||||
],
|
||||
tableData: [{ taskCode: "测试", taskName: "123" }], //table主表数据
|
||||
tableData: [], //table主表数据
|
||||
tableColumn: [
|
||||
//数据咧数据
|
||||
{
|
||||
id: "task_code",
|
||||
title: "任务编码",
|
||||
id: 'taskName',
|
||||
title: '任务名称'
|
||||
},
|
||||
{
|
||||
id: "task_name",
|
||||
title: "任务名称",
|
||||
id: 'taskCode',
|
||||
title: '任务编码'
|
||||
},
|
||||
{
|
||||
id: "task_classes",
|
||||
title: "任务分类",
|
||||
id: 'taskStatus',
|
||||
title: '任务状态'
|
||||
},
|
||||
{
|
||||
id: "task_cron",
|
||||
title: "任务策略",
|
||||
id: 'taskPlugin',
|
||||
title: '插件'
|
||||
},
|
||||
{
|
||||
id: "fun_info",
|
||||
title: "功能介绍",
|
||||
},
|
||||
{
|
||||
id: "remark",
|
||||
title: "备注",
|
||||
},
|
||||
id: 'taskCron',
|
||||
title: '任务策略'
|
||||
}
|
||||
],
|
||||
treeProps: {
|
||||
children: "childClassifications",
|
||||
label: "class_name",
|
||||
children: 'childClassifications',
|
||||
label: 'name'
|
||||
},
|
||||
treeTitle: "",
|
||||
treeTitle: '',
|
||||
treeRuleForm: {},
|
||||
treeAddFlag: false,
|
||||
};
|
||||
appId: '',//左侧树id
|
||||
pluginDist: {}//插件字典用于列表显示
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 右dialog提交
|
||||
async handleConfirmClick() {
|
||||
if (!this.treeRuleForm.class_name) {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "请输入树名称",
|
||||
});
|
||||
return;
|
||||
type: 'error',
|
||||
message: '请输入树名称'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.treeAddFlag) {
|
||||
const res = await getUserModuleApi(
|
||||
{
|
||||
tl: "integrationTaskClassificationService",
|
||||
as: "integrationTaskClassification",
|
||||
dj: "saveTaskClassification",
|
||||
tl: 'integrationTaskClassificationService',
|
||||
as: 'integrationTaskClassification',
|
||||
dj: 'saveTaskClassification'
|
||||
},
|
||||
this.treeRuleForm
|
||||
);
|
||||
)
|
||||
if (res.status == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "保存成功",
|
||||
});
|
||||
this.rightDialogSwitch = false;
|
||||
this.initTreeData();
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.rightDialogSwitch = false
|
||||
this.initTreeData()
|
||||
}
|
||||
} else {
|
||||
const res = await getUserModuleApi(
|
||||
{
|
||||
tl: "integrationTaskClassificationService",
|
||||
as: "integrationTaskClassification",
|
||||
dj: "updateTaskClassification",
|
||||
tl: 'integrationTaskClassificationService',
|
||||
as: 'integrationTaskClassification',
|
||||
dj: 'updateTaskClassification'
|
||||
},
|
||||
this.treeRuleForm
|
||||
);
|
||||
)
|
||||
if (res.status == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "保存成功",
|
||||
});
|
||||
this.rightDialogSwitch = false;
|
||||
this.initTreeData();
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
this.rightDialogSwitch = false
|
||||
this.initTreeData()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -249,184 +284,207 @@ export default {
|
|||
async initTreeData() {
|
||||
const res = await getUserModuleApi(
|
||||
{
|
||||
tl: "integrationTaskClassificationService",
|
||||
as: "integrationTaskClassification",
|
||||
dj: "queryTaskClassification",
|
||||
tl: 'sysApplicationService',
|
||||
as: '',
|
||||
dj: 'queryEntity'
|
||||
},
|
||||
{}
|
||||
);
|
||||
)
|
||||
if (res.status == 200) {
|
||||
this.treeData = res.attribute;
|
||||
console.log(res)
|
||||
this.treeData = res.attribute
|
||||
this.$nextTick(() => {
|
||||
this.$refs.menuTree.clickFirst()
|
||||
})
|
||||
}
|
||||
console.log(res, "🌲");
|
||||
console.log(res, '🌲')
|
||||
},
|
||||
// 树添加
|
||||
treeAppendHandle(data) {
|
||||
this.treeRuleForm = {};
|
||||
this.treeTitle = "子节点增加";
|
||||
this.treeAddFlag = true;
|
||||
this.$set(this.treeRuleForm, "class_superiors_name", data.class_name);
|
||||
this.$set(this.treeRuleForm, "class_superiors", data.id);
|
||||
this.$set(this.treeRuleForm, "class_code", data.class_code);
|
||||
this.$set(this.treeRuleForm, "lvl", String(data.lvl * 1 + 1));
|
||||
this.rightDialogSwitch = true;
|
||||
this.treeRuleForm = {}
|
||||
this.treeTitle = '子节点增加'
|
||||
this.treeAddFlag = true
|
||||
this.$set(this.treeRuleForm, 'class_superiors_name', data.class_name)
|
||||
this.$set(this.treeRuleForm, 'class_superiors', data.id)
|
||||
this.$set(this.treeRuleForm, 'class_code', data.class_code)
|
||||
this.$set(this.treeRuleForm, 'lvl', String(data.lvl * 1 + 1))
|
||||
this.rightDialogSwitch = true
|
||||
},
|
||||
treeReviseHandle(data) {
|
||||
this.treeRuleForm = {};
|
||||
this.treeAddFlag = false;
|
||||
this.rightDialogSwitch = true;
|
||||
this.$set(this.treeRuleForm, "id", data.id);
|
||||
this.$set(this.treeRuleForm, "class_code", data.class_code);
|
||||
this.$set(this.treeRuleForm, "class_name", data.class_name);
|
||||
this.$set(this.treeRuleForm, "lvl", String(data.lvl));
|
||||
this.treeTitle = "子节点编辑";
|
||||
this.treeRuleForm = {}
|
||||
this.treeAddFlag = false
|
||||
this.rightDialogSwitch = true
|
||||
this.$set(this.treeRuleForm, 'id', data.id)
|
||||
this.$set(this.treeRuleForm, 'class_code', data.class_code)
|
||||
this.$set(this.treeRuleForm, 'class_name', data.class_name)
|
||||
this.$set(this.treeRuleForm, 'lvl', String(data.lvl))
|
||||
this.treeTitle = '子节点编辑'
|
||||
},
|
||||
treeRemoveHandle(data) {
|
||||
this.$confirm("确认删除?")
|
||||
.then(async () => {
|
||||
console.log(1);
|
||||
this.$confirm('确认删除?')
|
||||
.then(async() => {
|
||||
console.log(1)
|
||||
const res = await getUserModuleApi(
|
||||
{
|
||||
tl: "integrationTaskClassificationService",
|
||||
as: "integrationTaskClassification",
|
||||
dj: "updateTaskClassificationSts",
|
||||
tl: 'integrationTaskClassificationService',
|
||||
as: 'integrationTaskClassification',
|
||||
dj: 'updateTaskClassificationSts'
|
||||
},
|
||||
{
|
||||
id: data.id, //任务id
|
||||
id: data.id //任务id
|
||||
}
|
||||
);
|
||||
console.log(res);
|
||||
)
|
||||
console.log(res)
|
||||
if (res.status == 200) {
|
||||
this.$nextTick(() => {
|
||||
this.initTreeData();
|
||||
});
|
||||
this.initTreeData()
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
// 左侧树加号点击事件
|
||||
treeAddHandle() {
|
||||
this.treeRuleForm = {};
|
||||
this.treeAddFlag = true;
|
||||
this.rightDialogSwitch = true;
|
||||
this.treeTitle = "根节点增加";
|
||||
this.$set(this.treeRuleForm, "class_code", new Date().getTime());
|
||||
this.$set(this.treeRuleForm, "lvl", "0");
|
||||
this.treeRuleForm = {}
|
||||
this.treeAddFlag = true
|
||||
this.rightDialogSwitch = true
|
||||
this.treeTitle = '根节点增加'
|
||||
this.$set(this.treeRuleForm, 'class_code', new Date().getTime())
|
||||
this.$set(this.treeRuleForm, 'lvl', '0')
|
||||
},
|
||||
// 初始化表单
|
||||
async initTableData(obj = {}) {
|
||||
const res = await getUserModuleApi(
|
||||
{
|
||||
tl: "integrationTaskService",
|
||||
as: "integrationTask",
|
||||
dj: "queryListJson",
|
||||
tl: 'integrationTaskService',
|
||||
as: '',
|
||||
dj: 'queryEntityPage'
|
||||
},
|
||||
{
|
||||
pageNum: this.pageModel.pageIndex,
|
||||
pageSize: this.pageModel.limit,
|
||||
query_condition: { ...obj },
|
||||
task_app: this.appId,
|
||||
...obj,
|
||||
}
|
||||
);
|
||||
console.log(res);
|
||||
)
|
||||
console.log(res, 'tabledata')
|
||||
if (res.status == 200) {
|
||||
this.tableData = res.attribute;
|
||||
this.tableData = res.attribute.list
|
||||
this.pageModel.total = res.attribute.total
|
||||
}
|
||||
},
|
||||
// 搜索按钮
|
||||
searchHandle() {
|
||||
this.initTableData({ ...this.searchForm });
|
||||
this.initTableData({ ...this.searchForm })
|
||||
},
|
||||
// 重置按钮
|
||||
resizeSearchHandle() {
|
||||
this.searchForm = {};
|
||||
this.searchForm = {}
|
||||
},
|
||||
// 新建路由跳转
|
||||
newPage() {
|
||||
this.$router.push({ name: "taskAdd" });
|
||||
this.$router.push({ name: 'taskAdd' })
|
||||
},
|
||||
// 暂无作用
|
||||
// 树点击事件
|
||||
homeHandleNodeClick(data) {
|
||||
this.pageModel.pageIndex = 1;
|
||||
this.pageModel.total = 0;
|
||||
this.pageModel.limit = 10;
|
||||
this.searchForm = {};
|
||||
this.tableData = [];
|
||||
this.lookFlag = false;
|
||||
this.newFlag = false;
|
||||
console.log(data, 'data')
|
||||
this.pageModel.pageIndex = 1
|
||||
this.pageModel.total = 0
|
||||
this.pageModel.limit = 10
|
||||
this.appId = data.id
|
||||
this.searchForm = {}
|
||||
this.tableData = []
|
||||
this.lookFlag = false
|
||||
this.newFlag = false
|
||||
//树点击完毕后调用插件查询接口
|
||||
this.plugSelectInit()
|
||||
//初始化表单
|
||||
this.initTableData()
|
||||
},
|
||||
//查询条件下啦接口
|
||||
async plugSelectInit() {
|
||||
const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
|
||||
appId: this.appId
|
||||
})
|
||||
if (res.status === '200') {
|
||||
this.pluginDist = {}
|
||||
res.attribute.forEach(item => {
|
||||
item.label = item.pluginName
|
||||
this.$set(this.pluginDist, item.id, item.label)
|
||||
})
|
||||
this.SearchformRow[1].elCol[0].options = res.attribute
|
||||
console.log(this.SearchformRow[1].elCol[0], 'this.SearchformRow[1].elCol[0]')
|
||||
}
|
||||
console.log(res, '拿到插件列表')
|
||||
},
|
||||
// 页面
|
||||
currentChangeHandle(pageModel) {
|
||||
this.pageModel = pageModel;
|
||||
this.pageModel = pageModel
|
||||
this.$nextTick(() => {
|
||||
this.initTableData({ ...this.searchForm });
|
||||
});
|
||||
this.initTableData({ ...this.searchForm })
|
||||
})
|
||||
},
|
||||
// 表格按钮
|
||||
tableButtonHandle(val, item) {
|
||||
if (item.type === "view") {
|
||||
if (item.type === 'view') {
|
||||
this.$router.push({
|
||||
name: "taskAdd",
|
||||
query: { id: val.id, lookFlag: true },
|
||||
});
|
||||
} else if (item.type === "dele") {
|
||||
console.log(111);
|
||||
this.$confirm("确认删除?")
|
||||
.then(async () => {
|
||||
name: 'taskAdd',
|
||||
query: { id: val.id, lookFlag: true }
|
||||
})
|
||||
} else if (item.type === 'dele') {
|
||||
console.log(111)
|
||||
this.$confirm('确认删除?')
|
||||
.then(async() => {
|
||||
const res = await getUserModuleApi(
|
||||
{
|
||||
tl: "integrationTaskService",
|
||||
as: "integrationTask",
|
||||
dj: "updateIntegrationTaskSts",
|
||||
tl: 'integrationTaskService',
|
||||
as: 'integrationTask',
|
||||
dj: 'updateIntegrationTaskSts'
|
||||
},
|
||||
{
|
||||
id: val.id, //任务id
|
||||
id: val.id //任务id
|
||||
}
|
||||
);
|
||||
)
|
||||
if (res.status == 200) {
|
||||
if (
|
||||
this.pageModel.total - 1 + this.pageModel.limit <=
|
||||
this.pageModel.pageIndex * this.pageModel.limit
|
||||
) {
|
||||
this.pageModel.pageIndex--;
|
||||
this.pageModel.pageIndex--
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.initTableData({ ...this.searchForm });
|
||||
});
|
||||
this.initTableData({ ...this.searchForm })
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
} else if (item.type === "edit") {
|
||||
this.$router.push({ name: "taskAdd", query: { id: val.id } });
|
||||
console.log(err)
|
||||
})
|
||||
} else if (item.type === 'edit') {
|
||||
this.$router.push({ name: 'taskAdd', query: { id: val.id } })
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
BaseMenuTree,
|
||||
BaseNewForm,
|
||||
BaseTable,
|
||||
basePage,
|
||||
baseRightDialog,
|
||||
},
|
||||
computed: {
|
||||
// 操作框的宽度
|
||||
funWidth() {
|
||||
return this.funData.length * 70;
|
||||
},
|
||||
baseRightDialog
|
||||
},
|
||||
mounted() {
|
||||
// this.$refs.menuTree.clickFirst();
|
||||
this.initTableData();
|
||||
this.initTreeData();
|
||||
// this.initTableData()
|
||||
this.initTreeData()
|
||||
},
|
||||
computed: {
|
||||
// 操作框的宽度
|
||||
funWidth() {
|
||||
return this.funData.length * 70;
|
||||
},
|
||||
},
|
||||
};
|
||||
return this.funData.length * 70
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
@ -434,36 +492,45 @@ export default {
|
|||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
> .text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
> .input {
|
||||
flex: 5;
|
||||
}
|
||||
}
|
||||
|
||||
.wraaap {
|
||||
display: flex;
|
||||
|
||||
.right {
|
||||
width: 85%;
|
||||
margin-left: 20px;
|
||||
border-radius: 20px !important;
|
||||
}
|
||||
|
||||
.left {
|
||||
border-radius: 20px;
|
||||
width: 15%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
main {
|
||||
margin-top: 20px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
header {
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue