123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <template>
- <div class="tpwjxm">
- <el-row>
- <el-col :span="13">
- <!-- datetimerange value-format="yyyy-MM-dd" :clearable="false"align="left" -->
- <el-date-picker
- v-model="pageObj.sj"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="~"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- class="datepicker"
- size="mini"
- @change="changedate"
- >
- </el-date-picker>
- </el-col>
- <el-col :span="1">
- <div class="max-width" style="height: 10px"></div>
- </el-col>
- <el-col :span="10">
- <el-input
- v-model="pageObj.xmmc"
- placeholder="请输入项目名称"
- class="input-style"
- size="mini"
- @input="changeForm"
- >
- <i slot="suffix" class="el-input__icon el-icon-search"></i>
- <!-- <el-button slot="append" icon="el-icon-search"></el-button> -->
- </el-input>
- </el-col>
- </el-row>
- <div
- class="listDiv"
- v-infinite-scroll="infiniteScroll"
- :infinite-scroll-disabled="listdisabled"
- >
- <div
- class="dataItem"
- v-for="(item, dindex) in datalist"
- :class="now == item.bsm ? 'dataItemHight' : ''"
- :key="item.bsm"
- @click="zoomItem(item)"
- >
- <!-- <div>{{ dindex + 1 }}. 项目名称:{{ item.xmmc }}</div> -->
- <div class="index">{{ dindex + 1 }}</div>
- <div class="nameTitle">{{ item.xmmc }}</div>
- <div>建设单位:{{ item.jsdw }}</div>
- <div class="item_bottom">
- <el-tag type="warning" v-if="item.rwzt == 0">创建</el-tag>
- <el-tag v-if="item.rwzt == 1">执行中</el-tag>
- <el-tag type="success" v-if="item.rwzt == 2">完成</el-tag>
- <el-tag type="danger" v-if="item.rwzt == 3">错误</el-tag>
- <div>
- <span class="button" @click.stop="checkRz(item)">日志</span>
- <span class="button" @click="checkDetails(item)">结果</span>
- <span class="button" v-if="item.fxbg && type == 'hgxfx'" @click.stop="report(item)"
- >报告</span
- >
- <span
- class="button"
- @click.stop="del(item)"
- v-if="item.rwzt == 2 || item.rwzt == 3 || item.rwzt == 99"
- >删除</span
- >
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import parse from "wellknown";
- import { GetPage, Delect } from "@/api/ghss/hgxfx.js";
- import { Message, MessageBox } from "element-ui";
- import { rest } from "lodash";
- import { GetXzResList, DelXzRes ,DownloadReport} from "../../../api/ghss/ghxz.js";
- let dataSources;
- export default {
- props: {
- historyList: {
- type: Array,
- },
- type: {
- type: String,
- },
- recordBsm: {
- type: String,
- },
- },
- data() {
- return {
- pageObj: {
- kssj: "",
- sj: [],
- jssj: "",
- xmmc: "",
- page: 1,
- },
- defaultTime1: [
- new Date(2023, 1, 1, 0, 0, 0),
- new Date(2023, 2, 1, 23, 59, 59),
- ], // '00:00:00', '23:59:59'
- datalist: [],
- listdisabled: false,
- now: "",
- // recordBsm: "", //辅助选址成功后的标识码
- };
- },
- mounted() {
- // this.getData();
- // this.bus.$on("recordBsm", (val) => {
- // console.log(val, "recordBsm");
- // this.recordBsm = val
- // });
- },
- methods: {
- report(item) {
- // window.open(item.fxbg.replace(".docx", ".pdf"), "_blank");
- window.open(window.axiosURI + '/analyse/fzss/DownloadReport?filePath='+`${item.fxbg}`);
- },
- del(item) {
- MessageBox.confirm(
- "该操作将会删除此数据且不可恢复,您确定要删除吗?",
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }
- )
- .then(() => {
- if (this.$props.type == "hgxfx") {
- Delect({ bsm: item.bsm }).then((res) => {
- if (res.success) {
- Message.success("删除成功!");
- this.changeForm();
- }
- });
- } else {
- DelXzRes({ bsm: item.bsm }).then((res) => {
- if (res.success) {
- Message.success("删除成功!");
- this.changeForm();
- }
- });
- }
- })
- .catch(() => {});
- },
- checkDetails(item) {
- this.$emit("updateParent", "nowObj", item);
- let next = this.$props.type == "hgxfx" ? "scjg" : "xzjg";
- this.$emit("updateParent", "activeTabs", next);
- if (this.$props.type != "hgxfx") {
- this.$emit("updateParent", "rwBsm", item.bsm);
- }
- },
- checkRz(item) {
- this.$emit("updateParent", "nowObj", item);
- this.$emit("updateParent", "rzBsm", item.bsm);
- },
- infiniteScroll() {
- this.pageObj.page += 1;
- this.listdisabled = true;
- this.$emit("updateParent", "loading", true);
- setTimeout(() => {
- this.getData();
- }, 500);
- },
- changeForm() {
- this.pageObj.page = 1;
- this.datalist = [];
- this.getData();
- },
- changedate(val) {
- if (val) {
- this.pageObj.kssj = this.pageObj.sj[0];
- this.pageObj.jssj = this.pageObj.sj[1];
- } else {
- this.pageObj.kssj = "";
- this.pageObj.jssj = "";
- }
- this.changeForm();
- },
- getData() {
- this.$emit("updateParent", "loading", true);
- if (this.$props.type == "hgxfx") {
- GetPage({ ...this.pageObj }).then((res) => {
- setTimeout(() => {
- this.$emit("updateParent", "loading", false);
- }, 100);
- this.listdisabled = res.data.length < 10;
- this.datalist = [...this.datalist, ...res.data];
- });
- } else {
- let tempObj = { ...this.pageObj };
- let obj = {
- startTime: tempObj.kssj,
- endTime: tempObj.jssj,
- name: tempObj.xmmc,
- pageNum: 1,
- pageSize: 10,
- };
- GetXzResList(obj).then((res) => {
- setTimeout(() => {
- this.$emit("updateParent", "loading", false);
- }, 100);
- this.listdisabled = res.data.items.length < 10;
- this.datalist = [...this.datalist, ...res.data.items];
- });
- }
- },
- zoomItem(item) {
- this.now = item.bsm;
- this.addPolygon(parse(item.geom));
- },
- // 加载GeoJSON数据
- addPolygon(geojson) {
- this.reset();
- let polygon = Cesium.GeoJsonDataSource.load(geojson, {
- clampToGround: true,
- stroke: Cesium.Color.RED,
- fill: Cesium.Color.WHITE.withAlpha(0.3),
- strokeWidth: 5,
- });
- polygon.then(function (dataSource) {
- dataSources = dataSource;
- viewer.dataSources.add(dataSource);
- viewer.zoomTo(dataSource);
- });
- },
- reset() {
- if (dataSources) viewer.dataSources.remove(dataSources);
- dataSources = undefined;
- },
- },
- watch: {},
- beforeDestroy() {
- this.pageObj = {
- kssj: "",
- sj: [],
- jssj: "",
- xmmc: "",
- page: 1,
- };
- },
- };
- </script>
- <style lang="scss" scoped>
- .tpwjxm {
- width: 100%;
- height: 100%;
- .el-form-item {
- margin-bottom: 5px;
- }
- .datepicker {
- width: 100% !important;
- span {
- display: flex;
- align-items: center;
- }
- }
- .el-icon-search {
- color: #20a0fc;
- }
- .listDiv {
- width: 100%;
- height: calc(100% - 40px);
- padding-top: 10px;
- padding-right: 10px;
- overflow-x: hidden;
- overflow-y: auto;
- color: #fff;
- .dataItem {
- height: 80px;
- border-bottom: 1px solid #667e8f;
- padding-left: 30px;
- position: relative;
- margin-bottom: 10px;
- color: #cddeeb;
- line-height: 20px;
- }
- .dataItem:hover,
- .dataItemHight {
- // border: 1px solid #02a7f0;
- background-color: rgba(64, 158, 255, 0.2);
- }
- .index {
- width: 30px;
- height: 100%;
- line-height: 70px;
- font-weight: bold;
- font-size: 16px;
- color: #ffffff;
- text-align: center;
- position: absolute;
- left: 0;
- }
- .nameTitle {
- color: #ffffff;
- font-size: 16px;
- line-height: 24px;
- }
- .item_bottom {
- display: flex;
- justify-content: space-between;
- margin-top: 5px;
- .el-tag {
- // margin-top: 14px;
- width: 48px;
- height: 18px;
- line-height: 18px;
- position: absolute;
- top: 0;
- right: 0;
- color: #fff;
- border-radius: 0px 0px 2px 14px;
- border-color: transparent;
- }
- .el-tag--success {
- background: linear-gradient(
- 170deg,
- rgba(0, 200, 128, 0.6) 0%,
- rgba(155, 255, 139, 0.7) 100%
- );
- }
- .el-tag--warning {
- background: linear-gradient(
- 170deg,
- rgba(249, 180, 71, 0.6) 0%,
- rgba(249, 180, 71, 0.6) 100%
- );
- }
- .el-tag--light {
- background: linear-gradient(
- 170deg,
- rgba(255, 126, 33, 0.6) 0%,
- rgba(255, 166, 33, 0.7) 100%
- );
- }
- .el-tag--danger {
- background: linear-gradient(
- 170deg,
- rgba(200, 0, 0, 0.6) 0%,
- rgba(255, 105, 105, 0.6) 100%
- );
- }
- .button {
- width: 48px;
- height: 20px;
- font-size: 14px;
- line-height: 20px;
- color: #b6e0ff;
- text-align: center;
- display: inline-block;
- background-image: url("/static/images/ghzc/btnbg.png");
- background-size: 100% 100%;
- cursor: pointer;
- margin-right: 8px;
- }
- }
- }
- }
- </style>
- <style lang="scss">
- @import "../../cockpit/datePicker.scss";
- </style>
|