Browse Source

fix pageable bug

main
wangshaoping 1 year ago
parent
commit
a7f855e80a
  1. 2
      gradle.properties
  2. 2
      io.sc.platform.core.frontend/package.json
  3. 9
      io.sc.platform.core.frontend/src/platform/components-ext/formater/BooleanFormater.ts
  4. 6
      io.sc.platform.core.frontend/src/platform/components-ext/formater/index.ts
  5. 36
      io.sc.platform.core.frontend/src/platform/components-ext/options/BooleanOptions.ts
  6. 5
      io.sc.platform.core.frontend/src/platform/components-ext/options/EnumOptions.ts
  7. 3
      io.sc.platform.core.frontend/src/platform/components/index.ts
  8. 0
      io.sc.platform.core.frontend/src/platform/components/tag/WEnableTag.vue
  9. 14
      io.sc.platform.core.frontend/src/platform/index.ts
  10. 1
      io.sc.platform.core.frontend/src/platform/plugin/axios.ts
  11. 2
      io.sc.platform.core.frontend/src/platform/plugin/quasar.ts
  12. 4
      io.sc.platform.core.frontend/template-project/package.json
  13. 8
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties
  14. 6
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties
  15. 8
      io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties
  16. 4
      io.sc.platform.developer.frontend/package.json
  17. 14
      io.sc.platform.developer.frontend/src/views/plugin/ApplicationProperties.vue
  18. 11
      io.sc.platform.developer.frontend/src/views/plugin/Components.vue
  19. 13
      io.sc.platform.developer.frontend/src/views/plugin/Directories.vue
  20. 12
      io.sc.platform.developer.frontend/src/views/plugin/FrontendModule.vue
  21. 18
      io.sc.platform.developer.frontend/src/views/plugin/FrontendRoutes.vue
  22. 11
      io.sc.platform.developer.frontend/src/views/plugin/Initializer.vue
  23. 11
      io.sc.platform.developer.frontend/src/views/plugin/JsonSerializers.vue
  24. 11
      io.sc.platform.developer.frontend/src/views/plugin/Messages.vue
  25. 8
      io.sc.platform.developer.frontend/src/views/plugin/P6spy.vue
  26. 18
      io.sc.platform.developer.frontend/src/views/plugin/Parameters.vue
  27. 11
      io.sc.platform.developer.frontend/src/views/plugin/Repositories.vue
  28. 11
      io.sc.platform.developer.frontend/src/views/plugin/RestartProperties.vue
  29. 10
      io.sc.platform.developer.frontend/src/views/plugin/Security.vue
  30. 9
      io.sc.platform.developer.frontend/src/views/plugin/SystemProperties.vue
  31. 11
      io.sc.platform.developer.frontend/src/views/plugin/Ws.vue
  32. 16
      io.sc.platform.developer.frontend/src/views/springboot/Bean.vue
  33. 124
      io.sc.platform.developer.frontend/src/views/springboot/Mapping.vue
  34. 6
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/InitializerWebController.java
  35. 7
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginApplicationPropertiesWebController.java
  36. 7
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginComponentsWebController.java
  37. 7
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginDirectoriesWebController.java
  38. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginFrontendModuleWebController.java
  39. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginFrontendRouteWebController.java
  40. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginJsonSerializersWebController.java
  41. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginMessagesWebController.java
  42. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginP6spyWebController.java
  43. 7
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginParametersWebController.java
  44. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginRepositoriesWebController.java
  45. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginRestartPropertiesWebController.java
  46. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginSecurityWebController.java
  47. 6
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginSwaggerWebController.java
  48. 6
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginSystemPropertiesWebController.java
  49. 8
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginWsWebController.java
  50. 11
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/springboot/SpringbootBeansWebController.java
  51. 86
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/springboot/SpringbootRequestMappingWebController.java
  52. 44
      io.sc.platform.developer/src/main/java/io/sc/platform/developer/wrapper/springboot/DespatcherServletWrapper.java
  53. 4
      io.sc.platform.lcdp.frontend/package.json
  54. 4
      io.sc.platform.mvc.frontend/package.json
  55. 6
      io.sc.platform.security.frontend/package.json
  56. 4
      io.sc.platform.system.frontend/package.json
  57. 65
      io.sc.platform.system.frontend/src/i18n/messages.json
  58. 65
      io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json
  59. 67
      io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json
  60. 522
      io.sc.platform.system.frontend/src/views/role/Role.vue
  61. 208
      io.sc.platform.system.frontend/src/views/role/SelectUserDialog.vue
  62. 15
      io.sc.platform.system.frontend/src/views/user/SelectRoleDialog.vue
  63. 3
      io.sc.platform.system.frontend/src/views/user/SetPasswordDialog.vue
  64. 159
      io.sc.platform.system.frontend/src/views/user/User.vue
  65. 38
      io.sc.platform.system/src/main/java/io/sc/platform/system/user/service/impl/UserServiceImpl.java

2
gradle.properties

@ -38,7 +38,7 @@ application_version=1.0.0
platform_group=io.sc platform_group=io.sc
platform_version=8.1.20 platform_version=8.1.20
platform_plugin_version=8.1.13 platform_plugin_version=8.1.13
platform_core_frontend_version=8.1.67 platform_core_frontend_version=8.1.75
########################################################### ###########################################################
# dependencies version # dependencies version

2
io.sc.platform.core.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.70", "version": "8.1.76",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件", "//main": "库的主文件",
"main": "dist/platform-core.js", "main": "dist/platform-core.js",

9
io.sc.platform.core.frontend/src/platform/components-ext/formater/BooleanFormater.ts

@ -14,4 +14,11 @@ const trueFalseFormater = (value) => {
return i18n.global.t('false'); return i18n.global.t('false');
}; };
export { yesNoFormater, trueFalseFormater }; const enableTagFormater = (value) => {
return {
componentType: 'WEnableTag',
attrs: { enable: value },
};
};
export { yesNoFormater, trueFalseFormater, enableTagFormater };

6
io.sc.platform.core.frontend/src/platform/components-ext/formater/index.ts

@ -1,11 +1,15 @@
import type { EnumType } from '@/platform/types'; import type { EnumType } from '@/platform/types';
import { yesNoFormater, trueFalseFormater } from './BooleanFormater'; import { yesNoFormater, trueFalseFormater, enableTagFormater } from './BooleanFormater';
import { dateOnlyFormater } from './DatetimeFormater'; import { dateOnlyFormater } from './DatetimeFormater';
import { EnumFormater } from './EnumFormater'; import { EnumFormater } from './EnumFormater';
class Formater { class Formater {
static #enumFormaterMap = {}; static #enumFormaterMap = {};
public static enableTag() {
return enableTagFormater;
}
public static yesNo() { public static yesNo() {
return yesNoFormater; return yesNoFormater;
} }

36
io.sc.platform.core.frontend/src/platform/components-ext/options/BooleanOptions.ts

@ -1,17 +1,33 @@
import { i18n } from '@/platform/plugin'; import { i18n } from '@/platform/plugin';
const yesNo = () => { const yesNo = (includeEmpty: boolean = true) => {
return [ if (includeEmpty) {
{ value: true, label: i18n.global.t('yes') }, return [
{ value: false, label: i18n.global.t('no') }, { value: null, label: '' },
]; { value: true, label: i18n.global.t('yes') },
{ value: false, label: i18n.global.t('no') },
];
} else {
return [
{ value: true, label: i18n.global.t('yes') },
{ value: false, label: i18n.global.t('no') },
];
}
}; };
const trueFalse = () => { const trueFalse = (includeEmpty: boolean = true) => {
return [ if (includeEmpty) {
{ value: true, label: i18n.global.t('true') }, return [
{ value: false, label: i18n.global.t('false') }, { value: null, label: '' },
]; { value: true, label: i18n.global.t('true') },
{ value: false, label: i18n.global.t('false') },
];
} else {
return [
{ value: true, label: i18n.global.t('true') },
{ value: false, label: i18n.global.t('false') },
];
}
}; };
export { yesNo, trueFalse }; export { yesNo, trueFalse };

5
io.sc.platform.core.frontend/src/platform/components-ext/options/EnumOptions.ts

@ -8,9 +8,12 @@ class EnumOptions {
this.#options = options; this.#options = options;
} }
public options() { public options(includeEmpty: boolean = true) {
if (this.#options) { if (this.#options) {
const result = []; const result = [];
if (includeEmpty) {
result.push({ value: null, label: '' });
}
for (const option of this.#options) { for (const option of this.#options) {
result.push({ result.push({
value: option.value, value: option.value,

3
io.sc.platform.core.frontend/src/platform/components/index.ts

@ -26,6 +26,7 @@ import WInfoPanel from './panel/WInfoPanel.vue';
import WGrid from './grid/WGrid.vue'; import WGrid from './grid/WGrid.vue';
import WToolbar from './toolbar/WToolbar.vue'; import WToolbar from './toolbar/WToolbar.vue';
import WEnableTag from './tag/WEnableTag.vue';
export default { export default {
install: (app: App) => { install: (app: App) => {
@ -55,6 +56,7 @@ export default {
app.component('WGrid', WGrid); app.component('WGrid', WGrid);
app.component('WToolbar', WToolbar); app.component('WToolbar', WToolbar);
app.component('WEnableTag', WEnableTag);
}, },
}; };
@ -80,6 +82,7 @@ export {
WPassword, WPassword,
WGrid, WGrid,
WToolbar, WToolbar,
WEnableTag,
}; };
export { PlatformIconEnum } from './utils'; export { PlatformIconEnum } from './utils';

0
io.sc.platform.system.frontend/src/views/user/RoleStatusTag.vue → io.sc.platform.core.frontend/src/platform/components/tag/WEnableTag.vue

14
io.sc.platform.core.frontend/src/platform/index.ts

@ -108,7 +108,19 @@ export { Options } from './components-ext';
/** /**
* UI * UI
*/ */
export { WPlatformPage, WIconEmpty, WHScreenDiv, WColorInput, WColorInputPalette, WPosition, WCodemirror, WSelect, WGrid, WTreeGrid } from './components'; export {
WPlatformPage,
WIconEmpty,
WHScreenDiv,
WColorInput,
WColorInputPalette,
WPosition,
WCodemirror,
WSelect,
WGrid,
WTreeGrid,
WEnableTag,
} from './components';
export { PlatformIconEnum } from './components'; export { PlatformIconEnum } from './components';
export { PageStatusEnum } from './components'; export { PageStatusEnum } from './components';

1
io.sc.platform.core.frontend/src/platform/plugin/axios.ts

@ -4,7 +4,6 @@ import { i18n } from './i18n';
import { PConst } from '@/platform/PConst'; import { PConst } from '@/platform/PConst';
import { Environment } from '@/platform/plugin/environment'; import { Environment } from '@/platform/plugin/environment';
import { NotifyManager } from './manager'; import { NotifyManager } from './manager';
import { Tools } from '@/platform/utils';
const ignoredUrls: string[] = [PConst.API_I18N_MESSAGES_URL, PConst.API_APP_CONFIGURE_URL]; const ignoredUrls: string[] = [PConst.API_I18N_MESSAGES_URL, PConst.API_APP_CONFIGURE_URL];
const gc = Environment.getConfigure(); const gc = Environment.getConfigure();

2
io.sc.platform.core.frontend/src/platform/plugin/quasar.ts

@ -4,8 +4,6 @@ import type { I18nMessageLocaleType } from '@/platform/types';
import { Environment } from '@/platform/plugin/environment'; import { Environment } from '@/platform/plugin/environment';
import { I18nMessageManager } from '@/platform/plugin/manager'; import { I18nMessageManager } from '@/platform/plugin/manager';
import { QBtn } from 'quasar';
const gc = Environment.getConfigure(); const gc = Environment.getConfigure();
const eventBus: any = new EventBus(); const eventBus: any = new EventBus();

4
io.sc.platform.core.frontend/template-project/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.70", "version": "8.1.76",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.70", "platform-core": "8.1.76",
"quasar": "2.14.2", "quasar": "2.14.2",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

8
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words.properties

@ -100,7 +100,7 @@ normal=Normal
oldValue=Old Value oldValue=Old Value
operationSuccess=Operation Sucess operationSuccess=Operation Sucess
order=Order order=Order
org=Org org=Organization
parent=Parent parent=Parent
parentId=Parent ID parentId=Parent ID
path=Path path=Path
@ -149,3 +149,9 @@ webContainer=Web Container
weixin=WeiXin weixin=WeiXin
welcome=Welcome welcome=Welcome
yes=Yes yes=Yes
rawPassword=Raw Password
newPassword=New Password
confirmNewPassword=Confirm New Password
accountExpired=Expired
accountLocked=Locked
credentialsExpired=Credentials Expired

6
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_tw_CN.properties

@ -149,3 +149,9 @@ webContainer=Web \u5BB9\u5668
weixin=\u5FAE\u4FE1 weixin=\u5FAE\u4FE1
welcome=\u6B61\u8FCE welcome=\u6B61\u8FCE
yes=\u662F yes=\u662F
rawPassword=\u539F\u5BC6\u78BC
newPassword=\u65B0\u5BC6\u78BC
confirmNewPassword=\u78BA\u8A8D\u65B0\u5BC6\u78BC
accountExpired=\u904E\u671F
accountLocked=\u9396\u5B9A
credentialsExpired=\u5BC6\u78BC\u904E\u671F

8
io.sc.platform.core/src/main/resources/io/sc/platform/core/i18n/words_zh_CN.properties

@ -148,4 +148,10 @@ version=\u7248\u672C
webContainer=Web \u5BB9\u5668 webContainer=Web \u5BB9\u5668
weixin=\u5FAE\u4FE1 weixin=\u5FAE\u4FE1
welcome=\u6B22\u8FCE welcome=\u6B22\u8FCE
yes=\u662F yes=\u662F
rawPassword=\u539F\u5BC6\u7801
newPassword=\u65B0\u5BC6\u7801
confirmNewPassword=\u786E\u8BA4\u65B0\u5BC6\u7801
accountExpired=\u8FC7\u671F
accountLocked=\u9501\u5B9A
credentialsExpired=\u5BC6\u7801\u8FC7\u671F

4
io.sc.platform.developer.frontend/package.json

@ -78,7 +78,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.70", "platform-core": "8.1.75",
"quasar": "2.14.2", "quasar": "2.14.2",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",
@ -100,4 +100,4 @@
"codemirror": "6.0.1", "codemirror": "6.0.1",
"vue-codemirror6": "1.2.0" "vue-codemirror6": "1.2.0"
} }
} }

14
io.sc.platform.developer.frontend/src/views/plugin/ApplicationProperties.vue

@ -3,15 +3,17 @@
:title="$t('menu.developer.plugin.applicationProperties')" :title="$t('menu.developer.plugin.applicationProperties')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/applicationProperties')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/applicationProperties')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: '20%', name: 'order', label: $t('order') }, { width: 50, name: 'order', label: $t('order'), align: 'right', sortable: false },
{ width: '20%', name: 'module', label: $t('module') }, { width: 150, name: 'module', label: $t('module'), sortable: false },
{ width: '40%', name: 'description', label: $t('description') }, { width: 200, name: 'description', label: $t('description'), sortable: false },
{ {
width: '40%', width: 300,
name: 'properties', name: 'properties',
label: $t('properties'), label: $t('properties'),
sortable: false,
format: (properties) => { format: (properties) => {
properties = properties || []; properties = properties || [];
let result = ''; let result = '';
@ -21,7 +23,7 @@
return result; return result;
}, },
}, },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url') },
]" ]"
></w-grid> ></w-grid>
</template> </template>

11
io.sc.platform.developer.frontend/src/views/plugin/Components.vue

@ -3,12 +3,14 @@
:title="$t('menu.developer.plugin.components')" :title="$t('menu.developer.plugin.components')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/components')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/components')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ {
width: '40%', width: 300,
name: 'includes', name: 'includes',
label: $t('include'), label: $t('include'),
sortable: false,
format: (includes) => { format: (includes) => {
includes = includes || []; includes = includes || [];
let result = ''; let result = '';
@ -19,9 +21,10 @@
}, },
}, },
{ {
width: '40%', width: 300,
name: 'excludes', name: 'excludes',
label: $t('exclude'), label: $t('exclude'),
sortable: false,
format: (excludes) => { format: (excludes) => {
excludes = excludes || []; excludes = excludes || [];
let result = ''; let result = '';
@ -31,7 +34,7 @@
return result; return result;
}, },
}, },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

13
io.sc.platform.developer.frontend/src/views/plugin/Directories.vue

@ -3,15 +3,16 @@
:title="$t('menu.developer.plugin.directories')" :title="$t('menu.developer.plugin.directories')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/directories')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/directories')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: '20%', name: 'name', label: $t('name') }, { width: 200, name: 'name', label: $t('name'), sortable: false },
{ width: '40%', name: 'path', label: $t('path') }, { width: 200, name: 'path', label: $t('path'), sortable: false },
{ width: '40%', name: 'autoCreate', label: $t('autoCreate') }, { width: 100, name: 'autoCreate', label: $t('autoCreate'), format: Formater.yesNo(), sortable: false },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { Environment } from 'platform-core'; import { Environment, Formater } from 'platform-core';
</script> </script>

12
io.sc.platform.developer.frontend/src/views/plugin/FrontendModule.vue

@ -3,12 +3,15 @@
:title="$t('menu.developer.plugin.frontendModule')" :title="$t('menu.developer.plugin.frontendModule')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/frontendModule')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/frontendModule')"
:checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: 100, name: 'name', label: $t('name') }, { width: 200, name: 'name', label: $t('name'), sortable: false },
{ {
width: '40%', width: 200,
name: 'components', name: 'components',
label: $t('component'), label: $t('component'),
sortable: false,
format: (components) => { format: (components) => {
components = components || []; components = components || [];
let result = ''; let result = '';
@ -19,9 +22,10 @@
}, },
}, },
{ {
width: '40%', width: 300,
name: 'resources', name: 'resources',
label: $t('resource'), label: $t('resource'),
sortable: false,
format: (resources) => { format: (resources) => {
resources = resources || []; resources = resources || [];
let result = ''; let result = '';
@ -31,7 +35,7 @@
return result; return result;
}, },
}, },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

18
io.sc.platform.developer.frontend/src/views/plugin/FrontendRoutes.vue

@ -3,15 +3,17 @@
:title="$t('menu.developer.plugin.frontendModule')" :title="$t('menu.developer.plugin.frontendModule')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/frontendRoute')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/frontendRoute')"
:checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: '40%', name: 'name', label: $t('name') }, { width: 280, name: 'name', label: $t('name'), sortable: false },
{ width: '40%', name: 'parent', label: $t('parent') }, { width: 80, name: 'parent', label: $t('parent'), sortable: false },
{ width: '40%', name: 'path', label: $t('path') }, { width: 250, name: 'path', label: $t('path'), sortable: false },
{ width: '40%', name: 'module', label: $t('module') }, { width: 90, name: 'priority', label: $t('priority'), sortable: false },
{ width: '40%', name: 'priority', label: $t('priority') }, { width: 250, name: 'module', label: $t('module'), sortable: false },
{ width: '40%', name: 'component', label: $t('component') }, { width: 300, name: 'component', label: $t('component'), sortable: false },
{ width: '40%', name: 'redirect', label: $t('redirect') }, { width: 200, name: 'redirect', label: $t('redirect'), sortable: false },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

11
io.sc.platform.developer.frontend/src/views/plugin/Initializer.vue

@ -3,12 +3,13 @@
:title="$t('menu.developer.plugin.initializer')" :title="$t('menu.developer.plugin.initializer')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/initializer')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/initializer')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: '20%', name: 'order', label: $t('order'), align: 'right' }, { name: 'order', label: $t('order'), align: 'right', sortable: false },
{ width: '40%', name: 'name', label: $t('name'), format: (value) => $t(value), align: 'left' }, { name: 'name', label: $t('name'), format: (value) => $t(value), align: 'left', sortable: false },
{ width: '40%', name: 'description', label: $t('description'), format: (value) => $t(value), align: 'left' }, { name: 'description', label: $t('description'), format: (value) => $t(value), align: 'left', sortable: false },
{ width: '40%', name: 'id', label: $t('className'), align: 'left' }, { name: 'id', label: $t('className'), align: 'left', sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

11
io.sc.platform.developer.frontend/src/views/plugin/JsonSerializers.vue

@ -3,12 +3,13 @@
:title="$t('menu.developer.plugin.jsonSerializers')" :title="$t('menu.developer.plugin.jsonSerializers')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/jsonSerializers')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/jsonSerializers')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: '20%', name: 'className', label: $t('className') }, { width: 280, name: 'className', label: $t('className'), sortable: false },
{ width: '40%', name: 'serializer', label: $t('serializer') }, { width: 420, name: 'serializer', label: $t('serializer'), sortable: false },
{ width: '40%', name: 'deserializer', label: $t('deserializer') }, { width: 420, name: 'deserializer', label: $t('deserializer'), sortable: false },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

11
io.sc.platform.developer.frontend/src/views/plugin/Messages.vue

@ -3,12 +3,14 @@
:title="$t('menu.developer.plugin.messages')" :title="$t('menu.developer.plugin.messages')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/messages')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/messages')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ {
width: '40%', width: 300,
name: 'includes', name: 'includes',
label: $t('include'), label: $t('include'),
sortable: false,
format: (includes) => { format: (includes) => {
includes = includes || []; includes = includes || [];
let result = ''; let result = '';
@ -19,9 +21,10 @@
}, },
}, },
{ {
width: '40%', width: 300,
name: 'excludes', name: 'excludes',
label: $t('exclude'), label: $t('exclude'),
sortable: false,
format: (excludes) => { format: (excludes) => {
excludes = excludes || []; excludes = excludes || [];
let result = ''; let result = '';
@ -31,7 +34,7 @@
return result; return result;
}, },
}, },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

8
io.sc.platform.developer.frontend/src/views/plugin/P6spy.vue

@ -3,12 +3,14 @@
:title="$t('menu.developer.plugin.p6spy')" :title="$t('menu.developer.plugin.p6spy')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/p6spy')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/p6spy')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ {
width: '40%', width: 300,
name: 'ignoredPatterns', name: 'ignoredPatterns',
label: $t('ignored'), label: $t('ignored'),
sortable: false,
format: (ignoredPatterns) => { format: (ignoredPatterns) => {
ignoredPatterns = ignoredPatterns || []; ignoredPatterns = ignoredPatterns || [];
let result = ''; let result = '';
@ -18,7 +20,7 @@
return result; return result;
}, },
}, },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

18
io.sc.platform.developer.frontend/src/views/plugin/Parameters.vue

@ -1,17 +1,19 @@
<template> <template>
<w-grid <w-grid
:title="$t('menu.developer.plugin.parameters')" :title="$t('menu.developer.plugin.parameters')"
:tree="true"
tree-relationship-field="parentId"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/parameters')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/parameters')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: '20%', name: 'id', label: $t('id'), align: 'right' }, { width: 300, name: 'id', label: $t('id'), sortable: false },
{ width: '40%', name: 'parentId', label: $t('parentId') }, { width: 200, name: 'defaultValue', label: $t('defaultValue'), sortable: false },
{ width: '40%', name: 'defaultValue', label: $t('defaultValue') }, { width: 80, name: 'order', label: $t('order'), sortable: false },
{ width: '40%', name: 'order', label: $t('order') }, { width: 100, name: 'priority', label: $t('priority'), sortable: false },
{ width: '40%', name: 'priority', label: $t('priority') }, { width: 200, name: 'description', label: $t('description'), sortable: false },
{ width: '40%', name: 'description', label: $t('description') }, { width: 200, name: 'configurationFileUrl', label: $t('className'), sortable: false },
{ width: '40%', name: 'configurationFileUrl', label: $t('className') },
]" ]"
></w-grid> ></w-grid>
</template> </template>

11
io.sc.platform.developer.frontend/src/views/plugin/Repositories.vue

@ -3,12 +3,14 @@
:title="$t('menu.developer.plugin.repositories')" :title="$t('menu.developer.plugin.repositories')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/repositories')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/repositories')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ {
width: '40%', width: 300,
name: 'includes', name: 'includes',
label: $t('include'), label: $t('include'),
sortable: false,
format: (includes) => { format: (includes) => {
includes = includes || []; includes = includes || [];
let result = ''; let result = '';
@ -19,9 +21,10 @@
}, },
}, },
{ {
width: '40%', width: 300,
name: 'excludes', name: 'excludes',
label: $t('exclude'), label: $t('exclude'),
sortable: false,
format: (excludes) => { format: (excludes) => {
excludes = excludes || []; excludes = excludes || [];
let result = ''; let result = '';
@ -31,7 +34,7 @@
return result; return result;
}, },
}, },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

11
io.sc.platform.developer.frontend/src/views/plugin/RestartProperties.vue

@ -3,12 +3,14 @@
:title="$t('menu.developer.plugin.restartProperties')" :title="$t('menu.developer.plugin.restartProperties')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/restartProperties')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/restartProperties')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ {
width: '20%', width: 300,
name: 'container', name: 'container',
label: $t('webContainer'), label: $t('webContainer'),
sortable: false,
format: (containers) => { format: (containers) => {
containers = containers || []; containers = containers || [];
let result = ''; let result = '';
@ -19,9 +21,10 @@
}, },
}, },
{ {
width: '40%', width: 300,
name: 'jar', name: 'jar',
label: $t('jar'), label: $t('jar'),
sortable: false,
format: (jars) => { format: (jars) => {
jars = jars || []; jars = jars || [];
let result = ''; let result = '';
@ -31,7 +34,7 @@
return result; return result;
}, },
}, },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

10
io.sc.platform.developer.frontend/src/views/plugin/Security.vue

@ -3,12 +3,14 @@
:title="$t('menu.developer.plugin.security')" :title="$t('menu.developer.plugin.security')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/security')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/security')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ {
width: '40%', width: 200,
name: 'permitPatterns', name: 'permitPatterns',
label: $t('include'), label: $t('ignored'),
sortable: false,
format: (permitPatterns) => { format: (permitPatterns) => {
permitPatterns = permitPatterns || []; permitPatterns = permitPatterns || [];
let result = ''; let result = '';
@ -18,7 +20,7 @@
return result; return result;
}, },
}, },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 500, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

9
io.sc.platform.developer.frontend/src/views/plugin/SystemProperties.vue

@ -3,11 +3,12 @@
:title="$t('menu.developer.plugin.systemProperties')" :title="$t('menu.developer.plugin.systemProperties')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/systemProperties')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/systemProperties')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: '20%', name: 'name', label: $t('name') }, { width: 200, name: 'name', label: $t('name'), sortable: false },
{ width: '40%', name: 'value', label: $t('path') }, { width: 200, name: 'value', label: $t('value'), sortable: false },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

11
io.sc.platform.developer.frontend/src/views/plugin/Ws.vue

@ -3,12 +3,13 @@
:title="$t('menu.developer.plugin.ws')" :title="$t('menu.developer.plugin.ws')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/plugins/ws')" :fetch-data-url="Environment.apiContextPath('/api/developer/plugins/ws')"
row-key="id" :checkbox-selection="false"
:pageable="false"
:columns="[ :columns="[
{ width: '20%', name: 'publish', label: $t('publish') }, { width: 200, name: 'publish', label: $t('publish'), sortable: false },
{ width: '40%', name: 'beanName', label: $t('beanName') }, { width: 200, name: 'beanName', label: $t('beanName'), sortable: false },
{ width: '40%', name: 'beanClass', label: $t('beanClass') }, { width: 200, name: 'beanClass', label: $t('beanClass'), sortable: false },
{ width: '40%', name: 'configurationFileUrl', label: $t('url') }, { width: 200, name: 'configurationFileUrl', label: $t('url'), sortable: false },
]" ]"
></w-grid> ></w-grid>
</template> </template>

16
io.sc.platform.developer.frontend/src/views/springboot/Bean.vue

@ -3,17 +3,12 @@
:title="$t('menu.developer.springboot.bean')" :title="$t('menu.developer.springboot.bean')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']" :toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/beans')" :fetch-data-url="Environment.apiContextPath('/api/developer/springboot/beans')"
:checkbox-selection="true" :checkbox-selection="false"
:pagination="{ :pageable="false"
sortBy: 'name',
descending: false,
reqPageStart: 0,
rowsPerPage: 0,
}"
:columns="[ :columns="[
{ width: 600, name: 'name', label: $t('name') }, { width: 600, name: 'name', label: $t('name'), sortable: false },
{ width: 500, name: 'type', label: $t('className') }, { width: 500, name: 'type', label: $t('className'), sortable: false },
{ width: 100, name: 'configurationFileUrl', label: $t('url') }, { width: 100, name: 'scope', label: $t('scope'), sortable: false },
]" ]"
:viewer="{ :viewer="{
panel: { panel: {
@ -50,7 +45,6 @@
return result; return result;
}, },
}, },
{ width: 100, name: 'configurationFileUrl', label: $t('url') },
], ],
}, },
}" }"

124
io.sc.platform.developer.frontend/src/views/springboot/Mapping.vue

@ -1,4 +1,124 @@
<template> <template>
<div>Mapping</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.bean')"
:toolbar-actions="['refresh', 'separator', 'view', 'export']"
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/mappings/dispatcherServletMappingDescriptions')"
:checkbox-selection="false"
:pageable="false"
:columns="[
{
width: 100,
name: 'httpMethod',
label: $t('Http Method'),
format: (value, row) => {
return row.details?.requestMappingConditions?.methods || 'GET';
},
sortable: false,
},
{
width: 200,
name: 'patterns',
label: $t('patterns'),
format: (value, row) => {
return row.details?.requestMappingConditions?.patterns || row.predicate;
},
sortable: false,
},
{
width: 400,
name: 'className',
label: $t('className'),
format: (value, row) => {
return row.details?.handlerMethod?.className || row.handler;
},
sortable: false,
},
{
width: 150,
name: 'methodName',
label: $t('methodName'),
format: (value, row) => {
return row.details?.handlerMethod?.name;
},
sortable: false,
},
{
width: 150,
name: 'consumes',
label: $t('consumes'),
format: (value, row) => {
let result = '';
const consumes = row.details?.requestMappingConditions?.consumes;
if (consumes) {
for (const consume of consumes) {
result += consume.mediaType + '<br/>';
}
}
return result;
},
sortable: false,
},
{
width: 150,
name: 'produces',
label: $t('produces'),
format: (value, row) => {
let result = '';
const produces = row.details?.requestMappingConditions?.produces;
if (produces) {
for (const produce of produces) {
result += produce.mediaType + '<br/>';
}
}
return result;
},
sortable: false,
},
]"
></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="false"
:columns="[
{ width: 200, name: 'servletNameMappings', label: $t('servletNameMappings'), sortable: false },
{ width: 200, name: 'urlPatternMappings', label: $t('urlPatternMappings'), sortable: false },
{ width: 400, name: 'className', label: $t('className'), sortable: false },
{ width: 150, name: 'name', label: $t('name'), sortable: false },
]"
></w-grid>
</q-tab-panel>
<q-tab-panel name="servlets" 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/servletRegistrationMappingDescriptions')"
:checkbox-selection="false"
:pageable="false"
:columns="[
{ width: 300, name: 'mappings', label: $t('mappings'), sortable: false },
{ width: 300, name: 'className', label: $t('className'), sortable: false },
{ width: 200, name: 'name', label: $t('name'), sortable: false },
]"
></w-grid>
</q-tab-panel>
</q-tab-panels>
</template> </template>
<script setup lang="ts"></script> <script setup lang="ts">
import { ref } from 'vue';
import { Environment } from 'platform-core';
const selectedTabRef = ref('dispatcherServlets');
</script>

6
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/InitializerWebController.java

@ -3,8 +3,6 @@ package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.initializer.ApplicationInitializer; import io.sc.platform.core.initializer.ApplicationInitializer;
import io.sc.platform.core.util.Sorter; import io.sc.platform.core.util.Sorter;
import io.sc.platform.developer.wrapper.plugins.InitializerWrapper; import io.sc.platform.developer.wrapper.plugins.InitializerWrapper;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -19,13 +17,13 @@ import java.util.ServiceLoader;
public class InitializerWebController { public class InitializerWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<InitializerWrapper> initializer(){ public List<InitializerWrapper> initializer(){
List<ApplicationInitializer> initializers =new ArrayList<>(); List<ApplicationInitializer> initializers =new ArrayList<>();
ServiceLoader<ApplicationInitializer> loader = ServiceLoader.load(ApplicationInitializer.class,Thread.currentThread().getContextClassLoader()); ServiceLoader<ApplicationInitializer> loader = ServiceLoader.load(ApplicationInitializer.class,Thread.currentThread().getContextClassLoader());
loader.iterator().forEachRemaining(item -> { loader.iterator().forEachRemaining(item -> {
initializers.add(item); initializers.add(item);
}); });
Sorter.sort(initializers); Sorter.sort(initializers);
return QueryResult.page(InitializerWrapper.from(initializers)); return InitializerWrapper.from(initializers);
} }
} }

7
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginApplicationPropertiesWebController.java

@ -2,8 +2,6 @@ package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.PluginManager; import io.sc.platform.core.plugins.PluginManager;
import io.sc.platform.core.plugins.item.ApplicationProperties; import io.sc.platform.core.plugins.item.ApplicationProperties;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -16,8 +14,7 @@ import java.util.List;
public class PluginApplicationPropertiesWebController { public class PluginApplicationPropertiesWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<ApplicationProperties> applicationProperties(){ public List<ApplicationProperties> applicationProperties(){
List<ApplicationProperties> plugins = PluginManager.getInstance().getApplicationProperties(); return PluginManager.getInstance().getApplicationProperties();
return QueryResult.page(plugins);
} }
} }

7
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginComponentsWebController.java

@ -2,8 +2,6 @@ package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.PluginManager; import io.sc.platform.core.plugins.PluginManager;
import io.sc.platform.core.plugins.item.Component; import io.sc.platform.core.plugins.item.Component;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -16,8 +14,7 @@ import java.util.List;
public class PluginComponentsWebController { public class PluginComponentsWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<Component> components(){ public List<Component> components(){
List<Component> plugins = PluginManager.getInstance().getComponents(); return PluginManager.getInstance().getComponents();
return QueryResult.page(plugins);
} }
} }

7
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginDirectoriesWebController.java

@ -2,8 +2,6 @@ package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.PluginManager; import io.sc.platform.core.plugins.PluginManager;
import io.sc.platform.core.plugins.item.Directory; import io.sc.platform.core.plugins.item.Directory;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -16,8 +14,7 @@ import java.util.List;
public class PluginDirectoriesWebController { public class PluginDirectoriesWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<Directory> directories(){ public List<Directory> directories(){
List<Directory> plugins = PluginManager.getInstance().getDirectories(); return PluginManager.getInstance().getDirectories();
return QueryResult.page(plugins);
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginFrontendModuleWebController.java

@ -1,10 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.item.Message;
import io.sc.platform.mvc.plugins.PluginManager; import io.sc.platform.mvc.plugins.PluginManager;
import io.sc.platform.mvc.plugins.item.FrontEndModule; import io.sc.platform.mvc.plugins.item.FrontEndModule;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginFrontendModuleWebController { public class PluginFrontendModuleWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<FrontEndModule> frontendModule(){ public List<FrontEndModule> frontendModule(){
List<FrontEndModule> plugins = PluginManager.getInstance().getFrontEndModules(); return PluginManager.getInstance().getFrontEndModules();
return QueryResult.page(plugins);
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginFrontendRouteWebController.java

@ -1,10 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.mvc.plugins.PluginManager; import io.sc.platform.mvc.plugins.PluginManager;
import io.sc.platform.mvc.plugins.item.FrontEndModule;
import io.sc.platform.mvc.plugins.item.FrontEndRoute; import io.sc.platform.mvc.plugins.item.FrontEndRoute;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginFrontendRouteWebController { public class PluginFrontendRouteWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<FrontEndRoute> frontendRoute(){ public List<FrontEndRoute> frontendRoute(){
List<FrontEndRoute> plugins = PluginManager.getInstance().getFrontEndRoutes(); return PluginManager.getInstance().getFrontEndRoutes();
return QueryResult.page(plugins);
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginJsonSerializersWebController.java

@ -1,10 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.PluginManager; import io.sc.platform.core.plugins.PluginManager;
import io.sc.platform.core.plugins.item.Directory;
import io.sc.platform.core.plugins.item.JsonSerializer; import io.sc.platform.core.plugins.item.JsonSerializer;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginJsonSerializersWebController { public class PluginJsonSerializersWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<JsonSerializer> jsonSerializers(){ public List<JsonSerializer> jsonSerializers(){
List<JsonSerializer> plugins = PluginManager.getInstance().getJsonSerializers(); return PluginManager.getInstance().getJsonSerializers();
return QueryResult.page(plugins);
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginMessagesWebController.java

@ -2,9 +2,6 @@ package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.PluginManager; import io.sc.platform.core.plugins.PluginManager;
import io.sc.platform.core.plugins.item.Message; import io.sc.platform.core.plugins.item.Message;
import io.sc.platform.orm.plugins.item.Repository;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginMessagesWebController { public class PluginMessagesWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<Message> messages(){ public List<Message> messages(){
List<Message> plugins = PluginManager.getInstance().getMessages(); return PluginManager.getInstance().getMessages();
return QueryResult.page(plugins);
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginP6spyWebController.java

@ -1,10 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.item.JsonSerializer;
import io.sc.platform.jdbc.plugins.PluginManager; import io.sc.platform.jdbc.plugins.PluginManager;
import io.sc.platform.jdbc.plugins.item.P6spy; import io.sc.platform.jdbc.plugins.item.P6spy;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginP6spyWebController { public class PluginP6spyWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<P6spy> p6spy(){ public List<P6spy> p6spy(){
List<P6spy> plugins = PluginManager.getInstance().getP6spys(); return PluginManager.getInstance().getP6spys();
return QueryResult.page(plugins);
} }
} }

7
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginParametersWebController.java

@ -2,8 +2,6 @@ package io.sc.platform.developer.controller.plugins;
import io.sc.platform.mvc.plugins.PluginManager; import io.sc.platform.mvc.plugins.PluginManager;
import io.sc.platform.mvc.plugins.item.Parameter; import io.sc.platform.mvc.plugins.item.Parameter;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -16,8 +14,7 @@ import java.util.List;
public class PluginParametersWebController { public class PluginParametersWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<Parameter> parameters(){ public List<Parameter> parameters(){
List<Parameter> plugins =PluginManager.getInstance().getParameters(); return PluginManager.getInstance().getParameters();
return QueryResult.page(plugins);
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginRepositoriesWebController.java

@ -1,10 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.item.Component;
import io.sc.platform.orm.plugins.PluginManager; import io.sc.platform.orm.plugins.PluginManager;
import io.sc.platform.orm.plugins.item.Repository; import io.sc.platform.orm.plugins.item.Repository;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginRepositoriesWebController { public class PluginRepositoriesWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<Repository> repositories(){ public List<Repository> repositories(){
List<Repository> plugins = PluginManager.getInstance().getRepositories(); return PluginManager.getInstance().getRepositories();
return QueryResult.page(plugins);
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginRestartPropertiesWebController.java

@ -1,10 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.PluginManager; import io.sc.platform.core.plugins.PluginManager;
import io.sc.platform.core.plugins.item.ApplicationProperties;
import io.sc.platform.core.plugins.item.RestartProperties; import io.sc.platform.core.plugins.item.RestartProperties;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginRestartPropertiesWebController { public class PluginRestartPropertiesWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<RestartProperties> restartProperties(){ public List<RestartProperties> restartProperties(){
List<RestartProperties> plugins = PluginManager.getInstance().getRestartProperties(); return PluginManager.getInstance().getRestartProperties();
return QueryResult.page(plugins);
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginSecurityWebController.java

@ -1,10 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.mvc.plugins.item.FrontEndRoute;
import io.sc.platform.orm.service.support.QueryResult;
import io.sc.platform.security.plugins.PluginManager; import io.sc.platform.security.plugins.PluginManager;
import io.sc.platform.security.plugins.item.Security; import io.sc.platform.security.plugins.item.Security;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginSecurityWebController { public class PluginSecurityWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<Security> security(){ public List<Security> security(){
List<Security> plugins = PluginManager.getInstance().getSecurities(); return PluginManager.getInstance().getSecurities();
return QueryResult.page(plugins);
} }
} }

6
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginSwaggerWebController.java

@ -1,9 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.jdbc.plugins.item.P6spy; import io.sc.platform.jdbc.plugins.item.P6spy;
import io.sc.platform.mvc.plugins.PluginManager;
import io.sc.platform.orm.service.support.QueryResult; import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -16,7 +14,7 @@ import java.util.List;
public class PluginSwaggerWebController { public class PluginSwaggerWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<P6spy> swagger(){ public List<P6spy> swagger(){
return QueryResult.emptyPage(); return QueryResult.emptyList();
} }
} }

6
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginSystemPropertiesWebController.java

@ -3,8 +3,6 @@ package io.sc.platform.developer.controller.plugins;
import io.sc.platform.core.plugins.Plugin; import io.sc.platform.core.plugins.Plugin;
import io.sc.platform.core.plugins.PluginManager; import io.sc.platform.core.plugins.PluginManager;
import io.sc.platform.developer.wrapper.plugins.SystemPropertyWrapper; import io.sc.platform.developer.wrapper.plugins.SystemPropertyWrapper;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -19,7 +17,7 @@ import java.util.Map;
public class PluginSystemPropertiesWebController { public class PluginSystemPropertiesWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<SystemPropertyWrapper> systemProperties(){ public List<SystemPropertyWrapper> systemProperties(){
List<Plugin<Map<String, String>>> plugins = PluginManager.getInstance().getSystemPropertyPlugins(); List<Plugin<Map<String, String>>> plugins = PluginManager.getInstance().getSystemPropertyPlugins();
List<SystemPropertyWrapper> result =new ArrayList<>(); List<SystemPropertyWrapper> result =new ArrayList<>();
for(Plugin<Map<String, String>> plugin : plugins){ for(Plugin<Map<String, String>> plugin : plugins){
@ -30,6 +28,6 @@ public class PluginSystemPropertiesWebController {
result.add(wrapper); result.add(wrapper);
} }
} }
return QueryResult.page(result); return result;
} }
} }

8
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/plugins/PluginWsWebController.java

@ -1,10 +1,7 @@
package io.sc.platform.developer.controller.plugins; package io.sc.platform.developer.controller.plugins;
import io.sc.platform.jdbc.plugins.item.P6spy;
import io.sc.platform.orm.service.support.QueryResult;
import io.sc.platform.ws.plugins.PluginManager; import io.sc.platform.ws.plugins.PluginManager;
import io.sc.platform.ws.plugins.item.JaxWsWebservice; import io.sc.platform.ws.plugins.item.JaxWsWebservice;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,8 +14,7 @@ import java.util.List;
public class PluginWsWebController { public class PluginWsWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<JaxWsWebservice> ws(){ public List<JaxWsWebservice> ws(){
List<JaxWsWebservice> plugins = PluginManager.getInstance().getJaxWsWebservices(); return PluginManager.getInstance().getJaxWsWebservices();
return QueryResult.page(plugins);
} }
} }

11
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/springboot/SpringbootBeansWebController.java

@ -2,12 +2,10 @@ package io.sc.platform.developer.controller.springboot;
import io.sc.platform.developer.wrapper.springboot.BeanWrapper; import io.sc.platform.developer.wrapper.springboot.BeanWrapper;
import io.sc.platform.orm.service.support.QueryParameter; import io.sc.platform.orm.service.support.QueryParameter;
import io.sc.platform.orm.service.support.QueryResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.beans.BeansEndpoint; import org.springframework.boot.actuate.beans.BeansEndpoint;
import org.springframework.boot.actuate.beans.BeansEndpoint.BeanDescriptor; import org.springframework.boot.actuate.beans.BeansEndpoint.BeanDescriptor;
import org.springframework.boot.actuate.beans.BeansEndpoint.ContextBeans; import org.springframework.boot.actuate.beans.BeansEndpoint.ContextBeans;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Order; import org.springframework.data.domain.Sort.Order;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -15,7 +13,10 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.*; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
@Controller @Controller
@RequestMapping("/api/developer/springboot/beans") @RequestMapping("/api/developer/springboot/beans")
@ -24,7 +25,7 @@ public class SpringbootBeansWebController {
@GetMapping("") @GetMapping("")
@ResponseBody @ResponseBody
public Page<BeanWrapper> beans(QueryParameter queryParameter){ public List<BeanWrapper> beans(QueryParameter queryParameter){
List<BeanWrapper> result =new ArrayList<>(); List<BeanWrapper> result =new ArrayList<>();
Map<String, ContextBeans> contexts =beansEndpoint.beans().getContexts(); Map<String, ContextBeans> contexts =beansEndpoint.beans().getContexts();
for(Map.Entry<String, ContextBeans> contextEntry : contexts.entrySet()){ for(Map.Entry<String, ContextBeans> contextEntry : contexts.entrySet()){
@ -53,7 +54,7 @@ public class SpringbootBeansWebController {
} }
} }
} }
return QueryResult.page(result); return result;
} }
private class BeanNameAscComparator implements Comparator<BeanWrapper> { private class BeanNameAscComparator implements Comparator<BeanWrapper> {

86
io.sc.platform.developer/src/main/java/io/sc/platform/developer/controller/springboot/SpringbootRequestMappingWebController.java

@ -0,0 +1,86 @@
package io.sc.platform.developer.controller.springboot;
import io.sc.platform.developer.wrapper.springboot.BeanWrapper;
import io.sc.platform.developer.wrapper.springboot.DespatcherServletWrapper;
import io.sc.platform.orm.service.support.QueryParameter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.web.mappings.HandlerMethodDescription;
import org.springframework.boot.actuate.web.mappings.MappingsEndpoint;
import org.springframework.boot.actuate.web.mappings.MappingsEndpoint.ApplicationMappings;
import org.springframework.boot.actuate.web.mappings.MappingsEndpoint.ContextMappings;
import org.springframework.boot.actuate.web.mappings.servlet.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.*;
@Controller
@RequestMapping("/api/developer/springboot/mappings")
public class SpringbootRequestMappingWebController {
@Autowired MappingsEndpoint mappingsEndpoint;
@GetMapping("dispatcherServletMappingDescriptions")
@ResponseBody
public List<DispatcherServletMappingDescription> dispatcherServletMappingDescriptions(QueryParameter queryParameter){
List<DispatcherServletMappingDescription> result =new ArrayList<>();
ApplicationMappings applicationMappings =mappingsEndpoint.mappings();
Map<String, ContextMappings> contexts =applicationMappings.getContexts();
for(Map.Entry<String, ContextMappings> contextEntry : contexts.entrySet()) {
ContextMappings contextMappings = contextEntry.getValue();
Map<String, Object> mappings = contextMappings.getMappings();
for (Map.Entry<String, Object> mapping : mappings.entrySet()) {
String name = mapping.getKey();
if ("dispatcherServlets".equalsIgnoreCase(name)) {
Map<String, List<DispatcherServletMappingDescription>> dispatcherServletMappings = (Map<String, List<DispatcherServletMappingDescription>>) mapping.getValue();
for(Map.Entry<String, List<DispatcherServletMappingDescription>> dispatcherServletMapping : dispatcherServletMappings.entrySet()) {
result.addAll(dispatcherServletMapping.getValue());
}
}
}
}
return result;
}
@GetMapping("filterRegistrationMappingDescriptions")
@ResponseBody
public List<FilterRegistrationMappingDescription> filterRegistrationMappingDescriptions(QueryParameter queryParameter){
List<FilterRegistrationMappingDescription> result =new ArrayList<>();
ApplicationMappings applicationMappings =mappingsEndpoint.mappings();
Map<String, ContextMappings> contexts =applicationMappings.getContexts();
for(Map.Entry<String, ContextMappings> contextEntry : contexts.entrySet()) {
ContextMappings contextMappings = contextEntry.getValue();
Map<String, Object> mappings = contextMappings.getMappings();
for (Map.Entry<String, Object> mapping : mappings.entrySet()) {
String name = mapping.getKey();
if ("servletFilters".equalsIgnoreCase(name)) {
List<FilterRegistrationMappingDescription> filters =(List<FilterRegistrationMappingDescription>)mapping.getValue();
result.addAll(filters);
}
}
}
return result;
}
@GetMapping("servletRegistrationMappingDescriptions")
@ResponseBody
public List<ServletRegistrationMappingDescription> servletRegistrationMappingDescriptions(QueryParameter queryParameter){
List<ServletRegistrationMappingDescription> result =new ArrayList<>();
ApplicationMappings applicationMappings =mappingsEndpoint.mappings();
Map<String, ContextMappings> contexts =applicationMappings.getContexts();
for(Map.Entry<String, ContextMappings> contextEntry : contexts.entrySet()) {
ContextMappings contextMappings = contextEntry.getValue();
Map<String, Object> mappings = contextMappings.getMappings();
for (Map.Entry<String, Object> mapping : mappings.entrySet()) {
String name = mapping.getKey();
if ("servlets".equalsIgnoreCase(name)) {
List<ServletRegistrationMappingDescription> servlets =(List<ServletRegistrationMappingDescription>)mapping.getValue();
result.addAll(servlets);
}
}
}
return result;
}
}

44
io.sc.platform.developer/src/main/java/io/sc/platform/developer/wrapper/springboot/DespatcherServletWrapper.java

@ -0,0 +1,44 @@
package io.sc.platform.developer.wrapper.springboot;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.Set;
public class DespatcherServletWrapper {
private String className;
private String methodName;
private Set<RequestMethod> httpMethods;
private Set<String> patterns;
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public Set<RequestMethod> getHttpMethods() {
return httpMethods;
}
public void setHttpMethods(Set<RequestMethod> httpMethods) {
this.httpMethods = httpMethods;
}
public Set<String> getPatterns() {
return patterns;
}
public void setPatterns(Set<String> patterns) {
this.patterns = patterns;
}
}

4
io.sc.platform.lcdp.frontend/package.json

@ -91,7 +91,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.67", "platform-core": "8.1.75",
"quasar": "2.14.2", "quasar": "2.14.2",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",
@ -100,4 +100,4 @@
"vue-router": "4.2.5", "vue-router": "4.2.5",
"vue-codemirror6": "1.2.0" "vue-codemirror6": "1.2.0"
} }
} }

4
io.sc.platform.mvc.frontend/package.json

@ -78,7 +78,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.67", "platform-core": "8.1.75",
"quasar": "2.14.2", "quasar": "2.14.2",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",
@ -100,4 +100,4 @@
"codemirror": "6.0.1", "codemirror": "6.0.1",
"vue-codemirror6": "1.2.0" "vue-codemirror6": "1.2.0"
} }
} }

6
io.sc.platform.security.frontend/package.json

@ -4,7 +4,7 @@
"description": "", "description": "",
"private": false, "private": false,
"keywords": [ "keywords": [
], ],
"author": "", "author": "",
"license": "ISC", "license": "ISC",
@ -99,6 +99,6 @@
"vue-dompurify-html": "5.0.1", "vue-dompurify-html": "5.0.1",
"vue-i18n": "9.8.0", "vue-i18n": "9.8.0",
"vue-router": "4.2.5", "vue-router": "4.2.5",
"platform-core": "8.1.67" "platform-core": "8.1.75"
} }
} }

4
io.sc.platform.system.frontend/package.json

@ -78,7 +78,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.70", "platform-core": "8.1.76",
"quasar": "2.14.2", "quasar": "2.14.2",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",
@ -100,4 +100,4 @@
"codemirror": "6.0.1", "codemirror": "6.0.1",
"vue-codemirror6": "1.2.0" "vue-codemirror6": "1.2.0"
} }
} }

65
io.sc.platform.system.frontend/src/i18n/messages.json

@ -1,4 +1,8 @@
{ {
"parameter.system":"System",
"parameter.system.homePage":"Home Page",
"parameter.login.encodePassword":"Login Password Encode",
"menu.system" : "System Manager", "menu.system" : "System Manager",
"menu.system.corporation" : "Corporation", "menu.system.corporation" : "Corporation",
"menu.system.user" : "User", "menu.system.user" : "User",
@ -17,33 +21,34 @@
"menu.system.monitor.resources" : "Resources", "menu.system.monitor.resources" : "Resources",
"menu.system.license" : "License", "menu.system.license" : "License",
"system.org.gridTitle":"Org Tree",
"system.announcement.gridTitle":"Announcement List",
"system.monitor.auditlog.gridTitle":"Audit Log List",
"system.user.grid.title":"User List", "system.user.grid.title":"User List",
"system.user.action.addUser":"Add User", "system.user.grid.toolbar.setPassword":"Set Password",
"system.user.action.addAllUser":"Add All User", "system.user.grid.toolbar.setAllPassword":"Set All Password",
"system.user.action.removeUser":"Remove User", "system.user.grid.toolbar.resetPassword":"Reset Password",
"system.user.action.removeAllUser":"Remove All User", "system.user.grid.toolbar.resetPassword.tip":"Are you sure to reset the user's password?",
"system.user.action.setPassword":"Set Password", "system.user.grid.toolbar.resetAllPassword":"Reset All Password",
"system.user.action.setAllPassword":"Set All Password", "system.user.grid.toolbar.resetAllPassword.tip":"Are you sure to reset ALL user's password?",
"system.user.action.resetPassword":"Reset Password", "system.user.selectRole.grid.title":"Role List",
"system.user.action.resetAllPassword":"Reset All Password", "system.user.selectRole.grid.toolbar.addRole":"Add Role",
"system.user.confirm.resetPassword":"Are you sure to reset the user's password?", "system.user.selectRole.grid.toolbar.addAllRole":"Add All Role",
"system.user.confirm.resetAllPassword":"Are you sure to reset ALL user's password?", "system.user.selectRole.grid.toolbar.addAllRole.tip":"Are you sure to add ALL roles to user?",
"system.user.selectRole.grid.toolbar.removeRole":"Remove Role",
"system.user.selectRole.grid.toolbar.removeRole.tip":"Are you sure to remove user's role?",
"system.user.selectRole.grid.toolbar.removeAllRole":"Remove All Role",
"system.user.selectRole.grid.toolbar.removeAllRole.tip":"Are you sure to remove user's ALL roles?",
"system.user.selectRole.dialog.title":"Available Role List",
"system.role.grid.title":"Role List", "system.role.grid.title":"Role List",
"system.role.action.addRole":"Add Role", "system.role.selectUser.grid.title":"User List",
"system.role.action.addAllRole":"Add All Role", "system.role.selectUser.grid.toolbar.addUser":"Add User",
"system.role.action.addAllRole.confirm":"Are you sure to add ALL roles to {userName} ({userLoginName})?", "system.role.selectUser.grid.toolbar.addAllUser":"Add All User",
"system.role.action.removeRole":"Remove Role", "system.role.selectUser.grid.toolbar.addAllUser.tip":"Are you sure to add ALL users to role?",
"system.role.action.removeRole.confirm":"Are you sure to remove {userName} ({userLoginName}) user's role {roleCode} ({roleName})?", "system.role.selectUser.grid.toolbar.removeUser":"Remove User",
"system.role.action.removeRole.confirms":"Are you sure to remove {userName} ({userLoginName}) user's {counter} roles?", "system.role.selectUser.grid.toolbar.removeUser.tip":"Are you sure to remove role's user?",
"system.role.action.removeAllRole":"Remove All Role", "system.role.selectUser.grid.toolbar.removeAllUser":"Remove All User",
"system.role.action.removeAllRole.confirm":"Are you sure to remove ALL roles to {userName} ({userLoginName})?", "system.role.selectUser.grid.toolbar.removeAllUser.tip":"Are you sure to remove role's ALL users?",
"system.role.selectUser.dialog.title":"Available User List",
"system.selectRoleByUserDialog.title":"Available Role List",
"system.org.grid.title":"Org Tree", "system.org.grid.title":"Org Tree",
@ -57,17 +62,5 @@
"system.monitor.log.tab.view":"Log View", "system.monitor.log.tab.view":"Log View",
"system.monitor.log.tab.download":"Log Download", "system.monitor.log.tab.download":"Log Download",
"system.monitor.log.tab.level":"Log Level", "system.monitor.log.tab.level":"Log Level",
"rawPassword": "Raw Password",
"newPassword": "New Password",
"confirmNewPassword": "Confirm New Password",
"accountExpired": "Expired",
"accountLocked": "Locked",
"credentialsExpired": "Credentials Expired",
"parameter.system":"System",
"parameter.system.homePage":"Home Page",
"parameter.login.encodePassword":"Login Password Encode"
} }

65
io.sc.platform.system.frontend/src/i18n/messages_tw_CN.json

@ -1,4 +1,8 @@
{ {
"parameter.system":"系統",
"parameter.system.homePage":"首頁",
"parameter.login.encodePassword":"登錄頁面密碼加密",
"menu.system" : "系統管理", "menu.system" : "系統管理",
"menu.system.corporation" : "法人管理", "menu.system.corporation" : "法人管理",
"menu.system.user" : "用戶管理", "menu.system.user" : "用戶管理",
@ -17,35 +21,39 @@
"menu.system.monitor.resources" : "系統資源", "menu.system.monitor.resources" : "系統資源",
"menu.system.license" : "許可證管理", "menu.system.license" : "許可證管理",
"system.org.gridTitle":"機構樹",
"system.announcement.gridTitle":"公告列表",
"system.monitor.auditlog.gridTitle":"審計日誌列表",
"system.user.grid.title":"用戶列表", "system.user.grid.title":"用戶列表",
"system.user.action.addUser":"添加用户", "system.user.grid.toolbar.setPassword":"設置密碼",
"system.user.action.addAllUser":"添加所有用户", "system.user.grid.toolbar.setAllPassword":"設置所有密碼",
"system.user.action.removeUser":"移除用户", "system.user.grid.toolbar.resetPassword":"重置密碼",
"system.user.action.removeAllUser":"移除所有用户", "system.user.grid.toolbar.resetPassword.tip":"您确定要重置用户密碼嗎?",
"system.user.action.setPassword":"設置密碼", "system.user.grid.toolbar.resetAllPassword":"重置所有密碼",
"system.user.action.setAllPassword":"設置所有密碼", "system.user.grid.toolbar.resetAllPassword.tip":"您确定要重置所有用户密碼嗎?",
"system.user.action.resetPassword":"重置密碼", "system.user.selectRole.grid.title":"角色列表",
"system.user.action.resetAllPassword":"重置所有密碼", "system.user.selectRole.grid.toolbar.addRole":"添加角色",
"system.user.confirm.resetPassword":"您確認要重置用戶密碼嗎?", "system.user.selectRole.grid.toolbar.addAllRole":"添加所有角色",
"system.user.confirm.resetAllPassword":"您確認要重置所有用戶密碼嗎?", "system.user.selectRole.grid.toolbar.addAllRole.tip":"您确定要给用户添加所有角色嗎?",
"system.user.selectRole.grid.toolbar.removeRole":"移除角色",
"system.user.selectRole.grid.toolbar.removeRole.tip":"您确定要移除用户的角色嗎?",
"system.user.selectRole.grid.toolbar.removeAllRole":"移除所有角色",
"system.user.selectRole.grid.toolbar.removeAllRole.tip":"您确定要將用户的所有角色移除嗎?",
"system.user.selectRole.dialog.title":"可選角色列表",
"system.role.grid.title":"角色列表", "system.role.grid.title":"角色列表",
"system.role.action.addRole":"添加角色", "system.role.selectUser.grid.title":"用戶列表",
"system.role.action.addAllRole":"添加所有角色", "system.role.selectUser.grid.toolbar.addUser":"添加用户",
"system.role.action.addAllRole.confirm":"您確認要給 {userName} ({userLoginName}) 用戶添加所有角色嗎?", "system.role.selectUser.grid.toolbar.addAllUser":"添加所有用户",
"system.role.action.removeRole":"移除角色", "system.role.selectUser.grid.toolbar.addAllUser.tip":"您确定要给角色添加所有用户嗎?",
"system.role.action.removeRole.confirm":"您確定要移除 {userName} ({userLoginName}) 用戶的角色 {roleCode} ({roleName}) 吗?", "system.role.selectUser.grid.toolbar.removeUser":"移除用户",
"system.role.action.removeRole.confirms":"您確定要移除 {userName} ({userLoginName}) 用戶的 {counter} 個角色吗?", "system.role.selectUser.grid.toolbar.removeUser.tip":"您确定要移除角色的用户嗎?",
"system.role.action.removeAllRole":"移除所有角色", "system.role.selectUser.grid.toolbar.removeAllUser":"移除所有用户",
"system.role.action.removeAllRole.confirm":"您確認要將 {userName} ({userLoginName}) 用戶的所有角色移除嗎?", "system.role.selectUser.grid.toolbar.removeAllUser.tip":"您确定要移除角色的所有用户嗎?",
"system.role.selectUser.dialog.title":"可選用戶列表",
"system.selectRoleByUserDialog.title":"可選角色列表",
"system.org.grid.title":"機構樹",
"system.org.gridTitle":"機構樹",
"system.announcement.gridTitle":"公告列表",
"system.monitor.auditlog.gridTitle":"審計日誌列表",
"system.menu.action.addTop":"新增頂級菜單", "system.menu.action.addTop":"新增頂級菜單",
"system.menu.action.addChild":"新增子菜單", "system.menu.action.addChild":"新增子菜單",
@ -57,14 +65,5 @@
"system.monitor.log.tab.download":"日誌下載", "system.monitor.log.tab.download":"日誌下載",
"system.monitor.log.tab.level":"日誌級別", "system.monitor.log.tab.level":"日誌級別",
"rawPassword": "原密碼",
"newPassword": "新密碼",
"confirmNewPassword": "確認新密碼",
"accountExpired": "過期",
"accountLocked": "鎖定",
"credentialsExpired": "密碼過期",
"parameter.system":"系統",
"parameter.system.homePage":"首頁",
"parameter.login.encodePassword":"登錄頁面密碼加密"
} }

67
io.sc.platform.system.frontend/src/i18n/messages_zh_CN.json

@ -1,4 +1,8 @@
{ {
"parameter.system":"系统",
"parameter.system.homePage":"首页",
"parameter.login.encodePassword":"登录页面密码加密",
"menu.system" : "系统管理", "menu.system" : "系统管理",
"menu.system.corporation" : "法人管理", "menu.system.corporation" : "法人管理",
"menu.system.user" : "用户管理", "menu.system.user" : "用户管理",
@ -17,33 +21,39 @@
"menu.system.monitor.resources" : "系统资源", "menu.system.monitor.resources" : "系统资源",
"menu.system.license" : "许可证管理", "menu.system.license" : "许可证管理",
"system.org.gridTitle":"机构树",
"system.announcement.gridTitle":"公告列表",
"system.monitor.auditlog.gridTitle":"审计日志列表",
"system.user.grid.title":"用户列表", "system.user.grid.title":"用户列表",
"system.user.action.addUser":"添加用户", "system.user.grid.toolbar.setPassword":"设置密码",
"system.user.action.addAllUser":"添加所有用户", "system.user.grid.toolbar.setAllPassword":"设置所有密码",
"system.user.action.removeUser":"移除用户", "system.user.grid.toolbar.resetPassword":"重置密码",
"system.user.action.removeAllUser":"移除所有用户", "system.user.grid.toolbar.resetPassword.tip":"您确定要重置用户密码吗?",
"system.user.action.setPassword":"设置密码", "system.user.grid.toolbar.resetAllPassword":"重置所有密码",
"system.user.action.setAllPassword":"设置所有密码", "system.user.grid.toolbar.resetAllPassword.tip":"您确定要重置所有用户密码吗?",
"system.user.action.resetPassword":"重置密码", "system.user.selectRole.grid.title":"角色列表",
"system.user.action.resetAllPassword":"重置所有密码", "system.user.selectRole.grid.toolbar.addRole":"添加角色",
"system.user.confirm.resetPassword":"您确定要重置用户密码吗?", "system.user.selectRole.grid.toolbar.addAllRole":"添加所有角色",
"system.user.confirm.resetAllPassword":"您确定要重置所有用户密码吗?", "system.user.selectRole.grid.toolbar.addAllRole.tip":"您确定要给用户添加所有角色吗?",
"system.user.selectRole.grid.toolbar.removeRole":"移除角色",
"system.user.selectRole.grid.toolbar.removeRole.tip":"您确定要移除用户的角色吗?",
"system.user.selectRole.grid.toolbar.removeAllRole":"移除所有角色",
"system.user.selectRole.grid.toolbar.removeAllRole.tip":"您确定要将用户的所有角色移除吗?",
"system.user.selectRole.dialog.title":"可选角色列表",
"system.role.grid.title":"角色列表", "system.role.grid.title":"角色列表",
"system.role.action.addRole":"添加角色", "system.role.selectUser.grid.title":"用户列表",
"system.role.action.addAllRole":"添加所有角色", "system.role.selectUser.grid.toolbar.addUser":"添加用户",
"system.role.action.addAllRole.confirm":"您确定要给 {userName} ({userLoginName}) 用户添加所有角色吗?", "system.role.selectUser.grid.toolbar.addAllUser":"添加所有用户",
"system.role.action.removeRole":"移除角色", "system.role.selectUser.grid.toolbar.addAllUser.tip":"您确定要给角色添加所有用户吗?",
"system.role.action.removeRole.confirm":"您确定要移除 {userName} ({userLoginName}) 用户的角色 {roleCode} ({roleName}) 吗?", "system.role.selectUser.grid.toolbar.removeUser":"移除用户",
"system.role.action.removeRole.confirms":"您确定要移除 {userName} ({userLoginName}) 用户的 {counter} 个角色吗?", "system.role.selectUser.grid.toolbar.removeUser.tip":"您确定要移除角色的用户吗?",
"system.role.action.removeAllRole":"移除所有角色", "system.role.selectUser.grid.toolbar.removeAllUser":"移除所有用户",
"system.role.action.removeAllRole.confirm":"您确定要将 {userName} ({userLoginName}) 用户的所有角色移除吗?", "system.role.selectUser.grid.toolbar.removeAllUser.tip":"您确定要移除角色的所有用户吗?",
"system.role.selectUser.dialog.title":"可选用户列表",
"system.selectRoleByUserDialog.title":"可选角色列表",
"system.org.gridTitle":"机构树",
"system.announcement.gridTitle":"公告列表",
"system.monitor.auditlog.gridTitle":"审计日志列表",
"system.org.grid.title":"机构树", "system.org.grid.title":"机构树",
@ -59,14 +69,5 @@
"system.monitor.log.tab.level":"日志级别", "system.monitor.log.tab.level":"日志级别",
"rawPassword": "原密码",
"newPassword": "新密码",
"confirmNewPassword": "确认新密码",
"accountExpired": "过期",
"accountLocked": "锁定",
"credentialsExpired": "密码过期",
"parameter.system":"系统",
"parameter.system.homePage":"首页",
"parameter.login.encodePassword":"登录页面密码加密"
} }

522
io.sc.platform.system.frontend/src/views/role/Role.vue

@ -1,311 +1,277 @@
<template> <template>
<q-splitter :model-value="70" class="w-full h-full"> <q-splitter :model-value="60" class="w-full h-full">
<template #before> <template #before>
<platform-grid <div class="px-1">
ref="roleGridRef" <w-grid
:table-props="{ borderded: false, flat: true }" ref="roleGridRef"
:query-form-cols-number="roleConfigure.queryFormColsNumber" :title="$t('system.role.grid.title')"
:query-form-cols-auto="roleConfigure.queryFormColsAuto" :data-url="Environment.apiContextPath('/api/system/role')"
:table-title="roleConfigure.tableTitle" selection="multiple"
:table-row-key="roleConfigure.tableRowKey" :query-form-fields="[
:table-init-load-data="roleConfigure.tableInitLoadData" { name: 'code', label: $t('code'), type: 'text' },
:table-data-url="roleConfigure.tableDataUrl" { name: 'name', label: $t('name'), type: 'text' },
:table-show-sort-no="false" { name: 'enable', label: $t('isEnable'), type: 'select', options: Options.yesNo() },
:table-columns="roleConfigure.tableColumns" { name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select', options: Options.enum(DataComeFromEnum) },
:table-left-column-sticky-number="roleConfigure.tableLeftColumnStickyNumber" ]"
:table-buttons="roleConfigure.tableButtons" :toolbar-configure="{ noIcon: false }"
:query-form-fields="roleConfigure.queryFormFields" :toolbar-actions="['query', 'refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'export']"
:table-pagination="roleConfigure.tablePagination" :columns="[
:add-form-props="roleConfigure.addFormProps" { name: 'code', label: $t('code') },
:table-dense="false" { name: 'name', label: $t('name') },
@row-click="roleConfigure.rowClickFun" { width: 80, name: 'status', label: $t('status'), format: Formater.enableTag() },
> { width: 100, name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) },
</platform-grid> { width: 120, name: 'lastModifier', label: $t('lastModifier') },
{ width: 120, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() },
]"
: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: Formater.yesNo() },
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate') },
{ name: 'corporationCode', label: $t('corporationCode') },
],
},
}"
@row-click="
(evt, row, index) => {
currentSelectedRoleId = row.id;
userGridRef?.refresh();
menuTreeGridRef?.refresh();
}
"
>
</w-grid>
</div>
</template> </template>
<template #after> <template #after>
<q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0"> <q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0" no-caps>
<q-tab name="menu" icon="bi-people" :label="$t('menu')" /> <q-tab name="menu" icon="bi-people" :label="$t('menu')" />
<q-tab name="user" icon="bi-diagram-3" :label="$t('user')" /> <q-tab name="user" icon="bi-diagram-3" :label="$t('user')" />
<q-tab name="authorization" icon="bi-diagram-3" label="权限" />
</q-tabs> </q-tabs>
<q-tab-panels v-model="selectedTabRef" animated swipeable keep-alive> <q-tab-panels v-model="selectedTabRef" animated swipeable keep-alive>
<q-tab-panel name="menu"> <q-tab-panel name="menu" class="px-0">
<w-tree-grid <w-grid
ref="menuTreeGridRef" ref="menuTreeGridRef"
title="菜单树" :tree="true"
label-key="titleI18nKey" :title="$t('system.org.grid.title')"
label-i18n :data-url="Environment.apiContextPath('/api/system/menu/listAllMenusWithSelectedStatusByRole?roleId=') + currentSelectedRoleId"
label-empty="--------------------" selection="multiple"
tick-strategy="leaf" :pageable="false"
:actions="menuConfigure.actions" :full-screen-button="false"
/> :toolbar-configure="{ noIcon: true }"
:toolbar-actions="[
'refresh',
'separator',
{
name: 'save',
label: $t('save'),
click: () => {
axios
.post(Environment.apiContextPath('/api/system/role/updateMenus'), {
one: userGridRef.getSelectedRows()[0].id,
many: menuTreeGridRef.getTicked(),
})
.then((response) => {});
},
},
'view',
]"
:columns="[
{
width: 100,
name: 'titleI18nKey',
label: $t('name'),
format: (value, row) => {
return $t(value);
},
},
{ width: 60, name: 'enable', label: $t('status'), format: Formater.enableTag() },
]"
: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: Formater.yesNo() },
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate') },
{ name: 'corporationCode', label: $t('corporationCode') },
],
},
}"
></w-grid>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="user"> <q-tab-panel name="user" class="px-0">
<platform-grid <w-grid
ref="userGridRef" ref="userGridRef"
:table-props="{ borderded: false, flat: true }" :title="$t('system.role.selectUser.grid.title')"
:query-form-cols-number="userConfigure.queryFormColsNumber" :fetch-data-url="Environment.apiContextPath('/api/system/user/queryUsersByRole?roleId=') + currentSelectedRoleId"
:hide-bottom="userConfigure.hideBottom" :auto-fetch-data="false"
:query-form-cols-auto="userConfigure.queryFormColsAuto" selection="multiple"
:table-title="userConfigure.tableTitle" :full-screen-button="false"
:table-row-key="userConfigure.tableRowKey" :toolbar-configure="{ noIcon: true }"
:table-init-load-data="userConfigure.tableInitLoadData" :toolbar-actions="[
:table-data-url="userConfigure.tableDataUrl" 'refresh',
:table-show-sort-no="false" 'separator',
:table-columns="userConfigure.tableColumns" {
:table-left-column-sticky-number="userConfigure.tableLeftColumnStickyNumber" name: 'addUser',
:table-buttons="userConfigure.tableButtons" label: $t('system.role.selectUser.grid.toolbar.addUser'),
:query-form-fields="userConfigure.queryFormFields" enableIf: () => {
:table-pagination="userConfigure.tablePagination" if (roleGridRef) {
table-selection="multiple" return roleGridRef.getSelectedRows().length > 0;
:table-dense="false" }
return false;
},
click: () => {
selectUserDialog.open({ roleId: roleGridRef.getSelectedRows()[0].id, userGrid: userGridRef });
},
},
{
name: 'addAllUser',
label: $t('system.role.selectUser.grid.toolbar.addAllUser'),
enableIf: () => {
if (roleGridRef) {
return roleGridRef.getSelectedRows().length > 0;
}
return false;
},
click: () => {
const selectedRole = roleGridRef.getSelectedRows()[0];
DialogManager.confirm($t('system.role.selectUser.grid.toolbar.addAllUser.tip'), () => {
axios
.post(Environment.apiContextPath('/api/system/role/addAllUsers'), {
one: selectedRole.id,
many: [],
})
.then((response) => {
userGridRef?.refresh();
});
});
},
},
'separator',
{
name: 'removeUser',
label: $t('system.role.selectUser.grid.toolbar.removeUser'),
enableIf: () => {
if (roleGridRef && userGridRef) {
return roleGridRef.getSelectedRows().length > 0 && userGridRef.getSelectedRows().length > 0;
}
return false;
},
click: (selecteds) => {
const selectedRole = roleGridRef.getSelectedRows()[0];
const userIds = Tools.extractProperties(selecteds, 'id');
DialogManager.confirm($t('system.role.selectUser.grid.toolbar.removeUser.tip'), () => {
axios
.post(Environment.apiContextPath('/api/system/role/removeUsers'), {
one: selectedRole.id,
many: userIds,
})
.then((response) => {
userGridRef?.refresh();
});
});
},
},
{
name: 'removeAllUser',
label: $t('system.role.selectUser.grid.toolbar.removeAllUser'),
enableIf: () => {
if (roleGridRef) {
return roleGridRef.getSelectedRows().length > 0;
}
return false;
},
click: () => {
const selectedRole = roleGridRef.getSelectedRows()[0];
DialogManager.confirm($t('system.role.selectUser.grid.toolbar.removeAllUser.tip'), () => {
axios
.post(Environment.apiContextPath('/api/system/role/removeAllUsers'), {
one: selectedRole.id,
many: [],
})
.then((response) => {
userGridRef?.refresh();
});
});
},
},
'separator',
'view',
]"
:columns="[
{ width: 100, name: 'loginName', label: t('loginName') },
{ width: 100, name: 'userName', label: t('userName') },
{
name: 'status',
label: $t('status'),
format: (value, row) => {
return {
componentType: UserStatusTag,
attrs: row,
};
},
},
]"
> >
</platform-grid> </w-grid>
</q-tab-panel>
<q-tab-panel name="authorization">
<q-splitter v-model="splitterModel">
<template #before>
<q-tabs v-model="authorizationModel" vertical>
<q-tab name="统计报表-减值结果" label="统计报表-减值结果" />
<q-tab name="统计报表-阶段迁徙分析" label="统计报表-阶段迁徙分析" />
<q-tab name="统计报表-三分类汇总" label="统计报表-三分类汇总" />
<q-tab name="统计报表-阶段汇总" label="统计报表-阶段汇总" />
<q-tab name="用户管理" label="用户管理" />
<q-tab name="公告管理" label="公告管理" />
<q-tab name="消息管理" label="消息管理" />
<q-tab name="参数管理" label="参数管理" />
<q-tab name="数据字典" label="数据字典" />
<q-tab name="国际化多语言" label="国际化多语言" />
<q-tab name="流程管理" label="流程管理" />
</q-tabs>
</template>
<template #after>
<q-tab-panels v-model="authorizationModel" animated swipeable vertical transition-prev="jump-up" transition-next="jump-up">
<q-tab-panel name="统计报表-减值结果">
<q-checkbox v-model="authorizationReactive.query" label="查询" />
<q-checkbox v-model="authorizationReactive.query" label="报表导出" />
</q-tab-panel>
<q-tab-panel name="用户管理">
<q-checkbox v-model="authorizationReactive.query" label="查询" />
<q-checkbox v-model="authorizationReactive.query" label="新增" />
<q-checkbox v-model="authorizationReactive.query" label="复制" />
<q-checkbox v-model="authorizationReactive.query" label="修改" />
<q-checkbox v-model="authorizationReactive.query" label="删除" />
<q-checkbox v-model="authorizationReactive.query" label="查看" />
<q-checkbox v-model="authorizationReactive.query" label="数据导入" />
<q-checkbox v-model="authorizationReactive.query" label="流程审批" />
</q-tab-panel>
</q-tab-panels>
<div class="row justify-end items-start content-start">
<q-btn label="保存" outline></q-btn>
</div>
</template>
</q-splitter>
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</template> </template>
<SelectUserDialog ref="selectUserDialog" title="可选用户列表" :maximized="false" width="50%" height="500px"></SelectUserDialog> <SelectUserDialog ref="selectUserDialog"></SelectUserDialog>
</q-splitter> </q-splitter>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive } from 'vue'; import { ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { Environment, axios } from 'platform-core'; import { Environment, axios, DialogManager, Tools, EnumTools, Options, Formater } from 'platform-core';
import SelectUserDialog from './SelectUserDialog.vue'; import SelectUserDialog from './SelectUserDialog.vue';
import UserStatusTag from '../user/UserStatusTag.vue';
const { t } = useI18n(); const { t } = useI18n();
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom');
const roleGridRef = ref(); const roleGridRef = ref();
const userGridRef = ref(); const userGridRef = ref();
const menuTreeGridRef = ref(); const menuTreeGridRef = ref();
const selectUserDialog = ref(); const selectUserDialog = ref();
const selectedTabRef = ref('menu'); const selectedTabRef = ref('user');
const currentSelectedRoleId = ref('');
const authorizationReactive = reactive({
query: true,
add: true,
});
const splitterModel = ref(40);
const authorizationModel = ref('统计报表-减值结果');
const roleConfigure = {
queryFormColsNumber: 4,
queryFormColsAuto: false,
queryFormFields: [
{ label: t('code'), modelName: 'code', type: 'text' },
{ label: t('name'), modelName: 'name', type: 'text' },
{
label: t('enable'),
modelName: 'enable',
type: 'select',
options: [
{ value: true, label: '是' },
{ value: false, label: '否' },
],
},
{
label: t('dataComeFrom'),
modelName: 'dataComeFrom',
type: 'select',
options: [
{ value: 'MANUAL', label: t('io.sc.platform.orm.api.enums.DataComeFrom.MANUAL') },
{ value: 'AUTO', label: t('io.sc.platform.orm.api.enums.DataComeFrom.AUTO') },
],
},
],
hideBottom: false,
tableInitLoadData: true,
tableLeftColumnStickyNumber: 0,
tableTitle: t('system.role.gridTitle'),
tableRowKey: 'id',
tableDataUrl: Environment.apiContextPath('/api/system/role'),
tablePagination: {
sortBy: 'lastModifyDate',
descending: true,
reqPageStart: 0,
rowsPerPage: 10,
},
tableButtons: ['query', 'reset', 'separator', 'refresh', 'add', 'edit', 'delete', 'separator', 'view', 'separator', 'inFullscreen'],
tableColumns: [
{ width: 100, name: 'code', label: t('code') },
{ width: 100, name: 'name', label: t('name') },
{ width: 100, name: 'enable', label: t('isEnable'), format: (value) => (value ? t('yes') : t('no')) },
{ width: 100, name: 'dataComeFrom', label: t('dataComeFrom') },
{ width: 110, name: 'lastModifier', label: t('lastModifier') },
{ width: 115, name: 'lastModifyDate', label: t('lastModifyDate') },
],
addFormProps: {
dialogInitWidth: '50%',
dialogInitHeight: '90%',
formColsNumber: 1,
formColsAuto: false,
formFields: [
{ modelName: 'code', label: t('code'), type: 'text', required: true },
{ modelName: 'name', label: t('name'), type: 'text', required: true },
{ modelName: 'description', label: t('description'), type: 'textarea' },
],
},
rowClickFun: (evt, row, index) => {
// push
roleGridRef.value.getSelectedRows().splice(0, roleGridRef.value.getSelectedRows().length);
roleGridRef.value.getSelectedRows().push(row);
if (menuTreeGridRef.value) {
axios.get(Environment.apiContextPath('/api/system/menu/listAllMenusWithSelectedStatusByRole?roleId=') + row.id).then((response) => {
menuTreeGridRef.value.setNodes(response.data);
});
}
if (userGridRef.value) {
axios.get(Environment.apiContextPath('/api/system/user/queryUsersByRole?roleId=') + row.id).then((response) => {
userGridRef.value.replaceRowsFun(response.data.content);
});
}
},
};
const userConfigure = {
queryFormColsNumber: 4,
queryFormColsAuto: false,
queryFormFields: [],
hideBottom: true,
tableInitLoadData: false,
tableLeftColumnStickyNumber: 0,
tableTitle: t('system.user.gridTitle'),
tableRowKey: 'id',
tableDataUrl: '',
tablePagination: {
sortBy: 'lastModifyDate',
descending: true,
reqPageStart: 0,
rowsPerPage: 0,
},
tableButtons: [
'refresh',
'inFullscreen',
{
name: 'addUser',
label: t('system.user.action.addUser'),
icon: '',
enable: () => {
if (roleGridRef.value) {
return roleGridRef.value.getSelectedRows().length > 0;
}
return false;
},
click: () => {
selectUserDialog.value.show({ userGrid: userGridRef, roleGrid: roleGridRef });
},
},
{
name: 'addAllUser',
label: t('system.user.action.addAllUser'),
icon: '',
enable: () => {},
click: () => {
axios
.post(Environment.apiContextPath('/api/system/role/addAllUsers'), {
one: roleGridRef.value.getSelectedRows()[0].id,
many: [],
})
.then((response) => {
axios.get(Environment.apiContextPath('/api/system/user/queryUsersByRole?roleId=') + roleGridRef.value.getSelectedRows()[0].id).then((response) => {
userGridRef.value.replaceRowsFun(response.data.content);
});
});
},
},
{
name: 'removeUser',
label: t('system.user.action.removeUser'),
icon: '',
enable: () => {},
click: () => {
const userIds = [];
for (const user of userGridRef.value.getSelectedRows()) {
userIds.push(user.id);
}
axios
.post(Environment.apiContextPath('/api/system/role/removeUsers'), {
one: roleGridRef.value.getSelectedRows()[0].id,
many: userIds,
})
.then((response) => {
axios.get(Environment.apiContextPath('/api/system/user/queryUsersByRole?roleId=') + roleGridRef.value.getSelectedRows()[0].id).then((response) => {
userGridRef.value.replaceRowsFun(response.data.content);
});
});
},
},
{
name: 'removeAllUser',
label: t('system.user.action.removeAllUser'),
icon: '',
enable: () => {},
click: () => {
axios
.post(Environment.apiContextPath('/api/system/role/removeAllUsers'), {
one: roleGridRef.value.getSelectedRows()[0].id,
many: [],
})
.then((response) => {
axios.get(Environment.apiContextPath('/api/system/user/queryUsersByRole?roleId=') + roleGridRef.value.getSelectedRows()[0].id).then((response) => {
userGridRef.value.replaceRowsFun(response.data.content);
});
});
},
},
],
tableColumns: [
{ width: 100, name: 'loginName', label: t('loginName') },
{ width: 100, name: 'userName', label: t('userName') },
{ width: 80, name: 'enable', label: t('isEnable'), format: (value) => (value ? t('yes') : t('no')) },
],
};
const menuConfigure = { const menuConfigure = {
actions: [ actions: [

208
io.sc.platform.system.frontend/src/views/role/SelectUserDialog.vue

@ -1,152 +1,100 @@
<template> <template>
<div> <w-dialog
<q-dialog ref="dialogRef" allow-focus-outside v-bind="attrs"> ref="dialogRef"
<q-card :title="$t('system.role.selectUser.dialog.title')"
:style="{ width="800px"
width: attrs.maximized ? '100vw' : width, height="500px"
'max-width': '100vw', :can-maximize="false"
height: attrs.maximized ? '100vh' : height, :buttons="[
'max-height': '100vh', {
}" label: $t('confirm'),
> click: () => {
<q-card-section :style="headerStyle"> const userIds = Tools.extractProperties(gridRef.getSelectedRows(), 'id');
<div class="flex justify-between"> axios
<div class="text-h6">{{ title }}</div> .post(Environment.apiContextPath('/api/system/role/addUsers'), {
<div class="flex justify-end q-gutter-md"> one: roleId,
<q-btn :label="$t('confirm')" dense color="primary" style="width: 100px" @click="addUsers" /> many: userIds,
<q-btn v-close-popup dense flat icon="close" :title="$t('close')"> </q-btn> })
</div> .then((response) => {
</div> userGridRef?.refresh();
</q-card-section> close();
<q-card-section class="q-pt-none" :style="bodyStyle"> });
<platform-grid },
ref="gridRef" },
:table-props="{ borderded: false, flat: true }" ]"
:query-form-cols-number="userConfigure.queryFormColsNumber" >
:hide-bottom="userConfigure.hideBottom" <div class="px-2">
:query-form-cols-auto="userConfigure.queryFormColsAuto" <w-grid
:table-title="userConfigure.tableTitle" ref="gridRef"
:table-row-key="userConfigure.tableRowKey" :title="$t('system.user.grid.title')"
:table-init-load-data="userConfigure.tableInitLoadData" selection="multiple"
:table-data-url="userConfigure.tableDataUrl" :full-screen-button="false"
:table-show-sort-no="false" :toolbar-configure="{ noIcon: false }"
:table-columns="userConfigure.tableColumns" :toolbar-actions="['query', 'refresh']"
:table-left-column-sticky-number="userConfigure.tableLeftColumnStickyNumber" :query-form-fields="[
:table-buttons="userConfigure.tableButtons" { name: 'loginName', label: $t('loginName'), type: 'text' },
:query-form-fields="userConfigure.queryFormFields" { name: 'userName', label: $t('userName'), type: 'text' },
:table-pagination="userConfigure.tablePagination" {
table-selection="multiple" name: 'enable',
:table-dense="false" label: $t('enable'),
> type: 'select',
</platform-grid> options: Options.yesNo(),
</q-card-section> queryOperator: 'equals',
</q-card> },
</q-dialog> {
</div> name: 'dataComeFrom',
label: $t('dataComeFrom'),
type: 'select',
options: Options.enum(DataComeFromEnum),
queryOperator: 'equals',
},
]"
:auto-fetch-data="false"
:fetch-data-url="Environment.apiContextPath('/api/system/user/queryOtherUsersByRole?roleId=' + roleId)"
:columns="[
{ name: 'loginName', label: $t('loginName') },
{ name: 'userName', label: $t('userName') },
{
name: 'status',
label: t('status'),
format: Formater.enableTag(),
},
{ name: 'lastModifier', label: t('lastModifier') },
{ name: 'lastModifyDate', label: t('lastModifyDate'), format: Formater.dateOnly() },
]"
></w-grid>
</div>
</w-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useAttrs, ref, onMounted, nextTick } from 'vue'; import { ref, nextTick } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { axios, Environment } from 'platform-core'; import { axios, Environment, Tools, EnumTools, Options, Formater } from 'platform-core';
const attrs = useAttrs();
const props = defineProps({
headerStyle: { type: String, default: 'width:100%;padding: 16px 8px 4px 16px' },
bodyStyle: { type: String, default: 'padding: 0px 8px 0px 8px;height:calc(100%)' },
title: { type: String, default: '' },
width: { type: String, default: '70%' },
height: { type: String, default: '70%' },
});
const { t } = useI18n(); const { t } = useI18n();
const dialogRef = ref(); const dialogRef = ref();
const gridRef = ref(); const gridRef = ref();
let userGridRef, roleGridRef; let roleId, userGridRef;
const userConfigure = {
queryFormColsNumber: 4,
queryFormColsAuto: false,
hideBottom: true,
tableInitLoadData: false,
tableLeftColumnStickyNumber: 0,
tableTitle: '',
tableRowKey: 'id',
tableDataUrl: '',
tablePagination: {
sortBy: 'lastModifyDate',
descending: true,
reqPageStart: 0,
rowsPerPage: 0,
},
tableButtons: ['query', 'refresh'],
queryFormFields: [
{ label: t('loginName'), modelName: 'loginName', type: 'text' },
{ label: t('userName'), modelName: 'userName', type: 'text' },
{
label: t('enable'),
modelName: 'enable',
type: 'select',
options: [
{ value: true, label: '是' },
{ value: false, label: '否' },
],
},
{
label: t('dataComeFrom'),
modelName: 'dataComeFrom',
type: 'select',
options: [
{ value: 'MANUAL', label: t('io.sc.platform.orm.api.enums.DataComeFrom.MANUAL') },
{ value: 'AUTO', label: t('io.sc.platform.orm.api.enums.DataComeFrom.AUTO') },
],
},
],
tableColumns: [
{ width: 100, name: 'loginName', label: t('loginName') },
{ width: 100, name: 'userName', label: t('userName') },
{ width: 80, name: 'enable', label: t('isEnable'), format: (value) => (value ? t('yes') : t('no')) },
],
};
const addUsers = () => {
const userIds = [];
for (const user of gridRef.value.getSelectedRows()) {
userIds.push(user.id);
}
axios
.post(Environment.apiContextPath('/api/system/role/addUsers'), {
one: roleGridRef.value.getSelectedRows()[0].id,
many: userIds,
})
.then((response) => {
axios.get(Environment.apiContextPath('/api/system/user/queryUsersByRole?roleId=') + roleGridRef.value.getSelectedRows()[0].id).then((response) => {
userGridRef.value.replaceRowsFun(response.data.content);
});
dialogRef.value.hide();
});
};
const show = (param: object) => { const open = (param: object) => {
roleId = param.roleId;
userGridRef = param.userGrid; userGridRef = param.userGrid;
roleGridRef = param.roleGrid;
const currentRoleId = roleGridRef.value.getSelectedRows()[0].id;
dialogRef.value.show(); dialogRef.value.show();
nextTick(() => { nextTick(() => {
axios.get(Environment.apiContextPath('/api/system/user/queryOtherUsersByRole?roleId=') + currentRoleId).then((response) => { gridRef.value.refresh();
gridRef.value.replaceRowsFun(response.data.content);
});
}); });
}; };
const hide = () => { const close = () => {
dialogRef.value.hide(); dialogRef.value.hide();
}; };
defineExpose({ defineExpose({
show, open,
hide, close,
}); });
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom');
</script> </script>

15
io.sc.platform.system.frontend/src/views/user/SelectRoleDialog.vue

@ -16,9 +16,7 @@
many: roleIds, many: roleIds,
}) })
.then((response) => { .then((response) => {
axios.get(Environment.apiContextPath('/api/system/role/queryRolesByUser?userId=') + userId).then((response) => { roleGridRef?.refresh();
roleGridRef.replaceRows(response.data.content);
});
close(); close();
}); });
}, },
@ -59,12 +57,7 @@
{ {
name: 'status', name: 'status',
label: t('status'), label: t('status'),
format: (value, row) => { format: Formater.enableTag(),
return {
componentType: RoleStatusTag,
attrs: row,
};
},
}, },
{ name: 'lastModifier', label: t('lastModifier') }, { name: 'lastModifier', label: t('lastModifier') },
{ name: 'lastModifyDate', label: t('lastModifyDate') }, { name: 'lastModifyDate', label: t('lastModifyDate') },
@ -77,7 +70,6 @@
import { ref, nextTick } from 'vue'; import { ref, nextTick } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { axios, Environment, Tools, EnumTools, Options, Formater } from 'platform-core'; import { axios, Environment, Tools, EnumTools, Options, Formater } from 'platform-core';
import RoleStatusTag from './RoleStatusTag.vue';
const { t } = useI18n(); const { t } = useI18n();
@ -89,11 +81,10 @@ EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom').then((data) => {
DataComeFromEnum.value = data; DataComeFromEnum.value = data;
}); });
let userId, userGridRef, roleGridRef; let userId, roleGridRef;
const open = (param: object) => { const open = (param: object) => {
userId = param.userId; userId = param.userId;
userGridRef = param.userGrid;
roleGridRef = param.roleGrid; roleGridRef = param.roleGrid;
dialogRef.value.show(); dialogRef.value.show();

3
io.sc.platform.system.frontend/src/views/user/SetPasswordDialog.vue

@ -7,7 +7,8 @@
:can-maximize="false" :can-maximize="false"
:buttons="[ :buttons="[
{ {
label: $t('submit'), label: $t('confirm'),
noCaps: true,
click: () => { click: () => {
axios axios
.post(Environment.apiContextPath('/api/system/user/' + actionType), { .post(Environment.apiContextPath('/api/system/user/' + actionType), {

159
io.sc.platform.system.frontend/src/views/user/User.vue

@ -6,11 +6,12 @@
ref="userGridRef" ref="userGridRef"
:title="$t('system.user.grid.title')" :title="$t('system.user.grid.title')"
selection="multiple" selection="multiple"
:data-url="Environment.apiContextPath('/api/system/user')"
:query-form-fields="[ :query-form-fields="[
{ name: 'loginName', label: $t('loginName'), type: 'text' }, { name: 'loginName', label: $t('loginName'), type: 'text' },
{ name: 'userName', label: $t('userName'), type: 'text' }, { name: 'userName', label: $t('userName'), type: 'text' },
{ name: 'enable', label: $t('isEnable'), type: 'select', options: Options.yesNo() }, { name: 'enable', label: $t('isEnable'), type: 'select', options: Options.yesNo(), queryOperator: 'equals' },
{ name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select', options: Options.enum(DataComeFromEnum) }, { name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select', options: Options.enum(DataComeFromEnum), queryOperator: 'equals' },
]" ]"
:toolbar-configure="{ noIcon: false }" :toolbar-configure="{ noIcon: false }"
:toolbar-actions="[ :toolbar-actions="[
@ -24,7 +25,7 @@
'separator', 'separator',
{ {
name: 'setPassword', name: 'setPassword',
label: $t('system.user.action.setPassword'), label: $t('system.user.grid.toolbar.setPassword'),
icon: 'bi-shield-check', icon: 'bi-shield-check',
enableIf: function (selecteds) { enableIf: function (selecteds) {
return selecteds.length > 0; return selecteds.length > 0;
@ -35,7 +36,7 @@
}, },
{ {
name: 'setAllPassword', name: 'setAllPassword',
label: $t('system.user.action.setAllPassword'), label: $t('system.user.grid.toolbar.setAllPassword'),
icon: 'bi-shield', icon: 'bi-shield',
enableIf: function (selecteds) { enableIf: function (selecteds) {
return true; return true;
@ -47,29 +48,29 @@
'separator', 'separator',
{ {
name: 'resetPassword', name: 'resetPassword',
label: $t('system.user.action.resetPassword'), label: $t('system.user.grid.toolbar.resetPassword'),
icon: 'bi-shield-fill-check', icon: 'bi-shield-fill-check',
enableIf: function (selecteds) { enableIf: function (selecteds) {
return selecteds.length > 0; return selecteds.length > 0;
}, },
click: function (selecteds) { click: function (selecteds) {
DialogManager.confirm(t('system.user.confirm.resetPassword'), () => { DialogManager.confirm($t('system.user.grid.toolbar.resetPassword.tip'), () => {
const userIds = Tools.extractProperties(selecteds, 'id'); const userIds = Tools.extractProperties(selecteds, 'id');
axios.post(Environment.apiContextPath('/api/system/user/resetPassword'), userIds).then(() => { axios.post(Environment.apiContextPath('/api/system/user/resetPassword'), userIds).then(() => {
NotifyManager.info(t('operationSuccess')); NotifyManager.info($t('operationSuccess'));
}); });
}); });
}, },
}, },
{ {
name: 'resetAllPassword', name: 'resetAllPassword',
label: $t('system.user.action.resetAllPassword'), label: $t('system.user.grid.toolbar.resetAllPassword'),
icon: 'bi-shield-fill', icon: 'bi-shield-fill',
enableIf: function (selecteds) { enableIf: function (selecteds) {
return true; return true;
}, },
click: function () { click: function () {
DialogManager.confirm($t('system.user.confirm.resetAllPassword'), () => { DialogManager.confirm($t('system.user.grid.toolbar.resetAllPassword.tip'), () => {
axios.post(Environment.apiContextPath('/api/system/user/resetAllPassword')).then(() => { axios.post(Environment.apiContextPath('/api/system/user/resetAllPassword')).then(() => {
setPasswordDialogRef.value.hide(); setPasswordDialogRef.value.hide();
NotifyManager.info($t('operationSuccess')); NotifyManager.info($t('operationSuccess'));
@ -81,8 +82,6 @@
'view', 'view',
'export', 'export',
]" ]"
:data-url="Environment.apiContextPath('/api/system/user')"
row-key="id"
:columns="[ :columns="[
{ name: 'loginName', label: $t('loginName') }, { name: 'loginName', label: $t('loginName') },
{ name: 'userName', label: $t('userName') }, { name: 'userName', label: $t('userName') },
@ -166,7 +165,6 @@
}" }"
@row-click=" @row-click="
(evt, row, index) => { (evt, row, index) => {
console.log(row.id);
currentSelectedUserId = row.id; currentSelectedUserId = row.id;
roleGridRef?.refresh(); roleGridRef?.refresh();
orgTreeGridRef?.refresh(); orgTreeGridRef?.refresh();
@ -177,7 +175,7 @@
</template> </template>
<template #after> <template #after>
<div class="px-1"> <div class="px-1">
<q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0"> <q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0" no-caps>
<q-tab name="role" icon="bi-people" :label="$t('role')" /> <q-tab name="role" icon="bi-people" :label="$t('role')" />
<q-tab name="org" icon="bi-diagram-3" :label="$t('org')" /> <q-tab name="org" icon="bi-diagram-3" :label="$t('org')" />
</q-tabs> </q-tabs>
@ -186,8 +184,8 @@
<q-tab-panel name="role" class="px-0"> <q-tab-panel name="role" class="px-0">
<w-grid <w-grid
ref="roleGridRef" ref="roleGridRef"
:title="$t('system.role.grid.title')" :title="$t('system.user.selectRole.grid.title')"
:data-url="Environment.apiContextPath('/api/system/role/queryRolesByUser') + currentSelectedUserId" :fetch-data-url="Environment.apiContextPath('/api/system/role/queryRolesByUser?userId=') + currentSelectedUserId"
:auto-fetch-data="false" :auto-fetch-data="false"
selection="multiple" selection="multiple"
:full-screen-button="false" :full-screen-button="false"
@ -197,7 +195,7 @@
'separator', 'separator',
{ {
name: 'addRole', name: 'addRole',
label: $t('system.role.action.addRole'), label: $t('system.user.selectRole.grid.toolbar.addRole'),
enableIf: () => { enableIf: () => {
if (userGridRef) { if (userGridRef) {
return userGridRef.getSelectedRows().length > 0; return userGridRef.getSelectedRows().length > 0;
@ -205,12 +203,12 @@
return false; return false;
}, },
click: () => { click: () => {
selectRoleDialog.open({ userId: userGridRef.getSelectedRows()[0].id, userGrid: userGridRef, roleGrid: roleGridRef }); selectRoleDialog.open({ userId: userGridRef.getSelectedRows()[0].id, roleGrid: roleGridRef });
}, },
}, },
{ {
name: 'addAllRole', name: 'addAllRole',
label: $t('system.role.action.addAllRole'), label: $t('system.user.selectRole.grid.toolbar.addAllRole'),
enableIf: () => { enableIf: () => {
if (userGridRef) { if (userGridRef) {
return userGridRef.getSelectedRows().length > 0; return userGridRef.getSelectedRows().length > 0;
@ -219,27 +217,22 @@
}, },
click: () => { click: () => {
const selectedUser = userGridRef.getSelectedRows()[0]; const selectedUser = userGridRef.getSelectedRows()[0];
DialogManager.confirm( DialogManager.confirm($t('system.user.selectRole.grid.toolbar.addAllRole.tip'), () => {
$t('system.role.action.addAllRole.confirm', { userLoginName: selectedUser.loginName, userName: selectedUser.userName }), axios
() => { .post(Environment.apiContextPath('/api/system/user/addAllRoles'), {
axios one: selectedUser.id,
.post(Environment.apiContextPath('/api/system/user/addAllRoles'), { many: [],
one: selectedUser.id, })
many: [], .then((response) => {
}) roleGridRef?.refresh();
.then((response) => { });
axios.get(Environment.apiContextPath('/api/system/role/queryRolesByUser?userId=') + selectedUser.id).then((response) => { });
roleGridRef.replaceRows(response.data.content);
});
});
},
);
}, },
}, },
'separator', 'separator',
{ {
name: 'removeRole', name: 'removeRole',
label: $t('system.role.action.removeRole'), label: $t('system.user.selectRole.grid.toolbar.removeRole'),
enableIf: () => { enableIf: () => {
if (userGridRef && roleGridRef) { if (userGridRef && roleGridRef) {
return userGridRef.getSelectedRows().length > 0 && roleGridRef.getSelectedRows().length > 0; return userGridRef.getSelectedRows().length > 0 && roleGridRef.getSelectedRows().length > 0;
@ -249,33 +242,21 @@
click: (selecteds) => { click: (selecteds) => {
const selectedUser = userGridRef.getSelectedRows()[0]; const selectedUser = userGridRef.getSelectedRows()[0];
const roleIds = Tools.extractProperties(selecteds, 'id'); const roleIds = Tools.extractProperties(selecteds, 'id');
const messageKey = roleIds.length > 1 ? 'system.role.action.removeRole.confirms' : 'system.role.action.removeRole.confirm'; DialogManager.confirm($t('system.user.selectRole.grid.toolbar.removeRole.tip'), () => {
DialogManager.confirm( axios
t(messageKey, { .post(Environment.apiContextPath('/api/system/user/removeRoles'), {
userLoginName: selectedUser.loginName, one: selectedUser.id,
userName: selectedUser.userName, many: roleIds,
roleCode: selecteds[0].code, })
roleName: selecteds[0].name, .then((response) => {
counter: selecteds.length, roleGridRef?.refresh();
}), });
() => { });
axios
.post(Environment.apiContextPath('/api/system/user/removeRoles'), {
one: selectedUser.id,
many: roleIds,
})
.then((response) => {
axios.get(Environment.apiContextPath('/api/system/role/queryRolesByUser?userId=') + selectedUser.id).then((response) => {
roleGridRef.replaceRows(response.data.content);
});
});
},
);
}, },
}, },
{ {
name: 'removeAllRole', name: 'removeAllRole',
label: $t('system.role.action.removeAllRole'), label: $t('system.user.selectRole.grid.toolbar.removeAllRole'),
enableIf: () => { enableIf: () => {
if (userGridRef && roleGridRef) { if (userGridRef && roleGridRef) {
return userGridRef.getSelectedRows().length > 0 && roleGridRef.getRows().length > 0; return userGridRef.getSelectedRows().length > 0 && roleGridRef.getRows().length > 0;
@ -284,21 +265,16 @@
}, },
click: () => { click: () => {
const selectedUser = userGridRef.getSelectedRows()[0]; const selectedUser = userGridRef.getSelectedRows()[0];
DialogManager.confirm( DialogManager.confirm($t('system.user.selectRole.grid.toolbar.removeAllRole.tip'), () => {
t('system.role.action.removeAllRole.confirm', { userLoginName: selectedUser.loginName, userName: selectedUser.userName }), axios
() => { .post(Environment.apiContextPath('/api/system/user/removeAllRoles'), {
axios one: selectedUser.id,
.post(Environment.apiContextPath('/api/system/user/removeAllRoles'), { many: [],
one: selectedUser.id, })
many: [], .then((response) => {
}) roleGridRef?.refresh();
.then((response) => { });
axios.get(Environment.apiContextPath('/api/system/role/queryRolesByUser?userId=') + selectedUser.id).then((response) => { });
roleGridRef.replaceRows(response.data.content);
});
});
},
);
}, },
}, },
'separator', 'separator',
@ -311,12 +287,7 @@
width: 60, width: 60,
name: 'status', name: 'status',
label: $t('status'), label: $t('status'),
format: (value, row) => { format: Formater.enableTag(),
return {
componentType: RoleStatusTag,
attrs: row,
};
},
}, },
]" ]"
:viewer="{ :viewer="{
@ -346,6 +317,7 @@
:title="$t('system.org.grid.title')" :title="$t('system.org.grid.title')"
:data-url="Environment.apiContextPath('/api/system/org/listAllOrgsWithSelectedStatusByUser?userId=') + currentSelectedUserId" :data-url="Environment.apiContextPath('/api/system/org/listAllOrgsWithSelectedStatusByUser?userId=') + currentSelectedUserId"
selection="multiple" selection="multiple"
:pageable="false"
:full-screen-button="false" :full-screen-button="false"
:toolbar-configure="{ noIcon: true }" :toolbar-configure="{ noIcon: true }"
:toolbar-actions="[ :toolbar-actions="[
@ -357,34 +329,18 @@
click: () => { click: () => {
axios axios
.post(Environment.apiContextPath('/api/system/user/updateOrgs'), { .post(Environment.apiContextPath('/api/system/user/updateOrgs'), {
one: currentSelectedUserId, one: userGridRef.getSelectedRows()[0].id,
many: orgTreeGridRef.value.getTicked(), many: orgTreeGridRef.getTicked(),
}) })
.then((response) => {}); .then((response) => {});
}, },
}, },
'view', 'view',
]" ]"
:pagination="{
sortBy: 'name',
descending: false,
reqPageStart: 0,
rowsPerPage: 0,
}"
:columns="[ :columns="[
{ width: 100, name: 'code', label: $t('code') }, { width: 80, name: 'code', label: $t('code') },
{ width: 100, name: 'name', label: $t('name') }, { width: 100, name: 'name', label: $t('name') },
{ { width: 60, name: 'status', label: $t('status'), format: Formater.enableTag() },
width: 60,
name: 'status',
label: $t('status'),
format: (value, row) => {
return {
componentType: RoleStatusTag,
attrs: row,
};
},
},
]" ]"
:viewer="{ :viewer="{
panel: { panel: {
@ -415,11 +371,12 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import { Environment, axios, EnumTools, NotifyManager, DialogManager, Formater, Options, Tools } from 'platform-core'; import { Environment, axios, EnumTools, NotifyManager, DialogManager, Formater, Options, Tools, OperatorTypeEnum } from 'platform-core';
import SelectRoleDialog from './SelectRoleDialog.vue'; import SelectRoleDialog from './SelectRoleDialog.vue';
import SetPasswordDialog from './SetPasswordDialog.vue'; import SetPasswordDialog from './SetPasswordDialog.vue';
import UserStatusTag from './UserStatusTag.vue'; import UserStatusTag from './UserStatusTag.vue';
import RoleStatusTag from './RoleStatusTag.vue';
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom');
const userGridRef = ref(); const userGridRef = ref();
const roleGridRef = ref(); const roleGridRef = ref();
@ -428,7 +385,5 @@ const orgTreeGridRef = ref();
const selectRoleDialog = ref(); const selectRoleDialog = ref();
const selectedTabRef = ref('role'); const selectedTabRef = ref('role');
const setPasswordDialogRef = ref(); const setPasswordDialogRef = ref();
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom');
const currentSelectedUserId = ref(''); const currentSelectedUserId = ref('');
</script> </script>

38
io.sc.platform.system/src/main/java/io/sc/platform/system/user/service/impl/UserServiceImpl.java

@ -37,6 +37,8 @@ import org.springframework.util.StringUtils;
import javax.persistence.criteria.Join; import javax.persistence.criteria.Join;
import javax.persistence.criteria.JoinType; import javax.persistence.criteria.JoinType;
import javax.persistence.criteria.Root;
import javax.persistence.criteria.Subquery;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
@ -186,8 +188,19 @@ public class UserServiceImpl extends DaoServiceImpl<UserEntity, String, UserRepo
public Page<UserEntity> queryUsersByRole(String roleId, QueryParameter queryParameter) throws Exception { public Page<UserEntity> queryUsersByRole(String roleId, QueryParameter queryParameter) throws Exception {
if(StringUtils.hasText(roleId)) { if(StringUtils.hasText(roleId)) {
Specification<UserEntity> specification = (root, query, criteriaBuilder) -> { Specification<UserEntity> specification = (root, query, criteriaBuilder) -> {
Join<RoleEntity, UserEntity> join = root.join("roles"); Subquery<Integer> subquery =query.subquery(Integer.class);
return criteriaBuilder.equal(join.get("id"), roleId); // select 1
subquery.select(criteriaBuilder.literal(1));
// from sys_user_role,sys_role
Root<UserEntity> subQueryRoot =subquery.correlate(root);
Join<RoleEntity,UserEntity> join = subQueryRoot.join("roles");
// where sys_user.id_='xxx'
subquery.where(criteriaBuilder.equal(join.get("id"), roleId));
// where exists (...)
return criteriaBuilder.exists(subquery);
}; };
return this.query(specification, queryParameter); return this.query(specification, queryParameter);
} }
@ -197,12 +210,23 @@ public class UserServiceImpl extends DaoServiceImpl<UserEntity, String, UserRepo
@Override @Override
public Page<UserEntity> queryOtherUsersByRole(String roleId, QueryParameter queryParameter) throws Exception { public Page<UserEntity> queryOtherUsersByRole(String roleId, QueryParameter queryParameter) throws Exception {
if(StringUtils.hasText(roleId)) { if(StringUtils.hasText(roleId)) {
Specification<UserEntity> specification = (root, query, criteriaBuilder) -> { Specification<UserEntity> baseSpecification = (root, query, criteriaBuilder) -> {
query.distinct(true); Subquery<Integer> subquery =query.subquery(Integer.class);
Join<RoleEntity, UserEntity> join = root.join("roles", JoinType.LEFT); // select 1
return criteriaBuilder.or(criteriaBuilder.isNull(join.get("id")),criteriaBuilder.notEqual(join.get("id"), roleId)); subquery.select(criteriaBuilder.literal(1));
// from sys_user_role,sys_role
Root<UserEntity> subQueryRoot =subquery.correlate(root);
Join<RoleEntity,UserEntity> join = subQueryRoot.join("roles");
// where sys_user.id_='xxx'
subquery.where(criteriaBuilder.equal(join.get("id"), roleId));
// where exists (...)
return criteriaBuilder.not(criteriaBuilder.exists(subquery));
}; };
return this.query(specification, queryParameter); Specification<UserEntity> specification =buildSpecification(queryParameter);
return this.query(baseSpecification.and(specification), queryParameter);
} }
return QueryResult.emptyPage(); return QueryResult.emptyPage();
} }

Loading…
Cancel
Save