rev:现场代码优化

This commit is contained in:
2026-04-23 17:54:50 +08:00
parent c0f763e153
commit 0cf3d212d1
20 changed files with 295 additions and 52 deletions

View File

@@ -2,6 +2,6 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'http:// 10.4.46.150:8011'
VUE_APP_BASE_API = 'http:// 172.30.15.231:8011'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws:// 10.4.46.150:8011'
VUE_APP_WS_API = 'ws:// 172.30.15.231:8011'

View File

@@ -3,7 +3,7 @@ window.g = {
VUE_APP_BASE_API: 'http://127.0.0.1:8011'
},
prod: {
VUE_APP_BASE_API: 'http://10.4.46.150:8011'
VUE_APP_BASE_API: 'http://172.30.15.231:8011'
}

View File

@@ -104,6 +104,7 @@
<span v-if="scope.row.instruction_status=='0' ">就绪</span>
<span v-if="scope.row.instruction_status=='1' ">执行中</span>
<span v-if="scope.row.instruction_status=='2' ">完成</span>
<span v-if="scope.row.instruction_status=='3' ">取消</span>
</template>
</el-table-column>
<el-table-column prop="start_point_code" label="起点" />

View File

@@ -66,10 +66,31 @@
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<Search />
<el-date-picker
v-model="query.createTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
@change="crud.toQuery"
/>
<rrOperation />
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<crudOperation :permission="permission" >
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-thumb"
size="mini"
:loading="showDtlLoading"
@click="downdtl"
>
导出
</el-button>
</crudOperation>
<!--表单组件-->
<el-dialog
:close-on-click-modal="false"
@@ -237,6 +258,7 @@
<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>
<span v-if="scope.row.task_status=='3' ">取消</span>
</template>
</el-table-column>
<el-table-column prop="priority" label="任务优先级" />
@@ -259,10 +281,13 @@ import Search from '@/views/monitor/lucene/time'
import crudTask from '@/api/acs/task/task'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import deviceCrud from '@/api/acs/device/device'
import routeCurd from '@/api/acs/route/routePlan'
import { getDicts } from '@/api/system/dict'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
const defaultForm = {
task_id: null,
@@ -286,7 +311,7 @@ const defaultForm = {
}
export default {
name: 'Task',
components: { pagination, crudOperation, Search },
components: { pagination, crudOperation, rrOperation, Search },
dicts: ['task_status'],
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
@@ -356,6 +381,7 @@ export default {
toZList: [],
start_flag: false,
end_flag: false,
showDtlLoading: false,
permission: {
add: ['admin', 'task:add'],
edit: ['admin', 'task:edit'],
@@ -538,6 +564,29 @@ export default {
this.form.to_y = ''
this.form.to_z = ''
}
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true
const data = {
'task_code': this.crud.query.task_code,
'vehicle_code': this.crud.query.vehicle_code,
'material_type': this.crud.query.material_type,
'status': this.crud.query.status,
'point_code': this.crud.query.point_code,
'createTime': this.crud.query.createTime[0],
'end_time': this.crud.query.createTime[1]
}
this.showDtlLoading = true
download('/api/task/download', data).then(result => {
downloadFile(result, '任务详情', 'xlsx')
crud.downloadLoading = false
this.showDtlLoading = false
}).catch(() => {
crud.downloadLoading = false
this.showDtlLoading = false
})
}
}
}
}

View File

@@ -94,6 +94,7 @@
<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>
<span v-if="scope.row.task_status=='3' ">取消</span>
</template>
</el-table-column>
<el-table-column prop="priority" label="任务优先级" />

View File

@@ -134,6 +134,7 @@
<span v-if="scope.row.instruction_status=='0' ">就绪</span>
<span v-if="scope.row.instruction_status=='1' ">执行中</span>
<span v-if="scope.row.instruction_status=='2' ">完成</span>
<span v-if="scope.row.instruction_status=='3' ">取消</span>
</template>
</el-table-column>
<el-table-column prop="send_status" label="下发状态">

View File

@@ -338,6 +338,7 @@
<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>
<span v-if="scope.row.task_status==='3' ">取消</span>
</template>
</el-table-column>
<el-table-column prop="priority" label="优先级" width="100" />