网站
Não pode escolher mais do que 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.
 
 
 

477 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://192.168.31.107:8080',
  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.doGet(webConfig, {}, module.webConfigInformation, true);
  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.priceAvgList)
  167. for (var i = 0 ; i < data.priceAvgList.length ; i++){
  168. module.option.xAxis.data[i] = data.priceAvgList[i].year
  169. module.option.series[0].data[i] = data.priceAvgList[i].price
  170. }
  171. // 柱状图绘制
  172. var chartDom = document.getElementById('chart');
  173. var myChart = echarts.init(chartDom);
  174. module.option && myChart.setOption(module.option);
  175. }
  176. //互动交流
  177. module.communicateList = function (data) {
  178. if (data.code == 200) {
  179. console.log(data.data)
  180. var content = data.data;
  181. module.data.communicateList = content;
  182. var communicateData = template('communicateData', module.data);
  183. $("#communicateContent").html(communicateData);
  184. }
  185. }
  186. //新闻资讯数据
  187. module.NewsInformation = function (data) {
  188. if (data.code == 200) {
  189. var content = data.data;
  190. module.data.newsInformationList = content;
  191. var NewsInformationData = template('NewsInformationData', module.data);
  192. $("#NewsInformationContent").html(NewsInformationData);
  193. }
  194. }
  195. //政策法规
  196. module.policiesRegulations = function (data) {
  197. if (data.code == 200) {
  198. var content = data.data;
  199. module.data.policiesRegulationsList = content;
  200. var policiesRegulationsData = template('policiesRegulationsData', module.data);
  201. $("#policiesRegulationsContent").html(policiesRegulationsData);
  202. }
  203. }
  204. //交易规则
  205. module.tradingRules = function (data) {
  206. if (data.code == 200) {
  207. var content = data.data;
  208. module.data.tradingRulesList = content;
  209. var tradingRulesData = template('tradingRulesData', module.data);
  210. $("#tradingRulesContent").html(tradingRulesData);
  211. }
  212. }
  213. //资料下载
  214. module.dataDownload = function (data) {
  215. if (data.code == 200) {
  216. var content = data.data;
  217. module.data.dataDownloadList = content;
  218. var dataDownloadData = template('dataDownloadData', module.data);
  219. $("#dataDownloadContent").html(dataDownloadData);
  220. }
  221. }
  222. //标的物所在地
  223. module.deptLocation = function (data) {
  224. console.log(data)
  225. if (data.code == 200) {
  226. var content = data.data ;
  227. var contentList = [];
  228. for (var i = 0 ; i < 5 ; i++){
  229. contentList[i] = content[i];
  230. }
  231. module.data.deptLocationList = contentList;
  232. var deptLocationData = template('deptLocationData', module.data);
  233. $("#deptLocationContent").html(deptLocationData);
  234. }
  235. }
  236. //标的物类型
  237. module.deptType = function (data) {
  238. if (data.code == 200) {
  239. var content = [] ;
  240. for (var i = 0 ; i < 4 ; i++){
  241. content[i] = data.data[i];
  242. }
  243. module.data.deptTypeList = content;
  244. var deptTypeData = template('deptTypeData', module.data);
  245. $("#deptTypeContent").html(deptTypeData);
  246. }
  247. }
  248. //网站配置信息
  249. module.webConfigInformation = function (data) {
  250. if (data.code == 200) {
  251. var content = data.data;
  252. $("#webConfigName").html(content[0].configValue);
  253. $("#webConfigRecord").html(content[1].configValue + content[2].configValue);
  254. $("#webConfigAddress").html(content[0].configValue+'&nbsp;'+content[3].configValue);
  255. }
  256. }
  257. //查询挂牌项目浏览总次数
  258. module.allViewCount = function (data) {
  259. if (data.code == 200) {
  260. var content = data.data;
  261. module.data.allViewCountList = content.toString().split("");
  262. var allViewCountData = template('allViewCountData', module.data);
  263. $("#allViewCount").html(allViewCountData);
  264. }
  265. }
  266. //底部友情链接
  267. module.bottomFriendsLinks = function (data) {
  268. if (data.code == 200) {
  269. var content = data.data;
  270. module.data.friendsLinksList = content;
  271. var friendsLinksData = template('friendsLinksData', module.data);
  272. $("#friendsLinksContent").html(friendsLinksData);
  273. }
  274. }
  275. //土地林地四荒地
  276. module.landList = function (data) {
  277. if (data.code == 200) {
  278. var content = data.data;
  279. module.data.landListList = content;
  280. var landListData = template('landListData', module.data);
  281. $("#landListContent").html(landListData);
  282. }
  283. }
  284. //集体资产
  285. module.collectiveAssets = function (data) {
  286. if (data.code == 200) {
  287. var content = data.data;
  288. module.data.collectiveAssetsList = content;
  289. var collectiveAssetsData = template('collectiveAssetsData', module.data);
  290. $("#collectiveAssetsContent").html(collectiveAssetsData);
  291. }
  292. }
  293. //小型水利设施
  294. module.waterConservancyFacilities = function (data) {
  295. if (data.code == 200) {
  296. var content = data.data;
  297. module.data.waterConservancyFacilitiesList = content;
  298. var waterConservancyFacilitiesData = template('waterConservancyFacilitiesData', module.data);
  299. $("#waterConservancyFacilitiesContent").html(waterConservancyFacilitiesData);
  300. }
  301. }
  302. //农业生产设备
  303. module.productionEquipment = function (data) {
  304. if (data.code == 200) {
  305. var content = data.data;
  306. module.data.productionEquipmentList = content;
  307. var productionEquipmentData = template('productionEquipmentData', module.data);
  308. $("#productionEquipmentContent").html(productionEquipmentData);
  309. }
  310. }
  311. //成交公示列表
  312. module.announcementList = function (data) {
  313. if (data.code == 200) {
  314. var content = data.data;
  315. module.data.announcementListList = content;
  316. var announcementListData = template('announcementListData', module.data);
  317. $("#announcementListContent").html(announcementListData);
  318. }
  319. }
  320. //鉴证公告列表
  321. module.attestationList = function (data) {
  322. if (data.code == 200) {
  323. var content = data.data;
  324. module.data.attestationList = content;
  325. var attestationData = template('attestationData', module.data);
  326. $("#attestationContent").html(attestationData);
  327. }
  328. }
  329. //竞价大厅列表
  330. module.biddingHallList = function (data) {
  331. if (data.code == 200) {
  332. var content = data.data;
  333. console.log(content)
  334. module.data.biddingHallListList = content;
  335. var biddingHallListData = template('biddingHallListData', module.data);
  336. $("#biddingHallListContent").html(biddingHallListData);
  337. }
  338. }
  339. ///竞价大厅-滚动
  340. module.hallRolling = function () {
  341. var divScroll = document.getElementById('tableList');
  342. window.onmousewheel = divScroll.onmousewheel = function () { return false }
  343. module.timeInter(divScroll);
  344. divScroll.onmouseover = function () {
  345. clearInterval(time);
  346. }
  347. divScroll.onmouseout = function () {
  348. module.timeInter(divScroll);
  349. }
  350. }
  351. //个人供求
  352. module.supplyDemand = function (data) {
  353. if (data.code == 200) {
  354. console.log(data)
  355. var content = data.data;
  356. module.data.supplyDemandList = content;
  357. var supplyDemandData = template('supplyDemandData', module.data);
  358. $("#supply").html(supplyDemandData);
  359. }
  360. }
  361. //个人供求
  362. module.supplyDemand2 = function (data) {
  363. if (data.code == 200) {
  364. console.log(data)
  365. var content = data.data;
  366. module.data.supplyDemand2List = content;
  367. var supplyDemand2Data = template('supplyDemand2Data', module.data);
  368. $("#demand").html(supplyDemand2Data);
  369. }
  370. }
  371. module.timeInter = function (divScroll) {
  372. time = setInterval(function () {
  373. var oldTop = divScroll.scrollTop;
  374. var newTop = oldTop + 1;
  375. divScroll.scrollTop = newTop;
  376. var counst = divScroll.scrollHeight - divScroll.scrollTop - divScroll.clientHeight;
  377. if (1 > counst) {
  378. divScroll.scrollTop = 0;
  379. }
  380. }, 30)
  381. }
  382. //证书查询
  383. goSearchKeyWord = function(){
  384. var type = $('input[name="transaction"]:checked').val();
  385. var searchKeyWord = $('#searchKeyWord').val();
  386. tools.skip('view/announcement/announcement.html?type='+type+'&searchKeyWord='+searchKeyWord)
  387. }
  388. //项目查询
  389. searchProject = function(){
  390. var projectNum = $('#projectNum').val();
  391. var projectName = $('#projectName').val();
  392. var deptTypeSelect = $("select[name='deptTypeSelect']").val();
  393. tools.skip('view/listingItems/itemsList.html?projectCode='+projectNum+'&projectName='+projectName+'&projectNumber='+deptTypeSelect)
  394. }
  395. //标的物类型
  396. module.deptTypeSelect = function (data) {
  397. if (data.code == 200) {
  398. console.log(data);
  399. var content = data.data ;
  400. module.data.deptTypeSelectList = content;
  401. var deptTypeSelectData = template('deptTypeSelectData', module.data);
  402. $("#deptTypeSelectContent").html(deptTypeSelectData);
  403. }
  404. }
  405. //切换
  406. tabCheck = function (type) {
  407. if(type == 'supply'){
  408. document.getElementById('demand').style.display = 'none';
  409. document.getElementById('demandBtn').className = '';
  410. }
  411. if(type == 'demand'){
  412. document.getElementById('supply').style.display = 'none';
  413. document.getElementById('supplyBtn').className = '';
  414. }
  415. document.getElementById(type).style.display = 'inline-table';
  416. document.getElementById(type+'Btn').className = 'active';
  417. }
  418. return module;
  419. });