Commit b61eb1ed62218974596fc1e3fd717f0b1bb515a0
1 parent
288aac54
上报线索研判
Showing
13 changed files
with
896 additions
and
284 deletions
src/api/systemData/dataInterface.js
| 1 | import request from '@/utils/request' | 1 | import request from '@/utils/request' |
| 2 | 2 | ||
| 3 | -// 获取字段列表 | 3 | +// 查询需要判研的列表 |
| 4 | +export function getListForJudge(data) { | ||
| 5 | + return request({ | ||
| 6 | + url: `/Extend/BaseInspectionReport/GetListForJudge`, | ||
| 7 | + method: 'GET', | ||
| 8 | + data | ||
| 9 | + }) | ||
| 10 | +} | ||
| 11 | +// 查询当前登陆人发起的列表 | ||
| 4 | export function getList(data) { | 12 | export function getList(data) { |
| 5 | return request({ | 13 | return request({ |
| 6 | - url: `/Extend/BaseInspectionReport`, | 14 | + url: `/Extend/BaseInspectionReport/GetListForCurrentUser`, |
| 7 | method: 'GET', | 15 | method: 'GET', |
| 8 | data | 16 | data |
| 9 | }) | 17 | }) |
| 10 | } | 18 | } |
| 19 | +// 获取单个巡查上报 | ||
| 20 | +export function getDetail(id) { | ||
| 21 | + return request({ | ||
| 22 | + url: `/Extend/BaseInspectionReport/${id}`, | ||
| 23 | + method: 'GET', | ||
| 24 | + }) | ||
| 25 | +} | ||
| 26 | +// 提交 | ||
| 27 | +export function addForm(data) { | ||
| 28 | + return request({ | ||
| 29 | + url: `/Extend/BaseInspectionReport`, | ||
| 30 | + method: 'POST', | ||
| 31 | + data | ||
| 32 | + }) | ||
| 33 | +} | ||
| 34 | +// 更新 | ||
| 35 | +export function updataForm(data) { | ||
| 36 | + return request({ | ||
| 37 | + url: `/Extend/BaseInspectionReport/${data.id}`, | ||
| 38 | + method: 'PUT', | ||
| 39 | + data | ||
| 40 | + }) | ||
| 41 | +} | ||
| 42 | +// 判研 | ||
| 43 | +export function disposalSuggestions(data) { | ||
| 44 | + return request({ | ||
| 45 | + url: `/Extend/BaseInspectionReport/${data.id}/disposalSuggestions`, | ||
| 46 | + method: 'PUT', | ||
| 47 | + data | ||
| 48 | + }) | ||
| 49 | +} | ||
| 11 | 50 | ||
| 12 | 51 | ||
| 13 | // 获取接口列表(分页) | 52 | // 获取接口列表(分页) |
src/components/Generator/components/InputTable/index.vue
| @@ -327,7 +327,7 @@ export default { | @@ -327,7 +327,7 @@ export default { | ||
| 327 | top: 74%; | 327 | top: 74%; |
| 328 | z-index: 1; | 328 | z-index: 1; |
| 329 | } | 329 | } |
| 330 | - >>> .el-input__inner { | 330 | + .el-input__inner { |
| 331 | border-color: #f56c6c; | 331 | border-color: #f56c6c; |
| 332 | } | 332 | } |
| 333 | } | 333 | } |
| @@ -361,7 +361,7 @@ export default { | @@ -361,7 +361,7 @@ export default { | ||
| 361 | 361 | ||
| 362 | .ncc-table-box.table { | 362 | .ncc-table-box.table { |
| 363 | // 索引和删除按钮切换 | 363 | // 索引和删除按钮切换 |
| 364 | - >>> .el-table__row:hover { | 364 | + .el-table__row:hover { |
| 365 | .index { | 365 | .index { |
| 366 | display: none; | 366 | display: none; |
| 367 | &.btn-disabled { | 367 | &.btn-disabled { |
| @@ -377,15 +377,15 @@ export default { | @@ -377,15 +377,15 @@ export default { | ||
| 377 | opacity: 1; | 377 | opacity: 1; |
| 378 | } | 378 | } |
| 379 | } | 379 | } |
| 380 | - >>> .el-input-number { | 380 | + .el-input-number { |
| 381 | width: 100%; | 381 | width: 100%; |
| 382 | min-width: 120px; | 382 | min-width: 120px; |
| 383 | } | 383 | } |
| 384 | - >>> .el-table__header th { | 384 | + .el-table__header th { |
| 385 | line-height: 1; | 385 | line-height: 1; |
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | - >>> .el-table .el-table__body { | 388 | + .el-table .el-table__body { |
| 389 | td { | 389 | td { |
| 390 | padding: 2px 0; | 390 | padding: 2px 0; |
| 391 | background: #fff !important; | 391 | background: #fff !important; |
src/main.js
src/utils/index.js
| 1 | +/** | ||
| 2 | + * Parse the time to string | ||
| 3 | + * @param {(Object|string|number)} time | ||
| 4 | + * @param {string} cFormat | ||
| 5 | + * @returns {string | null} | ||
| 6 | + */ | ||
| 7 | +export function parseTime(time, cFormat) { | ||
| 8 | + if (arguments.length === 0 || !time) { | ||
| 9 | + return null | ||
| 10 | + } | ||
| 11 | + const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' | ||
| 12 | + let date | ||
| 13 | + if ((typeof time === 'string')) { | ||
| 14 | + if ((/^[0-9]+$/.test(time))) { | ||
| 15 | + // support "1548221490638" | ||
| 16 | + time = parseInt(time) | ||
| 17 | + } else { | ||
| 18 | + // support safari | ||
| 19 | + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari | ||
| 20 | + time = time.replace(new RegExp(/-/gm), '/') | ||
| 21 | + } | ||
| 22 | + } else { | ||
| 23 | + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { | ||
| 24 | + time = parseInt(time) | ||
| 25 | + } | ||
| 26 | + if ((typeof time === 'number') && (time.toString().length === 10)) { | ||
| 27 | + time = time * 1000 | ||
| 28 | + } | ||
| 29 | + date = new Date(time) | ||
| 30 | + } | ||
| 31 | + const formatObj = { | ||
| 32 | + y: date.getFullYear(), | ||
| 33 | + m: date.getMonth() + 1, | ||
| 34 | + d: date.getDate(), | ||
| 35 | + h: date.getHours(), | ||
| 36 | + i: date.getMinutes(), | ||
| 37 | + s: date.getSeconds(), | ||
| 38 | + a: date.getDay() | ||
| 39 | + } | ||
| 40 | + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { | ||
| 41 | + const value = formatObj[key] | ||
| 42 | + // Note: getDay() returns 0 on Sunday | ||
| 43 | + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } | ||
| 44 | + return value.toString().padStart(2, '0') | ||
| 45 | + }) | ||
| 46 | + return time_str | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +/** | ||
| 50 | + * @param {number} time | ||
| 51 | + * @param {string} option | ||
| 52 | + * @returns {string} | ||
| 53 | + */ | ||
| 54 | +export function formatTime(time, option) { | ||
| 55 | + if (('' + time).length === 10) { | ||
| 56 | + time = parseInt(time) * 1000 | ||
| 57 | + } else { | ||
| 58 | + time = +time | ||
| 59 | + } | ||
| 60 | + const d = new Date(time) | ||
| 61 | + const now = Date.now() | ||
| 1 | 62 | ||
| 63 | + const diff = (now - d) / 1000 | ||
| 64 | + | ||
| 65 | + if (diff < 30) { | ||
| 66 | + return '刚刚' | ||
| 67 | + } else if (diff < 3600) { | ||
| 68 | + // less 1 hour | ||
| 69 | + return Math.ceil(diff / 60) + '分钟前' | ||
| 70 | + } else if (diff < 3600 * 24) { | ||
| 71 | + return Math.ceil(diff / 3600) + '小时前' | ||
| 72 | + } else if (diff < 3600 * 24 * 2) { | ||
| 73 | + return '1天前' | ||
| 74 | + } | ||
| 75 | + if (option) { | ||
| 76 | + return parseTime(time, option) | ||
| 77 | + } else { | ||
| 78 | + return ( | ||
| 79 | + d.getMonth() + | ||
| 80 | + 1 + | ||
| 81 | + '月' + | ||
| 82 | + d.getDate() + | ||
| 83 | + '日' + | ||
| 84 | + d.getHours() + | ||
| 85 | + '时' + | ||
| 86 | + d.getMinutes() + | ||
| 87 | + '分' | ||
| 88 | + ) | ||
| 89 | + } | ||
| 90 | +} | ||
| 2 | 91 | ||
| 3 | /** | 92 | /** |
| 4 | - * 通用js方法封装处理 | ||
| 5 | - * Copyright (c) 2019 ruoyi | 93 | + * @param {string} url |
| 94 | + * @returns {Object} | ||
| 6 | */ | 95 | */ |
| 96 | +export function getQueryObject(url) { | ||
| 97 | + url = url == null ? window.location.href : url | ||
| 98 | + const search = url.substring(url.lastIndexOf('?') + 1) | ||
| 99 | + const obj = {} | ||
| 100 | + const reg = /([^?&=]+)=([^?&=]*)/g | ||
| 101 | + search.replace(reg, (rs, $1, $2) => { | ||
| 102 | + const name = decodeURIComponent($1) | ||
| 103 | + let val = decodeURIComponent($2) | ||
| 104 | + val = String(val) | ||
| 105 | + obj[name] = val | ||
| 106 | + return rs | ||
| 107 | + }) | ||
| 108 | + return obj | ||
| 109 | +} | ||
| 7 | 110 | ||
| 8 | -// 日期格式化 | ||
| 9 | -export function parseTime(time, pattern) { | ||
| 10 | - if (arguments.length === 0 || !time) { | ||
| 11 | - return null | ||
| 12 | - } | ||
| 13 | - const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' | ||
| 14 | - let date | ||
| 15 | - if (typeof time === 'object') { | ||
| 16 | - date = time | ||
| 17 | - } else { | ||
| 18 | - if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { | ||
| 19 | - time = parseInt(time) | ||
| 20 | - } else if (typeof time === 'string') { | ||
| 21 | - time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), ''); | ||
| 22 | - } | ||
| 23 | - if ((typeof time === 'number') && (time.toString().length === 10)) { | ||
| 24 | - time = time * 1000 | ||
| 25 | - } | ||
| 26 | - date = new Date(time) | ||
| 27 | - } | ||
| 28 | - const formatObj = { | ||
| 29 | - y: date.getFullYear(), | ||
| 30 | - m: date.getMonth() + 1, | ||
| 31 | - d: date.getDate(), | ||
| 32 | - h: date.getHours(), | ||
| 33 | - i: date.getMinutes(), | ||
| 34 | - s: date.getSeconds(), | ||
| 35 | - a: date.getDay() | 111 | +/** |
| 112 | + * @param {string} input value | ||
| 113 | + * @returns {number} output value | ||
| 114 | + */ | ||
| 115 | +export function byteLength(str) { | ||
| 116 | + // returns the byte length of an utf8 string | ||
| 117 | + let s = str.length | ||
| 118 | + for (var i = str.length - 1; i >= 0; i--) { | ||
| 119 | + const code = str.charCodeAt(i) | ||
| 120 | + if (code > 0x7f && code <= 0x7ff) s++ | ||
| 121 | + else if (code > 0x7ff && code <= 0xffff) s += 2 | ||
| 122 | + if (code >= 0xDC00 && code <= 0xDFFF) i-- | ||
| 123 | + } | ||
| 124 | + return s | ||
| 125 | +} | ||
| 126 | + | ||
| 127 | +/** | ||
| 128 | + * @param {Array} actual | ||
| 129 | + * @returns {Array} | ||
| 130 | + */ | ||
| 131 | +export function cleanArray(actual) { | ||
| 132 | + const newArray = [] | ||
| 133 | + for (let i = 0; i < actual.length; i++) { | ||
| 134 | + if (actual[i]) { | ||
| 135 | + newArray.push(actual[i]) | ||
| 36 | } | 136 | } |
| 37 | - const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { | ||
| 38 | - let value = formatObj[key] | ||
| 39 | - // Note: getDay() returns 0 on Sunday | ||
| 40 | - if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } | ||
| 41 | - if (result.length > 0 && value < 10) { | ||
| 42 | - value = '0' + value | ||
| 43 | - } | ||
| 44 | - return value || 0 | 137 | + } |
| 138 | + return newArray | ||
| 139 | +} | ||
| 140 | + | ||
| 141 | +/** | ||
| 142 | + * @param {Object} json | ||
| 143 | + * @returns {Array} | ||
| 144 | + */ | ||
| 145 | +export function param(json) { | ||
| 146 | + if (!json) return '' | ||
| 147 | + return cleanArray( | ||
| 148 | + Object.keys(json).map(key => { | ||
| 149 | + if (json[key] === undefined) return '' | ||
| 150 | + return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) | ||
| 45 | }) | 151 | }) |
| 46 | - return time_str | 152 | + ).join('&') |
| 153 | +} | ||
| 154 | + | ||
| 155 | +/** | ||
| 156 | + * @param {string} url | ||
| 157 | + * @returns {Object} | ||
| 158 | + */ | ||
| 159 | +export function param2Obj(url) { | ||
| 160 | + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') | ||
| 161 | + if (!search) { | ||
| 162 | + return {} | ||
| 47 | } | 163 | } |
| 48 | - | ||
| 49 | - // 表单重置 | ||
| 50 | - export function resetForm(refName) { | ||
| 51 | - if (this.$refs[refName]) { | ||
| 52 | - this.$refs[refName].resetFields(); | 164 | + const obj = {} |
| 165 | + const searchArr = search.split('&') | ||
| 166 | + searchArr.forEach(v => { | ||
| 167 | + const index = v.indexOf('=') | ||
| 168 | + if (index !== -1) { | ||
| 169 | + const name = v.substring(0, index) | ||
| 170 | + const val = v.substring(index + 1, v.length) | ||
| 171 | + obj[name] = val | ||
| 53 | } | 172 | } |
| 173 | + }) | ||
| 174 | + return obj | ||
| 175 | +} | ||
| 176 | + | ||
| 177 | +/** | ||
| 178 | + * @param {string} val | ||
| 179 | + * @returns {string} | ||
| 180 | + */ | ||
| 181 | +export function html2Text(val) { | ||
| 182 | + const div = document.createElement('div') | ||
| 183 | + div.innerHTML = val | ||
| 184 | + return div.textContent || div.innerText | ||
| 185 | +} | ||
| 186 | + | ||
| 187 | +/** | ||
| 188 | + * Merges two objects, giving the last one precedence | ||
| 189 | + * @param {Object} target | ||
| 190 | + * @param {(Object|Array)} source | ||
| 191 | + * @returns {Object} | ||
| 192 | + */ | ||
| 193 | +export function objectMerge(target, source) { | ||
| 194 | + if (typeof target !== 'object') { | ||
| 195 | + target = {} | ||
| 196 | + } | ||
| 197 | + if (Array.isArray(source)) { | ||
| 198 | + return source.slice() | ||
| 54 | } | 199 | } |
| 55 | - | ||
| 56 | - // 添加日期范围 | ||
| 57 | - export function addDateRange(params, dateRange, propName) { | ||
| 58 | - let search = params; | ||
| 59 | - search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}; | ||
| 60 | - dateRange = Array.isArray(dateRange) ? dateRange : []; | ||
| 61 | - if (typeof (propName) === 'undefined') { | ||
| 62 | - search.params['beginTime'] = dateRange[0]; | ||
| 63 | - search.params['endTime'] = dateRange[1]; | 200 | + Object.keys(source).forEach(property => { |
| 201 | + const sourceProperty = source[property] | ||
| 202 | + if (typeof sourceProperty === 'object') { | ||
| 203 | + target[property] = objectMerge(target[property], sourceProperty) | ||
| 64 | } else { | 204 | } else { |
| 65 | - search.params['begin' + propName] = dateRange[0]; | ||
| 66 | - search.params['end' + propName] = dateRange[1]; | 205 | + target[property] = sourceProperty |
| 67 | } | 206 | } |
| 68 | - return search; | 207 | + }) |
| 208 | + return target | ||
| 209 | +} | ||
| 210 | + | ||
| 211 | +/** | ||
| 212 | + * @param {HTMLElement} element | ||
| 213 | + * @param {string} className | ||
| 214 | + */ | ||
| 215 | +export function toggleClass(element, className) { | ||
| 216 | + if (!element || !className) { | ||
| 217 | + return | ||
| 69 | } | 218 | } |
| 70 | - | ||
| 71 | - // 回显数据字典 | ||
| 72 | - export function selectDictLabel(datas, value) { | ||
| 73 | - if (value === undefined) { | ||
| 74 | - return ""; | ||
| 75 | - } | ||
| 76 | - var actions = []; | ||
| 77 | - Object.keys(datas).some((key) => { | ||
| 78 | - if (datas[key].value == ('' + value)) { | ||
| 79 | - actions.push(datas[key].label); | ||
| 80 | - return true; | ||
| 81 | - } | ||
| 82 | - }) | ||
| 83 | - if (actions.length === 0) { | ||
| 84 | - actions.push(value); | ||
| 85 | - } | ||
| 86 | - return actions.join(''); | 219 | + let classString = element.className |
| 220 | + const nameIndex = classString.indexOf(className) | ||
| 221 | + if (nameIndex === -1) { | ||
| 222 | + classString += '' + className | ||
| 223 | + } else { | ||
| 224 | + classString = | ||
| 225 | + classString.substr(0, nameIndex) + | ||
| 226 | + classString.substr(nameIndex + className.length) | ||
| 87 | } | 227 | } |
| 88 | - | ||
| 89 | - // 回显数据字典(字符串、数组) | ||
| 90 | - export function selectDictLabels(datas, value, separator) { | ||
| 91 | - if (value === undefined || value.length ===0) { | ||
| 92 | - return ""; | ||
| 93 | - } | ||
| 94 | - if (Array.isArray(value)) { | ||
| 95 | - value = value.join(","); | ||
| 96 | - } | ||
| 97 | - var actions = []; | ||
| 98 | - var currentSeparator = undefined === separator ? "," : separator; | ||
| 99 | - var temp = value.split(currentSeparator); | ||
| 100 | - Object.keys(value.split(currentSeparator)).some((val) => { | ||
| 101 | - var match = false; | ||
| 102 | - Object.keys(datas).some((key) => { | ||
| 103 | - if (datas[key].value == ('' + temp[val])) { | ||
| 104 | - actions.push(datas[key].label + currentSeparator); | ||
| 105 | - match = true; | ||
| 106 | - } | ||
| 107 | - }) | ||
| 108 | - if (!match) { | ||
| 109 | - actions.push(temp[val] + currentSeparator); | ||
| 110 | - } | ||
| 111 | - }) | ||
| 112 | - return actions.join('').substring(0, actions.join('').length - 1); | ||
| 113 | - } | ||
| 114 | - | ||
| 115 | - // 字符串格式化(%s ) | ||
| 116 | - export function sprintf(str) { | ||
| 117 | - var args = arguments, flag = true, i = 1; | ||
| 118 | - str = str.replace(/%s/g, function () { | ||
| 119 | - var arg = args[i++]; | ||
| 120 | - if (typeof arg === 'undefined') { | ||
| 121 | - flag = false; | ||
| 122 | - return ''; | ||
| 123 | - } | ||
| 124 | - return arg; | ||
| 125 | - }); | ||
| 126 | - return flag ? str : ''; | ||
| 127 | - } | ||
| 128 | - | ||
| 129 | - // 转换字符串,undefined,null等转化为"" | ||
| 130 | - export function parseStrEmpty(str) { | ||
| 131 | - if (!str || str == "undefined" || str == "null") { | ||
| 132 | - return ""; | ||
| 133 | - } | ||
| 134 | - return str; | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | - // 数据合并 | ||
| 138 | - export function mergeRecursive(source, target) { | ||
| 139 | - for (var p in target) { | ||
| 140 | - try { | ||
| 141 | - if (target[p].constructor == Object) { | ||
| 142 | - source[p] = mergeRecursive(source[p], target[p]); | ||
| 143 | - } else { | ||
| 144 | - source[p] = target[p]; | ||
| 145 | - } | ||
| 146 | - } catch (e) { | ||
| 147 | - source[p] = target[p]; | ||
| 148 | - } | ||
| 149 | - } | ||
| 150 | - return source; | ||
| 151 | - }; | ||
| 152 | - | ||
| 153 | - /** | ||
| 154 | - * 构造树型结构数据 | ||
| 155 | - * @param {*} data 数据源 | ||
| 156 | - * @param {*} id id字段 默认 'id' | ||
| 157 | - * @param {*} parentId 父节点字段 默认 'parentId' | ||
| 158 | - * @param {*} children 孩子节点字段 默认 'children' | ||
| 159 | - */ | ||
| 160 | - export function handleTree(data, id, parentId, children) { | ||
| 161 | - let config = { | ||
| 162 | - id: id || 'id', | ||
| 163 | - parentId: parentId || 'parentId', | ||
| 164 | - childrenList: children || 'children' | ||
| 165 | - }; | ||
| 166 | - | ||
| 167 | - var childrenListMap = {}; | ||
| 168 | - var nodeIds = {}; | ||
| 169 | - var tree = []; | ||
| 170 | - | ||
| 171 | - for (let d of data) { | ||
| 172 | - let parentId = d[config.parentId]; | ||
| 173 | - if (childrenListMap[parentId] == null) { | ||
| 174 | - childrenListMap[parentId] = []; | ||
| 175 | - } | ||
| 176 | - nodeIds[d[config.id]] = d; | ||
| 177 | - childrenListMap[parentId].push(d); | ||
| 178 | - } | ||
| 179 | - | ||
| 180 | - for (let d of data) { | ||
| 181 | - let parentId = d[config.parentId]; | ||
| 182 | - if (nodeIds[parentId] == null) { | ||
| 183 | - tree.push(d); | ||
| 184 | - } | ||
| 185 | - } | ||
| 186 | - | ||
| 187 | - for (let t of tree) { | ||
| 188 | - adaptToChildrenList(t); | ||
| 189 | - } | ||
| 190 | - | ||
| 191 | - function adaptToChildrenList(o) { | ||
| 192 | - if (childrenListMap[o[config.id]] !== null) { | ||
| 193 | - o[config.childrenList] = childrenListMap[o[config.id]]; | ||
| 194 | - } | ||
| 195 | - if (o[config.childrenList]) { | ||
| 196 | - for (let c of o[config.childrenList]) { | ||
| 197 | - adaptToChildrenList(c); | ||
| 198 | - } | 228 | + element.className = classString |
| 229 | +} | ||
| 230 | + | ||
| 231 | +/** | ||
| 232 | + * @param {string} type | ||
| 233 | + * @returns {Date} | ||
| 234 | + */ | ||
| 235 | +export function getTime(type) { | ||
| 236 | + if (type === 'start') { | ||
| 237 | + return new Date().getTime() - 3600 * 1000 * 24 * 90 | ||
| 238 | + } else { | ||
| 239 | + return new Date(new Date().toDateString()) | ||
| 240 | + } | ||
| 241 | +} | ||
| 242 | + | ||
| 243 | +/** | ||
| 244 | + * @param {Function} func | ||
| 245 | + * @param {number} wait | ||
| 246 | + * @param {boolean} immediate | ||
| 247 | + * @return {*} | ||
| 248 | + */ | ||
| 249 | +export function debounce(func, wait, immediate) { | ||
| 250 | + let timeout, args, context, timestamp, result | ||
| 251 | + | ||
| 252 | + const later = function() { | ||
| 253 | + // 据上一次触发时间间隔 | ||
| 254 | + const last = +new Date() - timestamp | ||
| 255 | + | ||
| 256 | + // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait | ||
| 257 | + if (last < wait && last > 0) { | ||
| 258 | + timeout = setTimeout(later, wait - last) | ||
| 259 | + } else { | ||
| 260 | + timeout = null | ||
| 261 | + // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 | ||
| 262 | + if (!immediate) { | ||
| 263 | + result = func.apply(context, args) | ||
| 264 | + if (!timeout) context = args = null | ||
| 199 | } | 265 | } |
| 200 | } | 266 | } |
| 201 | - return tree; | ||
| 202 | - } | ||
| 203 | - | ||
| 204 | - /** | ||
| 205 | - * 参数处理 | ||
| 206 | - * @param {*} params 参数 | ||
| 207 | - */ | ||
| 208 | - export function tansParams(params) { | ||
| 209 | - let result = '' | ||
| 210 | - for (const propName of Object.keys(params)) { | ||
| 211 | - const value = params[propName]; | ||
| 212 | - var part = encodeURIComponent(propName) + "="; | ||
| 213 | - if (value !== null && value !== "" && typeof (value) !== "undefined") { | ||
| 214 | - if (typeof value === 'object') { | ||
| 215 | - for (const key of Object.keys(value)) { | ||
| 216 | - if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') { | ||
| 217 | - let params = propName + '[' + key + ']'; | ||
| 218 | - var subPart = encodeURIComponent(params) + "="; | ||
| 219 | - result += subPart + encodeURIComponent(value[key]) + "&"; | ||
| 220 | - } | ||
| 221 | - } | ||
| 222 | - } else { | ||
| 223 | - result += part + encodeURIComponent(value) + "&"; | ||
| 224 | - } | ||
| 225 | - } | 267 | + } |
| 268 | + | ||
| 269 | + return function(...args) { | ||
| 270 | + context = this | ||
| 271 | + timestamp = +new Date() | ||
| 272 | + const callNow = immediate && !timeout | ||
| 273 | + // 如果延时不存在,重新设定延时 | ||
| 274 | + if (!timeout) timeout = setTimeout(later, wait) | ||
| 275 | + if (callNow) { | ||
| 276 | + result = func.apply(context, args) | ||
| 277 | + context = args = null | ||
| 226 | } | 278 | } |
| 279 | + | ||
| 227 | return result | 280 | return result |
| 228 | } | 281 | } |
| 229 | - | ||
| 230 | - // 验证是否为blob格式 | ||
| 231 | - export function blobValidate(data) { | ||
| 232 | - return data.type !== 'application/json' | 282 | +} |
| 283 | + | ||
| 284 | +/** | ||
| 285 | + * This is just a simple version of deep copy | ||
| 286 | + * Has a lot of edge cases bug | ||
| 287 | + * If you want to use a perfect deep copy, use lodash's _.cloneDeep | ||
| 288 | + * @param {Object} source | ||
| 289 | + * @returns {Object} | ||
| 290 | + */ | ||
| 291 | +export function deepClone(source) { | ||
| 292 | + if (!source && typeof source !== 'object') { | ||
| 293 | + throw new Error('error arguments', 'deepClone') | ||
| 294 | + } | ||
| 295 | + const targetObj = source.constructor === Array ? [] : {} | ||
| 296 | + Object.keys(source).forEach(keys => { | ||
| 297 | + if (source[keys] && typeof source[keys] === 'object') { | ||
| 298 | + targetObj[keys] = deepClone(source[keys]) | ||
| 299 | + } else { | ||
| 300 | + targetObj[keys] = source[keys] | ||
| 301 | + } | ||
| 302 | + }) | ||
| 303 | + return targetObj | ||
| 304 | +} | ||
| 305 | + | ||
| 306 | +/** | ||
| 307 | + * @param {Array} arr | ||
| 308 | + * @returns {Array} | ||
| 309 | + */ | ||
| 310 | +export function uniqueArr(arr) { | ||
| 311 | + return Array.from(new Set(arr)) | ||
| 312 | +} | ||
| 313 | + | ||
| 314 | +/** | ||
| 315 | + * @returns {string} | ||
| 316 | + */ | ||
| 317 | +export function createUniqueString() { | ||
| 318 | + const timestamp = +new Date() + '' | ||
| 319 | + const randomNum = parseInt((1 + Math.random()) * 65536) + '' | ||
| 320 | + return (+(randomNum + timestamp)).toString(32) | ||
| 321 | +} | ||
| 322 | + | ||
| 323 | +/** | ||
| 324 | + * Check if an element has a class | ||
| 325 | + * @param {HTMLElement} elm | ||
| 326 | + * @param {string} cls | ||
| 327 | + * @returns {boolean} | ||
| 328 | + */ | ||
| 329 | +export function hasClass(ele, cls) { | ||
| 330 | + return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) | ||
| 331 | +} | ||
| 332 | + | ||
| 333 | +/** | ||
| 334 | + * Add class to element | ||
| 335 | + * @param {HTMLElement} elm | ||
| 336 | + * @param {string} cls | ||
| 337 | + */ | ||
| 338 | +export function addClass(ele, cls) { | ||
| 339 | + if (!hasClass(ele, cls)) ele.className += ' ' + cls | ||
| 340 | +} | ||
| 341 | + | ||
| 342 | +/** | ||
| 343 | + * Remove class from element | ||
| 344 | + * @param {HTMLElement} elm | ||
| 345 | + * @param {string} cls | ||
| 346 | + */ | ||
| 347 | +export function removeClass(ele, cls) { | ||
| 348 | + if (hasClass(ele, cls)) { | ||
| 349 | + const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') | ||
| 350 | + ele.className = ele.className.replace(reg, ' ') | ||
| 233 | } | 351 | } |
| 234 | - | ||
| 235 | \ No newline at end of file | 352 | \ No newline at end of file |
| 353 | +} | ||
| 236 | \ No newline at end of file | 354 | \ No newline at end of file |
src/utils/request.js
| @@ -20,6 +20,7 @@ const service = axios.create({ | @@ -20,6 +20,7 @@ const service = axios.create({ | ||
| 20 | //拦截器(请求,响应) | 20 | //拦截器(请求,响应) |
| 21 | //请求 | 21 | //请求 |
| 22 | service.interceptors.request.use(config => { | 22 | service.interceptors.request.use(config => { |
| 23 | + if (config.url.indexOf('http') > -1) config.baseURL = '' | ||
| 23 | // 是否需要设置 token | 24 | // 是否需要设置 token |
| 24 | const isToken = (config.headers || {}).isToken === false | 25 | const isToken = (config.headers || {}).isToken === false |
| 25 | // 是否需要防止数据重复提交 | 26 | // 是否需要防止数据重复提交 |
| @@ -28,14 +29,16 @@ service.interceptors.request.use(config => { | @@ -28,14 +29,16 @@ service.interceptors.request.use(config => { | ||
| 28 | if (getToken() && !isToken) { | 29 | if (getToken() && !isToken) { |
| 29 | config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 | 30 | config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 |
| 30 | } | 31 | } |
| 31 | - // get请求映射params参数 | ||
| 32 | - if (config.method === 'get' && config.params) { | ||
| 33 | - let url = config.url + '?' + tansParams(config.params); | ||
| 34 | - url = url.slice(0, -1); | ||
| 35 | - config.params = {}; | ||
| 36 | - config.url = url; | 32 | + if (config.method == 'get') { |
| 33 | + config.params = config.data | ||
| 37 | } | 34 | } |
| 38 | - return config; | 35 | + // let timestamp = Date.parse(new Date()) / 1000 |
| 36 | + // if (config.url.indexOf('?') > -1) { | ||
| 37 | + // config.url += `&n=${timestamp}` | ||
| 38 | + // } else { | ||
| 39 | + // config.url += `?n=${timestamp}` | ||
| 40 | + // } | ||
| 41 | + return config | ||
| 39 | }) | 42 | }) |
| 40 | //响应 | 43 | //响应 |
| 41 | service.interceptors.response.use(res => { | 44 | service.interceptors.response.use(res => { |
src/views/DisposalSuggestions/Form.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog title="判研建议" :close-on-click-modal="false" :visible.sync="visible" class="NCC-dialog NCC-dialog_center" lock-scroll width="70%"> | ||
| 3 | + <el-row :gutter="15" class="" > | ||
| 4 | + <el-col :span="24" class="form_title"> | ||
| 5 | + 巡查上报详情 | ||
| 6 | + </el-col> | ||
| 7 | + <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :disabled="!!isDetail" :rules="rules" v-loading="loading"> | ||
| 8 | + <el-col :span="24" v-if="false" > | ||
| 9 | + <el-form-item label="主键" prop="id"> | ||
| 10 | + <el-input v-model="dataForm.id" placeholder="请输入" clearable :style='{"width":"100%"}' > | ||
| 11 | + </el-input> | ||
| 12 | + </el-form-item> | ||
| 13 | + </el-col> | ||
| 14 | + <el-col :span="24"> | ||
| 15 | + <el-form-item label="来源" prop="source"> | ||
| 16 | + <el-select v-model="dataForm.source" placeholder="请选择" clearable :style='{"width":"100%"}' > | ||
| 17 | + <el-option v-for="(item, index) in sourceOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option> | ||
| 18 | + </el-select> | ||
| 19 | + </el-form-item> | ||
| 20 | + </el-col> | ||
| 21 | + <el-col :span="24"> | ||
| 22 | + <el-form-item label="平台名称" prop="platformName"> | ||
| 23 | + <el-input v-model="dataForm.platformName" placeholder="请输入" clearable :style='{"width":"100%"}' > | ||
| 24 | + </el-input> | ||
| 25 | + </el-form-item> | ||
| 26 | + </el-col> | ||
| 27 | + <el-col :span="24"> | ||
| 28 | + <el-form-item label="平台类型" prop="platformType"> | ||
| 29 | + <el-select v-model="dataForm.platformType" placeholder="请选择" clearable :style='{"width":"100%"}' > | ||
| 30 | + <el-option v-for="(item, index) in platformTypeOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option> | ||
| 31 | + </el-select> | ||
| 32 | + </el-form-item> | ||
| 33 | + </el-col> | ||
| 34 | + <el-col :span="24"> | ||
| 35 | + <el-form-item label="部门" prop="department"> | ||
| 36 | + <dep-select v-model="dataForm.department" placeholder="请选择" clearable > | ||
| 37 | + </dep-select> | ||
| 38 | + </el-form-item> | ||
| 39 | + </el-col> | ||
| 40 | + <el-col :span="24"> | ||
| 41 | + <el-form-item label="问题类型" prop="questionType"> | ||
| 42 | + <el-radio-group v-model="dataForm.questionType" :style='{}' > | ||
| 43 | + <el-radio v-for="(item, index) in questionTypeOptions" :key="index" :label="item.id" >{{item.fullName}}</el-radio> | ||
| 44 | + </el-radio-group> | ||
| 45 | + </el-form-item> | ||
| 46 | + </el-col> | ||
| 47 | + <el-col :span="24"> | ||
| 48 | + <el-form-item label="问题分类" prop="questionClass"> | ||
| 49 | + <el-select v-model="dataForm.questionClass" placeholder="请选择" clearable :style='{"width":"100%"}' > | ||
| 50 | + <el-option v-for="(item, index) in questionClassOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option> | ||
| 51 | + </el-select> | ||
| 52 | + </el-form-item> | ||
| 53 | + </el-col> | ||
| 54 | + <el-col :span="24"> | ||
| 55 | + <el-form-item label="问题内容" prop="questionContent"> | ||
| 56 | + <el-input v-model="dataForm.questionContent" placeholder="请输入" show-word-limit :style='{"width":"100%"}' type='textarea' :autosize='{"minRows":4,"maxRows":4}' > | ||
| 57 | + </el-input> | ||
| 58 | + </el-form-item> | ||
| 59 | + </el-col> | ||
| 60 | + <el-col :span="24"> | ||
| 61 | + <el-form-item label="有害链接" prop="link"> | ||
| 62 | + <el-input v-model="dataForm.link" placeholder="请输入" clearable :style='{"width":"100%"}' > | ||
| 63 | + </el-input> | ||
| 64 | + </el-form-item> | ||
| 65 | + </el-col> | ||
| 66 | + <el-col :span="24"> | ||
| 67 | + <el-form-item label="取证内容" prop="obtainEvidence"> | ||
| 68 | + <NCC-UploadFz v-model="dataForm.obtainEvidence" :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" > | ||
| 69 | + </NCC-UploadFz> | ||
| 70 | + </el-form-item> | ||
| 71 | + </el-col> | ||
| 72 | + <el-col :span="24"> | ||
| 73 | + <el-form-item label="附件上传" prop="annex"> | ||
| 74 | + <NCC-UploadFz v-model="dataForm.annex" :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" > | ||
| 75 | + </NCC-UploadFz> | ||
| 76 | + </el-form-item> | ||
| 77 | + </el-col> | ||
| 78 | + <el-col :span="24"> | ||
| 79 | + <el-form-item label="处置建议" prop="disposalSuggestions"> | ||
| 80 | + <el-input v-model="dataForm.disposalSuggestions" placeholder="请输入" show-word-limit :style='{"width":"100%"}' type='textarea' :autosize='{"minRows":4,"maxRows":4}' > | ||
| 81 | + </el-input> | ||
| 82 | + </el-form-item> | ||
| 83 | + </el-col> | ||
| 84 | + <el-col :span="24"> | ||
| 85 | + <el-form-item label="阶段" prop="stage"> | ||
| 86 | + <el-select v-model="dataForm.stage" placeholder="请选择" clearable :style='{"width":"100%"}' > | ||
| 87 | + <el-option v-for="(item, index) in stageOptions" :key="index" :label="item.fullName" :value="item.id" ></el-option> | ||
| 88 | + </el-select> | ||
| 89 | + </el-form-item> | ||
| 90 | + </el-col> | ||
| 91 | + <el-col :span="24" v-if="false" > | ||
| 92 | + <el-form-item label="创建用户" prop="creatorUserId"> | ||
| 93 | + <el-input v-model="dataForm.creatorUserId" placeholder="系统自动生成" readonly > | ||
| 94 | + </el-input> | ||
| 95 | + </el-form-item> | ||
| 96 | + </el-col> | ||
| 97 | + <el-col :span="24" v-if="false" > | ||
| 98 | + <el-form-item label="创建时间" prop="creatorTime"> | ||
| 99 | + <el-input v-model="dataForm.creatorTime" placeholder="系统自动生成" readonly > | ||
| 100 | + </el-input> | ||
| 101 | + </el-form-item> | ||
| 102 | + </el-col> | ||
| 103 | + <el-col :span="24" v-if="false" > | ||
| 104 | + <el-form-item label="修改用户" prop="lastModifyUserId"> | ||
| 105 | + <el-input v-model="dataForm.lastModifyUserId" placeholder="系统自动生成" readonly > | ||
| 106 | + </el-input> | ||
| 107 | + </el-form-item> | ||
| 108 | + </el-col> | ||
| 109 | + <el-col :span="24" v-if="false" > | ||
| 110 | + <el-form-item label="修改时间" prop="lastModifyTime"> | ||
| 111 | + <el-input v-model="dataForm.lastModifyTime" placeholder="系统自动生成" readonly > | ||
| 112 | + </el-input> | ||
| 113 | + </el-form-item> | ||
| 114 | + </el-col> | ||
| 115 | + </el-form> | ||
| 116 | + <el-col :span="24" class="form_title"> | ||
| 117 | + 判研建议 | ||
| 118 | + </el-col> | ||
| 119 | + <el-form ref="suggestionForm" :model="suggestionForm" size="small" label-width="100px" label-position="right"> | ||
| 120 | + <el-col :span="24"> | ||
| 121 | + <el-form-item label="处置建议" prop="disposalSuggestions"> | ||
| 122 | + <el-input v-model="suggestionForm.disposalSuggestions" placeholder="请输入处置建议" show-word-limit :style='{"width":"100%"}' type='textarea' :autosize='{"minRows":4,"maxRows":4}' > | ||
| 123 | + </el-input> | ||
| 124 | + </el-form-item> | ||
| 125 | + </el-col> | ||
| 126 | + <el-col :span="24"> | ||
| 127 | + <el-form-item label="判断意见" prop="judgmentOpinions"> | ||
| 128 | + <el-input v-model="suggestionForm.judgmentOpinions" placeholder="请输入判断意见" show-word-limit :style='{"width":"100%"}' type='textarea' :autosize='{"minRows":4,"maxRows":4}' > | ||
| 129 | + </el-input> | ||
| 130 | + </el-form-item> | ||
| 131 | + </el-col> | ||
| 132 | + <el-col :span="24"> | ||
| 133 | + <el-form-item label="判断分类" prop="judgmentClass"> | ||
| 134 | + <el-input v-model="suggestionForm.judgmentClass" placeholder="请输入判断分类" show-word-limit :style='{"width":"100%"}' type='textarea' :autosize='{"minRows":4,"maxRows":4}' > | ||
| 135 | + </el-input> | ||
| 136 | + </el-form-item> | ||
| 137 | + </el-col> | ||
| 138 | + </el-form> | ||
| 139 | + </el-row> | ||
| 140 | + <span slot="footer" class="dialog-footer"> | ||
| 141 | + <el-button @click="visible = false">取 消</el-button> | ||
| 142 | + <el-button type="primary" @click="dataFormSubmit()">确 定</el-button> | ||
| 143 | + </span> | ||
| 144 | + </el-dialog> | ||
| 145 | +</template> | ||
| 146 | +<script> | ||
| 147 | + import request from '@/utils/request' | ||
| 148 | + import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | ||
| 149 | + import { getDetail, disposalSuggestions } from '@/api/systemData/dataInterface' | ||
| 150 | + export default { | ||
| 151 | + components: {}, | ||
| 152 | + props: [], | ||
| 153 | + data() { | ||
| 154 | + return { | ||
| 155 | + loading: true, | ||
| 156 | + visible: false, | ||
| 157 | + isDetail: true, | ||
| 158 | + dataForm: { | ||
| 159 | + id:'', | ||
| 160 | + id:undefined, | ||
| 161 | + source:undefined, | ||
| 162 | + platformName:undefined, | ||
| 163 | + platformType:undefined, | ||
| 164 | + department:undefined, | ||
| 165 | + questionType:undefined, | ||
| 166 | + questionClass:undefined, | ||
| 167 | + questionContent:undefined, | ||
| 168 | + link:undefined, | ||
| 169 | + obtainEvidence:[], | ||
| 170 | + annex:[], | ||
| 171 | + disposalSuggestions:undefined, | ||
| 172 | + stage:undefined, | ||
| 173 | + creatorUserId:undefined, | ||
| 174 | + creatorTime:undefined, | ||
| 175 | + lastModifyUserId:undefined, | ||
| 176 | + lastModifyTime:undefined, | ||
| 177 | + }, | ||
| 178 | + rules: { | ||
| 179 | + }, | ||
| 180 | + sourceOptions:[{"fullName":"市网信办线索","id":"市网信办线索"},{"fullName":"自主巡查发现","id":"自主巡查发现"}], | ||
| 181 | + platformTypeOptions : [], | ||
| 182 | + questionTypeOptions : [], | ||
| 183 | + questionClassOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}], | ||
| 184 | + stageOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}], | ||
| 185 | + | ||
| 186 | + suggestionForm: { | ||
| 187 | + disposalSuggestions: "", //处置建议 | ||
| 188 | + judgmentOpinions: "", //判断意见 | ||
| 189 | + judgmentClass: "" //判断分类 | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + }, | ||
| 193 | + computed: {}, | ||
| 194 | + watch: {}, | ||
| 195 | + created() { | ||
| 196 | + this.getplatformTypeOptions(); | ||
| 197 | + this.getquestionTypeOptions(); | ||
| 198 | + }, | ||
| 199 | + mounted() { | ||
| 200 | + }, | ||
| 201 | + methods: { | ||
| 202 | + getplatformTypeOptions(){ | ||
| 203 | + getDictionaryDataSelector('576279943168656645').then(res => { | ||
| 204 | + this.platformTypeOptions = res.data.list | ||
| 205 | + }); | ||
| 206 | + }, | ||
| 207 | + getquestionTypeOptions(){ | ||
| 208 | + getDictionaryDataSelector('577006814432855301').then(res => { | ||
| 209 | + this.questionTypeOptions = res.data.list | ||
| 210 | + }); | ||
| 211 | + }, | ||
| 212 | + goBack() { | ||
| 213 | + this.$emit('refresh') | ||
| 214 | + }, | ||
| 215 | + init(id, isDetail) { | ||
| 216 | + this.dataForm.id = id || 0; | ||
| 217 | + this.visible = true; | ||
| 218 | + this.$nextTick(async () => { | ||
| 219 | + this.$refs['elForm'].resetFields(); | ||
| 220 | + this.$refs['suggestionForm'].resetFields(); | ||
| 221 | + if (this.dataForm.id) { | ||
| 222 | + let res = await getDetail(this.dataForm.id) | ||
| 223 | + this.dataForm = res.data; | ||
| 224 | + this.loading = false; | ||
| 225 | + if(!this.dataForm.obtainEvidence)this.dataForm.obtainEvidence=[]; | ||
| 226 | + if(!this.dataForm.annex)this.dataForm.annex=[]; | ||
| 227 | + } | ||
| 228 | + }) | ||
| 229 | + }, | ||
| 230 | + dataFormSubmit() { | ||
| 231 | + if(!this.suggestionForm.disposalSuggestions && !this.suggestionForm.judgmentOpinions && !this.suggestionForm.judgmentClass) { | ||
| 232 | + this.$message({ | ||
| 233 | + message: '判研建议不能为空!', | ||
| 234 | + type: 'danger', | ||
| 235 | + }) | ||
| 236 | + } | ||
| 237 | + this.$refs['suggestionForm'].validate(async (valid) => { | ||
| 238 | + if (valid) { | ||
| 239 | + let res = await disposalSuggestions(this.dataForm); | ||
| 240 | + this.$message({ | ||
| 241 | + message: res.msg, | ||
| 242 | + type: 'success', | ||
| 243 | + duration: 1000, | ||
| 244 | + onClose: () => { | ||
| 245 | + this.visible = false, this.$emit('refresh', true) | ||
| 246 | + } | ||
| 247 | + }) | ||
| 248 | + } | ||
| 249 | + }) | ||
| 250 | + }, | ||
| 251 | + } | ||
| 252 | + } | ||
| 253 | +</script> | ||
| 254 | +<style lang="scss" scoped> | ||
| 255 | + .form_title { | ||
| 256 | + line-height: 30px; | ||
| 257 | + padding-left: 40px; | ||
| 258 | + color: #409eff; | ||
| 259 | + } | ||
| 260 | +</style> |
src/views/DisposalSuggestions/index.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="SystemInfo item-box common-info-box"> | ||
| 3 | + <div class="item-title">上报线索研判</div> | ||
| 4 | + <div class="item-body"> | ||
| 5 | + <div class="NCC-common-layout"> | ||
| 6 | + <div class="NCC-common-layout-center"> | ||
| 7 | + <el-row class="NCC-common-search-box" :gutter="16"> | ||
| 8 | + <el-form @submit.native.prevent size="mini"> | ||
| 9 | + <el-col :span="4"> | ||
| 10 | + <el-form-item label=""> | ||
| 11 | + <el-input v-model="query.platformName" placeholder="请输入平台名称" clearable /> | ||
| 12 | + </el-form-item> | ||
| 13 | + </el-col> | ||
| 14 | + <el-col :span="4"> | ||
| 15 | + <el-form-item label=""> | ||
| 16 | + <el-select v-model="query.platformType" placeholder="请选择平台类型" clearable > | ||
| 17 | + <el-option v-for="(item, index) in platformTypeOptions" :key="index" :label="item.fullName" :value="item.id" /> | ||
| 18 | + </el-select> | ||
| 19 | + </el-form-item> | ||
| 20 | + </el-col> | ||
| 21 | + <el-col :span="4"> | ||
| 22 | + <el-form-item label=""> | ||
| 23 | + <depSelect v-model="query.department" placeholder="请选择部门" /> | ||
| 24 | + </el-form-item> | ||
| 25 | + </el-col> | ||
| 26 | + <el-col :span="4"> | ||
| 27 | + <el-form-item label=""> | ||
| 28 | + <el-select v-model="query.questionType" placeholder="请选择问题类型" > | ||
| 29 | + <el-option v-for="(item, index) in questionTypeOptions" :key="index" :label="item.fullName" :value="item.id" /> | ||
| 30 | + </el-select> | ||
| 31 | + </el-form-item> | ||
| 32 | + </el-col> | ||
| 33 | + <el-col :span="4"> | ||
| 34 | + <el-form-item label=""> | ||
| 35 | + <el-select v-model="query.questionClass" placeholder="请选择问题分类" clearable > | ||
| 36 | + <el-option v-for="(item, index) in questionClassOptions" :key="index" :label="item.fullName" :value="item.id" /> | ||
| 37 | + </el-select> | ||
| 38 | + </el-form-item> | ||
| 39 | + </el-col> | ||
| 40 | + <el-col :span="4"> | ||
| 41 | + <el-form-item> | ||
| 42 | + <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | ||
| 43 | + </el-form-item> | ||
| 44 | + </el-col> | ||
| 45 | + </el-form> | ||
| 46 | + </el-row> | ||
| 47 | + <div class="NCC-common-layout-main NCC-flex-main"> | ||
| 48 | + <NCC-table v-loading="listLoading" :data="list"> | ||
| 49 | + <el-table-column show-overflow-tooltip prop="platformName" label="平台名称" align="left" /> | ||
| 50 | + <el-table-column show-overflow-tooltip label="平台类型" prop="platformType" align="left"> | ||
| 51 | + <template slot-scope="scope">{{ scope.row.platformType | dynamicText(platformTypeOptions) }}</template> | ||
| 52 | + </el-table-column> | ||
| 53 | + <el-table-column show-overflow-tooltip label="问题类型" prop="questionType" align="left"> | ||
| 54 | + <template slot-scope="scope">{{ scope.row.questionType | dynamicText(questionTypeOptions) }}</template> | ||
| 55 | + </el-table-column> | ||
| 56 | + <el-table-column show-overflow-tooltip prop="link" label="有害链接" align="left" /> | ||
| 57 | + <el-table-column show-overflow-tooltip prop="disposalSuggestions" label="处置建议" align="left" /> | ||
| 58 | + <el-table-column show-overflow-tooltip prop="id" label="主键" align="left" /> | ||
| 59 | + <el-table-column show-overflow-tooltip prop="department" label="部门" align="left" /> | ||
| 60 | + <el-table-column show-overflow-tooltip label="问题分类" prop="questionClass" align="left"> | ||
| 61 | + <template slot-scope="scope">{{ scope.row.questionClass | dynamicText(questionClassOptions) }}</template> | ||
| 62 | + </el-table-column> | ||
| 63 | + <el-table-column show-overflow-tooltip label="阶段" prop="stage" align="left"> | ||
| 64 | + <template slot-scope="scope">{{ scope.row.stage | dynamicText(stageOptions) }}</template> | ||
| 65 | + </el-table-column> | ||
| 66 | + <el-table-column label="操作" fixed="right" width="100"> | ||
| 67 | + <template slot-scope="scope"> | ||
| 68 | + <el-button type="text" @click="addOrUpdateHandle(scope.row.id)" >判研</el-button> | ||
| 69 | + </template> | ||
| 70 | + </el-table-column> | ||
| 71 | + </NCC-table> | ||
| 72 | + <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" /> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + <NCC-Form v-if="formVisible" ref="NCCForm" @refresh="refresh" /> | ||
| 76 | + </div> | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + | ||
| 80 | +</template> | ||
| 81 | +<script> | ||
| 82 | + import request from '@/utils/request' | ||
| 83 | + import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | ||
| 84 | + import NCCForm from './Form' | ||
| 85 | + import { getListForJudge, previewDataInterface } from '@/api/systemData/dataInterface' | ||
| 86 | + export default { | ||
| 87 | + components: { NCCForm }, | ||
| 88 | + data() { | ||
| 89 | + return { | ||
| 90 | + showAll: false, | ||
| 91 | + query: { | ||
| 92 | + platformName:undefined, | ||
| 93 | + platformType:undefined, | ||
| 94 | + department:undefined, | ||
| 95 | + questionType:undefined, | ||
| 96 | + questionClass:undefined, | ||
| 97 | + }, | ||
| 98 | + list: [], | ||
| 99 | + listLoading: true, | ||
| 100 | + multipleSelection: [], total: 0, | ||
| 101 | + listQuery: { | ||
| 102 | + currentPage: 1, | ||
| 103 | + pageSize: 20, | ||
| 104 | + sort: "desc", | ||
| 105 | + sidx: "", | ||
| 106 | + }, | ||
| 107 | + formVisible: false, | ||
| 108 | + exportBoxVisible: false, | ||
| 109 | + columnList: [ | ||
| 110 | + { prop: 'platformName', label: '平台名称' }, | ||
| 111 | + { prop: 'platformType', label: '平台类型' }, | ||
| 112 | + { prop: 'questionType', label: '问题类型' }, | ||
| 113 | + { prop: 'link', label: '有害链接' }, | ||
| 114 | + { prop: 'disposalSuggestions', label: '处置建议' }, | ||
| 115 | + { prop: 'id', label: '主键' }, | ||
| 116 | + { prop: 'department', label: '部门' }, | ||
| 117 | + { prop: 'questionClass', label: '问题分类' }, | ||
| 118 | + { prop: 'stage', label: '阶段' }, | ||
| 119 | + ], | ||
| 120 | + sourceOptions:[{"fullName":"市网信办线索","id":"市网信办线索"},{"fullName":"自主巡查发现","id":"自主巡查发现"}], | ||
| 121 | + platformTypeOptions : [], | ||
| 122 | + questionTypeOptions : [], | ||
| 123 | + questionClassOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}], | ||
| 124 | + stageOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}], | ||
| 125 | + } | ||
| 126 | + }, | ||
| 127 | + computed: {}, | ||
| 128 | + created() { | ||
| 129 | + this.initData() | ||
| 130 | + this.getplatformTypeOptions(); | ||
| 131 | + this.getquestionTypeOptions(); | ||
| 132 | + }, | ||
| 133 | + methods: { | ||
| 134 | + getplatformTypeOptions(){ | ||
| 135 | + getDictionaryDataSelector('576279943168656645').then(res => { | ||
| 136 | + this.platformTypeOptions = res.data.list | ||
| 137 | + }); | ||
| 138 | + }, | ||
| 139 | + getquestionTypeOptions(){ | ||
| 140 | + getDictionaryDataSelector('577006814432855301').then(res => { | ||
| 141 | + this.questionTypeOptions = res.data.list | ||
| 142 | + }); | ||
| 143 | + }, | ||
| 144 | + initData() { | ||
| 145 | + this.listLoading = true; | ||
| 146 | + let _query = { | ||
| 147 | + ...this.listQuery, | ||
| 148 | + ...this.query | ||
| 149 | + }; | ||
| 150 | + let query = {} | ||
| 151 | + for (let key in _query) { | ||
| 152 | + if (Array.isArray(_query[key])) { | ||
| 153 | + query[key] = _query[key].join() | ||
| 154 | + } else { | ||
| 155 | + query[key] = _query[key] | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + getListForJudge(query).then(res => { | ||
| 159 | + this.list = res.data.list | ||
| 160 | + this.total = res.data.pagination.total | ||
| 161 | + this.listLoading = false | ||
| 162 | + }) | ||
| 163 | + }, | ||
| 164 | + | ||
| 165 | + addOrUpdateHandle(id, isDetail) { | ||
| 166 | + this.formVisible = true | ||
| 167 | + this.$nextTick(() => { | ||
| 168 | + this.$refs.NCCForm.init(id, isDetail) | ||
| 169 | + }) | ||
| 170 | + }, | ||
| 171 | + search() { | ||
| 172 | + this.listQuery = { | ||
| 173 | + currentPage: 1, | ||
| 174 | + pageSize: 20, | ||
| 175 | + sort: "desc", | ||
| 176 | + sidx: "", | ||
| 177 | + } | ||
| 178 | + this.initData() | ||
| 179 | + }, | ||
| 180 | + refresh(isrRefresh) { | ||
| 181 | + this.formVisible = false | ||
| 182 | + if (isrRefresh) this.reset() | ||
| 183 | + }, | ||
| 184 | + reset() { | ||
| 185 | + for (let key in this.query) { | ||
| 186 | + this.query[key] = undefined | ||
| 187 | + } | ||
| 188 | + this.listQuery = { | ||
| 189 | + currentPage: 1, | ||
| 190 | + pageSize: 20, | ||
| 191 | + sort: "desc", | ||
| 192 | + sidx: "", | ||
| 193 | + } | ||
| 194 | + this.initData() | ||
| 195 | + } | ||
| 196 | + } | ||
| 197 | + } | ||
| 198 | +</script> | ||
| 199 | +<style scoped lang="scss"> | ||
| 200 | +.common-info-box { | ||
| 201 | + :deep(.el-table__body-wrapper.is-scrolling-none) { | ||
| 202 | + height: calc(100% - 47px); | ||
| 203 | + overflow-y: scroll; | ||
| 204 | + } | ||
| 205 | + .item-body { | ||
| 206 | + height: calc(100% - 35px); | ||
| 207 | + } | ||
| 208 | +} | ||
| 209 | +</style> | ||
| 0 | \ No newline at end of file | 210 | \ No newline at end of file |
src/views/baseInspectionReport/Form.vue
| @@ -120,7 +120,7 @@ | @@ -120,7 +120,7 @@ | ||
| 120 | <script> | 120 | <script> |
| 121 | import request from '@/utils/request' | 121 | import request from '@/utils/request' |
| 122 | import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | 122 | import { getDictionaryDataSelector } from '@/api/systemData/dictionary' |
| 123 | - import { previewDataInterface } from '@/api/systemData/dataInterface' | 123 | + import { getDetail, addForm, updataForm } from '@/api/systemData/dataInterface' |
| 124 | export default { | 124 | export default { |
| 125 | components: {}, | 125 | components: {}, |
| 126 | props: [], | 126 | props: [], |
| @@ -184,56 +184,28 @@ | @@ -184,56 +184,28 @@ | ||
| 184 | this.dataForm.id = id || 0; | 184 | this.dataForm.id = id || 0; |
| 185 | this.visible = true; | 185 | this.visible = true; |
| 186 | this.isDetail = isDetail || false; | 186 | this.isDetail = isDetail || false; |
| 187 | - this.$nextTick(() => { | 187 | + this.$nextTick(async () => { |
| 188 | this.$refs['elForm'].resetFields(); | 188 | this.$refs['elForm'].resetFields(); |
| 189 | if (this.dataForm.id) { | 189 | if (this.dataForm.id) { |
| 190 | - request({ | ||
| 191 | - url: '/Extend/BaseInspectionReport/' + this.dataForm.id, | ||
| 192 | - method: 'get' | ||
| 193 | - }).then(res =>{ | ||
| 194 | - this.dataForm = res.data; | ||
| 195 | - if(!this.dataForm.obtainEvidence)this.dataForm.obtainEvidence=[]; | ||
| 196 | - if(!this.dataForm.annex)this.dataForm.annex=[]; | ||
| 197 | - }) | 190 | + let res = await getDetail(this.dataForm.id) |
| 191 | + this.dataForm = res.data; | ||
| 192 | + if(!this.dataForm.obtainEvidence)this.dataForm.obtainEvidence=[]; | ||
| 193 | + if(!this.dataForm.annex)this.dataForm.annex=[]; | ||
| 198 | } | 194 | } |
| 199 | }) | 195 | }) |
| 200 | }, | 196 | }, |
| 201 | dataFormSubmit() { | 197 | dataFormSubmit() { |
| 202 | - this.$refs['elForm'].validate((valid) => { | 198 | + this.$refs['elForm'].validate(async (valid) => { |
| 203 | if (valid) { | 199 | if (valid) { |
| 204 | - if (!this.dataForm.id) { | ||
| 205 | - request({ | ||
| 206 | - url: `/Extend/BaseInspectionReport`, | ||
| 207 | - method: 'post', | ||
| 208 | - data: this.dataForm, | ||
| 209 | - }).then((res) => { | ||
| 210 | - this.$message({ | ||
| 211 | - message: res.msg, | ||
| 212 | - type: 'success', | ||
| 213 | - duration: 1000, | ||
| 214 | - onClose: () => { | ||
| 215 | - this.visible = false, | ||
| 216 | - this.$emit('refresh', true) | ||
| 217 | - } | ||
| 218 | - }) | ||
| 219 | - }) | ||
| 220 | - } else { | ||
| 221 | - request({ | ||
| 222 | - url: '/Extend/BaseInspectionReport/' + this.dataForm.id, | ||
| 223 | - method: 'PUT', | ||
| 224 | - data: this.dataForm | ||
| 225 | - }).then((res) => { | ||
| 226 | - this.$message({ | ||
| 227 | - message: res.msg, | ||
| 228 | - type: 'success', | ||
| 229 | - duration: 1000, | ||
| 230 | - onClose: () => { | ||
| 231 | - this.visible = false | ||
| 232 | - this.$emit('refresh', true) | ||
| 233 | - } | ||
| 234 | - }) | ||
| 235 | - }) | ||
| 236 | - } | 200 | + let res = !this.dataForm.id ? await addForm(this.dataForm) : await updataForm(this.dataForm); |
| 201 | + this.$message({ | ||
| 202 | + message: res.msg, | ||
| 203 | + type: 'success', | ||
| 204 | + duration: 1000, | ||
| 205 | + onClose: () => { | ||
| 206 | + this.visible = false, this.$emit('refresh', true) | ||
| 207 | + } | ||
| 208 | + }) | ||
| 237 | } | 209 | } |
| 238 | }) | 210 | }) |
| 239 | }, | 211 | }, |
src/views/baseInspectionReport/index.vue
| @@ -8,12 +8,12 @@ | @@ -8,12 +8,12 @@ | ||
| 8 | <el-form @submit.native.prevent size="mini"> | 8 | <el-form @submit.native.prevent size="mini"> |
| 9 | <el-col :span="4"> | 9 | <el-col :span="4"> |
| 10 | <el-form-item label=""> | 10 | <el-form-item label=""> |
| 11 | - <el-input v-model="query.platformName" placeholder="平台名称" clearable /> | 11 | + <el-input v-model="query.platformName" placeholder="请输入平台名称" clearable /> |
| 12 | </el-form-item> | 12 | </el-form-item> |
| 13 | </el-col> | 13 | </el-col> |
| 14 | <el-col :span="4"> | 14 | <el-col :span="4"> |
| 15 | <el-form-item label=""> | 15 | <el-form-item label=""> |
| 16 | - <el-select v-model="query.platformType" placeholder="平台类型" clearable > | 16 | + <el-select v-model="query.platformType" placeholder="请选择平台类型" clearable > |
| 17 | <el-option v-for="(item, index) in platformTypeOptions" :key="index" :label="item.fullName" :value="item.id" /> | 17 | <el-option v-for="(item, index) in platformTypeOptions" :key="index" :label="item.fullName" :value="item.id" /> |
| 18 | </el-select> | 18 | </el-select> |
| 19 | </el-form-item> | 19 | </el-form-item> |
| @@ -25,14 +25,14 @@ | @@ -25,14 +25,14 @@ | ||
| 25 | </el-col> | 25 | </el-col> |
| 26 | <el-col :span="4"> | 26 | <el-col :span="4"> |
| 27 | <el-form-item label=""> | 27 | <el-form-item label=""> |
| 28 | - <el-select v-model="query.questionType" placeholder="问题类型" > | 28 | + <el-select v-model="query.questionType" placeholder="请选择问题类型" > |
| 29 | <el-option v-for="(item, index) in questionTypeOptions" :key="index" :label="item.fullName" :value="item.id" /> | 29 | <el-option v-for="(item, index) in questionTypeOptions" :key="index" :label="item.fullName" :value="item.id" /> |
| 30 | </el-select> | 30 | </el-select> |
| 31 | </el-form-item> | 31 | </el-form-item> |
| 32 | </el-col> | 32 | </el-col> |
| 33 | <el-col :span="4"> | 33 | <el-col :span="4"> |
| 34 | <el-form-item label=""> | 34 | <el-form-item label=""> |
| 35 | - <el-select v-model="query.questionClass" placeholder="问题分类" clearable > | 35 | + <el-select v-model="query.questionClass" placeholder="请选择问题分类" clearable > |
| 36 | <el-option v-for="(item, index) in questionClassOptions" :key="index" :label="item.fullName" :value="item.id" /> | 36 | <el-option v-for="(item, index) in questionClassOptions" :key="index" :label="item.fullName" :value="item.id" /> |
| 37 | </el-select> | 37 | </el-select> |
| 38 | </el-form-item> | 38 | </el-form-item> |
| @@ -135,8 +135,8 @@ | @@ -135,8 +135,8 @@ | ||
| 135 | computed: {}, | 135 | computed: {}, |
| 136 | created() { | 136 | created() { |
| 137 | this.initData() | 137 | this.initData() |
| 138 | - // this.getplatformTypeOptions(); | ||
| 139 | - // this.getquestionTypeOptions(); | 138 | + this.getplatformTypeOptions(); |
| 139 | + this.getquestionTypeOptions(); | ||
| 140 | }, | 140 | }, |
| 141 | methods: { | 141 | methods: { |
| 142 | getplatformTypeOptions(){ | 142 | getplatformTypeOptions(){ |
| @@ -164,8 +164,10 @@ | @@ -164,8 +164,10 @@ | ||
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | getList(query).then(res => { | 166 | getList(query).then(res => { |
| 167 | - this.list = res.data.list | ||
| 168 | - this.total = res.data.pagination.total | 167 | + if(res.data) { |
| 168 | + this.list = res.data.list | ||
| 169 | + this.total = res.data.pagination.total | ||
| 170 | + } | ||
| 169 | this.listLoading = false | 171 | this.listLoading = false |
| 170 | }) | 172 | }) |
| 171 | }, | 173 | }, |
src/views/extend/zyOaProfit/Form.vue
src/views/extend/zyOaWfFinrmbt/ExportBox.vue
| @@ -60,7 +60,7 @@ export default { | @@ -60,7 +60,7 @@ export default { | ||
| 60 | } | 60 | } |
| 61 | </script> | 61 | </script> |
| 62 | <style lang="scss" scoped> | 62 | <style lang="scss" scoped> |
| 63 | ->>> .el-dialog__body { | 63 | +.el-dialog__body { |
| 64 | padding: 20px !important; | 64 | padding: 20px !important; |
| 65 | } | 65 | } |
| 66 | </style> | 66 | </style> |
| 67 | \ No newline at end of file | 67 | \ No newline at end of file |
src/views/homePage/components/news/NewsDialog.vue
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | class="list" | 11 | class="list" |
| 12 | v-infinite-scroll="load" | 12 | v-infinite-scroll="load" |
| 13 | infinite-scroll-disabled="disabled" | 13 | infinite-scroll-disabled="disabled" |
| 14 | + infinite-scroll-immediate | ||
| 14 | > | 15 | > |
| 15 | <li class="list-item" v-for="i in count" :key="i"> | 16 | <li class="list-item" v-for="i in count" :key="i"> |
| 16 | <div class="item-title"> | 17 | <div class="item-title"> |
| @@ -30,12 +31,14 @@ | @@ -30,12 +31,14 @@ | ||
| 30 | </template> | 31 | </template> |
| 31 | 32 | ||
| 32 | <script> | 33 | <script> |
| 34 | +import {getMessageList} from "@/api/system/message"; | ||
| 33 | export default { | 35 | export default { |
| 34 | name: "NewsDialog", | 36 | name: "NewsDialog", |
| 35 | data() { | 37 | data() { |
| 36 | return { | 38 | return { |
| 37 | count: 10, | 39 | count: 10, |
| 38 | loading: false, | 40 | loading: false, |
| 41 | + messageList: [], | ||
| 39 | }; | 42 | }; |
| 40 | }, | 43 | }, |
| 41 | computed: { | 44 | computed: { |
| @@ -46,11 +49,17 @@ export default { | @@ -46,11 +49,17 @@ export default { | ||
| 46 | return this.loading || this.noMore; | 49 | return this.loading || this.noMore; |
| 47 | }, | 50 | }, |
| 48 | }, | 51 | }, |
| 52 | + created() { | ||
| 53 | + this.load(); | ||
| 54 | + }, | ||
| 49 | mounted() {}, | 55 | mounted() {}, |
| 50 | methods: { | 56 | methods: { |
| 51 | load() { | 57 | load() { |
| 52 | console.log(11); | 58 | console.log(11); |
| 53 | this.loading = true; | 59 | this.loading = true; |
| 60 | + getMessageList({ pageIndex: 1, pageSize: 10 }).then((res) => { | ||
| 61 | + console.log(res); | ||
| 62 | + }); | ||
| 54 | setTimeout(() => { | 63 | setTimeout(() => { |
| 55 | this.count += 2; | 64 | this.count += 2; |
| 56 | this.loading = false; | 65 | this.loading = false; |
src/views/homePage/components/news/index.vue