style:定时任务
Showing
4 changed files
with
118 additions
and
138 deletions
| 1 | { | 1 | { |
| 2 | "TITLE": "汉中市数据上报系统", | 2 | "TITLE": "汉中市数据上报系统", |
| 3 | "THEME": "jg", | 3 | "THEME": "sb", |
| 4 | "LOGIN": "jg", | 4 | "LOGIN": "sb", |
| 5 | "CODE": "BDCJGPT", | 5 | "CODE": "BDCSBPT", |
| 6 | "AREARMAP": "610702", | 6 | "AREARMAP": "610702", |
| 7 | "SERVERAPI": "/bdcsjsb", | 7 | "SERVERAPI": "/bdcsjsb", |
| 8 | "calcHeight": 160, | 8 | "calcHeight": 160, | ... | ... |
| ... | @@ -73,15 +73,17 @@ | ... | @@ -73,15 +73,17 @@ |
| 73 | 73 | ||
| 74 | <el-row> | 74 | <el-row> |
| 75 | <el-col :span="8"> | 75 | <el-col :span="8"> |
| 76 | <el-form-item prop="FDZL"> | 76 | <el-form-item prop="QSZT"> |
| 77 | <span slot="label"> | 77 | <span slot="label"> |
| 78 | 房地坐落: <br /> | 78 | 权属状态: <br /> |
| 79 | <p class="label-detail">(FDZL)</p> | 79 | <p class="label-detail">(QSZT)</p> |
| 80 | </span> | 80 | </span> |
| 81 | <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.fdzl"></el-input> | 81 | <el-select :disabled="$store.state.business.Edit" v-model="ruleForm.qszt"> |
| 82 | <el-option v-for="item in dicData['A22']" :key="item.DCODE" :label="item.DNAME" :value="item.DCODE"> | ||
| 83 | </el-option> | ||
| 84 | </el-select> | ||
| 82 | </el-form-item> | 85 | </el-form-item> |
| 83 | </el-col> | 86 | </el-col> |
| 84 | |||
| 85 | <el-col :span="8"> | 87 | <el-col :span="8"> |
| 86 | <el-form-item prop="TDSYQR"> | 88 | <el-form-item prop="TDSYQR"> |
| 87 | <span slot="label"> | 89 | <span slot="label"> |
| ... | @@ -333,19 +335,19 @@ | ... | @@ -333,19 +335,19 @@ |
| 333 | </el-form-item> | 335 | </el-form-item> |
| 334 | </el-col> | 336 | </el-col> |
| 335 | 337 | ||
| 336 | <el-col :span="8"> | 338 | |
| 337 | <el-form-item prop="QSZT"> | 339 | |
| 340 | </el-row> | ||
| 341 | <el-row> | ||
| 342 | <el-col :span="24"> | ||
| 343 | <el-form-item prop="FDZL"> | ||
| 338 | <span slot="label"> | 344 | <span slot="label"> |
| 339 | 权属状态: <br /> | 345 | 房地坐落: <br /> |
| 340 | <p class="label-detail">(QSZT)</p> | 346 | <p class="label-detail">(FDZL)</p> |
| 341 | </span> | 347 | </span> |
| 342 | <el-select :disabled="$store.state.business.Edit" v-model="ruleForm.qszt"> | 348 | <el-input :disabled="$store.state.business.Edit" v-model="ruleForm.fdzl"></el-input> |
| 343 | <el-option v-for="item in dicData['A22']" :key="item.DCODE" :label="item.DNAME" :value="item.DCODE"> | ||
| 344 | </el-option> | ||
| 345 | </el-select> | ||
| 346 | </el-form-item> | 349 | </el-form-item> |
| 347 | </el-col> | 350 | </el-col> |
| 348 | |||
| 349 | </el-row> | 351 | </el-row> |
| 350 | </el-form> | 352 | </el-form> |
| 351 | <message-tips ref="msg" /> | 353 | <message-tips ref="msg" /> | ... | ... |
| ... | @@ -723,6 +723,10 @@ | ... | @@ -723,6 +723,10 @@ |
| 723 | background: #ffffff; | 723 | background: #ffffff; |
| 724 | border: 1px solid #294ef1; | 724 | border: 1px solid #294ef1; |
| 725 | padding: 15px; | 725 | padding: 15px; |
| 726 | |||
| 727 | .el-form-item__content { | ||
| 728 | display: flex; | ||
| 729 | } | ||
| 726 | } | 730 | } |
| 727 | 731 | ||
| 728 | // 修改密码界面样式 | 732 | // 修改密码界面样式 | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | <!-- 编辑 --> | 2 | <!-- 编辑 --> |
| 3 | <dialogBox ref="addTask" width="50%" :isMain="true" @submitForm="handleSubmit" @closeDialog="handleClose" | 3 | <dialogBox ref="addTask" width="50%" :isMain="true" @submitForm="handleSubmit" @closeDialog="handleClose" |
| 4 | v-model="myValue" customClass="editValidRule" title="新增定时任务"> | 4 | v-model="myValue" customClass="editValidRule" title="新增定时任务"> |
| 5 | <div class="dialogCon" style="height:360px"> | 5 | <div class="dialogCon" style=""> |
| 6 | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px"> | 6 | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px"> |
| 7 | <el-row :gutter="20"> | 7 | <el-row :gutter="20"> |
| 8 | <el-col :span="12"> | 8 | <el-col :span="12"> |
| ... | @@ -31,7 +31,7 @@ | ... | @@ -31,7 +31,7 @@ |
| 31 | <el-row :gutter="20"> | 31 | <el-row :gutter="20"> |
| 32 | <el-col :span="24"> | 32 | <el-col :span="24"> |
| 33 | <el-form-item label="任务描述" prop="remark"> | 33 | <el-form-item label="任务描述" prop="remark"> |
| 34 | <el-input v-model="ruleForm.remark" placeholder="任务描述"></el-input> | 34 | <el-input v-model="ruleForm.remark" type="textarea" :rows="2" placeholder="任务描述"></el-input> |
| 35 | </el-form-item> | 35 | </el-form-item> |
| 36 | </el-col> | 36 | </el-col> |
| 37 | </el-row> | 37 | </el-row> |
| ... | @@ -42,136 +42,110 @@ | ... | @@ -42,136 +42,110 @@ |
| 42 | </template> | 42 | </template> |
| 43 | 43 | ||
| 44 | <script> | 44 | <script> |
| 45 | import sjsbTask from '@/api/sjsbTask.js' | 45 | import sjsbTask from '@/api/sjsbTask.js' |
| 46 | export default { | 46 | export default { |
| 47 | props: { | 47 | props: { |
| 48 | value: { type: Boolean, default: false }, | 48 | value: { type: Boolean, default: false }, |
| 49 | taskData: { | 49 | taskData: { |
| 50 | type: Object, | 50 | type: Object, |
| 51 | default: null | 51 | default: null |
| 52 | } | 52 | } |
| 53 | }, | ||
| 54 | data () { | ||
| 55 | return { | ||
| 56 | myValue: this.value, | ||
| 57 | ruleForm: { | ||
| 58 | jobName: '', | ||
| 59 | cronExpression: '', | ||
| 60 | beanName: '', | ||
| 61 | methodName: '', | ||
| 62 | methodParams: '', | ||
| 63 | remark: '' | ||
| 64 | }, | ||
| 65 | rules: { | ||
| 66 | jobName: [ | ||
| 67 | { required: true, message: '任务名', trigger: 'blur' } | ||
| 68 | ], | ||
| 69 | cronExpression: [ | ||
| 70 | { required: true, message: 'cron表达式', trigger: 'blur' } | ||
| 71 | ], | ||
| 72 | beanName: [ | ||
| 73 | { required: true, message: '任务类名', trigger: 'blur' } | ||
| 74 | ], | ||
| 75 | methodName: [ | ||
| 76 | { required: true, message: '任务方法名', trigger: 'blur' } | ||
| 77 | ] | ||
| 78 | }, | ||
| 79 | message: '' | ||
| 80 | } | ||
| 81 | }, | ||
| 82 | methods: { | ||
| 83 | handleSubmit () { | ||
| 84 | let _this = this | ||
| 85 | this.$refs['ruleForm'].validate(async (valid) => { | ||
| 86 | if (valid) { | ||
| 87 | if (!_this.taskData) { | ||
| 88 | try { | ||
| 89 | let res = await sjsbTask.sjsbTaskSave(_this.ruleForm) | ||
| 90 | if (res.code == 200) { | ||
| 91 | _this.loading = false | ||
| 92 | _this.$message({ | ||
| 93 | message: res.message, | ||
| 94 | type: 'success' | ||
| 95 | }) | ||
| 96 | _this.handleClose() | ||
| 97 | _this.$parent.featchData() | ||
| 98 | } | ||
| 99 | } catch (error) { | ||
| 100 | _this.message = error | ||
| 101 | _this.$refs.msg.messageShow() | ||
| 102 | } | ||
| 103 | } else { | ||
| 104 | try { | ||
| 105 | let res = await sjsbTask.updateCron(_this.ruleForm) | ||
| 106 | if (res.code == 200) { | ||
| 107 | _this.$message({ | ||
| 108 | message: res.message, | ||
| 109 | type: 'success' | ||
| 110 | }) | ||
| 111 | _this.handleClose() | ||
| 112 | _this.$parent.featchData() | ||
| 113 | } | ||
| 114 | } catch (error) { | ||
| 115 | _this.message = error | ||
| 116 | _this.$refs.msg.messageShow() | ||
| 117 | } | ||
| 118 | } | ||
| 119 | } else { | ||
| 120 | this.$message('请检查表单完整性') | ||
| 121 | return false; | ||
| 122 | } | ||
| 123 | }) | ||
| 124 | }, | ||
| 125 | handleClose () { | ||
| 126 | this.$emit("input", false); | ||
| 127 | } | ||
| 128 | }, | ||
| 129 | watch: { | ||
| 130 | value (val) { | ||
| 131 | this.myValue = val | ||
| 53 | }, | 132 | }, |
| 54 | data () { | 133 | taskData (val) { |
| 55 | return { | 134 | if (val != null) { |
| 56 | myValue: this.value, | 135 | this.ruleForm = val |
| 57 | ruleForm: { | 136 | } else { |
| 137 | this.ruleForm = { | ||
| 58 | jobName: '', | 138 | jobName: '', |
| 59 | cronExpression: '', | 139 | cronExpression: '', |
| 60 | beanName: '', | 140 | beanName: '', |
| 61 | methodName: '', | 141 | methodName: '', |
| 62 | methodParams: '', | 142 | methodParams: '', |
| 63 | remark: '' | 143 | remark: '' |
| 64 | }, | ||
| 65 | rules: { | ||
| 66 | jobName: [ | ||
| 67 | { required: true, message: '任务名', trigger: 'blur' } | ||
| 68 | ], | ||
| 69 | cronExpression: [ | ||
| 70 | { required: true, message: 'cron表达式', trigger: 'blur' } | ||
| 71 | ], | ||
| 72 | beanName: [ | ||
| 73 | { required: true, message: '任务类名', trigger: 'blur' } | ||
| 74 | ], | ||
| 75 | methodName: [ | ||
| 76 | { required: true, message: '任务方法名', trigger: 'blur' } | ||
| 77 | ] | ||
| 78 | }, | ||
| 79 | message: '' | ||
| 80 | } | ||
| 81 | }, | ||
| 82 | methods: { | ||
| 83 | handleSubmit () { | ||
| 84 | let _this = this | ||
| 85 | this.$refs['ruleForm'].validate(async (valid) => { | ||
| 86 | if (valid) { | ||
| 87 | if (!_this.taskData) { | ||
| 88 | try { | ||
| 89 | let res = await sjsbTask.sjsbTaskSave(_this.ruleForm) | ||
| 90 | if (res.code == 200) { | ||
| 91 | _this.loading = false | ||
| 92 | _this.$message({ | ||
| 93 | message: res.message, | ||
| 94 | type: 'success' | ||
| 95 | }) | ||
| 96 | _this.handleClose() | ||
| 97 | _this.$parent.featchData() | ||
| 98 | } | ||
| 99 | } catch (error) { | ||
| 100 | _this.message = error | ||
| 101 | _this.$refs.msg.messageShow() | ||
| 102 | } | ||
| 103 | } else { | ||
| 104 | try { | ||
| 105 | let res = await sjsbTask.updateCron(_this.ruleForm) | ||
| 106 | if (res.code == 200) { | ||
| 107 | _this.$message({ | ||
| 108 | message: res.message, | ||
| 109 | type: 'success' | ||
| 110 | }) | ||
| 111 | _this.handleClose() | ||
| 112 | _this.$parent.featchData() | ||
| 113 | } | ||
| 114 | } catch (error) { | ||
| 115 | _this.message = error | ||
| 116 | _this.$refs.msg.messageShow() | ||
| 117 | } | ||
| 118 | } | ||
| 119 | } else { | ||
| 120 | this.$message('请检查表单完整性') | ||
| 121 | return false; | ||
| 122 | } | ||
| 123 | }) | ||
| 124 | }, | ||
| 125 | handleClose () { | ||
| 126 | this.$emit("input", false); | ||
| 127 | } | ||
| 128 | }, | ||
| 129 | watch: { | ||
| 130 | value (val) { | ||
| 131 | this.myValue = val | ||
| 132 | }, | ||
| 133 | taskData (val) { | ||
| 134 | if (val != null) { | ||
| 135 | this.ruleForm = val | ||
| 136 | } else { | ||
| 137 | this.ruleForm = { | ||
| 138 | jobName: '', | ||
| 139 | cronExpression: '', | ||
| 140 | beanName: '', | ||
| 141 | methodName: '', | ||
| 142 | methodParams: '', | ||
| 143 | remark: '' | ||
| 144 | } | ||
| 145 | } | 144 | } |
| 146 | } | 145 | } |
| 147 | } | 146 | } |
| 148 | } | 147 | } |
| 148 | } | ||
| 149 | </script> | 149 | </script> |
| 150 | <style rel="stylesheet/scss" lang="scss" scoped> | ||
| 151 | // /deep/.dialogBox .dialog_title { | ||
| 152 | // margin-left: 5px !important; | ||
| 153 | // } | ||
| 154 | |||
| 155 | // /deep/.el-dialog__headerbtn { | ||
| 156 | // margin-top: -12px; | ||
| 157 | // } | ||
| 158 | |||
| 159 | // .editDialogBox-box { | ||
| 160 | // margin: 14px 18px 30px 18px !important | ||
| 161 | // } | ||
| 162 | |||
| 163 | // /deep/.el-form-item__label { | ||
| 164 | // color: #fff; | ||
| 165 | // } | ||
| 166 | |||
| 167 | // /deep/.el-form-item { | ||
| 168 | // color: #fff; | ||
| 169 | // margin-bottom: 10px; | ||
| 170 | // } | ||
| 171 | 150 | ||
| 172 | // /deep/ .el-input__inner { | ||
| 173 | // background-color: transparent; | ||
| 174 | // border: 1px solid #458ACF; | ||
| 175 | // } | ||
| 176 | </style> | ||
| 177 | 151 | ... | ... |
-
Please register or sign in to post a comment