--no commit message
Showing
2 changed files
with
197 additions
and
201 deletions
| ... | @@ -29,227 +29,227 @@ | ... | @@ -29,227 +29,227 @@ |
| 29 | </div> | 29 | </div> |
| 30 | </template> | 30 | </template> |
| 31 | <script> | 31 | <script> |
| 32 | // 定时任务 | 32 | // 定时任务 |
| 33 | import data from "./data" | 33 | import data from "./data" |
| 34 | import sjsbTask from '@/api/sjsbTask.js' | 34 | import sjsbTask from '@/api/sjsbTask.js' |
| 35 | import tableMixin from '@/mixins/tableMixin.js' | 35 | import tableMixin from '@/mixins/tableMixin.js' |
| 36 | import addTask from '../components/addTask.vue' | 36 | import addTask from '../components/addTask.vue' |
| 37 | export default { | 37 | export default { |
| 38 | name: "timedTask", | 38 | name: "timedTask", |
| 39 | mixins: [tableMixin], | 39 | mixins: [tableMixin], |
| 40 | components: { | 40 | components: { |
| 41 | addTask | 41 | addTask |
| 42 | }, | ||
| 43 | data () { | ||
| 44 | return { | ||
| 45 | taskData: null, | ||
| 46 | isDialog: false, | ||
| 47 | form: { | ||
| 48 | jobName: '', | ||
| 49 | currentPage: 1 | ||
| 50 | }, | ||
| 51 | selectionList: [], | ||
| 52 | tableData: { | ||
| 53 | columns: [{ | ||
| 54 | label: '序号', | ||
| 55 | type: 'index', | ||
| 56 | width: '50', | ||
| 57 | index: this.indexMethod, | ||
| 58 | }].concat(data.columns()).concat([ | ||
| 59 | { | ||
| 60 | label: "操作", | ||
| 61 | width: 380, | ||
| 62 | render: (h, scope) => { | ||
| 63 | return ( | ||
| 64 | <div> | ||
| 65 | <el-button type="text" | ||
| 66 | v-show={scope.row.jobStatus === 0} | ||
| 67 | class='btnColor' | ||
| 68 | icon="el-icon-video-pause" | ||
| 69 | onClick={() => { this.handleActive(scope.row) }}>激活 | ||
| 70 | </el-button> | ||
| 71 | <el-button type="text" | ||
| 72 | v-show={scope.row.jobStatus === -1} | ||
| 73 | class='btnColor' | ||
| 74 | icon="el-icon-video-pause" | ||
| 75 | onClick={() => { this.recover(scope.row) }}>恢复 | ||
| 76 | </el-button> | ||
| 77 | <el-button type="text" | ||
| 78 | icon="el-icon-edit" | ||
| 79 | class='btnColor' | ||
| 80 | onClick={() => { this.handleEdit(scope.row) }}>编辑 | ||
| 81 | </el-button> | ||
| 82 | <el-button type="text" | ||
| 83 | icon="el-icon-delete" | ||
| 84 | class='successColor' | ||
| 85 | v-show={scope.row.jobStatus !== -1} | ||
| 86 | onClick={() => { this.handleDel(scope.row) }}>删除 | ||
| 87 | </el-button> | ||
| 88 | </div> | ||
| 89 | ); | ||
| 90 | }, | ||
| 91 | }, | ||
| 92 | ]), | ||
| 93 | data: [] | ||
| 94 | }, | ||
| 95 | pageData: { | ||
| 96 | total: 0, | ||
| 97 | pageSize: 15, | ||
| 98 | current: 1, | ||
| 99 | }, | ||
| 100 | } | ||
| 101 | }, | ||
| 102 | methods: { | ||
| 103 | handleAdd () { | ||
| 104 | this.taskData = null | ||
| 105 | this.isDialog = true | ||
| 106 | }, | 42 | }, |
| 107 | resetSe () { | 43 | data () { |
| 108 | this.form.jobName = '' | 44 | return { |
| 109 | this.featchData() | 45 | taskData: null, |
| 110 | }, | 46 | isDialog: false, |
| 111 | async featchData () { | 47 | form: { |
| 112 | try { | 48 | jobName: '', |
| 113 | this.form = Object.assign(this.form, this.formData) | 49 | currentPage: 1 |
| 114 | let { result } = await sjsbTask.getTaskListByName(this.form) | 50 | }, |
| 115 | this.tableData.data = result.list | 51 | selectionList: [], |
| 116 | } catch (error) { | 52 | tableData: { |
| 117 | this.message = error | 53 | columns: [{ |
| 54 | label: '序号', | ||
| 55 | type: 'index', | ||
| 56 | width: '50', | ||
| 57 | index: this.indexMethod, | ||
| 58 | }].concat(data.columns()).concat([ | ||
| 59 | { | ||
| 60 | label: "操作", | ||
| 61 | width: 380, | ||
| 62 | render: (h, scope) => { | ||
| 63 | return ( | ||
| 64 | <div> | ||
| 65 | <el-button type="text" | ||
| 66 | v-show={scope.row.jobStatus === 0} | ||
| 67 | class='btnColor' | ||
| 68 | icon="el-icon-video-pause" | ||
| 69 | onClick={() => { this.handleActive(scope.row) }}>激活 | ||
| 70 | </el-button> | ||
| 71 | <el-button type="text" | ||
| 72 | v-show={scope.row.jobStatus === -1} | ||
| 73 | class='btnColor' | ||
| 74 | icon="el-icon-video-pause" | ||
| 75 | onClick={() => { this.recover(scope.row) }}>恢复 | ||
| 76 | </el-button> | ||
| 77 | <el-button type="text" | ||
| 78 | icon="el-icon-edit" | ||
| 79 | class='btnColor' | ||
| 80 | onClick={() => { this.handleEdit(scope.row) }}>编辑 | ||
| 81 | </el-button> | ||
| 82 | <el-button type="text" | ||
| 83 | icon="el-icon-delete" | ||
| 84 | class='successColor' | ||
| 85 | v-show={scope.row.jobStatus !== -1} | ||
| 86 | onClick={() => { this.handleDel(scope.row) }}>删除 | ||
| 87 | </el-button> | ||
| 88 | </div> | ||
| 89 | ); | ||
| 90 | }, | ||
| 91 | }, | ||
| 92 | ]), | ||
| 93 | data: [] | ||
| 94 | }, | ||
| 95 | pageData: { | ||
| 96 | total: 0, | ||
| 97 | pageSize: 15, | ||
| 98 | current: 1, | ||
| 99 | }, | ||
| 118 | } | 100 | } |
| 119 | }, | 101 | }, |
| 120 | recover (row) { | 102 | methods: { |
| 121 | this.$confirm('此操将进行恢复操作, 是否继续?', '提示', { | 103 | handleAdd () { |
| 122 | confirmButtonText: '确定', | 104 | this.taskData = null |
| 123 | cancelButtonText: '取消', | 105 | this.isDialog = true |
| 124 | type: 'warning', | 106 | }, |
| 125 | }) | 107 | resetSe () { |
| 126 | .then(() => { | 108 | this.form.jobName = '' |
| 127 | sjsbTask.recover(row.jobId) | 109 | this.featchData() |
| 128 | .then((res) => { | 110 | }, |
| 129 | if ((res.code = 200)) { | 111 | async featchData () { |
| 130 | this.$message({ | 112 | try { |
| 131 | type: 'success', | 113 | this.form = Object.assign(this.form, this.formData) |
| 132 | message: res.message, | 114 | let { result } = await sjsbTask.getTaskListByName(this.form) |
| 115 | this.tableData.data = result.list | ||
| 116 | } catch (error) { | ||
| 117 | this.message = error | ||
| 118 | } | ||
| 119 | }, | ||
| 120 | recover (row) { | ||
| 121 | this.$confirm('此操将进行恢复操作, 是否继续?', '提示', { | ||
| 122 | confirmButtonText: '确定', | ||
| 123 | cancelButtonText: '取消', | ||
| 124 | type: 'warning', | ||
| 125 | }) | ||
| 126 | .then(() => { | ||
| 127 | sjsbTask.recover(row.jobId) | ||
| 128 | .then((res) => { | ||
| 129 | if ((res.code = 200)) { | ||
| 130 | this.$message({ | ||
| 131 | type: 'success', | ||
| 132 | message: res.message, | ||
| 133 | }) | ||
| 134 | this.featchData() | ||
| 135 | } | ||
| 136 | }) | ||
| 137 | .catch((error) => { | ||
| 138 | this.$alert(error, '提示', { | ||
| 139 | confirmButtonText: '确定', | ||
| 140 | type: 'error' | ||
| 133 | }) | 141 | }) |
| 134 | this.featchData() | ||
| 135 | } | ||
| 136 | }) | ||
| 137 | .catch((error) => { | ||
| 138 | this.$alert(error, '提示', { | ||
| 139 | confirmButtonText: '确定', | ||
| 140 | type: 'error' | ||
| 141 | }) | 142 | }) |
| 143 | }) | ||
| 144 | .catch(() => { | ||
| 145 | this.$message({ | ||
| 146 | type: 'info', | ||
| 147 | message: '已取消', | ||
| 142 | }) | 148 | }) |
| 143 | }) | ||
| 144 | .catch(() => { | ||
| 145 | this.$message({ | ||
| 146 | type: 'info', | ||
| 147 | message: '已取消', | ||
| 148 | }) | 149 | }) |
| 149 | }) | 150 | }, |
| 150 | }, | ||
| 151 | 151 | ||
| 152 | handleActive (row) { | 152 | handleActive (row) { |
| 153 | this.$confirm('此操将进行激活操作, 是否继续?', '提示', { | 153 | this.$confirm('此操将进行激活操作, 是否继续?', '提示', { |
| 154 | confirmButtonText: '确定', | 154 | confirmButtonText: '确定', |
| 155 | cancelButtonText: '取消', | 155 | cancelButtonText: '取消', |
| 156 | type: 'warning', | 156 | type: 'warning', |
| 157 | }) | 157 | }) |
| 158 | .then(() => { | 158 | .then(() => { |
| 159 | sjsbTask.active(row.jobId) | 159 | sjsbTask.active(row.jobId) |
| 160 | .then((res) => { | 160 | .then((res) => { |
| 161 | if ((res.code = 200)) { | 161 | if ((res.code = 200)) { |
| 162 | this.$message({ | 162 | this.$message({ |
| 163 | type: 'success', | 163 | type: 'success', |
| 164 | message: res.message, | 164 | message: res.message, |
| 165 | }) | ||
| 166 | this.featchData() | ||
| 167 | } | ||
| 168 | }) | ||
| 169 | .catch((error) => { | ||
| 170 | this.$alert(error, '提示', { | ||
| 171 | confirmButtonText: '确定', | ||
| 172 | type: 'error' | ||
| 165 | }) | 173 | }) |
| 166 | this.featchData() | ||
| 167 | } | ||
| 168 | }) | ||
| 169 | .catch((error) => { | ||
| 170 | this.$alert(error, '提示', { | ||
| 171 | confirmButtonText: '确定', | ||
| 172 | type: 'error' | ||
| 173 | }) | 174 | }) |
| 175 | }) | ||
| 176 | .catch(() => { | ||
| 177 | this.$message({ | ||
| 178 | type: 'info', | ||
| 179 | message: '已取消', | ||
| 174 | }) | 180 | }) |
| 175 | }) | ||
| 176 | .catch(() => { | ||
| 177 | this.$message({ | ||
| 178 | type: 'info', | ||
| 179 | message: '已取消', | ||
| 180 | }) | 181 | }) |
| 182 | }, | ||
| 183 | // 暂停 | ||
| 184 | handleSuspend (row) { | ||
| 185 | this.$confirm('此操将进行暂停操作, 是否继续?', '提示', { | ||
| 186 | confirmButtonText: '确定', | ||
| 187 | cancelButtonText: '取消', | ||
| 188 | type: 'warning', | ||
| 181 | }) | 189 | }) |
| 182 | }, | 190 | .then(() => { |
| 183 | // 暂停 | 191 | sjsbTask.pauseJob(row.id) |
| 184 | handleSuspend (row) { | 192 | .then((res) => { |
| 185 | this.$confirm('此操将进行暂停操作, 是否继续?', '提示', { | 193 | if ((res.code = 200)) { |
| 186 | confirmButtonText: '确定', | 194 | this.$message({ |
| 187 | cancelButtonText: '取消', | 195 | type: 'success', |
| 188 | type: 'warning', | 196 | message: res.message, |
| 189 | }) | 197 | }) |
| 190 | .then(() => { | 198 | this.featchData() |
| 191 | sjsbTask.pauseJob(row.id) | 199 | } |
| 192 | .then((res) => { | 200 | }) |
| 193 | if ((res.code = 200)) { | 201 | .catch((error) => { |
| 194 | this.$message({ | 202 | this.$alert(error, '提示', { |
| 195 | type: 'success', | 203 | confirmButtonText: '确定', |
| 196 | message: res.message, | 204 | type: 'error' |
| 197 | }) | 205 | }) |
| 198 | this.featchData() | ||
| 199 | } | ||
| 200 | }) | ||
| 201 | .catch((error) => { | ||
| 202 | this.$alert(error, '提示', { | ||
| 203 | confirmButtonText: '确定', | ||
| 204 | type: 'error' | ||
| 205 | }) | 206 | }) |
| 207 | }) | ||
| 208 | .catch(() => { | ||
| 209 | this.$message({ | ||
| 210 | type: 'info', | ||
| 211 | message: '已取消', | ||
| 206 | }) | 212 | }) |
| 207 | }) | ||
| 208 | .catch(() => { | ||
| 209 | this.$message({ | ||
| 210 | type: 'info', | ||
| 211 | message: '已取消', | ||
| 212 | }) | 213 | }) |
| 214 | }, | ||
| 215 | handleEdit (row) { | ||
| 216 | this.taskData = row | ||
| 217 | this.isDialog = true | ||
| 218 | }, | ||
| 219 | handleDel (row) { | ||
| 220 | this.$confirm('此操将进行删除操作, 是否继续?', '提示', { | ||
| 221 | confirmButtonText: '确定', | ||
| 222 | cancelButtonText: '取消', | ||
| 223 | type: 'warning', | ||
| 213 | }) | 224 | }) |
| 214 | }, | 225 | .then(() => { |
| 215 | handleEdit (row) { | 226 | sjsbTask.sjsbTaskRemove(row.jobId) |
| 216 | this.taskData = row | 227 | .then((res) => { |
| 217 | this.isDialog = true | 228 | if ((res.code = 200)) { |
| 218 | }, | 229 | this.$message({ |
| 219 | handleDel (row) { | 230 | type: 'success', |
| 220 | this.$confirm('此操将进行删除操作, 是否继续?', '提示', { | 231 | message: res.message, |
| 221 | confirmButtonText: '确定', | 232 | }) |
| 222 | cancelButtonText: '取消', | 233 | this.featchData() |
| 223 | type: 'warning', | 234 | } |
| 224 | }) | 235 | }) |
| 225 | .then(() => { | 236 | .catch((error) => { |
| 226 | sjsbTask.sjsbTaskRemove(row.jobId) | 237 | this.$alert(error, '提示', { |
| 227 | .then((res) => { | 238 | confirmButtonText: '确定', |
| 228 | if ((res.code = 200)) { | 239 | type: 'error' |
| 229 | this.$message({ | ||
| 230 | type: 'success', | ||
| 231 | message: res.message, | ||
| 232 | }) | 240 | }) |
| 233 | this.featchData() | ||
| 234 | } | ||
| 235 | }) | ||
| 236 | .catch((error) => { | ||
| 237 | this.$alert(error, '提示', { | ||
| 238 | confirmButtonText: '确定', | ||
| 239 | type: 'error' | ||
| 240 | }) | 241 | }) |
| 242 | }) | ||
| 243 | .catch(() => { | ||
| 244 | this.$message({ | ||
| 245 | type: 'info', | ||
| 246 | message: '已取消', | ||
| 241 | }) | 247 | }) |
| 242 | }) | ||
| 243 | .catch(() => { | ||
| 244 | this.$message({ | ||
| 245 | type: 'info', | ||
| 246 | message: '已取消', | ||
| 247 | }) | 248 | }) |
| 248 | }) | 249 | } |
| 249 | } | 250 | } |
| 250 | } | 251 | } |
| 251 | } | ||
| 252 | </script> | 252 | </script> |
| 253 | <style scoped lang="scss"> | 253 | <style scoped lang="scss"> |
| 254 | @import "~@/styles/mixin.scss"; | 254 | @import "~@/styles/mixin.scss"; |
| 255 | </style> | 255 | </style> | ... | ... |
| ... | @@ -408,9 +408,5 @@ export default { | ... | @@ -408,9 +408,5 @@ export default { |
| 408 | }; | 408 | }; |
| 409 | </script> | 409 | </script> |
| 410 | <style scoped lang="scss"> | 410 | <style scoped lang="scss"> |
| 411 | <<<<<<< HEAD | ||
| 412 | @import "~@/styles/mixin.scss"; | 411 | @import "~@/styles/mixin.scss"; |
| 413 | ======= | ||
| 414 | @import "~@/styles/mixin.scss"; | ||
| 415 | >>>>>>> 7c233183698a503df659c8b6cf28f340f4de3587 | ||
| 416 | </style> | 412 | </style> | ... | ... |
-
Please register or sign in to post a comment