集成任务部署开发完成(curd)

This commit is contained in:
hyt 2024-05-08 08:56:31 +08:00
parent 97e527fc0b
commit 4f26dec9a4
3 changed files with 770 additions and 736 deletions

View File

@ -375,7 +375,6 @@ export default {
},
//
handleNodeClick(data,b,c) {
console.log(data,b,c)
this.$emit("handleNodeClick", data);
},
},

View File

@ -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