提交 d17c16d7 authored 作者: jianglw's avatar jianglw

添加定时任务和字典

上级 b22c8347
import request from '@/utils/request'
// 查询字典数据列表
export function listData(query) {
return request({
url: '/topology/dict/data/list',
method: 'get',
params: query
})
}
// 查询字典数据详细
export function getData(dictCode) {
return request({
url: '/topology/dict/data/' + dictCode,
method: 'get'
})
}
// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
return request({
url: '/topology/dict/data/type/' + dictType,
method: 'get'
})
}
// 新增字典数据
export function addData(data) {
return request({
url: '/topology/dict/data',
method: 'post',
data: data
})
}
// 修改字典数据
export function updateData(data) {
return request({
url: '/topology/dict/data',
method: 'put',
data: data
})
}
// 删除字典数据
export function delData(dictCode) {
return request({
url: '/topology/dict/data/' + dictCode,
method: 'delete'
})
}
// 导出字典数据
export function exportData(query) {
return request({
url: '/topology/dict/data/export',
method: 'get',
params: query
})
}
\ No newline at end of file
import request from '@/utils/request'
// 查询字典类型列表
export function listType(query) {
return request({
url: '/topology/dict/type/list',
method: 'get',
params: query
})
}
// 查询字典类型详细
export function getType(dictId) {
return request({
url: '/topology/dict/type/' + dictId,
method: 'get'
})
}
// 新增字典类型
export function addType(data) {
return request({
url: '/topology/dict/type',
method: 'post',
data: data
})
}
// 修改字典类型
export function updateType(data) {
return request({
url: '/topology/dict/type',
method: 'put',
data: data
})
}
// 删除字典类型
export function delType(dictId) {
return request({
url: '/topology/dict/type/' + dictId,
method: 'delete'
})
}
// 清理参数缓存
export function clearCache() {
return request({
url: '/topology/dict/type/clearCache',
method: 'delete'
})
}
// 导出字典类型
export function exportType(query) {
return request({
url: '/topology/dict/type/export',
method: 'get',
params: query
})
}
// 获取字典选择框列表
export function optionselect() {
return request({
url: '/topology/dict/type/optionselect',
method: 'get'
})
}
\ No newline at end of file
import request from '@/utils/request'
// 查询定时任务调度列表
export function listJob(query) {
return request({
url: '/topology/job/list',
method: 'get',
params: query
})
}
// 查询定时任务调度详细
export function getJob(jobId) {
return request({
url: '/topology/job/' + jobId,
method: 'get'
})
}
// 新增定时任务调度
export function addJob(data) {
return request({
url: '/topology/job',
method: 'post',
data: data
})
}
// 修改定时任务调度
export function updateJob(data) {
return request({
url: '/topology/job',
method: 'put',
data: data
})
}
// 删除定时任务调度
export function delJob(jobId) {
return request({
url: '/topology/job/' + jobId,
method: 'delete'
})
}
// 导出定时任务调度
export function exportJob(query) {
return request({
url: '/topology/job/export',
method: 'get',
params: query
})
}
// 任务状态修改
export function changeJobStatus(jobId, status) {
const data = {
jobId,
status
}
return request({
url: '/topology/job/changeStatus',
method: 'put',
data: data
})
}
// 定时任务立即执行一次
export function runJob(jobId, jobGroup) {
const data = {
jobId,
jobGroup
}
return request({
url: '/topology/job/run',
method: 'put',
data: data
})
}
\ No newline at end of file
...@@ -3,24 +3,40 @@ import App from './App.vue' ...@@ -3,24 +3,40 @@ import App from './App.vue'
import router from './router' import router from './router'
import store from './store' import store from './store'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import locale from 'element-ui/lib/locale/lang/en'
import './assets/styles/element-variables.scss' import './assets/styles/element-variables.scss'
import Antd from 'ant-design-vue'; import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css'; import 'ant-design-vue/dist/antd.css';
import { parseTime, resetForm,selectDictLabel, selectDictLabels,addDateRange } from "@/utils/ruoyi";
//topology //topology
//注册图标 //注册图标
import { registerIcons,registerSvgs } from "@/utils/topology/customgraph.js"; import { registerIcons,registerSvgs } from "@/utils/topology/customgraph.js";
// import {encryption,decrypt} from "@/utils/rsautils.js"; // import {encryption,decrypt} from "@/utils/rsautils.js";
registerIcons(); registerIcons();
registerSvgs(); registerSvgs();
import {topologyDict} from "../package/index.js" import { getDicts } from "@/api/dict/data";
let topologyDicts=topologyDict;
Vue.prototype.topologyDict=Object.assign({},topologyDicts);
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(Antd); Vue.use(Antd);
Vue.use(ElementUI, { locale }) Vue.use(ElementUI)
import Pagination from "@/components/Pagination";
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" });
}
Vue.prototype.msgError = function (msg) {
this.$message({ showClose: true, message: msg, type: "error" });
}
Vue.prototype.msgInfo = function (msg) {
this.$message.info(msg);
}
Vue.component('Pagination', Pagination)
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.getDicts = getDicts
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.addDateRange=addDateRange
new Vue({ new Vue({
router, router,
store, store,
......
...@@ -10,9 +10,9 @@ VueRouter.prototype.push = function push(location) { ...@@ -10,9 +10,9 @@ VueRouter.prototype.push = function push(location) {
} }
const routes = [ const routes = [
{ {
path: '/', path: '/topologyView/list',
name: 'Index', name: 'Index',
component: () =>import('@/views/test/Test.vue') component: () =>import('@/views/configuration/ParamsConfig.vue')
}, },
{ {
path: '/toplogyView/workspace', path: '/toplogyView/workspace',
...@@ -23,6 +23,21 @@ const routes = [ ...@@ -23,6 +23,21 @@ const routes = [
path: '/toplogyView/preview', path: '/toplogyView/preview',
name: 'Preview', name: 'Preview',
component: () =>import('@/views/topology/Preview.vue') component: () =>import('@/views/topology/Preview.vue')
},
{
path: '/toplogyView/job',
name: 'Job',
component: () =>import('@/views/job/index.vue')
},
{
path: '/toplogyView/dict/data/:dictId',
name: 'DictData',
component: () =>import('@/views/dict/data.vue')
},
{
path: '/toplogyView/dict/type',
name: 'DictType',
component: () =>import('@/views/dict/index.vue')
} }
] ]
......
/**
* 通用js方法封装处理
* Copyright (c) 2019 ruoyi
*/
const baseURL = process.env.VUE_APP_BASE_API
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
// 添加日期范围
export function addDateRange(params, dateRange, propName) {
var search = params;
search.params = {};
if (null != dateRange && '' != dateRange) {
if (typeof(propName) === "undefined") {
search.params["beginTime"] = dateRange[0];
search.params["endTime"] = dateRange[1];
} else {
search.params["begin" + propName] = dateRange[0];
search.params["end" + propName] = dateRange[1];
}
}
return search;
}
// 回显数据字典
export function selectDictLabel(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel);
return true;
}
})
return actions.join('');
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + temp[val])) {
actions.push(datas[key].dictLabel + currentSeparator);
}
})
})
return actions.join('').substring(0, actions.join('').length - 1);
}
// 通用下载方法
export function download(fileName) {
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
}
// 字符串格式化(%s )
export function sprintf(str) {
var args = arguments, flag = true, i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
if (typeof arg === 'undefined') {
flag = false;
return '';
}
return arg;
});
return flag ? str : '';
}
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
return str;
}
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
* @param {*} rootId 根Id 默认 0
*/
export function handleTree(data, id, parentId, children, rootId) {
id = id || 'id'
parentId = parentId || 'parentId'
children = children || 'children'
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
//对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
//循环所有项
const treeData = cloneData.filter(father => {
let branchArr = cloneData.filter(child => {
//返回每一项的子级数组
return father[id] === child[parentId]
});
branchArr.length > 0 ? father.children = branchArr : '';
//返回第一层
return father[parentId] === rootId;
});
return treeData != '' ? treeData : data;
}
...@@ -10,7 +10,12 @@ let tagType = [ ...@@ -10,7 +10,12 @@ let tagType = [
{ "dictLabel": "Node", "dictValue": 0 }, { "dictLabel": "Node", "dictValue": 0 },
{ "dictLabel": "Line", "dictValue": 1 }, { "dictLabel": "Line", "dictValue": 1 },
] ]
let statusOptions=[
{ "dictLabel": "正常", "dictValue": "0" },
{ "dictLabel": "暂停", "dictValue": "1" },
]
export{ export{
dataAcquisitionMode, dataAcquisitionMode,
tagType tagType,
statusOptions
} }
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<el-row :gutter="10" class="mb8"> <el-row :gutter="5" class="mb8">
<el-col :span="24"> <el-col :span="24">
<!-- v-hasPermi="['topology:index:add']" --> <!-- v-hasPermi="['topology:index:add']" -->
<el-button <el-button
...@@ -12,6 +12,22 @@ ...@@ -12,6 +12,22 @@
@click="addTopology" @click="addTopology"
>创建组态</el-button >创建组态</el-button
> >
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="addJob"
>定时任务</el-button
>
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="addDict"
>字典</el-button
>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -130,7 +146,6 @@ ...@@ -130,7 +146,6 @@
<script> <script>
import AddParams from "./modules/AddParams.vue"; import AddParams from "./modules/AddParams.vue";
import AddMutual from "./modules/AddMutual.vue"; import AddMutual from "./modules/AddMutual.vue";
import Pagination from "@/components/Pagination";
import PreviewToImg from "@/components/topology/PreviewToImg.vue"; import PreviewToImg from "@/components/topology/PreviewToImg.vue";
import { deleteTopologyHandle, list, deleteTopology } from "@/api/topology.js"; import { deleteTopologyHandle, list, deleteTopology } from "@/api/topology.js";
export default { export default {
...@@ -153,7 +168,6 @@ export default { ...@@ -153,7 +168,6 @@ export default {
AddParams, AddParams,
PreviewToImg, PreviewToImg,
AddMutual, AddMutual,
Pagination,
}, },
data() { data() {
return { return {
...@@ -231,6 +245,16 @@ export default { ...@@ -231,6 +245,16 @@ export default {
path: this.editorUrl, path: this.editorUrl,
}); });
}, },
addJob() {
this.$router.push({
path: "/toplogyView/job",
});
},
addDict() {
this.$router.push({
path: "/toplogyView/dict/type",
});
},
removeTopology(id) { removeTopology(id) {
this.$confirm("确认要删除吗?", "警告", { this.$confirm("确认要删除吗?", "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
@click="handleEdit(scope.$index, scope.row)" @click="handleEdit(scope.$index, scope.row)"
type="primary" type="primary"
style="margin-right: 5px" style="margin-right: 5px"
>Edit</el-button >修改</el-button
> >
<!-- 保存 --> <!-- 保存 -->
<el-button <el-button
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
v-if="scope.row.edit" v-if="scope.row.edit"
@click="handleSave(scope.$index, scope.row)" @click="handleSave(scope.$index, scope.row)"
style="margin-right: 5px" style="margin-right: 5px"
>Save</el-button >保存</el-button
> >
</div> </div>
<!-- 添加控制 --> <!-- 添加控制 -->
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
:plain="true" :plain="true"
v-if="scope.row.edit" v-if="scope.row.edit"
@click="handleSave(scope.$index, scope.row)" @click="handleSave(scope.$index, scope.row)"
>Save</el-button >保存</el-button
> >
</div> </div>
<!-- 全局控制删除 --> <!-- 全局控制删除 -->
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
:plain="true" :plain="true"
type="danger" type="danger"
@click="handleDeleteIt(scope.$index, scope.row)" @click="handleDeleteIt(scope.$index, scope.row)"
>Delete</el-button >删除</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -126,10 +126,12 @@ export default { ...@@ -126,10 +126,12 @@ export default {
loading: false, loading: false,
//切换下一步 //切换下一步
current: 0, current: 0,
// 采集数据字典
dataAcquisitionMode: [],
//tagType类型
tagType: [],
// 表单校验 // 表单校验
rules: {}, rules: {},
dataAcquisitionMode:this.topologyDict.dataAcquisitionMode,
tagType:this.topologyDict.tagType,
// 表单参数 // 表单参数
form: { form: {
dataAcquisitionMode: "", dataAcquisitionMode: "",
...@@ -147,13 +149,18 @@ export default { ...@@ -147,13 +149,18 @@ export default {
update(row) { update(row) {
this.open = true; this.open = true;
this.title = "设置参数"; this.title = "设置参数";
this.getDicts("data_acquisition_mode").then((response) => {
this.dataAcquisitionMode = response.data;
});
this.getDicts("tag_type").then((response) => {
this.tagType = response.data;
});
this.topologyData = Object.assign({}, row); this.topologyData = Object.assign({}, row);
this.fileData = Object.assign({}, JSON.parse(row.data)); this.fileData = Object.assign({}, JSON.parse(row.data));
this.handleList = []; this.handleList = [];
if (this.fileData.topologyHandle) { if (this.fileData.topologyHandle) {
if (!!this.fileData.topologyHandle.dataAcquisitionMode) { if (!!this.fileData.topologyHandle.dataAcquisitionMode) {
this.form.dataAcquisitionMode = this.form.dataAcquisitionMode = this.fileData.topologyHandle.dataAcquisitionMode;
this.fileData.topologyHandle.dataAcquisitionMode;
} }
if (!!this.fileData.topologyHandle.sentence) { if (!!this.fileData.topologyHandle.sentence) {
this.form.sentence = this.fileData.topologyHandle.sentence; this.form.sentence = this.fileData.topologyHandle.sentence;
...@@ -241,17 +248,6 @@ export default { ...@@ -241,17 +248,6 @@ export default {
typeFormat(row, column) { typeFormat(row, column) {
return this.selectDictLabel(this.tagType, row.type); return this.selectDictLabel(this.tagType, row.type);
}, },
// 回显数据字典
selectDictLabel(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].dictValue == "" + value) {
actions.push(datas[key].dictLabel);
return true;
}
});
return actions.join("");
},
next() { next() {
if (!this.form.dataAcquisitionMode) { if (!this.form.dataAcquisitionMode) {
this.$message.warning("请选择获取方式"); this.$message.warning("请选择获取方式");
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="任务名称" prop="jobName">
<el-input
v-model="queryParams.jobName"
placeholder="请输入任务名称"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务组名" prop="jobGroup">
<el-select
v-model="queryParams.jobGroup"
placeholder="请任务组名"
clearable
size="small"
style="width: 240px"
>
<el-option
v-for="dict in jobGroupOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="执行状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择执行状态"
clearable
size="small"
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="执行时间">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['monitor:job:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
@click="handleClean"
v-hasPermi="['monitor:job:remove']"
>清空</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['monitor:job:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="jobLogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="日志编号" width="80" align="center" prop="jobLogId" />
<el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
<el-table-column label="任务组名" align="center" prop="jobGroup" :formatter="jobGroupFormat" :show-overflow-tooltip="true" />
<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
<el-table-column label="日志信息" align="center" prop="jobMessage" :show-overflow-tooltip="true" />
<el-table-column label="执行状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="执行时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleView(scope.row)"
v-hasPermi="['monitor:job:query']"
>详细</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 调度日志详细 -->
<el-dialog title="调度日志详细" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" label-width="100px" size="mini">
<el-row>
<el-col :span="12">
<el-form-item label="日志序号:">{{ form.jobLogId }}</el-form-item>
<el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务分组:">{{ form.jobGroup }}</el-form-item>
<el-form-item label="执行时间:">{{ form.createTime }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="调用方法:">{{ form.invokeTarget }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="日志信息:">{{ form.jobMessage }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="执行状态:">
<div v-if="form.status == 0">正常</div>
<div v-else-if="form.status == 1">失败</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="异常信息:" v-if="form.status == 1">{{ form.exceptionInfo }}</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="open = false">关 闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listJobLog, delJobLog, exportJobLog, cleanJobLog } from "@/api/monitor/jobLog";
export default {
name: "JobLog",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 调度日志表格数据
jobLogList: [],
// 是否显示弹出层
open: false,
// 日期范围
dateRange: [],
// 表单参数
form: {},
// 执行状态字典
statusOptions: [],
// 任务组名字典
jobGroupOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
jobName: undefined,
jobGroup: undefined,
status: undefined
}
};
},
created() {
this.getList();
this.getDicts("sys_job_status").then(response => {
this.statusOptions = response.data;
});
this.getDicts("sys_job_group").then(response => {
this.jobGroupOptions = response.data;
});
},
methods: {
/** 查询调度日志列表 */
getList() {
this.loading = true;
listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.jobLogList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
// 执行状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 任务组名字典翻译
jobGroupFormat(row, column) {
return this.selectDictLabel(this.jobGroupOptions, row.jobGroup);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.jobLogId);
this.multiple = !selection.length;
},
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
},
/** 删除按钮操作 */
handleDelete(row) {
const jobLogIds = this.ids;
this.$confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delJobLog(jobLogIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 清空按钮操作 */
handleClean() {
this.$confirm("是否确认清空所有调度日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return cleanJobLog();
}).then(() => {
this.getList();
this.msgSuccess("清空成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有调度日志数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportJobLog(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>
\ No newline at end of file
<template> <template>
<div style="overflow: hidden"> <div style="overflow: hidden">
<div id="topology-hrhx" style="width: 100%; height: 100vh"></div> <div id="topology-hrhx" style="width: 100%; height: 100vh;overflow: hidden"></div>
<div class="tools"> <div class="tools">
<a-button type="primary" @click="onBack"> <a-button type="primary" @click="onBack">
<a-icon type="left" /> 返回 <a-icon type="left" /> 返回
...@@ -48,12 +48,6 @@ export default { ...@@ -48,12 +48,6 @@ export default {
}, },
methods: { methods: {
onBack() { onBack() {
// this.$router.push({
// path: "/workspace",
// query: {
// id: this.$route.query.id,
// },
// });
this.$router.go(-1); this.$router.go(-1);
}, },
onSizeWindow() { onSizeWindow() {
......
...@@ -263,11 +263,11 @@ export default { ...@@ -263,11 +263,11 @@ export default {
props: { props: {
backUrl: { backUrl: {
type: String, type: String,
default: "/", default: "/topologyView/list",
}, },
previewUrl: { previewUrl: {
type: String, type: String,
default: "/preview", default: "/toplogyView/preview",
}, },
}, },
data() { data() {
...@@ -348,9 +348,7 @@ export default { ...@@ -348,9 +348,7 @@ export default {
event.preventDefault(); event.preventDefault();
}, },
back() { back() {
this.$router.push({ this.$router.go(-1);
path: this.backUrl,
});
}, },
saveContent(e) { saveContent(e) {
var key = window.event.keyCode var key = window.event.keyCode
...@@ -445,7 +443,6 @@ export default { ...@@ -445,7 +443,6 @@ export default {
}); });
}, },
async open() { async open() {
if (this.$route.query.id) { if (this.$route.query.id) {
await getTopologyId(this.$route.query.id) await getTopologyId(this.$route.query.id)
.then((res) => { .then((res) => {
...@@ -464,6 +461,8 @@ export default { ...@@ -464,6 +461,8 @@ export default {
this.fromArrow = this.canvas.data.fromArrow; this.fromArrow = this.canvas.data.fromArrow;
this.lineName = this.canvas.data.lineName; this.lineName = this.canvas.data.lineName;
this.canvas.lock(0); this.canvas.lock(0);
this.canvas.closeSocket()
this.canvas.closeMqtt()
} }
}, },
init() { init() {
...@@ -593,7 +592,6 @@ export default { ...@@ -593,7 +592,6 @@ export default {
a.dispatchEvent(evt); a.dispatchEvent(evt);
}, },
updateProps(node) { updateProps(node) {
console.log(node);
this.canvas.updateProps(this.canvas.data.pens); this.canvas.updateProps(this.canvas.data.pens);
}, },
updateLines(line) { updateLines(line) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论