Panel.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <template>
  2. <main class="panel_main">
  3. <div class="panel_head_box">
  4. <span class="panel_head_btn" @click="close_panel_btn_fun"></span>
  5. <h4 class="panel_head_h4">网站地图</h4>
  6. </div>
  7. <section class="panel_long clearfix">
  8. <div class="panel_main_in">
  9. <div class="panel_box ">
  10. <div class="panel_a_box ">
  11. <!-- {{navigation1}} -->
  12. <NuxtLink class="panel_a_btn dot1" :to="'/'">首页</NuxtLink>
  13. <NuxtLink class="panel_a_btn dot1"
  14. v-for="(per_obj,per_index) in navigation1"
  15. @click="getLinkPath(per_obj)" title=""
  16. :key="per_obj">
  17. {{per_obj.alias}}
  18. </NuxtLink>
  19. </div>
  20. </div>
  21. </div>
  22. </section>
  23. </main>
  24. </template>
  25. <script setup>
  26. // 注入全局导航数据
  27. // const navigation1 = useState('globalNavData')
  28. const navigation1 = ref("");
  29. async function getPageData2() {
  30. const mkdata = await requestDataPromise('/web/getWebsiteModelCategory', {
  31. method: 'GET',
  32. query: {
  33. 'placeid': 1,
  34. 'pid': 0,
  35. 'num': 999
  36. },
  37. });
  38. navigation1.value = mkdata.data;
  39. }
  40. getPageData2()
  41. const panelVisible = useState('panelVisible')
  42. // 关闭面板
  43. const close_panel_btn_fun = () => {
  44. panelVisible.value = false
  45. }
  46. //3.职能部门 start ---------------------------------------->
  47. let department = ref("")
  48. const depValue = ref("")
  49. // let departmentList = async () => {
  50. // const mkdata = await requestDataPromise('/web/selectWebsiteDepartment', {
  51. // method: 'GET',
  52. // query: {
  53. // 'keyword': department.value,
  54. // },
  55. // });
  56. // if(mkdata.code == 200){
  57. // department.value = mkdata.data;
  58. // }else{
  59. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  60. // console.log("错误位置:获取职能部门")
  61. // console.log("后端错误反馈:",mkdata.message)
  62. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  63. // }
  64. // }
  65. // //获得所有部门
  66. // departmentList();
  67. //3.职能部门 end ---------------------------------------->
  68. //4.展示行政区划 start ---------------------------------------->
  69. //let areaList = ref("")
  70. //4.1 省
  71. let province = ref("")
  72. let provinceid = ref("")
  73. let provinceList = ref("")
  74. // const provinceList = useState('globalProvinceData')
  75. //4.2 市
  76. let city = ref("")
  77. let cityid = ref("")
  78. let cityList = ref("")
  79. //4.3 县
  80. let region = ref("")
  81. //let regionid = ref("")
  82. let regionList = ref("")
  83. //选择省
  84. // let areaArrList = async () => {
  85. // const mkdata = await requestDataPromise('/web/selectWebsiteArea', {
  86. // method: 'GET',
  87. // query: {},
  88. // });
  89. // if(mkdata.code == 200){
  90. // provinceList.value = mkdata.data;
  91. // }else{
  92. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  93. // console.log("错误位置:获取行政区划")
  94. // console.log("后端错误反馈:",mkdata.message)
  95. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  96. // }
  97. // }
  98. // //一开始只需要获取一下省
  99. // areaArrList();
  100. //选择市
  101. let change = async (id) => {
  102. provinceid.value = id;
  103. const shengData = await requestDataPromise('/web/selectWebsiteArea', {
  104. method: 'GET',
  105. query: {
  106. 'pid': id,
  107. },
  108. });
  109. cityList.value = shengData.data;
  110. }
  111. //选择县
  112. let change1 = async (id) => {
  113. cityid.value = id;
  114. const xianData = await requestDataPromise('/web/selectWebsiteArea', {
  115. method: 'GET',
  116. query: {
  117. 'pid': id,
  118. },
  119. });
  120. regionList.value = xianData.data;
  121. }
  122. //4.展示行政区划 end ---------------------------------------->
  123. //5.执行搜索 start ---------------------------------------->
  124. const getcityid = ref("")
  125. //跳转到搜索页面
  126. // let goToSearch = (id) => {
  127. // console.log(id)
  128. // const route = `/search/search?catids=${id}`;
  129. // window.location.href = route;
  130. // }
  131. //获得cityid和
  132. let goToPrimary = async () => {
  133. if (province.value != "") { getcityid.value = province.value }
  134. if (city.value != "") { getcityid.value = city.value }
  135. if (region.value != "") { getcityid.value = region.value }
  136. if (province.value == "" && city.value == "" && region.value == "" && depValue.value == "") {
  137. ElMessage.error('请选择行政区划或者职能部门!')
  138. } else {
  139. // const responseStatus = await requestDataPromise('/web/selectWebsiteCategory', {
  140. // method: 'GET',
  141. // query: {
  142. // 'cityid': getcityid.value,
  143. // 'department_id': depValue.value
  144. // },
  145. // });
  146. // if (responseStatus.data.catid && responseStatus.data.catid.length > 0) {
  147. // const catids = responseStatus.data.catid.join(',');
  148. // const route = `/search/search?catids=${catids}`;
  149. // window.location.href = route;
  150. // } else {
  151. // // 可以在这里处理数组为空的情况
  152. // console.log('没有可用的分类ID');
  153. // const route = `/search/search`;
  154. // window.location.href = route;
  155. // }
  156. const route = `/search/search?catids=${getcityid.value}&department_id=${depValue.value}`;
  157. window.location.href = route;
  158. }
  159. }
  160. //5.执行搜索 end ---------------------------------------->
  161. onMounted(async () => {
  162. //从客户端获取行政职能部门 加快打开速度
  163. try {
  164. const { $webUrl, $CwebUrl } = useNuxtApp();
  165. const response = await fetch($webUrl + '/web/selectWebsiteDepartment', {
  166. headers: {
  167. 'Content-Type': 'application/json',
  168. 'Userurl': $CwebUrl,
  169. 'Origin': $CwebUrl
  170. }
  171. });
  172. const result = await response.json();
  173. department.value = result.data;
  174. } catch (error) {
  175. console.error('获取部门数据失败:', error);
  176. }
  177. //从客户端获取行政区划
  178. try {
  179. const { $webUrl, $CwebUrl } = useNuxtApp();
  180. const response2 = await fetch($webUrl + '/web/selectWebsiteArea', {
  181. headers: {
  182. 'Content-Type': 'application/json',
  183. 'Userurl': $CwebUrl,
  184. 'Origin': $CwebUrl
  185. }
  186. });
  187. const result2 = await response2.json();
  188. provinceList.value = result2.data;
  189. } catch (error) {
  190. console.error('获取行政区划数据失败:', error);
  191. }
  192. })
  193. const getLinkPath = (item) => {
  194. panelVisible.value = false
  195. // close_panel_btn_fun()
  196. let the_path;
  197. if (item.is_url == 1) {
  198. the_path = `${item.web_url}`;
  199. // return `${item.web_url}`;
  200. } else if (item.alias == '招工招聘') { //招工招聘
  201. the_path = `/${item.aLIas_pinyin}/index.html`
  202. // return `/${item.aLIas_pinyin}/index.html`;
  203. } else if (item.alias == '农民工求职') { //农民工求职
  204. the_path = `/${item.aLIas_pinyin}/index.html`
  205. // return `/${item.aLIas_pinyin}/index.html`;
  206. } else if (item.alias == '人力资源库') { //人力资源库
  207. the_path =`/${item.aLIas_pinyin}/index.html`;
  208. // return `/${item.aLIas_pinyin}/index.html`;
  209. } else if (item.children_count == 0) {
  210. the_path =`/${item.aLIas_pinyin}/list-1.html`
  211. // return `/${item.aLIas_pinyin}/list-1.html`;
  212. } else {
  213. the_path = `/${item.aLIas_pinyin}/index.html`;
  214. // return `/${item.aLIas_pinyin}/index.html`;
  215. }
  216. const { $router } = useNuxtApp();
  217. $router.push(the_path);
  218. }
  219. import { watch } from 'vue'
  220. onMounted(() => {
  221. const delayTimer_hid = ref(null);//延迟器
  222. delayTimer_hid.value = setTimeout(() => {
  223. watch(panelVisible, (newValue, oldValue) => {
  224. // 根据panelVisible的状态执行不同操作
  225. if (newValue) {
  226. document.body.classList.add("body_hid")
  227. } else {
  228. // 面板隐藏时的操作
  229. document.body.classList.remove('body_hid')
  230. }
  231. })
  232. }, 333);
  233. })
  234. </script>
  235. <style lang="less" scoped>
  236. @import url('@/assets/css/public/nav.less');
  237. </style>
  238. <style lang="less" scoped>
  239. @media screen and (max-width:800px){/*ipad_phone*/
  240. .dot1{word-break: keep-all; white-space: nowrap;overflow:hidden;text-overflow:ellipsis;
  241. }
  242. .select{overflow:hidden;height:auto;line-height:normal;}
  243. .select .inner{width:96%;margin:0px auto;overflow:hidden;height:auto; }
  244. .select .role{padding:0;height:auto;overflow:hidden;float:none;}
  245. .select .role .searchRole{box-sizing:border-box;width:333px; float:left;margin-left:0px;}
  246. .select .el-select{width:230px!important;}
  247. .select .role .searchRole em{margin:4px 10px;float:right;}
  248. .select .role > .title, .select .region > .title{float:none;font-size:18px;}
  249. .select .region{overflow:hidden;height:auto;float:none;}
  250. .select .region .searchRole{float:none;padding:10px 0;width:90%;margin:5px;height:auto;}
  251. .select .region .el-select{margin-left:17px;}
  252. .select .region em{margin-left:22px;}
  253. .panel_main{
  254. position:fixed;
  255. top:0px;
  256. left:0px;
  257. width:100%;
  258. height:100%;
  259. background:#F6F6F6;
  260. z-index:1999;
  261. overflow:hidden;
  262. }
  263. .panel_head_box{
  264. width:97%;margin:0px auto 4px;
  265. height:50px;border-bottom:1px solid #b8b8b8;
  266. text-align:center;position:relative;
  267. }
  268. .panel_long{
  269. height:100%;
  270. overflow:auto;
  271. }
  272. .panel_head_h4{height:50px;line-height:50px;display:inline-block;
  273. font-size:22px;color:#333;text-align:center;}
  274. .panel_head_btn{float:right;width:22px;height:22px; top:12px;
  275. position:absolute;right:0px;
  276. background:url('../../public/image/guanbi1.png') no-repeat center center;
  277. background-size:100% 100%;
  278. }
  279. .panel_main_in{width:96%;margin:0px auto;padding-bottom:66px;}
  280. .panel_box{}
  281. .panel_name_box{
  282. width:100%;
  283. height:44px;
  284. }
  285. .panel_name{
  286. float:left;font-weight:bold;
  287. height:44px;
  288. line-height:44px;
  289. font-size:16px;
  290. color:#333;
  291. // padding-left:20px;
  292. }
  293. .panel_a_box{
  294. width:100%;
  295. overflow:hidden;
  296. margin-bottom:10px;
  297. }
  298. .panel_box_line{
  299. border-bottom:1px solid #ddd;
  300. }
  301. .panel_a_btn{
  302. float:left;
  303. width:23%;margin: 2% 1%;box-sizing:border-box;text-align:center;
  304. height:44px;
  305. line-height:44px;
  306. font-size:12px;
  307. color:#333;
  308. padding:0 4px;background:#F6F6F6;border:solid 1px #ddd;
  309. }
  310. .panel_a_btn_2{
  311. float:left;
  312. width:14%;margin:4px 1.3%;box-sizing:border-box;text-align:center;
  313. height:33px;
  314. line-height:33px;
  315. font-size:14px;
  316. color:#333;
  317. padding:0 8px;background:#F6F6F6;border:solid 1px #ddd;
  318. }
  319. }
  320. </style>
  321. <style>
  322. @media screen and (min-width:801px){/*pc*/
  323. .pc_none{display:none;}
  324. }
  325. @media screen and (max-width:800px){/*ipad_phone*/
  326. .body_hid{
  327. overflow:hidden;
  328. }
  329. .phone_none{display:none;}
  330. }
  331. </style>