index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <!--山水工程列表-->
  2. <template>
  3. <div class="ghzc LandscapeProject">
  4. <Boxcommon :islist="islist">
  5. <template v-slot:title>
  6. <span class="clearBtn" @click="changeType">
  7. 切换到工程{{ islist ? "总览" : "列表" }}
  8. </span>
  9. </template>
  10. <template v-slot:all>
  11. <div class="xz_box" v-show="!islist">
  12. <div class="content">
  13. <div class="item" v-for="(sd, index) in sdlist" :key="index">
  14. <div class="icon">
  15. <div class="iicon" :class="sd.value"></div>
  16. </div>
  17. <div class="text">
  18. <span>{{ sdata[sd.prop] || 0 }} </span>{{ sd.unit }}
  19. <p>{{ sd.name }}</p>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="echartlist">
  24. <div v-for="(eitem, i) in echarts" :key="i" class="echars">
  25. <div class="echartTitle">
  26. <div class="block-title">{{ eitem.label }}</div>
  27. <div class="selectTab">
  28. <el-select
  29. v-if="i == 0"
  30. v-model="tab"
  31. placeholder="请选择"
  32. :popper-append-to-body="false"
  33. @change="changeCharts"
  34. >
  35. <el-option
  36. v-for="item in sdlist"
  37. :key="item.value"
  38. :label="item.name"
  39. :value="item.value"
  40. >
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <!-- <div
  45. class="eicon"
  46. :class="eitem.isshow ? 'eshow' : 'eclose'"
  47. @click="eitem.isshow = !eitem.isshow"
  48. ></div> -->
  49. </div>
  50. <!-- v-show="eitem.isshow" -->
  51. <ThreeStackedBarAndLine
  52. v-if="i == 1"
  53. class="echart"
  54. ref="echartRef1"
  55. ></ThreeStackedBarAndLine>
  56. <pie
  57. v-else-if="i == 2"
  58. unit="亿元"
  59. class="echart"
  60. ref="echartRef2"
  61. ></pie>
  62. <div v-else class="echart"></div>
  63. <!-- <bar class="echart" :ref="`echartRef${i}`"></bar> -->
  64. </div>
  65. </div>
  66. </div>
  67. </template>
  68. </Boxcommon>
  69. <div
  70. class="sm-panel sm-function-module-query"
  71. v-if="store.state.vectorData.length > 0"
  72. v-drag
  73. >
  74. <div class="sm-panel-header">
  75. <span>山水工程详情</span>
  76. </div>
  77. <el-tabs
  78. type="border-card"
  79. class="xz_box info"
  80. v-model="activeTabs"
  81. stretch
  82. >
  83. <el-tab-pane label="基本信息" name="base">
  84. <CockpitVector></CockpitVector>
  85. </el-tab-pane>
  86. <el-tab-pane label="全过程管理信息" name="qgc"> </el-tab-pane>
  87. </el-tabs>
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import pie from "@/components/echartsTemplate/pie.vue";
  93. import bar from "@/components/echartsTemplate/bar.vue";
  94. import ThreeStackedBarAndLine from "@/views/cockpit/common/ThreeStackedBarAndLine.vue";
  95. import Boxcommon from "@/views/cockpit/common/VectorSpace/BoxCommonVector.vue";
  96. import CockpitVector from "@/components/Query/clickQuery/CockpitVector.vue";
  97. import { QueryOne, QueryList } from "../../api/cockpitNew";
  98. export default {
  99. name: "LandscapeProject",
  100. components: {
  101. Boxcommon,
  102. pie,
  103. bar,
  104. ThreeStackedBarAndLine,
  105. CockpitVector,
  106. },
  107. data() {
  108. return {
  109. islist: true,
  110. sdata: {},
  111. sdlist: [
  112. { name: "项目数", prop: "xzqhdm_number", unit: "个", value: "num" },
  113. { name: "治理面积", prop: "zlmj", unit: "公顷", value: "mj" },
  114. { name: "总投资", prop: "tzje", unit: "亿元", value: "ztz" },
  115. ],
  116. echarts: [
  117. { label: "工程类型", isshow: false },
  118. { label: "工程进度", isshow: false },
  119. { label: "计划总投资", isshow: false },
  120. { label: "资金筹措情况", isshow: false },
  121. { label: "工程成效", isshow: false },
  122. ],
  123. tab: "num",
  124. activeTabs: "base",
  125. jdData: {
  126. legend_data: ["治理面积(公顷)", "项目数量", "投资金额(亿元)"],
  127. x_data: [],
  128. line_data: [],
  129. },
  130. };
  131. },
  132. created() {},
  133. mounted() {
  134. this.getData();
  135. },
  136. methods: {
  137. changeData(name, updata) {
  138. this[name] = updata;
  139. },
  140. draw_vector() {
  141. store.setCockpit_vector({
  142. title: "山水工程项目",
  143. word: "项目名称",
  144. mapType: "jsc_stxf_ssxf_layer",
  145. tableData: [],
  146. tablejscType: `jsc_stxf_ywlx_ssxfmx`,
  147. columns: [
  148. "项目名称",
  149. "治理面积(公顷)",
  150. "投资金额(万元)",
  151. "区县编码",
  152. "区县编码名称",
  153. "治理时间",
  154. "治理进度",
  155. "备注",
  156. ],
  157. });
  158. },
  159. changeType() {
  160. this.islist = !this.islist;
  161. if (!this.islist) {
  162. this.echarts.forEach((ei, i) => {
  163. // let a = {
  164. // xData: ["===a"],
  165. // yData: [10],
  166. // };
  167. // this.setEchart(a, i);
  168. });
  169. }
  170. },
  171. getData() {
  172. this.draw_vector();
  173. this.GetQueryOne();
  174. this.GetQueryList();
  175. this.GetSumList();
  176. },
  177. GetQueryOne() {
  178. let params = {
  179. jscType: `jsc_stxf_ztgh_ssxf`,
  180. id: 4602,
  181. };
  182. QueryOne(params).then((res) => {
  183. this.sdata = res.data || {};
  184. });
  185. },
  186. GetQueryList() {
  187. this.jdData.x_data = [];
  188. this.jdData.line_data = [];
  189. this.jdData.result = [[], []];
  190. let params = { jscType: `jsc_stxf_ssxf_jdfq`, id: 4602 };
  191. QueryList(params).then((res) => {
  192. res.data.forEach((jdData) => {
  193. this.jdData.x_data.push(jdData.dj);
  194. this.jdData.line_data.push(jdData.zlmj);
  195. this.jdData.result[0].push(jdData.dj_number);
  196. this.jdData.result[1].push(jdData.tzje);
  197. });
  198. this.setEchart(this.jdData, 1);
  199. });
  200. },
  201. GetSumList() {
  202. let data = [
  203. { name: "中央资金", value: "13.45" },
  204. { name: "省级资金", value: "5" },
  205. { name: "市级资金", value: "18.67" },
  206. ];
  207. this.setEchart({ data, type: '"horizontal"', total: 37.12 }, 2);
  208. },
  209. setEchart(data, id) {
  210. this.$nextTick(() => {
  211. this.$refs[`echartRef${id}`][0].setOptions(data);
  212. });
  213. },
  214. },
  215. watch: {
  216. // activeTabs(newValue) {},
  217. },
  218. };
  219. </script>
  220. <style lang="scss" scoped>
  221. .LandscapeProject {
  222. .clearBtn {
  223. padding: 0 10px;
  224. border-radius: 4px;
  225. cursor: pointer;
  226. width: 130px;
  227. background-color: #3f94f53f;
  228. border: 1px solid #3f93f5;
  229. color: #b6e0ff;
  230. position: absolute;
  231. top: 6px;
  232. right: 20px;
  233. line-height: 26px;
  234. &:hover {
  235. font-weight: bold;
  236. }
  237. }
  238. .content {
  239. width: 100%;
  240. height: 100px;
  241. .item {
  242. width: 32%;
  243. height: 100px;
  244. display: inline-block;
  245. // border: #00FFFF 1px solid;
  246. position: relative;
  247. .icon {
  248. width: 100%;
  249. height: 50px;
  250. display: flex;
  251. justify-content: space-between;
  252. }
  253. .iicon {
  254. background: no-repeat 50%;
  255. background-image: url("/static/images/overview/icon_yrkkg.png");
  256. width: 45px;
  257. height: 45px;
  258. flex: 1;
  259. }
  260. .num {
  261. background-image: url("/static/images/overview/icon_yrkkg.png");
  262. }
  263. .mj {
  264. background-image: url("/static/images/overview/icon_yrkkg.png");
  265. }
  266. .ztz {
  267. background-image: url("/static/images/overview/icon_yrkkg.png");
  268. }
  269. .text {
  270. display: inline-block;
  271. // border: #00FFFF 1px solid;
  272. width: 100%;
  273. margin-bottom: 4px;
  274. text-align: center;
  275. margin-left: 0.3rem;
  276. overflow: hidden;
  277. text-overflow: ellipsis;
  278. white-space: nowrap;
  279. span {
  280. font-family: "Arial Negreta", "Arial Normal", "Arial";
  281. font-weight: 700;
  282. font-style: normal;
  283. color: #68f4fb;
  284. }
  285. .unit {
  286. font-family: "Arial Negreta", "Arial Normal", "Arial";
  287. font-weight: 400;
  288. font-size: 12px;
  289. color: #ecf6ff;
  290. line-height: 12px;
  291. }
  292. }
  293. }
  294. }
  295. .echartlist {
  296. width: 100%;
  297. height: calc(100% - 120px);
  298. overflow-y: auto;
  299. overflow-x: hidden;
  300. .block-title {
  301. width: calc(100% - 130px) !important;
  302. }
  303. }
  304. .selectTab {
  305. // margin-right: 20px;
  306. /deep/ .el-input__inner {
  307. width: 100px !important;
  308. height: 30px !important;
  309. font-size: 12px;
  310. color: #bcd3e5;
  311. // border: none;
  312. background-color: transparent !important;
  313. background-size: 100% 100%;
  314. }
  315. }
  316. .sm-panel {
  317. width: 400px;
  318. height: 700px;
  319. z-index: 999999;
  320. }
  321. .CockpitVectorBox {
  322. top: 0px;
  323. }
  324. .info {
  325. padding: 0;
  326. overflow: hidden;
  327. }
  328. }
  329. </style>
  330. <style lang="scss">
  331. @import "../complianceAnalysis//ghzc.scss";
  332. </style>