网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

149 lines
5.1 KiB

  1. define(['jquery', "template", "Tools", 'LeftNav', 'dateTime'], function ($, template, Tools, LeftNav) {
  2. //数据存储
  3. var module = {
  4. data: {
  5. //服务器地址
  6. serverApi: '',
  7. dataList: {
  8. children: [],
  9. haschildren: true,
  10. isopen: false,
  11. level: "0",
  12. name: "",
  13. url: "#",
  14. },
  15. },
  16. };
  17. var tools = new Tools();
  18. module.init = function (page) {
  19. tools.doGet(dictType + '/Industrial_classification_type', {}, module.dictType , true);
  20. // $("#signStartTimeStr").datetime({
  21. // type: "date",
  22. // value: [new Date().getFullYear(),new Date().getMonth()+1,new Date().getDate()],
  23. // success: function (res) {
  24. // //console.log(res)
  25. // }
  26. // })
  27. //
  28. // $("#signEndTimeStr").datetime({
  29. // type: "date",
  30. // value: [new Date().getFullYear(),new Date().getMonth()+1,new Date().getDate()],
  31. // success: function (res) {
  32. // //console.log(res)
  33. // }
  34. // })
  35. };
  36. //新闻列表
  37. module.projectList = function (data) {
  38. if (data.code == 200) {
  39. var content = data.data;
  40. content.forEach(res => {
  41. module.data.dataList.children.push(res);
  42. })
  43. leftNav(".left", module.data.dataList);
  44. }
  45. }
  46. module.dictType = function (data) {
  47. module.data.industryClassOptions = data.data;
  48. tools.doPost(entityMain, {}, module.entityMain , true);
  49. }
  50. //经营主体
  51. module.entityMain = function (data) {
  52. if (data.code == 200) {
  53. var content = data.data;
  54. for ( var i = 0 ; i < content.length ; i++ ){
  55. if (content[i].industryClassificationType != null){
  56. var industryClassificationType = content[i].industryClassificationType.split(",");
  57. var secondArray = "";
  58. for (var j = 0 ; j < industryClassificationType.length ; j++){
  59. secondArray += module.selectDictLabel(module.data.industryClassOptions,industryClassificationType[j]);
  60. }
  61. content[i].industryClassificationType = secondArray;
  62. }
  63. console.log(content[i].industryClassificationType)
  64. content[i].masterMap = serverApi + content[i].masterMap ;
  65. }
  66. module.data.entityMainList = content;
  67. var entityMainData = template('entityMainData', module.data);
  68. $("#entityMainContent").html(entityMainData);
  69. }
  70. }
  71. module.selectDictLabel = function (datas, value) {
  72. var actions = [];
  73. Object.keys(datas).some((key) => {
  74. if (datas[key].dictValue == ('' + value)) {
  75. actions.push(datas[key].dictLabel);
  76. return true;
  77. }
  78. })
  79. return actions.join('');
  80. }
  81. switchTab = function (type) {
  82. $("#"+type+"Btn").addClass("active").siblings().removeClass("active");
  83. $("#"+type+"").css('display','block').siblings().css('display','none');
  84. module.data.switchTab = type;
  85. }
  86. searchType = function (id) {
  87. console.log(id)
  88. $(".left .left_nav_name").removeClass("nav_open");
  89. tools.doPost(technologyConsulting, {techniqueType: id}, module.technologyConsultingList, true);
  90. }
  91. technologySearch = function(){
  92. const data = {}
  93. if ($("input[name='searchType']:checked").val() == 'title'){
  94. data.trainingName = $('#technologyInput').val();
  95. }else{
  96. data.briefIntroduction = $('#technologyInput').val();
  97. }
  98. if ($('#signStartTimeStr').val()){
  99. data.startTime = $('#signStartTimeStr').val() + ' 00:00:00';
  100. }
  101. if ($('#signEndTimeStr').val()){
  102. data.endTime = $('#signEndTimeStr').val() + ' 00:00:00';
  103. }
  104. console.log(data)
  105. tools.doPost(technologyTraining, data, module.technologyTrainingList, true);
  106. }
  107. consultingSearch = function(){
  108. const data = {}
  109. if ($("input[name='consultingType']:checked").val() == 'title'){
  110. data.title = $('#consultingInput').val();
  111. }else{
  112. data.handleName = $('#consultingInput').val();
  113. }
  114. // data.startTime = $('#technologyInput').val();
  115. // data.endTime = $('#technologyInput').val();
  116. console.log(data)
  117. tools.doPost(technologyConsulting, data, module.technologyConsultingList, true);
  118. }
  119. goSearch = function (type) {
  120. if (type == 'expert'){
  121. tools.doPost(expertDatabase, {name: $("#searchInput").val()}, module.expertDatabaseList, true);
  122. }
  123. if (type == 'article'){
  124. tools.doPost(articleLibrary, {headline: $("#articleSearchInput").val()}, module.articleLibraryList, true);
  125. }
  126. if (type == 'video'){
  127. tools.doPost(videoLibrary, {headline: $("#videoSearchInput").val()}, module.videoLibraryList, true);
  128. }
  129. }
  130. return module;
  131. })