add: 历史记录模块添加导出功能
This commit is contained in:
BIN
acs/nladmin-ui/src/assets/images/logo2.png
Normal file
BIN
acs/nladmin-ui/src/assets/images/logo2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
@@ -1,17 +1,17 @@
|
||||
export default {
|
||||
'Auto': {
|
||||
'table': {
|
||||
'name': '名称',
|
||||
'code': '编号',
|
||||
'status': '状态',
|
||||
'thread_name': '线程名',
|
||||
'thread_state': '线程状态',
|
||||
'usedStatus': '使用状态',
|
||||
'stopMessage': '停止信息',
|
||||
'operate': '操作',
|
||||
},
|
||||
'msg': {
|
||||
'stop_msg': '确定停止该线程吗?'
|
||||
}
|
||||
'Auto': {
|
||||
'table': {
|
||||
'name': '名称',
|
||||
'code': '编号',
|
||||
'status': '状态',
|
||||
'thread_name': '线程名',
|
||||
'thread_state': '线程状态',
|
||||
'usedStatus': '使用状态',
|
||||
'stopMessage': '停止信息',
|
||||
'operate': '操作'
|
||||
},
|
||||
'msg': {
|
||||
'stop_msg': '确定停止该线程吗?'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ export default {
|
||||
'inst_nextdevice_code': 'Command destination device',
|
||||
'destination_configuration': 'Destination configuration',
|
||||
'operation': 'Operation',
|
||||
'device_is_not_null': 'Device code cannot be empty'
|
||||
'device_is_not_null': 'Device code cannot be empty',
|
||||
'mapping_relationship': 'Mapping relationship'
|
||||
},
|
||||
'rules': {
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ export default {
|
||||
'inst_nextdevice_code': 'Perangkat tujuan perintah',
|
||||
'destination_configuration': 'Konfigurasi tujuan',
|
||||
'operation': 'Operasi',
|
||||
'device_is_not_null': 'Kode perangkat tidak boleh kosong'
|
||||
'device_is_not_null': 'Kode perangkat tidak boleh kosong',
|
||||
'mapping_relationship': 'Hubungan pemetaan'
|
||||
},
|
||||
'rules': {
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ export default {
|
||||
'inst_nextdevice_code': '指令终点设备',
|
||||
'destination_configuration': '终点配置',
|
||||
'operation': '操作',
|
||||
'device_is_not_null': '设备编码不能为空'
|
||||
'device_is_not_null': '设备编码不能为空',
|
||||
'mapping_relationship': '映射关系'
|
||||
},
|
||||
'rules': {
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
const defaultForm = {
|
||||
assigned_id: null,
|
||||
@@ -149,7 +150,7 @@ export default {
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '映射关系', url: 'api/deviceAssigned', idField: 'assigned_id', sort: 'assignned_id', optShow: {
|
||||
title: i18n.t('config.table.mapping_relationship'), url: 'api/deviceAssigned', idField: 'assigned_id', sort: 'assignned_id', optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true
|
||||
|
||||
@@ -134,6 +134,7 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
const defaultForm = {
|
||||
assigned_id: null,
|
||||
@@ -149,7 +150,7 @@ export default {
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '映射关系', url: 'api/deviceAssigned', idField: 'assigned_id', sort: 'assignned_id', optShow: {
|
||||
title: i18n.t('config.table.mapping_relationship'), url: 'api/deviceAssigned', idField: 'assigned_id', sort: 'assignned_id', optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true
|
||||
|
||||
@@ -58,12 +58,24 @@
|
||||
<Search />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:loading="downLoadInstLogging"
|
||||
@click="doExportInstLogging()"
|
||||
>
|
||||
{{ $t('common.Export') }}
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:visible.sync="crud.status.cu"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
@@ -129,6 +141,8 @@ import crudInstruction from '@/api/acs/instruction/instruction'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import { getDicts } from '@/views/system/dict/dict'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
const defaultForm = {
|
||||
instruction_id: null,
|
||||
@@ -241,7 +255,25 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
|
||||
doExportInstLogging() {
|
||||
this.downLoadTaskLogging = true
|
||||
const params = {
|
||||
code: this.query.task_code,
|
||||
vehicle_code: this.query.vehicle_code,
|
||||
material_type: this.query.material_type,
|
||||
status: this.query.status,
|
||||
point_code: this.crud.pointCode,
|
||||
createTime: this.crud.createTime,
|
||||
end_time: this.crud.endTime // 假设 this.crud.endTime 是你的结束时间
|
||||
}
|
||||
const url = '/api/instruction/downloadInstLogging'
|
||||
download(url, params).then(result => {
|
||||
downloadFile(result, this.crud.title + '数据', 'csv')
|
||||
this.downLoadTaskTreeLogging = false
|
||||
}).catch(() => {
|
||||
this.downLoadTaskTreeLogging = false
|
||||
})
|
||||
},
|
||||
beforeHandleCommand(index, row, command) {
|
||||
return {
|
||||
'index': index,
|
||||
|
||||
@@ -69,7 +69,19 @@
|
||||
<Search />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:loading="downLoadTaskLogging"
|
||||
@click="doExportTaskLogging()"
|
||||
>
|
||||
{{ $t('common.Export') }}
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
@@ -263,6 +275,8 @@ import pagination from '@crud/Pagination'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import routeCurd from '@/api/acs/route/routePlan'
|
||||
import { getDicts } from '@/views/system/dict/dict'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
const defaultForm = {
|
||||
task_id: null,
|
||||
@@ -427,7 +441,25 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
|
||||
doExportTaskLogging() {
|
||||
this.downLoadTaskLogging = true
|
||||
const params = {
|
||||
task_code: this.query.task_code,
|
||||
vehicle_code: this.query.vehicle_code,
|
||||
material_type: this.query.material_type,
|
||||
status: this.query.status,
|
||||
point_code: this.crud.pointCode,
|
||||
createTime: this.crud.createTime,
|
||||
end_time: this.crud.endTime // 假设 this.crud.endTime 是你的结束时间
|
||||
}
|
||||
const url = 'api/task/downloadTaskLogging'
|
||||
download(url, params).then(result => {
|
||||
downloadFile(result, this.crud.title + '数据', 'csv')
|
||||
this.downLoadTaskTreeLogging = false
|
||||
}).catch(() => {
|
||||
this.downLoadTaskTreeLogging = false
|
||||
})
|
||||
},
|
||||
beforeHandleCommand(index, row, command) {
|
||||
return {
|
||||
'index': index,
|
||||
|
||||
@@ -69,7 +69,19 @@
|
||||
<Search />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:loading="downLoadTaskTreeLogging"
|
||||
@click="doExportTaskTreeLogging()"
|
||||
>
|
||||
{{ $t('common.Export') }}
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -123,6 +135,8 @@ import pagination from '@crud/Pagination'
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import routeCurd from '@/api/acs/route/routePlan'
|
||||
import { getDicts } from '@/views/system/dict/dict'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
const defaultForm = {
|
||||
task_id: null,
|
||||
@@ -141,11 +155,16 @@ export default {
|
||||
dicts: ['task_status'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '任务', url: 'api/task/getAll', idField: 'task_id', sort: 'task_id,desc', crudMethod: { ...crudTask }, optShow: {
|
||||
}})
|
||||
return [
|
||||
CRUD({ title: '任务', url: 'api/task/getAll', idField: 'task_id', sort: 'task_id,desc', crudMethod: { ...crudTask }, optShow: {
|
||||
// ...
|
||||
}})/* ,
|
||||
CRUD({ title: '设备协议', url: 'api/device/protocol', idField: 'id', sort: 'id,desc', optShow: { download: false }}) */
|
||||
]
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
downLoadTaskTreeLogging: false,
|
||||
deviceList: [],
|
||||
materialList: [],
|
||||
statusList: [],
|
||||
@@ -196,6 +215,25 @@ export default {
|
||||
resolve(res.content)
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
doExportTaskTreeLogging() {
|
||||
this.downLoadTaskTreeLogging = true
|
||||
const params = {
|
||||
task_code: this.query.task_code,
|
||||
vehicle_code: this.query.vehicle_code,
|
||||
material_type: this.query.material_type,
|
||||
status: this.query.is_over,
|
||||
point_code: this.crud.pointCode,
|
||||
createTime: this.crud.createTime,
|
||||
end_time: this.crud.endTime // 假设 this.crud.endTime 是你的结束时间
|
||||
}
|
||||
const url = 'api/task/downloadTaskTreeLogging'
|
||||
download(url, params).then(result => {
|
||||
downloadFile(result, this.crud.title + '数据', 'csv')
|
||||
this.downLoadTaskTreeLogging = false
|
||||
}).catch(() => {
|
||||
this.downLoadTaskTreeLogging = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user