feat:系统管理
Showing
16 changed files
with
1627 additions
and
0 deletions
src/api/dictionaries.js
0 → 100644
| 1 | import request from '@/utils/request' | ||
| 2 | |||
| 3 | class dictionaries { | ||
| 4 | // 获取整个字典数据 | ||
| 5 | async getDicData (data) { | ||
| 6 | return request({ | ||
| 7 | url: '/SysDict/getJson', | ||
| 8 | method: 'get' | ||
| 9 | }) | ||
| 10 | } | ||
| 11 | // 编辑 | ||
| 12 | async editSysDict (data) { | ||
| 13 | return request({ | ||
| 14 | url: '/SysDict/editSysDictByTypeId', | ||
| 15 | method: 'post', | ||
| 16 | data | ||
| 17 | }) | ||
| 18 | } | ||
| 19 | // 获取字典表父级集合 | ||
| 20 | async getSysDictParent (data) { | ||
| 21 | return request({ | ||
| 22 | url: '/SysDict/getSysDictParent', | ||
| 23 | method: 'post', | ||
| 24 | data | ||
| 25 | }) | ||
| 26 | } | ||
| 27 | // 编辑界面获取指定字典编码子集 | ||
| 28 | async getSysDictByTypeId (id) { | ||
| 29 | return request({ | ||
| 30 | url: '/SysDict/getSysDictByTypeId', | ||
| 31 | method: 'get', | ||
| 32 | params: { | ||
| 33 | typeId: id | ||
| 34 | } | ||
| 35 | }) | ||
| 36 | } | ||
| 37 | // 接入业务信息表 | ||
| 38 | async getAllSysJrywxx () { | ||
| 39 | return request({ | ||
| 40 | url: '/sysJrywxx/getAllSysJrywxx', | ||
| 41 | method: 'get' | ||
| 42 | }) | ||
| 43 | } | ||
| 44 | } | ||
| 45 | export default new dictionaries() | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/api/system.js
0 → 100644
| 1 | import request from '@/utils/request' | ||
| 2 | |||
| 3 | class system { | ||
| 4 | // 定时任务 | ||
| 5 | |||
| 6 | // 定时任务查询接口 | ||
| 7 | async getTaskListByName (data) { | ||
| 8 | return request({ | ||
| 9 | url: '/sjsbTask/getTaskListByName', | ||
| 10 | method: 'post', | ||
| 11 | data | ||
| 12 | }) | ||
| 13 | } | ||
| 14 | // 定时任务新增接口 | ||
| 15 | async sjsbTaskSave (data) { | ||
| 16 | return request({ | ||
| 17 | url: '/sjsbTask/save', | ||
| 18 | method: 'post', | ||
| 19 | data | ||
| 20 | }) | ||
| 21 | } | ||
| 22 | // 修改定时任务执行时间接口 | ||
| 23 | async updateCron (data) { | ||
| 24 | return request({ | ||
| 25 | url: '/sjsbTask/updateCron', | ||
| 26 | method: 'post', | ||
| 27 | data | ||
| 28 | }) | ||
| 29 | } | ||
| 30 | // 定时任务删除接口 | ||
| 31 | async sjsbTaskRemove (id) { | ||
| 32 | return request({ | ||
| 33 | url: '/sjsbTask/remove', | ||
| 34 | method: 'get', | ||
| 35 | params: { | ||
| 36 | id: id | ||
| 37 | } | ||
| 38 | }) | ||
| 39 | } | ||
| 40 | // 暂停任务接口 | ||
| 41 | async pauseJob (id) { | ||
| 42 | return request({ | ||
| 43 | url: '/sjsbTask/pauseJob', | ||
| 44 | method: 'get', | ||
| 45 | params: { | ||
| 46 | id: id | ||
| 47 | } | ||
| 48 | }) | ||
| 49 | } | ||
| 50 | // 恢复任务接口 | ||
| 51 | async resumeJob (id) { | ||
| 52 | return request({ | ||
| 53 | url: '/sjsbTask/resumeJob', | ||
| 54 | method: 'get', | ||
| 55 | params: { | ||
| 56 | id: id | ||
| 57 | } | ||
| 58 | }) | ||
| 59 | } | ||
| 60 | // 激活任务接口 | ||
| 61 | async activateJob (id) { | ||
| 62 | return request({ | ||
| 63 | url: '/sjsbTask/activateJob', | ||
| 64 | method: 'get', | ||
| 65 | params: { | ||
| 66 | id: id | ||
| 67 | } | ||
| 68 | }) | ||
| 69 | } | ||
| 70 | // 手动测试 | ||
| 71 | async sjsbTaskRun (id) { | ||
| 72 | return request({ | ||
| 73 | url: '/sjsbTask/run', | ||
| 74 | method: 'get', | ||
| 75 | params: { | ||
| 76 | id: id | ||
| 77 | } | ||
| 78 | }) | ||
| 79 | } | ||
| 80 | } | ||
| 81 | export default new system() | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -173,6 +173,35 @@ export const asyncRoutes = [ | ... | @@ -173,6 +173,35 @@ export const asyncRoutes = [ |
| 173 | } | 173 | } |
| 174 | ] | 174 | ] |
| 175 | }, | 175 | }, |
| 176 | // 系统管理 | ||
| 177 | { | ||
| 178 | path: '/system', | ||
| 179 | component: Layout, | ||
| 180 | meta: { title: '系统管理', icon: 'sqcx', breadcrumb: false }, | ||
| 181 | redirect: '/system/dictionary-config', | ||
| 182 | alwaysShow: true, | ||
| 183 | name: 'system', | ||
| 184 | children: [ | ||
| 185 | { | ||
| 186 | path: 'dictionary-config', | ||
| 187 | component: () => import('@/views/system/dictionary-config'), | ||
| 188 | name: 'dictionary-config', | ||
| 189 | meta: { title: '字典管理' } | ||
| 190 | }, | ||
| 191 | { | ||
| 192 | path: 'validationRule', | ||
| 193 | component: () => import('@/views/system/validationRule'), | ||
| 194 | name: 'validationRule', | ||
| 195 | meta: { title: '上报效验规则配置' } | ||
| 196 | }, | ||
| 197 | { | ||
| 198 | path: 'timedTask', | ||
| 199 | component: () => import('@/views/system/timedTask'), | ||
| 200 | name: 'timedTask', | ||
| 201 | meta: { title: '定时任务' } | ||
| 202 | } | ||
| 203 | ] | ||
| 204 | } | ||
| 176 | ] | 205 | ] |
| 177 | 206 | ||
| 178 | const createRouter = () => | 207 | const createRouter = () => | ... | ... |
src/utils/tools.js
0 → 100644
| 1 | |||
| 2 | /** | ||
| 3 | * 获取数据类型 | ||
| 4 | * @param {All} [o] 需要检测的数据 | ||
| 5 | * @returns {String} | ||
| 6 | */ | ||
| 7 | export function getType(o) { | ||
| 8 | return Object.prototype.toString.call(o).slice(8, -1); | ||
| 9 | } | ||
| 10 | /** | ||
| 11 | * 判断是否是指定数据类型 | ||
| 12 | * @param {All} [o] 需要检测的数据 | ||
| 13 | * @param {String} [type] 数据类型 | ||
| 14 | * @returns {Boolean} | ||
| 15 | */ | ||
| 16 | export function isKeyType(o, type) { | ||
| 17 | return getType(o).toLowerCase() === type.toLowerCase(); | ||
| 18 | } | ||
| 19 | export function deepCopy(sth) { | ||
| 20 | let copy; | ||
| 21 | if (null == sth || "object" != typeof sth) return sth; | ||
| 22 | if (isKeyType(sth, 'date')) { | ||
| 23 | copy = new Date(); | ||
| 24 | copy.setTime(sth.getTime()); | ||
| 25 | return copy; | ||
| 26 | } | ||
| 27 | if (isKeyType(sth, 'array')) { | ||
| 28 | copy = []; | ||
| 29 | for (let i = 0, len = sth.length; i < len; i++) { | ||
| 30 | copy[i] = deepCopy(sth[i]); | ||
| 31 | } | ||
| 32 | return copy; | ||
| 33 | } | ||
| 34 | if (isKeyType(sth, 'object')) { | ||
| 35 | copy = {}; | ||
| 36 | for (let attr in sth) { | ||
| 37 | if (sth.hasOwnProperty(attr)) copy[attr] = deepCopy(sth[attr]); | ||
| 38 | } | ||
| 39 | return copy; | ||
| 40 | } | ||
| 41 | return null; | ||
| 42 | } | ||
| 43 | /** | ||
| 44 | * 关键信息隐藏 | ||
| 45 | * @param str 字符串 | ||
| 46 | * @param frontLen 字符串前面保留位数 | ||
| 47 | * @param endLen 字符串后面保留位数 | ||
| 48 | * @returns {string} | ||
| 49 | */ | ||
| 50 | export function hideCode(str, frontLen, endLen = 0) { | ||
| 51 | var len = str.length - frontLen - endLen; | ||
| 52 | var xing = ''; | ||
| 53 | for (var i = 0; i < len; i++) { | ||
| 54 | xing += '*'; | ||
| 55 | } | ||
| 56 | return str.substring(0, frontLen) + xing + str.substring(str.length - endLen); | ||
| 57 | }; | ||
| 58 | // 数组去重 | ||
| 59 | |||
| 60 | export function unique(arr) { | ||
| 61 | var obj = {}; | ||
| 62 | return arr.filter(function (item, index, arr) { | ||
| 63 | return obj.hasOwnProperty(typeof item + item) ? false : (obj[typeof item + item] = true) | ||
| 64 | }) | ||
| 65 | } | ||
| 66 | // 创造id | ||
| 67 | |||
| 68 | export function getUuid(len, radix) { | ||
| 69 | var chars = "0123456789abcdefghijklmnopqrstuvwxyz".split( | ||
| 70 | "" | ||
| 71 | ); | ||
| 72 | var uuid = [], | ||
| 73 | i; | ||
| 74 | radix = radix || chars.length; | ||
| 75 | if (len) { | ||
| 76 | for (i = 0; i < len; i++) uuid[i] = chars[0 | (Math.random() * radix)]; | ||
| 77 | } else { | ||
| 78 | var r; | ||
| 79 | uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-"; | ||
| 80 | uuid[14] = "4"; | ||
| 81 | for (i = 0; i < 36; i++) { | ||
| 82 | if (!uuid[i]) { | ||
| 83 | r = 0 | (Math.random() * 16); | ||
| 84 | uuid[i] = chars[i == 19 ? (r & 0x3) | 0x8 : r]; | ||
| 85 | } | ||
| 86 | } | ||
| 87 | } | ||
| 88 | return uuid.join(""); | ||
| 89 | } | ||
| 90 | |||
| 91 | //js计算两个时间戳之间的时间差 (月) | ||
| 92 | export function intervalTime(startTime, endTime) { | ||
| 93 | // var timestamp=new Date().getTime(); //计算当前时间戳 | ||
| 94 | var timestamp = (Date.parse(new Date())) / 1000;//计算当前时间戳 (毫秒级) | ||
| 95 | var date1 = ""; //开始时间 | ||
| 96 | if (timestamp < startTime) { | ||
| 97 | date1 = startTime; | ||
| 98 | } else { | ||
| 99 | date1 = timestamp; //开始时间 | ||
| 100 | } | ||
| 101 | var date2 = endTime; //结束时间 | ||
| 102 | // var date3 = date2.getTime() - date1.getTime(); //时间差的毫秒数 | ||
| 103 | var date3 = (date2 - date1) * 1000; //时间差的毫秒数 | ||
| 104 | //计算出相差天数 | ||
| 105 | var mon = Math.floor(date3 / (30 * 24 * 3600 * 1000 * 1000)); | ||
| 106 | // return days + "天 " + hours + "小时 " + minutes + " 分钟" + seconds + " 秒" | ||
| 107 | return mon | ||
| 108 | } | ||
| 109 | // 日期转时间戳 | ||
| 110 | export function js_strto_time(str_time) { | ||
| 111 | var str = str_time.replace(/-/g, '/') // 将-替换成/,因为下面这个构造函数只支持/分隔的日期字符串 | ||
| 112 | var date = new Date(str) // 构造一个日期型数据,值为传入的字符串 | ||
| 113 | return date.getTime() | ||
| 114 | } | ||
| 115 | // 时间戳转日期 | ||
| 116 | export function timestampToTime(timestamp) { | ||
| 117 | var date = new Date(timestamp)//时间戳为10位需*1000,时间戳为13位的话不需乘1000 | ||
| 118 | var Y = date.getFullYear() + '-' | ||
| 119 | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-' | ||
| 120 | var D = date.getDate() > 10 ? date.getDate() : '0' + date.getDate() | ||
| 121 | return Y + M + D | ||
| 122 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/views/system/components/addTask.vue
0 → 100644
| 1 | <template> | ||
| 2 | <!-- 编辑 --> | ||
| 3 | <dialogBox ref="addTask" width="60%" @submitForm="handleSubmit" :closed="true" @closeDialog="handleClose" | ||
| 4 | customClass="editValidRule" multiple title="新增定时任务"> | ||
| 5 | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px"> | ||
| 6 | <el-row :gutter="20"> | ||
| 7 | <el-col :span="12"> | ||
| 8 | <el-form-item label="任务名" prop="job_name"> | ||
| 9 | <el-input v-model="ruleForm.job_name" placeholder="任务名"></el-input> | ||
| 10 | </el-form-item> | ||
| 11 | </el-col> | ||
| 12 | <el-col :span="12"> | ||
| 13 | <el-form-item label="任务分组" prop="job_group"> | ||
| 14 | <el-input v-model="ruleForm.job_group" placeholder="任务分组"></el-input> | ||
| 15 | </el-form-item> | ||
| 16 | </el-col> | ||
| 17 | </el-row> | ||
| 18 | <el-row :gutter="20"> | ||
| 19 | <el-col :span="12"> | ||
| 20 | <el-form-item label="cron表达式" prop="cron_expression"> | ||
| 21 | <el-input v-model="ruleForm.cron_expression" placeholder="cron表达式"></el-input> | ||
| 22 | </el-form-item> | ||
| 23 | </el-col> | ||
| 24 | <el-col :span="12"> | ||
| 25 | <el-form-item label="任务类名" prop="bean_class"> | ||
| 26 | <el-input v-model="ruleForm.bean_class" placeholder="任务执行时调用哪个类的方法 包名+类名"></el-input> | ||
| 27 | </el-form-item> | ||
| 28 | </el-col> | ||
| 29 | </el-row> | ||
| 30 | <el-row :gutter="20"> | ||
| 31 | <el-col :span="24"> | ||
| 32 | <el-form-item label="任务描述" prop="description"> | ||
| 33 | <el-input v-model="ruleForm.description" placeholder="任务描述"></el-input> | ||
| 34 | </el-form-item> | ||
| 35 | </el-col> | ||
| 36 | </el-row> | ||
| 37 | </el-form> | ||
| 38 | <message-tips :message="message" ref="msg" /> | ||
| 39 | </dialogBox> | ||
| 40 | </template> | ||
| 41 | |||
| 42 | <script> | ||
| 43 | import system from '@/api/system.js' | ||
| 44 | export default { | ||
| 45 | props: { | ||
| 46 | taskData: { | ||
| 47 | type: Object, | ||
| 48 | default: null | ||
| 49 | } | ||
| 50 | }, | ||
| 51 | data () { | ||
| 52 | return { | ||
| 53 | ruleForm: { | ||
| 54 | job_name: '', | ||
| 55 | job_group: '', | ||
| 56 | cron_expression: '', | ||
| 57 | bean_class: '', | ||
| 58 | description: '' | ||
| 59 | }, | ||
| 60 | rules: { | ||
| 61 | job_name: [ | ||
| 62 | { required: true, message: '任务名', trigger: 'blur' } | ||
| 63 | ], | ||
| 64 | job_group: [ | ||
| 65 | { required: true, message: '分组', trigger: 'blur' } | ||
| 66 | ], | ||
| 67 | cron_expression: [ | ||
| 68 | { required: true, message: 'cron表达式', trigger: 'blur' } | ||
| 69 | ], | ||
| 70 | bean_class: [ | ||
| 71 | { required: true, message: '任务类名', trigger: 'blur' } | ||
| 72 | ], | ||
| 73 | description: [ | ||
| 74 | { required: true, message: '任务描述', trigger: 'blur' } | ||
| 75 | ], | ||
| 76 | }, | ||
| 77 | message: '' | ||
| 78 | } | ||
| 79 | }, | ||
| 80 | methods: { | ||
| 81 | isShow () { | ||
| 82 | this.$refs.addTask.isShow() | ||
| 83 | setTimeout(() => { | ||
| 84 | if (this.taskData) { | ||
| 85 | this.ruleForm = _.cloneDeep(this.taskData) | ||
| 86 | } | ||
| 87 | }, 0) | ||
| 88 | }, | ||
| 89 | handleSubmit () { | ||
| 90 | let _this = this | ||
| 91 | this.$refs['ruleForm'].validate(async (valid) => { | ||
| 92 | if (valid) { | ||
| 93 | if (!_this.taskData) { | ||
| 94 | try { | ||
| 95 | let res = await system.sjsbTaskSave(_this.ruleForm) | ||
| 96 | if (res.code == 200) { | ||
| 97 | _this.loading = false | ||
| 98 | _this.$message({ | ||
| 99 | message: res.message, | ||
| 100 | type: 'success' | ||
| 101 | }) | ||
| 102 | _this.handleClose() | ||
| 103 | _this.$parent.featchData() | ||
| 104 | } | ||
| 105 | } catch (error) { | ||
| 106 | _this.message = error | ||
| 107 | _this.$refs.msg.messageShow() | ||
| 108 | } | ||
| 109 | } else { | ||
| 110 | try { | ||
| 111 | let res = await system.updateCron(_this.ruleForm) | ||
| 112 | if (res.code == 200) { | ||
| 113 | _this.$message({ | ||
| 114 | message: res.message, | ||
| 115 | type: 'success' | ||
| 116 | }) | ||
| 117 | _this.handleClose() | ||
| 118 | _this.$parent.featchData() | ||
| 119 | } | ||
| 120 | } catch (error) { | ||
| 121 | _this.message = error | ||
| 122 | _this.$refs.msg.messageShow() | ||
| 123 | } | ||
| 124 | } | ||
| 125 | } else { | ||
| 126 | this.$message('请检查表单完整性') | ||
| 127 | return false; | ||
| 128 | } | ||
| 129 | }) | ||
| 130 | }, | ||
| 131 | handleClose () { | ||
| 132 | this.$refs.addTask.isHide() | ||
| 133 | this.$refs['ruleForm'].resetFields() | ||
| 134 | } | ||
| 135 | } | ||
| 136 | } | ||
| 137 | </script> | ||
| 138 | <style rel="stylesheet/less" lang="less" scoped> | ||
| 139 | |||
| 140 | </style> | ||
| 141 |
| 1 | <template> | ||
| 2 | <!-- 编辑 --> | ||
| 3 | <dialogBox ref="edit" width="60%" :closed="true" @closeDialog="handleClose" @submitForm="handleSubmit" | ||
| 4 | customClass="editDictionary" multiple title="字典信息"> | ||
| 5 | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px"> | ||
| 6 | <el-row :gutter="20"> | ||
| 7 | <el-col :span="12"> | ||
| 8 | <el-form-item label="字典类型编码" prop="DCODE"> | ||
| 9 | <el-input v-model.trim="ruleForm.DCODE" placeholder="字典类型编码"></el-input> | ||
| 10 | </el-form-item> | ||
| 11 | </el-col> | ||
| 12 | <el-col :span="12"> | ||
| 13 | <el-form-item label="字典类型名称" prop="DNAME"> | ||
| 14 | <el-input v-model.trim="ruleForm.DNAME" placeholder="字典类型名称"></el-input> | ||
| 15 | </el-form-item> | ||
| 16 | </el-col> | ||
| 17 | </el-row> | ||
| 18 | <el-row :gutter="20"> | ||
| 19 | <el-col :span="12"> | ||
| 20 | <el-form-item label="字典结构" prop="ISTREE"> | ||
| 21 | <el-radio-group v-model="ruleForm.ISTREE"> | ||
| 22 | <el-radio label="1">树形</el-radio> | ||
| 23 | <el-radio label="0">列表</el-radio> | ||
| 24 | </el-radio-group> | ||
| 25 | </el-form-item> | ||
| 26 | </el-col> | ||
| 27 | </el-row> | ||
| 28 | </el-form> | ||
| 29 | <lb-table :column="column" :heightNum="550" :key="key" :expand-row-keys="keyList" row-key="DICTID" | ||
| 30 | :tree-props="{ children: 'children' }" :pagination="false" :data="tableData"> | ||
| 31 | </lb-table> | ||
| 32 | <message-tips :message="message" ref="msg" /> | ||
| 33 | </dialogBox> | ||
| 34 | </template> | ||
| 35 | |||
| 36 | <script> | ||
| 37 | import dictionaries from '@/api/dictionaries' | ||
| 38 | import { getUuid } from '@/utils/tools' | ||
| 39 | export default { | ||
| 40 | props: { | ||
| 41 | dictList: Array, | ||
| 42 | dicData: Object | ||
| 43 | }, | ||
| 44 | data () { | ||
| 45 | return { | ||
| 46 | key: 0, | ||
| 47 | message: '', | ||
| 48 | keyList: [], | ||
| 49 | ruleForm: { | ||
| 50 | DCODE: '', | ||
| 51 | DNAME: '', | ||
| 52 | ISTREE: '1' | ||
| 53 | }, | ||
| 54 | column: [ | ||
| 55 | { | ||
| 56 | width: '60', | ||
| 57 | renderHeader: (h, scope) => { | ||
| 58 | return <i class="el-icon-plus" onClick={() => { this.handleAdd() }} style="cursor:pointer;color:#409EFF">增加</i> | ||
| 59 | }, | ||
| 60 | render: (h, scope) => { | ||
| 61 | return ( | ||
| 62 | <span>{scope.row.index}</span> | ||
| 63 | ) | ||
| 64 | } | ||
| 65 | }, | ||
| 66 | { | ||
| 67 | prop: 'DCODE', | ||
| 68 | label: '字典项编码', | ||
| 69 | render: (h, scope) => { | ||
| 70 | return ( | ||
| 71 | <div> | ||
| 72 | <el-input placeholder="字典项编码" v-show={scope.row.codeShow} v-fo value={scope.row[scope.column.property]} | ||
| 73 | onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }} | ||
| 74 | onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> | ||
| 75 | |||
| 76 | |||
| 77 | <el-input placeholder="字典项编码" v-show={!scope.row.codeShow} value={scope.row[scope.column.property]} | ||
| 78 | onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }} | ||
| 79 | onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> | ||
| 80 | </div> | ||
| 81 | ) | ||
| 82 | } | ||
| 83 | }, | ||
| 84 | { | ||
| 85 | prop: 'DNAME', | ||
| 86 | label: '字典项名称', | ||
| 87 | render: (h, scope) => { | ||
| 88 | return ( | ||
| 89 | <div> | ||
| 90 | <el-input placeholder="字典项编码" v-show={scope.row.nameShow} v-fo value={scope.row[scope.column.property]} | ||
| 91 | onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }} | ||
| 92 | onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> | ||
| 93 | |||
| 94 | <el-input placeholder="字典项名称" v-show={!scope.row.nameShow} value={scope.row[scope.column.property]} | ||
| 95 | onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }} | ||
| 96 | onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> | ||
| 97 | </div> | ||
| 98 | ) | ||
| 99 | } | ||
| 100 | }, | ||
| 101 | { | ||
| 102 | width: '130px', | ||
| 103 | label: '移动', | ||
| 104 | render: (h, scope) => { | ||
| 105 | return ( | ||
| 106 | <div> | ||
| 107 | <el-button type='text' disabled={scope.$index == 0} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button> | ||
| 108 | <el-button type='text' disabled={(scope.$index + 1) == this.tableData.length} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button > | ||
| 109 | </div > | ||
| 110 | ) | ||
| 111 | } | ||
| 112 | }, | ||
| 113 | { | ||
| 114 | width: '150px', | ||
| 115 | label: '操作', | ||
| 116 | render: (h, scope) => { | ||
| 117 | return ( | ||
| 118 | <div> | ||
| 119 | <el-button type="text" style="margin-right:10px" v-show={this.ruleForm.ISTREE == '1'} onClick={() => { this.handleAddSubordinate(scope.row) }}>增加下级</el-button> | ||
| 120 | <el-button type="text" style="margin-left:0" onClick={() => { this.handleMinus(scope.$index, scope.row) }}>删除</el-button> | ||
| 121 | </div> | ||
| 122 | ) | ||
| 123 | } | ||
| 124 | } | ||
| 125 | ], | ||
| 126 | tableData: [], | ||
| 127 | rules: { | ||
| 128 | DCODE: [ | ||
| 129 | { required: true, message: '字典类型编码', trigger: 'blur' } | ||
| 130 | ], | ||
| 131 | } | ||
| 132 | } | ||
| 133 | }, | ||
| 134 | methods: { | ||
| 135 | isShow () { | ||
| 136 | this.$refs.edit.isShow() | ||
| 137 | setTimeout(() => { | ||
| 138 | this.tableData = _.cloneDeep(this.dictList) | ||
| 139 | this.addIndexes() | ||
| 140 | let { DCODE, DNAME, ISTREE } = this.dicData | ||
| 141 | this.ruleForm = { | ||
| 142 | DCODE, | ||
| 143 | DNAME, | ||
| 144 | ISTREE | ||
| 145 | } | ||
| 146 | }, 0) | ||
| 147 | }, | ||
| 148 | // 添加索引 | ||
| 149 | addIndexes () { | ||
| 150 | this.tableData.forEach((item, index) => { | ||
| 151 | if (index == 0) { | ||
| 152 | item.codeShow = true | ||
| 153 | } else { | ||
| 154 | item.codeShow = false | ||
| 155 | item.nameShow = false | ||
| 156 | } | ||
| 157 | item.index = index + 1 | ||
| 158 | }) | ||
| 159 | }, | ||
| 160 | itemShowFalse () { | ||
| 161 | this.tableData.forEach((item, index) => { | ||
| 162 | item.codeShow = false | ||
| 163 | item.nameShow = false | ||
| 164 | }) | ||
| 165 | }, | ||
| 166 | handleMinus (index, row) { | ||
| 167 | this.removeTreeListItem(this.tableData, row.DICTID) | ||
| 168 | }, | ||
| 169 | removeTreeListItem (treeList, DICTID) { | ||
| 170 | if (!treeList || !treeList.length) { | ||
| 171 | return | ||
| 172 | } | ||
| 173 | for (let i = 0; i < treeList.length; i++) { | ||
| 174 | if (treeList[i].DICTID === DICTID) { | ||
| 175 | treeList.splice(i, 1); | ||
| 176 | break; | ||
| 177 | } | ||
| 178 | this.removeTreeListItem(treeList[i].children, DICTID) | ||
| 179 | } | ||
| 180 | }, | ||
| 181 | async handleSubmit () { | ||
| 182 | let submitData = _.cloneDeep(this.tableData) | ||
| 183 | this.ruleForm.DICTID = this.dicData.DICTID | ||
| 184 | this.ruleForm.PARENTID = null | ||
| 185 | this.ruleForm.TYPEID = this.dicData.TYPEID | ||
| 186 | submitData.forEach((item) => { | ||
| 187 | item.ISTREE = this.ruleForm.ISTREE | ||
| 188 | }) | ||
| 189 | submitData.unshift(this.ruleForm) | ||
| 190 | try { | ||
| 191 | let res = await dictionaries.editSysDict({ 'editDicts': submitData }) | ||
| 192 | if (res.code == 200) { | ||
| 193 | this.$message({ | ||
| 194 | message: res.message, | ||
| 195 | type: 'success' | ||
| 196 | }) | ||
| 197 | this.handleClose() | ||
| 198 | this.$parent.featchData() | ||
| 199 | } | ||
| 200 | } catch (error) { | ||
| 201 | this.message = error | ||
| 202 | this.$refs.msg.messageShow() | ||
| 203 | } | ||
| 204 | }, | ||
| 205 | handleClose () { | ||
| 206 | this.$refs['ruleForm'].resetFields(); | ||
| 207 | this.$refs.edit.isHide() | ||
| 208 | }, | ||
| 209 | // 增加下级 | ||
| 210 | handleAddSubordinate (row) { | ||
| 211 | if (!row.children) { | ||
| 212 | row.children = [] | ||
| 213 | } | ||
| 214 | row.children.push( | ||
| 215 | { | ||
| 216 | DCODE: '', | ||
| 217 | DNAME: '', | ||
| 218 | DICTID: getUuid(32), | ||
| 219 | TYPEID: row.TYPEID, | ||
| 220 | PARENTID: row.DICTID, | ||
| 221 | children: null, | ||
| 222 | ISTREE: this.ruleForm.ISTREE | ||
| 223 | } | ||
| 224 | ) | ||
| 225 | this.keyList = []; | ||
| 226 | this.keyList.push(row.DICTID) | ||
| 227 | }, | ||
| 228 | // 增加 | ||
| 229 | handleAdd () { | ||
| 230 | this.$nextTick(() => { | ||
| 231 | let container = this.$el.querySelector('.el-table__body-wrapper'); | ||
| 232 | container.scrollTop = container.scrollHeight; | ||
| 233 | }) | ||
| 234 | this.tableData.push( | ||
| 235 | { | ||
| 236 | DCODE: '', | ||
| 237 | DNAME: '', | ||
| 238 | DICTID: getUuid(32), | ||
| 239 | TYPEID: this.dicData.TYPEID, | ||
| 240 | PARENTID: this.dicData.DICTID, | ||
| 241 | children: null, | ||
| 242 | ISTREE: this.ruleForm.ISTREE | ||
| 243 | } | ||
| 244 | ) | ||
| 245 | this.addIndexes() | ||
| 246 | }, | ||
| 247 | // 上移下移 | ||
| 248 | moveUpward (index, row) { | ||
| 249 | if (index > 0) { | ||
| 250 | let upData = this.tableData[index - 1]; | ||
| 251 | this.tableData.splice(index - 1, 1); | ||
| 252 | this.tableData.splice(index, 0, upData); | ||
| 253 | } else { | ||
| 254 | this.$message({ | ||
| 255 | message: '已经是第一条,上移失败', | ||
| 256 | type: 'warning' | ||
| 257 | }); | ||
| 258 | } | ||
| 259 | this.key++ | ||
| 260 | }, | ||
| 261 | moveDown (index, row) { | ||
| 262 | if ((index + 1) == this.tableData.length) { | ||
| 263 | this.$message({ | ||
| 264 | message: '已经是最后一条,下移失败', | ||
| 265 | type: 'warning' | ||
| 266 | }); | ||
| 267 | } else { | ||
| 268 | let downData = this.tableData[index + 1]; | ||
| 269 | this.tableData.splice(index + 1, 1); | ||
| 270 | this.tableData.splice(index, 0, downData); | ||
| 271 | } | ||
| 272 | this.key++ | ||
| 273 | } | ||
| 274 | } | ||
| 275 | } | ||
| 276 | </script> | ||
| 277 | <style rel="stylesheet/less" lang="less" scoped> | ||
| 278 | |||
| 279 | </style> | ||
| 280 |
| 1 | <template> | ||
| 2 | <!-- 编辑 --> | ||
| 3 | <dialogBox ref="validRule" width="60%" @submitForm="handleSubmit" :closed="true" @closeDialog="handleClose" | ||
| 4 | customClass="editValidRule" multiple title="上报效验规则设置"> | ||
| 5 | <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px"> | ||
| 6 | <el-row :gutter="20"> | ||
| 7 | <el-col :span="12"> | ||
| 8 | <el-form-item label="数据表名" prop="DATATABLE"> | ||
| 9 | <el-input v-model="ruleForm.DATATABLE" placeholder="数据表名"></el-input> | ||
| 10 | </el-form-item> | ||
| 11 | </el-col> | ||
| 12 | <el-col :span="12"> | ||
| 13 | <el-form-item label="中文名称" prop="CHINESETABLE"> | ||
| 14 | <el-input v-model="ruleForm.CHINESETABLE" placeholder="中文名称"></el-input> | ||
| 15 | </el-form-item> | ||
| 16 | </el-col> | ||
| 17 | </el-row> | ||
| 18 | <el-row :gutter="20"> | ||
| 19 | <el-col :span="12"> | ||
| 20 | <el-form-item label="tab表头链接标识" prop="SOLEURL"> | ||
| 21 | <el-input v-model="ruleForm.SOLEURL" placeholder="tab表头链接标识"></el-input> | ||
| 22 | </el-form-item> | ||
| 23 | </el-col> | ||
| 24 | </el-row> | ||
| 25 | </el-form> | ||
| 26 | <lb-table :column="tableData.column" :heightNum="600" :pagination="false" :data="tableData.data"> | ||
| 27 | </lb-table> | ||
| 28 | <message-tips :message="message" ref="msg" /> | ||
| 29 | </dialogBox> | ||
| 30 | </template> | ||
| 31 | |||
| 32 | <script> | ||
| 33 | import ruleConfig from '@/api/ruleConfig' | ||
| 34 | export default { | ||
| 35 | props: { | ||
| 36 | ruleData: Object, | ||
| 37 | }, | ||
| 38 | data () { | ||
| 39 | return { | ||
| 40 | message: '', | ||
| 41 | ruleForm: { | ||
| 42 | DATATABLE: '', | ||
| 43 | CHINESETABLE: '', | ||
| 44 | SOLEURL: '' | ||
| 45 | }, | ||
| 46 | tableData: { | ||
| 47 | column: [ | ||
| 48 | { | ||
| 49 | width: '60', | ||
| 50 | renderHeader: (h, scope) => { | ||
| 51 | return <i class="el-icon-plus" onClick={() => { this.handleAdd() }} style="cursor:pointer;color:#409EFF">增加</i> | ||
| 52 | }, | ||
| 53 | render: (h, scope) => { | ||
| 54 | return ( | ||
| 55 | <i class="el-icon-minus" onClick={() => { this.handleMinus(scope.$index, scope.row) }} style="cursor:pointer"></i> | ||
| 56 | ) | ||
| 57 | } | ||
| 58 | }, | ||
| 59 | { | ||
| 60 | prop: 'FIELD', | ||
| 61 | label: '字段名', | ||
| 62 | render: (h, scope) => { | ||
| 63 | return ( | ||
| 64 | <el-input value={scope.row[scope.column.property]} onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> | ||
| 65 | ) | ||
| 66 | } | ||
| 67 | }, | ||
| 68 | { | ||
| 69 | prop: 'CHINESENAME', | ||
| 70 | label: '中文名称', | ||
| 71 | render: (h, scope) => { | ||
| 72 | return ( | ||
| 73 | <el-input value={scope.row[scope.column.property]} onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> | ||
| 74 | ) | ||
| 75 | } | ||
| 76 | }, | ||
| 77 | // 是否必填 | ||
| 78 | { | ||
| 79 | prop: 'REQUIRED', | ||
| 80 | label: '是否必填', | ||
| 81 | render: (h, scope) => { | ||
| 82 | return ( | ||
| 83 | <el-checkbox v-model={scope.row[scope.column.property]} true-label={'1'} false-label={'0'}>必填</el-checkbox> | ||
| 84 | ) | ||
| 85 | } | ||
| 86 | }, | ||
| 87 | // 效验表达式 | ||
| 88 | { | ||
| 89 | prop: 'EXPRESSION', | ||
| 90 | label: '效验表达式', | ||
| 91 | render: (h, scope) => { | ||
| 92 | return ( | ||
| 93 | <el-select value={scope.row[scope.column.property]} clearable | ||
| 94 | onChange={(val) => { scope.row[scope.column.property] = val }}> | ||
| 95 | { | ||
| 96 | this.tagOptions.map(option => { | ||
| 97 | return ( | ||
| 98 | <el-option label={option.label} value={option.value}></el-option> | ||
| 99 | ) | ||
| 100 | }) | ||
| 101 | } | ||
| 102 | </el-select> | ||
| 103 | ) | ||
| 104 | } | ||
| 105 | }, | ||
| 106 | { | ||
| 107 | prop: 'MESSAGE', | ||
| 108 | label: '提示信息', | ||
| 109 | render: (h, scope) => { | ||
| 110 | return ( | ||
| 111 | <el-input placeholder="提示信息" value={scope.row[scope.column.property]} onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> | ||
| 112 | ) | ||
| 113 | } | ||
| 114 | } | ||
| 115 | ], | ||
| 116 | data: [] | ||
| 117 | }, | ||
| 118 | tagOptions: [ | ||
| 119 | { | ||
| 120 | label: '手机号', | ||
| 121 | value: '^[1][3,4,5,6,7,8,9][0-9]{9}$' | ||
| 122 | }, | ||
| 123 | { | ||
| 124 | label: '身份证', | ||
| 125 | value: '^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$|^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)$' | ||
| 126 | }, | ||
| 127 | { | ||
| 128 | label: '军官证', | ||
| 129 | value: '^[\\u4E00-\\u9FA5](字第)([0-9a-zA-Z]{4,8})(号?)$' | ||
| 130 | }, | ||
| 131 | { | ||
| 132 | label: '护照', | ||
| 133 | value: '^([a-zA-z]|[0-9]){5,17}$' | ||
| 134 | }, | ||
| 135 | { | ||
| 136 | label: '港澳身份证', | ||
| 137 | value: '^([A-Z]\\d{6,10}(\\(\\w{1}\\))?)$' | ||
| 138 | }, | ||
| 139 | { | ||
| 140 | label: '台湾身份证', | ||
| 141 | value: '^\\d{8}|^[a-zA-Z0-9]{10}|^\\d{18}$' | ||
| 142 | }, | ||
| 143 | { | ||
| 144 | label: '营业执照', | ||
| 145 | value: '(^(?:(?![IOZSV])[\\dA-Z]){2}\\d{6}(?:(?![IOZSV])[\\dA-Z]){10}$)|(^\\d{15}$)' | ||
| 146 | }, | ||
| 147 | { | ||
| 148 | label: '户口簿', | ||
| 149 | value: '^\\d{9}$' | ||
| 150 | } | ||
| 151 | ], | ||
| 152 | rules: { | ||
| 153 | DCODE: [ | ||
| 154 | { required: true, message: '字典类型编码', trigger: 'blur' } | ||
| 155 | ], | ||
| 156 | } | ||
| 157 | } | ||
| 158 | }, | ||
| 159 | methods: { | ||
| 160 | isShow () { | ||
| 161 | setTimeout(() => { | ||
| 162 | this.ruleForm = this.ruleData | ||
| 163 | this.tableData.data = this.ruleData.sysywsjbfieldlist | ||
| 164 | }, 0) | ||
| 165 | this.$refs.validRule.isShow() | ||
| 166 | }, | ||
| 167 | handleEdit (scope) { | ||
| 168 | this.$set(scope.row, '_edit', true) | ||
| 169 | }, | ||
| 170 | handleAdd () { | ||
| 171 | this.tableData.data.push({ | ||
| 172 | field: '', | ||
| 173 | chinesename: '', | ||
| 174 | required: '1', | ||
| 175 | expression: null, | ||
| 176 | message: '' | ||
| 177 | }) | ||
| 178 | }, | ||
| 179 | handleMinus (index, row) { | ||
| 180 | this.tableData.data.splice(index, 1); | ||
| 181 | }, | ||
| 182 | async handleSubmit () { | ||
| 183 | this.ruleForm.sysYwsjbFieldList = this.tableData.data | ||
| 184 | try { | ||
| 185 | let res = await ruleConfig.editSysYwsjbWithSysYwsjbField(this.ruleForm) | ||
| 186 | if (res.code == 200) { | ||
| 187 | this.$message({ | ||
| 188 | message: res.message, | ||
| 189 | type: 'success' | ||
| 190 | }) | ||
| 191 | this.handleClose() | ||
| 192 | this.$parent.featchData() | ||
| 193 | } | ||
| 194 | } catch (error) { | ||
| 195 | this.message = error | ||
| 196 | this.$refs.msg.messageShow() | ||
| 197 | } | ||
| 198 | |||
| 199 | }, | ||
| 200 | handleClose () { | ||
| 201 | this.$refs['ruleForm'].resetFields(); | ||
| 202 | this.$refs.validRule.isHide() | ||
| 203 | } | ||
| 204 | } | ||
| 205 | } | ||
| 206 | </script> | ||
| 207 | <style rel="stylesheet/less" lang="less" scoped> | ||
| 208 | |||
| 209 | </style> | ||
| 210 |
| 1 | import filter from '@/utils/filter.js' | ||
| 2 | class data extends filter { | ||
| 3 | constructor() { | ||
| 4 | super() | ||
| 5 | } | ||
| 6 | columns () { | ||
| 7 | return [ | ||
| 8 | { | ||
| 9 | label: "序号", | ||
| 10 | prop: 'ROWNUM', | ||
| 11 | width: 60 | ||
| 12 | }, | ||
| 13 | { | ||
| 14 | prop: "DCODE", | ||
| 15 | label: "字典类型编码" | ||
| 16 | }, | ||
| 17 | { | ||
| 18 | prop: "DNAME", | ||
| 19 | label: "字典类型名称" | ||
| 20 | }, | ||
| 21 | { | ||
| 22 | label: "字典结构", | ||
| 23 | render: (h, scope) => { | ||
| 24 | return ( | ||
| 25 | <div> | ||
| 26 | {scope.row.ISTREE == 1 ? '树形' : '列表'} | ||
| 27 | </div> | ||
| 28 | ) | ||
| 29 | }, | ||
| 30 | }, | ||
| 31 | ] | ||
| 32 | } | ||
| 33 | } | ||
| 34 | export default new data() |
File mode changed
src/views/system/dictionary-config/index.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="dictionary-config from-clues"> | ||
| 3 | <div class="from-clues-header"> | ||
| 4 | <el-form ref="form" :model="form" label-width="125px"> | ||
| 5 | <el-row> | ||
| 6 | <el-col :span="5"> | ||
| 7 | <el-form-item label="字典类型编码"> | ||
| 8 | <el-input v-model="form.DCODE" placeholder="字典类型编码"></el-input> | ||
| 9 | </el-form-item> | ||
| 10 | </el-col> | ||
| 11 | <el-col :span="5"> | ||
| 12 | <el-form-item label="字典类型名称"> | ||
| 13 | <el-input v-model="form.DNAME" placeholder="字典类型名称"></el-input> | ||
| 14 | </el-form-item> | ||
| 15 | </el-col> | ||
| 16 | |||
| 17 | <el-col :span="14" class="btnColRight"> | ||
| 18 | <el-button @click="handleUpdateDic">刷新字典缓存</el-button> | ||
| 19 | <el-button type="primary" @click="handleSubmit">查询结果</el-button> | ||
| 20 | </el-col> | ||
| 21 | </el-row> | ||
| 22 | </el-form> | ||
| 23 | </div> | ||
| 24 | <div class="from-clues-content"> | ||
| 25 | <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total" | ||
| 26 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" | ||
| 27 | :data="tableData.data"> | ||
| 28 | </lb-table> | ||
| 29 | <message-tips ref="msg" :message="message" /> | ||
| 30 | </div> | ||
| 31 | <edit-dictionary ref="dictionary" :dictList="dictList" :dicData="dicRowData"></edit-dictionary> | ||
| 32 | </div> | ||
| 33 | </template> | ||
| 34 | |||
| 35 | <script> | ||
| 36 | // 字典 | ||
| 37 | import data from "./data" | ||
| 38 | import dictionaries from '@/api/dictionaries' | ||
| 39 | import tableMixin from '@/mixins/tableMixin.js' | ||
| 40 | import editDictionary from '../components/editDictionary.vue' | ||
| 41 | export default { | ||
| 42 | name: "dictionary-config", | ||
| 43 | mixins: [tableMixin], | ||
| 44 | components: { | ||
| 45 | editDictionary | ||
| 46 | }, | ||
| 47 | data () { | ||
| 48 | return { | ||
| 49 | message: '', | ||
| 50 | form: { | ||
| 51 | DCODE: '', | ||
| 52 | DNAME: '', | ||
| 53 | currentPage: 1 | ||
| 54 | }, | ||
| 55 | preContent: '', | ||
| 56 | tableData: { | ||
| 57 | columns: data.columns().concat([ | ||
| 58 | { | ||
| 59 | label: "操作", | ||
| 60 | render: (h, scope) => { | ||
| 61 | return ( | ||
| 62 | <div> | ||
| 63 | <el-button | ||
| 64 | type="text" | ||
| 65 | size="mini" | ||
| 66 | icon="el-icon-edit" | ||
| 67 | onClick={() => { this.handleEdit(scope.row) }} | ||
| 68 | > | ||
| 69 | 编辑 | ||
| 70 | </el-button> | ||
| 71 | </div> | ||
| 72 | ); | ||
| 73 | }, | ||
| 74 | } | ||
| 75 | ]), | ||
| 76 | data: [] | ||
| 77 | }, | ||
| 78 | pageData: { | ||
| 79 | total: 0, | ||
| 80 | pageSize: 15, | ||
| 81 | current: 1, | ||
| 82 | }, | ||
| 83 | dictList: [], | ||
| 84 | dicRowData: null | ||
| 85 | } | ||
| 86 | }, | ||
| 87 | methods: { | ||
| 88 | async featchData () { | ||
| 89 | try { | ||
| 90 | this.form = Object.assign(this.form, this.formData) | ||
| 91 | let { result: { list, total, pages: pageSize, pageNum: current } | ||
| 92 | } = await dictionaries.getSysDictParent(this.form) | ||
| 93 | this.tableData.data = list | ||
| 94 | this.pageData = { | ||
| 95 | pageSize, | ||
| 96 | current, | ||
| 97 | total | ||
| 98 | } | ||
| 99 | } catch (error) { | ||
| 100 | this.message = error | ||
| 101 | this.$refs.msg.messageShow() | ||
| 102 | } | ||
| 103 | }, | ||
| 104 | async handleEdit (row) { | ||
| 105 | this.dicRowData = row | ||
| 106 | try { | ||
| 107 | let { result: res } = await dictionaries.getSysDictByTypeId(row.TYPEID) | ||
| 108 | this.dictList = res | ||
| 109 | this.$refs.dictionary.isShow() | ||
| 110 | } catch (error) { | ||
| 111 | this.$alert(error, '提示', { | ||
| 112 | confirmButtonText: '确定', | ||
| 113 | type: 'error' | ||
| 114 | }) | ||
| 115 | } | ||
| 116 | }, | ||
| 117 | // 更新字典 | ||
| 118 | handleUpdateDic () { | ||
| 119 | this.$store.dispatch('dictionaries/generateDic').then((res) => { | ||
| 120 | if (res) { | ||
| 121 | this.$message({ | ||
| 122 | message: '刷新成功!', | ||
| 123 | type: 'success' | ||
| 124 | }); | ||
| 125 | } | ||
| 126 | }) | ||
| 127 | } | ||
| 128 | } | ||
| 129 | } | ||
| 130 | </script> | ||
| 131 | <style scoped lang="scss"> | ||
| 132 | @import "~@/styles/public.scss"; | ||
| 133 | @import "./index.scss"; | ||
| 134 | </style> | ||
| 135 | |||
| 136 |
src/views/system/timedTask/data/index.js
0 → 100644
| 1 | import filter from '@/utils/filter.js' | ||
| 2 | class data extends filter { | ||
| 3 | constructor() { | ||
| 4 | super() | ||
| 5 | } | ||
| 6 | columns () { | ||
| 7 | return [ | ||
| 8 | { | ||
| 9 | prop: "job_name", | ||
| 10 | label: "任务名称", | ||
| 11 | width: 130 | ||
| 12 | }, | ||
| 13 | { | ||
| 14 | prop: "description", | ||
| 15 | label: "任务描述", | ||
| 16 | width: 300 | ||
| 17 | }, | ||
| 18 | { | ||
| 19 | prop: "cron_expression", | ||
| 20 | label: "cron表达式" | ||
| 21 | }, | ||
| 22 | { | ||
| 23 | prop: "bean_class", | ||
| 24 | width: 260, | ||
| 25 | label: "任务类" | ||
| 26 | }, | ||
| 27 | { | ||
| 28 | prop: "job_group", | ||
| 29 | label: "任务分组" | ||
| 30 | }, | ||
| 31 | { | ||
| 32 | label: "状态", | ||
| 33 | render: (h, scope) => { | ||
| 34 | return ( | ||
| 35 | <div> | ||
| 36 | { this.stateStatus(scope.row.job_status) } | ||
| 37 | </div> | ||
| 38 | ) | ||
| 39 | }, | ||
| 40 | } | ||
| 41 | ] | ||
| 42 | } | ||
| 43 | } | ||
| 44 | export default new data() |
src/views/system/timedTask/index.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="timedTask from-clues"> | ||
| 3 | <div class="from-clues-header"> | ||
| 4 | <el-form ref="form" :model="form" label-width="80px"> | ||
| 5 | <el-row> | ||
| 6 | <el-col :span="6"> | ||
| 7 | <el-form-item label="搜索标题"> | ||
| 8 | <el-input v-model="form.job_name" placeholder="请输入标题"></el-input> | ||
| 9 | </el-form-item> | ||
| 10 | </el-col> | ||
| 11 | <el-col :span="18" class="btnColRight"> | ||
| 12 | <el-button type="primary" @click="handleSubmit">搜索</el-button> | ||
| 13 | <el-button type="primary" @click="handleAdd">新增</el-button> | ||
| 14 | </el-col> | ||
| 15 | </el-row> | ||
| 16 | </el-form> | ||
| 17 | </div> | ||
| 18 | <div class="from-clues-content"> | ||
| 19 | <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total" | ||
| 20 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" | ||
| 21 | :data="tableData.data"> | ||
| 22 | </lb-table> | ||
| 23 | <add-task ref="task" :taskData="taskData" /> | ||
| 24 | <message-tips ref="msg" :message="message" /> | ||
| 25 | </div> | ||
| 26 | </div> | ||
| 27 | </template> | ||
| 28 | <script> | ||
| 29 | // 定时任务 | ||
| 30 | import data from "./data" | ||
| 31 | import system from '@/api/system.js' | ||
| 32 | import tableMixin from '@/mixins/tableMixin.js' | ||
| 33 | import addTask from '../components/addTask.vue' | ||
| 34 | export default { | ||
| 35 | name: "timedTask", | ||
| 36 | mixins: [tableMixin], | ||
| 37 | components: { | ||
| 38 | addTask | ||
| 39 | }, | ||
| 40 | data () { | ||
| 41 | return { | ||
| 42 | taskData: null, | ||
| 43 | form: { | ||
| 44 | job_name: '', | ||
| 45 | currentPage: 1 | ||
| 46 | }, | ||
| 47 | selectionList: [], | ||
| 48 | tableData: { | ||
| 49 | columns: [{ | ||
| 50 | label: '序号', | ||
| 51 | type: 'index', | ||
| 52 | width: '50', | ||
| 53 | index: this.indexMethod, | ||
| 54 | }].concat(data.columns()).concat([ | ||
| 55 | { | ||
| 56 | label: "操作", | ||
| 57 | width: 380, | ||
| 58 | render: (h, scope) => { | ||
| 59 | return ( | ||
| 60 | <div> | ||
| 61 | <el-button type="text" size="mini" style="color: #67C23A" | ||
| 62 | v-show={scope.row.job_status !== '1' && scope.row.job_status !== '2'} | ||
| 63 | icon="el-icon-magic-stick" | ||
| 64 | onClick={() => { this.handleRecovery(scope.row) }}>激活 | ||
| 65 | </el-button> | ||
| 66 | |||
| 67 | <el-button type="text" size="mini" | ||
| 68 | style="color: #67C23A;margin-left:0" | ||
| 69 | icon="el-icon-refresh-right" | ||
| 70 | v-show={scope.row.job_status === '2'} | ||
| 71 | onClick={() => { this.handleActivation(scope.row) }}>恢复 | ||
| 72 | </el-button> | ||
| 73 | |||
| 74 | <el-button type="text" size="mini" | ||
| 75 | v-show={scope.row.job_status !== '1'} | ||
| 76 | icon="el-icon-stopwatch" | ||
| 77 | onClick={() => { this.handletest(scope.row) }}>手动测试 | ||
| 78 | </el-button> | ||
| 79 | <el-button type="text" size="mini" | ||
| 80 | v-show={scope.row.job_status === '1'} | ||
| 81 | icon="el-icon-video-pause" | ||
| 82 | onClick={() => { this.handleSuspend(scope.row) }}>暂停 | ||
| 83 | </el-button> | ||
| 84 | <el-button type="text" size="mini" | ||
| 85 | icon="el-icon-edit" | ||
| 86 | v-show={scope.row.job_status === '2' || scope.row.job_status === '-1' || scope.row.job_status === '0'} | ||
| 87 | onClick={() => { this.handleEdit(scope.row) }}>编辑 | ||
| 88 | </el-button> | ||
| 89 | <el-button type="text" size="mini" | ||
| 90 | icon="el-icon-delete" style="color:#F56C6C" | ||
| 91 | v-show={scope.row.job_status !== '1'} | ||
| 92 | onClick={() => { this.handleDel(scope.row) }}>删除 | ||
| 93 | </el-button> | ||
| 94 | </div> | ||
| 95 | ); | ||
| 96 | }, | ||
| 97 | }, | ||
| 98 | ]), | ||
| 99 | data: [] | ||
| 100 | }, | ||
| 101 | pageData: { | ||
| 102 | total: 0, | ||
| 103 | pageSize: 15, | ||
| 104 | current: 1, | ||
| 105 | }, | ||
| 106 | } | ||
| 107 | }, | ||
| 108 | methods: { | ||
| 109 | handleAdd () { | ||
| 110 | this.taskData = null | ||
| 111 | this.$refs.task.isShow() | ||
| 112 | }, | ||
| 113 | async featchData () { | ||
| 114 | try { | ||
| 115 | this.form = Object.assign(this.form, this.formData) | ||
| 116 | let { result: { list, total, pages: pageSize, pageNum: current } | ||
| 117 | } = await system.getTaskListByName(this.form) | ||
| 118 | this.tableData.data = list | ||
| 119 | this.pageData = { | ||
| 120 | pageSize, | ||
| 121 | current, | ||
| 122 | total | ||
| 123 | } | ||
| 124 | } catch (error) { | ||
| 125 | this.message = error | ||
| 126 | this.$refs.msg.messageShow() | ||
| 127 | } | ||
| 128 | }, | ||
| 129 | // 暂停 | ||
| 130 | handleSuspend (row) { | ||
| 131 | this.$confirm('此操将进行暂停操作, 是否继续?', '提示', { | ||
| 132 | confirmButtonText: '确定', | ||
| 133 | cancelButtonText: '取消', | ||
| 134 | type: 'warning', | ||
| 135 | }) | ||
| 136 | .then(() => { | ||
| 137 | system.pauseJob(row.id) | ||
| 138 | .then((res) => { | ||
| 139 | if ((res.code = 200)) { | ||
| 140 | this.$message({ | ||
| 141 | type: 'success', | ||
| 142 | message: res.message, | ||
| 143 | }) | ||
| 144 | this.featchData() | ||
| 145 | } | ||
| 146 | }) | ||
| 147 | .catch((error) => { | ||
| 148 | this.$alert(error, '提示', { | ||
| 149 | confirmButtonText: '确定', | ||
| 150 | type: 'error' | ||
| 151 | }) | ||
| 152 | }) | ||
| 153 | }) | ||
| 154 | .catch(() => { | ||
| 155 | this.$message({ | ||
| 156 | type: 'info', | ||
| 157 | message: '已取消', | ||
| 158 | }) | ||
| 159 | }) | ||
| 160 | }, | ||
| 161 | // 激活 | ||
| 162 | handleRecovery (row) { | ||
| 163 | this.$confirm('此操将进行激活操作, 是否继续?', '提示', { | ||
| 164 | confirmButtonText: '确定', | ||
| 165 | cancelButtonText: '取消', | ||
| 166 | type: 'warning', | ||
| 167 | }) | ||
| 168 | .then(() => { | ||
| 169 | system.activateJob(row.id) | ||
| 170 | .then((res) => { | ||
| 171 | if ((res.code = 200)) { | ||
| 172 | this.$message({ | ||
| 173 | type: 'success', | ||
| 174 | message: res.message, | ||
| 175 | }) | ||
| 176 | this.featchData() | ||
| 177 | } | ||
| 178 | }) | ||
| 179 | .catch((error) => { | ||
| 180 | this.$alert(error, '提示', { | ||
| 181 | confirmButtonText: '确定', | ||
| 182 | type: 'error' | ||
| 183 | }) | ||
| 184 | }) | ||
| 185 | }) | ||
| 186 | .catch(() => { | ||
| 187 | this.$message({ | ||
| 188 | type: 'info', | ||
| 189 | message: '已取消', | ||
| 190 | }) | ||
| 191 | }) | ||
| 192 | }, | ||
| 193 | // 恢复 | ||
| 194 | handleActivation (row) { | ||
| 195 | this.$confirm('此操将进行恢复操作, 是否继续?', '提示', { | ||
| 196 | confirmButtonText: '确定', | ||
| 197 | cancelButtonText: '取消', | ||
| 198 | type: 'warning', | ||
| 199 | }) | ||
| 200 | .then(() => { | ||
| 201 | system.resumeJob(row.id) | ||
| 202 | .then((res) => { | ||
| 203 | if ((res.code = 200)) { | ||
| 204 | this.$message({ | ||
| 205 | type: 'success', | ||
| 206 | message: res.message, | ||
| 207 | }) | ||
| 208 | this.featchData() | ||
| 209 | } | ||
| 210 | }) | ||
| 211 | .catch((error) => { | ||
| 212 | this.$alert(error, '提示', { | ||
| 213 | confirmButtonText: '确定', | ||
| 214 | type: 'error' | ||
| 215 | }) | ||
| 216 | }) | ||
| 217 | }) | ||
| 218 | .catch(() => { | ||
| 219 | this.$message({ | ||
| 220 | type: 'info', | ||
| 221 | message: '已取消', | ||
| 222 | }) | ||
| 223 | }) | ||
| 224 | }, | ||
| 225 | // 手动测试 | ||
| 226 | handletest (row) { | ||
| 227 | this.$confirm('此操将进行手动测试, 是否继续?', '提示', { | ||
| 228 | confirmButtonText: '确定', | ||
| 229 | cancelButtonText: '取消', | ||
| 230 | type: 'warning', | ||
| 231 | }) | ||
| 232 | .then(() => { | ||
| 233 | system.sjsbTaskRun(row.id) | ||
| 234 | .then((res) => { | ||
| 235 | if ((res.code = 200)) { | ||
| 236 | this.$alert(res.message, '提示', { | ||
| 237 | confirmButtonText: '确定', | ||
| 238 | type: 'success' | ||
| 239 | }); | ||
| 240 | this.featchData() | ||
| 241 | } | ||
| 242 | }) | ||
| 243 | .catch((error) => { | ||
| 244 | this.$alert(error, '提示', { | ||
| 245 | confirmButtonText: '确定', | ||
| 246 | type: 'error' | ||
| 247 | }) | ||
| 248 | }) | ||
| 249 | }) | ||
| 250 | .catch(() => { | ||
| 251 | this.$message({ | ||
| 252 | type: 'info', | ||
| 253 | message: '已取消', | ||
| 254 | }) | ||
| 255 | }) | ||
| 256 | }, | ||
| 257 | handleEdit (row) { | ||
| 258 | this.taskData = row | ||
| 259 | this.$refs.task.isShow() | ||
| 260 | }, | ||
| 261 | handleDel (row) { | ||
| 262 | this.$confirm('此操将进行删除操作, 是否继续?', '提示', { | ||
| 263 | confirmButtonText: '确定', | ||
| 264 | cancelButtonText: '取消', | ||
| 265 | type: 'warning', | ||
| 266 | }) | ||
| 267 | .then(() => { | ||
| 268 | system.sjsbTaskRemove(row.id) | ||
| 269 | .then((res) => { | ||
| 270 | if ((res.code = 200)) { | ||
| 271 | this.$message({ | ||
| 272 | type: 'success', | ||
| 273 | message: res.message, | ||
| 274 | }) | ||
| 275 | this.featchData() | ||
| 276 | } | ||
| 277 | }) | ||
| 278 | .catch((error) => { | ||
| 279 | this.$alert(error, '提示', { | ||
| 280 | confirmButtonText: '确定', | ||
| 281 | type: 'error' | ||
| 282 | }) | ||
| 283 | }) | ||
| 284 | }) | ||
| 285 | .catch(() => { | ||
| 286 | this.$message({ | ||
| 287 | type: 'info', | ||
| 288 | message: '已取消', | ||
| 289 | }) | ||
| 290 | }) | ||
| 291 | } | ||
| 292 | } | ||
| 293 | } | ||
| 294 | </script> | ||
| 295 | <style scoped lang="scss"> | ||
| 296 | @import "~@/styles/mixin.scss"; | ||
| 297 | @import "~@/styles/public.scss"; | ||
| 298 | </style> |
| 1 | import filter from '@/utils/filter.js' | ||
| 2 | class data extends filter { | ||
| 3 | constructor() { | ||
| 4 | super() | ||
| 5 | } | ||
| 6 | columns () { | ||
| 7 | return [ | ||
| 8 | { | ||
| 9 | prop: "DATATABLE", | ||
| 10 | label: "数据表名" | ||
| 11 | }, | ||
| 12 | { | ||
| 13 | prop: "CHINESETABLE", | ||
| 14 | label: "中文名称" | ||
| 15 | }, | ||
| 16 | { | ||
| 17 | prop: "SOLEURL", | ||
| 18 | label: "tab表头链接标识", | ||
| 19 | }, | ||
| 20 | ] | ||
| 21 | } | ||
| 22 | } | ||
| 23 | export default new data() |
src/views/system/validationRule/index.scss
0 → 100644
File mode changed
src/views/system/validationRule/index.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="dictionary-config from-clues"> | ||
| 3 | <div class="from-clues-header"> | ||
| 4 | <el-form ref="form" :model="form" label-width="125px"> | ||
| 5 | <el-row> | ||
| 6 | <el-col :span="6"> | ||
| 7 | <el-form-item label="数据表名"> | ||
| 8 | <el-input v-model="form.DATATABLE" placeholder="数据表名"></el-input> | ||
| 9 | </el-form-item> | ||
| 10 | </el-col> | ||
| 11 | <el-col :span="6"> | ||
| 12 | <el-form-item label="中文名称"> | ||
| 13 | <el-input v-model="form.CHINESETABLE" placeholder="中文名称"></el-input> | ||
| 14 | </el-form-item> | ||
| 15 | </el-col> | ||
| 16 | <el-col :span="6"> | ||
| 17 | <el-form-item label="tab表头链接标识"> | ||
| 18 | <el-input v-model="form.SOLEURL" placeholder="tab表头链接标识"></el-input> | ||
| 19 | </el-form-item> | ||
| 20 | </el-col> | ||
| 21 | |||
| 22 | <el-col :span="6" class="btnColRight"> | ||
| 23 | <el-button @click="handleUpdateDic">刷新规则缓存</el-button> | ||
| 24 | <el-button type="primary" @click="handleSubmit">查询结果</el-button> | ||
| 25 | </el-col> | ||
| 26 | </el-row> | ||
| 27 | </el-form> | ||
| 28 | </div> | ||
| 29 | <div class="from-clues-content"> | ||
| 30 | <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="pageData.total" | ||
| 31 | @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" | ||
| 32 | :data="tableData.data"> | ||
| 33 | </lb-table> | ||
| 34 | <message-tips ref="msg" :message="message" /> | ||
| 35 | </div> | ||
| 36 | <edit-validRule ref="validRule" :ruleData="ruleData"></edit-validRule> | ||
| 37 | </div> | ||
| 38 | </template> | ||
| 39 | |||
| 40 | <script> | ||
| 41 | // 字典 | ||
| 42 | import data from "./data" | ||
| 43 | import tableMixin from '@/mixins/tableMixin.js' | ||
| 44 | import ruleConfig from '@/api/ruleConfig' | ||
| 45 | import editValidRule from '../components/editValidRule.vue' | ||
| 46 | export default { | ||
| 47 | name: "dictionary-config", | ||
| 48 | mixins: [tableMixin], | ||
| 49 | components: { | ||
| 50 | editValidRule | ||
| 51 | }, | ||
| 52 | data () { | ||
| 53 | return { | ||
| 54 | message: '', | ||
| 55 | form: { | ||
| 56 | DATATABLE: '', | ||
| 57 | CHINESETABLE: '', | ||
| 58 | SOLEURL: '', | ||
| 59 | currentPage: 1 | ||
| 60 | }, | ||
| 61 | preContent: '', | ||
| 62 | tableData: { | ||
| 63 | columns: [{ | ||
| 64 | label: '序号', | ||
| 65 | type: 'index', | ||
| 66 | width: '50', | ||
| 67 | index: this.indexMethod, | ||
| 68 | }].concat(data.columns()).concat([ | ||
| 69 | { | ||
| 70 | label: "操作", | ||
| 71 | render: (h, scope) => { | ||
| 72 | return ( | ||
| 73 | <div> | ||
| 74 | <el-button | ||
| 75 | type="text" | ||
| 76 | size="mini" | ||
| 77 | icon="el-icon-edit" | ||
| 78 | onClick={() => { this.handleEdit(scope.$index, scope.row) }} | ||
| 79 | > | ||
| 80 | 编辑 | ||
| 81 | </el-button> | ||
| 82 | |||
| 83 | <el-button | ||
| 84 | type="text" | ||
| 85 | size="mini" | ||
| 86 | icon="el-icon-delete" | ||
| 87 | style="color:#F56C6C" | ||
| 88 | onClick={() => { this.handleDel(scope.$index, scope.row) }} | ||
| 89 | > | ||
| 90 | 删除 | ||
| 91 | </el-button> | ||
| 92 | </div> | ||
| 93 | ); | ||
| 94 | }, | ||
| 95 | } | ||
| 96 | ]), | ||
| 97 | data: [] | ||
| 98 | }, | ||
| 99 | pageData: { | ||
| 100 | total: 0, | ||
| 101 | pageSize: 15, | ||
| 102 | current: 1, | ||
| 103 | }, | ||
| 104 | ruleData: null | ||
| 105 | } | ||
| 106 | }, | ||
| 107 | methods: { | ||
| 108 | async featchData () { | ||
| 109 | try { | ||
| 110 | this.form = Object.assign(this.form, this.formData) | ||
| 111 | let { result: { list, total, pages: pageSize, pageNum: current } | ||
| 112 | } = await ruleConfig.getSysYwsjbList(this.form) | ||
| 113 | this.tableData.data = list | ||
| 114 | this.pageData = { | ||
| 115 | pageSize, | ||
| 116 | current, | ||
| 117 | total | ||
| 118 | } | ||
| 119 | } catch (error) { | ||
| 120 | this.message = error | ||
| 121 | this.$refs.msg.messageShow() | ||
| 122 | } | ||
| 123 | }, | ||
| 124 | async handleEdit (index, row) { | ||
| 125 | try { | ||
| 126 | let { result: res } = await ruleConfig.eidtConfigRule(row.BSM_YWSJB) | ||
| 127 | this.ruleData = res | ||
| 128 | this.$refs.validRule.isShow() | ||
| 129 | } catch (error) { | ||
| 130 | this.$alert(error, '提示', { | ||
| 131 | confirmButtonText: '确定', | ||
| 132 | type: 'error' | ||
| 133 | }) | ||
| 134 | } | ||
| 135 | }, | ||
| 136 | handleDel (index, row) { | ||
| 137 | let _this = this | ||
| 138 | this.$confirm('此操作将进行删除校验规则, 是否继续?', '提示', { | ||
| 139 | cancelButtonText: '取消', | ||
| 140 | confirmButtonText: '确定', | ||
| 141 | type: 'warning' | ||
| 142 | }).then(async () => { | ||
| 143 | try { | ||
| 144 | let res = await ruleConfig.deleteSysYwsjbWithSysYwsjbFieldByBsmYwsjb(row.BSM_YWSJB) | ||
| 145 | if (res.code == 200) { | ||
| 146 | _this.$message({ | ||
| 147 | type: 'success', | ||
| 148 | message: '删除成功!' | ||
| 149 | }); | ||
| 150 | _this.featchData() | ||
| 151 | } | ||
| 152 | } catch (error) { | ||
| 153 | _this.$alert(error, '提示', { | ||
| 154 | confirmButtonText: '确定', | ||
| 155 | type: 'error' | ||
| 156 | }) | ||
| 157 | } | ||
| 158 | }).catch(() => { | ||
| 159 | this.$message({ | ||
| 160 | type: 'info', | ||
| 161 | message: '已取消删除' | ||
| 162 | }); | ||
| 163 | }); | ||
| 164 | }, | ||
| 165 | handleUpdateDic () { | ||
| 166 | this.$store.dispatch('dictionaries/generateDic').then((res) => { | ||
| 167 | if (res) { | ||
| 168 | this.$message({ | ||
| 169 | message: '刷新成功!', | ||
| 170 | type: 'success' | ||
| 171 | }) | ||
| 172 | } | ||
| 173 | }) | ||
| 174 | } | ||
| 175 | } | ||
| 176 | } | ||
| 177 | </script> | ||
| 178 | <style scoped lang="scss"> | ||
| 179 | @import "~@/styles/public.scss"; | ||
| 180 | @import "./index.scss"; | ||
| 181 | </style> | ||
| 182 | |||
| 183 |
-
Please register or sign in to post a comment