forked from verdnatura/salix-front
refs #7355 add role
This commit is contained in:
parent
732bb0943c
commit
e64e6eefe3
|
@ -108,6 +108,7 @@ async function search() {
|
|||
...Object.fromEntries(staticParams),
|
||||
search: searchText.value,
|
||||
},
|
||||
...{ filter: props.filter },
|
||||
};
|
||||
|
||||
if (props.whereFilter) {
|
||||
|
|
|
@ -9,7 +9,9 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
|||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const tableRef = ref();
|
||||
|
||||
const filter = {
|
||||
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
||||
};
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -29,7 +31,22 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'username',
|
||||
name: 'roleFk',
|
||||
label: t('role'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'roleFk',
|
||||
attrs: {
|
||||
url: 'VnRoles',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'name',
|
||||
},
|
||||
},
|
||||
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'nickname',
|
||||
label: t('Nickname'),
|
||||
isTitle: true,
|
||||
component: 'input',
|
||||
|
@ -104,12 +121,13 @@ const exprBuilder = (param, value) => {
|
|||
:expr-builder="exprBuilder"
|
||||
:label="t('account.search')"
|
||||
:info="t('account.searchInfo')"
|
||||
:filter="filter"
|
||||
/>
|
||||
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="AccountUsers"
|
||||
url="VnUsers/preview"
|
||||
:filter="filter"
|
||||
order="id DESC"
|
||||
:columns="columns"
|
||||
default-mode="table"
|
||||
|
|
|
@ -11,6 +11,9 @@ const { t } = useI18n();
|
|||
data-key="Account"
|
||||
:descriptor="AccountDescriptor"
|
||||
search-data-key="AccountUsers"
|
||||
:filter="{
|
||||
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
|
||||
}"
|
||||
:searchbar-props="{
|
||||
url: 'VnUsers/preview',
|
||||
label: t('account.search'),
|
||||
|
|
Loading…
Reference in New Issue