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> |
<template> |
||||
<w-grid |
<div> |
||||
:tree="true" |
<q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0" no-caps> |
||||
:title="$t('system.corporation.grid.title')" |
<q-tab name="dispatcherServlets" icon="bi-people" :label="$t('Dispatcher Servlets')" /> |
||||
:data-url="Environment.apiContextPath('/api/system/corporation')" |
<q-tab name="servletFilters" icon="bi-diagram-3" :label="$t('Servlet Filters')" /> |
||||
selection="multiple" |
<q-tab name="servlets" icon="bi-diagram-3" :label="$t('Servlets')" /> |
||||
:checkbox-selection="false" |
</q-tabs> |
||||
:pageable="false" |
<q-tab-panels v-model="selectedTabRef" animated swipeable keep-alive> |
||||
:full-screen-button="false" |
<q-tab-panel name="dispatcherServlets" class="px-0"> |
||||
:tree-icon=" |
<w-grid |
||||
(row) => { |
:title="$t('menu.developer.springboot.mapping')" |
||||
return { name: 'folder', color: 'amber' }; |
:checkbox-selection="false" |
||||
} |
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/dispatcherServletMappingDescriptions')" |
||||
" |
:pageable="false" |
||||
:toolbar-configure="{ noIcon: false }" |
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
:toolbar-actions="['refresh', 'separator', ['addTop', 'addChild'], 'edit', 'remove', 'separator', 'view']" |
:columns="[ |
||||
:columns="[ |
{ |
||||
{ width: 100, name: 'name', label: $t('name') }, |
width: 100, |
||||
{ width: '100%', name: 'code', label: $t('code') }, |
name: 'httpMethods', |
||||
{ width: 90, name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
label: $t('httpMethod'), |
||||
{ 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() }, |
width: 400, |
||||
]" |
name: 'patterns', |
||||
:editor="{ |
label: $t('pattern'), |
||||
dialog: { |
format: (value) => { |
||||
width: '600px', |
return value; |
||||
height: '300px', |
}, |
||||
}, |
}, |
||||
form: { |
{ |
||||
colsNum: 1, |
width: 300, |
||||
fields: [ |
name: 'className', |
||||
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
label: $t('className'), |
||||
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
format: Formater.simpleClassName(), |
||||
{ name: 'description', label: $t('description'), type: 'textarea', rows: 1 }, |
}, |
||||
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true }, |
{ |
||||
], |
width: 200, |
||||
}, |
name: 'methodName', |
||||
}" |
label: $t('methodName'), |
||||
:viewer="{ |
format: (value) => { |
||||
panel: { |
return value; |
||||
columnNum: 1, |
}, |
||||
fields: [ |
}, |
||||
{ name: 'id', label: $t('id') }, |
{ name: 'consumes', label: $t('consume'), format: Formater.split() }, |
||||
{ name: 'code', label: $t('code') }, |
]" |
||||
{ name: 'name', label: $t('name') }, |
:viewer="{ |
||||
{ name: 'description', label: $t('description') }, |
panel: { |
||||
{ name: 'enable', label: $t('enable'), format: (value) => value }, |
columnNum: 1, |
||||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: (value) => value }, |
fields: [ |
||||
{ name: 'creator', label: $t('creator') }, |
{ name: 'httpMethods', label: $t('httpMethod') }, |
||||
{ name: 'createDate', label: $t('createDate') }, |
{ name: 'patterns', label: $t('pattern') }, |
||||
{ name: 'lastModifier', label: $t('lastModifier') }, |
{ name: 'className', label: $t('className'), format: Formater.none() }, |
||||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: (value) => value }, |
{ 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() }, |
||||
></w-grid> |
{ 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> |
</template> |
||||
|
|
||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import { Environment, Formater, Options } from '@/platform'; |
import { ref } from 'vue'; |
||||
|
import { Environment, Formater } from '@/platform'; |
||||
|
|
||||
|
const selectedTabRef = ref('dispatcherServlets'); |
||||
</script> |
</script> |
||||
|
@ -1,62 +1,120 @@ |
|||||
<template> |
<template> |
||||
<w-grid |
<div> |
||||
:tree="true" |
<q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0" no-caps> |
||||
:title="$t('system.corporation.grid.title')" |
<q-tab name="dispatcherServlets" icon="bi-people" :label="$t('Dispatcher Servlets')" /> |
||||
:data-url="Environment.apiContextPath('/api/system/corporation')" |
<q-tab name="servletFilters" icon="bi-diagram-3" :label="$t('Servlet Filters')" /> |
||||
selection="multiple" |
<q-tab name="servlets" icon="bi-diagram-3" :label="$t('Servlets')" /> |
||||
:checkbox-selection="false" |
</q-tabs> |
||||
:pageable="false" |
<q-tab-panels v-model="selectedTabRef" animated swipeable keep-alive> |
||||
:full-screen-button="false" |
<q-tab-panel name="dispatcherServlets" class="px-0"> |
||||
:tree-icon=" |
<w-grid |
||||
(row) => { |
:title="$t('menu.developer.springboot.mapping')" |
||||
return { name: 'folder', color: 'amber' }; |
:checkbox-selection="false" |
||||
} |
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/dispatcherServletMappingDescriptions')" |
||||
" |
:pageable="false" |
||||
:toolbar-configure="{ noIcon: false }" |
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
||||
:toolbar-actions="['refresh', 'separator', ['addTop', 'addChild'], 'edit', 'remove', 'separator', 'view']" |
:columns="[ |
||||
:columns="[ |
{ |
||||
{ width: 100, name: 'name', label: $t('name') }, |
width: 100, |
||||
{ width: '100%', name: 'code', label: $t('code') }, |
name: 'httpMethods', |
||||
{ width: 90, name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
label: $t('httpMethod'), |
||||
{ 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() }, |
width: 400, |
||||
]" |
name: 'patterns', |
||||
:editor="{ |
label: $t('pattern'), |
||||
dialog: { |
format: (value) => { |
||||
width: '600px', |
return value; |
||||
height: '300px', |
}, |
||||
}, |
}, |
||||
form: { |
{ |
||||
colsNum: 1, |
width: 300, |
||||
fields: [ |
name: 'className', |
||||
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
label: $t('className'), |
||||
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
format: Formater.simpleClassName(), |
||||
{ name: 'description', label: $t('description'), type: 'textarea', rows: 1 }, |
}, |
||||
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true }, |
{ |
||||
], |
width: 200, |
||||
}, |
name: 'methodName', |
||||
}" |
label: $t('methodName'), |
||||
:viewer="{ |
format: (value) => { |
||||
panel: { |
return value; |
||||
columnNum: 1, |
}, |
||||
fields: [ |
}, |
||||
{ name: 'id', label: $t('id') }, |
{ name: 'consumes', label: $t('consume'), format: Formater.split() }, |
||||
{ name: 'code', label: $t('code') }, |
]" |
||||
{ name: 'name', label: $t('name') }, |
:viewer="{ |
||||
{ name: 'description', label: $t('description') }, |
panel: { |
||||
{ name: 'enable', label: $t('enable'), format: (value) => value }, |
columnNum: 1, |
||||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: (value) => value }, |
fields: [ |
||||
{ name: 'creator', label: $t('creator') }, |
{ name: 'httpMethods', label: $t('httpMethod') }, |
||||
{ name: 'createDate', label: $t('createDate') }, |
{ name: 'patterns', label: $t('pattern') }, |
||||
{ name: 'lastModifier', label: $t('lastModifier') }, |
{ name: 'className', label: $t('className'), format: Formater.none() }, |
||||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: (value) => value }, |
{ 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() }, |
||||
></w-grid> |
{ 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> |
</template> |
||||
|
|
||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import { Environment, Formater, Options } from '@/platform'; |
import { ref } from 'vue'; |
||||
|
import { Environment, Formater } from '@/platform'; |
||||
|
|
||||
|
const selectedTabRef = ref('dispatcherServlets'); |
||||
</script> |
</script> |
||||
|
Loading…
Reference in new issue