添加任务字典,修改全局样式
|
@ -1,4 +1,4 @@
|
|||
@primary-color: #1890ff;
|
||||
@primary-color: #2B85D1;
|
||||
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
||||
/* stylelint-disable no-duplicate-selectors */
|
||||
/* stylelint-disable */
|
||||
|
|
5
public/color.less
vendored
|
@ -1,4 +1,4 @@
|
|||
@primary-color: #1890ff;
|
||||
@primary-color: #2B85D1;
|
||||
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
||||
/* stylelint-disable no-duplicate-selectors */
|
||||
/* stylelint-disable */
|
||||
|
@ -2595,7 +2595,7 @@ mark {
|
|||
}
|
||||
::selection {
|
||||
background: @primary-color;
|
||||
color: #fff;
|
||||
color: #000000;
|
||||
}
|
||||
[ant-click-animating-without-extra-node]:after,
|
||||
.ant-click-animating-node {
|
||||
|
@ -2784,7 +2784,6 @@ mark {
|
|||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
background-color: #fff;
|
||||
border-color: #d9d9d9;
|
||||
}
|
||||
|
|
21
src/api/dataType.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { getAction, deleteAction, putAction, postAction, httpAction,uploadAction } from '@/api/manage'
|
||||
|
||||
const dataTypeCreate = (params)=>postAction("/dataType/create",params);
|
||||
const dataTypeUpdateById = (params)=>putAction("/dataType/updateById",params);
|
||||
const dataTypeQueryById = (params)=>getAction("/dataType/queryById",params);
|
||||
const dataTypePageList = (params)=>getAction("/dataType/pageList",params);
|
||||
const dataTypeQueryAll = (params)=>getAction("/dataType/queryAll",params);
|
||||
const dataTypeDeleteById = (params)=>deleteAction("/dataType/deleteById",params);
|
||||
|
||||
|
||||
export {
|
||||
dataTypeCreate,
|
||||
dataTypeUpdateById,
|
||||
dataTypeQueryById,
|
||||
dataTypePageList,
|
||||
dataTypeQueryAll,
|
||||
dataTypeDeleteById
|
||||
}
|
||||
|
||||
|
||||
|
21
src/api/task.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { getAction, deleteAction, putAction, postAction, httpAction,uploadAction } from '@/api/manage'
|
||||
|
||||
const taskCreate = (params)=>postAction("/task/create",params);
|
||||
const taskUpdateById = (params)=>putAction("/task/updateById",params);
|
||||
const taskQueryById = (params)=>getAction("/task/queryById",params);
|
||||
const taskPageList = (params)=>getAction("/task/pageList",params);
|
||||
const taskDistributeTask = (params)=>putAction("/task/distributeTask",params);
|
||||
const taskDeleteById = (params)=>deleteAction("/task/deleteById",params);
|
||||
|
||||
|
||||
export {
|
||||
taskCreate,
|
||||
taskUpdateById,
|
||||
taskQueryById,
|
||||
taskPageList,
|
||||
taskDistributeTask,
|
||||
taskDeleteById
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.2 KiB |
|
@ -133,7 +133,7 @@
|
|||
padding: 6px 0;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
color: #000000;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
@backcolor : #ffffff;
|
||||
@inpuitbackcolor : #ffffff;
|
||||
@labelDeaultColor : #000000;
|
||||
@defaultWhiteColor: #ffffff;
|
||||
@defaultWhiteColor: #000000;
|
||||
@fontfamily : 'Microsoft YaHei';
|
||||
@tableheadColor : #fafafa;
|
||||
@tableheadColor : #E5E8EB;
|
||||
@tableColor : #000000;
|
||||
|
||||
/* 滚动条优化 start */
|
||||
|
@ -15,21 +15,21 @@
|
|||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background : #3a3d4e;
|
||||
background : #C8C8C8;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background : #717483;
|
||||
background : #fafafa;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #717483;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background: #3a3d4e;
|
||||
background: #C8C8C8;
|
||||
}
|
||||
|
||||
/* 滚动条优化 end */
|
||||
|
@ -61,7 +61,9 @@ body {
|
|||
color: #8a8e9e !important;
|
||||
}
|
||||
|
||||
|
||||
.ant-pagination-item-active {
|
||||
color: @headercolor !important;
|
||||
}
|
||||
|
||||
/* chrome 记住密码样式 */
|
||||
.user-layout-login .has-success input:-webkit-autofill {
|
||||
|
@ -120,6 +122,7 @@ body {
|
|||
z-index : 200 !important;
|
||||
border-bottom: 0px !important;
|
||||
background : url('~@/assets/img/tab_bg_active.png') no-repeat;
|
||||
color: @headercolor !important;
|
||||
}
|
||||
|
||||
.ant-tabs-tab:first-child {
|
||||
|
@ -259,7 +262,7 @@ ul li {
|
|||
|
||||
.ant-pagination-item-active a,
|
||||
.ant-pagination-item a:hover{
|
||||
background-color: #3d4151 !important;
|
||||
background-color: #2989CC !important;
|
||||
border-radius: 30px;
|
||||
}
|
||||
.ant-pagination-prev .ant-pagination-item-link,
|
||||
|
@ -274,7 +277,6 @@ ul li {
|
|||
.ant-pagination-item a,
|
||||
.ant-empty-normal,
|
||||
.anticon.anticon-schedule, .border-card:hover,
|
||||
.ant-tabs-tab-active,
|
||||
.ant-tabs-tab:hover,
|
||||
.ant-form-item,
|
||||
.ant-select-arrow,
|
||||
|
@ -653,7 +655,7 @@ textarea,
|
|||
min-width : 60px !important;
|
||||
height : 36px !important;
|
||||
font-family: @fontfamily;
|
||||
color : @defaultWhiteColor !important;
|
||||
//color : @defaultWhiteColor !important;
|
||||
}
|
||||
|
||||
.ant-btn,
|
||||
|
@ -774,7 +776,7 @@ textarea,
|
|||
.ant-menu-submenu:hover,
|
||||
.ant-menu-submenu-selected .ant-menu-submenu-title,
|
||||
.ant-menu-submenu-title:hover {
|
||||
color: @defaultWhiteColor !important;
|
||||
color: @headercolor !important;
|
||||
}
|
||||
|
||||
.ant-menu-submenu-horizontal.ant-menu-submenu-selected,
|
||||
|
@ -836,7 +838,7 @@ textarea,
|
|||
|
||||
&.dark {
|
||||
.ant-drawer-content {
|
||||
background-color: rgb(0, 21, 41);
|
||||
background-color: rgb(0, 76, 147);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -994,11 +996,11 @@ tr.ant-table-expanded-row:hover {
|
|||
}
|
||||
|
||||
.ant-card-body {
|
||||
background-color: #282B2C;
|
||||
background-color: #8a8a8a4f;
|
||||
}
|
||||
|
||||
.ant-layout-footer {
|
||||
background-color: #010101;
|
||||
background-color: #9494947e;
|
||||
}
|
||||
|
||||
.ant-pagination {
|
||||
|
|
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 11 KiB |
174
src/views/ship/dataType.vue
Normal file
|
@ -0,0 +1,174 @@
|
|||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="30">
|
||||
|
||||
<a-col :md="6" :sm="10" >
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button @click="handleAdd" type="primary" v-has="'cont:btn'" icon="plus">新增</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
<div style="height:900px;overflow-y:auto;">
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<!-- :locale="myLocale"-->
|
||||
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
<span slot="name" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="20" />
|
||||
</span>
|
||||
<span slot="describe" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="20" />
|
||||
</span>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)" v-has="'cont:btn'">修改</a>
|
||||
<a-divider type="vertical" v-has="'cont:btn'" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<dataTypeModal ref="modalForm" @ok="modalFormOk"></dataTypeModal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dataTypeModal from './modules/dataTypeModal'
|
||||
import {
|
||||
dataTypePageList,
|
||||
dataTypeDeleteById } from '@/api/dataType'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||
|
||||
export default {
|
||||
name: "shiplist",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
dataTypeModal,
|
||||
JEllipsis,
|
||||
VNodes: {
|
||||
functional: true,
|
||||
render: (h, ctx) => ctx.props.vnodes,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
description: '数据类型管理',
|
||||
dataSources: [],
|
||||
queryParam: {
|
||||
pageNum :1,
|
||||
pageSize:20
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'id',
|
||||
width:60,
|
||||
align:"id",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '英文名称',
|
||||
align:"enName",
|
||||
dataIndex: 'enName',
|
||||
},
|
||||
{
|
||||
title: '中文名称',
|
||||
align:"cnName",
|
||||
dataIndex: 'cnName'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
align:"createTime",
|
||||
width: 250,
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
width:180,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
//筛选需要重写handleTableChange
|
||||
handleTableChange(pagination, filters, sorter) {
|
||||
//分页、排序、筛选变化时触发
|
||||
//TODO 筛选
|
||||
if (Object.keys(sorter).length > 0) {
|
||||
this.isorter.column = sorter.field;
|
||||
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
|
||||
}
|
||||
this.ipagination = pagination;
|
||||
this.loadData();
|
||||
},
|
||||
loadData() {
|
||||
dataTypePageList(this.queryParam).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.rows||res.result;
|
||||
if(res.result.total)
|
||||
{
|
||||
this.ipagination.total = res.result.total;
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete: function (id) {
|
||||
var that = this;
|
||||
dataTypeDeleteById({id: id}).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleEdit: function (record) {
|
||||
this.$refs.modalForm.edit(record);
|
||||
this.$refs.modalForm.title = "编辑";
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.modalForm.add();
|
||||
this.$refs.modalForm.title = "新增";
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
|
@ -1,199 +0,0 @@
|
|||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
okText="保存并安排任务"
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item label="任务名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input v-decorator="['quartzName']" ></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="同步策略名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<j-select-multiple v-model="dataStrategySelected" :options="strategys"/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="cron表达式">
|
||||
<j-cron ref="innerVueCron" v-decorator="['cronExpression', { initialValue: '* * * * * ? *' }]" @change="setCorn"></j-cron>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="描述">
|
||||
<a-textarea placeholder="请输入描述" :rows="3" v-decorator="['description', {}]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { httpAction } from '@/api/manage'
|
||||
import JCron from "@/components/jeecg/JCron";
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import pick from 'lodash.pick'
|
||||
// import moment from "moment"
|
||||
|
||||
export default {
|
||||
name: "QuartzJobModal",
|
||||
components: {
|
||||
JCron,
|
||||
JSelectMultiple
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
buttonStyle: 'solid',
|
||||
visible: false,
|
||||
status:'',
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
cron: {
|
||||
label: '',
|
||||
value: ''
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules: {
|
||||
cron: {
|
||||
rules: [{
|
||||
required: true, message: '请输入cron表达式!'
|
||||
}]
|
||||
}
|
||||
},
|
||||
url: {
|
||||
add: "/sys/quartzJob/add",
|
||||
edit: "/sys/quartzJob/edit",
|
||||
queryEditStrategyList:"/sys/quartzJob/editSynchronSelectDetails",
|
||||
queryAddStrategyList:"/sys/quartzJob/addSynchronSelectDetails"
|
||||
},
|
||||
strategys:[],
|
||||
dataStrategySelected:'',
|
||||
idcDataStrategyId:""
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
let that = this;
|
||||
that.form.resetFields();
|
||||
this.model = Object.assign({},record);
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.model.id){
|
||||
this.status = this.model.status;
|
||||
this.getEditStrategyList();
|
||||
}else{
|
||||
this.getAddStrategyList();
|
||||
}
|
||||
this.dataStrategySelected = this.model.strategyId;
|
||||
this.form.setFieldsValue(pick(this.model,'cronExpression','description','quartzName'));
|
||||
});
|
||||
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
//add获取同步策略列表
|
||||
getAddStrategyList(){
|
||||
httpAction(this.url.queryAddStrategyList,{},"get").then((res)=>{
|
||||
if(res.success){
|
||||
this.strategys=res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
//edit获取同步策略列表
|
||||
getEditStrategyList(){
|
||||
httpAction(this.url.queryEditStrategyList,{},"get").then((res)=>{
|
||||
if(res.success){
|
||||
this.strategys=res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
strategyChange(value){
|
||||
this.idcDataStrategyId = value;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
console.log('values',values)
|
||||
if (!err) {
|
||||
if (typeof values.cronExpression == "undefined" || Object.keys(values.cronExpression).length==0 ) {
|
||||
this.$message.warning('请输入cron表达式!');
|
||||
return false;
|
||||
}
|
||||
that.confirmLoading = true;
|
||||
let httpurl = '';
|
||||
let method = '';
|
||||
if(!this.model.id){
|
||||
httpurl+=this.url.add;
|
||||
method = 'post';
|
||||
}else{
|
||||
httpurl+=this.url.edit;
|
||||
method = 'put';
|
||||
}
|
||||
httpAction(httpurl, {quartzName:values.quartzName,strategyId:this.dataStrategySelected,cronExpression:values.cronExpression,description:values.description,id:this.model.id,status:this.status},method).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
setCorn(data){
|
||||
console.log('data)',data);
|
||||
this.$nextTick(() => {
|
||||
this.model.cronExpression = data;
|
||||
})
|
||||
|
||||
if (Object.keys(data).length==0) {
|
||||
this.$message.warning('请输入cron表达式!');
|
||||
}
|
||||
},
|
||||
validateCron(rule, value, callback){
|
||||
if(!value){
|
||||
callback()
|
||||
}else if (Object.keys(value).length==0) {
|
||||
callback("请输入cron表达式!");
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.disabled{
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
120
src/views/ship/modules/dataTypeModal.vue
Normal file
|
@ -0,0 +1,120 @@
|
|||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
okText="保存"
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item label="英文名称" >
|
||||
<a-input v-decorator="['enName']" ></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="中文名称">
|
||||
<a-input v-decorator="['cnName']" ></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { dataTypeCreate,
|
||||
dataTypeUpdateById} from '@/api/dataType'
|
||||
import JCron from "@/components/jeecg/JCron";
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import pick from 'lodash.pick'
|
||||
// import moment from "moment"
|
||||
|
||||
export default {
|
||||
name: "dataTypeModal",
|
||||
components: {
|
||||
JCron,
|
||||
JSelectMultiple
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
buttonStyle: 'solid',
|
||||
visible: false,
|
||||
status:'',
|
||||
model: {},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
strategys:[],
|
||||
dataStrategySelected:'',
|
||||
idcDataStrategyId:""
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.visible =true;
|
||||
let that = this;
|
||||
that.form.resetFields();
|
||||
this.model = Object.assign({},record);
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'enName','cnName'));
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
console.log('values',values)
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
if(!this.model.id){
|
||||
dataTypeCreate(values).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}else{
|
||||
dataTypeUpdateById({id:this.model.id,enName:values.enName,cnName:values.cnName}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.disabled{
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
124
src/views/ship/modules/shipModeModal.vue
Normal file
|
@ -0,0 +1,124 @@
|
|||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
okText="保存"
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item label="型号名称" >
|
||||
<a-input v-decorator="['name']" ></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="说明">
|
||||
<a-textarea placeholder="请输入描述" :rows="3" v-decorator="['describe', {}]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { shipModelCreate,
|
||||
shipModelUpdateById,
|
||||
shipModelQueryById,
|
||||
shipModelPageList,
|
||||
shipModelQueryByModelId,
|
||||
shipModeldeleteById } from '@/api/ship'
|
||||
import JCron from "@/components/jeecg/JCron";
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import pick from 'lodash.pick'
|
||||
// import moment from "moment"
|
||||
|
||||
export default {
|
||||
name: "shipModeModal",
|
||||
components: {
|
||||
JCron,
|
||||
JSelectMultiple
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
buttonStyle: 'solid',
|
||||
visible: false,
|
||||
status:'',
|
||||
model: {},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
strategys:[],
|
||||
dataStrategySelected:'',
|
||||
idcDataStrategyId:""
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.visible =true;
|
||||
let that = this;
|
||||
that.form.resetFields();
|
||||
this.model = Object.assign({},record);
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name','describe'));
|
||||
});
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
console.log('values',values)
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
if(!this.model.id){
|
||||
shipModelCreate(values).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}else{
|
||||
shipModelUpdateById({id:this.model.id,name:values.name,describe:values.describe}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.disabled{
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
160
src/views/ship/modules/shipNumModal.vue
Normal file
|
@ -0,0 +1,160 @@
|
|||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
okText="保存"
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item :labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol" label="舷号名称" >
|
||||
<a-input v-decorator="['name']" ></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="选择型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select show-search
|
||||
placeholder="选择型号"
|
||||
option-filter-prop="children" :filter-option="filterOption" size="large" v-decorator="['modelId', {}]">
|
||||
<a-select-option v-for="d in treeData" :key="d.id">
|
||||
{{ d.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item :labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="说明">
|
||||
<a-textarea placeholder="请输入描述" :rows="3" v-decorator="['describe', {}]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { shipNumCreate,shipModelPageList,shipNumUpdateById} from '@/api/ship'
|
||||
import JCron from "@/components/jeecg/JCron";
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import pick from 'lodash.pick'
|
||||
import JTreeSelect from '@/components/jeecg/JTreeSelect'
|
||||
|
||||
// import moment from "moment"
|
||||
|
||||
export default {
|
||||
name: "shipNumModal",
|
||||
components: {
|
||||
JCron,
|
||||
JSelectMultiple,
|
||||
JTreeSelect
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
buttonStyle: 'solid',
|
||||
visible: false,
|
||||
treeData:{},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
queryParam: {
|
||||
pageNum :1,
|
||||
pageSize:20
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
status:'',
|
||||
model: {},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
strategys:[],
|
||||
dataStrategySelected:'',
|
||||
idcDataStrategyId:""
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.visible =true;
|
||||
let that = this;
|
||||
that.form.resetFields();
|
||||
this.model = Object.assign({},record);
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name','describe','modelId'));
|
||||
});
|
||||
},
|
||||
filterOption(input, option) {
|
||||
return (
|
||||
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
);
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
loadData() {
|
||||
shipModelPageList(this.queryParam).then((res) => {
|
||||
if (res.success) {
|
||||
this.treeData = res.result.rows
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
console.log('values',values)
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
if(!this.model.id){
|
||||
shipNumCreate(values).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}else{
|
||||
shipNumUpdateById({id:this.model.id,name:values.name,describe:values.describe,modelId:model.modelId}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.disabled{
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
|
@ -3,56 +3,20 @@
|
|||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="30">
|
||||
<a-col :md="6" :sm="10">
|
||||
<a-form-item label="定时任务名称">
|
||||
<a-input placeholder="请输入定时任务名称" v-model="queryParam.quartzName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="10">
|
||||
<a-form-item label="同步策略名称">
|
||||
<a-input placeholder="请输入同步策略名称" v-model="queryParam.strategyName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="10">
|
||||
<a-form-item label="任务状态">
|
||||
<a-select style="width: 220px" v-model="queryParam.status" placeholder="请选择状态">
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option value="0">正常</a-select-option>
|
||||
<a-select-option value="-1">停止</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :md="6" :sm="10" >
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
<a-button @click="handleAdd" type="primary" v-has="'cont:btn'" icon="plus">新增</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" v-has="'cont:btn'" icon="plus">新增</a-button>
|
||||
<a-button type="primary" v-has="'cont:btn'" icon="download" @click="handleExportXls('定时任务信息')">导出</a-button>
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-button type="primary" v-has="'cont:btn'" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" v-has="'cont:btn'" @click="batchDel" icon="del">批量删除</a-button>
|
||||
<a-button type="primary" v-has="'cont:btn'" @click="batchStart" icon="start" style="margin-left: 8px">批量启动</a-button>
|
||||
<a-button type="primary" v-has="'cont:btn'" @click="pauseJobBatch" icon="pauseJob" style="margin-left: 8px">批量暂停</a-button>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
<div style="height:615px;overflow-y:auto;">
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
|
||||
<div style="height:900px;overflow-y:auto;">
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
|
@ -66,69 +30,41 @@
|
|||
@change="handleTableChange">
|
||||
<!-- :locale="myLocale"-->
|
||||
|
||||
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
|
||||
<div style="margin-bottom: 5px">
|
||||
<span v-for="(item,index) in record.strategyName.split(',')" :key="index">
|
||||
<a-badge status="success" style="vertical-align: middle;"/><span>{{ item }}<br></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
<span slot="description" slot-scope="text">
|
||||
<span slot="name" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="20" />
|
||||
</span>
|
||||
<span slot="parameterRender" slot-scope="text">
|
||||
<span slot="describe" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="20" />
|
||||
</span>
|
||||
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="resumeJob(record)" v-if="record.status==-1" v-has="'cont:btn'">启动</a>
|
||||
<a @click="pauseJob(record)" v-if="record.status==0" v-has="'cont:btn'">停止</a>
|
||||
|
||||
<a @click="handleEdit(record)" v-has="'cont:btn'">修改</a>
|
||||
<a-divider type="vertical" v-has="'cont:btn'" />
|
||||
<a-dropdown v-has="'cont:btn'">
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item><a @click="executeImmediately(record)">立即执行</a></a-menu-item>
|
||||
<a-menu-item><a @click="handleEdit(record)">编辑</a></a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
<a-divider type="vertical" v-has="'cont:btn'" />
|
||||
<a @click="handleDetail(record)">详情</a>
|
||||
</span>
|
||||
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderStatus" slot-scope="status">
|
||||
<a-tag v-if="status==0" color="green">已启动</a-tag>
|
||||
<a-tag v-if="status==-1" color="orange">已暂停</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<quartzJob-modal ref="modalForm" @ok="modalFormOk"></quartzJob-modal>
|
||||
<shipModeModal ref="modalForm" @ok="modalFormOk"></shipModeModal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QuartzJobModal from './modules/QuartzJobModal'
|
||||
import { getAction } from '@/api/manage'
|
||||
import shipModeModal from './modules/shipModeModal'
|
||||
import { shipModelPageList,
|
||||
shipModeldeleteById } from '@/api/ship'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||
|
||||
export default {
|
||||
name: "QuartzJobList",
|
||||
name: "shiplist",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
QuartzJobModal,
|
||||
shipModeModal,
|
||||
JEllipsis,
|
||||
VNodes: {
|
||||
functional: true,
|
||||
|
@ -137,51 +73,38 @@
|
|||
},
|
||||
data () {
|
||||
return {
|
||||
description: '定时任务在线管理',
|
||||
description: 'JT型号管理',
|
||||
dataSources: [],
|
||||
// 查询条件
|
||||
queryParam: {},
|
||||
//myLocale: {emptyText: '同步策略已全部配置'},
|
||||
// 表头
|
||||
queryParam: {
|
||||
pageNum :1,
|
||||
pageSize:20
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
key:'id',
|
||||
width:60,
|
||||
align:"center",
|
||||
align:"id",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '定时任务名称',
|
||||
align:"center",
|
||||
dataIndex: 'quartzName',
|
||||
sorter: true,
|
||||
title: '型号名称',
|
||||
align:"name",
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: 'cron表达式',
|
||||
align:"center",
|
||||
dataIndex: 'cronExpression'
|
||||
title: '说明',
|
||||
align:"describe",
|
||||
dataIndex: 'describe'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align:"center",
|
||||
title: '创建时间',
|
||||
align:"createTime",
|
||||
width: 250,
|
||||
dataIndex: 'description',
|
||||
scopedSlots: {customRender: 'description'},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align:"center",
|
||||
dataIndex: 'status',
|
||||
scopedSlots: { customRender: 'customRenderStatus' },
|
||||
filterMultiple: false,
|
||||
filters: [
|
||||
{ text: '已启动', value: '0' },
|
||||
{ text: '已暂停', value: '-1' },
|
||||
]
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
@ -190,27 +113,13 @@
|
|||
width:180,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/sys/quartzJob/list",
|
||||
delete: "/sys/quartzJob/delete",
|
||||
deleteBatch: "/sys/quartzJob/deleteBatch",
|
||||
startBatch: "/sys/quartzJob/startBatch",
|
||||
pauseJobBatch: "/sys/quartzJob/pauseJobBatch",
|
||||
pause: "/sys/quartzJob/pause",
|
||||
resume: "/sys/quartzJob/resume",
|
||||
exportXlsUrl: "sys/quartzJob/exportXls",
|
||||
importExcelUrl: "sys/quartzJob/importExcel",
|
||||
execute: "sys/quartzJob/execute",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
//筛选需要重写handleTableChange
|
||||
|
@ -221,176 +130,41 @@
|
|||
this.isorter.column = sorter.field;
|
||||
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
|
||||
}
|
||||
//这种筛选方式只支持单选
|
||||
//this.filters.status = filters.status[0];
|
||||
this.ipagination = pagination;
|
||||
this.loadData();
|
||||
},
|
||||
pauseJobBatch: function () {
|
||||
if(!this.url.pauseJobBatch){
|
||||
this.$message.error("请设置url.pauseJobBatch属性!")
|
||||
return
|
||||
}
|
||||
let content_ = '是否暂停选中数据?';
|
||||
if (this.selectedRowKeys.length <= 0) {
|
||||
content_ = '是否暂停全部数据?'
|
||||
}
|
||||
var ids = "";
|
||||
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
||||
ids += this.selectedRowKeys[a] + ",";
|
||||
}
|
||||
var that = this;
|
||||
this.$confirm({
|
||||
title: "确认暂停",
|
||||
content: content_,
|
||||
onOk: function () {
|
||||
that.loading = true;
|
||||
getAction(that.url.pauseJobBatch, {ids: ids}).then((res) => {
|
||||
loadData() {
|
||||
shipModelPageList(this.queryParam).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
loadData(arg) {
|
||||
if(!this.url.list){
|
||||
this.$message.error("请设置url.list属性!")
|
||||
return
|
||||
}
|
||||
//加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1;
|
||||
}
|
||||
let params = this.getQueryParams();//查询条件
|
||||
let strategyName = params.strategyName;
|
||||
let status = "";
|
||||
if(this.idcDataSourceTableId){
|
||||
strategyName = this.idcDataSourceSelected + "-" + this.sourceUserId + "-" + this.idcDataSourceTableId;
|
||||
}else if(this.sourceUserId && this.sourceUserId.length > 0){
|
||||
strategyName = this.idcDataSourceSelected + "-" + this.sourceUserId;
|
||||
}else if(this.idcDataSourceSelected){
|
||||
strategyName = this.idcDataSourceSelected;
|
||||
}
|
||||
this.$set(this.queryParam,'strategyName',strategyName);
|
||||
console.log(params)
|
||||
if(params.status){
|
||||
status = params.status;
|
||||
}
|
||||
this.loading = true;
|
||||
getAction(this.url.list, {quartzName:params.quartzName,strategyName:strategyName,status:status,pageNo:params.pageNo,pageSize:params.pageSize,order:params.order,column:params.column}).then((res) => {
|
||||
if (res.success) {
|
||||
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
this.dataSource = res.result.records||res.result;
|
||||
this.dataSource = res.result.rows||res.result;
|
||||
if(res.result.total)
|
||||
{
|
||||
this.ipagination.total = res.result.total;
|
||||
}
|
||||
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
if(res.code===510){
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
});
|
||||
},
|
||||
batchStart: function () {
|
||||
if(!this.url.startBatch){
|
||||
this.$message.error("请设置url.startBatch属性!")
|
||||
return
|
||||
}
|
||||
let content_ = '是否启动选中数据?';
|
||||
if (this.selectedRowKeys.length <= 0) {
|
||||
content_ = '是否启动全部数据?'
|
||||
}
|
||||
var ids = "";
|
||||
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
||||
ids += this.selectedRowKeys[a] + ",";
|
||||
}
|
||||
handleDelete: function (id) {
|
||||
var that = this;
|
||||
this.$confirm({
|
||||
title: "确认启动",
|
||||
content: content_,
|
||||
onOk: function () {
|
||||
that.loading = true;
|
||||
getAction(that.url.startBatch, {ids: ids}).then((res) => {
|
||||
shipModeldeleteById({id: id}).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
pauseJob: function(record){
|
||||
var that = this;
|
||||
//暂停定时任务
|
||||
this.$confirm({
|
||||
title:"确认暂停",
|
||||
content:"是否暂停选中任务?",
|
||||
onOk: function(){
|
||||
getAction(that.url.pause,{id:record.id}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
handleEdit: function (record) {
|
||||
this.$refs.modalForm.edit(record);
|
||||
this.$refs.modalForm.title = "编辑";
|
||||
},
|
||||
resumeJob: function(record){
|
||||
var that = this;
|
||||
//恢复定时任务
|
||||
this.$confirm({
|
||||
title:"确认启动",
|
||||
content:"是否启动选中任务?",
|
||||
onOk: function(){
|
||||
getAction(that.url.resume,{id:record.id}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
handleAdd() {
|
||||
this.$refs.modalForm.add();
|
||||
this.$refs.modalForm.title = "新增";
|
||||
},
|
||||
executeImmediately(record){
|
||||
var that = this;
|
||||
//立即执行定时任务
|
||||
this.$confirm({
|
||||
title:"确认提示",
|
||||
content:"是否立即执行任务?",
|
||||
onOk: function(){
|
||||
getAction(that.url.execute,{id:record.id}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -3,56 +3,20 @@
|
|||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="30">
|
||||
<a-col :md="6" :sm="10">
|
||||
<a-form-item label="定时任务名称">
|
||||
<a-input placeholder="请输入定时任务名称" v-model="queryParam.quartzName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="10">
|
||||
<a-form-item label="同步策略名称">
|
||||
<a-input placeholder="请输入同步策略名称" v-model="queryParam.strategyName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="10">
|
||||
<a-form-item label="任务状态">
|
||||
<a-select style="width: 220px" v-model="queryParam.status" placeholder="请选择状态">
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option value="0">正常</a-select-option>
|
||||
<a-select-option value="-1">停止</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :md="6" :sm="10" >
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
<a-button @click="handleAdd" type="primary" v-has="'cont:btn'" icon="plus">新增</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" v-has="'cont:btn'" icon="plus">新增</a-button>
|
||||
<a-button type="primary" v-has="'cont:btn'" icon="download" @click="handleExportXls('定时任务信息')">导出</a-button>
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
||||
<a-button type="primary" v-has="'cont:btn'" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" v-has="'cont:btn'" @click="batchDel" icon="del">批量删除</a-button>
|
||||
<a-button type="primary" v-has="'cont:btn'" @click="batchStart" icon="start" style="margin-left: 8px">批量启动</a-button>
|
||||
<a-button type="primary" v-has="'cont:btn'" @click="pauseJobBatch" icon="pauseJob" style="margin-left: 8px">批量暂停</a-button>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
<div style="height:615px;overflow-y:auto;">
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
|
||||
<div style="height:900px;overflow-y:auto;">
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
|
@ -66,69 +30,36 @@
|
|||
@change="handleTableChange">
|
||||
<!-- :locale="myLocale"-->
|
||||
|
||||
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
|
||||
<div style="margin-bottom: 5px">
|
||||
<span v-for="(item,index) in record.strategyName.split(',')" :key="index">
|
||||
<a-badge status="success" style="vertical-align: middle;"/><span>{{ item }}<br></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
<span slot="description" slot-scope="text">
|
||||
<span slot="name" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="20" />
|
||||
</span>
|
||||
<span slot="parameterRender" slot-scope="text">
|
||||
<span slot="describe" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="20" />
|
||||
</span>
|
||||
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="resumeJob(record)" v-if="record.status==-1" v-has="'cont:btn'">启动</a>
|
||||
<a @click="pauseJob(record)" v-if="record.status==0" v-has="'cont:btn'">停止</a>
|
||||
|
||||
<a-divider type="vertical" v-has="'cont:btn'" />
|
||||
<a-dropdown v-has="'cont:btn'">
|
||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item><a @click="executeImmediately(record)">立即执行</a></a-menu-item>
|
||||
<a-menu-item><a @click="handleEdit(record)">编辑</a></a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
<a-divider type="vertical" v-has="'cont:btn'" />
|
||||
<a @click="handleDetail(record)">详情</a>
|
||||
<a @click="handleEdit(record)" v-has="'cont:btn'">修改</a>
|
||||
</span>
|
||||
|
||||
<!-- 状态渲染模板 -->
|
||||
<template slot="customRenderStatus" slot-scope="status">
|
||||
<a-tag v-if="status==0" color="green">已启动</a-tag>
|
||||
<a-tag v-if="status==-1" color="orange">已暂停</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<quartzJob-modal ref="modalForm" @ok="modalFormOk"></quartzJob-modal>
|
||||
<shipNumModal ref="modalForm" @ok="modalFormOk"></shipNumModal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QuartzJobModal from './modules/QuartzJobModal'
|
||||
import { getAction } from '@/api/manage'
|
||||
import shipNumModal from './modules/shipNumModal'
|
||||
import { shipNumPageList } from '@/api/ship'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||
|
||||
export default {
|
||||
name: "QuartzJobList",
|
||||
name: "shiplist",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
QuartzJobModal,
|
||||
shipNumModal,
|
||||
JEllipsis,
|
||||
VNodes: {
|
||||
functional: true,
|
||||
|
@ -137,51 +68,43 @@
|
|||
},
|
||||
data () {
|
||||
return {
|
||||
description: '定时任务在线管理',
|
||||
description: 'JT舷号管理',
|
||||
dataSources: [],
|
||||
// 查询条件
|
||||
queryParam: {},
|
||||
//myLocale: {emptyText: '同步策略已全部配置'},
|
||||
// 表头
|
||||
queryParam: {
|
||||
pageNum :1,
|
||||
pageSize:20
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'rowIndex',
|
||||
key:'id',
|
||||
width:60,
|
||||
align:"center",
|
||||
align:"id",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '定时任务名称',
|
||||
align:"center",
|
||||
dataIndex: 'quartzName',
|
||||
sorter: true,
|
||||
title: '舷号名称',
|
||||
align:"name",
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: 'cron表达式',
|
||||
align:"center",
|
||||
dataIndex: 'cronExpression'
|
||||
title: '型号名称',
|
||||
align:"modelName",
|
||||
dataIndex: 'modelName'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
align:"center",
|
||||
title: '说明',
|
||||
align:"describe",
|
||||
dataIndex: 'describe'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
align:"createTime",
|
||||
width: 250,
|
||||
dataIndex: 'description',
|
||||
scopedSlots: {customRender: 'description'},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align:"center",
|
||||
dataIndex: 'status',
|
||||
scopedSlots: { customRender: 'customRenderStatus' },
|
||||
filterMultiple: false,
|
||||
filters: [
|
||||
{ text: '已启动', value: '0' },
|
||||
{ text: '已暂停', value: '-1' },
|
||||
]
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
@ -190,27 +113,13 @@
|
|||
width:180,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: "/sys/quartzJob/list",
|
||||
delete: "/sys/quartzJob/delete",
|
||||
deleteBatch: "/sys/quartzJob/deleteBatch",
|
||||
startBatch: "/sys/quartzJob/startBatch",
|
||||
pauseJobBatch: "/sys/quartzJob/pauseJobBatch",
|
||||
pause: "/sys/quartzJob/pause",
|
||||
resume: "/sys/quartzJob/resume",
|
||||
exportXlsUrl: "sys/quartzJob/exportXls",
|
||||
importExcelUrl: "sys/quartzJob/importExcel",
|
||||
execute: "sys/quartzJob/execute",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
//筛选需要重写handleTableChange
|
||||
|
@ -221,176 +130,30 @@
|
|||
this.isorter.column = sorter.field;
|
||||
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
|
||||
}
|
||||
//这种筛选方式只支持单选
|
||||
//this.filters.status = filters.status[0];
|
||||
this.ipagination = pagination;
|
||||
this.loadData();
|
||||
},
|
||||
pauseJobBatch: function () {
|
||||
if(!this.url.pauseJobBatch){
|
||||
this.$message.error("请设置url.pauseJobBatch属性!")
|
||||
return
|
||||
}
|
||||
let content_ = '是否暂停选中数据?';
|
||||
if (this.selectedRowKeys.length <= 0) {
|
||||
content_ = '是否暂停全部数据?'
|
||||
}
|
||||
var ids = "";
|
||||
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
||||
ids += this.selectedRowKeys[a] + ",";
|
||||
}
|
||||
var that = this;
|
||||
this.$confirm({
|
||||
title: "确认暂停",
|
||||
content: content_,
|
||||
onOk: function () {
|
||||
that.loading = true;
|
||||
getAction(that.url.pauseJobBatch, {ids: ids}).then((res) => {
|
||||
loadData() {
|
||||
shipNumPageList(this.queryParam).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
loadData(arg) {
|
||||
if(!this.url.list){
|
||||
this.$message.error("请设置url.list属性!")
|
||||
return
|
||||
}
|
||||
//加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1;
|
||||
}
|
||||
let params = this.getQueryParams();//查询条件
|
||||
let strategyName = params.strategyName;
|
||||
let status = "";
|
||||
if(this.idcDataSourceTableId){
|
||||
strategyName = this.idcDataSourceSelected + "-" + this.sourceUserId + "-" + this.idcDataSourceTableId;
|
||||
}else if(this.sourceUserId && this.sourceUserId.length > 0){
|
||||
strategyName = this.idcDataSourceSelected + "-" + this.sourceUserId;
|
||||
}else if(this.idcDataSourceSelected){
|
||||
strategyName = this.idcDataSourceSelected;
|
||||
}
|
||||
this.$set(this.queryParam,'strategyName',strategyName);
|
||||
console.log(params)
|
||||
if(params.status){
|
||||
status = params.status;
|
||||
}
|
||||
this.loading = true;
|
||||
getAction(this.url.list, {quartzName:params.quartzName,strategyName:strategyName,status:status,pageNo:params.pageNo,pageSize:params.pageSize,order:params.order,column:params.column}).then((res) => {
|
||||
if (res.success) {
|
||||
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
this.dataSource = res.result.records||res.result;
|
||||
this.dataSource = res.result.rows||res.result;
|
||||
if(res.result.total)
|
||||
{
|
||||
this.ipagination.total = res.result.total;
|
||||
}
|
||||
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
}
|
||||
if(res.code===510){
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
batchStart: function () {
|
||||
if(!this.url.startBatch){
|
||||
this.$message.error("请设置url.startBatch属性!")
|
||||
return
|
||||
}
|
||||
let content_ = '是否启动选中数据?';
|
||||
if (this.selectedRowKeys.length <= 0) {
|
||||
content_ = '是否启动全部数据?'
|
||||
}
|
||||
var ids = "";
|
||||
for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
||||
ids += this.selectedRowKeys[a] + ",";
|
||||
}
|
||||
var that = this;
|
||||
this.$confirm({
|
||||
title: "确认启动",
|
||||
content: content_,
|
||||
onOk: function () {
|
||||
that.loading = true;
|
||||
getAction(that.url.startBatch, {ids: ids}).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.loading = false;
|
||||
});
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
pauseJob: function(record){
|
||||
var that = this;
|
||||
//暂停定时任务
|
||||
this.$confirm({
|
||||
title:"确认暂停",
|
||||
content:"是否暂停选中任务?",
|
||||
onOk: function(){
|
||||
getAction(that.url.pause,{id:record.id}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
handleEdit: function (record) {
|
||||
this.$refs.modalForm.edit(record);
|
||||
this.$refs.modalForm.title = "编辑";
|
||||
},
|
||||
resumeJob: function(record){
|
||||
var that = this;
|
||||
//恢复定时任务
|
||||
this.$confirm({
|
||||
title:"确认启动",
|
||||
content:"是否启动选中任务?",
|
||||
onOk: function(){
|
||||
getAction(that.url.resume,{id:record.id}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
handleAdd() {
|
||||
this.$refs.modalForm.add();
|
||||
this.$refs.modalForm.title = "新增";
|
||||
},
|
||||
executeImmediately(record){
|
||||
var that = this;
|
||||
//立即执行定时任务
|
||||
this.$confirm({
|
||||
title:"确认提示",
|
||||
content:"是否立即执行任务?",
|
||||
onOk: function(){
|
||||
getAction(that.url.execute,{id:record.id}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
that.onClearSelected();
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
201
src/views/task/index.vue
Normal file
|
@ -0,0 +1,201 @@
|
|||
<template>
|
||||
<a-card :bordered="false">
|
||||
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="30">
|
||||
|
||||
<a-col :md="6" :sm="10" >
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-button @click="handleAdd" type="primary" v-has="'cont:btn'" icon="plus">新增</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<!-- table区域-begin -->
|
||||
<div style="height:900px;overflow-y:auto;">
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<!-- :locale="myLocale"-->
|
||||
|
||||
<!-- 字符串超长截取省略号显示-->
|
||||
<span slot="name" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="20" />
|
||||
</span>
|
||||
<span slot="describe" slot-scope="text">
|
||||
<j-ellipsis :value="text" :length="20" />
|
||||
</span>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)" v-has="'cont:btn'">修改</a>
|
||||
<a-divider type="vertical" v-has="'cont:btn'" />
|
||||
<a @click="handleDistribute(record.id)" v-has="'cont:btn'">下发任务</a>
|
||||
<a-divider type="vertical" v-has="'cont:btn'" />
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<taskModal ref="modalForm" @ok="modalFormOk"></taskModal>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import taskModal from './modules/taskModal'
|
||||
import { shipModelPageList,
|
||||
shipModeldeleteById } from '@/api/ship'
|
||||
import { taskCreate,
|
||||
taskUpdateById,
|
||||
taskQueryById,
|
||||
taskPageList,
|
||||
taskDistributeTask,
|
||||
taskDeleteById } from '@/api/task'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import JEllipsis from "@/components/jeecg/JEllipsis";
|
||||
|
||||
export default {
|
||||
name: "tasklist",
|
||||
mixins:[JeecgListMixin],
|
||||
components: {
|
||||
taskModal,
|
||||
JEllipsis,
|
||||
VNodes: {
|
||||
functional: true,
|
||||
render: (h, ctx) => ctx.props.vnodes,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
description: '任务规划管理',
|
||||
dataSources: [],
|
||||
queryParam: {
|
||||
pageNum :1,
|
||||
pageSize:20
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
dataIndex: '',
|
||||
key:'id',
|
||||
width:60,
|
||||
align:"id",
|
||||
customRender:function (t,r,index) {
|
||||
return parseInt(index)+1;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '任务名称',
|
||||
align:"name",
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
align:"createTime",
|
||||
dataIndex: 'createTime'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align:"startTime",
|
||||
dataIndex: 'startTime'
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
align:"endTime",
|
||||
dataIndex: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '下发时间',
|
||||
align:"issuingTime",
|
||||
dataIndex: 'issuingTime',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
align:"center",
|
||||
width:180,
|
||||
scopedSlots: { customRender: 'action' },
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
created () {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
//筛选需要重写handleTableChange
|
||||
handleTableChange(pagination, filters, sorter) {
|
||||
//分页、排序、筛选变化时触发
|
||||
//TODO 筛选
|
||||
if (Object.keys(sorter).length > 0) {
|
||||
this.isorter.column = sorter.field;
|
||||
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
|
||||
}
|
||||
this.ipagination = pagination;
|
||||
this.loadData();
|
||||
},
|
||||
loadData() {
|
||||
taskPageList(this.queryParam).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.rows||res.result;
|
||||
if(res.result.total)
|
||||
{
|
||||
this.ipagination.total = res.result.total;
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete: function (id) {
|
||||
var that = this;
|
||||
taskDeleteById({id: id}).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleEdit: function (record) {
|
||||
this.$refs.modalForm.edit(record);
|
||||
this.$refs.modalForm.title = "编辑";
|
||||
},
|
||||
handleDistribute:function (id) {
|
||||
var that = this;
|
||||
taskDistributeTask({id: id}).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.loadData();
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.modalForm.add();
|
||||
this.$refs.modalForm.title = "新增";
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
220
src/views/task/modules/taskModal.vue
Normal file
|
@ -0,0 +1,220 @@
|
|||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
okText="保存"
|
||||
cancelText="关闭">
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<a-form-item label="任务名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input v-decorator="['name']" ></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="选择型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select show-search
|
||||
placeholder="选择型号"
|
||||
option-filter-prop="children" :filter-option="filterOption" size="large" v-decorator="['shipModelId', {}]"
|
||||
@change="selectModel">
|
||||
<a-select-option v-for="d in shipMode" :key="d.id">
|
||||
{{ d.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="选择舷号" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select show-search
|
||||
placeholder="选择舷号"
|
||||
option-filter-prop="children" :filter-option="filterOption" size="large" v-decorator="['shipNumId', {}]">
|
||||
<a-select-option v-for="d in shipNum" :key="d.id">
|
||||
{{ d.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="开始结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-range-picker
|
||||
style="width:500px"
|
||||
:show-time="{ format: 'HH:mm:ss' }"
|
||||
v-model="rangeTime"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
:placeholder="['任务开始时间', '任务结束时间']"
|
||||
@change="onChange"
|
||||
@ok="onOk"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
label="说明">
|
||||
<a-textarea placeholder="请输入描述" :rows="3" v-decorator="['describe', {}]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment"
|
||||
import {
|
||||
shipNumPageList,
|
||||
shipNumQueryByModelId,
|
||||
shipModelPageList
|
||||
} from '@/api/ship'
|
||||
import { taskCreate,
|
||||
taskUpdateById } from '@/api/task'
|
||||
import JCron from "@/components/jeecg/JCron";
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
|
||||
export default {
|
||||
name: "taskModal",
|
||||
components: {
|
||||
JCron,
|
||||
JSelectMultiple
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
title:"操作",
|
||||
buttonStyle: 'solid',
|
||||
visible: false,
|
||||
dateFormat:'YYYY-MM-DD HH:mm',
|
||||
status:'',
|
||||
model: {},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
strategys:[],
|
||||
dataStrategySelected:'',
|
||||
idcDataStrategyId:"",
|
||||
shipMode:{},
|
||||
shipNum:{},
|
||||
rangeTime:[],
|
||||
queryParam: {
|
||||
pageNum :1,
|
||||
pageSize:20
|
||||
},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
shipModelPageList(this.queryParam).then((res) => {
|
||||
if (res.success) {
|
||||
this.shipMode = res.result.rows
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
shipNumPageList(this.queryParam).then((res) => {
|
||||
if (res.success) {
|
||||
this.shipNum = res.result.rows
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
filterOption(input, option) {
|
||||
return (
|
||||
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
);
|
||||
},
|
||||
selectModel(value){
|
||||
shipNumQueryByModelId({modelId:value}).then((res) => {
|
||||
if (res.success) {
|
||||
this.shipNum = res.result
|
||||
} else {
|
||||
this.$message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
add () {
|
||||
this.rangeTime=[];
|
||||
this.edit({});
|
||||
},
|
||||
edit (record) {
|
||||
this.visible =true;
|
||||
let that = this;
|
||||
that.form.resetFields();
|
||||
this.model = Object.assign({},record);
|
||||
this.rangeTime.push(moment(this.model.startTime),moment(this.model.endTime))
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'name','describe','shipModelId','shipNumId'));
|
||||
});
|
||||
},
|
||||
onChange(value, dateString) {
|
||||
this.model.startDate = dateString[0];
|
||||
this.model.endDate = dateString[1];
|
||||
},
|
||||
onOk(value) {
|
||||
this.model.startDate = moment(value[0],dateFormat);
|
||||
this.model.endDate = moment(value[1],dateFormat);
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
console.log('values',values)
|
||||
if (!err) {
|
||||
that.confirmLoading = true;
|
||||
if(!this.model.id){
|
||||
this.model.name = values.name;
|
||||
this.model.shipModelId = values.shipModelId;
|
||||
this.model.shipNumId = values.shipNumId;
|
||||
this.model.describe = values.describe;
|
||||
taskCreate(this.model).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}else{
|
||||
taskUpdateById({id:this.model.id,name:values.name,describe:values.describe,shipModelId:values.shipModelId,shipNumId:values.shipNumId,
|
||||
startTime:this.model.startTime,endTime:this.model.endTime
|
||||
}).then((res)=>{
|
||||
if(res.success){
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
}else{
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.disabled{
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|