123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536 |
- <template>
- <!-- 导航 -->
- <div class="navigate">
- <div class="partOne">
- <div class="inner">
- <!-- 导航一 -->
- <ul class="navigationOne">
- <li v-for="(item, index) in navigation1" :key="index">
- <!-- <NuxtLink :to="`/primaryNavigation/${item.alias}`" target="_blank">{{ item.alias }}</NuxtLink> -->
- <NuxtLink :to="{path:`/primaryNavigation/${item.category_id}`,query:{name:item.name}}" target="_blank" >{{ item.name }}</NuxtLink>
- </li>
- </ul>
- </div>
- </div>
- <!-- <div class="partTwo">
- <div class="inner">
- <ul class="navigationTwo">
- <li v-for="(item,index) in navigation2" :key="index">{{ item.name }}</li>
- </ul>
- </div>
- </div> -->
- <div class="partThree">
- <!-- 地方频道 -->
- <div class="inner">
- <!-- channel 频道 -->
- <h5 class="channel">地方频道</h5>
- <p class="areaChannel">
- <span v-for="(item, index) in areaList" :key="index">
- <a href="#">{{ item.name }}</a>
- </span>
- </p>
- </div>
- </div>
- <!-- 导航栏下的大图 -->
- <div class="logo">
- <div class="inner">
- <img src="../../static/images/banner 1.png" alt="">
- </div>
- </div>
- <!-- 行政查询 -->
- <div class="select">
- <div class="inner">
- <div class="role left">
- <div class="title">行政职能查询</div>
- <div class="searchRole">
- <el-select v-model="depValue" placeholder="职能部门" size="large" style="width: 80px">
- <el-option v-for="(item, index) in department" :key="index" :label="item.label"
- :value="item.name" />
- </el-select>
- <i></i>
- <input type="text" v-model="typeValue" placeholder="输入关键词" class="ipt">
- <em></em>
- </div>
- </div>
- <div class="region left">
- <div class="title">行政区划查询</div>
- <div class="searchRole">
- <el-select v-model="province" placeholder="请选择省" size="large" style="width: 80px">
- <el-option v-for="item in provinceList" :key="item.id" :label="item.name"
- @click="change(item.id)" :value="item.name" />
- </el-select>
- <i></i>
- <el-select v-model="city" placeholder="请选择市" no-data-text="请先选择省份" size="large"
- style="width: 80px">
- <el-option v-for="(item, index) in cityList" :key="item.id" :label="item.name"
- @click="change1(item.id)" :value="item.name" />
- </el-select>
- <i></i>
- <el-select v-model="region" placeholder="请选择区/县" no-data-text="请先选择市" size="large"
- style="width: 100px">
- <el-option v-for="item in regionList" :key="item.id" :label="item.name"
- :value="item.name" />
- </el-select>
- <em></em>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import { ref, onMounted } from 'vue';
- import { ElSelect, ElOption } from 'element-plus'
- const nuxtApp = useNuxtApp();
- const axios = nuxtApp.$axios;
- //获取导航一的栏目
- const navigation1 = ref("");
- const navigateList = async () => {
- try {
- const response = await axios.get(`/web/getWebsiteModelCategory?placeid=${1}&pid=${0}&num=${24}`);
- console.log(response.data);
- navigation1.value = response.data;
- } catch (error) {
- console.error(error);
- }
- }
- // const navigateList = async () => {
- // try {
- // const response = await axios.get(`/web/getWebsiteCategory?pageSize=${24}`);
- // console.log(response.data);
- // navigation1.value = response.data;
- // } catch (error) {
- // console.error(error);
- // }
- // }
- //获取导航二的栏目
- const navigation2 = ref("");
- const navigate2List = async () => {
- try {
- const response = await axios.get(`/web/getWebsiteModelCategory?placeid=${2}&pid=${1}&num=${13}`);
- // console.log(response.data);
- navigation2.value = response.data;
- } catch (error) {
- console.error(error);
- }
- }
- //职能部门 搜索
- let department = ref("安全")
- const depValue = ref("")
- const typeValue = ref("")
- let departmentList = async () => {
- try {
- const response = await axios.get(`/web/selectWebsiteDepartment?keyword=${department.value}`);
- // console.log(response.data.department);
- department.value = response.data.department
- // console.log(department.value);
- } catch (error) {
- console.error(error);
- }
- }
- //获取地区各省名称
- let areaList = ref("")
- //获取省名称
- let province = useState("province", () => "")
- let provinceid = useState("provinceid", () => null)
- let provinceList = useState("provinceList", () => "")
- let areaArrList = async () => {
- try {
- const response = await axios.get('/web/getWebsiteDistrit');
- console.log(response.data);
- areaList.value = response.data;
- provinceList.value = response.data
- } catch (error) {
- console.error(error);
- }
- }
- // 获取城市名称
- let city = useState("city", () => "")
- let cityid = useState("cityid", () => "")
- let cityList = useState("cityList", () => "")
- //选择省份后省份的id
- let change = (id) => {
- console.log(id);
- provinceid.value = id
- console.log(provinceid.value);
- //根据省id获取对应的市名称
- axios.get(`web/selectWebsiteArea?province=${provinceid.value}&city=0`).then(response => {
- // console.log("response", response.data.city);
- cityList.value = response.data.city;
- // console.log("cityList", cityList.value);
- }).catch(error => {
- console.error(error);
- })
- }
- // 获取区/县名称
- let region = useState("region", () => "")
- let regionid = useState("regionid", () => "")
- let regionList = useState("regionList", () => "")
- //选择市后市的id
- let change1 = (id) => {
- console.log(id);
- cityid.value = id
- console.log(cityid.value);
- //根据市id获取对应的区/县名称
- axios.get(`web/selectWebsiteArea?province=${provinceid.value}&city=${cityid.value}`).then(response => {
- // console.log("response", response.data);
- regionList.value = response.data.region;
- // console.log("regionList", regionList.value);
- }).catch(error => {
- console.error(error);
- })
- }
- //挂载成功钩子函数
- onMounted(() => {
- //导航一栏目
- navigateList()
- //导航二栏目
- navigate2List()
- //获取地区各省名称
- areaArrList()
- //获取职能部门
- departmentList()
- })
- </script>
- <style lang="less" scoped>
- // 导航部分
- .partOne .navigationOne,
- .partOne .navigationOne>li,
- .partTwo .navigationTwo,
- .partTwo .navigationTwo>li {
- float: left;
- }
- .partOne {
- width: 100%;
- height: 130px;
- line-height: 65px;
- background-color: #fff;
- font-size: 20px;
- font-family: PingFang SC-Semibold;
- border-bottom: 1px solid #e3e3e3;
- .navigationOne {
- width: 1200px;
- height: 130px;
- color: #333;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-around;
- li {
- font-family: PingFang SC;
- font-weight: 600;
- font-size: 20px;
- text-align: left;
- font-style: normal;
- text-transform: none;
- margin: 0 10px;
- // &:nth-last-child(1) {
- // margin-right: 0px;
- // }
- a {
- color: #333;
- }
- }
- >li:hover a {
- color: #139602;
- }
- }
- }
- // .partTwo {
- // width: 100%;
- // height: 57px;
- // line-height: 57px;
- // border-bottom: 1px solid #e3e3e3;
- // .navigationTwo {
- // width: 1207px;
- // height: 57px;
- // color: #333333;
- // border-bottom: 1px solid #e3e3e3;
- // li {
- // font-weight: 600;
- // font-size: 20px;
- // height: 56px;
- // margin-right: 21px;
- // &:nth-last-child(1) {
- // margin-right: 0px;
- // }
- // }
- // li:hover {
- // color: #139602;
- // border-bottom: 2px solid #139602;
- // }
- // }
- // }
- .partThree {
- width: 100%;
- height: 105px;
- .inner {
- margin-bottom: 5px;
- }
- .channel,
- .areaChannel {
- float: left;
- margin-top: 17px;
- }
- .channel {
- width: 56px;
- height: 20px;
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 14px;
- color: #666666;
- line-height: 20px;
- text-align: left;
- font-style: normal;
- text-transform: none;
- }
- .areaChannel {
- width: 1122px;
- margin-left: 14px;
- >span {
- display: inline-block;
- height: 16px;
- line-height: 16px;
- margin-bottom: 10px;
- padding: 0 8px;
- text-align: center;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- text-align: center;
- font-style: normal;
- text-transform: none;
- border-right: 1px solid #e6e6e6;
- a {
- display: inline-block;
- height: 16px;
- color: #868686;
- }
- a:hover {
- color: #868686;
- }
- }
- >span:last-child,
- >span:nth-child(18),
- >span:nth-child(32) {
- border-right: none;
- }
- >span:hover a {
- color: #139602;
- }
- }
- }
- .logo {
- margin-top: 5px;
- height: 90px;
- img {
- width: 1200px;
- height: 90px;
- }
- }
- // 行政查询
- .select {
- width: 100%;
- height: 62px;
- line-height: 62px;
- margin-top: 20px;
- .inner {
- width: 1200px;
- height: 62px;
- margin-top: 10px;
- background-color: #fafafa;
- }
- .role,
- .region {
- float: left;
- height: 62px;
- .el-select--large::v-deep .el-select__wrapper {
- font-size: 14px;
- gap: 6px;
- line-height: 24px;
- min-height: 35px;
- padding: 0;
- border: none;
- box-shadow: none;
- }
- .el-select__placeholder::v-deep.is-transparent {
- color: #999999;
- font-weight: 600;
- }
- >.title {
- float: left;
- width: 120px;
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 20px;
- color: #666666;
- text-align: left;
- font-style: normal;
- text-transform: none;
- }
- .searchRole {
- float: left;
- padding-left: 20px;
- box-sizing: border-box;
- i {
- display: inline-block;
- width: 1px;
- height: 12px;
- background-color: #d9d9d9;
- margin: 0 10px;
- vertical-align: middle;
- }
- }
- }
- .role {
- padding-left: 16px;
- .searchRole {
- width: 440px;
- height: 40px;
- line-height: 35px;
- background-color: #fff;
- border: 1px solid #ededed;
- margin: 10px 20px 12px 22px;
- border-radius: 25px;
- em {
- display: inline-block;
- width: 29px;
- height: 29px;
- margin: 4px;
- margin-right: 25px;
- vertical-align: -13px;
- background: url('../../static/images/Iconly/Broken/Search.png');
- }
- >.ipt {
- width: 245px;
- font-family: PingFang SC, PingFang SC;
- font-weight: 600;
- font-size: 14px;
- color: #666;
- line-height: 16px;
- padding-left: 22px;
- box-sizing: border-box;
- text-align: left;
- font-style: normal;
- text-transform: none;
- border: none;
- outline: none;
- }
- >.ipt::placeholder {
- color: #cccccc;
- }
- span {
- color: #999999;
- }
- }
- }
- .region {
- .searchRole {
- width: 440px;
- height: 40px;
- line-height: 35px;
- background-color: #fff;
- border: 1px solid #ededed;
- margin: 10px 0px 12px 16px;
- border-radius: 25px;
- }
- em {
- display: inline-block;
- width: 29px;
- height: 29px;
- margin-left: 48px;
- vertical-align: middle;
- background: url('../../static/images/Iconly/Broken/Search.png');
- }
- i {
- display: inline-block;
- width: 24px;
- height: 24px;
- margin-right: 11px;
- vertical-align: middle;
- background: url("../../static/images/Iconly/Two-tone/Arrow - Down 3.png");
- }
- span {
- color: #999999;
- margin-right: 22px;
- }
- }
- }
- </style>
|