农燊高科官方网站
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

502 linhas
17 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "echarts", 'swiper'], function ($, template, Tools, echarts, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'http://219.148.186.198:8082/ruoyi-admin',
  10. //焦点图数据
  11. focusList: [],
  12. //新闻资讯数据
  13. newsInformationList: [],
  14. //政策法规数据
  15. policiesRegulationsList: [],
  16. //交易规则数据
  17. tradingRulesList: [],
  18. //资料下载数据
  19. dataDownloadList: [],
  20. //标的物所在地
  21. deptLocationList:[],
  22. //标的物类型
  23. deptTypeList:[],
  24. //网站配置信息
  25. webConfigInformationList:[],
  26. //底部友情链接
  27. friendsLinksList:[],
  28. //土地林地四荒地数据
  29. landListList:[],
  30. //集体资产数据
  31. collectiveAssetsList:[],
  32. //小型水利设施数据
  33. waterConservancyFacilitiesList:[],
  34. //农业生产设备数据
  35. productionEquipmentList:[],
  36. //挂牌项目总浏览次数
  37. allViewCountList:[],
  38. //成交公示数据
  39. announcementListList:[],
  40. //鉴证公告数据
  41. attestationList:[]
  42. },
  43. //柱状图参数
  44. option: {
  45. xAxis: {
  46. type: 'category',
  47. axisLine: {
  48. show: true,
  49. lineStyle: {
  50. width: 1,
  51. type: "solid"
  52. }
  53. },
  54. axisLabel: { //设置x轴的字
  55. show: true,
  56. interval: 0,//使x轴横坐标全部显示
  57. textStyle: {//x轴字体样式
  58. margin: 15
  59. }
  60. },
  61. data: []
  62. },
  63. yAxis: {
  64. type: 'value',
  65. min: 400,
  66. max: 1000,
  67. splitNumber: 7,
  68. splitLine: {
  69. lineStyle: {
  70. type: 'dashed'
  71. }
  72. },
  73. axisLine: {
  74. show: true,
  75. lineStyle: {
  76. width: 1,
  77. type: "solid"
  78. }
  79. },
  80. },
  81. series: [{
  82. data: [],//实际值减300
  83. type: 'bar',
  84. itemStyle: {
  85. color: '#007b76'
  86. }
  87. }],
  88. grid: {
  89. height: 200,
  90. width: 280,
  91. top: '-5px'
  92. },
  93. }
  94. };
  95. var tools = new Tools();
  96. module.init = function (page) {
  97. //获取焦点图信息
  98. tools.doGet(websiteNew + '/1/0/4', {}, module.focusNews , true);
  99. //新闻资讯
  100. tools.doGet(websiteNew + '/2/0/6', {}, module.NewsInformation , true);
  101. //政策法规
  102. tools.doGet(websiteNew + '/3/0/6', {}, module.policiesRegulations , true);
  103. //交易规则
  104. tools.doGet(websiteNew + '/4/0/6', {}, module.tradingRules , true);
  105. //资料下载
  106. tools.doGet(websiteNew + '/5/0/6', {}, module.dataDownload, true);
  107. //标的物所在地
  108. tools.doGet(webDept, {deptId:''}, module.deptLocation , true);
  109. //标的物类型
  110. tools.doGet(webDeptType+"/project_type", {}, module.deptType, true);
  111. //标的物类型下拉菜单
  112. tools.doGet(webDeptType+"/project_type", {}, module.deptTypeSelect, true);
  113. //网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号)
  114. tools.getWebConfig();
  115. //底部友情链接
  116. tools.doGet(friendsLinks, {}, module.bottomFriendsLinks, true);
  117. //土地
  118. tools.doGet(webListing + '/1,2,3/0/3', {}, module.landList, true);
  119. //集体资产
  120. tools.doGet(webListing + '/4/0/3', {}, module.collectiveAssets, true);
  121. //农业生产设备
  122. tools.doGet(webListing + '/5/0/3', {}, module.productionEquipment, true);
  123. //小型水利设施
  124. tools.doGet(webListing + '/6/0/3', {}, module.waterConservancyFacilities, true);
  125. //查询挂牌项目浏览总次数
  126. tools.doGet(allViewCount + '/100', {}, module.allViewCount, true);
  127. //查询挂牌项目浏览总次数
  128. tools.doGet(announcementList + '/0/4', {}, module.announcementList, true);
  129. //查询挂牌项目浏览总次数
  130. tools.doGet(biddingHallList + '/0/10', {}, module.biddingHallList, true);
  131. //查询挂牌项目浏览总次数
  132. tools.doGet(attestationList + '/0/5', {}, module.attestationList, true);
  133. //个人供求
  134. tools.doGet(supplyDemand + '/100/1/5', {}, module.supplyDemand, true);
  135. tools.doGet(supplyDemand + '/100/2/5', {}, module.supplyDemand2, true);
  136. //互动交流
  137. tools.doGet(communicateList + '/100/5', {}, module.communicateList, true);
  138. //土地挂牌价格走势统计图
  139. tools.doGet(statistics, {deptId: 100}, module.statisticsContent, true);
  140. //竞价大厅-滚动
  141. //module.hallRolling();
  142. };
  143. //焦点图数据
  144. module.focusNews = function (data) {
  145. if (data.code == 200) {
  146. var content = data.data;
  147. var focusList = [];
  148. for (var i = 0; i < content.length; i++) {
  149. var imgStrs = content[i].content.match(/<img.*?>/g)
  150. var title = content[i].title
  151. if (imgStrs != null && imgStrs != '') {
  152. focusList.push({img:imgStrs[0],title:title})
  153. }
  154. }
  155. module.data.focusList = focusList;
  156. var bannerFocusData = template('bannerFocusData', module.data);
  157. $("#bannerFocusContent").html(bannerFocusData);
  158. new Swiper('#bannerFocusWrap', {
  159. pagination: '.page-pagination',
  160. paginationClickable: true
  161. })
  162. }
  163. }
  164. module.statisticsContent = function(data){
  165. console.log(module.option)
  166. console.log(data)
  167. module.data.nowPriceAvg = data.nowPriceAvg;
  168. module.data.priceRate = data.priceRate;
  169. var statisticsData = template('statisticsData', module.data);
  170. $("#statisticsContent").html(statisticsData);
  171. for (var i = 0 ; i < data.priceAvgList.length ; i++){
  172. module.option.xAxis.data[i] = data.priceAvgList[i].year
  173. module.option.series[0].data[i] = data.priceAvgList[i].price
  174. }
  175. // 柱状图绘制
  176. var chartDom = document.getElementById('chart');
  177. var myChart = echarts.init(chartDom);
  178. module.option && myChart.setOption(module.option);
  179. }
  180. //互动交流
  181. module.communicateList = function (data) {
  182. if (data.code == 200) {
  183. console.log(data.data)
  184. var content = data.data;
  185. module.data.communicateList = content;
  186. var communicateData = template('communicateData', module.data);
  187. $("#communicateContent").html(communicateData);
  188. }
  189. }
  190. //新闻资讯数据
  191. module.NewsInformation = function (data) {
  192. if (data.code == 200) {
  193. var content = data.data;
  194. console.log(content)
  195. module.data.newsInformationList = content;
  196. var NewsInformationData = template('NewsInformationData', module.data);
  197. $("#NewsInformationContent").html(NewsInformationData);
  198. }
  199. }
  200. //政策法规
  201. module.policiesRegulations = function (data) {
  202. if (data.code == 200) {
  203. var content = data.data;
  204. module.data.policiesRegulationsList = content;
  205. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  206. $("#policiesRegulationsContent").html(policiesRegulationsData);
  207. }
  208. }
  209. //交易规则
  210. module.tradingRules = function (data) {
  211. if (data.code == 200) {
  212. var content = data.data;
  213. module.data.tradingRulesList = content;
  214. var tradingRulesData = template('tradingRulesData', module.data);
  215. $("#tradingRulesContent").html(tradingRulesData);
  216. }
  217. }
  218. //资料下载
  219. module.dataDownload = function (data) {
  220. if (data.code == 200) {
  221. var content = data.data;
  222. module.data.dataDownloadList = content;
  223. var dataDownloadData = template('dataDownloadData', module.data);
  224. $("#dataDownloadContent").html(dataDownloadData);
  225. }
  226. }
  227. //标的物所在地
  228. module.deptLocation = function (data) {
  229. console.log(data)
  230. if (data.code == 200) {
  231. var content = data.data ;
  232. var contentList = [];
  233. for (var i = 0 ; i < 5 ; i++){
  234. contentList[i] = content[i];
  235. }
  236. module.data.deptLocationList = contentList;
  237. var deptLocationData = template('deptLocationData', module.data);
  238. $("#deptLocationContent").html(deptLocationData);
  239. }
  240. }
  241. //标的物类型
  242. module.deptType = function (data) {
  243. if (data.code == 200) {
  244. var content = [] ;
  245. for (var i = 0 ; i < 4 ; i++){
  246. content[i] = data.data[i];
  247. }
  248. module.data.deptTypeList = content;
  249. var deptTypeData = template('deptTypeData', module.data);
  250. $("#deptTypeContent").html(deptTypeData);
  251. }
  252. }
  253. //网站配置信息
  254. module.webConfigInformation = function (data) {
  255. if (data.code == 200) {
  256. var content = data.data;
  257. $("#webConfigName").html(content[0].configValue);
  258. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  259. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  260. }
  261. }
  262. //查询挂牌项目浏览总次数
  263. module.allViewCount = function (data) {
  264. if (data.code == 200) {
  265. var content = data.data;
  266. module.data.allViewCountList = content.toString().split("");
  267. var allViewCountData = template('allViewCountData', module.data);
  268. $("#allViewCount").html(allViewCountData);
  269. }
  270. }
  271. //底部友情链接
  272. module.bottomFriendsLinks = function (data) {
  273. if (data.code == 200) {
  274. var content = data.data;
  275. module.data.friendsLinksList = content;
  276. var friendsLinksData = template('friendsLinksData', module.data);
  277. $("#friendsLinksContent").html(friendsLinksData);
  278. }
  279. }
  280. //土地林地四荒地
  281. module.landList = function (data) {
  282. if (data.code == 200) {
  283. var content = data.data;
  284. module.data.landListList = content;
  285. var landListData = template('landListData', module.data);
  286. $("#landListContent").html(landListData);
  287. }
  288. }
  289. //集体资产
  290. module.collectiveAssets = function (data) {
  291. if (data.code == 200) {
  292. var content = data.data;
  293. module.data.collectiveAssetsList = content;
  294. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  295. $("#collectiveAssetsContent").html(collectiveAssetsData);
  296. }
  297. }
  298. //小型水利设施
  299. module.waterConservancyFacilities = function (data) {
  300. if (data.code == 200) {
  301. var content = data.data;
  302. module.data.waterConservancyFacilitiesList = content;
  303. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  304. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  305. }
  306. }
  307. //农业生产设备
  308. module.productionEquipment = function (data) {
  309. if (data.code == 200) {
  310. var content = data.data;
  311. module.data.productionEquipmentList = content;
  312. var productionEquipmentData = template('productionEquipmentData', module.data);
  313. $("#productionEquipmentContent").html(productionEquipmentData);
  314. }
  315. }
  316. //成交公示列表
  317. module.announcementList = function (data) {
  318. if (data.code == 200) {
  319. var content = data.data;
  320. module.data.announcementListList = content;
  321. var announcementListData = template('announcementListData', module.data);
  322. $("#announcementListContent").html(announcementListData);
  323. }
  324. }
  325. //鉴证公告列表
  326. module.attestationList = function (data) {
  327. if (data.code == 200) {
  328. var content = data.data;
  329. module.data.attestationList = content;
  330. var attestationData = template('attestationData', module.data);
  331. $("#attestationContent").html(attestationData);
  332. }
  333. }
  334. //竞价大厅列表
  335. module.biddingHallList = function (data) {
  336. if (data.code == 200) {
  337. var content = data.data;
  338. console.log(content)
  339. module.data.biddingHallListList = content;
  340. var biddingHallListData = template('biddingHallListData', module.data);
  341. $("#biddingHallListContent").html(biddingHallListData);
  342. }
  343. }
  344. ///竞价大厅-滚动
  345. module.hallRolling = function () {
  346. var divScroll = document.getElementById('tableList');
  347. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  348. module.timeInter(divScroll);
  349. divScroll.onmouseover = function () {
  350. clearInterval(time);
  351. }
  352. divScroll.onmouseout = function () {
  353. module.timeInter(divScroll);
  354. }
  355. }
  356. //个人供求
  357. module.supplyDemand = function (data) {
  358. if (data.code == 200) {
  359. console.log(data)
  360. var content = data.data;
  361. module.data.supplyDemandList = content;
  362. var supplyDemandData = template('supplyDemandData', module.data);
  363. $("#supply").html(supplyDemandData);
  364. }
  365. }
  366. //个人供求
  367. module.supplyDemand2 = function (data) {
  368. if (data.code == 200) {
  369. console.log(data)
  370. var content = data.data;
  371. module.data.supplyDemand2List = content;
  372. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  373. $("#demand").html(supplyDemand2Data);
  374. }
  375. }
  376. module.timeInter = function (divScroll) {
  377. time = setInterval(function () {
  378. var oldTop = divScroll.scrollTop;
  379. var newTop = oldTop + 1;
  380. divScroll.scrollTop = newTop;
  381. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  382. if (1 > counst) {
  383. divScroll.scrollTop = 0;
  384. }
  385. }, 30)
  386. }
  387. //证书查询
  388. goSearchKeyWord = function(){
  389. var type = $('input[name="transaction"]:checked').val();
  390. var searchKeyWord = $('#searchKeyWord').val();
  391. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  392. }
  393. //项目查询
  394. searchProject = function(){
  395. var projectNum = $('#projectNum').val();
  396. var projectName = $('#projectName').val();
  397. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  398. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  399. }
  400. //标的物类型
  401. module.deptTypeSelect = function (data) {
  402. if (data.code == 200) {
  403. console.log(data);
  404. var content = data.data ;
  405. module.data.deptTypeSelectList = content;
  406. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  407. $("#deptTypeSelectContent").html(deptTypeSelectData);
  408. }
  409. }
  410. //切换
  411. tabCheck = function (type) {
  412. if(type == 'supply'){
  413. document.getElementById('demand').style.display = 'none';
  414. document.getElementById('demandBtn').className = '';
  415. }
  416. if(type == 'demand'){
  417. document.getElementById('supply').style.display = 'none';
  418. document.getElementById('supplyBtn').className = '';
  419. }
  420. document.getElementById(type).style.display = 'inline-table';
  421. document.getElementById(type+'Btn').className = 'active';
  422. }
  423. goDetail = function (id) {
  424. tools.skip('view/listingItems/itemsDetail.html?id='+id);
  425. }
  426. goListing = function () {
  427. tools.skip('view/listingItems/itemsList.html');
  428. }
  429. goAnnouncementList = function (type) {
  430. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord=');
  431. }
  432. goNewList = function () {
  433. tools.skip('view/new/newList.html');
  434. }
  435. goPolicy = function (type) {
  436. tools.skip('view/policy/policy.html?type='+type);
  437. }
  438. return module;
  439. });