|  | vor 8 Monaten | |
|---|---|---|
| .github | vor 1 Jahr | |
| @ | vor 9 Monaten | |
| build | vor 1 Jahr | |
| js | vor 2 Jahren | |
| mock | vor 1 Jahr | |
| public | vor 9 Monaten | |
| src | vor 8 Monaten | |
| tests | vor 3 Jahren | |
| types | vor 9 Monaten | |
| .babelrc | vor 1 Jahr | |
| .editorconfig | vor 4 Jahren | |
| .env | vor 1 Jahr | |
| .env.development | vor 8 Monaten | |
| .env.production | vor 1 Jahr | |
| .eslintignore | vor 4 Jahren | |
| .eslintrc.js | vor 3 Jahren | |
| .gitignore | vor 10 Monaten | |
| .gitpod.yml | vor 4 Jahren | |
| .prettierignore | vor 4 Jahren | |
| .stylelintignore | vor 4 Jahren | |
| Dockerfile | vor 2 Jahren | |
| LICENSE | vor 2 Jahren | |
| README.md | vor 10 Monaten | |
| commitlint.config.js | vor 1 Jahr | |
| index.html | vor 10 Monaten | |
| jest.config.mjs | vor 4 Jahren | |
| npm | vor 4 Jahren | |
| npminstall-debug.log | vor 11 Monaten | |
| package.json | vor 1 Jahr | |
| pnpm-lock.yaml | vor 1 Jahr | |
| postcss.config.js | vor 4 Jahren | |
| prettier.config.js | vor 3 Jahren | |
| stylelint.config.js | vor 1 Jahr | |
| tsconfig.json | vor 2 Jahren | |
| vite.config.ts | vor 1 Jahr | 
系统v2.0前端代码仓库
本项目以jeecgboot为模板,请先阅读此文档后继续!
建议:安装 nvm 或其他 nodejs 版本管理器,使用 VSCode 作为 IDE,使用 Chrome/Edge 浏览器;
在项目目录下执行 pnpm install
在项目目录下执行 git config commit.template .github/COMMIT_TEMPLATE
开发的基本流程,部分内容可忽略
git pull # 可以rebase
git checkout [branch] # 可选
nvm use 20 # 建议,高版本node自带pnpm包管理器
pnpm dev # 必选,dddd
git add .
git commit # 公用模板见.github/COMMIT_TEMPLATE
git push origin [branch] # 目前master分支无保护,可直接推
pnpm build
主题可以在 /views/vent/sys/setting/index.vue 中找到设置入口
常规的颜色、变量在 /design/color.less 或 /design/themify/ 下添加,图片资源应在 /assets/images/themify/ 下添加
各个页面的主题化标准模板可以参考登录页 /views/sys/login/Login.vue
下面是配合主题化使用的工具,输入页面的 css 样式,即可输出标准模板所需的资源
// Please make sure these requires before using this function:
// 1. replace all url patterns to patterns like `url(/@/xxx/xxx.xxx)`.
// 2. remove all the in-line comments(//) or replace them to block comments(/** */).
// 3. replace all rbg/rgba/hsa or any other css color functions to hex colors(#xxxxxx).
function themifyScript(
  str,
  options = {
    color: false,
    gradient: false,
    url: true,
  }
) {
  const keySet = new Set();
  let strcopy = str;
  let varstr = '';
  // process url, extract all css url and replace them to css var and record them.
  {
    keySet.clear();
    const regexp = /url\('?(\/[@|0-9|a-z|A-Z|\-|_]+)+.(png|svg)'?\)/g;
    let res = regexp.exec(str);
    while (res) {
      const [url, image] = res;
      const varname = `--image-${image.replace('/', '')}`;
      if (!keySet.has(image)) {
        keySet.add(image);
        varstr += `${varname}: ${url};`;
      }
      if (options.url) {
        strcopy = strcopy.replace(url, `var(${varname})`);
      }
      res = regexp.exec(str);
    }
  }
  // process gradient, extract all css gradient and replace them to css var and record them.
  {
    keySet.clear();
    let key = 0;
    const regexp = /linear-gradient\([0-9|a-z|A-Z|#|,|\s|%|.]+\)/g;
    let res = regexp.exec(str);
    while (res) {
      const [gradient] = res;
      const varname = `--gradient-${key}`;
      if (!keySet.has(gradient)) {
        keySet.add(gradient);
        varstr += `${varname}: ${gradient};`;
      }
      if (options.gradient) {
        strcopy = strcopy.replace(gradient, `var(${varname})`);
      }
      res = regexp.exec(str);
      key += 1;
    }
  }
  {
    keySet.clear();
    let key = 0;
    const regexp = /radial-gradient\([0-9|a-z|A-Z|#|,|\s|%|.]+\)/g;
    let res = regexp.exec(str);
    while (res) {
      const [gradient] = res;
      const varname = `--gradient-${key}`;
      if (!keySet.has(gradient)) {
        keySet.add(gradient);
        varstr += `${varname}: ${gradient};`;
      }
      if (options.gradient) {
        strcopy = strcopy.replace(gradient, `var(${varname})`);
      }
      res = regexp.exec(str);
      key += 1;
    }
  }
  // process color, extract all css colors and replace them to css var and record them.
  {
    keySet.clear();
    let key = 0;
    const regexp = /#[0-9|a-z|A-Z]{3,8}/g;
    let res = regexp.exec(str);
    while (res) {
      const [color] = res;
      const varname = `--color-${key}`;
      if (!keySet.has(color)) {
        keySet.add(color);
        varstr += `${varname}: ${color};`;
      }
      if (options.color) {
        strcopy = strcopy.replace(color, `var(${varname})`);
      }
      res = regexp.exec(str);
      key += 1;
    }
  }
  return [varstr, strcopy];
}