diff --git a/.eslintrc.js b/.eslintrc.js index 375b935..17be2f1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,7 +24,7 @@ module.exports = { 'vue/max-attributes-per-line': [ 2, { - singleline: 10, // 当开始标签位于单行时,每行的最大属性数 + singleline: 20, // 当开始标签位于单行时,每行的最大属性数 // 当开始标签位于多行时,每行的最大属性数 multiline: { max: 1, @@ -75,7 +75,7 @@ module.exports = { curly: [2, 'multi-line'], // 强制所有控制语句使用一致的括号风格 'dot-location': [2, 'property'], // 在点之前和之后执行一致的换行符 'eol-last': 2, // 要求或禁止文件末尾存在空行 - eqeqeq: ['error', 'always', { null: 'ignore' }], // 要求使用 === 和 !== + // eqeqeq: ['error', 'never', { null: 'ignore' }], // 要求使用 === 和 !== // 强制 generator 函数中 * 号周围使用一致的空格 'generator-star-spacing': [ 2, @@ -290,6 +290,8 @@ module.exports = { objectsInObjects: false } ], - 'array-bracket-spacing': [2, 'never'] // 该规则在数组括号内强制实现一致的间距 + 'array-bracket-spacing': [2, 'never'], // 该规则在数组括号内强制实现一致的间距 + 'vue/require-default-prop': 'off', + 'vue/require-prop-types': 'off' } }; diff --git a/public/index.html b/public/index.html index 925455c..caf21b6 100644 --- a/public/index.html +++ b/public/index.html @@ -1,208 +1,92 @@ - - - - - + + + + + <%= webpackConfig.name %> - - + #loader-wrapper { + position: relative; + width: 100%; + height: 100%; + background: #1a1a34; + z-index: 1000; + } + +
-
-
-
-
-
正在加载系统资源,请耐心等待
-
-
+
+ +
资源加载中...
+
+ + diff --git a/public/loading/index.js b/public/loading/index.js new file mode 100644 index 0000000..e98df9e --- /dev/null +++ b/public/loading/index.js @@ -0,0 +1,208 @@ +/* ========================================================*/ +/* Light Loader +/*========================================================*/ +var lightLoader = function (c, cw, ch) { + var _this = this; + this.c = c; + this.ctx = c.getContext('2d'); + this.cw = cw; + this.ch = ch; + + this.loaded = 0; + this.loaderSpeed = 1.5; + this.loaderHeight = 8; + this.loaderWidth = 428; + this.loader = { + x: this.cw / 2 - this.loaderWidth / 2, + y: this.ch / 2 - this.loaderHeight / 2 + }; + this.particles = []; + this.particleLift = 180; + this.gravity = 0.15; + this.particleRate = 8; + + /* ========================================================*/ + /* Initialize + /*========================================================*/ + this.init = function () { + this.loop(); + }; + + /* ========================================================*/ + /* Utility Functions + /*========================================================*/ + this.rand = function (rMi, rMa) { + return ~~(Math.random() * (rMa - rMi + 1) + rMi); + }; + this.hitTest = function (x1, y1, w1, h1, x2, y2, w2, h2) { + return !(x1 + w1 < x2 || x2 + w2 < x1 || y1 + h1 < y2 || y2 + h2 < y1); + }; + + /* ========================================================*/ + /* Update Loader + /*========================================================*/ + this.updateLoader = function () { + if (this.loaded < 100) { + this.loaded += this.loaderSpeed; + } else { + this.loaded = 0; + } + }; + + /* ========================================================*/ + /* Render Loader + /*========================================================*/ + this.renderLoader = function () { + this.ctx.fillStyle = '#2F2F47'; + this.ctx.fillRect(this.loader.x, this.loader.y, this.loaderWidth, this.loaderHeight); + + var newWidth = (this.loaded / 100) * this.loaderWidth; + var linearGrad = this.ctx.createLinearGradient(0, 0, this.loaderWidth, 0); + linearGrad.addColorStop(0.0, '#24DED0'); + linearGrad.addColorStop(1.0, '#1490EA'); + this.ctx.fillStyle = linearGrad; + this.ctx.fillRect(this.loader.x, this.loader.y, newWidth, this.loaderHeight); + + // this.ctx.fillStyle = '#2F2F47'; + // this.ctx.fillRect( + // this.loader.x, + // this.loader.y, + // newWidth, + // this.loaderHeight + // ); + }; + + /* ========================================================*/ + /* Particles + /*========================================================*/ + this.Particle = function () { + this.x = _this.loader.x + (_this.loaded / 100) * _this.loaderWidth - _this.rand(0, 1); + this.y = _this.ch / 2 + _this.rand(0, _this.loaderHeight) - _this.loaderHeight / 2; + this.vx = (_this.rand(0, 4) - 2) / 100; + this.vy = (_this.rand(0, _this.particleLift) - _this.particleLift * 2) / 100; + this.width = _this.rand(1, 4) / 2; + this.height = _this.rand(1, 4) / 2; + }; + + this.Particle.prototype.update = function (i) { + this.vx += (_this.rand(0, 6) - 3) / 100; + this.vy += _this.gravity; + this.x += this.vx; + this.y += this.vy; + + if (this.y > _this.ch) { + _this.particles.splice(i, 1); + } + }; + + this.Particle.prototype.render = function () { + _this.ctx.fillStyle = 'rgba(50, 213, 203, 0.4)'; + _this.ctx.fillRect(this.x, this.y, this.width, this.height); + }; + + this.createParticles = function () { + var i = this.particleRate; + while (i--) { + this.particles.push(new this.Particle()); + } + }; + + this.updateParticles = function () { + var i = this.particles.length; + while (i--) { + var p = this.particles[i]; + p.update(i); + } + }; + + this.renderParticles = function () { + var i = this.particles.length; + while (i--) { + var p = this.particles[i]; + p.render(); + } + }; + + /* ========================================================*/ + /* Clear Canvas + /*========================================================*/ + this.clearCanvas = function () { + this.ctx.globalCompositeOperation = 'source-over'; + this.ctx.clearRect(0, 0, this.cw, this.ch); + this.ctx.globalCompositeOperation = 'lighter'; + }; + + /* ========================================================*/ + /* Animation Loop + /*========================================================*/ + this.loop = function () { + var loopIt = function () { + requestAnimationFrame(loopIt, _this.c); + _this.clearCanvas(); + + _this.createParticles(); + + _this.updateLoader(); + _this.updateParticles(); + + _this.renderLoader(); + _this.renderParticles(); + }; + loopIt(); + }; +}; + +/* ========================================================*/ +/* Check Canvas Support +/*========================================================*/ +var isCanvasSupported = function () { + var elem = document.createElement('canvas'); + return !!(elem.getContext && elem.getContext('2d')); +}; + +/* ========================================================*/ +/* Setup requestAnimationFrame +/*========================================================*/ +var setupRAF = function () { + var lastTime = 0; + var vendors = ['ms', 'moz', 'webkit', 'o']; + for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; + window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; + } + + if (!window.requestAnimationFrame) { + window.requestAnimationFrame = function (callback, element) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function () { + callback(currTime + timeToCall); + }, timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + } + + if (!window.cancelAnimationFrame) { + window.cancelAnimationFrame = function (id) { + clearTimeout(id); + }; + } +}; + +/* ========================================================*/ +/* Define Canvas and Initialize +/*========================================================*/ +if (isCanvasSupported) { + var c = document.createElement('canvas'); + c.width = 428; + c.height = 100; + var cw = c.width; + var ch = c.height; + // document.body.appendChild(c); + document.getElementById('loader-wrapper').appendChild(c); + var cl = new lightLoader(c, cw, ch); + + setupRAF(); + cl.init(); +} diff --git a/public/loading/prefixfree.min.js b/public/loading/prefixfree.min.js new file mode 100644 index 0000000..5c33854 --- /dev/null +++ b/public/loading/prefixfree.min.js @@ -0,0 +1,477 @@ +(function () { + if (!window.addEventListener) { + return; + } + + var self = (window.StyleFix = { + link: function (link) { + try { + // Ignore stylesheets with data-noprefix attribute as well as alternate stylesheets + if (link.rel !== 'stylesheet' || link.hasAttribute('data-noprefix')) { + return; + } + } catch (e) { + return; + } + + var url = link.href || link.getAttribute('data-href'); + var base = url.replace(/[^\/]+$/, ''); + var base_scheme = (/^[a-z]{3,10}:/.exec(base) || [''])[0]; + var base_domain = (/^[a-z]{3,10}:\/\/[^\/]+/.exec(base) || [''])[0]; + var base_query = /^([^?]*)\??/.exec(url)[1]; + var parent = link.parentNode; + var xhr = new XMLHttpRequest(); + var process; + + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + process(); + } + }; + + process = function () { + var css = xhr.responseText; + + if (css && link.parentNode && (!xhr.status || xhr.status < 400 || xhr.status > 600)) { + css = self.fix(css, true, link); + + // Convert relative URLs to absolute, if needed + if (base) { + css = css.replace(/url\(\s*?((?:"|')?)(.+?)\1\s*?\)/gi, function ($0, quote, url) { + if (/^([a-z]{3,10}:|#)/i.test(url)) { + // Absolute & or hash-relative + return $0; + } else if (/^\/\//.test(url)) { + // Scheme-relative + // May contain sequences like /../ and /./ but those DO work + return 'url("' + base_scheme + url + '")'; + } else if (/^\//.test(url)) { + // Domain-relative + return 'url("' + base_domain + url + '")'; + } else if (/^\?/.test(url)) { + // Query-relative + return 'url("' + base_query + url + '")'; + } else { + // Path-relative + return 'url("' + base + url + '")'; + } + }); + + // behavior URLs shoudn’t be converted (Issue #19) + // base should be escaped before added to RegExp (Issue #81) + var escaped_base = base.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g, '\\$1'); + css = css.replace(RegExp('\\b(behavior:\\s*?url\\(\'?"?)' + escaped_base, 'gi'), '$1'); + } + + var style = document.createElement('style'); + style.textContent = css; + style.media = link.media; + style.disabled = link.disabled; + style.setAttribute('data-href', link.getAttribute('href')); + + parent.insertBefore(style, link); + parent.removeChild(link); + + style.media = link.media; // Duplicate is intentional. See issue #31 + } + }; + + try { + xhr.open('GET', url); + xhr.send(null); + } catch (e) { + // Fallback to XDomainRequest if available + if (typeof XDomainRequest !== 'undefined') { + xhr = new XDomainRequest(); + xhr.onerror = xhr.onprogress = function () {}; + xhr.onload = process; + xhr.open('GET', url); + xhr.send(null); + } + } + + link.setAttribute('data-inprogress', ''); + }, + + styleElement: function (style) { + if (style.hasAttribute('data-noprefix')) { + return; + } + var disabled = style.disabled; + + style.textContent = self.fix(style.textContent, true, style); + + style.disabled = disabled; + }, + + styleAttribute: function (element) { + var css = element.getAttribute('style'); + + css = self.fix(css, false, element); + + element.setAttribute('style', css); + }, + + process: function () { + // Linked stylesheets + $('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link); + + // Inline stylesheets + $('style').forEach(StyleFix.styleElement); + + // Inline styles + $('[style]').forEach(StyleFix.styleAttribute); + }, + + register: function (fixer, index) { + (self.fixers = self.fixers || []).splice(index === undefined ? self.fixers.length : index, 0, fixer); + }, + + fix: function (css, raw, element) { + for (var i = 0; i < self.fixers.length; i++) { + css = self.fixers[i](css, raw, element) || css; + } + + return css; + }, + + camelCase: function (str) { + return str + .replace(/-([a-z])/g, function ($0, $1) { + return $1.toUpperCase(); + }) + .replace('-', ''); + }, + + deCamelCase: function (str) { + return str.replace(/[A-Z]/g, function ($0) { + return '-' + $0.toLowerCase(); + }); + } + }); + + /** ************************************ + * Process styles + **************************************/ + (function () { + setTimeout(function () { + $('link[rel="stylesheet"]').forEach(StyleFix.link); + }, 10); + + document.addEventListener('DOMContentLoaded', StyleFix.process, false); + })(); + + function $(expr, con) { + return [].slice.call((con || document).querySelectorAll(expr)); + } +})(); + +/** + * PrefixFree + */ +(function (root) { + if (!window.StyleFix || !window.getComputedStyle) { + return; + } + + // Private helper + function fix(what, before, after, replacement, css) { + what = self[what]; + + if (what.length) { + var regex = RegExp(before + '(' + what.join('|') + ')' + after, 'gi'); + + css = css.replace(regex, replacement); + } + + return css; + } + + var self = (window.PrefixFree = { + prefixCSS: function (css, raw, element) { + var prefix = self.prefix; + + // Gradient angles hotfix + if (self.functions.indexOf('linear-gradient') > -1) { + // Gradients are supported with a prefix, convert angles to legacy + css = css.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/gi, function ($0, delim, repeating, deg) { + return delim + (repeating || '') + 'linear-gradient(' + (90 - deg) + 'deg'; + }); + } + + css = fix('functions', '(\\s|:|,)', '\\s*\\(', '$1' + prefix + '$2(', css); + css = fix('keywords', '(\\s|:)', '(\\s|;|\\}|$)', '$1' + prefix + '$2$3', css); + css = fix('properties', '(^|\\{|\\s|;)', '\\s*:', '$1' + prefix + '$2:', css); + + // Prefix properties *inside* values (issue #8) + if (self.properties.length) { + var regex = RegExp('\\b(' + self.properties.join('|') + ')(?!:)', 'gi'); + + css = fix( + 'valueProperties', + '\\b', + ':(.+?);', + function ($0) { + return $0.replace(regex, prefix + '$1'); + }, + css + ); + } + + if (raw) { + css = fix('selectors', '', '\\b', self.prefixSelector, css); + css = fix('atrules', '@', '\\b', '@' + prefix + '$1', css); + } + + // Fix double prefixing + css = css.replace(RegExp('-' + prefix, 'g'), '-'); + + // Prefix wildcard + css = css.replace(/-\*-(?=[a-z]+)/gi, self.prefix); + + return css; + }, + + property: function (property) { + return (self.properties.indexOf(property) ? self.prefix : '') + property; + }, + + value: function (value, property) { + value = fix('functions', '(^|\\s|,)', '\\s*\\(', '$1' + self.prefix + '$2(', value); + value = fix('keywords', '(^|\\s)', '(\\s|$)', '$1' + self.prefix + '$2$3', value); + + // TODO properties inside values + + return value; + }, + + // Warning: Prefixes no matter what, even if the selector is supported prefix-less + prefixSelector: function (selector) { + return selector.replace(/^:{1,2}/, function ($0) { + return $0 + self.prefix; + }); + }, + + // Warning: Prefixes no matter what, even if the property is supported prefix-less + prefixProperty: function (property, camelCase) { + var prefixed = self.prefix + property; + + return camelCase ? StyleFix.camelCase(prefixed) : prefixed; + } + }); + + /** ************************************ + * Properties + **************************************/ + (function () { + var prefixes = {}; + var properties = []; + var shorthands = {}; + var style = getComputedStyle(document.documentElement, null); + var dummy = document.createElement('div').style; + + // Why are we doing this instead of iterating over properties in a .style object? Cause Webkit won't iterate over those. + var iterate = function (property) { + if (property.charAt(0) === '-') { + properties.push(property); + + var parts = property.split('-'); + var prefix = parts[1]; + + // Count prefix uses + prefixes[prefix] = ++prefixes[prefix] || 1; + + // This helps determining shorthands + while (parts.length > 3) { + parts.pop(); + + var shorthand = parts.join('-'); + + if (supported(shorthand) && properties.indexOf(shorthand) === -1) { + properties.push(shorthand); + } + } + } + }; + var supported = function (property) { + return StyleFix.camelCase(property) in dummy; + }; + + // Some browsers have numerical indices for the properties, some don't + if (style.length > 0) { + for (var i = 0; i < style.length; i++) { + iterate(style[i]); + } + } else { + for (var property in style) { + iterate(StyleFix.deCamelCase(property)); + } + } + + // Find most frequently used prefix + var highest = { uses: 0 }; + for (var prefix in prefixes) { + var uses = prefixes[prefix]; + + if (highest.uses < uses) { + highest = { prefix: prefix, uses: uses }; + } + } + + self.prefix = '-' + highest.prefix + '-'; + self.Prefix = StyleFix.camelCase(self.prefix); + + self.properties = []; + + // Get properties ONLY supported with a prefix + for (var i = 0; i < properties.length; i++) { + var property = properties[i]; + + if (property.indexOf(self.prefix) === 0) { + // we might have multiple prefixes, like Opera + var unprefixed = property.slice(self.prefix.length); + + if (!supported(unprefixed)) { + self.properties.push(unprefixed); + } + } + } + + // IE fix + if (self.Prefix == 'Ms' && !('transform' in dummy) && !('MsTransform' in dummy) && 'msTransform' in dummy) { + self.properties.push('transform', 'transform-origin'); + } + + self.properties.sort(); + })(); + + /** ************************************ + * Values + **************************************/ + (function () { + // Values that might need prefixing + var functions = { + 'linear-gradient': { + property: 'backgroundImage', + params: 'red, teal' + }, + calc: { + property: 'width', + params: '1px + 5%' + }, + element: { + property: 'backgroundImage', + params: '#foo' + }, + 'cross-fade': { + property: 'backgroundImage', + params: 'url(a.png), url(b.png), 50%' + } + }; + + functions['repeating-linear-gradient'] = functions['repeating-radial-gradient'] = functions['radial-gradient'] = functions['linear-gradient']; + + // Note: The properties assigned are just to *test* support. + // The keywords will be prefixed everywhere. + var keywords = { + initial: 'color', + 'zoom-in': 'cursor', + 'zoom-out': 'cursor', + box: 'display', + flexbox: 'display', + 'inline-flexbox': 'display', + flex: 'display', + 'inline-flex': 'display', + grid: 'display', + 'inline-grid': 'display', + 'min-content': 'width' + }; + + self.functions = []; + self.keywords = []; + + var style = document.createElement('div').style; + + function supported(value, property) { + style[property] = ''; + style[property] = value; + + return !!style[property]; + } + + for (var func in functions) { + var test = functions[func]; + var property = test.property; + var value = func + '(' + test.params + ')'; + + if (!supported(value, property) && supported(self.prefix + value, property)) { + // It's supported, but with a prefix + self.functions.push(func); + } + } + + for (var keyword in keywords) { + var property = keywords[keyword]; + + if (!supported(keyword, property) && supported(self.prefix + keyword, property)) { + // It's supported, but with a prefix + self.keywords.push(keyword); + } + } + })(); + + /** ************************************ + * Selectors and @-rules + **************************************/ + (function () { + var selectors = { + ':read-only': null, + ':read-write': null, + ':any-link': null, + '::selection': null + }; + + var atrules = { + keyframes: 'name', + viewport: null, + document: 'regexp(".")' + }; + + self.selectors = []; + self.atrules = []; + + var style = root.appendChild(document.createElement('style')); + + function supported(selector) { + style.textContent = selector + '{}'; // Safari 4 has issues with style.innerHTML + + return !!style.sheet.cssRules.length; + } + + for (var selector in selectors) { + var test = selector + (selectors[selector] ? '(' + selectors[selector] + ')' : ''); + + if (!supported(test) && supported(self.prefixSelector(test))) { + self.selectors.push(selector); + } + } + + for (var atrule in atrules) { + var test = atrule + ' ' + (atrules[atrule] || ''); + + if (!supported('@' + test) && supported('@' + self.prefix + test)) { + self.atrules.push(atrule); + } + } + + root.removeChild(style); + })(); + + // Properties that accept properties as their value + self.valueProperties = ['transition', 'transition-property']; + + // Add class for current prefix + root.className += ' ' + self.prefix; + + StyleFix.register(self.prefixCSS); +})(document.documentElement); diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 0000000..40ce6f9 Binary files /dev/null and b/public/logo.png differ diff --git a/src/api/login.js b/src/api/login.js index 649f59c..8c24dc9 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 登录方法 export function login(username, password, code, uuid) { @@ -7,7 +7,7 @@ export function login(username, password, code, uuid) { password, code, uuid - } + }; return request({ url: '/login', headers: { @@ -15,7 +15,7 @@ export function login(username, password, code, uuid) { }, method: 'post', data: data - }) + }); } // 注册方法 @@ -27,7 +27,7 @@ export function register(data) { }, method: 'post', data: data - }) + }); } // 获取用户详细信息 @@ -35,7 +35,7 @@ export function getInfo() { return request({ url: '/getInfo', method: 'get' - }) + }); } // 退出方法 @@ -43,7 +43,7 @@ export function logout() { return request({ url: '/logout', method: 'post' - }) + }); } // 获取验证码 @@ -55,5 +55,5 @@ export function getCodeImg() { }, method: 'get', timeout: 20000 - }) -} \ No newline at end of file + }); +} diff --git a/src/api/menu.js b/src/api/menu.js index faef101..c86c318 100644 --- a/src/api/menu.js +++ b/src/api/menu.js @@ -1,9 +1,9 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 获取路由 export const getRouters = () => { return request({ url: '/getRouters', method: 'get' - }) -} \ No newline at end of file + }); +}; diff --git a/src/api/monitor/cache.js b/src/api/monitor/cache.js index 72c5f6a..d08af80 100644 --- a/src/api/monitor/cache.js +++ b/src/api/monitor/cache.js @@ -1,11 +1,11 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询缓存详细 export function getCache() { return request({ url: '/monitor/cache', method: 'get' - }) + }); } // 查询缓存名称列表 @@ -13,7 +13,7 @@ export function listCacheName() { return request({ url: '/monitor/cache/getNames', method: 'get' - }) + }); } // 查询缓存键名列表 @@ -21,7 +21,7 @@ export function listCacheKey(cacheName) { return request({ url: '/monitor/cache/getKeys/' + cacheName, method: 'get' - }) + }); } // 查询缓存内容 @@ -29,7 +29,7 @@ export function getCacheValue(cacheName, cacheKey) { return request({ url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey, method: 'get' - }) + }); } // 清理指定名称缓存 @@ -37,7 +37,7 @@ export function clearCacheName(cacheName) { return request({ url: '/monitor/cache/clearCacheName/' + cacheName, method: 'delete' - }) + }); } // 清理指定键名缓存 @@ -45,7 +45,7 @@ export function clearCacheKey(cacheKey) { return request({ url: '/monitor/cache/clearCacheKey/' + cacheKey, method: 'delete' - }) + }); } // 清理全部缓存 @@ -53,5 +53,5 @@ export function clearCacheAll() { return request({ url: '/monitor/cache/clearCacheAll', method: 'delete' - }) + }); } diff --git a/src/api/monitor/job.js b/src/api/monitor/job.js index 3815569..affb0ec 100644 --- a/src/api/monitor/job.js +++ b/src/api/monitor/job.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询定时任务调度列表 export function listJob(query) { @@ -6,7 +6,7 @@ export function listJob(query) { url: '/monitor/job/list', method: 'get', params: query - }) + }); } // 查询定时任务调度详细 @@ -14,7 +14,7 @@ export function getJob(jobId) { return request({ url: '/monitor/job/' + jobId, method: 'get' - }) + }); } // 新增定时任务调度 @@ -23,7 +23,7 @@ export function addJob(data) { url: '/monitor/job', method: 'post', data: data - }) + }); } // 修改定时任务调度 @@ -32,7 +32,7 @@ export function updateJob(data) { url: '/monitor/job', method: 'put', data: data - }) + }); } // 删除定时任务调度 @@ -40,7 +40,7 @@ export function delJob(jobId) { return request({ url: '/monitor/job/' + jobId, method: 'delete' - }) + }); } // 任务状态修改 @@ -48,24 +48,23 @@ export function changeJobStatus(jobId, status) { const data = { jobId, status - } + }; return request({ url: '/monitor/job/changeStatus', method: 'put', data: data - }) + }); } - // 定时任务立即执行一次 export function runJob(jobId, jobGroup) { const data = { jobId, jobGroup - } + }; return request({ url: '/monitor/job/run', method: 'put', data: data - }) -} \ No newline at end of file + }); +} diff --git a/src/api/monitor/jobLog.js b/src/api/monitor/jobLog.js index 6e0be61..14d2d0a 100644 --- a/src/api/monitor/jobLog.js +++ b/src/api/monitor/jobLog.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询调度日志列表 export function listJobLog(query) { @@ -6,7 +6,7 @@ export function listJobLog(query) { url: '/monitor/jobLog/list', method: 'get', params: query - }) + }); } // 删除调度日志 @@ -14,7 +14,7 @@ export function delJobLog(jobLogId) { return request({ url: '/monitor/jobLog/' + jobLogId, method: 'delete' - }) + }); } // 清空调度日志 @@ -22,5 +22,5 @@ export function cleanJobLog() { return request({ url: '/monitor/jobLog/clean', method: 'delete' - }) + }); } diff --git a/src/api/monitor/logininfor.js b/src/api/monitor/logininfor.js index 4d112b7..a058007 100644 --- a/src/api/monitor/logininfor.js +++ b/src/api/monitor/logininfor.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询登录日志列表 export function list(query) { @@ -6,7 +6,7 @@ export function list(query) { url: '/monitor/logininfor/list', method: 'get', params: query - }) + }); } // 删除登录日志 @@ -14,7 +14,7 @@ export function delLogininfor(infoId) { return request({ url: '/monitor/logininfor/' + infoId, method: 'delete' - }) + }); } // 解锁用户登录状态 @@ -22,7 +22,7 @@ export function unlockLogininfor(userName) { return request({ url: '/monitor/logininfor/unlock/' + userName, method: 'get' - }) + }); } // 清空登录日志 @@ -30,5 +30,5 @@ export function cleanLogininfor() { return request({ url: '/monitor/logininfor/clean', method: 'delete' - }) + }); } diff --git a/src/api/monitor/online.js b/src/api/monitor/online.js index bd22137..4991b48 100644 --- a/src/api/monitor/online.js +++ b/src/api/monitor/online.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询在线用户列表 export function list(query) { @@ -6,7 +6,7 @@ export function list(query) { url: '/monitor/online/list', method: 'get', params: query - }) + }); } // 强退用户 @@ -14,5 +14,5 @@ export function forceLogout(tokenId) { return request({ url: '/monitor/online/' + tokenId, method: 'delete' - }) + }); } diff --git a/src/api/monitor/operlog.js b/src/api/monitor/operlog.js index a04bca8..28a0a36 100644 --- a/src/api/monitor/operlog.js +++ b/src/api/monitor/operlog.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询操作日志列表 export function list(query) { @@ -6,7 +6,7 @@ export function list(query) { url: '/monitor/operlog/list', method: 'get', params: query - }) + }); } // 删除操作日志 @@ -14,7 +14,7 @@ export function delOperlog(operId) { return request({ url: '/monitor/operlog/' + operId, method: 'delete' - }) + }); } // 清空操作日志 @@ -22,5 +22,5 @@ export function cleanOperlog() { return request({ url: '/monitor/operlog/clean', method: 'delete' - }) + }); } diff --git a/src/api/monitor/server.js b/src/api/monitor/server.js index e1f9ca2..d992fd8 100644 --- a/src/api/monitor/server.js +++ b/src/api/monitor/server.js @@ -1,9 +1,9 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 获取服务信息 export function getServer() { return request({ url: '/monitor/server', method: 'get' - }) -} \ No newline at end of file + }); +} diff --git a/src/api/sch/classType.js b/src/api/sch/classType.js index e83037c..09950b0 100644 --- a/src/api/sch/classType.js +++ b/src/api/sch/classType.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询班型列表 export function getClassTypeTableList(query) { @@ -6,7 +6,7 @@ export function getClassTypeTableList(query) { url: '/sch/classType/list', method: 'get', params: query - }) + }); } // 新增班型 @@ -15,7 +15,7 @@ export function insertClassType(params) { url: '/sch/classType', method: 'post', data: params - }) + }); } // 修改班型 export function updateClassType(params) { @@ -23,21 +23,21 @@ export function updateClassType(params) { url: '/sch/classType', method: 'put', data: params - }) + }); } // 删除班型 export function deleteClassType(ids) { return request({ url: '/sch/classType/' + ids, method: 'delete' - }) + }); } -//克隆班型 +// 克隆班型 export function cloneClassType(data) { return request({ url: '/sch/classType/clone', method: 'post', data: data - }) + }); } diff --git a/src/api/sch/place.js b/src/api/sch/place.js index ea59c8b..b615e40 100644 --- a/src/api/sch/place.js +++ b/src/api/sch/place.js @@ -1,11 +1,11 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 获取地图数据 export function getMapData() { return request({ url: '/sch/place/list', method: 'get' - }) + }); } // 更新驾校状态 @@ -14,7 +14,7 @@ export async function updateSchoolStatus(data) { url: '/sch/place/updateSchool', method: 'put', data: data - }) + }); } // 保存场地状态 @@ -23,5 +23,5 @@ export function savePlace(data) { url: '/sch/place', method: 'post', data: data - }) + }); } diff --git a/src/api/sch/school.js b/src/api/sch/school.js index 2fda293..0bce887 100644 --- a/src/api/sch/school.js +++ b/src/api/sch/school.js @@ -1,36 +1,36 @@ -import request from '@/utils/request' +import request from '@/utils/request'; export default { pageList(data = {}) { return request({ - url: "/sch/school/list", - method: "get", - params: data, + url: '/sch/school/list', + method: 'get', + params: data }); }, getById(id) { return request({ url: `/sch/school/${id}`, - method: "get", + method: 'get' }); }, add(data = {}) { return request({ - url: "/sch/school", - method: "post", - data, + url: '/sch/school', + method: 'post', + data }); }, update(data = {}) { return request({ - url: "/sch/school", - method: "put", - data, + url: '/sch/school', + method: 'put', + data }); }, delete(id) { return request({ url: `/sch/school/${id}`, - method: "delete", + method: 'delete' }); } -} +}; diff --git a/src/api/system/config.js b/src/api/system/config.js index a404d82..d87985f 100644 --- a/src/api/system/config.js +++ b/src/api/system/config.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询参数列表 export function listConfig(query) { @@ -6,7 +6,7 @@ export function listConfig(query) { url: '/system/config/list', method: 'get', params: query - }) + }); } // 查询参数详细 @@ -14,7 +14,7 @@ export function getConfig(configId) { return request({ url: '/system/config/' + configId, method: 'get' - }) + }); } // 根据参数键名查询参数值 @@ -22,7 +22,7 @@ export function getConfigKey(configKey) { return request({ url: '/system/config/configKey/' + configKey, method: 'get' - }) + }); } // 新增参数配置 @@ -31,7 +31,7 @@ export function addConfig(data) { url: '/system/config', method: 'post', data: data - }) + }); } // 修改参数配置 @@ -40,7 +40,7 @@ export function updateConfig(data) { url: '/system/config', method: 'put', data: data - }) + }); } // 删除参数配置 @@ -48,7 +48,7 @@ export function delConfig(configId) { return request({ url: '/system/config/' + configId, method: 'delete' - }) + }); } // 刷新参数缓存 @@ -56,5 +56,5 @@ export function refreshCache() { return request({ url: '/system/config/refreshCache', method: 'delete' - }) + }); } diff --git a/src/api/system/dept.js b/src/api/system/dept.js index 494b284..fc0a4dd 100644 --- a/src/api/system/dept.js +++ b/src/api/system/dept.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询部门列表 export function listDept(query) { @@ -6,7 +6,7 @@ export function listDept(query) { url: '/system/dept/list', method: 'get', params: query - }) + }); } // 查询部门列表(排除节点) @@ -14,7 +14,7 @@ export function listDeptExcludeChild(deptId) { return request({ url: '/system/dept/list/exclude/' + deptId, method: 'get' - }) + }); } // 查询部门详细 @@ -22,7 +22,7 @@ export function getDept(deptId) { return request({ url: '/system/dept/' + deptId, method: 'get' - }) + }); } // 新增部门 @@ -31,7 +31,7 @@ export function addDept(data) { url: '/system/dept', method: 'post', data: data - }) + }); } // 修改部门 @@ -40,7 +40,7 @@ export function updateDept(data) { url: '/system/dept', method: 'put', data: data - }) + }); } // 删除部门 @@ -48,12 +48,12 @@ export function delDept(deptId) { return request({ url: '/system/dept/' + deptId, method: 'delete' - }) + }); } // 查询部门下拉树结构 export function deptTreeSelect() { return request({ url: '/system/dept/deptTree', method: 'get' - }) + }); } diff --git a/src/api/system/dict/data.js b/src/api/system/dict/data.js index 6c9eb79..118f62d 100644 --- a/src/api/system/dict/data.js +++ b/src/api/system/dict/data.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询字典数据列表 export function listData(query) { @@ -6,7 +6,7 @@ export function listData(query) { url: '/system/dict/data/list', method: 'get', params: query - }) + }); } // 查询字典数据详细 @@ -14,7 +14,7 @@ export function getData(dictCode) { return request({ url: '/system/dict/data/' + dictCode, method: 'get' - }) + }); } // 根据字典类型查询字典数据信息 @@ -22,7 +22,7 @@ export function getDicts(dictType) { return request({ url: '/system/dict/data/type/' + dictType, method: 'get' - }) + }); } // 新增字典数据 @@ -31,7 +31,7 @@ export function addData(data) { url: '/system/dict/data', method: 'post', data: data - }) + }); } // 修改字典数据 @@ -40,7 +40,7 @@ export function updateData(data) { url: '/system/dict/data', method: 'put', data: data - }) + }); } // 删除字典数据 @@ -48,5 +48,5 @@ export function delData(dictCode) { return request({ url: '/system/dict/data/' + dictCode, method: 'delete' - }) + }); } diff --git a/src/api/system/dict/type.js b/src/api/system/dict/type.js index a7a6e01..877c921 100644 --- a/src/api/system/dict/type.js +++ b/src/api/system/dict/type.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询字典类型列表 export function listType(query) { @@ -6,7 +6,7 @@ export function listType(query) { url: '/system/dict/type/list', method: 'get', params: query - }) + }); } // 查询字典类型详细 @@ -14,7 +14,7 @@ export function getType(dictId) { return request({ url: '/system/dict/type/' + dictId, method: 'get' - }) + }); } // 新增字典类型 @@ -23,7 +23,7 @@ export function addType(data) { url: '/system/dict/type', method: 'post', data: data - }) + }); } // 修改字典类型 @@ -32,7 +32,7 @@ export function updateType(data) { url: '/system/dict/type', method: 'put', data: data - }) + }); } // 删除字典类型 @@ -40,7 +40,7 @@ export function delType(dictId) { return request({ url: '/system/dict/type/' + dictId, method: 'delete' - }) + }); } // 刷新字典缓存 @@ -48,7 +48,7 @@ export function refreshCache() { return request({ url: '/system/dict/type/refreshCache', method: 'delete' - }) + }); } // 获取字典选择框列表 @@ -56,5 +56,5 @@ export function optionselect() { return request({ url: '/system/dict/type/optionselect', method: 'get' - }) -} \ No newline at end of file + }); +} diff --git a/src/api/system/employee.js b/src/api/system/employee.js index c07e3fa..b2d8db2 100644 --- a/src/api/system/employee.js +++ b/src/api/system/employee.js @@ -1,42 +1,42 @@ -import request from '@/utils/request' +import request from '@/utils/request'; export default { pageList(data = {}) { return request({ - url: "/system/employee/list", - method: "get", - params: data, + url: '/system/employee/list', + method: 'get', + params: data }); }, getById(id) { return request({ url: `/system/employee/${id}`, - method: "get", + method: 'get' }); }, add(data = {}) { return request({ - url: "/system/employee", - method: "post", - data, + url: '/system/employee', + method: 'post', + data }); }, update(data = {}) { return request({ - url: "/system/employee", - method: "put", - data, + url: '/system/employee', + method: 'put', + data }); }, delete(id) { return request({ url: `/system/employee/${id}`, - method: "delete", + method: 'delete' }); }, getEmployee() { return request({ - url: "/system/employee/getEmployees", - method: "get" + url: '/system/employee/getEmployees', + method: 'get' }); } -} +}; diff --git a/src/api/system/menu.js b/src/api/system/menu.js index f6415c6..7c9cbc7 100644 --- a/src/api/system/menu.js +++ b/src/api/system/menu.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询菜单列表 export function listMenu(query) { @@ -6,7 +6,7 @@ export function listMenu(query) { url: '/system/menu/list', method: 'get', params: query - }) + }); } // 查询菜单详细 @@ -14,7 +14,7 @@ export function getMenu(menuId) { return request({ url: '/system/menu/' + menuId, method: 'get' - }) + }); } // 查询菜单下拉树结构 @@ -22,7 +22,7 @@ export function treeselect() { return request({ url: '/system/menu/treeselect', method: 'get' - }) + }); } // 根据角色ID查询菜单下拉树结构 @@ -30,7 +30,7 @@ export function roleMenuTreeselect(roleId) { return request({ url: '/system/menu/roleMenuTreeselect/' + roleId, method: 'get' - }) + }); } // 新增菜单 @@ -39,7 +39,7 @@ export function addMenu(data) { url: '/system/menu', method: 'post', data: data - }) + }); } // 修改菜单 @@ -48,7 +48,7 @@ export function updateMenu(data) { url: '/system/menu', method: 'put', data: data - }) + }); } // 删除菜单 @@ -56,5 +56,5 @@ export function delMenu(menuId) { return request({ url: '/system/menu/' + menuId, method: 'delete' - }) -} \ No newline at end of file + }); +} diff --git a/src/api/system/notice.js b/src/api/system/notice.js index c274ea5..474c469 100644 --- a/src/api/system/notice.js +++ b/src/api/system/notice.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询公告列表 export function listNotice(query) { @@ -6,7 +6,7 @@ export function listNotice(query) { url: '/system/notice/list', method: 'get', params: query - }) + }); } // 查询公告详细 @@ -14,7 +14,7 @@ export function getNotice(noticeId) { return request({ url: '/system/notice/' + noticeId, method: 'get' - }) + }); } // 新增公告 @@ -23,7 +23,7 @@ export function addNotice(data) { url: '/system/notice', method: 'post', data: data - }) + }); } // 修改公告 @@ -32,7 +32,7 @@ export function updateNotice(data) { url: '/system/notice', method: 'put', data: data - }) + }); } // 删除公告 @@ -40,5 +40,5 @@ export function delNotice(noticeId) { return request({ url: '/system/notice/' + noticeId, method: 'delete' - }) -} \ No newline at end of file + }); +} diff --git a/src/api/system/post.js b/src/api/system/post.js index 1a8e9ca..edbe1eb 100644 --- a/src/api/system/post.js +++ b/src/api/system/post.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询岗位列表 export function listPost(query) { @@ -6,7 +6,7 @@ export function listPost(query) { url: '/system/post/list', method: 'get', params: query - }) + }); } // 查询岗位详细 @@ -14,7 +14,7 @@ export function getPost(postId) { return request({ url: '/system/post/' + postId, method: 'get' - }) + }); } // 新增岗位 @@ -23,7 +23,7 @@ export function addPost(data) { url: '/system/post', method: 'post', data: data - }) + }); } // 修改岗位 @@ -32,7 +32,7 @@ export function updatePost(data) { url: '/system/post', method: 'put', data: data - }) + }); } // 删除岗位 @@ -40,5 +40,5 @@ export function delPost(postId) { return request({ url: '/system/post/' + postId, method: 'delete' - }) + }); } diff --git a/src/api/system/role.js b/src/api/system/role.js index cc74ed8..e274a55 100644 --- a/src/api/system/role.js +++ b/src/api/system/role.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询角色列表 export function listRole(query) { @@ -6,7 +6,7 @@ export function listRole(query) { url: '/system/role/list', method: 'get', params: query - }) + }); } // 查询角色详细 @@ -14,7 +14,7 @@ export function getRole(roleId) { return request({ url: '/system/role/' + roleId, method: 'get' - }) + }); } // 新增角色 @@ -23,7 +23,7 @@ export function addRole(data) { url: '/system/role', method: 'post', data: data - }) + }); } // 修改角色 @@ -32,7 +32,7 @@ export function updateRole(data) { url: '/system/role', method: 'put', data: data - }) + }); } // 角色数据权限 @@ -41,7 +41,7 @@ export function dataScope(data) { url: '/system/role/dataScope', method: 'put', data: data - }) + }); } // 角色状态修改 @@ -49,12 +49,12 @@ export function changeRoleStatus(roleId, status) { const data = { roleId, status - } + }; return request({ url: '/system/role/changeStatus', method: 'put', data: data - }) + }); } // 删除角色 @@ -62,7 +62,7 @@ export function delRole(roleId) { return request({ url: '/system/role/' + roleId, method: 'delete' - }) + }); } // 查询角色已授权用户列表 @@ -71,7 +71,7 @@ export function allocatedUserList(query) { url: '/system/role/authUser/allocatedList', method: 'get', params: query - }) + }); } // 查询角色未授权用户列表 @@ -80,7 +80,7 @@ export function unallocatedUserList(query) { url: '/system/role/authUser/unallocatedList', method: 'get', params: query - }) + }); } // 取消用户授权角色 @@ -89,7 +89,7 @@ export function authUserCancel(data) { url: '/system/role/authUser/cancel', method: 'put', data: data - }) + }); } // 批量取消用户授权角色 @@ -98,7 +98,7 @@ export function authUserCancelAll(data) { url: '/system/role/authUser/cancelAll', method: 'put', params: data - }) + }); } // 授权用户选择 @@ -107,7 +107,7 @@ export function authUserSelectAll(data) { url: '/system/role/authUser/selectAll', method: 'put', params: data - }) + }); } // 根据角色ID查询部门树结构 @@ -115,14 +115,12 @@ export function deptTreeSelect(roleId) { return request({ url: '/system/role/deptTree/' + roleId, method: 'get' - }) + }); } - - export function getRoleOptions() { return request({ url: '/system/role/getRoles', method: 'get' - }) + }); } diff --git a/src/api/system/user.js b/src/api/system/user.js index 1801bfa..864b508 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -1,7 +1,5 @@ -import request from '@/utils/request' -import { - parseStrEmpty -} from "@/utils/ruoyi"; +import request from '@/utils/request'; +import { parseStrEmpty } from '@/utils/ruoyi'; // 查询用户列表 export function listUser(query) { @@ -9,7 +7,7 @@ export function listUser(query) { url: '/system/user/list', method: 'get', params: query - }) + }); } // 查询用户详细 @@ -17,7 +15,7 @@ export function getUser(userId) { return request({ url: '/system/user/' + parseStrEmpty(userId), method: 'get' - }) + }); } // 新增用户 @@ -26,7 +24,7 @@ export function addUser(data) { url: '/system/user', method: 'post', data: data - }) + }); } // 修改用户 @@ -35,7 +33,7 @@ export function updateUser(data) { url: '/system/user', method: 'put', data: data - }) + }); } // 删除用户 @@ -43,7 +41,7 @@ export function delUser(userId) { return request({ url: '/system/user/' + userId, method: 'delete' - }) + }); } // 用户密码重置 @@ -51,12 +49,12 @@ export function resetUserPwd(userId, password) { const data = { userId, password - } + }; return request({ url: '/system/user/resetPwd', method: 'put', data: data - }) + }); } // 用户状态修改 @@ -64,12 +62,12 @@ export function changeUserStatus(userId, status) { const data = { userId, status - } + }; return request({ url: '/system/user/changeStatus', method: 'put', data: data - }) + }); } // 查询用户个人信息 @@ -77,7 +75,7 @@ export function getUserProfile() { return request({ url: '/system/user/profile', method: 'get' - }) + }); } // 修改用户个人信息 @@ -86,7 +84,7 @@ export function updateUserProfile(data) { url: '/system/user/profile', method: 'put', data: data - }) + }); } // 用户密码重置 @@ -94,12 +92,12 @@ export function updateUserPwd(oldPassword, newPassword) { const data = { oldPassword, newPassword - } + }; return request({ url: '/system/user/profile/updatePwd', method: 'put', params: data - }) + }); } // 用户头像上传 @@ -108,7 +106,7 @@ export function uploadAvatar(data) { url: '/system/user/profile/avatar', method: 'post', data: data - }) + }); } // 查询授权角色 @@ -116,7 +114,7 @@ export function getAuthRole(userId) { return request({ url: '/system/user/authRole/' + userId, method: 'get' - }) + }); } // 保存授权角色 @@ -125,5 +123,5 @@ export function updateAuthRole(data) { url: '/system/user/authRole', method: 'put', params: data - }) + }); } diff --git a/src/api/tool/gen.js b/src/api/tool/gen.js index 4506927..a3547ff 100644 --- a/src/api/tool/gen.js +++ b/src/api/tool/gen.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询生成表数据 export function listTable(query) { @@ -6,7 +6,7 @@ export function listTable(query) { url: '/tool/gen/list', method: 'get', params: query - }) + }); } // 查询db数据库列表 export function listDbTable(query) { @@ -14,7 +14,7 @@ export function listDbTable(query) { url: '/tool/gen/db/list', method: 'get', params: query - }) + }); } // 查询表详细信息 @@ -22,7 +22,7 @@ export function getGenTable(tableId) { return request({ url: '/tool/gen/' + tableId, method: 'get' - }) + }); } // 修改代码生成信息 @@ -31,7 +31,7 @@ export function updateGenTable(data) { url: '/tool/gen', method: 'put', data: data - }) + }); } // 导入表 @@ -40,7 +40,7 @@ export function importTable(data) { url: '/tool/gen/importTable', method: 'post', params: data - }) + }); } // 预览生成代码 @@ -48,7 +48,7 @@ export function previewTable(tableId) { return request({ url: '/tool/gen/preview/' + tableId, method: 'get' - }) + }); } // 删除表数据 @@ -56,7 +56,7 @@ export function delTable(tableId) { return request({ url: '/tool/gen/' + tableId, method: 'delete' - }) + }); } // 生成代码(自定义路径) @@ -64,7 +64,7 @@ export function genCode(tableName) { return request({ url: '/tool/gen/genCode/' + tableName, method: 'get' - }) + }); } // 同步数据库 @@ -72,5 +72,5 @@ export function synchDb(tableName) { return request({ url: '/tool/gen/synchDb/' + tableName, method: 'get' - }) + }); } diff --git a/src/api/zs/clue.js b/src/api/zs/clue.js index 8ec3dd1..58785e0 100644 --- a/src/api/zs/clue.js +++ b/src/api/zs/clue.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询线索列表 export function getClueList(query) { @@ -6,7 +6,7 @@ export function getClueList(query) { url: '/zs/clue/list', method: 'get', params: query - }) + }); } // 新增线索 @@ -15,7 +15,7 @@ export function addClue(data) { url: '/zs/clue', method: 'post', data: data - }) + }); } // 修改线索 @@ -24,16 +24,16 @@ export function updateClue(data) { url: '/zs/clue', method: 'put', data: data - }) + }); } -//删除 +// 删除 export function deleteClue(data) { return request({ url: '/zs/clue', method: 'delete', params: data - }) + }); } // 导出 export function exportData(query) { @@ -41,7 +41,7 @@ export function exportData(query) { url: '/zs/clue/export', method: 'get', params: query - }) + }); } // 导入模板 @@ -50,7 +50,7 @@ export function importTemplate(param) { url: '/zs/clue/importTemplate', method: 'get', params: param - }) + }); } // 导入 export function importData(data) { @@ -58,61 +58,60 @@ export function importData(data) { url: '/zs/clue/importData', method: 'post', data: data - }) + }); } -//查询登记getSign +// 查询登记getSign export function getSign(query) { return request({ url: '/zs/clue/sign', method: 'get', params: query - }) + }); } -//保存登记 +// 保存登记 export function saveSign(data) { return request({ url: '/zs/clue/sign', method: 'post', data: data - }) + }); } -//甩单 +// 甩单 export function saveDistribute(data) { return request({ url: '/zs/clue/distribute', method: 'put', data: data - }) + }); } -//驳回 +// 驳回 export function refuse(data) { return request({ url: '/zs/clue/refuse', method: 'put', data: data - }) + }); } -//查询甩单记录 +// 查询甩单记录 export function getDistributeRecord(param) { return request({ url: '/zs/clue/distributerecord', method: 'get', params: param - }) + }); } -//查询跟踪记录 +// 查询跟踪记录 export function getFollowRecord(param) { return request({ url: '/zs/clue/followrecord', method: 'get', params: param - }) - + }); } // @@ -122,14 +121,14 @@ export function getConsultRecord(param) { url: '/zs/clue/consultrecord', method: 'get', params: param - }) + }); } // 获取已过期 export function getClueCountBadge() { return request({ url: `/zs/clue/badgeCount`, method: 'get' - }) + }); } // 批量更新 @@ -138,49 +137,49 @@ export function batchUpdate(data) { url: `/zs/clue/batchUpdate`, method: 'put', data: data - }) + }); } -//公海线索 getPublicList +// 公海线索 getPublicList export function getPublicList(param) { return request({ url: `/zs/clue/public/list`, method: 'get', params: param - }) + }); } -//拾取线索 +// 拾取线索 export function pickupClue(data) { return request({ url: `/zs/clue/public/pickup`, method: 'put', data: data - }) + }); } -//丢弃线索 +// 丢弃线索 export function discardClue(data) { return request({ url: `/zs/clue/public/discard`, method: 'put', data: data - }) + }); } -//查询接收 +// 查询接收 export function getAccept() { return request({ url: `/zs/clue/accept`, method: 'get' - }) + }); } -//丢弃线索 +// 丢弃线索 export function updateAccept(data) { return request({ url: `/zs/clue/accept`, method: 'put', data: data - }) + }); } diff --git a/src/api/zs/sign.js b/src/api/zs/sign.js index 32dae0b..de910a1 100644 --- a/src/api/zs/sign.js +++ b/src/api/zs/sign.js @@ -1,4 +1,4 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 查询线索列表 export function getSignList(query) { @@ -6,7 +6,7 @@ export function getSignList(query) { url: '/zs/sign/list', method: 'get', params: query - }) + }); } // 导出 @@ -15,7 +15,7 @@ export function exportData(query) { url: '/zs/sign/export', method: 'get', params: query - }) + }); } // 导入模板 @@ -23,7 +23,7 @@ export function importTemplate() { return request({ url: '/zs/sign/importTemplate', method: 'get' - }) + }); } // 导入 export function importData(data) { @@ -31,16 +31,15 @@ export function importData(data) { url: '/zs/sign/importData', method: 'post', data: data - }) + }); } - export function addSign(data) { return request({ url: '/zs/sign', method: 'post', data: data - }) + }); } export function updateSign(data) { @@ -48,7 +47,7 @@ export function updateSign(data) { url: '/zs/sign', method: 'put', data: data - }) + }); } export function getClues(param) { @@ -56,34 +55,31 @@ export function getClues(param) { url: '/zs/sign/clue', method: 'get', params: param - }) + }); } - - export function deleteSign(data) { return request({ url: '/zs/sign', method: 'delete', params: data - }) + }); } -//审核登记 +// 审核登记 export function checkSign(data) { return request({ url: '/zs/sign/check', method: 'put', data: data - }) + }); } - -//审核记录 +// 审核记录 export function getCheckRecord(data) { return request({ url: '/zs/sign/check', method: 'get', params: data - }) + }); } diff --git a/src/assets/icons/index.js b/src/assets/icons/index.js index 2c6b309..11560ed 100644 --- a/src/assets/icons/index.js +++ b/src/assets/icons/index.js @@ -1,9 +1,9 @@ -import Vue from 'vue' -import SvgIcon from '@/components/SvgIcon'// svg component +import Vue from 'vue'; +import SvgIcon from '@/components/SvgIcon'; // svg component // register globally -Vue.component('svg-icon', SvgIcon) +Vue.component('SvgIcon', SvgIcon); -const req = require.context('./svg', false, /\.svg$/) -const requireAll = requireContext => requireContext.keys().map(requireContext) -requireAll(req) +const req = require.context('./svg', false, /\.svg$/); +const requireAll = (requireContext) => requireContext.keys().map(requireContext); +requireAll(req); diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue index 1696f54..f48aa13 100644 --- a/src/components/Breadcrumb/index.vue +++ b/src/components/Breadcrumb/index.vue @@ -14,49 +14,54 @@ export default { data() { return { levelList: null - } + }; }, watch: { $route(route) { // if you go to the redirect page, do not update the breadcrumbs if (route.path.startsWith('/redirect/')) { - return + return; } - this.getBreadcrumb() + this.getBreadcrumb(); } }, created() { - this.getBreadcrumb() + this.getBreadcrumb(); }, methods: { getBreadcrumb() { // only show routes with meta.title - let matched = this.$route.matched.filter(item => item.meta && item.meta.title) - const first = matched[0] + let matched = this.$route.matched.filter((item) => item.meta && item.meta.title); + const first = matched[0]; if (!this.isDashboard(first)) { - matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched) + matched = [ + { + path: '/index', + meta: { title: '首页' } + } + ].concat(matched); } - this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) + this.levelList = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false); }, isDashboard(route) { - const name = route && route.name + const name = route && route.name; if (!name) { - return false + return false; } - return name.trim() === 'Index' + return name.trim() === 'Index'; }, handleLink(item) { - const { redirect, path } = item + const { redirect, path } = item; if (redirect) { - this.$router.push(redirect) - return + this.$router.push(redirect); + return; } - this.$router.push(path) + this.$router.push(path); } } -} +}; \ No newline at end of file + diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 6bb5a18..56677a5 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -1,98 +1,86 @@ diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index 6c583cf..2d9cce7 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -1,23 +1,10 @@ diff --git a/src/components/IconSelect/requireIcons.js b/src/components/IconSelect/requireIcons.js index 99e5c54..7630b0f 100644 --- a/src/components/IconSelect/requireIcons.js +++ b/src/components/IconSelect/requireIcons.js @@ -1,11 +1,10 @@ +const req = require.context('../../assets/icons/svg', false, /\.svg$/); +const requireAll = (requireContext) => requireContext.keys(); -const req = require.context('../../assets/icons/svg', false, /\.svg$/) -const requireAll = requireContext => requireContext.keys() +const re = /\.\/(.*)\.svg/; -const re = /\.\/(.*)\.svg/ +const icons = requireAll(req).map((i) => { + return i.match(re)[1]; +}); -const icons = requireAll(req).map(i => { - return i.match(re)[1] -}) - -export default icons +export default icons; diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue index 3c770c7..2efce46 100644 --- a/src/components/ImagePreview/index.vue +++ b/src/components/ImagePreview/index.vue @@ -1,33 +1,28 @@ diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index b57a15e..198f3b5 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -1,49 +1,25 @@ diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue index 1714e1f..f91428e 100644 --- a/src/components/ThemePicker/index.vue +++ b/src/components/ThemePicker/index.vue @@ -1,158 +1,153 @@ diff --git a/src/layout/components/Sidebar/FixiOSBug.js b/src/layout/components/Sidebar/FixiOSBug.js index 6823726..2554996 100644 --- a/src/layout/components/Sidebar/FixiOSBug.js +++ b/src/layout/components/Sidebar/FixiOSBug.js @@ -1,25 +1,25 @@ export default { computed: { device() { - return this.$store.state.app.device + return this.$store.state.app.device; } }, mounted() { // In order to fix the click on menu on the ios device will trigger the mouseleave bug - this.fixBugIniOS() + this.fixBugIniOS(); }, methods: { fixBugIniOS() { - const $subMenu = this.$refs.subMenu + const $subMenu = this.$refs.subMenu; if ($subMenu) { - const handleMouseleave = $subMenu.handleMouseleave + const handleMouseleave = $subMenu.handleMouseleave; $subMenu.handleMouseleave = (e) => { if (this.device === 'mobile') { - return + return; } - handleMouseleave(e) - } + handleMouseleave(e); + }; } } } -} +}; diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue index be3285d..8d1e9e7 100644 --- a/src/layout/components/Sidebar/Item.vue +++ b/src/layout/components/Sidebar/Item.vue @@ -1,3 +1,4 @@ + diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue index 8b0bc93..604b63a 100644 --- a/src/layout/components/Sidebar/Link.vue +++ b/src/layout/components/Sidebar/Link.vue @@ -5,7 +5,7 @@ diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index 4853fbb..0102d7f 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -12,24 +12,17 @@ - + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 51d0839..861ff6f 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -1,57 +1,43 @@ diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue index bb753a1..cdd7a8f 100644 --- a/src/layout/components/TagsView/ScrollPane.vue +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -5,75 +5,75 @@ diff --git a/src/layout/mixin/ResizeHandler.js b/src/layout/mixin/ResizeHandler.js index e8d0df8..653234f 100644 --- a/src/layout/mixin/ResizeHandler.js +++ b/src/layout/mixin/ResizeHandler.js @@ -1,45 +1,45 @@ -import store from '@/store' +import store from '@/store'; -const { body } = document -const WIDTH = 992 // refer to Bootstrap's responsive design +const { body } = document; +const WIDTH = 992; // refer to Bootstrap's responsive design export default { watch: { $route(route) { if (this.device === 'mobile' && this.sidebar.opened) { - store.dispatch('app/closeSideBar', { withoutAnimation: false }) + store.dispatch('app/closeSideBar', { withoutAnimation: false }); } } }, beforeMount() { - window.addEventListener('resize', this.$_resizeHandler) + window.addEventListener('resize', this.$_resizeHandler); }, beforeDestroy() { - window.removeEventListener('resize', this.$_resizeHandler) + window.removeEventListener('resize', this.$_resizeHandler); }, mounted() { - const isMobile = this.$_isMobile() + const isMobile = this.$_isMobile(); if (isMobile) { - store.dispatch('app/toggleDevice', 'mobile') - store.dispatch('app/closeSideBar', { withoutAnimation: true }) + store.dispatch('app/toggleDevice', 'mobile'); + store.dispatch('app/closeSideBar', { withoutAnimation: true }); } }, methods: { // use $_ for mixins properties // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential $_isMobile() { - const rect = body.getBoundingClientRect() - return rect.width - 1 < WIDTH + const rect = body.getBoundingClientRect(); + return rect.width - 1 < WIDTH; }, $_resizeHandler() { if (!document.hidden) { - const isMobile = this.$_isMobile() - store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + const isMobile = this.$_isMobile(); + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop'); if (isMobile) { - store.dispatch('app/closeSideBar', { withoutAnimation: true }) + store.dispatch('app/closeSideBar', { withoutAnimation: true }); } } } } -} +}; diff --git a/src/main.js b/src/main.js index ca0b1b1..ad6da66 100644 --- a/src/main.js +++ b/src/main.js @@ -19,38 +19,9 @@ import './global'; import './assets/icons'; // icon import './permission'; // permission control -import { - download -} from '@/utils/request' -import { - getDicts -} from "@/api/system/dict/data"; -import { - getConfigKey -} from "@/api/system/config"; -import { - parseTime, - resetForm, - addDateRange, - selectDictLabel, - selectDictLabels, - handleTree -} from "@/utils/ruoyi"; - // 头部标签组件 import VueMeta from 'vue-meta'; -// 全局方法挂载 -Vue.prototype.getDicts = getDicts -Vue.prototype.getConfigKey = getConfigKey -Vue.prototype.parseTime = parseTime -Vue.prototype.resetForm = resetForm -Vue.prototype.addDateRange = addDateRange -Vue.prototype.selectDictLabel = selectDictLabel -Vue.prototype.selectDictLabels = selectDictLabels -Vue.prototype.download = download -Vue.prototype.handleTree = handleTree - import Mixin from './mixins/Mixin'; Vue.mixin(Mixin); diff --git a/src/plugins/cache.js b/src/plugins/cache.js index 6b5c00b..719dbb1 100644 --- a/src/plugins/cache.js +++ b/src/plugins/cache.js @@ -1,69 +1,69 @@ const sessionCache = { - set (key, value) { + set(key, value) { if (!sessionStorage) { - return + return; } if (key != null && value != null) { - sessionStorage.setItem(key, value) + sessionStorage.setItem(key, value); } }, - get (key) { + get(key) { if (!sessionStorage) { - return null + return null; } if (key == null) { - return null + return null; } - return sessionStorage.getItem(key) + return sessionStorage.getItem(key); }, - setJSON (key, jsonValue) { + setJSON(key, jsonValue) { if (jsonValue != null) { - this.set(key, JSON.stringify(jsonValue)) + this.set(key, JSON.stringify(jsonValue)); } }, - getJSON (key) { - const value = this.get(key) + getJSON(key) { + const value = this.get(key); if (value != null) { - return JSON.parse(value) + return JSON.parse(value); } }, - remove (key) { + remove(key) { sessionStorage.removeItem(key); } -} +}; const localCache = { - set (key, value) { + set(key, value) { if (!localStorage) { - return + return; } if (key != null && value != null) { - localStorage.setItem(key, value) + localStorage.setItem(key, value); } }, - get (key) { + get(key) { if (!localStorage) { - return null + return null; } if (key == null) { - return null + return null; } - return localStorage.getItem(key) + return localStorage.getItem(key); }, - setJSON (key, jsonValue) { + setJSON(key, jsonValue) { if (jsonValue != null) { - this.set(key, JSON.stringify(jsonValue)) + this.set(key, JSON.stringify(jsonValue)); } }, - getJSON (key) { - const value = this.get(key) + getJSON(key) { + const value = this.get(key); if (value != null) { - return JSON.parse(value) + return JSON.parse(value); } }, - remove (key) { + remove(key) { localStorage.removeItem(key); } -} +}; export default { /** @@ -74,4 +74,4 @@ export default { * 本地缓存 */ local: localCache -} +}; diff --git a/src/plugins/modal.js b/src/plugins/modal.js index b37ca14..a3a1663 100644 --- a/src/plugins/modal.js +++ b/src/plugins/modal.js @@ -1,43 +1,43 @@ -import { Message, MessageBox, Notification, Loading } from 'element-ui' +import { Message, MessageBox, Notification, Loading } from 'element-ui'; let loadingInstance; export default { // 消息提示 msg(content) { - Message.info(content) + Message.info(content); }, // 错误消息 msgError(content) { - Message.error(content) + Message.error(content); }, // 成功消息 msgSuccess(content) { - Message.success(content) + Message.success(content); }, // 警告消息 msgWarning(content) { - Message.warning(content) + Message.warning(content); }, // 弹出提示 alert(content) { - MessageBox.alert(content, "系统提示") + MessageBox.alert(content, '系统提示'); }, // 错误提示 alertError(content) { - MessageBox.alert(content, "系统提示", { type: 'error' }) + MessageBox.alert(content, '系统提示', { type: 'error' }); }, // 成功提示 alertSuccess(content) { - MessageBox.alert(content, "系统提示", { type: 'success' }) + MessageBox.alert(content, '系统提示', { type: 'success' }); }, // 警告提示 alertWarning(content) { - MessageBox.alert(content, "系统提示", { type: 'warning' }) + MessageBox.alert(content, '系统提示', { type: 'warning' }); }, // 通知提示 notify(content) { - Notification.info(content) + Notification.info(content); }, // 错误通知 notifyError(content) { @@ -45,39 +45,39 @@ export default { }, // 成功通知 notifySuccess(content) { - Notification.success(content) + Notification.success(content); }, // 警告通知 notifyWarning(content) { - Notification.warning(content) + Notification.warning(content); }, // 确认窗体 confirm(content) { - return MessageBox.confirm(content, "系统提示", { + return MessageBox.confirm(content, '系统提示', { confirmButtonText: '确定', cancelButtonText: '取消', - type: "warning", - }) + type: 'warning' + }); }, // 提交内容 prompt(content) { - return MessageBox.prompt(content, "系统提示", { + return MessageBox.prompt(content, '系统提示', { confirmButtonText: '确定', cancelButtonText: '取消', - type: "warning", - }) + type: 'warning' + }); }, // 打开遮罩层 loading(content) { loadingInstance = Loading.service({ lock: true, text: content, - spinner: "el-icon-loading", - background: "rgba(0, 0, 0, 0.7)", - }) + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); }, // 关闭遮罩层 closeLoading() { loadingInstance.close(); } -} +}; diff --git a/src/plugins/tab.js b/src/plugins/tab.js index cade9f7..728a8b1 100644 --- a/src/plugins/tab.js +++ b/src/plugins/tab.js @@ -1,4 +1,4 @@ -import store from '@/store' +import store from '@/store'; import router from '@/router'; export default { @@ -15,16 +15,16 @@ export default { }); } return store.dispatch('tagsView/delCachedView', obj).then(() => { - const { path, query } = obj + const { path, query } = obj; router.replace({ path: '/redirect' + path, query: query - }) - }) + }); + }); }, // 关闭当前tab页签,打开新页签 closeOpenPage(obj) { - store.dispatch("tagsView/delView", router.currentRoute); + store.dispatch('tagsView/delView', router.currentRoute); if (obj !== undefined) { return router.push(obj); } @@ -56,7 +56,12 @@ export default { }, // 添加tab页签 openPage(title, url, params) { - var obj = { path: url, meta: { title: title } } + var obj = { + path: url, + meta: { + title: title + } + }; store.dispatch('tagsView/addView', obj); return router.push({ path: url, query: params }); }, @@ -64,4 +69,4 @@ export default { updatePage(obj) { return store.dispatch('tagsView/updateVisitedView', obj); } -} +}; diff --git a/src/router/index.js b/src/router/index.js index e3d15f0..4a90961 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -29,14 +29,17 @@ import Layout from '@/layout'; */ // 公共路由 -export const constantRoutes = [{ +export const constantRoutes = [ + { path: '/redirect', component: Layout, hidden: true, - children: [{ - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect') - }] + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect') + } + ] }, { path: '/login', @@ -62,16 +65,18 @@ export const constantRoutes = [{ path: '', component: Layout, redirect: 'index', - children: [{ - path: 'index', - component: () => import('@/views/index'), - name: 'Index', - meta: { - title: '首页', - icon: 'dashboard', - affix: true + children: [ + { + path: 'index', + component: () => import('@/views/index'), + name: 'Index', + meta: { + title: '首页', + icon: 'dashboard', + affix: true + } } - }] + ] }, // { // path: '/demo', @@ -106,78 +111,89 @@ export const constantRoutes = [{ component: Layout, hidden: true, redirect: 'noredirect', - children: [{ - path: 'profile', - component: () => import('@/views/system/user/profile/index'), - name: 'Profile', - meta: { - title: '个人中心', - icon: 'user' + children: [ + { + path: 'profile', + component: () => import('@/views/system/user/profile/index'), + name: 'Profile', + meta: { + title: '个人中心', + icon: 'user' + } } - }] + ] } ]; // 动态路由,基于用户权限动态去加载 -export const dynamicRoutes = [{ +export const dynamicRoutes = [ + { path: '/system/user-auth', component: Layout, hidden: true, permissions: ['system:user:edit'], - children: [{ - path: 'role/:userId(\\d+)', - component: () => import('@/views/system/user/authRole'), - name: 'AuthRole', - meta: { - title: '分配角色', - activeMenu: '/system/user' + children: [ + { + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: { + title: '分配角色', + activeMenu: '/system/user' + } } - }] + ] }, { path: '/system/role-auth', component: Layout, hidden: true, permissions: ['system:role:edit'], - children: [{ - path: 'user/:roleId(\\d+)', - component: () => import('@/views/system/role/authUser'), - name: 'AuthUser', - meta: { - title: '分配用户', - activeMenu: '/system/role' + children: [ + { + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: { + title: '分配用户', + activeMenu: '/system/role' + } } - }] + ] }, { path: '/system/dict-data', component: Layout, hidden: true, permissions: ['system:dict:list'], - children: [{ - path: 'index/:dictId(\\d+)', - component: () => import('@/views/system/dict/data'), - name: 'Data', - meta: { - title: '字典数据', - activeMenu: '/system/dict' + children: [ + { + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data'), + name: 'Data', + meta: { + title: '字典数据', + activeMenu: '/system/dict' + } } - }] + ] }, { path: '/monitor/job-log', component: Layout, hidden: true, permissions: ['monitor:job:list'], - children: [{ - path: 'index', - component: () => import('@/views/monitor/job/log'), - name: 'JobLog', - meta: { - title: '调度日志', - activeMenu: '/monitor/job' + children: [ + { + path: 'index', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: { + title: '调度日志', + activeMenu: '/monitor/job' + } } - }] + ] } ]; diff --git a/src/settings.js b/src/settings.js index 6a0b09f..d5cd23e 100644 --- a/src/settings.js +++ b/src/settings.js @@ -41,4 +41,4 @@ module.exports = { * If you want to also use it in dev, you can pass ['production', 'development'] */ errorLog: 'production' -} +}; diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 3e22d1c..6bd7bb3 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -1,4 +1,4 @@ -import Cookies from 'js-cookie' +import Cookies from 'js-cookie'; const state = { sidebar: { @@ -8,59 +8,59 @@ const state = { }, device: 'desktop', size: Cookies.get('size') || 'medium' -} +}; const mutations = { - TOGGLE_SIDEBAR: state => { + TOGGLE_SIDEBAR: (state) => { if (state.sidebar.hide) { return false; } - state.sidebar.opened = !state.sidebar.opened - state.sidebar.withoutAnimation = false + state.sidebar.opened = !state.sidebar.opened; + state.sidebar.withoutAnimation = false; if (state.sidebar.opened) { - Cookies.set('sidebarStatus', 1) + Cookies.set('sidebarStatus', 1); } else { - Cookies.set('sidebarStatus', 0) + Cookies.set('sidebarStatus', 0); } }, CLOSE_SIDEBAR: (state, withoutAnimation) => { - Cookies.set('sidebarStatus', 0) - state.sidebar.opened = false - state.sidebar.withoutAnimation = withoutAnimation + Cookies.set('sidebarStatus', 0); + state.sidebar.opened = false; + state.sidebar.withoutAnimation = withoutAnimation; }, TOGGLE_DEVICE: (state, device) => { - state.device = device + state.device = device; }, SET_SIZE: (state, size) => { - state.size = size - Cookies.set('size', size) + state.size = size; + Cookies.set('size', size); }, SET_SIDEBAR_HIDE: (state, status) => { - state.sidebar.hide = status + state.sidebar.hide = status; } -} +}; const actions = { toggleSideBar({ commit }) { - commit('TOGGLE_SIDEBAR') + commit('TOGGLE_SIDEBAR'); }, closeSideBar({ commit }, { withoutAnimation }) { - commit('CLOSE_SIDEBAR', withoutAnimation) + commit('CLOSE_SIDEBAR', withoutAnimation); }, toggleDevice({ commit }, device) { - commit('TOGGLE_DEVICE', device) + commit('TOGGLE_DEVICE', device); }, setSize({ commit }, size) { - commit('SET_SIZE', size) + commit('SET_SIZE', size); }, toggleSideBarHide({ commit }, status) { - commit('SET_SIDEBAR_HIDE', status) + commit('SET_SIDEBAR_HIDE', status); } -} +}; export default { namespaced: true, state, mutations, actions -} +}; diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js index f95bead..5ce76c1 100644 --- a/src/store/modules/dict.js +++ b/src/store/modules/dict.js @@ -1,50 +1,50 @@ const state = { - dict: new Array() -} + dict: [] +}; const mutations = { SET_DICT: (state, { key, value }) => { - if (key !== null && key !== "") { + if (key !== null && key !== '') { state.dict.push({ key: key, value: value - }) + }); } }, REMOVE_DICT: (state, key) => { try { for (let i = 0; i < state.dict.length; i++) { - if (state.dict[i].key == key) { - state.dict.splice(i, i) - return true + if (state.dict[i].key === key) { + state.dict.splice(i, i); + return true; } } } catch (e) { + console.log(e); } }, CLEAN_DICT: (state) => { - state.dict = new Array() + state.dict = []; } -} +}; const actions = { // 设置字典 setDict({ commit }, data) { - commit('SET_DICT', data) + commit('SET_DICT', data); }, // 删除字典 removeDict({ commit }, key) { - commit('REMOVE_DICT', key) + commit('REMOVE_DICT', key); }, // 清空字典 cleanDict({ commit }) { - commit('CLEAN_DICT') + commit('CLEAN_DICT'); } -} +}; export default { namespaced: true, state, mutations, actions -} - +}; diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 2455a1e..9b5b25c 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -1,8 +1,8 @@ -import defaultSettings from '@/settings' +import defaultSettings from '@/settings'; -const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings +const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings; -const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' +const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''; const state = { title: '', theme: storageSetting.theme || '#409EFF', @@ -13,30 +13,30 @@ const state = { fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader, sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo, dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle -} +}; const mutations = { CHANGE_SETTING: (state, { key, value }) => { + // eslint-disable-next-line no-prototype-builtins if (state.hasOwnProperty(key)) { - state[key] = value + state[key] = value; } } -} +}; const actions = { // 修改布局设置 changeSetting({ commit }, data) { - commit('CHANGE_SETTING', data) + commit('CHANGE_SETTING', data); }, // 设置网页标题 setTitle({ commit }, title) { - state.title = title + state.title = title; } -} +}; export default { namespaced: true, state, mutations, actions -} - +}; diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index 5fc011c..23b6497 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -2,227 +2,227 @@ const state = { visitedViews: [], cachedViews: [], iframeViews: [] -} +}; const mutations = { ADD_IFRAME_VIEW: (state, view) => { - if (state.iframeViews.some(v => v.path === view.path)) return + if (state.iframeViews.some((v) => v.path === view.path)) return; state.iframeViews.push( Object.assign({}, view, { title: view.meta.title || 'no-name' }) - ) + ); }, ADD_VISITED_VIEW: (state, view) => { - if (state.visitedViews.some(v => v.path === view.path)) return + if (state.visitedViews.some((v) => v.path === view.path)) return; state.visitedViews.push( Object.assign({}, view, { title: view.meta.title || 'no-name' }) - ) + ); }, ADD_CACHED_VIEW: (state, view) => { - if (state.cachedViews.includes(view.name)) return + if (state.cachedViews.includes(view.name)) return; if (view.meta && !view.meta.noCache) { - state.cachedViews.push(view.name) + state.cachedViews.push(view.name); } }, DEL_VISITED_VIEW: (state, view) => { for (const [i, v] of state.visitedViews.entries()) { if (v.path === view.path) { - state.visitedViews.splice(i, 1) - break + state.visitedViews.splice(i, 1); + break; } } - state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) + state.iframeViews = state.iframeViews.filter((item) => item.path !== view.path); }, DEL_IFRAME_VIEW: (state, view) => { - state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) + state.iframeViews = state.iframeViews.filter((item) => item.path !== view.path); }, DEL_CACHED_VIEW: (state, view) => { - const index = state.cachedViews.indexOf(view.name) - index > -1 && state.cachedViews.splice(index, 1) + const index = state.cachedViews.indexOf(view.name); + index > -1 && state.cachedViews.splice(index, 1); }, DEL_OTHERS_VISITED_VIEWS: (state, view) => { - state.visitedViews = state.visitedViews.filter(v => { - return v.meta.affix || v.path === view.path - }) - state.iframeViews = state.iframeViews.filter(item => item.path === view.path) + state.visitedViews = state.visitedViews.filter((v) => { + return v.meta.affix || v.path === view.path; + }); + state.iframeViews = state.iframeViews.filter((item) => item.path === view.path); }, DEL_OTHERS_CACHED_VIEWS: (state, view) => { - const index = state.cachedViews.indexOf(view.name) + const index = state.cachedViews.indexOf(view.name); if (index > -1) { - state.cachedViews = state.cachedViews.slice(index, index + 1) + state.cachedViews = state.cachedViews.slice(index, index + 1); } else { - state.cachedViews = [] + state.cachedViews = []; } }, - DEL_ALL_VISITED_VIEWS: state => { + DEL_ALL_VISITED_VIEWS: (state) => { // keep affix tags - const affixTags = state.visitedViews.filter(tag => tag.meta.affix) - state.visitedViews = affixTags - state.iframeViews = [] + const affixTags = state.visitedViews.filter((tag) => tag.meta.affix); + state.visitedViews = affixTags; + state.iframeViews = []; }, - DEL_ALL_CACHED_VIEWS: state => { - state.cachedViews = [] + DEL_ALL_CACHED_VIEWS: (state) => { + state.cachedViews = []; }, UPDATE_VISITED_VIEW: (state, view) => { for (let v of state.visitedViews) { if (v.path === view.path) { - v = Object.assign(v, view) - break + v = Object.assign(v, view); + break; } } }, DEL_RIGHT_VIEWS: (state, view) => { - const index = state.visitedViews.findIndex(v => v.path === view.path) + const index = state.visitedViews.findIndex((v) => v.path === view.path); if (index === -1) { - return + return; } state.visitedViews = state.visitedViews.filter((item, idx) => { if (idx <= index || (item.meta && item.meta.affix)) { - return true + return true; } - const i = state.cachedViews.indexOf(item.name) + const i = state.cachedViews.indexOf(item.name); if (i > -1) { - state.cachedViews.splice(i, 1) + state.cachedViews.splice(i, 1); } - if(item.meta.link) { - const fi = state.iframeViews.findIndex(v => v.path === item.path) - state.iframeViews.splice(fi, 1) + if (item.meta.link) { + const fi = state.iframeViews.findIndex((v) => v.path === item.path); + state.iframeViews.splice(fi, 1); } - return false - }) + return false; + }); }, DEL_LEFT_VIEWS: (state, view) => { - const index = state.visitedViews.findIndex(v => v.path === view.path) + const index = state.visitedViews.findIndex((v) => v.path === view.path); if (index === -1) { - return + return; } state.visitedViews = state.visitedViews.filter((item, idx) => { if (idx >= index || (item.meta && item.meta.affix)) { - return true + return true; } - const i = state.cachedViews.indexOf(item.name) + const i = state.cachedViews.indexOf(item.name); if (i > -1) { - state.cachedViews.splice(i, 1) + state.cachedViews.splice(i, 1); } - if(item.meta.link) { - const fi = state.iframeViews.findIndex(v => v.path === item.path) - state.iframeViews.splice(fi, 1) + if (item.meta.link) { + const fi = state.iframeViews.findIndex((v) => v.path === item.path); + state.iframeViews.splice(fi, 1); } - return false - }) + return false; + }); } -} +}; const actions = { addView({ dispatch }, view) { - dispatch('addVisitedView', view) - dispatch('addCachedView', view) + dispatch('addVisitedView', view); + dispatch('addCachedView', view); }, addIframeView({ commit }, view) { - commit('ADD_IFRAME_VIEW', view) + commit('ADD_IFRAME_VIEW', view); }, addVisitedView({ commit }, view) { - commit('ADD_VISITED_VIEW', view) + commit('ADD_VISITED_VIEW', view); }, addCachedView({ commit }, view) { - commit('ADD_CACHED_VIEW', view) + commit('ADD_CACHED_VIEW', view); }, delView({ dispatch, state }, view) { - return new Promise(resolve => { - dispatch('delVisitedView', view) - dispatch('delCachedView', view) + return new Promise((resolve) => { + dispatch('delVisitedView', view); + dispatch('delCachedView', view); resolve({ visitedViews: [...state.visitedViews], cachedViews: [...state.cachedViews] - }) - }) + }); + }); }, delVisitedView({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_VISITED_VIEW', view) - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit('DEL_VISITED_VIEW', view); + resolve([...state.visitedViews]); + }); }, delIframeView({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_IFRAME_VIEW', view) - resolve([...state.iframeViews]) - }) + return new Promise((resolve) => { + commit('DEL_IFRAME_VIEW', view); + resolve([...state.iframeViews]); + }); }, delCachedView({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_CACHED_VIEW', view) - resolve([...state.cachedViews]) - }) + return new Promise((resolve) => { + commit('DEL_CACHED_VIEW', view); + resolve([...state.cachedViews]); + }); }, delOthersViews({ dispatch, state }, view) { - return new Promise(resolve => { - dispatch('delOthersVisitedViews', view) - dispatch('delOthersCachedViews', view) + return new Promise((resolve) => { + dispatch('delOthersVisitedViews', view); + dispatch('delOthersCachedViews', view); resolve({ visitedViews: [...state.visitedViews], cachedViews: [...state.cachedViews] - }) - }) + }); + }); }, delOthersVisitedViews({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_OTHERS_VISITED_VIEWS', view) - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit('DEL_OTHERS_VISITED_VIEWS', view); + resolve([...state.visitedViews]); + }); }, delOthersCachedViews({ commit, state }, view) { - return new Promise(resolve => { - commit('DEL_OTHERS_CACHED_VIEWS', view) - resolve([...state.cachedViews]) - }) + return new Promise((resolve) => { + commit('DEL_OTHERS_CACHED_VIEWS', view); + resolve([...state.cachedViews]); + }); }, delAllViews({ dispatch, state }, view) { - return new Promise(resolve => { - dispatch('delAllVisitedViews', view) - dispatch('delAllCachedViews', view) + return new Promise((resolve) => { + dispatch('delAllVisitedViews', view); + dispatch('delAllCachedViews', view); resolve({ visitedViews: [...state.visitedViews], cachedViews: [...state.cachedViews] - }) - }) + }); + }); }, delAllVisitedViews({ commit, state }) { - return new Promise(resolve => { - commit('DEL_ALL_VISITED_VIEWS') - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit('DEL_ALL_VISITED_VIEWS'); + resolve([...state.visitedViews]); + }); }, delAllCachedViews({ commit, state }) { - return new Promise(resolve => { - commit('DEL_ALL_CACHED_VIEWS') - resolve([...state.cachedViews]) - }) + return new Promise((resolve) => { + commit('DEL_ALL_CACHED_VIEWS'); + resolve([...state.cachedViews]); + }); }, updateVisitedView({ commit }, view) { - commit('UPDATE_VISITED_VIEW', view) + commit('UPDATE_VISITED_VIEW', view); }, delRightTags({ commit }, view) { - return new Promise(resolve => { - commit('DEL_RIGHT_VIEWS', view) - resolve([...state.visitedViews]) - }) + return new Promise((resolve) => { + commit('DEL_RIGHT_VIEWS', view); + resolve([...state.visitedViews]); + }); }, delLeftTags({ commit }, view) { - return new Promise(resolve => { - commit('DEL_LEFT_VIEWS', view) - resolve([...state.visitedViews]) - }) - }, -} + return new Promise((resolve) => { + commit('DEL_LEFT_VIEWS', view); + resolve([...state.visitedViews]); + }); + } +}; export default { namespaced: true, state, mutations, actions -} +}; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index ab0a6fe..83f6b01 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,5 +1,5 @@ -import { login, logout, getInfo } from '@/api/login' -import { getToken, setToken, removeToken } from '@/utils/auth' +import { login, logout, getInfo } from '@/api/login'; +import { getToken, setToken, removeToken } from '@/utils/auth'; const user = { state: { @@ -12,85 +12,93 @@ const user = { mutations: { SET_TOKEN: (state, token) => { - state.token = token + state.token = token; }, SET_NAME: (state, name) => { - state.name = name + state.name = name; }, SET_AVATAR: (state, avatar) => { - state.avatar = avatar + state.avatar = avatar; }, SET_ROLES: (state, roles) => { - state.roles = roles + state.roles = roles; }, SET_PERMISSIONS: (state, permissions) => { - state.permissions = permissions + state.permissions = permissions; } }, actions: { // 登录 Login({ commit }, userInfo) { - const username = userInfo.username.trim() - const password = userInfo.password - const code = userInfo.code - const uuid = userInfo.uuid + const username = userInfo.username.trim(); + const password = userInfo.password; + const code = userInfo.code; + const uuid = userInfo.uuid; return new Promise((resolve, reject) => { - login(username, password, code, uuid).then(res => { - setToken(res.token) - commit('SET_TOKEN', res.token) - resolve() - }).catch(error => { - reject(error) - }) - }) + login(username, password, code, uuid) + .then((res) => { + setToken(res.token); + commit('SET_TOKEN', res.token); + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); }, // 获取用户信息 GetInfo({ commit, state }) { return new Promise((resolve, reject) => { - getInfo().then(res => { - const user = res.user - const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; - if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 - commit('SET_ROLES', res.roles) - commit('SET_PERMISSIONS', res.permissions) - } else { - commit('SET_ROLES', ['ROLE_DEFAULT']) - } - commit('SET_NAME', user.userName) - commit('SET_AVATAR', avatar) - resolve(res) - }).catch(error => { - reject(error) - }) - }) + getInfo() + .then((res) => { + const user = res.user; + const avatar = + user.avatar === '' || user.avatar == null ? require('@/assets/images/profile.jpg') : process.env.VUE_APP_BASE_API + user.avatar; + if (res.roles && res.roles.length > 0) { + // 验证返回的roles是否是一个非空数组 + commit('SET_ROLES', res.roles); + commit('SET_PERMISSIONS', res.permissions); + } else { + commit('SET_ROLES', ['ROLE_DEFAULT']); + } + commit('SET_NAME', user.userName); + commit('SET_AVATAR', avatar); + resolve(res); + }) + .catch((error) => { + reject(error); + }); + }); }, // 退出系统 LogOut({ commit, state }) { return new Promise((resolve, reject) => { - logout(state.token).then(() => { - commit('SET_TOKEN', '') - commit('SET_ROLES', []) - commit('SET_PERMISSIONS', []) - removeToken() - resolve() - }).catch(error => { - reject(error) - }) - }) + logout(state.token) + .then(() => { + commit('SET_TOKEN', ''); + commit('SET_ROLES', []); + commit('SET_PERMISSIONS', []); + removeToken(); + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); }, // 前端 登出 FedLogOut({ commit }) { - return new Promise(resolve => { - commit('SET_TOKEN', '') - removeToken() - resolve() - }) + return new Promise((resolve) => { + commit('SET_TOKEN', ''); + removeToken(); + resolve(); + }); } } -} +}; -export default user +export default user; diff --git a/src/utils/dict/Dict.js b/src/utils/dict/Dict.js index 104bd6e..66bf179 100644 --- a/src/utils/dict/Dict.js +++ b/src/utils/dict/Dict.js @@ -1,11 +1,11 @@ -import Vue from 'vue' -import { mergeRecursive } from "@/utils/ruoyi"; -import DictMeta from './DictMeta' -import DictData from './DictData' +import Vue from 'vue'; +import { mergeRecursive } from '@/utils/ruoyi'; +import DictMeta from './DictMeta'; +import DictData from './DictData'; const DEFAULT_DICT_OPTIONS = { - types: [], -} + types: [] +}; /** * @classdesc 字典 @@ -15,31 +15,31 @@ const DEFAULT_DICT_OPTIONS = { */ export default class Dict { constructor() { - this.owner = null - this.label = {} - this.type = {} + this.owner = null; + this.label = {}; + this.type = {}; } init(options) { if (options instanceof Array) { - options = { types: options } + options = { types: options }; } - const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options) + const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options); if (opts.types === undefined) { - throw new Error('need dict types') + throw new Error('need dict types'); } - const ps = [] - this._dictMetas = opts.types.map(t => DictMeta.parse(t)) - this._dictMetas.forEach(dictMeta => { - const type = dictMeta.type - Vue.set(this.label, type, {}) - Vue.set(this.type, type, []) + const ps = []; + this._dictMetas = opts.types.map((t) => DictMeta.parse(t)); + this._dictMetas.forEach((dictMeta) => { + const type = dictMeta.type; + Vue.set(this.label, type, {}); + Vue.set(this.type, type, []); if (dictMeta.lazy) { - return + return; } - ps.push(loadDict(this, dictMeta)) - }) - return Promise.all(ps) + ps.push(loadDict(this, dictMeta)); + }); + return Promise.all(ps); } /** @@ -47,11 +47,11 @@ export default class Dict { * @param {String} type 字典类型 */ reloadDict(type) { - const dictMeta = this._dictMetas.find(e => e.type === type) + const dictMeta = this._dictMetas.find((e) => e.type === type); if (dictMeta === undefined) { - return Promise.reject(`the dict meta of ${type} was not found`) + return Promise.reject(`the dict meta of ${type} was not found`); } - return loadDict(this, dictMeta) + return loadDict(this, dictMeta); } } @@ -62,21 +62,20 @@ export default class Dict { * @returns {Promise} */ function loadDict(dict, dictMeta) { - return dictMeta.request(dictMeta) - .then(response => { - const type = dictMeta.type - let dicts = dictMeta.responseConverter(response, dictMeta) - if (!(dicts instanceof Array)) { - console.error('the return of responseConverter must be Array.') - dicts = [] - } else if (dicts.filter(d => d instanceof DictData).length !== dicts.length) { - console.error('the type of elements in dicts must be DictData') - dicts = [] - } - dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts) - dicts.forEach(d => { - Vue.set(dict.label[type], d.value, d.label) - }) - return dicts - }) + return dictMeta.request(dictMeta).then((response) => { + const type = dictMeta.type; + let dicts = dictMeta.responseConverter(response, dictMeta); + if (!(dicts instanceof Array)) { + console.error('the return of responseConverter must be Array.'); + dicts = []; + } else if (dicts.filter((d) => d instanceof DictData).length !== dicts.length) { + console.error('the type of elements in dicts must be DictData'); + dicts = []; + } + dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts); + dicts.forEach((d) => { + Vue.set(dict.label[type], d.value, d.label); + }); + return dicts; + }); } diff --git a/src/utils/dict/DictConverter.js b/src/utils/dict/DictConverter.js index 0cf5df8..ea1f235 100644 --- a/src/utils/dict/DictConverter.js +++ b/src/utils/dict/DictConverter.js @@ -1,10 +1,10 @@ -import DictOptions from './DictOptions' -import DictData from './DictData' +import DictOptions from './DictOptions'; +import DictData from './DictData'; -export default function(dict, dictMeta) { - const label = determineDictField(dict, dictMeta.labelField, ...DictOptions.DEFAULT_LABEL_FIELDS) - const value = determineDictField(dict, dictMeta.valueField, ...DictOptions.DEFAULT_VALUE_FIELDS) - return new DictData(dict[label], dict[value], dict) +export default function (dict, dictMeta) { + const label = determineDictField(dict, dictMeta.labelField, ...DictOptions.DEFAULT_LABEL_FIELDS); + const value = determineDictField(dict, dictMeta.valueField, ...DictOptions.DEFAULT_VALUE_FIELDS); + return new DictData(dict[label], dict[value], dict); } /** @@ -13,5 +13,5 @@ export default function(dict, dictMeta) { * @param {...String} fields */ function determineDictField(dict, ...fields) { - return fields.find(f => Object.prototype.hasOwnProperty.call(dict, f)) + return fields.find((f) => Object.prototype.hasOwnProperty.call(dict, f)); } diff --git a/src/utils/dict/DictData.js b/src/utils/dict/DictData.js index afc763e..81ee6f0 100644 --- a/src/utils/dict/DictData.js +++ b/src/utils/dict/DictData.js @@ -6,8 +6,8 @@ */ export default class DictData { constructor(label, value, raw) { - this.label = label - this.value = value - this.raw = raw + this.label = label; + this.value = value; + this.raw = raw; } } diff --git a/src/utils/dict/DictMeta.js b/src/utils/dict/DictMeta.js index 9779daa..30dd8b6 100644 --- a/src/utils/dict/DictMeta.js +++ b/src/utils/dict/DictMeta.js @@ -1,5 +1,5 @@ -import { mergeRecursive } from "@/utils/ruoyi"; -import DictOptions from './DictOptions' +import { mergeRecursive } from '@/utils/ruoyi'; +import DictOptions from './DictOptions'; /** * @classdesc 字典元数据 @@ -10,29 +10,28 @@ import DictOptions from './DictOptions' */ export default class DictMeta { constructor(options) { - this.type = options.type - this.request = options.request - this.responseConverter = options.responseConverter - this.labelField = options.labelField - this.valueField = options.valueField - this.lazy = options.lazy === true + this.type = options.type; + this.request = options.request; + this.responseConverter = options.responseConverter; + this.labelField = options.labelField; + this.valueField = options.valueField; + this.lazy = options.lazy === true; } } - /** * 解析字典元数据 * @param {Object} options * @returns {DictMeta} */ -DictMeta.parse= function(options) { - let opts = null +DictMeta.parse = function (options) { + let opts = null; if (typeof options === 'string') { - opts = DictOptions.metas[options] || {} - opts.type = options + opts = DictOptions.metas[options] || {}; + opts.type = options; } else if (typeof options === 'object') { - opts = options + opts = options; } - opts = mergeRecursive(DictOptions.metas['*'], opts) - return new DictMeta(opts) -} + opts = mergeRecursive(DictOptions.metas['*'], opts); + return new DictMeta(opts); +}; diff --git a/src/utils/dict/DictOptions.js b/src/utils/dict/DictOptions.js index 338a94e..5a92da5 100644 --- a/src/utils/dict/DictOptions.js +++ b/src/utils/dict/DictOptions.js @@ -1,5 +1,5 @@ -import { mergeRecursive } from "@/utils/ruoyi"; -import dictConverter from './DictConverter' +import { mergeRecursive } from '@/utils/ruoyi'; +import dictConverter from './DictConverter'; export const options = { metas: { @@ -8,16 +8,16 @@ export const options = { * 字典请求,方法签名为function(dictMeta: DictMeta): Promise */ request: (dictMeta) => { - console.log(`load dict ${dictMeta.type}`) - return Promise.resolve([]) + console.log(`load dict ${dictMeta.type}`); + return Promise.resolve([]); }, /** * 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData */ responseConverter, labelField: 'label', - valueField: 'value', - }, + valueField: 'value' + } }, /** * 默认标签字段 @@ -26,8 +26,8 @@ export const options = { /** * 默认值字段 */ - DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'], -} + DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'] +}; /** * 映射字典 @@ -36,16 +36,16 @@ export const options = { * @returns {DictData} */ function responseConverter(response, dictMeta) { - const dicts = response.content instanceof Array ? response.content : response + const dicts = response.content instanceof Array ? response.content : response; if (dicts === undefined) { - console.warn(`no dict data of "${dictMeta.type}" found in the response`) - return [] + console.warn(`no dict data of "${dictMeta.type}" found in the response`); + return []; } - return dicts.map(d => dictConverter(d, dictMeta)) + return dicts.map((d) => dictConverter(d, dictMeta)); } export function mergeOptions(src) { - mergeRecursive(options, src) + mergeRecursive(options, src); } -export default options +export default options; diff --git a/src/utils/dict/index.js b/src/utils/dict/index.js index 215eb9e..60d4c7e 100644 --- a/src/utils/dict/index.js +++ b/src/utils/dict/index.js @@ -1,33 +1,33 @@ -import Dict from './Dict' -import { mergeOptions } from './DictOptions' +import Dict from './Dict'; +import { mergeOptions } from './DictOptions'; -export default function(Vue, options) { - mergeOptions(options) +export default function (Vue, options) { + mergeOptions(options); Vue.mixin({ data() { if (this.$options === undefined || this.$options.dicts === undefined || this.$options.dicts === null) { - return {} + return {}; } - const dict = new Dict() - dict.owner = this + const dict = new Dict(); + dict.owner = this; return { dict - } + }; }, created() { if (!(this.dict instanceof Dict)) { - return + return; } - options.onCreated && options.onCreated(this.dict) + options.onCreated && options.onCreated(this.dict); this.dict.init(this.$options.dicts).then(() => { - options.onReady && options.onReady(this.dict) + options.onReady && options.onReady(this.dict); this.$nextTick(() => { - this.$emit('dictReady', this.dict) + this.$emit('dictReady', this.dict); if (this.$options.methods && this.$options.methods.onDictReady instanceof Function) { - this.$options.methods.onDictReady.call(this, this.dict) + this.$options.methods.onDictReady.call(this, this.dict); } - }) - }) - }, - }) + }); + }); + } + }); } diff --git a/src/utils/errorCode.js b/src/utils/errorCode.js index d2111ee..81aff2c 100644 --- a/src/utils/errorCode.js +++ b/src/utils/errorCode.js @@ -1,6 +1,6 @@ export default { - '401': '认证失败,无法访问系统资源', - '403': '当前操作没有权限', - '404': '访问资源不存在', - 'default': '系统未知错误,请反馈给管理员' -} + 401: '认证失败,无法访问系统资源', + 403: '当前操作没有权限', + 404: '访问资源不存在', + default: '系统未知错误,请反馈给管理员' +}; diff --git a/src/utils/index.js b/src/utils/index.js index b800f65..f11453a 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -4,7 +4,7 @@ import { parseTime } from './ruoyi'; * 表格时间格式化 */ export function formatDate(cellValue) { - if (cellValue == null || cellValue == '') return ''; + if (cellValue == null || cellValue === '') return ''; var date = new Date(cellValue); var year = date.getFullYear(); var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; diff --git a/src/utils/jsencrypt.js b/src/utils/jsencrypt.js index 78d9523..1c0574b 100644 --- a/src/utils/jsencrypt.js +++ b/src/utils/jsencrypt.js @@ -1,30 +1,30 @@ -import JSEncrypt from 'jsencrypt/bin/jsencrypt.min' +import JSEncrypt from 'jsencrypt/bin/jsencrypt.min'; // 密钥对生成 http://web.chacuo.net/netrsakeypair -const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' + - 'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' +const publicKey = + 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' + 'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='; -const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' + +const privateKey = + 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' + '7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' + 'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' + 'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' + 'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' + 'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' + 'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' + - 'UP8iWi1Qw0Y=' + 'UP8iWi1Qw0Y='; // 加密 export function encrypt(txt) { - const encryptor = new JSEncrypt() - encryptor.setPublicKey(publicKey) // 设置公钥 - return encryptor.encrypt(txt) // 对数据进行加密 + const encryptor = new JSEncrypt(); + encryptor.setPublicKey(publicKey); // 设置公钥 + return encryptor.encrypt(txt); // 对数据进行加密 } // 解密 export function decrypt(txt) { - const encryptor = new JSEncrypt() - encryptor.setPrivateKey(privateKey) // 设置私钥 - return encryptor.decrypt(txt) // 对数据进行解密 + const encryptor = new JSEncrypt(); + encryptor.setPrivateKey(privateKey); // 设置私钥 + return encryptor.decrypt(txt); // 对数据进行解密 } - diff --git a/src/utils/request.js b/src/utils/request.js index 9f63805..182d17d 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -10,7 +10,7 @@ import { successCode } from '@/global/global'; let downloadLoadingInstance; // 是否显示重新登录 -export let isRelogin = { show: false }; +export const isRelogin = { show: false }; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'; // 创建axios实例 diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js index fc5815d..3362a81 100644 --- a/src/utils/ruoyi.js +++ b/src/utils/ruoyi.js @@ -78,7 +78,7 @@ export function selectDictLabel(datas, value) { } var actions = []; Object.keys(datas).some((key) => { - if (datas[key].value == '' + value) { + if (datas[key].value === '' + value) { actions.push(datas[key].label); return true; } @@ -100,7 +100,7 @@ export function selectDictLabels(datas, value, separator) { Object.keys(value.split(currentSeparator)).some((val) => { var match = false; Object.keys(datas).some((key) => { - if (datas[key].value == '' + temp[val]) { + if (datas[key].value === '' + temp[val]) { actions.push(datas[key].label + currentSeparator); match = true; } @@ -130,7 +130,7 @@ export function sprintf(str) { // 转换字符串,undefined,null等转化为"" export function parseStrEmpty(str) { - if (!str || str == 'undefined' || str == 'null') { + if (!str || str === 'undefined' || str === 'null') { return ''; } return str; @@ -140,7 +140,7 @@ export function parseStrEmpty(str) { export function mergeRecursive(source, target) { for (var p in target) { try { - if (target[p].constructor == Object) { + if (target[p].constructor === Object) { source[p] = mergeRecursive(source[p], target[p]); } else { source[p] = target[p]; @@ -241,15 +241,14 @@ export async function blobValidate(data) { } } - export function isNullOrEmpty(val) { if (val === null || val === undefined) { - return true + return true; } else if (val === {} || Object.keys(val).length === 0) { - return true + return true; } else if (val.length === 0) { - return true + return true; } else { - return false + return false; } } diff --git a/src/utils/scroll-to.js b/src/utils/scroll-to.js index c5d8e04..a908ce1 100644 --- a/src/utils/scroll-to.js +++ b/src/utils/scroll-to.js @@ -1,29 +1,36 @@ -Math.easeInOutQuad = function(t, b, c, d) { - t /= d / 2 +Math.easeInOutQuad = function (t, b, c, d) { + t /= d / 2; if (t < 1) { - return c / 2 * t * t + b + return (c / 2) * t * t + b; } - t-- - return -c / 2 * (t * (t - 2) - 1) + b -} + t--; + return (-c / 2) * (t * (t - 2) - 1) + b; +}; // requestAnimationFrame for Smart Animating http://goo.gl/sx5sts -var requestAnimFrame = (function() { - return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } -})() +var requestAnimFrame = (function () { + return ( + window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + function (callback) { + window.setTimeout(callback, 1000 / 60); + } + ); +})(); /** * Because it's so fucking difficult to detect the scrolling element, just move them all * @param {number} amount */ function move(amount) { - document.documentElement.scrollTop = amount - document.body.parentNode.scrollTop = amount - document.body.scrollTop = amount + document.documentElement.scrollTop = amount; + document.body.parentNode.scrollTop = amount; + document.body.scrollTop = amount; } function position() { - return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop + return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop; } /** @@ -32,27 +39,27 @@ function position() { * @param {Function} callback */ export function scrollTo(to, duration, callback) { - const start = position() - const change = to - start - const increment = 20 - let currentTime = 0 - duration = (typeof (duration) === 'undefined') ? 500 : duration - var animateScroll = function() { + const start = position(); + const change = to - start; + const increment = 20; + let currentTime = 0; + duration = typeof duration === 'undefined' ? 500 : duration; + var animateScroll = function () { // increment the time - currentTime += increment + currentTime += increment; // find the value with the quadratic in-out easing function - var val = Math.easeInOutQuad(currentTime, start, change, duration) + var val = Math.easeInOutQuad(currentTime, start, change, duration); // move the document.body - move(val) + move(val); // do the animation unless its over if (currentTime < duration) { - requestAnimFrame(animateScroll) + requestAnimFrame(animateScroll); } else { - if (callback && typeof (callback) === 'function') { + if (callback && typeof callback === 'function') { // the animation is done so lets callback - callback() + callback(); } } - } - animateScroll() + }; + animateScroll(); } diff --git a/src/utils/storage.js b/src/utils/storage.js index 384236f..628015e 100644 --- a/src/utils/storage.js +++ b/src/utils/storage.js @@ -1,8 +1,3 @@ -/** - * @Author: Lei Ding - * @Date: 2021/9/8 - */ - import Vue from 'vue'; /** diff --git a/src/views/components/icons/element-icons.js b/src/views/components/icons/element-icons.js index 9ea4d63..a19a159 100644 --- a/src/views/components/icons/element-icons.js +++ b/src/views/components/icons/element-icons.js @@ -1,3 +1,284 @@ -const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round'] +const elementIcons = [ + 'platform-eleme', + 'eleme', + 'delete-solid', + 'delete', + 's-tools', + 'setting', + 'user-solid', + 'user', + 'phone', + 'phone-outline', + 'more', + 'more-outline', + 'star-on', + 'star-off', + 's-goods', + 'goods', + 'warning', + 'warning-outline', + 'question', + 'info', + 'remove', + 'circle-plus', + 'success', + 'error', + 'zoom-in', + 'zoom-out', + 'remove-outline', + 'circle-plus-outline', + 'circle-check', + 'circle-close', + 's-help', + 'help', + 'minus', + 'plus', + 'check', + 'close', + 'picture', + 'picture-outline', + 'picture-outline-round', + 'upload', + 'upload2', + 'download', + 'camera-solid', + 'camera', + 'video-camera-solid', + 'video-camera', + 'message-solid', + 'bell', + 's-cooperation', + 's-order', + 's-platform', + 's-fold', + 's-unfold', + 's-operation', + 's-promotion', + 's-home', + 's-release', + 's-ticket', + 's-management', + 's-open', + 's-shop', + 's-marketing', + 's-flag', + 's-comment', + 's-finance', + 's-claim', + 's-custom', + 's-opportunity', + 's-data', + 's-check', + 's-grid', + 'menu', + 'share', + 'd-caret', + 'caret-left', + 'caret-right', + 'caret-bottom', + 'caret-top', + 'bottom-left', + 'bottom-right', + 'back', + 'right', + 'bottom', + 'top', + 'top-left', + 'top-right', + 'arrow-left', + 'arrow-right', + 'arrow-down', + 'arrow-up', + 'd-arrow-left', + 'd-arrow-right', + 'video-pause', + 'video-play', + 'refresh', + 'refresh-right', + 'refresh-left', + 'finished', + 'sort', + 'sort-up', + 'sort-down', + 'rank', + 'loading', + 'view', + 'c-scale-to-original', + 'date', + 'edit', + 'edit-outline', + 'folder', + 'folder-opened', + 'folder-add', + 'folder-remove', + 'folder-delete', + 'folder-checked', + 'tickets', + 'document-remove', + 'document-delete', + 'document-copy', + 'document-checked', + 'document', + 'document-add', + 'printer', + 'paperclip', + 'takeaway-box', + 'search', + 'monitor', + 'attract', + 'mobile', + 'scissors', + 'umbrella', + 'headset', + 'brush', + 'mouse', + 'coordinate', + 'magic-stick', + 'reading', + 'data-line', + 'data-board', + 'pie-chart', + 'data-analysis', + 'collection-tag', + 'film', + 'suitcase', + 'suitcase-1', + 'receiving', + 'collection', + 'files', + 'notebook-1', + 'notebook-2', + 'toilet-paper', + 'office-building', + 'school', + 'table-lamp', + 'house', + 'no-smoking', + 'smoking', + 'shopping-cart-full', + 'shopping-cart-1', + 'shopping-cart-2', + 'shopping-bag-1', + 'shopping-bag-2', + 'sold-out', + 'sell', + 'present', + 'box', + 'bank-card', + 'money', + 'coin', + 'wallet', + 'discount', + 'price-tag', + 'news', + 'guide', + 'male', + 'female', + 'thumb', + 'cpu', + 'link', + 'connection', + 'open', + 'turn-off', + 'set-up', + 'chat-round', + 'chat-line-round', + 'chat-square', + 'chat-dot-round', + 'chat-dot-square', + 'chat-line-square', + 'message', + 'postcard', + 'position', + 'turn-off-microphone', + 'microphone', + 'close-notification', + 'bangzhu', + 'time', + 'odometer', + 'crop', + 'aim', + 'switch-button', + 'full-screen', + 'copy-document', + 'mic', + 'stopwatch', + 'medal-1', + 'medal', + 'trophy', + 'trophy-1', + 'first-aid-kit', + 'discover', + 'place', + 'location', + 'location-outline', + 'location-information', + 'add-location', + 'delete-location', + 'map-location', + 'alarm-clock', + 'timer', + 'watch-1', + 'watch', + 'lock', + 'unlock', + 'key', + 'service', + 'mobile-phone', + 'bicycle', + 'truck', + 'ship', + 'basketball', + 'football', + 'soccer', + 'baseball', + 'wind-power', + 'light-rain', + 'lightning', + 'heavy-rain', + 'sunrise', + 'sunrise-1', + 'sunset', + 'sunny', + 'cloudy', + 'partly-cloudy', + 'cloudy-and-sunny', + 'moon', + 'moon-night', + 'dish', + 'dish-1', + 'food', + 'chicken', + 'fork-spoon', + 'knife-fork', + 'burger', + 'tableware', + 'sugar', + 'dessert', + 'ice-cream', + 'hot-water', + 'water-cup', + 'coffee-cup', + 'cold-drink', + 'goblet', + 'goblet-full', + 'goblet-square', + 'goblet-square-full', + 'refrigerator', + 'grape', + 'watermelon', + 'cherry', + 'apple', + 'pear', + 'orange', + 'coffee', + 'ice-tea', + 'ice-drink', + 'milk-tea', + 'potato-strips', + 'lollipop', + 'ice-cream-square', + 'ice-cream-round' +]; -export default elementIcons +export default elementIcons; diff --git a/src/views/components/icons/index.vue b/src/views/components/icons/index.vue index d3c9a71..69a47ab 100644 --- a/src/views/components/icons/index.vue +++ b/src/views/components/icons/index.vue @@ -36,8 +36,8 @@ diff --git a/src/views/error/404.vue b/src/views/error/404.vue index 96f075c..56f972b 100644 --- a/src/views/error/404.vue +++ b/src/views/error/404.vue @@ -26,20 +26,19 @@ diff --git a/src/views/finance/finance/index.vue b/src/views/finance/finance/index.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/views/index_v1.vue b/src/views/index_v1.vue index d2d2ec6..f9b5dec 100644 --- a/src/views/index_v1.vue +++ b/src/views/index_v1.vue @@ -25,16 +25,15 @@ - diff --git a/src/views/sch/school.vue b/src/views/sch/school.vue index e2ae7f1..eeb8afd 100644 --- a/src/views/sch/school.vue +++ b/src/views/sch/school.vue @@ -9,7 +9,7 @@ 搜索 重置 - 新增 + 新增 @@ -38,14 +38,13 @@ - + \ No newline at end of file + this.$modal + .confirm('删除驾校信息,同时会删除该驾校下的场地信息和班型信息,是否确认名称为"' + item.schoolName + '"的数据项?') + .then(function () { + return schoolApi.delete(item.schoolId); + }) + .then((resp) => { + if (resp.code === 200) { + this.getPageList(); + this.$modal.msgSuccess('删除成功'); + } + }) + .catch(() => {}); + } + } +}; + diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index f580b98..c5efb3a 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -1,44 +1,19 @@ \ No newline at end of file + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 6ca5457..035966e 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -1,49 +1,19 @@ \ No newline at end of file + diff --git a/src/views/system/employee/index.vue b/src/views/system/employee/index.vue index 96c0206..a435955 100644 --- a/src/views/system/employee/index.vue +++ b/src/views/system/employee/index.vue @@ -7,7 +7,7 @@
- +
@@ -98,7 +98,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -202,12 +202,13 @@ - \ No newline at end of file diff --git a/src/views/zs/components/batchUpdateForm.vue b/src/views/zs/components/batchUpdateForm.vue index 90a46f7..988b6e1 100644 --- a/src/views/zs/components/batchUpdateForm.vue +++ b/src/views/zs/components/batchUpdateForm.vue @@ -1,21 +1,10 @@