V3.36版本修改,基础信息列展示规则,分页数量修改,类别搜索修改
This commit is contained in:
BIN
deploy.tar.gz
BIN
deploy.tar.gz
Binary file not shown.
@ -252,7 +252,8 @@ class MaterialBaseService:
|
|||||||
|
|
||||||
category = filters.get('category')
|
category = filters.get('category')
|
||||||
if category is not None and category != '':
|
if category is not None and category != '':
|
||||||
query = query.filter(MaterialBase.category.ilike(category.strip()))
|
# 在末尾拼接 '%' 实现前缀模糊匹配
|
||||||
|
query = query.filter(MaterialBase.category.ilike(f"{category.strip()}%"))
|
||||||
|
|
||||||
type_val = filters.get('type')
|
type_val = filters.get('type')
|
||||||
if type_val is not None and type_val != '':
|
if type_val is not None and type_val != '':
|
||||||
@ -750,7 +751,8 @@ class MaterialBaseService:
|
|||||||
|
|
||||||
category = filters.get('category')
|
category = filters.get('category')
|
||||||
if category is not None and category != '':
|
if category is not None and category != '':
|
||||||
filter_conditions.append(MaterialBase.category.ilike(category.strip()))
|
# 同样在末尾拼接 '%'
|
||||||
|
filter_conditions.append(MaterialBase.category.ilike(f"{category.strip()}%"))
|
||||||
type_val = filters.get('type')
|
type_val = filters.get('type')
|
||||||
if type_val is not None and type_val != '':
|
if type_val is not None and type_val != '':
|
||||||
filter_conditions.append(MaterialBase.material_type.ilike(type_val.strip()))
|
filter_conditions.append(MaterialBase.material_type.ilike(type_val.strip()))
|
||||||
|
|||||||
@ -239,7 +239,7 @@ const handleLogout = () => {
|
|||||||
<footer v-if="!isLoginPage" class="app-footer">
|
<footer v-if="!isLoginPage" class="app-footer">
|
||||||
<span class="version-tag">
|
<span class="version-tag">
|
||||||
<el-icon style="vertical-align: middle; margin-right: 4px"><InfoFilled /></el-icon>
|
<el-icon style="vertical-align: middle; margin-right: 4px"><InfoFilled /></el-icon>
|
||||||
当前版本:V3.35(识图版)
|
当前版本:V3.36
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@ -32,19 +32,16 @@
|
|||||||
<el-option v-for="item in companyOptions" :key="item" :label="item" :value="item" />
|
<el-option v-for="item in companyOptions" :key="item" :label="item" :value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<el-select
|
<el-cascader
|
||||||
v-model="queryParams.category"
|
v-model="searchCategoryPath"
|
||||||
|
:options="categoryTreeOptions"
|
||||||
|
:props="{ checkStrictly: true }"
|
||||||
placeholder="类别"
|
placeholder="类别"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
allow-create
|
|
||||||
default-first-option
|
|
||||||
style="width: 240px; margin-right: 10px;"
|
style="width: 240px; margin-right: 10px;"
|
||||||
@change="handleQuery"
|
@change="handleQuery"
|
||||||
popper-class="long-dropdown"
|
/>
|
||||||
>
|
|
||||||
<el-option v-for="item in categoryOptions" :key="item" :label="item" :value="item" />
|
|
||||||
</el-select>
|
|
||||||
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.type"
|
v-model="queryParams.type"
|
||||||
@ -195,6 +192,7 @@
|
|||||||
<el-checkbox v-if="hasColPermission('files')" v-model="columns.files.visible" label="资料" />
|
<el-checkbox v-if="hasColPermission('files')" v-model="columns.files.visible" label="资料" />
|
||||||
<el-checkbox v-if="hasColPermission('isEnabled')" v-model="columns.isEnabled.visible" label="状态" />
|
<el-checkbox v-if="hasColPermission('isEnabled')" v-model="columns.isEnabled.visible" label="状态" />
|
||||||
<el-checkbox v-if="hasColPermission('isInspectionRequired')" v-model="columns.isInspectionRequired.visible" label="强制质检" />
|
<el-checkbox v-if="hasColPermission('isInspectionRequired')" v-model="columns.isInspectionRequired.visible" label="强制质检" />
|
||||||
|
<el-checkbox v-if="hasColPermission('warningStatus')" v-model="columns.warningStatus.visible" label="预警状态" />
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
@ -315,7 +313,7 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="userStore.hasPermission('material_list:view_warning')" label="预警状态" width="120" align="center">
|
<el-table-column v-if="columns.warningStatus.visible" label="预警状态" width="120" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<template v-if="row.warningStatus === 2">
|
<template v-if="row.warningStatus === 2">
|
||||||
<el-tag type="danger" size="small">红色预警</el-tag>
|
<el-tag type="danger" size="small">红色预警</el-tag>
|
||||||
@ -348,7 +346,7 @@
|
|||||||
<el-pagination
|
<el-pagination
|
||||||
v-model:current-page="queryParams.pageNum"
|
v-model:current-page="queryParams.pageNum"
|
||||||
v-model:page-size="queryParams.pageSize"
|
v-model:page-size="queryParams.pageSize"
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
:page-sizes="[50, 100, 200, 500]"
|
||||||
:background="true"
|
:background="true"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="total"
|
:total="total"
|
||||||
@ -893,7 +891,8 @@ const columns = reactive({
|
|||||||
available: { visible: true },
|
available: { visible: true },
|
||||||
files: { visible: true },
|
files: { visible: true },
|
||||||
isEnabled: { visible: true },
|
isEnabled: { visible: true },
|
||||||
isInspectionRequired: { visible: true }
|
isInspectionRequired: { visible: true },
|
||||||
|
warningStatus: { visible: true }
|
||||||
});
|
});
|
||||||
|
|
||||||
// 列与权限Code的映射关系(数据库中的code)
|
// 列与权限Code的映射关系(数据库中的code)
|
||||||
@ -910,7 +909,8 @@ const permissionMap: Record<string, string> = {
|
|||||||
available: 'material_list:availableCount',
|
available: 'material_list:availableCount',
|
||||||
files: 'material_list:files',
|
files: 'material_list:files',
|
||||||
isEnabled: 'material_list:isEnabled',
|
isEnabled: 'material_list:isEnabled',
|
||||||
isInspectionRequired: 'material_list:operation'
|
isInspectionRequired: 'material_list:operation',
|
||||||
|
warningStatus: 'material_list:view_warning'
|
||||||
};
|
};
|
||||||
|
|
||||||
// ================= 全选与本地缓存逻辑 =================
|
// ================= 全选与本地缓存逻辑 =================
|
||||||
@ -1003,6 +1003,16 @@ const categoryOptions = ref<string[]>([]);
|
|||||||
const typeOptions = ref<string[]>([]);
|
const typeOptions = ref<string[]>([]);
|
||||||
const categoryTreeOptions = ref<CascaderOption[]>([]);
|
const categoryTreeOptions = ref<CascaderOption[]>([]);
|
||||||
|
|
||||||
|
// 用于搜索栏级联选择器的数据绑定中转
|
||||||
|
const searchCategoryPath = computed({
|
||||||
|
get() {
|
||||||
|
return queryParams.category ? queryParams.category.split('/') : [];
|
||||||
|
},
|
||||||
|
set(val: string[] | null) {
|
||||||
|
queryParams.category = val && val.length > 0 ? val.join('/') : '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 类别级联选择器的 ref
|
// 类别级联选择器的 ref
|
||||||
const categoryCascaderRef = ref<any>(null);
|
const categoryCascaderRef = ref<any>(null);
|
||||||
|
|
||||||
@ -1018,7 +1028,7 @@ const tempCategorySuffix = ref<string>('');
|
|||||||
|
|
||||||
const queryParams = reactive<QueryParams>({
|
const queryParams = reactive<QueryParams>({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 100,
|
||||||
keyword: '',
|
keyword: '',
|
||||||
searchField: 'all',
|
searchField: 'all',
|
||||||
category: '',
|
category: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user