53 changed files with 6954 additions and 166 deletions
@ -1,4 +1,131 @@ |
|||||
<template> |
<template> |
||||
<div>authorization</div> |
<q-splitter :model-value="450" unit="px" separator-style="width: 3px;" class="w-full" style="height: 100%"> |
||||
|
<template #before> |
||||
|
<div class="pr-1" style="height: 100%"> |
||||
|
<w-grid |
||||
|
ref="roleGridRef" |
||||
|
:title="$t('system.role.grid.title')" |
||||
|
:config-button="true" |
||||
|
selection="multiple" |
||||
|
:checkbox-selection="true" |
||||
|
:data-url="Environment.apiContextPath('/api/system/role')" |
||||
|
:pagination="{ |
||||
|
sortBy: 'name', |
||||
|
descending: false, |
||||
|
}" |
||||
|
:query-form-cols-num="3" |
||||
|
:query-form-fields="[ |
||||
|
{ name: 'code', label: $t('code'), type: 'text' }, |
||||
|
{ name: 'name', label: $t('name'), type: 'text' }, |
||||
|
{ name: 'enable', label: $t('isEnable'), type: 'select', options: Options.yesNo() }, |
||||
|
]" |
||||
|
:toolbar-configure="{ noIcon: false }" |
||||
|
:toolbar-actions="['query', 'separator', 'refresh', 'separator', 'view', 'separator', 'export']" |
||||
|
:columns="[ |
||||
|
{ width: 100, name: 'code', label: $t('code') }, |
||||
|
{ width: '100%', name: 'name', label: $t('name') }, |
||||
|
{ width: 80, 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.none() }, |
||||
|
{ 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'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
@row-click=" |
||||
|
(evt, row, index) => { |
||||
|
roleIdRef = row.id; |
||||
|
resourceTreeGridRef?.refresh(); |
||||
|
} |
||||
|
" |
||||
|
@before-request-data=" |
||||
|
() => { |
||||
|
roleIdRef = ''; |
||||
|
resourceTreeGridRef?.refresh(); |
||||
|
} |
||||
|
" |
||||
|
> |
||||
|
</w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
<template #after> |
||||
|
<div class="pl-1" style="height: 100%"> |
||||
|
<w-grid |
||||
|
ref="resourceTreeGridRef" |
||||
|
:title="$t('re.resources.grid.title')" |
||||
|
dense-body |
||||
|
hide-bottom |
||||
|
:config-button="true" |
||||
|
selection="multiple" |
||||
|
:checkbox-selection="true" |
||||
|
:tree="true" |
||||
|
:tree-icon=" |
||||
|
(row) => { |
||||
|
if (row.type === 'FOLDER') { |
||||
|
return { name: 'folder', color: 'amber' }; |
||||
|
} else if (row.type === 'MODEL') { |
||||
|
return { name: 'bi-boxes' }; |
||||
|
} else if (row.type === 'SCORE_CARD') { |
||||
|
return { name: 'bi-card-list' }; |
||||
|
} else { |
||||
|
return { name: row.icon }; |
||||
|
} |
||||
|
} |
||||
|
" |
||||
|
ticked-field="selected" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/re/resource/listAllResourcesWithSelectedStatusByRole?roleId=' + roleIdRef)" |
||||
|
:pageable="false" |
||||
|
:toolbar-configure="{ noIcon: false }" |
||||
|
:toolbar-actions="[ |
||||
|
'refresh', |
||||
|
'separator', |
||||
|
'expand', |
||||
|
{ |
||||
|
name: 'save', |
||||
|
label: $t('save'), |
||||
|
icon: 'sym_o_save', |
||||
|
click: (arg) => { |
||||
|
const data = { |
||||
|
one: roleIdRef, |
||||
|
many: Tools.extractProperties(arg.tickeds, 'id'), |
||||
|
}; |
||||
|
axios.post(Environment.apiContextPath('/api/re/resource/updateRoles'), data).then((response) => { |
||||
|
NotifyManager.info($t('operationSuccess')); |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
]" |
||||
|
:columns="[ |
||||
|
{ width: '100%', name: 'name', label: $t('name') }, |
||||
|
{ width: 80, name: 'type', label: $t('type'), format: Formater.enum(Enums.ResourceType) }, |
||||
|
{ width: 100, name: 'code', label: $t('code') }, |
||||
|
{ width: 60, name: 'version', label: $t('version') }, |
||||
|
{ width: 60, name: 'status', label: $t('status'), format: Formater.enum(Enums.DeployStatus) }, |
||||
|
]" |
||||
|
></w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
</q-splitter> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { ref } from 'vue'; |
||||
|
import { Environment, NotifyManager, axios, Tools, EnumTools, Options, Formater } from 'platform-core'; |
||||
|
|
||||
|
const roleGridRef = ref(); |
||||
|
const resourceTreeGridRef = ref(); |
||||
|
const roleIdRef = ref(); |
||||
|
|
||||
|
const Enums = await EnumTools.fetch(['io.sc.engine.rule.core.enums.ResourceType', 'io.sc.engine.rule.core.enums.DeployStatus']); |
||||
|
</script> |
||||
|
@ -1,4 +1,410 @@ |
|||||
<template> |
<template> |
||||
<div>dictionary</div> |
<q-splitter :model-value="500" unit="px" separator-style="width: 3px;" class="w-full" style="height: 100%"> |
||||
|
<template #before> |
||||
|
<div class="pr-1" style="height: 100%"> |
||||
|
<w-grid |
||||
|
ref="treeGridRef" |
||||
|
:title="$t('re.dictionary.grid.title')" |
||||
|
dense-body |
||||
|
hide-bottom |
||||
|
:config-button="true" |
||||
|
selection="multiple" |
||||
|
:checkbox-selection="false" |
||||
|
:tree="true" |
||||
|
:tree-icon=" |
||||
|
(row) => { |
||||
|
if (row.type === 'FOLDER') { |
||||
|
return { name: 'folder', color: 'amber' }; |
||||
|
} else { |
||||
|
return { name: 'bi-card-list' }; |
||||
|
} |
||||
|
} |
||||
|
" |
||||
|
ticked-field="selected" |
||||
|
:data-url="Environment.apiContextPath('/api/re/dictionary')" |
||||
|
:pageable="false" |
||||
|
:toolbar-configure="{ noIcon: false }" |
||||
|
:toolbar-actions="[ |
||||
|
'refresh', |
||||
|
'separator', |
||||
|
'expand', |
||||
|
[ |
||||
|
{ |
||||
|
name: 'addGroup', |
||||
|
label: $t('re.dictionary.grid.toolbar.addGroup'), |
||||
|
icon: 'add', |
||||
|
click: undefined, |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'addTop', |
||||
|
name: 'addTop', |
||||
|
label: $t('re.dictionary.grid.toolbar.addTop'), |
||||
|
afterClick: (arg) => { |
||||
|
arg.grid.getEditorForm().setFieldValue('type', 'FOLDER'); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'addChild', |
||||
|
name: 'addChild', |
||||
|
label: $t('re.dictionary.grid.toolbar.addChild'), |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected && arg.selected.type === 'FOLDER'; |
||||
|
}, |
||||
|
afterClick: (arg) => { |
||||
|
arg.grid.getEditorForm().setFieldValue('type', 'FOLDER'); |
||||
|
}, |
||||
|
}, |
||||
|
'separator', |
||||
|
{ |
||||
|
name: 'addJavaType', |
||||
|
extend: 'addChild', |
||||
|
label: $t('re.dictionary.grid.toolbar.addJavaType'), |
||||
|
icon: 'playlist_add', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected && arg.selected.type === 'FOLDER'; |
||||
|
}, |
||||
|
afterClick: (arg) => { |
||||
|
arg.grid.getEditorForm().setFieldValue('type', 'JAVA_CLASS'); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'addUserDefinedJavaClassType', |
||||
|
extend: 'addChild', |
||||
|
label: $t('re.dictionary.grid.toolbar.addUserDefinedJavaClassType'), |
||||
|
icon: 'playlist_add', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected && arg.selected.type === 'FOLDER'; |
||||
|
}, |
||||
|
afterClick: (arg) => { |
||||
|
arg.grid.getEditorForm().setFieldValue('type', 'UD_JAVA_CLASS'); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'addEnumType', |
||||
|
extend: 'addChild', |
||||
|
label: $t('re.dictionary.grid.toolbar.addEnumType'), |
||||
|
icon: 'playlist_add', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected && arg.selected.type === 'FOLDER'; |
||||
|
}, |
||||
|
afterClick: (arg) => { |
||||
|
arg.grid.getEditorForm().setFieldValue('type', 'ENUM'); |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
[ |
||||
|
{ |
||||
|
name: 'cloneGroup', |
||||
|
label: $t('re.dictionary.grid.toolbar.cloneGroup'), |
||||
|
icon: 'content_copy', |
||||
|
click: undefined, |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected; |
||||
|
}, |
||||
|
}, |
||||
|
'clone', |
||||
|
{ |
||||
|
extend: 'deepClone', |
||||
|
name: 'deepClone', |
||||
|
label: $t('re.dictionary.grid.toolbar.deepClone'), |
||||
|
icon: 'bi-copy', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected && arg.selected.type !== 'FOLDER'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'clone', |
||||
|
name: 'deepCloneNew', |
||||
|
label: $t('re.dictionary.grid.toolbar.deepCloneNew'), |
||||
|
icon: 'bi-copy', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected && arg.selected.type !== 'FOLDER'; |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
|
||||
|
'separator', |
||||
|
'edit', |
||||
|
'remove', |
||||
|
'separator', |
||||
|
{ |
||||
|
name: 'generateJson', |
||||
|
label: $t('re.dictionary.grid.toolbar.generateJson'), |
||||
|
icon: 'bi-code', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected && arg.selected.type !== 'FOLDER'; |
||||
|
}, |
||||
|
}, |
||||
|
'separator', |
||||
|
{ |
||||
|
name: 'deploy', |
||||
|
label: $t('re.dictionary.grid.toolbar.deploy'), |
||||
|
icon: 'bi-balloon', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected && arg.selected.type !== 'FOLDER'; |
||||
|
}, |
||||
|
}, |
||||
|
'separator', |
||||
|
[ |
||||
|
{ |
||||
|
name: 'importGroup', |
||||
|
label: $t('re.dictionary.grid.toolbar.importGroup'), |
||||
|
icon: 'file_upload', |
||||
|
click: undefined, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'import', |
||||
|
label: $t('re.dictionary.grid.toolbar.import'), |
||||
|
icon: 'file_upload', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'importSample', |
||||
|
label: $t('re.dictionary.grid.toolbar.importSample'), |
||||
|
icon: 'bi-database-up', |
||||
|
}, |
||||
|
], |
||||
|
'separator', |
||||
|
'view', |
||||
|
'separator', |
||||
|
{ |
||||
|
extend: 'export', |
||||
|
name: 'export', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.selected; |
||||
|
}, |
||||
|
}, |
||||
|
]" |
||||
|
:columns="[ |
||||
|
{ width: '100%', name: 'name', label: $t('name') }, |
||||
|
{ |
||||
|
width: 80, |
||||
|
name: 'type', |
||||
|
label: $t('type'), |
||||
|
format: (value) => { |
||||
|
if (value !== 'FOLDER') { |
||||
|
return Formater.enum(Enums.DictionaryType)(value); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
{ width: 60, name: 'version', label: $t('version') }, |
||||
|
{ width: 60, name: 'status', label: $t('status'), format: Formater.enum(Enums.DeployStatus) }, |
||||
|
]" |
||||
|
:editor="{ |
||||
|
dialog: { |
||||
|
width: '600px', |
||||
|
}, |
||||
|
form: { |
||||
|
colsNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'parent', label: $t('parent'), type: 'text', hidden: true }, |
||||
|
{ name: 'type', label: $t('type'), type: 'text', hidden: true }, |
||||
|
{ |
||||
|
name: 'code', |
||||
|
label: $t('code'), |
||||
|
type: 'text', |
||||
|
showIf: (arg) => { |
||||
|
const type = arg.form.getFieldValue('type'); |
||||
|
return type !== 'FOLDER'; |
||||
|
}, |
||||
|
}, |
||||
|
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
||||
|
{ name: 'description', label: $t('description'), type: 'text' }, |
||||
|
{ |
||||
|
name: 'javaClassName', |
||||
|
label: $t('re.dictionary.grid.entity.javaClassName'), |
||||
|
type: 'text', |
||||
|
showIf: (arg) => { |
||||
|
const type = arg.form.getFieldValue('type'); |
||||
|
return type === 'JAVA_CLASS'; |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
:viewer="{ |
||||
|
panel: { |
||||
|
columnNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'order', label: $t('order') }, |
||||
|
{ 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') }, |
||||
|
{ name: 'category', label: $t('category'), format: Formater.none() }, |
||||
|
{ name: 'executeMode', label: $t('re.resources.designer.model.grid.entity.executeMode'), format: Formater.none() }, |
||||
|
|
||||
|
{ 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'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
@row-click=" |
||||
|
(evt, row, index) => { |
||||
|
currentSelectedDictionaryIdRef = row.id; |
||||
|
gridRef?.refresh(); |
||||
|
} |
||||
|
" |
||||
|
@before-request-data=" |
||||
|
() => { |
||||
|
currentSelectedDictionaryIdRef = ''; |
||||
|
gridRef?.refresh(); |
||||
|
} |
||||
|
" |
||||
|
></w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
<template #after> |
||||
|
<!--字段--> |
||||
|
<div class="pl-1" style="height: 100%"> |
||||
|
<w-grid |
||||
|
ref="gridRef" |
||||
|
:title="$t('system.role.grid.title')" |
||||
|
hide-bottom |
||||
|
:config-button="true" |
||||
|
selection="multiple" |
||||
|
:checkbox-selection="true" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/re/dictionary/userDefinedJavaClassField?dictionary=' + currentSelectedDictionaryIdRef)" |
||||
|
:data-url="Environment.apiContextPath('/api/re/dictionary/userDefinedJavaClassField')" |
||||
|
:pageable="false" |
||||
|
:query-form-cols-num="3" |
||||
|
:query-form-fields="[ |
||||
|
{ name: 'code', label: $t('code'), type: 'text' }, |
||||
|
{ name: 'name', label: $t('name'), type: 'text' }, |
||||
|
]" |
||||
|
:toolbar-configure="{ noIcon: false }" |
||||
|
:toolbar-actions="['query', 'separator', 'refresh', 'separator', 'view', 'separator', 'export']" |
||||
|
:columns="[ |
||||
|
{ width: 50, name: 'order', label: $t('order'), align: 'right', sortable: false }, |
||||
|
{ width: 100, name: 'code', label: $t('code') }, |
||||
|
{ width: '100%', name: 'name', label: $t('name') }, |
||||
|
{ |
||||
|
width: 150, |
||||
|
name: 'valueType', |
||||
|
label: $t('re.resources.designer.parameter.grid.entity.valueType'), |
||||
|
sortable: false, |
||||
|
format: (value) => { |
||||
|
return ValueTypeMap[value]; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: 80, |
||||
|
name: 'valueTypeIsList', |
||||
|
label: $t('re.resources.designer.parameter.grid.entity.valueTypeIsList'), |
||||
|
sortable: false, |
||||
|
format: Formater.yesNo(), |
||||
|
}, |
||||
|
{ width: 150, name: 'defaultValue', label: $t('defaultValue'), sortable: false }, |
||||
|
]" |
||||
|
: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.none() }, |
||||
|
{ 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'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
> |
||||
|
</w-grid> |
||||
|
</div> |
||||
|
|
||||
|
<!--选项--> |
||||
|
<div class="pl-1" style="height: 100%"> |
||||
|
<w-grid |
||||
|
ref="gridRef" |
||||
|
:title="$t('system.role.grid.title')" |
||||
|
hide-bottom |
||||
|
:config-button="true" |
||||
|
selection="multiple" |
||||
|
:checkbox-selection="true" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/re/dictionary/userDefinedJavaClassField?dictionary=' + currentSelectedDictionaryIdRef)" |
||||
|
:data-url="Environment.apiContextPath('/api/re/dictionary/userDefinedJavaClassField')" |
||||
|
:pageable="false" |
||||
|
:query-form-cols-num="3" |
||||
|
:query-form-fields="[ |
||||
|
{ name: 'code', label: $t('code'), type: 'text' }, |
||||
|
{ name: 'name', label: $t('name'), type: 'text' }, |
||||
|
]" |
||||
|
:toolbar-configure="{ noIcon: false }" |
||||
|
:toolbar-actions="['query', 'separator', 'refresh', 'separator', 'view', 'separator', 'export']" |
||||
|
:columns="[ |
||||
|
{ width: 50, name: 'order', label: $t('order'), align: 'right', sortable: false }, |
||||
|
{ width: 100, name: 'code', label: $t('code') }, |
||||
|
{ width: '100%', name: 'name', label: $t('name') }, |
||||
|
{ |
||||
|
width: 150, |
||||
|
name: 'valueType', |
||||
|
label: $t('re.resources.designer.parameter.grid.entity.valueType'), |
||||
|
sortable: false, |
||||
|
format: (value) => { |
||||
|
return ValueTypeMap[value]; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: 80, |
||||
|
name: 'valueTypeIsList', |
||||
|
label: $t('re.resources.designer.parameter.grid.entity.valueTypeIsList'), |
||||
|
sortable: false, |
||||
|
format: Formater.yesNo(), |
||||
|
}, |
||||
|
{ width: 150, name: 'defaultValue', label: $t('defaultValue'), sortable: false }, |
||||
|
]" |
||||
|
: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.none() }, |
||||
|
{ 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'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
> |
||||
|
</w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
</q-splitter> |
||||
</template> |
</template> |
||||
<script setup lang="ts"></script> |
<script setup lang="ts"> |
||||
|
import { ref } from 'vue'; |
||||
|
import { axios, Environment, Formater, EnumTools, Options } from 'platform-core'; |
||||
|
|
||||
|
const treeGridRef = ref(); |
||||
|
const gridRef = ref(); |
||||
|
const currentSelectedDictionaryIdRef = ref(''); |
||||
|
|
||||
|
const Enums = await EnumTools.fetch(['io.sc.engine.rule.core.enums.ResourceType', 'io.sc.engine.rule.core.enums.DeployStatus']); |
||||
|
let ValueTypeMap = {}; |
||||
|
const ValueTypeList = []; |
||||
|
const response = await axios.get(Environment.apiContextPath('/api/re/dictionary/getAllDictionaryMap')); |
||||
|
if (response && response.data) { |
||||
|
ValueTypeMap = {}; |
||||
|
ValueTypeList.splice(0, ValueTypeList.length); |
||||
|
for (const item of response.data) { |
||||
|
ValueTypeMap[item.key] = item.value; |
||||
|
ValueTypeList.push({ value: item.key, label: item.value }); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
@ -0,0 +1,73 @@ |
|||||
|
<template> |
||||
|
<w-dialog ref="dialogRef" :title="$t('re.resources.importSample.dialog.title')" width="600px" :can-maximize="false"> |
||||
|
<q-form action="post"> |
||||
|
<div class="row py-1"> |
||||
|
<div class="col-3"></div> |
||||
|
<div class="col-6"> |
||||
|
<q-file ref="fileRef" v-model="modelValue.file" :label="$t('file.single.tip')" dense outlined clearable counter accept=".json"> |
||||
|
<template #prepend> |
||||
|
<q-icon name="cloud_upload" /> |
||||
|
</template> |
||||
|
</q-file> |
||||
|
</div> |
||||
|
<div class="col-3"></div> |
||||
|
</div> |
||||
|
<div class="row py-1"> |
||||
|
<div class="col-3"></div> |
||||
|
<div class="col-6 row justify-center q-gutter-md py-2"> |
||||
|
<q-btn icon="bi-database-up" :label="$t('import')" color="primary" @click="importData"></q-btn> |
||||
|
</div> |
||||
|
<div class="col-3"></div> |
||||
|
</div> |
||||
|
</q-form> |
||||
|
</w-dialog> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import { ref, reactive } from 'vue'; |
||||
|
import { useI18n } from 'vue-i18n'; |
||||
|
import { axios, Environment, DialogManager, Tools } from 'platform-core'; |
||||
|
|
||||
|
const emit = defineEmits<{ |
||||
|
(e: 'afterImported', evt: Event): void; |
||||
|
}>(); |
||||
|
|
||||
|
const { t } = useI18n(); |
||||
|
const dialogRef = ref(); |
||||
|
const modelValue = reactive({ |
||||
|
file: undefined, |
||||
|
}); |
||||
|
const fileRef = ref(); |
||||
|
|
||||
|
const importData = () => { |
||||
|
axios |
||||
|
.post( |
||||
|
Environment.apiContextPath('/api/re/resource/import'), |
||||
|
{ |
||||
|
file: fileRef.value.nativeEl.files[0], |
||||
|
}, |
||||
|
{ |
||||
|
headers: { |
||||
|
'Content-Type': 'multipart/form-data', |
||||
|
}, |
||||
|
}, |
||||
|
) |
||||
|
.then(() => { |
||||
|
close(); |
||||
|
emit('afterImported'); |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
const open = () => { |
||||
|
modelValue.file = undefined; |
||||
|
dialogRef.value.show(); |
||||
|
}; |
||||
|
|
||||
|
const close = () => { |
||||
|
dialogRef.value.hide(); |
||||
|
}; |
||||
|
|
||||
|
defineExpose({ |
||||
|
open, |
||||
|
close, |
||||
|
}); |
||||
|
</script> |
@ -0,0 +1,91 @@ |
|||||
|
<template> |
||||
|
<w-dialog ref="dialogRef" :title="$t('re.resources.importSample.dialog.title')" width="900px" :can-maximize="false"> |
||||
|
<div class="px-2"> |
||||
|
<w-grid |
||||
|
ref="gridRef" |
||||
|
:height="300" |
||||
|
:title="$t('re.resources.importSample.grid.title')" |
||||
|
selection="multiple" |
||||
|
:full-screen-button="false" |
||||
|
:tree="true" |
||||
|
dense-body |
||||
|
:toolbar-configure="{ noIcon: false }" |
||||
|
:toolbar-actions="[ |
||||
|
'refresh', |
||||
|
'separator', |
||||
|
'expand', |
||||
|
'separator', |
||||
|
{ |
||||
|
name: 'import', |
||||
|
label: $t('re.resources.importSample.grid.toolbar.import'), |
||||
|
icon: 'bi-database-up', |
||||
|
enableIf: (arg) => { |
||||
|
return arg.ticked; |
||||
|
}, |
||||
|
click: (arg) => { |
||||
|
if (arg.tickeds && arg.tickeds.length > 0) { |
||||
|
const ids = Tools.extractProperties(arg.tickeds, 'id'); |
||||
|
console.log(ids); |
||||
|
DialogManager.confirm($t('re.resources.importSample.grid.toolbar.import.tip'), () => { |
||||
|
axios.post(Environment.apiContextPath('/api/re/resource/createExample'), ids).then(() => { |
||||
|
close(); |
||||
|
emit('afterImported'); |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
]" |
||||
|
:query-form-fields="[]" |
||||
|
:auto-fetch-data="false" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/re/resource/listResourceExampleContributionItems')" |
||||
|
foreign-key="parentId" |
||||
|
:columns="[ |
||||
|
{ |
||||
|
width: 200, |
||||
|
name: 'name', |
||||
|
label: $t('name'), |
||||
|
format: (value, row) => { |
||||
|
return $t(row.id); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
width: '100%', |
||||
|
name: 'description', |
||||
|
label: $t('description'), |
||||
|
format: (value, row) => { |
||||
|
return $t(row.id + '.description'); |
||||
|
}, |
||||
|
}, |
||||
|
]" |
||||
|
></w-grid> |
||||
|
</div> |
||||
|
</w-dialog> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import { ref, nextTick } from 'vue'; |
||||
|
import { axios, Environment, DialogManager, Tools } from 'platform-core'; |
||||
|
|
||||
|
const emit = defineEmits<{ |
||||
|
(e: 'afterImported', evt: Event): void; |
||||
|
}>(); |
||||
|
|
||||
|
const dialogRef = ref(); |
||||
|
const gridRef = ref(); |
||||
|
|
||||
|
const open = () => { |
||||
|
dialogRef.value.show(); |
||||
|
nextTick(() => { |
||||
|
gridRef.value.refresh(); |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
const close = () => { |
||||
|
dialogRef.value.hide(); |
||||
|
}; |
||||
|
|
||||
|
defineExpose({ |
||||
|
open, |
||||
|
close, |
||||
|
}); |
||||
|
</script> |
@ -1,12 +0,0 @@ |
|||||
[ |
|
||||
//引擎示例 |
|
||||
{"id":"re.engine.example.resource.engine","order":100}, |
|
||||
//引擎示例/基本示例 |
|
||||
{ |
|
||||
"order" :100, |
|
||||
"parentId" :"re.engine.example.resource.engine", |
|
||||
"id" :"re.engine.example.resource.engine.base", |
|
||||
"file" :"classpath:/org/wsp/engine/rule/example/resource/engine/引擎内置示例.json", |
|
||||
"dictionary":"classpath:/org/wsp/engine/rule/example/resource/engine/引擎内置示例(数据字典).json" |
|
||||
} |
|
||||
] |
|
@ -0,0 +1,12 @@ |
|||||
|
[ |
||||
|
//引擎示例 |
||||
|
{"id":"re.engine.sample.resource.engine","order":100}, |
||||
|
//引擎示例/基本示例 |
||||
|
{ |
||||
|
"order" :100, |
||||
|
"parentId" :"re.engine.sample.resource.engine", |
||||
|
"id" :"re.engine.sample.resource.engine.base", |
||||
|
"file" :"classpath:/io/sc/engine/rule/server/sample/引擎内置示例.json", |
||||
|
"dictionary":"classpath:/io/sc/engine/rule/server/sample/引擎内置示例(数据字典).json" |
||||
|
} |
||||
|
] |
@ -0,0 +1,5 @@ |
|||||
|
re.engine.sample.resource.engine=Engine Sample |
||||
|
re.engine.sample.resource.engine.description=Engine Sample |
||||
|
|
||||
|
re.engine.sample.resource.engine.base=Base Sample |
||||
|
re.engine.sample.resource.engine.base.description=Engine Base Sample |
@ -0,0 +1,5 @@ |
|||||
|
re.engine.sample.resource.engine=\u5F15\u64CE\u793A\u4F8B |
||||
|
re.engine.sample.resource.engine.description= |
||||
|
|
||||
|
re.engine.sample.resource.engine.base=\u57FA\u672C\u793A\u4F8B |
||||
|
re.engine.sample.resource.engine.base.description=\u5F15\u64CE\u81EA\u5E26\u57FA\u672C\u793A\u4F8B |
@ -0,0 +1,152 @@ |
|||||
|
{ |
||||
|
"type" : "FOLDER", |
||||
|
"id" : "e28a4f3b-25b3-457a-a473-c0a30d834469", |
||||
|
"code" : "D25173642570409", |
||||
|
"name" : "引擎内置示例(数据字典)", |
||||
|
"description" : null, |
||||
|
"order" : null, |
||||
|
"children" : [ { |
||||
|
"type" : "FOLDER", |
||||
|
"id" : "28cd2fc7-b837-4c9c-af40-00947dab4a7c", |
||||
|
"code" : "D25355646002659", |
||||
|
"name" : "日历", |
||||
|
"description" : null, |
||||
|
"order" : null, |
||||
|
"children" : [ { |
||||
|
"type" : "JAVA_CLASS", |
||||
|
"id" : "145e9e62-0e2e-42eb-9a60-e866c419f4aa", |
||||
|
"code" : "D25509529048589", |
||||
|
"name" : "日历", |
||||
|
"description" : null, |
||||
|
"order" : null, |
||||
|
"children" : null, |
||||
|
"status" : "SKETCH", |
||||
|
"version" : 1, |
||||
|
"javaClassName" : "java.util.Calendar" |
||||
|
} ] |
||||
|
}, { |
||||
|
"type" : "FOLDER", |
||||
|
"id" : "9e13f57c-22df-40d3-bd36-56cfa682bc6e", |
||||
|
"code" : "D25739980183495", |
||||
|
"name" : "个人客户基本信息", |
||||
|
"description" : null, |
||||
|
"order" : null, |
||||
|
"children" : [ { |
||||
|
"type" : "UD_JAVA_CLASS", |
||||
|
"id" : "cc9589cd-28c9-4752-bacd-0293bcdb63c7", |
||||
|
"code" : "D25776493023470", |
||||
|
"name" : "个人客户基本信息", |
||||
|
"description" : null, |
||||
|
"order" : null, |
||||
|
"children" : null, |
||||
|
"status" : "SKETCH", |
||||
|
"version" : 1, |
||||
|
"fields" : [ { |
||||
|
"id" : "8121cce5-91fe-4fc3-8e91-e5a8a1105d02", |
||||
|
"code" : "name", |
||||
|
"name" : "姓名", |
||||
|
"description" : null, |
||||
|
"valueType" : "java.lang.String", |
||||
|
"valueTypeIsList" : false, |
||||
|
"defaultValue" : null, |
||||
|
"valueCalculation" : null, |
||||
|
"order" : 1 |
||||
|
}, { |
||||
|
"id" : "9ac0a8b3-59a1-4c03-a4f2-d501d1651506", |
||||
|
"code" : "age", |
||||
|
"name" : "年龄", |
||||
|
"description" : null, |
||||
|
"valueType" : "java.lang.Long", |
||||
|
"valueTypeIsList" : false, |
||||
|
"defaultValue" : null, |
||||
|
"valueCalculation" : null, |
||||
|
"order" : 2 |
||||
|
}, { |
||||
|
"id" : "b6b45882-3812-4686-bcd5-ad0a1c9b46ec", |
||||
|
"code" : "education", |
||||
|
"name" : "学历", |
||||
|
"description" : null, |
||||
|
"valueType" : "D25564292618908", |
||||
|
"valueTypeIsList" : false, |
||||
|
"defaultValue" : null, |
||||
|
"valueCalculation" : null, |
||||
|
"order" : 3 |
||||
|
} ] |
||||
|
} ] |
||||
|
}, { |
||||
|
"type" : "FOLDER", |
||||
|
"id" : "d48e8de8-1036-4b40-a16f-8ff0a4e46588", |
||||
|
"code" : "D25546624448897", |
||||
|
"name" : "学历", |
||||
|
"description" : null, |
||||
|
"order" : null, |
||||
|
"children" : [ { |
||||
|
"type" : "ENUM", |
||||
|
"id" : "d4040459-25c7-4e9a-a64e-81981f1ca51d", |
||||
|
"code" : "D25564292618908", |
||||
|
"name" : "学历", |
||||
|
"description" : null, |
||||
|
"order" : null, |
||||
|
"children" : null, |
||||
|
"status" : "SKETCH", |
||||
|
"version" : 1, |
||||
|
"items" : [ { |
||||
|
"id" : "0077a9fc-0089-425f-b210-3d2d9562d78a", |
||||
|
"value" : "05", |
||||
|
"title" : "专科/中专", |
||||
|
"description" : null, |
||||
|
"order" : 4, |
||||
|
"config" : null |
||||
|
}, { |
||||
|
"id" : "0670b3f9-1bc8-41b9-aa83-3cd84a2a86c4", |
||||
|
"value" : "08", |
||||
|
"title" : "博士研究生", |
||||
|
"description" : null, |
||||
|
"order" : 7, |
||||
|
"config" : null |
||||
|
}, { |
||||
|
"id" : "27a3efb1-b0c9-40db-9190-fac5749fcf43", |
||||
|
"value" : "07", |
||||
|
"title" : "硕士研究生", |
||||
|
"description" : null, |
||||
|
"order" : 6, |
||||
|
"config" : null |
||||
|
}, { |
||||
|
"id" : "4040d009-f2eb-4c8d-83fe-36498b5bae15", |
||||
|
"value" : "04", |
||||
|
"title" : "高中", |
||||
|
"description" : null, |
||||
|
"order" : 3, |
||||
|
"config" : null |
||||
|
}, { |
||||
|
"id" : "42febcda-ecc4-4285-823c-0c9fed119ecb", |
||||
|
"value" : "03", |
||||
|
"title" : "初中", |
||||
|
"description" : null, |
||||
|
"order" : 2, |
||||
|
"config" : null |
||||
|
}, { |
||||
|
"id" : "6b0f746e-7c35-430a-ad21-0b049d1da729", |
||||
|
"value" : "06", |
||||
|
"title" : "本科", |
||||
|
"description" : null, |
||||
|
"order" : 5, |
||||
|
"config" : null |
||||
|
}, { |
||||
|
"id" : "c4836a75-c9bb-4cbe-a462-4ade0eac0dbe", |
||||
|
"value" : "02", |
||||
|
"title" : "小学", |
||||
|
"description" : null, |
||||
|
"order" : 1, |
||||
|
"config" : null |
||||
|
}, { |
||||
|
"id" : "c9881266-0f49-483e-89e5-e21e250829a2", |
||||
|
"value" : "01", |
||||
|
"title" : "文盲", |
||||
|
"description" : null, |
||||
|
"order" : 0, |
||||
|
"config" : null |
||||
|
} ] |
||||
|
} ] |
||||
|
} ] |
||||
|
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue