网站
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

86 lines
2.9 KiB

  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools"], function ($, template, Tools) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. communicateList: [],
  13. },
  14. };
  15. var tools = new Tools();
  16. module.init = function (page) {
  17. //新闻详情
  18. tools.doGet(orcodeList, {
  19. code:getQueryVariable('id'),
  20. translate_dict: '1',
  21. bookId: JSON.parse(tools.getCookie('user')).bookId,
  22. deptId: JSON.parse(tools.getCookie('user')).deptId
  23. }, module.newsDetail , true);
  24. //新闻列表
  25. tools.doGet(orcodeList, {
  26. translate_dict:1,
  27. orderByColumn: 'code',
  28. isAsc: 'asc',
  29. pageNum:1,
  30. pageSize:10,
  31. bookId: JSON.parse(tools.getCookie('user')).bookId,
  32. deptId: JSON.parse(tools.getCookie('user')).deptId
  33. }, module.newsList , true);
  34. tools.doGet(webList, {}, module.webList , true);
  35. };
  36. //获取地址栏参数
  37. function getQueryVariable(variable){
  38. var query = window.location.search.substring(1);
  39. var vars = query.split("&");
  40. for (var i=0;i<vars.length;i++) {
  41. var pair = vars[i].split("=");
  42. if(pair[0] == variable){return pair[1];}
  43. }
  44. return(false);
  45. }
  46. module.webList = function (data) {
  47. if (data.code == 200) {
  48. var content = data.data;
  49. module.data.webList = content;
  50. var webData = template('webData', module.data);
  51. $("#webContent").html(webData);
  52. $('#ewm').attr('src', 'static/images/'+content.top.bz);
  53. }
  54. }
  55. module.newsDetail = function (data) {
  56. if (data.code == 200) {
  57. var content = data.rows[0];
  58. $('#name').html(content.name);
  59. $('#code').html('资产编码:' + content.code);
  60. $('#biddingType').html('资产类别:'+content.assetType);
  61. $('#operationType').html('经营属性:'+content.operationType);
  62. $('#secondParty').html('构建时间:'+content.buildTime);
  63. $('#location').html('坐落位置:'+content.location);
  64. $('#settleType').html('使用情况:'+content.useType);
  65. $('#totalAmount').html('数量/建筑面积:'+content.netValue);
  66. $('#settledAmount').html('计量单位:'+content.unit);
  67. $('#receivedAmount').html('原值:'+content.originalValue);
  68. }
  69. }
  70. module.newsList = function (data) {
  71. if (data.code == 200) {
  72. var content = data.rows;
  73. module.data.newList = content;
  74. var newListData = template('newListData', module.data);
  75. $("#newListContent").html(newListData);
  76. }
  77. }
  78. return module;
  79. });