content.jsx 9.7 KB

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