| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .el-container{ |
| | | /* min-height: 820px; */ |
| | | } |
| | | .el-aside { |
| | | width: initial; |
| | | } |
| | |
| | | .el-main__content { |
| | | padding: var(--el-main-padding); |
| | | max-height: calc(100vh - 60px - var(--el-main-padding) * 2); |
| | | /* background-color: aqua; */ |
| | | /* overflow: auto; */ |
| | | } |
| | | .back-top { |
| | |
| | | |
| | | /** |
| | | * æ°å»ºä¸ä¸ªæµè¯ä»»å¡ |
| | | * @param {String} taskId |
| | | * @param {String} taskId |
| | | * @returns {Promise} |
| | | */ |
| | | newTestTask(taskId) { |
| | |
| | | }, |
| | | |
| | | /** |
| | | * æ°å»ºä¸ä¸ªæµè¯ä»»å¡ |
| | | * @param {String} taskId |
| | | * @returns {Promise} |
| | | */ |
| | | startTask(param) { |
| | | return $fysp.put(`bgTask/start`, param).then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * æ°å»ºå¹¶è¿è¡ä¸ä¸ªæµè¯ä»»å¡ |
| | | * @param {String} taskId |
| | | * @param {String} taskId |
| | | * @returns {Promise} |
| | | */ |
| | | startNewTestTask(taskId) { |
| | |
| | | }, |
| | | |
| | | /** |
| | | * 强å¶å
³éæµè¯ä»»å¡ |
| | | * è¿è¡ä¸ä¸ªä»»å¡ |
| | | * @param {String} taskId |
| | | * @returns {Promise} |
| | | */ |
| | | startTask(param) { |
| | | return $fysp.put(`bgTask/start`, param).then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * 强å¶å
³éä»»å¡ |
| | | * @param {Object} param åå°ä»»å¡æ¥è¯¢æ¡ä»¶ |
| | | * @returns {Promise} |
| | | */ |
| | | shutDownTask(param) { |
| | | return $fysp.put(`bgTask/shutDown`, param).then((res) => res.data); |
| | | }, |
| | | |
| | | /** |
| | | * ç§»é¤ä¸ä¸ªä»»å¡ |
| | | * @param {Object} param åå°ä»»å¡æ¥è¯¢æ¡ä»¶ |
| | | * @returns |
| | | */ |
| | | removeTask(param) { |
| | | return $fysp.put(`bgTask/remove`, param).then((res) => res.data); |
| | | } |
| | | }; |
| | |
| | | body { |
| | | /* background-color: rebeccapurple; */ |
| | | margin: 0; |
| | | } |
| | | /* min-width: 1440px; */ |
| | | /* min-height: 820px; */ |
| | | } |
| | |
| | | FYOptionText: typeof import('./components/search-option/base/FYOptionText.vue')['default'] |
| | | FYOptionTime: typeof import('./components/search-option/FYOptionTime.vue')['default'] |
| | | FYOptionUserType: typeof import('./components/search-option/FYOptionUserType.vue')['default'] |
| | | FYReconfrimButton: typeof import('./components/button/FYReconfrimButton.vue')['default'] |
| | | FYSearchBar: typeof import('./components/search-option/FYSearchBar.vue')['default'] |
| | | FYTable: typeof import('./components/table/FYTable.vue')['default'] |
| | | Header: typeof import('./components/core/Header.vue')['default'] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { cloneVNode, Comment, defineComponent, Fragment, h, Text, VNode } from 'vue'; |
| | | |
| | | /** |
| | | * å¯¹äºææ¬æSVGï¼éè¦ç¨spanå
裹ä¸ä¸ |
| | | * @param s |
| | | */ |
| | | const wrapTextContent = (s: string | VNode): VNode => { |
| | | return h('span', null, s); |
| | | }; |
| | | |
| | | /** |
| | | * 夿æ¯å¦ä¸ºObject |
| | | * @param val |
| | | */ |
| | | const isObject = (val: any) => val !== null && typeof val === 'object'; |
| | | |
| | | /** |
| | | * æ¾åºç¬¬ä¸ä¸ªåæ³çåå
ç´ |
| | | * @param node |
| | | */ |
| | | const findFirstLegitChild = (node: VNode[] | undefined): VNode | null => { |
| | | if (!node) return null; |
| | | for (const child of node) { |
| | | if (isObject(child)) { |
| | | switch (child.type) { |
| | | case Comment: |
| | | continue; |
| | | case Text: |
| | | case 'svg': |
| | | return wrapTextContent(child); |
| | | case Fragment: |
| | | return findFirstLegitChild(child.children as VNode[]); |
| | | default: |
| | | return child; |
| | | } |
| | | } |
| | | return wrapTextContent(child); |
| | | } |
| | | return null; |
| | | }; |
| | | |
| | | const NAME = 'SlotEvents'; |
| | | |
| | | const SlotEvents = defineComponent({ |
| | | name: NAME, |
| | | setup(_, { slots, attrs }) { |
| | | return () => { |
| | | const defaultSlot = slots.default?.(attrs); |
| | | if (!defaultSlot) return null; |
| | | if (defaultSlot.length > 1) { |
| | | console.warn(`${NAME}: åªéè¦ä¸ä¸ªåå
ç´ `); |
| | | return null; |
| | | } |
| | | const firstLegitChild = findFirstLegitChild(defaultSlot); |
| | | if (!firstLegitChild) { |
| | | console.warn(`${NAME}: 没æå¯ç¨çåå
ç´ `); |
| | | return null; |
| | | } |
| | | return cloneVNode(firstLegitChild, attrs); |
| | | }; |
| | | } |
| | | }); |
| | | export default SlotEvents; |
| | |
| | | <template> |
| | | <el-card class="bg-task-card" shadow="hover" :body-style="{ padding: '8px' }"> |
| | | <!-- <template #header> --> |
| | | <el-row style="background-color: aliceblue"> |
| | | <!-- <el-space> --> |
| | | <el-tag>{{ nameToLabel(model.type) }}</el-tag> |
| | | <el-text style="width: 80%" tag="b" size="large" truncated>{{ model.name }}</el-text> |
| | | <!-- <div>{{ model.name }}asdasdasdasdasdasdaasdasdasdasdasdasdaasdasdasdasdasdasdaasdasdasdasdasdasda</div> --> |
| | | <!-- </el-space> --> |
| | | <el-card class="m-b-8" shadow="always" :body-style="{ padding: '8px' }"> |
| | | <el-row> |
| | | <el-col :span="4"> |
| | | <div class="status-btn"> |
| | | <el-icon v-if="waiting" color="var(--el-color-info)" :size="50"><VideoPlay /></el-icon> |
| | | <el-icon v-else-if="running" color="var(--el-color-primary)" :size="50" class="is-loading" |
| | | ><Loading |
| | | /></el-icon> |
| | | <el-icon v-else-if="success" color="var(--el-color-success)" :size="50" |
| | | ><CircleCheck |
| | | /></el-icon> |
| | | <el-icon v-else-if="fail" color="var(--el-color-error)" :size="50" |
| | | ><CircleClose |
| | | /></el-icon> |
| | | <el-icon v-else color="var(--el-color-warning)" :size="50"><Warning /></el-icon> |
| | | <el-text type="info" size="small" style="position: absolute; bottom: 0">{{ |
| | | nameToLabel(model.status) |
| | | }}</el-text> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="20" class="p-l-8"> |
| | | <el-row justify="space-between"> |
| | | <el-text class="m-l-4px w-150px" tag="b" size="large" truncated>{{ model.name }}</el-text> |
| | | <el-tag>{{ nameToLabel(model.type) }}</el-tag> |
| | | </el-row> |
| | | <el-row class="p-v-8" align="bottom"> |
| | | <el-col :span="12"> |
| | | <span class="timer">{{ time }}</span> |
| | | <el-text type="info" size="small" tag="div">è¿è¡æ¶é¿</el-text> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-text type="default" size="default" tag="div" |
| | | >å¼å§ï¼{{ $fm.formatYMDH(model.startTime) }}</el-text |
| | | > |
| | | <el-text type="default" size="default" tag="div" |
| | | >ç»æï¼{{ $fm.formatYMDH(model.endTime) }}</el-text |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | | <el-row justify="end" align="bottom"> |
| | | <!-- <span class="f-s color-i">IDï¼{{ model.id }}</span> --> |
| | | <el-row> |
| | | <FYReconfrimButton v-if="waiting" @confirm="startTask" v-model="startConfirm"> |
| | | <el-button |
| | | plain |
| | | icon="VideoPlay" |
| | | type="primary" |
| | | size="small" |
| | | :loading="false" |
| | | @click="startConfirm = true" |
| | | >å¼å§ä»»å¡</el-button |
| | | > |
| | | </FYReconfrimButton> |
| | | <FYReconfrimButton v-if="running" @confirm="stopTask" v-model="stopConfirm"> |
| | | <el-button |
| | | icon="VideoPause" |
| | | plain |
| | | type="danger" |
| | | size="small" |
| | | :loading="false" |
| | | @click="stopConfirm = true" |
| | | >强å¶ç»æ</el-button |
| | | > |
| | | </FYReconfrimButton> |
| | | <FYReconfrimButton v-if="!running" @confirm="removeTask" v-model="removeConfirm"> |
| | | <el-button |
| | | icon="Delete" |
| | | plain |
| | | type="danger" |
| | | size="small" |
| | | :loading="false" |
| | | @click="removeConfirm = true" |
| | | >ç§»é¤ä»»å¡</el-button |
| | | > |
| | | </FYReconfrimButton> |
| | | <el-button |
| | | v-if="success" |
| | | plain |
| | | type="success" |
| | | size="small" |
| | | :loading="false" |
| | | @click="gotoResult" |
| | | >æ¥çç»æ<el-icon class="m-l-4"><Right /></el-icon |
| | | ></el-button> |
| | | </el-row> |
| | | </el-row> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <div> |
| | | <el-text truncated>{{ model.name }}asdasdasdasdasdasdaasdasdasdasdasdasdaasdasdasdasdasdasdaasdasdasdasdasdasda</el-text> |
| | | </div> --> |
| | | |
| | | <!-- </template> --> |
| | | <div> |
| | | <el-text type="info" size="small">IDï¼{{ model.id }}</el-text> |
| | | </div> |
| | | |
| | | <div> |
| | | <el-text type="info" size="small">ç¶æï¼{{ nameToLabel(model.status) }}</el-text> |
| | | </div> |
| | | <div> |
| | | <el-text type="info" size="small">å¼å§ï¼{{ model.startTime }}</el-text> |
| | | </div> |
| | | <div> |
| | | <el-text type="info" size="small">ç»æï¼{{ model.endTime }}</el-text> |
| | | </div> |
| | | <!-- <template #footer> --> |
| | | <el-row justify="end"> |
| | | <el-button type="primary" size="small" :loading="false" @click="$emit('start', model)" |
| | | >å¼å§ä»»å¡</el-button |
| | | > |
| | | <el-button type="danger" size="small" :loading="false" @click="$emit('shutDown', model)" |
| | | >强å¶ç»æ</el-button |
| | | > |
| | | <el-button type="danger" size="small" :loading="false" @click="$emit('remove', model)" |
| | | >ç§»é¤ä»»å¡</el-button |
| | | > |
| | | <el-button type="danger" size="small" :loading="false" @click="$emit('gotoResult', model)" |
| | | >æ¥çç»æ</el-button |
| | | > |
| | | </el-row> |
| | | <!-- </template> --> |
| | | </el-card> |
| | | </template> |
| | | <script> |
| | | import { nTlBgTask } from '@/enum/bgTask'; |
| | | import { nTlBgTask, BG_TASK_STATUS } from '@/enum/bgTask'; |
| | | import { useTimer } from '../../composables/timer'; |
| | | |
| | | export default { |
| | | setup() { |
| | | const { time, startTimer, pauseTimer, stopTimer } = useTimer(); |
| | | return { time, startTimer, pauseTimer, stopTimer }; |
| | | }, |
| | | props: { |
| | | model: Object |
| | | model: Object, |
| | | index: Number |
| | | }, |
| | | emits: ['start', 'shutDown', 'remove', 'gotoResult'], |
| | | data() { |
| | | return { |
| | | startConfirm: false, |
| | | stopConfirm: false, |
| | | removeConfirm: false |
| | | }; |
| | | }, |
| | | computed: { |
| | | waiting() { |
| | | return this.model.status == BG_TASK_STATUS.WAITING.name; |
| | | }, |
| | | running() { |
| | | return this.model.status == BG_TASK_STATUS.RUNNING.name; |
| | | }, |
| | | success() { |
| | | return this.model.status == BG_TASK_STATUS.SUCCESS.name; |
| | | }, |
| | | fail() { |
| | | return this.model.status == BG_TASK_STATUS.FAIL.name; |
| | | }, |
| | | shutdown() { |
| | | return this.model.status == BG_TASK_STATUS.SHUTDOWN.name; |
| | | } |
| | | }, |
| | | methods: { |
| | | nameToLabel(name) { |
| | | const t = nTlBgTask(name); |
| | | return t.label; |
| | | }, |
| | | startTask() { |
| | | this.$emit('start', this.index, (res) => { |
| | | if (res) { |
| | | this.startTimer(); |
| | | } |
| | | }); |
| | | }, |
| | | stopTask() { |
| | | this.$emit('shutDown', this.index, (res) => { |
| | | if (res) { |
| | | this.stopTimer(); |
| | | } |
| | | }); |
| | | }, |
| | | removeTask() { |
| | | this.$emit('remove', this.index, (res) => { |
| | | if (res) { |
| | | // this.stopTimer(); |
| | | } |
| | | }); |
| | | }, |
| | | gotoResult() { |
| | | this.$emit('gotoResult', this.index); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .bg-task-card { |
| | | margin-bottom: 8px; |
| | | .status-btn { |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border: var(--el-border); |
| | | border-radius: var(--el-border-radius-base); |
| | | } |
| | | .timer { |
| | | font-size: 30px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-popover :visible="modelValue" placement="top" :width="160"> |
| | | <p>{{ msg }}</p> |
| | | <div style="text-align: right; margin: 0"> |
| | | <el-button size="small" text @click="handleCancel">åæ¶</el-button> |
| | | <el-button size="small" type="primary" @click="handleConfirm">确认</el-button> |
| | | </div> |
| | | <template #reference> |
| | | <!-- <slots-events @click="visible = true"> --> |
| | | <slot></slot> |
| | | <!-- </slots-events> --> |
| | | </template> |
| | | </el-popover> |
| | | </template> |
| | | <script> |
| | | /** |
| | | * äºæ¬¡ç¡®è®¤æé® |
| | | */ |
| | | export default { |
| | | props: { |
| | | modelValue: Boolean, |
| | | msg: { |
| | | type: String, |
| | | default: '确认æä½ï¼' |
| | | } |
| | | }, |
| | | emits: ['confirm', 'cancel', 'update:modelValue'], |
| | | data() { |
| | | return { |
| | | // visible: false |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleConfirm() { |
| | | // this.visible = false; |
| | | this.$emit('confirm'); |
| | | this.$emit('update:modelValue', false); |
| | | }, |
| | | handleCancel() { |
| | | // this.visible = false; |
| | | this.$emit('cancel'); |
| | | this.$emit('update:modelValue', false); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { ref, computed } from 'vue'; |
| | | |
| | | /** |
| | | * ç§è¡¨è®¡æ¶å¨ |
| | | */ |
| | | export function useTimer() { |
| | | let interval; |
| | | const count = ref(0); |
| | | const running = ref(false); |
| | | const time = computed(() => { |
| | | const hour = Math.floor(count.value / 3600); |
| | | const min = Math.floor((count.value - hour * 3600) / 60); |
| | | const sec = Math.floor(count.value - hour * 3600 - min * 60); |
| | | |
| | | return `${hour.toString().padStart(2, '0')}:${min.toString().padStart(2, '0')}:${sec |
| | | .toString() |
| | | .padStart(2, '0')}`; |
| | | }); |
| | | |
| | | function startTimer() { |
| | | if (!running.value) { |
| | | interval = setInterval(() => { |
| | | count.value++; |
| | | }, 1000); |
| | | running.value = true |
| | | } |
| | | } |
| | | |
| | | function pauseTimer() { |
| | | if (interval) { |
| | | clearInterval(interval); |
| | | } |
| | | running.value = false |
| | | } |
| | | |
| | | function stopTimer() { |
| | | pauseTimer(); |
| | | count.value = 0; |
| | | } |
| | | |
| | | return { time, startTimer, pauseTimer, stopTimer, running }; |
| | | } |
| | |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue'; |
| | | import { router } from './router'; |
| | | import App from './App.vue'; |
| | | |
| | | import timeUtil from './utils/time-util'; |
| | | |
| | | // import 'element-plus/dist/index.css'; |
| | | import './assets/main.css' |
| | | import './assets/main.css'; |
| | | |
| | | import "element-plus/theme-chalk/src/overlay.scss" |
| | | import "element-plus/theme-chalk/src/message.scss" |
| | | import "element-plus/theme-chalk/src/message-box.scss" |
| | | import "element-plus/theme-chalk/src/notification.scss" |
| | | import 'element-plus/theme-chalk/src/overlay.scss'; |
| | | import 'element-plus/theme-chalk/src/message.scss'; |
| | | import 'element-plus/theme-chalk/src/message-box.scss'; |
| | | import 'element-plus/theme-chalk/src/notification.scss'; |
| | | |
| | | const app = createApp(App); |
| | | |
| | | app.config.globalProperties.$fm = timeUtil; |
| | | |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | | app.component(key, component); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // |
| | | @mixin font-size($size) { |
| | | font-size: var($size); |
| | | } |
| | | |
| | | .f-s { |
| | | @include font-size(--el-font-size-small); |
| | | } |
| | | |
| | | .f-b { |
| | | @include font-size(--el-font-size-base); |
| | | } |
| | | |
| | | .f-m { |
| | | @include font-size(--el-font-size-medium); |
| | | } |
| | | |
| | | .f-l { |
| | | @include font-size(--el-font-size-large); |
| | | } |
| | | |
| | | @mixin color($value) { |
| | | color: var($value); |
| | | } |
| | | |
| | | .color-p { |
| | | @include color(--el-color-primary); |
| | | } |
| | | |
| | | .color-s { |
| | | @include color(--el-color-success); |
| | | } |
| | | |
| | | .color-w { |
| | | @include color(--el-color-warning); |
| | | } |
| | | |
| | | .color-d { |
| | | @include color(--el-color-danger); |
| | | } |
| | | |
| | | .color-e { |
| | | @include color(--el-color-error); |
| | | } |
| | | |
| | | .color-i { |
| | | @include color(--el-color-info); |
| | | } |
| | | |
| | | .b-color-aqua { |
| | | background-color: aqua; |
| | | } |
| | | |
| | | // |
| | | .p-l-8 { |
| | | padding-left: 8px; |
| | | } |
| | | |
| | | .p-v-8 { |
| | | padding: 8px 0; |
| | | } |
| | | |
| | | .m-b-8 { |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .m-l-4 { |
| | | margin-left: 4px; |
| | | } |
| | | |
| | | .w-150px { |
| | | width: 290px; |
| | | } |
| | | |
| | | // |
| | | .cursor-p { |
| | | cursor: pointer; |
| | | } |
| | |
| | | // You should use them in scss, because we calculate it by sass. |
| | | // comment next lines to use default color |
| | | // @forward "element-plus/theme-chalk/src/common/var.scss" with ( |
| | | // do not use same name, it will override. |
| | | // $colors: $--colors, |
| | | // $button-padding-horizontal: ("default": 50px) |
| | | // do not use same name, it will override. |
| | | // $colors: $--colors, |
| | | // $button-padding-horizontal: ("default": 50px) |
| | | // ); |
| | | |
| | | // if you want to import all |
| | |
| | | // @debug $--colors; |
| | | |
| | | // custom dark variables |
| | | @use "./dark.scss"; |
| | | @use "./animation.scss" |
| | | @use './dark.scss'; |
| | | @use './animation.scss'; |
| | | @use './base.scss'; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import dayjs from "dayjs"; |
| | | |
| | | export default { |
| | | format(date, template) { |
| | | return dayjs(date).format(template) |
| | | }, |
| | | |
| | | formatH(date){ |
| | | if (date) { |
| | | return this.format(date, 'HH:mm:ss') |
| | | } else { |
| | | return '--:--:--' |
| | | } |
| | | }, |
| | | |
| | | formatYMD(date){ |
| | | if (date) { |
| | | return this.format(date, 'YYYY-MM-DD') |
| | | } else { |
| | | return '----/--/--' |
| | | } |
| | | }, |
| | | |
| | | formatYMDH(date){ |
| | | if (date) { |
| | | return this.format(date, 'YYYY-MM-DD HH:mm:ss') |
| | | } else { |
| | | return '----/--/-- --:--:--' |
| | | } |
| | | }, |
| | | } |
| | |
| | | <template v-for="(v, i) in taskList" :key="i"> |
| | | <FYBgTaskCard |
| | | :model="v" |
| | | :index="i" |
| | | @start="startTask" |
| | | @shutDown="shutDownTask" |
| | | @remove="removeTask" |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | newTestTask() { |
| | | this.fetchData((page, pageSize) => { |
| | | return bgtaskApi.newTestTask(`Test-Task-${++this.taskIndex}`).then((res) => { |
| | | this.taskList.push(res.data); |
| | | }); |
| | | }); |
| | | }, |
| | | startNewTestTask() { |
| | | this.fetchData((page, pageSize) => { |
| | | return bgtaskApi.startNewTestTask(`Test-Task-${++this.taskIndex}`).then((res) => { |
| | | this.taskList.push(res.data); |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | _getParam(taskStatus) { |
| | | return { |
| | | type: taskStatus.type, |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | startTask(taskStatus) { |
| | | startTask(index, callback) { |
| | | this.fetchData((page, pageSize) => { |
| | | return bgtaskApi.startTask(this._getParam(taskStatus)).then((res) => { |
| | | this.taskList = this.taskList.concat(res.data); |
| | | const param = this._getParam(this.taskList[index]); |
| | | return bgtaskApi.startTask(param).then((res) => { |
| | | this.taskList[index] = res.data; |
| | | callback(true); |
| | | }); |
| | | }); |
| | | }, |
| | | newTestTask() { |
| | | shutDownTask(index, callback) { |
| | | this.fetchData((page, pageSize) => { |
| | | return bgtaskApi.newTestTask(`Test-Task-${++this.taskIndex}`).then((res) => { |
| | | this.taskList = this.taskList.concat(res.data); |
| | | }); |
| | | }); |
| | | }, |
| | | startNewTestTask() { |
| | | this.fetchData((page, pageSize) => { |
| | | return bgtaskApi.startNewTestTask(`Test-Task-${++this.taskIndex}`).then((res) => { |
| | | this.taskList = this.taskList.concat(res.data); |
| | | }); |
| | | }); |
| | | }, |
| | | shutDownTask(taskStatus) { |
| | | this.fetchData((page, pageSize) => { |
| | | return bgtaskApi.shutDownTask(this._getParam(taskStatus)).then((res) => { |
| | | res.data.forEach((e) => { |
| | | let v = this.taskList.find((value) => { |
| | | return value.id == e.id; |
| | | const param = this._getParam(this.taskList[index]); |
| | | return bgtaskApi.shutDownTask(param).then((res) => { |
| | | if (index && res.data && res.data.length == 1) { |
| | | this.taskList[index] = res.data[0]; |
| | | } else { |
| | | res.data.forEach((e) => { |
| | | let v = this.taskList.find((value) => { |
| | | return value.id == e.id; |
| | | }); |
| | | const i = this.taskList.indexOf(v); |
| | | this.taskList[i] = e; |
| | | }); |
| | | const i = this.taskList.indexOf(v); |
| | | this.taskList[i] = e; |
| | | }); |
| | | } |
| | | callback(true); |
| | | }); |
| | | }); |
| | | }, |
| | | removeTask(taskStatus){ |
| | | |
| | | removeTask(index, callback) { |
| | | this.fetchData((page, pageSize) => { |
| | | const param = this._getParam(this.taskList[index]); |
| | | return bgtaskApi.removeTask(param).then((res) => { |
| | | if (res.data) { |
| | | this.taskList.splice(index, 1); |
| | | callback(true); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | gotoResult(taskStatus) { |
| | | |
| | | } |
| | | }, |
| | | gotoResult(index) {} |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | |
| | | <el-col :span="5"> |
| | | <el-button v-if="!v.pass" type="primary" size="small" @click="goto(v.path)"> |
| | | å»å®å |
| | | <el-icon style="margin-left: 4px"><Right /></el-icon> |
| | | <el-icon class="m-l-4"><Right /></el-icon> |
| | | </el-button> |
| | | </el-col> |
| | | </el-form-item> |
| | |
| | | // allow auto load markdown components under `./src/components/` |
| | | extensions: ['vue', 'md'], |
| | | // allow auto import and register components used in markdown |
| | | include: [/\.vue$/, /\.vue\?vue/, /\.md$/], |
| | | include: [/\.vue$/, /\.vue\?vue/, /\.md$/, /\.ts$/], |
| | | resolvers: [ |
| | | ElementPlusResolver({ |
| | | importStyle: 'sass' |