Browse Source

修复部分问题

main
likunming 17 hours ago
parent
commit
31ddc06ba9
  1. 5
      io.sc.platform.core.frontend/src/platform/components/grid/ts/function/Criteria.ts
  2. 52
      io.sc.platform.core.frontend/src/platform/components/select/WUserSelect.vue
  3. 3
      io.sc.platform.core.frontend/src/views/likm/Form.vue
  4. 71
      io.sc.platform.core.frontend/src/views/likm/Grid.vue

5
io.sc.platform.core.frontend/src/platform/components/grid/ts/function/Criteria.ts

@ -98,11 +98,16 @@ export class Criteria extends Base {
if (
(!Tools.isEmpty(queryFormData[item]) && !Array.isArray(queryFormData[item])) ||
(!Tools.isEmpty(queryFormData[item]) && Array.isArray(queryFormData[item]) && queryFormData[item].length > 0)
) {
if (
(this.queryFormFields[item]['type'] === 'w-date-range' && !Tools.isEmpty(queryFormData[item]['from'])) ||
this.queryFormFields[item]['type'] !== 'w-date-range'
) {
// 根据数据进行operator处理
const criteria = this.buildCriteria(queryFormData[item], item);
urlSearchParams.append('criteria', JSON.stringify(criteria));
}
}
});
});
}

52
io.sc.platform.core.frontend/src/platform/components/select/WUserSelect.vue

@ -26,22 +26,62 @@
<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>
<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="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>
<div class="h-full pl-1">
<w-grid
ref="userGridRef"
:checkbox-selection="props.multiple || false"
@ -71,6 +111,7 @@
@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(

3
io.sc.platform.core.frontend/src/views/likm/Form.vue

@ -227,6 +227,9 @@
label: '数字',
type: 'w-number',
precision: 2,
prefix: '¥',
colsFirst: true,
colSpan: 'full',
requiredIf: (args) => {
return true;
},

71
io.sc.platform.core.frontend/src/views/likm/Grid.vue

@ -1,74 +1,19 @@
<template>
<w-grid
:title="$t('menu.developer.springboot.bean')"
title="用户列表"
:checkbox-selection="false"
:fetch-data-url="Environment.apiContextPath('/api/developer/springboot/beans')"
:fetch-data-url="Environment.apiContextPath('/api/system/user')"
:pageable="false"
:toolbar-actions="['refresh', 'separator', 'view', 'separator', 'export']"
group-mode="alone"
group-by-field="scope"
:toolbar-actions="['query', 'reset']"
:query-form-fields="[{ name: 'lastModifyDate', label: $t('lastModifyDate'), type: 'w-date-range' }]"
:columns="[
{ width: 500, name: 'name', label: $t('name') },
{ width: 400, name: 'type', label: $t('className'), format: Formater.simpleClassName() },
{ name: 'loginName', label: $t('loginName') },
{ name: 'userName', label: $t('userName') },
{
width: 100,
name: 'scope',
label: $t('scope'),
sortable: false,
format: (val) => {
if (val === 'singleton') {
return '测试';
} else if (val === 'prototype') {
return '测试2';
}
return val;
},
name: 'lastModifyDate',
label: $t('lastModifyDate'),
},
]"
:viewer="{
panel: {
columnNum: 2,
labelWidth: 200,
valueWidth: '100%',
fields: [
{ width: 100, name: 'name', label: $t('name') },
{ width: 100, name: 'context', label: $t('context') },
{
width: 100,
name: 'scope',
label: $t('scope'),
},
{ width: 100, name: 'type', label: $t('className'), format: Formater.none() },
{ width: 100, name: 'resource', label: $t('resource') },
{
width: 100,
name: 'aliases',
label: $t('aliases'),
format: (aliases) => {
aliases = aliases || [];
let result = '';
for (const aliase of aliases) {
result += aliase + '<br/>';
}
return result;
},
},
{
width: 100,
name: 'dependencies',
label: $t('dependencies'),
format: (dependencies) => {
dependencies = dependencies || [];
let result = '';
for (const dependency of dependencies) {
result += dependency + '<br/>';
}
return result;
},
},
],
},
}"
></w-grid>
</template>
<script setup lang="ts">

Loading…
Cancel
Save