37 changed files with 2293 additions and 429 deletions
@ -1,10 +1,125 @@ |
|||
<template> |
|||
<div style="height: 100%"> |
|||
<w-color-input-palette v-model="colorRef"></w-color-input-palette> |
|||
<q-splitter :model-value="60" class="w-full" style="height: 100%"> |
|||
<template #before> |
|||
<div class="pr-1" style="height: 100%"> |
|||
<w-grid |
|||
ref="applicationGridRef" |
|||
:title="$t('system.application.grid.title')" |
|||
:config-button="true" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
:data-url="Environment.apiContextPath('/api/system/application')" |
|||
:sort-by="['order']" |
|||
: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', 'refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'separator', 'export']" |
|||
:columns="[ |
|||
{ width: 60, name: 'order', label: $t('order') }, |
|||
{ width: 100, name: 'code', label: $t('code') }, |
|||
{ width: '100%', name: 'name', label: $t('name') }, |
|||
{ width: 80, name: 'enable', label: $t('status'), format: Formater.enableTag() }, |
|||
{ 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: 'order', label: $t('order'), type: 'number' }, |
|||
{ 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.none() }, |
|||
{ name: 'order', label: $t('order') }, |
|||
{ 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) => { |
|||
currentSelectedApplicationId = row.id; |
|||
menuTreeGridRef?.refresh(); |
|||
userGridRef?.refresh(); |
|||
} |
|||
" |
|||
@before-request-data=" |
|||
() => { |
|||
currentSelectedApplicationId = ''; |
|||
menuTreeGridRef?.refresh(); |
|||
userGridRef?.refresh(); |
|||
} |
|||
" |
|||
> |
|||
</w-grid> |
|||
</div> |
|||
</template> |
|||
<template #after> |
|||
<div class="pl-1" style="height: 100%"> |
|||
<q-tabs v-model="selectedTabRef" inline-label align="left" :breakpoint="0" no-caps> |
|||
<q-tab name="menu" icon="bi-menu-app" :label="$t('menu')" /> |
|||
</q-tabs> |
|||
|
|||
<q-tab-panels v-model="selectedTabRef" animated swipeable keep-alive style="height: calc(100% - 48px)"> |
|||
<q-tab-panel name="menu" class="px-0 pb-0" style="height: 100%; padding-left: 0px; padding-right: 0px; padding-bottom: 0px"> |
|||
<SelectMenuTreeGrid |
|||
ref="menuTreeGridRef" |
|||
:fetch-data-url="Environment.apiContextPath('/api/system/menu/listAllMenusWithSelectedStatusByApplication')" |
|||
foreign-key="applicationId" |
|||
:foreign-value="currentSelectedApplicationId" |
|||
@update="update" |
|||
></SelectMenuTreeGrid> |
|||
</q-tab-panel> |
|||
</q-tab-panels> |
|||
</div> |
|||
</template> |
|||
</q-splitter> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref } from 'vue'; |
|||
import { Environment, axios, EnumTools, Options, Formater } from '@/platform'; |
|||
import SelectMenuTreeGrid from './shared/SelectMenuTreeGrid.vue'; |
|||
|
|||
const applicationGridRef = ref(); |
|||
const userGridRef = ref(); |
|||
const menuTreeGridRef = ref(); |
|||
|
|||
const selectedTabRef = ref('menu'); |
|||
const currentSelectedApplicationId = ref(''); |
|||
|
|||
const colorRef = ref('#EEEEEE'); |
|||
const update = (ids, gridComponent) => { |
|||
axios |
|||
.post(Environment.apiContextPath('/api/system/application/updateMenus'), { |
|||
one: applicationGridRef.value.getSelectedRows()[0].id, |
|||
many: ids, |
|||
}) |
|||
.then(() => { |
|||
gridComponent.refresh(); |
|||
}); |
|||
}; |
|||
</script> |
|||
|
@ -0,0 +1,102 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('system.shared.selectApplication.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" style="height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectApplication.dialog.grid.title')" |
|||
selection="multiple" |
|||
:full-screen-button="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh']" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'name', label: $t('name'), type: 'text' }, |
|||
{ |
|||
name: 'enable', |
|||
label: $t('enable'), |
|||
type: 'select', |
|||
options: Options.yesNo(), |
|||
queryOperator: 'equals', |
|||
}, |
|||
{ |
|||
name: 'dataComeFrom', |
|||
label: $t('dataComeFrom'), |
|||
type: 'select', |
|||
options: Options.enum(DataComeFromEnum), |
|||
queryOperator: 'equals', |
|||
}, |
|||
]" |
|||
:auto-fetch-data="false" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:columns="[ |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ |
|||
name: 'status', |
|||
label: t('status'), |
|||
format: Formater.enableTag(), |
|||
}, |
|||
{ name: 'lastModifier', label: t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: t('lastModifyDate') }, |
|||
]" |
|||
></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> |
@ -0,0 +1,141 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectApplication.grid.title')" |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:auto-fetch-data="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
name: 'selectIn', |
|||
label: $t('system.shared.selectApplication.grid.toolbar.selectIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
dialogRef.open(foreignValue); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectOut', |
|||
label: $t('system.shared.selectApplication.grid.toolbar.selectOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getSelectedRows()?.length > 0; |
|||
}, |
|||
click: (arg) => { |
|||
const ids = Tools.extractProperties(arg.selecteds, 'id'); |
|||
DialogManager.confirm($t('system.shared.selectApplication.grid.toolbar.selectOut.tip'), () => { |
|||
emit('selectOut', ids, gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'selectAllIn', |
|||
label: $t('system.shared.selectApplication.grid.toolbar.selectAllIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectApplication.grid.toolbar.selectAllIn.tip'), () => { |
|||
emit('selectAllIn', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectAllOut', |
|||
label: $t('system.shared.selectApplication.grid.toolbar.selectAllOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectApplication.grid.toolbar.selectAllOut.tip'), () => { |
|||
emit('selectAllOut', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
:columns="[ |
|||
{ width: 150, 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') }, |
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
<SelectApplicationDialog |
|||
ref="dialogRef" |
|||
:opener="gridRef" |
|||
:fetch-data-url="fetchOtherDataUrl" |
|||
:foreign-key="foreignKey" |
|||
:foreign-value="foreignValue" |
|||
@after-selected=" |
|||
(ids: string[]) => { |
|||
emit('selectIn', ids, gridRef, dialogRef); |
|||
} |
|||
" |
|||
></SelectApplicationDialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
|
|||
import { EnumTools, DialogManager, Formater, Tools } from 'platform-core'; |
|||
import SelectApplicationDialog from './SelectApplicationDialog.vue'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
fetchOtherDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'selectIn', ids: string[], gridComponent: any, dialogComponent: any): void; |
|||
(e: 'selectOut', ids: string[], gridComponent: any): void; |
|||
(e: 'selectAllIn', gridComponent: any): void; |
|||
(e: 'selectAllOut', gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
const dialogRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,123 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="treeGridRef" |
|||
:title="$t('system.shared.selectMenu.grid.title')" |
|||
hide-bottom |
|||
:config-button="false" |
|||
:tree="true" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
tree-tick-strategy="strict" |
|||
: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 }; |
|||
} |
|||
} |
|||
" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:pageable="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
extend: 'expand', |
|||
enableIf: () => { |
|||
return foreignValue && treeGridRef?.getRows()?.length > 0; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'save', |
|||
label: $t('save'), |
|||
enableIf: () => { |
|||
return foreignValue && treeGridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: (arg) => { |
|||
DialogManager.confirm($t('system.shared.selectMenu.grid.toolbar.save.tip'), () => { |
|||
const ids = Tools.extractProperties(arg.tickeds, 'id'); |
|||
emit('update', ids, treeGridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
: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: 'enable', label: $t('status'), format: Formater.enableTag(), sortable: false }, |
|||
]" |
|||
: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') }, |
|||
|
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
import { DialogManager, Formater, Tools } from '@/platform'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'update', ids: string[], gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const treeGridRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
treeGridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
treeGridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,97 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="treeGridRef" |
|||
:title="$t('system.shared.selectOrg.grid.title')" |
|||
hide-bottom |
|||
:config-button="false" |
|||
:tree="true" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
tree-tick-strategy="strict" |
|||
ticked-field="selected" |
|||
:tree-icon=" |
|||
(row) => { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} |
|||
" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:pageable="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
extend: 'expand', |
|||
enableIf: () => { |
|||
return foreignValue && treeGridRef?.getRows()?.length > 0; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'save', |
|||
label: $t('save'), |
|||
enableIf: () => { |
|||
return foreignValue && treeGridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectOrg.grid.toolbar.save.tip'), () => { |
|||
const ids = Tools.extractProperties(treeGridRef?.getTickedRows(), 'id'); |
|||
emit('update', ids, treeGridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
:columns="[ |
|||
{ width: '100%', name: 'name', label: $t('name') }, |
|||
{ width: 100, name: 'code', label: $t('code') }, |
|||
{ width: 80, name: 'enable', label: $t('status'), format: Formater.enableTag(), 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') }, |
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
import { Environment, DialogManager, Formater, Tools } from 'platform-core'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'update', ids: string[], gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const treeGridRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
treeGridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
treeGridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,102 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('system.shared.selectRole.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" style="height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectRole.dialog.grid.title')" |
|||
selection="multiple" |
|||
:full-screen-button="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh']" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'name', label: $t('name'), type: 'text' }, |
|||
{ |
|||
name: 'enable', |
|||
label: $t('enable'), |
|||
type: 'select', |
|||
options: Options.yesNo(), |
|||
queryOperator: 'equals', |
|||
}, |
|||
{ |
|||
name: 'dataComeFrom', |
|||
label: $t('dataComeFrom'), |
|||
type: 'select', |
|||
options: Options.enum(DataComeFromEnum), |
|||
queryOperator: 'equals', |
|||
}, |
|||
]" |
|||
:auto-fetch-data="false" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:columns="[ |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ |
|||
name: 'status', |
|||
label: t('status'), |
|||
format: Formater.enableTag(), |
|||
}, |
|||
{ name: 'lastModifier', label: t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: t('lastModifyDate') }, |
|||
]" |
|||
></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> |
@ -0,0 +1,141 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectRole.grid.title')" |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:auto-fetch-data="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
name: 'selectIn', |
|||
label: $t('system.shared.selectRole.grid.toolbar.selectIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
dialogRef.open(foreignValue); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectOut', |
|||
label: $t('system.shared.selectRole.grid.toolbar.selectOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getSelectedRows()?.length > 0; |
|||
}, |
|||
click: (arg) => { |
|||
const ids = Tools.extractProperties(arg.selecteds, 'id'); |
|||
DialogManager.confirm($t('system.shared.selectRole.grid.toolbar.selectOut.tip'), () => { |
|||
emit('selectOut', ids, gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'selectAllIn', |
|||
label: $t('system.shared.selectRole.grid.toolbar.selectAllIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectRole.grid.toolbar.selectAllIn.tip'), () => { |
|||
emit('selectAllIn', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectAllOut', |
|||
label: $t('system.shared.selectRole.grid.toolbar.selectAllOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectRole.grid.toolbar.selectAllOut.tip'), () => { |
|||
emit('selectAllOut', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
:columns="[ |
|||
{ width: 150, 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') }, |
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
<SelectRoleDialog |
|||
ref="dialogRef" |
|||
:opener="gridRef" |
|||
:fetch-data-url="fetchOtherDataUrl" |
|||
:foreign-key="foreignKey" |
|||
:foreign-value="foreignValue" |
|||
@after-selected=" |
|||
(ids: string[]) => { |
|||
emit('selectIn', ids, gridRef, dialogRef); |
|||
} |
|||
" |
|||
></SelectRoleDialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
|
|||
import { EnumTools, DialogManager, Formater, Tools } from 'platform-core'; |
|||
import SelectRoleDialog from './SelectRoleDialog.vue'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
fetchOtherDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'selectIn', ids: string[], gridComponent: any, dialogComponent: any): void; |
|||
(e: 'selectOut', ids: string[], gridComponent: any): void; |
|||
(e: 'selectAllIn', gridComponent: any): void; |
|||
(e: 'selectAllOut', gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
const dialogRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,106 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('system.shared.selectUser.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" style="height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectUser.dialog.grid.title')" |
|||
selection="multiple" |
|||
:full-screen-button="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh']" |
|||
:query-form-fields="[ |
|||
{ name: 'loginName', label: $t('loginName'), type: 'text' }, |
|||
{ name: 'userName', label: $t('userName'), type: 'text' }, |
|||
{ |
|||
name: 'enable', |
|||
label: $t('enable'), |
|||
type: 'select', |
|||
options: Options.yesNo(), |
|||
queryOperator: 'equals', |
|||
}, |
|||
{ |
|||
name: 'dataComeFrom', |
|||
label: $t('dataComeFrom'), |
|||
type: 'select', |
|||
options: Options.enum(DataComeFromEnum), |
|||
queryOperator: 'equals', |
|||
}, |
|||
]" |
|||
:auto-fetch-data="false" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
: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, |
|||
}; |
|||
}, |
|||
}, |
|||
]" |
|||
></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'; |
|||
import UserStatusTag from './UserStatusTag.vue'; |
|||
|
|||
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> |
@ -0,0 +1,161 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectUser.grid.title')" |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:auto-fetch-data="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
name: 'selectIn', |
|||
label: $t('system.shared.selectUser.grid.toolbar.selectIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
dialogRef.open(foreignValue); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectOut', |
|||
label: $t('system.shared.selectUser.grid.toolbar.selectOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getSelectedRows()?.length > 0; |
|||
}, |
|||
click: (arg) => { |
|||
const ids = Tools.extractProperties(arg.selecteds, 'id'); |
|||
DialogManager.confirm($t('system.shared.selectUser.grid.toolbar.selectOut.tip'), () => { |
|||
emit('selectOut', ids, gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'selectAllIn', |
|||
label: $t('system.shared.selectUser.grid.toolbar.selectAllIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectUser.grid.toolbar.selectAllIn.tip'), () => { |
|||
emit('selectAllIn', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectAllOut', |
|||
label: $t('system.shared.selectUser.grid.toolbar.selectAllOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectUser.grid.toolbar.selectAllOut.tip'), () => { |
|||
emit('selectAllOut', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
:columns="[ |
|||
{ width: 150, name: 'loginName', label: $t('loginName') }, |
|||
{ width: '100%', name: 'userName', label: $t('userName') }, |
|||
{ |
|||
width: 150, |
|||
name: 'enable', |
|||
label: $t('status'), |
|||
format: (value, row) => { |
|||
return { |
|||
componentType: UserStatusTag, |
|||
attrs: row, |
|||
}; |
|||
}, |
|||
}, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'loginName', label: $t('loginName') }, |
|||
{ name: 'userName', label: $t('userName') }, |
|||
{ name: 'description', label: $t('description') }, |
|||
{ |
|||
name: 'enable', |
|||
label: $t('enable'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'accountExpired', label: $t('accountExpired') }, |
|||
{ name: 'accountLocked', label: $t('accountLocked') }, |
|||
{ name: 'credentialsExpired', label: $t('credentialsExpired') }, |
|||
{ name: 'email', label: $t('email') }, |
|||
{ name: 'phone', label: $t('phone') }, |
|||
{ name: 'mobile', label: $t('mobile') }, |
|||
{ name: 'weixin', label: $t('weixin') }, |
|||
{ name: 'qq', label: $t('qq') }, |
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
<SelectUserDialog |
|||
ref="dialogRef" |
|||
:opener="gridRef" |
|||
:fetch-data-url="fetchOtherDataUrl" |
|||
:foreign-key="foreignKey" |
|||
:foreign-value="foreignValue" |
|||
@after-selected=" |
|||
(ids: string[]) => { |
|||
emit('selectIn', ids, gridRef, dialogRef); |
|||
} |
|||
" |
|||
></SelectUserDialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
import { DialogManager, Tools } from 'platform-core'; |
|||
import SelectUserDialog from './SelectUserDialog.vue'; |
|||
import UserStatusTag from './UserStatusTag.vue'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
fetchOtherDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'selectIn', ids: string[], gridComponent: any, dialogComponent: any): void; |
|||
(e: 'selectOut', ids: string[], gridComponent: any): void; |
|||
(e: 'selectAllIn', gridComponent: any): void; |
|||
(e: 'selectAllOut', gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
const dialogRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
console.log('onUpdated....'); |
|||
gridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,17 @@ |
|||
<template> |
|||
<div> |
|||
<q-chip v-if="enable && !accountExpired && !accountLocked && !credentialsExpired" color="green" text-color="white" :label="$t('normal')" dense></q-chip> |
|||
<q-chip v-if="!enable" color="red" text-color="white" :label="$t('disable')" dense></q-chip> |
|||
<q-chip v-if="accountExpired" color="red" text-color="white" :label="$t('accountExpired')" dense></q-chip> |
|||
<q-chip v-if="accountLocked" color="red" text-color="white" :label="$t('accountLocked')" dense></q-chip> |
|||
<q-chip v-if="credentialsExpired" color="red" text-color="white" :label="$t('credentialsExpired')" dense></q-chip> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
const props = defineProps({ |
|||
enable: { type: Boolean, default: true }, |
|||
accountExpired: { type: Boolean, default: false }, |
|||
accountLocked: { type: Boolean, default: false }, |
|||
credentialsExpired: { type: Boolean, default: false }, |
|||
}); |
|||
</script> |
@ -0,0 +1,102 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('system.shared.selectApplication.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" style="height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectApplication.dialog.grid.title')" |
|||
selection="multiple" |
|||
:full-screen-button="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh']" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'name', label: $t('name'), type: 'text' }, |
|||
{ |
|||
name: 'enable', |
|||
label: $t('enable'), |
|||
type: 'select', |
|||
options: Options.yesNo(), |
|||
queryOperator: 'equals', |
|||
}, |
|||
{ |
|||
name: 'dataComeFrom', |
|||
label: $t('dataComeFrom'), |
|||
type: 'select', |
|||
options: Options.enum(DataComeFromEnum), |
|||
queryOperator: 'equals', |
|||
}, |
|||
]" |
|||
:auto-fetch-data="false" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:columns="[ |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ |
|||
name: 'status', |
|||
label: t('status'), |
|||
format: Formater.enableTag(), |
|||
}, |
|||
{ name: 'lastModifier', label: t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: t('lastModifyDate') }, |
|||
]" |
|||
></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> |
@ -0,0 +1,141 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectApplication.grid.title')" |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:auto-fetch-data="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
name: 'selectIn', |
|||
label: $t('system.shared.selectApplication.grid.toolbar.selectIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
dialogRef.open(foreignValue); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectOut', |
|||
label: $t('system.shared.selectApplication.grid.toolbar.selectOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getSelectedRows()?.length > 0; |
|||
}, |
|||
click: (arg) => { |
|||
const ids = Tools.extractProperties(arg.selecteds, 'id'); |
|||
DialogManager.confirm($t('system.shared.selectApplication.grid.toolbar.selectOut.tip'), () => { |
|||
emit('selectOut', ids, gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'selectAllIn', |
|||
label: $t('system.shared.selectApplication.grid.toolbar.selectAllIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectApplication.grid.toolbar.selectAllIn.tip'), () => { |
|||
emit('selectAllIn', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectAllOut', |
|||
label: $t('system.shared.selectApplication.grid.toolbar.selectAllOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectApplication.grid.toolbar.selectAllOut.tip'), () => { |
|||
emit('selectAllOut', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
:columns="[ |
|||
{ width: 150, 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') }, |
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
<SelectApplicationDialog |
|||
ref="dialogRef" |
|||
:opener="gridRef" |
|||
:fetch-data-url="fetchOtherDataUrl" |
|||
:foreign-key="foreignKey" |
|||
:foreign-value="foreignValue" |
|||
@after-selected=" |
|||
(ids: string[]) => { |
|||
emit('selectIn', ids, gridRef, dialogRef); |
|||
} |
|||
" |
|||
></SelectApplicationDialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
|
|||
import { EnumTools, DialogManager, Formater, Tools } from 'platform-core'; |
|||
import SelectApplicationDialog from './SelectApplicationDialog.vue'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
fetchOtherDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'selectIn', ids: string[], gridComponent: any, dialogComponent: any): void; |
|||
(e: 'selectOut', ids: string[], gridComponent: any): void; |
|||
(e: 'selectAllIn', gridComponent: any): void; |
|||
(e: 'selectAllOut', gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
const dialogRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,123 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="treeGridRef" |
|||
:title="$t('system.shared.selectMenu.grid.title')" |
|||
hide-bottom |
|||
:config-button="false" |
|||
:tree="true" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
tree-tick-strategy="strict" |
|||
: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 }; |
|||
} |
|||
} |
|||
" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:pageable="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
extend: 'expand', |
|||
enableIf: () => { |
|||
return foreignValue && treeGridRef?.getRows()?.length > 0; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'save', |
|||
label: $t('save'), |
|||
enableIf: () => { |
|||
return foreignValue && treeGridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: (arg) => { |
|||
DialogManager.confirm($t('system.shared.selectMenu.grid.toolbar.save.tip'), () => { |
|||
const ids = Tools.extractProperties(arg.tickeds, 'id'); |
|||
emit('update', ids, treeGridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
: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: 'enable', label: $t('status'), format: Formater.enableTag(), sortable: false }, |
|||
]" |
|||
: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') }, |
|||
|
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
import { DialogManager, Formater, Tools } from '@/platform'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'update', ids: string[], gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const treeGridRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
treeGridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
treeGridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,97 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="treeGridRef" |
|||
:title="$t('system.shared.selectOrg.grid.title')" |
|||
hide-bottom |
|||
:config-button="false" |
|||
:tree="true" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
tree-tick-strategy="strict" |
|||
ticked-field="selected" |
|||
:tree-icon=" |
|||
(row) => { |
|||
return { name: 'folder', color: 'amber' }; |
|||
} |
|||
" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:pageable="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
extend: 'expand', |
|||
enableIf: () => { |
|||
return foreignValue && treeGridRef?.getRows()?.length > 0; |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'save', |
|||
label: $t('save'), |
|||
enableIf: () => { |
|||
return foreignValue && treeGridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectOrg.grid.toolbar.save.tip'), () => { |
|||
const ids = Tools.extractProperties(treeGridRef?.getTickedRows(), 'id'); |
|||
emit('update', ids, treeGridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
:columns="[ |
|||
{ width: '100%', name: 'name', label: $t('name') }, |
|||
{ width: 100, name: 'code', label: $t('code') }, |
|||
{ width: 80, name: 'enable', label: $t('status'), format: Formater.enableTag(), 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') }, |
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
import { Environment, DialogManager, Formater, Tools } from 'platform-core'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'update', ids: string[], gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const treeGridRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
treeGridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
treeGridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,102 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('system.shared.selectRole.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" style="height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectRole.dialog.grid.title')" |
|||
selection="multiple" |
|||
:full-screen-button="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh']" |
|||
:query-form-fields="[ |
|||
{ name: 'code', label: $t('code'), type: 'text' }, |
|||
{ name: 'name', label: $t('name'), type: 'text' }, |
|||
{ |
|||
name: 'enable', |
|||
label: $t('enable'), |
|||
type: 'select', |
|||
options: Options.yesNo(), |
|||
queryOperator: 'equals', |
|||
}, |
|||
{ |
|||
name: 'dataComeFrom', |
|||
label: $t('dataComeFrom'), |
|||
type: 'select', |
|||
options: Options.enum(DataComeFromEnum), |
|||
queryOperator: 'equals', |
|||
}, |
|||
]" |
|||
:auto-fetch-data="false" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:columns="[ |
|||
{ name: 'code', label: $t('code') }, |
|||
{ name: 'name', label: $t('name') }, |
|||
{ |
|||
name: 'status', |
|||
label: t('status'), |
|||
format: Formater.enableTag(), |
|||
}, |
|||
{ name: 'lastModifier', label: t('lastModifier') }, |
|||
{ name: 'lastModifyDate', label: t('lastModifyDate') }, |
|||
]" |
|||
></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> |
@ -0,0 +1,141 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectRole.grid.title')" |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:auto-fetch-data="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
name: 'selectIn', |
|||
label: $t('system.shared.selectRole.grid.toolbar.selectIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
dialogRef.open(foreignValue); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectOut', |
|||
label: $t('system.shared.selectRole.grid.toolbar.selectOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getSelectedRows()?.length > 0; |
|||
}, |
|||
click: (arg) => { |
|||
const ids = Tools.extractProperties(arg.selecteds, 'id'); |
|||
DialogManager.confirm($t('system.shared.selectRole.grid.toolbar.selectOut.tip'), () => { |
|||
emit('selectOut', ids, gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'selectAllIn', |
|||
label: $t('system.shared.selectRole.grid.toolbar.selectAllIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectRole.grid.toolbar.selectAllIn.tip'), () => { |
|||
emit('selectAllIn', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectAllOut', |
|||
label: $t('system.shared.selectRole.grid.toolbar.selectAllOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectRole.grid.toolbar.selectAllOut.tip'), () => { |
|||
emit('selectAllOut', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
:columns="[ |
|||
{ width: 150, 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') }, |
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
<SelectRoleDialog |
|||
ref="dialogRef" |
|||
:opener="gridRef" |
|||
:fetch-data-url="fetchOtherDataUrl" |
|||
:foreign-key="foreignKey" |
|||
:foreign-value="foreignValue" |
|||
@after-selected=" |
|||
(ids: string[]) => { |
|||
emit('selectIn', ids, gridRef, dialogRef); |
|||
} |
|||
" |
|||
></SelectRoleDialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
|
|||
import { EnumTools, DialogManager, Formater, Tools } from 'platform-core'; |
|||
import SelectRoleDialog from './SelectRoleDialog.vue'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
fetchOtherDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'selectIn', ids: string[], gridComponent: any, dialogComponent: any): void; |
|||
(e: 'selectOut', ids: string[], gridComponent: any): void; |
|||
(e: 'selectAllIn', gridComponent: any): void; |
|||
(e: 'selectAllOut', gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
const dialogRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
gridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,106 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
:title="$t('system.shared.selectUser.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" style="height: 100%"> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectUser.dialog.grid.title')" |
|||
selection="multiple" |
|||
:full-screen-button="false" |
|||
:toolbar-configure="{ noIcon: false }" |
|||
:toolbar-actions="['query', 'refresh']" |
|||
:query-form-fields="[ |
|||
{ name: 'loginName', label: $t('loginName'), type: 'text' }, |
|||
{ name: 'userName', label: $t('userName'), type: 'text' }, |
|||
{ |
|||
name: 'enable', |
|||
label: $t('enable'), |
|||
type: 'select', |
|||
options: Options.yesNo(), |
|||
queryOperator: 'equals', |
|||
}, |
|||
{ |
|||
name: 'dataComeFrom', |
|||
label: $t('dataComeFrom'), |
|||
type: 'select', |
|||
options: Options.enum(DataComeFromEnum), |
|||
queryOperator: 'equals', |
|||
}, |
|||
]" |
|||
:auto-fetch-data="false" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
: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, |
|||
}; |
|||
}, |
|||
}, |
|||
]" |
|||
></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'; |
|||
import UserStatusTag from './UserStatusTag.vue'; |
|||
|
|||
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> |
@ -0,0 +1,161 @@ |
|||
<template> |
|||
<w-grid |
|||
ref="gridRef" |
|||
:title="$t('system.shared.selectUser.grid.title')" |
|||
:config-button="false" |
|||
selection="multiple" |
|||
:checkbox-selection="true" |
|||
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" |
|||
:auto-fetch-data="false" |
|||
:toolbar-configure="{ noIcon: true }" |
|||
:toolbar-actions="[ |
|||
'refresh', |
|||
'separator', |
|||
{ |
|||
name: 'selectIn', |
|||
label: $t('system.shared.selectUser.grid.toolbar.selectIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
dialogRef.open(foreignValue); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectOut', |
|||
label: $t('system.shared.selectUser.grid.toolbar.selectOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getSelectedRows()?.length > 0; |
|||
}, |
|||
click: (arg) => { |
|||
const ids = Tools.extractProperties(arg.selecteds, 'id'); |
|||
DialogManager.confirm($t('system.shared.selectUser.grid.toolbar.selectOut.tip'), () => { |
|||
emit('selectOut', ids, gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
{ |
|||
name: 'selectAllIn', |
|||
label: $t('system.shared.selectUser.grid.toolbar.selectAllIn'), |
|||
enableIf: () => { |
|||
return foreignValue ? true : false; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectUser.grid.toolbar.selectAllIn.tip'), () => { |
|||
emit('selectAllIn', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
name: 'selectAllOut', |
|||
label: $t('system.shared.selectUser.grid.toolbar.selectAllOut'), |
|||
enableIf: () => { |
|||
return foreignValue && gridRef?.getRows()?.length > 0; |
|||
}, |
|||
click: () => { |
|||
DialogManager.confirm($t('system.shared.selectUser.grid.toolbar.selectAllOut.tip'), () => { |
|||
emit('selectAllOut', gridRef); |
|||
}); |
|||
}, |
|||
}, |
|||
'separator', |
|||
'view', |
|||
]" |
|||
:columns="[ |
|||
{ width: 150, name: 'loginName', label: $t('loginName') }, |
|||
{ width: '100%', name: 'userName', label: $t('userName') }, |
|||
{ |
|||
width: 150, |
|||
name: 'enable', |
|||
label: $t('status'), |
|||
format: (value, row) => { |
|||
return { |
|||
componentType: UserStatusTag, |
|||
attrs: row, |
|||
}; |
|||
}, |
|||
}, |
|||
]" |
|||
:viewer="{ |
|||
panel: { |
|||
columnNum: 1, |
|||
fields: [ |
|||
{ name: 'id', label: $t('id') }, |
|||
{ name: 'loginName', label: $t('loginName') }, |
|||
{ name: 'userName', label: $t('userName') }, |
|||
{ name: 'description', label: $t('description') }, |
|||
{ |
|||
name: 'enable', |
|||
label: $t('enable'), |
|||
format: (value) => { |
|||
return value; |
|||
}, |
|||
}, |
|||
{ name: 'accountExpired', label: $t('accountExpired') }, |
|||
{ name: 'accountLocked', label: $t('accountLocked') }, |
|||
{ name: 'credentialsExpired', label: $t('credentialsExpired') }, |
|||
{ name: 'email', label: $t('email') }, |
|||
{ name: 'phone', label: $t('phone') }, |
|||
{ name: 'mobile', label: $t('mobile') }, |
|||
{ name: 'weixin', label: $t('weixin') }, |
|||
{ name: 'qq', label: $t('qq') }, |
|||
{ 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') }, |
|||
], |
|||
}, |
|||
}" |
|||
></w-grid> |
|||
<SelectUserDialog |
|||
ref="dialogRef" |
|||
:opener="gridRef" |
|||
:fetch-data-url="fetchOtherDataUrl" |
|||
:foreign-key="foreignKey" |
|||
:foreign-value="foreignValue" |
|||
@after-selected=" |
|||
(ids: string[]) => { |
|||
emit('selectIn', ids, gridRef, dialogRef); |
|||
} |
|||
" |
|||
></SelectUserDialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, onUpdated } from 'vue'; |
|||
import { DialogManager, Tools } from 'platform-core'; |
|||
import SelectUserDialog from './SelectUserDialog.vue'; |
|||
import UserStatusTag from './UserStatusTag.vue'; |
|||
|
|||
const props = defineProps({ |
|||
fetchDataUrl: { type: String, default: '' }, |
|||
fetchOtherDataUrl: { type: String, default: '' }, |
|||
foreignKey: { type: String, default: '' }, |
|||
foreignValue: { type: String, default: '' }, |
|||
}); |
|||
|
|||
const emit = defineEmits<{ |
|||
(e: 'selectIn', ids: string[], gridComponent: any, dialogComponent: any): void; |
|||
(e: 'selectOut', ids: string[], gridComponent: any): void; |
|||
(e: 'selectAllIn', gridComponent: any): void; |
|||
(e: 'selectAllOut', gridComponent: any): void; |
|||
}>(); |
|||
|
|||
const gridRef = ref(); |
|||
const dialogRef = ref(); |
|||
|
|||
const refresh = () => { |
|||
gridRef.value.refresh(); |
|||
}; |
|||
|
|||
onUpdated(() => { |
|||
console.log('onUpdated....'); |
|||
gridRef.value.refresh(); |
|||
}); |
|||
|
|||
defineExpose({ |
|||
refresh, |
|||
}); |
|||
</script> |
@ -0,0 +1,17 @@ |
|||
<template> |
|||
<div> |
|||
<q-chip v-if="enable && !accountExpired && !accountLocked && !credentialsExpired" color="green" text-color="white" :label="$t('normal')" dense></q-chip> |
|||
<q-chip v-if="!enable" color="red" text-color="white" :label="$t('disable')" dense></q-chip> |
|||
<q-chip v-if="accountExpired" color="red" text-color="white" :label="$t('accountExpired')" dense></q-chip> |
|||
<q-chip v-if="accountLocked" color="red" text-color="white" :label="$t('accountLocked')" dense></q-chip> |
|||
<q-chip v-if="credentialsExpired" color="red" text-color="white" :label="$t('credentialsExpired')" dense></q-chip> |
|||
</div> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
const props = defineProps({ |
|||
enable: { type: Boolean, default: true }, |
|||
accountExpired: { type: Boolean, default: false }, |
|||
accountLocked: { type: Boolean, default: false }, |
|||
credentialsExpired: { type: Boolean, default: false }, |
|||
}); |
|||
</script> |
Loading…
Reference in new issue