lsjl.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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" @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 } 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. },
  123. del(item) {
  124. MessageBox.confirm(
  125. "该操作将会删除此数据且不可恢复,您确定要删除吗?",
  126. "提示",
  127. {
  128. confirmButtonText: "确定",
  129. cancelButtonText: "取消",
  130. type: "warning",
  131. }
  132. )
  133. .then(() => {
  134. if (this.$props.type == "hgxfx") {
  135. Delect({ bsm: item.bsm }).then((res) => {
  136. if (res.success) {
  137. Message.success("删除成功!");
  138. this.changeForm();
  139. }
  140. });
  141. } else {
  142. DelXzRes({ bsm: item.bsm }).then((res) => {
  143. if (res.success) {
  144. Message.success("删除成功!");
  145. this.changeForm();
  146. }
  147. });
  148. }
  149. })
  150. .catch(() => {});
  151. },
  152. checkDetails(item) {
  153. this.$emit("updateParent", "nowObj", item);
  154. let next = this.$props.type == "hgxfx" ? "scjg" : "xzjg";
  155. this.$emit("updateParent", "activeTabs", next);
  156. if (this.$props.type != "hgxfx") {
  157. this.$emit("updateParent", "rwBsm", item.bsm);
  158. }
  159. },
  160. checkRz(item) {
  161. this.$emit("updateParent", "nowObj", item);
  162. this.$emit("updateParent", "rzBsm", item.bsm);
  163. },
  164. infiniteScroll() {
  165. this.pageObj.page += 1;
  166. this.listdisabled = true;
  167. this.$emit("updateParent", "loading", true);
  168. setTimeout(() => {
  169. this.getData();
  170. }, 500);
  171. },
  172. changeForm() {
  173. this.pageObj.page = 1;
  174. this.datalist = [];
  175. this.getData();
  176. },
  177. changedate(val) {
  178. if (val) {
  179. this.pageObj.kssj = this.pageObj.sj[0];
  180. this.pageObj.jssj = this.pageObj.sj[1];
  181. } else {
  182. this.pageObj.kssj = "";
  183. this.pageObj.jssj = "";
  184. }
  185. this.changeForm();
  186. },
  187. getData() {
  188. this.$emit("updateParent", "loading", true);
  189. if (this.$props.type == "hgxfx") {
  190. GetPage({ ...this.pageObj }).then((res) => {
  191. setTimeout(() => {
  192. this.$emit("updateParent", "loading", false);
  193. }, 100);
  194. this.listdisabled = res.data.length < 10;
  195. this.datalist = [...this.datalist, ...res.data];
  196. });
  197. } else {
  198. let tempObj = { ...this.pageObj };
  199. let obj = {
  200. startTime: tempObj.kssj,
  201. endTime: tempObj.jssj,
  202. name: tempObj.xmmc,
  203. pageNum: 1,
  204. pageSize: 10,
  205. };
  206. GetXzResList(obj).then((res) => {
  207. setTimeout(() => {
  208. this.$emit("updateParent", "loading", false);
  209. }, 100);
  210. this.listdisabled = res.data.items.length < 10;
  211. this.datalist = [...this.datalist, ...res.data.items];
  212. });
  213. }
  214. },
  215. zoomItem(item) {
  216. this.now = item.bsm;
  217. this.addPolygon(parse(item.geom));
  218. },
  219. // 加载GeoJSON数据
  220. addPolygon(geojson) {
  221. this.reset();
  222. let polygon = Cesium.GeoJsonDataSource.load(geojson, {
  223. clampToGround: true,
  224. stroke: Cesium.Color.RED,
  225. fill: Cesium.Color.WHITE.withAlpha(0.3),
  226. strokeWidth: 5,
  227. });
  228. polygon.then(function (dataSource) {
  229. dataSources = dataSource;
  230. viewer.dataSources.add(dataSource);
  231. viewer.zoomTo(dataSource);
  232. });
  233. },
  234. reset() {
  235. if (dataSources) viewer.dataSources.remove(dataSources);
  236. dataSources = undefined;
  237. },
  238. },
  239. watch: {},
  240. beforeDestroy() {
  241. this.pageObj = {
  242. kssj: "",
  243. sj: [],
  244. jssj: "",
  245. xmmc: "",
  246. page: 1,
  247. };
  248. },
  249. };
  250. </script>
  251. <style lang="scss" scoped>
  252. .tpwjxm {
  253. width: 100%;
  254. height: 100%;
  255. .el-form-item {
  256. margin-bottom: 5px;
  257. }
  258. .datepicker {
  259. width: 100% !important;
  260. span {
  261. display: flex;
  262. align-items: center;
  263. }
  264. }
  265. .el-icon-search {
  266. color: #20a0fc;
  267. }
  268. .listDiv {
  269. width: 100%;
  270. height: calc(100% - 40px);
  271. padding-top: 10px;
  272. padding-right: 10px;
  273. overflow-x: hidden;
  274. overflow-y: auto;
  275. color: #fff;
  276. .dataItem {
  277. height: 80px;
  278. border-bottom: 1px solid #667e8f;
  279. padding-left: 30px;
  280. position: relative;
  281. margin-bottom: 10px;
  282. color: #cddeeb;
  283. line-height: 20px;
  284. }
  285. .dataItem:hover,
  286. .dataItemHight {
  287. // border: 1px solid #02a7f0;
  288. background-color: rgba(64, 158, 255, 0.2);
  289. }
  290. .index {
  291. width: 30px;
  292. height: 100%;
  293. line-height: 70px;
  294. font-weight: bold;
  295. font-size: 16px;
  296. color: #ffffff;
  297. text-align: center;
  298. position: absolute;
  299. left: 0;
  300. }
  301. .nameTitle {
  302. color: #ffffff;
  303. font-size: 16px;
  304. line-height: 24px;
  305. }
  306. .item_bottom {
  307. display: flex;
  308. justify-content: space-between;
  309. margin-top: 5px;
  310. .el-tag {
  311. // margin-top: 14px;
  312. width: 48px;
  313. height: 18px;
  314. line-height: 18px;
  315. position: absolute;
  316. top: 0;
  317. right: 0;
  318. color: #fff;
  319. border-radius: 0px 0px 2px 14px;
  320. border-color: transparent;
  321. }
  322. .el-tag--success {
  323. background: linear-gradient(
  324. 170deg,
  325. rgba(0, 200, 128, 0.6) 0%,
  326. rgba(155, 255, 139, 0.7) 100%
  327. );
  328. }
  329. .el-tag--warning {
  330. background: linear-gradient(
  331. 170deg,
  332. rgba(249, 180, 71, 0.6) 0%,
  333. rgba(249, 180, 71, 0.6) 100%
  334. );
  335. }
  336. .el-tag--light {
  337. background: linear-gradient(
  338. 170deg,
  339. rgba(255, 126, 33, 0.6) 0%,
  340. rgba(255, 166, 33, 0.7) 100%
  341. );
  342. }
  343. .el-tag--danger {
  344. background: linear-gradient(
  345. 170deg,
  346. rgba(200, 0, 0, 0.6) 0%,
  347. rgba(255, 105, 105, 0.6) 100%
  348. );
  349. }
  350. .button {
  351. width: 48px;
  352. height: 20px;
  353. font-size: 14px;
  354. line-height: 20px;
  355. color: #b6e0ff;
  356. text-align: center;
  357. display: inline-block;
  358. background-image: url("/static/images/ghzc/btnbg.png");
  359. background-size: 100% 100%;
  360. cursor: pointer;
  361. margin-right: 8px;
  362. }
  363. }
  364. }
  365. }
  366. </style>
  367. <style lang="scss">
  368. @import "../../cockpit/datePicker.scss";
  369. </style>