diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index ea6e20f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,14 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -insert_final_newline = false -trim_trailing_whitespace = false diff --git a/.env b/.env index 27b1c1d..5811734 100644 --- a/.env +++ b/.env @@ -1,4 +1,3 @@ -VITE_PROJECT_NAME = '东莞年报填报服务' -VITE_BASE_API = '/aiceps-gd-server' -# VITE_PUBLICPATH = '/aiceps-dg-app' -VITE_PUBLICPATH = '/aiceps-app' \ No newline at end of file +VITE_PROJECT_NAME = '企业智能年报移动系统' +VITE_BASE_API = '/mobile-api' +VITE_PUBLICPATH = '/mobile' diff --git a/.env.staging b/.env.staging deleted file mode 100644 index 32ae75e..0000000 --- a/.env.staging +++ /dev/null @@ -1,9 +0,0 @@ -NODE_ENV = production - -# just a flag -ENV = 'staging' -VUE_APP_ENVIRONMENT = 'staging' - -# base api -VUE_APP_BASE_API = '/stage-api' - diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e6529fc..0000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -build/*.js -src/assets -public -dist diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index c977505..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,198 +0,0 @@ -module.exports = { - root: true, - parserOptions: { - parser: 'babel-eslint', - sourceType: 'module' - }, - env: { - browser: true, - node: true, - es6: true, - }, - extends: ['plugin:vue/recommended', 'eslint:recommended'], - - // add your custom rules here - //it is base on https://github.com/vuejs/eslint-config-vue - rules: { - "vue/max-attributes-per-line": [2, { - "singleline": 10, - "multiline": { - "max": 1, - "allowFirstLine": false - } - }], - "vue/singleline-html-element-content-newline": "off", - "vue/multiline-html-element-content-newline":"off", - "vue/name-property-casing": ["error", "PascalCase"], - "vue/no-v-html": "off", - 'accessor-pairs': 2, - 'arrow-spacing': [2, { - 'before': true, - 'after': true - }], - 'block-spacing': [2, 'always'], - 'brace-style': [2, '1tbs', { - 'allowSingleLine': true - }], - 'camelcase': [0, { - 'properties': 'always' - }], - 'comma-dangle': [2, 'never'], - 'comma-spacing': [2, { - 'before': false, - 'after': true - }], - 'comma-style': [2, 'last'], - 'constructor-super': 2, - 'curly': [2, 'multi-line'], - 'dot-location': [2, 'property'], - 'eol-last': 2, - 'eqeqeq': ["error", "always", {"null": "ignore"}], - 'generator-star-spacing': [2, { - 'before': true, - 'after': true - }], - 'handle-callback-err': [2, '^(err|error)$'], - 'indent': [2, 2, { - 'SwitchCase': 1 - }], - 'jsx-quotes': [2, 'prefer-single'], - 'key-spacing': [2, { - 'beforeColon': false, - 'afterColon': true - }], - 'keyword-spacing': [2, { - 'before': true, - 'after': true - }], - 'new-cap': [2, { - 'newIsCap': true, - 'capIsNew': false - }], - 'new-parens': 2, - 'no-array-constructor': 2, - 'no-caller': 2, - 'no-console': 'off', - 'no-class-assign': 2, - 'no-cond-assign': 2, - 'no-const-assign': 2, - 'no-control-regex': 0, - 'no-delete-var': 2, - 'no-dupe-args': 2, - 'no-dupe-class-members': 2, - 'no-dupe-keys': 2, - 'no-duplicate-case': 2, - 'no-empty-character-class': 2, - 'no-empty-pattern': 2, - 'no-eval': 2, - 'no-ex-assign': 2, - 'no-extend-native': 2, - 'no-extra-bind': 2, - 'no-extra-boolean-cast': 2, - 'no-extra-parens': [2, 'functions'], - 'no-fallthrough': 2, - 'no-floating-decimal': 2, - 'no-func-assign': 2, - 'no-implied-eval': 2, - 'no-inner-declarations': [2, 'functions'], - 'no-invalid-regexp': 2, - 'no-irregular-whitespace': 2, - 'no-iterator': 2, - 'no-label-var': 2, - 'no-labels': [2, { - 'allowLoop': false, - 'allowSwitch': false - }], - 'no-lone-blocks': 2, - 'no-mixed-spaces-and-tabs': 2, - 'no-multi-spaces': 2, - 'no-multi-str': 2, - 'no-multiple-empty-lines': [2, { - 'max': 1 - }], - 'no-native-reassign': 2, - 'no-negated-in-lhs': 2, - 'no-new-object': 2, - 'no-new-require': 2, - 'no-new-symbol': 2, - 'no-new-wrappers': 2, - 'no-obj-calls': 2, - 'no-octal': 2, - 'no-octal-escape': 2, - 'no-path-concat': 2, - 'no-proto': 2, - 'no-redeclare': 2, - 'no-regex-spaces': 2, - 'no-return-assign': [2, 'except-parens'], - 'no-self-assign': 2, - 'no-self-compare': 2, - 'no-sequences': 2, - 'no-shadow-restricted-names': 2, - 'no-spaced-func': 2, - 'no-sparse-arrays': 2, - 'no-this-before-super': 2, - 'no-throw-literal': 2, - 'no-trailing-spaces': 2, - 'no-undef': 2, - 'no-undef-init': 2, - 'no-unexpected-multiline': 2, - 'no-unmodified-loop-condition': 2, - 'no-unneeded-ternary': [2, { - 'defaultAssignment': false - }], - 'no-unreachable': 2, - 'no-unsafe-finally': 2, - 'no-unused-vars': [2, { - 'vars': 'all', - 'args': 'none' - }], - 'no-useless-call': 2, - 'no-useless-computed-key': 2, - 'no-useless-constructor': 2, - 'no-useless-escape': 0, - 'no-whitespace-before-property': 2, - 'no-with': 2, - 'one-var': [2, { - 'initialized': 'never' - }], - 'operator-linebreak': [2, 'after', { - 'overrides': { - '?': 'before', - ':': 'before' - } - }], - 'padded-blocks': [2, 'never'], - 'quotes': [2, 'single', { - 'avoidEscape': true, - 'allowTemplateLiterals': true - }], - 'semi': [2, 'never'], - 'semi-spacing': [2, { - 'before': false, - 'after': true - }], - 'space-before-blocks': [2, 'always'], - 'space-before-function-paren': [2, 'never'], - 'space-in-parens': [2, 'never'], - 'space-infix-ops': 2, - 'space-unary-ops': [2, { - 'words': true, - 'nonwords': false - }], - 'spaced-comment': [2, 'always', { - 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] - }], - 'template-curly-spacing': [2, 'never'], - 'use-isnan': 2, - 'valid-typeof': 2, - 'wrap-iife': [2, 'any'], - 'yield-star-spacing': [2, 'both'], - 'yoda': [2, 'never'], - 'prefer-const': 2, - 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, - 'object-curly-spacing': [2, 'always', { - objectsInObjects: false - }], - 'array-bracket-spacing': [2, 'never'] - } -} diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..5cc1b8f --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,599 @@ +# Youfool-LLM 前端开发最佳实践 + +本文档为 Youfool PMS Web 项目的前端开发最佳实践,专门用于指导 LLM 进行规范化的前端编码。 + +--- + +## 1. 技术栈与约束 + +### 1.1 核心框架 + +- **Vue.js**: 3.3.4 (选项式 API 优先) +- **UI 框架**: Element Plus 2.7.4 (仅桌面端框架) +- **状态管理**: Vuex 4.1.0 (模块化结构) +- **路由**: Vue Router 4.2.5 (Hash 模式路由) +- **构建工具**: Vite 4.4.5 (自定义插件) +- **HTTP 客户端**: Axios 1.6.0 (综合请求封装) +- **图表**: ECharts 5.6.0 (数据可视化) +- **样式**: SCSS + PostCSS px-to-rem 转换 + +### 1.2 开发约束 + +- **仅支持桌面端**:系统专为桌面环境设计,不兼容小屏幕设备(如手机、平板) +- **最小分辨率**:设计最小支持宽度为 1200px,推荐使用 1920px 或更高分辨率 +- **固定布局策略**:采用固定布局而非响应式布局,确保在桌面端的一致性体验 +- **无需移动端适配**:开发时无需考虑移动端兼容性、触摸交互等移动特性 + +--- + +## 2. 项目架构 + +### 2.1 目录结构 + +``` +src/ +├── api/ # 按业务域组织的 API 服务模块 +├── components/ # 可复用 Vue 组件和 EasyComponent 系统 +├── extends/ # 可复用 Vue 指令 +├── icons/ # 整个项目所有的svg图标 +├── layout/ # 布局组件 (Web 等) +├── plugins/ # 自定义 Vue 插件和 EasyComponent 系统 +├── router/ # Vue Router 配置,支持基于角色的访问控制 +├── store/ # Vuex 模块 (app、user、permission、contract) +├── utils/ # 工具函数和请求封装 +├── views/ # 按业务域组织的页面组件 +└── styles/ # 全局 SCSS 样式 +``` + +**注意**:模拟数据存放在 `src/mock/` 目录(产品设计阶段) + +### 2.2 核心系统 + +#### 2.2.1 EasyComponent 插件系统 + +- **配置驱动组件**: EasyForm、EasyTable、EditTable、EasyDialog +- **动态表单生成**: 基础选项加载与验证 +- **业务扩展**: `src/components/EasyComponentExtend/` +- **桌面端专用**: 专注于桌面端用户体验,不考虑移动端适配 + +#### 2.2.2 API 架构 + +- **模块化结构**: 中文文件名匹配业务域 +- **集中请求封装**: `src/utils/request.js` 配置拦截器 +- **标准响应格式**: `{code, data, msg}` +- **自动 token 注入**: 401/403 自动登出 + +#### 2.2.3 路由架构 + +- **路由配置文件**: `src/router/routes.js` (所有路由配置的实际存放位置) +- **路由结构**: + - `constantRoutes`: 常量路由(公开访问,如登录、首页、404等) + - `asyncRoutes`: 异步路由(需要权限控制,动态加载的业务路由) +- **路由注册**: 使用 `handlerImport` 包装动态导入 +- **⚠️ 重要**: 路由配置以实际代码文件 `src/router/routes.js` 为准,新增或修改路由必须在该文件中进行 + +--- + +## 3. 编码规范 + +### 3.1 代码风格 + +#### 3.1.1 ESLint 规范强制执行 + +**重要性**:⭐⭐⭐⭐⭐ + +- 项目配置了严格的 ESLint 规则,不符合规范的代码将被编译拦截 +- 提交前必须执行 `npm run lint` 确保代码通过检查 +- 所有文件必须以换行符结尾 (eol-last 规则) + +#### 3.1.2 命名约定 + +- **业务域文件**: 使用中文业务域 + 英文技术名 +- **组件名**: PascalCase +- **变量名**: camelCase +- **常量名**: UPPER_SNAKE_CASE +- **CSS 类名**: kebab-case + +#### 3.1.3 通用规范 + +- 遵循 Vue.js 官方风格指南 +- 遵循 Element Plus 组件使用规范 + +### 3.2 Vue 3 规范 + +#### 3.2.1 API 风格 + +- 严格遵守 Vue 3.3.4 语法规范 +- 使用**选项式 API 优先** +- 正确使用 JavaScript ES6+ 特性 + +#### 3.2.2 响应式数据定义 + +**所有响应式数据定义在 `data()` 中** + +```javascript +export default { + data() { + return { + // 基础类型 + count: 0, + message: 'hello', + isVisible: true, + + // 对象和数组 + formData: { + name: '', + email: '', + age: 0 + }, + + chartOptions: { + title: { text: '图表标题' }, + series: [] + } + } + } +} +``` + +#### 3.2.3 组件导入规范 + +```javascript +// 使用动态导入和 handlerImport +const component = () => handlerImport(import('@/views/路径/组件.vue')) +``` + +### 3.3 样式编写规范 + +#### 3.3.1 样式位置 + +**所有样式必须写在组件的 ` + + + +``` + +#### 3.3.2 单位使用 + +- **px 单位**:在样式代码中直接使用 px,构建工具会自动转换为 rem +- **rem 单位**:由 PostCSS 自动转换 px → rem,手写不应使用 rem + +```scss +// 正确:使用 px 单位 +.container { + width: 300px; + height: 200px; + margin: 16px; +} +``` + +#### 3.3.3 Style 标签显式声明 + +```vue + + + + + +``` + +### 3.4 调试信息规范 + +- **禁止**: 除捕获异常外,不要在控制台中打印任何调试信息 (chenxf,2025年12月23日) +- **允许**: 异常捕获时的 console.error + +--- + +## 4. 设计规范 + +### 4.1 屏幕适配 + +- **仅支持桌面端**:系统专为桌面环境设计,不兼容小屏幕设备(如手机、平板) +- **最小屏幕宽度**:设计最小支持宽度为 1200px,推荐使用 1920px 或更高分辨率 + +### 4.2 UI 组件使用 + +- **主要框架**: Element Plus +- **组件尺寸**: 优先使用 `medium` 和 `large` +- **布局组件**: 使用 Element Plus Layout + +### 4.3 样式设计要求 + +- **固定单位**:使用 px 作为主要单位,配合 PostCSS px-to-rem 转换 +- **最小交互区域**:按钮、链接等可交互元素最小尺寸为 32px × 32px +- **字体大小**:正文字体不小于 14px,标题字体根据层级递增 +- **色彩对比度**:确保文字与背景的对比度符合 WCAG 2.1 AA 标准 + +--- + +## 5. 路由配置 + +### 5.1 基础配置 + +#### 5.1.1 路由配置文件 + +- **实际存放位置**: `src/router/routes.js` +- **⚠️ 重要**: 新增或修改路由必须在该文件中进行 + +#### 5.1.2 路由结构 + +- `constantRoutes`: 常量路由(公开访问,如登录、首页、404等) +- `asyncRoutes`: 异步路由(需要权限控制,动态加载的业务路由) + +### 5.2 父子路由配置 + +#### 5.2.1 配置原则 + +当配置带有子路由的菜单路由时,父路由组件必须包含 `` 来渲染子路由内容。 + +#### 5.2.2 错误示例 ❌ + +```javascript +// 错误:父路由直接使用页面组件 +{ + path: '/gzt/datacenter', + redirect: '/gzt/datacenter/overview', + component: () => handlerImport(import('@/views/工作台/数据分析中心/index.vue')), + meta: { + title: '数据分析中心', + icon: 'menu8-2', + keepAlive: false, + isMenu: true + }, + children: [ + { + path: '/gzt/datacenter/overview', + component: () => handlerImport(import('@/views/工作台/数据分析中心/index.vue')), + meta: { + title: '总览分析', + isSubMenu: true + } + } + ] +} +``` + +**问题**:父路由组件没有 ``,子路由无法正确渲染。 + +#### 5.2.3 正确示例 ✅ + +```javascript +// 正确:使用 Empty 布局组件作为父路由 +{ + path: '/gzt/datacenter', + redirect: '/gzt/datacenter/overview', + component: Empty, // 使用带有 的布局组件 + meta: { + title: '数据分析中心', + icon: 'menu8-2', + keepAlive: false, + isMenu: true + }, + children: [ + { + path: '/gzt/datacenter/overview', + component: () => handlerImport(import('@/views/工作台/数据分析中心/index.vue')), + meta: { + title: '总览分析', + isSubMenu: true + } + }, + { + path: '/gzt/datacenter/personal-performance', + component: () => handlerImport(import('@/views/数据分析中心/个人绩效分析/index.vue')), + meta: { + title: '个人绩效分析', + isSubMenu: true, + keepAlive: true + } + } + ] +} +``` + +### 5.3 关键原则 + +1. **父子路由分离**:父路由负责布局,子路由负责内容 +2. **布局组件选择**:使用 `Empty` 组件或包含 `` 的布局组件 +3. **重定向配置**:设置合适的默认子路由重定向 +4. **元信息配置**:正确区分 `isMenu` 和 `isSubMenu` 属性 + +### 5.4 常用布局组件 + +- `Empty`:空布局组件,仅包含 ``,适用于需要嵌套子路由的场景 +- `WebLayout`:适用于本项目的默认布局 + +### 5.5 路由组织规范 + +```javascript +// 所有页面路由应在父路由的 children 中 (chenxf,2025年12月23日) +// 路径需要继承父路由,并写全路径 +{ + path: '/contract/detail/functionList', + children: [ + { + path: '/contract/detail/functionList/detail', // ✅ 正确:继承父路径并写全路径 + }, + { + path: '/detail' // ❌ 错误:不应使用不是父路由作为前缀的路径 + } + ] +} +``` + +**规范来源**:合同功能清单路由组织实践 (chenxf,2025年12月23日) + +### 5.6 注意事项 + +- 父路由的 `component` 不能直接使用业务页面组件 +- 子路由的 `path` 应使用父路由的路径作为前缀 +- 确保布局组件已正确导入并注册 + +--- + +## 6. 组件开发实践 + +### 6.1 组件拆分原则 + +#### 6.1.1 业务模块组件拆分 + +- **文件夹组织**: 相关代码放在一个文件夹内 +- **避免重复**: 禁止同名 .vue 文件和同名文件夹并存 +- **共享组件**: 放在小范围公共文件中 + +#### 6.1.2 列表页面组件选型 + +**使用 `` 场景**: +- 条件查询筛选功能 +- 简单弹窗编辑/查看功能 +- 行内编辑功能 + +**使用 `` 场景**: +- 纯展示列表页面 + +#### 6.1.3 CSS 类名命名 + +- 参照其他相似页面保持一致 +- 以方便维护公共 CSS 类为原则 +- 遵循项目现有的命名约定 + +### 6.2 EasyForm 开发规范 + +#### 6.2.1 侧边查询条件 + +- **使用组件**: 应使用 `` 开发 (chenxf,2025年12月23日) +- **字段复用**: 尽可能复用列表页面组件中定义的 fields (chenxf,2025年12月23日) +- **职责分离**: + - 侧边查询条件组件只负责生成查询条件数据 (chenxf,2025年12月23日) + - 通过事件通知父组件执行搜索查询 (chenxf,2025年12月23日) + +#### 6.2.2 字段配置 + +**必填校验** +```javascript +// 使用 required: true (chenxf,2025年12月23日) +{ + prop: 'fieldName', + required: true, + // ❌ 错误:不需要在 rules 中定义必填校验 + // rules: [{ required: true, message: '请输入', trigger: 'blur' }] +} +``` + +**占位符** +```javascript +// 在 formProps.placeholders 中定义 (chenxf,2025年12月23日) +fields: [ + { + formProps: { + placeholders: '请输入内容' // 仅在需要自定义时填写,一般由EasyForm组件自动生成 + } + } +] +// ❌ 错误:不在 field 中定义 placeholder +``` + +**默认值** +```javascript +// ❌ 错误:非业务要求场景下,fields 中不应定义 defaultValue (chenxf,2025年12月23日) +// ✅ 正确:直接对 formData 赋值 +this.formData.fieldName = '初始值' +``` + +#### 6.2.3 码值配置 + +**本地码值表** +```javascript +// 使用 options 字段 +{ + prop: 'status', + label: '状态', + type: 'select', + options: [ + { label: '启用', value: '1' }, + { label: '禁用', value: '0' } + ] +} +``` + +**全局码值表** +```javascript +// main.js 中定义 +BaseOptionsLoader: (baseCode)=>{ + if(baseCode==='statusOptions'){ + return [ + { label: '启用', value: '1' }, + { label: '禁用', value: '0' } + ] + } +} + +// field 中引用 +{ + prop: 'status', + type: 'select', + optionsBaseCode: 'statusOptions' +} + +// ❌ 错误:不要在 data 中声明码表 (chenxf,2025年12月23日) +// ❌ 错误:不要使用 formatter 进行码值转换 (chenxf,2025年12月23日) +``` + +#### 6.2.4 组件属性定义 + +```javascript +// element-plus 组件属性应在 formProps 中定义 (chenxf,2025年12月23日) +formConfig: { + formProps: { + // ✅ 正确:在这里定义 + size: 'large', + labelWidth: '120px' + } +} + +// ❌ 错误:不在 fieldProps 中定义 element-plus 属性 +``` + +#### 6.2.5 字段单位 + +```javascript +// 使用 append 字段定义单位 (chenxf,2025年12月23日) +{ + prop: 'price', + label: '价格', + append: '元' +} +``` + +#### 6.2.6 码表值类型 + +- **优先使用**: string 类型 (chenxf,2025年12月23日) +- **例外**: 当接口明确定义为 number 类型时 + +### 6.3 EasyTable 开发规范 + +#### 6.3.1 格式化字段使用规范 + +**✅ 应该使用 formatter 的场景**: +- 日期格式化(如时间戳转为 YYYY-MM-DD) +- 数字格式化(如金额添加千分位) +- 文本处理(如截断、拼接等) + +**编写位置**:tableProps.formatter (chenxf,2025年12月23日) + +```javascript +tableConfig: { + tableProps: { + // ✅ 正确:在这里定义 + formatter: (row, column, cellValue) => { + // 示例:日期格式化 + return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') + } + } +} +``` + +#### 6.3.2 码值转换规范 + +**❌ 不应该使用 formatter 的场景**: +- 状态码转换(如 0/1 → 禁用/启用) +- 类型码转换(如 type=1,2,3 → 业务类型文本) + +**正确做法**:使用 options 字段定义对应的码值表 (chenxf,2025年12月23日) + +```javascript +// ✅ 正确:使用 options 字段定义码值表 +{ + prop: 'status', + label: '状态', + options: [ + { label: '启用', value: '1' }, + { label: '禁用', value: '0' } + ] +} + +// ❌ 错误:不要使用 formatter 进行码值转换 (chenxf,2025年12月23日) +``` + +### 6.4 通用开发规范 + +#### 6.4.1 异步操作处理 + +```javascript +// 按钮 handler 中的异步操作应 return Promise (chenxf,2025年12月23日) +handlers: { + async handleSubmit() { + // ✅ 正确:return Promise + return await this.saveData() + } +} +``` + +#### 6.4.2 编辑查看页面复用 + +- **原则**: 如查看页面不存在和编辑页面复杂的结构差异 (chenxf,2025年12月23日) +- **实现**: + - 编辑和查看页面应使用同一个页面 (chenxf,2025年12月23日) + - 使用 `` 开发 (chenxf,2025年12月23日) + - 通过 `formConfig.isView` 字段控制是否处于编辑或查看状态 (chenxf,2025年12月23日) + +#### 6.4.3 字段复用 + +- **原则**: 同一个业务文件下,easy-component 的各个组件的 fields 应尽可能复用 (chenxf,2025年12月23日) +- **实践**: 提取公共 fields 配置,多处引用 + +#### 6.4.4 错误处理规范 + +**API 调用必须使用 try-catch 包裹** (zhenghl,2025年12月24日) + +```javascript +// ✅ 正确示例 +async getUnreadCount() { + try { + const response = await getUnreadMessageCount() + this.unreadCount = response || 0 + } catch (error) { + console.error('获取未读消息数量失败:', error) + } +} + +// ❌ 错误示例:缺少错误处理 +async getUnreadCount() { + const response = await getUnreadMessageCount() + this.unreadCount = response || 0 +} +``` + +**规范要求**: +- 所有 API 调用必须使用 try-catch 包裹 +- 错误信息使用 console.error 记录 +- 异常处理逻辑应包含用户友好的错误提示 + +--- + +## 7. 附录 + +### 7.1 规范来源说明 + +本规范文档的内容综合了项目开发实践和代码审查总结。其中 `docs/fix/` 目录记录了代码审查中发现的问题和规范要求,是当前最佳实践的重要来源。这些规范经过实践验证,是项目开发中必须遵守的重要规则。 + +--- + +*文档版本: v1.2.0* +*最后更新时间: 2025-12-24* +*维护者: Youfool 前端团队* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f4be7a0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: 10 -script: npm run test -notifications: - email: false diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 35ef929..0000000 --- a/babel.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - presets: [ - ['@vue/app', { - useBuiltIns: 'entry' - }] - ] -} diff --git a/build/constant-file.js b/build/constant-file.js deleted file mode 100644 index 7b1c688..0000000 --- a/build/constant-file.js +++ /dev/null @@ -1,101 +0,0 @@ -const path = require('path') -const fs = require('fs') -const axios = require('axios') -const crypto = require('crypto') -const readline = require('readline') - -/** - * 生成字典插件 v1.0 - * youfool - */ -class constantFile { - constructor(options) { - this.options = options - } - apply(compiler) { - compiler.hooks.environment.tap('constantFile', async (compilation, callback) => { - // 只在开发环境 - if (process.env.ENV === 'development') { - const projectPath = path.join(__dirname, '../../') - const constantPath = projectPath + '/src/constant' - fs.mkdir(constantPath, function (error) { - if (error) { - return false - } - // 获取字典参数 - axios.get(this.options.api).then((res) => { - const { code, data } = res.data - if (code === 0) { - for (const module of data) { - // 模块 - const moduleName = Object.keys(module)[0] - const filePath = constantPath + '/' + moduleName + 'Constant.js' - let fileStr = templateStr(module[moduleName]) - const hash = crypto.createHash('md5') - hash.update(fileStr) - const md5 = hash.digest('hex') - // 判断之前的文件是否存在 - if (fs.existsSync(filePath)) { - const oldFile = readline.createInterface({ - input: fs.createReadStream(filePath) - }) - let oldMd5 - oldFile.on('line', function (line) { // 事件监听 - if (!oldMd5) { - // 解析旧文件的字符md5 - oldMd5 = line.replace('// ', '') - if (oldMd5 === md5) { - oldFile.close() - } else { - // 不相同则重新生成常量文件 - fileStr = `// ${md5}\n` + fileStr - fs.writeFileSync(filePath, fileStr, 'utf8') - } - } - }) - } else { - // 不相同则重新生成常量文件 - fileStr = `// ${md5}\n` + fileStr - fs.writeFileSync(filePath, fileStr, 'utf8') - } - } - } - }).catch((e) => { }) - }) - } - }) - } -} - -/** - * 生成文件字符 - */ -function templateStr(dictTypes) { - const moduleName = dictTypes[0].module - const moduleDescription = dictTypes[0].moduleDescription - // 开头 - const head = `/** - * ${moduleName}${moduleDescription || ''} - * 注:本文件不能手动修改,需要通过代码生成器生成 - */\n` - // 底部 - let bottom = 'export default {' - // 遍历类型 - let content = '' - for (const dictType of dictTypes) { - content += `/** - *${dictType.name} - *${dictType.typeDescription || ''} - */` - for (const dictCode of dictType.dictCodes) { - const attribute = `${dictType.type.toUpperCase()}_${dictCode.constant.toUpperCase()}` - content += `\nconst ${attribute} = '${dictCode.code}'// ${dictCode.label}${dictCode.description || ''}` - bottom += ` ${attribute},` - } - content += `\n` - } - // 去除最后的逗号 - bottom = bottom.substr(0, bottom.length - 1) + ` }` - return head + '\n' + content + '\n' + bottom + '\n' -} -module.exports = constantFile diff --git a/build/increpack.js b/build/increpack.js deleted file mode 100644 index 1cca204..0000000 --- a/build/increpack.js +++ /dev/null @@ -1,117 +0,0 @@ -const path = require('path') -const fs = require('fs') -const compressing = require('compressing') -const axios = require('axios') -const child_process = require('child_process') -const packageJson = require('../package.json') -function parseTime(time, format = 'yyyy-MM-dd hh:mm:ss') { - const date = time instanceof Date ? time : new Date(time) - - const o = { - 'M+': date.getMonth() + 1, // 月份 - 'd+': date.getDate(), // 日 - 'h+': date.getHours(), // 小时 - 'm+': date.getMinutes(), // 分 - 's+': date.getSeconds(), // 秒 - 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度 - 'S': date.getMilliseconds() // 毫秒 - } - if (/(y+)/.test(format)) { - format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)) - } - for (const k in o) { - if (new RegExp('(' + k + ')').test(format)) { - format = format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) - } - } - return format -} - -/** - * 打包插件 v2.0 - * youfool - */ -class IncrePack { - apply(compiler) { - if (process.env.VUE_APP_WEBPACK_CMD !== 'build') { - return - } - const date = new Date() - const projectPath = path.join(__dirname, '../') - const distPath = projectPath + 'dist' - const versionPath = `${projectPath}src/version.js` - let hash = '000000' - try { - hash = child_process.execSync('git rev-parse HEAD').slice(0, 6) - } catch (e) { - console.log('------------------读取版本Hash失败---------------') - console.warn(e) - } - const codeVersion = `${parseTime(date, 'yyyy-MM-dd hh:mm:ss')} ${hash} ${process.env.VUE_APP_ENVIRONMENT}` - compiler.hooks.beforeRun.tapAsync('SetVersion', async(compilation, callback) => { - const data = `/** 本文件由打包插件自动生成和修改 */\nexport default '${codeVersion}'\n` - fs.writeFileSync(versionPath, data) - callback() - }) - compiler.hooks.done.tap('SetVersion', async(compilation) => { - const data = `/** 本文件由打包插件自动生成和修改 */\nexport default ''\n` - fs.writeFileSync(versionPath, data) - }) - compiler.hooks.done.tap('IncrePack', async(compilation) => { - let versionJson = { - artifactId: packageJson.name, - version: packageJson.version, - appId: packageJson.appId, - codeId: packageJson.codeId, - codeVersion - } - if (packageJson.increApi) { - // 获取版本信息 - try { - console.log('------------------正在写入升级记录---------------') - const res = await axios.default({ - url: packageJson.increApi + '?appId=' + packageJson.appId + '&codeId=' + packageJson.codeId, - method: 'get', - timeout: 5000 - }) - const { code, data } = res.data - if (code === 0 && data) { - versionJson = { - ...versionJson, - artifactId: packageJson.name, - upgradeId: data.upgradeId, - version: data.version, - releaseTime: data.releaseTime, - fromCommit: data.fromCommit, - untilCommit: data.untilCommit, - newFeatures: data.newFeatures, - repair: data.repair, - other: data.other, - operId: data.operId, - operName: data.operName, - } - console.log('------------------写入升级记录成功---------------') - } - } catch (e) { - console.log(e.message) - console.log('------------------提交升级记录到远端失败---------------') - } - } - fs.mkdirSync(distPath + '/increpack-config') - fs.writeFileSync(distPath + '/increpack-config/version.json', JSON.stringify(versionJson), 'utf8') - const increName = `${packageJson.name}-${process.env.VUE_APP_ENVIRONMENT}-${parseTime(date, 'yyyy-MM-dd')}-${hash}.zip` - // 打包压缩 - const tempFile = projectPath + '/' + increName - compressing.zip.compressDir(distPath, tempFile, { ignoreBase: true }) - .then(() => { - // 剪切回dist目录下 - fs.renameSync(tempFile, distPath + '/' + increName) - console.log('------------------打包成功------------------') - }) - .catch(err => { - console.error(err) - }) - }) - } -} -module.exports = IncrePack diff --git a/build/index.js b/build/index.js deleted file mode 100644 index 0c57de2..0000000 --- a/build/index.js +++ /dev/null @@ -1,35 +0,0 @@ -const { run } = require('runjs') -const chalk = require('chalk') -const config = require('../vue.config.js') -const rawArgv = process.argv.slice(2) -const args = rawArgv.join(' ') - -if (process.env.npm_config_preview || rawArgv.includes('--preview')) { - const report = rawArgv.includes('--report') - - run(`vue-cli-service build ${args}`) - - const port = 9526 - const publicPath = config.publicPath - - var connect = require('connect') - var serveStatic = require('serve-static') - const app = connect() - - app.use( - publicPath, - serveStatic('./dist', { - index: ['index.html', '/'] - }) - ) - - app.listen(port, function () { - console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) - if (report) { - console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) - } - - }) -} else { - run(`vue-cli-service build ${args}`) -} diff --git a/postcss.config.js b/postcss.config.js deleted file mode 100644 index 10473ef..0000000 --- a/postcss.config.js +++ /dev/null @@ -1,8 +0,0 @@ -// https://github.com/michael-ciniawsky/postcss-load-config - -module.exports = { - 'plugins': { - // to edit target browsers: use "browserslist" field in package.json - 'autoprefixer': {} - } -} diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 1823999..0000000 --- a/public/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - <%= webpackConfig.name %> - - - -
- - - diff --git a/src/api/table.js b/src/api/table.js deleted file mode 100644 index 2d72b1d..0000000 --- a/src/api/table.js +++ /dev/null @@ -1,21 +0,0 @@ -// import request from '@/utils/request' - -export function getList(params) { - // return request({ - // url: '/table/list', - // method: 'get', - // params - // }) - return Promise.resolve({ - items: [ - { - id: 0, - title: '111', - status: 'published', - author: 'name', - display_time: '2020-02-02', - pageviews: '111' - } - ] - }) -} diff --git a/src/assets/404_images/404.png b/src/assets/404_images/404.png deleted file mode 100644 index 3d8e230..0000000 Binary files a/src/assets/404_images/404.png and /dev/null differ diff --git a/src/assets/404_images/404_cloud.png b/src/assets/404_images/404_cloud.png deleted file mode 100644 index c6281d0..0000000 Binary files a/src/assets/404_images/404_cloud.png and /dev/null differ diff --git a/src/assets/css/global.scss b/src/assets/css/global.scss deleted file mode 100644 index d9fd432..0000000 --- a/src/assets/css/global.scss +++ /dev/null @@ -1,25 +0,0 @@ -// 公共全局样式页面,需配合scss使用 -// 一级标题文字大小 -$font-size-classA-title: 30px; - - - -// 下边距 -$margin-bottom-20: 20px; - - - - - -// 主题颜色 -$color-theme: #ccc; - - - -// 一级字体颜色 -$color-classA-font-weight: blue; - - - -// 等等 - diff --git a/src/assets/font/demo.css b/src/assets/font/demo.css deleted file mode 100644 index a67054a..0000000 --- a/src/assets/font/demo.css +++ /dev/null @@ -1,539 +0,0 @@ -/* Logo 字体 */ -@font-face { - font-family: "iconfont logo"; - src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); - src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), - url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), - url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), - url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); -} - -.logo { - font-family: "iconfont logo"; - font-size: 160px; - font-style: normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -/* tabs */ -.nav-tabs { - position: relative; -} - -.nav-tabs .nav-more { - position: absolute; - right: 0; - bottom: 0; - height: 42px; - line-height: 42px; - color: #666; -} - -#tabs { - border-bottom: 1px solid #eee; -} - -#tabs li { - cursor: pointer; - width: 100px; - height: 40px; - line-height: 40px; - text-align: center; - font-size: 16px; - border-bottom: 2px solid transparent; - position: relative; - z-index: 1; - margin-bottom: -1px; - color: #666; -} - - -#tabs .active { - border-bottom-color: #f00; - color: #222; -} - -.tab-container .content { - display: none; -} - -/* 页面布局 */ -.main { - padding: 30px 100px; - width: 960px; - margin: 0 auto; -} - -.main .logo { - color: #333; - text-align: left; - margin-bottom: 30px; - line-height: 1; - height: 110px; - margin-top: -50px; - overflow: hidden; - *zoom: 1; -} - -.main .logo a { - font-size: 160px; - color: #333; -} - -.helps { - margin-top: 40px; -} - -.helps pre { - padding: 20px; - margin: 10px 0; - border: solid 1px #e7e1cd; - background-color: #fffdef; - overflow: auto; -} - -.icon_lists { - width: 100% !important; - overflow: hidden; - *zoom: 1; -} - -.icon_lists li { - width: 100px; - margin-bottom: 10px; - margin-right: 20px; - text-align: center; - list-style: none !important; - cursor: default; -} - -.icon_lists li .code-name { - line-height: 1.2; -} - -.icon_lists .icon { - display: block; - height: 100px; - line-height: 100px; - font-size: 42px; - margin: 10px auto; - color: #333; - -webkit-transition: font-size 0.25s linear, width 0.25s linear; - -moz-transition: font-size 0.25s linear, width 0.25s linear; - transition: font-size 0.25s linear, width 0.25s linear; -} - -.icon_lists .icon:hover { - font-size: 100px; -} - -.icon_lists .svg-icon { - /* 通过设置 font-size 来改变图标大小 */ - width: 1em; - /* 图标和文字相邻时,垂直对齐 */ - vertical-align: -0.15em; - /* 通过设置 color 来改变 SVG 的颜色/fill */ - fill: currentColor; - /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 - normalize.css 中也包含这行 */ - overflow: hidden; -} - -.icon_lists li .name, -.icon_lists li .code-name { - color: #666; -} - -/* markdown 样式 */ -.markdown { - color: #666; - font-size: 14px; - line-height: 1.8; -} - -.highlight { - line-height: 1.5; -} - -.markdown img { - vertical-align: middle; - max-width: 100%; -} - -.markdown h1 { - color: #404040; - font-weight: 500; - line-height: 40px; - margin-bottom: 24px; -} - -.markdown h2, -.markdown h3, -.markdown h4, -.markdown h5, -.markdown h6 { - color: #404040; - margin: 1.6em 0 0.6em 0; - font-weight: 500; - clear: both; -} - -.markdown h1 { - font-size: 28px; -} - -.markdown h2 { - font-size: 22px; -} - -.markdown h3 { - font-size: 16px; -} - -.markdown h4 { - font-size: 14px; -} - -.markdown h5 { - font-size: 12px; -} - -.markdown h6 { - font-size: 12px; -} - -.markdown hr { - height: 1px; - border: 0; - background: #e9e9e9; - margin: 16px 0; - clear: both; -} - -.markdown p { - margin: 1em 0; -} - -.markdown>p, -.markdown>blockquote, -.markdown>.highlight, -.markdown>ol, -.markdown>ul { - width: 80%; -} - -.markdown ul>li { - list-style: circle; -} - -.markdown>ul li, -.markdown blockquote ul>li { - margin-left: 20px; - padding-left: 4px; -} - -.markdown>ul li p, -.markdown>ol li p { - margin: 0.6em 0; -} - -.markdown ol>li { - list-style: decimal; -} - -.markdown>ol li, -.markdown blockquote ol>li { - margin-left: 20px; - padding-left: 4px; -} - -.markdown code { - margin: 0 3px; - padding: 0 5px; - background: #eee; - border-radius: 3px; -} - -.markdown strong, -.markdown b { - font-weight: 600; -} - -.markdown>table { - border-collapse: collapse; - border-spacing: 0px; - empty-cells: show; - border: 1px solid #e9e9e9; - width: 95%; - margin-bottom: 24px; -} - -.markdown>table th { - white-space: nowrap; - color: #333; - font-weight: 600; -} - -.markdown>table th, -.markdown>table td { - border: 1px solid #e9e9e9; - padding: 8px 16px; - text-align: left; -} - -.markdown>table th { - background: #F7F7F7; -} - -.markdown blockquote { - font-size: 90%; - color: #999; - border-left: 4px solid #e9e9e9; - padding-left: 0.8em; - margin: 1em 0; -} - -.markdown blockquote p { - margin: 0; -} - -.markdown .anchor { - opacity: 0; - transition: opacity 0.3s ease; - margin-left: 8px; -} - -.markdown .waiting { - color: #ccc; -} - -.markdown h1:hover .anchor, -.markdown h2:hover .anchor, -.markdown h3:hover .anchor, -.markdown h4:hover .anchor, -.markdown h5:hover .anchor, -.markdown h6:hover .anchor { - opacity: 1; - display: inline-block; -} - -.markdown>br, -.markdown>p>br { - clear: both; -} - - -.hljs { - display: block; - background: white; - padding: 0.5em; - color: #333333; - overflow-x: auto; -} - -.hljs-comment, -.hljs-meta { - color: #969896; -} - -.hljs-string, -.hljs-variable, -.hljs-template-variable, -.hljs-strong, -.hljs-emphasis, -.hljs-quote { - color: #df5000; -} - -.hljs-keyword, -.hljs-selector-tag, -.hljs-type { - color: #a71d5d; -} - -.hljs-literal, -.hljs-symbol, -.hljs-bullet, -.hljs-attribute { - color: #0086b3; -} - -.hljs-section, -.hljs-name { - color: #63a35c; -} - -.hljs-tag { - color: #333333; -} - -.hljs-title, -.hljs-attr, -.hljs-selector-id, -.hljs-selector-class, -.hljs-selector-attr, -.hljs-selector-pseudo { - color: #795da3; -} - -.hljs-addition { - color: #55a532; - background-color: #eaffea; -} - -.hljs-deletion { - color: #bd2c00; - background-color: #ffecec; -} - -.hljs-link { - text-decoration: underline; -} - -/* 代码高亮 */ -/* PrismJS 1.15.0 -https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ -/** - * prism.js default theme for JavaScript, CSS and HTML - * Based on dabblet (http://dabblet.com) - * @author Lea Verou - */ -code[class*="language-"], -pre[class*="language-"] { - color: black; - background: none; - text-shadow: 0 1px white; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - - -moz-tab-size: 4; - -o-tab-size: 4; - tab-size: 4; - - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - -pre[class*="language-"]::-moz-selection, -pre[class*="language-"] ::-moz-selection, -code[class*="language-"]::-moz-selection, -code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; -} - -pre[class*="language-"]::selection, -pre[class*="language-"] ::selection, -code[class*="language-"]::selection, -code[class*="language-"] ::selection { - text-shadow: none; - background: #b3d4fc; -} - -@media print { - - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } -} - -/* Code blocks */ -pre[class*="language-"] { - padding: 1em; - margin: .5em 0; - overflow: auto; -} - -:not(pre)>code[class*="language-"], -pre[class*="language-"] { - background: #f5f2f0; -} - -/* Inline code */ -:not(pre)>code[class*="language-"] { - padding: .1em; - border-radius: .3em; - white-space: normal; -} - -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: slategray; -} - -.token.punctuation { - color: #999; -} - -.namespace { - opacity: .7; -} - -.token.property, -.token.tag, -.token.boolean, -.token.number, -.token.constant, -.token.symbol, -.token.deleted { - color: #905; -} - -.token.selector, -.token.attr-name, -.token.string, -.token.char, -.token.builtin, -.token.inserted { - color: #690; -} - -.token.operator, -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string { - color: #9a6e3a; - background: hsla(0, 0%, 100%, .5); -} - -.token.atrule, -.token.attr-value, -.token.keyword { - color: #07a; -} - -.token.function, -.token.class-name { - color: #DD4A68; -} - -.token.regex, -.token.important, -.token.variable { - color: #e90; -} - -.token.important, -.token.bold { - font-weight: bold; -} - -.token.italic { - font-style: italic; -} - -.token.entity { - cursor: help; -} diff --git a/src/assets/font/demo_index.html b/src/assets/font/demo_index.html deleted file mode 100644 index 7dbaf14..0000000 --- a/src/assets/font/demo_index.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - IconFont Demo - - - - - - - - - - - -
-

- -
-
-
    - -
  • - -
    icon_group
    -
    &#xeb95;
    -
  • - -
  • - -
    icon_mobilephone
    -
    &#xeb98;
    -
  • - -
  • - -
    icon_dmail
    -
    &#xeb94;
    -
  • - -
  • - -
    icon_message
    -
    &#xeb97;
    -
  • - -
  • - -
    icon_left
    -
    &#xeb99;
    -
  • - -
  • - -
    icon_next_arrow
    -
    &#xeb9a;
    -
  • - -
  • - -
    icon_statistics
    -
    &#xeb9f;
    -
  • - -
-
-

Unicode 引用

-
- -

Unicode 是字体在网页端最原始的应用方式,特点是:

-
    -
  • 兼容性最好,支持 IE6+,及所有现代浏览器。
  • -
  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • -
  • 但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。
  • -
-
-

注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式

-
-

Unicode 使用步骤如下:

-

第一步:拷贝项目下面生成的 @font-face

-
@font-face {
-  font-family: 'iconfont';
-  src: url('iconfont.eot');
-  src: url('iconfont.eot?#iefix') format('embedded-opentype'),
-      url('iconfont.woff2') format('woff2'),
-      url('iconfont.woff') format('woff'),
-      url('iconfont.ttf') format('truetype'),
-      url('iconfont.svg#iconfont') format('svg');
-}
-
-

第二步:定义使用 iconfont 的样式

-
.iconfont {
-  font-family: "iconfont" !important;
-  font-size: 16px;
-  font-style: normal;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-
-

第三步:挑选相应图标并获取字体编码,应用于页面

-
-<span class="iconfont">&#x33;</span>
-
-
-

"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

-
-
-
-
-
    - -
  • - -
    - icon_group -
    -
    .chinawealicon_group -
    -
  • - -
  • - -
    - icon_mobilephone -
    -
    .chinawealicon_mobilephone -
    -
  • - -
  • - -
    - icon_dmail -
    -
    .chinawealicon_dmail -
    -
  • - -
  • - -
    - icon_message -
    -
    .chinawealicon_message -
    -
  • - -
  • - -
    - icon_left -
    -
    .chinawealicon_left -
    -
  • - -
  • - -
    - icon_next_arrow -
    -
    .chinawealicon_next_arrow -
    -
  • - -
  • - -
    - icon_statistics -
    -
    .chinawealicon_statistics -
    -
  • - -
-
-

font-class 引用

-
- -

font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

-

与 Unicode 使用方式相比,具有如下特点:

-
    -
  • 兼容性良好,支持 IE8+,及所有现代浏览器。
  • -
  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • -
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
  • -
  • 不过因为本质上还是使用的字体,所以多色图标还是不支持的。
  • -
-

使用步骤如下:

-

第一步:引入项目下面生成的 fontclass 代码:

-
<link rel="stylesheet" href="./iconfont.css">
-
-

第二步:挑选相应图标并获取类名,应用于页面:

-
<span class="iconfont chinawealxxx"></span>
-
-
-

" - iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

-
-
-
-
-
    - -
  • - -
    icon_group
    -
    #chinawealicon_group
    -
  • - -
  • - -
    icon_mobilephone
    -
    #chinawealicon_mobilephone
    -
  • - -
  • - -
    icon_dmail
    -
    #chinawealicon_dmail
    -
  • - -
  • - -
    icon_message
    -
    #chinawealicon_message
    -
  • - -
  • - -
    icon_left
    -
    #chinawealicon_left
    -
  • - -
  • - -
    icon_next_arrow
    -
    #chinawealicon_next_arrow
    -
  • - -
  • - -
    icon_statistics
    -
    #chinawealicon_statistics
    -
  • - -
-
-

Symbol 引用

-
- -

这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 - 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

-
    -
  • 支持多色图标了,不再受单色限制。
  • -
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • -
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • -
  • 浏览器渲染 SVG 的性能一般,还不如 png。
  • -
-

使用步骤如下:

-

第一步:引入项目下面生成的 symbol 代码:

-
<script src="./iconfont.js"></script>
-
-

第二步:加入通用 CSS 代码(引入一次就行):

-
<style>
-.icon {
-  width: 1em;
-  height: 1em;
-  vertical-align: -0.15em;
-  fill: currentColor;
-  overflow: hidden;
-}
-</style>
-
-

第三步:挑选相应图标并获取类名,应用于页面:

-
<svg class="icon" aria-hidden="true">
-  <use xlink:href="#icon-xxx"></use>
-</svg>
-
-
-
- -
-
- - - diff --git a/src/assets/font/iconfont.css b/src/assets/font/iconfont.css deleted file mode 100644 index 6bb7a77..0000000 --- a/src/assets/font/iconfont.css +++ /dev/null @@ -1,54 +0,0 @@ -@font-face {font-family: "iconfont"; - src: url('iconfont.eot?t=1573086485730'); /* IE9 */ - src: url('iconfont.eot?t=1573086485730#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAYEAAsAAAAAC8QAAAW2AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDVAqJZIdjATYCJAMgCxIABCAFhG0HgRMb6AkR1aQbkP08sJst8g+IFvVghy0TO6S6+gz+28x5+xZYFm+wiCvE9czJichSh7QeszMXSMW+zqg6DUAQwN/325Sh2i1kKsyUCIPvssx/sMPLhVElq9sAAav+/+eY6SKxnue3rZ0ii7qoaTgcJdDAMi7KW+8NbAeKpxKdzU16wXsaCAAefogBKSqpagIHFpyGoGzurNYp4GxWsCEkAs4g9jnKgnwAETjGxtwB8L7698SFJMIBDEQU3LPqLMXTYXa1u4ao4BaMpwKE/NwArqcACiAGAAuQhb7e2aB6IgYU/DuXRR4Ajp/FAK4OV69ryO1m1HZXl7wtCQ481Dl6CNhK/edBDAlAxOC0cmCnJyWAq120gPanDGaQj64LbGABVzcbGMDVI4YPrl6wQQy4hqyQAM2tVgPQAuQ1gHxB2Bwt5UkikCo2LSZYqlZrBZWUu0qjUWdUKjnRGl7WG9YZluZ8RKzRXYZ2g6GrjxBr1imvzq4umY44HMCTJz4bHeUnY3v2hLRrebtfZ/j8vb7Ck6aUIyEnAjSbsralpTmdZCg+KbFv6KLT/qQZ3QORug59R4tzZFQOqmZegl/Oq7ed87IaRmpHRoIHnS1T2nZbd9l3CDtXb9lhZHt2hiq27/YW9e4Km6o4+tBX3P8gRX7skZ9k6PGarq07u7XTd9ijLJ29u7frZnS0GSz2HWCFnTJN224isu7iV2viI1mkGiG6cat9l3V3205hh0xLTR+1Xab46ZVZLJdtPespa2o/pu8khE9tT1fldo/WGR2CNqLdrrd0Wg2tXW26SDtzSvs2fYO614/Ua2iUxNm2ghF28HKHo3lkZJTTOV7IaVEcf+xPHaEnT8ZSUd1UqrlGHvBTWfiA+G2v+etFVr7mj4zg2LI1pGT1/gFtmbn74lqt300exMwXjy4oo0UZ+Qn5K7z2jZbuiGsz3kIS2muNYV81cKYqc73uizsbzjj8HWfW7/muTue4UpOkcewAM2bv7y99JpTW1nbV1KBkouylpH80GVjxJSYsWDGbzCILl0+awI6qaBo7cTCoOsIc6VE9trdrEec/nMxzBm31X1URw0Hzx1Y20VFwm5QaH36VPHhywi46THclDKsr9psuCM0cuGaBtiFl08od1mCjLcV4o+xGCmUbg607ko3dWHFwglKjyFFolBlYlSyYM4RmSY6kWaBcmLZpd0fsQu/de7RZm9858Z5CP1mpUULUf3NST67sim8ebf6n6X6/ev3keui/YduxYoMg6LF52izdnt1799q8bJJYV1tc94PA9QjdOptXD6+2Sd/WSW2cbWVg7fzFP68emD6U7awh1Zanzu30AH35Upq53fn0yverOvZO4MJn1vdqXHh65xhZRduvXTvSN3Rc9fvvh+MJfuC/VJ8l/81LfLCBA8D9gGVoAuAepmY6GQ5Az/wH7uv0AU0H3Icot6UGjvs75hfqAbgvUF5vOiKW4eWK9U1S5fzGyf4kA5++eFOnmt3D+fomw9msZbFl239dANz/x9wUnI3r1Zkojc3kvAFRjAHwvAPY+jPAK77KU687lQIER2cCQ8IXKE4IksXGgIhMCohxTMCLVnpaxsNiPpIUQJQ3CAi1/cBQOg+U2l0ki/0SRPS+AzF1FHgt87ijTFiz+MLFSBQ5Tf3SrIx7Izh0rZU/UIxtIlaFSvtAbBWmxLgEZzpED8ljx5KpuC9VQxbhjkroeWhbpoXCNTI9z1Qdgvh4i987nadx56wVEpBQkCNTfZFZMqxn5P5q7br9AxRGrYSEtHyLfoCwqulJojgJMZChto/Vsi61S0wKd0tZzCCWaynrkBLmhpZPMLLQf1ENMupsZorYIBDPulnias/l67spPQHA4x7BjSGUsERExERCOCLFSBVGhfA4HA2+jtOqxVDq4M+Wd0nVbgthbVJg9Um0MHrQl/RYNEpEeP5FrSZaSfEqs44DAA==') format('woff2'), - url('iconfont.woff?t=1573086485730') format('woff'), - url('iconfont.ttf?t=1573086485730') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ - url('iconfont.svg?t=1573086485730#iconfont') format('svg'); /* iOS 4.1- */ -} - -.iconfont { - font-family: "iconfont" !important; - font-size: 16px; - font-style: normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -[class^="el-icon-chinaweal"], [class*=" el-icon-chinaweal"] { - font-family:"iconfont" !important; - - /* 以下内容参照第三方图标库本身的规则 */ - font-size: inherit; - font-style:normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.chinawealicon_group:before { - content: "\eb95"; -} - -.chinawealicon_mobilephone:before { - content: "\eb98"; -} - -.chinawealicon_dmail:before { - content: "\eb94"; -} - -.chinawealicon_message:before { - content: "\eb97"; -} - -.chinawealicon_left:before { - content: "\eb99"; -} - -.chinawealicon_next_arrow:before { - content: "\eb9a"; -} - -.chinawealicon_statistics:before { - content: "\eb9f"; -} - diff --git a/src/assets/font/iconfont.eot b/src/assets/font/iconfont.eot deleted file mode 100644 index e280692..0000000 Binary files a/src/assets/font/iconfont.eot and /dev/null differ diff --git a/src/assets/font/iconfont.js b/src/assets/font/iconfont.js deleted file mode 100644 index 9a45f17..0000000 --- a/src/assets/font/iconfont.js +++ /dev/null @@ -1 +0,0 @@ -!function(l){var e,t='',c=(e=document.getElementsByTagName("script"))[e.length-1].getAttribute("data-injectcss");if(c&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(e){console&&console.log(e)}}!function(e){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(e,0);else{var c=function(){document.removeEventListener("DOMContentLoaded",c,!1),e()};document.addEventListener("DOMContentLoaded",c,!1)}else document.attachEvent&&(n=e,o=l.document,i=!1,(a=function(){try{o.documentElement.doScroll("left")}catch(e){return void setTimeout(a,50)}t()})(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,t())});function t(){i||(i=!0,n())}var n,o,i,a}(function(){var e,c;(e=document.createElement("div")).innerHTML=t,t=null,(c=e.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",function(e,c){c.firstChild?function(e,c){c.parentNode.insertBefore(e,c)}(e,c.firstChild):c.appendChild(e)}(c,document.body))})}(window); \ No newline at end of file diff --git a/src/assets/font/iconfont.json b/src/assets/font/iconfont.json deleted file mode 100644 index 2eec579..0000000 --- a/src/assets/font/iconfont.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "id": "1496577", - "name": "众望通前端框架", - "font_family": "iconfont", - "css_prefix_text": "chinaweal", - "description": "", - "glyphs": [ - { - "icon_id": "7766747", - "name": "icon_group", - "font_class": "icon_group", - "unicode": "eb95", - "unicode_decimal": 60309 - }, - { - "icon_id": "7766758", - "name": "icon_mobilephone", - "font_class": "icon_mobilephone", - "unicode": "eb98", - "unicode_decimal": 60312 - }, - { - "icon_id": "7766759", - "name": "icon_dmail", - "font_class": "icon_dmail", - "unicode": "eb94", - "unicode_decimal": 60308 - }, - { - "icon_id": "7766760", - "name": "icon_message", - "font_class": "icon_message", - "unicode": "eb97", - "unicode_decimal": 60311 - }, - { - "icon_id": "7766764", - "name": "icon_left", - "font_class": "icon_left", - "unicode": "eb99", - "unicode_decimal": 60313 - }, - { - "icon_id": "7766765", - "name": "icon_next_arrow", - "font_class": "icon_next_arrow", - "unicode": "eb9a", - "unicode_decimal": 60314 - }, - { - "icon_id": "7766801", - "name": "icon_statistics", - "font_class": "icon_statistics", - "unicode": "eb9f", - "unicode_decimal": 60319 - } - ] -} diff --git a/src/assets/font/iconfont.svg b/src/assets/font/iconfont.svg deleted file mode 100644 index ed0328d..0000000 --- a/src/assets/font/iconfont.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - -Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/assets/font/iconfont.ttf b/src/assets/font/iconfont.ttf deleted file mode 100644 index df24604..0000000 Binary files a/src/assets/font/iconfont.ttf and /dev/null differ diff --git a/src/assets/font/iconfont.woff b/src/assets/font/iconfont.woff deleted file mode 100644 index 41ed702..0000000 Binary files a/src/assets/font/iconfont.woff and /dev/null differ diff --git a/src/assets/font/iconfont.woff2 b/src/assets/font/iconfont.woff2 deleted file mode 100644 index d048ba5..0000000 Binary files a/src/assets/font/iconfont.woff2 and /dev/null differ diff --git a/src/assets/images/maintain.png b/src/assets/images/maintain.png old mode 100644 new mode 100755 diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue deleted file mode 100644 index e65a60d..0000000 --- a/src/components/Breadcrumb/index.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - - - diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue deleted file mode 100644 index 368b002..0000000 --- a/src/components/Hamburger/index.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue deleted file mode 100644 index b07ded2..0000000 --- a/src/components/SvgIcon/index.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/src/icons/index.js b/src/icons/index.js deleted file mode 100644 index 2c6b309..0000000 --- a/src/icons/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import Vue from 'vue' -import SvgIcon from '@/components/SvgIcon'// svg component - -// register globally -Vue.component('svg-icon', SvgIcon) - -const req = require.context('./svg', false, /\.svg$/) -const requireAll = requireContext => requireContext.keys().map(requireContext) -requireAll(req) diff --git a/src/icons/svg/dashboard.svg b/src/icons/svg/dashboard.svg deleted file mode 100644 index 5317d37..0000000 --- a/src/icons/svg/dashboard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/example.svg b/src/icons/svg/example.svg deleted file mode 100644 index 46f42b5..0000000 --- a/src/icons/svg/example.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/eye-open.svg b/src/icons/svg/eye-open.svg deleted file mode 100644 index 88dcc98..0000000 --- a/src/icons/svg/eye-open.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/eye.svg b/src/icons/svg/eye.svg deleted file mode 100644 index 16ed2d8..0000000 --- a/src/icons/svg/eye.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/form.svg b/src/icons/svg/form.svg deleted file mode 100644 index dcbaa18..0000000 --- a/src/icons/svg/form.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/link.svg b/src/icons/svg/link.svg deleted file mode 100644 index 48197ba..0000000 --- a/src/icons/svg/link.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/nested.svg b/src/icons/svg/nested.svg deleted file mode 100644 index 06713a8..0000000 --- a/src/icons/svg/nested.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/password.svg b/src/icons/svg/password.svg deleted file mode 100644 index e291d85..0000000 --- a/src/icons/svg/password.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/table.svg b/src/icons/svg/table.svg deleted file mode 100644 index 0e3dc9d..0000000 --- a/src/icons/svg/table.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/template.svg b/src/icons/svg/template.svg deleted file mode 100644 index 8552b06..0000000 --- a/src/icons/svg/template.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/tree.svg b/src/icons/svg/tree.svg deleted file mode 100644 index dd4b7dd..0000000 --- a/src/icons/svg/tree.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/user.svg b/src/icons/svg/user.svg deleted file mode 100644 index 0ba0716..0000000 --- a/src/icons/svg/user.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svgo.yml b/src/icons/svgo.yml deleted file mode 100644 index d11906a..0000000 --- a/src/icons/svgo.yml +++ /dev/null @@ -1,22 +0,0 @@ -# replace default config - -# multipass: true -# full: true - -plugins: - - # - name - # - # or: - # - name: false - # - name: true - # - # or: - # - name: - # param1: 1 - # param2: 2 - -- removeAttrs: - attrs: - - 'fill' - - 'fill-rule' diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue deleted file mode 100644 index 4bfea1b..0000000 --- a/src/layout/components/AppMain.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue deleted file mode 100644 index 5407f57..0000000 --- a/src/layout/components/Navbar.vue +++ /dev/null @@ -1,131 +0,0 @@ - - - - - diff --git a/src/layout/components/Sidebar/FixiOSBug.js b/src/layout/components/Sidebar/FixiOSBug.js deleted file mode 100644 index bc14856..0000000 --- a/src/layout/components/Sidebar/FixiOSBug.js +++ /dev/null @@ -1,26 +0,0 @@ -export default { - computed: { - 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 - // https://github.com/PanJiaChen/vue-element-admin/issues/1135 - this.fixBugIniOS() - }, - methods: { - fixBugIniOS() { - const $subMenu = this.$refs.subMenu - if ($subMenu) { - const handleMouseleave = $subMenu.handleMouseleave - $subMenu.handleMouseleave = (e) => { - if (this.device === 'mobile') { - return - } - handleMouseleave(e) - } - } - } - } -} diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue deleted file mode 100644 index b515f61..0000000 --- a/src/layout/components/Sidebar/Item.vue +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue deleted file mode 100644 index eb4dd10..0000000 --- a/src/layout/components/Sidebar/Link.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue deleted file mode 100644 index 773936e..0000000 --- a/src/layout/components/Sidebar/Logo.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue deleted file mode 100644 index 2d49dd8..0000000 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue deleted file mode 100644 index fb014a2..0000000 --- a/src/layout/components/Sidebar/index.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/src/layout/components/index.js b/src/layout/components/index.js deleted file mode 100644 index 97ee3cd..0000000 --- a/src/layout/components/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as Navbar } from './Navbar' -export { default as Sidebar } from './Sidebar' -export { default as AppMain } from './AppMain' diff --git a/src/layout/mixin/ResizeHandler.js b/src/layout/mixin/ResizeHandler.js deleted file mode 100644 index e8d0df8..0000000 --- a/src/layout/mixin/ResizeHandler.js +++ /dev/null @@ -1,45 +0,0 @@ -import store from '@/store' - -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 }) - } - } - }, - beforeMount() { - window.addEventListener('resize', this.$_resizeHandler) - }, - beforeDestroy() { - window.removeEventListener('resize', this.$_resizeHandler) - }, - mounted() { - const isMobile = this.$_isMobile() - if (isMobile) { - 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 - }, - $_resizeHandler() { - if (!document.hidden) { - const isMobile = this.$_isMobile() - store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') - - if (isMobile) { - store.dispatch('app/closeSideBar', { withoutAnimation: true }) - } - } - } - } -} diff --git a/src/plugins/element.js b/src/plugins/element.js deleted file mode 100644 index 523a72f..0000000 --- a/src/plugins/element.js +++ /dev/null @@ -1,6 +0,0 @@ -import Vue from 'vue' -import Element from 'element-ui' -import 'element-ui/lib/theme-chalk/index.css' -import locale from 'element-ui/lib/locale/lang/zh-CN' // 中文 - -Vue.use(Element, { locale }) diff --git a/src/router/permission.js b/src/router/permission.js index 80df954..0d83bc8 100644 --- a/src/router/permission.js +++ b/src/router/permission.js @@ -14,19 +14,11 @@ router.beforeEach(async (to, from, next) => { await oauthLoginByCerno(to.query.token, to.query.cerno, to.query.tel).then((data) => { setToken('token') }).catch(() => { - callMessage({ - type: 'error', - message: '登录失败' - }) }) } else { await oauthLogin(to.query.token).then((data) => { setToken('token') }).catch(() => { - callMessage({ - type: 'error', - message: '登录失败' - }) }) } next({ diff --git a/src/settings.js b/src/settings.js deleted file mode 100644 index 6cb7ae5..0000000 --- a/src/settings.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - - title: process.env.VUE_APP_NAME, - - /** - * @type {boolean} true | false - * @description Whether fix the header - */ - fixedHeader: true, - - /** - * @type {boolean} true | false - * @description Whether show the logo in sidebar - */ - sidebarLogo: true -} diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js deleted file mode 100644 index 8ffbadd..0000000 --- a/src/store/modules/settings.js +++ /dev/null @@ -1,29 +0,0 @@ -import defaultSettings from '@/settings' - -const { showSettings, fixedHeader, sidebarLogo } = defaultSettings - -const state = { - showSettings: showSettings, - fixedHeader: fixedHeader, - sidebarLogo: sidebarLogo -} - -const mutations = { - CHANGE_SETTING: (state, { key, value }) => { - state[key] = value - } -} - -const actions = { - changeSetting({ commit }, data) { - commit('CHANGE_SETTING', data) - } -} - -export default { - namespaced: true, - state, - mutations, - actions -} - diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss deleted file mode 100644 index 6af3bfd..0000000 --- a/src/styles/element-ui.scss +++ /dev/null @@ -1,44 +0,0 @@ -// cover some element-ui styles - -.el-breadcrumb__inner, -.el-breadcrumb__inner a { - font-weight: 400 !important; -} - -.el-upload { - input[type="file"] { - display: none !important; - } -} - -.el-upload__input { - display: none; -} - - -// to fixed https://github.com/ElemeFE/element/issues/2461 -.el-dialog { - transform: none; - left: 0; - position: relative; - margin: 0 auto; -} - -// refine element ui upload -.upload-container { - .el-upload { - width: 100%; - - .el-upload-dragger { - width: 100%; - height: 200px; - } - } -} - -// dropdown -.el-dropdown-menu { - a { - display: block - } -} diff --git a/src/styles/mixin.scss b/src/styles/mixin.scss deleted file mode 100644 index 36b74bb..0000000 --- a/src/styles/mixin.scss +++ /dev/null @@ -1,28 +0,0 @@ -@mixin clearfix { - &:after { - content: ""; - display: table; - clear: both; - } -} - -@mixin scrollBar { - &::-webkit-scrollbar-track-piece { - background: #d3dce6; - } - - &::-webkit-scrollbar { - width: 6px; - } - - &::-webkit-scrollbar-thumb { - background: #99a9bf; - border-radius: 20px; - } -} - -@mixin relative { - position: relative; - width: 100%; - height: 100%; -} diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss deleted file mode 100644 index 3dad4c3..0000000 --- a/src/styles/sidebar.scss +++ /dev/null @@ -1,209 +0,0 @@ -#app { - - .main-container { - min-height: 100%; - transition: margin-left .28s; - margin-left: $sideBarWidth; - position: relative; - } - - .sidebar-container { - transition: width 0.28s; - width: $sideBarWidth !important; - background-color: $menuBg; - height: 100%; - position: fixed; - font-size: 0px; - top: 0; - bottom: 0; - left: 0; - z-index: 1001; - overflow: hidden; - - // reset element-ui css - .horizontal-collapse-transition { - transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; - } - - .scrollbar-wrapper { - overflow-x: hidden !important; - } - - .el-scrollbar__bar.is-vertical { - right: 0px; - } - - .el-scrollbar { - height: 100%; - } - - &.has-logo { - .el-scrollbar { - height: calc(100% - 50px); - } - } - - .is-horizontal { - display: none; - } - - a { - display: inline-block; - width: 100%; - overflow: hidden; - } - - .svg-icon { - margin-right: 16px; - } - - .el-menu { - border: none; - height: 100%; - width: 100% !important; - } - - // menu hover - .submenu-title-noDropdown, - .el-submenu__title { - &:hover { - background-color: $menuHover !important; - } - } - - .is-active>.el-submenu__title { - color: $subMenuActiveText !important; - } - - & .nest-menu .el-submenu>.el-submenu__title, - & .el-submenu .el-menu-item { - min-width: $sideBarWidth !important; - background-color: $subMenuBg !important; - - &:hover { - background-color: $subMenuHover !important; - } - } - } - - .hideSidebar { - .sidebar-container { - width: 54px !important; - } - - .main-container { - margin-left: 54px; - } - - .submenu-title-noDropdown { - padding: 0 !important; - position: relative; - - .el-tooltip { - padding: 0 !important; - - .svg-icon { - margin-left: 20px; - } - } - } - - .el-submenu { - overflow: hidden; - - &>.el-submenu__title { - padding: 0 !important; - - .svg-icon { - margin-left: 20px; - } - - .el-submenu__icon-arrow { - display: none; - } - } - } - - .el-menu--collapse { - .el-submenu { - &>.el-submenu__title { - &>span { - height: 0; - width: 0; - overflow: hidden; - visibility: hidden; - display: inline-block; - } - } - } - } - } - - .el-menu--collapse .el-menu .el-submenu { - min-width: $sideBarWidth !important; - } - - // mobile responsive - .mobile { - .main-container { - margin-left: 0px; - } - - .sidebar-container { - transition: transform .28s; - width: $sideBarWidth !important; - } - - &.hideSidebar { - .sidebar-container { - pointer-events: none; - transition-duration: 0.3s; - transform: translate3d(-$sideBarWidth, 0, 0); - } - } - } - - .withoutAnimation { - - .main-container, - .sidebar-container { - transition: none; - } - } -} - -// when menu collapsed -.el-menu--vertical { - &>.el-menu { - .svg-icon { - margin-right: 16px; - } - } - - .nest-menu .el-submenu>.el-submenu__title, - .el-menu-item { - &:hover { - // you can use $subMenuHover - background-color: $menuHover !important; - } - } - - // the scroll bar appears when the subMenu is too long - >.el-menu--popup { - max-height: 100vh; - overflow-y: auto; - - &::-webkit-scrollbar-track-piece { - background: #d3dce6; - } - - &::-webkit-scrollbar { - width: 6px; - } - - &::-webkit-scrollbar-thumb { - background: #99a9bf; - border-radius: 20px; - } - } -} diff --git a/src/styles/transition.scss b/src/styles/transition.scss deleted file mode 100644 index 4cb27cc..0000000 --- a/src/styles/transition.scss +++ /dev/null @@ -1,48 +0,0 @@ -// global transition css - -/* fade */ -.fade-enter-active, -.fade-leave-active { - transition: opacity 0.28s; -} - -.fade-enter, -.fade-leave-active { - opacity: 0; -} - -/* fade-transform */ -.fade-transform-leave-active, -.fade-transform-enter-active { - transition: all .5s; -} - -.fade-transform-enter { - opacity: 0; - transform: translateX(-30px); -} - -.fade-transform-leave-to { - opacity: 0; - transform: translateX(30px); -} - -/* breadcrumb transition */ -.breadcrumb-enter-active, -.breadcrumb-leave-active { - transition: all .5s; -} - -.breadcrumb-enter, -.breadcrumb-leave-active { - opacity: 0; - transform: translateX(20px); -} - -.breadcrumb-move { - transition: all .5s; -} - -.breadcrumb-leave-active { - position: absolute; -} diff --git a/src/styles/variables.scss b/src/styles/variables.scss deleted file mode 100644 index 951ac09..0000000 --- a/src/styles/variables.scss +++ /dev/null @@ -1,37 +0,0 @@ -// sidebar -//原始样式 -$menuText:#bfcbd9; -$menuActiveText:#409EFF; -$subMenuActiveText:#f4f4f5; //https://github.com/ElemeFE/element/issues/12951 - -$menuBg:#304156; -$menuHover:#263445; - -$subMenuBg:#1f2d3d; -$subMenuHover:#001528; - -//亮白左菜主题 -// $menuText:#595959; //一级菜单字体颜色 -// $menuActiveText:#409EFF; //激活字体颜色 -// $subMenuActiveText:#595959; //子级菜单字体颜色 - -// $menuBg:#eef1f6; //一级背景 -// $menuHover:#d1dbe5;//一级hover颜色 - -// $subMenuBg:#e4e8f1;//子级背景 -// $subMenuHover:#d1dbe5;//子级hover颜色 - -$sideBarWidth: 210px;//左菜单宽度 - -// the :export directive is the magic sauce for webpack -// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass -:export { - menuText: $menuText; - menuActiveText: $menuActiveText; - subMenuActiveText: $subMenuActiveText; - menuBg: $menuBg; - menuHover: $menuHover; - subMenuBg: $subMenuBg; - subMenuHover: $subMenuHover; - sideBarWidth: $sideBarWidth; -} diff --git a/src/utils/get-page-title.js b/src/utils/get-page-title.js deleted file mode 100644 index 979d9f6..0000000 --- a/src/utils/get-page-title.js +++ /dev/null @@ -1,10 +0,0 @@ -import defaultSettings from '@/settings' - -const title = defaultSettings.title || 'youfool-vue-template' - -export default function getPageTitle(pageTitle) { - if (pageTitle) { - return `${pageTitle} - ${title}` - } - return `${title}` -} diff --git a/src/version.js b/src/version.js deleted file mode 100644 index b037c2f..0000000 --- a/src/version.js +++ /dev/null @@ -1,2 +0,0 @@ -/** 本文件由打包插件自动生成和修改 */ -export default '' diff --git a/src/views/Maintain.vue b/src/views/Maintain.vue old mode 100644 new mode 100755 diff --git a/src/views/business/年度报告管理.vue b/src/views/business/年度报告管理.vue index 1c6ba6f..11d92a3 100644 --- a/src/views/business/年度报告管理.vue +++ b/src/views/business/年度报告管理.vue @@ -48,11 +48,12 @@ export default { }, methods: { reportYear() { - if (this.$store.getters.userInfo.entBizTypeInfo?.bizInfo?.includes('GTH')) { - return showDialog({ - message: '个体工商户年度报告功能暂未开放' - }) - } + // 2026.03.30.cc 解除个体工商户年报限制 + // if (this.$store.getters.userInfo.entBizTypeInfo?.bizInfo?.includes('GTH')) { + // return showDialog({ + // message: '个体工商户年度报告功能暂未开放' + // }) + // } return annualFillBaseYearList().then((data) => { const year = data.sort((a, b) => { return Number(a) - Number(b) diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue deleted file mode 100644 index 5b774e7..0000000 --- a/src/views/dashboard/index.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - - diff --git a/src/views/index.vue b/src/views/index.vue index cafd749..d6eac6f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -10,7 +10,7 @@
- + diff --git a/src/views/login/index.vue b/src/views/login/index.vue deleted file mode 100644 index 3ae63ea..0000000 --- a/src/views/login/index.vue +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - diff --git a/src/views/table/index.vue b/src/views/table/index.vue deleted file mode 100644 index 23f6147..0000000 --- a/src/views/table/index.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - diff --git a/vue.config.js b/vue.config.js deleted file mode 100644 index 60f63d5..0000000 --- a/vue.config.js +++ /dev/null @@ -1,169 +0,0 @@ -'use strict' -const path = require('path') -const defaultSettings = require('./src/settings.js') -const IncrePack = require('./build/increpack') -const ConstantFile = require('./build/constant-file') - -function resolve(dir) { - return path.join(__dirname, dir) -} - -const name = defaultSettings.title || 'youfool-vue-template' // page title - -// If your port is set to 80, -// use administrator privileges to execute the command line. -// For example, Mac: sudo npm run -// You can change the port by the following methods: -// port = 9528 npm run dev OR npm run dev --port = 9528 -const port = process.env.port || process.env.npm_config_port || 9528 // dev port - -// All configuration item explanations can be find in https://cli.vuejs.org/config/ -module.exports = { - /** - * You will need to set publicPath if you plan to deploy your site under a sub path, - * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/, - * then publicPath should be set to "/bar/". - * In most cases please use '/' !!! - * Detail: https://cli.vuejs.org/config/#publicpath - */ - publicPath: process.env.VUE_APP_PUBLICPATH, - outputDir: 'dist', - assetsDir: 'static', - lintOnSave: process.env.NODE_ENV === 'development', - productionSourceMap: false, - devServer: { - port: port, - open: false, - overlay: { - warnings: false, - errors: true - }, - proxy: { - // change xxx-api/login => mock/login - // detail: https://cli.vuejs.org/config/#devserver-proxy - // 如果有多个mock请往里面继续添加 - [process.env.VUE_APP_BASE_API + '/user']: { - target: `http://127.0.0.1:${port}/mock`, - changeOrigin: true, - pathRewrite: { - ['^' + process.env.VUE_APP_BASE_API]: '' - } - }, - [process.env.VUE_APP_BASE_API + '/table']: { - target: `http://127.0.0.1:${port}/mock`, - changeOrigin: true, - pathRewrite: { - ['^' + process.env.VUE_APP_BASE_API]: '' - } - } - // [process.env.VUE_APP_BASE_API]: { - // target: `http://mock-api.com`, - // changeOrigin: true, - // pathRewrite: { - // ['^' + process.env.VUE_APP_BASE_API]: '' - // } - // } - } - }, - configureWebpack: { - // provide the app's title in webpack's name field, so that - // it can be accessed in index.html to inject the correct title. - name: name, - resolve: { - alias: { - '@': resolve('src') - } - }, - plugins: [ - new IncrePack(), - new ConstantFile({ api: process.env.CMS_DICT_API }) - ] - }, - // 引入自定义的全局样式表 - css: { - loaderOptions: { - sass: { - prependData: `@import "./src/assets/css/global.scss";` - } - } - }, - // 兼容浏览器 - transpileDependencies: ['element-ui'], - chainWebpack(config) { - config.plugins.delete('preload') // TODO: need test - config.plugins.delete('prefetch') // TODO: need test - - // set svg-sprite-loader - config.module - .rule('svg') - .exclude.add(resolve('src/icons')) - .end() - config.module - .rule('icons') - .test(/\.svg$/) - .include.add(resolve('src/icons')) - .end() - .use('svg-sprite-loader') - .loader('svg-sprite-loader') - .options({ - symbolId: 'icon-[name]' - }) - .end() - - // set preserveWhitespace - config.module - .rule('vue') - .use('vue-loader') - .loader('vue-loader') - .tap(options => { - options.compilerOptions.preserveWhitespace = true - return options - }) - .end() - - config - // https://webpack.js.org/configuration/devtool/#development - .when(process.env.NODE_ENV === 'development', - config => config.devtool('cheap-source-map') - ) - - config - .when(process.env.NODE_ENV !== 'development', - config => { - config - .plugin('ScriptExtHtmlWebpackPlugin') - .after('html') - .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` - inline: /runtime\..*\.js$/ - }]) - .end() - config - .optimization.splitChunks({ - chunks: 'all', - cacheGroups: { - libs: { - name: 'chunk-libs', - test: /[\\/]node_modules[\\/]/, - priority: 10, - chunks: 'initial' // only package third parties that are initially dependent - }, - elementUI: { - name: 'chunk-elementUI', // split elementUI into a single package - priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app - test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm - }, - commons: { - name: 'chunk-commons', - test: resolve('src/components'), // can customize your rules - minChunks: 3, // minimum common number - priority: 5, - reuseExistingChunk: true - } - } - }) - config.optimization.runtimeChunk('single') - } - ) - } -} diff --git a/前端流程图.png b/前端流程图.png deleted file mode 100644 index b296f07..0000000 Binary files a/前端流程图.png and /dev/null differ