feat: sync advanced filter fields with column permissions
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
@ -445,7 +445,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, nextTick } from 'vue';
|
||||
import { ref, reactive, onMounted, nextTick, computed } from 'vue';
|
||||
import { Plus, Document, Refresh, Setting, Rank, Camera, Link, Download } from '@element-plus/icons-vue';
|
||||
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
@ -511,17 +511,21 @@ const submitLoading = ref(false);
|
||||
const tableSize = ref<'large' | 'default' | 'small'>('large');
|
||||
const advancedFilterVisible = ref(false);
|
||||
const advancedConditions = ref([{ field: '', operator: '', value: '' }]);
|
||||
const fieldOptions = ref([
|
||||
{ value: 'companyName', label: '所属公司' },
|
||||
{ value: 'name', label: '名称' },
|
||||
{ value: 'commonName', label: '俗名' },
|
||||
{ value: 'category', label: '类别' },
|
||||
{ value: 'type', label: '类型' },
|
||||
{ value: 'spec', label: '规格型号' },
|
||||
{ value: 'unit', label: '单位' },
|
||||
{ value: 'inventoryCount', label: '库存数' },
|
||||
{ value: 'availableCount', label: '可用数' }
|
||||
]);
|
||||
const fieldOptions = computed(() => {
|
||||
const allFields = [
|
||||
{ value: 'companyName', label: '所属公司', perm: 'material_list:companyName' },
|
||||
{ value: 'name', label: '名称', perm: 'material_list:name' },
|
||||
{ value: 'commonName', label: '俗名', perm: 'material_list:commonName' },
|
||||
{ value: 'category', label: '类别', perm: 'material_list:category' },
|
||||
{ value: 'type', label: '类型', perm: 'material_list:type' },
|
||||
{ value: 'spec', label: '规格型号', perm: 'material_list:spec' },
|
||||
{ value: 'unit', label: '单位', perm: 'material_list:unit' },
|
||||
{ value: 'inventoryCount', label: '库存数', perm: 'material_list:inventoryCount' },
|
||||
{ value: 'availableCount', label: '可用数', perm: 'material_list:availableCount' }
|
||||
];
|
||||
// 根据用户权限过滤
|
||||
return allFields.filter(item => userStore.hasPermission(item.perm));
|
||||
});
|
||||
const operatorOptions = ref([
|
||||
{ value: 'eq', label: '等于' },
|
||||
{ value: 'ne', label: '不等于' },
|
||||
|
||||
Reference in New Issue
Block a user