diff --git a/server/core/server.go b/server/core/server.go index f1d644292..18e43ddc1 100644 --- a/server/core/server.go +++ b/server/core/server.go @@ -2,7 +2,6 @@ package core import ( "fmt" - "github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/initialize" "github.com/flipped-aurora/gin-vue-admin/server/service/system" diff --git a/server/go.sum b/server/go.sum index f6bada71e..ec6a18e60 100644 --- a/server/go.sum +++ b/server/go.sum @@ -42,6 +42,7 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.1.0/go.mod h1:wP83 github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= diff --git a/server/resource/package/server/model/model.go.tpl b/server/resource/package/server/model/model.go.tpl index f1f979c59..28cacaed1 100644 --- a/server/resource/package/server/model/model.go.tpl +++ b/server/resource/package/server/model/model.go.tpl @@ -29,7 +29,7 @@ package {{.Package}} {{- if not .OnlyTemplate}} import ( {{- if .GvaModel }} - "{{.Module}}/global" + "github.com/flipped-aurora/gin-vue-admin/server/global" {{- end }} {{- if or .HasTimer }} "time" @@ -82,5 +82,4 @@ func ({{.StructName}}) TableName() string { } {{ end }} - -{{ end }} \ No newline at end of file +{{ end }} diff --git a/server/resource/package/server/service/service.go.tpl b/server/resource/package/server/service/service.go.tpl index 29c5864cb..ff42b4ee3 100644 --- a/server/resource/package/server/service/service.go.tpl +++ b/server/resource/package/server/service/service.go.tpl @@ -23,7 +23,7 @@ if info.Start{{.FieldName}} != nil && info.End{{.FieldName}} != nil { db = db.Where("{{.ColumnName}} {{.FieldSearchType}} ? AND ? ",info.Start{{.FieldName}},info.End{{.FieldName}}) } {{- else}} -if info.{{.FieldName}} != nil { +if info.{{.FieldName}} != nil{{- if eq .FieldType "string" }} && *info.{{.FieldName}} != ""{{- end }} { db = db.Where("{{.ColumnName}} {{.FieldSearchType}} ?",{{if eq .FieldSearchType "LIKE"}}"%"+{{ end }}*info.{{.FieldName}}{{if eq .FieldSearchType "LIKE"}}+"%"{{ end }}) } {{- end }} @@ -158,7 +158,7 @@ func ({{.Abbreviation}}Service *{{.StructName}}Service)Get{{.StructName}}InfoLis db = db.Where("{{.ColumnName}} {{.FieldSearchType}} ? AND ? ",info.Start{{.FieldName}},info.End{{.FieldName}}) } {{- else}} - if info.{{.FieldName}} != nil { + if info.{{.FieldName}} != nil{{- if eq .FieldType "string" }} && *info.{{.FieldName}} != ""{{- end }} { db = db.Where("{{.ColumnName}} {{.FieldSearchType}} ?",{{if eq .FieldSearchType "LIKE"}}"%"+{{ end }}*info.{{.FieldName}}{{if eq .FieldSearchType "LIKE"}}+"%"{{ end }}) } {{- end }} diff --git a/server/resource/package/web/view/form.vue.tpl b/server/resource/package/web/view/form.vue.tpl index af023eee9..1f2f9c1c8 100644 --- a/server/resource/package/web/view/form.vue.tpl +++ b/server/resource/package/web/view/form.vue.tpl @@ -1,72 +1,63 @@ +{{- $top := . -}} {{- if .IsAdd }} // 新增表单中增加如下代码 {{- range .Fields}} {{- if .Form}} - - {{- if .CheckDataSource}} - - - - {{- else }} - {{- if eq .FieldType "bool" }} - - {{- end }} - {{- if eq .FieldType "string" }} - {{- if .DictType}} - - - - {{- else }} - - {{- end }} - {{- end }} - {{- if eq .FieldType "richtext" }} - - {{- end }} - {{- if eq .FieldType "json" }} - // 此字段为json结构,可以前端自行控制展示和数据绑定模式 需绑定json的key为 formData.{{.FieldJson}} 后端会按照json的类型进行存取 - {{"{{"}} formData.{{.FieldJson}} {{"}}"}} - {{- end }} - {{- if eq .FieldType "array" }} - - {{- end }} - {{- if eq .FieldType "int" }} - - {{- end }} - {{- if eq .FieldType "time.Time" }} - - {{- end }} - {{- if eq .FieldType "float64" }} - - {{- end }} - {{- if eq .FieldType "enum" }} - - - - {{- end }} - {{- if eq .FieldType "picture" }} - - {{- end }} - {{- if eq .FieldType "pictures" }} - - {{- end }} - {{- if eq .FieldType "video" }} - - {{- end }} - {{- if eq .FieldType "file" }} - - {{- end }} - {{- end }} + + {{- if .CheckDataSource}} + + + + {{- else }} + {{- if eq .FieldType "bool" }} + + {{- end }} + {{- if eq .FieldType "string" }} + {{- if .DictType}} + + + + {{- else }} + + {{- end }} + {{- end }} + {{- if eq .FieldType "richtext" }} + + {{- end }} + {{- if eq .FieldType "int" }} + + {{- end }} + {{- if eq .FieldType "time.Time" }} + + {{- end }} + {{- if eq .FieldType "float64" }} + + {{- end }} + {{- if eq .FieldType "enum" }} + + + + {{- end }} + {{- if eq .FieldType "picture" }} + + {{- end }} + {{- if eq .FieldType "video" }} + + {{- end }} + {{- if eq .FieldType "pictures" }} + + {{- end }} + {{- if eq .FieldType "file" }} + + {{- end }} + {{- if eq .FieldType "json" }} + // 此字段为json结构,可以前端自行控制展示和数据绑定模式 需绑定json的key为 formData.{{.FieldJson}} 后端会按照json的类型进行存取 + {{"{{"}} formData.{{.FieldJson}} {{"}}"}} + {{- end }} + {{- if eq .FieldType "array" }} + + {{- end }} + {{- end }} {{- end }} {{- end }} @@ -125,22 +116,22 @@ const {{ $element }}Options = ref([]) {{- end }} // 验证规则中增加如下字段 -{{- range .Fields }} + {{- range .Fields }} {{- if .Form }} {{- if eq .Require true }} -{{.FieldJson }} : [{ - required: true, - message: '{{ .ErrorText }}', - trigger: ['input','blur'], -}, + {{.FieldJson }} : [{ + required: true, + message: '{{ .ErrorText }}', + trigger: ['input','blur'], + }, {{- if eq .FieldType "string" }} -{ - whitespace: true, - message: '不能只输入空格', - trigger: ['input', 'blur'], -} + { + whitespace: true, + message: t('general.noOnlySpace'), + trigger: ['input', 'blur'], + } {{- end }} -], + ], {{- end }} {{- end }} {{- end }} @@ -160,6 +151,10 @@ const getDataSourceFunc = async()=>{ getDataSourceFunc() {{- end }} {{- else }} +<<<<<<< HEAD +======= + +>>>>>>> 51490a7e2c2d02f1a32e81180eb7a48ada0956a2 {{- if not .OnlyTemplate }} -
+
+
+ {{ option.label }} +
{{ option.label }}
-
@@ -33,169 +29,177 @@ diff --git a/web/src/components/customPic/index.vue b/web/src/components/customPic/index.vue index 63743d535..6a265dee4 100644 --- a/web/src/components/customPic/index.vue +++ b/web/src/components/customPic/index.vue @@ -1,28 +1,12 @@ - + diff --git a/web/src/components/selectFile/selectFile.vue b/web/src/components/selectFile/selectFile.vue index 06872980d..3354d3b2f 100644 --- a/web/src/components/selectFile/selectFile.vue +++ b/web/src/components/selectFile/selectFile.vue @@ -20,71 +20,67 @@ - diff --git a/web/src/components/selectImage/selectComponent.vue b/web/src/components/selectImage/selectComponent.vue index 59ad1c8d6..c6b613469 100644 --- a/web/src/components/selectImage/selectComponent.vue +++ b/web/src/components/selectImage/selectComponent.vue @@ -15,10 +15,15 @@ muted preload="metadata" > - + - + - diff --git a/web/src/components/upload/image.vue b/web/src/components/upload/image.vue index a7a226fea..d2791d69b 100644 --- a/web/src/components/upload/image.vue +++ b/web/src/components/upload/image.vue @@ -1,4 +1,3 @@ - diff --git a/web/src/components/warningBar/warningBar.vue b/web/src/components/warningBar/warningBar.vue index 4fac6c0b9..9d018812f 100644 --- a/web/src/components/warningBar/warningBar.vue +++ b/web/src/components/warningBar/warningBar.vue @@ -1,7 +1,7 @@ diff --git a/web/src/core/config.js b/web/src/core/config.js index 582ac01f2..847b68dc9 100644 --- a/web/src/core/config.js +++ b/web/src/core/config.js @@ -1,30 +1,52 @@ /** * 网站配置文件 */ -const greenText = (text) => `\x1b[32m${text}\x1b[0m`; +const greenText = (text) => `\x1b[32m${text}\x1b[0m` const config = { appName: 'Gin-Vue-Admin', appLogo: 'logo.png', showViteLogo: true, - logs: [], + logs: [] } export const viteLogo = (env) => { if (config.showViteLogo) { - console.log(greenText(`> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin`)); - console.log(greenText(`> 当前版本:v2.7.7`)); - console.log(greenText(`> 加群方式:微信:shouzi_1994 QQ群:470239250`)); - console.log(greenText(`> 项目地址:https://github.com/flipped-aurora/gin-vue-admin`)); - console.log(greenText(`> 插件市场:https://plugin.gin-vue-admin.com`)); - console.log(greenText(`> GVA讨论社区:https://support.qq.com/products/371961`)); - console.log(greenText(`> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`)); - console.log(greenText(`> 默认前端文件运行地址:http://127.0.0.1:${env.VITE_CLI_PORT}`)); - console.log(greenText(`--------------------------------------版权声明--------------------------------------`)); - console.log(greenText(`** 版权所有方:flipped-aurora开源团队 **`)); - console.log(greenText(`** 版权持有公司:北京翻转极光科技有限责任公司 **`)); - console.log(greenText(`** 剔除授权标识需购买商用授权:https://gin-vue-admin.com/empower/index.html **`)); - console.log('\n'); + console.log( + greenText( + `> 欢迎使用Gin-Vue-Admin,开源地址:https://github.com/flipped-aurora/gin-vue-admin` + ) + ) + console.log(greenText(`> 当前版本:v2.7.7`)) + console.log(greenText(`> 加群方式:微信:shouzi_1994 QQ群:470239250`)) + console.log( + greenText(`> 项目地址:https://github.com/flipped-aurora/gin-vue-admin`) + ) + console.log(greenText(`> 插件市场:https://plugin.gin-vue-admin.com`)) + console.log( + greenText(`> GVA讨论社区:https://support.qq.com/products/371961`) + ) + console.log( + greenText( + `> 默认自动化文档地址:http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html` + ) + ) + console.log( + greenText(`> 默认前端文件运行地址:http://127.0.0.1:${env.VITE_CLI_PORT}`) + ) + console.log( + greenText( + `--------------------------------------版权声明--------------------------------------` + ) + ) + console.log(greenText(`** 版权所有方:flipped-aurora开源团队 **`)) + console.log(greenText(`** 版权持有公司:北京翻转极光科技有限责任公司 **`)) + console.log( + greenText( + `** 剔除授权标识需购买商用授权:https://gin-vue-admin.com/empower/index.html **` + ) + ) + console.log('\n') } } diff --git a/web/src/core/global.js b/web/src/core/global.js index 2ef1ffef4..b402b7053 100644 --- a/web/src/core/global.js +++ b/web/src/core/global.js @@ -10,21 +10,26 @@ const createIconComponent = (name) => ({ name: 'SvgIcon', render() { return h(svgIcon, { - name: name, + name: name }) - }, + } }) -const registerIcons = async(app) => { +const registerIcons = async (app) => { const iconModules = import.meta.glob('@/assets/icons/**/*.svg') // 系统目录 svg 图标 - const pluginIconModules = import.meta.glob('@/plugin/**/assets/icons/**/*.svg') // 插件目录 svg 图标 - const mergedIconModules = Object.assign({}, iconModules, pluginIconModules); // 合并所有 svg 图标 + const pluginIconModules = import.meta.glob( + '@/plugin/**/assets/icons/**/*.svg' + ) // 插件目录 svg 图标 + const mergedIconModules = Object.assign({}, iconModules, pluginIconModules) // 合并所有 svg 图标 for (const path in mergedIconModules) { - let pluginName = "" - if (path.startsWith("/src/plugin/")) { + let pluginName = '' + if (path.startsWith('/src/plugin/')) { pluginName = `${path.split('/')[3]}-` } - const iconName = path.split('/').pop().replace(/\.svg$/, '') + const iconName = path + .split('/') + .pop() + .replace(/\.svg$/, '') // 如果iconName带空格则不加入到图标库中并且提示名称不合法 if (iconName.indexOf(' ') !== -1) { console.error(`icon ${iconName}.svg includes whitespace in ${path}`) @@ -32,11 +37,12 @@ const registerIcons = async(app) => { } const key = `${pluginName}${iconName}` // 开发模式下列出所有 svg 图标,方便开发者直接查找复制使用 - import.meta.env.MODE == 'development' && console.log(`svg-icon-component: <${key} />`) + import.meta.env.MODE == 'development' && + console.log(`svg-icon-component: <${key} />`) const iconComponent = createIconComponent(key) config.logs.push({ - 'key': key, - 'label': key, + key: key, + label: key }) app.component(key, iconComponent) } diff --git a/web/src/directive/auth.js b/web/src/directive/auth.js index 50594d45f..d2b9b6a8f 100644 --- a/web/src/directive/auth.js +++ b/web/src/directive/auth.js @@ -5,7 +5,7 @@ export default { const userStore = useUserStore() app.directive('auth', { // 当被绑定的元素插入到 DOM 中时…… - mounted: function(el, binding) { + mounted: function (el, binding) { const userInfo = userStore.userInfo let type = '' switch (Object.prototype.toString.call(binding.value)) { @@ -27,7 +27,7 @@ export default { return } const waitUse = binding.value.toString().split(',') - let flag = waitUse.some(item => Number(item) === userInfo.authorityId) + let flag = waitUse.some((item) => Number(item) === userInfo.authorityId) if (binding.modifiers.not) { flag = !flag } @@ -38,4 +38,3 @@ export default { }) } } - diff --git a/web/src/hooks/charts.js b/web/src/hooks/charts.js index e7a14b1b0..9f03b0e6a 100644 --- a/web/src/hooks/charts.js +++ b/web/src/hooks/charts.js @@ -1,19 +1,18 @@ // 本组件参考 arco-pro 的实现 // https://github.com/arco-design/arco-design-pro-vue/blob/main/arco-design-pro-vite/src/hooks/chart-option.ts -import { computed } from 'vue'; -import { useAppStore } from '@/pinia'; - +import { computed } from 'vue' +import { useAppStore } from '@/pinia' export default function useChartOption(sourceOption) { - const appStore = useAppStore(); + const appStore = useAppStore() const isDark = computed(() => { - return appStore.theme === 'dark'; - }); + return appStore.theme === 'dark' + }) const chartOption = computed(() => { - return sourceOption(isDark.value); - }); + return sourceOption(isDark.value) + }) return { - chartOption, - }; + chartOption + } } diff --git a/web/src/hooks/responsive.js b/web/src/hooks/responsive.js index 417c1f999..e324c1688 100644 --- a/web/src/hooks/responsive.js +++ b/web/src/hooks/responsive.js @@ -1,35 +1,35 @@ // 本组件参考 arco-pro 的实现 // https://github.com/arco-design/arco-design-pro-vue/blob/main/arco-design-pro-vite/src/hooks/responsive.ts -import { onMounted, onBeforeMount, onBeforeUnmount } from 'vue'; -import { useDebounceFn } from '@vueuse/core'; -import { useAppStore } from '@/pinia'; -import { addEventListen, removeEventListen } from '@/utils/event'; +import { onMounted, onBeforeMount, onBeforeUnmount } from 'vue' +import { useDebounceFn } from '@vueuse/core' +import { useAppStore } from '@/pinia' +import { addEventListen, removeEventListen } from '@/utils/event' -const WIDTH = 992; +const WIDTH = 992 function queryDevice() { - const rect = document.body.getBoundingClientRect(); - return rect.width - 1 < WIDTH; + const rect = document.body.getBoundingClientRect() + return rect.width - 1 < WIDTH } export default function useResponsive(immediate) { - const appStore = useAppStore(); - function resizeHandler() { - if (!document.hidden) { - const isMobile = queryDevice(); - appStore.toggleDevice(isMobile ? 'mobile' : 'desktop'); - // appStore.toggleDevice(isMobile); - } + const appStore = useAppStore() + function resizeHandler() { + if (!document.hidden) { + const isMobile = queryDevice() + appStore.toggleDevice(isMobile ? 'mobile' : 'desktop') + // appStore.toggleDevice(isMobile); } - const debounceFn = useDebounceFn(resizeHandler, 100); - onMounted(() => { - if (immediate) debounceFn(); - }); - onBeforeMount(() => { - addEventListen(window, 'resize', debounceFn); - }); - onBeforeUnmount(() => { - removeEventListen(window, 'resize', debounceFn); - }); + } + const debounceFn = useDebounceFn(resizeHandler, 100) + onMounted(() => { + if (immediate) debounceFn() + }) + onBeforeMount(() => { + addEventListen(window, 'resize', debounceFn) + }) + onBeforeUnmount(() => { + removeEventListen(window, 'resize', debounceFn) + }) } diff --git a/web/src/hooks/use-windows-resize.js b/web/src/hooks/use-windows-resize.js index 4ddf3f0fb..a3e1490ef 100644 --- a/web/src/hooks/use-windows-resize.js +++ b/web/src/hooks/use-windows-resize.js @@ -18,6 +18,6 @@ export const useWindowResize = (cb) => { useEventListener('resize', onResize, { passive: true }) return { width, - height, + height } } diff --git a/web/src/i18n.js b/web/src/i18n.js index 83b39460c..e6d4d34ed 100644 --- a/web/src/i18n.js +++ b/web/src/i18n.js @@ -7,16 +7,16 @@ import Cookies from 'js-cookie' const messages = { en: { - ...enLocale, + ...enLocale }, zh: { - ...zhLocale, + ...zhLocale }, 'zh-TW': { - ...zhtwLocale, + ...zhtwLocale }, ar: { - ...arLocale, + ...arLocale } } diff --git a/web/src/locales/ar.json b/web/src/locales/ar.json index 68e0db3d6..e23ee5b71 100644 --- a/web/src/locales/ar.json +++ b/web/src/locales/ar.json @@ -264,16 +264,16 @@ "generateInitialAPI": "إنشاء API الأولي", "checkMsg": "يرجى التحقق مما إذا كان قد تم فتح initialize.Api(ctx) و initialize.Menu(ctx) في server/plugin/{plugName}/plugin.go؟", "announcement": { - "info": { - "title": "عنوان", - "content": "المحتوى", - "richTextContent": "[محتوى النص الغني]", - "author": "مؤلف", - "attachments": "الملحقات", - "enterTitleNote": "الرجاء إدخال عنوان", - "selectAuthorNote": "الرجاء اختيار المؤلف" - } - }, + "info": { + "title": "عنوان", + "content": "المحتوى", + "richTextContent": "[محتوى النص الغني]", + "author": "مؤلف", + "attachments": "الملحقات", + "enterTitleNote": "الرجاء إدخال عنوان", + "selectAuthorNote": "الرجاء اختيار المؤلف" + } + }, "email": { "emailConfigNote": "يجب تكوين ملف إعدادات البريد الإلكتروني مسبقًا، لمنع البريد العشوائي غير الضروري، لا يتم فتح هذه الميزة في تجربة الإنترنت.", "targetEmail": "البريد الإلكتروني المستهدف", @@ -453,7 +453,7 @@ } }, "superAdmin": { - "authority" : { + "authority": { "components": { "apis": { "filterName": "تصفية بلإسم", diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 438f0d4c8..c5933eda8 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -266,16 +266,16 @@ "generateInitialAPI": "Generate Initial API", "checkMsg": "Please check if initialize.Api(ctx) and initialize.Menu(ctx) are opened in `server/plugin/{plugName}/plugin.go`?", "announcement": { - "info": { - "title": "Title", - "content": "Content", - "richTextContent": "[Rich text content]", - "author": "Author", - "attachments": "Attachments", - "enterTitleNote": "Please enter a title", - "selectAuthorNote": "Please select author" - } - }, + "info": { + "title": "Title", + "content": "Content", + "richTextContent": "[Rich text content]", + "author": "Author", + "attachments": "Attachments", + "enterTitleNote": "Please enter a title", + "selectAuthorNote": "Please select author" + } + }, "email": { "emailConfigNote": "You need to configure the email configuration file in advance. To prevent unnecessary spam, this feature is not open for online experience.", "targetEmail": "Target Email", @@ -455,7 +455,7 @@ } }, "superAdmin": { - "authority" : { + "authority": { "components": { "apis": { "filterName": "Filter Name", @@ -878,6 +878,7 @@ "generateCode": "Generate Code", "viewCode": "View Code", "previewCode": "Preview Code", + "generate": "Generate", "moveDown": "Move Down", "moveUp": "Move Up", "selectDB": "Please select a database", diff --git a/web/src/locales/lang.js b/web/src/locales/lang.js deleted file mode 100644 index f13f98d03..000000000 --- a/web/src/locales/lang.js +++ /dev/null @@ -1,11 +0,0 @@ -const i18n = { - en:{ - "sysLoading": "System is loading, please wait..." - }, - zh:{ - "sysLoading": "系统正在加载,请稍候..." - }, - ar:{ - "sysLoading": "جارٍ تحميل النظام، يرجى الانتظار" - } -} diff --git a/web/src/locales/zh-TW.json b/web/src/locales/zh-TW.json index dbd78f3af..9a9d6dd39 100644 --- a/web/src/locales/zh-TW.json +++ b/web/src/locales/zh-TW.json @@ -709,9 +709,10 @@ "fieldLen": "数据库字段长度", "fileName": "文件名称", "fileNameNote": "生成文件的默认名称(建议为驼峰格式,首字母小写,如sysXxxXxxx)", - "generateCode": "生成代码", + "generateCode": "生成代碼", "viewCode": "查看代码", "previewCode": "预览代码", + "generate": "生成", "moveDown": "下移", "moveUp": "上移", "selectDB": "请选择数据库", diff --git a/web/src/locales/zh.json b/web/src/locales/zh.json index d2ced95fd..86e33e95f 100644 --- a/web/src/locales/zh.json +++ b/web/src/locales/zh.json @@ -262,32 +262,32 @@ } }, "plugins": { - "checkMessage": "请检查server下的/plugin/{plugName}/plugin.go是否已放开需要的 initialize.Api(ctx) 和 initialize.Menu(ctx)?", - "overwriteMessage": "点击后将会覆盖server下的/plugin/{plugName}/initialize/menu. 是否继续?", - "overwriteWarning": "点击后将会覆盖server下的/plugin/{plugName}/initialize/api. 是否继续?", - "generateInitialAPI": "生成初始API", - "checkMsg": "请检查server下的/plugin/{plugName}/plugin.go是否已放开需要的 initialize.Api(ctx) 和 initialize.Menu(ctx)?", - "announcement": { - "info": { - "title": "标题", - "content": "内容", - "richTextContent": "[富文本内容]", - "author": "作者", - "attachments": "附件", - "enterTitleNote": "请输入标题", - "selectAuthorNote": "请选择作者" - } - }, - "email": { - "emailConfigNote": "需要提前配置email配置文件,为防止不必要的垃圾邮件,在线体验功能不开放此功能体验。", - "targetEmail": "目标邮箱", - "email": "邮件", - "emailContent": "邮件内容", - "sendTestEmail": "发送测试邮件", - "sendEmail": "发送邮件", - "sendSuccess": "发送成功", - "sentSuccessPleaseCheck": "发送成功,请查收" + "checkMessage": "请检查server下的/plugin/{plugName}/plugin.go是否已放开需要的 initialize.Api(ctx) 和 initialize.Menu(ctx)?", + "overwriteMessage": "点击后将会覆盖server下的/plugin/{plugName}/initialize/menu. 是否继续?", + "overwriteWarning": "点击后将会覆盖server下的/plugin/{plugName}/initialize/api. 是否继续?", + "generateInitialAPI": "生成初始API", + "checkMsg": "请检查server下的/plugin/{plugName}/plugin.go是否已放开需要的 initialize.Api(ctx) 和 initialize.Menu(ctx)?", + "announcement": { + "info": { + "title": "标题", + "content": "内容", + "richTextContent": "[富文本内容]", + "author": "作者", + "attachments": "附件", + "enterTitleNote": "请输入标题", + "selectAuthorNote": "请选择作者" } + }, + "email": { + "emailConfigNote": "需要提前配置email配置文件,为防止不必要的垃圾邮件,在线体验功能不开放此功能体验。", + "targetEmail": "目标邮箱", + "email": "邮件", + "emailContent": "邮件内容", + "sendTestEmail": "发送测试邮件", + "sendEmail": "发送邮件", + "sendSuccess": "发送成功", + "sentSuccessPleaseCheck": "发送成功,请查收" + } }, "utils": { "request": { @@ -457,7 +457,7 @@ } }, "superAdmin": { - "authority" : { + "authority": { "components": { "apis": { "filterName": "筛选名字", @@ -862,6 +862,7 @@ "generateCode": "生成代码", "viewCode": "查看代码", "previewCode": "预览代码", + "generate": "生成", "moveDown": "下移", "moveUp": "上移", "selectDB": "请选择数据库", @@ -977,17 +978,17 @@ "display": "展示: ", "enumValueValidationError": "枚举值校验错误", "oneToManyNote": "一对多关联模式下,数据类型会改变为数组,后端表现为json,具体表现为数组模式,是否继续?", - "string": "字符串", + "string": "字符串", "richText": "富文本", - "integer": "整数", + "integer": "整数", "boolean": "布尔", - "float": "浮点数", + "float": "浮点数", "time": "时间", - "enum": "枚举", + "enum": "枚举", "singleImage": "单图", - "multipleImages": "多图", + "multipleImages": "多图", "video": "视频", - "file": "文件", + "file": "文件", "array": "数组" } }, diff --git a/web/src/main.js b/web/src/main.js index d6a9e2368..fae81c88b 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -21,11 +21,11 @@ const app = createApp(App) app.config.productionTip = false app - .use(run) - .use(ElementPlus) - .use(store) - .use(auth) - .use(router) - .use(i18n) - .mount('#app') + .use(run) + .use(ElementPlus) + .use(store) + .use(auth) + .use(router) + .use(i18n) + .mount('#app') export default app diff --git a/web/src/permission.js b/web/src/permission.js index b0c39af51..70c21bee8 100644 --- a/web/src/permission.js +++ b/web/src/permission.js @@ -8,26 +8,25 @@ Nprogress.configure({ showSpinner: false, ease: 'ease', speed: 500 }) const whiteList = ['Login', 'Init'] -const getRouter = async(userStore) => { +const getRouter = async (userStore) => { const routerStore = useRouterStore() await routerStore.SetAsyncRouter() await userStore.GetUserInfo() const asyncRouters = routerStore.asyncRouters - asyncRouters.forEach(asyncRouter => { + asyncRouters.forEach((asyncRouter) => { router.addRoute(asyncRouter) }) } const removeLoading = () => { - const element = document.getElementById('gva-loading-box'); + const element = document.getElementById('gva-loading-box') if (element) { - element.remove(); + element.remove() } } - async function handleKeepAlive(to) { - if (to.matched.some(item => item.meta.keepAlive)) { + if (to.matched.some((item) => item.meta.keepAlive)) { if (to.matched && to.matched.length > 2) { for (let i = 1; i < to.matched.length; i++) { const element = to.matched[i - 1] @@ -45,7 +44,7 @@ async function handleKeepAlive(to) { } } -router.beforeEach(async(to, from) => { +router.beforeEach(async (to, from) => { const routerStore = useRouterStore() Nprogress.start() const userStore = useUserStore() @@ -54,7 +53,7 @@ router.beforeEach(async(to, from) => { const token = userStore.token // 在白名单中的判断情况 document.title = getPageTitle(to.meta.title, to) - if(to.meta.client) { + if (to.meta.client) { return true } if (whiteList.indexOf(to.name) > -1) { @@ -85,9 +84,9 @@ router.beforeEach(async(to, from) => { } else { // 不在白名单中并且已经登录的时候 if (token) { - if(sessionStorage.getItem("needToHome") === 'true') { - sessionStorage.removeItem("needToHome") - return { path: '/'} + if (sessionStorage.getItem('needToHome') === 'true') { + sessionStorage.removeItem('needToHome') + return { path: '/' } } // 添加flag防止多次获取动态路由和栈溢出 if (!routerStore.asyncRouterFlag && whiteList.indexOf(from.name) < 0) { @@ -124,7 +123,6 @@ router.beforeEach(async(to, from) => { } }) - router.afterEach(() => { // 路由加载完成后关闭进度条 document.getElementsByClassName('main-cont main-right')[0]?.scrollTo(0, 0) diff --git a/web/src/pinia/index.js b/web/src/pinia/index.js index 49c389e99..85e45e84e 100644 --- a/web/src/pinia/index.js +++ b/web/src/pinia/index.js @@ -5,9 +5,4 @@ import { useDictionaryStore } from '@/pinia/modules/dictionary' const store = createPinia() -export { - store, - useAppStore, - useUserStore, - useDictionaryStore -} +export { store, useAppStore, useUserStore, useDictionaryStore } diff --git a/web/src/pinia/modules/app.js b/web/src/pinia/modules/app.js index 91e222e72..2a37f4d4d 100644 --- a/web/src/pinia/modules/app.js +++ b/web/src/pinia/modules/app.js @@ -1,58 +1,56 @@ - import { defineStore } from 'pinia' import { ref, watchEffect, reactive } from 'vue' -import { setBodyPrimaryColor } from '@/utils/format' +import { setBodyPrimaryColor } from '@/utils/format' export const useAppStore = defineStore('app', () => { - - const device = ref("") + const device = ref('') const config = reactive({ weakness: false, grey: false, primaryColor: '#3b82f6', showTabs: true, darkMode: 'auto', - layout_side_width : 256, - layout_side_collapsed_width : 80, - layout_side_item_height : 48, + layout_side_width: 256, + layout_side_collapsed_width: 80, + layout_side_item_height: 48, show_watermark: true, - side_mode : 'normal' + side_mode: 'normal' }) - const theme = ref( 'auto') + const theme = ref('auto') const toggleTheme = (dark) => { if (dark) { - theme.value = 'dark'; + theme.value = 'dark' } else { - theme.value = 'light'; + theme.value = 'light' } } const toggleWeakness = (e) => { - config.weakness = e; + config.weakness = e } const toggleGrey = (e) => { - config.grey = e; + config.grey = e } const togglePrimaryColor = (e) => { - config.primaryColor = e; + config.primaryColor = e } const toggleTabs = (e) => { - config.showTabs = e; + config.showTabs = e } const toggleDevice = (e) => { - device.value = e; + device.value = e } const toggleDarkMode = (e) => { config.darkMode = e } - const toggleDarkModeAuto = () =>{ + const toggleDarkModeAuto = () => { // 处理浏览器主题 const darkQuery = window.matchMedia('(prefers-color-scheme: dark)') const dark = darkQuery.matches @@ -63,61 +61,59 @@ export const useAppStore = defineStore('app', () => { } const toggleConfigSideWidth = (e) => { - config.layout_side_width = e; + config.layout_side_width = e } const toggleConfigSideCollapsedWidth = (e) => { - config.layout_side_collapsed_width = e; + config.layout_side_collapsed_width = e } const toggleConfigSideItemHeight = (e) => { - config.layout_side_item_height = e; + config.layout_side_item_height = e } const toggleConfigWatermark = (e) => { - config.show_watermark = e; + config.show_watermark = e } - const toggleSideModel= (e) =>{ + const toggleSideModel = (e) => { config.side_mode = e } watchEffect(() => { if (theme.value === 'dark') { - document.documentElement.classList.add('dark'); - document.documentElement.classList.remove('light'); + document.documentElement.classList.add('dark') + document.documentElement.classList.remove('light') } else { - document.documentElement.classList.add('light'); - document.documentElement.classList.remove('dark'); + document.documentElement.classList.add('light') + document.documentElement.classList.remove('dark') } }) watchEffect(() => { // 色弱模式监听处理 if (config.weakness) { - document.documentElement.classList.add('html-weakenss'); + document.documentElement.classList.add('html-weakenss') } else { - document.documentElement.classList.remove('html-weakenss'); + document.documentElement.classList.remove('html-weakenss') } }) watchEffect(() => { // 灰色模式监听处理 if (config.grey) { - document.documentElement.classList.add('html-grey'); + document.documentElement.classList.add('html-grey') } else { - document.documentElement.classList.remove('html-grey'); + document.documentElement.classList.remove('html-grey') } }) - - watchEffect(() => { - if(config.darkMode === 'auto'){ + if (config.darkMode === 'auto') { toggleDarkModeAuto() } - if(config.darkMode === 'dark'){ + if (config.darkMode === 'dark') { toggleTheme(true) - }else{ + } else { toggleTheme(false) } }) @@ -143,5 +139,4 @@ export const useAppStore = defineStore('app', () => { toggleConfigWatermark, toggleSideModel } - }) diff --git a/web/src/pinia/modules/dictionary.js b/web/src/pinia/modules/dictionary.js index cd88f8c72..57a284497 100644 --- a/web/src/pinia/modules/dictionary.js +++ b/web/src/pinia/modules/dictionary.js @@ -10,7 +10,7 @@ export const useDictionaryStore = defineStore('dictionary', () => { dictionaryMap.value = { ...dictionaryMap.value, ...dictionaryRes } } - const getDictionary = async(type) => { + const getDictionary = async (type) => { if (dictionaryMap.value[type] && dictionaryMap.value[type].length) { return dictionaryMap.value[type] } else { @@ -18,13 +18,14 @@ export const useDictionaryStore = defineStore('dictionary', () => { if (res.code === 0) { const dictionaryRes = {} const dict = [] - res.data.resysDictionary.sysDictionaryDetails && res.data.resysDictionary.sysDictionaryDetails.forEach(item => { - dict.push({ - label: item.label, - value: item.value, - extend: item.extend + res.data.resysDictionary.sysDictionaryDetails && + res.data.resysDictionary.sysDictionaryDetails.forEach((item) => { + dict.push({ + label: item.label, + value: item.value, + extend: item.extend + }) }) - }) dictionaryRes[res.data.resysDictionary.type] = dict setDictionaryMap(dictionaryRes) return dictionaryMap.value[type] diff --git a/web/src/pinia/modules/router.js b/web/src/pinia/modules/router.js index 8837e981e..e22cdf52d 100644 --- a/web/src/pinia/modules/router.js +++ b/web/src/pinia/modules/router.js @@ -2,44 +2,49 @@ import { asyncRouterHandle } from '@/utils/asyncRouter' import { emitter } from '@/utils/bus.js' import { asyncMenu } from '@/api/menu' import { defineStore } from 'pinia' -import { ref,watchEffect } from 'vue' +import { ref, watchEffect } from 'vue' import i18n from '@/i18n' // added by mohamed hassan to multilangauge -import pathInfo from "@/pathInfo.json"; +import pathInfo from '@/pathInfo.json' const notLayoutRouterArr = [] const keepAliveRoutersArr = [] const nameMap = {} const formatRouter = (routes, routeMap, parent) => { - routes && routes.forEach(item => { - item.parent = parent - item.meta.btns = item.btns - item.meta.hidden = item.hidden - if (item.meta.defaultMenu === true) { - if (!parent) { - item = { ...item, path: `/${item.path}` } - notLayoutRouterArr.push(item) + routes && + routes.forEach((item) => { + item.parent = parent + item.meta.btns = item.btns + item.meta.hidden = item.hidden + if (item.meta.defaultMenu === true) { + if (!parent) { + item = { ...item, path: `/${item.path}` } + notLayoutRouterArr.push(item) + } } - } - routeMap[item.name] = item - if (item.children && item.children.length > 0) { - formatRouter(item.children, routeMap, item) - } - }) + routeMap[item.name] = item + if (item.children && item.children.length > 0) { + formatRouter(item.children, routeMap, item) + } + }) } const KeepAliveFilter = (routes) => { - routes && routes.forEach(item => { - // 子菜单中有 keep-alive 的,父菜单也必须 keep-alive,否则无效。这里将子菜单中有 keep-alive 的父菜单也加入。 - if ((item.children && item.children.some(ch => ch.meta.keepAlive) || item.meta.keepAlive)) { - const path = item.meta.path - keepAliveRoutersArr.push(pathInfo[path]) - nameMap[item.name] = pathInfo[path] - } - if (item.children && item.children.length > 0) { - KeepAliveFilter(item.children) - } - }) + routes && + routes.forEach((item) => { + // 子菜单中有 keep-alive 的,父菜单也必须 keep-alive,否则无效。这里将子菜单中有 keep-alive 的父菜单也加入。 + if ( + (item.children && item.children.some((ch) => ch.meta.keepAlive)) || + item.meta.keepAlive + ) { + const path = item.meta.path + keepAliveRoutersArr.push(pathInfo[path]) + nameMap[item.name] = pathInfo[path] + } + if (item.children && item.children.length > 0) { + KeepAliveFilter(item.children) + } + }) } export const useRouterStore = defineStore('router', () => { @@ -47,7 +52,7 @@ export const useRouterStore = defineStore('router', () => { const asyncRouterFlag = ref(0) const setKeepAliveRouters = (history) => { const keepArrTemp = [] - history.forEach(item => { + history.forEach((item) => { if (nameMap[item.name]) { keepArrTemp.push(nameMap[item.name]) } @@ -64,64 +69,63 @@ export const useRouterStore = defineStore('router', () => { const menuMap = {} - const topActive = ref("") - - - - + const topActive = ref('') const setLeftMenu = (name) => { sessionStorage.setItem('topActive', name) topActive.value = name - if(menuMap[name]?.children){ + if (menuMap[name]?.children) { leftMenu.value = menuMap[name].children } return menuMap[name]?.children } - watchEffect(()=>{ - let topActive = sessionStorage.getItem("topActive") + watchEffect(() => { + let topActive = sessionStorage.getItem('topActive') let firstHasChildren = '' asyncRouters.value[0]?.children.forEach((item) => { - if (item.hidden) return; - menuMap[item.name] = item; + if (item.hidden) return + menuMap[item.name] = item if (!firstHasChildren && item.children && item.children.length > 0) { firstHasChildren = item.name } - topMenu.value.push({...item, children: []}) - }); + topMenu.value.push({ ...item, children: [] }) + }) - if(!menuMap[topActive]?.children && firstHasChildren){ - topActive = firstHasChildren + if (!menuMap[topActive]?.children && firstHasChildren) { + topActive = firstHasChildren } setLeftMenu(topActive) }) - const routeMap = ({}) + const routeMap = {} // 从后台获取动态路由 - const SetAsyncRouter = async() => { + const SetAsyncRouter = async () => { asyncRouterFlag.value++ - const baseRouter = [{ - path: '/layout', - name: 'layout', - component: 'view/layout/index.vue', - meta: { - title: i18n.global.t('pinia.modules.router.bottomLayerLayout') - }, - children: [] - }] + const baseRouter = [ + { + path: '/layout', + name: 'layout', + component: 'view/layout/index.vue', + meta: { + title: i18n.global.t('pinia.modules.router.bottomLayerLayout') + }, + children: [] + } + ] const asyncRouterRes = await asyncMenu() const asyncRouter = asyncRouterRes.data.menus - asyncRouter && asyncRouter.push({ - path: 'reload', - name: 'Reload', - hidden: true, - meta: { - title: '', - closeTab: true, - }, - component: 'view/error/reload.vue' - }) + asyncRouter && + asyncRouter.push({ + path: 'reload', + name: 'Reload', + hidden: true, + meta: { + title: '', + closeTab: true + }, + component: 'view/error/reload.vue' + }) formatRouter(asyncRouter, routeMap) baseRouter[0].children = asyncRouter if (notLayoutRouterArr.length !== 0) { @@ -145,4 +149,3 @@ export const useRouterStore = defineStore('router', () => { routeMap } }) - diff --git a/web/src/pinia/modules/user.js b/web/src/pinia/modules/user.js index 6a5e54fee..62cfcbe57 100644 --- a/web/src/pinia/modules/user.js +++ b/web/src/pinia/modules/user.js @@ -1,14 +1,13 @@ -import { login, getUserInfo, setSelfInfo } from '@/api/user' +import { login, getUserInfo } from '@/api/user' import { jsonInBlacklist } from '@/api/jwt' import router from '@/router/index' import { ElLoading, ElMessage } from 'element-plus' import { defineStore } from 'pinia' -import { ref, computed, watch } from 'vue' +import { ref, watch } from 'vue' import { useRouterStore } from './router' import cookie from 'js-cookie' import i18n from '@/i18n' // added by mohamed hassan to multilangauge -import {useAppStore} from "@/pinia"; - +import { useAppStore } from '@/pinia' export const useUserStore = defineStore('user', () => { const appStore = useAppStore() @@ -18,14 +17,18 @@ export const useUserStore = defineStore('user', () => { uuid: '', nickName: '', headerImg: '', - authority: {}, + authority: {} }) - const token = ref(window.localStorage.getItem('token') || cookie.get('x-token') || '') - const language = ref(window.localStorage.getItem('language') || cookie.get('language') || 'en') // added by mohamed hassan to allow store selected language for multilanguage support. + const token = ref( + window.localStorage.getItem('token') || cookie.get('x-token') || '' + ) + const language = ref( + window.localStorage.getItem('language') || cookie.get('language') || 'en' + ) // added by mohamed hassan to allow store selected language for multilanguage support. const setUserInfo = (val) => { userInfo.value = val - if(val.originSetting){ - Object.keys(appStore.config).forEach(key => { + if (val.originSetting) { + Object.keys(appStore.config).forEach((key) => { appStore.config[key] = val.originSetting[key] }) } @@ -48,7 +51,7 @@ export const useUserStore = defineStore('user', () => { const NeedInit = async () => { token.value = '' window.localStorage.removeItem('token') - await router.push({name: 'Init', replace: true}) + await router.push({ name: 'Init', replace: true }) } const ResetUserInfo = (value = {}) => { @@ -58,7 +61,7 @@ export const useUserStore = defineStore('user', () => { } } /* 获取用户信息*/ - const GetUserInfo = async() => { + const GetUserInfo = async () => { const res = await getUserInfo() if (res.code === 0) { setUserInfo(res.data.userInfo) @@ -66,10 +69,10 @@ export const useUserStore = defineStore('user', () => { return res } /* 登录*/ - const LoginIn = async(loginInfo) => { + const LoginIn = async (loginInfo) => { loadingInstance.value = ElLoading.service({ fullscreen: true, - text: i18n.global.t('pinia.modules.user.loggingIn'), + text: i18n.global.t('pinia.modules.user.loggingIn') }) const res = await login(loginInfo) @@ -90,7 +93,7 @@ export const useUserStore = defineStore('user', () => { const asyncRouters = routerStore.asyncRouters // 注册到路由表里 - asyncRouters.forEach(asyncRouter => { + asyncRouters.forEach((asyncRouter) => { router.addRoute(asyncRouter) }) @@ -107,13 +110,12 @@ export const useUserStore = defineStore('user', () => { window.localStorage.setItem('osType', 'MAC') } - // 全部操作均结束,关闭loading并返回 loadingInstance.value.close() return true } /* 登出*/ - const LoginOut = async() => { + const LoginOut = async () => { const res = await jsonInBlacklist() // 登出失败 @@ -128,7 +130,7 @@ export const useUserStore = defineStore('user', () => { window.location.reload() } /* 清理数据 */ - const ClearStorage = async() => { + const ClearStorage = async () => { token.value = '' sessionStorage.clear() window.localStorage.removeItem('token') @@ -136,9 +138,12 @@ export const useUserStore = defineStore('user', () => { localStorage.removeItem('originSetting') } - watch(() => token.value, () => { - window.localStorage.setItem('token', token.value) - }) + watch( + () => token.value, + () => { + window.localStorage.setItem('token', token.value) + } + ) return { userInfo, diff --git a/web/src/plugin/announcement/api/info.js b/web/src/plugin/announcement/api/info.js index e0b5fec7c..e19770bd2 100644 --- a/web/src/plugin/announcement/api/info.js +++ b/web/src/plugin/announcement/api/info.js @@ -105,6 +105,6 @@ export const getInfoList = (params) => { export const getInfoDataSource = () => { return service({ url: '/info/getInfoDataSource', - method: 'get', + method: 'get' }) } diff --git a/web/src/plugin/announcement/form/info.vue b/web/src/plugin/announcement/form/info.vue index 95a868d76..9824048ba 100644 --- a/web/src/plugin/announcement/form/info.vue +++ b/web/src/plugin/announcement/form/info.vue @@ -1,21 +1,41 @@ - + diff --git a/web/src/plugin/announcement/view/info.vue b/web/src/plugin/announcement/view/info.vue index 27349d973..b4c259965 100644 --- a/web/src/plugin/announcement/view/info.vue +++ b/web/src/plugin/announcement/view/info.vue @@ -1,7 +1,14 @@ diff --git a/web/src/plugin/email/api/email.js b/web/src/plugin/email/api/email.js index 590c862f4..c3f6c7b24 100644 --- a/web/src/plugin/email/api/email.js +++ b/web/src/plugin/email/api/email.js @@ -27,4 +27,3 @@ export const sendEmail = (data) => { data }) } - diff --git a/web/src/plugin/email/view/index.vue b/web/src/plugin/email/view/index.vue index 98bde594c..54d9c386e 100644 --- a/web/src/plugin/email/view/index.vue +++ b/web/src/plugin/email/view/index.vue @@ -15,51 +15,50 @@ - + - {{ t('plugins.email.sendTestEmail') }} - {{ t('plugins.email.sendEmail') }} + {{ + t('plugins.email.sendTestEmail') + }} + {{ + t('plugins.email.sendEmail') + }}
- - diff --git a/web/src/router/index.js b/web/src/router/index.js index 52d376307..d5203b2f8 100644 --- a/web/src/router/index.js +++ b/web/src/router/index.js @@ -1,31 +1,32 @@ import { createRouter, createWebHashHistory } from 'vue-router' -const routes = [{ - path: '/', - redirect: '/login' -}, -{ - path: '/init', - name: 'Init', - component: () => import('@/view/init/index.vue') -}, -{ - path: '/login', - name: 'Login', - component: () => import('@/view/login/index.vue') -}, -{ - path: '/:catchAll(.*)', - meta: { - closeTab: true, +const routes = [ + { + path: '/', + redirect: '/login' }, - component: () => import('@/view/error/index.vue') -} + { + path: '/init', + name: 'Init', + component: () => import('@/view/init/index.vue') + }, + { + path: '/login', + name: 'Login', + component: () => import('@/view/login/index.vue') + }, + { + path: '/:catchAll(.*)', + meta: { + closeTab: true + }, + component: () => import('@/view/error/index.vue') + } ] const router = createRouter({ history: createWebHashHistory(), - routes, + routes }) export default router diff --git a/web/src/style/element/index.scss b/web/src/style/element/index.scss index 40ef0df5c..0c2de8ddf 100644 --- a/web/src/style/element/index.scss +++ b/web/src/style/element/index.scss @@ -1,24 +1,24 @@ @forward 'element-plus/theme-chalk/src/common/var.scss' with ( $colors: ( - 'white': #ffffff, + 'white': #ffffff, 'black': #000000, 'primary': ( - 'base': #4d70ff, + 'base': #4d70ff ), 'success': ( - 'base': #67c23a, + 'base': #67c23a ), 'warning': ( - 'base': #e6a23c, + 'base': #e6a23c ), 'danger': ( - 'base': #f56c6c, + 'base': #f56c6c ), 'error': ( - 'base': #f56c6c, + 'base': #f56c6c ), 'info': ( - 'base': #909399, - ), + 'base': #909399 + ) ) ); diff --git a/web/src/style/element_visiable.scss b/web/src/style/element_visiable.scss index fad0754e3..4d33aef7b 100644 --- a/web/src/style/element_visiable.scss +++ b/web/src/style/element_visiable.scss @@ -1,138 +1,136 @@ @use '@/style/main.scss'; -@use "@/style/reset"; +@use '@/style/reset'; @tailwind base; @tailwind components; @tailwind utilities; .el-button { - font-weight: 400; - border-radius: 2px; + font-weight: 400; + border-radius: 2px; } .gva-pagination { - @apply flex justify-end; - .el-pagination__editor { - .el-input__inner { - @apply h-8; - } + @apply flex justify-end; + .el-pagination__editor { + .el-input__inner { + @apply h-8; } + } - .is-active { - @apply rounded text-white; - background: var(--el-color-primary); - color: #ffffff !important; - } + .is-active { + @apply rounded text-white; + background: var(--el-color-primary); + color: #ffffff !important; + } } - -.el-drawer__header{ - margin-bottom: 0 !important; - padding-top: 16px !important; - padding-bottom: 16px !important; - @apply border-0 border-b border-solid border-gray-200; +.el-drawer__header { + margin-bottom: 0 !important; + padding-top: 16px !important; + padding-bottom: 16px !important; + @apply border-0 border-b border-solid border-gray-200; } - .el-form--inline { - .el-form-item { - & > .el-input, .el-cascader, .el-select, .el-date-editor, .el-autocomplete { - @apply w-52; - } + .el-form-item { + & > .el-input, + .el-cascader, + .el-select, + .el-date-editor, + .el-autocomplete { + @apply w-52; } + } } .el-dropdown { - @apply overflow-hidden + @apply overflow-hidden; } - .el-table { - tr{ - th { - @apply dark:bg-slate-900; - .cell { - @apply leading-[36px] text-gray-700 dark:text-gray-200; - } - } + tr { + th { + @apply dark:bg-slate-900; + .cell { + @apply leading-[36px] text-gray-700 dark:text-gray-200; + } } - .el-table__row { - td { - @apply dark:bg-slate-900; - .cell { - @apply leading-[32px] text-gray-600 dark:text-gray-300; - } - } + } + .el-table__row { + td { + @apply dark:bg-slate-900; + .cell { + @apply leading-[32px] text-gray-600 dark:text-gray-300; + } } - tr{ - th{ - &.is-leaf { - @apply dark:bg-slate-900; - } - } - + } + tr { + th { + &.is-leaf { + @apply dark:bg-slate-900; + } } + } } // layout // table .el-pagination { - @apply mt-8; - .btn-prev, - .btn-next { - @apply border border-solid border-gray-300 dark:border-gray-700 rounded; - } - .el-pager { - li { - @apply border border-solid border-gray-300 dark:border-gray-600 rounded text-gray-600 text-sm mx-1; - } + @apply mt-8; + .btn-prev, + .btn-next { + @apply border border-solid border-gray-300 dark:border-gray-700 rounded; + } + .el-pager { + li { + @apply border border-solid border-gray-300 dark:border-gray-600 rounded text-gray-600 text-sm mx-1; } + } } -.el-menu{ - li{ - @apply my-1; - } +.el-menu { + li { + @apply my-1; + } } -.el-menu--vertical{ - .el-menu-item{ - border-radius: 2px; - &.is-active{ - background-color: var(--el-color-primary) !important; - color: #fff !important; - } +.el-menu--vertical { + .el-menu-item { + border-radius: 2px; + &.is-active { + background-color: var(--el-color-primary) !important; + color: #fff !important; } + } } - -.el-sub-menu.el-sub-menu__hide-arrow{ - height: 44px; +.el-sub-menu.el-sub-menu__hide-arrow { + height: 44px; } - -.el-tabs__header{ - margin: 0 0 1px !important; +.el-tabs__header { + margin: 0 0 1px !important; } -.el-sub-menu.is-active{ - > .el-sub-menu__title{ - color: var(--el-color-primary) !important; - } +.el-sub-menu.is-active { + > .el-sub-menu__title { + color: var(--el-color-primary) !important; + } } .el-sub-menu__title.el-tooltip__trigger, -.el-menu-item .el-menu-tooltip__trigger{ - justify-content: center; +.el-menu-item .el-menu-tooltip__trigger { + justify-content: center; } -.el-menu--horizontal .el-menu .el-sub-menu__title{ - justify-content: flex-start; +.el-menu--horizontal .el-menu .el-sub-menu__title { + justify-content: flex-start; } html.dark { - /* 自定义深色背景颜色 */ - --el-bg-color: rgb(30 ,41 ,59); - --el-bg-color-overlay: rgb(40 ,51 ,69); - --el-fill-color-light: rgb(15 ,23 ,42); - --el-fill-color : rgb(15 ,23 ,42); + /* 自定义深色背景颜色 */ + --el-bg-color: rgb(30, 41, 59); + --el-bg-color-overlay: rgb(40, 51, 69); + --el-fill-color-light: rgb(15, 23, 42); + --el-fill-color: rgb(15, 23, 42); } diff --git a/web/src/style/iconfont.css b/web/src/style/iconfont.css index bc091a05c..623bf13b5 100644 --- a/web/src/style/iconfont.css +++ b/web/src/style/iconfont.css @@ -1,47 +1,47 @@ @font-face { - font-family: 'gvaIcon'; - src: url('data:font/ttf;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTZJUyU8AAA14AAAAHEdERUYAKQARAAANWAAAAB5PUy8yPJpJTAAAAVgAAABgY21hcM0T0L4AAAHYAAABWmdhc3D//wADAAANUAAAAAhnbHlmRk3UvwAAA0wAAAbYaGVhZB/a5jgAAADcAAAANmhoZWEHngOFAAABFAAAACRobXR4DaoBrAAAAbgAAAAebG9jYQbMCGgAAAM0AAAAGG1heHABGgB+AAABOAAAACBuYW1lXoIBAgAACiQAAAKCcG9zdN15OnUAAAyoAAAAqAABAAAAAQAA+a916l8PPPUACwQAAAAAAN5YUSMAAAAA3lhRIwBL/8ADwAM1AAAACAACAAAAAAAAAAEAAAOA/4AAXAQAAAAAAAPAAAEAAAAAAAAAAAAAAAAAAAAEAAEAAAALAHIABQAAAAAAAgAAAAoACgAAAP8AAAAAAAAABAQAAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZADA5mXmfQOA/4AAAAPcAIAAAAABAAAAAAAAAAAAAAAgAAEEAAAAAAAAAAQAAAAEAACLAIoAYAB1AHYASwBLAGAAAAAAAAMAAAADAAAAHAABAAAAAABUAAMAAQAAABwABAA4AAAACgAIAAIAAuZm5mrmduZ9//8AAOZl5mrmdeZ7//8ZnhmbGZEZjQABA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wBuAHQAAGljb25mb250AABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAHMAdgBnADIAdAB0AGYAIABmAHIAbwBtACAARgBvAG4AdABlAGwAbABvACAAcAByAG8AagBlAGMAdAAuAABHZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuAABoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAABodHRwOi8vZm9udGVsbG8uY29tAAAAAAIAAAAAAAAACgAAAAAAAQAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAgECAQMBBAEFAQYBBwEIAQkRYXJyb3ctZG91YmxlLWxlZnQSYXJyb3ctZG91YmxlLXJpZ2h0EGN1c3RvbWVyLXNlcnZpY2URZnVsbHNjcmVlbi1leHBhbmQRZnVsbHNjcmVlbi1zaHJpbmsGcHJvbXB0B3JlZnJlc2gGc2VhcmNoAAAAAf//AAIAAQAAAAwAAAAWAAAAAgABAAMACgABAAQAAAACAAAAAAAAAAEAAAAA1aQnCAAAAADeWFEjAAAAAN5YUSM=') format('truetype'); - font-weight: 600; - font-style: normal; - font-display: swap; + font-family: 'gvaIcon'; + src: url('data:font/ttf;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTZJUyU8AAA14AAAAHEdERUYAKQARAAANWAAAAB5PUy8yPJpJTAAAAVgAAABgY21hcM0T0L4AAAHYAAABWmdhc3D//wADAAANUAAAAAhnbHlmRk3UvwAAA0wAAAbYaGVhZB/a5jgAAADcAAAANmhoZWEHngOFAAABFAAAACRobXR4DaoBrAAAAbgAAAAebG9jYQbMCGgAAAM0AAAAGG1heHABGgB+AAABOAAAACBuYW1lXoIBAgAACiQAAAKCcG9zdN15OnUAAAyoAAAAqAABAAAAAQAA+a916l8PPPUACwQAAAAAAN5YUSMAAAAA3lhRIwBL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QABAAAAAAAEAAgAnAABAAAAAAAFAAsAvQABAAAAAAAGAAgA2wABAAAAAAAKACsBPAABAAAAAAALABMBkAADAAEECQAAACYAAAADAAEECQABABAAPAADAAEECQACAA4AVwADAAEECQADABAAbwADAAEECQAEABAAigADAAEECQAFABYApQADAAEECQAGABAAyQADAAEECQAKAFYA5AADAAEECQALACYBaABDAHIAZQBhAHQAZQBkACAAYgB5ACAAaQBjAG8AbgBmAG8AbgB0AABDcmVhdGVkIGJ5IGljb25mb250AABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAHMAdgBnADIAdAB0AGYAIABmAHIAbwBtACAARgBvAG4AdABlAGwAbABvACAAcAByAG8AagBlAGMAdAAuAABHZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuAABoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAABodHRwOi8vZm9udGVsbG8uY29tAAAAAAIAAAAAAAAACgAAAAAAAQAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAgECAQMBBAEFAQYBBwEIAQkRYXJyb3ctZG91YmxlLWxlZnQSYXJyb3ctZG91YmxlLXJpZ2h0EGN1c3RvbWVyLXNlcnZpY2URZnVsbHNjcmVlbi1leHBhbmQRZnVsbHNjcmVlbi1zaHJpbmsGcHJvbXB0B3JlZnJlc2gGc2VhcmNoAAAAAf//AAIAAQAAAAwAAAAWAAAAAgABAAMACgABAAQAAAACAAAAAAAAAAEAAAAA1aQnCAAAAADeWFEjAAAAAN5YUSM=') + format('truetype'); + font-weight: 600; + font-style: normal; + font-display: swap; } .gvaIcon { - font-family: "gvaIcon" !important; - font-size: 16px; - font-style: normal; - font-weight: 800; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - } + font-family: 'gvaIcon' !important; + font-size: 16px; + font-style: normal; + font-weight: 800; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} .gvaIcon-arrow-double-left:before { - content: "\e665"; - } + content: '\e665'; +} .gvaIcon-arrow-double-right:before { - content: "\e666"; + content: '\e666'; } .gvaIcon-fullscreen-shrink:before { - content: "\e676"; + content: '\e676'; } .gvaIcon-customer-service:before { - content: "\e66a"; - } + content: '\e66a'; +} .gvaIcon-fullscreen-expand:before { - content: "\e675"; + content: '\e675'; } .gvaIcon-prompt:before { - content: "\e67b"; + content: '\e67b'; } .gvaIcon-refresh:before { - content: "\e67c"; + content: '\e67c'; } .gvaIcon-search:before { - content: "\e67d"; + content: '\e67d'; } - diff --git a/web/src/style/main.scss b/web/src/style/main.scss index 12318e5ac..ac5622d97 100644 --- a/web/src/style/main.scss +++ b/web/src/style/main.scss @@ -1,53 +1,50 @@ - @use '@/style/iconfont.css'; -.html-grey{ - filter: grayscale(100%); +.html-grey { + filter: grayscale(100%); } -.html-weakenss{ - filter: invert(80%); +.html-weakenss { + filter: invert(80%); } .gva-table-box { - @apply p-4 bg-white text-slate-700 dark:text-slate-400 dark:bg-slate-900 rounded my-2; - .el-table{ - @apply border-x border-t border-b-0 rounded border-table-border border-solid -mx-[1px]; - } + @apply p-4 bg-white text-slate-700 dark:text-slate-400 dark:bg-slate-900 rounded my-2; + .el-table { + @apply border-x border-t border-b-0 rounded border-table-border border-solid -mx-[1px]; + } } .gva-btn-list { - @apply mb-3 flex items-center; + @apply mb-3 flex items-center; } - #nprogress .bar { - background: #29d !important; + background: #29d !important; } -.gva-customer-icon{ - @apply w-4 h-4; +.gva-customer-icon { + @apply w-4 h-4; } ::-webkit-scrollbar { - @apply hidden; + @apply hidden; } - .gva-search-box { - @apply p-4 bg-white text-slate-700 dark:text-slate-400 dark:bg-slate-900 rounded my-2; + @apply p-4 bg-white text-slate-700 dark:text-slate-400 dark:bg-slate-900 rounded my-2; } .gva-form-box { - @apply p-4 bg-white text-slate-700 dark:text-slate-400 dark:bg-slate-900 rounded my-2; + @apply p-4 bg-white text-slate-700 dark:text-slate-400 dark:bg-slate-900 rounded my-2; } -.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content{ - background: var(--el-color-primary-bg) !important; +.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content { + background: var(--el-color-primary-bg) !important; } -.el-dropdown{ +.el-dropdown { + outline: none; + * { outline: none; - *{ - outline: none; - } + } } diff --git a/web/src/style/reset.scss b/web/src/style/reset.scss index 745bcdb07..2cd44c702 100644 --- a/web/src/style/reset.scss +++ b/web/src/style/reset.scss @@ -1,7 +1,6 @@ /* Document ========================================================================== */ - /** * 1. Correct the line height in all browsers. * 2. Prevent adjustments of font size after orientation changes in iOS. @@ -14,11 +13,9 @@ html { /* 2 */ } - /* Sections ========================================================================== */ - /** * Remove the margin in all browsers. */ @@ -27,7 +24,6 @@ body { margin: 0; } - /** * Render the `main` element consistently in IE. */ @@ -36,7 +32,6 @@ main { display: block; } - /** * Correct the font size and margin on `h1` elements within `section` and * `article` contexts in Chrome, Firefox, and Safari. @@ -47,11 +42,9 @@ h1 { margin: 0.67em 0; } - /* Grouping content ========================================================================== */ - /** * 1. Add the correct box sizing in Firefox. * 2. Show the overflow in Edge and IE. @@ -66,7 +59,6 @@ hr { /* 2 */ } - /** * 1. Correct the inheritance and scaling of font size in all browsers. * 2. Correct the odd `em` font sizing in all browsers. @@ -79,11 +71,9 @@ pre { /* 2 */ } - /* Text-level semantics ========================================================================== */ - /** * Remove the gray background on active links in IE 10. */ @@ -92,7 +82,6 @@ a { background-color: transparent; } - /** * 1. Remove the bottom border in Chrome 57- * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. @@ -107,7 +96,6 @@ abbr[title] { /* 2 */ } - /** * Add the correct font weight in Chrome, Edge, and Safari. */ @@ -117,7 +105,6 @@ strong { font-weight: bolder; } - /** * 1. Correct the inheritance and scaling of font size in all browsers. * 2. Correct the odd `em` font sizing in all browsers. @@ -132,7 +119,6 @@ samp { /* 2 */ } - /** * Add the correct font size in all browsers. */ @@ -141,7 +127,6 @@ small { font-size: 80%; } - /** * Prevent `sub` and `sup` elements from affecting the line height in * all browsers. @@ -163,11 +148,9 @@ sup { top: -0.5em; } - /* Embedded content ========================================================================== */ - /** * Remove the border on images inside links in IE 10. */ @@ -176,11 +159,9 @@ img { border-style: none; } - /* Forms ========================================================================== */ - /** * 1. Change the font styles in all browsers. * 2. Remove the margin in Firefox and Safari. @@ -201,7 +182,6 @@ textarea { /* 2 */ } - /** * Show the overflow in IE. * 1. Show the overflow in Edge. @@ -213,7 +193,6 @@ input { overflow: visible; } - /** * Remove the inheritance of text transform in Edge, Firefox, and IE. * 1. Remove the inheritance of text transform in Firefox. @@ -225,44 +204,40 @@ select { text-transform: none; } - /** * Correct the inability to style clickable types in iOS and Safari. */ button, -[type="button"], -[type="reset"], -[type="submit"] { +[type='button'], +[type='reset'], +[type='submit'] { -webkit-appearance: button; } - /** * Remove the inner border and padding in Firefox. */ button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { +[type='button']::-moz-focus-inner, +[type='reset']::-moz-focus-inner, +[type='submit']::-moz-focus-inner { border-style: none; padding: 0; } - /** * Restore the focus styles unset by the previous rule. */ button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { +[type='button']:-moz-focusring, +[type='reset']:-moz-focusring, +[type='submit']:-moz-focusring { outline: 1px dotted ButtonText; } - /** * Correct the padding in Firefox. */ @@ -271,7 +246,6 @@ fieldset { padding: 0.35em 0.75em 0.625em; } - /** * 1. Correct the text wrapping in Edge and IE. * 2. Correct the color inheritance from `fieldset` elements in IE. @@ -294,7 +268,6 @@ legend { /* 1 */ } - /** * Add the correct vertical alignment in Chrome, Firefox, and Opera. */ @@ -303,7 +276,6 @@ progress { vertical-align: baseline; } - /** * Remove the default vertical scrollbar in IE 10+. */ @@ -312,53 +284,48 @@ textarea { overflow: auto; } - /** * 1. Add the correct box sizing in IE 10. * 2. Remove the padding in IE 10. */ -[type="checkbox"], -[type="radio"] { +[type='checkbox'], +[type='radio'] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } - /** * Correct the cursor style of increment and decrement buttons in Chrome. */ -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { +[type='number']::-webkit-inner-spin-button, +[type='number']::-webkit-outer-spin-button { height: auto; } - /** * 1. Correct the odd appearance in Chrome and Safari. * 2. Correct the outline style in Safari. */ -[type="search"] { +[type='search'] { -webkit-appearance: textfield; /* 1 */ outline-offset: -2px; /* 2 */ } - /** * Remove the inner padding in Chrome and Safari on macOS. */ -[type="search"]::-webkit-search-decoration { +[type='search']::-webkit-search-decoration { -webkit-appearance: none; } - /** * 1. Correct the inability to style clickable types in iOS and Safari. * 2. Change font properties to `inherit` in Safari. @@ -371,11 +338,9 @@ textarea { /* 2 */ } - /* Interactive ========================================================================== */ - /* * Add the correct display in Edge, IE 10+, and Firefox. */ @@ -384,7 +349,6 @@ details { display: block; } - /* * Add the correct display in all browsers. */ @@ -393,11 +357,9 @@ summary { display: list-item; } - /* Misc ========================================================================== */ - /** * Add the correct display in IE 10+. */ @@ -406,7 +368,6 @@ template { display: none; } - /** * Add the correct display in IE 10. */ @@ -433,7 +394,8 @@ table, th, td { border: none; - font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; + font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', + 'Microsoft YaHei', '微软雅黑', Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; @@ -486,8 +448,8 @@ input::-moz-placeholder { color: #ccc; } -input[type=submit], -input[type=button] { +input[type='submit'], +input[type='button'] { cursor: pointer; } diff --git a/web/src/utils/asyncRouter.js b/web/src/utils/asyncRouter.js index 26c3df0a0..9e7a5cae2 100644 --- a/web/src/utils/asyncRouter.js +++ b/web/src/utils/asyncRouter.js @@ -2,9 +2,9 @@ const viewModules = import.meta.glob('../view/**/*.vue') const pluginModules = import.meta.glob('../plugin/**/*.vue') export const asyncRouterHandle = (asyncRouter) => { - asyncRouter.forEach(item => { + asyncRouter.forEach((item) => { if (item.component && typeof item.component === 'string') { - item.meta.path = "/src/"+item.component + item.meta.path = '/src/' + item.component if (item.component.split('/')[0] === 'view') { item.component = dynamicImport(viewModules, item.component) } else if (item.component.split('/')[0] === 'plugin') { @@ -17,10 +17,7 @@ export const asyncRouterHandle = (asyncRouter) => { }) } -function dynamicImport( - dynamicViewsModules, - component -) { +function dynamicImport(dynamicViewsModules, component) { const keys = Object.keys(dynamicViewsModules) const matchKeys = keys.filter((key) => { const k = key.replace('../', '') diff --git a/web/src/utils/bus.js b/web/src/utils/bus.js index 4b673fa2f..f2a3b9238 100644 --- a/web/src/utils/bus.js +++ b/web/src/utils/bus.js @@ -1,6 +1,4 @@ - // using ES6 modules import mitt from 'mitt' export const emitter = mitt() - diff --git a/web/src/utils/date.js b/web/src/utils/date.js index 6bb8570bf..0744cfb83 100644 --- a/web/src/utils/date.js +++ b/web/src/utils/date.js @@ -3,26 +3,35 @@ // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 -// eslint-disable-next-line no-extend-native -Date.prototype.Format = function(fmt) { - var o = { +Date.prototype.Format = function (fmt) { + const o = { 'M+': this.getMonth() + 1, // 月份 'd+': this.getDate(), // 日 'h+': this.getHours(), // 小时 'm+': this.getMinutes(), // 分 's+': this.getSeconds(), // 秒 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度 - 'S': this.getMilliseconds() // 毫秒 + S: this.getMilliseconds() // 毫秒 } - if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)) } - for (var k in o) { - if (new RegExp('(' + k + ')').test(fmt)) { fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) } + if (/(y+)/.test(fmt)) { + fmt = fmt.replace( + RegExp.$1, + (this.getFullYear() + '').substr(4 - RegExp.$1.length) + ) + } + for (const k in o) { + if (new RegExp('(' + k + ')').test(fmt)) { + fmt = fmt.replace( + RegExp.$1, + RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length) + ) + } } return fmt } export function formatTimeToStr(times, pattern) { - var d = new Date(times).Format('yyyy-MM-dd hh:mm:ss') + let d = new Date(times).Format('yyyy-MM-dd hh:mm:ss') if (pattern) { d = new Date(times).Format(pattern) } diff --git a/web/src/utils/dictionary.js b/web/src/utils/dictionary.js index 440fe5e1a..679a6b988 100644 --- a/web/src/utils/dictionary.js +++ b/web/src/utils/dictionary.js @@ -1,7 +1,7 @@ import { useDictionaryStore } from '@/pinia/modules/dictionary' import { getSysParam } from '@/api/sysParams' // 获取字典方法 使用示例 getDict('sex').then(res) 或者 async函数下 const res = await getDict('sex') -export const getDict = async(type) => { +export const getDict = async (type) => { const dictionaryStore = useDictionaryStore() await dictionaryStore.getDictionary(type) return dictionaryStore.dictionaryMap[type] @@ -18,7 +18,7 @@ export const showDictLabel = ( return '' } const dictMap = {} - dict.forEach(item => { + dict.forEach((item) => { if (Reflect.has(item, keyCode) && Reflect.has(item, valueCode)) { dictMap[item[keyCode]] = item[valueCode] } @@ -26,10 +26,9 @@ export const showDictLabel = ( return Reflect.has(dictMap, code) ? dictMap[code] : '' } - -export const getParams = async (key)=>{ - const res = await getSysParam({key}) - if(res.code === 0){ +export const getParams = async (key) => { + const res = await getSysParam({ key }) + if (res.code === 0) { return res.data.value } } diff --git a/web/src/utils/downloadImg.js b/web/src/utils/downloadImg.js index 93fb2222d..10506c791 100644 --- a/web/src/utils/downloadImg.js +++ b/web/src/utils/downloadImg.js @@ -1,7 +1,8 @@ -export const downloadImage = (imgsrc, name) => { // 下载图片地址和图片名 +export const downloadImage = (imgsrc, name) => { + // 下载图片地址和图片名 var image = new Image() image.setAttribute('crossOrigin', 'anonymous') - image.onload = function() { + image.onload = function () { var canvas = document.createElement('canvas') canvas.width = image.width canvas.height = image.height diff --git a/web/src/utils/event.js b/web/src/utils/event.js index 5063d8cba..4861bf703 100644 --- a/web/src/utils/event.js +++ b/web/src/utils/event.js @@ -1,29 +1,17 @@ -export function addEventListen( - target, - event, - handler, - capture = false -) { +export function addEventListen(target, event, handler, capture = false) { if ( target.addEventListener && typeof target.addEventListener === 'function' ) { - target.addEventListener(event, handler, capture); + target.addEventListener(event, handler, capture) } } -export function removeEventListen( - target, - event, - handler, - capture = false -) { +export function removeEventListen(target, event, handler, capture = false) { if ( target.removeEventListener && typeof target.removeEventListener === 'function' ) { - target.removeEventListener(event, handler, capture); + target.removeEventListener(event, handler, capture) } } - - diff --git a/web/src/utils/format.js b/web/src/utils/format.js index 8186e010c..0fede0f32 100644 --- a/web/src/utils/format.js +++ b/web/src/utils/format.js @@ -1,6 +1,6 @@ import { formatTimeToStr } from '@/utils/date' import { getDict } from '@/utils/dictionary' -import {ref} from "vue"; +import { ref } from 'vue' import { useI18n } from 'vue-i18n' // added by mohamed hassan to support multilanguage export const formatBoolean = (bool) => { @@ -21,30 +21,32 @@ export const formatDate = (time) => { } export const filterDict = (value, options) => { - const rowLabel = options && options.filter(item => item.value === value) + const rowLabel = options && options.filter((item) => item.value === value) return rowLabel && rowLabel[0] && rowLabel[0].label } export const filterDataSource = (dataSource, value) => { if (Array.isArray(value)) { - return value.map(item => { - const rowLabel = dataSource && dataSource.find(i => i.value === item) + return value.map((item) => { + const rowLabel = dataSource && dataSource.find((i) => i.value === item) return rowLabel?.label }) } - const rowLabel = dataSource && dataSource.find(item => item.value === value) + const rowLabel = dataSource && dataSource.find((item) => item.value === value) return rowLabel?.label } -export const getDictFunc = async(type) => { +export const getDictFunc = async (type) => { const dicts = await getDict(type) return dicts } -const path = import.meta.env.VITE_BASE_PATH + ':' + import.meta.env.VITE_SERVER_PORT + '/' +const path = + import.meta.env.VITE_BASE_PATH + ':' + import.meta.env.VITE_SERVER_PORT + '/' export const ReturnArrImg = (arr) => { const imgArr = [] - if (arr instanceof Array) { // 如果是数组类型 + if (arr instanceof Array) { + // 如果是数组类型 for (const arrKey in arr) { if (arr[arrKey].slice(0, 4) !== 'http') { imgArr.push(path + arr[arrKey]) @@ -52,7 +54,8 @@ export const ReturnArrImg = (arr) => { imgArr.push(arr[arrKey]) } } - } else { // 如果不是数组类型 + } else { + // 如果不是数组类型 if (arr.slice(0, 4) !== 'http') { imgArr.push(path + arr) } else { @@ -67,65 +70,69 @@ export const returnArrImg = ReturnArrImg export const onDownloadFile = (url) => { window.open(path + url) } -const colorToHex = u=>{ - let e = u.replace("#", "").match(/../g); - for (let t = 0; t < 3; t++) - e[t] = parseInt(e[t], 16); +const colorToHex = (u) => { + let e = u.replace('#', '').match(/../g) + for (let t = 0; t < 3; t++) e[t] = parseInt(e[t], 16) return e } -const hexToColor = (u,e,t)=>{ - let a = [u.toString(16), e.toString(16), t.toString(16)]; - for (let n = 0; n < 3; n++) - a[n].length === 1 && (a[n] = `0${a[n]}`); - return `#${a.join("")}` +const hexToColor = (u, e, t) => { + let a = [u.toString(16), e.toString(16), t.toString(16)] + for (let n = 0; n < 3; n++) a[n].length === 1 && (a[n] = `0${a[n]}`) + return `#${a.join('')}` } -const generateAllColors = (u,e)=> { - let t = colorToHex(u); - const target = [10, 10, 30]; - for (let a = 0; a < 3; a++) - t[a] = Math.floor(t[a] * (1 - e) + target[a] * e); +const generateAllColors = (u, e) => { + let t = colorToHex(u) + const target = [10, 10, 30] + for (let a = 0; a < 3; a++) t[a] = Math.floor(t[a] * (1 - e) + target[a] * e) return hexToColor(t[0], t[1], t[2]) } const generateAllLightColors = (u, e) => { - let t = colorToHex(u); - const target = [240, 248, 255]; // RGB for blue white color - for (let a = 0; a < 3; a++) - t[a] = Math.floor(t[a] * (1 - e) + target[a] * e); - return hexToColor(t[0], t[1], t[2]); + let t = colorToHex(u) + const target = [240, 248, 255] // RGB for blue white color + for (let a = 0; a < 3; a++) t[a] = Math.floor(t[a] * (1 - e) + target[a] * e) + return hexToColor(t[0], t[1], t[2]) } - function addOpacityToColor(u, opacity) { - let t = colorToHex(u); - return `rgba(${t[0]}, ${t[1]}, ${ t[2]}, ${opacity})`; + let t = colorToHex(u) + return `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${opacity})` } - -export const setBodyPrimaryColor = (primaryColor, darkMode) =>{ - +export const setBodyPrimaryColor = (primaryColor, darkMode) => { let fmtColorFunc = generateAllColors if (darkMode === 'light') { fmtColorFunc = generateAllLightColors } document.documentElement.style.setProperty('--el-color-primary', primaryColor) - document.documentElement.style.setProperty('--el-color-primary-bg', addOpacityToColor(primaryColor, 0.4)) + document.documentElement.style.setProperty( + '--el-color-primary-bg', + addOpacityToColor(primaryColor, 0.4) + ) for (let times = 1; times <= 2; times++) { - document.documentElement.style.setProperty(`--el-color-primary-dark-${times}`, fmtColorFunc(primaryColor, times / 10)) + document.documentElement.style.setProperty( + `--el-color-primary-dark-${times}`, + fmtColorFunc(primaryColor, times / 10) + ) } for (let times = 1; times <= 10; times++) { - document.documentElement.style.setProperty(`--el-color-primary-light-${times}`, fmtColorFunc(primaryColor, times / 10)) + document.documentElement.style.setProperty( + `--el-color-primary-light-${times}`, + fmtColorFunc(primaryColor, times / 10) + ) } - document.documentElement.style.setProperty(`--el-menu-hover-bg-color`, addOpacityToColor(primaryColor, 0.2)) + document.documentElement.style.setProperty( + `--el-menu-hover-bg-color`, + addOpacityToColor(primaryColor, 0.2) + ) } - const baseUrl = ref(import.meta.env.VITE_BASE_API) export const getBaseUrl = () => { - return baseUrl.value === "/" ? "" : baseUrl.value + return baseUrl.value === '/' ? '' : baseUrl.value } export const CreateUUID = () => { @@ -134,8 +141,8 @@ export const CreateUUID = () => { d += performance.now() } return '00000000-0000-0000-0000-000000000000'.replace(/0/g, (c) => { - const r = (d + Math.random() * 16) % 16 | 0 // d是随机种子 + const r = (d + Math.random() * 16) % 16 | 0 // d是随机种子 d = Math.floor(d / 16) - return (c === '0' ? r : (r & 0x3 | 0x8)).toString(16) + return (c === '0' ? r : (r & 0x3) | 0x8).toString(16) }) } diff --git a/web/src/utils/image.js b/web/src/utils/image.js index 9a929588c..a2d3241e8 100644 --- a/web/src/utils/image.js +++ b/web/src/utils/image.js @@ -9,7 +9,7 @@ export default class ImageCompress { // 压缩 const fileType = this.file.type const fileSize = this.file.size / 1024 - return new Promise(resolve => { + return new Promise((resolve) => { const reader = new FileReader() reader.readAsDataURL(this.file) reader.onload = () => { @@ -26,7 +26,7 @@ export default class ImageCompress { ctx.clearRect(0, 0, canvas.width, canvas.height) ctx.drawImage(img, 0, 0, canvas.width, canvas.height) - const newImgData = canvas.toDataURL(fileType, 0.90) + const newImgData = canvas.toDataURL(fileType, 0.9) // 压缩宽高后的图像大小 const newImgSize = this.fileSizeKB(newImgData) @@ -69,7 +69,7 @@ export default class ImageCompress { fileSizeKB(dataURL) { let sizeKB = 0 - sizeKB = Math.round((dataURL.split(',')[1].length * 3 / 4) / 1024) + sizeKB = Math.round((dataURL.split(',')[1].length * 3) / 4 / 1024) return sizeKB } @@ -93,21 +93,30 @@ export default class ImageCompress { const path = import.meta.env.VITE_FILE_API export const getUrl = (url) => { - if (url && url.slice(0, 4) !== 'http'){ - if (path === "/"){ - return url + if (url && url.slice(0, 4) !== 'http') { + if (path === '/') { + return url } - if (url.slice(0, 1) === "/"){ - return path + url + if (url.slice(0, 1) === '/') { + return path + url } - return path + "/" + url - }else{ + return path + '/' + url + } else { return url } } -export const isVideoExt = (url) => url.endsWith('.mp4') || url.endsWith('.mov') || url.endsWith('.webm') || url.endsWith('.ogg'); +export const isVideoExt = (url) => + url.endsWith('.mp4') || + url.endsWith('.mov') || + url.endsWith('.webm') || + url.endsWith('.ogg') -export const isVideoMime = (type) => type == 'video/mp4' || type == 'video/webm' || type == 'video/ogg'; +export const isVideoMime = (type) => + type == 'video/mp4' || type == 'video/webm' || type == 'video/ogg' -export const isImageMime = (type) => type == 'image/jpeg' || type == 'image/png' || type == 'image/webp' || type == 'image/svg+xml'; +export const isImageMime = (type) => + type == 'image/jpeg' || + type == 'image/png' || + type == 'image/webp' || + type == 'image/svg+xml' diff --git a/web/src/utils/request.js b/web/src/utils/request.js index e163900bd..a0851a520 100644 --- a/web/src/utils/request.js +++ b/web/src/utils/request.js @@ -12,9 +12,11 @@ const service = axios.create({ let activeAxios = 0 let timer let loadingInstance -const showLoading = (option = { - target: null, -}) => { +const showLoading = ( + option = { + target: null + } +) => { const loadDom = document.getElementById('gva-base-load-dom') activeAxios++ if (timer) { @@ -37,7 +39,7 @@ const closeLoading = () => { } // http request 拦截器 service.interceptors.request.use( - config => { + (config) => { if (!config.donNotShowLoading) { showLoading(config.loadingOption) } @@ -51,7 +53,7 @@ service.interceptors.request.use( } return config }, - error => { + (error) => { if (!error.config.donNotShowLoading) { closeLoading() } @@ -66,7 +68,7 @@ service.interceptors.request.use( // http response 拦截器 service.interceptors.response.use( - response => { + (response) => { const userStore = useUserStore() if (!response.config.donNotShowLoading) { closeLoading() @@ -88,68 +90,87 @@ service.interceptors.response.use( return response.data.msg ? response.data : response } }, - error => { + (error) => { if (!error.config.donNotShowLoading) { closeLoading() } if (!error.response) { ElMessageBox.confirm( - i18n.global.t('utils.request.requestErrorDetected') + - `

${error}

- `, i18n.global.t('utils.request.requestError'), { - dangerouslyUseHTMLString: true, - distinguishCancelAndClose: true, - confirmButtonText: i18n.global.t('utils.request.tryAgainLater'), - cancelButtonText: i18n.global.t('general.cancel') - }) + i18n.global.t('utils.request.requestErrorDetected') + + `

${error}

+ `, + i18n.global.t('utils.request.requestError'), + { + dangerouslyUseHTMLString: true, + distinguishCancelAndClose: true, + confirmButtonText: i18n.global.t('utils.request.tryAgainLater'), + cancelButtonText: i18n.global.t('general.cancel') + } + ) return } switch (error.response.status) { case 500: ElMessageBox.confirm( - i18n.global.t('utils.request.interfaceErrorDetected') + - `

${error}

` + - `

` + i18n.global.t('utils.request.errorCode') + ` 500 :` + i18n.global.t('utils.request.interfaceErrorNote') + `

`, - i18n.global.t('utils.request.interfaceError'), { - dangerouslyUseHTMLString: true, - distinguishCancelAndClose: true, - confirmButtonText: i18n.global.t('utils.request.clearCache'), - cancelButtonText: i18n.global.t('general.cancel') + i18n.global.t('utils.request.interfaceErrorDetected') + + `

${error}

` + + `

` + + i18n.global.t('utils.request.errorCode') + + ` 500 :` + + i18n.global.t('utils.request.interfaceErrorNote') + + `

`, + i18n.global.t('utils.request.interfaceError'), + { + dangerouslyUseHTMLString: true, + distinguishCancelAndClose: true, + confirmButtonText: i18n.global.t('utils.request.clearCache'), + cancelButtonText: i18n.global.t('general.cancel') + } + ).then(() => { + const userStore = useUserStore() + userStore.ClearStorage() + router.push({ name: 'Login', replace: true }) }) - .then(() => { - const userStore = useUserStore() - userStore.ClearStorage() - router.push({ name: 'Login', replace: true }) - }) break case 404: - ElMessageBox.confirm( - i18n.global.t('utils.request.interfaceErrorDetected') + - `

${error}

` + - `

` + i18n.global.t('utils.request.errorCode') + ` 404 :` + i18n.global.t('utils.request.interfaceNotRegisteredNote') + `

`, - i18n.global.t('utils.request.interfaceError'), { - dangerouslyUseHTMLString: true, - distinguishCancelAndClose: true, - confirmButtonText: i18n.global.t('utils.request.iGotIt'), - cancelButtonText: i18n.global.t('general.cancel') - }) + ElMessageBox.confirm( + i18n.global.t('utils.request.interfaceErrorDetected') + + `

${error}

` + + `

` + + i18n.global.t('utils.request.errorCode') + + ` 404 :` + + i18n.global.t('utils.request.interfaceNotRegisteredNote') + + `

`, + i18n.global.t('utils.request.interfaceError'), + { + dangerouslyUseHTMLString: true, + distinguishCancelAndClose: true, + confirmButtonText: i18n.global.t('utils.request.iGotIt'), + cancelButtonText: i18n.global.t('general.cancel') + } + ) break case 401: ElMessageBox.confirm( - i18n.global.t('utils.request.invalidToken') + - `

` + i18n.global.t('utils.request.errorCode') + ` 401 ` + i18n.global.t('utils.request.errorMessage') + `: ${error}

`, - i18n.global.t('utils.request.identityInfo'), { - dangerouslyUseHTMLString: true, - distinguishCancelAndClose: true, - confirmButtonText: i18n.global.t('utils.request.loginAgain'), - cancelButtonText: i18n.global.t('general.cancel') + i18n.global.t('utils.request.invalidToken') + + `

` + + i18n.global.t('utils.request.errorCode') + + ` 401 ` + + i18n.global.t('utils.request.errorMessage') + + `: ${error}

`, + i18n.global.t('utils.request.identityInfo'), + { + dangerouslyUseHTMLString: true, + distinguishCancelAndClose: true, + confirmButtonText: i18n.global.t('utils.request.loginAgain'), + cancelButtonText: i18n.global.t('general.cancel') + } + ).then(() => { + const userStore = useUserStore() + userStore.ClearStorage() + router.push({ name: 'Login', replace: true }) }) - .then(() => { - const userStore = useUserStore() - userStore.ClearStorage() - router.push({ name: 'Login', replace: true }) - }) break } diff --git a/web/src/utils/stringFun.js b/web/src/utils/stringFun.js index eac417911..baec83db1 100644 --- a/web/src/utils/stringFun.js +++ b/web/src/utils/stringFun.js @@ -1,29 +1,29 @@ /* eslint-disable */ export const toUpperCase = (str) => { - if (str[0]) { - return str.replace(str[0], str[0].toUpperCase()) - } else { - return '' - } + if (str[0]) { + return str.replace(str[0], str[0].toUpperCase()) + } else { + return '' + } } export const toLowerCase = (str) => { - if (str[0]) { - return str.replace(str[0], str[0].toLowerCase()) - } else { - return '' - } + if (str[0]) { + return str.replace(str[0], str[0].toLowerCase()) + } else { + return '' + } } // 驼峰转换下划线 export const toSQLLine = (str) => { - if (str === 'ID') return 'ID' - return str.replace(/([A-Z])/g, "_$1").toLowerCase(); + if (str === 'ID') return 'ID' + return str.replace(/([A-Z])/g, '_$1').toLowerCase() } // 下划线转换驼峰 export const toHump = (name) => { - return name.replace(/\_(\w)/g, function(all, letter) { - return letter.toUpperCase(); - }); -} \ No newline at end of file + return name.replace(/\_(\w)/g, function (all, letter) { + return letter.toUpperCase() + }) +} diff --git a/web/src/view/about/index.vue b/web/src/view/about/index.vue index 1daf5065e..d03fb3246 100644 --- a/web/src/view/about/index.vue +++ b/web/src/view/about/index.vue @@ -8,16 +8,13 @@
- + gin-vue-admin + /> @@ -28,7 +25,7 @@ class="dom-center" src="https://img.shields.io/github/watchers/flipped-aurora/gin-vue-admin.svg?label=Watch" alt="" - > + /> @@ -37,7 +34,7 @@ class="dom-center" src="https://img.shields.io/github/stars/flipped-aurora/gin-vue-admin.svg?style=social" alt="" - > + /> @@ -46,7 +43,7 @@ class="dom-center" src="https://img.shields.io/github/forks/flipped-aurora/gin-vue-admin.svg?label=Fork" alt="" - > + /> @@ -58,34 +55,27 @@
- + flipped-aurora + /> -
-
+ @@ -100,7 +90,7 @@
- + Load more @@ -127,76 +112,74 @@ diff --git a/web/src/view/dashboard/components/banner.vue b/web/src/view/dashboard/components/banner.vue index 0141f5c5f..226dda997 100644 --- a/web/src/view/dashboard/components/banner.vue +++ b/web/src/view/dashboard/components/banner.vue @@ -5,36 +5,39 @@ - + diff --git a/web/src/view/dashboard/components/card.vue b/web/src/view/dashboard/components/card.vue index bcd904a4c..ee170dd5f 100644 --- a/web/src/view/dashboard/components/card.vue +++ b/web/src/view/dashboard/components/card.vue @@ -5,10 +5,8 @@ - + diff --git a/web/src/view/dashboard/components/charts-content-numbers.vue b/web/src/view/dashboard/components/charts-content-numbers.vue index b11564f7c..950b3b416 100644 --- a/web/src/view/dashboard/components/charts-content-numbers.vue +++ b/web/src/view/dashboard/components/charts-content-numbers.vue @@ -10,174 +10,181 @@ - + diff --git a/web/src/view/dashboard/components/charts-people-numbers.vue b/web/src/view/dashboard/components/charts-people-numbers.vue index a7013f20e..3d10b3fab 100644 --- a/web/src/view/dashboard/components/charts-people-numbers.vue +++ b/web/src/view/dashboard/components/charts-people-numbers.vue @@ -11,131 +11,128 @@ - + diff --git a/web/src/view/dashboard/components/charts.vue b/web/src/view/dashboard/components/charts.vue index 3bcf5a9ed..650b5f13f 100644 --- a/web/src/view/dashboard/components/charts.vue +++ b/web/src/view/dashboard/components/charts.vue @@ -11,7 +11,7 @@
-
+
@@ -20,7 +20,7 @@ +80%
-
+
@@ -31,28 +31,24 @@ - + diff --git a/web/src/view/dashboard/components/index.js b/web/src/view/dashboard/components/index.js index 23cc04a76..a59985be7 100644 --- a/web/src/view/dashboard/components/index.js +++ b/web/src/view/dashboard/components/index.js @@ -1,19 +1,19 @@ -import GvaBanner from "./banner.vue" -import GvaCard from "./card.vue" -import GvaChart from "./charts.vue" -import GvaTable from "./table.vue" -import GvaNotice from "./notice.vue" -import GvaQuickLink from "./quickLinks.vue" -import GvaWiki from "./wiki.vue" -import GvaPluginTable from "./pluginTable.vue" +import GvaBanner from './banner.vue' +import GvaCard from './card.vue' +import GvaChart from './charts.vue' +import GvaTable from './table.vue' +import GvaNotice from './notice.vue' +import GvaQuickLink from './quickLinks.vue' +import GvaWiki from './wiki.vue' +import GvaPluginTable from './pluginTable.vue' export { - GvaBanner, - GvaCard, - GvaChart, - GvaTable, - GvaNotice, - GvaQuickLink, - GvaWiki, - GvaPluginTable + GvaBanner, + GvaCard, + GvaChart, + GvaTable, + GvaNotice, + GvaQuickLink, + GvaWiki, + GvaPluginTable } diff --git a/web/src/view/dashboard/components/notice.vue b/web/src/view/dashboard/components/notice.vue index f0f0d4e59..e7f36bfe3 100644 --- a/web/src/view/dashboard/components/notice.vue +++ b/web/src/view/dashboard/components/notice.vue @@ -5,7 +5,11 @@ - + diff --git a/web/src/view/dashboard/components/pluginTable.vue b/web/src/view/dashboard/components/pluginTable.vue index c6a1e580b..e22a18322 100644 --- a/web/src/view/dashboard/components/pluginTable.vue +++ b/web/src/view/dashboard/components/pluginTable.vue @@ -6,62 +6,82 @@ - + diff --git a/web/src/view/dashboard/components/quickLinks.vue b/web/src/view/dashboard/components/quickLinks.vue index 6dda3519e..1598267bd 100644 --- a/web/src/view/dashboard/components/quickLinks.vue +++ b/web/src/view/dashboard/components/quickLinks.vue @@ -5,21 +5,35 @@ - + diff --git a/web/src/view/dashboard/components/table.vue b/web/src/view/dashboard/components/table.vue index bf504e2b1..304db0014 100644 --- a/web/src/view/dashboard/components/table.vue +++ b/web/src/view/dashboard/components/table.vue @@ -6,53 +6,68 @@ - + diff --git a/web/src/view/dashboard/components/wiki.vue b/web/src/view/dashboard/components/wiki.vue index b98c49ccd..35a86ebc8 100644 --- a/web/src/view/dashboard/components/wiki.vue +++ b/web/src/view/dashboard/components/wiki.vue @@ -5,40 +5,44 @@ - + diff --git a/web/src/view/dashboard/index.vue b/web/src/view/dashboard/index.vue index 5efe294ab..8a83c89c7 100644 --- a/web/src/view/dashboard/index.vue +++ b/web/src/view/dashboard/index.vue @@ -1,5 +1,7 @@ - + diff --git a/web/src/view/error/index.vue b/web/src/view/error/index.vue index 5b593f4da..34c88d19e 100644 --- a/web/src/view/error/index.vue +++ b/web/src/view/error/index.vue @@ -2,10 +2,18 @@
- +

{{ t('error.message1') }}

{{ t('error.message2') }}

-

{{ t('error.projectAddress') }}https://github.com/flipped-aurora/gin-vue-admin

+

+ {{ t('error.projectAddress') + }}https://github.com/flipped-aurora/gin-vue-admin +

{{ t('error.backToHome') }}
@@ -13,19 +21,19 @@ diff --git a/web/src/view/error/reload.vue b/web/src/view/error/reload.vue index 2504c55f0..1fd027e66 100644 --- a/web/src/view/error/reload.vue +++ b/web/src/view/error/reload.vue @@ -3,12 +3,12 @@ diff --git a/web/src/view/example/breakpoint/breakpoint.vue b/web/src/view/example/breakpoint/breakpoint.vue index d5d4564e2..364b107ee 100644 --- a/web/src/view/example/breakpoint/breakpoint.vue +++ b/web/src/view/example/breakpoint/breakpoint.vue @@ -1,15 +1,11 @@ - diff --git a/web/src/view/example/customer/customer.vue b/web/src/view/example/customer/customer.vue index 3ccc9ad17..953165b79 100644 --- a/web/src/view/example/customer/customer.vue +++ b/web/src/view/example/customer/customer.vue @@ -3,11 +3,9 @@
- {{ t('general.add') }} + {{ + t('general.add') + }}
- + {{ t('general.change') }} + >{{ t('general.change') }} {{ t('general.delete') }} + >{{ t('general.delete') }} @@ -89,30 +86,21 @@
{{ t('view.example.customer.client') }}
- {{ t('general.cancel') }} - {{ t('general.confirm') }} + {{ + t('general.cancel') + }} + {{ + t('general.confirm') + }}
- + - + - + @@ -120,119 +108,121 @@ diff --git a/web/src/view/example/index.vue b/web/src/view/example/index.vue index 8b322d621..0c3b58dde 100644 --- a/web/src/view/example/index.vue +++ b/web/src/view/example/index.vue @@ -1,10 +1,7 @@ diff --git a/web/src/view/example/upload/upload.vue b/web/src/view/example/upload/upload.vue index 26b0a6efe..981aa249f 100644 --- a/web/src/view/example/upload/upload.vue +++ b/web/src/view/example/upload/upload.vue @@ -1,25 +1,16 @@ @@ -102,13 +86,15 @@ type="primary" link @click="downloadFile(scope.row)" - >{{ t('view.example.upload.download') }} + >{{ t('view.example.upload.download') }} {{ t('general.delete') }} + >{{ t('general.delete') }} @@ -129,179 +115,203 @@ diff --git a/web/src/view/init/index.vue b/web/src/view/init/index.vue index 2c18cbec7..49768e6d9 100644 --- a/web/src/view/init/index.vue +++ b/web/src/view/init/index.vue @@ -1,59 +1,76 @@ diff --git a/web/src/view/layout/aside/asideComponent/asyncSubmenu.vue b/web/src/view/layout/aside/asideComponent/asyncSubmenu.vue index 678683fa5..b9c4bf4b8 100644 --- a/web/src/view/layout/aside/asideComponent/asyncSubmenu.vue +++ b/web/src/view/layout/aside/asideComponent/asyncSubmenu.vue @@ -7,9 +7,9 @@ diff --git a/web/src/view/layout/aside/asideComponent/index.vue b/web/src/view/layout/aside/asideComponent/index.vue index 8558655ab..32e7d4186 100644 --- a/web/src/view/layout/aside/asideComponent/index.vue +++ b/web/src/view/layout/aside/asideComponent/index.vue @@ -4,7 +4,7 @@ v-if="!routerInfo.hidden" :router-info="routerInfo" > - - - + diff --git a/web/src/view/layout/aside/combinationMode.vue b/web/src/view/layout/aside/combinationMode.vue index f8a934188..22c6c38df 100644 --- a/web/src/view/layout/aside/combinationMode.vue +++ b/web/src/view/layout/aside/combinationMode.vue @@ -1,12 +1,15 @@ -

{{ t('view.api.newAddedRouteNote1') }} {{ t('view.api.newAddedRouteNote2') }} +

+ {{ t('view.api.newAddedRouteNote1') }} + {{ + t('view.api.newAddedRouteNote2') + }} @@ -227,8 +195,8 @@

- diff --git a/web/src/view/superAdmin/menu/menu.vue b/web/src/view/superAdmin/menu/menu.vue index 91abd943c..418f1b01c 100644 --- a/web/src/view/superAdmin/menu/menu.vue +++ b/web/src/view/superAdmin/menu/menu.vue @@ -2,26 +2,14 @@
- - {{ t('view.superAdmin.menu.addRootMenu') }} + + {{ t('view.superAdmin.menu.addRootMenu') }}
- - + + @@ -140,10 +129,7 @@ {{ t('general.close') }} - + {{ t('general.confirm') }}
@@ -165,13 +151,18 @@ :label="t('view.superAdmin.menu.filePath')" prop="component" > - - {{ t('view.superAdmin.menu.subMenuNote') }} + + {{ + t('view.superAdmin.menu.subMenuNote') + }} - {{ t('view.superAdmin.menu.clickMe') }} + {{ t('view.superAdmin.menu.clickMe') }} @@ -203,16 +194,15 @@ - + @@ -225,31 +215,21 @@ - + - - + + - + - + - - + + - + @@ -459,7 +390,7 @@ icon="delete" @click="deleteParameter(form.parameters, scope.$index)" > - {{ t('general.delete') }} + {{ t('general.delete') }}
@@ -467,12 +398,8 @@
- - {{ t('view.superAdmin.menu.addButton') }} + + {{ t('view.superAdmin.menu.addButton') }}
- + - {{ t('general.delete') }} + {{ t('general.delete') }}
@@ -532,155 +456,114 @@ diff --git a/web/src/view/superAdmin/operation/sysOperationRecord.vue b/web/src/view/superAdmin/operation/sysOperationRecord.vue index b504b8d60..3600b5cc5 100644 --- a/web/src/view/superAdmin/operation/sysOperationRecord.vue +++ b/web/src/view/superAdmin/operation/sysOperationRecord.vue @@ -1,38 +1,38 @@ @@ -139,10 +140,12 @@
{{ fmtBody(scope.row.resp) }}
- {{ t('view.operation.sysOperationRecord.none') }} + {{ + t('view.operation.sysOperationRecord.none') + }}
@@ -152,20 +155,20 @@ :label="t('general.createdAt')" width="180" > - + - + @@ -185,147 +188,146 @@ diff --git a/web/src/view/superAdmin/params/sysParams.vue b/web/src/view/superAdmin/params/sysParams.vue index 5a98f2eb6..ff82541e3 100644 --- a/web/src/view/superAdmin/params/sysParams.vue +++ b/web/src/view/superAdmin/params/sysParams.vue @@ -1,29 +1,55 @@ - - + diff --git a/web/src/view/superAdmin/user/user.vue b/web/src/view/superAdmin/user/user.vue index d50aaecee..4799f7212 100644 --- a/web/src/view/superAdmin/user/user.vue +++ b/web/src/view/superAdmin/user/user.vue @@ -2,47 +2,36 @@
- {{ t('view.superAdmin.user.addUser') }} + {{ + t('view.superAdmin.user.addUser') + }}
- + - + @@ -104,7 +80,7 @@ /> @@ -131,7 +122,11 @@ inline-prompt :active-value="1" :inactive-value="2" - @change="()=>{switchEnable(scope.row)}" + @change=" + () => { + switchEnable(scope.row) + } + " /> @@ -147,19 +142,22 @@ link icon="delete" @click="deleteUserFunc(scope.row)" - >{{ t('general.delete') }} + >{{ t('general.delete') }} {{ t('general.edit') }} + >{{ t('general.edit') }} {{ t('view.superAdmin.user.resetPassword') }} + >{{ t('view.superAdmin.user.resetPassword') }} @@ -186,11 +184,12 @@
{{ t('view.superAdmin.user.user') }}
- {{ t('general.close') }} - {{ t('general.confirm') }} + {{ + t('general.close') + }} + {{ + t('general.confirm') + }}
@@ -221,16 +220,10 @@ > - + - + - + - + @@ -271,318 +266,343 @@ diff --git a/web/src/view/system/state.vue b/web/src/view/system/state.vue index 4b428333d..e54eeb93e 100644 --- a/web/src/view/system/state.vue +++ b/web/src/view/system/state.vue @@ -1,52 +1,31 @@
- MountPoint - + {{ item.mountPoint }} total (MB) - + {{ item.totalMb }} used (MB) - + {{ item.usedMb }} total (GB) - + {{ item.totalGb }} used (GB) - + {{ item.usedGb }} @@ -117,10 +80,7 @@ - + physical number of cores: - + {{ state.cpu.cores }} core {{ index }}: - + + +
- + @@ -168,31 +122,21 @@ total (MB) - + {{ state.ram.totalMb }} used (MB) - + {{ state.ram.usedMb }} total (GB) - + {{ state.ram.totalMb / 1024 }} used (GB) - + {{ + (state.ram.usedMb / 1024).toFixed(2) + }} @@ -209,43 +153,40 @@
- diff --git a/web/src/view/systemTools/autoCode/component/fieldDialog.vue b/web/src/view/systemTools/autoCode/component/fieldDialog.vue index 7720305c3..89db0e526 100644 --- a/web/src/view/systemTools/autoCode/component/fieldDialog.vue +++ b/web/src/view/systemTools/autoCode/component/fieldDialog.vue @@ -16,50 +16,37 @@ - - {{ t('view.systemTools.autoCode.fieldDialog.autoFill') }} + + {{ + t('view.systemTools.autoCode.fieldDialog.autoFill') + }} - + - + - + - + @@ -82,23 +71,30 @@ - + @@ -145,7 +147,7 @@ @@ -158,13 +160,19 @@ /> - + - + - + @@ -173,16 +181,27 @@ - + - + - - + + - + @@ -192,35 +211,37 @@ name="1" > - +
{{ item.aliasName }} - {{ item.dbName }} + {{ + item.dbName + }}
- + - + - - - {{ item.isPrimary ? t('view.systemTools.autoCode.primaryKey') : t('view.systemTools.autoCode.nonPrimaryKey') }} - {{ item.columnName }} + + + + {{ + item.isPrimary + ? t('view.systemTools.autoCode.primaryKey') + : t('view.systemTools.autoCode.nonPrimaryKey') + }} + + {{ item.columnName }} - {{ t('view.systemTools.autoCode.fieldDialog.type') }}{{ item.type }} {{ t('view.systemTools.autoCode.fieldDialog.fileDesc') }}{{ item.comment }} + {{ t('view.systemTools.autoCode.fieldDialog.type') + }}{{ item.type }} + {{ t('view.systemTools.autoCode.fieldDialog.fileDesc') + }}{{ item.comment }} - + - - - {{ item.isPrimary ? t('view.systemTools.autoCode.primaryKey') : t('view.systemTools.autoCode.nonPrimaryKey') }} - {{ item.columnName }} - + + + {{ + item.isPrimary + ? t('view.systemTools.autoCode.primaryKey') + : t('view.systemTools.autoCode.nonPrimaryKey') + }} + + {{ item.columnName }} - {{ t('view.systemTools.autoCode.fieldDialog.type') }}{{ item.type }} {{ t('view.systemTools.autoCode.fieldDialog.fileDesc') }}{{ item.comment }} + + {{ t('view.systemTools.autoCode.fieldDialog.type') + }}{{ item.type }} + {{ t('view.systemTools.autoCode.fieldDialog.fileDesc') + }}{{ item.comment }} @@ -298,203 +373,231 @@ diff --git a/web/src/view/systemTools/autoCode/component/previewCodeDialog.vue b/web/src/view/systemTools/autoCode/component/previewCodeDialog.vue index cb03178b9..3343fd580 100644 --- a/web/src/view/systemTools/autoCode/component/previewCodeDialog.vue +++ b/web/src/view/systemTools/autoCode/component/previewCodeDialog.vue @@ -1,119 +1,122 @@ diff --git a/web/src/view/systemTools/autoCode/index.vue b/web/src/view/systemTools/autoCode/index.vue index 186adfa25..31cccc40d 100644 --- a/web/src/view/systemTools/autoCode/index.vue +++ b/web/src/view/systemTools/autoCode/index.vue @@ -1,19 +1,21 @@