50 changed files with 1139 additions and 637 deletions
@ -0,0 +1,13 @@ |
|||
<template> |
|||
<div v-if="!Tools.isUndefinedOrNull(success)"> |
|||
<q-chip v-if="success === true || success === 'success'" color="green" text-color="white" :label="$t('success')" dense></q-chip> |
|||
<q-chip v-if="success !== true && success !== 'success'" color="red" text-color="white" :label="$t('failed')" dense></q-chip> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { Tools } from '@/platform/utils'; |
|||
|
|||
const props = defineProps({ |
|||
success: { type: [Boolean, String], default: true }, |
|||
}); |
|||
</script> |
@ -1,56 +1,58 @@ |
|||
<template> |
|||
<w-list-grid |
|||
:tree="true" |
|||
title="User List" |
|||
:no-action-icon="true" |
|||
:target-object-name="$t('菜单')" |
|||
:actions="[ |
|||
'query', |
|||
'refresh', |
|||
'expandAll', |
|||
'selectAll', |
|||
'separator', |
|||
'add', |
|||
'clone', |
|||
'edit', |
|||
'remove', |
|||
'removeAll', |
|||
'separator', |
|||
'detail', |
|||
|
|||
'addTop', |
|||
'addChild', |
|||
<w-grid |
|||
ref="auditLogGridRef" |
|||
:title="$t('system.user.grid.title')" |
|||
selection="multiple" |
|||
:data-url="Environment.apiContextPath('/api/system/monitor/auditlog')" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'message', label: $t('i18nMessage'), type: 'text' }, |
|||
{ name: 'lang', label: $t('language'), type: 'select' }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select' }, |
|||
]" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh', 'separator', 'view', 'export']" |
|||
:columns="[ |
|||
{ width: 100, name: 'status', label: $t('status'), format: Formater.successTag() }, |
|||
{ width: 60, name: 'action', label: $t('action') }, |
|||
{ width: 100, name: 'startDate', label: $t('startDate') }, |
|||
{ width: 60, name: 'executeTime', label: $t('executeTime') }, |
|||
{ width: 80, name: 'loginName', label: $t('loginName') }, |
|||
{ width: 60, name: 'httpMethod', label: $t('httpMethod') }, |
|||
{ width: 200, name: 'url', label: $t('url') }, |
|||
{ width: 100, name: 'ip', label: $t('ip') }, |
|||
{ width: 100, name: 'className', label: $t('className') }, |
|||
{ width: 100, name: 'methodName', label: $t('methodName') }, |
|||
{ width: 100, name: 'oldValue', label: $t('oldValue') }, |
|||
{ width: 100, name: 'newValue', label: $t('newValue') }, |
|||
{ width: 100, name: 'exception', label: $t('exception') }, |
|||
{ width: 100, name: 'exceptionMessage', label: $t('exceptionMessage') }, |
|||
{ width: 100, name: 'exceptionStackTrace', label: $t('exceptionStackTrace') }, |
|||
]" |
|||
:columns="columns" |
|||
:auto-fetch-data="true" |
|||
:data-url="Environment.apiContextPath('/api/system/menu/allMenus')" |
|||
></w-list-grid> |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'lang', label: $t('language') }, |
|||
{ name: 'message', label: $t('i18nMessage') }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ 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) => {}" |
|||
> |
|||
</w-grid> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment } from '@/platform'; |
|||
import { Environment, axios, Formater, Options } from '@/platform'; |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const columns = [ |
|||
{ |
|||
name: 'name', |
|||
required: true, |
|||
label: t('name'), |
|||
align: 'left', |
|||
field: 'name', |
|||
sortable: true, |
|||
format: (value, data) => { |
|||
return t(data.titleI18nKey); |
|||
}, |
|||
}, |
|||
{ name: 'type', align: 'center', label: 'type', field: 'type', sortable: true }, |
|||
{ name: 'enable', label: 'enable', field: 'enable', sortable: true }, |
|||
{ name: 'dataComeFrom', label: 'dataComeFrom', field: 'dataComeFrom' }, |
|||
{ name: 'lastModifier', label: 'lastModifier', field: 'lastModifier' }, |
|||
{ name: 'lastModifyDate', label: 'lastModifyDate', field: 'lastModifyDate' }, |
|||
{ name: 'corporationCode', label: 'corporationCode', field: 'corporationCode', sortable: true }, |
|||
]; |
|||
const auditLogGridRef = ref(); |
|||
</script> |
|||
|
@ -1,56 +1,58 @@ |
|||
<template> |
|||
<w-list-grid |
|||
:tree="true" |
|||
title="User List" |
|||
:no-action-icon="true" |
|||
:target-object-name="$t('菜单')" |
|||
:actions="[ |
|||
'query', |
|||
'refresh', |
|||
'expandAll', |
|||
'selectAll', |
|||
'separator', |
|||
'add', |
|||
'clone', |
|||
'edit', |
|||
'remove', |
|||
'removeAll', |
|||
'separator', |
|||
'detail', |
|||
|
|||
'addTop', |
|||
'addChild', |
|||
<w-grid |
|||
ref="auditLogGridRef" |
|||
:title="$t('system.user.grid.title')" |
|||
selection="multiple" |
|||
:data-url="Environment.apiContextPath('/api/system/monitor/auditlog')" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'message', label: $t('i18nMessage'), type: 'text' }, |
|||
{ name: 'lang', label: $t('language'), type: 'select' }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select' }, |
|||
]" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh', 'separator', 'view', 'export']" |
|||
:columns="[ |
|||
{ width: 100, name: 'status', label: $t('status'), format: Formater.successTag() }, |
|||
{ width: 60, name: 'action', label: $t('action') }, |
|||
{ width: 100, name: 'startDate', label: $t('startDate') }, |
|||
{ width: 60, name: 'executeTime', label: $t('executeTime') }, |
|||
{ width: 80, name: 'loginName', label: $t('loginName') }, |
|||
{ width: 60, name: 'httpMethod', label: $t('httpMethod') }, |
|||
{ width: 200, name: 'url', label: $t('url') }, |
|||
{ width: 100, name: 'ip', label: $t('ip') }, |
|||
{ width: 100, name: 'className', label: $t('className') }, |
|||
{ width: 100, name: 'methodName', label: $t('methodName') }, |
|||
{ width: 100, name: 'oldValue', label: $t('oldValue') }, |
|||
{ width: 100, name: 'newValue', label: $t('newValue') }, |
|||
{ width: 100, name: 'exception', label: $t('exception') }, |
|||
{ width: 100, name: 'exceptionMessage', label: $t('exceptionMessage') }, |
|||
{ width: 100, name: 'exceptionStackTrace', label: $t('exceptionStackTrace') }, |
|||
]" |
|||
:columns="columns" |
|||
:auto-fetch-data="true" |
|||
:data-url="Environment.apiContextPath('/api/system/menu/allMenus')" |
|||
></w-list-grid> |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'lang', label: $t('language') }, |
|||
{ name: 'message', label: $t('i18nMessage') }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ 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) => {}" |
|||
> |
|||
</w-grid> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment } from '@/platform'; |
|||
import { Environment, axios, Formater, Options } from '@/platform'; |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const columns = [ |
|||
{ |
|||
name: 'name', |
|||
required: true, |
|||
label: t('name'), |
|||
align: 'left', |
|||
field: 'name', |
|||
sortable: true, |
|||
format: (value, data) => { |
|||
return t(data.titleI18nKey); |
|||
}, |
|||
}, |
|||
{ name: 'type', align: 'center', label: 'type', field: 'type', sortable: true }, |
|||
{ name: 'enable', label: 'enable', field: 'enable', sortable: true }, |
|||
{ name: 'dataComeFrom', label: 'dataComeFrom', field: 'dataComeFrom' }, |
|||
{ name: 'lastModifier', label: 'lastModifier', field: 'lastModifier' }, |
|||
{ name: 'lastModifyDate', label: 'lastModifyDate', field: 'lastModifyDate' }, |
|||
{ name: 'corporationCode', label: 'corporationCode', field: 'corporationCode', sortable: true }, |
|||
]; |
|||
const auditLogGridRef = ref(); |
|||
</script> |
|||
|
@ -1,4 +1,79 @@ |
|||
<template> |
|||
<div>Menus</div> |
|||
<w-grid |
|||
:tree="true" |
|||
dense-body |
|||
:title="$t('menu.developer.plugin.menus')" |
|||
:data-url="Environment.apiContextPath('/api/system/menu/getAllMenuPlugins')" |
|||
primary-key="id" |
|||
foreign-key="parentId" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:pageable="false" |
|||
:full-screen-button="false" |
|||
:tree-icon=" |
|||
(row) => { |
|||
if (row.type === 'SEPARATOR') { |
|||
return { name: 'bi-dash-lg' }; |
|||
} else if (row.type === 'ROUTE_ACTION') { |
|||
return { name: 'sym_o_crop_16_9' }; |
|||
} else { |
|||
return { name: row.icon }; |
|||
} |
|||
} |
|||
" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['refresh', 'separator', 'view', 'export']" |
|||
:columns="[ |
|||
{ |
|||
width: 400, |
|||
name: 'titleI18nKey', |
|||
label: $t('name'), |
|||
sortable: false, |
|||
format: (value, row) => { |
|||
if (row.type === 'SEPARATOR') { |
|||
return `<hr style='width:100px'/>`; |
|||
} else if (row.type === 'ROUTE_ACTION') { |
|||
return $t(row.i18nKey); |
|||
} else { |
|||
return $t(value); |
|||
} |
|||
}, |
|||
}, |
|||
{ width: 100, name: 'order', label: $t('order'), align: 'right', sortable: false }, |
|||
{ width: '100%', name: 'configurationFileUrl', label: $t('url'), sortable: false }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'parentId', label: $t('parentId') }, |
|||
{ |
|||
name: 'titleI18nKey', |
|||
label: $t('system.menu.grid.entity.titleI18nKey'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'icon', label: $t('icon') }, |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'javaScript', label: $t('system.menu.grid.entity.javaScript') }, |
|||
{ name: 'url', label: $t('system.menu.grid.entity.url') }, |
|||
{ name: 'urlOpenType', label: $t('system.menu.grid.entity.urlOpenType') }, |
|||
{ name: 'routeName', label: $t('system.menu.grid.entity.routeName') }, |
|||
{ |
|||
name: 'routeQuery', |
|||
label: $t('system.menu.grid.entity.routeQuery'), |
|||
format: (value) => { |
|||
return JSON.stringify(value); |
|||
}, |
|||
}, |
|||
{ name: 'configurationFileUrl', label: $t('url') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"></script> |
|||
<script setup lang="ts"> |
|||
import { Environment } from 'platform-core'; |
|||
</script> |
|||
|
@ -1,70 +1,102 @@ |
|||
<template> |
|||
<div> |
|||
<platform-grid |
|||
<w-grid |
|||
ref="i18nGridRef" |
|||
:table-props="{ borderded: false, flat: true }" |
|||
:table-title="i18nConfigure.tableTitle" |
|||
:table-init-load-data="i18nConfigure.tableInitLoadData" |
|||
:table-row-key="i18nConfigure.tableRowKey" |
|||
:table-data-url="i18nConfigure.tableDataUrl" |
|||
:table-columns="i18nConfigure.tableColumns" |
|||
:table-buttons="i18nConfigure.tableButtons" |
|||
:add-form-props="i18nConfigure.addFormProps" |
|||
:table-show-sort-no="false" |
|||
:table-dense="true" |
|||
:table-row-drag="true" |
|||
:table-pagination="i18nConfigure.tablePagination" |
|||
> |
|||
</platform-grid> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { onMounted, ref } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment, axios } from 'platform-core'; |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const Language = { |
|||
en: '英文', |
|||
zh_CN: '简体中文', |
|||
tw_CN: '繁体中文', |
|||
}; |
|||
|
|||
const LanguageOptions = [ |
|||
{ label: '英文', value: 'en' }, |
|||
{ label: '简体中文', value: 'zh_CN' }, |
|||
{ label: '繁体中文', value: 'tw_CN' }, |
|||
]; |
|||
|
|||
const i18nGridRef = ref(); |
|||
const i18nConfigure = { |
|||
tableTitle: '多语言消息列表', |
|||
tableInitLoadData: true, |
|||
tableRowKey: 'id', |
|||
tableDataUrl: Environment.apiContextPath('/api/system/i18n'), |
|||
tablePagination: { |
|||
sortBy: 'code', |
|||
descending: false, |
|||
reqPageStart: 0, |
|||
rowsPerPage: 20, |
|||
:title="$t('system.user.grid.title')" |
|||
selection="multiple" |
|||
:data-url="Environment.apiContextPath('/api/system/i18n')" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'message', label: $t('i18nMessage'), type: 'text' }, |
|||
{ name: 'lang', label: $t('language'), type: 'select', options: Options.enum(LanguageEnum), queryOperator: 'equals' }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom'), type: 'select', options: Options.enum(DataComeFromEnum), queryOperator: 'equals' }, |
|||
]" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'query', |
|||
'refresh', |
|||
'separator', |
|||
'add', |
|||
'clone', |
|||
'edit', |
|||
'remove', |
|||
{ |
|||
name: 'deleteAll', |
|||
label: $t('deleteAll'), |
|||
icon: 'bi-trash3', |
|||
click: () => { |
|||
DialogManager.confirm($t('system.i18n.grid.toolbar.removeAll.tip'), () => { |
|||
axios.post(Environment.apiContextPath('/api/system/i18n/removeMessages')).then(() => { |
|||
NotifyManager.info($t('operationSuccess')); |
|||
i18nGridRef.refresh(); |
|||
}); |
|||
}); |
|||
}, |
|||
}, |
|||
tableColumns: [ |
|||
{ name: 'code', label: t('code') }, |
|||
{ name: 'lang', label: t('lang'), format: (value) => Language[value] }, |
|||
{ name: 'message', label: t('message') }, |
|||
'separator', |
|||
{ |
|||
name: 'importAll', |
|||
label: $t('import'), |
|||
icon: 'bi-arrow-right-circle', |
|||
click: () => { |
|||
DialogManager.confirm($t('system.i18n.grid.toolbar.importAll.tip'), () => { |
|||
axios.post(Environment.apiContextPath('/api/system/i18n/importMessages')).then(() => { |
|||
NotifyManager.info($t('operationSuccess')); |
|||
i18nGridRef.refresh(); |
|||
}); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'lang', label: $t('language'), format: Formater.enum(LanguageEnum) }, |
|||
{ name: 'message', label: $t('i18nMessage') }, |
|||
{ width: 100, name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|||
{ width: 100, name: 'lastModifier', label: $t('lastModifier') }, |
|||
{ width: 100, 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: 'lang', label: $t('language'), type: 'select', required: true, options: Options.enum(LanguageEnum) }, |
|||
{ name: 'message', label: $t('i18nMessage'), type: 'text', required: true }, |
|||
], |
|||
tableButtons: ['refresh', 'add', 'edit', 'delete'], |
|||
addFormProps: { |
|||
dialogInitWidth: '50%', |
|||
dialogInitHeight: '90%', |
|||
formColsNumber: 1, |
|||
formColsAuto: false, |
|||
formFields: [ |
|||
{ modelName: 'code', label: t('code'), type: 'text', required: true }, |
|||
{ modelName: 'lang', label: t('lang'), type: 'select', required: true, options: LanguageOptions }, |
|||
{ modelName: 'message', label: t('message'), type: 'text', required: true }, |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'lang', label: $t('language') }, |
|||
{ name: 'message', label: $t('i18nMessage') }, |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ 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) => {}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { axios, Environment, EnumTools, Formater, Options, DialogManager, NotifyManager } from 'platform-core'; |
|||
|
|||
const i18nGridRef = ref(); |
|||
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom'); |
|||
const LanguageEnum = await EnumTools.fetch('io.sc.platform.core.enums.Language'); |
|||
</script> |
|||
|
@ -0,0 +1,135 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('system.shared.importMenuPlugin.dialog.title')" |
|||
width="800px" |
|||
height="500px" |
|||
:can-maximize="false" |
|||
:buttons="[ |
|||
{ |
|||
label: $t('confirm'), |
|||
click: () => { |
|||
const ids = Tools.extractProperties(gridRef.getSelectedRows(), 'id'); |
|||
emit('afterSelected', ids, dialogRef); |
|||
}, |
|||
}, |
|||
]" |
|||
> |
|||
<div class="px-2"> |
|||
<w-grid |
|||
:tree="true" |
|||
dense-body |
|||
:data-url="Environment.apiContextPath('/api/system/menu/getAllMenuPlugins')" |
|||
primary-key="id" |
|||
foreign-key="parentId" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
tick-strategy="strict" |
|||
:pageable="false" |
|||
:config-button="false" |
|||
:full-screen-button="false" |
|||
:tree-icon=" |
|||
(row) => { |
|||
if (row.type === 'SEPARATOR') { |
|||
return { name: 'bi-dash-lg' }; |
|||
} else if (row.type === 'ROUTE_ACTION') { |
|||
return { name: 'sym_o_crop_16_9' }; |
|||
} else { |
|||
return { name: row.icon }; |
|||
} |
|||
} |
|||
" |
|||
:columns="[ |
|||
{ |
|||
width: '100%', |
|||
name: 'titleI18nKey', |
|||
label: $t('name'), |
|||
sortable: false, |
|||
format: (value, row) => { |
|||
if (row.type === 'SEPARATOR') { |
|||
return `<hr style='width:100px'/>`; |
|||
} else if (row.type === 'ROUTE_ACTION') { |
|||
return $t(row.i18nKey); |
|||
} else { |
|||
return $t(value); |
|||
} |
|||
}, |
|||
}, |
|||
{ width: 100, name: 'order', label: $t('order'), align: 'right', sortable: false }, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'parentId', label: $t('parentId') }, |
|||
{ |
|||
name: 'titleI18nKey', |
|||
label: $t('system.menu.grid.entity.titleI18nKey'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'icon', label: $t('icon') }, |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'javaScript', label: $t('system.menu.grid.entity.javaScript') }, |
|||
{ name: 'url', label: $t('system.menu.grid.entity.url') }, |
|||
{ name: 'urlOpenType', label: $t('system.menu.grid.entity.urlOpenType') }, |
|||
{ name: 'routeName', label: $t('system.menu.grid.entity.routeName') }, |
|||
{ |
|||
name: 'routeQuery', |
|||
label: $t('system.menu.grid.entity.routeQuery'), |
|||
format: (value) => { |
|||
return JSON.stringify(value); |
|||
}, |
|||
}, |
|||
{ name: 'configurationFileUrl', label: $t('url') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</div> |
|||
</w-dialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, nextTick } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment, Tools, EnumTools, Options, Formater } from 'platform-core'; |
|||
|
|||
const props = defineProps({ |
|||
opener: { type: Object, default: undefined }, |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'afterSelected', ids: string[], dialogComponent: any): void; |
|||
}>(); |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const dialogRef = ref(); |
|||
const gridRef = ref(); |
|||
const foreignKeyRef = ref(); |
|||
|
|||
const open = (foreignKey: string) => { |
|||
foreignKeyRef.value = foreignKey; |
|||
dialogRef.value.show(); |
|||
|
|||
nextTick(() => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
}; |
|||
|
|||
const close = () => { |
|||
dialogRef.value.hide(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
open, |
|||
close, |
|||
}); |
|||
|
|||
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom'); |
|||
</script> |
@ -1,73 +1,91 @@ |
|||
<template> |
|||
<q-splitter :model-value="70" class="w-full h-full"> |
|||
<template #before> |
|||
<w-tree-grid ref="parameterTreeGridRef" title="系统参数树" label-key="code" label-i18n @update:selected="parameterSelected" /> |
|||
</template> |
|||
<template #after> |
|||
<div class="row"> |
|||
<div class="col-12"> |
|||
<q-input v-model="code" label="代码" outlined class="p-1" /> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-12"> |
|||
<q-input v-model="value" label="值" outlined class="p-1" /> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-12 flex justify-center q-gutter-md pt-5"> |
|||
<q-btn label="保存" color="primary" outlined class="p-1" style="width: 100px" @click="save" /> |
|||
</div> |
|||
</div> |
|||
<div class="row" style="height: 200px"></div> |
|||
</template> |
|||
</q-splitter> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onMounted } from 'vue'; |
|||
import { useI18n } from 'vue-i18n'; |
|||
import { Environment, axios } from 'platform-core'; |
|||
|
|||
const { t } = useI18n(); |
|||
|
|||
const parameterTreeGridRef = ref(); |
|||
const id = ref(''); |
|||
const code = ref(''); |
|||
const value = ref(''); |
|||
|
|||
const parameterSelected = (target) => { |
|||
if (target) { |
|||
const node = parameterTreeGridRef.value.getNodeById(target); |
|||
id.value = node.id; |
|||
code.value = node.code; |
|||
value.value = node.value; |
|||
} else { |
|||
id.value = ''; |
|||
code.value = ''; |
|||
value.value = ''; |
|||
<w-grid |
|||
ref="parameterTreeGridRef" |
|||
:tree="true" |
|||
dense-body |
|||
:title="$t('system.menu.grid.title')" |
|||
:data-url="Environment.apiContextPath('/api/system/parameter')" |
|||
selection="multiple" |
|||
:checkbox-selection="false" |
|||
:pageable="false" |
|||
:full-screen-button="false" |
|||
default-expand-all |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
'expand', |
|||
{ |
|||
extend: 'edit', |
|||
enableIf: (selecteds) => { |
|||
if (selecteds && selecteds.length > 0) { |
|||
return !Tools.isUndefinedOrNull(selecteds[0].value); |
|||
} |
|||
}; |
|||
return false; |
|||
}, |
|||
}, |
|||
'separator', |
|||
'export', |
|||
]" |
|||
:columns="[ |
|||
{ |
|||
width: 300, |
|||
name: 'code', |
|||
label: $t('code'), |
|||
sortable: false, |
|||
format: (value) => { |
|||
return $t(value); |
|||
}, |
|||
}, |
|||
{ width: '100%', name: 'value', label: $t('value'), sortable: false }, |
|||
{ width: 100, name: 'dataComeFrom', label: $t('dataComeFrom'), sortable: false, format: Formater.enum(DataComeFromEnum) }, |
|||
{ width: 100, name: 'lastModifier', label: $t('lastModifier'), sortable: false }, |
|||
{ width: 100, name: 'lastModifyDate', label: $t('lastModifyDate'), sortable: false, format: Formater.dateOnly() }, |
|||
]" |
|||
:editor="{ |
|||
dialog: { |
|||
width: '600px', |
|||
height: '250px', |
|||
}, |
|||
form: { |
|||
colsNum: 1, |
|||
fields: [ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'value', label: $t('value'), type: 'text' }, |
|||
], |
|||
}, |
|||
}" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'type', label: $t('type') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ name: 'titleI18nKey', label: $t('titleI18nKey') }, |
|||
{ name: 'icon', label: $t('icon') }, |
|||
{ name: 'enable', label: $t('enable') }, |
|||
{ name: 'order', label: $t('order') }, |
|||
{ name: 'javaScript', label: $t('javaScript') }, |
|||
{ name: 'url', label: $t('url') }, |
|||
{ name: 'urlOpenType', label: $t('urlOpenType') }, |
|||
{ name: 'routeName', label: $t('routeName') }, |
|||
{ name: 'routeQuery', label: $t('routeQuery') }, |
|||
|
|||
const save = () => { |
|||
const node = parameterTreeGridRef.value.getNodeById(id.value); |
|||
const data = { |
|||
id: node.id, |
|||
code: node.code, |
|||
value: value.value, |
|||
parent: node.parentId, |
|||
corporationCode: node.corporationCode, |
|||
dataComeFrom: node.dataComeFrom, |
|||
creator: node.creator, |
|||
createDate: node.createDate, |
|||
lastModifier: node.lastModifier, |
|||
lastModifyDate: node.lastModifyDate, |
|||
}; |
|||
axios.put(Environment.apiContextPath('/api/system/parameter/') + id.value, data).then((response) => {}); |
|||
}; |
|||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|||
{ 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) => {}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { Environment, Tools, EnumTools, Formater, Options } from 'platform-core'; |
|||
|
|||
onMounted(() => { |
|||
axios.get(Environment.apiContextPath('/api/system/parameter?pageable=false&sortBy=code')).then((response) => { |
|||
parameterTreeGridRef.value.setNodes(response.data.content); |
|||
}); |
|||
}); |
|||
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom'); |
|||
</script> |
|||
|
@ -0,0 +1,36 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.FileWrapper; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogFileLastModifyDateComparator implements Comparator<FileWrapper> { |
|||
private boolean asc =true; |
|||
|
|||
public LogFileLastModifyDateComparator(){} |
|||
|
|||
public LogFileLastModifyDateComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(FileWrapper o1, FileWrapper o2) { |
|||
if(asc) { |
|||
if(o1.getLastModifyDate().getTime()>o2.getLastModifyDate().getTime()){ |
|||
return 1; |
|||
}else if(o1.getLastModifyDate().getTime()==o2.getLastModifyDate().getTime()){ |
|||
return 0; |
|||
}else{ |
|||
return -1; |
|||
} |
|||
}else{ |
|||
if(o2.getLastModifyDate().getTime()>o1.getLastModifyDate().getTime()){ |
|||
return 1; |
|||
}else if(o2.getLastModifyDate().getTime()==o1.getLastModifyDate().getTime()){ |
|||
return 0; |
|||
}else{ |
|||
return -1; |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.FileWrapper; |
|||
import io.sc.platform.core.util.PinyinUtil; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogFileNameComparator implements Comparator<FileWrapper> { |
|||
private boolean asc =true; |
|||
|
|||
public LogFileNameComparator(){} |
|||
|
|||
public LogFileNameComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(FileWrapper o1, FileWrapper o2) { |
|||
if(asc) { |
|||
return PinyinUtil.compare(o1.getName(), o2.getName()); |
|||
}else{ |
|||
return PinyinUtil.compare(o2.getName(), o1.getName()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,38 @@ |
|||
package io.sc.platform.system.monitor.support; |
|||
|
|||
import io.sc.platform.core.support.FileWrapper; |
|||
import io.sc.platform.core.util.PinyinUtil; |
|||
import io.sc.platform.system.api.org.OrgVo; |
|||
|
|||
import java.util.Comparator; |
|||
|
|||
public class LogFileSizeComparator implements Comparator<FileWrapper> { |
|||
private boolean asc =true; |
|||
|
|||
public LogFileSizeComparator(){} |
|||
|
|||
public LogFileSizeComparator(boolean asc){ |
|||
this.asc =asc; |
|||
} |
|||
|
|||
@Override |
|||
public int compare(FileWrapper o1, FileWrapper o2) { |
|||
if(asc) { |
|||
if(o1.getSize()>o2.getSize()){ |
|||
return 1; |
|||
}else if(o1.getSize()==o2.getSize()){ |
|||
return 0; |
|||
}else{ |
|||
return -1; |
|||
} |
|||
}else{ |
|||
if(o2.getSize()>o1.getSize()){ |
|||
return 1; |
|||
}else if(o2.getSize()==o1.getSize()){ |
|||
return 0; |
|||
}else{ |
|||
return -1; |
|||
} |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue