content.jsx 10.0 KB

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