Skip to content

Commit

Permalink
fetch: Remove Theme Configuration wansenai#22
Browse files Browse the repository at this point in the history
  • Loading branch information
Jzow committed Dec 20, 2023
1 parent c1fa2ef commit 71b339f
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 138 deletions.
6 changes: 3 additions & 3 deletions flow-admin-ui/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

*.sh
node_modules
*.md
Expand All @@ -9,7 +8,8 @@ node_modules
dist
/public
/docs
.husky
.local
/bin
Dockerfile
/docker

/internal/**/dist
85 changes: 12 additions & 73 deletions flow-admin-ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,76 +1,15 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
jsxPragma: 'React',
ecmaFeatures: {
jsx: true,
},
},
extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
rules: {
'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'space-before-function-paren': 'off',

'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/multi-word-component-names': 'off',
},
};
parserOptions: {
ecmaVersion: 'latest'
}
}
130 changes: 102 additions & 28 deletions flow-admin-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,110 @@
node_modules
.DS_Store
dist
.npmrc
.cache
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

tests/server/static
tests/server/static/upload
# nyc test coverage
.nyc_output

.local
# local env files
.env.local
.env.*.local
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Editor directories and files
.idea
# .vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

package-lock.json
pnpm-lock.yaml
# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

.history
# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# vscode private configuration file
.vscode/redis.json

.idea

!**/form-making/dist/
.vscode
14 changes: 5 additions & 9 deletions flow-admin-ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/dist/*
.local
.output.js
/node_modules/**

**/*.svg
**/*.sh

/public/*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=lint-staged
public-hoist-pattern[]=*stylelint*
public-hoist-pattern[]=@commitlint/cli
12 changes: 7 additions & 5 deletions flow-admin-ui/src/logics/theme/dark.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { darkCssIsReady, loadDarkThemeCss } from 'vite-plugin-theme/es/client';
import { addClass, hasClass, removeClass } from '/@/utils/domUtils';
import { addClass, hasClass, removeClass } from '@/utils/domUtils';

export type CustomColorType = {
name: string;
light: string;
dark: string;
};

export async function updateDarkTheme(mode: string | null = 'light') {
const htmlRoot = document.getElementById('htmlRoot');
Expand All @@ -8,9 +13,6 @@ export async function updateDarkTheme(mode: string | null = 'light') {
}
const hasDarkClass = hasClass(htmlRoot, 'dark');
if (mode === 'dark') {
if (import.meta.env.PROD && !darkCssIsReady) {
await loadDarkThemeCss();
}
htmlRoot.setAttribute('data-theme', 'dark');
if (!hasDarkClass) {
addClass(htmlRoot, 'dark');
Expand Down
18 changes: 1 addition & 17 deletions flow-admin-ui/src/logics/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
import { getThemeColors, generateColors } from '../../../build/config/themeConfig';

import { replaceStyleVariables } from 'vite-plugin-theme/es/client';
import { mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme/es/colorUtils';

export async function changeTheme(color: string) {
const colors = generateColors({
mixDarken,
mixLighten,
tinycolor,
color,
});

return await replaceStyleVariables({
colorVariables: [...getThemeColors(color), ...colors],
});
}
export async function changeTheme(_color: string) {}
2 changes: 1 addition & 1 deletion flow-admin-ui/src/utils/http/axios/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
// 接口拼接地址
urlPrefix: urlPrefix,
// 是否加入时间戳
joinTime: true,
joinTime: false,
// 忽略重复请求
ignoreCancelToken: true,
// 是否携带token
Expand Down
2 changes: 1 addition & 1 deletion flow-admin-ui/src/views/base/app/app.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
import {Icon} from "/@/components/Icon";
import Icon from "/@/components/Icon/Icon.vue";
export const columns: BasicColumn[] = [
{
title: '图标',
Expand Down
2 changes: 1 addition & 1 deletion flow-admin-ui/src/views/privilege/group/group.data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {BasicColumn, FormSchema} from '/@/components/Table';
import {Icon} from "/@/components/Icon";
import Icon from "/@/components/Icon/Icon.vue";
import {Tag, Checkbox} from "ant-design-vue";
import {h} from "vue";

Expand Down

0 comments on commit 71b339f

Please sign in to comment.