集成任务部署开发完成(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) { handleNodeClick(data,b,c) {
console.log(data,b,c)
this.$emit("handleNodeClick", data); this.$emit("handleNodeClick", data);
}, },
}, },

View File

@ -5,8 +5,8 @@
:menuData="treeData" :menuData="treeData"
:filterShow="true" :filterShow="true"
:Allshow="false" :Allshow="false"
:treeButton="true" :treeButton="false"
:filterButtonShow="true" :filterButtonShow="false"
style="height: 100%" style="height: 100%"
:treeProps="treeProps" :treeProps="treeProps"
@handleNodeClick="homeHandleNodeClick" @handleNodeClick="homeHandleNodeClick"
@ -49,9 +49,16 @@
:showIndex="true" :showIndex="true"
:tabLoading="mainTabLoading" :tabLoading="mainTabLoading"
@onFunc="tableButtonHandle" @onFunc="tableButtonHandle"
:tableHeight="'60vh'" :tableHeight="'53vh'"
:border="false" :border="false"
></BaseTable> >
<template #taskStatus="{row}">
{{ row.taskStatus == 1 ? '启用' : '停用' }}
</template>
<template #taskPlugin="{row}">
{{ pluginDist[row.taskPlugin] }}
</template>
</BaseTable>
</div> </div>
</main> </main>
<footer> <footer>
@ -91,12 +98,14 @@
</template> </template>
<script> <script>
import basePage from "./compoments/basePage.vue"; import basePage from './compoments/basePage.vue'
import BaseMenuTree from "./compoments/baseMenuTree"; import BaseMenuTree from './compoments/baseMenuTree'
import BaseNewForm from "./compoments/baseNewForm"; import BaseNewForm from './compoments/baseNewForm'
import BaseTable from "./compoments/baseTable"; import BaseTable from './compoments/baseTable'
import { getUserModuleApi } from "@/api/integrationOption/integrationOption.js"; import { getUserModuleApi } from '@/api/integrationOption/integrationOption.js'
import baseRightDialog from "@/components/base/baseRightDialog"; import baseRightDialog from '@/components/base/baseRightDialog'
import { authApi } from '@/api/apis/auth'
export default { export default {
data() { data() {
return { return {
@ -107,141 +116,167 @@ export default {
// //
pageIndex: 1, pageIndex: 1,
total: 10, total: 10,
limit: 10, limit: 10
}, },
mainTabLoading: false, //loding mainTabLoading: false, //loding
treeData: [ treeData: [
// //
{ {
label: "测试", label: '测试',
id: 1, id: 1,
children: [ children: [
{ {
id: 3, id: 3,
label: "哈哈", label: '哈哈'
}, }
]
}
], ],
}, treeForm: { class_name: '', class_superiors: '', class_code: '' },
],
treeForm: { class_name: "", class_superiors: "", class_code: "" },
searchForm: {}, // searchForm: {}, //
SearchformRow: [ SearchformRow: [
// //
{ {
elCol: [ elCol: [
{ {
type: "input", type: 'input',
title: "任务编码", title: '任务编码',
id: "task_code", id: 'taskCode',
row: 8, row: 8
}, },
{ {
type: "input", type: 'input',
title: "任务名称", title: '任务名称',
id: "task_name", id: 'taskName',
row: 8
},
{
type: 'radio',
title: '任务状态',
id: 'taskStatus',
row: 8, row: 8,
options: [
{
label: '启用',
id: '1'
}, },
], {
}, label: '停用',
id: '2'
}
]
}
]
}
,
{
elCol: [
{
type: 'select',
title: '插件',
id: 'taskPlugin',
row: 8,
options: []
}
]
}
], ],
funData: [ funData: [
//table //table
{ {
type: "edit", type: 'edit',
text: "编辑", text: '编辑',
color: "#5a9cf8", color: '#5a9cf8'
}, },
{ {
type: "view", type: 'view',
text: "查看", text: '查看',
color: "#5a9cf8", color: '#5a9cf8'
}, },
{ {
type: "dele", type: 'dele',
text: "删除", text: '删除',
color: "#e47470", color: '#e47470'
}, }
], ],
tableData: [{ taskCode: "测试", taskName: "123" }], //table tableData: [], //table
tableColumn: [ tableColumn: [
// //
{ {
id: "task_code", id: 'taskName',
title: "任务编码", title: '任务名称'
}, },
{ {
id: "task_name", id: 'taskCode',
title: "任务名称", title: '任务编码'
}, },
{ {
id: "task_classes", id: 'taskStatus',
title: "任务分类", title: '任务状态'
}, },
{ {
id: "task_cron", id: 'taskPlugin',
title: "任务策略", title: '插件'
}, },
{ {
id: "fun_info", id: 'taskCron',
title: "功能介绍", title: '任务策略'
}, }
{
id: "remark",
title: "备注",
},
], ],
treeProps: { treeProps: {
children: "childClassifications", children: 'childClassifications',
label: "class_name", label: 'name'
}, },
treeTitle: "", treeTitle: '',
treeRuleForm: {}, treeRuleForm: {},
treeAddFlag: false, treeAddFlag: false,
}; appId: '',//id
pluginDist: {}//
}
}, },
methods: { methods: {
// dialog // dialog
async handleConfirmClick() { async handleConfirmClick() {
if (!this.treeRuleForm.class_name) { if (!this.treeRuleForm.class_name) {
this.$message({ this.$message({
type: "error", type: 'error',
message: "请输入树名称", message: '请输入树名称'
}); })
return; return
} }
if (this.treeAddFlag) { if (this.treeAddFlag) {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskClassificationService", tl: 'integrationTaskClassificationService',
as: "integrationTaskClassification", as: 'integrationTaskClassification',
dj: "saveTaskClassification", dj: 'saveTaskClassification'
}, },
this.treeRuleForm this.treeRuleForm
); )
if (res.status == 200) { if (res.status == 200) {
this.$message({ this.$message({
type: "success", type: 'success',
message: "保存成功", message: '保存成功'
}); })
this.rightDialogSwitch = false; this.rightDialogSwitch = false
this.initTreeData(); this.initTreeData()
} }
} else { } else {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskClassificationService", tl: 'integrationTaskClassificationService',
as: "integrationTaskClassification", as: 'integrationTaskClassification',
dj: "updateTaskClassification", dj: 'updateTaskClassification'
}, },
this.treeRuleForm this.treeRuleForm
); )
if (res.status == 200) { if (res.status == 200) {
this.$message({ this.$message({
type: "success", type: 'success',
message: "保存成功", message: '保存成功'
}); })
this.rightDialogSwitch = false; this.rightDialogSwitch = false
this.initTreeData(); this.initTreeData()
} }
} }
}, },
@ -249,184 +284,207 @@ export default {
async initTreeData() { async initTreeData() {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskClassificationService", tl: 'sysApplicationService',
as: "integrationTaskClassification", as: '',
dj: "queryTaskClassification", dj: 'queryEntity'
}, },
{} {}
); )
if (res.status == 200) { 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) { treeAppendHandle(data) {
this.treeRuleForm = {}; this.treeRuleForm = {}
this.treeTitle = "子节点增加"; this.treeTitle = '子节点增加'
this.treeAddFlag = true; this.treeAddFlag = true
this.$set(this.treeRuleForm, "class_superiors_name", data.class_name); this.$set(this.treeRuleForm, 'class_superiors_name', data.class_name)
this.$set(this.treeRuleForm, "class_superiors", data.id); this.$set(this.treeRuleForm, 'class_superiors', data.id)
this.$set(this.treeRuleForm, "class_code", data.class_code); this.$set(this.treeRuleForm, 'class_code', data.class_code)
this.$set(this.treeRuleForm, "lvl", String(data.lvl * 1 + 1)); this.$set(this.treeRuleForm, 'lvl', String(data.lvl * 1 + 1))
this.rightDialogSwitch = true; this.rightDialogSwitch = true
}, },
treeReviseHandle(data) { treeReviseHandle(data) {
this.treeRuleForm = {}; this.treeRuleForm = {}
this.treeAddFlag = false; this.treeAddFlag = false
this.rightDialogSwitch = true; this.rightDialogSwitch = true
this.$set(this.treeRuleForm, "id", data.id); this.$set(this.treeRuleForm, 'id', data.id)
this.$set(this.treeRuleForm, "class_code", data.class_code); this.$set(this.treeRuleForm, 'class_code', data.class_code)
this.$set(this.treeRuleForm, "class_name", data.class_name); this.$set(this.treeRuleForm, 'class_name', data.class_name)
this.$set(this.treeRuleForm, "lvl", String(data.lvl)); this.$set(this.treeRuleForm, 'lvl', String(data.lvl))
this.treeTitle = "子节点编辑"; this.treeTitle = '子节点编辑'
}, },
treeRemoveHandle(data) { treeRemoveHandle(data) {
this.$confirm("确认删除?") this.$confirm('确认删除?')
.then(async() => { .then(async() => {
console.log(1); console.log(1)
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskClassificationService", tl: 'integrationTaskClassificationService',
as: "integrationTaskClassification", as: 'integrationTaskClassification',
dj: "updateTaskClassificationSts", dj: 'updateTaskClassificationSts'
}, },
{ {
id: data.id, //id id: data.id //id
} }
); )
console.log(res); console.log(res)
if (res.status == 200) { if (res.status == 200) {
this.$nextTick(() => { this.$nextTick(() => {
this.initTreeData(); this.initTreeData()
}); })
} }
}) })
.catch(() => {}); .catch(() => {
})
}, },
// //
treeAddHandle() { treeAddHandle() {
this.treeRuleForm = {}; this.treeRuleForm = {}
this.treeAddFlag = true; this.treeAddFlag = true
this.rightDialogSwitch = true; this.rightDialogSwitch = true
this.treeTitle = "根节点增加"; this.treeTitle = '根节点增加'
this.$set(this.treeRuleForm, "class_code", new Date().getTime()); this.$set(this.treeRuleForm, 'class_code', new Date().getTime())
this.$set(this.treeRuleForm, "lvl", "0"); this.$set(this.treeRuleForm, 'lvl', '0')
}, },
// //
async initTableData(obj = {}) { async initTableData(obj = {}) {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskService", tl: 'integrationTaskService',
as: "integrationTask", as: '',
dj: "queryListJson", dj: 'queryEntityPage'
}, },
{ {
pageNum: this.pageModel.pageIndex, pageNum: this.pageModel.pageIndex,
pageSize: this.pageModel.limit, pageSize: this.pageModel.limit,
query_condition: { ...obj }, task_app: this.appId,
...obj,
} }
); )
console.log(res); console.log(res, 'tabledata')
if (res.status == 200) { if (res.status == 200) {
this.tableData = res.attribute; this.tableData = res.attribute.list
this.pageModel.total = res.attribute.total
} }
}, },
// //
searchHandle() { searchHandle() {
this.initTableData({ ...this.searchForm }); this.initTableData({ ...this.searchForm })
}, },
// //
resizeSearchHandle() { resizeSearchHandle() {
this.searchForm = {}; this.searchForm = {}
}, },
// //
newPage() { newPage() {
this.$router.push({ name: "taskAdd" }); this.$router.push({ name: 'taskAdd' })
}, },
// //
homeHandleNodeClick(data) { homeHandleNodeClick(data) {
this.pageModel.pageIndex = 1; console.log(data, 'data')
this.pageModel.total = 0; this.pageModel.pageIndex = 1
this.pageModel.limit = 10; this.pageModel.total = 0
this.searchForm = {}; this.pageModel.limit = 10
this.tableData = []; this.appId = data.id
this.lookFlag = false; this.searchForm = {}
this.newFlag = false; 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) { currentChangeHandle(pageModel) {
this.pageModel = pageModel; this.pageModel = pageModel
this.$nextTick(() => { this.$nextTick(() => {
this.initTableData({ ...this.searchForm }); this.initTableData({ ...this.searchForm })
}); })
}, },
// //
tableButtonHandle(val, item) { tableButtonHandle(val, item) {
if (item.type === "view") { if (item.type === 'view') {
this.$router.push({ this.$router.push({
name: "taskAdd", name: 'taskAdd',
query: { id: val.id, lookFlag: true }, query: { id: val.id, lookFlag: true }
}); })
} else if (item.type === "dele") { } else if (item.type === 'dele') {
console.log(111); console.log(111)
this.$confirm("确认删除?") this.$confirm('确认删除?')
.then(async() => { .then(async() => {
const res = await getUserModuleApi( const res = await getUserModuleApi(
{ {
tl: "integrationTaskService", tl: 'integrationTaskService',
as: "integrationTask", as: 'integrationTask',
dj: "updateIntegrationTaskSts", dj: 'updateIntegrationTaskSts'
}, },
{ {
id: val.id, //id id: val.id //id
} }
); )
if (res.status == 200) { if (res.status == 200) {
if ( if (
this.pageModel.total - 1 + this.pageModel.limit <= this.pageModel.total - 1 + this.pageModel.limit <=
this.pageModel.pageIndex * this.pageModel.limit this.pageModel.pageIndex * this.pageModel.limit
) { ) {
this.pageModel.pageIndex--; this.pageModel.pageIndex--
} }
this.$nextTick(() => { this.$nextTick(() => {
this.initTableData({ ...this.searchForm }); this.initTableData({ ...this.searchForm })
}); })
} }
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err)
}); })
} else if (item.type === "edit") { } else if (item.type === 'edit') {
this.$router.push({ name: "taskAdd", query: { id: val.id } }); this.$router.push({ name: 'taskAdd', query: { id: val.id } })
}
} }
},
}, },
components: { components: {
BaseMenuTree, BaseMenuTree,
BaseNewForm, BaseNewForm,
BaseTable, BaseTable,
basePage, basePage,
baseRightDialog, baseRightDialog
},
computed: {
//
funWidth() {
return this.funData.length * 70;
},
}, },
mounted() { mounted() {
// this.$refs.menuTree.clickFirst(); // this.$refs.menuTree.clickFirst();
this.initTableData(); // this.initTableData()
this.initTreeData(); this.initTreeData()
}, },
computed: { computed: {
// //
funWidth() { funWidth() {
return this.funData.length * 70; return this.funData.length * 70
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -434,36 +492,45 @@ export default {
padding: 20px; padding: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
> .text { > .text {
flex: 1; flex: 1;
} }
> .input { > .input {
flex: 5; flex: 5;
} }
} }
.wraaap { .wraaap {
display: flex; display: flex;
.right { .right {
width: 85%; width: 85%;
margin-left: 20px; margin-left: 20px;
border-radius: 20px !important; border-radius: 20px !important;
} }
.left { .left {
border-radius: 20px; border-radius: 20px;
width: 15%; width: 15%;
background-color: #fff; background-color: #fff;
} }
.btn { .btn {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
main { main {
margin-top: 20px; margin-top: 20px;
border-radius: 20px; border-radius: 20px;
} }
footer { footer {
margin-top: 15px; margin-top: 15px;
} }
header { header {
border-radius: 20px; border-radius: 20px;
} }

File diff suppressed because it is too large Load Diff