lsjl.vue 7.8 KB

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