12 changed files with 223 additions and 699 deletions
@ -0,0 +1,15 @@ |
|||||
|
package org.nl.modules.lucence.enums; |
||||
|
|
||||
|
public enum LogTypeEnum { |
||||
|
DEVICE_LOG("设备日志"), |
||||
|
INTERFACE_LOG("接口日志"); |
||||
|
|
||||
|
private String desc; |
||||
|
|
||||
|
LogTypeEnum(String desc) { |
||||
|
this.desc = desc; |
||||
|
} |
||||
|
public String getDesc() { |
||||
|
return desc; |
||||
|
} |
||||
|
} |
@ -1,555 +1,109 @@ |
|||||
<template> |
<template> |
||||
<div class="app-container"> |
<div class="app-container"> |
||||
<!--工具栏--> |
|
||||
<div class="head-container"> |
<div class="head-container"> |
||||
<div v-if="crud.props.searchToggle"> |
<Search /> |
||||
<!-- 搜索 --> |
<crudOperation /> |
||||
<el-input |
|
||||
v-model="query.task_code" |
|
||||
size="small" |
|
||||
clearable |
|
||||
placeholder="输入任务号" |
|
||||
style="width: 200px;" |
|
||||
class="filter-item" |
|
||||
@keyup.enter.native="crud.toQuery" |
|
||||
/> |
|
||||
<el-input |
|
||||
v-if="false" |
|
||||
v-model="query.is_over" |
|
||||
value="1" |
|
||||
size="small" |
|
||||
clearable |
|
||||
placeholder="输入任务号" |
|
||||
style="width: 200px;" |
|
||||
class="filter-item" |
|
||||
@keyup.enter.native="crud.toQuery" |
|
||||
/> |
|
||||
<el-input |
|
||||
v-model="query.vehicle_code" |
|
||||
size="small" |
|
||||
clearable |
|
||||
placeholder="输入载具号" |
|
||||
style="width: 200px;" |
|
||||
class="filter-item" |
|
||||
@keyup.enter.native="crud.toQuery" |
|
||||
/> |
|
||||
<el-select |
|
||||
v-model="query.material_type" |
|
||||
clearable |
|
||||
filterable |
|
||||
size="small" |
|
||||
placeholder="物料类型" |
|
||||
class="filter-item" |
|
||||
style="width: 190px" |
|
||||
@change="crud.toQuery" |
|
||||
> |
|
||||
<el-option v-for="item in materialList" :key="item.id" :label="item.label" :value="item.value" /> |
|
||||
</el-select> |
|
||||
<el-select |
|
||||
v-model="query.status" |
|
||||
clearable |
|
||||
filterable |
|
||||
size="small" |
|
||||
placeholder="任务状态" |
|
||||
class="filter-item" |
|
||||
style="width: 190px" |
|
||||
@change="crud.toQuery" |
|
||||
> |
|
||||
<el-option v-for="item in dict.task_status" :key="item.id" :label="item.label" :value="item.value" /> |
|
||||
</el-select> |
|
||||
<el-input |
|
||||
v-model="query.point_code" |
|
||||
size="small" |
|
||||
clearable |
|
||||
placeholder="输入起点或终点" |
|
||||
style="width: 200px;" |
|
||||
class="filter-item" |
|
||||
@keyup.enter.native="crud.toQuery" |
|
||||
/> |
|
||||
<Search /> |
|
||||
</div> |
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
|
||||
<crudOperation :permission="permission" /> |
|
||||
<!--表单组件--> |
|
||||
<el-dialog |
|
||||
:close-on-click-modal="false" |
|
||||
:before-close="crud.cancelCU" |
|
||||
:visible.sync="crud.status.cu > 0" |
|
||||
:title="crud.status.title" |
|
||||
width="500px" |
|
||||
> |
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px"> |
|
||||
<el-form-item v-if="false" label="任务标识" prop="task_id"> |
|
||||
<el-input v-model="form.task_id" style="width: 370px;" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="物料类型"> |
|
||||
<el-select |
|
||||
v-model="form.material" |
|
||||
style="width: 370px;" |
|
||||
filterable |
|
||||
placeholder="请选择" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in dict.material_type" |
|
||||
:key="item.id" |
|
||||
:label="item.label" |
|
||||
:value="item.value" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="路由方案"> |
|
||||
<el-select |
|
||||
v-model="form.route_plan_code" |
|
||||
style="width: 370px;" |
|
||||
filterable |
|
||||
placeholder="请选择" |
|
||||
default-first-option |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in routeList" |
|
||||
:key="item.plan_code" |
|
||||
:label="item.plan_name" |
|
||||
:value="item.plan_code" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="起点" prop="start_point_code"> |
|
||||
<el-select |
|
||||
v-model="form.start_point_code" |
|
||||
style="width: 370px;" |
|
||||
filterable |
|
||||
placeholder="请选择" |
|
||||
@change="showStartStorage" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in deviceList" |
|
||||
:key="item.device_code" |
|
||||
:label="item.device_name" |
|
||||
:value="item.device_code" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-show="start_flag" label="起点-列" prop="from_y"> |
|
||||
<el-select |
|
||||
v-model="form.from_y" |
|
||||
style="width: 370px;" |
|
||||
filterable |
|
||||
placeholder="请选择" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in fromYList" |
|
||||
:key="item.id" |
|
||||
:label="item.value" |
|
||||
:value="item.id" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-show="start_flag" label="起点-层" prop="from_z"> |
|
||||
<el-select |
|
||||
v-model="form.from_z" |
|
||||
style="width: 370px;" |
|
||||
filterable |
|
||||
placeholder="请选择" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in fromZList" |
|
||||
:key="item.id" |
|
||||
:label="item.value" |
|
||||
:value="item.id" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="终点" prop="next_point_code"> |
|
||||
<el-select |
|
||||
v-model="form.next_point_code" |
|
||||
style="width: 370px;" |
|
||||
filterable |
|
||||
placeholder="请选择" |
|
||||
@change="showEndStorage" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in deviceList" |
|
||||
:key="item.device_code" |
|
||||
:label="item.device_name" |
|
||||
:value="item.device_code" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-show="end_flag" label="终点-列" prop="to_y"> |
|
||||
<el-select |
|
||||
v-model="form.to_y" |
|
||||
style="width: 370px;" |
|
||||
filterable |
|
||||
placeholder="请选择" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in toYList" |
|
||||
:key="item.id" |
|
||||
:label="item.value" |
|
||||
:value="item.id" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item v-show="end_flag" label="终点-层" prop="to_z"> |
|
||||
<el-select |
|
||||
v-model="form.to_z" |
|
||||
style="width: 370px;" |
|
||||
filterable |
|
||||
placeholder="请选择" |
|
||||
> |
|
||||
<el-option |
|
||||
v-for="item in toZList" |
|
||||
:key="item.id" |
|
||||
:label="item.value" |
|
||||
:value="item.id" |
|
||||
/> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="优先级"> |
|
||||
<el-input v-model="form.priority" style="width: 370px;" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="载具号"> |
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" /> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="描述信息" prop="description"> |
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="5" type="textarea" /> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
<div slot="footer" class="dialog-footer"> |
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
|
||||
</div> |
|
||||
</el-dialog> |
|
||||
<!--表格渲染--> |
|
||||
<el-table |
|
||||
ref="table" |
|
||||
v-loading="crud.loading" |
|
||||
:data="crud.data" |
|
||||
size="small" |
|
||||
style="width: 100%;" |
|
||||
@selection-change="crud.selectionChangeHandler" |
|
||||
> |
|
||||
<el-table-column v-if="false" prop="task_id" label="任务标识" /> |
|
||||
<el-table-column prop="task_code" label="任务号" /> |
|
||||
<el-table-column prop="vehicle_code" label="载具号" /> |
|
||||
<el-table-column prop="task_status" label="任务状态"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-if="scope.row.task_status=='0' ">就绪</span> |
|
||||
<span v-if="scope.row.task_status=='1' ">执行中</span> |
|
||||
<span v-if="scope.row.task_status=='2' ">完成</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="priority" label="任务优先级" /> |
|
||||
<el-table-column prop="start_point_code" label="起点" /> |
|
||||
<el-table-column prop="next_point_code" label="终点" /> |
|
||||
<el-table-column prop="matarial" label="物料" /> |
|
||||
<el-table-column prop="quantity" label="数量" /> |
|
||||
<el-table-column prop="remark" label="备注" /> |
|
||||
<el-table-column prop="create_by" label="创建者" /> |
|
||||
<el-table-column prop="create_time" label="创建时间" width="135" /> |
|
||||
</el-table> |
|
||||
<!--分页组件--> |
|
||||
<pagination /> |
|
||||
</div> |
</div> |
||||
|
<!--表格渲染--> |
||||
|
<el-table |
||||
|
ref="table" |
||||
|
v-loading="crud.loading" |
||||
|
:data="crud.data" |
||||
|
style="width: 100%;" |
||||
|
@selection-change="crud.selectionChangeHandler" |
||||
|
> |
||||
|
<!-- <el-table-column type="selection" width="55"/>--> |
||||
|
<!-- <el-table-column v-if="false" prop="id" label="id"/>--> |
||||
|
<el-table-column prop="operate" width="50" label="操作" /> |
||||
|
<el-table-column prop="device_code" label="设备号" /> |
||||
|
<el-table-column prop="task_code" label="任务编号" /> |
||||
|
<el-table-column prop="instruct_code" label="指令编号" /> |
||||
|
<el-table-column prop="method" label="方法" /> |
||||
|
<el-table-column prop="status_code" label="状态码" /> |
||||
|
<el-table-column prop="requestparam" label="请求参数" /> |
||||
|
<el-table-column prop="responseparam" label="返回参数" /> |
||||
|
<el-table-column prop="logTime" width="170" label="记录时间" /> |
||||
|
<el-table-column prop="content" width="500" label="内容详情" /> |
||||
|
|
||||
|
</el-table> |
||||
|
<!--分页组件--> |
||||
|
<pagination /> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import Search from '@/views/monitor/lucene/time' |
import Search from './search' |
||||
import crudTask from '@/views/monitor/lucene/api/lucene' |
import CRUD, { crud, header, presenter } from '@crud/crud' |
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud' |
|
||||
import crudOperation from '@crud/CRUD.operation' |
import crudOperation from '@crud/CRUD.operation' |
||||
import pagination from '@crud/Pagination' |
import pagination from '@crud/Pagination' |
||||
import deviceCrud from '@/api/acs/device/device' |
import { delAll } from '@/api/acs/lucene/log' |
||||
import routeCurd from '@/api/acs/route/routePlan' |
|
||||
import { getDicts } from '@/api/system/dict' |
|
||||
|
|
||||
const defaultForm = { |
|
||||
task_id: null, |
|
||||
vehicle_code: null, |
|
||||
vehicle_type: null, |
|
||||
task_type: null, |
|
||||
task_status: null, |
|
||||
priority: 0, |
|
||||
start_point_code: null, |
|
||||
start_device_code: null, |
|
||||
next_point_code: null, |
|
||||
remark: null, |
|
||||
material: null, |
|
||||
route_plan_code: 'normal', |
|
||||
from_x: null, |
|
||||
from_y: null, |
|
||||
from_z: null, |
|
||||
to_x: null, |
|
||||
to_y: null, |
|
||||
to_z: null |
|
||||
} |
|
||||
export default { |
export default { |
||||
name: 'Task', |
name: 'LuceneLog', |
||||
components: { pagination, crudOperation, Search }, |
components: { Search, pagination, crudOperation }, |
||||
dicts: ['task_status'], |
mixins: [presenter(), header(), crud()], |
||||
mixins: [presenter(), header(), form(defaultForm), crud()], |
cruds: function() { |
||||
cruds() { |
|
||||
return CRUD({ |
return CRUD({ |
||||
title: '任务', |
title: '系统参数', url: 'api/lucene/getAll', idField: 'id', sort: 'id,desc', |
||||
url: 'api/lucene//getAll', |
queryOnPresenterCreated: true, |
||||
idField: 'task_id', |
optShow: { |
||||
sort: 'task_id,desc', |
add: false, |
||||
query: { is_over: '1' }, |
edit: false, |
||||
crudMethod: { ...crudTask }, |
del: false, |
||||
optShow: {} |
download: false |
||||
|
}, |
||||
|
page: { |
||||
|
size: 40, |
||||
|
total: 0, |
||||
|
page: 0 |
||||
|
}, |
||||
|
query: { |
||||
|
createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24)), new Date()] |
||||
|
} |
||||
}) |
}) |
||||
}, |
}, |
||||
data() { |
data() { |
||||
const checkFromY = (rule, value, callback) => { |
|
||||
if (this.start_flag) { |
|
||||
if (!value) { |
|
||||
callback(new Error('请选择起点-列!')) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} |
|
||||
const checkFromZ = (rule, value, callback) => { |
|
||||
if (this.start_flag) { |
|
||||
if (!value) { |
|
||||
callback(new Error('请选择起点-层!')) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} |
|
||||
const checkToY = (rule, value, callback) => { |
|
||||
if (this.end_flag) { |
|
||||
if (!value) { |
|
||||
callback(new Error('请选择终点-列!')) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} |
|
||||
const checkToZ = (rule, value, callback) => { |
|
||||
if (this.end_flag) { |
|
||||
if (!value) { |
|
||||
callback(new Error('请选择终点-列!')) |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} else { |
|
||||
callback() |
|
||||
} |
|
||||
} |
|
||||
return { |
return { |
||||
deviceList: [], |
query: { blurry: '123' }, |
||||
materialList: [], |
|
||||
statusList: [], |
|
||||
routeList: [], |
|
||||
fromYList: [], |
|
||||
fromZList: [], |
|
||||
toYList: [], |
|
||||
toZList: [], |
|
||||
start_flag: false, |
|
||||
end_flag: false, |
|
||||
permission: { |
permission: { |
||||
add: ['admin', 'task:add'], |
add: ['admin', 'param:add'], |
||||
edit: ['admin', 'task:edit'], |
edit: ['admin', 'param:edit'], |
||||
del: ['admin', 'task:del'] |
del: ['admin', 'param:del'] |
||||
}, |
}, |
||||
rules: { |
|
||||
start_point_code: [ |
rules: {} |
||||
{ required: true, message: '起点不能为空', trigger: 'change' } |
|
||||
], |
|
||||
next_point_code: [ |
|
||||
{ required: true, message: '终点不能为空', trigger: 'change' } |
|
||||
], |
|
||||
from_y: [ |
|
||||
{ validator: checkFromY, trigger: 'change' } |
|
||||
], |
|
||||
from_z: [ |
|
||||
{ validator: checkFromZ, trigger: 'change' } |
|
||||
], |
|
||||
to_y: [ |
|
||||
{ validator: checkToY, trigger: 'change' } |
|
||||
], |
|
||||
to_z: [ |
|
||||
{ validator: checkToZ, trigger: 'change' } |
|
||||
] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
watch: { |
|
||||
rangeDate: function(newVal, oldVal) { |
|
||||
if (newVal !== null) { |
|
||||
this.tableParams.beginDate = newVal[0] |
|
||||
this.tableParams.endDate = newVal[1] |
|
||||
} else { |
|
||||
this.tableParams.beginDate = null |
|
||||
this.tableParams.endDate = null |
|
||||
} |
|
||||
} |
} |
||||
}, |
}, |
||||
created() { |
created() { |
||||
deviceCrud.selectDeviceList().then(data => { |
|
||||
this.deviceList = data |
|
||||
}) |
|
||||
routeCurd.selectList().then(data => { |
|
||||
this.routeList = data |
|
||||
}) |
|
||||
getDicts().then(data => { |
|
||||
this.dicts = data |
|
||||
}) |
|
||||
this.query.a = 111 |
|
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
||||
[CRUD.HOOK.beforeRefresh]() { |
[CRUD.HOOK.beforeRefresh]() { |
||||
return true |
return true |
||||
}, |
}, |
||||
finish(index, row) { |
confirmDelAll() { |
||||
crudTask.finish(row.task_id).then(res => { |
this.$confirm(`确认清空所有操作日志吗?`, '提示', { |
||||
this.crud.toQuery() |
confirmButtonText: '确定', |
||||
this.crud.notify('完成成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
cancelButtonText: '取消', |
||||
}).catch(err => { |
type: 'warning' |
||||
console.log(err.response.data.message) |
}).then(() => { |
||||
}) |
this.crud.delAllLoading = true |
||||
}, |
delAll('device_execute').then(res => { |
||||
cancel(index, row) { |
this.crud.delAllLoading = false |
||||
crudTask.cancel(row.task_id).then(res => { |
this.crud.dleChangePage(1) |
||||
this.crud.toQuery() |
this.crud.delSuccessNotify() |
||||
this.crud.notify('取消成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
this.crud.toQuery() |
||||
}).catch(err => { |
}).catch(err => { |
||||
console.log(err.response.data.message) |
this.crud.delAllLoading = false |
||||
}) |
console.log(err.response.data.message) |
||||
}, |
|
||||
|
|
||||
beforeHandleCommand(index, row, command) { |
|
||||
return { |
|
||||
'index': index, |
|
||||
'row': row, |
|
||||
'command': command |
|
||||
} |
|
||||
}, |
|
||||
handleCommand(command) { |
|
||||
switch (command.command) { |
|
||||
case 'a':// 完成 |
|
||||
this.finish(command.index, command.row) |
|
||||
break |
|
||||
case 'b':// 取消 |
|
||||
this.cancel(command.index, command.row) |
|
||||
break |
|
||||
} |
|
||||
}, |
|
||||
showStartStorage(val) { |
|
||||
let obj = {} |
|
||||
obj = this.deviceList.find((item) => { |
|
||||
return item.device_code === val |
|
||||
}) |
|
||||
if (obj.device_type === 'storage') { |
|
||||
this.start_flag = true |
|
||||
let storage_obj = {} |
|
||||
deviceCrud.queryStorageExtra(obj.device_code).then(data => { |
|
||||
storage_obj = data |
|
||||
const n1 = storage_obj.minY |
|
||||
const n2 = storage_obj.maxY |
|
||||
const m1 = storage_obj.minZ |
|
||||
const m2 = storage_obj.maxZ |
|
||||
const from_y = [] |
|
||||
const from_z = [] |
|
||||
for (let i = n1; i <= n2; i++) { |
|
||||
const y = {} |
|
||||
if (i < 10) { |
|
||||
y.id = '0' + i |
|
||||
} else { |
|
||||
y.id = i |
|
||||
} |
|
||||
y.value = i + '列' |
|
||||
from_y.push(y) |
|
||||
} |
|
||||
for (let i = m1; i <= m2; i++) { |
|
||||
const z = {} |
|
||||
if (i < 10) { |
|
||||
z.id = '0' + i |
|
||||
} else { |
|
||||
z.id = i |
|
||||
} |
|
||||
z.value = i + '层' |
|
||||
from_z.push(z) |
|
||||
} |
|
||||
this.fromYList = from_y |
|
||||
this.fromZList = from_z |
|
||||
this.form.from_x = storage_obj.tunnel |
|
||||
}) |
}) |
||||
} else { |
}).catch(() => { |
||||
this.start_flag = false |
|
||||
this.form.from_x = '' |
|
||||
this.form.from_y = '' |
|
||||
this.form.from_z = '' |
|
||||
} |
|
||||
}, |
|
||||
showEndStorage(val) { |
|
||||
let obj = {} |
|
||||
obj = this.deviceList.find((item) => { |
|
||||
return item.device_code === val |
|
||||
}) |
}) |
||||
if (obj.device_type === 'storage') { |
|
||||
this.end_flag = true |
|
||||
let storage_obj = {} |
|
||||
deviceCrud.queryStorageExtra(obj.device_code).then(data => { |
|
||||
storage_obj = data |
|
||||
const n1 = storage_obj.minY |
|
||||
const n2 = storage_obj.maxY |
|
||||
const m1 = storage_obj.minZ |
|
||||
const m2 = storage_obj.maxZ |
|
||||
const to_y = [] |
|
||||
const to_z = [] |
|
||||
for (let i = n1; i <= n2; i++) { |
|
||||
const y = {} |
|
||||
if (i < 10) { |
|
||||
y.id = '0' + i |
|
||||
} else { |
|
||||
y.id = i |
|
||||
} |
|
||||
y.value = i + '列' |
|
||||
to_y.push(y) |
|
||||
} |
|
||||
for (let i = m1; i <= m2; i++) { |
|
||||
const z = {} |
|
||||
if (i < 10) { |
|
||||
z.id = '0' + i |
|
||||
} else { |
|
||||
z.id = i |
|
||||
} |
|
||||
z.value = i + '层' |
|
||||
to_z.push(z) |
|
||||
} |
|
||||
this.toYList = to_y |
|
||||
this.toZList = to_z |
|
||||
this.form.to_x = storage_obj.tunnel |
|
||||
}) |
|
||||
} else { |
|
||||
this.end_flag = false |
|
||||
this.form.to_x = '' |
|
||||
this.form.to_y = '' |
|
||||
this.form.to_z = '' |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
</script> |
</script> |
||||
|
|
||||
<style scoped> |
<style scoped> |
||||
.el-dropdown-link { |
|
||||
cursor: pointer; |
|
||||
color: #409EFF; |
|
||||
} |
|
||||
|
|
||||
.el-icon-arrow-down { |
|
||||
font-size: 12px; |
|
||||
} |
|
||||
</style> |
</style> |
||||
|
@ -1,107 +0,0 @@ |
|||||
<template> |
|
||||
<div class="app-container"> |
|
||||
<div class="head-container"> |
|
||||
<Search /> |
|
||||
<crudOperation /> |
|
||||
</div> |
|
||||
<!--表格渲染--> |
|
||||
<el-table |
|
||||
ref="table" |
|
||||
v-loading="crud.loading" |
|
||||
:data="crud.data" |
|
||||
style="width: 100%;" |
|
||||
@selection-change="crud.selectionChangeHandler" |
|
||||
> |
|
||||
<!-- <el-table-column type="selection" width="55"/>--> |
|
||||
<!-- <el-table-column v-if="false" prop="id" label="id"/>--> |
|
||||
<el-table-column prop="operate" width="50" label="操作" /> |
|
||||
<el-table-column prop="device_code" label="设备号" /> |
|
||||
<el-table-column prop="task_code" label="任务编号" /> |
|
||||
<el-table-column prop="instruct_code" label="指令编号" /> |
|
||||
<el-table-column prop="logTime" width="170" label="记录时间" /> |
|
||||
<el-table-column prop="content" width="500" label="内容详情" /> |
|
||||
|
|
||||
</el-table> |
|
||||
<!--分页组件--> |
|
||||
<pagination /> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import Search from './search' |
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud' |
|
||||
import crudOperation from '@crud/CRUD.operation' |
|
||||
import pagination from '@crud/Pagination' |
|
||||
import { delAll } from '@/api/acs/lucene/log' |
|
||||
|
|
||||
/* const start = new Date() */ |
|
||||
export default { |
|
||||
name: 'LuceneLog', |
|
||||
components: { Search, pagination, crudOperation }, |
|
||||
mixins: [presenter(), header(), crud()], |
|
||||
cruds() { |
|
||||
return CRUD({ |
|
||||
title: '系统参数', url: 'api/lucene/getAll', idField: 'id', sort: 'id,desc', |
|
||||
queryOnPresenterCreated: false, |
|
||||
optShow: { |
|
||||
add: false, |
|
||||
edit: false, |
|
||||
del: false, |
|
||||
download: false |
|
||||
}, |
|
||||
page: { |
|
||||
size: 40, |
|
||||
total: 0, |
|
||||
page: 0 |
|
||||
}, |
|
||||
query: { |
|
||||
/* createTime: [start.setTime(start.getTime() - 3600 * 1000 * 0.5), new Date()] */ |
|
||||
/* createTime: [start, new Date()] */ |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
query: { blurry: '123' }, |
|
||||
permission: { |
|
||||
add: ['admin', 'param:add'], |
|
||||
edit: ['admin', 'param:edit'], |
|
||||
del: ['admin', 'param:del'] |
|
||||
}, |
|
||||
|
|
||||
rules: {} |
|
||||
} |
|
||||
}, |
|
||||
created() { |
|
||||
}, |
|
||||
methods: { |
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|
||||
[CRUD.HOOK.beforeRefresh]() { |
|
||||
return true |
|
||||
}, |
|
||||
confirmDelAll() { |
|
||||
this.$confirm(`确认清空所有操作日志吗?`, '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.crud.delAllLoading = true |
|
||||
delAll('device_execute').then(res => { |
|
||||
this.crud.delAllLoading = false |
|
||||
this.crud.dleChangePage(1) |
|
||||
this.crud.delSuccessNotify() |
|
||||
this.crud.toQuery() |
|
||||
}).catch(err => { |
|
||||
this.crud.delAllLoading = false |
|
||||
console.log(err.response.data.message) |
|
||||
}) |
|
||||
}).catch(() => { |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
|
|
||||
</style> |
|
Loading…
Reference in new issue