Browse Source

抽离发布任务

master
maochaoying 2 years ago
parent
commit
d96c5adacf
  1. 2
      .env
  2. 167
      src/components/Publish.vue
  3. 28
      src/components/Task.vue
  4. 32
      src/pages/index.vue

2
.env

@ -15,4 +15,4 @@ VITE_HOST_URL=http://127.0.0.1:8081/
# VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.111:8899/websocket/nuclear
# # VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear
# VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.111:8899/ws/cmd
# VITE_HOST_URL=http://192.168.1.111:8899/
# VITE_HOST_URL=http://192.168.1.111:8899/

167
src/components/Publish.vue

@ -1,89 +1,91 @@
<template>
<t-form
:data="formData"
:rules="pubRules"
ref="form"
@reset="onReset"
@submit="onSubmit"
>
<t-form-item
label="任务名称"
help="任务名称用来直观的说明本次操作"
name="taskName"
<div class="publish_container_component">
<t-form
:data="formData"
:rules="pubRules"
ref="form"
@reset="onReset"
@submit="onSubmit"
>
<t-input
v-model="formData.taskName"
placeholder="请输入任务名称"
></t-input>
</t-form-item>
<t-form-item label="核查顺序" name="checkOrder">
<t-radio-group v-model="formData.checkOrder">
<t-radio value="0">横向</t-radio>
<t-radio value="1">纵向</t-radio>
</t-radio-group>
</t-form-item>
<t-form-item label="核电站" name="nuclearStationId">
<t-select
v-model="formData.nuclearStationId"
class="demo-select-base"
clearable
filterable
@change="handleStationChange"
placeholder="请选择所在核电站"
<t-form-item
label="任务名称"
help="任务名称用来直观的说明本次操作"
name="taskName"
>
<t-option
v-for="item in stationList"
:value="item.id"
:label="item.name"
:key="item.id"
<t-input
v-model="formData.taskName"
placeholder="请输入任务名称"
></t-input>
</t-form-item>
<t-form-item label="核查顺序" name="checkOrder">
<t-radio-group v-model="formData.checkOrder">
<t-radio value="0">横向</t-radio>
<t-radio value="1">纵向</t-radio>
</t-radio-group>
</t-form-item>
<t-form-item label="核电站" name="nuclearStationId">
<t-select
v-model="formData.nuclearStationId"
class="demo-select-base"
clearable
filterable
@change="handleStationChange"
placeholder="请选择所在核电站"
>
{{ item.name }}
</t-option>
</t-select>
</t-form-item>
<t-form-item label="堆芯" name="nuclearCoreId">
<t-select
v-model="formData.nuclearCoreId"
class="demo-select-base"
clearable
filterable
placeholder="请选择所在堆芯"
>
<t-option
v-for="item in coreList"
:value="item.id"
:label="item.name"
:key="item.id"
<t-option
v-for="item in stationList"
:value="item.id"
:label="item.name"
:key="item.id"
>
{{ item.name }}
</t-option>
</t-select>
</t-form-item>
<t-form-item label="堆芯" name="nuclearCoreId">
<t-select
v-model="formData.nuclearCoreId"
class="demo-select-base"
clearable
filterable
placeholder="请选择所在堆芯"
>
{{ item.name }}
</t-option>
</t-select>
</t-form-item>
<t-form-item label="操作员" name="operatorId">
<t-select
v-model="formData.operatorId"
class="demo-select-base"
clearable
filterable
placeholder="请选择分配的操作员"
>
<t-option
v-for="item in userList"
:value="item.username"
:label="item.nickname"
:key="item.id"
<t-option
v-for="item in coreList"
:value="item.id"
:label="item.name"
:key="item.id"
>
{{ item.name }}
</t-option>
</t-select>
</t-form-item>
<t-form-item label="操作员" name="operatorId">
<t-select
v-model="formData.operatorId"
class="demo-select-base"
clearable
filterable
placeholder="请选择分配的操作员"
>
{{ item.nickname }}
</t-option>
</t-select>
</t-form-item>
<t-form-item>
<t-space size="10px">
<t-button theme="primary" type="submit">提交</t-button>
<t-button theme="default" variant="base" type="reset">重置</t-button>
</t-space>
</t-form-item>
</t-form>
<t-option
v-for="item in userList"
:value="item.username"
:label="item.nickname"
:key="item.id"
>
{{ item.nickname }}
</t-option>
</t-select>
</t-form-item>
<t-form-item>
<t-space size="10px">
<t-button theme="primary" type="submit">提交</t-button>
<t-button theme="default" variant="base" type="reset">重置</t-button>
</t-space>
</t-form-item>
</t-form>
</div>
</template>
<script>
import { allOperatorApi } from '@/api/publish'
@ -99,6 +101,7 @@ const INITIAL_DATA = {
operatorId: '',
}
export default {
props: ['handleCancel', 'getTaskList'],
data() {
return {
formData: { ...INITIAL_DATA },
@ -144,6 +147,8 @@ export default {
if (res?.data?.result) {
this.$message.success('创建任务成功')
accountStore.changePage(1)
this.handleCancel()
this.getTaskList()
}
}
} else {
@ -159,4 +164,4 @@ export default {
}
</script>
<style scoped></style>
<style scoped lang="scss"></style>

28
src/components/Task.vue

@ -9,6 +9,14 @@
</t-breadcrumb>
</t-space>
</template>
<template #actions>
<t-button
v-if="role == 'ROLE_ADMIN'"
theme="primary"
@click="publishTask"
>发布任务</t-button
>
</template>
<t-table
bordered
@ -109,6 +117,17 @@
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
></t-upload>
</t-drawer>
<t-dialog
:visible="publishVisible"
:cancelBtn="null"
:confirmBtn="null"
v-if="role == 'ROLE_ADMIN'"
:onClose="handleCancel"
>
<template v-slot:body>
<Publish :handleCancel="handleCancel" :getTaskList="getTaskList" />
</template>
</t-dialog>
</div>
</template>
@ -121,6 +140,7 @@ import {
} from '@/api/task'
import { getNuclearExcelApi } from '@/api'
import PathPlan from 'cpns/PathPlan'
import Publish from 'cpns/Publish'
import { checkCanDiyPathApi, pathPlanApi, getPlanPathListApi } from '@/api/path'
import {
useAccountStore,
@ -139,6 +159,7 @@ const cameraStore = useCameraStore()
export default {
data() {
return {
publishVisible: false,
excelData: [],
pathVisible: false,
userList: [],
@ -424,6 +445,7 @@ export default {
],
components: {
PathPlan,
Publish,
},
computed: {
actionAddress() {
@ -441,6 +463,12 @@ export default {
},
},
methods: {
handleCancel() {
this.publishVisible = false
},
publishTask() {
this.publishVisible = true
},
async getExcelList(taskId) {
const res = await getNuclearExcelApi(taskId)
if (res?.code == 200) {

32
src/pages/index.vue

@ -43,31 +43,6 @@
</g>
</svg>
<div class="menu_list">
<div
class="menu"
@click="accountStore.changePage(2)"
v-if="role == 'ROLE_ADMIN'"
>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
fill="none"
version="1.1"
width="30.133363723754883"
height="25.885509490966797"
viewBox="0 0 30.133363723754883 25.885509490966797"
>
<g>
<path
d="M2.16892,25.8855L24.069,25.8855C25.1625,25.8855,26.2349,24.7739,26.2319,23.6413L26.2439,8.84358L26.3523,8.73556L26.2955,8.67851L29.7384,5.03974C30.2655,4.48244,30.2655,3.58776,29.7354,3.04252L27.2441,0.418722C26.9911,0.153631,26.6296,0,26.253,0C25.8765,0,25.515,0.153631,25.2619,0.418722L20.1921,5.74162L2.16591,5.76271C0.966979,5.76271,0,6.99177,0,8.00996L0,23.6383C0,24.2076,0.250029,24.783,0.686826,25.2198C1.11157,25.6445,1.65079,25.8855,2.16892,25.8855ZM25.045,8.33916L25.0451,8.24794L28.8648,4.20229C28.9491,4.11192,28.9521,3.95527,28.8708,3.87394L28.8648,3.86792L26.3705,1.24412C26.3313,1.20797,26.2741,1.20496,26.253,1.20496C26.2289,1.20496,26.1747,1.20797,26.1355,1.25014L21.3025,6.32475L21.3336,6.35593L14.7003,12.9952C14.6732,13.0193,14.6582,13.0495,14.6491,13.0796L14.6401,13.1127L13.5508,16.25C14.7659,16.2318,15.9935,16.1717,16.5169,16.0436C16.7036,15.9984,16.8633,15.9593,17.0019,15.9262C17.276,15.8599,17.5381,15.7966,17.5863,15.7665Q17.5923,15.7635,17.6043,15.7514L17.6134,15.7424L25.045,8.33916ZM19.0383,6.94821L13.8508,12.1427C13.6701,12.3205,13.5436,12.5404,13.4833,12.7814L12.2743,16.2546L12.2634,16.2545L12.2423,16.2545L12.242,16.3472L11.9922,17.065L12.24,17.1509L12.2393,17.4595L12.2513,17.4595C12.3688,17.4625,12.5224,17.4625,12.7062,17.4625C13.7997,17.4625,15.9174,17.4354,16.806,17.2185C16.9898,17.1703,17.1495,17.1341,17.282,17.101C17.9146,16.9504,18.1797,16.8841,18.4629,16.5949L25.0436,10.0392L25.033,23.6353C25.033,24.1293,24.4606,24.6775,24.072,24.6775L2.17194,24.6775C1.79237,24.6775,1.21098,24.2106,1.21098,23.6353L1.21098,8.00695C1.21098,7.58521,1.71706,6.96466,2.17194,6.96466L19.0383,6.94821ZM20.4996,19.493L5.75994,19.493C5.53703,19.493,5.35327,19.3093,5.35327,19.0864L5.35327,18.6948C5.35327,18.4718,5.53703,18.2881,5.75994,18.2881L20.4996,18.2881C20.7225,18.2881,20.9063,18.4718,20.9063,18.6948L20.9063,19.0864C20.9063,19.3093,20.7225,19.493,20.4996,19.493Z"
fill-rule="evenodd"
fill="#FFFFFF"
fill-opacity="1"
/>
</g>
</svg>
<p class="title">发布任务</p>
</div>
<div class="menu" @click="clickTaskTab">
<svg
xmlns="http://www.w3.org/2000/svg"
@ -345,12 +320,6 @@
/>
</div>
<div
class="publish_container"
v-if="accountStore.activePage == 2 && role == 'ROLE_ADMIN'"
>
<Publish />
</div>
<div
class="task_container"
v-if="accountStore.activePage == 3 && role == 'ROLE_ADMIN'"
>
@ -391,7 +360,6 @@ import Excel from 'cpns/Excel'
import Nuclear from 'cpns/Nuclear'
import Image from 'cpns/Image'
import Task from 'cpns/Task'
import Publish from 'cpns/Publish'
import User from 'cpns/User'
import DetailTable from 'cpns/DetailTable'
import Debug from 'cpns/Debug'

Loading…
Cancel
Save