lsjl.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <div class="tpwjxm">
  3. <el-row>
  4. <el-col :span="13">
  5. <!-- datetimerange value-format="yyyy-MM-dd" :clearable="false"align="left" -->
  6. <el-date-picker
  7. v-model="pageObj.sj"
  8. type="daterange"
  9. value-format="yyyy-MM-dd"
  10. range-separator="~"
  11. start-placeholder="开始日期"
  12. end-placeholder="结束日期"
  13. class="datepicker"
  14. size="mini"
  15. @change="changedate"
  16. >
  17. </el-date-picker>
  18. </el-col>
  19. <el-col :span="1">
  20. <div class="max-width" style="height: 10px"></div>
  21. </el-col>
  22. <el-col :span="10">
  23. <el-input
  24. v-model="pageObj.xmmc"
  25. placeholder="请输入项目名称"
  26. class="input-style"
  27. size="mini"
  28. @input="changeForm"
  29. >
  30. <i slot="suffix" class="el-input__icon el-icon-search"></i>
  31. <!-- <el-button slot="append" icon="el-icon-search"></el-button> -->
  32. </el-input>
  33. </el-col>
  34. </el-row>
  35. <div
  36. class="listDiv"
  37. v-infinite-scroll="infiniteScroll"
  38. :infinite-scroll-disabled="listdisabled"
  39. >
  40. <div
  41. class="dataItem"
  42. v-for="(item, dindex) in datalist"
  43. :class="now == item.bsm ? 'dataItemHight' : ''"
  44. :key="item.bsm"
  45. @click="zoomItem(item)"
  46. >
  47. <!-- <div>{{ dindex + 1 }}. 项目名称:{{ item.xmmc }}</div> -->
  48. <div class="index">{{ dindex + 1 }}</div>
  49. <div class="nameTitle">{{ item.xmmc }}</div>
  50. <div>建设单位:{{ item.jsdw }}</div>
  51. <div class="item_bottom">
  52. <el-tag type="warning" v-if="item.rwzt == 0">创建</el-tag>
  53. <el-tag v-if="item.rwzt == 1">执行中</el-tag>
  54. <el-tag type="success" v-if="item.rwzt == 2">完成</el-tag>
  55. <el-tag type="danger" v-if="item.rwzt == 3">错误</el-tag>
  56. <div>
  57. <span class="button" @click.stop="checkRz(item)">日志</span>
  58. <span class="button" @click="checkDetails(item)">结果</span>
  59. <span class="button" v-if="item.fxbg && type == 'hgxfx'" @click.stop="report(item)"
  60. >报告</span
  61. >
  62. <span
  63. class="button"
  64. @click.stop="del(item)"
  65. v-if="item.rwzt == 2 || item.rwzt == 3 || item.rwzt == 99"
  66. >删除</span
  67. >
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. <script>
  75. import parse from "wellknown";
  76. import { GetPage, Delect } from "@/api/ghss/hgxfx.js";
  77. import { Message, MessageBox } from "element-ui";
  78. import { rest } from "lodash";
  79. import { GetXzResList, DelXzRes ,DownloadReport} from "../../../api/ghss/ghxz.js";
  80. let dataSources;
  81. export default {
  82. props: {
  83. historyList: {
  84. type: Array,
  85. },
  86. type: {
  87. type: String,
  88. },
  89. recordBsm: {
  90. type: String,
  91. },
  92. },
  93. data() {
  94. return {
  95. pageObj: {
  96. kssj: "",
  97. sj: [],
  98. jssj: "",
  99. xmmc: "",
  100. page: 1,
  101. },
  102. defaultTime1: [
  103. new Date(2023, 1, 1, 0, 0, 0),
  104. new Date(2023, 2, 1, 23, 59, 59),
  105. ], // '00:00:00', '23:59:59'
  106. datalist: [],
  107. listdisabled: false,
  108. now: "",
  109. // recordBsm: "", //辅助选址成功后的标识码
  110. };
  111. },
  112. mounted() {
  113. // this.getData();
  114. // this.bus.$on("recordBsm", (val) => {
  115. // console.log(val, "recordBsm");
  116. // this.recordBsm = val
  117. // });
  118. },
  119. methods: {
  120. report(item) {
  121. // window.open(item.fxbg.replace(".docx", ".pdf"), "_blank");
  122. window.open(window.axiosURI + '/analyse/fzss/DownloadReport?filePath='+`${item.fxbg}`);
  123. },
  124. del(item) {
  125. MessageBox.confirm(
  126. "该操作将会删除此数据且不可恢复,您确定要删除吗?",
  127. "提示",
  128. {
  129. confirmButtonText: "确定",
  130. cancelButtonText: "取消",
  131. type: "warning",
  132. }
  133. )
  134. .then(() => {
  135. if (this.$props.type == "hgxfx") {
  136. Delect({ bsm: item.bsm }).then((res) => {
  137. if (res.success) {
  138. Message.success("删除成功!");
  139. this.changeForm();
  140. }
  141. });
  142. } else {
  143. DelXzRes({ bsm: item.bsm }).then((res) => {
  144. if (res.success) {
  145. Message.success("删除成功!");
  146. this.changeForm();
  147. }
  148. });
  149. }
  150. })
  151. .catch(() => {});
  152. },
  153. checkDetails(item) {
  154. this.$emit("updateParent", "nowObj", item);
  155. let next = this.$props.type == "hgxfx" ? "scjg" : "xzjg";
  156. this.$emit("updateParent", "activeTabs", next);
  157. if (this.$props.type != "hgxfx") {
  158. this.$emit("updateParent", "rwBsm", item.bsm);
  159. }
  160. },
  161. checkRz(item) {
  162. this.$emit("updateParent", "nowObj", item);
  163. this.$emit("updateParent", "rzBsm", item.bsm);
  164. },
  165. infiniteScroll() {
  166. this.pageObj.page += 1;
  167. this.listdisabled = true;
  168. this.$emit("updateParent", "loading", true);
  169. setTimeout(() => {
  170. this.getData();
  171. }, 500);
  172. },
  173. changeForm() {
  174. this.pageObj.page = 1;
  175. this.datalist = [];
  176. this.getData();
  177. },
  178. changedate(val) {
  179. if (val) {
  180. this.pageObj.kssj = this.pageObj.sj[0];
  181. this.pageObj.jssj = this.pageObj.sj[1];
  182. } else {
  183. this.pageObj.kssj = "";
  184. this.pageObj.jssj = "";
  185. }
  186. this.changeForm();
  187. },
  188. getData() {
  189. this.$emit("updateParent", "loading", true);
  190. if (this.$props.type == "hgxfx") {
  191. GetPage({ ...this.pageObj }).then((res) => {
  192. setTimeout(() => {
  193. this.$emit("updateParent", "loading", false);
  194. }, 100);
  195. this.listdisabled = res.data.length < 10;
  196. this.datalist = [...this.datalist, ...res.data];
  197. });
  198. } else {
  199. let tempObj = { ...this.pageObj };
  200. let obj = {
  201. startTime: tempObj.kssj,
  202. endTime: tempObj.jssj,
  203. name: tempObj.xmmc,
  204. pageNum: 1,
  205. pageSize: 10,
  206. };
  207. GetXzResList(obj).then((res) => {
  208. setTimeout(() => {
  209. this.$emit("updateParent", "loading", false);
  210. }, 100);
  211. this.listdisabled = res.data.items.length < 10;
  212. this.datalist = [...this.datalist, ...res.data.items];
  213. });
  214. }
  215. },
  216. zoomItem(item) {
  217. this.now = item.bsm;
  218. this.addPolygon(parse(item.geom));
  219. },
  220. // 加载GeoJSON数据
  221. addPolygon(geojson) {
  222. this.reset();
  223. let polygon = Cesium.GeoJsonDataSource.load(geojson, {
  224. clampToGround: true,
  225. stroke: Cesium.Color.RED,
  226. fill: Cesium.Color.WHITE.withAlpha(0.3),
  227. strokeWidth: 5,
  228. });
  229. polygon.then(function (dataSource) {
  230. dataSources = dataSource;
  231. viewer.dataSources.add(dataSource);
  232. viewer.zoomTo(dataSource);
  233. });
  234. },
  235. reset() {
  236. if (dataSources) viewer.dataSources.remove(dataSources);
  237. dataSources = undefined;
  238. },
  239. },
  240. watch: {},
  241. beforeDestroy() {
  242. this.pageObj = {
  243. kssj: "",
  244. sj: [],
  245. jssj: "",
  246. xmmc: "",
  247. page: 1,
  248. };
  249. },
  250. };
  251. </script>
  252. <style lang="scss" scoped>
  253. .tpwjxm {
  254. width: 100%;
  255. height: 100%;
  256. .el-form-item {
  257. margin-bottom: 5px;
  258. }
  259. .datepicker {
  260. width: 100% !important;
  261. span {
  262. display: flex;
  263. align-items: center;
  264. }
  265. }
  266. .el-icon-search {
  267. color: #20a0fc;
  268. }
  269. .listDiv {
  270. width: 100%;
  271. height: calc(100% - 40px);
  272. padding-top: 10px;
  273. padding-right: 10px;
  274. overflow-x: hidden;
  275. overflow-y: auto;
  276. color: #fff;
  277. .dataItem {
  278. height: 80px;
  279. border-bottom: 1px solid #667e8f;
  280. padding-left: 30px;
  281. position: relative;
  282. margin-bottom: 10px;
  283. color: #cddeeb;
  284. line-height: 20px;
  285. }
  286. .dataItem:hover,
  287. .dataItemHight {
  288. // border: 1px solid #02a7f0;
  289. background-color: rgba(64, 158, 255, 0.2);
  290. }
  291. .index {
  292. width: 30px;
  293. height: 100%;
  294. line-height: 70px;
  295. font-weight: bold;
  296. font-size: 16px;
  297. color: #ffffff;
  298. text-align: center;
  299. position: absolute;
  300. left: 0;
  301. }
  302. .nameTitle {
  303. color: #ffffff;
  304. font-size: 16px;
  305. line-height: 24px;
  306. }
  307. .item_bottom {
  308. display: flex;
  309. justify-content: space-between;
  310. margin-top: 5px;
  311. .el-tag {
  312. // margin-top: 14px;
  313. width: 48px;
  314. height: 18px;
  315. line-height: 18px;
  316. position: absolute;
  317. top: 0;
  318. right: 0;
  319. color: #fff;
  320. border-radius: 0px 0px 2px 14px;
  321. border-color: transparent;
  322. }
  323. .el-tag--success {
  324. background: linear-gradient(
  325. 170deg,
  326. rgba(0, 200, 128, 0.6) 0%,
  327. rgba(155, 255, 139, 0.7) 100%
  328. );
  329. }
  330. .el-tag--warning {
  331. background: linear-gradient(
  332. 170deg,
  333. rgba(249, 180, 71, 0.6) 0%,
  334. rgba(249, 180, 71, 0.6) 100%
  335. );
  336. }
  337. .el-tag--light {
  338. background: linear-gradient(
  339. 170deg,
  340. rgba(255, 126, 33, 0.6) 0%,
  341. rgba(255, 166, 33, 0.7) 100%
  342. );
  343. }
  344. .el-tag--danger {
  345. background: linear-gradient(
  346. 170deg,
  347. rgba(200, 0, 0, 0.6) 0%,
  348. rgba(255, 105, 105, 0.6) 100%
  349. );
  350. }
  351. .button {
  352. width: 48px;
  353. height: 20px;
  354. font-size: 14px;
  355. line-height: 20px;
  356. color: #b6e0ff;
  357. text-align: center;
  358. display: inline-block;
  359. background-image: url("/static/images/ghzc/btnbg.png");
  360. background-size: 100% 100%;
  361. cursor: pointer;
  362. margin-right: 8px;
  363. }
  364. }
  365. }
  366. }
  367. </style>
  368. <style lang="scss">
  369. @import "../../cockpit/datePicker.scss";
  370. </style>