diff --git a/src/assets/images/1.png b/src/assets/images/1.png new file mode 100644 index 00000000..72818b50 Binary files /dev/null and b/src/assets/images/1.png differ diff --git a/src/assets/images/2.png b/src/assets/images/2.png new file mode 100644 index 00000000..ac090dcb Binary files /dev/null and b/src/assets/images/2.png differ diff --git a/src/assets/images/3.png b/src/assets/images/3.png new file mode 100644 index 00000000..d1043ecd Binary files /dev/null and b/src/assets/images/3.png differ diff --git a/src/components/HeaderMessage/index.vue b/src/components/HeaderMessage/index.vue index 552853ce..39c7e5e5 100644 --- a/src/components/HeaderMessage/index.vue +++ b/src/components/HeaderMessage/index.vue @@ -10,14 +10,14 @@ > - + 待整改 ({{ 11 }}) - + 待验收 ({{ 22 }}) @@ -83,6 +83,12 @@ export default { mounted() { }, methods: { + jumpReform() { + this.$router.push({ path: '/hidden_danger/hidden_reform', query: { isBacklog: true }}) + }, + jumpReview() { + this.$router.push({ path: '/hidden_danger/hidden_review', query: { isBacklog: true }}) + } } } diff --git a/src/components/selDept/index.vue b/src/components/selDept/index.vue index 739d7c11..ffd6ac8c 100644 --- a/src/components/selDept/index.vue +++ b/src/components/selDept/index.vue @@ -1,364 +1,367 @@ - - - - + + + + diff --git a/src/components/show_images/api/index.js b/src/components/show_images/api/index.js new file mode 100644 index 00000000..f189942b --- /dev/null +++ b/src/components/show_images/api/index.js @@ -0,0 +1,40 @@ +import request from '@/utils/request' +import store from '@/store/modules/user' + +var roles = store.state.roles.replace(/;/g, '') + +export default { + getDate(pageSize, pageNo, data_id, table_name) { + return request({ + url: `/commonAction.do?eventcode=query_data&funid=queryevent&pagetype=editgrid&query_funid=sys_attach&user_id=${roles}`, + method: 'post', + data: `start=${pageNo}&limit=${pageSize}&where_sql=sys_attach.data_id = ? and sys_attach.table_name = ?&where_type=string;string&where_value=${data_id};${table_name}` + }).then(response => response.data) + }, + Delete(ids) { + let keys = '' + ids.forEach(d => { + keys += 'keyid=' + d + '&' + }) + return request({ + url: `/commonAction.do`, + method: 'post', + data: `funid=sys_attach&${keys}pagetype=editgrid&eventcode=delete&user_id=${roles}&dataType=json` + }).then(response => response.data) + }, + getFormDate(id) { + return request({ + url: `/commonAction.do?eventcode=query_data&funid=queryevent&pagetype=grid&query_funid=safe_insp&user_id=${roles}`, + method: 'post', + data: `start=0&limit=10&where_sql=safe_insp.safe_insp_id = ?&where_value=${id}&where_type=string&is_query=1&query_type=0` + }).then(response => response.data) + }, + downLoad(keys) { + const timestamp = new Date().getTime() + return request({ + url: `fileAction.do?funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=${timestamp}`, + method: 'get' + // data: `funid=sys_attach&keyid=${keys}&pagetype=editgrid&eventcode=down&user_id=${roles}&dataType=byte&_dc=${timestamp}` + }) + } +} diff --git a/src/components/show_images/index.vue b/src/components/show_images/index.vue new file mode 100644 index 00000000..a3e6df0e --- /dev/null +++ b/src/components/show_images/index.vue @@ -0,0 +1,262 @@ + + + + diff --git a/src/store/getters.js b/src/store/getters.js index 8fcf5a59..52928b23 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -1,15 +1,19 @@ -const getters = { - sidebar: state => state.app.sidebar, - size: state => state.app.size, - device: state => state.app.device, - visitedViews: state => state.tagsView.visitedViews, - cachedViews: state => state.tagsView.cachedViews, - token: state => state.user.token, - avatar: state => state.user.avatar, - name: state => state.user.name, - introduction: state => state.user.introduction, - roles: state => state.user.roles, - permission_routes: state => state.permission.routes, - errorLogs: state => state.errorLog.logs -} -export default getters +const getters = { + sidebar: state => state.app.sidebar, + size: state => state.app.size, + device: state => state.app.device, + visitedViews: state => state.tagsView.visitedViews, + cachedViews: state => state.tagsView.cachedViews, + token: state => state.user.token, + userName: state => state.user.userName, + userId: state => state.user.userId, + deptName: state => state.user.deptName, + deptId: state => state.user.deptId, + avatar: state => state.user.avatar, + name: state => state.user.name, + introduction: state => state.user.introduction, + roles: state => state.user.roles, + permission_routes: state => state.permission.routes, + errorLogs: state => state.errorLog.logs +} +export default getters diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c7aef027..81131d0a 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -8,7 +8,11 @@ const state = { name: '', avatar: '', introduction: '', - roles: [] + roles: [], + userName: '', + userId: '', + deptName: '', + deptId: '' } const mutations = { @@ -26,6 +30,18 @@ const mutations = { }, SET_ROLES: (state, roles) => { state.roles = roles + }, + USER_NAME: (state, userName) => { + state.userName = userName + }, + USER_ID: (state, userId) => { + state.userId = userId + }, + DEPT_NAME: (state, deptName) => { + state.deptName = deptName + }, + DEPT_ID: (state, deptId) => { + state.deptId = deptId } } @@ -39,8 +55,16 @@ const actions = { commit('SET_ROLES', res.data.data.role_id) // const { data } = res.data commit('SET_TOKEN', 'bwhse') + commit('USER_NAME', res.data.data.user_name) + commit('USER_ID', res.data.data.user_id) + commit('DEPT_NAME', res.data.data.dept_name) + commit('DEPT_ID', res.data.data.dept_id) setToken('bwhse') sessionStorage.setItem('ROLES', res.data.data.role_id) + sessionStorage.setItem('USER_NAME', res.data.data.user_name) + sessionStorage.setItem('USER_ID', res.data.data.user_id) + sessionStorage.setItem('DEPT_NAME', res.data.data.dept_name) + sessionStorage.setItem('DEPT_ID', res.data.data.dept_id) resolve() } else { Vue.prototype.$message.error(res.data.message) @@ -85,6 +109,10 @@ const actions = { // logout(state.token).then(() => { commit('SET_TOKEN', '') commit('SET_ROLES', []) + commit('USER_NAME', '') + commit('USER_ID', '') + commit('DEPT_NAME', '') + commit('DEPT_ID', '') sessionStorage.clear removeToken() resetRouter() @@ -104,6 +132,10 @@ const actions = { getRoles({ commit }, roles) { return new Promise(resolve => { commit('SET_ROLES', roles) + commit('USER_NAME', sessionStorage.getItem('USER_NAME')) + commit('USER_ID', sessionStorage.getItem('USER_ID')) + commit('DEPT_NAME', sessionStorage.getItem('DEPT_NAME')) + commit('DEPT_ID', sessionStorage.getItem('DEPT_ID')) resolve() }) }, diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index 6282c714..202c2844 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -158,3 +158,38 @@ // .el-input--medium .el-input__icon { // line-height: 26.8px; // } + +.el-tree .el-tree-node__expand-icon.expanded { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); +} +//有子节点 且未展开 +.el-tree .el-icon-caret-right:before { + background: url("../assets/images/1.png") no-repeat; + content: ""; + display: block; + width: 16px; + height: 16px; + font-size: 16px; + background-size: 16px; +} +//有子节点 且已展开 +.el-tree .el-tree-node__expand-icon.expanded.el-icon-caret-right:before { + background: url("../assets/images/2.png") no-repeat 0 3px; + content: ""; + display: block; + width: 16px; + height: 16px; + font-size: 16px; + background-size: 16px; +} +//没有子节点 +.el-tree .el-tree-node__expand-icon.is-leaf::before { + background: url("../assets/images/3.png") no-repeat; + content: ""; + display: block; + width: 16px; + height: 16px; + font-size: 16px; + background-size: 16px; +} diff --git a/src/utils/index.js b/src/utils/index.js index dc208f1c..79d44e7a 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,400 +1,400 @@ -/** - * Created by PanJiaChen on 16/11/18. - */ - -/** - * Parse the time to string - * @param {(Object|string|number)} time - * @param {string} cFormat - * @returns {string | null} - */ -export function parseTime(time, cFormat) { - if (arguments.length === 0 || !time) { - return null - } - const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' - let date - if (typeof time === 'object') { - date = time - } else { - if ((typeof time === 'string')) { - if ((/^[0-9]+$/.test(time))) { - // support "1548221490638" - time = parseInt(time) - } else { - // support safari - // https://stackoverflow.com/questions/4310953/invalid-date-in-safari - time = time.replace(new RegExp(/-/gm), '/') - } - } - - if ((typeof time === 'number') && (time.toString().length === 10)) { - time = time * 1000 - } - date = new Date(time) - } - const formatObj = { - y: date.getFullYear(), - m: date.getMonth() + 1, - d: date.getDate(), - h: date.getHours(), - i: date.getMinutes(), - s: date.getSeconds(), - a: date.getDay() - } - const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { - const value = formatObj[key] - // Note: getDay() returns 0 on Sunday - if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } - return value.toString().padStart(2, '0') - }) - return time_str -} - -export function parseDay(time, cFormat) { - if (arguments.length === 0 || !time) { - return null - } - const format = cFormat || '{y}-{m}-{d}' - let date - if (typeof time === 'object') { - date = time - } else { - if ((typeof time === 'string')) { - if ((/^[0-9]+$/.test(time))) { - // support "1548221490638" - time = parseInt(time) - } else { - // support safari - // https://stackoverflow.com/questions/4310953/invalid-date-in-safari - time = time.replace(new RegExp(/-/gm), '/') - } - } - - if ((typeof time === 'number') && (time.toString().length === 10)) { - time = time * 1000 - } - date = new Date(time) - } - const formatObj = { - y: date.getFullYear(), - m: date.getMonth() + 2, - d: date.getDate(), - h: date.getHours(), - i: date.getMinutes(), - s: date.getSeconds(), - a: date.getDay() - } - const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { - const value = formatObj[key] - // Note: getDay() returns 0 on Sunday - if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } - return value.toString().padStart(2, '0') - }) - return time_str -} - -/** - * @param {number} time - * @param {string} option - * @returns {string} - */ -export function formatTime(time, option) { - if (('' + time).length === 10) { - time = parseInt(time) * 1000 - } else { - time = +time - } - const d = new Date(time) - const now = Date.now() - - const diff = (now - d) / 1000 - - if (diff < 30) { - return '刚刚' - } else if (diff < 3600) { - // less 1 hour - return Math.ceil(diff / 60) + '分钟前' - } else if (diff < 3600 * 24) { - return Math.ceil(diff / 3600) + '小时前' - } else if (diff < 3600 * 24 * 2) { - return '1天前' - } - if (option) { - return parseTime(time, option) - } else { - return ( - d.getMonth() + - 1 + - '月' + - d.getDate() + - '日' + - d.getHours() + - '时' + - d.getMinutes() + - '分' - ) - } -} - -/** - * @param {string} url - * @returns {Object} - */ -export function getQueryObject(url) { - url = url == null ? window.location.href : url - const search = url.substring(url.lastIndexOf('?') + 1) - const obj = {} - const reg = /([^?&=]+)=([^?&=]*)/g - search.replace(reg, (rs, $1, $2) => { - const name = decodeURIComponent($1) - let val = decodeURIComponent($2) - val = String(val) - obj[name] = val - return rs - }) - return obj -} - -/** - * @param {string} input value - * @returns {number} output value - */ -export function byteLength(str) { - // returns the byte length of an utf8 string - let s = str.length - for (var i = str.length - 1; i >= 0; i--) { - const code = str.charCodeAt(i) - if (code > 0x7f && code <= 0x7ff) s++ - else if (code > 0x7ff && code <= 0xffff) s += 2 - if (code >= 0xDC00 && code <= 0xDFFF) i-- - } - return s -} - -/** - * @param {Array} actual - * @returns {Array} - */ -export function cleanArray(actual) { - const newArray = [] - for (let i = 0; i < actual.length; i++) { - if (actual[i]) { - newArray.push(actual[i]) - } - } - return newArray -} - -/** - * @param {Object} json - * @returns {Array} - */ -export function param(json) { - if (!json) return '' - return cleanArray( - Object.keys(json).map(key => { - if (json[key] === undefined) return '' - return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) - }) - ).join('&') -} - -/** - * @param {string} url - * @returns {Object} - */ -export function param2Obj(url) { - const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') - if (!search) { - return {} - } - const obj = {} - const searchArr = search.split('&') - searchArr.forEach(v => { - const index = v.indexOf('=') - if (index !== -1) { - const name = v.substring(0, index) - const val = v.substring(index + 1, v.length) - obj[name] = val - } - }) - return obj -} - -/** - * @param {string} val - * @returns {string} - */ -export function html2Text(val) { - const div = document.createElement('div') - div.innerHTML = val - return div.textContent || div.innerText -} - -/** - * Merges two objects, giving the last one precedence - * @param {Object} target - * @param {(Object|Array)} source - * @returns {Object} - */ -export function objectMerge(target, source) { - if (typeof target !== 'object') { - target = {} - } - if (Array.isArray(source)) { - return source.slice() - } - Object.keys(source).forEach(property => { - const sourceProperty = source[property] - if (typeof sourceProperty === 'object') { - target[property] = objectMerge(target[property], sourceProperty) - } else { - target[property] = sourceProperty - } - }) - return target -} - -/** - * @param {HTMLElement} element - * @param {string} className - */ -export function toggleClass(element, className) { - if (!element || !className) { - return - } - let classString = element.className - const nameIndex = classString.indexOf(className) - if (nameIndex === -1) { - classString += '' + className - } else { - classString = - classString.substr(0, nameIndex) + - classString.substr(nameIndex + className.length) - } - element.className = classString -} - -/** - * @param {string} type - * @returns {Date} - */ -export function getTime(type) { - if (type === 'start') { - return new Date().getTime() - 3600 * 1000 * 24 * 90 - } else { - return new Date(new Date().toDateString()) - } -} - -/** - * @param {Function} func - * @param {number} wait - * @param {boolean} immediate - * @return {*} - */ -export function debounce(func, wait, immediate) { - let timeout, args, context, timestamp, result - - const later = function() { - // 据上一次触发时间间隔 - const last = +new Date() - timestamp - - // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait - if (last < wait && last > 0) { - timeout = setTimeout(later, wait - last) - } else { - timeout = null - // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 - if (!immediate) { - result = func.apply(context, args) - if (!timeout) context = args = null - } - } - } - - return function(...args) { - context = this - timestamp = +new Date() - const callNow = immediate && !timeout - // 如果延时不存在,重新设定延时 - if (!timeout) timeout = setTimeout(later, wait) - if (callNow) { - result = func.apply(context, args) - context = args = null - } - - return result - } -} - -/** - * This is just a simple version of deep copy - * Has a lot of edge cases bug - * If you want to use a perfect deep copy, use lodash's _.cloneDeep - * @param {Object} source - * @returns {Object} - */ -export function deepClone(source) { - if (!source && typeof source !== 'object') { - throw new Error('error arguments', 'deepClone') - } - const targetObj = source.constructor === Array ? [] : {} - Object.keys(source).forEach(keys => { - if (source[keys] && typeof source[keys] === 'object') { - targetObj[keys] = deepClone(source[keys]) - } else { - targetObj[keys] = source[keys] - } - }) - return targetObj -} - -/** - * @param {Array} arr - * @returns {Array} - */ -export function uniqueArr(arr) { - return Array.from(new Set(arr)) -} - -/** - * @returns {string} - */ -export function createUniqueString() { - const timestamp = +new Date() + '' - const randomNum = parseInt((1 + Math.random()) * 65536) + '' - return (+(randomNum + timestamp)).toString(32) -} - -/** - * Check if an element has a class - * @param {HTMLElement} elm - * @param {string} cls - * @returns {boolean} - */ -export function hasClass(ele, cls) { - return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) -} - -/** - * Add class to element - * @param {HTMLElement} elm - * @param {string} cls - */ -export function addClass(ele, cls) { - if (!hasClass(ele, cls)) ele.className += ' ' + cls -} - -/** - * Remove class from element - * @param {HTMLElement} elm - * @param {string} cls - */ -export function removeClass(ele, cls) { - if (hasClass(ele, cls)) { - const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') - ele.className = ele.className.replace(reg, ' ') - } -} +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * Parse the time to string + * @param {(Object|string|number)} time + * @param {string} cFormat + * @returns {string | null} + */ +export function parseTime(time, cFormat) { + if (arguments.length === 0 || !time) { + return null + } + const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string')) { + if ((/^[0-9]+$/.test(time))) { + // support "1548221490638" + time = parseInt(time) + } else { + // support safari + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari + time = time.replace(new RegExp(/-/gm), '/') + } + } + + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + const value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } + return value.toString().padStart(2, '0') + }) + return time_str +} + +export function parseDay(time, cFormat) { + if (arguments.length === 0 || !time) { + return null + } + const format = cFormat || '{y}-{m}-{d}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string')) { + if ((/^[0-9]+$/.test(time))) { + // support "1548221490638" + time = parseInt(time) + } else { + // support safari + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari + time = time.replace(new RegExp(/-/gm), '/') + } + } + + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + const value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } + return value.toString().padStart(2, '0') + }) + return time_str +} + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export function formatTime(time, option) { + if (('' + time).length === 10) { + time = parseInt(time) * 1000 + } else { + time = +time + } + const d = new Date(time) + const now = Date.now() + + const diff = (now - d) / 1000 + + if (diff < 30) { + return '刚刚' + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前' + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前' + } else if (diff < 3600 * 24 * 2) { + return '1天前' + } + if (option) { + return parseTime(time, option) + } else { + return ( + d.getMonth() + + 1 + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) + } +} + +/** + * @param {string} url + * @returns {Object} + */ +export function getQueryObject(url) { + url = url == null ? window.location.href : url + const search = url.substring(url.lastIndexOf('?') + 1) + const obj = {} + const reg = /([^?&=]+)=([^?&=]*)/g + search.replace(reg, (rs, $1, $2) => { + const name = decodeURIComponent($1) + let val = decodeURIComponent($2) + val = String(val) + obj[name] = val + return rs + }) + return obj +} + +/** + * @param {string} input value + * @returns {number} output value + */ +export function byteLength(str) { + // returns the byte length of an utf8 string + let s = str.length + for (var i = str.length - 1; i >= 0; i--) { + const code = str.charCodeAt(i) + if (code > 0x7f && code <= 0x7ff) s++ + else if (code > 0x7ff && code <= 0xffff) s += 2 + if (code >= 0xDC00 && code <= 0xDFFF) i-- + } + return s +} + +/** + * @param {Array} actual + * @returns {Array} + */ +export function cleanArray(actual) { + const newArray = [] + for (let i = 0; i < actual.length; i++) { + if (actual[i]) { + newArray.push(actual[i]) + } + } + return newArray +} + +/** + * @param {Object} json + * @returns {Array} + */ +export function param(json) { + if (!json) return '' + return cleanArray( + Object.keys(json).map(key => { + if (json[key] === undefined) return '' + return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) + }) + ).join('&') +} + +/** + * @param {string} url + * @returns {Object} + */ +export function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} + +/** + * @param {string} val + * @returns {string} + */ +export function html2Text(val) { + const div = document.createElement('div') + div.innerHTML = val + return div.textContent || div.innerText +} + +/** + * Merges two objects, giving the last one precedence + * @param {Object} target + * @param {(Object|Array)} source + * @returns {Object} + */ +export function objectMerge(target, source) { + if (typeof target !== 'object') { + target = {} + } + if (Array.isArray(source)) { + return source.slice() + } + Object.keys(source).forEach(property => { + const sourceProperty = source[property] + if (typeof sourceProperty === 'object') { + target[property] = objectMerge(target[property], sourceProperty) + } else { + target[property] = sourceProperty + } + }) + return target +} + +/** + * @param {HTMLElement} element + * @param {string} className + */ +export function toggleClass(element, className) { + if (!element || !className) { + return + } + let classString = element.className + const nameIndex = classString.indexOf(className) + if (nameIndex === -1) { + classString += '' + className + } else { + classString = + classString.substr(0, nameIndex) + + classString.substr(nameIndex + className.length) + } + element.className = classString +} + +/** + * @param {string} type + * @returns {Date} + */ +export function getTime(type) { + if (type === 'start') { + return new Date().getTime() - 3600 * 1000 * 24 * 90 + } else { + return new Date(new Date().toDateString()) + } +} + +/** + * @param {Function} func + * @param {number} wait + * @param {boolean} immediate + * @return {*} + */ +export function debounce(func, wait, immediate) { + let timeout, args, context, timestamp, result + + const later = function() { + // 据上一次触发时间间隔 + const last = +new Date() - timestamp + + // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last) + } else { + timeout = null + // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 + if (!immediate) { + result = func.apply(context, args) + if (!timeout) context = args = null + } + } + } + + return function(...args) { + context = this + timestamp = +new Date() + const callNow = immediate && !timeout + // 如果延时不存在,重新设定延时 + if (!timeout) timeout = setTimeout(later, wait) + if (callNow) { + result = func.apply(context, args) + context = args = null + } + + return result + } +} + +/** + * This is just a simple version of deep copy + * Has a lot of edge cases bug + * If you want to use a perfect deep copy, use lodash's _.cloneDeep + * @param {Object} source + * @returns {Object} + */ +export function deepClone(source) { + if (!source && typeof source !== 'object') { + throw new Error('error arguments', 'deepClone') + } + const targetObj = source.constructor === Array ? [] : {} + Object.keys(source).forEach(keys => { + if (source[keys] && typeof source[keys] === 'object') { + targetObj[keys] = deepClone(source[keys]) + } else { + targetObj[keys] = source[keys] + } + }) + return targetObj +} + +/** + * @param {Array} arr + * @returns {Array} + */ +export function uniqueArr(arr) { + return Array.from(new Set(arr)) +} + +/** + * @returns {string} + */ +export function createUniqueString() { + const timestamp = +new Date() + '' + const randomNum = parseInt((1 + Math.random()) * 65536) + '' + return (+(randomNum + timestamp)).toString(32) +} + +/** + * Check if an element has a class + * @param {HTMLElement} elm + * @param {string} cls + * @returns {boolean} + */ +export function hasClass(ele, cls) { + return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) +} + +/** + * Add class to element + * @param {HTMLElement} elm + * @param {string} cls + */ +export function addClass(ele, cls) { + if (!hasClass(ele, cls)) ele.className += ' ' + cls +} + +/** + * Remove class from element + * @param {HTMLElement} elm + * @param {string} cls + */ +export function removeClass(ele, cls) { + if (hasClass(ele, cls)) { + const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') + ele.className = ele.className.replace(reg, ' ') + } +} diff --git a/src/views/dashboard/admin/index.vue b/src/views/dashboard/admin/index.vue index c4c23150..e94eca27 100644 --- a/src/views/dashboard/admin/index.vue +++ b/src/views/dashboard/admin/index.vue @@ -1,119 +1,119 @@ - - - - - + + + + + diff --git a/src/views/hidden_check/components/create/index.vue b/src/views/hidden_check/components/create/index.vue index 514ba340..4f72bd80 100644 --- a/src/views/hidden_check/components/create/index.vue +++ b/src/views/hidden_check/components/create/index.vue @@ -54,19 +54,19 @@ - + - + - + @@ -148,7 +148,7 @@ > - 取 消 + 确 定 @@ -161,6 +161,7 @@ import publicApi from '@/api/public' import buttons from '@/components/formBtn' import SelUser from '@/components/selUser' import SelDept from '@/components/selDept' +import { parseDay } from '@/utils/index' export default { name: 'HiddenCheckCreateForm', components: { @@ -177,9 +178,9 @@ export default { form: { hidden_danger__hidden_code: '', hidden_danger__hidden_state: '1', - hidden_danger__check_man: '', - hidden_danger__check_dept: '', - hidden_danger__check_date: '', + hidden_danger__check_man: this.$store.state.user.userName, + hidden_danger__check_dept: this.$store.state.user.deptName, + hidden_danger__check_date: parseDay(new Date()), hidden_danger__check_location: '', hidden_danger__check_content: '', hidden_danger__check_problem: '', @@ -195,8 +196,8 @@ export default { hidden_danger__insp_det_id: '', hidden_danger__hidden_danger_id: '', hidden_danger__dept_id: '', - hidden_danger__check_man_id: '', - hidden_danger__check_dept_id: '' + hidden_danger__check_man_id: this.$store.state.user.userId, + hidden_danger__check_dept_id: this.$store.state.user.deptId }, rules: { hidden_danger__check_man: [ @@ -230,6 +231,8 @@ export default { } }, created() { + console.log(this.$store) + console.log(this.form) this.getHiddenState() }, methods: { diff --git a/src/views/hidden_check/components/edit_form/index.vue b/src/views/hidden_check/components/edit_form/index.vue index ac454b9a..d0e8fbe3 100644 --- a/src/views/hidden_check/components/edit_form/index.vue +++ b/src/views/hidden_check/components/edit_form/index.vue @@ -54,19 +54,19 @@ - + - + - + @@ -100,6 +100,16 @@ + + + 隐患排查图片 + + + + 隐患整改图片 + + + '' } @@ -356,9 +368,6 @@ export default { -webkit-box-sizing: border-box; box-sizing: border-box; } -.el-col{ - margin-left: 2%; -} .buttons { display: flex; .el-button--primary { @@ -366,4 +375,11 @@ export default { height: 26.8px; } } +.img{ + margin-top: 10px; + text-align: center; + span{ + width: 100%; + } +} diff --git a/src/views/hidden_reform/components/edit_form/index.vue b/src/views/hidden_reform/components/edit_form/index.vue index 498b9c82..4ff5e035 100644 --- a/src/views/hidden_reform/components/edit_form/index.vue +++ b/src/views/hidden_reform/components/edit_form/index.vue @@ -6,6 +6,9 @@ 返回列表 +
+
| 隐患排查
+
@@ -100,6 +103,11 @@ +
+
+ | 隐患整改 +
+
@@ -120,7 +128,7 @@ - + @@ -382,4 +390,14 @@ export default { height: 26.8px; } } +.classify{ + width: 100%; + // display: inline-block; + padding: 10px 0; + font-weight: bold; + color: #1890ff; + span{ + color: #000; + } +} diff --git a/src/views/hidden_reform/index.vue b/src/views/hidden_reform/index.vue index 71a122f4..b8e79ef9 100644 --- a/src/views/hidden_reform/index.vue +++ b/src/views/hidden_reform/index.vue @@ -94,6 +94,7 @@ export default { data: [], deptTree: [], ids: [], + isBacklog: this.$route.query.isBacklog || false, levels: [], pager: { pageNo: 0, @@ -198,6 +199,9 @@ export default { } }, created() { + if (this.isBacklog) { + this.whereSql = '' + } this.getList() }, mounted() { diff --git a/src/views/hidden_review/components/edit_form/index.vue b/src/views/hidden_review/components/edit_form/index.vue index 70cad97f..85ea1c40 100644 --- a/src/views/hidden_review/components/edit_form/index.vue +++ b/src/views/hidden_review/components/edit_form/index.vue @@ -6,6 +6,9 @@ 返回列表 +
+
| 隐患排查
+
@@ -100,6 +103,9 @@ +
+
| 隐患整改
+
@@ -125,6 +131,9 @@ +
+
| 隐患验收
+
@@ -147,7 +156,7 @@ - + @@ -436,4 +445,16 @@ export default { height: 26.8px; } } +.classify{ + width: 100%; + // display: inline-block; + padding: 10px 0; + font-weight: bold; + color: #1890ff; + span{ + height: 100%; + line-height: 18.4px; + color: #000; + } +} diff --git a/src/views/hidden_review/index.vue b/src/views/hidden_review/index.vue index a96e28c3..63432304 100644 --- a/src/views/hidden_review/index.vue +++ b/src/views/hidden_review/index.vue @@ -90,6 +90,7 @@ export default { data: [], deptTree: [], ids: [], + isBacklog: this.$route.query.isBacklog || false, levels: [], pager: { pageNo: 0, @@ -174,6 +175,9 @@ export default { } }, created() { + if (this.isBacklog) { + this.whereSql = '' + } this.getList() }, mounted() { @@ -188,8 +192,7 @@ export default { api.getDate( this.pager.pageSize, pageNo, - this.whereSql, - this.whereValue + this.whereSql ).then(data => { if (data.success) { this.data = data.data.root diff --git a/src/views/insp_name/components/edit_form/index.vue b/src/views/insp_name/components/edit_form/index.vue index 8dcaaee9..44374347 100644 --- a/src/views/insp_name/components/edit_form/index.vue +++ b/src/views/insp_name/components/edit_form/index.vue @@ -26,7 +26,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/src/views/safe_insp/components/create/index.vue b/src/views/safe_insp/components/create/index.vue index 1b8c164a..fdb15edc 100644 --- a/src/views/safe_insp/components/create/index.vue +++ b/src/views/safe_insp/components/create/index.vue @@ -9,7 +9,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -54,7 +54,7 @@ - + diff --git a/src/views/safe_insp/components/edit_form/index.vue b/src/views/safe_insp/components/edit_form/index.vue index 644686a2..fc2a2a90 100644 --- a/src/views/safe_insp/components/edit_form/index.vue +++ b/src/views/safe_insp/components/edit_form/index.vue @@ -54,7 +54,7 @@ - + @@ -199,6 +199,7 @@ export default { console.log(this.id) this.getList() this.getTypeSel() + this.getInsptimes() }, methods: { getList() { @@ -215,7 +216,7 @@ export default { }) }, async getTypeSel() { - await publicApi.getTypeSel('insptimes').then(data => { + await publicApi.getTypeSel('inspstate').then(data => { if (data.success) { this.options = data.data.root } else { @@ -227,6 +228,7 @@ export default { await publicApi.getTypeSel('insptimes').then(data => { if (data.success) { this.insptimes = data.data.root + console.log(this.insptimes, 'this.insptimes') } else { this.$message.error(data.message) } diff --git a/src/views/safe_insp/components/insp_det/index.vue b/src/views/safe_insp/components/insp_det/index.vue index 9b77764e..a044890b 100644 --- a/src/views/safe_insp/components/insp_det/index.vue +++ b/src/views/safe_insp/components/insp_det/index.vue @@ -56,6 +56,15 @@ + + + + + + + + + - +
- +
{{ scope.row[d.prop] }}
@@ -416,4 +416,9 @@ export default { .el-card { margin-top: 10px; } + .el-tree{ + height: 500px; + overflow-x:auto; + overflow-y:auto; + } diff --git a/src/views/sys_user/components/auditUser.vue b/src/views/sys_user/components/auditUser.vue index 41006e1b..ee88cb6b 100644 --- a/src/views/sys_user/components/auditUser.vue +++ b/src/views/sys_user/components/auditUser.vue @@ -1,211 +1,219 @@ - - - - - + + + + + diff --git a/src/views/sys_user/index.vue b/src/views/sys_user/index.vue index c15239cc..02aaf0e5 100644 --- a/src/views/sys_user/index.vue +++ b/src/views/sys_user/index.vue @@ -51,7 +51,7 @@
- +
{{ scope.row[d.prop] }}