Commit 1126bdc6 authored by jiangqiuyu's avatar jiangqiuyu

Merge branch 'main' of https://gitlab.33.cn/guxukai/baas3-fe

Conflicts: src/shared/models/TODO.md
parents 9cc5962d d0e1fab4
......@@ -4,6 +4,7 @@ node_modules
src/assets/font/font.*
tailwind.css
auto-imports.d.ts
components.d.ts
# local env files
.env.local
.env.*.local
......
......@@ -142,6 +142,7 @@
│   │   │   └── lookup //开发参考 开发模式下会在左侧菜单显示
│   │   │   └── icons
│   │   │   └── index.vue
│   │   ├── plugins //第三方插件
│   │   ├── router //路由相关
│   │   │   ├── constants.ts
│   │   │   ├── index.ts
......
......@@ -73,7 +73,6 @@
"svg-sprite-loader": "^6.0.11",
"typescript": "^4.5.4",
"typescript-json-serializer": "^3.4.4",
"unplugin-auto-import": "^0.5.5",
"unplugin-vue-components": "^0.17.11",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-shell-plugin-next": "^2.2.2"
......
- [x] [登录注册入口](./entry)
- [x] [登录注册入口](./index)
- [ ] [个人控制台](./account)
- [ ] [联盟控制台](./federation)
- [ ] [企业控制台](./organization)
......
......@@ -7,7 +7,7 @@
"name": "home",
"meta": {
"element": "home/index.vue",
"title": "home",
"title": "首页",
"level": 1,
"icon": "homepage",
"showInAsideMenu": true
......@@ -16,7 +16,6 @@
{
"path": "notice",
"name": "notice",
"element": "home/index.vue",
"meta": {
"element": "home/index.vue",
"title": "站内信",
......@@ -27,7 +26,6 @@
{
"path": "announce-list",
"name": "announce-list",
"element": "home/index.vue",
"meta": {
"element": "home/index.vue",
"title": "公告列表",
......@@ -43,51 +41,52 @@
{
"path": "alliance-chain",
"name": "alliance-chain",
"element": "home/index.vue",
"meta": { "title": "联盟链","level": 2,"showInAsideMenu": true }
"meta": { "title": "联盟链","level": 2,"showInAsideMenu": true,
"element": "home/index.vue"
}
},
{
"path": "parallel-chain",
"name": "parallel-chain",
"element": "home/index.vue",
"meta": { "title": "平行链","level": 2,"showInAsideMenu": true }
"meta": { "title": "平行链","level": 2,"showInAsideMenu": true, "element": "home/index.vue"
}
},
{
"path": "chain-log",
"name": "chain-log",
"element": "home/index.vue",
"meta": { "title": "链日志","level": 2,"showInAsideMenu": true }
"meta": { "title": "链日志","level": 2,"showInAsideMenu": true , "element": "home/index.vue"
}
},
{
"path": "address-management",
"name": "address-management",
"element": "home/index.vue",
"meta": { "title": "地址管理","level": 2,"showInAsideMenu": true }
"meta": { "title": "地址管理","level": 2,"showInAsideMenu": true , "element": "home/index.vue"
}
},
{
"path": "key-management",
"name": "key-management",
"element": "home/index.vue",
"meta": { "title": "密钥管理", "level": 2,"showInAsideMenu": true }
"meta": { "title": "密钥管理", "level": 2,"showInAsideMenu": true , "element": "home/index.vue"
}
}
]
},
{
"path": "openapi",
"name": "openapi",
"meta": { "title": "OpenApi", "icon": "app" },
"meta": { "title": "OpenApi", "icon": "app","level": 1, "showInAsideMenu": true },
"children": [
{
"path": "app-management",
"name": "app-management",
"element": "home/index.vue",
"meta": { "title": "授权管理", "level": 2,"showInAsideMenu": true }
"meta": { "title": "授权管理", "level": 2,"showInAsideMenu": true, "element": "home/index.vue"
}
},
{
"path": "app-openapi",
"name": "app-openapi",
"element": "home/index.vue",
"meta": { "title": "接口文档", "level": 2,"showInAsideMenu": true }
"meta": { "title": "接口文档", "level": 2,"showInAsideMenu": true, "element": "home/index.vue"
}
}
]
}
......
import { createApp } from 'vue'
import App from './App.vue'
import { router } from './router'
import { store } from '@shared/store'
import { createMockServer } from '@shared/mock'
import 'tailwindcss/tailwind.css'
import ElementPlus from 'element-plus'
import Components from '@shared/components/global/index'
import '@shared/assets/sass/index.scss'
import '@assets/icons'
import '@assets/font/font.css'
import '@assets/css/tailwind.css'
createMockServer()
const app = createApp(App)
app.use(store).use(router).use(ElementPlus).use(Components).mount('#app')
import { app } from '@shared/main'
app.use(router).mount('#app')
<template>
<el-config-provider :locale="zhCn">
<router-view />
</el-config-provider>
</template>
<script setup>
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import { useSplash } from '@shared/hooks/useSplash'
useSplash()
</script>
<style></style>
<template>
<el-config-provider :locale="zhCn">
<router-view />
</el-config-provider>
</template>
<script setup>
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import { useSplash } from '@shared/hooks/useSplash'
useSplash()
</script>
<style></style>
......@@ -5,56 +5,259 @@
{
"path": "",
"name": "home",
"meta": {
"meta": { "title": "首页", "code": "auth.federation.home",
"icon": "homepage",
"element": "home/index.vue",
"title": "home",
"level": 1,
"icon": "401",
"showInAsideMenu": true
}
},
{
"path": "admin",
"name": "admin",
"meta": {
"title": "管理员",
"path": "notice",
"name": "notice",
"meta": { "title": "站内信",
"element": "home/index.vue",
"level": 1,
"showInAsideMenu": false
}
},
{
"path": "announce-list",
"name": "announce-list",
"meta": { "title": "公告列表",
"element": "home/index.vue",
"level": 1,
"showInAsideMenu": false
}
},
{
"path": "alert-group",
"name": "alert-group",
"meta": { "title": "设置告警组",
"element": "home/index.vue",
"level": 1,
"showInAsideMenu": false
}
},
{
"path": "alert-rule",
"name": "alert-rule",
"meta": { "title": "告警规则设置",
"element": "home/index.vue",
"level": 1,
"showInAsideMenu": false
}
},
{
"path": "notice-rule",
"name": "notice-rule",
"meta": { "title": "通知规则设置",
"element": "home/index.vue",
"level": 1,
"showInAsideMenu": false
}
},
{
"path": "warning-info/:type",
"name": "warning-info",
"meta": { "title": "告警信息",
"element": "home/index.vue",
"level": 1,
"showInAsideMenu": false
}
},
{
"path": "chain",
"name": "chain",
"meta": { "title": "链管理", "icon": "chain", "code": "auth.federation.chain",
"level": 1,
"icon": "401",
"showInAsideMenu": true
},
"children": [
{
"path": "",
"name": "admin-list",
"meta": {
"element": "admin/index.vue",
"title": "列表",
"path": "alliance-chain",
"name": "alliance-chain",
"meta": { "title": "联盟链", "code": "auth.federation.chain.info",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": true
}
},
{
"path": "alliance-member",
"name": "alliance-member",
"meta": { "title": "联盟成员", "code": "auth.federation.chain.member",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": true
}
},
{
"path": "contract-details",
"name": "contract-details",
"meta": { "title": "合约详情", "code": "auth.federation.chain.contract",
"element": "home/index.vue",
"level": 2,
"icon": "401",
"showInAsideMenu": true
}
},
{
"path": "create",
"name": "admin-create",
"path": "chain-log",
"name": "chain-log",
"meta": { "title": "链日志", "code": "auth.federation.chain.log",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": true
}
},
{
"path": "create-chain/:chain_type",
"name": "create-chain",
"meta": {
"title": "链创建",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": false
}
},
{
"path": "import-chain/:chain_type",
"name": "import-chain",
"meta": {
"element": "admin/create.vue",
"title": "新建",
"title": "链导入",
"element": "home/index.vue",
"level": 2,
"icon": "401",
"showInAsideMenu": false
}
},
{
"path": "edit/:id",
"name": "admin-edit",
"path": "add-node/:chain_type",
"name": "add-node",
"meta": {
"element": "admin/edit.vue",
"title": "编辑",
"title": "添加节点",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": false
}
}
]
},
{
"path": "application",
"name": "application",
"meta": { "title": "应用管理", "icon": "app", "code": "auth.federation.application",
"level": 1,
"showInAsideMenu": true
},
"children": [
{
"path": "chain-app",
"name": "chain-app",
"meta": { "title": "链应用", "code": "auth.federation.application.chain",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": true
}
},
{
"path": "app-detail",
"name": "app-detail",
"meta": { "title": "应用详情",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": false
}
}
]
},
{
"path": "cost",
"name": "cost",
"meta": { "title": "订单", "icon": "cost", "code": "auth.federation.order",
"element": "home/index.vue",
"level": 1,
"showInAsideMenu": true
},
"redirect": "/cost/order-management",
"children": [
{
"path": "order-management",
"name": "order-management",
"meta": { "title": "订单管理",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": false
}
},
{
"path": "order-detail/:id",
"name": "order-detail",
"meta": { "title": "订单详情",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": false
}
},
{
"path": "pay-order/:id",
"name": "pay-order",
"meta": { "title": "订单支付",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": false
}
},
{
"path": "pay-money/:id",
"name": "pay-money",
"meta": { "title": "付款",
"element": "home/index.vue",
"level": 2,
"icon": "401",
"showInAsideMenu": false
}
},
{
"path": "pay-success/:id",
"name": "pay-success",
"meta": { "title": "支付成功",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": false
}
}
]
},
{
"path": "settings",
"name": "settings",
"meta": { "title": "设置", "icon": "settings", "code": "auth.federation.setting",
"element": "home/index.vue",
"level": 1,
"showInAsideMenu": true
},
"children": [
{
"path": "user-management",
"name": "user-management",
"meta": { "title": "用户管理", "code": "auth.federation.setting.user",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": true
}
},
{
"path": "role-permissions",
"name": "role-permissions",
"meta": { "title": "角色权限", "code": "auth.federation.setting.role",
"element": "home/index.vue",
"level": 2,
"showInAsideMenu": true
}
}
]
}
......
import { createApp } from 'vue'
import App from './App.vue'
import { router } from './router'
import { store } from '@shared/store'
import { createMockServer } from '@shared/mock'
import 'tailwindcss/tailwind.css'
import ElementPlus from 'element-plus'
import Components from '@shared/components/global/index'
import '@shared/assets/sass/index.scss'
import '@assets/icons'
import '@assets/font/font.css'
import '@assets/css/tailwind.css'
createMockServer()
const app = createApp(App)
app.use(store).use(router).use(ElementPlus).use(Components).mount('#app')
import { app } from '@shared/main'
app.use(router).mount('#app')
import { router } from './router'
import { app } from '@shared/main'
app.use(router).mount('#app')
import { createRouter, createWebHistory } from 'vue-router'
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import { SYSTEM_ROUTES } from '@shared/router/constants'
const FIXED_ROUTES = [
const FIXED_ROUTES: RouteRecordRaw[] = [
{
path: '/login',
path: '',
name: 'login',
component: () => import('@entry/views/fixed/login/index.vue'),
alias: '/login',
component: () => import('@index/views/fixed/login/index.vue'),
},
{
path: '/proxy',
name: 'proxy',
component: () => import('@entry/views/fixed/proxy/index.vue'),
component: () => import('@index/views/fixed/proxy/index.vue'),
},
{
path: '/retrieve',
name: 'retrieve',
component: () => import('@entry/views/fixed/retrieve/index.vue'),
component: () => import('@index/views/fixed/retrieve/index.vue'),
},
{
path: '/register',
name: 'register',
component: () => import('@entry/views/fixed/register/index.vue'),
component: () => import('@index/views/fixed/register/index.vue'),
},
]
const routes = [...FIXED_ROUTES, ...SYSTEM_ROUTES]
export const router = createRouter({
history: createWebHistory('/entry'),
history: createWebHistory('/'),
routes,
})
<template>
<el-config-provider :locale="zhCn">
<router-view />
</el-config-provider>
</template>
<script setup>
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import { useSplash } from '@shared/hooks/useSplash'
useSplash()
</script>
<style></style>
This diff is collapsed.
import { createApp } from 'vue'
import App from './App.vue'
import { router } from './router'
import { store } from '@shared/store'
import { createMockServer } from '@shared/mock'
import 'tailwindcss/tailwind.css'
import ElementPlus from 'element-plus'
import Components from '@shared/components/global/index'
import '@shared/assets/sass/index.scss'
import '@assets/icons'
import '@assets/font/font.css'
import '@assets/css/tailwind.css'
createMockServer()
const app = createApp(App)
app.use(store).use(router).use(ElementPlus).use(Components).mount('#app')
import { app } from '@shared/main'
app.use(router).mount('#app')
<template>
<el-config-provider :locale="zhCn">
<router-view />
</el-config-provider>
</template>
<script setup>
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import { useSplash } from '@shared/hooks/useSplash'
useSplash()
</script>
<style></style>
import { createApp } from 'vue'
import App from './App.vue'
import { router } from './router'
import { store } from '@shared/store'
import { createMockServer } from '@shared/mock'
import 'tailwindcss/tailwind.css'
import ElementPlus from 'element-plus'
import Components from '@shared/components/global/index'
import '@shared/assets/sass/index.scss'
import '@assets/icons'
import '@assets/font/font.css'
import '@assets/css/tailwind.css'
createMockServer()
const app = createApp(App)
app.use(store).use(router).use(ElementPlus).use(Components).mount('#app')
import { app } from '@shared/main'
app.use(router).mount('#app')
<template>
<el-config-provider :locale="zhCn">
<router-view />
</el-config-provider>
</template>
<script setup>
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import { useSplash } from '@shared/hooks/useSplash'
useSplash()
</script>
<style></style>
This diff is collapsed.
import { createApp } from 'vue'
import App from './App.vue'
import { router } from './router'
import { store } from '@shared/store'
import { createMockServer } from '@shared/mock'
import 'tailwindcss/tailwind.css'
import ElementPlus from 'element-plus'
import Components from '@shared/components/global/index'
import '@shared/assets/sass/index.scss'
import '@assets/icons'
import '@assets/font/font.css'
import '@assets/css/tailwind.css'
createMockServer()
const app = createApp(App)
app.use(store).use(router).use(ElementPlus).use(Components).mount('#app')
import { app } from '@shared/main'
app.use(router).mount('#app')
<template>
<el-config-provider :locale="zhCn">
<el-config-provider :locale="currentLocale">
<router-view />
</el-config-provider>
</template>
<script setup>
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import { useSplash } from '@shared/hooks/useSplash'
import { useLocale } from '@shared/hooks/useLocale'
useSplash()
const { currentLocale } = useLocale()
</script>
<style></style>
......@@ -4,9 +4,11 @@
<!--
* 使用:
* 1.组件模版中使用
* [<g-svg name="icon"></g-svg>]
* [<g-icon name="icon"></g-icon>]
* 注意:
* 1.name 为 element-plus svg组件名称(必填)
* 查询:
* 1.https://element-plus.gitee.io/zh-CN/component/icon.html#icon-collection
-->
<script lang="ts">
import { defineComponent } from 'vue'
......
import upperFirst from 'lodash/upperFirst'
import camelCase from 'lodash/camelCase'
import { App } from '@vue/runtime-core'
const path = require('path')
export default {
install: function (app: App) {
const globalComponents = require.context('./', true, /\.(vue|js)$/iu)
globalComponents.keys().forEach(filePath => {
const component = globalComponents(filePath)
let name = path.resolve(filePath, '..')
name = upperFirst(
camelCase(
name
.split('/')
.pop()
.replace(/\.\w+$/u, ''),
),
)
app.component(`G${name}`, component.default || component)
})
},
}
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import en from 'element-plus/lib/locale/lang/en'
import { computed } from 'vue'
import { useLayout } from '@shared/store/modules/layout'
export const useLocale = () => {
const layoutStore = useLayout()
const currentLocale = computed(() => {
return layoutStore.currentLocale === 'zh' ? zhCn : en
})
return {
currentLocale,
}
}
......@@ -10,11 +10,11 @@ const formatFile = (params?: AxiosRequestConfig) => {
if (params?.data) {
if (isPlainObject(params.data)) {
if (Object.values(params.data).some(_ => _ instanceof File)) {
const formatData = new FormData()
const formData = new FormData()
for (const [k, v] of params.data) {
formatData.append(k, v)
formData.append(k, v)
}
params.data = formatData
params.data = formData
}
}
}
......
......@@ -2,14 +2,14 @@
<el-sub-menu :index="menu.name" v-if="menuList?.length">
<template #title>
<i :class="`font-${menu.meta.icon}`" class="mr-6 text-xl cursor-pointer" />
<span>{{ menu.meta.title }}</span>
<span>{{ $t(`baas.menu.${menu.name}`) }}</span>
</template>
<aside-menu-item v-for="item in menuList" :key="item.name" :menu="item" />
</el-sub-menu>
<el-menu-item :index="menu.name" @click="handleClickMenu()" v-else>
<i :class="`font-${menu.meta.icon}`" class="mr-6 text-xl cursor-pointer" />
<template #title>
<span>{{ menu.meta.title }}</span>
<span>{{ $t(`baas.menu.${menu.name}`) }}</span>
</template>
</el-menu-item>
</template>
......
<template>
<g-query-wrapper :data="menuData" :loading="menuLoading" :error="menuError" :run="menuRun">
<aside-menu-item
v-for="menu in $router.options.routes
.find(_ => _.name === 'default')
.children.filter(_ => _.meta.showInAsideMenu)"
:key="menu.name"
:menu="menu"
/>
<el-menu
:default-active="currentActiveRoute"
:background-color="themeFlag === 'light' ? 'transparent' : isCollapse ? '#151930' : '#1f2a37'"
:text-color="themeFlag === 'light' ? '#374151' : '#ffffff'"
:active-text-color="themeFlag === 'light' ? '#047857' : '#6EE7B7'"
:collapse="isCollapse"
:default-openeds="['home']"
class="border-none"
>
<aside-menu-item
v-for="menu in $router.options.routes
.find(_ => _.name === 'default')
.children.filter(_ => _.meta.showInAsideMenu)"
:key="menu.name"
:menu="menu"
/>
</el-menu>
</g-query-wrapper>
</template>
<script lang="ts">
......@@ -23,16 +33,25 @@ import { useRequest } from 'vue-request'
import { AuthMenuInfo } from '@shared/models/auth-service/AuthMenuInfo'
import { GATEWAY_CODE } from '@shared/http/constants'
import { filterAsyncRoutes, hasPermission } from '@shared/utils/route-utils'
import { computed } from 'vue'
const props = defineProps({
enableRouteFilter: {
type: Boolean,
default: false,
},
themeFlag: {
type: String,
},
isCollapse: {
type: Boolean,
default: false,
},
})
const $router = useRouter()
const $route = useRoute()
const userStore = useUser()
const authStore = useAuth()
const currentActiveRoute = computed(() => $route.name as string)
const {
data: menuData,
loading: menuLoading,
......
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="globalization" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"><path d="M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z" fill="currentColor"></path><path d="M267.84 342.92a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z" fill="currentColor"></path></svg>
\ No newline at end of file
......@@ -29,17 +29,7 @@
:class="[isCollapse ? 'bg-[#151930]' : 'bg-[#1f2a37]']"
style="height: 1px"
></div>
<el-menu
:default-active="currentActiveRoute"
:background-color="themeFlag === 'light' ? 'transparent' : isCollapse ? '#151930' : '#1f2a37'"
:text-color="themeFlag === 'light' ? '#374151' : '#ffffff'"
:active-text-color="themeFlag === 'light' ? '#047857' : '#6EE7B7'"
:collapse="isCollapse"
:default-openeds="['home']"
class="border-none"
>
<aside-menu-list :enable-route-filter="enableRouteFilter" />
</el-menu>
<aside-menu-list :enable-route-filter="enableRouteFilter" :theme-flag="themeFlag" :is-collapse="isCollapse" />
</div>
</div>
</el-aside>
......@@ -70,6 +60,24 @@
@click="fullScreen"
class="mr-6 text-xl cursor-pointer"
/>
<el-dropdown trigger="click">
<img src="./components/globalization.svg" class="mr-6" />
<template #dropdown>
<el-dropdown-menu class="translation">
<el-dropdown-item
v-for="item in localeList"
:key="item.key"
@click="handleChangeLocale(item.key)"
:style="{
background: locale === item.key ? '#1b2a47' : '',
color: locale === item.key ? '#f4f4f5' : '#000',
}"
><el-icon v-show="locale === item.key"> <g-icon name="Check" /> </el-icon
>{{ item.value }}</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-badge type="danger" :value="12" class="mr-12">
<g-icon name="Bell" class="w-[1em] h-[1em] text-xl cursor-pointer" />
......@@ -89,12 +97,8 @@
class="flex flex-col pb-0 bg-gray-50 dark:bg-[#151930] dark:text-white transition transition-all duration-300"
>
<el-breadcrumb :separator-icon="ArrowRight" class="pl-1">
<el-breadcrumb-item
v-for="(item, index) in layoutStore.$state.breadcrumbList"
:key="index"
:to="{ path: item.path }"
>
<span class="text-gray-700 dark:text-white">{{ item.title }}</span>
<el-breadcrumb-item v-for="(item, index) in breadcrumbList" :key="index" :to="{ name: item.name }">
<span class="text-gray-700 dark:text-white">{{ $t(`baas.menu.${item.name}`) }}</span>
</el-breadcrumb-item>
</el-breadcrumb>
<div class="flex-grow mt-4 h-full overflow-y-auto rounded-t-md border">
......@@ -117,17 +121,30 @@ import { MessageUtils } from '../utils/message-utils'
import { useAuth } from '@shared/store/modules/auth'
import { useLayout } from '@shared/store/modules/layout'
import ConsoleMenu from './components/console-menu/index.vue'
import { LocaleType } from '@shared/types/layout'
import { useI18n } from 'vue-i18n'
const props = defineProps({
enableRouteFilter: {
type: Boolean,
default: false,
},
})
const { locale } = useI18n()
const layoutStore = useLayout()
const PROJECT_NAME = process.env.APP_NAME
const $route = useRoute()
const $router = useRouter()
const currentActiveRoute = computed(() => $route.name as string)
const breadcrumbList = computed(() => layoutStore.breadcrumbList)
const localeList: { key: LocaleType; value: string }[] = [
{
key: 'zh',
value: '简体中文',
},
{
key: 'en',
value: 'English',
},
]
onMounted(() => {
setTheme(false)
})
......@@ -147,6 +164,8 @@ onBeforeRouteUpdate((to, from) => {
if (to.meta.level === val.level) {
val.title = to.meta.title!
val.path = to.path
val.name = to.name as string
val.level = to.meta.level
}
return val
})
......@@ -161,6 +180,7 @@ onBeforeRouteUpdate((to, from) => {
title: to.meta.title!,
path: to.path,
level: to.meta.level,
name: to.name as string,
})
}
layoutStore.$patch({
......@@ -227,10 +247,17 @@ const {
const handleLogout = () => {
logoutRun().then(res => {
if (res?.code === GATEWAY_CODE.success) {
window.location.replace(window.location.origin + '/entry/login')
window.location.replace(window.location.origin + '/login')
} else {
MessageUtils.warning(res?.message)
}
})
}
//切换语言
const handleChangeLocale = (l: LocaleType) => {
layoutStore.$patch({
currentLocale: l,
})
locale.value = l
}
</script>
import { createApp } from 'vue'
import App from './App.vue'
import { router } from './router'
import App from '@shared/App.vue'
import { store } from '@shared/store'
import { createMockServer } from '@shared/mock'
import 'tailwindcss/tailwind.css'
import ElementPlus from 'element-plus'
import Components from '@shared/components/global/index'
import '@shared/assets/sass/index.scss'
import '@assets/icons'
import '@assets/font/font.css'
import '@assets/css/tailwind.css'
import { i18n } from '@shared/plugins/i18n'
createMockServer()
const app = createApp(App)
app.use(store).use(router).use(ElementPlus).use(Components).mount('#app')
export const app = createApp(App)
app.use(store).use(ElementPlus).use(i18n)
- [x] app-service - jqy
- [x] auth-service - zk
- [x] chain-service - zk
- [ ] cloud-service - zk
- [x] cloud-service - zk
- [x] commodity-service - gxk
- [x] common-service - gxk
- [x] gateway - gxk
......@@ -10,5 +10,5 @@
- [x] monitor-service - gxk
- [x] order-service - jqy
- [x] pay-service - jqy
- [ ] user-service - zk
- [x] user-service - zk
- [x] website-service - jqy
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserAreaCity extends Model<UserAreaCity> {
/**
* 获取城市
* @param payload
*/
static async get(payload: UserAreaCityGetReq) {
return await api.get<HttpResponse>('/services/user-service/area/city', { params: payload })
}
}
@Serializable()
export class UserAreaCityGetReq extends Model<UserAreaCityGetReq> {
@JsonProperty() provinceCode: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserAreaCounty extends Model<UserAreaCounty> {
/**
* 根据城市获取区名称
* @param payload
*/
static async get(payload: UserAreaCountyGetReq) {
return await api.get<HttpResponse>('/services/user-service/area/county', { params: payload })
}
}
@Serializable()
export class UserAreaCountyGetReq extends Model<UserAreaCountyGetReq> {
@JsonProperty() cityCode: string
}
import { Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserAreaProvince extends Model<UserAreaProvince> {
/**
* 获取省份
*/
static async get() {
return await api.get<HttpResponse>('/services/user-service/area/province')
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederation extends Model<UserFederation> {
/**
* 创建联盟
* @param payload
*/
static async post(payload: UserFederationPostReq) {
return await api.post<HttpResponse>('/services/user-service/federation', { data: payload })
}
}
@Serializable()
export class UserFederationPostReq extends Model<UserFederationPostReq> {
@JsonProperty() name: string
@JsonProperty() remark: string
@JsonProperty() orgId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationAccountPage extends Model<UserFederationAccountPage> {
/**
* 联盟账户
* @param payload
*/
static async post(payload: UserFederationAccountPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/federation/account/page', { data: payload })
}
}
@Serializable()
export class UserFederationAccountPagePostReq extends Model<UserFederationAccountPagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationChainNames extends Model<UserFederationChainNames> {
/**
* 获取链名称信息
* @param payload
*/
static async get(payload: UserFederationChainNamesGetReq) {
return await api.get<HttpResponse>('/services/user-service/federation/chain/names', { params: payload })
}
}
@Serializable()
export class UserFederationChainNamesGetReq extends Model<UserFederationChainNamesGetReq> {
@JsonProperty() chainType: string
@JsonProperty() fedId: string
@JsonProperty() orgId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationFedId extends Model<UserFederationFedId> {
/**
* 删除联盟
* @param payload
*/
static async delete(payload: UserFederationFedIdDeleteReq) {
return await api.delete<HttpResponse>(`/services/user-service/federation/${payload.fedId}`, { params: payload })
}
}
@Serializable()
export class UserFederationFedIdDeleteReq extends Model<UserFederationFedIdDeleteReq> {
@JsonProperty() fedId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationInviteCode extends Model<UserFederationInviteCode> {
/**
* 生成邀请码
* @param payload
*/
static async get(payload: UserFederationInviteCodeGetReq) {
return await api.get<HttpResponse>('/services/user-service/federation/invite-code', { params: payload })
}
}
@Serializable()
export class UserFederationInviteCodeGetReq extends Model<UserFederationInviteCodeGetReq> {
@JsonProperty() fedId: string
@JsonProperty() orgName: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationJoinPage extends Model<UserFederationJoinPage> {
/**
* 分页查看加入联盟列表
* @param payload
*/
static async post(payload: UserFederationJoinPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/federation/join/page', { data: payload })
}
}
@Serializable()
export class UserFederationJoinPagePostReq extends Model<UserFederationJoinPagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationOrg extends Model<UserFederationOrg> {
/**
* 邀请联盟成员-成员搜索
* @param payload
*/
static async get(payload: UserFederationOrgGetReq) {
return await api.get<HttpResponse>('/services/user-service/federation/org', { params: payload })
}
}
@Serializable()
export class UserFederationOrgGetReq extends Model<UserFederationOrgGetReq> {
@JsonProperty() fedId: string
@JsonProperty() orgName: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationOrganization extends Model<UserFederationOrganization> {
/**
* 企业加入联盟
* @param payload
*/
static async get(payload: UserFederationOrganizationGetReq) {
return await api.get<HttpResponse>('/services/user-service/federation/organization', { params: payload })
}
/**
* 企业退出联盟
* @param payload
*/
static async put(payload: UserFederationOrganizationPutReq) {
return await api.put<HttpResponse>('/services/user-service/federation/organization', { data: payload })
}
}
@Serializable()
export class UserFederationOrganizationGetReq extends Model<UserFederationOrganizationGetReq> {
@JsonProperty() code: string
@JsonProperty() orgId: string
}
@Serializable()
export class UserFederationOrganizationPutReq extends Model<UserFederationOrganizationPutReq> {
@JsonProperty() fedId: string
@JsonProperty() fedName: string
@JsonProperty() orgId: string
@JsonProperty() orgName: string
@JsonProperty() tag: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationOrganizationOrgId extends Model<UserFederationOrganizationOrgId> {
/**
* 根据企业ID获取企业所在联盟信息
* @param payload
*/
static async get(payload: UserFederationOrganizationOrgIdGetReq) {
return await api.get<HttpResponse>(`/services/user-service/federation/organization/${payload.orgId}`, {
params: payload,
})
}
}
@Serializable()
export class UserFederationOrganizationOrgIdGetReq extends Model<UserFederationOrganizationOrgIdGetReq> {
@JsonProperty() orgId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationOrganizationPage extends Model<UserFederationOrganizationPage> {
/**
* 分页查看联盟成员列表
* @param payload
*/
static async post(payload: UserFederationOrganizationPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/federation/organization/page', { data: payload })
}
}
@Serializable()
export class UserFederationOrganizationPagePostReq extends Model<UserFederationOrganizationPagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserFederationPage extends Model<UserFederationPage> {
/**
* 分页查看创建联盟列表
* @param payload
*/
static async post(payload: UserFederationPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/federation/page', { data: payload })
}
}
@Serializable()
export class UserFederationPagePostReq extends Model<UserFederationPagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganization extends Model<UserOrganization> {
/**
* 创建企业
* @param payload
*/
static async post(payload: UserOrganizationPostReq) {
return await api.post<HttpResponse>('/services/user-service/organization', { data: payload })
}
/**
* 企业信息更新
* @param payload
*/
static async put(payload: UserOrganizationPutReq) {
return await api.put<HttpResponse>('/services/user-service/organization', { data: payload })
}
}
@Serializable()
export class UserOrganizationPostReq extends Model<UserOrganizationPostReq> {
@JsonProperty() addressList: string[]
@JsonProperty() certs: string[]
@JsonProperty() orgAddress: string
@JsonProperty() orgId: string
@JsonProperty() orgName: string
@JsonProperty() orgType: string
@JsonProperty() remark: string
@JsonProperty() status: string
}
@Serializable()
export class UserOrganizationPutReq extends UserOrganizationPostReq {}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationAccountPage extends Model<UserOrganizationAccountPage> {
/**
* 分页查看企业账户列表
* @param payload
*/
static async post(payload: UserOrganizationAccountPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/account/page', { data: payload })
}
}
@Serializable()
export class UserOrganizationAccountPagePostReq extends Model<UserOrganizationAccountPagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationApprovePage extends Model<UserOrganizationApprovePage> {
/**
* 分页查看审批记录列表
* @param payload
*/
static async post(payload: UserOrganizationApprovePagePostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/approve/page', { data: payload })
}
}
@Serializable()
export class UserOrganizationApprovePagePostReq extends Model<UserOrganizationApprovePagePostReq> {
@JsonProperty() objectId: string
@JsonProperty() orgName: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
@JsonProperty() param: string
@JsonProperty() status: number
@JsonProperty() userId: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationApprovedOrgName extends Model<UserOrganizationApprovedOrgName> {
/**
* 模糊搜索审批通过的企业
* @param payload
*/
static async get(payload: UserOrganizationApprovedOrgNameGetReq) {
return await api.get<HttpResponse>(`/services/user-service/organization/approved/${payload.orgName}`, {
params: payload,
})
}
}
@Serializable()
export class UserOrganizationApprovedOrgNameGetReq extends Model<UserOrganizationApprovedOrgNameGetReq> {
@JsonProperty() orgName: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationCert extends Model<UserOrganizationCert> {
/**
* 企业资质审批
* @param payload
*/
static async post(payload: UserOrganizationCertPostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/cert', { data: payload })
}
}
@Serializable()
export class UserOrganizationCertPostReq extends Model<UserOrganizationCertPostReq> {
@JsonProperty() addressList: string[]
@JsonProperty() certs: string[]
@JsonProperty() orgAddress: string
@JsonProperty() orgId: string
@JsonProperty() orgName: string
@JsonProperty() orgType: string
@JsonProperty() remark: string
@JsonProperty() status: string
}
import { Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationCertCount extends Model<UserOrganizationCertCount> {
/**
* 统计待审批企业数量
*/
static async get() {
return await api.get<HttpResponse>('/services/user-service/organization/cert/count')
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationCertImage extends Model<UserOrganizationCertImage> {
/**
* 异步查看企业营业执照图片
* @param payload
*/
static async get(payload: UserOrganizationCertImageGetReq) {
return await api.get<HttpResponse>('/services/user-service/organization/cert/image', { params: payload })
}
}
@Serializable()
export class UserOrganizationCertImageGetReq extends Model<UserOrganizationCertImageGetReq> {
@JsonProperty() imageNum: number
@JsonProperty() orgId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationCertPage extends Model<UserOrganizationCertPage> {
/**
* 分页查询待审批企业列表
* @param payload
*/
static async post(payload: UserOrganizationCertPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/cert/page', { data: payload })
}
}
@Serializable()
export class UserOrganizationCertPagePostReq extends Model<UserOrganizationCertPagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationCertRecord extends Model<UserOrganizationCertRecord> {
/**
* 查看企业提交记录
* @param payload
*/
static async get(payload: UserOrganizationCertRecordGetReq) {
return await api.get<HttpResponse>('/services/user-service/organization/cert/record', { params: payload })
}
}
@Serializable()
export class UserOrganizationCertRecordGetReq extends Model<UserOrganizationCertRecordGetReq> {
@JsonProperty() orgId: string
@JsonProperty() tag: string
@JsonProperty() userId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationClose extends Model<UserOrganizationClose> {
/**
* 注销企业之前查询企业状态
*/
static async get() {
return await api.get<HttpResponse>('/services/user-service/organization/close')
}
/**
* 撤销-注销企业申请
* @param payload
*/
static async post(payload: UserOrganizationClosePostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/close', { data: payload })
}
}
@Serializable()
export class UserOrganizationClosePostReq extends Model<UserOrganizationClosePostReq> {
@JsonProperty() addressList: string[]
@JsonProperty() certs: string[]
@JsonProperty() orgAddress: string
@JsonProperty() orgId: string
@JsonProperty() orgName: string
@JsonProperty() orgType: string
@JsonProperty() remark: string
@JsonProperty() status: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationCloseApprove extends Model<UserOrganizationCloseApprove> {
/**
* 注销企业审批之前查询企业状态
* @param payload
*/
static async get(payload: UserOrganizationCloseApproveGetReq) {
return await api.get<HttpResponse>('/services/user-service/organization/close/approve', { params: payload })
}
/**
* 注销企业审批
* @param payload
*/
static async post(payload: UserOrganizationCloseApprovePostReq) {
return await api.post('/services/user-service/organization/close/approve', { data: payload })
}
}
@Serializable()
export class UserOrganizationCloseApproveGetReq extends Model<UserOrganizationCloseApproveGetReq> {
@JsonProperty() orgId: string
}
@Serializable()
export class UserOrganizationCloseApprovePostReq extends Model<UserOrganizationCloseApprovePostReq> {
@JsonProperty() addressList: string[]
@JsonProperty() certs: string[]
@JsonProperty() orgAddress: string
@JsonProperty() orgId: string
@JsonProperty() orgName: string
@JsonProperty() orgType: string
@JsonProperty() remark: string
@JsonProperty() status: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationExistOrgName extends Model<UserOrganizationExistOrgName> {
/**
* 校验企业名称
* @param payload
*/
static async get(payload: UserOrganizationExistOrgNameGetReq) {
return await api.get<HttpResponse>(`/services/user-service/organization/exist/${payload.orgName}`, {
params: payload,
})
}
}
@Serializable()
export class UserOrganizationExistOrgNameGetReq extends Model<UserOrganizationExistOrgNameGetReq> {
@JsonProperty() orgName: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationFederationFedId extends Model<UserOrganizationFederationFedId> {
/**
* 获取某联盟下的企业信息
* @param payload
*/
static async get(payload: UserOrganizationFederationFedIdGetReq) {
return await api.get<HttpResponse>(`/services/user-service/organization/federation/${payload.fedId}`, {
params: payload,
})
}
}
@Serializable()
export class UserOrganizationFederationFedIdGetReq extends Model<UserOrganizationFederationFedIdGetReq> {
@JsonProperty() fedId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationJoinCount extends Model<UserOrganizationJoinCount> {
/**
* 根据企业对象id统计用户加入企业待审批数量
* @param payload
*/
static async get(payload: UserOrganizationJoinCountGetReq) {
return await api.get<HttpResponse>('/services/user-service/organization/join/count', { params: payload })
}
}
@Serializable()
export class UserOrganizationJoinCountGetReq extends Model<UserOrganizationJoinCountGetReq> {
@JsonProperty() objectId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationOrgId extends Model<UserOrganizationOrgId> {
static async get(payload: UserOrganizationOrgIdGetReq) {
return await api.get<HttpResponse>(`/services/user-service/organization/${payload.orgId}`, { params: payload })
}
}
@Serializable()
export class UserOrganizationOrgIdGetReq extends Model<UserOrganizationOrgIdGetReq> {
@JsonProperty() orgId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationPage extends Model<UserOrganizationPage> {
/**
* 分页查看用户创建企业列表
* @param payload
*/
static async post(payload: UserOrganizationPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/page', { data: payload })
}
}
@Serializable()
export class UserOrganizationPagePostReq extends Model<UserOrganizationPagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationRevocation extends Model<UserOrganizationRevocation> {
/**
* 撤销 加入企业-创建企业 申请
* @param payload
*/
static async put(payload: UserOrganizationRevocationPutReq) {
return await api.put<HttpResponse>('/services/user-service/organization/revocation', { data: payload })
}
}
@Serializable()
export class UserOrganizationRevocationPutReq extends Model<UserOrganizationRevocationPutReq> {
@JsonProperty() createTime: number
@JsonProperty() note: string
@JsonProperty() orgId: string
@JsonProperty() orgName: string
@JsonProperty() phoneNum: string
@JsonProperty() remark: string
@JsonProperty() status: number
@JsonProperty() tag: string
@JsonProperty() uname: string
@JsonProperty() userId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationUser extends Model<UserOrganizationUser> {
/**
* 添加企业用户
* @param payload
*/
static async post(payload: UserOrganizationUserPostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/user', { data: payload })
}
/**
* 变更企业用户状态
* @param payload
*/
static async put(payload: UserOrganizationUserPutReq) {
return await api.put<HttpResponse>('/services/user-service/organization/user', { data: payload })
}
}
@Serializable()
export class UserOrganizationUserPostReq extends Model<UserOrganizationUserPostReq> {
@JsonProperty() createTime: number
@JsonProperty() note: string
@JsonProperty() orgId: string
@JsonProperty() orgName: string
@JsonProperty() phoneNum: string
@JsonProperty() remark: string
@JsonProperty() status: number
@JsonProperty() tag: string
@JsonProperty() uname: string
@JsonProperty() userId: string
}
@Serializable()
export class UserOrganizationUserPutReq extends UserOrganizationUserPostReq {}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationUserApprovePage extends Model<UserOrganizationUserApprovePage> {
/**
* 分页查看用户加入企业待审批列表
* @param payload
*/
static async post(payload: UserOrganizationUserApprovePagePostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/user/approve/page', { data: payload })
}
}
@Serializable()
export class UserOrganizationUserApprovePagePostReq extends Model<UserOrganizationUserApprovePagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationUserOrgId extends Model<UserOrganizationUserOrgId> {
/**
* 删除企业用户
* @param payload
*/
static async delete(payload: UserOrganizationUserOrgIdDeleteReq) {
return await api.delete<HttpResponse>(`/services/user-service/organization/user/${payload.orgId}`, {
params: payload,
})
}
}
@Serializable()
export class UserOrganizationUserOrgIdDeleteReq extends Model<UserOrganizationUserOrgIdDeleteReq> {
@JsonProperty() orgId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationUserPage extends Model<UserOrganizationUserPage> {
/**
* 分页查看企业用户列表
* @param payload
*/
static async post(payload: UserOrganizationUserPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/organization/user/page', { data: payload })
}
}
@Serializable()
export class UserOrganizationUserPagePostReq extends Model<UserOrganizationUserPagePostReq> {
@JsonProperty() objectId: string
@JsonProperty() orgName: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
@JsonProperty() param: string
@JsonProperty() status: number
@JsonProperty() userId: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserOrganizationUserUid extends Model<UserOrganizationUserUid> {
/**
* 根据用户ID获取企业信息
* @param payload
*/
static async get(payload: UserOrganizationUserUidGetReq) {
return await api.get<HttpResponse>(`/services/user-service/organization/user/${payload.uid}`, { params: payload })
}
}
@Serializable()
export class UserOrganizationUserUidGetReq extends Model<UserOrganizationUserUidGetReq> {
@JsonProperty() uid: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserRegisterStatus extends Model<UserRegisterStatus> {
/**
* 获取注册功能状态
*/
static async get() {
return await api.get<HttpResponse>('/services/user-service/register/status')
}
/**
* 修改注册功能状态
* @param payload
*/
static async post(payload: UserRegisterStatusPostReq) {
return await api.post<HttpResponse>('/services/user-service/register/status', { data: payload })
}
}
@Serializable()
export class UserRegisterStatusPostReq extends Model<UserRegisterStatusPostReq> {
@JsonProperty() objectId: string
@JsonProperty() orgName: string
@JsonProperty() param: string
@JsonProperty() roleIdList: number[]
@JsonProperty() status: string
@JsonProperty() sysType: number
@JsonProperty() userId: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUser extends Model<UserUser> {
/**
* (超管)新增用户
* @param payload
*/
static async post(payload: UserUserPostReq) {
return await api.post<HttpResponse>('/services/user-service/user', { data: payload })
}
/**
* 修改个人信息
* @param payload
*/
static async put(payload: UserUserPutReq) {
return await api.put<HttpResponse>('/services/user-service/user', { data: payload })
}
}
@Serializable()
export class UserUserPostReq extends Model<UserUserPostReq> {
@JsonProperty() image: string
@JsonProperty() mail: string
@JsonProperty() newMail: string
@JsonProperty() password: string
@JsonProperty() phoneNum: string
@JsonProperty() phoneNumNew: string
@JsonProperty() uname: string
@JsonProperty() verificode: string
}
@Serializable()
export class UserUserPutReq extends Model<UserUserPutReq> {
@JsonProperty() image: string
@JsonProperty() mail: string
@JsonProperty() newMail: string
@JsonProperty() password: string
@JsonProperty() phoneNum: string
@JsonProperty() phoneNumNew: string
@JsonProperty() uname: string
@JsonProperty() verificode: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserAccountPage extends Model<UserUserAccountPage> {
/**
* 个人账户
* @param payload
*/
static async post(payload: UserUserAccountPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/user/account/page', { data: payload })
}
}
@Serializable()
export class UserUserAccountPagePostReq extends Model<UserUserAccountPagePostReq> {
@JsonProperty() loginUser: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
//TODO 分页enum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserCodeValidate extends Model<UserUserCodeValidate> {
/**
* 验证码验证
* @param payload
*/
static async post(payload: UserUserCodeValidatePostReq) {
return await api.post<HttpResponse>('/services/user-service/user/code-validate', { data: payload })
}
}
@Serializable()
export class UserUserCodeValidatePostReq extends Model<UserUserCodeValidatePostReq> {
@JsonProperty() code: string
@JsonProperty() target: string
@JsonProperty() type: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserInvite extends Model<UserUserInvite> {
/**
* (企业、联盟)添加用户
* @param payload
*/
static async put(payload: UserUserInvitePutReq) {
return await api.put<HttpResponse>('/services/user-service/user/invite', { data: payload })
}
}
@Serializable()
export class UserUserInvitePutReq extends Model<UserUserInvitePutReq> {
@JsonProperty() newUserId: number
@JsonProperty() objectId: string
@JsonProperty() orgName: string
@JsonProperty() param: string
@JsonProperty() roleIdList: number[]
@JsonProperty() status: string
@JsonProperty() sysType: number
@JsonProperty() userId: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserPage extends Model<UserUserPage> {
/**
* 分页查看平台注册用户信息列表
* @param payload
*/
static async post(payload: UserUserPagePostReq) {
return await api.post<HttpResponse>('/services/user-service/user/page', { data: payload })
}
}
@Serializable()
export class UserUserPagePostReq extends Model<UserUserPagePostReq> {
@JsonProperty() objectId: string
@JsonProperty() orgName: string
@JsonProperty() pageIndex: number
@JsonProperty() pageSize: number
@JsonProperty() param: string
@JsonProperty() status: number
@JsonProperty() userId: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserRecharge extends Model<UserUserRecharge> {
/**
* 管理员给用户充值
* @param payload
*/
static async get(payload: UserUserRechargeGetReq) {
return await api.get<HttpResponse>('/services/user-service/user/recharge', { params: payload })
}
}
@Serializable()
export class UserUserRechargeGetReq extends Model<UserUserRechargeGetReq> {
@JsonProperty() amount: string
@JsonProperty() userId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserRole extends Model<UserUserRole> {
/**
* 变更角色(联盟、企业)
* @param payload
*/
static async put(payload: UserUserRolePutReq) {
return await api.put<HttpResponse>('/services/user-service/user/role', { data: payload })
}
}
@Serializable()
export class UserUserRolePutReq extends Model<UserUserRolePutReq> {
@JsonProperty() newUserId: number
@JsonProperty() objectId: string
@JsonProperty() orgName: string
@JsonProperty() param: string
@JsonProperty() roleIdList: number[]
@JsonProperty() status: string
@JsonProperty() sysType: number
@JsonProperty() userId: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserRoleSystem extends Model<UserUserRoleSystem> {
/**
* 变更角色(超管)之前查询变更角色列表
* @param payload
*/
static async get(payload: UserUserRoleSystemGetReq) {
return await api.get<HttpResponse>('/services/user-service/user/role/system', { params: payload })
}
}
@Serializable()
export class UserUserRoleSystemGetReq extends Model<UserUserRoleSystemGetReq> {
@JsonProperty() userId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserStatus extends Model<UserUserStatus> {
/**
* 用户启禁用
* @param payload
*/
static async put(payload: UserUserStatusPutReq) {
return await api.put<HttpResponse>('/services/user-service/user/status', { data: payload })
}
}
@Serializable()
export class UserUserStatusPutReq extends Model<UserUserStatusPutReq> {
@JsonProperty() newUserId: number
@JsonProperty() objectId: string
@JsonProperty() orgName: string
@JsonProperty() param: string
@JsonProperty() roleIdList: number[]
@JsonProperty() status: string
@JsonProperty() sysType: number
@JsonProperty() userId: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserTransfer extends Model<UserUserTransfer> {
/**
* 转让所有权
* @param payload
*/
static async put(payload: UserUserTransferPutReq) {
return await api.put<HttpResponse>('/services/user-service/user/transfer', { data: payload })
}
}
@Serializable()
export class UserUserTransferPutReq extends Model<UserUserTransferPutReq> {
@JsonProperty() newUserId: number
@JsonProperty() objectId: string
@JsonProperty() orgName: string
@JsonProperty() param: string
@JsonProperty() roleIdList: number[]
@JsonProperty() status: string
@JsonProperty() sysType: number
@JsonProperty() userId: number
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserTransferUsers extends Model<UserUserTransferUsers> {
/**
* 转让所有权之前查询用户列表
* @param payload
*/
static async get(payload: UserUserTransferUsersGetReq) {
return await api.get<HttpResponse>('/services/user-service/user/transfer/users', { params: payload })
}
}
@Serializable()
export class UserUserTransferUsersGetReq extends Model<UserUserTransferUsersGetReq> {
@JsonProperty() objectId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUserUserIdObjectId extends Model<UserUserUserIdObjectId> {
/**
* 移除用户
* @param payload
*/
static async delete(payload: UserUserUserIdObjectIdDeleteReq) {
return await api.delete<HttpResponse>(`/services/user-service/user/${payload.userId}/${payload.objectId}`, {
params: payload,
})
}
}
@Serializable()
export class UserUserUserIdObjectIdDeleteReq extends Model<UserUserUserIdObjectIdDeleteReq> {
@JsonProperty() objectId: string
@JsonProperty() userId: string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class UserUsers extends Model<UserUsers> {
/**
* 批量导入用户
* @param payload
*/
static async post(payload: UserUsersPostReq) {
return await api.post<HttpResponse>('/services/user-service/users', { data: payload })
}
}
@Serializable()
export class UserUsersPostReq extends Model<UserUsersPostReq> {
@JsonProperty() multipartFile: string
}
<template>
<div>{{ $t('baas.menu.announce-list') }}</div>
</template>
<script lang="ts" setup></script>
// 按钮配置
export const buttonConfig = {
zh: {
baas: {},
},
en: {
baas: {},
},
}
type ButtonConfigItem = {
baas: {
button: {}
}
}
// 导航菜单配置
export const menusConfig: {
zh: MenusConfigItem
en: MenusConfigItem
} = {
zh: {
baas: {
menu: {
lookup: '开发参考',
icons: '图标库',
i18n: '国际化',
home: '首页',
chain: '链管理',
'announce-list': '公告列表',
notice: '站内信',
'alliance-chain': '联盟链',
'parallel-chain': '平行链',
'chain-log': '链日志',
'address-management': '地址管理',
'key-management': '密钥管理',
openapi: 'OpenApi',
'app-management': '授权管理',
'app-openapi': '接口文档',
},
},
},
en: {
baas: {
menu: {
lookup: 'lookup',
icons: 'icons',
i18n: 'i18n',
home: 'home',
chain: 'chain',
'announce-list': 'announce list',
notice: 'notice',
'alliance-chain': 'alliance chain',
'parallel-chain': 'parallel chain',
'chain-log': 'chain log',
'address-management': 'address management',
'key-management': 'key management',
openapi: 'openapi',
'app-management': 'app management',
'app-openapi': 'app openapi',
},
},
},
}
type MenusConfigItem = {
baas: {
menu: {
lookup: string
icons: string
i18n: string
home: string
notice: string
'announce-list': string
chain: string
'alliance-chain': string
'parallel-chain': string
'chain-log': string
'address-management': string
'key-management': string
openapi: string
'app-management': string
'app-openapi': string
}
}
}
//https://vuelidate-next.netlify.app/advanced_usage.html#i18n-support
import { createI18n } from 'vue-i18n'
// element-plus国际化
import enLocale from 'element-plus/lib/locale/lang/en'
import zhLocale from 'element-plus/lib/locale/lang/zh-cn'
import { menusConfig } from '@shared/plugins/i18n/config/menu-config'
import { buttonConfig } from '@shared/plugins/i18n/config/button-config'
const localesList = [menusConfig, buttonConfig]
export const i18n = createI18n({
locale: 'zh', // set locale
locale: sessionStorage.getItem('layout')
? JSON.parse(sessionStorage.getItem('layout') as string).currentLocale
: 'zh', // set locale
fallbackLocale: 'zh', // set fallback locale
messages: {
zh: {
validations: {
required: '参数不能为空.',
},
baas: Object.assign({}, ...localesList.map(v => v.zh.baas)),
...zhLocale,
},
en: {
baas: Object.assign({}, ...localesList.map(v => v.en.baas)),
...enLocale,
},
},
silentTranslationWarn: true,
})
......@@ -34,7 +34,16 @@ export const LOOKUP_ROUTES =
title: '图标库',
showInAsideMenu: true,
level: 2,
icon: '401',
},
},
{
path: '/i18n',
name: 'i18n',
component: () => import('@shared/pages/lookup/i18n/index.vue'),
meta: {
title: '国际化',
showInAsideMenu: true,
level: 2,
},
},
],
......
......@@ -37,7 +37,7 @@ export const zookeeper = (router: Router): void => {
if (isInWhiteList) {
next()
} else {
window.location.replace(window.location.origin + '/entry/login')
window.location.replace(window.location.origin + '/login')
}
}
})
......
......@@ -9,13 +9,15 @@ export const useLayout = defineStore('layout', {
title: 'Home',
level: 1,
path: '/',
name: 'home',
},
],
currentLocale: 'zh',
}),
persist: {
key: 'layout',
storage: window.sessionStorage,
paths: ['breadcrumbList'],
paths: ['breadcrumbList', 'currentLocale'],
overwrite: true,
},
})
......
export type LayoutType = {
breadcrumbList: BreadcrumbType[]
currentLocale: LocaleType
}
export type LocaleType = 'zh' | 'en'
export type BreadcrumbType = {
title: string
level: number
path: string
name: string
}
import * as validators from '@vuelidate/validators'
import { i18n } from '@shared/utils/i18n-utils'
// or import { createI18nMessage } from '@vuelidate/validators'
const { createI18nMessage } = validators
// extract the `t` helper, should work for both Vue 2 and Vue 3 versions of vue-i18n
const { t } = i18n.global || i18n
// pass `t` and create your i18n message instance
const withI18nMessage = createI18nMessage({ t })
// wrap each validator.
export const required = withI18nMessage(validators.required)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment