| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:quartz:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="Beanåç§°" prop="beanName"> |
| | | <el-input v-model="searchForm.beanName" placeholder="请è¾å
¥åå¸äºº" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="模ååç§°" prop="module"> |
| | | <el-input v-model="searchForm.module" placeholder="请è¾å
¥åå¸äºº" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <!-- <el-button type="primary" :loading="isWorking.export" v-permissions="['business:devices:exportExcel']" @click="exportExcel">导åº</el-button> --> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:quartz:create']"> |
| | | <li><el-button type="primary" @click="$refs.OperaTimerWindow.open('æ°å»ºä»»å¡')" icon="el-icon-plus" v-permissions="['business:devices:create']">æ°å»º</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | border |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="index" prop="index" label="åºå·" align="center" min-width="50px"></el-table-column> |
| | | <el-table-column prop="beanName" label="BEANåç§°" align="center" min-width="150px"></el-table-column> |
| | | <el-table-column prop="module" label="模ååç§°" align="center" min-width="180px"></el-table-column> |
| | | <el-table-column prop="params" label="æ§è¡åæ°" align="center" min-width="180px"></el-table-column> |
| | | <el-table-column prop="state" label="ç¶æ" align="center" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.state ==1" style="color:green">æ£å¸¸</span> |
| | | <span v-if="row.state ==2" style="color: red">æå</span> |
| | | <span v-if="row.state ==3" style="color: red">å·²å é¤</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="cronExpres" label="表达å¼" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" align="center" min-width="180px"></el-table-column> |
| | | <el-table-column prop="remark" label="夿³¨" align="center" min-width="180px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:quartz:update'])" |
| | | label="æä½" |
| | | fixed="right" |
| | | min-width="220" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.OperaTimerWindow.open('ç¼è¾ä»»å¡', row)" v-permissions="['business:quartz:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="runById(row)" v-permissions="['business:quartz:update']">æ§è¡ä¸æ¬¡</el-button> |
| | | <el-button type="text" v-if="row.state == 1" style="color: red" @click="pauseById(row)" v-permissions="['business:quartz:update']">æå</el-button> |
| | | <el-button type="text" v-if="row.state == 2" style="color: green" @click="resumeById(row)" v-permissions="['business:quartz:update']">æ¢å¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | ></pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaTimerWindow ref="OperaTimerWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaTimerWindow from '@/views/timer/components/OperaTimerWindow' |
| | | import {runOnceById} from "@/api/timer/timer"; |
| | | export default { |
| | | name: 'Devices', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaTimerWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | beanName: '', |
| | | module: '' |
| | | }, |
| | | pausing:false, |
| | | running:false, |
| | | resuming:false, |
| | | room: [] |
| | | } |
| | | }, |
| | | provide() { |
| | | return { |
| | | room: () => this.room |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '设å¤ç®¡çä¿¡æ¯è¡¨', |
| | | api: '/timer/timer', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | pauseById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æå该任å¡å?') |
| | | .then(() => { |
| | | this.pausing = true |
| | | this.api.pauseById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æåæå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.pausing = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | resumeById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æ¢å¤è¯¥ä»»å¡å?') |
| | | .then(() => { |
| | | this.resuming = true |
| | | this.api.resumeById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æ¢å¤æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.resuming = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | runById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æ§è¡ä¸æ¬¡è¯¥ä»»å¡å?') |
| | | .then(() => { |
| | | this.running = true |
| | | this.api.runOnceById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æ§è¡æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.running = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | }, |
| | | } |
| | | |
| | | </script> |