Compare commits

..

7 Commits

  1. 791
      package-lock.json
  2. 4
      proxy.config.json
  3. 14
      src/app/home/basic-info/unit-details/unit-details.component.html
  4. 26
      src/app/home/basic-info/unit-details/unit-details.component.scss
  5. 500
      src/app/home/basic-info/unit-details/unit-details.component.ts
  6. 24
      src/app/home/home.module.ts
  7. 8
      src/app/home/statistic-analysis/home/home.component.ts
  8. 5
      src/app/home/statistic-analysis/home/unit-list/unit-list.component.ts
  9. 31
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
  10. 802
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
  11. 54
      src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.html
  12. 0
      src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.scss
  13. 25
      src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.spec.ts
  14. 35
      src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.ts
  15. 2
      src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts
  16. 5
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.html
  17. 226
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.ts
  18. 5
      src/app/home/task/station-task-apply/station-task-apply.component.html
  19. 426
      src/app/home/task/station-task-apply/station-task-apply.component.ts
  20. 5
      src/app/home/task/station-task-execution/station-task-execution.component.html
  21. 389
      src/app/home/task/station-task-execution/station-task-execution.component.ts
  22. 2
      src/app/home/task/station-task-execution/task-details/task-details.component.html
  23. 5
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.html
  24. 957
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
  25. 11
      src/app/home/task/zhi-audit/zhi-audit.component.html
  26. 101
      src/app/home/task/zhi-audit/zhi-audit.component.ts
  27. 989
      src/app/home/task/zhi-indicators/dist/zhi-indicators.component.js
  28. 5
      src/app/home/task/zhi-indicators/zhi-indicators.component.html
  29. 2
      src/app/home/task/zhi-indicators/zhi-indicators.component.ts
  30. BIN
      src/assets/images/tdt/end.png
  31. BIN
      src/assets/images/tdt/start.png
  32. 6
      src/index.html

791
package-lock.json generated

@ -38,6 +38,7 @@
"@angular/compiler-cli": "~13.1.0", "@angular/compiler-cli": "~13.1.0",
"@types/jasmine": "~3.10.0", "@types/jasmine": "~3.10.0",
"@types/node": "^12.11.1", "@types/node": "^12.11.1",
"d3": "^7.8.2",
"html-docx-js-typescript": "^0.1.5", "html-docx-js-typescript": "^0.1.5",
"jasmine-core": "~3.10.0", "jasmine-core": "~3.10.0",
"karma": "~6.3.0", "karma": "~6.3.0",
@ -4335,6 +4336,428 @@
"integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=",
"dev": true "dev": true
}, },
"node_modules/d3": {
"version": "7.8.2",
"resolved": "https://registry.npmmirror.com/d3/-/d3-7.8.2.tgz",
"integrity": "sha512-WXty7qOGSHb7HR7CfOzwN1Gw04MUOzN8qh9ZUsvwycIMb4DYMpY9xczZ6jUorGtO6bR9BPMPaueIKwiDxu9uiQ==",
"dev": true,
"dependencies": {
"d3-array": "3",
"d3-axis": "3",
"d3-brush": "3",
"d3-chord": "3",
"d3-color": "3",
"d3-contour": "4",
"d3-delaunay": "6",
"d3-dispatch": "3",
"d3-drag": "3",
"d3-dsv": "3",
"d3-ease": "3",
"d3-fetch": "3",
"d3-force": "3",
"d3-format": "3",
"d3-geo": "3",
"d3-hierarchy": "3",
"d3-interpolate": "3",
"d3-path": "3",
"d3-polygon": "3",
"d3-quadtree": "3",
"d3-random": "3",
"d3-scale": "4",
"d3-scale-chromatic": "3",
"d3-selection": "3",
"d3-shape": "3",
"d3-time": "3",
"d3-time-format": "4",
"d3-timer": "3",
"d3-transition": "3",
"d3-zoom": "3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-array": {
"version": "3.2.2",
"resolved": "https://registry.npmmirror.com/d3-array/-/d3-array-3.2.2.tgz",
"integrity": "sha512-yEEyEAbDrF8C6Ob2myOBLjwBLck1Z89jMGFee0oPsn95GqjerpaOA4ch+vc2l0FNFFwMD5N7OCSEN5eAlsUbgQ==",
"dev": true,
"dependencies": {
"internmap": "1 - 2"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-axis": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-axis/-/d3-axis-3.0.0.tgz",
"integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-brush": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-brush/-/d3-brush-3.0.0.tgz",
"integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",
"dev": true,
"dependencies": {
"d3-dispatch": "1 - 3",
"d3-drag": "2 - 3",
"d3-interpolate": "1 - 3",
"d3-selection": "3",
"d3-transition": "3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-chord": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-chord/-/d3-chord-3.0.1.tgz",
"integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==",
"dev": true,
"dependencies": {
"d3-path": "1 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-color": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-color/-/d3-color-3.1.0.tgz",
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-contour": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/d3-contour/-/d3-contour-4.0.2.tgz",
"integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==",
"dev": true,
"dependencies": {
"d3-array": "^3.2.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-delaunay": {
"version": "6.0.2",
"resolved": "https://registry.npmmirror.com/d3-delaunay/-/d3-delaunay-6.0.2.tgz",
"integrity": "sha512-IMLNldruDQScrcfT+MWnazhHbDJhcRJyOEBAJfwQnHle1RPh6WDuLvxNArUju2VSMSUuKlY5BGHRJ2cYyoFLQQ==",
"dev": true,
"dependencies": {
"delaunator": "5"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-dispatch": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-drag": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-drag/-/d3-drag-3.0.0.tgz",
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
"dev": true,
"dependencies": {
"d3-dispatch": "1 - 3",
"d3-selection": "3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-dsv": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-dsv/-/d3-dsv-3.0.1.tgz",
"integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==",
"dev": true,
"dependencies": {
"commander": "7",
"iconv-lite": "0.6",
"rw": "1"
},
"bin": {
"csv2json": "bin/dsv2json.js",
"csv2tsv": "bin/dsv2dsv.js",
"dsv2dsv": "bin/dsv2dsv.js",
"dsv2json": "bin/dsv2json.js",
"json2csv": "bin/json2dsv.js",
"json2dsv": "bin/json2dsv.js",
"json2tsv": "bin/json2dsv.js",
"tsv2csv": "bin/dsv2dsv.js",
"tsv2json": "bin/dsv2json.js"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-dsv/node_modules/commander": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true,
"engines": {
"node": ">= 10"
}
},
"node_modules/d3-dsv/node_modules/iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"dev": true,
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/d3-ease": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-ease/-/d3-ease-3.0.1.tgz",
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-fetch": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-fetch/-/d3-fetch-3.0.1.tgz",
"integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==",
"dev": true,
"dependencies": {
"d3-dsv": "1 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-force": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-force/-/d3-force-3.0.0.tgz",
"integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",
"dev": true,
"dependencies": {
"d3-dispatch": "1 - 3",
"d3-quadtree": "1 - 3",
"d3-timer": "1 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-format": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-format/-/d3-format-3.1.0.tgz",
"integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-geo": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-geo/-/d3-geo-3.1.0.tgz",
"integrity": "sha512-JEo5HxXDdDYXCaWdwLRt79y7giK8SbhZJbFWXqbRTolCHFI5jRqteLzCsq51NKbUoX0PjBVSohxrx+NoOUujYA==",
"dev": true,
"dependencies": {
"d3-array": "2.5.0 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-hierarchy": {
"version": "3.1.2",
"resolved": "https://registry.npmmirror.com/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
"integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-interpolate": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
"dev": true,
"dependencies": {
"d3-color": "1 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-path": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-path/-/d3-path-3.1.0.tgz",
"integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-polygon": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-polygon/-/d3-polygon-3.0.1.tgz",
"integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-quadtree": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-quadtree/-/d3-quadtree-3.0.1.tgz",
"integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-random": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-random/-/d3-random-3.0.1.tgz",
"integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-scale": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/d3-scale/-/d3-scale-4.0.2.tgz",
"integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
"dev": true,
"dependencies": {
"d3-array": "2.10.0 - 3",
"d3-format": "1 - 3",
"d3-interpolate": "1.2.0 - 3",
"d3-time": "2.1.1 - 3",
"d3-time-format": "2 - 4"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-scale-chromatic": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz",
"integrity": "sha512-Lx9thtxAKrO2Pq6OO2Ua474opeziKr279P/TKZsMAhYyNDD3EnCffdbgeSYN5O7m2ByQsxtuP2CSDczNUIZ22g==",
"dev": true,
"dependencies": {
"d3-color": "1 - 3",
"d3-interpolate": "1 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-selection": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-shape": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/d3-shape/-/d3-shape-3.2.0.tgz",
"integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
"dev": true,
"dependencies": {
"d3-path": "^3.1.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-time": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-time/-/d3-time-3.1.0.tgz",
"integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
"dev": true,
"dependencies": {
"d3-array": "2 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-time-format": {
"version": "4.1.0",
"resolved": "https://registry.npmmirror.com/d3-time-format/-/d3-time-format-4.1.0.tgz",
"integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
"dev": true,
"dependencies": {
"d3-time": "1 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-timer": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-timer/-/d3-timer-3.0.1.tgz",
"integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/d3-transition": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-transition/-/d3-transition-3.0.1.tgz",
"integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
"dev": true,
"dependencies": {
"d3-color": "1 - 3",
"d3-dispatch": "1 - 3",
"d3-ease": "1 - 3",
"d3-interpolate": "1 - 3",
"d3-timer": "1 - 3"
},
"engines": {
"node": ">=12"
},
"peerDependencies": {
"d3-selection": "2 - 3"
}
},
"node_modules/d3-zoom": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-zoom/-/d3-zoom-3.0.0.tgz",
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
"dev": true,
"dependencies": {
"d3-dispatch": "1 - 3",
"d3-drag": "2 - 3",
"d3-interpolate": "1 - 3",
"d3-selection": "2 - 3",
"d3-transition": "2 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/date-fns": { "node_modules/date-fns": {
"version": "2.28.0", "version": "2.28.0",
"resolved": "https://registry.npmmirror.com/date-fns/download/date-fns-2.28.0.tgz", "resolved": "https://registry.npmmirror.com/date-fns/download/date-fns-2.28.0.tgz",
@ -4488,6 +4911,15 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/delaunator": {
"version": "5.0.0",
"resolved": "https://registry.npmmirror.com/delaunator/-/delaunator-5.0.0.tgz",
"integrity": "sha512-AyLvtyJdbv/U1GkiS6gUUzclRoAY4Gs75qkMygJJhU75LW4DNuSF2RMzpxs9jw9Oz1BobHjTdkG3zdP55VxAqw==",
"dev": true,
"dependencies": {
"robust-predicates": "^3.0.0"
}
},
"node_modules/delegates": { "node_modules/delegates": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz", "resolved": "https://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz",
@ -6197,6 +6629,15 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/internmap": {
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/internmap/-/internmap-2.0.3.tgz",
"integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/ip": { "node_modules/ip": {
"version": "1.1.5", "version": "1.1.5",
"resolved": "https://registry.nlark.com/ip/download/ip-1.1.5.tgz", "resolved": "https://registry.nlark.com/ip/download/ip-1.1.5.tgz",
@ -9432,6 +9873,12 @@
"rimraf": "bin.js" "rimraf": "bin.js"
} }
}, },
"node_modules/robust-predicates": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/robust-predicates/-/robust-predicates-3.0.1.tgz",
"integrity": "sha512-ndEIpszUHiG4HtDsQLeIuMvRsDnn8c8rYStabochtUeCvfuvNptb5TUbVD68LRAILPX7p9nqQGh4xJgn3EHS/g==",
"dev": true
},
"node_modules/run-async": { "node_modules/run-async": {
"version": "2.4.1", "version": "2.4.1",
"resolved": "https://registry.nlark.com/run-async/download/run-async-2.4.1.tgz", "resolved": "https://registry.nlark.com/run-async/download/run-async-2.4.1.tgz",
@ -9450,6 +9897,12 @@
"queue-microtask": "^1.2.2" "queue-microtask": "^1.2.2"
} }
}, },
"node_modules/rw": {
"version": "1.3.3",
"resolved": "https://registry.npmmirror.com/rw/-/rw-1.3.3.tgz",
"integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
"dev": true
},
"node_modules/rxjs": { "node_modules/rxjs": {
"version": "7.4.0", "version": "7.4.0",
"resolved": "https://registry.npmmirror.com/rxjs/download/rxjs-7.4.0.tgz", "resolved": "https://registry.npmmirror.com/rxjs/download/rxjs-7.4.0.tgz",
@ -14407,6 +14860,317 @@
"integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=",
"dev": true "dev": true
}, },
"d3": {
"version": "7.8.2",
"resolved": "https://registry.npmmirror.com/d3/-/d3-7.8.2.tgz",
"integrity": "sha512-WXty7qOGSHb7HR7CfOzwN1Gw04MUOzN8qh9ZUsvwycIMb4DYMpY9xczZ6jUorGtO6bR9BPMPaueIKwiDxu9uiQ==",
"dev": true,
"requires": {
"d3-array": "3",
"d3-axis": "3",
"d3-brush": "3",
"d3-chord": "3",
"d3-color": "3",
"d3-contour": "4",
"d3-delaunay": "6",
"d3-dispatch": "3",
"d3-drag": "3",
"d3-dsv": "3",
"d3-ease": "3",
"d3-fetch": "3",
"d3-force": "3",
"d3-format": "3",
"d3-geo": "3",
"d3-hierarchy": "3",
"d3-interpolate": "3",
"d3-path": "3",
"d3-polygon": "3",
"d3-quadtree": "3",
"d3-random": "3",
"d3-scale": "4",
"d3-scale-chromatic": "3",
"d3-selection": "3",
"d3-shape": "3",
"d3-time": "3",
"d3-time-format": "4",
"d3-timer": "3",
"d3-transition": "3",
"d3-zoom": "3"
}
},
"d3-array": {
"version": "3.2.2",
"resolved": "https://registry.npmmirror.com/d3-array/-/d3-array-3.2.2.tgz",
"integrity": "sha512-yEEyEAbDrF8C6Ob2myOBLjwBLck1Z89jMGFee0oPsn95GqjerpaOA4ch+vc2l0FNFFwMD5N7OCSEN5eAlsUbgQ==",
"dev": true,
"requires": {
"internmap": "1 - 2"
}
},
"d3-axis": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-axis/-/d3-axis-3.0.0.tgz",
"integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==",
"dev": true
},
"d3-brush": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-brush/-/d3-brush-3.0.0.tgz",
"integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",
"dev": true,
"requires": {
"d3-dispatch": "1 - 3",
"d3-drag": "2 - 3",
"d3-interpolate": "1 - 3",
"d3-selection": "3",
"d3-transition": "3"
}
},
"d3-chord": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-chord/-/d3-chord-3.0.1.tgz",
"integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==",
"dev": true,
"requires": {
"d3-path": "1 - 3"
}
},
"d3-color": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-color/-/d3-color-3.1.0.tgz",
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
"dev": true
},
"d3-contour": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/d3-contour/-/d3-contour-4.0.2.tgz",
"integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==",
"dev": true,
"requires": {
"d3-array": "^3.2.0"
}
},
"d3-delaunay": {
"version": "6.0.2",
"resolved": "https://registry.npmmirror.com/d3-delaunay/-/d3-delaunay-6.0.2.tgz",
"integrity": "sha512-IMLNldruDQScrcfT+MWnazhHbDJhcRJyOEBAJfwQnHle1RPh6WDuLvxNArUju2VSMSUuKlY5BGHRJ2cYyoFLQQ==",
"dev": true,
"requires": {
"delaunator": "5"
}
},
"d3-dispatch": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
"dev": true
},
"d3-drag": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-drag/-/d3-drag-3.0.0.tgz",
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
"dev": true,
"requires": {
"d3-dispatch": "1 - 3",
"d3-selection": "3"
}
},
"d3-dsv": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-dsv/-/d3-dsv-3.0.1.tgz",
"integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==",
"dev": true,
"requires": {
"commander": "7",
"iconv-lite": "0.6",
"rw": "1"
},
"dependencies": {
"commander": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true
},
"iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"dev": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
}
}
}
},
"d3-ease": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-ease/-/d3-ease-3.0.1.tgz",
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
"dev": true
},
"d3-fetch": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-fetch/-/d3-fetch-3.0.1.tgz",
"integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==",
"dev": true,
"requires": {
"d3-dsv": "1 - 3"
}
},
"d3-force": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-force/-/d3-force-3.0.0.tgz",
"integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",
"dev": true,
"requires": {
"d3-dispatch": "1 - 3",
"d3-quadtree": "1 - 3",
"d3-timer": "1 - 3"
}
},
"d3-format": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-format/-/d3-format-3.1.0.tgz",
"integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==",
"dev": true
},
"d3-geo": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-geo/-/d3-geo-3.1.0.tgz",
"integrity": "sha512-JEo5HxXDdDYXCaWdwLRt79y7giK8SbhZJbFWXqbRTolCHFI5jRqteLzCsq51NKbUoX0PjBVSohxrx+NoOUujYA==",
"dev": true,
"requires": {
"d3-array": "2.5.0 - 3"
}
},
"d3-hierarchy": {
"version": "3.1.2",
"resolved": "https://registry.npmmirror.com/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
"integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==",
"dev": true
},
"d3-interpolate": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
"dev": true,
"requires": {
"d3-color": "1 - 3"
}
},
"d3-path": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-path/-/d3-path-3.1.0.tgz",
"integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
"dev": true
},
"d3-polygon": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-polygon/-/d3-polygon-3.0.1.tgz",
"integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==",
"dev": true
},
"d3-quadtree": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-quadtree/-/d3-quadtree-3.0.1.tgz",
"integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==",
"dev": true
},
"d3-random": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-random/-/d3-random-3.0.1.tgz",
"integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==",
"dev": true
},
"d3-scale": {
"version": "4.0.2",
"resolved": "https://registry.npmmirror.com/d3-scale/-/d3-scale-4.0.2.tgz",
"integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
"dev": true,
"requires": {
"d3-array": "2.10.0 - 3",
"d3-format": "1 - 3",
"d3-interpolate": "1.2.0 - 3",
"d3-time": "2.1.1 - 3",
"d3-time-format": "2 - 4"
}
},
"d3-scale-chromatic": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz",
"integrity": "sha512-Lx9thtxAKrO2Pq6OO2Ua474opeziKr279P/TKZsMAhYyNDD3EnCffdbgeSYN5O7m2ByQsxtuP2CSDczNUIZ22g==",
"dev": true,
"requires": {
"d3-color": "1 - 3",
"d3-interpolate": "1 - 3"
}
},
"d3-selection": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
"dev": true
},
"d3-shape": {
"version": "3.2.0",
"resolved": "https://registry.npmmirror.com/d3-shape/-/d3-shape-3.2.0.tgz",
"integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
"dev": true,
"requires": {
"d3-path": "^3.1.0"
}
},
"d3-time": {
"version": "3.1.0",
"resolved": "https://registry.npmmirror.com/d3-time/-/d3-time-3.1.0.tgz",
"integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
"dev": true,
"requires": {
"d3-array": "2 - 3"
}
},
"d3-time-format": {
"version": "4.1.0",
"resolved": "https://registry.npmmirror.com/d3-time-format/-/d3-time-format-4.1.0.tgz",
"integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
"dev": true,
"requires": {
"d3-time": "1 - 3"
}
},
"d3-timer": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-timer/-/d3-timer-3.0.1.tgz",
"integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
"dev": true
},
"d3-transition": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/d3-transition/-/d3-transition-3.0.1.tgz",
"integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
"dev": true,
"requires": {
"d3-color": "1 - 3",
"d3-dispatch": "1 - 3",
"d3-ease": "1 - 3",
"d3-interpolate": "1 - 3",
"d3-timer": "1 - 3"
}
},
"d3-zoom": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/d3-zoom/-/d3-zoom-3.0.0.tgz",
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
"dev": true,
"requires": {
"d3-dispatch": "1 - 3",
"d3-drag": "2 - 3",
"d3-interpolate": "1 - 3",
"d3-selection": "2 - 3",
"d3-transition": "2 - 3"
}
},
"date-fns": { "date-fns": {
"version": "2.28.0", "version": "2.28.0",
"resolved": "https://registry.npmmirror.com/date-fns/download/date-fns-2.28.0.tgz", "resolved": "https://registry.npmmirror.com/date-fns/download/date-fns-2.28.0.tgz",
@ -14524,6 +15288,15 @@
} }
} }
}, },
"delaunator": {
"version": "5.0.0",
"resolved": "https://registry.npmmirror.com/delaunator/-/delaunator-5.0.0.tgz",
"integrity": "sha512-AyLvtyJdbv/U1GkiS6gUUzclRoAY4Gs75qkMygJJhU75LW4DNuSF2RMzpxs9jw9Oz1BobHjTdkG3zdP55VxAqw==",
"dev": true,
"requires": {
"robust-predicates": "^3.0.0"
}
},
"delegates": { "delegates": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz", "resolved": "https://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz",
@ -15878,6 +16651,12 @@
} }
} }
}, },
"internmap": {
"version": "2.0.3",
"resolved": "https://registry.npmmirror.com/internmap/-/internmap-2.0.3.tgz",
"integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
"dev": true
},
"ip": { "ip": {
"version": "1.1.5", "version": "1.1.5",
"resolved": "https://registry.nlark.com/ip/download/ip-1.1.5.tgz", "resolved": "https://registry.nlark.com/ip/download/ip-1.1.5.tgz",
@ -18343,6 +19122,12 @@
"glob": "^7.1.3" "glob": "^7.1.3"
} }
}, },
"robust-predicates": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/robust-predicates/-/robust-predicates-3.0.1.tgz",
"integrity": "sha512-ndEIpszUHiG4HtDsQLeIuMvRsDnn8c8rYStabochtUeCvfuvNptb5TUbVD68LRAILPX7p9nqQGh4xJgn3EHS/g==",
"dev": true
},
"run-async": { "run-async": {
"version": "2.4.1", "version": "2.4.1",
"resolved": "https://registry.nlark.com/run-async/download/run-async-2.4.1.tgz", "resolved": "https://registry.nlark.com/run-async/download/run-async-2.4.1.tgz",
@ -18358,6 +19143,12 @@
"queue-microtask": "^1.2.2" "queue-microtask": "^1.2.2"
} }
}, },
"rw": {
"version": "1.3.3",
"resolved": "https://registry.npmmirror.com/rw/-/rw-1.3.3.tgz",
"integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
"dev": true
},
"rxjs": { "rxjs": {
"version": "7.4.0", "version": "7.4.0",
"resolved": "https://registry.npmmirror.com/rxjs/download/rxjs-7.4.0.tgz", "resolved": "https://registry.npmmirror.com/rxjs/download/rxjs-7.4.0.tgz",

4
proxy.config.json

@ -1,13 +1,13 @@
{ {
"/api": { "/api": {
"target": "https://121.36.37.70:8204/", "target": "https://fx.anxincloud.cn/",
"测试": "https://121.36.37.70:8204/", "测试": "https://121.36.37.70:8204/",
"生产": "https://fx.anxincloud.cn/", "生产": "https://fx.anxincloud.cn/",
"secure": false, "secure": false,
"changeOrigin": true "changeOrigin": true
}, },
"/hubs": { "/hubs": {
"target": "https://121.36.37.70:8204/", "target": "https://fx.anxincloud.cn/",
"secure": false, "secure": false,
"ws": true, "ws": true,
"logLevel": "debug" "logLevel": "debug"

14
src/app/home/basic-info/unit-details/unit-details.component.html

@ -143,7 +143,7 @@
</div> </div>
<div class="gistopbox"> <div class="gistopbox" *ngIf="isGisTopBox">
<div class="positionItem"> <div class="positionItem">
<span> <span>
经度 : 经度 :
@ -168,16 +168,8 @@
<div class="gistopbox hidden" [ngClass]="{'show': isGisTopBoxTwo}"> <div class="gistopbox hidden" [ngClass]="{'show': isGisTopBoxTwo}">
<div class="inputBox"> <div class="inputBox">
<span>位置: </span> <span>位置: </span>
<div class="example-input"> <input name="position" [(ngModel)]="searchTitle" id="tipinput" class="positionInput" type="text"
<input placeholder="请输入位置" nz-input [(ngModel)]="inputValue" (input)="onInput($event)" autocomplete="off">
[nzAutocomplete]="auto" />
<nz-autocomplete #auto>
<nz-auto-option *ngFor="let item of options" [nzValue]="item.name"
[nzLabel]="item.name">
{{ item.name }}
</nz-auto-option>
</nz-autocomplete>
</div>
</div> </div>
<div class="setPosition" (click)="search()"> <div class="setPosition" (click)="search()">
搜索 搜索

26
src/app/home/basic-info/unit-details/unit-details.component.scss

@ -1,5 +1,5 @@
.bule { .bule {
color: #2196f3; color: #2196F3;
} }
.detailsbox { .detailsbox {
@ -52,7 +52,7 @@
.title { .title {
color: #000; color: #000;
margin: 20px 15px; margin: 20px 15px;
background: #eff1f5; background: #EFF1F5;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
border-radius: 3px; border-radius: 3px;
@ -73,7 +73,7 @@
} }
.selected { .selected {
color: #2196f3; color: #2196F3;
} }
} }
} }
@ -172,11 +172,11 @@
top: 10px; top: 10px;
width: 90%; width: 90%;
height: 46px; height: 46px;
background: #ffffff; background: #FFFFFF;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
z-index: 999;
.positionItem { .positionItem {
width: 35%; width: 35%;
height: 35px; height: 35px;
@ -184,7 +184,7 @@
align-items: center; align-items: center;
.itemNum { .itemNum {
background: #f2f2f2; background: #F2F2F2;
box-sizing: border-box; box-sizing: border-box;
padding-left: 10px; padding-left: 10px;
width: 80%; width: 80%;
@ -199,7 +199,7 @@
cursor: pointer; cursor: pointer;
width: 15%; width: 15%;
height: 32px; height: 32px;
background: #2196f3; background: #2196F3;
color: #fff; color: #fff;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
@ -211,19 +211,19 @@
width: 63%; width: 63%;
display: flex; display: flex;
align-items: center; align-items: center;
.example-input {
flex: 1; .positionInput {
input {
border: 0; border: 0;
border-radius: 6px; border-radius: 6px;
width: 90%;
height: 34px; height: 34px;
background: #f2f2f2; background: #F2F2F2;
margin-left: 8px; margin-left: 8px;
box-sizing: border-box; box-sizing: border-box;
padding-left: 10px; padding-left: 10px;
} }
} }
}
} }
.hidden { .hidden {
@ -233,7 +233,7 @@
.show { .show {
opacity: 1; opacity: 1;
z-index: 1000; z-index: 1;
} }
} }
} }

500
src/app/home/basic-info/unit-details/unit-details.component.ts

@ -27,8 +27,6 @@ import { OperationLogComponent } from './operation-log/operation-log.component';
declare var $: any; declare var $: any;
declare var Print: any; declare var Print: any;
declare var T: any;
@Component({ @Component({
selector: 'app-unit-details', selector: 'app-unit-details',
templateUrl: './unit-details.component.html', templateUrl: './unit-details.component.html',
@ -532,275 +530,6 @@ export class UnitDetailsComponent implements OnInit {
this.getBuildingTypes(); this.getBuildingTypes();
} }
map: any; //天地图实例
zoom = 12;
localsearch; //创建搜索对象 -- 提示列表
geocoder;
labelGisBgT() {
this.map = new T.Map('container', {
// projection: 'EPSG:4326',
});
this.map.centerAndZoom(new T.LngLat(116.40769, 39.89945), this.zoom);
this.localsearch = new T.LocalSearch(this.map, {
pageCapacity: 10,
onSearchComplete: (res) => {
this.localSearchResult(res);
},
});
this.geocoder = new T.Geocoder();
this.createDrivingRoute();
}
//驾车规划
drivingRoute;
createDrivingRoute() {
var startIcon = '../../../../assets/images/tdt/start.png'; //起点图标
var endIcon = '../../../../assets/images/tdt/end.png'; //终点图标
let that = this;
this.drivingRoute = new T.DrivingRoute(this.map, {
policy: 0, //驾车策略
onSearchComplete: (res) => {
searchResult(res);
},
});
searchDrivingRoute();
function searchDrivingRoute() {
that.map.clearOverLays();
let startLngLat = new T.LngLat(116.26762, 39.8001);
let endLngLat = new T.LngLat(116.60889, 40.02656);
//驾车路线搜索
that.drivingRoute.search(startLngLat, endLngLat);
}
function searchResult(result) {
console.log('驾车规划结果', result);
//添加起始点
createStartMarker(result);
// obj = result;
// var resultList = document.createElement('div');
// //获取方案个数
//获得单条驾车方案结果对象
let plan = result.getPlan(0);
console.log('单条驾车方案结果对象', plan);
//显示方案内容
var describeStr =
'<strong>总时间:' +
plan.getDuration() +
'秒,总距离:' +
Math.round(plan.getDistance()) +
'公里</strong>';
describeStr +=
"<div><img src='" +
startIcon +
"'/>" +
'116.267620,39.800100' +
'</div>';
console.log('describeStr', describeStr);
//显示该方案每段的描述信息
var numRoutes = plan.getNumRoutes();
console.log('numRoutes', numRoutes);
// for (var m = 0; m < numRoutes; m++) {
// var route = plan.getRoute(m);
// describeStr +=
// m + 1 + '.<span>' + route.getDescription() + '</span><br/>';
// //显示该方案每段的详细描述信息
// var numStepsStr = '';
// var numSteps = route.getNumSteps();
// for (var n = 0; n < numSteps; n++) {
// var step = route.getStep(n);
// numStepsStr +=
// '<p>' +
// (n + 1) +
// ")<a href='javascript://' onclick='showPosition(\"" +
// step.getPosition().getLng() +
// '","' +
// step.getPosition().getLat() +
// '","' +
// step.getDescription() +
// '");\'>' +
// step.getDescription() +
// '</a></p>';
// }
// describeStr += numStepsStr;
// }
// describeStr +=
// "<div><img src='" +
// endIcon +
// "'/>" +
// '116.608890,40.026560' +
// '</div>';
// div.innerHTML = describeStr;
// resultList.appendChild(div);
// //显示驾车线路
createRoute(plan.getPath(),'red');
// //显示最佳级别
that.map.setViewport(plan.getPath());
//显示公交搜索结果
// document.getElementById('driving_way').appendChild(resultList);
}
function createRoute(lnglats, lineColor?) {
//创建线对象
var line = new T.Polyline(lnglats, {
color: '#2C64A7',
weight: 5,
opacity: 0.9,
});
//向地图上添加线
that.map.addOverLay(line);
}
function createStartMarker(result) {
var startMarker = new T.Marker(result.getStart(), {
icon: new T.Icon({
iconUrl: startIcon,
iconSize: new T.Point(44, 34),
iconAnchor: new T.Point(12, 31),
}),
});
that.map.addOverLay(startMarker);
var endMarker = new T.Marker(result.getEnd(), {
icon: new T.Icon({
iconUrl: endIcon,
iconSize: new T.Point(44, 34),
iconAnchor: new T.Point(12, 31),
}),
});
that.map.addOverLay(endMarker);
}
}
//输入提示
inputValue?: string;
options: any[] = [];
onInput(event: Event): void {
const value = (event.target as HTMLInputElement).value;
this.localsearch.search(value, 4);
//
}
localSearchResult(result) {
this.clearAll();
// this.localsearch.clearResults()
console.log('结果列表', result);
console.log('结果类型', result.getResultType());
// console.log('666', result.suggests[0].getPois());
this.options = result.suggests || [];
//清空地图及搜索列表
}
//解析点数据结果
// pois(obj) {
// if (obj) {
// //显示搜索列表
// var divMarker = document.createElement('div');
// //坐标数组,设置最佳比例尺时会用到
// var zoomArr = [];
// for (var i = 0; i < obj.length; i++) {
// //闭包
// (function (i) {
// //名称
// var name = obj[i].name;
// //地址
// var address = obj[i].address;
// //坐标
// var lnglatArr = obj[i].lonlat.split(',');
// var lnglat = new T.LngLat(lnglatArr[0], lnglatArr[1]);
// var winHtml = '名称:' + name + '<br/>地址:' + address;
// //创建标注对象
// var marker = new T.Marker(lnglat);
// //地图上添加标注点
// map.addOverLay(marker);
// //注册标注点的点击事件
// var markerInfoWin = new T.InfoWindow(winHtml, { autoPan: true });
// marker.addEventListener('click', function () {
// marker.openInfoWindow(markerInfoWin);
// });
// zoomArr.push(lnglat);
// //在页面上显示搜索的列表
// var a = document.createElement('a');
// a.href = 'javascript://';
// a.innerHTML = name;
// a.onclick = function () {
// showPosition(marker, winHtml);
// };
// divMarker.appendChild(document.createTextNode(i + 1 + '.'));
// divMarker.appendChild(a);
// divMarker.appendChild(document.createElement('br'));
// })(i);
// }
// //显示地图的最佳级别
// map.setViewport(zoomArr);
// //显示搜索结果
// divMarker.appendChild(
// document.createTextNode(
// '共' +
// localsearch.getCountNumber() +
// '条记录,分' +
// localsearch.getCountPage() +
// '页,当前第' +
// localsearch.getPageIndex() +
// '页'
// )
// );
// document.getElementById('searchDiv').appendChild(divMarker);
// document.getElementById('resultDiv').style.display = 'block';
// }
// }
//清空地图及搜索列表
clearAll() {
this.map.clearOverLays();
}
//点击位置按钮
setPosition() {
console.log('点击位置');
if (this.disableds) {
return;
}
this.isGisTopBox = false;
this.isGisTopBoxTwo = true;
}
search() {
console.log(this.inputValue);
if (!this.inputValue) {
return;
}
// this.localsearch.search(this.inputValue, 1);
// console.log(this.localsearch.getResultType())
// this.http
// .get(
// `/geocoder?ds={"keyWord":"北京市延庆区延庆镇莲花池村前街50夕阳红养老院"}&tk=3027d4c8ed89bd8a185a9b73dbf3dcad`
// )
// .subscribe((data) => {
// console.log(data);
// });
this.geocoder.getPoint(this.inputValue, (res) => {
console.log(888, res);
this.map.centerAndZoom(
new T.LngLat(res.location.lon, res.location.lat),
16
);
});
}
imageUrl = ''; //单位照片 imageUrl = ''; //单位照片
isLoadingSave: boolean = false; isLoadingSave: boolean = false;
uploadIndex: string; uploadIndex: string;
@ -872,6 +601,7 @@ export class UnitDetailsComponent implements OnInit {
isMapLabel: boolean; isMapLabel: boolean;
//地图标注位置 //地图标注位置
markerPosition: any = { x: 0, y: 0 }; //单位坐标 markerPosition: any = { x: 0, y: 0 }; //单位坐标
map: any; //地图实例
isGisTopBox: boolean = false; //点击位置按钮 isGisTopBox: boolean = false; //点击位置按钮
isGisTopBoxTwo: boolean = false; //点击位置按钮 isGisTopBoxTwo: boolean = false; //点击位置按钮
oldPositionMarker: any; //旧位置marker实例 oldPositionMarker: any; //旧位置marker实例
@ -895,6 +625,227 @@ export class UnitDetailsComponent implements OnInit {
//初始化地图 //初始化地图
searchTitle: any; //搜索内容 searchTitle: any; //搜索内容
placeSearch: any; //地址搜索类 placeSearch: any; //地址搜索类
search() {
this.placeSearch.search(this.searchTitle, (status, result) => {
// 搜索成功时,result即是对应的匹配数据
if (result.info == 'OK') {
this.newPositionMarker.setPosition([
result.poiList.pois[0].location.lng,
result.poiList.pois[0].location.lat,
]);
this.markerPosition2 = {
x: result.poiList.pois[0].location.lng,
y: result.poiList.pois[0].location.lat,
};
this.map.setCenter([
result.poiList.pois[0].location.lng,
result.poiList.pois[0].location.lat,
]); //设置地图中心点
} else {
alert('查询不到输入地址信息');
}
});
}
//初始化地图
markerPosition2;
labelGis() {
this.map = new AMap.Map('container', {
zoom: 12,
});
this.map.on('complete', () => {
this.isGisTopBox = true;
});
//输入提示
var autoOptions = {
input: 'tipinput',
};
AMap.plugin(['AMap.PlaceSearch', 'AMap.AutoComplete'], () => {
var auto = new AMap.AutoComplete(autoOptions);
this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类
auto.on('select', (e) => {
this.newPositionMarker.setPosition([
e.poi.location.lng,
e.poi.location.lat,
]);
this.markerPosition2 = { x: e.poi.location.lng, y: e.poi.location.lat };
this.map.setCenter([e.poi.location.lng, e.poi.location.lat]); //设置地图中心点
}); //注册监听,当选中某条记录时会触发
});
if (this.isMapLabel) {
//如果已经标注单位坐标
console.log('已标注单位位置');
this.map.setCenter([this.olddata.location.x, this.olddata.location.y]);
this.oldPositionMarker = new AMap.Marker({
position: [this.olddata.location.x, this.olddata.location.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-34, -36),
});
// 将 markers 添加到地图
this.map.add(this.oldPositionMarker);
} else {
// console.log('未标注单位位置')
this.map.setCity('济南');
}
}
//点击位置按钮
setPosition() {
if (this.disableds) {
return;
}
this.isGisTopBox = false;
this.isGisTopBoxTwo = true;
if (this.isMapLabel) {
//如果已经标注单位坐标
// console.log('已标注单位位置')
if (this.oldPositionMarker) {
this.oldPositionMarker.setContent(this.oldPositionMarkerContent);
}
if (this.newPositionMarker) {
this.newPositionMarker.setContent(this.oldPositionMarkerContent);
}
this.newPositionMarker = new AMap.Marker({
draggable: true,
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContentBtn,
offset: new AMap.Pixel(-34, -36),
});
this.map.add(this.newPositionMarker);
if (this.markerPosition.x && this.markerPosition.x != 0) {
this.markerPosition2 = {
x: this.markerPosition.x,
y: this.markerPosition.y,
};
} else {
this.markerPosition2 = {
x: this.map.getCenter().lng,
y: this.map.getCenter().lat,
}; //获取当前地图中心位置
}
this.newPositionMarker.on('dragend', (e) => {
let lnglat = this.map.containerToLngLat(e.pixel);
this.markerPosition2 = { x: lnglat.KL, y: lnglat.kT };
});
this.newPositionMarker.on('dragging', (e) => {
let lnglat = this.map.containerToLngLat(e.pixel);
this.newPositionMarker.setPosition(lnglat);
});
//点击确定
this.renderer2.listen(
this.elementRef.nativeElement.querySelector('#setPositionOk'),
'click',
(event) => {
this.map.clearMap();
this.isGisTopBox = true;
this.isGisTopBoxTwo = false;
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition2.x, this.markerPosition2.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-34, -36),
});
this.markerPosition = this.markerPosition2;
this.map.add(this.newPositionMarker);
}
);
//点击取消
this.renderer2.listen(
this.elementRef.nativeElement.querySelector('#setPositionClose'),
'click',
(event) => {
this.isGisTopBox = true;
this.isGisTopBoxTwo = false;
this.map.clearMap();
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-34, -36),
});
this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
}
);
} else {
// console.log('未标注单位位置')
if (this.newPositionMarker) {
this.newPositionMarker.setContent(this.oldPositionMarkerContent);
}
let center;
//this.markerPosition---单位坐标
if (this.markerPosition.x && this.markerPosition.x != 0) {
center = [this.markerPosition.x, this.markerPosition.y];
} else {
center = this.map.getCenter(); //获取当前地图中心位置
// console.log('获取当前地图中心位置', center)
this.map.setCenter(center);
}
this.newPositionMarker = new AMap.Marker({
draggable: true,
position: center,
content: this.newPositionMarkerContentBtn,
offset: new AMap.Pixel(-34, -36),
});
this.map.add(this.newPositionMarker);
if (this.markerPosition.x && this.markerPosition.x != 0) {
this.markerPosition2 = {
x: this.markerPosition.x,
y: this.markerPosition.y,
};
} else {
this.markerPosition2 = {
x: this.map.getCenter().lng,
y: this.map.getCenter().lat,
}; //获取当前地图中心位置
}
this.newPositionMarker.on('dragend', (e) => {
let lnglat = this.map.containerToLngLat(e.pixel);
this.markerPosition2 = { x: lnglat.KL, y: lnglat.kT };
});
this.newPositionMarker.on('dragging', (e) => {
let lnglat = this.map.containerToLngLat(e.pixel);
this.newPositionMarker.setPosition(lnglat);
});
//点击确定
this.renderer2.listen(
this.elementRef.nativeElement.querySelector('#setPositionOk'),
'click',
(event) => {
this.isGisTopBox = true;
this.isGisTopBoxTwo = false;
this.markerPosition = this.markerPosition2;
this.map.clearMap();
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-34, -36),
});
this.newPositionMarker.setMap(this.map);
}
);
this.renderer2.listen(
this.elementRef.nativeElement.querySelector('#setPositionClose'),
'click',
(event) => {
this.map.clearMap();
this.isGisTopBox = true;
this.isGisTopBoxTwo = false;
if (this.markerPosition.x && this.markerPosition.x != 0) {
//说明之前标过点
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-34, -36),
});
this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
}
}
); //取消
}
}
listOfData: any[] = []; listOfData: any[] = [];
listOfData2: any[] = []; listOfData2: any[] = [];
@ -1613,10 +1564,10 @@ export class UnitDetailsComponent implements OnInit {
} }
edit() { edit() {
console.log(this.validateForm); console.log(this.validateForm)
if(this.validateForm.invalid){ if(this.validateForm.invalid){
this.message.create('warning', '请填写完整'); this.message.create('warning', '请填写完整');
return; return
} }
// return // return
let body = { let body = {
@ -1709,8 +1660,7 @@ export class UnitDetailsComponent implements OnInit {
//未标注 //未标注
this.isMapLabel = false; this.isMapLabel = false;
} }
// this.labelGis(); this.labelGis();
this.labelGisBgT();
}); });
} }

24
src/app/home/home.module.ts

@ -82,7 +82,7 @@ import { FormComponent } from './statistic-analysis/form/form.component';
import { ExamineComponent } from './statistic-analysis/form/examine/examine.component'; import { ExamineComponent } from './statistic-analysis/form/examine/examine.component';
import { ReviewComponent } from './statistic-analysis/form/review/review.component'; import { ReviewComponent } from './statistic-analysis/form/review/review.component';
import { UnitListComponent } from './statistic-analysis/home/unit-list/unit-list.component'; import { UnitListComponent } from './statistic-analysis/home/unit-list/unit-list.component';
import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete'; import { LookShuangsjComponent } from './task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
NavComponent, NavComponent,
@ -134,6 +134,7 @@ import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete';
ExamineComponent, ExamineComponent,
ReviewComponent, ReviewComponent,
UnitListComponent, UnitListComponent,
LookShuangsjComponent
], ],
imports: [ imports: [
CommonModule, CommonModule,
@ -172,26 +173,9 @@ import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete';
NzListModule, NzListModule,
NzDividerModule, NzDividerModule,
AngularDraggableModule, AngularDraggableModule,
NzTabsModule, NzTabsModule
NzAutocompleteModule,
], ],
providers: [StationTaskExecutionComponent, StationWeeklyPlanComponent], providers: [StationTaskExecutionComponent, StationWeeklyPlanComponent],
entryComponents: [ entryComponents: [AddroleComponent, EditroleComponent, AdduserComponent, EdituserComponent, AddorComponent, EditorComponent, ApplyComponent, ApplyLookComponent, LookTaskComponent, AllotPersonComponent, EditOrComponent, CreateTaskComponent, UploadComponent, CheckagainComponent,TaskListComponent]
AddroleComponent,
EditroleComponent,
AdduserComponent,
EdituserComponent,
AddorComponent,
EditorComponent,
ApplyComponent,
ApplyLookComponent,
LookTaskComponent,
AllotPersonComponent,
EditOrComponent,
CreateTaskComponent,
UploadComponent,
CheckagainComponent,
TaskListComponent,
],
}) })
export class HomeModule { } export class HomeModule { }

8
src/app/home/statistic-analysis/home/home.component.ts

@ -731,8 +731,7 @@ export class HomeComponent implements OnInit {
} }
echartsSetData_taskStatByOrg() { echartsSetData_taskStatByOrg() {
console.log();
console.log()
this.completionOfTaskPie.clear(); this.completionOfTaskPie.clear();
this.completionOfTaskBar.clear(); this.completionOfTaskBar.clear();
@ -746,8 +745,7 @@ export class HomeComponent implements OnInit {
this.completionOfTaskPie && this.completionOfTaskPie &&
this.completionOfTaskPie.setOption(this.completionOfTaskPieOption); this.completionOfTaskPie.setOption(this.completionOfTaskPieOption);
console.log(666, this.statisticalData_taskStatByOrg);
console.log(666,this.statisticalData_taskStatByOrg)
let taskBar = task['组织机构数据']; let taskBar = task['组织机构数据'];
let taskBarx = []; let taskBarx = [];
let taskBary1 = []; let taskBary1 = [];
@ -890,6 +888,7 @@ export class HomeComponent implements OnInit {
clickCard(item) { clickCard(item) {
console.log(item); console.log(item);
// return
if (item.name.indexOf('单位') !== -1) { if (item.name.indexOf('单位') !== -1) {
this.modal.create({ this.modal.create({
nzTitle: item.name + '列表', nzTitle: item.name + '列表',
@ -899,7 +898,6 @@ export class HomeComponent implements OnInit {
nzFooter: null, nzFooter: null,
nzComponentParams: { nzComponentParams: {
name: item.name, name: item.name,
data: item.data,
}, },
}); });
} else { } else {

5
src/app/home/statistic-analysis/home/unit-list/unit-list.component.ts

@ -9,15 +9,12 @@ import { NzMessageService } from 'ng-zorro-antd/message';
}) })
export class UnitListComponent implements OnInit { export class UnitListComponent implements OnInit {
@Input() name?: any; @Input() name?: any;
@Input() data?: any;
constructor(private http: HttpClient, private message: NzMessageService) {} constructor(private http: HttpClient, private message: NzMessageService) {}
ngOnInit(): void { ngOnInit(): void {
if (this.data.length !== 0) {
this.getUnitList(); this.getUnitList();
} }
}
listOfData: any = []; listOfData: any = [];
@ -28,9 +25,9 @@ export class UnitListComponent implements OnInit {
getUnitList() { getUnitList() {
this.isloading = true; this.isloading = true;
let params = { let params = {
CompanyIds: this.data,
PageNumber: this.PageNumber, PageNumber: this.PageNumber,
PageSize: this.PageSize, PageSize: this.PageSize,
CheckType: this.name === '不合格单位数量' ? '不合格单位' : '隐患单位',
}; };
this.http this.http
.get('/api/Companies', { .get('/api/Companies', {

31
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html

@ -2,9 +2,12 @@
<div class="box"> <div class="box">
<div class="timebox"> <div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)"> <nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option> <nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option> <nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select> </nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)" <div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}"> [ngClass]="{'selectedMonth': item.id == selectedMonth}">
@ -161,6 +164,10 @@
</ng-template> </ng-template>
</ng-template> </ng-template>
</div> </div>
<!-- <span (click)="xxx(i)">xxx</span> -->
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="i.planTime"
nzPlaceHolder="请选择检查日期" nzBorderless (ngModelChange)="checkTime($event,i,item)">
</nz-date-picker>
</div> </div>
</div> </div>
</div> </div>
@ -450,6 +457,28 @@
检查结果 检查结果
</span> </span>
</div> </div>
<div class="flexcol" style="flex: 2;">
<span class="ellipsi">
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss"
[(ngModel)]="i.planTime" nzPlaceHolder="请选择检查日期" nzBorderless
(ngModelChange)="checkTime($event,i,element)">
</nz-date-picker>
</span>
<span>
检查时间
</span>
</div>
<div class="flexcol" style="flex: 1;">
<span class="ellipsi">
<span style="cursor: pointer;margin-right: 5px;" (click)="look(i)">查看</span>
<span style="cursor: pointer;color: rgb(255, 64, 77);" (click)="deleteTask(item,i)">删除</span>
</span>
<span>
操作
</span>
</div>
</div> </div>
</div> </div>

802
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts

@ -3,45 +3,54 @@ import { Component, NgZone, OnInit, ViewContainerRef } from '@angular/core';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { AllotPersonComponent } from '../da-subordinate-audit/allot-person/allot-person.component'; import { AllotPersonComponent } from '../da-subordinate-audit/allot-person/allot-person.component';
import signalR from '../../../../signalR' import signalR from '../../../../signalR';
import * as moment from 'moment';
import { LookShuangsjComponent } from './look-shuangsj/look-shuangsj.component';
@Component({ @Component({
selector: 'app-da-monthly-task-overview', selector: 'app-da-monthly-task-overview',
templateUrl: './da-monthly-task-overview.component.html', templateUrl: './da-monthly-task-overview.component.html',
styleUrls: ['./da-monthly-task-overview.component.scss'] styleUrls: ['./da-monthly-task-overview.component.scss'],
}) })
export class DaMonthlyTaskOverviewComponent implements OnInit { export class DaMonthlyTaskOverviewComponent implements OnInit {
constructor(
constructor(private ngZone: NgZone, private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { } private ngZone: NgZone,
private http: HttpClient,
selectedMonth private modal: NzModalService,
selectedYear = 2023 private viewContainerRef: ViewContainerRef,
selectedTime private message: NzMessageService
) {}
selectedMonth;
selectedYear = new Date().getFullYear();
selectedTime;
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.id this.selectedMonth = item.id;
this.getTuesdayThursdayNum() this.getTuesdayThursdayNum();
this.getHigherTasks() this.getHigherTasks();
this.getTaskList() this.getTaskList();
this.getAllStation() this.getAllStation();
this.getCountStat() this.getCountStat();
} }
selectYear(e) { selectYear(e) {
this.selectedYear = e this.selectedYear = e;
this.getTuesdayThursdayNum() this.getTuesdayThursdayNum();
this.getHigherTasks() this.getHigherTasks();
this.getTaskList() this.getTaskList();
this.getAllStation() this.getAllStation();
this.getCountStat() this.getCountStat();
} }
//当月有几个周二周四 //当月有几个周二周四
TuesdayThursdayNum = 0 TuesdayThursdayNum = 0;
getTuesdayThursdayNum() { getTuesdayThursdayNum() {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime =
this.http.get(`/api/TaskTargets/GetTargetCount/${selectedTime}`).subscribe((data: any) => { this.selectedYear + '-' + this.selectedMonth + '-' + '01';
console.log('最大日期', data) this.http
this.TuesdayThursdayNum = data .get(`/api/TaskTargets/GetTargetCount/${selectedTime}`)
}) .subscribe((data: any) => {
console.log('最大日期', data);
this.TuesdayThursdayNum = data;
});
} }
months = [ months = [
@ -56,194 +65,314 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
{ id: 9, name: '9月', isable: true }, { id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true }, { id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true }, { id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true } { id: 12, name: '12月', isable: true },
] ];
OrganizationId;
OrganizationId
ngOnInit(): void { ngOnInit(): void {
// 接收来自中心的消息 // 接收来自中心的消息
(signalR.SR as any).on('receiveNotification', (message: string, senderName: string) => { (signalR.SR as any).on(
'receiveNotification',
(message: string, senderName: string) => {
// 接收后要做的事 // 接收后要做的事
console.log('收到消息---', message) console.log('收到消息---', message);
}) }
);
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.OrganizationId = JSON.parse(
this.selectedMonth = new Date().getMonth() + 1 sessionStorage.getItem('userData')
).organizationId;
this.selectedMonth = new Date().getMonth() + 1;
//上级任务指标 //上级任务指标
this.getHigherTasks() this.getHigherTasks();
// 下级任务申请 // 下级任务申请
this.getTaskList() this.getTaskList();
// this.getSupervisor('main') // this.getSupervisor('main')
// this.getSupervisor('assisted') // this.getSupervisor('assisted')
//统计信息 //统计信息
this.getCountStat() this.getCountStat();
this.getTuesdayThursdayNum() this.getTuesdayThursdayNum();
//本级部署 //本级部署
this.getAllStation() this.getAllStation();
} }
//上级任务指标 //上级任务指标
cardData = [ cardData = [
{ name: '双随机', isDetails: false, isLoading: false, background: '#1D9DFF', icon: 'suiji.png', passed: 0, inspected: 0, percentage: 0, data: [] }, {
{ name: '行政许可', isDetails: false, isLoading: false, background: '#42B983', icon: 'xuke.png', passed: 0, inspected: 0, percentage: 0, data: [] }, name: '双随机',
{ name: '熟悉演练', isDetails: false, isLoading: false, background: '#9D80FF', icon: 'yanlian.png', passed: 0, inspected: 0, percentage: 0, data: [] }, isDetails: false,
{ name: '消防宣传', isDetails: false, isLoading: false, background: '#FF5D2A', icon: 'xuanchuan.png', passed: 0, inspected: 0, percentage: 0, data: [] }, isLoading: false,
{ name: '投诉举报', isDetails: false, isLoading: false, background: '#5087FF', icon: 'tousu.png', passed: 0, inspected: 0, percentage: 0, data: [] }, background: '#1D9DFF',
{ name: '火灾调查', isDetails: false, isLoading: false, background: '#FF404D', icon: 'huozai.png', passed: 0, inspected: 0, percentage: 0, data: [] } icon: 'suiji.png',
] passed: 0,
inspected: 0,
percentage: 0,
data: [],
},
{
name: '行政许可',
isDetails: false,
isLoading: false,
background: '#42B983',
icon: 'xuke.png',
passed: 0,
inspected: 0,
percentage: 0,
data: [],
},
{
name: '熟悉演练',
isDetails: false,
isLoading: false,
background: '#9D80FF',
icon: 'yanlian.png',
passed: 0,
inspected: 0,
percentage: 0,
data: [],
},
{
name: '消防宣传',
isDetails: false,
isLoading: false,
background: '#FF5D2A',
icon: 'xuanchuan.png',
passed: 0,
inspected: 0,
percentage: 0,
data: [],
},
{
name: '投诉举报',
isDetails: false,
isLoading: false,
background: '#5087FF',
icon: 'tousu.png',
passed: 0,
inspected: 0,
percentage: 0,
data: [],
},
{
name: '火灾调查',
isDetails: false,
isLoading: false,
background: '#FF404D',
icon: 'huozai.png',
passed: 0,
inspected: 0,
percentage: 0,
data: [],
},
];
getHigherTasks() { getHigherTasks() {
this.cardData.forEach((item, key) => { this.cardData.forEach((item, key) => {
item.data = [] item.data = [];
item.passed = 0 item.passed = 0;
item.inspected = 0 item.inspected = 0;
}); });
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime =
this.selectedYear + '-' + this.selectedMonth + '-' + '01';
let params = { let params = {
Month: selectedTime, Month: selectedTime,
OrganizationId: this.OrganizationId, OrganizationId: this.OrganizationId,
PageNumber: 1, PageNumber: 1,
CreationTypes: ['上级指派'], CreationTypes: ['上级指派'],
PageSize: 9999 PageSize: 9999,
} };
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
data.items.forEach(element => { this.http
.get('/api/PlanTasks', {
params: params,
})
.subscribe((data: any) => {
data.items.forEach((element) => {
this.cardData.forEach((item, key) => { this.cardData.forEach((item, key) => {
element.taskType == item.name ? this.cardData[key].data.push(element) : null element.taskType == item.name
? this.cardData[key].data.push(element)
: null;
}); });
}); });
this.cardData.forEach(element => { this.cardData.forEach((element) => {
element.data.forEach(item => { element.data.forEach((item) => {
item.approvalStatus == '通过' ? element.passed += 1 : null item.approvalStatus == '通过' ? (element.passed += 1) : null;
item.approvalStatus == '已检查 ' ? element.inspected += 1 : null item.approvalStatus == '已检查 ' ? (element.inspected += 1) : null;
}) });
}) });
this.cardData.forEach(element => { this.cardData.forEach((element) => {
element.percentage = Math.round((element.inspected / element.data.length) * 100) || 0 element.percentage =
}) Math.round((element.inspected / element.data.length) * 100) || 0;
this.cardData = [...this.cardData] });
this.cardData = [...this.cardData];
}) });
} }
openDetails(data, type) { openDetails(data, type) {
this.ngZone.run(() => { this.ngZone.run(() => {
//这里写需要立即渲染的代码 //这里写需要立即渲染的代码
data.isDetails = type data.isDetails = type;
}); });
} }
//下级任务申请打开关闭 //下级任务申请打开关闭
expand(data) { expand(data) {
this.ngZone.run(() => { this.ngZone.run(() => {
//这里写需要立即渲染的代码 //这里写需要立即渲染的代码
data.isExpand = !data.isExpand data.isExpand = !data.isExpand;
}); });
} }
istaskauditExpanded = true istaskauditExpanded = true;
istaskauditexpand() { istaskauditexpand() {
this.istaskauditExpanded = !this.istaskauditExpanded this.istaskauditExpanded = !this.istaskauditExpanded;
} }
taskData = [ taskData = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [], isExpand: true }, {
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true }, id: 0,
{ id: 2, name: '双随机任务', finished: 0, totalCount: 0, list: [], isExpand: true } name: '熟悉演练任务',
] finished: 0,
totalCount: 0,
list: [],
isExpand: true,
},
{
id: 1,
name: '联络指导任务',
finished: 0,
totalCount: 0,
list: [],
isExpand: true,
},
{
id: 2,
name: '双随机任务',
finished: 0,
totalCount: 0,
list: [],
isExpand: true,
},
];
getTaskList() { getTaskList() {
this.taskData = [ this.taskData = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [], isExpand: true }, {
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [], isExpand: true }, id: 0,
{ id: 2, name: '双随机任务', finished: 0, totalCount: 0, list: [], isExpand: true } name: '熟悉演练任务',
finished: 0,
] totalCount: 0,
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' list: [],
isExpand: true,
},
{
id: 1,
name: '联络指导任务',
finished: 0,
totalCount: 0,
list: [],
isExpand: true,
},
{
id: 2,
name: '双随机任务',
finished: 0,
totalCount: 0,
list: [],
isExpand: true,
},
];
let selectedTime =
this.selectedYear + '-' + this.selectedMonth + '-' + '01';
let params = { let params = {
Month: selectedTime, Month: selectedTime,
OrganizationId: this.OrganizationId, OrganizationId: this.OrganizationId,
CreationTypes: ['申领任务'], CreationTypes: ['申领任务'],
PageNumber: 1, PageNumber: 1,
PageSize: 9999 PageSize: 9999,
} };
this.http.get('/api/PlanTasks', { this.http
params: params .get('/api/PlanTasks', {
}).subscribe((data: any) => { params: params,
let arr1 = [] })
let arr2 = [] .subscribe((data: any) => {
let arr3 = [] let arr1 = [];
data.items.forEach(element => { let arr2 = [];
let arr3 = [];
data.items.forEach((element) => {
if (element.taskName == '熟悉演练') { if (element.taskName == '熟悉演练') {
arr1.push(element) arr1.push(element);
} }
if (element.taskName == '联络指导') { if (element.taskName == '联络指导') {
arr2.push(element) arr2.push(element);
} }
if (element.taskName == '双随机') { if (element.taskName == '双随机') {
arr3.push(element) arr3.push(element);
} }
}); });
arr1.forEach(item => { arr1.forEach((item) => {
if (item.approvalStatus == '通过' || item.approvalStatus == '待检查' || item.approvalStatus == '已检查') { if (
this.taskData[0].finished += 1 item.approvalStatus == '通过' ||
item.approvalStatus == '待检查' ||
item.approvalStatus == '已检查'
) {
this.taskData[0].finished += 1;
} }
}); });
arr2.forEach(item => { arr2.forEach((item) => {
if (item.approvalStatus == '通过' || item.approvalStatus == '待检查' || item.approvalStatus == '已检查') { if (
this.taskData[1].finished += 1 item.approvalStatus == '通过' ||
item.approvalStatus == '待检查' ||
item.approvalStatus == '已检查'
) {
this.taskData[1].finished += 1;
} }
}); });
arr3.forEach(item => { arr3.forEach((item) => {
if (item.approvalStatus == '通过' || item.approvalStatus == '待检查' || item.approvalStatus == '已检查') { if (
this.taskData[2].finished += 1 item.approvalStatus == '通过' ||
item.approvalStatus == '待检查' ||
item.approvalStatus == '已检查'
) {
this.taskData[2].finished += 1;
} }
}); });
this.taskData[0].list = [...arr1] this.taskData[0].list = [...arr1];
this.taskData[1].list = [...arr2] this.taskData[1].list = [...arr2];
this.taskData[2].list = [...arr3] this.taskData[2].list = [...arr3];
console.log('下级任务申请', this.taskData) console.log('下级任务申请', this.taskData);
});
})
} }
assitantsupervisorList assitantsupervisorList;
mainsupervisorList mainsupervisorList;
getSupervisor(type) { getSupervisor(type) {
let params = { let params = {
inspectorType: type inspectorType: type,
} };
this.http.get('/api/Users/Inspectors', { this.http
params: params .get('/api/Users/Inspectors', {
}).subscribe((data: any) => { params: params,
console.log('检查员列表', data) })
.subscribe((data: any) => {
console.log('检查员列表', data);
if (type == 'main') { if (type == 'main') {
this.mainsupervisorList = data this.mainsupervisorList = data;
} else { } else {
this.assitantsupervisorList = data this.assitantsupervisorList = data;
} }
}) });
} }
allot(item) { allot(item) {
console.log(item) console.log(item);
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) { if (
this.mainsupervisorList.length == 0 ||
this.assitantsupervisorList.length == 0
) {
this.message.create('warning', '请从用户管理添加检查人员'); this.message.create('warning', '请从用户管理添加检查人员');
return return;
} }
const modal = this.modal.create({ const modal = this.modal.create({
nzTitle: '分配监督检查员', nzTitle: '分配监督检查员',
@ -253,191 +382,384 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
nzMaskClosable: false, nzMaskClosable: false,
nzComponentParams: { nzComponentParams: {
mainsupervisorList: this.mainsupervisorList, mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList assitantsupervisorList: this.assitantsupervisorList,
}, },
nzOnOk: async () => { nzOnOk: async () => {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
let body = { let body = {
mainSupervisorId: instance.validateForm.value.main, mainSupervisorId: instance.validateForm.value.main,
assitantSupervisorId: instance.validateForm.value.assitant assitantSupervisorId: instance.validateForm.value.assitant,
} };
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({ this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => { next: async (data) => {
this.message.create('success', '分配成功'); this.message.create('success', '分配成功');
resolve(data) resolve(data);
console.log(data); console.log(data);
this.getTaskList() this.getTaskList();
return true return true;
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '分配失败'); this.message.create('warning', '分配失败');
reject(err) reject(err);
return false return false;
} },
}) });
}) });
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create('warning', '请填写完整!');
return false return false;
}
} }
},
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
} }
//获得统计信息 //获得统计信息
countStat: any = { countStat: any = {
statistics1: { statistics1: {
num: 0, percentageComplete: 0, item1: 0, item2: 0, item3: 0 num: 0,
percentageComplete: 0,
item1: 0,
item2: 0,
item3: 0,
}, },
statistics2: { statistics2: {
num: 0, percentageComplete: 0, item1: 0, item2: 0, item3: 0 num: 0,
percentageComplete: 0,
item1: 0,
item2: 0,
item3: 0,
}, },
statistics3: { statistics3: {
num: 0, percentageComplete: 0, item1: 0, item2: 0, item3: 0 num: 0,
} percentageComplete: 0,
} item1: 0,
item2: 0,
item3: 0,
},
};
getCountStat() { getCountStat() {
function integer(num) { function integer(num) {
return Math.round(num * 100) || 0 return Math.round(num * 100) || 0;
} }
let selectedMonth = this.selectedMonth < 10 ? "0" + this.selectedMonth : this.selectedMonth; let selectedMonth =
let selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01' this.selectedMonth < 10 ? '0' + this.selectedMonth : this.selectedMonth;
this.http.get('/api/PlanTasks/GetCountStat', { let selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01';
this.http
.get('/api/PlanTasks/GetCountStat', {
params: { params: {
month: selectedTime month: selectedTime,
} },
}).subscribe(data => { })
console.log('统计信息', data) .subscribe((data) => {
console.log('统计信息', data);
this.countStat = { this.countStat = {
statistics1: { statistics1: {
num: data['任务总数']['总数'], percentageComplete: integer(data['任务总数']['已完成'] / data['任务总数']['总数']), item1: integer(data['任务总数']['上级指派'] / data['任务总数']['总数']), item2: integer(data['任务总数']['自主任务'] / data['任务总数']['总数']), item3: integer(data['任务总数']['申领任务'] / data['任务总数']['总数']) num: data['任务总数']['总数'],
percentageComplete: integer(
data['任务总数']['已完成'] / data['任务总数']['总数']
),
item1: integer(
data['任务总数']['上级指派'] / data['任务总数']['总数']
),
item2: integer(
data['任务总数']['自主任务'] / data['任务总数']['总数']
),
item3: integer(
data['任务总数']['申领任务'] / data['任务总数']['总数']
),
}, },
statistics2: { statistics2: {
num: data['消防救援任务总数']['总数'], percentageComplete: integer(data['消防救援任务总数']['已完成'] / data['任务总数']['总数']), item1: integer(data['消防救援任务总数']['上级指派'] / data['消防救援任务总数']['总数']), item2: integer(data['消防救援任务总数']['自主任务'] / data['消防救援任务总数']['总数']), item3: integer(data['消防救援任务总数']['申领任务'] / data['消防救援任务总数']['总数']) num: data['消防救援任务总数']['总数'],
percentageComplete: integer(
data['消防救援任务总数']['已完成'] / data['任务总数']['总数']
),
item1: integer(
data['消防救援任务总数']['上级指派'] /
data['消防救援任务总数']['总数']
),
item2: integer(
data['消防救援任务总数']['自主任务'] /
data['消防救援任务总数']['总数']
),
item3: integer(
data['消防救援任务总数']['申领任务'] /
data['消防救援任务总数']['总数']
),
}, },
statistics3: { statistics3: {
num: data['检查员任务总数']['总数'], percentageComplete: integer(data['检查员任务总数']['已完成'] / data['任务总数']['总数']), item1: integer(data['检查员任务总数']['上级指派'] / data['检查员任务总数']['总数']), item2: integer(data['检查员任务总数']['自主任务'] / data['检查员任务总数']['总数']), item3: integer(data['检查员任务总数']['申领任务'] / data['检查员任务总数']['总数']) num: data['检查员任务总数']['总数'],
} percentageComplete: integer(
} data['检查员任务总数']['已完成'] / data['任务总数']['总数']
}) ),
item1: integer(
data['检查员任务总数']['上级指派'] /
data['检查员任务总数']['总数']
),
item2: integer(
data['检查员任务总数']['自主任务'] /
data['检查员任务总数']['总数']
),
item3: integer(
data['检查员任务总数']['申领任务'] /
data['检查员任务总数']['总数']
),
},
};
});
} }
//本级部署打开关闭 //本级部署打开关闭
isdeployboxExpanded = true isdeployboxExpanded = true;
isdeployboxexpand() { isdeployboxexpand() {
this.isdeployboxExpanded = !this.isdeployboxExpanded this.isdeployboxExpanded = !this.isdeployboxExpanded;
} }
formatOne = (percent: number): string => `${percent}%\n完成率`; formatOne = (percent: number): string => `${percent}%\n完成率`;
//获得辖区下所有救援站 //获得辖区下所有救援站
stationData = [] stationData = [];
getAllStation() { getAllStation() {
let params = { let params = {
ContainsChildren: "true", ContainsChildren: 'true',
PageNumber: 1, PageNumber: 1,
PageSize: 9999 PageSize: 9999,
} };
this.http.get('/api/Organizations', { this.http
params: params .get('/api/Organizations', {
}).subscribe((data: any) => { params: params,
})
.subscribe((data: any) => {
this.ngZone.run(() => { this.ngZone.run(() => {
data.items = data.items.filter(element => { // data.items = data.items.filter((element) => {
return element.level == 'squadron' // return element.level == 'squadron';
// });
data.items.forEach((element) => {
element.isExpand = false;
element.isLoading = false;
});
this.stationData = data.items;
this.stationData[0].isExpand = true;
this.stationData.forEach((item) => {
this.getTaskListOfStation(item);
});
}); });
data.items.forEach(element => {
element.isExpand = false
element.isLoading = false
}); });
this.stationData = data.items
this.stationData[0].isExpand = true
this.stationData.forEach(item => {
this.getTaskListOfStation(item)
})
})
})
} }
expandcarditem(item) { expandcarditem(item) {
item.isExpand = !item.isExpand item.isExpand = !item.isExpand;
} }
//获得消防站下的所有任务 //获得消防站下的所有任务
getTaskListOfStation(item) { getTaskListOfStation(item) {
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime =
this.selectedYear + '-' + this.selectedMonth + '-' + '01';
let params = { let params = {
Month: selectedTime, Month: selectedTime,
CompanyOrganizationId: item.id, CompanyOrganizationId: item.id,
PageNumber: 1, PageNumber: 1,
approvalStatuses: ['通过', '待检查', '已检查'], approvalStatuses: ['通过', '待检查', '已检查'],
PageSize: 9999 PageSize: 9999,
} };
item.isLoading = true item.isLoading = true;
this.http.get('/api/PlanTasks', { this.http
params: params .get('/api/PlanTasks', {
}).subscribe({ params: params,
})
.subscribe({
next: (data: any) => { next: (data: any) => {
item.isLoading = false item.isLoading = false;
let listData = [ let listData = [
{ name: '双随机', background: '#1D9DFF', icon: 'suiji.png', scale: '0/0', data: [], inspected: 0, finished: 0 }, {
{ name: '行政许可', background: '#42B983', icon: 'xuke.png', scale: '0/0', data: [], inspected: 0, finished: 0 }, name: '双随机',
{ name: '熟悉演练', background: '#9D80FF', icon: 'yanlian.png', scale: '0/0', data: [], inspected: 0, finished: 0 }, background: '#1D9DFF',
{ name: '联络指导', background: '#5483EA', icon: 'zhidao.png', scale: '0/0', data: [], inspected: 0, finished: 0 }, icon: 'suiji.png',
{ name: '消防宣传', background: '#FF5D2A', icon: 'xuanchuan.png', scale: '0/0', data: [], inspected: 0, finished: 0 }, scale: '0/0',
{ name: '投诉举报', background: '#5087FF', icon: 'tousu.png', scale: '0/0', data: [], inspected: 0, finished: 0 }, data: [],
{ name: '火灾调查', background: '#FF404D', icon: 'huozai.png', scale: '0/0', data: [], inspected: 0, finished: 0 } inspected: 0,
] finished: 0,
data.items.forEach(element => { },
{
name: '行政许可',
background: '#42B983',
icon: 'xuke.png',
scale: '0/0',
data: [],
inspected: 0,
finished: 0,
},
{
name: '熟悉演练',
background: '#9D80FF',
icon: 'yanlian.png',
scale: '0/0',
data: [],
inspected: 0,
finished: 0,
},
{
name: '联络指导',
background: '#5483EA',
icon: 'zhidao.png',
scale: '0/0',
data: [],
inspected: 0,
finished: 0,
},
{
name: '消防宣传',
background: '#FF5D2A',
icon: 'xuanchuan.png',
scale: '0/0',
data: [],
inspected: 0,
finished: 0,
},
{
name: '投诉举报',
background: '#5087FF',
icon: 'tousu.png',
scale: '0/0',
data: [],
inspected: 0,
finished: 0,
},
{
name: '火灾调查',
background: '#FF404D',
icon: 'huozai.png',
scale: '0/0',
data: [],
inspected: 0,
finished: 0,
},
];
data.items.forEach((element) => {
listData.forEach((item, key) => { listData.forEach((item, key) => {
element.taskType == item.name ? listData[key].data.push(element) : null element.taskType == item.name
? listData[key].data.push(element)
: null;
}); });
}); });
for (let index = 0; index < listData.length; index++) { for (let index = 0; index < listData.length; index++) {
const element = listData[index]; const element = listData[index];
if (element.data.length == 0) { if (element.data.length == 0) {
listData.splice(index, 1) listData.splice(index, 1);
index-- index--;
} }
} }
item.data = listData item.data = listData;
console.log('当前登录用户所有通过的任务', item); console.log('当前登录用户所有通过的任务', item);
item.allUnitsNum = 0 item.allUnitsNum = 0;
item.awaitInspect = 0 item.awaitInspect = 0;
item.inspected = 0 item.inspected = 0;
item.finished = 0 item.finished = 0;
item.data.forEach(element => { item.data.forEach((element) => {
item.allUnitsNum += element.data.length item.allUnitsNum += element.data.length;
element.data.forEach(i => { element.data.forEach((i) => {
i.approvalStatus == '待检查' ? item.awaitInspect += 1 : null i.approvalStatus == '待检查' ? (item.awaitInspect += 1) : null;
i.approvalStatus == '已检查' ? item.inspected += 1 : null i.approvalStatus == '已检查' ? (item.inspected += 1) : null;
i.approvalStatus == '待检查' ? element.inspected += 1 : null i.approvalStatus == '待检查' ? (element.inspected += 1) : null;
i.approvalStatus == '已检查' ? element.finished += 1 : null i.approvalStatus == '已检查' ? (element.finished += 1) : null;
}); });
}); });
item.percentage = Math.round((item.inspected / item.allUnitsNum) * 100) item.percentage = Math.round(
(item.inspected / item.allUnitsNum) * 100
);
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '获取数据失败'); this.message.create('warning', '获取数据失败');
item.isLoading = false item.isLoading = false;
},
});
} }
})
checkTime(e, i, element) {
if (e) {
let time = new Date(
moment(e).format('yyyy-MM-DD HH:mm:ss')
).toISOString();
i.planTime = time;
} else {
i.planTime = null;
}
let month = moment(e).format('yyyy-MM-01');
element.isLoading = true;
let body = {
planTime: i.planTime,
month: month,
};
this.http.patch(`/api/PlanTasks/${i.id}`, body).subscribe({
next: (data) => {
this.message.create('success', '检查日期分配成功');
element.isLoading = false;
},
error: (err) => {
this.message.create('warning', '检查日期分配失败');
element.isLoading = false;
},
});
}
look(item) {
console.log(item);
// console.log(JSON.parse(item.resultData));
if (item.taskType == '双随机' || item.taskType == '联络指导') {
let data = JSON.parse(item.resultData);
if (!data) {
this.message.create('warning', '无数据');
return;
}
this.modal.create({
nzTitle: '双随机详情',
nzContent: LookShuangsjComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 800,
nzFooter: null,
nzComponentParams: {
data: data,
},
});
} else if (item.taskType == '熟悉演练') {
window.open(
`/statistic/taskdetails?id=${item.id}&company=${
item.company.companyName
}&organization=${item.organization.name}&legalPersonName=${
item.company.legalPersonName ? item.company.legalPersonName : ''
}`
);
}
}
deleteTask(element, item) {
this.modal.confirm({
nzTitle: '确定删除此任务吗?',
nzOkText: '确定',
nzOkType: 'primary',
nzOkDanger: true,
nzOnOk: () => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe({
next: (data) => {
this.message.create('success', '删除成功');
element.data = element.data.filter((i) => i.id != item.id);
},
error: (err) => {
this.message.create('warning', '删除失败');
},
});
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel'),
});
} }
} }

54
src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.html

@ -0,0 +1,54 @@
<div>
<div class="rowItem">
<span>单位名称:</span><span>{{data.company?.companyName}}</span>
</div>
<div class="rowItem">
<span>单位管理人:</span><span>{{data.company?.directorName}}</span>
</div>
<div class="rowItem">
<span>联系方式:</span><span>{{data.company?.directorPhone}}</span>
</div>
<div class="rowItem">
<span>单位地址:</span><span>{{data.company?.address}}</span>
</div>
<div class="rowItem">
<span>建筑结构:</span><span>{{data.company?.datas?.basicInfo.structure}}</span>
</div>
<div class="rowItem">
<span>建筑高度:</span><span>{{data.company?.datas?.basicInfo.height}}</span>
</div>
<div class="rowItem">
<span>建筑层数:</span><span>{{data.company?.datas?.basicInfo.layer}}</span>
</div>
<div class="rowItem">
<span>控制室位置:</span><span>{{data.company?.datas?.facilities.controlPosition}}</span>
</div>
<div class="rowItem">
<span>安全重点部位:</span><span>{{data.company?.useNature}}</span>
</div>
<div class="rowItem">
<span>单位性质:</span><span>{{data.company?.datas?.basicInfo.nature}}</span>
</div>
<div class="rowItem">
<span>消防设施及器材:</span><span>{{data.company?.datas?.facilities.fireFightingFacilities.title}}</span>
</div>
<div class="rowItem">
<span>单位主要消防设施:</span><span>{{data.company?.zhuyaosheshi?.title}}</span>
</div>
<div class="rowItem">
<span>位置:</span><span>{{data.position.name}}</span>
</div>
<div class="rowItem">
<span>姓名:</span><span>{{data.name}}</span>
</div>
<div class="rowItem">
<span>职务:</span><span>{{data.post}}</span>
</div>
<div class="rowItem">
<span>备注:</span><span>{{data.remarks}}</span>
</div>
<div class="rowItem">
<span>图片列表:</span>
<img *ngFor="let item of data.imgShow2" [src]="item" alt="" (click)="viewImg(item)" width="100" height="100">
</div>
</div>

0
src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.scss

25
src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LookShuangsjComponent } from './look-shuangsj.component';
describe('LookShuangsjComponent', () => {
let component: LookShuangsjComponent;
let fixture: ComponentFixture<LookShuangsjComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LookShuangsjComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(LookShuangsjComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

35
src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.ts

@ -0,0 +1,35 @@
import { Component, Input, OnInit } from '@angular/core';
import Viewer from 'viewerjs';
@Component({
selector: 'app-look-shuangsj',
templateUrl: './look-shuangsj.component.html',
styleUrls: ['./look-shuangsj.component.scss'],
})
export class LookShuangsjComponent implements OnInit {
@Input() data?: any;
constructor() {}
ngOnInit(): void {
console.log(this.data);
}
//查看图片
viewImg(url) {
let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes;
let node = document.createElement('img');
node.style.display = 'none';
node.src = url;
node.id = 'img';
dom.appendChild(node);
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
},
});
node.click();
}, 0);
}
}

2
src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts

@ -23,7 +23,7 @@ export class DaOneselfPlanComponent implements OnInit {
this.getTuesdayThursdayNum() this.getTuesdayThursdayNum()
} }
selectedMonth selectedMonth
selectedYear = 2023 selectedYear = 2024
selectedTime selectedTime
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.id this.selectedMonth = item.id

5
src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.html

@ -2,9 +2,12 @@
<div class="box"> <div class="box">
<div class="timebox"> <div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)"> <nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option> <nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option> <nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select> </nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)" <div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}"> [ngClass]="{'selectedMonth': item.id == selectedMonth}">

226
src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.ts

@ -7,33 +7,36 @@ import { AllotPersonComponent } from './allot-person/allot-person.component';
@Component({ @Component({
selector: 'app-da-subordinate-audit', selector: 'app-da-subordinate-audit',
templateUrl: './da-subordinate-audit.component.html', templateUrl: './da-subordinate-audit.component.html',
styleUrls: ['./da-subordinate-audit.component.scss'] styleUrls: ['./da-subordinate-audit.component.scss'],
}) })
export class DaSubordinateAuditComponent implements OnInit { export class DaSubordinateAuditComponent implements OnInit {
constructor(
private http: HttpClient,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService
) {}
constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { } OrganizationId;
selectedTab = 0;
OrganizationId atPresentData = { id: 0, name: '', finished: 0, totalCount: 0, list: [] };
selectedTab = 0
atPresentData = { id: 0, name: '', finished: 0, totalCount: 0, list: [] }
selectTab(item) { selectTab(item) {
this.selectedTab = item.id this.selectedTab = item.id;
this.atPresentData = item this.atPresentData = item;
} }
ngOnInit(): void { ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.OrganizationId = JSON.parse(
this.selectedMonth = new Date().getMonth() + 1 sessionStorage.getItem('userData')
).organizationId;
this.getTaskList(0) this.selectedMonth = new Date().getMonth() + 1;
this.getTaskList(0);
//获得主协调查人员 //获得主协调查人员
this.getSupervisor('main') this.getSupervisor('main');
this.getSupervisor('assisted') this.getSupervisor('assisted');
} }
months = [ months = [
{ id: 1, name: '1月', isable: true }, { id: 1, name: '1月', isable: true },
@ -47,104 +50,110 @@ export class DaSubordinateAuditComponent implements OnInit {
{ id: 9, name: '9月', isable: true }, { id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true }, { id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true }, { id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true } { id: 12, name: '12月', isable: true },
] ];
selectedMonth selectedMonth;
selectedYear = 2023 selectedYear = new Date().getFullYear();
selectedTime selectedTime;
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.id this.selectedMonth = item.id;
this.getTaskList(this.selectedTab) this.getTaskList(this.selectedTab);
} }
selectYear(e) { selectYear(e) {
this.selectedYear = e this.selectedYear = e;
console.log('年', e) console.log('年', e);
this.getTaskList(this.selectedTab) this.getTaskList(this.selectedTab);
} }
PageNumber = 1 PageNumber = 1;
PageSize = 9999 PageSize = 9999;
data = [ data = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] }, { id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] } { id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] },
] ];
isloading = false isloading = false;
getTaskList(index) { getTaskList(index) {
this.isloading = true this.isloading = true;
this.data = [ this.data = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] }, { id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] } { id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] },
] ];
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime =
console.log('查询时间', selectedTime) this.selectedYear + '-' + this.selectedMonth + '-' + '01';
console.log('查询时间', selectedTime);
let params = { let params = {
Month: selectedTime, Month: selectedTime,
OrganizationId: this.OrganizationId, OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber, PageNumber: this.PageNumber,
PageSize: this.PageSize PageSize: this.PageSize,
} };
this.http.get('/api/PlanTasks', { this.http
params: params .get('/api/PlanTasks', {
}).subscribe((data: any) => { params: params,
let arr1 = [] })
let arr2 = [] .subscribe((data: any) => {
data.items.forEach(element => { let arr1 = [];
let arr2 = [];
data.items.forEach((element) => {
if (element.taskName == '熟悉演练') { if (element.taskName == '熟悉演练') {
arr1.push(element) arr1.push(element);
} }
if (element.taskName == '联络指导') { if (element.taskName == '联络指导') {
arr2.push(element) arr2.push(element);
} }
}); });
arr1.forEach(item => { arr1.forEach((item) => {
if (!!item.approvalStatus) { if (!!item.approvalStatus) {
this.data[0].finished += 1 this.data[0].finished += 1;
} }
}); });
arr2.forEach(item => { arr2.forEach((item) => {
if (!!item.approvalStatus) { if (!!item.approvalStatus) {
this.data[1].finished += 1 this.data[1].finished += 1;
} }
}); });
this.data[0].totalCount = arr1.length this.data[0].totalCount = arr1.length;
this.data[0].list = [...arr1] this.data[0].list = [...arr1];
this.data[1].totalCount = arr2.length this.data[1].totalCount = arr2.length;
this.data[1].list = [...arr2] this.data[1].list = [...arr2];
this.atPresentData = this.data[index] this.atPresentData = this.data[index];
console.log(this.atPresentData) console.log(this.atPresentData);
this.isloading = false this.isloading = false;
}) });
} }
assitantsupervisorList;
mainsupervisorList;
assitantsupervisorList
mainsupervisorList
getSupervisor(type) { getSupervisor(type) {
let params = { let params = {
inspectorType: type inspectorType: type,
} };
this.http.get('/api/Users/Inspectors', { this.http
params: params .get('/api/Users/Inspectors', {
}).subscribe((data: any) => { params: params,
console.log('检查员列表', data) })
.subscribe((data: any) => {
console.log('检查员列表', data);
if (type == 'main') { if (type == 'main') {
this.mainsupervisorList = data this.mainsupervisorList = data;
} else { } else {
this.assitantsupervisorList = data this.assitantsupervisorList = data;
} }
}) });
} }
allot(item) { allot(item) {
console.log(item) console.log(item);
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) { if (
this.mainsupervisorList.length == 0 ||
this.assitantsupervisorList.length == 0
) {
this.message.create('warning', '请从用户管理添加检查人员'); this.message.create('warning', '请从用户管理添加检查人员');
return return;
} }
const modal = this.modal.create({ const modal = this.modal.create({
nzTitle: '分配监督检查员', nzTitle: '分配监督检查员',
@ -154,38 +163,40 @@ export class DaSubordinateAuditComponent implements OnInit {
nzMaskClosable: false, nzMaskClosable: false,
nzComponentParams: { nzComponentParams: {
mainsupervisorList: this.mainsupervisorList, mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList assitantsupervisorList: this.assitantsupervisorList,
}, },
nzOnOk: async () => { nzOnOk: async () => {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
let body = { let body = {
mainSupervisorId: instance.validateForm.value.main, mainSupervisorId: instance.validateForm.value.main,
assitantSupervisorId: instance.validateForm.value.assitant assitantSupervisorId: instance.validateForm.value.assitant,
} };
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({ this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => { next: async (data) => {
this.message.create('success', '分配成功'); this.message.create('success', '分配成功');
resolve(data) resolve(data);
this.getTaskList(this.selectedTab) this.getTaskList(this.selectedTab);
return true return true;
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '分配失败'); this.message.create('warning', '分配失败');
reject(err) reject(err);
return false return false;
} },
}) });
}) });
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create('warning', '请填写完整!');
return false return false;
}
} }
},
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
} }
agree(item) { agree(item) {
@ -194,21 +205,23 @@ export class DaSubordinateAuditComponent implements OnInit {
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'default', nzOkType: 'default',
nzOnOk: () => { nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, { this.http
.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: { params: {
approvalStatus: 'approved' approvalStatus: 'approved',
} },
}).subscribe({ })
.subscribe({
next: (data) => { next: (data) => {
this.message.create('success', '审核成功'); this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab) this.getTaskList(this.selectedTab);
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '审核失败'); this.message.create('warning', '审核失败');
}
})
}, },
nzCancelText: '取消' });
},
nzCancelText: '取消',
}); });
} }
@ -218,22 +231,23 @@ export class DaSubordinateAuditComponent implements OnInit {
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'default', nzOkType: 'default',
nzOnOk: () => { nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, { this.http
.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: { params: {
approvalStatus: 'reject' approvalStatus: 'reject',
} },
}).subscribe({ })
.subscribe({
next: (data) => { next: (data) => {
this.message.create('success', '审核成功'); this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab) this.getTaskList(this.selectedTab);
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '审核失败'); this.message.create('warning', '审核失败');
}
})
}, },
nzCancelText: '取消' });
},
nzCancelText: '取消',
}); });
} }
} }

5
src/app/home/task/station-task-apply/station-task-apply.component.html

@ -23,9 +23,12 @@
</div> </div>
<div class="timebox"> <div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)"> <nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option> <nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option> <nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select> </nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)" <div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}"> [ngClass]="{'selectedMonth': item.id == selectedMonth}">

426
src/app/home/task/station-task-apply/station-task-apply.component.ts

@ -1,6 +1,15 @@
import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core'; import {
Component,
OnInit,
TemplateRef,
ViewContainerRef,
} from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNodeOptions,
} from 'ng-zorro-antd/tree';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
@ -10,25 +19,31 @@ import { ApplyLookComponent } from './apply-look/apply-look.component';
import { ThisReceiver } from '@angular/compiler'; import { ThisReceiver } from '@angular/compiler';
import { MethodService } from 'src/app/service/method.service'; import { MethodService } from 'src/app/service/method.service';
@Component({ @Component({
selector: 'app-station-task-apply', selector: 'app-station-task-apply',
templateUrl: './station-task-apply.component.html', templateUrl: './station-task-apply.component.html',
styleUrls: ['./station-task-apply.component.scss'] styleUrls: ['./station-task-apply.component.scss'],
}) })
export class StationTaskApplyComponent implements OnInit { export class StationTaskApplyComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService, public methodService: MethodService) { } constructor(
private fb: FormBuilder,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService,
private http: HttpClient,
private toTree: TreeService,
public methodService: MethodService
) {}
searchForm = { searchForm = {
taskname: '', taskname: '',
unitname: '', unitname: '',
unitlevel: '', unitlevel: '',
or: '' or: '',
} };
OrganizationId OrganizationId;
isSupervisor: boolean //是否为检查员 isSupervisor: boolean; //是否为检查员
months = [ months = [
{ id: 1, name: '1月', isable: true }, { id: 1, name: '1月', isable: true },
@ -42,29 +57,29 @@ export class StationTaskApplyComponent implements OnInit {
{ id: 9, name: '9月', isable: true }, { id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true }, { id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true }, { id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true } { id: 12, name: '12月', isable: true },
] ];
selectedMonth selectedMonth;
selectedYear = 2023 selectedYear = new Date().getFullYear();
selectedTime selectedTime;
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.id this.selectedMonth = item.id;
this.getTaskList() this.getTaskList();
} }
selectYear(e) { selectYear(e) {
this.selectedYear = e this.selectedYear = e;
this.getTaskList() this.getTaskList();
} }
isloading = false;
isloading = false totalCount;
totalCount PageNumber = 1;
PageNumber = 1 PageSize = 10;
PageSize = 10 taskLIst = [];
taskLIst = []
getTaskList() { getTaskList() {
this.isloading = true this.isloading = true;
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime =
this.selectedYear + '-' + this.selectedMonth + '-' + '01';
let params = { let params = {
Month: selectedTime, Month: selectedTime,
TaskName: this.searchForm.taskname, TaskName: this.searchForm.taskname,
@ -75,109 +90,118 @@ export class StationTaskApplyComponent implements OnInit {
CreationTypes: ['申领任务'], CreationTypes: ['申领任务'],
OrganizationId: this.OrganizationId, OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber, PageNumber: this.PageNumber,
PageSize: this.PageSize PageSize: this.PageSize,
} };
this.http.get('/api/PlanTasks', { this.http
params: params .get('/api/PlanTasks', {
}).subscribe((data: any) => { params: params,
this.isloading = false
console.log('任务申请列表', data);
this.totalCount = data.totalCount
this.taskLIst = [...data.items]
}) })
.subscribe((data: any) => {
this.isloading = false;
console.log('任务申请列表', data);
this.totalCount = data.totalCount;
this.taskLIst = [...data.items];
});
} }
pageChange($event) { pageChange($event) {
this.PageNumber = $event this.PageNumber = $event;
this.getTaskList() this.getTaskList();
} }
search() { search() {
this.PageNumber = 1 this.PageNumber = 1;
this.getTaskList() this.getTaskList();
} }
reset() { reset() {
this.PageNumber = 1 this.PageNumber = 1;
this.searchForm = { this.searchForm = {
taskname: '', taskname: '',
unitname: '', unitname: '',
unitlevel: '', unitlevel: '',
or: '' or: '',
};
this.getTaskList();
} }
this.getTaskList()
}
expandKeys expandKeys;
defaultOrId: string defaultOrId: string;
//获取所有组织机构 //获取所有组织机构
organizationList: any organizationList: any;
organizationListAll: any organizationListAll: any;
nodes: any = [] nodes: any = [];
async getAllOrganization() { async getAllOrganization() {
let params = { let params = {
ContainsChildren: "true", ContainsChildren: 'true',
PageNumber: 1, PageNumber: 1,
PageSize: 9999, PageSize: 9999,
code: '0000' code: '0000',
} };
var p = new Promise<void>((resolve, reject) => { var p = new Promise<void>((resolve, reject) => {
this.http.get('/api/Organizations', { this.http
params: params .get('/api/Organizations', {
}).subscribe((data: any) => { params: params,
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.disableCheckbox = true
element.selectable = false
element.level == 'squadron' ? element.disableCheckbox = false : null
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items))
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(item => {
return item.level != 'squadron'
}) })
resolve(data) .subscribe((data: any) => {
}) data.items.forEach((element) => {
}) element.key = element.id;
return p element.title = element.name;
element.disableCheckbox = true;
element.selectable = false;
element.level == 'squadron'
? (element.disableCheckbox = false)
: null;
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items));
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(
(item) => {
return item.level != 'squadron';
}
);
resolve(data);
});
});
return p;
} }
//获得所有检查员 //获得所有检查员
supervisorList = [] supervisorList = [];
async getSupervisor() { async getSupervisor() {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
this.http.get('/api/Users/Inspectors').subscribe((data: any) => { this.http.get('/api/Users/Inspectors').subscribe((data: any) => {
console.log('检查员列表', data) console.log('检查员列表', data);
data.forEach(element => { data.forEach((element) => {
element.key = element.id element.key = element.id;
element.title = element.name element.title = element.name;
element.parentId = element.organizationId element.parentId = element.organizationId;
});
this.supervisorList = data;
resolve(data);
});
}); });
this.supervisorList = data
resolve(data)
})
})
} }
mainsupervisorList = [] mainsupervisorList = [];
assitantsupervisorList = [] assitantsupervisorList = [];
getSupervisortype(type) { getSupervisortype(type) {
let params = { let params = {
inspectorType: type inspectorType: type,
} };
this.http.get('/api/Users/Inspectors', { this.http
params: params .get('/api/Users/Inspectors', {
}).subscribe((data: any) => { params: params,
})
.subscribe((data: any) => {
if (type == 'main') { if (type == 'main') {
this.mainsupervisorList = data this.mainsupervisorList = data;
} else { } else {
this.assitantsupervisorList = data this.assitantsupervisorList = data;
} }
}) });
} }
//获得除了检查员的其他用户 //获得除了检查员的其他用户
users users;
async getUsers() { async getUsers() {
var p = new Promise<void>((resolve, reject) => { var p = new Promise<void>((resolve, reject) => {
let params = { let params = {
@ -185,60 +209,66 @@ export class StationTaskApplyComponent implements OnInit {
OrganizationLevel: 'squadron', OrganizationLevel: 'squadron',
ContainsChildren: true, ContainsChildren: true,
PageNumber: 1, PageNumber: 1,
PageSize: 9999 PageSize: 9999,
} };
this.http.get('/api/Users', { this.http
params: params .get('/api/Users', {
}).subscribe((data: any) => { params: params,
console.log('用户列表', data.items)
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.parentId = element.organizationId
});
this.users = data.items
resolve(data)
})
}) })
return p .subscribe((data: any) => {
console.log('用户列表', data.items);
data.items.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.parentId = element.organizationId;
});
this.users = data.items;
resolve(data);
});
});
return p;
} }
userId userId;
ngOnInit(): void { ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.OrganizationId = JSON.parse(
this.userId = JSON.parse(sessionStorage.getItem('userData')).id sessionStorage.getItem('userData')
let roles = JSON.parse(sessionStorage.getItem('userData')).roles ).organizationId;
let isSupervisor = roles.find(item => { this.userId = JSON.parse(sessionStorage.getItem('userData')).id;
return item.name.indexOf('检查') != -1 let roles = JSON.parse(sessionStorage.getItem('userData')).roles;
}) let isSupervisor = roles.find((item) => {
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false return item.name.indexOf('检查') != -1;
this.selectedMonth = new Date().getMonth() + 1 });
this.getTaskList() isSupervisor ? (this.isSupervisor = true) : (this.isSupervisor = false);
Promise.all([this.getAllOrganization(), this.getSupervisor(), this.getUsers()]) this.selectedMonth = new Date().getMonth() + 1;
.then((results) => { this.getTaskList();
Promise.all([
this.getAllOrganization(),
this.getSupervisor(),
this.getUsers(),
]).then((results) => {
if (this.isSupervisor) { if (this.isSupervisor) {
// let arr = [...this.users, ...this.organizationListAll] // let arr = [...this.users, ...this.organizationListAll]
let arr = [...this.organizationListAll] let arr = [...this.organizationListAll];
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr))) this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)));
} else { } else {
let arr = [...this.supervisorList, ...this.organizationList] let arr = [...this.supervisorList, ...this.organizationList];
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr))) this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)));
} }
}); });
setTimeout(() => { setTimeout(() => {
this.rollStart() this.rollStart();
}, 0); }, 0);
//获得主协调查人员 //获得主协调查人员
this.getSupervisortype('main') this.getSupervisortype('main');
this.getSupervisortype('assisted') this.getSupervisortype('assisted');
} }
timer timer;
rollStart() { rollStart() {
var ROLL_SPEED = 100 var ROLL_SPEED = 100;
var noticeList1 = document.getElementById('notice-list'); var noticeList1 = document.getElementById('notice-list');
var noticeList2 = document.getElementById('notice-list-2'); var noticeList2 = document.getElementById('notice-list-2');
var listWrapper = document.getElementById('list-wrapper'); var listWrapper = document.getElementById('list-wrapper');
@ -246,18 +276,20 @@ export class StationTaskApplyComponent implements OnInit {
this.timer = setInterval(rollStart, ROLL_SPEED); this.timer = setInterval(rollStart, ROLL_SPEED);
function rollStart() { function rollStart() {
if (Math.abs(_subStr(listWrapper.style.top)) >= noticeList1.clientHeight) { if (
listWrapper.style.top = '0px' Math.abs(_subStr(listWrapper.style.top)) >= noticeList1.clientHeight
) {
listWrapper.style.top = '0px';
} else { } else {
var top = listWrapper.style.top var top = listWrapper.style.top;
listWrapper.style.top = _subStr(top) - 1 + 'px' listWrapper.style.top = _subStr(top) - 1 + 'px';
} }
} }
// 截取px前数值 // 截取px前数值
function _subStr(str) { function _subStr(str) {
var index = str.indexOf('px'); var index = str.indexOf('px');
if (index > -1) { if (index > -1) {
return parseFloat(str.substr(0, index + 1)) return parseFloat(str.substr(0, index + 1));
} }
} }
} }
@ -265,20 +297,20 @@ export class StationTaskApplyComponent implements OnInit {
window.clearInterval(this.timer); window.clearInterval(this.timer);
} }
mouseleave() { mouseleave() {
this.rollStart() this.rollStart();
} }
ngOnDestroy(): void { ngOnDestroy(): void {
console.log('退出了') console.log('退出了');
this.mouseEnter() this.mouseEnter();
} }
apply() { apply() {
if (this.nodes.length == 0) { if (this.nodes.length == 0) {
this.message.create('warning', '组织机构为空,请稍后重试'); this.message.create('warning', '组织机构为空,请稍后重试');
return return;
} }
if (this.supervisorList.length == 0) { if (this.supervisorList.length == 0) {
this.message.create('warning', '检查员名单为空,请稍后重试'); this.message.create('warning', '检查员名单为空,请稍后重试');
return return;
} }
const modal = this.modal.create({ const modal = this.modal.create({
nzTitle: '申请', nzTitle: '申请',
@ -287,40 +319,53 @@ export class StationTaskApplyComponent implements OnInit {
nzWidth: 660, nzWidth: 660,
nzMaskClosable: false, nzMaskClosable: false,
nzComponentParams: { nzComponentParams: {
title: this.isSupervisor ? ["联络指导", "双随机"] : ["熟悉演练"], title: this.isSupervisor ? ['联络指导', '双随机'] : ['熟悉演练'],
isSupervisor: this.isSupervisor, isSupervisor: this.isSupervisor,
supervisorList: JSON.parse(JSON.stringify(this.supervisorList)), supervisorList: JSON.parse(JSON.stringify(this.supervisorList)),
organizationList: JSON.parse(JSON.stringify(this.organizationList)), organizationList: JSON.parse(JSON.stringify(this.organizationList)),
users: JSON.parse(JSON.stringify(this.users)), users: JSON.parse(JSON.stringify(this.users)),
nodes: JSON.parse(JSON.stringify(this.nodes)), nodes: JSON.parse(JSON.stringify(this.nodes)),
mainsupervisorList: JSON.parse(JSON.stringify(this.mainsupervisorList)), mainsupervisorList: JSON.parse(JSON.stringify(this.mainsupervisorList)),
assitantsupervisorList: JSON.parse(JSON.stringify(this.assitantsupervisorList)) assitantsupervisorList: JSON.parse(
JSON.stringify(this.assitantsupervisorList)
),
}, },
nzOnOk: async () => { nzOnOk: async () => {
console.log(instance.validateForm.value) console.log(instance.validateForm.value);
if (instance.validateForm.valid && instance.selectedUnitData.id) { if (instance.validateForm.valid && instance.selectedUnitData.id) {
if (instance.taskType == '双随机') { if (instance.taskType == '双随机') {
if (!instance.validateForm.value.main || !instance.validateForm.value.assist) { if (
!instance.validateForm.value.main ||
!instance.validateForm.value.assist
) {
this.message.create('warning', '请填写检查人员!'); this.message.create('warning', '请填写检查人员!');
return false return false;
} }
} }
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
let selectedMonth = this.selectedMonth < 10 ? "0" + this.selectedMonth : this.selectedMonth; let selectedMonth =
let selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01' this.selectedMonth < 10
let supervisorIds ? '0' + this.selectedMonth
let assistantOrganizationIds : this.selectedMonth;
let selectedTime =
this.selectedYear + '-' + selectedMonth + '-' + '01';
let supervisorIds;
let assistantOrganizationIds;
if (this.isSupervisor) { if (this.isSupervisor) {
if (instance.taskType == '双随机') { if (instance.taskType == '双随机') {
supervisorIds = [instance.validateForm.value.main, instance.validateForm.value.assist] supervisorIds = [
instance.validateForm.value.main,
instance.validateForm.value.assist,
];
} else { } else {
supervisorIds = [] supervisorIds = [];
} }
assistantOrganizationIds = instance.validateForm.value.organization assistantOrganizationIds =
instance.validateForm.value.organization;
} else { } else {
supervisorIds = instance.validateForm.value.organization supervisorIds = instance.validateForm.value.organization;
assistantOrganizationIds = [] assistantOrganizationIds = [];
} }
let body = { let body = {
@ -332,36 +377,35 @@ export class StationTaskApplyComponent implements OnInit {
supervisorIds: supervisorIds, supervisorIds: supervisorIds,
assistantOrganizationIds: assistantOrganizationIds, assistantOrganizationIds: assistantOrganizationIds,
creationType: '申领任务', creationType: '申领任务',
approvalStatus: '待处理' approvalStatus: '待处理',
} };
this.http.post('/api/PlanTasks', body).subscribe({ this.http.post('/api/PlanTasks', body).subscribe({
next: (data) => { next: (data) => {
this.message.create('success', '创建成功'); this.message.create('success', '创建成功');
resolve(data) resolve(data);
this.getTaskList() this.getTaskList();
return true return true;
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '创建失败'); this.message.create('warning', '创建失败');
reject(err) reject(err);
return false return false;
} },
}) });
}) });
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create('warning', '请填写完整!');
return false return false;
}
} }
},
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
} }
look(item) { look(item) {
const modal = this.modal.create({ const modal = this.modal.create({
nzTitle: '详情', nzTitle: '详情',
@ -372,44 +416,40 @@ export class StationTaskApplyComponent implements OnInit {
nzComponentParams: { nzComponentParams: {
data: item, data: item,
}, },
nzFooter: null nzFooter: null,
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
} }
//删除任务 //删除任务
deleteTask(item, incomingData) { deleteTask(item, incomingData) {
console.log(item) console.log(item);
console.log(incomingData) console.log(incomingData);
this.modal.confirm({ this.modal.confirm({
nzTitle: `确定要删除该任务吗?`, nzTitle: `确定要删除该任务吗?`,
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'primary', nzOkType: 'primary',
nzOnOk: () => { nzOnOk: () => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe(data => { this.http.delete(`/api/PlanTasks/${item.id}`).subscribe((data) => {
for (let index = 0; index < incomingData.length; index++) { for (let index = 0; index < incomingData.length; index++) {
const element = incomingData[index]; const element = incomingData[index];
if (element.id == item.id) { if (element.id == item.id) {
incomingData.splice(index, 1) incomingData.splice(index, 1);
index-- index--;
} }
} }
this.message.create('success', '删除成功!'); this.message.create('success', '删除成功!');
});
})
}, },
nzCancelText: '取消', nzCancelText: '取消',
nzOnCancel: () => { nzOnCancel: () => {},
}
}); });
} }
//待检查撤销 //待检查撤销
revocationTask(item, taskLIst) { revocationTask(item, taskLIst) {
this.modal.confirm({ this.modal.confirm({
@ -417,21 +457,23 @@ export class StationTaskApplyComponent implements OnInit {
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'default', nzOkType: 'default',
nzOnOk: () => { nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, { this.http
.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: { params: {
approvalStatus: '待处理' approvalStatus: '待处理',
} },
}).subscribe({ })
.subscribe({
next: (data) => { next: (data) => {
this.message.create('success', '已撤销'); this.message.create('success', '已撤销');
item.approvalStatus = '待处理' item.approvalStatus = '待处理';
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '撤销失败'); this.message.create('warning', '撤销失败');
}
})
}, },
nzCancelText: '取消' });
},
nzCancelText: '取消',
}); });
} }
} }
@ -451,5 +493,5 @@ export enum TaskType {
, ,
, ,
, ,
,
} }

5
src/app/home/task/station-task-execution/station-task-execution.component.html

@ -23,9 +23,12 @@
</div> </div>
<div class="timebox"> <div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)"> <nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option> <nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option> <nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select> </nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)" <div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}"> [ngClass]="{'selectedMonth': item.id == selectedMonth}">

389
src/app/home/task/station-task-execution/station-task-execution.component.ts

@ -1,6 +1,15 @@
import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core'; import {
Component,
OnInit,
TemplateRef,
ViewContainerRef,
} from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'; import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNodeOptions,
} from 'ng-zorro-antd/tree';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
@ -12,21 +21,29 @@ import { Router } from '@angular/router';
@Component({ @Component({
selector: 'app-station-task-execution', selector: 'app-station-task-execution',
templateUrl: './station-task-execution.component.html', templateUrl: './station-task-execution.component.html',
styleUrls: ['./station-task-execution.component.scss'] styleUrls: ['./station-task-execution.component.scss'],
}) })
export class StationTaskExecutionComponent implements OnInit { export class StationTaskExecutionComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private router: Router, public methodService: MethodService, private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService) { } constructor(
private router: Router,
public methodService: MethodService,
private fb: FormBuilder,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService,
private http: HttpClient,
private toTree: TreeService
) {}
searchForm = { searchForm = {
taskname: '', taskname: '',
unitname: '', unitname: '',
unitlevel: '', unitlevel: '',
or: '' or: '',
} };
OrganizationId OrganizationId;
isSupervisor: boolean //是否为检查员 isSupervisor: boolean; //是否为检查员
months = [ months = [
{ id: 1, name: '1月', isable: true }, { id: 1, name: '1月', isable: true },
@ -40,18 +57,18 @@ export class StationTaskExecutionComponent implements OnInit {
{ id: 9, name: '9月', isable: true }, { id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true }, { id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true }, { id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true } { id: 12, name: '12月', isable: true },
] ];
selectedMonth selectedMonth;
selectedYear = 2023 selectedYear = new Date().getFullYear();
selectedTime selectedTime;
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.id this.selectedMonth = item.id;
this.getTaskList() this.getTaskList();
} }
selectYear(e) { selectYear(e) {
this.selectedYear = e this.selectedYear = e;
this.getTaskList() this.getTaskList();
} }
cancel(item) { cancel(item) {
@ -60,60 +77,59 @@ export class StationTaskExecutionComponent implements OnInit {
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'default', nzOkType: 'default',
nzOnOk: () => { nzOnOk: () => {
item.isLoading = true item.isLoading = true;
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, { this.http
.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: { params: {
approvalStatus: '驳回' approvalStatus: '驳回',
} },
}).subscribe({ })
.subscribe({
next: (data) => { next: (data) => {
this.getTaskList() this.getTaskList();
this.message.create('success', '已驳回'); this.message.create('success', '已驳回');
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '驳回失败'); this.message.create('warning', '驳回失败');
}
})
}, },
nzCancelText: '取消' });
},
nzCancelText: '取消',
}); });
} }
delete(item) { delete(item) {
console.log(item) console.log(item);
this.modal.confirm({ this.modal.confirm({
nzTitle: `确定要删除该任务吗?`, nzTitle: `确定要删除该任务吗?`,
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'primary', nzOkType: 'primary',
nzOnOk: () => { nzOnOk: () => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe(data => { this.http.delete(`/api/PlanTasks/${item.id}`).subscribe((data) => {
for (let index = 0; index < this.taskLIst.length; index++) { for (let index = 0; index < this.taskLIst.length; index++) {
const element = this.taskLIst[index]; const element = this.taskLIst[index];
if (element.id == item.id) { if (element.id == item.id) {
this.taskLIst.splice(index, 1) this.taskLIst.splice(index, 1);
index-- index--;
} }
} }
this.message.create('success', '删除成功!'); this.message.create('success', '删除成功!');
});
})
}, },
nzCancelText: '取消', nzCancelText: '取消',
nzOnCancel: () => { nzOnCancel: () => {},
}
}); });
} }
isloading = false isloading = false;
totalCount totalCount;
PageNumber = 1 PageNumber = 1;
PageSize = 10 PageSize = 10;
taskLIst = [] taskLIst = [];
getTaskList() { getTaskList() {
this.isloading = true this.isloading = true;
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01' let selectedTime =
this.selectedYear + '-' + this.selectedMonth + '-' + '01';
let params = { let params = {
Month: selectedTime, Month: selectedTime,
// OrganizationId: this.OrganizationId, // OrganizationId: this.OrganizationId,
@ -124,92 +140,97 @@ export class StationTaskExecutionComponent implements OnInit {
AssistantOrganizationId: this.isSupervisor ? null : this.OrganizationId, AssistantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
approvalStatuses: ['待检查', '已检查'], approvalStatuses: ['待检查', '已检查'],
PageNumber: this.PageNumber, PageNumber: this.PageNumber,
PageSize: this.PageSize PageSize: this.PageSize,
} };
this.http.get('/api/PlanTasks', { this.http
params: params .get('/api/PlanTasks', {
}).subscribe((data: any) => { params: params,
this.isloading = false
console.log('任务申请列表', data);
this.totalCount = data.totalCount
this.taskLIst = [...data.items]
}) })
.subscribe((data: any) => {
this.isloading = false;
console.log('任务申请列表', data);
this.totalCount = data.totalCount;
this.taskLIst = [...data.items];
});
} }
pageChange($event) { pageChange($event) {
this.PageNumber = $event this.PageNumber = $event;
this.getTaskList() this.getTaskList();
} }
search() { search() {
this.PageNumber = 1 this.PageNumber = 1;
this.getTaskList() this.getTaskList();
} }
reset() { reset() {
this.PageNumber = 1 this.PageNumber = 1;
this.searchForm = { this.searchForm = {
taskname: '', taskname: '',
unitname: '', unitname: '',
unitlevel: '', unitlevel: '',
or: '' or: '',
} };
this.getTaskList() this.getTaskList();
} }
expandKeys;
expandKeys defaultOrId: string;
defaultOrId: string
//获取所有组织机构 //获取所有组织机构
organizationList: any organizationList: any;
organizationListAll: any organizationListAll: any;
nodes: any = [] nodes: any = [];
async getAllOrganization() { async getAllOrganization() {
let params = { let params = {
ContainsChildren: "true", ContainsChildren: 'true',
PageNumber: 1, PageNumber: 1,
PageSize: 9999 PageSize: 9999,
} };
var p = new Promise<void>((resolve, reject) => { var p = new Promise<void>((resolve, reject) => {
this.http.get('/api/Organizations', { this.http
params: params .get('/api/Organizations', {
}).subscribe((data: any) => { params: params,
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.disableCheckbox = true
element.selectable = false
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items))
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(item => {
return item.level != 'squadron'
})
resolve(data)
}) })
}) .subscribe((data: any) => {
return p data.items.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.disableCheckbox = true;
element.selectable = false;
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items));
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(
(item) => {
return item.level != 'squadron';
}
);
resolve(data);
});
});
return p;
} }
//获得所有检查员 //获得所有检查员
supervisorList = [] supervisorList = [];
mainsupervisorList = [] mainsupervisorList = [];
assitantsupervisorList = [] assitantsupervisorList = [];
async getSupervisor() { async getSupervisor() {
var p = new Promise<void>((resolve, reject) => { var p = new Promise<void>((resolve, reject) => {
this.http.get('/api/Users/Inspectors').subscribe((data: any) => { this.http.get('/api/Users/Inspectors').subscribe((data: any) => {
console.log('检查员列表', data) console.log('检查员列表', data);
data.forEach(element => { data.forEach((element) => {
element.key = element.id element.key = element.id;
element.title = element.name element.title = element.name;
element.parentId = element.organizationId element.parentId = element.organizationId;
}); });
this.supervisorList = data this.supervisorList = data;
resolve(data) resolve(data);
}) });
}) });
return p return p;
} }
//获得除了检查员的其他用户 //获得除了检查员的其他用户
users users;
async getUsers() { async getUsers() {
var p = new Promise<void>((resolve, reject) => { var p = new Promise<void>((resolve, reject) => {
let params = { let params = {
@ -217,69 +238,75 @@ export class StationTaskExecutionComponent implements OnInit {
OrganizationLevel: 'squadron', OrganizationLevel: 'squadron',
ContainsChildren: true, ContainsChildren: true,
PageNumber: 1, PageNumber: 1,
PageSize: 9999 PageSize: 9999,
} };
this.http.get('/api/Users', { this.http
params: params .get('/api/Users', {
}).subscribe((data: any) => { params: params,
console.log('用户列表', data.items)
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.parentId = element.organizationId
});
this.users = data.items
resolve(data)
}) })
}) .subscribe((data: any) => {
return p console.log('用户列表', data.items);
data.items.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.parentId = element.organizationId;
});
this.users = data.items;
resolve(data);
});
});
return p;
} }
userId userId;
time1 time1;
time2 time2;
ngOnInit(): void { ngOnInit(): void {
this.userId = JSON.parse(sessionStorage.getItem('userData')).id this.userId = JSON.parse(sessionStorage.getItem('userData')).id;
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId this.OrganizationId = JSON.parse(
this.userId = JSON.parse(sessionStorage.getItem('userData')).id sessionStorage.getItem('userData')
let roles = JSON.parse(sessionStorage.getItem('userData')).roles ).organizationId;
let isSupervisor = roles.find(item => { this.userId = JSON.parse(sessionStorage.getItem('userData')).id;
return item.name.indexOf('检查') != -1 let roles = JSON.parse(sessionStorage.getItem('userData')).roles;
}) let isSupervisor = roles.find((item) => {
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false return item.name.indexOf('检查') != -1;
this.selectedMonth = new Date().getMonth() + 1 });
this.getTaskList() isSupervisor ? (this.isSupervisor = true) : (this.isSupervisor = false);
Promise.all([this.getAllOrganization(), this.getSupervisor(), this.getUsers()]) this.selectedMonth = new Date().getMonth() + 1;
.then((results) => { this.getTaskList();
Promise.all([
this.getAllOrganization(),
this.getSupervisor(),
this.getUsers(),
]).then((results) => {
if (this.isSupervisor) { if (this.isSupervisor) {
let arr = [...this.users, ...this.organizationListAll] let arr = [...this.users, ...this.organizationListAll];
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr))) this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)));
} else { } else {
let arr = [...this.supervisorList, ...this.organizationList] let arr = [...this.supervisorList, ...this.organizationList];
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr))) this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)));
} }
}); });
setTimeout(() => { setTimeout(() => {
this.rollStart() this.rollStart();
}, 0); }, 0);
let t1 = new Date().getTime();
let t1 = new Date().getTime() let date = '2022-9-10';
let t2 = Date.parse(date);
let date = '2022-9-10'
let t2 = Date.parse(date)
// this.methodService.countdown(t1, t2, (res) => { // this.methodService.countdown(t1, t2, (res) => {
// // console.log(666, res) // // console.log(666, res)
// this.time1 = res.day + '天' + res.hour + '小时' // this.time1 = res.day + '天' + res.hour + '小时'
// }) // })
} }
timer timer;
rollStart() { rollStart() {
var ROLL_SPEED = 100 var ROLL_SPEED = 100;
var noticeList1 = document.getElementById('notice-list'); var noticeList1 = document.getElementById('notice-list');
var noticeList2 = document.getElementById('notice-list-2'); var noticeList2 = document.getElementById('notice-list-2');
var listWrapper = document.getElementById('list-wrapper'); var listWrapper = document.getElementById('list-wrapper');
@ -287,18 +314,20 @@ export class StationTaskExecutionComponent implements OnInit {
this.timer = setInterval(rollStart, ROLL_SPEED); this.timer = setInterval(rollStart, ROLL_SPEED);
function rollStart() { function rollStart() {
if (Math.abs(_subStr(listWrapper.style.top)) >= noticeList1.clientHeight) { if (
listWrapper.style.top = '0px' Math.abs(_subStr(listWrapper.style.top)) >= noticeList1.clientHeight
) {
listWrapper.style.top = '0px';
} else { } else {
var top = listWrapper.style.top var top = listWrapper.style.top;
listWrapper.style.top = _subStr(top) - 1 + 'px' listWrapper.style.top = _subStr(top) - 1 + 'px';
} }
} }
// 截取px前数值 // 截取px前数值
function _subStr(str) { function _subStr(str) {
var index = str.indexOf('px'); var index = str.indexOf('px');
if (index > -1) { if (index > -1) {
return parseFloat(str.substr(0, index + 1)) return parseFloat(str.substr(0, index + 1));
} }
} }
} }
@ -307,28 +336,32 @@ export class StationTaskExecutionComponent implements OnInit {
window.clearInterval(this.timer); window.clearInterval(this.timer);
} }
mouseleave() { mouseleave() {
this.rollStart();
this.rollStart()
} }
ngOnDestroy(): void { ngOnDestroy(): void {
console.log('退出了') console.log('退出了');
this.mouseEnter() this.mouseEnter();
this.methodService.cleartimer() this.methodService.cleartimer();
} }
apply() { apply() {}
}
look(item) { look(item) {
console.log(item) console.log(item);
if (item.approvalStatus == '待检查') { if (item.approvalStatus == '待检查') {
this.message.create('warning', '该单位未检查'); this.message.create('warning', '该单位未检查');
return return;
} }
this.router.navigate(['/task/taskexecution/taskdetails'], { queryParams: { id: item.id, company: item.company.companyName, organization: item.organization.name, legalPersonName: item.company.legalPersonName ? item.company.legalPersonName : '' } }) this.router.navigate(['/task/taskexecution/taskdetails'], {
queryParams: {
id: item.id,
company: item.company.companyName,
organization: item.organization.name,
legalPersonName: item.company.legalPersonName
? item.company.legalPersonName
: '',
},
});
} }
complete(item) { complete(item) {
@ -346,39 +379,41 @@ export class StationTaskExecutionComponent implements OnInit {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
let body = { let body = {
inspectionResult: instance.validateForm.value.result, inspectionResult: instance.validateForm.value.result,
resultAttachment: instance.fileList resultAttachment: instance.fileList,
} };
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({ this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: (data) => { next: (data) => {
this.message.create('success', '已完成'); this.message.create('success', '已完成');
this.getTaskList() this.getTaskList();
resolve(data) resolve(data);
}, },
error: (err) => { error: (err) => {
this.message.create('warning', '完成失败'); this.message.create('warning', '完成失败');
reject(err) reject(err);
} },
}) });
}) });
} else { } else {
this.message.create('warning', '请选择结果!'); this.message.create('warning', '请选择结果!');
return false return false;
}
} }
},
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
} }
ischat = false ischat = false;
taskId taskId;
openchat(item) { openchat(item) {
console.log(item) console.log(item);
this.taskId = item.id this.taskId = item.id;
this.ischat = true this.ischat = true;
} }
closechat() { closechat() {
this.ischat = false this.ischat = false;
} }
} }

2
src/app/home/task/station-task-execution/task-details/task-details.component.html

@ -1,6 +1,6 @@
<div class="bigbox"> <div class="bigbox">
<div class="btnbox"> <div class="btnbox">
<button class="goback" nz-button nzType="primary" (click)="goback()">返回</button> <!-- <button class="goback" nz-button nzType="primary" (click)="goback()">返回</button> -->
<button nz-button nzType="primary" (click)="print()" *ngIf="tabnum == 0" [nzLoading]="isprintLoading">打印表格</button> <button nz-button nzType="primary" (click)="print()" *ngIf="tabnum == 0" [nzLoading]="isprintLoading">打印表格</button>
<button nz-button nzType="primary" (click)="download(1)" *ngIf="tabnum == 1">下载演练卡</button> <button nz-button nzType="primary" (click)="download(1)" *ngIf="tabnum == 1">下载演练卡</button>
<button nz-button nzType="primary" (click)="download(2)" *ngIf="tabnum == 2">下载数字化预案</button> <button nz-button nzType="primary" (click)="download(2)" *ngIf="tabnum == 2">下载数字化预案</button>

5
src/app/home/task/station-weekly-plan/station-weekly-plan.component.html

@ -23,9 +23,12 @@
</div> </div>
<div class="timebox"> <div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)"> <nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option> <nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option> <nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select> </nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)" <div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}"> [ngClass]="{'selectedMonth': item.id == selectedMonth}">

957
src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts

File diff suppressed because it is too large Load Diff

11
src/app/home/task/zhi-audit/zhi-audit.component.html

@ -1,10 +1,13 @@
<!-- <p>任务审批</p> --> <!-- <p>任务审批</p> -->
<div class="box"> <div class="box">
<div class="timebox"> <div class="timebox">
<nz-select ngModel="2022"> <nz-select [(ngModel)]="selectedYear">
<nz-option nzValue="2021" nzLabel="2021年"></nz-option> <nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
<nz-option nzValue="2022" nzLabel="2022年"></nz-option> <nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option nzValue="2023" nzLabel="2023年"></nz-option> <nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select> </nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)" <div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.name == selectedMonth}"> [ngClass]="{'selectedMonth': item.name == selectedMonth}">

101
src/app/home/task/zhi-audit/zhi-audit.component.ts

@ -7,13 +7,18 @@ import { LookTaskComponent } from './look-task/look-task.component';
@Component({ @Component({
selector: 'app-zhi-audit', selector: 'app-zhi-audit',
templateUrl: './zhi-audit.component.html', templateUrl: './zhi-audit.component.html',
styleUrls: ['./zhi-audit.component.scss'] styleUrls: ['./zhi-audit.component.scss'],
}) })
export class ZhiAuditComponent implements OnInit { export class ZhiAuditComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
selectedYear = new Date().getFullYear();
constructor(private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { } constructor(
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef
) {}
months = [ months = [
{ name: '1月', isable: true }, { name: '1月', isable: true },
@ -27,14 +32,13 @@ export class ZhiAuditComponent implements OnInit {
{ name: '9月', isable: true }, { name: '9月', isable: true },
{ name: '10月', isable: true }, { name: '10月', isable: true },
{ name: '11月', isable: true }, { name: '11月', isable: true },
{ name: '12月', isable: true } { name: '12月', isable: true },
] ];
selectedMonth selectedMonth;
selectMonth(item) { selectMonth(item) {
this.selectedMonth = item.name this.selectedMonth = item.name;
} }
// 双随机 // 双随机
doubleRandom = { doubleRandom = {
isExpand: true, //卡片展开 isExpand: true, //卡片展开
@ -44,9 +48,12 @@ export class ZhiAuditComponent implements OnInit {
search2: '', //选择单位气泡卡片---组织选择列表 search2: '', //选择单位气泡卡片---组织选择列表
search2Value: [], search2Value: [],
selectedMenu: 1, //选择单位气泡卡片 selectedMenu: 1, //选择单位气泡卡片
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],//表格数据 data: [
nodes: [] 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
} 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
], //表格数据
nodes: [],
};
// 熟悉演练 // 熟悉演练
rehearsal = { rehearsal = {
@ -57,11 +64,14 @@ export class ZhiAuditComponent implements OnInit {
search2: '', //选择单位气泡卡片---组织选择列表 search2: '', //选择单位气泡卡片---组织选择列表
search2Value: [], search2Value: [],
selectedMenu: 1, //选择单位气泡卡片 selectedMenu: 1, //选择单位气泡卡片
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],//表格数据 data: [
nodes: [] 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
} 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
], //表格数据
nodes: [],
};
isPopover(data) { isPopover(data) {
data.isPopover = !data.isPopover data.isPopover = !data.isPopover;
} }
//搜索框提交 //搜索框提交
submitForm(value): void { submitForm(value): void {
@ -69,55 +79,57 @@ export class ZhiAuditComponent implements OnInit {
} }
// 弹出 tab // 弹出 tab
popoverMenuSelect(data, type) { popoverMenuSelect(data, type) {
data.selectedMenu = type data.selectedMenu = type;
} }
expand(data) { expand(data) {
data.isExpand = !data.isExpand data.isExpand = !data.isExpand;
} }
ngOnInit(): void { ngOnInit(): void {
this.getAllOrganization() this.getAllOrganization();
} }
nzExpandAll = false; nzExpandAll = false;
totalCount: string totalCount: string;
allOrList: any allOrList: any;
nodes nodes;
getAllOrganization() { getAllOrganization() {
let params = { let params = {
ContainsChildren: "true", ContainsChildren: 'true',
PageNumber: 1, PageNumber: 1,
PageSize: 9999 PageSize: 9999,
} };
this.http.get('/api/Organizations', { this.http
params: params .get('/api/Organizations', {
}).subscribe((data: any) => { params: params,
this.totalCount = data.totalCount })
data.items.forEach(element => { .subscribe((data: any) => {
element.key = element.id this.totalCount = data.totalCount;
element.title = element.name data.items.forEach((element) => {
element.selectable = false element.key = element.id;
element.title = element.name;
element.selectable = false;
}); });
this.allOrList = data.items this.allOrList = data.items;
this.nodes = [...this.toTree.toTree(data.items)] this.nodes = [...this.toTree.toTree(data.items)];
this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes)) this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes));
this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes)) this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes));
}) });
} }
orcheckbox(data, $event, node) { orcheckbox(data, $event, node) {
if ($event) { if ($event) {
data.search2Value.push(node.origin.name) data.search2Value.push(node.origin.name);
} else { } else {
for (let index = 0; index < data.search2Value.length; index++) { for (let index = 0; index < data.search2Value.length; index++) {
const element = data.search2Value[index]; const element = data.search2Value[index];
if (element == node.origin.name) { if (element == node.origin.name) {
data.search2Value.splice(index, 1) data.search2Value.splice(index, 1);
} }
} }
} }
console.log(data.search2Value) console.log(data.search2Value);
} }
lookTask() { lookTask() {
@ -127,12 +139,13 @@ export class ZhiAuditComponent implements OnInit {
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzFooter: null, nzFooter: null,
nzWidth: 800, nzWidth: 800,
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000)) nzOnOk: () => new Promise((resolve) => setTimeout(resolve, 1000)),
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
// Return a result when closed // Return a result when closed
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
} }
} }

989
src/app/home/task/zhi-indicators/dist/zhi-indicators.component.js vendored

@ -0,0 +1,989 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
exports.__esModule = true;
exports.ZhiIndicatorsComponent = void 0;
var core_1 = require("@angular/core");
var rxjs_1 = require("rxjs");
var operators_1 = require("rxjs/operators"); // 引入debounceTime、Subject
var edit_or_component_1 = require("./edit-or/edit-or.component");
var allot_person_component_1 = require("../da-subordinate-audit/allot-person/allot-person.component");
var ZhiIndicatorsComponent = /** @class */ (function () {
function ZhiIndicatorsComponent(ngZone, fb, http, toTree, message, modal, viewContainerRef) {
this.ngZone = ngZone;
this.fb = fb;
this.http = http;
this.toTree = toTree;
this.message = message;
this.modal = modal;
this.viewContainerRef = viewContainerRef;
this.valueChange = new rxjs_1.Subject();
this.targetCount = new rxjs_1.Subject();
this.months = [
{ id: 1, name: '1月', isable: true },
{ id: 2, name: '2月', isable: true },
{ id: 3, name: '3月', isable: true },
{ id: 4, name: '4月', isable: true },
{ id: 5, name: '5月', isable: true },
{ id: 6, name: '6月', isable: true },
{ id: 7, name: '7月', isable: true },
{ id: 8, name: '8月', isable: true },
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true },
];
this.selectedYear = 2024;
//投诉举报
this.complaint = {
name: '投诉举报',
allocated: 0,
isExpand: true,
isPopover: false,
isLoading: false,
search1: '',
search1Value: [],
search2: '',
search2Value: [],
searchAll: [],
selectedMenu: 1,
data: [],
nodes: [],
nodes2: [],
isnodes: true,
unitList: []
};
//行政许可
this.permission = {
name: '行政许可',
allocated: 0,
isExpand: true,
isPopover: false,
isLoading: false,
search1: '',
search1Value: [],
search2: '',
search2Value: [],
searchAll: [],
selectedMenu: 1,
data: [],
nodes: [],
nodes2: [],
isnodes: true,
unitList: []
};
// 双随机
this.doubleRandom = {
name: '双随机',
allocated: 0,
allPlanTasks: 0,
isExpand: true,
isPopover: false,
isLoading: false,
search1: '',
search1Value: [],
search2: '',
search2Value: [],
searchAll: [],
selectedMenu: 1,
data: [],
nodes: [],
nodes2: [],
isnodes: true,
unitList: []
};
// 熟悉演练
this.rehearsal = {
name: '熟悉演练',
allocated: 0,
allPlanTasks: 0,
isExpand: true,
isPopover: false,
isLoading: false,
search1: '',
search1Value: [],
search2: '',
search2Value: [],
searchAll: [],
selectedMenu: 1,
data: [],
nodes: [],
nodes2: [],
isnodes: true,
unitList: []
};
this.unitList = [];
this.PageNumber = 1;
this.moreDataLoading = false;
this.iszhanxun = false;
}
ZhiIndicatorsComponent.prototype.saveItem = function () { };
ZhiIndicatorsComponent.prototype.selectMonth = function (item) {
console.log('选择月份');
this.selectedMonth = item.id;
this.initializeData();
this.getTaskList('投诉举报');
this.getTaskList('行政许可');
this.getTaskTarget('双随机');
this.getTaskTarget('熟悉演练');
};
ZhiIndicatorsComponent.prototype.selectYear = function (e) {
console.log('选择年份');
this.selectedYear = e;
this.initializeData();
this.getTaskList('投诉举报');
this.getTaskList('行政许可');
this.getTaskTarget('双随机');
this.getTaskTarget('熟悉演练');
};
ZhiIndicatorsComponent.prototype.initializeData = function () {
this.complaint.isExpand = true;
this.complaint.isPopover = false;
this.complaint.isLoading = false;
this.complaint.search1 = '';
this.complaint.search1Value = [];
this.complaint.search2 = '';
this.complaint.search2Value = [];
this.complaint.selectedMenu = 1;
this.complaint.data = [];
this.permission.isExpand = true;
this.permission.isPopover = false;
this.permission.isLoading = false;
this.permission.search1 = '';
this.permission.search1Value = [];
this.permission.search2 = '';
this.permission.search2Value = [];
this.permission.selectedMenu = 1;
this.permission.data = [];
this.doubleRandom.isExpand = true;
this.doubleRandom.isPopover = false;
this.doubleRandom.isLoading = false;
this.doubleRandom.search1 = '';
this.doubleRandom.search1Value = [];
this.doubleRandom.search2 = '';
this.doubleRandom.search2Value = [];
this.doubleRandom.selectedMenu = 1;
this.doubleRandom.data = [];
this.rehearsal.isExpand = true;
this.rehearsal.isPopover = false;
this.rehearsal.isLoading = false;
this.rehearsal.search1 = '';
this.rehearsal.search1Value = [];
this.rehearsal.search2 = '';
this.rehearsal.search2Value = [];
this.rehearsal.selectedMenu = 1;
this.rehearsal.data = [];
};
ZhiIndicatorsComponent.prototype.log = function (data) {
var arr = [];
data.unitList.forEach(function (item) {
item.checked ? arr.push(item.id) : null;
});
data.search1Value = arr;
};
ZhiIndicatorsComponent.prototype.isPopover = function (data) {
console.log(data);
data.isPopover = !data.isPopover;
data.unitList.forEach(function (element) {
element.checked = false;
});
};
// 弹出 tab
ZhiIndicatorsComponent.prototype.popoverMenuSelect = function (data, type) {
data.selectedMenu = type;
};
ZhiIndicatorsComponent.prototype.expand = function (data) {
data.isExpand = !data.isExpand;
};
//搜索框提交
ZhiIndicatorsComponent.prototype.submitForm = function (data) {
data.unitList = [];
this.PageNumber = 1;
this.getCompanies(data);
};
ZhiIndicatorsComponent.prototype.getCompanies = function (incomingData) {
return __awaiter(this, void 0, void 0, function () {
var params;
var _this = this;
return __generator(this, function (_a) {
params = {
CompanyName: incomingData ? incomingData.search1 : '',
PageNumber: this.PageNumber,
PageSize: 50
};
return [2 /*return*/, new Promise(function (resolve, reject) {
_this.http
.get('/api/Companies', {
params: params
})
.subscribe(function (data) {
_this.moreDataLoading = false;
_this.totalCount = data.totalCount;
data.items.forEach(function (element) {
element.label = element.companyName;
element.value = element.id;
element.parentId = element.organizationId;
element.key = element.id;
element.title = element.companyName;
element.level = 4;
});
_this.unitList = data.items;
// if (incomingData && incomingData.name == '投诉举报') {
// this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList))
// } else if (incomingData && incomingData.name == '行政许可') {
// this.permission.unitList = JSON.parse(JSON.stringify(this.unitList))
// } else if (incomingData && incomingData.name == '双随机') {
// this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList))
// } else if (incomingData && incomingData.name == '熟悉演练') {
// this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList))
// } else {
// this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList))
// this.permission.unitList = JSON.parse(JSON.stringify(this.unitList))
// this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList))
// this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList))
// }
_this.complaint.unitList = _this.complaint.unitList.concat(JSON.parse(JSON.stringify(data.items)));
_this.complaint.unitList = __spreadArrays(_this.complaint.unitList);
_this.permission.unitList = _this.permission.unitList.concat(JSON.parse(JSON.stringify(data.items)));
_this.permission.unitList = __spreadArrays(_this.permission.unitList);
_this.doubleRandom.unitList = _this.doubleRandom.unitList.concat(JSON.parse(JSON.stringify(data.items)));
_this.doubleRandom.unitList = __spreadArrays(_this.doubleRandom.unitList);
_this.rehearsal.unitList = _this.rehearsal.unitList.concat(JSON.parse(JSON.stringify(data.items)));
_this.rehearsal.unitList = __spreadArrays(_this.rehearsal.unitList);
resolve(data);
});
})];
});
});
};
ZhiIndicatorsComponent.prototype.moreData = function () {
this.moreDataLoading = true;
this.PageNumber += 1;
this.getCompanies();
};
ZhiIndicatorsComponent.prototype.getAllOrganization = function () {
return __awaiter(this, void 0, void 0, function () {
var params;
var _this = this;
return __generator(this, function (_a) {
params = {
ContainsChildren: 'true',
PageNumber: 1,
PageSize: 9999,
code: '0000'
};
return [2 /*return*/, new Promise(function (resolve, reject) {
_this.http
.get('/api/Organizations', {
params: params
})
.subscribe(function (data) {
data.items.forEach(function (element) {
element.key = element.id;
element.title = element.name;
element.selectable = false;
element.disableCheckbox = true;
element.datatype = '机构';
element.level == 'squadron'
? (element.disableCheckbox = false)
: null;
});
_this.allOrList = JSON.parse(JSON.stringify(data.items));
_this.nodes = __spreadArrays(_this.toTree.toTree(JSON.parse(JSON.stringify(data.items))));
_this.complaint.nodes = JSON.parse(JSON.stringify(_this.nodes));
_this.permission.nodes = JSON.parse(JSON.stringify(_this.nodes));
_this.doubleRandom.nodes = JSON.parse(JSON.stringify(_this.nodes));
_this.rehearsal.nodes = JSON.parse(JSON.stringify(_this.nodes));
resolve(data);
});
})];
});
});
};
ZhiIndicatorsComponent.prototype.getUsers = function () {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
var params = {
OrganizationId: _this.OrganizationId,
OrganizationLevel: 'squadron',
ContainsChildren: true,
PageNumber: 1,
PageSize: 9999
};
_this.http
.get('/api/Users', {
params: params
})
.subscribe(function (data) {
console.log('用户列表', data.items);
data.items.forEach(function (element) {
element.key = element.id;
element.title = element.name;
element.parentId = element.organizationId;
});
_this.users = data.items;
resolve(data);
});
})];
});
});
};
ZhiIndicatorsComponent.prototype.editOr = function (incomingData, item) {
var _this = this;
var modal = this.modal.create({
nzTitle: '修改协助机构',
nzContent: edit_or_component_1.EditOrComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
selectedData: __spreadArrays(item.supervisorIds, item.assistantOrganizationIds),
organizationList: JSON.parse(JSON.stringify(this.allOrList)),
// users: JSON.parse(JSON.stringify(this.users)),
supervisorList: __spreadArrays(JSON.parse(JSON.stringify(this.assitantsupervisorList)), JSON.parse(JSON.stringify(this.mainsupervisorList)))
},
nzOnOk: function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!instance.validateForm.valid) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
console.log(instance.nzTreeComponent.getCheckedNodeList());
var supervisorIds = [];
var assistantOrganizationIds = [];
instance.nzTreeComponent.getCheckedNodeList().forEach(function (item) {
item.origin.datatype == '机构'
? assistantOrganizationIds.push(item.key)
: supervisorIds.push(item.key);
});
var body = {
supervisorIds: supervisorIds,
assistantOrganizationIds: assistantOrganizationIds
};
_this.http.patch("/api/PlanTasks/" + item.id, body).subscribe({
next: function (data) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.message.create('success', '修改成功');
incomingData.name == '投诉举报'
? this.getTaskList('投诉举报')
: null;
incomingData.name == '行政许可'
? this.getTaskList('行政许可')
: null;
resolve(data);
return [2 /*return*/];
});
}); },
error: function (err) {
_this.message.create('warning', '修改失败');
reject(err);
}
});
})];
case 1:
_a.sent();
return [3 /*break*/, 3];
case 2:
this.message.create('warning', '请填写完整!');
return [2 /*return*/, false];
case 3: return [2 /*return*/];
}
});
}); }
});
var instance = modal.getContentComponent();
modal.afterOpen.subscribe(function () { return console.log('[afterOpen] emitted!'); });
modal.afterClose.subscribe(function (result) {
return console.log('[afterClose] The result is:', result);
});
};
ZhiIndicatorsComponent.prototype.orcheckbox = function (data, $event, node) {
if ($event) {
data.search2Value.push(node.origin.id);
}
else {
for (var index = 0; index < data.search2Value.length; index++) {
var element = data.search2Value[index];
if (element == node.origin.id) {
data.search2Value.splice(index, 1);
index--;
}
}
}
console.log(data.search2Value);
};
ZhiIndicatorsComponent.prototype.ngOnInit = function () {
var _this = this;
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId;
this.selectedMonth = new Date().getMonth() + 1;
//说明保存防抖
this.valueChange.pipe(operators_1.debounceTime(1000)).subscribe(function (item) {
var body = {
description: item.description
};
return new Promise(function (resolve, reject) {
_this.http.patch("/api/PlanTasks/" + item.id, body).subscribe({
next: function (data) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.message.create('success', '实时保存成功');
resolve(data);
return [2 /*return*/];
});
}); },
error: function (err) {
_this.message.create('warning', '保存失败');
reject(err);
}
});
});
});
//任务额保存防抖
this.targetCount.pipe(operators_1.debounceTime(1000)).subscribe(function (item) {
// console.log(item)
var body = {
targetCount: item.targetCount
};
return new Promise(function (resolve, reject) {
_this.http.patch("/api/TaskTargets/" + item.id, body).subscribe({
next: function (data) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.message.create('success', '修改任务额成功');
resolve(data);
return [2 /*return*/];
});
}); },
error: function (err) {
_this.message.create('warning', '修改任务额失败');
reject(err);
}
});
});
});
// this.getUsers()
this.getCompanies();
this.getAllOrganization();
// Promise.all([this.getCompanies(), this.getAllOrganization()])
// .then((results) => {
// let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))]
// this.nodes = [...this.toTree.toTree(arr)]
// this.complaint.nodes = JSON.parse(JSON.stringify(this.nodes))
// this.permission.nodes = JSON.parse(JSON.stringify(this.nodes))
// this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes))
// this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes))
// });
this.getTaskList('投诉举报');
this.getTaskList('行政许可');
this.getTaskTarget('双随机');
this.getTaskTarget('熟悉演练');
//获得主协调查人员
this.getSupervisor('main');
this.getSupervisor('assisted');
var roles = JSON.parse(sessionStorage.getItem('userData')).roles;
var iszhanxun = roles.find(function (item) {
return item.name.indexOf('战训') != -1;
});
if (iszhanxun) {
this.iszhanxun = true;
}
console.log('iszhanxun', iszhanxun);
};
//投诉举报/行政许可 选择单位 确认按钮
ZhiIndicatorsComponent.prototype.selectedUnit = function (data, type) {
var _this = this;
var arr = __spreadArrays(data.search1Value, data.search2Value);
var arrSet = __spreadArrays(new Set(arr));
data.isLoading = true;
var selectedMonth = this.selectedMonth < 10 ? '0' + this.selectedMonth : this.selectedMonth;
var selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01';
this.http
.post("/api/PlanTasks/Many", null, {
params: {
month: selectedTime,
companyIds: arrSet,
taskType: type
}
})
.subscribe({
next: function (item) {
data.isLoading = false;
data.isPopover = false;
_this.message.create('success', '共创建' +
arrSet.length +
'条任务' +
',成功创建' +
item.length +
'条,剩余' +
(arrSet.length - item.length) +
'个单位已被创建');
type == '投诉举报' ? _this.getTaskList('投诉举报', data) : null;
type == '行政许可' ? _this.getTaskList('行政许可', data) : null;
},
error: function (err) {
data.isLoading = false;
_this.message.create('warning', '创建失败');
}
});
};
//双随机/熟悉演练 选择单位 确认按钮
ZhiIndicatorsComponent.prototype.selectedUnit2 = function (data, type) {
var _this = this;
var selectedMonth = this.selectedMonth < 10 ? '0' + this.selectedMonth : this.selectedMonth;
var selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01';
var arr = __spreadArrays(data.search1Value, data.search2Value);
var body = __spreadArrays(new Set(arr));
data.isLoading = true;
this.http
.post("/api/TaskTargets/" + selectedTime, body, {
params: {
taskType: type
}
})
.subscribe({
next: function (item) {
data.isLoading = false;
data.isPopover = false;
_this.message.create('success', '共创建' +
body.length +
'条任务' +
',成功创建' +
item.length +
'条,剩余' +
(body.length - item.length) +
'个单位已被创建');
type == '双随机' ? _this.getTaskTarget('双随机', data) : null;
type == '熟悉演练' ? _this.getTaskTarget('熟悉演练', data) : null;
},
error: function (err) {
data.isLoading = false;
_this.message.create('warning', '创建失败');
}
});
};
ZhiIndicatorsComponent.prototype.getTaskTarget = function (TaskType, carddata) {
return __awaiter(this, void 0, void 0, function () {
var selectedTime, params;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
TaskType == '双随机'
? (this.doubleRandom.isLoading = true)
: (this.rehearsal.isLoading = true);
selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01';
params = {
taskType: TaskType
};
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.http
.get("/api/TaskTargets/" + selectedTime, {
params: params
})
.subscribe(function (data) {
_this.ngZone.run(function () {
//这里写需要立即渲染的代码
TaskType == '双随机'
? (_this.doubleRandom.isLoading = false)
: (_this.rehearsal.isLoading = false);
console.log(TaskType + '任务指标列表', data);
TaskType == '双随机' ? (_this.doubleRandom.allocated = 0) : null;
TaskType == '熟悉演练' ? (_this.rehearsal.allocated = 0) : null;
TaskType == '双随机' ? (_this.doubleRandom.allPlanTasks = 0) : null;
TaskType == '熟悉演练' ? (_this.rehearsal.allPlanTasks = 0) : null;
TaskType == '双随机' ? (_this.doubleRandom.data = data) : null;
TaskType == '熟悉演练' ? (_this.rehearsal.data = data) : null;
data.forEach(function (element) {
if (element.planTasks) {
if (TaskType == '双随机') {
_this.doubleRandom.allPlanTasks += element.planTasks.length;
}
if (TaskType == '熟悉演练') {
_this.rehearsal.allPlanTasks += element.planTasks.length;
}
element.planTasks.forEach(function (item) {
if (item.approvalStatus == '通过') {
TaskType == '双随机'
? (_this.doubleRandom.allocated += 1)
: null;
TaskType == '熟悉演练'
? (_this.rehearsal.allocated += 1)
: null;
}
});
}
});
});
resolve(data);
});
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
ZhiIndicatorsComponent.prototype.getTaskList = function (TaskType, carddata) {
return __awaiter(this, void 0, void 0, function () {
var selectedTime, params;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
TaskType == '投诉举报'
? (this.complaint.isLoading = true)
: (this.permission.isLoading = true);
selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01';
params = {
Month: selectedTime,
OrganizationId: this.OrganizationId,
TaskType: TaskType,
PageNumber: 1,
PageSize: 99999
};
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.http
.get('/api/PlanTasks', {
params: params
})
.subscribe(function (data) {
_this.ngZone.run(function () {
//这里写需要立即渲染的代码
console.log(TaskType + '任务列表', data.items);
TaskType == '投诉举报'
? (_this.complaint.isLoading = false)
: (_this.permission.isLoading = false);
TaskType == '投诉举报' ? (_this.complaint.allocated = 0) : null;
TaskType == '行政许可' ? (_this.permission.allocated = 0) : null;
TaskType == '投诉举报' ? (_this.complaint.data = data.items) : null;
TaskType == '行政许可' ? (_this.permission.data = data.items) : null;
data.items.forEach(function (item) {
if (item.approvalStatus == '通过') {
TaskType == '投诉举报' ? (_this.complaint.allocated += 1) : null;
TaskType == '行政许可'
? (_this.permission.allocated += 1)
: null;
}
});
});
resolve(data);
});
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
//修改任务描述
ZhiIndicatorsComponent.prototype.taskDescChange = function (incomingData, item) {
this.valueChange.next(item);
};
//修改任务额
ZhiIndicatorsComponent.prototype.targetCountChange = function (incomingData, item, e) {
this.targetCount.next(item);
};
ZhiIndicatorsComponent.prototype.ngOnDestroy = function () {
// console.log('毁灭了')
// this.doubleRandom.isPopover = false
};
ZhiIndicatorsComponent.prototype.onExpandChange = function (e) {
var node = e.node;
if (node &&
node.getChildren().length === 0 &&
node.isExpanded &&
node.origin.level == 'squadron') {
this.loadNode(node.origin.id).then(function (data) {
node.addChildren(data);
});
}
else {
node.isLoading = false;
}
};
ZhiIndicatorsComponent.prototype.loadNode = function (id) {
var _this = this;
return new Promise(function (resolve) {
var params = {
OrganizationId: id,
PageNumber: 1,
PageSize: 9999
};
_this.http
.get('/api/Companies', {
params: params
})
.subscribe(function (data) {
console.log(data.items);
data.items.forEach(function (element) {
element.key = element.id;
element.title = element.companyName;
element.level = 4;
element.isLeaf = true;
});
resolve(data.items);
});
});
};
ZhiIndicatorsComponent.prototype.getCompaniesByName = function (incomingData) {
return __awaiter(this, void 0, void 0, function () {
var params_1;
var _this = this;
return __generator(this, function (_a) {
// incomingData.search2Value
console.log(incomingData.search2Value);
if (incomingData.search2) {
incomingData.isnodes = false;
params_1 = {
CompanyName: incomingData.search2,
PageNumber: this.PageNumber,
PageSize: 9999
};
return [2 /*return*/, new Promise(function (resolve, reject) {
_this.http
.get('/api/Companies', {
params: params_1
})
.subscribe(function (data) {
_this.moreDataLoading = false;
_this.totalCount = data.totalCount;
data.items.forEach(function (element) {
element.label = element.companyName;
element.value = element.id;
element.parentId = element.organizationId;
element.key = element.id;
element.title = element.companyName;
element.level = 4;
element.isLeaf = true;
incomingData.search2Value.forEach(function (item) {
item == element.id ? (element.isChecked = true) : null;
});
});
if (data.items.length == 0) {
_this.message.create('warning', '没有查询到任何单位');
incomingData.isnodes = true;
return;
}
var allOrList = JSON.parse(JSON.stringify(_this.allOrList));
allOrList.forEach(function (element) {
element.expanded = true;
});
var arr = __spreadArrays(allOrList, data.items);
incomingData.nodes2 = __spreadArrays(_this.toTree.toTree(arr));
resolve(data);
});
})];
}
else {
incomingData.isnodes = true;
}
return [2 /*return*/];
});
});
};
ZhiIndicatorsComponent.prototype.getSupervisor = function (type) {
var _this = this;
var params = {
inspectorType: type
};
this.http
.get('/api/Users/Inspectors', {
params: params
})
.subscribe(function (data) {
console.log('检查员列表', data);
data.forEach(function (element) {
element.parentId = element.organizationId;
element.key = element.id;
element.title = element.name;
element.selectable = false;
element.disableCheckbox = false;
element.datatype = '人员';
});
if (type == 'main') {
_this.mainsupervisorList = data;
}
else {
_this.assitantsupervisorList = data;
}
});
};
ZhiIndicatorsComponent.prototype.allot = function (item, type) {
var _this = this;
console.log(item);
if (this.mainsupervisorList.length == 0 ||
this.assitantsupervisorList.length == 0) {
this.message.create('warning', '请从用户管理添加检查人员');
return;
}
var modal = this.modal.create({
nzTitle: '分配监督检查员',
nzContent: allot_person_component_1.AllotPersonComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 485,
nzMaskClosable: false,
nzComponentParams: {
mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList
},
nzOnOk: function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!instance.validateForm.valid) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
var body = {
supervisorIds: [
instance.validateForm.value.main,
instance.validateForm.value.assitant,
]
};
_this.http.patch("/api/PlanTasks/" + item.id, body).subscribe({
next: function (data) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.message.create('success', '分配成功');
this.getTaskTarget(type);
resolve(data);
return [2 /*return*/, true];
});
}); },
error: function (err) {
_this.message.create('warning', '分配失败');
reject(err);
return false;
}
});
})];
case 1:
_a.sent();
return [3 /*break*/, 3];
case 2:
this.message.create('warning', '请填写完整!');
return [2 /*return*/, false];
case 3: return [2 /*return*/];
}
});
}); }
});
var instance = modal.getContentComponent();
modal.afterOpen.subscribe(function () { return console.log('[afterOpen] emitted!'); });
modal.afterClose.subscribe(function (result) {
return console.log('[afterClose] The result is:', result);
});
};
ZhiIndicatorsComponent.prototype.distribute = function (item, type) {
var _this = this;
this.modal.confirm({
nzTitle: "\u786E\u5B9A\u8981\u6D3E\u53D1\u8BE5\u4EFB\u52A1\u5417?",
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: function () {
item.isLoading = true;
_this.http
.post("/api/PlanTasks/Approval/" + item.id, null, {
params: {
approvalStatus: '待检查'
}
})
.subscribe({
next: function (data) {
_this.message.create('success', '已派发');
item.approvalStatus = '待检查';
item.isLoading = false;
item.passed += 1;
type == '投诉举报' ? (_this.complaint.allocated += 1) : null;
type == '行政许可' ? (_this.permission.allocated += 1) : null;
type == '双随机' ? (_this.doubleRandom.allocated += 1) : null;
type == '熟悉演练' ? (_this.rehearsal.allocated += 1) : null;
},
error: function (err) {
_this.message.create('warning', '派发失败');
item.isLoading = false;
}
});
},
nzCancelText: '取消'
});
};
//删除任务
ZhiIndicatorsComponent.prototype.deleteTask = function (item, incomingData) {
var _this = this;
console.log(item);
console.log(incomingData);
this.modal.confirm({
nzTitle: "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u4EFB\u52A1\u5417?",
nzOkText: '确定',
nzOkType: 'primary',
nzOnOk: function () {
_this.http["delete"]("/api/PlanTasks/" + item.id).subscribe(function (data) {
var originaldata;
if (item.taskType == '投诉举报' || item.taskType == '行政许可') {
_this.getTaskList(item.taskType);
}
if (item.taskType == '双随机' || item.taskType == '熟悉演练') {
_this.getTaskTarget(item.taskType);
}
_this.message.create('success', '删除成功!');
});
},
nzCancelText: '取消',
nzOnCancel: function () { }
});
};
ZhiIndicatorsComponent = __decorate([
core_1.Component({
selector: 'app-zhi-indicators',
templateUrl: './zhi-indicators.component.html',
styleUrls: ['./zhi-indicators.component.scss']
})
], ZhiIndicatorsComponent);
return ZhiIndicatorsComponent;
}());
exports.ZhiIndicatorsComponent = ZhiIndicatorsComponent;

5
src/app/home/task/zhi-indicators/zhi-indicators.component.html

@ -2,9 +2,12 @@
<div class="box"> <div class="box">
<div class="timebox"> <div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)"> <nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option> <nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option> <nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select> </nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)" <div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}"> [ngClass]="{'selectedMonth': item.id == selectedMonth}">

2
src/app/home/task/zhi-indicators/zhi-indicators.component.ts

@ -52,7 +52,7 @@ export class ZhiIndicatorsComponent implements OnInit {
{ id: 12, name: '12月', isable: true }, { id: 12, name: '12月', isable: true },
]; ];
selectedMonth; selectedMonth;
selectedYear = 2023; selectedYear = new Date().getFullYear();
selectedTime; selectedTime;
selectMonth(item) { selectMonth(item) {
console.log('选择月份'); console.log('选择月份');

BIN
src/assets/images/tdt/end.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

BIN
src/assets/images/tdt/start.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

6
src/index.html

@ -20,12 +20,12 @@
<script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script> <script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script> <script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.print.js"></script> <script type="text/javascript" src="/assets/wordexport/jquery.print.js"></script>
<!-- <script type="text/javascript"> <script type="text/javascript">
window._AMapSecurityConfig = { window._AMapSecurityConfig = {
securityJsCode: '0afa0b144398727fad2ca06f5f7156b3' securityJsCode: '0afa0b144398727fad2ca06f5f7156b3'
} }
</script> </script>
<script src="https://webapi.amap.com/maps?v=2.0&key=17bb9b27e49451cde8f2e6655b11ff1a"></script> <script src="https://webapi.amap.com/maps?v=2.0&key=17bb9b27e49451cde8f2e6655b11ff1a"></script>
<script src="https://webapi.amap.com/ui/1.1/main.js?v=1.1.1"></script> --> <script src="https://webapi.amap.com/ui/1.1/main.js?v=1.1.1"></script>
<script src="http://api.tianditu.gov.cn/api?v=4.0&tk=3027d4c8ed89bd8a185a9b73dbf3dcad" type="text/javascript"></script>
</html> </html>
Loading…
Cancel
Save