|
|
@@ -8,7 +8,11 @@ const props = defineProps({
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
- cacheForParent1: Boolean
|
|
|
+ cacheForParent1: Boolean,
|
|
|
+ showCompany: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
const emit = defineEmits();
|
|
|
@@ -21,9 +25,13 @@ const brandNameList = ref(JSON.parse(localStorage.getItem('brandNameList') || '[
|
|
|
const platformList = ref(JSON.parse(localStorage.getItem('platformList') || '[]'));
|
|
|
const departmentList = ref(JSON.parse(localStorage.getItem('departmentList') || '[]'));
|
|
|
|
|
|
+const companyList = ref([]);
|
|
|
+
|
|
|
// const platformNumberOptions = ref([]);
|
|
|
// const platformNameOptions = ref([]);
|
|
|
const usersOptions = ref([]);
|
|
|
+const companyOptions = ref([]);
|
|
|
+
|
|
|
// const operationOptions = ref([]);
|
|
|
const countryOptions = ref([]);
|
|
|
const departmentOptions = ref([]);
|
|
|
@@ -82,6 +90,7 @@ async function fetchSelectData() {
|
|
|
departmentOptions.value = resp.data.department
|
|
|
brandNameOptions.value = resp.data.brandName;
|
|
|
platformOptions.value = resp.data.platform;
|
|
|
+ companyOptions.value = resp.data.company;
|
|
|
} catch (e) {
|
|
|
console.error('Failed to fetch select data:', e);
|
|
|
}
|
|
|
@@ -113,6 +122,7 @@ async function fetchFilteredData() {
|
|
|
processFilterMultiple(platformList, 'platform', 'platforms');
|
|
|
processFilterMultiple(platformList, 'platform', 'platforms');
|
|
|
processFilterMultiple(departmentList, 'department', 'department');
|
|
|
+ processFilterMultiple(companyList, 'company', 'company');
|
|
|
|
|
|
if (usersList.value.length > 0) {
|
|
|
filters.users = usersList.value.join(',');
|
|
|
@@ -155,7 +165,7 @@ const selectCommonGroup2 = () => {
|
|
|
emitChange(); // 更新选择后的数据
|
|
|
};
|
|
|
|
|
|
-watch([countryList, brandNameList, usersList, platformList, departmentList], () => {
|
|
|
+watch([companyList,countryList, brandNameList, usersList, platformList, departmentList], () => {
|
|
|
emitChange();
|
|
|
});
|
|
|
|
|
|
@@ -171,6 +181,19 @@ defineExpose({ fetchFilteredData, filteredData, updateData });
|
|
|
|
|
|
<template>
|
|
|
<div class="flex gap-2.5 flex-wrap">
|
|
|
+ <el-select
|
|
|
+ v-if="showCompany"
|
|
|
+ v-model="companyList"
|
|
|
+ class="flex-item"
|
|
|
+ clearable
|
|
|
+ collapse-tags
|
|
|
+ filterable
|
|
|
+ multiple
|
|
|
+ placeholder="注册公司"
|
|
|
+ style="width: 275px;"
|
|
|
+ >
|
|
|
+ <el-option v-for="item in companyOptions" :key="item" :label="item" :value="item" />
|
|
|
+ </el-select>
|
|
|
<el-input v-model="platformNumberList" class="flex-item" clearable placeholder="平台编号" style="width: 100px"
|
|
|
@change="emitChange"></el-input>
|
|
|
<el-input v-model="platformNameList" class="flex-item" clearable placeholder="平台名称" style="width: 130px"
|