list.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <div class="xzlist">
  3. <div v-if="type == 1" class="xztype">
  4. <span :class="{ usable: pageObj.isConfirm }" @click="changerdxz">
  5. 认定为闲置未处置情况
  6. </span>
  7. <span :class="{ usable: !pageObj.isConfirm }" @click="changerdxz">
  8. 认定为未非闲置情况
  9. </span>
  10. </div>
  11. <custom-form ref="formRef" :model="pageObj" :config="formConfig">
  12. <template #region>
  13. <!-- clearable -->
  14. <el-cascader
  15. v-model="pageObj.xzqh"
  16. :show-all-levels="false"
  17. :options="store.state.region_tree"
  18. placeholder="行政区"
  19. :props="{
  20. checkStrictly: true,
  21. expandTrigger: 'hover',
  22. emitPath: false,
  23. }"
  24. ></el-cascader>
  25. </template>
  26. <template #type>
  27. <el-select v-model="pageObj.idleReason" placeholder="闲置原因">
  28. <el-option
  29. v-for="item in reasonList"
  30. :key="item.code"
  31. :label="item.name"
  32. :value="item.name"
  33. >
  34. </el-option>
  35. </el-select>
  36. </template>
  37. <template #action>
  38. <el-button
  39. size="mini"
  40. type="primary"
  41. icon="el-icon-search"
  42. @click="searchFun"
  43. >
  44. </el-button>
  45. </template>
  46. </custom-form>
  47. <div class="content">
  48. <div class="item">
  49. <p>项目数(个)</p>
  50. <span>{{ table.total || 0 }} </span>
  51. </div>
  52. <div class="item">
  53. <p>土地面积(亩)</p>
  54. <span>{{ table.area || 0 }} </span>
  55. </div>
  56. </div>
  57. <tablePage
  58. :class="'tablePage' + type"
  59. :cloumn="cloumn"
  60. :table="table"
  61. :indexed="false"
  62. :showTotal="false"
  63. layout="prev, pager,next"
  64. ref="tableDialogRef"
  65. @currentChange="searchFun"
  66. >
  67. <template #mj="{ row }">
  68. {{ Number(row.crmj).toFixed(2) }}
  69. </template>
  70. <template #action="{ row }">
  71. <span class="usable" @click="detail(row)">详情</span>
  72. <span class="usable" v-if="type == 0" @click="judge(row)"> 判定 </span>
  73. <span class="usable" v-if="type == 1" @click="handle(row)"> 处置 </span>
  74. </template>
  75. </tablePage>
  76. <div class="tip" v-if="type == 0">
  77. 说明:系统判断疑似闲置的条件(合同约定开工之日起仍未开工的项目)
  78. </div>
  79. <handleModal ref="handleRef" @close="searchFun()"></handleModal>
  80. </div>
  81. </template>
  82. <script>
  83. import tablePage from "@/components/mapView/tablePage.vue";
  84. import customForm from "@/components/mapView/custom-form.vue";
  85. import handleModal from "./handleModal.vue";
  86. import { GetList, idleLandList } from "@/api/Idleland.js";
  87. import {
  88. ysForm,
  89. xzForm,
  90. TableHeader,
  91. TableHeader2,
  92. reasonList,
  93. } from "./config";
  94. import { loadGeoJSON } from "@/utils/MapHelper/help.js";
  95. let geoSources = {};
  96. export default {
  97. components: {
  98. tablePage,
  99. customForm,
  100. handleModal,
  101. },
  102. props: {
  103. type: {
  104. type: String,
  105. },
  106. recordBsm: {
  107. type: String,
  108. },
  109. },
  110. data() {
  111. return {
  112. pageObj: {
  113. key: "",
  114. xzqh: "",
  115. idleReason: "",
  116. isConfirm: true,
  117. pageNum: 1,
  118. pageSize: 10,
  119. isDisposal: false,
  120. startTime: "",
  121. endTime: "",
  122. },
  123. datalist: [{}],
  124. formConfig: ysForm,
  125. cloumn: TableHeader,
  126. reasonList: reasonList,
  127. table: {
  128. data: [],
  129. total: 20,
  130. },
  131. now: "",
  132. tempdataLayerId: "",
  133. };
  134. },
  135. mounted() {
  136. this.formConfig = this.$props.type == 0 ? ysForm : xzForm;
  137. this.cloumn = this.$props.type == 0 ? TableHeader : TableHeader2;
  138. this.reset();
  139. },
  140. methods: {
  141. searchFun(page = {}) {
  142. this.getTableData({
  143. ...this.pageObj,
  144. pageNum: page.pageIndex || 1,
  145. pageSize: page.size || 10,
  146. });
  147. },
  148. getTableData() {
  149. this.$emit("updateParent", "loading", true);
  150. this.removeGeoJSON();
  151. if (this.$props.type == 0) {
  152. GetList(this.pageObj).then((res) => {
  153. this.$emit("updateParent", "loading", false);
  154. this.table = {
  155. ...res.data,
  156. total: res.data.count,
  157. data: res.data.list,
  158. };
  159. this.active_tableData(res.data.list);
  160. });
  161. } else {
  162. idleLandList(this.pageObj).then((res) => {
  163. this.$emit("updateParent", "loading", false);
  164. this.table = {
  165. ...res.data,
  166. total: res.data.count,
  167. data: res.data.list,
  168. };
  169. this.active_tableData(res.data.list);
  170. });
  171. }
  172. },
  173. tableRowClassName({ row, rowIndex }) {
  174. // if (rowIndex === this.scrollTop_index) {
  175. // return "warning-row";
  176. // }
  177. // return "";
  178. },
  179. active_tableData(newVal) {
  180. newVal.forEach((res, index) => {
  181. if (res.geom || res.st_asewkt)
  182. loadGeoJSON(
  183. res.geom || res.st_asewkt,
  184. "#55A1E3",
  185. { isfly: false },
  186. (data) => {
  187. geoSources[res.id] = data;
  188. data.name = "Idleland";
  189. data.entities.values.forEach((entity) => {
  190. entity.properties = { type: "图斑上图", id: res.id };
  191. });
  192. }
  193. );
  194. });
  195. },
  196. flyTo(item) {
  197. let id = "h_" + item.id;
  198. this.tempdataLayerId = id;
  199. if (geoSources[id]) return;
  200. loadGeoJSON(
  201. item.geom || item.st_asewkt,
  202. "#ff0000",
  203. { isfly: true },
  204. (data) => {
  205. data.name = "Idleland";
  206. geoSources[id] = data;
  207. data.entities.values.forEach((entity) => {
  208. entity.properties = { type: "图斑上图", id: item.id };
  209. });
  210. }
  211. );
  212. },
  213. removeGeoJSON() {
  214. if (!window.viewer) return;
  215. viewer.entities.removeAll();
  216. viewer.dataSources.removeAll();
  217. // viewer.dataSources._dataSources.forEach((das) => {
  218. // if (das.name == "Idleland") {viewer.dataSources.remove(das);}
  219. // });
  220. },
  221. reset(xzqh) {
  222. this.pageObj = {
  223. key: "",
  224. xzqh,
  225. idleReason: "",
  226. isConfirm: this.$props.type != 0,
  227. pageNum: 1,
  228. pageSize: 10,
  229. isDisposal: this.$props.type == 2,
  230. // startTime: store.state.cockpit_date[0],
  231. // endTime: store.state.cockpit_date[1],
  232. };
  233. },
  234. detail(row) {
  235. this.flyTo(row);
  236. this.bus.$emit("handleView", row, this.$props.type);
  237. },
  238. judge(row) {
  239. this.$refs.handleRef.Init(row, "judge");
  240. },
  241. handle(row) {
  242. this.$refs.handleRef.Init(row, "deal");
  243. },
  244. changerdxz() {
  245. this.pageObj.isConfirm = !this.pageObj.isConfirm;
  246. this.searchFun();
  247. },
  248. },
  249. watch: {
  250. tempdataLayerId(newVal, oldVal) {
  251. if (oldVal && geoSources[oldVal]) {
  252. viewer.dataSources.remove(geoSources[oldVal]);
  253. geoSources[oldVal] = null;
  254. }
  255. },
  256. },
  257. beforeDestroy() {},
  258. };
  259. </script>
  260. <style lang="scss" scoped>
  261. .xzlist {
  262. width: 100%;
  263. height: 100%;
  264. .content {
  265. width: 100%;
  266. height: 50px;
  267. margin: 10px 0;
  268. background: #2e5a70;
  269. border-radius: 5px;
  270. padding-top: 5px;
  271. .item {
  272. width: 48%;
  273. height: 100%;
  274. display: inline-block;
  275. position: relative;
  276. text-align: center;
  277. span {
  278. font-family: "Arial Negreta", "Arial Normal", "Arial";
  279. font-weight: 700;
  280. font-style: normal;
  281. color: #68f4fb;
  282. }
  283. }
  284. }
  285. .tablePage0,
  286. .tablePage1 {
  287. height: calc(100% - 160px);
  288. }
  289. .tablePage2 {
  290. height: calc(100% - 120px);
  291. }
  292. .tip {
  293. color: #f56c6c;
  294. }
  295. .xztype {
  296. display: flex;
  297. margin: 5px 0;
  298. align-items: center;
  299. justify-content: space-between;
  300. span {
  301. display: inline-block;
  302. border: 1px solid #3f93f5;
  303. border-radius: 5px;
  304. padding: 0 10px;
  305. line-height: 30px;
  306. }
  307. }
  308. }
  309. </style>
  310. <style lang="scss">
  311. .xzlist {
  312. .el-col {
  313. padding-right: 0 !important;
  314. }
  315. }
  316. </style>