|
|
@ -26,51 +26,92 @@ |
|
|
|
<q-btn v-if="!Tools.isEmpty(displayValueComputed)" flat square unelevated dense icon="cancel" @click="fieldMethodsClass.clearValue"></q-btn> |
|
|
|
<q-btn flat square unelevated dense icon="person_search"> |
|
|
|
<q-popup-proxy v-model:model-value="isShow" anchor="bottom right" self="top right" :offset="[0, 10]"> |
|
|
|
<q-splitter v-model="leftWidthRef" style="width: 800px; height: 300px; position: relative"> |
|
|
|
<q-splitter v-model="leftWidthRef" style="width: 900px; height: 400px; position: relative"> |
|
|
|
<template #before> |
|
|
|
<w-grid |
|
|
|
ref="orgGridRef" |
|
|
|
:dense="true" |
|
|
|
:tree="true" |
|
|
|
:fetch-data-url="Environment.apiContextPath('/api/system/org')" |
|
|
|
:config-button="false" |
|
|
|
:checkbox-selection="false" |
|
|
|
db-click-operation="expand" |
|
|
|
:columns="[{ name: 'name', label: $t('org') }]" |
|
|
|
@row-click="orgRowClick" |
|
|
|
> |
|
|
|
</w-grid> |
|
|
|
<q-list> |
|
|
|
<!-- 机构 --> |
|
|
|
<q-expansion-item icon="account_tree" label="机构"> |
|
|
|
<q-card class="p-0"> |
|
|
|
<q-card-section class="p-0"> |
|
|
|
<w-grid |
|
|
|
ref="orgGridRef" |
|
|
|
:dense="true" |
|
|
|
:tree="true" |
|
|
|
:height="250" |
|
|
|
:hide-header="true" |
|
|
|
separator="none" |
|
|
|
:fetch-data-url="Environment.apiContextPath('/api/system/org')" |
|
|
|
:config-button="false" |
|
|
|
:checkbox-selection="true" |
|
|
|
db-click-operation="expand" |
|
|
|
:columns="[{ name: 'name', label: $t('org') }]" |
|
|
|
@row-click="orgRowClick" |
|
|
|
@update-ticked="orgUpdateTicked" |
|
|
|
> |
|
|
|
</w-grid> |
|
|
|
</q-card-section> |
|
|
|
</q-card> |
|
|
|
</q-expansion-item> |
|
|
|
<q-separator /> |
|
|
|
|
|
|
|
<!-- 角色 --> |
|
|
|
<q-expansion-item icon="person" label="角色"> |
|
|
|
<q-card class="p-0"> |
|
|
|
<q-card-section class="p-0"> |
|
|
|
<w-grid |
|
|
|
ref="roleGridRef" |
|
|
|
:dense="true" |
|
|
|
:height="250" |
|
|
|
separator="none" |
|
|
|
:fetch-data-url="Environment.apiContextPath('/api/system/role')" |
|
|
|
:config-button="false" |
|
|
|
:checkbox-selection="true" |
|
|
|
db-click-operation="expand" |
|
|
|
:columns="[ |
|
|
|
{ name: 'code', label: $t('code') }, |
|
|
|
{ name: 'name', label: $t('org') }, |
|
|
|
]" |
|
|
|
@row-click="orgRowClick" |
|
|
|
> |
|
|
|
</w-grid> |
|
|
|
</q-card-section> |
|
|
|
</q-card> |
|
|
|
</q-expansion-item> |
|
|
|
<q-separator /> |
|
|
|
</q-list> |
|
|
|
</template> |
|
|
|
<template #after> |
|
|
|
<w-grid |
|
|
|
ref="userGridRef" |
|
|
|
:checkbox-selection="props.multiple || false" |
|
|
|
:dense="true" |
|
|
|
:fetch-data-url="userGridFetchDataUrl" |
|
|
|
:config-button="false" |
|
|
|
title="用户列表" |
|
|
|
:sort-by="['loginName']" |
|
|
|
:query-form-cols-num="2" |
|
|
|
:query-form-fields="[ |
|
|
|
{ name: 'loginName', label: $t('loginName'), type: 'w-text' }, |
|
|
|
{ name: 'userName', label: $t('userName'), type: 'w-text' }, |
|
|
|
]" |
|
|
|
:toolbar-actions="['query', 'separator', 'reset']" |
|
|
|
:ticked-record="{ |
|
|
|
columnName: valueUseColumnName, |
|
|
|
data: typeof modelValue === 'string' ? [modelValue] : modelValue, |
|
|
|
}" |
|
|
|
:columns="[ |
|
|
|
{ name: 'loginName', label: $t('loginName') }, |
|
|
|
{ name: 'userName', label: $t('userName') }, |
|
|
|
{ name: 'description', label: $t('description') }, |
|
|
|
{ name: 'enable', label: $t('status'), format: Formater.enableTag() }, |
|
|
|
]" |
|
|
|
@row-click="userRowClick" |
|
|
|
@update-ticked="updateTicked" |
|
|
|
@update-tickeds="updateTickeds" |
|
|
|
> |
|
|
|
</w-grid> |
|
|
|
<div class="h-full pl-1"> |
|
|
|
<w-grid |
|
|
|
ref="userGridRef" |
|
|
|
:checkbox-selection="props.multiple || false" |
|
|
|
:dense="true" |
|
|
|
:fetch-data-url="userGridFetchDataUrl" |
|
|
|
:config-button="false" |
|
|
|
title="用户列表" |
|
|
|
:sort-by="['loginName']" |
|
|
|
:query-form-cols-num="2" |
|
|
|
:query-form-fields="[ |
|
|
|
{ name: 'loginName', label: $t('loginName'), type: 'w-text' }, |
|
|
|
{ name: 'userName', label: $t('userName'), type: 'w-text' }, |
|
|
|
]" |
|
|
|
:toolbar-actions="['query', 'separator', 'reset']" |
|
|
|
:ticked-record="{ |
|
|
|
columnName: valueUseColumnName, |
|
|
|
data: typeof modelValue === 'string' ? [modelValue] : modelValue, |
|
|
|
}" |
|
|
|
:columns="[ |
|
|
|
{ name: 'loginName', label: $t('loginName') }, |
|
|
|
{ name: 'userName', label: $t('userName') }, |
|
|
|
{ name: 'description', label: $t('description') }, |
|
|
|
{ name: 'enable', label: $t('status'), format: Formater.enableTag() }, |
|
|
|
]" |
|
|
|
@row-click="userRowClick" |
|
|
|
@update-ticked="updateTicked" |
|
|
|
@update-tickeds="updateTickeds" |
|
|
|
> |
|
|
|
</w-grid> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</q-splitter> |
|
|
|
</q-popup-proxy> |
|
|
@ -85,7 +126,7 @@ |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, computed, useAttrs, toRaw, watch, onMounted } from 'vue'; |
|
|
|
import { Tools, axios, Environment, Formater } from '@/platform'; |
|
|
|
import { Tools, axios, Environment, Formater, $t } from '@/platform'; |
|
|
|
import { FormFieldProps } from '@/platform/components/form/FormField.ts'; |
|
|
|
import { FormFieldMethods } from '../form/FormField'; |
|
|
|
|
|
|
@ -94,6 +135,7 @@ const attrs = useAttrs(); |
|
|
|
const modelValue = defineModel<string | Array<string>>(); |
|
|
|
const modelObjectValue = ref(<any>[]); // 模型值包含实际值与显示值的对象集合。 |
|
|
|
const orgGridRef = ref(); |
|
|
|
const roleGridRef = ref(); |
|
|
|
const userGridRef = ref(); |
|
|
|
|
|
|
|
const userGridFetchDataUrl = Environment.apiContextPath('/api/system/user'); |
|
|
@ -255,6 +297,10 @@ const userRowClick = (args) => { |
|
|
|
const orgRowClick = (args) => { |
|
|
|
userGridRef.value.setFetchDataUrl(userGridFetchDataByOrgUrl + '?orgId=' + args.row['id']); |
|
|
|
userGridRef.value.refresh(); |
|
|
|
console.info('orgRowClick======================'); |
|
|
|
}; |
|
|
|
const orgUpdateTicked = (args) => { |
|
|
|
console.info('orgUpdateTicked======================'); |
|
|
|
}; |
|
|
|
|
|
|
|
watch( |
|
|
|