mirror of https://gitee.com/pnoker/dc3-web.git
parent
992a602d14
commit
8b923215da
@ -1,201 +0,0 @@
|
||||
<template>
|
||||
<el-col :span="24">
|
||||
<base-card>
|
||||
<avue-crud :option="listOption"
|
||||
:data="listData"
|
||||
:page="page"
|
||||
:table-loading="loading"
|
||||
ref="crud"
|
||||
v-model="listForm"
|
||||
@on-load="list"
|
||||
@row-update="listUpdate"
|
||||
@search-reset="searchReset"
|
||||
@search-change="searchChange"
|
||||
@refresh-change="refreshChange"
|
||||
@size-change="sizeChange"
|
||||
@current-change="currentChange"
|
||||
>
|
||||
</avue-crud>
|
||||
</base-card>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {dictionaryApi, scheduleApi} from '@/api/manager'
|
||||
import {successMessage} from "@/util/util";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {},
|
||||
listForm: {},
|
||||
listData: [],
|
||||
listOption: {
|
||||
tip: false,
|
||||
index: true,
|
||||
stripe: true,
|
||||
border: true,
|
||||
addBtn: false,
|
||||
viewBtn: true,
|
||||
delBtn: false,
|
||||
height: 664,
|
||||
align: 'center',
|
||||
column: [
|
||||
{
|
||||
label: '任务',
|
||||
prop: 'name',
|
||||
span: 12,
|
||||
disabled: true
|
||||
}, {
|
||||
label: '所属设备',
|
||||
prop: 'deviceId',
|
||||
span: 12,
|
||||
search: true,
|
||||
searchSpan: 16,
|
||||
disabled: true,
|
||||
type: 'tree',
|
||||
dicData: [],
|
||||
defaultExpandAll: true
|
||||
}, {
|
||||
label: '表达式',
|
||||
prop: 'cornExpression',
|
||||
span: 18,
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入 调度表达式',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
span: 6,
|
||||
width: 80,
|
||||
search: true,
|
||||
searchSpan: 8,
|
||||
type: 'select',
|
||||
searchFilterable: true,
|
||||
value: 2,
|
||||
dicData: [
|
||||
{
|
||||
label: '停止',
|
||||
value: 0
|
||||
}, {
|
||||
label: '启动',
|
||||
value: 1
|
||||
}, {
|
||||
label: '暂停',
|
||||
value: 2
|
||||
}
|
||||
],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择状态',
|
||||
trigger: 'click'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
label: '备注',
|
||||
prop: 'description',
|
||||
width: 300,
|
||||
span: 24,
|
||||
type: 'textarea',
|
||||
overHidden: true,
|
||||
rules: [
|
||||
{
|
||||
max: 380,
|
||||
message: '最多输入380个字符',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
label: '修改日期',
|
||||
prop: 'updateTime',
|
||||
width: 155,
|
||||
span: 12,
|
||||
disabled: true,
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss'
|
||||
}, {
|
||||
label: '创建日期',
|
||||
prop: 'createTime',
|
||||
width: 155,
|
||||
span: 12,
|
||||
disabled: true,
|
||||
type: 'date',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss'
|
||||
}
|
||||
]
|
||||
},
|
||||
loading: true,
|
||||
page: {
|
||||
total: 0,
|
||||
pageSize: 20,
|
||||
currentPage: 1
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.device();
|
||||
},
|
||||
methods:
|
||||
{
|
||||
list(page) {
|
||||
this.loading = true;
|
||||
scheduleApi.list(Object.assign({
|
||||
page: {
|
||||
current: page.currentPage,
|
||||
size: page.pageSize
|
||||
}
|
||||
}, this.query)).then(res => {
|
||||
const data = res.data;
|
||||
this.page.total = data.total;
|
||||
this.listData = data.records;
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
device() {
|
||||
dictionaryApi.deviceDictionary('group').then(res => {
|
||||
this.listOption.column[this.$refs.crud.findColumnIndex('deviceId')].dicData = res.data;
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
},
|
||||
listUpdate(row, index, done, loading) {
|
||||
scheduleApi.update(row).then(() => {
|
||||
loading();
|
||||
this.list(this.page);
|
||||
successMessage();
|
||||
}).finally(() => {
|
||||
done();
|
||||
});
|
||||
},
|
||||
refreshChange() {
|
||||
this.list(this.page);
|
||||
},
|
||||
currentChange(page) {
|
||||
this.page.currentPage = page;
|
||||
},
|
||||
sizeChange(pageSize) {
|
||||
this.page.pageSize = pageSize;
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = params;
|
||||
this.list(this.page);
|
||||
done();
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.list(this.page);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
</style>
|
Loading…
Reference in new issue