|
@@ -8,9 +8,19 @@
|
|
|
</div>
|
|
|
<div class="flex items-center pl-3 w-96 sm:pl-0">
|
|
|
<!-- <Breadcrumbs /> -->
|
|
|
- <el-select v-model="navData.app" class="m-2" @change="appChange" clearable filterable placeholder="Select"
|
|
|
- size="large">
|
|
|
- <el-option v-for="item in navDataArr" :key="item.name" :label="item.title" :value="item.name" />
|
|
|
+ <el-select style="width:260px;" v-model="navData.advertiser" filterable value-key="id" remote
|
|
|
+ @change="adverChange" reserve-keyword placeholder="请选择投手" :remote-method="remoteMethod">
|
|
|
+ <el-option v-for="item in navDataArr" :key="item.id" :label="item.username" :value="item" />
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="navData.app" style="width:260px;" class="m-2" @change="appChange" clearable filterable
|
|
|
+ placeholder="请选择" size="default">
|
|
|
+ <el-option v-for="item in miniPrograms" :key="item.id" :label="item.name" :value="item.app_name">
|
|
|
+ <div class="flex items-center">
|
|
|
+ <span class="mr-5">{{ item.name }}</span>
|
|
|
+ <el-image :src="item.type_logo" style="width: 20px; height: 20px" fit="contain"></el-image>
|
|
|
+ </div>
|
|
|
+ </el-option>
|
|
|
+
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -35,7 +45,7 @@
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
import { useAppStore } from '@/stores/modules/app'
|
|
|
-import { modulesListApp } from '@/api/modules/index'
|
|
|
+import { advertiserListAdvertiser } from '@/api/advertiser/index'
|
|
|
import Notification from './notification.vue'
|
|
|
import MenuSearch from './menuSearch.vue'
|
|
|
import MenuSelect from './menuSelect.vue'
|
|
@@ -43,13 +53,24 @@ import { useUserStore } from '@/stores/modules/user/index'
|
|
|
import Cache from '@/support/cache';
|
|
|
import router from '@/router'
|
|
|
const store = useAppStore()
|
|
|
-
|
|
|
+const miniPrograms = ref([])
|
|
|
const navData = ref({})
|
|
|
const navDataArr = ref([])
|
|
|
const searchMenuVisiable = ref(false)
|
|
|
const userStore = useUserStore()
|
|
|
-const appChange = (e) => {
|
|
|
+const adverChange = (e) => {
|
|
|
console.log(e, 'userStore', userStore, navData.value, 'navData.value');
|
|
|
+ navData.value.app = ''
|
|
|
+ miniPrograms.value = e.miniPrograms
|
|
|
+}
|
|
|
+const remoteMethod = (query: string) => {
|
|
|
+ if (query) {
|
|
|
+ init({ username: query })
|
|
|
+ } else {
|
|
|
+ init({})
|
|
|
+ }
|
|
|
+}
|
|
|
+const appChange = (e) => {
|
|
|
Cache.set('nav_data', JSON.stringify(navData.value));
|
|
|
router.push('/')
|
|
|
let timer = setTimeout(() => {
|
|
@@ -58,10 +79,16 @@ const appChange = (e) => {
|
|
|
}, 50)
|
|
|
searchMenuVisiable.value = false
|
|
|
}
|
|
|
-onMounted(() => {
|
|
|
- modulesListApp().then(res => {
|
|
|
+
|
|
|
+const init = (params: object) => {
|
|
|
+ advertiserListAdvertiser({ ...params, limit: 50 }).then(res => {
|
|
|
+ console.log(res, 'advertiserListAdvertiseradvertiserListAdvertiser');
|
|
|
navDataArr.value = res.data
|
|
|
})
|
|
|
+}
|
|
|
+onMounted(() => {
|
|
|
+ init({})
|
|
|
navData.value = JSON.parse(Cache.get('nav_data')) || {}
|
|
|
+ miniPrograms.value = JSON.parse(Cache.get('nav_data'))?.advertiser?.miniPrograms || []
|
|
|
})
|
|
|
</script>
|