middleground_code_v2/src/views/intergrationTask/taskAdd.vue

966 lines
22 KiB
Vue
Raw Normal View History

2024-03-26 11:18:19 +08:00
<template>
<div class="taskAdd">
<header>
<div class="top">
<div class="left"></div>
<div class="right"></div>
</div>
<div class="addbox">
<baseNewForm
ref="mainForm"
:spanNumber="24"
:formRow="formRow"
:ruleForm="ruleForm"
:isFunBtn="false"
:lookFlag="lookFlag"
:formRule="!lookFlag"
@onSubmit="onSubmitHandle"
@onChangeRadio="onChangeRadioHandle"
2024-05-08 08:56:31 +08:00
@onSelect="selectChangeHandle"
2024-03-26 11:18:19 +08:00
></baseNewForm>
</div>
</header>
<main>
<div>
2024-05-08 08:56:31 +08:00
<!-- <div class="title">-->
<!-- <h1>执行策略</h1>-->
<!-- </div>-->
<!-- <baseNewForm-->
<!-- :spanNumber="24"-->
<!-- :formRow="mainFormRow"-->
<!-- :ruleForm="mainRuleForm"-->
<!-- :isFunBtn="false"-->
<!-- :lookFlag="lookFlag"-->
<!-- ></baseNewForm>-->
<template v-if="true">
2024-03-26 11:18:19 +08:00
<div class="timeEdit">
<div class="title">
<h1>编辑发生时间</h1>
</div>
<div class="timepick">
<div class="Timebox">
crontab完整表达式{{
2024-05-08 08:56:31 +08:00
ruleForm.taskCron ? ruleForm.taskCron : '无'
2024-03-26 11:18:19 +08:00
}}
</div>
<el-button round @click="showDialog" :disabled="lookFlag"
>点击设置时间
</el-button
>
</div>
</div>
</template>
</div>
</main>
<footer>
<div class="btn">
<el-button
type="primary"
@click="commitForm"
:loading="commitLoading"
v-if="!lookFlag"
>提交
</el-button
>
<el-button @click="$router.back()">取消</el-button>
</div>
</footer>
<el-dialog title="生成 cron" :visible.sync="showCron" width="70%">
<FishCrontab
class="crontab"
@hide="showCron = false"
@fill="crontabFill"
:expression="expression"
:fiveTimes="true"
></FishCrontab>
</el-dialog>
</div>
</template>
<script>
2024-05-08 08:56:31 +08:00
import FishCrontab from 'fish-crontab'
import BaseLink from './compoments/baseLink/index.vue'
import BaseNewForm from './compoments/baseNewForm'
import baseTableForm from './compoments/baseTableForm_v2.vue'
import { getApiModuleApi } from '@/api/apiChunks/index.js'
import { authApi } from '@/api/apis/auth'
2024-03-26 11:18:19 +08:00
export default {
data() {
return {
commitLoading: false,
2024-05-08 08:56:31 +08:00
timeCron: '',
expression: '',
2024-03-26 11:18:19 +08:00
showCron: false,
lookFlag: false,
2024-05-08 08:56:31 +08:00
activeIndex: '1',
2024-03-26 11:18:19 +08:00
ruleForm: {
2024-05-08 08:56:31 +08:00
plug: '1',
taskCron: ''
2024-03-26 11:18:19 +08:00
},
formRow: [
{
elCol: [
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '任务编码',
id: 'taskCode',
2024-03-26 11:18:19 +08:00
row: 8,
2024-05-08 08:56:31 +08:00
disabled: true
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '任务名称',
id: 'taskName',
2024-03-26 11:18:19 +08:00
row: 8,
2024-05-08 08:56:31 +08:00
required: true
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '任务策略',
id: 'taskCron',
2024-03-26 11:18:19 +08:00
row: 8,
2024-05-08 08:56:31 +08:00
disabled: true,
placeholder: '请选择时间策略'
}
]
2024-03-26 11:18:19 +08:00
},
{
elCol: [
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '任务状态',
id: 'taskStatus',
2024-03-26 11:18:19 +08:00
row: 8,
required: true,
options: [
2024-05-08 08:56:31 +08:00
{ id: '1', label: '启用' },
{ id: '2', label: '停用' }
]
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
refName: 'plugId',
type: 'select',
disabled: false,
title: '应用列表',
id: 'taskApp',
2024-03-26 11:18:19 +08:00
required: true,
2024-05-08 08:56:31 +08:00
row: 8,
show: true,
2024-03-26 11:18:19 +08:00
options: [],
2024-05-08 08:56:31 +08:00
apiBody: {
pluginType: '1'
2024-03-26 11:18:19 +08:00
},
2024-05-08 08:56:31 +08:00
searchKey: 'pluginId',
2024-03-26 11:18:19 +08:00
prop: {
2024-05-08 08:56:31 +08:00
label: 'pluginLabel',
id: 'pluginId'
}
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
refName: 'plugId',
type: 'select',
disabled: false,
title: '插件列表',
id: 'taskPlugin',
2024-03-26 11:18:19 +08:00
required: true,
2024-05-08 08:56:31 +08:00
row: 8,
show: true,
options: [],
apiBody: {
pluginType: '1'
},
searchKey: 'pluginId',
prop: {
label: 'pluginLabel',
id: 'pluginId'
}
}
]
2024-03-26 11:18:19 +08:00
},
{
elCol: [
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '任务描述',
id: 'funInfo',
row: 12,
required: true
}
]
2024-03-26 11:18:19 +08:00
},
{
elCol: [
{
2024-05-08 08:56:31 +08:00
type: 'textrea',
title: '备注',
id: 'remark',
row: 24
}
]
}
2024-03-26 11:18:19 +08:00
],
funData: [
{
2024-05-08 08:56:31 +08:00
type: 'addattr',
text: '添加属性',
color: 'blue'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'dele',
text: '删除',
color: 'blue'
}
2024-03-26 11:18:19 +08:00
],
mainFormRow: [
{
elCol: [
{
2024-05-08 08:56:31 +08:00
type: 'radio',
title: '',
id: 'now_execution',
2024-03-26 11:18:19 +08:00
row: 8,
options: [
2024-05-08 08:56:31 +08:00
{ label: '立即执行', id: 'Y' },
{ label: '定时', id: 'N' }
]
}
]
}
2024-03-26 11:18:19 +08:00
],
mainRuleForm: {
2024-05-08 08:56:31 +08:00
now_execution: 'N'
2024-03-26 11:18:19 +08:00
},
tableInfo: [
{
2024-05-08 08:56:31 +08:00
id: 'requestHeader',
2024-03-26 11:18:19 +08:00
tableData: [
{
id: 3,
2024-05-08 08:56:31 +08:00
parameterName: '1',
children: [{ id: 4 }]
}
2024-03-26 11:18:19 +08:00
],
detailFields: [
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '参数名称',
id: 'parameterName',
width: 250
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '参数类型',
id: 'parameterType'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '具体类型',
id: 'concreteType'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'switch',
title: '必选',
id: 'required',
width: 80
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'number',
title: '长度',
id: 'length',
width: 100
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '示例',
id: 'example'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '描述',
id: 'description'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'number',
title: '文档顺序',
id: 'sorts',
width: 100
}
]
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
id: 'requestHeader',
2024-03-26 11:18:19 +08:00
tableData: [
{
id: 3,
2024-05-08 08:56:31 +08:00
parameterName: '2',
children: [{ id: 4 }]
}
2024-03-26 11:18:19 +08:00
],
detailFields: [
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '参数名称',
id: 'parameterName',
width: 250
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '参数类型',
id: 'parameterType'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '具体类型',
id: 'concreteType'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'switch',
title: '必选',
id: 'required',
width: 80
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'number',
title: '长度',
id: 'length',
width: 100
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '示例',
id: 'example'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '描述',
id: 'description'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'number',
title: '文档顺序',
id: 'sorts',
width: 100
}
]
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
id: 'requestHeader',
2024-03-26 11:18:19 +08:00
tableData: [
{
id: 3,
2024-05-08 08:56:31 +08:00
parameterName: '3',
children: [{ id: 4 }]
}
2024-03-26 11:18:19 +08:00
],
detailFields: [
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '参数名称',
id: 'parameterName',
width: 250
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '参数类型',
id: 'parameterType'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '具体类型',
id: 'concreteType'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'switch',
title: '必选',
id: 'required',
width: 80
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'number',
title: '长度',
id: 'length',
width: 100
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '示例',
id: 'example'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '描述',
id: 'description'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'number',
title: '文档顺序',
id: 'sorts',
width: 100
}
]
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
id: 'requestHeader',
2024-03-26 11:18:19 +08:00
tableData: [
{
id: 3,
2024-05-08 08:56:31 +08:00
parameterName: '4',
children: [{ id: 4 }]
}
2024-03-26 11:18:19 +08:00
],
detailFields: [
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '参数名称',
id: 'parameterName',
width: 250
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '参数类型',
id: 'parameterType'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'select',
title: '具体类型',
id: 'concreteType'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'switch',
title: '必选',
id: 'required',
width: 80
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'number',
title: '长度',
id: 'length',
width: 100
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '示例',
id: 'example'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'input',
title: '描述',
id: 'description'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
type: 'number',
title: '文档顺序',
id: 'sorts',
width: 100
}
]
}
2024-03-26 11:18:19 +08:00
],
parameterTypeOptions: [
{
2024-05-08 08:56:31 +08:00
label: '基本类型',
id: 'fundamental'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: '复杂类型',
id: 'complex'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: '基本列表',
id: 'fundamentallist'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: '复杂列表',
id: 'complexlist'
}
2024-03-26 11:18:19 +08:00
],
concreteTypeOptions: {
fundamental: [
{
2024-05-08 08:56:31 +08:00
label: 'String',
id: 'String'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Int',
id: 'Int'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Long',
id: 'Long'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Float',
id: 'Float'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Double',
id: 'Double'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Boolean',
id: 'Boolean'
}
2024-03-26 11:18:19 +08:00
],
complex: [
{
2024-05-08 08:56:31 +08:00
label: 'Object',
id: 'Object'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Map',
id: 'Map'
}
2024-03-26 11:18:19 +08:00
],
fundamentallist: [
{
2024-05-08 08:56:31 +08:00
label: 'String',
id: 'String'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Int',
id: 'Int'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Long',
id: 'Long'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Float',
id: 'Float'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Double',
id: 'Double'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Boolean',
id: 'Boolean'
}
2024-03-26 11:18:19 +08:00
],
complexlist: [
{
2024-05-08 08:56:31 +08:00
label: 'Object',
id: 'ObjectCom'
}
2024-03-26 11:18:19 +08:00
],
authport: [
{
2024-05-08 08:56:31 +08:00
label: 'String',
id: 'String'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Int',
id: 'Int'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Long',
id: 'Long'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Float',
id: 'Float'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Double',
id: 'Double'
2024-03-26 11:18:19 +08:00
},
{
2024-05-08 08:56:31 +08:00
label: 'Boolean',
id: 'Boolean'
}
]
2024-03-26 11:18:19 +08:00
},
timeForm: {
timeNum: 1,
timeunit: 1,
happenMethod: 1,
2024-05-08 08:56:31 +08:00
timeOnceData: '01-00-00',
2024-03-26 11:18:19 +08:00
periodNum: 1,
periotimeunit: 1,
2024-05-08 08:56:31 +08:00
timeperiod: ['01-00-00', '02-00-00'],
2024-03-26 11:18:19 +08:00
perpetual: true,
2024-05-08 08:56:31 +08:00
takeDate: ['2023-07-06-00-00-00', '2023-08-04-00-00-00']
2024-03-26 11:18:19 +08:00
},
itemunitOptions: [
{
id: 1,
2024-05-08 08:56:31 +08:00
label: '天'
2024-03-26 11:18:19 +08:00
},
{
id: 2,
2024-05-08 08:56:31 +08:00
label: '时'
}
]
}
2024-03-26 11:18:19 +08:00
},
methods: {
2024-05-08 08:56:31 +08:00
// 应用列表下啦改变方法
async selectChangeHandle(val, index, indexRow, row) {
if (row.title === '应用列表') {
this.formRow[1].elCol[2].options = []
this.$set(this.ruleForm, 'taskPlugin', '')
if (val) {
const res = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
appId: val
})
if (res.status === '200') {
res.attribute.forEach((item) => {
this.formRow[1].elCol[2].options.push({
id: item.id,
label: item.pluginName
})
})
2024-03-26 11:18:19 +08:00
}
2024-05-08 08:56:31 +08:00
console.log(res, '123')
2024-03-26 11:18:19 +08:00
}
}
2024-05-08 08:56:31 +08:00
console.log(val, row)
2024-03-26 11:18:19 +08:00
},
// 初始化标识select
async initSelectScene() {
const res = await getApiModuleApi({
2024-05-08 08:56:31 +08:00
tl: 'apiReflectionService',
as: 'sys_api_reflectionService',
dj: 'queryPagedJson'
})
2024-03-26 11:18:19 +08:00
},
2024-05-08 08:56:31 +08:00
// 应用列表初始化
2024-03-26 11:18:19 +08:00
async initSelectPlug() {
const res = await getApiModuleApi(
{
2024-05-08 08:56:31 +08:00
tl: 'sysApplicationService',
as: '',
dj: 'queryEntity'
2024-03-26 11:18:19 +08:00
},
2024-05-08 08:56:31 +08:00
{}
)
2024-03-26 11:18:19 +08:00
if (res.status == 200) {
res.attribute.forEach((item) => {
2024-05-08 08:56:31 +08:00
this.formRow[1].elCol[1].options.push({
id: item.id,
label: item.name
})
})
2024-03-26 11:18:19 +08:00
}
},
// 点击radio
onChangeRadioHandle(val, index, indexRow, row) {
2024-05-08 08:56:31 +08:00
console.log(val, index, indexRow, row)
if (row.id == 'plug') {
2024-03-26 11:18:19 +08:00
if (val == 2) {
if (this.ruleForm.plug_id) {
2024-05-08 08:56:31 +08:00
this.ruleForm.plug_id = ''
2024-03-26 11:18:19 +08:00
}
}
2024-05-08 08:56:31 +08:00
this.formRow[4].elCol[1].show = val == 1
2024-03-26 11:18:19 +08:00
}
},
// 查看任务
async searchTaskHandle(id) {
const res = await getApiModuleApi(
{
2024-05-08 08:56:31 +08:00
tl: 'integrationTaskService',
as: '',
dj: 'getEntity'
2024-03-26 11:18:19 +08:00
},
{
id: this.$route.query.id
}
2024-05-08 08:56:31 +08:00
)
2024-03-26 11:18:19 +08:00
if (res.status == 200) {
2024-05-08 08:56:31 +08:00
this.ruleForm = res.attribute
const res2 = await authApi('sysApplicationPluginService', '', 'queryEntity', '', {
appId: res.attribute.taskApp
})
if (res2.status === '200') {
res2.attribute.forEach((item) => {
this.formRow[1].elCol[2].options.push({
id: item.id,
label: item.pluginName
})
})
}
2024-03-26 11:18:19 +08:00
}
},
// 点击提交
commitForm() {
2024-05-08 08:56:31 +08:00
this.$refs.mainForm.submitForm()
2024-03-26 11:18:19 +08:00
},
// 时间插件
showDialog() {
2024-05-08 08:56:31 +08:00
this.expression = this.ruleForm.taskCron //传入的 cron 表达式,可以反解析到 UI 上
this.showCron = true
2024-03-26 11:18:19 +08:00
this.$nextTick(() => {
document
2024-05-08 08:56:31 +08:00
.querySelector('.crontab tbody')
.setAttribute('style', 'vertical-align:none !important;')
})
2024-03-26 11:18:19 +08:00
},
// 时间插件回调
crontabFill(value) {
//确定后回传的值
2024-05-08 08:56:31 +08:00
this.ruleForm.taskCron = value
2024-03-26 11:18:19 +08:00
},
handleChange() {
},
// 表单验证成功后
async onSubmitHandle() {
2024-05-08 08:56:31 +08:00
this.commitLoading = true
let obj = { ...this.ruleForm }
2024-03-26 11:18:19 +08:00
if (!this.$route.query.id) {
const res = await getApiModuleApi(
{
2024-05-08 08:56:31 +08:00
tl: 'integrationTaskService',
as: '',
dj: 'saveEntity'
2024-03-26 11:18:19 +08:00
},
obj
2024-05-08 08:56:31 +08:00
)
this.commitLoading = false
2024-03-26 11:18:19 +08:00
if (res.status == 200) {
this.$message({
2024-05-08 08:56:31 +08:00
type: 'success',
message: '保存成功!'
})
this.$router.back()
//面包屑删除
2024-05-08 08:56:31 +08:00
this.$store.dispatch('tagsView/delView', this.$route)
2024-03-26 11:18:19 +08:00
}
} else {
2024-05-08 08:56:31 +08:00
obj['id'] = this.$route.query.id
2024-03-26 11:18:19 +08:00
const res = await getApiModuleApi(
{
2024-05-08 08:56:31 +08:00
tl: 'integrationTaskService',
as: '',
dj: 'updateEntity'
2024-03-26 11:18:19 +08:00
},
obj
2024-05-08 08:56:31 +08:00
)
this.commitLoading = false
2024-03-26 11:18:19 +08:00
if (res.status == 200) {
this.$message({
2024-05-08 08:56:31 +08:00
type: 'success',
message: '修改成功!'
})
this.$router.back()
2024-03-26 11:18:19 +08:00
}
}
},
// 添加行
addTableData(tabledata) {
2024-05-08 08:56:31 +08:00
tabledata.push({ id: Date.now() })
2024-03-26 11:18:19 +08:00
},
handleSelect(key, keyPath) {
2024-05-08 08:56:31 +08:00
this.activeIndex = key
2024-03-26 11:18:19 +08:00
},
tableButtonHandle() {
},
// 暂无用
idWatch(arr, id) {
arr.some((item, index) => {
if (item.id === id) {
2024-05-08 08:56:31 +08:00
arr.splice(index, 1)
return true
2024-03-26 11:18:19 +08:00
} else if (item.children && item.children.length) {
2024-05-08 08:56:31 +08:00
this.idWatch(item.children, id)
2024-03-26 11:18:19 +08:00
} else {
2024-05-08 08:56:31 +08:00
return false
2024-03-26 11:18:19 +08:00
}
2024-05-08 08:56:31 +08:00
})
2024-03-26 11:18:19 +08:00
},
// 父下拉框改变处理(暂无用
fatherSelectChangeHandle(row) {
if (row[0].concreteType) {
2024-05-08 08:56:31 +08:00
row[0].concreteType = ''
2024-03-26 11:18:19 +08:00
if (row[0] && row[0].children) {
2024-05-08 08:56:31 +08:00
this.$delete(row[0], 'children')
2024-03-26 11:18:19 +08:00
}
}
},
// 子下拉框改变处理(暂无用
sonSelectChangeHandle(val, row) {
2024-05-08 08:56:31 +08:00
console.log(val, row)
2024-03-26 11:18:19 +08:00
if (
2024-05-08 08:56:31 +08:00
val != 'Object' &&
val != 'ObjectCom' &&
val != 'Map' &&
2024-03-26 11:18:19 +08:00
row[0].children
) {
2024-05-08 08:56:31 +08:00
this.$delete(row[0], 'children')
2024-03-26 11:18:19 +08:00
}
},
// 表单操作按钮
tableButtonHandle(row, item, data) {
2024-05-08 08:56:31 +08:00
if (item.type === 'dele') {
this.$confirm('确认删除?')
2024-03-26 11:18:19 +08:00
.then(() => {
2024-05-08 08:56:31 +08:00
this.idWatch(data, row.id)
2024-03-26 11:18:19 +08:00
})
.catch(() => {
2024-05-08 08:56:31 +08:00
})
} else if (item.type === 'addattr') {
2024-03-26 11:18:19 +08:00
console.log(
row.concreteType,
2024-05-08 08:56:31 +08:00
row.concreteType != 'Object',
row.concreteType != 'Map'
)
2024-03-26 11:18:19 +08:00
if (
row.concreteType &&
2024-05-08 08:56:31 +08:00
row.concreteType != 'Object' &&
row.concreteType != 'Map' &&
row.concreteType != 'ObjectCom'
2024-03-26 11:18:19 +08:00
) {
this.$notify({
2024-05-08 08:56:31 +08:00
title: '添加失败',
message: '具体类型为Object或Map时才能生成子集!',
type: 'error'
})
return
2024-03-26 11:18:19 +08:00
} else if (!row.children) {
2024-05-08 08:56:31 +08:00
this.$set(row, 'children', [])
row.children.push({ id: Date.now() })
2024-03-26 11:18:19 +08:00
} else {
2024-05-08 08:56:31 +08:00
row.children.push({ id: Date.now() })
2024-03-26 11:18:19 +08:00
}
this.$notify({
2024-05-08 08:56:31 +08:00
title: '添加成功',
message: '添加成功!',
type: 'success'
})
2024-03-26 11:18:19 +08:00
}
2024-05-08 08:56:31 +08:00
}
2024-03-26 11:18:19 +08:00
},
computed: {
funWidth() {
2024-05-08 08:56:31 +08:00
return this.funData.length * 70
}
2024-03-26 11:18:19 +08:00
},
components: {
BaseNewForm,
baseTableForm,
BaseLink,
2024-05-08 08:56:31 +08:00
FishCrontab
2024-03-26 11:18:19 +08:00
},
mounted() {
2024-05-08 08:56:31 +08:00
this.initSelectPlug()
2024-03-26 11:18:19 +08:00
if (this.$route.query.id) {
2024-05-08 08:56:31 +08:00
this.searchTaskHandle(this.$route.query.id)
2024-03-26 11:18:19 +08:00
}
if (this.$route.query.lookFlag) {
2024-05-08 08:56:31 +08:00
this.lookFlag = true
2024-03-26 11:18:19 +08:00
}
2024-05-08 08:56:31 +08:00
}
}
2024-03-26 11:18:19 +08:00
</script>
2024-05-08 08:56:31 +08:00
<style scope lang="scss">
2024-03-26 11:18:19 +08:00
::v-deep .el-table__header-wrapper {
border-radius: 15px !important;
background: #f7f7f7 !important;
}
.test {
vertical-align: inherit !important;
}
.crontab > > > tbody {
vertical-align: inherit !important;
}
.crontab > > > span {
vertical-align: inherit !important;
}
.crontab > > > td {
vertical-align: inherit !important;
}
.taskAdd {
width: 100%;
.addbox {
background-color: #fff;
padding: 20px 0;
border-radius: 18px;
}
header {
.top {
background-color: #fff;
display: flex;
justify-content: space-between;
.right {
padding: 20px;
}
}
}
main {
margin-top: 20px;
border-radius: 20px;
padding: 30px;
width: 100%;
background-color: #fff;
.title {
margin-bottom: 20px;
}
.timeEdit {
margin-top: 20px;
.timepick {
display: flex;
align-items: center;
.Timebox {
margin-right: 20px;
}
}
}
}
footer {
margin-top: 20px;
border-radius: 20px;
padding: 30px;
width: 100%;
background-color: #fff;
}
.add {
margin-top: 30px;
border: 1px dotted #ccc;
text-align: center;
height: 50px;
line-height: 50px;
}
.link {
width: 100%;
margin-top: 20px;
}
.timeEdit {
> .top {
.box {
display: flex;
height: 50px;
align-items: center;
.left {
width: 150px;
}
.right {
margin-left: 20px;
}
}
}
}
}
</style>