| | |
| | | "lint": "vue-cli-service lint", |
| | | "lint:style": "stylelint-config-prettier-check", |
| | | "inspect": "vue-cli-service inspect", |
| | | "template": "plop", |
| | | "clear": "rimraf node_modules&&npm install --registry=https://registry.npm.taobao.org", |
| | | "image-webpack-loader": "cnpm i image-webpack-loader -D", |
| | | "use:npm": "nrm use npm", |
| | |
| | | "clipboard": "^2.0.8", |
| | | "core-js": "^3.16.2", |
| | | "dayjs": "^1.10.6", |
| | | "echarts": "^5.1.2", |
| | | "element-ui": "^2.15.5", |
| | | "jsencrypt": "^3.2.1", |
| | | "lodash": "^4.17.21", |
| | | "maptalks": "^0.49.5", |
| | | "mapv": "^2.0.62", |
| | | "mockjs": "^1.1.0", |
| | | "nprogress": "^0.2.0", |
| | | "qs": "^6.10.1", |
| | | "screenfull": "^5.1.0", |
| | | "sortablejs": "^1.14.0", |
| | | "vab-icon": "^0.0.1", |
| | | "vue": "^2.6.14", |
| | | "vue-echarts": "6.0.0", |
| | | "vue-router": "^3.5.2", |
| | | "vuex": "^3.6.2", |
| | | "zx-count": "^0.3.7", |
| | | "zx-layouts": "^0.6.27", |
| | | "zx-magnifie": "^0.4.0", |
| | | "zx-markdown-editor": "^0.0.2", |
| | | "zx-player": "^1.0.2", |
| | | "zx-quill": "^0.0.3", |
| | | "zx-templates": "^0.0.26", |
| | | "zx-verify": "^0.0.2" |
| | | }, |
| | |
| | | "filemanager-webpack-plugin": "^6.1.6", |
| | | "image-webpack-loader": "^7.0.1", |
| | | "lint-staged": "^11.1.2", |
| | | "plop": "^2.7.4", |
| | | "prettier": "^2.3.2", |
| | | "sass": "~1.32.13", |
| | | "sass-loader": "^10.1.1", |
| | |
| | | "vue-template-compiler": "^2.6.14", |
| | | "webpackbar": "^4.0.0" |
| | | }, |
| | | "keywords": [ |
| | | "vue", |
| | | "admin", |
| | | "dashboard", |
| | | "element-ui", |
| | | "vue-admin", |
| | | "element-admin", |
| | | "boilerplate", |
| | | "admin-template", |
| | | "management-system" |
| | | ], |
| | | "engines": { |
| | | "node": ">=8.9", |
| | | "npm": ">= 3.0.0" |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | export function getList() { |
| | | export function getList(query) { |
| | | return request({ |
| | | url: "/projects", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | |
| | | const req = require.context('./svg', false, /\.svg$/), |
| | | const req = require.context("./svg", false, /\.svg$/), |
| | | requireAll = (requireContext) => { |
| | | /*let a = requireContext.keys().map(requireContext); |
| | | let arr = []; |
| | |
| | | arr.push(icon); |
| | | } |
| | | console.log(JSON.stringify(arr));*/ |
| | | return requireContext.keys().map(requireContext) |
| | | } |
| | | requireAll(req) |
| | | return requireContext.keys().map(requireContext); |
| | | }; |
| | | requireAll(req); |
| | |
| | | */ |
| | | const theme = { |
| | | //是否国定头部 固定fixed 不固定noFixed |
| | | header: 'fixed', |
| | | header: "fixed", |
| | | //横纵布局 horizontal vertical |
| | | layout: 'vertical', |
| | | layout: "vertical", |
| | | //是否开启主题配置按钮 |
| | | themeBar: true, |
| | | //是否显示多标签页 |
| | | tabsBar: true, |
| | | } |
| | | module.exports = theme |
| | | }; |
| | | module.exports = theme; |
| | |
| | | import Vue from 'vue' |
| | | import App from './App' |
| | | import store from './store' |
| | | import router from './router' |
| | | import './plugins' |
| | | import '@/layouts/export' |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 生产环境默认都使用mock,如果正式用于生产环境时,记得去掉 |
| | | */ |
| | | import Vue from "vue"; |
| | | import App from "./App"; |
| | | import store from "./store"; |
| | | import router from "./router"; |
| | | import "./plugins"; |
| | | import "@/layouts/export"; |
| | | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | const { mockXHR } = require('@/utils/static') |
| | | mockXHR() |
| | | } |
| | | |
| | | Vue.config.productionTip = false |
| | | Vue.config.productionTip = false; |
| | | |
| | | new Vue({ |
| | | el: '#vue-admin-beautiful', |
| | | el: "#vue-admin-beautiful", |
| | | router, |
| | | store, |
| | | render: (h) => h(App), |
| | | }) |
| | | }); |
| | |
| | | import { storage, tokenTableName } from '@/config' |
| | | import { storage, tokenTableName } from "@/config"; |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 获取accessToken |
| | | * @returns {string|ActiveX.IXMLDOMNode|Promise<any>|any|IDBRequest<any>|MediaKeyStatus|FormDataEntryValue|Function|Promise<Credential | null>} |
| | | */ |
| | | export function getAccessToken() { |
| | | if (storage) { |
| | | if ('localStorage' === storage) { |
| | | return localStorage.getItem(tokenTableName) |
| | | } else if ('sessionStorage' === storage) { |
| | | return sessionStorage.getItem(tokenTableName) |
| | | if ("localStorage" === storage) { |
| | | return localStorage.getItem(tokenTableName); |
| | | } else if ("sessionStorage" === storage) { |
| | | return sessionStorage.getItem(tokenTableName); |
| | | } else { |
| | | return localStorage.getItem(tokenTableName) |
| | | return localStorage.getItem(tokenTableName); |
| | | } |
| | | } else { |
| | | return localStorage.getItem(tokenTableName) |
| | | return localStorage.getItem(tokenTableName); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 存储accessToken |
| | | * @param accessToken |
| | | * @returns {void|*} |
| | | */ |
| | | export function setAccessToken(accessToken) { |
| | | if (storage) { |
| | | if ('localStorage' === storage) { |
| | | return localStorage.setItem(tokenTableName, accessToken) |
| | | } else if ('sessionStorage' === storage) { |
| | | return sessionStorage.setItem(tokenTableName, accessToken) |
| | | if ("localStorage" === storage) { |
| | | return localStorage.setItem(tokenTableName, accessToken); |
| | | } else if ("sessionStorage" === storage) { |
| | | return sessionStorage.setItem(tokenTableName, accessToken); |
| | | } else { |
| | | return localStorage.setItem(tokenTableName, accessToken) |
| | | return localStorage.setItem(tokenTableName, accessToken); |
| | | } |
| | | } else { |
| | | return localStorage.setItem(tokenTableName, accessToken) |
| | | return localStorage.setItem(tokenTableName, accessToken); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 移除accessToken |
| | | * @returns {void|Promise<void>} |
| | | */ |
| | | export function removeAccessToken() { |
| | | if (storage) { |
| | | if ('localStorage' === storage) { |
| | | return localStorage.removeItem(tokenTableName) |
| | | } else if ('sessionStorage' === storage) { |
| | | return sessionStorage.clear() |
| | | if ("localStorage" === storage) { |
| | | return localStorage.removeItem(tokenTableName); |
| | | } else if ("sessionStorage" === storage) { |
| | | return sessionStorage.clear(); |
| | | } else { |
| | | return localStorage.removeItem(tokenTableName) |
| | | return localStorage.removeItem(tokenTableName); |
| | | } |
| | | } else { |
| | | return localStorage.removeItem(tokenTableName) |
| | | return localStorage.removeItem(tokenTableName); |
| | | } |
| | | } |
| | |
| | | import Vue from 'vue' |
| | | import Clipboard from 'clipboard' |
| | | import Vue from "vue"; |
| | | import Clipboard from "clipboard"; |
| | | |
| | | function clipboardSuccess() { |
| | | Vue.prototype.$baseMessage('复制成功', 'success') |
| | | Vue.prototype.$baseMessage("复制成功", "success"); |
| | | } |
| | | |
| | | function clipboardError() { |
| | | Vue.prototype.$baseMessage('复制失败', 'error') |
| | | Vue.prototype.$baseMessage("复制失败", "error"); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 复制数据 |
| | | * @param text |
| | | * @param event |
| | | */ |
| | | export default function handleClipboard(text, event) { |
| | | const clipboard = new Clipboard(event.target, { |
| | | text: () => text, |
| | | }) |
| | | clipboard.on('success', () => { |
| | | clipboardSuccess() |
| | | clipboard.destroy() |
| | | }) |
| | | clipboard.on('error', () => { |
| | | clipboardError() |
| | | clipboard.destroy() |
| | | }) |
| | | clipboard.onClick(event) |
| | | }); |
| | | clipboard.on("success", () => { |
| | | clipboardSuccess(); |
| | | clipboard.destroy(); |
| | | }); |
| | | clipboard.on("error", () => { |
| | | clipboardError(); |
| | | clipboard.destroy(); |
| | | }); |
| | | clipboard.onClick(event); |
| | | } |
| | |
| | | }; |
| | | if (checkNeed()) { |
| | | Vue.config.errorHandler = (err, vm, info) => { |
| | | console.error("vue-admin-beautiful错误拦截:", err, vm, info); |
| | | console.error("错误拦截:", err, vm, info); |
| | | const url = window.location.href; |
| | | Vue.nextTick(() => { |
| | | store.dispatch("errorLog/addErrorLog", { err, vm, info, url }); |
| | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description all模式渲染后端返回路由 |
| | | * @param constantRoutes |
| | | * @returns {*} |
| | | */ |
| | | export function convertRouter(asyncRoutes) { |
| | | return asyncRoutes.map((route) => { |
| | | if (route.component) { |
| | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断当前路由是否包含权限 |
| | | * @param permissions |
| | | * @param route |
| | | * @returns {boolean|*} |
| | | */ |
| | | function hasPermission(permissions, route) { |
| | | if (route.meta && route.meta.permissions) { |
| | | return permissions.some((role) => route.meta.permissions.includes(role)); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description intelligence模式根据permissions数组拦截路由 |
| | | * @param routes |
| | | * @param permissions |
| | | * @returns {[]} |
| | | */ |
| | | export function filterAsyncRoutes(routes, permissions) { |
| | | const finallyRoutes = []; |
| | | routes.forEach((route) => { |
| | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 格式化时间 |
| | | * @param time |
| | | * @param cFormat |
| | | * @returns {string|null} |
| | | */ |
| | | export function parseTime(time, cFormat) { |
| | | if (arguments.length === 0) { |
| | | return null |
| | | return null; |
| | | } |
| | | const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' |
| | | let date |
| | | if (typeof time === 'object') { |
| | | date = time |
| | | const format = cFormat || "{y}-{m}-{d} {h}:{i}:{s}"; |
| | | let date; |
| | | if (typeof time === "object") { |
| | | date = time; |
| | | } else { |
| | | if (typeof time === 'string' && /^[0-9]+$/.test(time)) { |
| | | time = parseInt(time) |
| | | if (typeof time === "string" && /^[0-9]+$/.test(time)) { |
| | | time = parseInt(time); |
| | | } |
| | | if (typeof time === 'number' && time.toString().length === 10) { |
| | | time = time * 1000 |
| | | if (typeof time === "number" && time.toString().length === 10) { |
| | | time = time * 1000; |
| | | } |
| | | date = new Date(time) |
| | | date = new Date(time); |
| | | } |
| | | const formatObj = { |
| | | y: date.getFullYear(), |
| | |
| | | i: date.getMinutes(), |
| | | s: date.getSeconds(), |
| | | a: date.getDay(), |
| | | } |
| | | }; |
| | | const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { |
| | | let value = formatObj[key] |
| | | if (key === 'a') { |
| | | return ['日', '一', '二', '三', '四', '五', '六'][value] |
| | | let value = formatObj[key]; |
| | | if (key === "a") { |
| | | return ["日", "一", "二", "三", "四", "五", "六"][value]; |
| | | } |
| | | if (result.length > 0 && value < 10) { |
| | | value = '0' + value |
| | | value = "0" + value; |
| | | } |
| | | return value || 0 |
| | | }) |
| | | return time_str |
| | | return value || 0; |
| | | }); |
| | | return time_str; |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 格式化时间 |
| | | * @param time |
| | | * @param option |
| | | * @returns {string} |
| | | */ |
| | | export function formatTime(time, option) { |
| | | if (('' + time).length === 10) { |
| | | time = parseInt(time) * 1000 |
| | | if (("" + time).length === 10) { |
| | | time = parseInt(time) * 1000; |
| | | } else { |
| | | time = +time |
| | | time = +time; |
| | | } |
| | | const d = new Date(time) |
| | | const now = Date.now() |
| | | const d = new Date(time); |
| | | const now = Date.now(); |
| | | |
| | | const diff = (now - d) / 1000 |
| | | const diff = (now - d) / 1000; |
| | | |
| | | if (diff < 30) { |
| | | return '刚刚' |
| | | return "刚刚"; |
| | | } else if (diff < 3600) { |
| | | // less 1 hour |
| | | return Math.ceil(diff / 60) + '分钟前' |
| | | return Math.ceil(diff / 60) + "分钟前"; |
| | | } else if (diff < 3600 * 24) { |
| | | return Math.ceil(diff / 3600) + '小时前' |
| | | return Math.ceil(diff / 3600) + "小时前"; |
| | | } else if (diff < 3600 * 24 * 2) { |
| | | return '1天前' |
| | | return "1天前"; |
| | | } |
| | | if (option) { |
| | | return parseTime(time, option) |
| | | return parseTime(time, option); |
| | | } else { |
| | | return ( |
| | | d.getMonth() + |
| | | 1 + |
| | | '月' + |
| | | "月" + |
| | | d.getDate() + |
| | | '日' + |
| | | "日" + |
| | | d.getHours() + |
| | | '时' + |
| | | "时" + |
| | | d.getMinutes() + |
| | | '分' |
| | | ) |
| | | "分" |
| | | ); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 将url请求参数转为json格式 |
| | | * @param url |
| | | * @returns {{}|any} |
| | | */ |
| | | export function paramObj(url) { |
| | | const search = url.split('?')[1] |
| | | const search = url.split("?")[1]; |
| | | if (!search) { |
| | | return {} |
| | | return {}; |
| | | } |
| | | return JSON.parse( |
| | | '{"' + |
| | |
| | | .replace(/"/g, '\\"') |
| | | .replace(/&/g, '","') |
| | | .replace(/=/g, '":"') |
| | | .replace(/\+/g, ' ') + |
| | | .replace(/\+/g, " ") + |
| | | '"}' |
| | | ) |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 父子关系的数组转换成树形结构数据 |
| | | * @param data |
| | | * @returns {*} |
| | | */ |
| | | export function translateDataToTree(data) { |
| | | const parent = data.filter( |
| | | (value) => value.parentId === 'undefined' || value.parentId == null |
| | | ) |
| | | (value) => value.parentId === "undefined" || value.parentId == null |
| | | ); |
| | | const children = data.filter( |
| | | (value) => value.parentId !== 'undefined' && value.parentId != null |
| | | ) |
| | | (value) => value.parentId !== "undefined" && value.parentId != null |
| | | ); |
| | | const translator = (parent, children) => { |
| | | parent.forEach((parent) => { |
| | | children.forEach((current, index) => { |
| | | if (current.parentId === parent.id) { |
| | | const temp = JSON.parse(JSON.stringify(children)) |
| | | temp.splice(index, 1) |
| | | translator([current], temp) |
| | | typeof parent.children !== 'undefined' |
| | | const temp = JSON.parse(JSON.stringify(children)); |
| | | temp.splice(index, 1); |
| | | translator([current], temp); |
| | | typeof parent.children !== "undefined" |
| | | ? parent.children.push(current) |
| | | : (parent.children = [current]) |
| | | : (parent.children = [current]); |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | translator(parent, children) |
| | | return parent |
| | | }); |
| | | }); |
| | | }; |
| | | translator(parent, children); |
| | | return parent; |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 树形结构数据转换成父子关系的数组 |
| | | * @param data |
| | | * @returns {[]} |
| | | */ |
| | | export function translateTreeToData(data) { |
| | | const result = [] |
| | | const result = []; |
| | | data.forEach((item) => { |
| | | const loop = (data) => { |
| | | result.push({ |
| | | id: data.id, |
| | | name: data.name, |
| | | parentId: data.parentId, |
| | | }) |
| | | const child = data.children |
| | | }); |
| | | const child = data.children; |
| | | if (child) { |
| | | for (let i = 0; i < child.length; i++) { |
| | | loop(child[i]) |
| | | loop(child[i]); |
| | | } |
| | | } |
| | | } |
| | | loop(item) |
| | | }) |
| | | return result |
| | | }; |
| | | loop(item); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 10位时间戳转换 |
| | | * @param time |
| | | * @returns {string} |
| | | */ |
| | | export function tenBitTimestamp(time) { |
| | | const date = new Date(time * 1000) |
| | | const y = date.getFullYear() |
| | | let m = date.getMonth() + 1 |
| | | m = m < 10 ? '' + m : m |
| | | let d = date.getDate() |
| | | d = d < 10 ? '' + d : d |
| | | let h = date.getHours() |
| | | h = h < 10 ? '0' + h : h |
| | | let minute = date.getMinutes() |
| | | let second = date.getSeconds() |
| | | minute = minute < 10 ? '0' + minute : minute |
| | | second = second < 10 ? '0' + second : second |
| | | return y + '年' + m + '月' + d + '日 ' + h + ':' + minute + ':' + second //组合 |
| | | const date = new Date(time * 1000); |
| | | const y = date.getFullYear(); |
| | | let m = date.getMonth() + 1; |
| | | m = m < 10 ? "" + m : m; |
| | | let d = date.getDate(); |
| | | d = d < 10 ? "" + d : d; |
| | | let h = date.getHours(); |
| | | h = h < 10 ? "0" + h : h; |
| | | let minute = date.getMinutes(); |
| | | let second = date.getSeconds(); |
| | | minute = minute < 10 ? "0" + minute : minute; |
| | | second = second < 10 ? "0" + second : second; |
| | | return y + "年" + m + "月" + d + "日 " + h + ":" + minute + ":" + second; //组合 |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 13位时间戳转换 |
| | | * @param time |
| | | * @returns {string} |
| | | */ |
| | | export function thirteenBitTimestamp(time) { |
| | | const date = new Date(time / 1) |
| | | const y = date.getFullYear() |
| | | let m = date.getMonth() + 1 |
| | | m = m < 10 ? '' + m : m |
| | | let d = date.getDate() |
| | | d = d < 10 ? '' + d : d |
| | | let h = date.getHours() |
| | | h = h < 10 ? '0' + h : h |
| | | let minute = date.getMinutes() |
| | | let second = date.getSeconds() |
| | | minute = minute < 10 ? '0' + minute : minute |
| | | second = second < 10 ? '0' + second : second |
| | | return y + '年' + m + '月' + d + '日 ' + h + ':' + minute + ':' + second //组合 |
| | | const date = new Date(time / 1); |
| | | const y = date.getFullYear(); |
| | | let m = date.getMonth() + 1; |
| | | m = m < 10 ? "" + m : m; |
| | | let d = date.getDate(); |
| | | d = d < 10 ? "" + d : d; |
| | | let h = date.getHours(); |
| | | h = h < 10 ? "0" + h : h; |
| | | let minute = date.getMinutes(); |
| | | let second = date.getSeconds(); |
| | | minute = minute < 10 ? "0" + minute : minute; |
| | | second = second < 10 ? "0" + second : second; |
| | | return y + "年" + m + "月" + d + "日 " + h + ":" + minute + ":" + second; //组合 |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 获取随机id |
| | | * @param length |
| | | * @returns {string} |
| | | */ |
| | | export function uuid(length = 32) { |
| | | const num = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' |
| | | let str = '' |
| | | const num = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; |
| | | let str = ""; |
| | | for (let i = 0; i < length; i++) { |
| | | str += num.charAt(Math.floor(Math.random() * num.length)) |
| | | str += num.charAt(Math.floor(Math.random() * num.length)); |
| | | } |
| | | return str |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description m到n的随机数 |
| | | * @param m |
| | | * @param n |
| | | * @returns {number} |
| | | */ |
| | | export function random(m, n) { |
| | | return Math.floor(Math.random() * (m - n) + n) |
| | | return Math.floor(Math.random() * (m - n) + n); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description addEventListener |
| | | * @type {function(...[*]=)} |
| | | */ |
| | | export const on = (function () { |
| | | return function (element, event, handler, useCapture = false) { |
| | | if (element && event && handler) { |
| | | element.addEventListener(event, handler, useCapture) |
| | | element.addEventListener(event, handler, useCapture); |
| | | } |
| | | } |
| | | })() |
| | | }; |
| | | })(); |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description removeEventListener |
| | | * @type {function(...[*]=)} |
| | | */ |
| | | export const off = (function () { |
| | | return function (element, event, handler, useCapture = false) { |
| | | if (element && event) { |
| | | element.removeEventListener(event, handler, useCapture) |
| | | element.removeEventListener(event, handler, useCapture); |
| | | } |
| | | } |
| | | })() |
| | | }; |
| | | })(); |
| | |
| | | import { title } from '@/config' |
| | | import { title } from "@/config"; |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 设置标题 |
| | | * @param pageTitle |
| | | * @returns {string} |
| | | */ |
| | | export default function getPageTitle(pageTitle) { |
| | | if (pageTitle) { |
| | | return `${pageTitle}-${title}` |
| | | return `${pageTitle}-${title}`; |
| | | } |
| | | return `${title}` |
| | | return `${title}`; |
| | | } |
| | |
| | | import store from '@/store' |
| | | import store from "@/store"; |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 检查权限 |
| | | * @param value |
| | | * @returns {boolean} |
| | | */ |
| | | export default function checkPermission(value) { |
| | | if (value && value instanceof Array && value.length > 0) { |
| | | const permissions = store.getters['user/permissions'] |
| | | const permissionPermissions = value |
| | | const permissions = store.getters["user/permissions"]; |
| | | const permissionPermissions = value; |
| | | |
| | | return permissions.some((role) => { |
| | | return permissionPermissions.includes(role) |
| | | }) |
| | | return permissionPermissions.includes(role); |
| | | }); |
| | | } else { |
| | | return false |
| | | return false; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判读是否为外链 |
| | | * @param path |
| | | * @returns {boolean} |
| | | */ |
| | | export function isExternal(path) { |
| | | return /^(https?:|mailto:|tel:)/.test(path); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 校验密码是否小于6位 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isPassword(str) { |
| | | return str.length >= 5; |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否为数字 |
| | | * @param value |
| | | * @returns {boolean} |
| | | */ |
| | | export function isNumber(value) { |
| | | const reg = /^[0-9]*$/; |
| | | return reg.test(value); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是名称 |
| | | * @param value |
| | | * @returns {boolean} |
| | | */ |
| | | export function isName(value) { |
| | | const reg = /^[\u4e00-\u9fa5a-zA-Z0-9]+$/; |
| | | return reg.test(value); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否为IP |
| | | * @param ip |
| | | * @returns {boolean} |
| | | */ |
| | | export function isIP(ip) { |
| | | const reg = |
| | | /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/; |
| | | return reg.test(ip); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是传统网站 |
| | | * @param url |
| | | * @returns {boolean} |
| | | */ |
| | | export function isUrl(url) { |
| | | const reg = |
| | | /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/; |
| | | return reg.test(url); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是小写字母 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isLowerCase(str) { |
| | | const reg = /^[a-z]+$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是大写字母 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isUpperCase(str) { |
| | | const reg = /^[A-Z]+$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是大写字母开头 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isAlphabets(str) { |
| | | const reg = /^[A-Za-z]+$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是字符串 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isString(str) { |
| | | return typeof str === "string" || str instanceof String; |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是数组 |
| | | * @param arg |
| | | * @returns {arg is any[]|boolean} |
| | | */ |
| | | export function isArray(arg) { |
| | | if (typeof Array.isArray === "undefined") { |
| | | return Object.prototype.toString.call(arg) === "[object Array]"; |
| | |
| | | return Array.isArray(arg); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是端口号 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isPort(str) { |
| | | const reg = |
| | | /^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是手机号 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isPhone(str) { |
| | | const reg = /^1\d{10}$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是身份证号(第二代) |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isIdCard(str) { |
| | | const reg = |
| | | /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否是邮箱 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isEmail(str) { |
| | | const reg = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否中文 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isChina(str) { |
| | | const reg = /^[\u4E00-\u9FA5]{2,4}$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否为空 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isBlank(str) { |
| | | return ( |
| | | str == null || |
| | |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否为固话 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isTel(str) { |
| | | const reg = |
| | | /^(400|800)([0-9\\-]{7,10})|(([0-9]{4}|[0-9]{3})(-| )?)?([0-9]{7,8})((-| |转)*([0-9]{1,4}))?$/; |
| | | return reg.test(str); |
| | | } |
| | | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description 判断是否为数字且最多两位小数 |
| | | * @param str |
| | | * @returns {boolean} |
| | | */ |
| | | export function isNum(str) { |
| | | const reg = /^\d+(\.\d{1,2})?$/; |
| | | return reg.test(str); |
| | |
| | | <div class="error-content"> |
| | | <el-row :gutter="20"> |
| | | <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"> |
| | | <div class="pic-error"> |
| | | <img |
| | | alt="401" |
| | | class="pic-error-parent" |
| | | src="@/assets/error_images/401.png" |
| | | /> |
| | | <img |
| | | alt="401" |
| | | class="pic-error-child left" |
| | | src="@/assets/error_images/cloud.png" |
| | | /> |
| | | <img |
| | | alt="401" |
| | | class="pic-error-child" |
| | | src="@/assets/error_images/cloud.png" |
| | | /> |
| | | <img |
| | | alt="401" |
| | | class="pic-error-child" |
| | | src="@/assets/error_images/cloud.png" |
| | | /> |
| | | </div> |
| | | <div class="pic-error">401</div> |
| | | </el-col> |
| | | |
| | | <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"> |
| | |
| | | <div class="error-content"> |
| | | <el-row :gutter="20"> |
| | | <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"> |
| | | <div class="pic-error"> |
| | | <img |
| | | alt="401" |
| | | class="pic-error-parent" |
| | | src="@/assets/error_images/404.png" |
| | | /> |
| | | <img |
| | | alt="401" |
| | | class="pic-error-child left" |
| | | src="@/assets/error_images/cloud.png" |
| | | /> |
| | | <img |
| | | alt="401" |
| | | class="pic-error-child" |
| | | src="@/assets/error_images/cloud.png" |
| | | /> |
| | | <img |
| | | alt="401" |
| | | class="pic-error-child" |
| | | src="@/assets/error_images/cloud.png" |
| | | /> |
| | | </div> |
| | | 404 page not found! |
| | | </el-col> |
| | | |
| | | <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"> |
| | |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="dialogFormVisible" |
| | | width="500px" |
| | | width="550px" |
| | | :close-on-click-modal="false" |
| | | @close="close" |
| | | > |
| | |
| | | <el-tab-pane label="基础信息" name="base"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="项目名称" prop="name"> |
| | | <el-input v-model.trim="form.name" autocomplete="off"></el-input> |
| | | <el-input v-model.trim="form.name" :disabled="edit"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="项目地址" prop="srcUrl"> |
| | | <el-input v-model.trim="form.srcUrl" autocomplete="off"></el-input> |
| | | <el-input v-model.trim="form.srcUrl"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="项目用户" prop="srcUser"> |
| | | <el-input v-model.trim="form.srcUser" autocomplete="off"></el-input> |
| | | <el-input v-model.trim="form.srcUser"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="项目密码" prop="srcPassword"> |
| | | <el-input |
| | |
| | | > |
| | | </el-form-item> |
| | | <el-form-item label="项目描述" prop="desc"> |
| | | <el-input v-model="form.desc" autocomplete="off"></el-input> |
| | | <el-input v-model="form.desc"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="编译分支" prop="branch"> |
| | | <el-input v-model.trim="form.branch" autocomplete="off"></el-input> |
| | | <el-input v-model.trim="form.branch" :disabled="edit"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="编译架构" prop="arch"> |
| | | <el-radio-group v-model="form.arch"> |
| | | <el-radio-group v-model="form.arch" :disabled="edit"> |
| | | <el-radio label="x86">X86</el-radio> |
| | | <el-radio label="arm">ARM</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="项目类型" prop="type"> |
| | | <el-radio-group v-model="form.type"> |
| | | <el-radio label="os">基础包</el-radio> |
| | | <el-radio label="sys">系统包</el-radio> |
| | | <el-radio label="app">应用包</el-radio> |
| | | <el-radio label="algo">算法包</el-radio> |
| | |
| | | }, |
| | | title: "", |
| | | dialogFormVisible: false, |
| | | edit: false, |
| | | }; |
| | | }, |
| | | created() {}, |
| | |
| | | showEdit(row) { |
| | | if (!row) { |
| | | this.title = "添加"; |
| | | this.edit = false; |
| | | } else { |
| | | this.edit = true; |
| | | this.title = "编辑"; |
| | | this.form = Object.assign({}, row); |
| | | } |
| | |
| | | this.$refs["form"].resetFields(); |
| | | this.form = this.$options.data().form; |
| | | this.dialogFormVisible = false; |
| | | this.$emit("fetch-data"); |
| | | // this.$emit("fetch-data"); |
| | | }, |
| | | save() { |
| | | this.$refs["form"].validate(async (valid) => { |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | .el-radio { |
| | | margin-right: 20 px; |
| | | } |
| | | </style> |
| | |
| | | @submit.native.prevent |
| | | > |
| | | <el-form-item> |
| | | <el-input v-model="queryForm.title" placeholder="名称" /> |
| | | <el-input |
| | | v-model="queryForm.name" |
| | | placeholder="名称" |
| | | clearable="" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-select |
| | | v-model="queryForm.address" |
| | | v-model="queryForm.type" |
| | | placeholder="类型" |
| | | class="handle-select mr10" |
| | | size="mini" |
| | | clearable="" |
| | | > |
| | | <el-option key="1" label="系统" value="系统"></el-option> |
| | | <el-option key="2" label="应用" value="应用"></el-option> |
| | | <el-option key="3" label="算法" value="算法"></el-option> |
| | | <el-option key="os" label="基础" value="os"></el-option> |
| | | <el-option key="sys" label="系统" value="sys"></el-option> |
| | | <el-option key="app" label="应用" value="app"></el-option> |
| | | <el-option key="algo" label="算法" value="algo"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | <el-tag>{{ row.type | typeFilter }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column show-overflow-tooltip prop="arch" label="架构"> |
| | | </el-table-column> |
| | | <!-- <el-table-column show-overflow-tooltip label="当前版本" prop="latestVersion"></el-table-column> --> |
| | | <el-table-column label="状态"> |
| | | <template #default="{ row }"> |
| | |
| | | }, |
| | | typeFilter(type) { |
| | | const typeMap = { |
| | | os: "OS基础包", |
| | | sys: "系统包", |
| | | app: "应用包", |
| | | algo: "算法包", |
| | |
| | | queryForm: { |
| | | pageNo: 1, |
| | | pageSize: 20, |
| | | title: "", |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | |
| | | async expandChange(row, expandRows) { |
| | | console.log(row); |
| | | if (expandRows.length == 0) { |
| | | console.log("fold"); |
| | | return; |
| | | } |
| | | |
| | |
| | | }) |
| | | .then(({ value }) => { |
| | | buildPkg(row, value).then((rsp) => { |
| | | console.log(rsp); |
| | | this.expandChange(row, 1); |
| | | }); |
| | | }) |
| | |
| | | handleDownload(row) { |
| | | download({ path: row.filePath }).then((rsp) => { |
| | | if (rsp && rsp.success) { |
| | | console.log(rsp); |
| | | window.location = rsp.data; |
| | | } |
| | | }); |
| | |
| | | this.$refs["form"].resetFields(); |
| | | this.form = this.$options.data().form; |
| | | this.dialogFormVisible = false; |
| | | this.$emit("fetch-data"); |
| | | // this.$emit("fetch-data"); |
| | | }, |
| | | async save() { |
| | | if (this.createAction) { |
| | |
| | | const path = require('path') |
| | | const path = require("path"); |
| | | const { |
| | | publicPath, |
| | | assetsDir, |
| | |
| | | providePlugin, |
| | | build7z, |
| | | donation, |
| | | } = require('./src/config') |
| | | const { webpackBarName, webpackBanner, donationConsole } = require('zx-layouts') |
| | | } = require("./src/config"); |
| | | const { |
| | | webpackBarName, |
| | | webpackBanner, |
| | | donationConsole, |
| | | } = require("zx-layouts"); |
| | | |
| | | const { version, author } = require('./package.json') |
| | | const { version, author } = require("./package.json"); |
| | | |
| | | const Webpack = require('webpack') |
| | | const WebpackBar = require('webpackbar') |
| | | const FileManagerPlugin = require('filemanager-webpack-plugin') |
| | | const dayjs = require('dayjs') |
| | | const date = dayjs().format('YYYY_M_D') |
| | | const time = dayjs().format('YYYY-M-D HH:mm:ss') |
| | | process.env.VUE_APP_TITLE = title || 'vue-admin-beautiful' |
| | | process.env.VUE_APP_AUTHOR = author || 'chuzhixin 1204505056@qq.com' |
| | | process.env.VUE_APP_UPDATE_TIME = time |
| | | process.env.VUE_APP_VERSION = version |
| | | const Webpack = require("webpack"); |
| | | const WebpackBar = require("webpackbar"); |
| | | const FileManagerPlugin = require("filemanager-webpack-plugin"); |
| | | const dayjs = require("dayjs"); |
| | | const date = dayjs().format("YYYY_M_D"); |
| | | const time = dayjs().format("YYYY-M-D HH:mm:ss"); |
| | | process.env.VUE_APP_TITLE = "vue-intergrate"; |
| | | process.env.VUE_APP_AUTHOR = "basic"; |
| | | process.env.VUE_APP_UPDATE_TIME = time; |
| | | process.env.VUE_APP_VERSION = version; |
| | | |
| | | const resolve = (dir) => path.join(__dirname, dir) |
| | | const mockServer = () => { |
| | | if (process.env.NODE_ENV === 'development') return require('./mock') |
| | | else return '' |
| | | } |
| | | const resolve = (dir) => path.join(__dirname, dir); |
| | | |
| | | module.exports = { |
| | | publicPath, |
| | |
| | | warnings: true, |
| | | errors: true, |
| | | }, |
| | | after: mockServer(), |
| | | }, |
| | | configureWebpack() { |
| | | return { |
| | | resolve: { |
| | | alias: { |
| | | '@': resolve('src'), |
| | | "@": resolve("src"), |
| | | }, |
| | | }, |
| | | plugins: [ |
| | |
| | | name: webpackBarName, |
| | | }), |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | chainWebpack(config) { |
| | | config.plugins.delete('preload') |
| | | config.plugins.delete('prefetch') |
| | | config.plugins.delete("preload"); |
| | | config.plugins.delete("prefetch"); |
| | | config.module |
| | | .rule('svg') |
| | | .exclude.add(resolve('src/remixIcon')) |
| | | .add(resolve('src/colorfulIcon')) |
| | | .end() |
| | | .rule("svg") |
| | | .exclude.add(resolve("src/remixIcon")) |
| | | .add(resolve("src/colorfulIcon")) |
| | | .end(); |
| | | |
| | | config.module |
| | | .rule('remixIcon') |
| | | .rule("remixIcon") |
| | | .test(/\.svg$/) |
| | | .include.add(resolve('src/remixIcon')) |
| | | .include.add(resolve("src/remixIcon")) |
| | | .end() |
| | | .use('svg-sprite-loader') |
| | | .loader('svg-sprite-loader') |
| | | .options({ symbolId: 'remix-icon-[name]' }) |
| | | .end() |
| | | .use("svg-sprite-loader") |
| | | .loader("svg-sprite-loader") |
| | | .options({ symbolId: "remix-icon-[name]" }) |
| | | .end(); |
| | | |
| | | config.module |
| | | .rule('colorfulIcon') |
| | | .rule("colorfulIcon") |
| | | .test(/\.svg$/) |
| | | .include.add(resolve('src/colorfulIcon')) |
| | | .include.add(resolve("src/colorfulIcon")) |
| | | .end() |
| | | .use('svg-sprite-loader') |
| | | .loader('svg-sprite-loader') |
| | | .options({ symbolId: 'colorful-icon-[name]' }) |
| | | .end() |
| | | .use("svg-sprite-loader") |
| | | .loader("svg-sprite-loader") |
| | | .options({ symbolId: "colorful-icon-[name]" }) |
| | | .end(); |
| | | |
| | | /* config.when(process.env.NODE_ENV === "development", (config) => { |
| | | config.devtool("source-map"); |
| | | }); */ |
| | | config.when(process.env.NODE_ENV !== 'development', (config) => { |
| | | config.performance.set('hints', false) |
| | | config.devtool('none') |
| | | config.when(process.env.NODE_ENV !== "development", (config) => { |
| | | config.performance.set("hints", false); |
| | | config.devtool("none"); |
| | | config.optimization.splitChunks({ |
| | | automaticNameDelimiter: '-', |
| | | chunks: 'all', |
| | | automaticNameDelimiter: "-", |
| | | chunks: "all", |
| | | cacheGroups: { |
| | | chunk: { |
| | | name: 'vab-chunk', |
| | | name: "vab-chunk", |
| | | test: /[\\/]node_modules[\\/]/, |
| | | minSize: 131072, |
| | | maxSize: 524288, |
| | | chunks: 'async', |
| | | chunks: "async", |
| | | minChunks: 2, |
| | | priority: 10, |
| | | }, |
| | | vue: { |
| | | name: 'vue', |
| | | name: "vue", |
| | | test: /[\\/]node_modules[\\/](vue(.*)|core-js)[\\/]/, |
| | | chunks: 'initial', |
| | | chunks: "initial", |
| | | priority: 20, |
| | | }, |
| | | elementUI: { |
| | | name: 'element-ui', |
| | | name: "element-ui", |
| | | test: /[\\/]node_modules[\\/]element-ui(.*)[\\/]/, |
| | | priority: 30, |
| | | }, |
| | | extra: { |
| | | name: 'vab-layouts', |
| | | test: resolve('src/layouts'), |
| | | name: "vab-layouts", |
| | | test: resolve("src/layouts"), |
| | | priority: 40, |
| | | }, |
| | | }, |
| | | }) |
| | | }); |
| | | config |
| | | .plugin('banner') |
| | | .plugin("banner") |
| | | .use(Webpack.BannerPlugin, [`${webpackBanner}${time}`]) |
| | | .end() |
| | | .end(); |
| | | config.module |
| | | .rule('images') |
| | | .use('image-webpack-loader') |
| | | .loader('image-webpack-loader') |
| | | .rule("images") |
| | | .use("image-webpack-loader") |
| | | .loader("image-webpack-loader") |
| | | .options({ |
| | | bypassOnDebug: true, |
| | | }) |
| | | .end() |
| | | }) |
| | | .end(); |
| | | }); |
| | | |
| | | if (build7z) { |
| | | config.when(process.env.NODE_ENV === 'production', (config) => { |
| | | config.when(process.env.NODE_ENV === "production", (config) => { |
| | | config |
| | | .plugin('fileManager') |
| | | .plugin("fileManager") |
| | | .use(FileManagerPlugin, [ |
| | | { |
| | | onEnd: { |
| | |
| | | }, |
| | | }, |
| | | ]) |
| | | .end() |
| | | }) |
| | | .end(); |
| | | }); |
| | | } |
| | | }, |
| | | runtimeCompiler: true, |
| | |
| | | |
| | | /*sass-loader 9.0写法,感谢github用户 shaonialife*/ |
| | | additionalData(content, loaderContext) { |
| | | const { resourcePath, rootContext } = loaderContext |
| | | const relativePath = path.relative(rootContext, resourcePath) |
| | | const { resourcePath, rootContext } = loaderContext; |
| | | const relativePath = path.relative(rootContext, resourcePath); |
| | | if ( |
| | | relativePath.replace(/\\/g, '/') !== 'src/styles/variables.scss' |
| | | relativePath.replace(/\\/g, "/") !== "src/styles/variables.scss" |
| | | ) { |
| | | return '@import "~@/styles/variables.scss";' + content |
| | | return '@import "~@/styles/variables.scss";' + content; |
| | | } |
| | | return content |
| | | return content; |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | |
| | | /** |
| | | * @author chuzhixin 1204505056@qq.com (不想保留author可删除) |
| | | * @description webstorm.config |
| | | */ |
| | | const webpackConfig = require('@vue/cli-service/webpack.config.js') |
| | | module.exports = webpackConfig |
| | | const webpackConfig = require("@vue/cli-service/webpack.config.js"); |
| | | module.exports = webpackConfig; |