You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

877 lines
26 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="task_component">
  3. <t-card>
  4. <template #title>
  5. <t-space direction="vertical">
  6. <t-breadcrumb>
  7. <t-breadcrumbItem>首页</t-breadcrumbItem>
  8. <t-breadcrumbItem>任务管理中心</t-breadcrumbItem>
  9. </t-breadcrumb>
  10. </t-space>
  11. </template>
  12. <template #actions>
  13. <t-button
  14. v-if="role == 'ROLE_ADMIN'"
  15. theme="primary"
  16. @click="publishTask"
  17. >发布任务</t-button
  18. >
  19. </template>
  20. <t-table
  21. bordered
  22. hover
  23. tableLayout="auto"
  24. row-key="id"
  25. :data="data"
  26. :columns="columns"
  27. :scroll="{ type: 'virtual', rowHeight: 69, bufferSize: 10 }"
  28. resizable
  29. />
  30. <t-dialog
  31. theme="danger"
  32. header="删除"
  33. :body="delBody"
  34. :visible="delVisible"
  35. @confirm="onConfirmDelete"
  36. :onClose="closeDelDialog"
  37. :cancelBtn="null"
  38. />
  39. <t-drawer
  40. :visible="pathVisible"
  41. size="'100%'"
  42. header="自定义路径规划"
  43. :onConfirm="saveDiyPath"
  44. @cancel="pathVisible = false"
  45. :onOverlayClick="() => (pathVisible = false)"
  46. :closeBtn="true"
  47. >
  48. <div class="path_wrap">
  49. <PathPlan :excelData="excelData" />
  50. </div>
  51. </t-drawer>
  52. <t-dialog
  53. header="修改操作员"
  54. :visible="updateOperVisible"
  55. :footer="false"
  56. :onClose="operClose"
  57. >
  58. <template v-slot:body>
  59. <t-form
  60. :data="formData"
  61. :rules="pubRules"
  62. ref="form"
  63. @reset="onReset"
  64. @submit="onSubmit"
  65. >
  66. <t-form-item label="操作员" name="operatorId">
  67. <t-select
  68. v-model="formData.operatorId"
  69. class="demo-select-base"
  70. clearable
  71. filterable
  72. placeholder="请选择分配的操作员"
  73. >
  74. <t-option
  75. v-for="item in userList"
  76. :value="item.username"
  77. :label="item.nickname"
  78. :key="item.id"
  79. >
  80. {{ item.nickname }}
  81. </t-option>
  82. </t-select>
  83. </t-form-item>
  84. <t-form-item>
  85. <t-space size="10px">
  86. <t-button theme="primary" type="submit">提交</t-button>
  87. <t-button theme="default" variant="base" type="reset"
  88. >重置</t-button
  89. >
  90. </t-space>
  91. </t-form-item>
  92. </t-form>
  93. </template>
  94. </t-dialog>
  95. </t-card>
  96. <t-drawer
  97. size="medium"
  98. closeOnEscKeydown
  99. sizeDraggable
  100. :visible="uploadVisible"
  101. header="上传excel"
  102. :footer="false"
  103. @close="handleClose"
  104. :onConfirm="handleConfirm"
  105. >
  106. <t-upload
  107. ref="uploadRef"
  108. :action="actionAddress"
  109. :headers="getHeaders()"
  110. v-model="files"
  111. status="success"
  112. theme="file-input"
  113. placeholder="未选择文件"
  114. @fail="handleFail"
  115. @success="handleSuccess"
  116. accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  117. ></t-upload>
  118. </t-drawer>
  119. <t-dialog
  120. :visible="publishVisible"
  121. :cancelBtn="null"
  122. :confirmBtn="null"
  123. v-if="role == 'ROLE_ADMIN'"
  124. :onClose="handleCancel"
  125. >
  126. <template v-slot:body>
  127. <Publish :handleCancel="handleCancel" :getTaskList="getTaskList" />
  128. </template>
  129. </t-dialog>
  130. <t-dialog
  131. theme="danger"
  132. header="删除"
  133. :visible="stopTaskVisible"
  134. :onClose="() => (stopTaskVisible = false)"
  135. :onConfirm="handleStopTask"
  136. >
  137. <p style="font-size: 16px; margin: 20px 0">
  138. 结束任务后将不能再继续对该任务进行核查
  139. </p>
  140. </t-dialog>
  141. </div>
  142. </template>
  143. <script lang="jsx">
  144. import {
  145. taskListApi,
  146. delExcelByTaskIdApi,
  147. stopTaskApi,
  148. delTaskApi,
  149. updateOperByTaskIdApi,
  150. } from '@/api/task'
  151. import { getNuclearExcelApi } from '@/api'
  152. import PathPlan from 'cpns/PathPlan'
  153. import Publish from 'cpns/Publish'
  154. import { checkCanDiyPathApi, pathPlanApi, getPlanPathListApi } from '@/api/path'
  155. import {
  156. useAccountStore,
  157. useTaskStore,
  158. useImageStore,
  159. useCameraStore,
  160. } from '@/store'
  161. import { allOperatorApi } from '@/api/publish'
  162. import { getCameraConfig } from '@/api/camera'
  163. import moment from 'moment'
  164. import Cookie from '@/utils/cookie'
  165. const accountStore = useAccountStore()
  166. const taskStore = useTaskStore()
  167. const imageStore = useImageStore()
  168. const cameraStore = useCameraStore()
  169. export default {
  170. data() {
  171. return {
  172. stopTaskInfo: {},
  173. stopTaskVisible: false,
  174. publishVisible: false,
  175. excelData: [],
  176. pathVisible: false,
  177. userList: [],
  178. formData: { operatorId: '' },
  179. pubRules: {
  180. operatorId: [{ required: true, message: '请选择要分配的操作员' }],
  181. },
  182. updateOperVisible: false,
  183. operTaskId: null,
  184. deleteDialogIndex: false,
  185. delVisible: false,
  186. files: [],
  187. tips: '上传格式仅支持xlsx',
  188. uploadVisible: false,
  189. data: [],
  190. currentTaskId: '',
  191. columns: [
  192. {
  193. colKey: 'taskName',
  194. title: '任务名称',
  195. width: 160,
  196. },
  197. {
  198. colKey: 'operatorName',
  199. title: '操作员',
  200. width: 130,
  201. },
  202. {
  203. colKey: 'publishedId',
  204. title: '发布者',
  205. width: 130,
  206. },
  207. {
  208. colKey: 'publishTime',
  209. title: '发布时间',
  210. width: 190,
  211. cell: (h, { row }) =>
  212. moment(row.publishTime).format('YYYY-MM-DD HH:mm'),
  213. },
  214. {
  215. colKey: 'nuclearStationName',
  216. title: '核电站名称',
  217. ellipsis: true,
  218. width: 220,
  219. },
  220. {
  221. colKey: 'nuclearCoreName',
  222. title: '核反应堆',
  223. width: 120,
  224. },
  225. {
  226. colKey: 'status',
  227. title: '任务状态',
  228. width: 120,
  229. cell: (h, { row }) => {
  230. if (row.status == 0) {
  231. return (
  232. <div class="not_start_table_btn">
  233. <svg
  234. xmlns="http://www.w3.org/2000/svg"
  235. xmlns:xlink="http://www.w3.org/1999/xlink"
  236. fill="none"
  237. version="1.1"
  238. width="24"
  239. height="23.999755859375"
  240. viewBox="0 0 24 23.999755859375"
  241. >
  242. <g>
  243. <path
  244. d="M12,0C18.6275,0,24,5.37245,24,11.9999C24,18.6273,18.6275,23.9998,12,23.9998C5.3725,23.9998,0,18.6273,0,11.9999C0,5.37245,5.3725,0,12,0ZM12,16.1103C10.9964,16.1103,10.1827,16.9238,10.1827,17.9276C10.1827,18.9312,10.9964,19.7449,12,19.7449C13.0036,19.7449,13.8173,18.9312,13.8173,17.9276C13.8173,16.9238,13.0036,16.1103,12,16.1103ZM11.9477,14.6896C12.8122,14.6896,13.5129,13.9887,13.5129,13.1245L13.5129,5.82005C13.5129,4.95557,12.8122,4.25489,11.9477,4.25489C11.0833,4.25489,10.3826,4.95581,10.3826,5.82005L10.3826,13.1245C10.3826,13.9889,11.0833,14.6896,11.9477,14.6896Z"
  245. fill="#FFFFFF"
  246. fill-opacity="1"
  247. />
  248. </g>
  249. </svg>
  250. <span>未开始</span>
  251. </div>
  252. )
  253. } else if (row.status == 1) {
  254. return (
  255. <div
  256. class="process_table_btn"
  257. onClick={() => this.viewProcessTask()}
  258. >
  259. 进行中
  260. </div>
  261. )
  262. } else if (row.status == 2) {
  263. return (
  264. <div
  265. class="process_table_btn continue_table_btn"
  266. style={{ cursor: 'default' }}
  267. >
  268. 任务暂停
  269. </div>
  270. )
  271. } else {
  272. return (
  273. <div class="finished_table_btn">
  274. <svg
  275. xmlns="http://www.w3.org/2000/svg"
  276. xmlns:xlink="http://www.w3.org/1999/xlink"
  277. fill="none"
  278. version="1.1"
  279. width="23.99990463256836"
  280. height="24"
  281. viewBox="0 0 23.99990463256836 24"
  282. >
  283. <g>
  284. <path
  285. d="M12,24C5.37298,24,0,18.627,0,12C0,5.373,5.37298,0,12,0C18.6269,0,23.9999,5.373,23.9999,12C23.9999,18.627,18.6269,24,12,24ZM9.32396,16.712C9.81214,17.2003,10.6038,17.2003,11.092,16.712L18.6699,9.134C19.1581,8.64578,19.1581,7.85422,18.6699,7.366C18.1817,6.87778,17.3902,6.87778,16.9019,7.366L10.154,14.006L7.13397,10.986C6.64586,10.4971,5.85378,10.4968,5.3653,10.9853C4.87681,11.4738,4.87712,12.2659,5.36598,12.754L9.32396,16.712Z"
  286. fill="#FFFFFF"
  287. fill-opacity="1"
  288. />
  289. </g>
  290. </svg>
  291. <span>已完成</span>
  292. </div>
  293. )
  294. }
  295. },
  296. },
  297. {
  298. colKey: 'checkOrder',
  299. title: '检测路径',
  300. width: 120,
  301. cell: (h, { row }) => {
  302. if (row.checkOrder == 0) {
  303. return '横向规则'
  304. } else if (row.checkOrder == 1) {
  305. return '纵向规则'
  306. } else {
  307. return '自定义'
  308. }
  309. },
  310. },
  311. {
  312. colKey: 'startTime',
  313. title: '开始时间',
  314. width: 190,
  315. cell: (h, { row }) => {
  316. return row.startTime
  317. ? moment(row.startTime).format('YYYY-MM-DD HH:mm')
  318. : '---'
  319. },
  320. },
  321. {
  322. colKey: 'endTime',
  323. title: '完成时间',
  324. width: 190,
  325. cell: (h, { row }) => {
  326. return row.endTime
  327. ? moment(row.endTime).format('YYYY-MM-DD HH:mm')
  328. : '---'
  329. },
  330. },
  331. {
  332. title: '操作',
  333. fixed: 'right',
  334. colKey: 'oper',
  335. cell: (h, { row }) => {
  336. if (this.role == 'ROLE_ADMIN') {
  337. return (
  338. <div>
  339. <t-button
  340. variant="text"
  341. theme="primary"
  342. onClick={() => this.showDeleteDialog(true, row.id)}
  343. >
  344. 删除任务
  345. </t-button>
  346. <t-button
  347. variant="text"
  348. theme="primary"
  349. disabled={row.canUpload}
  350. onClick={() => this.showDeleteDialog(false, row.id)}
  351. >
  352. 删除excel
  353. </t-button>
  354. <t-button
  355. variant="text"
  356. theme="primary"
  357. disabled={!row.canUpload}
  358. onClick={() => this.uploadExcel(row.id)}
  359. >
  360. 上传Excel
  361. </t-button>
  362. <t-button
  363. variant="text"
  364. theme="primary"
  365. onClick={() => this.updateOper(row.id)}
  366. >
  367. 修改操作员
  368. </t-button>
  369. <t-button
  370. variant="text"
  371. theme="primary"
  372. disabled={row.canUpload || row.status != 0}
  373. onClick={() => this.showPathDialog(row.id)}
  374. >
  375. 自定义路径规划
  376. </t-button>
  377. <t-button
  378. variant="text"
  379. theme={
  380. row.canUpload
  381. ? 'primary'
  382. : row.hasError
  383. ? 'danger'
  384. : 'success'
  385. }
  386. disabled={row.canUpload}
  387. onClick={() =>
  388. this.viewDetail(
  389. row.id,
  390. row.nuclearCoreName,
  391. 2,
  392. row.nuclearStationName,
  393. row.operatorName,
  394. false,
  395. row,
  396. )
  397. }
  398. >
  399. 详情
  400. </t-button>
  401. </div>
  402. )
  403. } else {
  404. return (
  405. <div style={{ display: 'flex' }}>
  406. {row.status == 2 && this.role == 'ROLE_USER' ? (
  407. <div
  408. class="continue_table_btn"
  409. style={{ marginRight: '10px' }}
  410. onClick={() => this.startTask(row, row.nuclearCoreName)}
  411. >
  412. 继续任务
  413. </div>
  414. ) : null}
  415. {row.status == 0 && this.role == 'ROLE_USER' ? (
  416. <div
  417. style={{ marginRight: '10px' }}
  418. class={
  419. row.canUpload
  420. ? 'start_table_btn disable_table_btn'
  421. : 'start_table_btn'
  422. }
  423. onClick={() =>
  424. this.startTask(
  425. row,
  426. row.nuclearCoreName,
  427. 1,
  428. row.canUpload,
  429. )
  430. }
  431. >
  432. 开始任务
  433. </div>
  434. ) : null}
  435. <div>
  436. {[0, 1, 2].includes(row.status) &&
  437. this.role == 'ROLE_USER' ? (
  438. <div
  439. style={{ marginRight: '10px' }}
  440. onClick={() => this.changeTaskStatusTo3(row)}
  441. class={
  442. row.canUpload
  443. ? 'start_table_btn disable_table_btn'
  444. : 'start_table_btn'
  445. }
  446. >
  447. 结束任务
  448. </div>
  449. ) : null}
  450. </div>
  451. <div
  452. onClick={() =>
  453. this.viewDetail(
  454. row.id,
  455. row.nuclearCoreName,
  456. 1,
  457. row.nuclearStationName,
  458. row.operatorName,
  459. row.canUpload,
  460. row,
  461. )
  462. }
  463. class={
  464. row.canUpload
  465. ? 'start_table_btn disable_table_btn'
  466. : 'start_table_btn'
  467. }
  468. >
  469. 查看详情
  470. </div>
  471. </div>
  472. )
  473. }
  474. },
  475. },
  476. ],
  477. }
  478. },
  479. props: [
  480. 'startCaptureFunc',
  481. 'handleSimulationBrightness',
  482. 'handleExposureTime',
  483. 'startFlashLight',
  484. ],
  485. components: {
  486. PathPlan,
  487. Publish,
  488. },
  489. computed: {
  490. testArrLength() {
  491. const testArr = taskStore.excelData.filter(
  492. item => item.firstSign && item.secondSign,
  493. )
  494. return testArr.length
  495. },
  496. hasTestedLength() {
  497. const testArr = taskStore.excelData.filter(
  498. item => item.firstSign && item.secondSign,
  499. )
  500. const hasTested = testArr.filter(item => item.result != 0)
  501. return hasTested.length
  502. },
  503. actionAddress() {
  504. return `${import.meta.env.VITE_BASE_URL}/upload/${this.currentTaskId}`
  505. },
  506. role() {
  507. return Cookie.getCookie('r')
  508. },
  509. delBody() {
  510. if (this.deleteDialogIndex) {
  511. return '确认要删除当前任务吗,请确保当前任务已经废弃!'
  512. } else {
  513. return '确认要清空当前任务已上传的Excel路径规划吗,此操作不可逆!'
  514. }
  515. },
  516. },
  517. methods: {
  518. async handleStopTask() {
  519. const res = await stopTaskApi({ ...this.stopTaskInfo, status: 3 })
  520. if (res?.code == 200) {
  521. this.getTaskList()
  522. this.stopTaskVisible = false
  523. }
  524. },
  525. changeTaskStatusTo3(row) {
  526. this.stopTaskVisible = true
  527. this.stopTaskInfo = row
  528. },
  529. handleCancel() {
  530. this.publishVisible = false
  531. },
  532. publishTask() {
  533. this.publishVisible = true
  534. },
  535. async getExcelList(taskId) {
  536. const res = await getNuclearExcelApi(taskId)
  537. if (res?.code == 200) {
  538. // 根据data的serialNumber算出序列号
  539. const list = res.data.list
  540. list.map(item => {
  541. const arr = item.serialNumber.split('-')
  542. item.num = parseInt(arr[0]) * 14 + parseInt(arr[1]) + 1
  543. })
  544. this.excelData = list
  545. }
  546. },
  547. async saveDiyPath() {
  548. const res = await pathPlanApi(this.currentTaskId, taskStore.pathData)
  549. if (res?.code == 200) {
  550. this.pathVisible = false
  551. this.$message.success('设置成功')
  552. // 更新list
  553. this.getTaskList()
  554. }
  555. },
  556. showPathDialog(taskId) {
  557. this.currentTaskId = taskId
  558. this.getExcelList(taskId)
  559. const confirmDia = this.$dialog.confirm({
  560. header: '提示',
  561. body: '已开始的任务无法更改路径。复杂路径规划后,将清除创建任务时所选择的规则路径,确认要进行自定义规划吗?',
  562. confirmBtn: '确定',
  563. cancelBtn: '取消',
  564. onConfirm: async ({ e }) => {
  565. const res = await checkCanDiyPathApi(taskId)
  566. if (res?.code == 200) {
  567. // 这需要查询原先的路径 进行回显
  568. const listRes = await getPlanPathListApi(taskId)
  569. if (listRes?.code == 200) {
  570. if (listRes?.data) {
  571. taskStore.updatePathData(listRes?.data)
  572. }
  573. }
  574. this.pathVisible = true
  575. } else {
  576. this.$message.error(res?.msg)
  577. }
  578. // 请求成功后,销毁弹框
  579. confirmDia.destroy()
  580. },
  581. onClose: ({ e, trigger }) => {
  582. confirmDia.hide()
  583. },
  584. })
  585. },
  586. async getAllOperator() {
  587. const res = await allOperatorApi()
  588. if (res?.code == 200) {
  589. this.userList = res?.data
  590. }
  591. },
  592. onReset() {
  593. this.$message.success('重置成功')
  594. },
  595. async onSubmit({ validateResult, firstError }) {
  596. if (validateResult === true) {
  597. const res = await updateOperByTaskIdApi(this.operTaskId, this.formData)
  598. if (res?.code == 200) {
  599. this.getTaskList()
  600. this.updateOperVisible = false
  601. this.operTaskId = null
  602. this.$message.success('修改成功')
  603. }
  604. } else {
  605. this.$message.warning(firstError)
  606. }
  607. },
  608. updateOper(taskId) {
  609. this.operTaskId = taskId
  610. if (this.role == 'ROLE_ADMIN') {
  611. this.getAllOperator()
  612. }
  613. this.updateOperVisible = true
  614. },
  615. operClose() {
  616. this.updateOperVisible = false
  617. },
  618. onConfirmDelete() {
  619. if (this.deleteDialogIndex) {
  620. this.delTask(this.operTaskId)
  621. } else {
  622. this.delExcel(this.operTaskId)
  623. }
  624. },
  625. closeDelDialog() {
  626. this.delVisible = false
  627. },
  628. showDeleteDialog(index, taskId) {
  629. this.deleteDialogIndex = index
  630. this.operTaskId = taskId
  631. this.delVisible = true
  632. },
  633. viewProcessTask() {
  634. accountStore.changePage(0)
  635. taskStore.updateCurrentDetailTaskId(null)
  636. },
  637. async startTask(row, coreName, flag, canUpload) {
  638. if (flag == 1 && canUpload) {
  639. return
  640. }
  641. this.startCaptureFunc()
  642. this.startFlashLight()
  643. setTimeout(() => {
  644. this.startFlashLight()
  645. }, 1000)
  646. // websocketsend(openFlashLight)
  647. // 需要设置相机的参数 根据核堆id获取
  648. const res = await getCameraConfig(row.nuclearCoreId)
  649. if (res?.code == 200) {
  650. if (res?.data?.exposure) {
  651. // 改变相机的exposure
  652. this.handleExposureTime(res?.data?.exposure)
  653. }
  654. if (res?.data?.brightness) {
  655. // 改变相机的simulation_brightness
  656. this.handleSimulationBrightness(res?.data?.brightness)
  657. }
  658. }
  659. taskStore.updateTaskStatus(row.status)
  660. taskStore.updateCurrentCoord(row.currentCoord)
  661. imageStore.updateNuclearCoreName(coreName)
  662. Cookie.setCookie('core_name', coreName)
  663. imageStore.updateOperatorName(row.operatorName)
  664. imageStore.updateNuclearStationName(row.nuclearCoreName)
  665. imageStore.updateShowImage(false)
  666. accountStore.changePage(0)
  667. await taskStore.getExcelList(row.id)
  668. taskStore.updateCurrentTaskId(row.id)
  669. taskStore.updateCurrentDetailTaskId(null)
  670. },
  671. async viewDetail(
  672. taskId,
  673. nuclearCoreName,
  674. flag,
  675. nuclearStationName,
  676. operatorName,
  677. canUpload,
  678. row,
  679. ) {
  680. if (flag == 1 && canUpload) {
  681. return
  682. }
  683. this.startCaptureFunc()
  684. this.startFlashLight()
  685. setTimeout(() => {
  686. this.startFlashLight()
  687. }, 1000)
  688. // websocketsend(openFlashLight)
  689. // 需要设置相机的参数 根据核堆id获取
  690. const res = await getCameraConfig(row.nuclearCoreId)
  691. if (res?.code == 200) {
  692. if (res?.data?.exposure) {
  693. // 改变相机的exposure
  694. this.handleExposureTime(res?.data?.exposure)
  695. }
  696. if (res?.data?.brightness) {
  697. // 改变相机的simulation_brightness
  698. this.handleSimulationBrightness(res?.data?.brightness)
  699. }
  700. }
  701. // 直接取消继续任务按钮
  702. cameraStore.updateContinueTask(false)
  703. imageStore.updateNuclearStationName(nuclearStationName)
  704. imageStore.updateOperatorName(operatorName)
  705. imageStore.updateNuclearCoreName(nuclearCoreName)
  706. taskStore.updateCurrentDetailTaskId(taskId)
  707. imageStore.updateShowImage(false)
  708. accountStore.changePage(0)
  709. taskStore.getExcelList(taskId)
  710. },
  711. handleSuccess({ response }) {
  712. console.log(response)
  713. if (response?.code == 200) {
  714. this.uploadVisible = false
  715. this.getTaskList()
  716. this.$message.success('上传成功')
  717. } else {
  718. this.$message.error(response?.msg)
  719. }
  720. },
  721. handleFail({ file }) {
  722. this.$message.error(`文件 ${file.name} 上传失败`)
  723. },
  724. getHeaders() {
  725. return {
  726. Authorization: Cookie.getCookie('t'),
  727. }
  728. },
  729. handleClose() {
  730. this.uploadVisible = false
  731. },
  732. handleConfirm() {
  733. console.log(this.$refs)
  734. this.$refs.uploadRef.triggerUpload()
  735. },
  736. async delTask(taskId) {
  737. const res = await delTaskApi(taskId)
  738. if (res?.code == 200) {
  739. if (res?.data?.result) {
  740. this.$message.success('删除任务成功')
  741. this.getTaskList()
  742. this.delVisible = false
  743. }
  744. }
  745. },
  746. async delExcel(taskId) {
  747. const res = await delExcelByTaskIdApi(taskId)
  748. if (res?.code == 200) {
  749. if (res?.data?.result) {
  750. this.$message.success('删除该任务的excel计划表成功')
  751. this.getTaskList()
  752. this.delVisible = false
  753. }
  754. }
  755. },
  756. uploadExcel(taskId) {
  757. this.currentTaskId = taskId
  758. this.uploadVisible = true
  759. },
  760. async getTaskList() {
  761. const res = await taskListApi()
  762. if (res?.code == 200) {
  763. this.data = res?.data
  764. }
  765. },
  766. },
  767. mounted() {
  768. this.getTaskList()
  769. },
  770. }
  771. </script>
  772. <style lang="scss">
  773. .task_component {
  774. height: 90vh;
  775. overflow: scroll;
  776. }
  777. .process_table_btn {
  778. width: 93.18px;
  779. height: 32px;
  780. border-radius: 32px;
  781. display: flex;
  782. padding: 6px 25px;
  783. align-items: center;
  784. justify-content: center;
  785. font-size: 14px;
  786. font-weight: normal;
  787. box-sizing: border-box;
  788. white-space: nowrap;
  789. letter-spacing: 0.07em;
  790. color: #ffffff;
  791. background: #ed7b2f;
  792. cursor: pointer;
  793. }
  794. .start_table_btn {
  795. cursor: pointer;
  796. width: 93.18px;
  797. box-sizing: border-box;
  798. white-space: nowrap;
  799. height: 32px;
  800. border-radius: 32px;
  801. display: flex;
  802. padding: 6px 25px;
  803. align-items: center;
  804. justify-content: center;
  805. font-size: 14px;
  806. font-weight: normal;
  807. letter-spacing: 0.07em;
  808. color: #ffffff;
  809. background: #00a870;
  810. }
  811. .continue_table_btn {
  812. cursor: pointer;
  813. width: 93.18px;
  814. height: 32px;
  815. border-radius: 32px;
  816. display: flex;
  817. padding: 6px 25px;
  818. box-sizing: border-box;
  819. white-space: nowrap;
  820. align-items: center;
  821. justify-content: center;
  822. font-size: 14px;
  823. font-weight: normal;
  824. letter-spacing: 0.07em;
  825. color: #ffffff;
  826. background: #0052d9;
  827. }
  828. .finished_table_btn {
  829. width: 93.18px;
  830. box-sizing: border-box;
  831. white-space: nowrap;
  832. height: 32px;
  833. border-radius: 32px;
  834. display: flex;
  835. align-items: center;
  836. justify-content: space-between;
  837. font-size: 14px;
  838. font-weight: normal;
  839. letter-spacing: 0.07em;
  840. color: #ffffff;
  841. padding: 0 13px 0 5px;
  842. background: #00a870;
  843. }
  844. .not_start_table_btn {
  845. width: 93.18px;
  846. box-sizing: border-box;
  847. white-space: nowrap;
  848. height: 32px;
  849. border-radius: 32px;
  850. display: flex;
  851. align-items: center;
  852. justify-content: space-between;
  853. font-size: 14px;
  854. font-weight: normal;
  855. letter-spacing: 0.07em;
  856. color: #ffffff;
  857. padding: 0 13px 0 5px;
  858. background: #d8d8d8;
  859. }
  860. .disable_table_btn {
  861. background: #d8d8d8;
  862. cursor: default;
  863. }
  864. .path_wrap {
  865. display: flex;
  866. align-items: center;
  867. justify-content: center;
  868. }
  869. ::-webkit-scrollbar {
  870. width: 0; /*隐藏滚动条空间*/
  871. background-color: transparent; /*隐藏背景*/
  872. }
  873. </style>