| | |
| | | <template> |
| | | <div class="verSionBox"> |
| | | <My-bread :list="[ |
| | | <My-bread |
| | | :list="[ |
| | | `${$t('dataManage.dataManage')}`, |
| | | `${$t('dataManage.projectManage')}`, |
| | | ]"></My-bread> |
| | | ]" |
| | | ></My-bread> |
| | | <el-divider /> |
| | | <div class="verSionContent"> |
| | | <div class="verSion_leftTree subpage_Div"> |
| | |
| | | </div> |
| | | <div class="verSion_rightContent subpage_Div"> |
| | | <el-form |
| | | style=" height: 44px; |
| | | padding: 1%; |
| | | display: flex; |
| | | flex-direction: row-reverse; |
| | | border-radius: 5px; |
| | | border: 1px solid #dcdfe6;" |
| | | :inline="true" |
| | | class="demo-form-inline" |
| | | > |
| | | |
| | | <el-form-item> |
| | | <el-button |
| | | v-if="btnStatus.insert" |
| | |
| | | :disabled="count1 != 0 ? true : false" |
| | | type="success" |
| | | size="small" |
| | | >{{ $t('common.append') }}</el-button> |
| | | >{{ $t("common.append") }}</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- <el-divider class="eldivider" /> --> |
| | | <div style="height: 80%; margin-top: 10px;"> |
| | | <div class="table_box" style="height:calc(100% - 89px)"> |
| | | <el-table |
| | | ref="filterTable" |
| | | :data="dbTableData" |
| | | height="100%" |
| | | border |
| | | height="calc(100% - 57px)" |
| | | |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column |
| | |
| | | prop="remarks" |
| | | :label="$t('dataManage.projectObj.remarks')" |
| | | /> |
| | | <el-table-column |
| | | label="操作" |
| | | width="200" |
| | | > |
| | | <el-table-column label="操作" width="200"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="btnStatus.delete" |
| | |
| | | icon="el-icon-delete" |
| | | size="small" |
| | | type="danger" |
| | | >{{ $t('common.delete') }}</el-button> |
| | | >{{ $t("common.delete") }}</el-button |
| | | > |
| | | <el-button |
| | | v-if="btnStatus.update" |
| | | @click="EditProject(scope.row)" |
| | | icon="el-icon-edit" |
| | | type="info" |
| | | size="small" |
| | | >{{ $t('common.update') }}</el-button> |
| | | >{{ $t("common.update") }}</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div |
| | | style="margin-top: 10px" |
| | | class="pagination_box" |
| | | > |
| | | |
| | | </div> |
| | | |
| | | <div style="margin-top: 10px" class="pagination_box"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <el-input v-model="editFrom.projtype"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label="$t('dataManage.projectObj.location')"> |
| | | <el-input |
| | | :disabled="true" |
| | | v-model="editFrom.geom" |
| | | ></el-input> |
| | | <el-input :disabled="true" v-model="editFrom.geom"></el-input> |
| | | <el-link |
| | | @click="ShowInner" |
| | | style=" margin-left: 20px" |
| | | style="margin-left: 20px" |
| | | icon="el-icon-plus" |
| | | > |
| | | </el-link> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | slot="footer" |
| | | class="dialog-footer" |
| | | > |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button |
| | | type="info" |
| | | size="small" |
| | | :disabled="behavior != '新增项目' ? true : false" |
| | | @click="setRestEditFrom" |
| | | >{{ $t('common.reset') }}</el-button> |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | @click="insertEditFrom" |
| | | >{{ |
| | | $t('common.confirm') |
| | | >{{ $t("common.reset") }}</el-button |
| | | > |
| | | <el-button size="small" type="primary" @click="insertEditFrom">{{ |
| | | $t("common.confirm") |
| | | }}</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | project_delete, |
| | | project_update, |
| | | project_selectLocation, |
| | | } from '../../api/api'; |
| | | import ProjectOl from '../../components/ProjectOl.vue'; |
| | | import MyBread from '../../components/MyBread.vue'; |
| | | import moment from 'moment'; |
| | | } from "../../api/api"; |
| | | import ProjectOl from "../../components/ProjectOl.vue"; |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | import moment from "moment"; |
| | | |
| | | export default { |
| | | name: 'versionManage', |
| | | name: "versionManage", |
| | | components: { MyBread, ProjectOl }, |
| | | data() { |
| | | return { |
| | |
| | | showMap: false, |
| | | count: null, |
| | | projectFrom: {}, |
| | | editFrom: { geom: ' ' }, |
| | | editFrom: { geom: " " }, |
| | | dirId: null, |
| | | elProject: [], |
| | | dirList: [], //el树数据 |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'name', |
| | | children: "children", |
| | | label: "name", |
| | | }, |
| | | dbTableData: [], |
| | | btnStatus: { |
| | |
| | | this.showMap = true; |
| | | }, |
| | | outerClose(done) { |
| | | this.$confirm('确认关闭?') |
| | | this.$confirm("确认关闭?") |
| | | .then((_) => { |
| | | this.setRestEditFrom(); |
| | | this.getSelectProject(); |
| | | done(); |
| | | }) |
| | | .catch((_) => { }); |
| | | .catch((_) => {}); |
| | | }, |
| | | async innerClose() { |
| | | this.showMap = false; |
| | |
| | | |
| | | var wkt = this.$wkt.parse(this.$store.state.projeOl); |
| | | |
| | | const data = await project_selectLocation({ x: wkt.coordinates[0], y: wkt.coordinates[1] }) |
| | | console.log(data.result) |
| | | const data = await project_selectLocation({ |
| | | x: wkt.coordinates[0], |
| | | y: wkt.coordinates[1], |
| | | }); |
| | | console.log(data.result); |
| | | if (data.code == 200) { |
| | | |
| | | for (var i in data.result) { |
| | | var key = data.result[i].key; |
| | | var val = data.result[i].value; |
| | |
| | | this.editFrom.geom = this.$store.state.projeOl; |
| | | }, |
| | | async insertEditFrom() { |
| | | if (this.behavior == '新增项目') { |
| | | if (this.behavior == "新增项目") { |
| | | this.editFrom.dirid = this.dirId; |
| | | const data = await project_insert(this.editFrom); |
| | | if (data.code != 200) { |
| | | this.$message.error('项目新增失败'); |
| | | this.$message.error("项目新增失败"); |
| | | return; |
| | | } |
| | | this.outerVisible = false; |
| | | } else { |
| | | const data = await project_update(this.editFrom); |
| | | if (data.code != 200) { |
| | | this.$message.error('项目修改失败'); |
| | | this.$message.error("项目修改失败"); |
| | | return; |
| | | } |
| | | this.outerVisible = false; |
| | |
| | | this.setRestEditFrom(); |
| | | }, |
| | | setRestEditFrom() { |
| | | this.editFrom = { geom: ' ' }; |
| | | this.editFrom = { geom: " " }; |
| | | this.$store.state.projeOl = null; |
| | | }, |
| | | |
| | | //删除项目 |
| | | async deleteProject(row) { |
| | | this.$confirm('此操作将永久删除该项目, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | const data = await project_delete({ gid: row.gid }); |
| | | if (data.code == 200) { |
| | | this.$confirm("此操作将永久删除该项目, 是否继续?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | const data = await project_delete({ gid: row.gid }); |
| | | if (data.code == 200) { |
| | | this.$message({ |
| | | message: "删除成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: "删除失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.$message({ |
| | | message: "删除成功!", |
| | | type: "success", |
| | | type: "info", |
| | | message: "已取消删除", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: "删除失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | }, |
| | | //修改项目 |
| | | EditProject(row) { |
| | | this.behavior = '修改项目'; |
| | | this.behavior = "修改项目"; |
| | | this.outerVisible = true; |
| | | this.editFrom = row; |
| | | this.$store.state.projeOl = row.geom; |
| | |
| | | //新增项目 |
| | | insertProject() { |
| | | if (this.dirId == null) { |
| | | this.$message.error('请选择需要新增的目录'); |
| | | this.$message.error("请选择需要新增的目录"); |
| | | return; |
| | | } |
| | | this.behavior = '新增项目'; |
| | | this.behavior = "新增项目"; |
| | | this.outerVisible = true; |
| | | }, |
| | | //目录树点击事件 |
| | |
| | | this.listLoader.dirid = this.dirId; |
| | | const data = await project_selectByDirid(this.listLoader); |
| | | if (data.code != 200) { |
| | | this.$message.error('列表获取失败'); |
| | | this.$message.error("列表获取失败"); |
| | | return; |
| | | } |
| | | |
| | |
| | | async getSelectdirTab() { |
| | | const res = await project_selectDirAll(); |
| | | if (res.code != 200) { |
| | | this.$message.error('目录列表获取失败'); |
| | | this.$message.error("目录列表获取失败"); |
| | | return; |
| | | } |
| | | this.dirList = this.treeData(res.result); |
| | |
| | | return cloneData.filter((father) => { |
| | | // 循环所有项 |
| | | let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据 |
| | | branchArr.length > 0 ? (father.children = branchArr) : ''; // 给父级添加一个children属性,并赋值 |
| | | branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值 |
| | | return father.pid == 0; // 返回一级菜单 |
| | | }); |
| | | }, |
| | |
| | | width: 98%; |
| | | padding: 1%; |
| | | .verSionContent { |
| | | width: 100%; |
| | | height: 92%; |
| | | width: 100%; |
| | | height: calc(100% - 75px); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | .verSion_leftTree { |
| | | width: 15%; |
| | | height: 91%; |
| | | |
| | | width: calc(23% - 0px); |
| | | height: 100%; |
| | | padding: 10px; |
| | | border-radius: 5px; |
| | | padding: 1%; |
| | | max-height: 670px; |
| | | box-sizing: border-box; |
| | | overflow-y: auto; |
| | | } |
| | | .verSion_rightContent { |
| | | width: 80%; |
| | | height: 91%; |
| | | max-height: 670px; |
| | | width: 75%; |
| | | height: 100%; |
| | | border-radius: 5px; |
| | | padding: 1%; |
| | | overflow-y: auto; |
| | | padding: 10px; |
| | | box-sizing: border-box; |
| | | border: 1px solid #dcdfe6; |
| | | } |
| | | .projectli { |
| | | height: 46px; |
| | |
| | | } |
| | | } |
| | | } |
| | | .demo-form-inline{ |
| | | padding: 8px; |
| | | // margin-top: 10px; |
| | | border-radius: 5px; |
| | | border: 1px solid #dcdfe6; |
| | | margin-bottom: 20px; |
| | | text-align: right; |
| | | .el-form-item { |
| | | margin: 5px; |
| | | } |
| | | } |
| | | </style> |
| | | > |
| | | |