content.jsx 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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 "score":
  54. require.ensure([], () => {
  55. const ProjectScore= require("./project/score")
  56. .default;
  57. this.setState({
  58. component: <ProjectScore ApiUrl={""} />
  59. });
  60. });
  61. break;
  62. //项目汇总表
  63. case "highTech":
  64. require.ensure([], () => {
  65. const ProjectQuery = require("./summary/highTech")
  66. .default;
  67. this.setState({
  68. component: <ProjectQuery ApiUrl={""} />
  69. });
  70. });
  71. break;
  72. //项目统计
  73. case "projecCount":
  74. require.ensure([], () => {
  75. const ProjectQuery = require("./summary/projecCount")
  76. .default;
  77. this.setState({
  78. component: <ProjectQuery ApiUrl={""} />
  79. });
  80. });
  81. break;
  82. //项目数据统计
  83. case "projecDataStatistics":
  84. require.ensure([], () => {
  85. const ProjecDataStatistics = require("./summary/projecDataStatistics")
  86. .default;
  87. this.setState({
  88. component: <ProjecDataStatistics />
  89. });
  90. });
  91. break;
  92. //项目数据
  93. case "projecData":
  94. require.ensure([], () => {
  95. const ProjecData = require("./summary/projecData")
  96. .default;
  97. this.setState({
  98. component: <ProjecData ApiUrl={""} />
  99. });
  100. });
  101. break;
  102. //外包派单
  103. case "zxsglyOutSourcingPaiDan":
  104. require.ensure([], () => {
  105. const ZxsglyOutSourcingPaiDan = require("./project/zxsglyOutSourcingPaiDan")
  106. .default;
  107. this.setState({
  108. component: <ZxsglyOutSourcingPaiDan ApiUrl={""} />
  109. });
  110. });
  111. break;
  112. //外包任务派单
  113. case "outsourceTaskAssignment":
  114. require.ensure([], () => {
  115. const OutsourceTaskAssignment = require("./project/outsourceTaskAssignment")
  116. .default;
  117. this.setState({
  118. component: <OutsourceTaskAssignment ApiUrl={""} />
  119. });
  120. });
  121. break;
  122. //企业项目查询
  123. case "enterpriseProjectQuery":
  124. require.ensure([], () => {
  125. const EnterpriseProjectQuery = require("./project/enterpriseProjectQuery")
  126. .default;
  127. this.setState({
  128. component: <EnterpriseProjectQuery ApiUrl={""} />
  129. });
  130. });
  131. break;
  132. case "businessManagement":
  133. require.ensure([], () => {
  134. const BusinessManagement = require("./task/businessManagement/index")
  135. .default;
  136. this.setState({
  137. component: <BusinessManagement ApiUrl={""} />
  138. });
  139. });
  140. break;
  141. //任务查询
  142. case "taskQuery":
  143. require.ensure([], () => {
  144. const TaskQuery = require("./task/taskQuery").default;
  145. this.setState({
  146. component: <TaskQuery ApiUrl={""} />
  147. });
  148. });
  149. break;
  150. case "taskQueryZxs":
  151. require.ensure([], () => {
  152. const TaskQuery = require("./task/taskQueryZxs").default;
  153. this.setState({
  154. component: <TaskQuery ApiUrl={""} />
  155. });
  156. });
  157. break;
  158. //任务派单
  159. case "taskAssignment":
  160. require.ensure([], () => {
  161. const TaskAssignment = require("./task/taskAssignment")
  162. .default;
  163. this.setState({
  164. component: <TaskAssignment ApiUrl={""} />
  165. });
  166. });
  167. break;
  168. //专利列表
  169. case "patentList":
  170. require.ensure([], () => {
  171. const PatentList = require("./patent/list")
  172. .default;
  173. this.setState({
  174. component: <PatentList />
  175. });
  176. });
  177. break;
  178. //7天内提醒缴费专利列表
  179. case "patentSevenList":
  180. require.ensure([], () => {
  181. const PatentList = require("./patent/list")
  182. .default;
  183. this.setState({
  184. component: <PatentList status={5} />
  185. });
  186. });
  187. break;
  188. //15天内提醒缴费专利列表
  189. case "patentFifteenList":
  190. require.ensure([], () => {
  191. const PatentList = require("./patent/list")
  192. .default;
  193. this.setState({
  194. component: <PatentList status={4} />
  195. });
  196. });
  197. break;
  198. //30天内提醒缴费专利列表
  199. case "patentThirtyList":
  200. require.ensure([], () => {
  201. const PatentList = require("./patent/list")
  202. .default;
  203. this.setState({
  204. component: <PatentList status={3} />
  205. });
  206. });
  207. break;
  208. //60天内提醒缴费专利列表
  209. case "patentSixtyList":
  210. require.ensure([], () => {
  211. const PatentList = require("./patent/list")
  212. .default;
  213. this.setState({
  214. component: <PatentList status={2} />
  215. });
  216. });
  217. break;
  218. //90天内提醒缴费专利列表
  219. case "patentNinetyList":
  220. require.ensure([], () => {
  221. const PatentList = require("./patent/list")
  222. .default;
  223. this.setState({
  224. component: <PatentList status={1} />
  225. });
  226. });
  227. break;
  228. //专利成本审核列表(专利管理员查看)
  229. case "patentCostList":
  230. require.ensure([], () => {
  231. const CostAuditList = require("../order/orderNew/costAuditList").default;
  232. this.setState({
  233. component: <CostAuditList isPatentManager />,
  234. });
  235. });
  236. break;
  237. //我的任务
  238. case "myTask":
  239. require.ensure([], () => {
  240. const MyTask = require("./task/myTask").default;
  241. this.setState({
  242. component: <MyTask ApiUrl={""} />
  243. });
  244. });
  245. break;
  246. //我的任务
  247. case "myTaskZxs":
  248. require.ensure([], () => {
  249. const MyTask = require("./task/myTaskZxs").default;
  250. this.setState({
  251. component: <MyTask ApiUrl={""} />
  252. });
  253. });
  254. break;
  255. //我的外包任务
  256. case "myTaskOutsource":
  257. require.ensure([], () => {
  258. const MyTaskOutsource = require("./task/myTaskOutsource")
  259. .default;
  260. this.setState({
  261. component: <MyTaskOutsource ApiUrl={""} />
  262. });
  263. });
  264. break;
  265. //我的外包任务
  266. case "myTaskOutsourceZxs":
  267. require.ensure([], () => {
  268. const MyTaskOutsource = require("./task/myTaskOutsourceZxs")
  269. .default;
  270. this.setState({
  271. component: <MyTaskOutsource ApiUrl={""} />
  272. });
  273. });
  274. break;
  275. //合同变更审核列表
  276. case "contractChangeJsy":
  277. require.ensure([], () => {
  278. const ContractChangeJsy = require("./task/contractChangeJsy")
  279. .default;
  280. this.setState({
  281. component: <ContractChangeJsy ApiUrl={""} />
  282. });
  283. });
  284. break;
  285. //合同变更审核列表
  286. case "contractChangeJsjl":
  287. require.ensure([], () => {
  288. const ContractChangeJsjl = require("./task/contractChangeJsjl")
  289. .default;
  290. this.setState({
  291. component: <ContractChangeJsjl ApiUrl={""} />
  292. });
  293. });
  294. break;
  295. //合同变更审核列表
  296. case "contractChangeJszj":
  297. require.ensure([], () => {
  298. const ContractChangeJszj = require("./task/contractChangeJszj")
  299. .default;
  300. this.setState({
  301. component: <ContractChangeJszj ApiUrl={""} />
  302. });
  303. });
  304. break;
  305. //付款申请驳回列表
  306. case "payApplyReject":
  307. require.ensure([], () => {
  308. const PayApplyReject = require("./task/payApplyReject/index")
  309. .default;
  310. this.setState({
  311. component: <PayApplyReject ApiUrl={""} />
  312. });
  313. });
  314. break;
  315. //任务统计
  316. case "taskCount":
  317. require.ensure([], () => {
  318. const TaskCount = require("./task/taskCount").default;
  319. this.setState({
  320. component: <TaskCount ApiUrl={""} />
  321. });
  322. });
  323. break;
  324. //我的任务统计
  325. case "myTaskCount":
  326. require.ensure([], () => {
  327. const MyTaskCount = require("./task/myTaskCount").default;
  328. this.setState({
  329. component: <MyTaskCount ApiUrl={""} />
  330. });
  331. });
  332. break;
  333. default:
  334. require.ensure([], () => {
  335. const Module = require("../module").default;
  336. this.setState({
  337. component: <Module ApiUrl={""} />
  338. });
  339. });
  340. };
  341. window.location.hash = key;
  342. }
  343. render() {
  344. return (
  345. <div className="manage-content">
  346. <LeftTab handlekey={this.getKey.bind(this)} />
  347. <div className="content-right">
  348. {this.state.component}
  349. </div>
  350. </div>
  351. )
  352. }
  353. }
  354. export default Content;