修复BUG:

1.消息中心不加载目标数据问题;
2.地区数据加载问题
This commit is contained in:
猿小天
2024-01-18 22:12:55 +08:00
parent 9bd79b9dc6
commit 71eec9cfbd
4 changed files with 44 additions and 37 deletions

View File

@@ -60,12 +60,9 @@ class AreaViewSet(CustomModelViewSet):
del params['page'] del params['page']
if limit: if limit:
del params['limit'] del params['limit']
if params: if params and pcode:
if pcode:
queryset = self.queryset.filter(enable=True, pcode=pcode) queryset = self.queryset.filter(enable=True, pcode=pcode)
else: else:
queryset = self.queryset.filter(enable=True) queryset = self.queryset.filter(enable=True)
else:
queryset = self.queryset.filter(enable=True, pcode__isnull=True)
return queryset return queryset

View File

@@ -43,7 +43,7 @@
import {defineProps, onMounted, reactive, ref, toRaw, watch} from 'vue' import {defineProps, onMounted, reactive, ref, toRaw, watch} from 'vue'
import {dict} from '@fast-crud/fast-crud' import {dict} from '@fast-crud/fast-crud'
import XEUtils from 'xe-utils' import XEUtils from 'xe-utils'
import {request} from '/@/utils/service'
const props = defineProps({ const props = defineProps({
modelValue: {}, modelValue: {},
tableConfig: { tableConfig: {
@@ -71,6 +71,7 @@ watch(multipleSelection, // 监听multipleSelection的变化
if (!tableConfig.isMultiple) { if (!tableConfig.isMultiple) {
data.value = value ? value[tableConfig.label] : null data.value = value ? value[tableConfig.label] : null
} else { } else {
const result = value ? value.map((item: any) => { const result = value ? value.map((item: any) => {
return item[tableConfig.label] return item[tableConfig.label]
}) : null }) : null
@@ -125,10 +126,10 @@ const getDict = async () => {
limit: pageConfig.limit, limit: pageConfig.limit,
search: search.value search: search.value
} }
const dicts = dict({url: url, params: params}) const {data, page, limit, total} = await request({
await dicts.reloadDict() url:url,
const dictData: any = dicts.data params:params
const {data, page, limit, total} = dictData })
pageConfig.page = page pageConfig.page = page
pageConfig.limit = limit pageConfig.limit = limit
pageConfig.total = total pageConfig.total = total

View File

@@ -4,13 +4,18 @@ import tableSelector from '/@/components/tableSelector/index.vue';
import {shallowRef, computed, ref, inject} from 'vue'; import {shallowRef, computed, ref, inject} from 'vue';
import manyToMany from '/@/components/manyToMany/index.vue'; import manyToMany from '/@/components/manyToMany/index.vue';
import {auth} from '/@/utils/authFunction' import {auth} from '/@/utils/authFunction'
import {createCrudOptions as userCrudOptions } from "/@/views/system/user/crud";
import {request} from '/@/utils/service'
const {compute} = useCompute(); const {compute} = useCompute();
interface CreateCrudOptionsTypes { interface CreateCrudOptionsTypes {
crudOptions: CrudOptions; crudOptions: CrudOptions;
} }
export const createCrudOptions = function ({ crudExpose, tabActivted }: { crudExpose: CrudExpose; tabActivted: any }): CreateCrudOptionsTypes { export const createCrudOptions = function ({
crudExpose,
tabActivted
}: { crudExpose: CrudExpose; tabActivted: any }): CreateCrudOptionsTypes {
const pageRequest = async (query: PageQuery) => { const pageRequest = async (query: PageQuery) => {
if (tabActivted.value === 'receive') { if (tabActivted.value === 'receive') {
return await api.GetSelfReceive(query); return await api.GetSelfReceive(query);
@@ -292,6 +297,7 @@ export const createCrudOptions = function ({ crudExpose, tabActivted }: { crudEx
{ {
prop: 'name', prop: 'name',
label: '部门名称', label: '部门名称',
width: 150,
}, },
{ {
prop: 'status_label', prop: 'status_label',

View File

@@ -372,6 +372,9 @@ export const createCrudOptions = function ({crudExpose}: CreateCrudOptionsProps)
form: { form: {
show: false, show: false,
}, },
column: {
minWidth: 400, //最小列宽
},
}, },
...commonCrudConfig({ ...commonCrudConfig({
dept_belong_id: { dept_belong_id: {