Browse Source

表格优化提交

main
likunming 10 months ago
parent
commit
935ccc8d78
  1. 4
      io.sc.platform.core.frontend/src/platform/components/form/elements/WIcon.vue
  2. 29
      io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue

4
io.sc.platform.core.frontend/src/platform/components/form/elements/WIcon.vue

@ -161,6 +161,9 @@ const selectedTab = ref('bootstrap');
const isShow = ref(false);
const searchRef = ref('');
const valueRef = ref(props.modelValue || 'bi-arrow-up-left-square');
if (Tools.isEmpty(props.modelValue)) {
emit('update:modelValue', valueRef.value, props.form);
}
watch(
() => props.modelValue,
(newVal, oldVal) => {
@ -236,6 +239,7 @@ const iconItemClick = (icon: string) => {
valueRef.value = icon;
isShow.value = false;
updateModelValue(icon);
changeValue(icon);
};

29
io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue

@ -241,7 +241,7 @@
<script setup lang="ts">
import { ref, reactive, computed, onMounted, nextTick, toRaw, useAttrs, getCurrentInstance, provide, watchEffect, watch, onUpdated } from 'vue';
import { useI18n } from 'vue-i18n';
import { axios, Environment, NotifyManager, TreeBuilder, VueTools, Tools, eventBus } from '@/platform';
import { axios, Environment, NotifyManager, TreeBuilder, VueTools, Tools, eventBus, noErrorAxios } from '@/platform';
import { useQuasar, getCssVar, exportFile } from 'quasar';
import { IconEnum } from '@/platform/enums';
import { arrayToMap, OperatorTypeEnum, isEmpty, PageStatusEnum } from '@/platform/components/utils';
@ -735,7 +735,8 @@ const buttonObj = reactive({
$q.dialog({
title: t('confirm'),
message: t('action.remove.tip'),
cancel: true,
cancel: { noCaps: true },
ok: { noCaps: true },
persistent: true,
}).onOk(() => {
remove();
@ -844,7 +845,8 @@ const buttonObj = reactive({
$q.dialog({
title: t('confirm'),
message: t('action.resetDefaultValues.tip'),
cancel: true,
cancel: { noCaps: true },
ok: { noCaps: true },
persistent: true,
}).onOk(() => {
resetDefaultValues();
@ -1566,7 +1568,7 @@ const save = async () => {
: (url.editDataUrl ? url.editDataUrl : url.dataUrl) + '/' + getSelectedRowsComputed.value[0][props.primaryKey],
};
dialog.dialogButtons[0].loading = false;
axios(requestParams)
noErrorAxios(requestParams)
.then((resp) => {
dialog.dialogButtons[0].loading = false;
emit('afterEditorDataSubmit', resp.data);
@ -1575,7 +1577,22 @@ const save = async () => {
onRequest({ pagination: state.pagination });
})
.catch((error) => {
console.info('error====', error);
const response = error?.response;
const status = response?.status;
const data = response?.data;
if (data?.code === 1001) {
//
if (error.response.data.data) {
dialogFormRef.value.setValidationErrors(error.response.data.data);
}
} else {
//
if (status === 500) {
NotifyManager.error(t(data?.errorMessageI18nKey));
} else {
NotifyManager.error(t(status));
}
}
dialog.dialogButtons[0].loading = false;
});
} else {
@ -2477,7 +2494,7 @@ VueTools.expose2Instance(instance);
border-bottom-width: 1px;
}
.sticky-header-column-table thead tr {
.sticky-header-column-table thead tr:not(.noDataTr) {
height: var(--tableColumnTitleHeight) !important;
}

Loading…
Cancel
Save