|
@@ -3,28 +3,74 @@
|
|
|
<div class="white-bgc py-3">
|
|
|
<headSearch></headSearch>
|
|
|
<div class="px-5 mt-3 clear-parent">
|
|
|
- <areaType class="mb-3" :isClear="clear"></areaType>
|
|
|
- <industryType :isClear="clear"></industryType>
|
|
|
- <natureType class="my-5" :isClear="clear"></natureType>
|
|
|
- <scaleType :isClear="clear" @clear="clear = false"></scaleType>
|
|
|
- <div class="clear" @click="clear = true">清空筛选条件</div>
|
|
|
+ <areaType class="mb-3" :isClear="clear" @handleClick="handleSearch"></areaType>
|
|
|
+ <industryType :isClear="clear" @handleClick="handleSearch"></industryType>
|
|
|
+ <natureType class="my-5" :isClear="clear" @handleClick="handleSearch"></natureType>
|
|
|
+ <scaleType :isClear="clear" @clear="clear = false" @handleClick="handleSearch"></scaleType>
|
|
|
+ <div class="clear" @click="handleClear">清空筛选条件</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <companyItem class="mt-3"></companyItem>
|
|
|
+ <companyItem class="mt-3" :list="items"></companyItem>
|
|
|
+ <MPagination
|
|
|
+ :total="total"
|
|
|
+ :page="pageInfo.current"
|
|
|
+ :limit="pageInfo.size"
|
|
|
+ @handleChange="handleChangePage"
|
|
|
+ ></MPagination>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
defineOptions({name: 'retrieval-company-page'})
|
|
|
import { ref } from 'vue'
|
|
|
+import { getEnterpriseSearch } from '@/api/enterprise'
|
|
|
+import { dealDictData } from '../position/components/dict'
|
|
|
import headSearch from '@/components/headSearch'
|
|
|
import scaleType from './components/scaleType'
|
|
|
import natureType from './components/natureType'
|
|
|
import industryType from './components/industryType'
|
|
|
import areaType from './components/areaType'
|
|
|
import companyItem from './components/companyItem'
|
|
|
+import MPagination from '@/components/CtPagination'
|
|
|
|
|
|
const clear = ref(false)
|
|
|
+const handleClear = () => {
|
|
|
+ clear.value = true
|
|
|
+ query.value = {
|
|
|
+ ...pageInfo.value
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const total = ref(0)
|
|
|
+const items = ref([])
|
|
|
+const pageInfo = ref({
|
|
|
+ size: 1,
|
|
|
+ current: 1
|
|
|
+})
|
|
|
+const query = ref({
|
|
|
+ ...pageInfo.value
|
|
|
+})
|
|
|
+
|
|
|
+// 搜索
|
|
|
+const handleSearch = async (val, key) => {
|
|
|
+ query.value.current = 1
|
|
|
+ if (val === -1) delete query.value[key]
|
|
|
+ else query.value[key] = val
|
|
|
+ await getCompanyData()
|
|
|
+}
|
|
|
+
|
|
|
+const getCompanyData = async () => {
|
|
|
+ const { list, total: number } = await getEnterpriseSearch(query.value)
|
|
|
+ total.value = number
|
|
|
+ items.value = dealDictData(items.value, list)
|
|
|
+}
|
|
|
+getCompanyData()
|
|
|
+
|
|
|
+// 分页
|
|
|
+const handleChangePage = (index) => {
|
|
|
+ pageInfo.value.current = index
|
|
|
+ getCompanyData()
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|