10 changed files with 347 additions and 121 deletions
@ -0,0 +1,10 @@ |
|||
import { i18n } from '@/platform/plugin'; |
|||
|
|||
const i18nFormater = (value) => { |
|||
if (value) { |
|||
return i18n.global.t(value); |
|||
} |
|||
return i18n.global.t(value); |
|||
}; |
|||
|
|||
export { i18nFormater }; |
@ -0,0 +1,24 @@ |
|||
import { Tools } from '@/platform/utils'; |
|||
|
|||
class ReplaceFormater { |
|||
#token; |
|||
#replacer; |
|||
|
|||
constructor(token: string, replacer: string) { |
|||
this.#token = token; |
|||
this.#replacer = replacer; |
|||
} |
|||
|
|||
public formater() { |
|||
const token = this.#token; |
|||
const replacer = this.#replacer; |
|||
return (value) => { |
|||
if (Tools.isUndefinedOrNull(value)) { |
|||
return null; |
|||
} |
|||
return value.replaceAll(token, replacer); |
|||
}; |
|||
} |
|||
} |
|||
|
|||
export { ReplaceFormater }; |
@ -0,0 +1,16 @@ |
|||
const simpleClassNameFormater = (value) => { |
|||
if (value) { |
|||
let result = ''; |
|||
const splits = value.split('.'); |
|||
if (splits) { |
|||
for (let i = 0; i < splits.length - 1; i++) { |
|||
result += splits[i].substring(0, 1) + '.'; |
|||
} |
|||
result += splits[splits.length - 1]; |
|||
return result; |
|||
} |
|||
} |
|||
return ''; |
|||
}; |
|||
|
|||
export { simpleClassNameFormater }; |
@ -0,0 +1,33 @@ |
|||
import { Tools } from '@/platform/utils'; |
|||
|
|||
class SplitFormater { |
|||
#spliter; |
|||
#replacer; |
|||
|
|||
constructor(spliter: string, replacer: string) { |
|||
this.#spliter = spliter; |
|||
this.#replacer = replacer; |
|||
} |
|||
|
|||
public formater() { |
|||
const spliter = this.#spliter; |
|||
const replacer = this.#replacer; |
|||
return (value) => { |
|||
if (Tools.isUndefinedOrNull(value)) { |
|||
return null; |
|||
} |
|||
let result = ''; |
|||
const splits = value.split(spliter); |
|||
if (splits && splits.length > 0) { |
|||
for (let i = 0; i < splits.length - 1; i++) { |
|||
result += splits[i] + replacer; |
|||
} |
|||
result += splits[splits.length - 1]; |
|||
return result; |
|||
} |
|||
return value; |
|||
}; |
|||
} |
|||
} |
|||
|
|||
export { SplitFormater }; |
@ -1,62 +1,120 @@ |
|||
<template> |
|||
<w-grid |
|||
:tree="true" |
|||
:title="$t('system.corporation.grid.title')" |
|||
:data-url="Environment.apiContextPath('/api/system/corporation')" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:pageable="false" |
|||
:full-screen-button="false" |
|||
:tree-icon=" |
|||
(row) => { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} |
|||
" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['refresh', 'separator', ['addTop', 'addChild'], 'edit', 'remove', 'separator', 'view']" |
|||
:columns="[ |
|||
{ width: 100, name: 'name', label: $t('name') }, |
|||
{ width: '100%', name: 'code', label: $t('code') }, |
|||
{ width: 90, name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|||
{ width: 100, name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ width: 110, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() }, |
|||
{ width: 80, name: 'enable', label: $t('status'), format: Formater.enableTag() }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
height: '300px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
|||
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
|||
{ name: 'description', label: $t('description'), type: 'textarea', rows: 1 }, |
|||
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'description', label: $t('description') }, |
|||
{ name: 'enable', label: $t('enable'), format: (value) => value }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: (value) => value }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: (value) => value }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
<div> |
|||
<q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0" no-caps> |
|||
<q-tab name="dispatcherServlets" icon="bi-people" :label="$t('Dispatcher Servlets')" /> |
|||
<q-tab name="servletFilters" icon="bi-diagram-3" :label="$t('Servlet Filters')" /> |
|||
<q-tab name="servlets" icon="bi-diagram-3" :label="$t('Servlets')" /> |
|||
</q-tabs> |
|||
<q-tab-panels v-model="selectedTabRef" animated swipeable keep-alive> |
|||
<q-tab-panel name="dispatcherServlets" class="px-0"> |
|||
<w-grid |
|||
:title="$t('menu.developer.springboot.mapping')" |
|||
:checkbox-selection="false" |
|||
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/dispatcherServletMappingDescriptions')" |
|||
:pageable="false" |
|||
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
|||
:columns="[ |
|||
{ |
|||
width: 100, |
|||
name: 'httpMethods', |
|||
label: $t('httpMethod'), |
|||
}, |
|||
{ |
|||
width: 400, |
|||
name: 'patterns', |
|||
label: $t('pattern'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ |
|||
width: 300, |
|||
name: 'className', |
|||
label: $t('className'), |
|||
format: Formater.simpleClassName(), |
|||
}, |
|||
{ |
|||
width: 200, |
|||
name: 'methodName', |
|||
label: $t('methodName'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'consumes', label: $t('consume'), format: Formater.split() }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'httpMethods', label: $t('httpMethod') }, |
|||
{ name: 'patterns', label: $t('pattern') }, |
|||
{ name: 'className', label: $t('className'), format: Formater.none() }, |
|||
{ name: 'methodName', label: $t('methodName') }, |
|||
{ name: 'methodDescriptor', label: $t('methodDescriptor') }, |
|||
{ name: 'consumes', label: $t('consume'), format: Formater.split() }, |
|||
{ name: 'produces', label: $t('produce'), format: Formater.split() }, |
|||
{ name: 'headers', label: $t('header'), format: Formater.split() }, |
|||
{ name: 'params', label: $t('parameter'), format: Formater.split() }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</q-tab-panel> |
|||
<q-tab-panel name="servletFilters" class="px-0"> |
|||
<w-grid |
|||
:title="$t('menu.developer.springboot.bean')" |
|||
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
|||
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/filterRegistrationMappingDescriptions')" |
|||
:checkbox-selection="false" |
|||
:pageable="true" |
|||
:columns="[ |
|||
{ width: 300, name: 'name', label: $t('name'), sortable: false }, |
|||
{ width: '100%', name: 'urlPatternMappings', label: $t('pattern'), sortable: false }, |
|||
{ width: 400, name: 'className', label: $t('className'), sortable: false, format: Formater.simpleClassName() }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'urlPatternMappings', label: $t('pattern') }, |
|||
{ name: 'className', label: $t('className'), format: Formater.none() }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</q-tab-panel> |
|||
<q-tab-panel name="servlets" class="px-0"> |
|||
<w-grid |
|||
:title="$t('menu.developer.springboot.bean')" |
|||
:checkbox-selection="false" |
|||
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/servletRegistrationMappingDescriptions')" |
|||
:pageable="true" |
|||
:toolbar-actions="['refresh', 'separator', 'view', 'separator', 'export']" |
|||
:columns="[ |
|||
{ width: 300, name: 'name', label: $t('name'), sortable: false }, |
|||
{ width: '100%', name: 'mappings', label: $t('pattern'), sortable: false }, |
|||
{ width: 400, name: 'className', label: $t('className'), sortable: false, format: Formater.simpleClassName() }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'mappings', label: $t('pattern') }, |
|||
{ name: 'className', label: $t('className'), format: Formater.none() }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</q-tab-panel> |
|||
</q-tab-panels> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { Environment, Formater, Options } from '@/platform'; |
|||
import { ref } from 'vue'; |
|||
import { Environment, Formater } from '@/platform'; |
|||
|
|||
const selectedTabRef = ref('dispatcherServlets'); |
|||
</script> |
|||
|
@ -1,62 +1,120 @@ |
|||
<template> |
|||
<w-grid |
|||
:tree="true" |
|||
:title="$t('system.corporation.grid.title')" |
|||
:data-url="Environment.apiContextPath('/api/system/corporation')" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:pageable="false" |
|||
:full-screen-button="false" |
|||
:tree-icon=" |
|||
(row) => { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} |
|||
" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['refresh', 'separator', ['addTop', 'addChild'], 'edit', 'remove', 'separator', 'view']" |
|||
:columns="[ |
|||
{ width: 100, name: 'name', label: $t('name') }, |
|||
{ width: '100%', name: 'code', label: $t('code') }, |
|||
{ width: 90, name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|||
{ width: 100, name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ width: 110, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() }, |
|||
{ width: 80, name: 'enable', label: $t('status'), format: Formater.enableTag() }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
height: '300px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
|||
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
|||
{ name: 'description', label: $t('description'), type: 'textarea', rows: 1 }, |
|||
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'description', label: $t('description') }, |
|||
{ name: 'enable', label: $t('enable'), format: (value) => value }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: (value) => value }, |
|||
{ name: 'creator', label: $t('creator') }, |
|||
{ name: 'createDate', label: $t('createDate') }, |
|||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: (value) => value }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
<div> |
|||
<q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0" no-caps> |
|||
<q-tab name="dispatcherServlets" icon="bi-people" :label="$t('Dispatcher Servlets')" /> |
|||
<q-tab name="servletFilters" icon="bi-diagram-3" :label="$t('Servlet Filters')" /> |
|||
<q-tab name="servlets" icon="bi-diagram-3" :label="$t('Servlets')" /> |
|||
</q-tabs> |
|||
<q-tab-panels v-model="selectedTabRef" animated swipeable keep-alive> |
|||
<q-tab-panel name="dispatcherServlets" class="px-0"> |
|||
<w-grid |
|||
:title="$t('menu.developer.springboot.mapping')" |
|||
:checkbox-selection="false" |
|||
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/dispatcherServletMappingDescriptions')" |
|||
:pageable="false" |
|||
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
|||
:columns="[ |
|||
{ |
|||
width: 100, |
|||
name: 'httpMethods', |
|||
label: $t('httpMethod'), |
|||
}, |
|||
{ |
|||
width: 400, |
|||
name: 'patterns', |
|||
label: $t('pattern'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ |
|||
width: 300, |
|||
name: 'className', |
|||
label: $t('className'), |
|||
format: Formater.simpleClassName(), |
|||
}, |
|||
{ |
|||
width: 200, |
|||
name: 'methodName', |
|||
label: $t('methodName'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'consumes', label: $t('consume'), format: Formater.split() }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'httpMethods', label: $t('httpMethod') }, |
|||
{ name: 'patterns', label: $t('pattern') }, |
|||
{ name: 'className', label: $t('className'), format: Formater.none() }, |
|||
{ name: 'methodName', label: $t('methodName') }, |
|||
{ name: 'methodDescriptor', label: $t('methodDescriptor') }, |
|||
{ name: 'consumes', label: $t('consume'), format: Formater.split() }, |
|||
{ name: 'produces', label: $t('produce'), format: Formater.split() }, |
|||
{ name: 'headers', label: $t('header'), format: Formater.split() }, |
|||
{ name: 'params', label: $t('parameter'), format: Formater.split() }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</q-tab-panel> |
|||
<q-tab-panel name="servletFilters" class="px-0"> |
|||
<w-grid |
|||
:title="$t('menu.developer.springboot.bean')" |
|||
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
|||
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/filterRegistrationMappingDescriptions')" |
|||
:checkbox-selection="false" |
|||
:pageable="true" |
|||
:columns="[ |
|||
{ width: 300, name: 'name', label: $t('name'), sortable: false }, |
|||
{ width: '100%', name: 'urlPatternMappings', label: $t('pattern'), sortable: false }, |
|||
{ width: 400, name: 'className', label: $t('className'), sortable: false, format: Formater.simpleClassName() }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'urlPatternMappings', label: $t('pattern') }, |
|||
{ name: 'className', label: $t('className'), format: Formater.none() }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</q-tab-panel> |
|||
<q-tab-panel name="servlets" class="px-0"> |
|||
<w-grid |
|||
:title="$t('menu.developer.springboot.bean')" |
|||
:checkbox-selection="false" |
|||
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/servletRegistrationMappingDescriptions')" |
|||
:pageable="true" |
|||
:toolbar-actions="['refresh', 'separator', 'view', 'separator', 'export']" |
|||
:columns="[ |
|||
{ width: 300, name: 'name', label: $t('name'), sortable: false }, |
|||
{ width: '100%', name: 'mappings', label: $t('pattern'), sortable: false }, |
|||
{ width: 400, name: 'className', label: $t('className'), sortable: false, format: Formater.simpleClassName() }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'mappings', label: $t('pattern') }, |
|||
{ name: 'className', label: $t('className'), format: Formater.none() }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</q-tab-panel> |
|||
</q-tab-panels> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { Environment, Formater, Options } from '@/platform'; |
|||
import { ref } from 'vue'; |
|||
import { Environment, Formater } from '@/platform'; |
|||
|
|||
const selectedTabRef = ref('dispatcherServlets'); |
|||
</script> |
|||
|
Loading…
Reference in new issue