content.jsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. import React, { Component } from 'react';
  2. import '../content.less';
  3. import LeftTab from '../leftTab';
  4. import {getMenu} from '../publicMenu.js'
  5. class Content extends Component {
  6. constructor() {
  7. super();
  8. this.state = {
  9. loading: false,
  10. component: <div></div>,
  11. };
  12. }
  13. componentWillMount() {
  14. var ids=window.location.href.indexOf('rid=');
  15. var idk=window.location.href.substr(ids+4);
  16. var rid=idk.split('#');
  17. let menu=getMenu(rid);
  18. let curry;
  19. if(menu[0].subMenus.length>0){
  20. curry=menu[0].subMenus[0].url.split('#');
  21. }else{
  22. curry=menu[0].url.split('#');
  23. };
  24. if (window.location.hash) {
  25. this.getKey(window.location.hash.substr(1));
  26. } else {
  27. this.getKey(curry[1]);
  28. };
  29. }
  30. getKey(key) {
  31. switch (key) {
  32. //项目派单
  33. case "projectAssignment":
  34. require.ensure([], () => {
  35. const ProjectAssignment = require("./project/projectAssignment")
  36. .default;
  37. this.setState({
  38. component: <ProjectAssignment ApiUrl={""} />
  39. });
  40. });
  41. break;
  42. //项目查询
  43. case "projectQuery":
  44. require.ensure([], () => {
  45. const ProjectQuery = require("./project/projectQuery")
  46. .default;
  47. this.setState({
  48. component: <ProjectQuery ApiUrl={""} />
  49. });
  50. });
  51. break;
  52. //项目汇总表
  53. case "highTech":
  54. require.ensure([], () => {
  55. const ProjectQuery = require("./summary/highTech")
  56. .default;
  57. this.setState({
  58. component: <ProjectQuery ApiUrl={""} />
  59. });
  60. });
  61. break;
  62. //项目统计
  63. case "projecCount":
  64. require.ensure([], () => {
  65. const ProjectQuery = require("./summary/projecCount")
  66. .default;
  67. this.setState({
  68. component: <ProjectQuery ApiUrl={""} />
  69. });
  70. });
  71. break;
  72. //外包派单
  73. case "zxsglyOutSourcingPaiDan":
  74. require.ensure([], () => {
  75. const ZxsglyOutSourcingPaiDan = require("./project/zxsglyOutSourcingPaiDan")
  76. .default;
  77. this.setState({
  78. component: <ZxsglyOutSourcingPaiDan ApiUrl={""} />
  79. });
  80. });
  81. break;
  82. //外包任务派单
  83. case "outsourceTaskAssignment":
  84. require.ensure([], () => {
  85. const OutsourceTaskAssignment = require("./project/outsourceTaskAssignment")
  86. .default;
  87. this.setState({
  88. component: <OutsourceTaskAssignment ApiUrl={""} />
  89. });
  90. });
  91. break;
  92. //企业项目查询
  93. case "enterpriseProjectQuery":
  94. require.ensure([], () => {
  95. const EnterpriseProjectQuery = require("./project/enterpriseProjectQuery")
  96. .default;
  97. this.setState({
  98. component: <EnterpriseProjectQuery ApiUrl={""} />
  99. });
  100. });
  101. break;
  102. case "businessManagement":
  103. require.ensure([], () => {
  104. const BusinessManagement = require("./task/businessManagement/index")
  105. .default;
  106. this.setState({
  107. component: <BusinessManagement ApiUrl={""} />
  108. });
  109. });
  110. break;
  111. //任务查询
  112. case "taskQuery":
  113. require.ensure([], () => {
  114. const TaskQuery = require("./task/taskQuery").default;
  115. this.setState({
  116. component: <TaskQuery ApiUrl={""} />
  117. });
  118. });
  119. break;
  120. case "taskQueryZxs":
  121. require.ensure([], () => {
  122. const TaskQuery = require("./task/taskQueryZxs").default;
  123. this.setState({
  124. component: <TaskQuery ApiUrl={""} />
  125. });
  126. });
  127. break;
  128. //任务派单
  129. case "taskAssignment":
  130. require.ensure([], () => {
  131. const TaskAssignment = require("./task/taskAssignment")
  132. .default;
  133. this.setState({
  134. component: <TaskAssignment ApiUrl={""} />
  135. });
  136. });
  137. break;
  138. //专利列表
  139. case "patentList":
  140. require.ensure([], () => {
  141. const PatentList = require("./patent/list")
  142. .default;
  143. this.setState({
  144. component: <PatentList />
  145. });
  146. });
  147. break;
  148. //7天内提醒缴费专利列表
  149. case "patentSevenList":
  150. require.ensure([], () => {
  151. const PatentList = require("./patent/list")
  152. .default;
  153. this.setState({
  154. component: <PatentList status={5}/>
  155. });
  156. });
  157. break;
  158. //15天内提醒缴费专利列表
  159. case "patentFifteenList":
  160. require.ensure([], () => {
  161. const PatentList = require("./patent/list")
  162. .default;
  163. this.setState({
  164. component: <PatentList status={4}/>
  165. });
  166. });
  167. break;
  168. //30天内提醒缴费专利列表
  169. case "patentThirtyList":
  170. require.ensure([], () => {
  171. const PatentList = require("./patent/list")
  172. .default;
  173. this.setState({
  174. component: <PatentList status={3}/>
  175. });
  176. });
  177. break;
  178. //60天内提醒缴费专利列表
  179. case "patentSixtyList":
  180. require.ensure([], () => {
  181. const PatentList = require("./patent/list")
  182. .default;
  183. this.setState({
  184. component: <PatentList status={2}/>
  185. });
  186. });
  187. break;
  188. //90天内提醒缴费专利列表
  189. case "patentNinetyList":
  190. require.ensure([], () => {
  191. const PatentList = require("./patent/list")
  192. .default;
  193. this.setState({
  194. component: <PatentList status={1}/>
  195. });
  196. });
  197. break;
  198. //专利成本审核列表(专利管理员查看)
  199. case "patentCostList":
  200. require.ensure([], () => {
  201. const CostAuditList = require("../order/orderNew/costAuditList").default;
  202. this.setState({
  203. component: <CostAuditList isPatentManager/>,
  204. });
  205. });
  206. break;
  207. //我的任务
  208. case "myTask":
  209. require.ensure([], () => {
  210. const MyTask = require("./task/myTask").default;
  211. this.setState({
  212. component: <MyTask ApiUrl={""} />
  213. });
  214. });
  215. break;
  216. //我的任务
  217. case "myTaskZxs":
  218. require.ensure([], () => {
  219. const MyTask = require("./task/myTaskZxs").default;
  220. this.setState({
  221. component: <MyTask ApiUrl={""} />
  222. });
  223. });
  224. break;
  225. //我的外包任务
  226. case "myTaskOutsource":
  227. require.ensure([], () => {
  228. const MyTaskOutsource = require("./task/myTaskOutsource")
  229. .default;
  230. this.setState({
  231. component: <MyTaskOutsource ApiUrl={""} />
  232. });
  233. });
  234. break;
  235. //我的外包任务
  236. case "myTaskOutsourceZxs":
  237. require.ensure([], () => {
  238. const MyTaskOutsource = require("./task/myTaskOutsourceZxs")
  239. .default;
  240. this.setState({
  241. component: <MyTaskOutsource ApiUrl={""} />
  242. });
  243. });
  244. break;
  245. //合同变更审核列表
  246. case "contractChangeJsy":
  247. require.ensure([], () => {
  248. const ContractChangeJsy = require("./task/contractChangeJsy")
  249. .default;
  250. this.setState({
  251. component: <ContractChangeJsy ApiUrl={""} />
  252. });
  253. });
  254. break;
  255. //合同变更审核列表
  256. case "contractChangeJsjl":
  257. require.ensure([], () => {
  258. const ContractChangeJsjl = require("./task/contractChangeJsjl")
  259. .default;
  260. this.setState({
  261. component: <ContractChangeJsjl ApiUrl={""} />
  262. });
  263. });
  264. break;
  265. //合同变更审核列表
  266. case "contractChangeJszj":
  267. require.ensure([], () => {
  268. const ContractChangeJszj = require("./task/contractChangeJszj")
  269. .default;
  270. this.setState({
  271. component: <ContractChangeJszj ApiUrl={""} />
  272. });
  273. });
  274. break;
  275. //付款申请驳回列表
  276. case "payApplyReject":
  277. require.ensure([], () => {
  278. const PayApplyReject = require("./task/payApplyReject/index")
  279. .default;
  280. this.setState({
  281. component: <PayApplyReject ApiUrl={""} />
  282. });
  283. });
  284. break;
  285. //任务统计
  286. case "taskCount":
  287. require.ensure([], () => {
  288. const TaskCount = require("./task/taskCount").default;
  289. this.setState({
  290. component: <TaskCount ApiUrl={""} />
  291. });
  292. });
  293. break;
  294. //我的任务统计
  295. case "myTaskCount":
  296. require.ensure([], () => {
  297. const MyTaskCount = require("./task/myTaskCount").default;
  298. this.setState({
  299. component: <MyTaskCount ApiUrl={""} />
  300. });
  301. });
  302. break;
  303. default:
  304. require.ensure([], () => {
  305. const Module = require("../module").default;
  306. this.setState({
  307. component: <Module ApiUrl={""} />
  308. });
  309. });
  310. };
  311. window.location.hash = key;
  312. }
  313. render() {
  314. return (
  315. <div className="manage-content">
  316. <LeftTab handlekey={this.getKey.bind(this)} />
  317. <div className="content-right">
  318. {this.state.component}
  319. </div>
  320. </div>
  321. )
  322. }
  323. }
  324. export default Content;