Browse Source

update

main
wangshaoping 6 months ago
parent
commit
5a65836484
  1. 4
      io.sc.platform.system.frontend/src/views/application/Application.vue
  2. 10
      io.sc.platform.system.frontend/src/views/corporation/Corporation.vue
  3. 12
      io.sc.platform.system.frontend/src/views/role/Role.vue
  4. 14
      io.sc.platform.system.frontend/src/views/shared/SelectApplicationGrid.vue
  5. 6
      io.sc.platform.system.frontend/src/views/shared/SelectMenuTreeGrid.vue
  6. 5
      io.sc.platform.system.frontend/src/views/shared/SelectOrgTreeGrid.vue
  7. 6
      io.sc.platform.system.frontend/src/views/shared/SelectRoleGrid.vue
  8. 6
      io.sc.platform.system.frontend/src/views/shared/SelectUserGrid.vue
  9. 12
      io.sc.platform.system.frontend/src/views/user/User.vue

4
io.sc.platform.system.frontend/src/views/application/Application.vue

@ -107,11 +107,7 @@ const currentSelectedApplicationId = ref('');
const refreshRelationshipComponents = (id) => { const refreshRelationshipComponents = (id) => {
currentSelectedApplicationId.value = id; currentSelectedApplicationId.value = id;
if (currentSelectedApplicationId.value) {
menuTreeGridRef.value?.refresh(); menuTreeGridRef.value?.refresh();
} else {
menuTreeGridRef.value?.setLocalData();
}
}; };
const update = (ids, gridComponent) => { const update = (ids, gridComponent) => {

10
io.sc.platform.system.frontend/src/views/corporation/Corporation.vue

@ -35,12 +35,10 @@
'export', 'export',
]" ]"
:columns="[ :columns="[
{ width: 300, name: 'name', label: $t('name') }, { width: '100%', name: 'name', label: $t('name') },
{ width: 150, name: 'code', label: $t('code') }, { width: 150, name: 'code', label: $t('code') },
{ width: 60, name: 'order', label: $t('order') }, { width: 60, name: 'order', label: $t('order') },
{ width: 70, name: 'enable', label: $t('status'), align: 'center', format: Formater.enableTag() }, { width: 70, name: 'enable', label: $t('status'), align: 'center', format: Formater.enableTag() },
{ width: 100, name: 'lastModifier', label: $t('lastModifier') },
{ width: 110, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() },
]" ]"
:editor="{ :editor="{
dialog: { dialog: {
@ -119,6 +117,8 @@ const refreshRelationshipComponents = (id) => {
currentSelectedCorporationCode.value = id; currentSelectedCorporationCode.value = id;
if (currentSelectedCorporationCode.value) { if (currentSelectedCorporationCode.value) {
userGridRef.value?.refresh(); userGridRef.value?.refresh();
} else {
userGridRef.value?.clear();
} }
}; };
@ -168,8 +168,6 @@ const selectAllOut = (gridComponent) => {
}; };
onActivated(() => { onActivated(() => {
if (currentSelectedCorporationCode.value) { refreshRelationshipComponents(currentSelectedCorporationCode.value);
userGridRef.value?.refresh();
}
}); });
</script> </script>

12
io.sc.platform.system.frontend/src/views/role/Role.vue

@ -130,7 +130,7 @@
</q-splitter> </q-splitter>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onActivated } from 'vue';
import { Environment, axios, Options, Formater, SessionManager } from 'platform-core'; import { Environment, axios, Options, Formater, SessionManager } from 'platform-core';
import SelectUserGrid from '../shared/SelectUserGrid.vue'; import SelectUserGrid from '../shared/SelectUserGrid.vue';
import SelectMenuTreeGrid from '../shared/SelectMenuTreeGrid.vue'; import SelectMenuTreeGrid from '../shared/SelectMenuTreeGrid.vue';
@ -146,8 +146,13 @@ const currentSelectedRoleId = ref('');
const refreshRelationshipComponents = (id) => { const refreshRelationshipComponents = (id) => {
currentSelectedRoleId.value = id; currentSelectedRoleId.value = id;
if (currentSelectedRoleId.value) {
menuTreeGridRef.value?.refresh(); menuTreeGridRef.value?.refresh();
userGridRef.value?.refresh(); userGridRef.value?.refresh();
} else {
menuTreeGridRef.value?.clear();
userGridRef.value?.clear();
}
}; };
const selectIn = (ids: string[], gridComponent, dialogComponent) => { const selectIn = (ids: string[], gridComponent, dialogComponent) => {
@ -206,7 +211,9 @@ const update = (ids, gridComponent) => {
}); });
}; };
onMounted(() => { onActivated(() => {
refreshRelationshipComponents(currentSelectedRoleId.value);
if (SessionManager.isPrimaryCorporation()) {
axios.get(Environment.apiContextPath('/api/system/corporation?pageable=false')).then((response) => { axios.get(Environment.apiContextPath('/api/system/corporation?pageable=false')).then((response) => {
const options = []; const options = [];
const corporationMap = {}; const corporationMap = {};
@ -219,5 +226,6 @@ onMounted(() => {
corporationOptionRef.value = options; corporationOptionRef.value = options;
corporationMapRef.value = corporationMap; corporationMapRef.value = corporationMap;
}); });
}
}); });
</script> </script>

14
io.sc.platform.system.frontend/src/views/shared/SelectApplicationGrid.vue

@ -6,7 +6,7 @@
selection="multiple" selection="multiple"
:checkbox-selection="true" :checkbox-selection="true"
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" :fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue"
:auto-fetch-data="false" :auto-fetch-data="true"
:toolbar-configure="{ noIcon: false }" :toolbar-configure="{ noIcon: false }"
:toolbar-actions="[ :toolbar-actions="[
'refresh', 'refresh',
@ -109,7 +109,7 @@
></SelectApplicationDialog> ></SelectApplicationDialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onUpdated } from 'vue'; import { ref } from 'vue';
import { DialogManager, Formater, Tools } from 'platform-core'; import { DialogManager, Formater, Tools } from 'platform-core';
import SelectApplicationDialog from './SelectApplicationDialog.vue'; import SelectApplicationDialog from './SelectApplicationDialog.vue';
@ -132,17 +132,9 @@ const gridRef = ref();
const dialogRef = ref(); const dialogRef = ref();
const refresh = () => { const refresh = () => {
gridRef.value.refresh(); gridRef.value?.refresh();
}; };
onMounted(() => {
refresh();
});
onUpdated(() => {
refresh();
});
defineExpose({ defineExpose({
refresh, refresh,
}); });

6
io.sc.platform.system.frontend/src/views/shared/SelectMenuTreeGrid.vue

@ -20,7 +20,7 @@
} }
" "
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" :fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue"
:auto-fetch-data="false" :auto-fetch-data="true"
:pageable="false" :pageable="false"
:toolbar-configure="{ noIcon: false }" :toolbar-configure="{ noIcon: false }"
:toolbar-actions="[ :toolbar-actions="[
@ -95,7 +95,7 @@
></w-grid> ></w-grid>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onUpdated } from 'vue'; import { ref } from 'vue';
import { DialogManager, Formater, Tools } from 'platform-core'; import { DialogManager, Formater, Tools } from 'platform-core';
defineProps({ defineProps({
@ -111,7 +111,7 @@ const emit = defineEmits<{
const treeGridRef = ref(); const treeGridRef = ref();
const refresh = () => { const refresh = () => {
treeGridRef.value.refresh(); treeGridRef.value?.refresh();
}; };
defineExpose({ defineExpose({

5
io.sc.platform.system.frontend/src/views/shared/SelectOrgTreeGrid.vue

@ -15,6 +15,7 @@
} }
" "
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" :fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue"
:auto-fetch-data="true"
:pageable="false" :pageable="false"
:toolbar-configure="{ noIcon: false }" :toolbar-configure="{ noIcon: false }"
:toolbar-actions="[ :toolbar-actions="[
@ -69,7 +70,7 @@
></w-grid> ></w-grid>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onUpdated } from 'vue'; import { ref } from 'vue';
import { DialogManager, Formater, Tools } from 'platform-core'; import { DialogManager, Formater, Tools } from 'platform-core';
defineProps({ defineProps({
@ -85,7 +86,7 @@ const emit = defineEmits<{
const treeGridRef = ref(); const treeGridRef = ref();
const refresh = () => { const refresh = () => {
treeGridRef.value.refresh(); treeGridRef.value?.refresh();
}; };
defineExpose({ defineExpose({

6
io.sc.platform.system.frontend/src/views/shared/SelectRoleGrid.vue

@ -6,7 +6,7 @@
selection="multiple" selection="multiple"
:checkbox-selection="true" :checkbox-selection="true"
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" :fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue"
:auto-fetch-data="false" :auto-fetch-data="true"
:toolbar-configure="{ noIcon: false }" :toolbar-configure="{ noIcon: false }"
:toolbar-actions="[ :toolbar-actions="[
'refresh', 'refresh',
@ -109,7 +109,7 @@
></SelectRoleDialog> ></SelectRoleDialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onUpdated } from 'vue'; import { ref } from 'vue';
import { DialogManager, Formater, Tools } from 'platform-core'; import { DialogManager, Formater, Tools } from 'platform-core';
import SelectRoleDialog from './SelectRoleDialog.vue'; import SelectRoleDialog from './SelectRoleDialog.vue';
@ -132,7 +132,7 @@ const gridRef = ref();
const dialogRef = ref(); const dialogRef = ref();
const refresh = () => { const refresh = () => {
gridRef.value.refresh(); gridRef.value?.refresh();
}; };
defineExpose({ defineExpose({

6
io.sc.platform.system.frontend/src/views/shared/SelectUserGrid.vue

@ -6,7 +6,7 @@
selection="multiple" selection="multiple"
:checkbox-selection="true" :checkbox-selection="true"
:fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue" :fetch-data-url="fetchDataUrl + '?' + foreignKey + '=' + foreignValue"
:auto-fetch-data="false" :auto-fetch-data="true"
:toolbar-configure="{ noIcon: false }" :toolbar-configure="{ noIcon: false }"
:toolbar-actions="[ :toolbar-actions="[
'refresh', 'refresh',
@ -128,7 +128,7 @@
></SelectUserDialog> ></SelectUserDialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onUpdated } from 'vue'; import { ref } from 'vue';
import { DialogManager, Tools } from 'platform-core'; import { DialogManager, Tools } from 'platform-core';
import SelectUserDialog from './SelectUserDialog.vue'; import SelectUserDialog from './SelectUserDialog.vue';
import UserStatusTag from './UserStatusTag.vue'; import UserStatusTag from './UserStatusTag.vue';
@ -151,7 +151,7 @@ const gridRef = ref();
const dialogRef = ref(); const dialogRef = ref();
const refresh = () => { const refresh = () => {
gridRef.value.refresh(); gridRef.value?.refresh();
}; };
defineExpose({ defineExpose({

12
io.sc.platform.system.frontend/src/views/user/User.vue

@ -232,7 +232,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onActivated } from 'vue';
import { Environment, axios, SessionManager, NotifyManager, DialogManager, Formater, Options, Tools } from 'platform-core'; import { Environment, axios, SessionManager, NotifyManager, DialogManager, Formater, Options, Tools } from 'platform-core';
import SelectRoleGrid from '../shared/SelectRoleGrid.vue'; import SelectRoleGrid from '../shared/SelectRoleGrid.vue';
import SelectOrgTreeGrid from '../shared/SelectOrgTreeGrid.vue'; import SelectOrgTreeGrid from '../shared/SelectOrgTreeGrid.vue';
@ -251,8 +251,13 @@ const currentSelectedUserId = ref('');
const refreshRelationshipComponents = (id) => { const refreshRelationshipComponents = (id) => {
currentSelectedUserId.value = id; currentSelectedUserId.value = id;
if (currentSelectedUserId.value) {
roleGridRef.value?.refresh(); roleGridRef.value?.refresh();
orgTreeGridRef.value?.refresh(); orgTreeGridRef.value?.refresh();
} else {
roleGridRef.value?.clear();
orgTreeGridRef.value?.clear();
}
}; };
const selectIn = (ids: string[], gridComponent, dialogComponent) => { const selectIn = (ids: string[], gridComponent, dialogComponent) => {
@ -311,7 +316,9 @@ const update = (ids, gridComponent) => {
}); });
}; };
onMounted(() => { onActivated(() => {
refreshRelationshipComponents(currentSelectedUserId.value);
if (SessionManager.isPrimaryCorporation()) {
axios.get(Environment.apiContextPath('/api/system/corporation?pageable=false')).then((response) => { axios.get(Environment.apiContextPath('/api/system/corporation?pageable=false')).then((response) => {
const options = []; const options = [];
const corporationMap = {}; const corporationMap = {};
@ -324,5 +331,6 @@ onMounted(() => {
corporationOptionRef.value = options; corporationOptionRef.value = options;
corporationMapRef.value = corporationMap; corporationMapRef.value = corporationMap;
}); });
}
}); });
</script> </script>

Loading…
Cancel
Save