|
@@ -1,452 +1,455 @@
|
|
|
-<template>
|
|
|
- <div class="space-index">
|
|
|
- <div class="space-null" v-if="projectItemList.length ==0">
|
|
|
- <img :src="nullImage" alt="" />
|
|
|
- <div class="space-null-text">您还未添加楼宇信息,可新增楼宇,开启您的空间设置吧!</div>
|
|
|
- <div class="flow-button">
|
|
|
- <el-button size="medium" type="primary" @click="insert('projectItem')">
|
|
|
- <i class="iconfont huifont-xinzeng"></i>新增楼宇
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="space-content" v-else>
|
|
|
- <div class="space-content-item">
|
|
|
- <div class="space-title">
|
|
|
- <div class="space-title-label">楼宇</div>
|
|
|
- <el-button size="medium" type="primary" @click="insert('projectItem')">
|
|
|
- <i class="iconfont huifont-xinzeng"></i>新增
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <div class="space-content-box">
|
|
|
- <div class="space-room-list">
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="12" v-for="item in projectItemList" :key="item.id">
|
|
|
- <div :class="projectItem.id === item.id?'space-room-item active' : 'space-room-item'"
|
|
|
- @click="selectTarget(item)">
|
|
|
- <div class="space-room-image">
|
|
|
- <img :src="returnImage(item)" alt="" />
|
|
|
- </div>
|
|
|
- <div class="space-room-text">
|
|
|
- <div class="space-room-label">{{item.name}}</div>
|
|
|
- <div class="space-room-sub">{{item.remark}}</div>
|
|
|
- </div>
|
|
|
- <div class="space-room-icon">
|
|
|
- <el-dropdown trigger="click"
|
|
|
- @command="command=>commandFunc(command,item,'projectItem')">
|
|
|
- <div class="target-item-icon">
|
|
|
- <i class="iconfont huifont-jinhangzhong"></i>
|
|
|
- </div>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="detail">详情</el-dropdown-item>
|
|
|
- <el-dropdown-item command="update">编辑</el-dropdown-item>
|
|
|
- <el-dropdown-item command="delete">删除</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="space-line"></div>
|
|
|
- <div class="space-content-item">
|
|
|
- <div class="space-title">
|
|
|
- <div class="space-title-label">楼层</div>
|
|
|
- <el-button size="medium" type="primary" @click="insert('projectItemTarget')">
|
|
|
- <i class="iconfont huifont-xinzeng"></i>新增
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <div class="space-content-box">
|
|
|
- <div class="space-undefined" v-if="projectItemTargetList.length === 0">
|
|
|
- <img :src="undefinedImage" alt="" />
|
|
|
- <div class="space-undefined-text">暂无数据</div>
|
|
|
- </div>
|
|
|
- <el-row class="project-item-traget" :gutter="10" v-else>
|
|
|
- <el-col :span="8" v-for="(target,index) in projectItemTargetList" :key="target.id">
|
|
|
- <div class="target-item">
|
|
|
- <div class="target-item-num">
|
|
|
- <i class="iconfont huifont-louceng"></i>
|
|
|
- </div>
|
|
|
- <div class="target-item-label">{{target.name}}</div>
|
|
|
- <el-dropdown trigger="click"
|
|
|
- @command="command=>commandFunc(command,target,'projectItemTarget')">
|
|
|
- <div class="target-item-icon">
|
|
|
- <i class="iconfont huifont-jinhangzhong"></i>
|
|
|
- </div>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="update">编辑</el-dropdown-item>
|
|
|
- <el-dropdown-item command="delete">删除</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px" :append-to-body="true">
|
|
|
- <project-item-form v-if="visible && type === 'projectItem'" @callback="callback" :isUpdate="isUpdate"
|
|
|
- :detailId="itemId">
|
|
|
- </project-item-form>
|
|
|
- <project-item-target-form v-if="visible && type === 'projectItemTarget'" @callback="callback"
|
|
|
- :isUpdate="isUpdate" :detailId="itemId" :projectItemId="projectItem.id">
|
|
|
- </project-item-target-form>
|
|
|
- </el-dialog>
|
|
|
- <el-drawer title="楼宇详情" :visible.sync="drawer" :size="400" :append-to-body="true">
|
|
|
- <project-item-detail v-if="drawer" :detailId="itemId"></project-item-detail>
|
|
|
- </el-drawer>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
- import {
|
|
|
- getProjectDetailById,
|
|
|
- getProjectItemList,
|
|
|
- deleteProjectItemById,
|
|
|
- deleteProjectItemTarget,
|
|
|
- deleteRoom
|
|
|
- } from '@/httpApi/space';
|
|
|
- import projectItemForm from '@/components/work/space/set/projectItemForm'
|
|
|
- import projectItemDetail from '@/components/work/space/set/projectItemDetail'
|
|
|
- import projectItemTargetForm from '@/components/work/space/set/projectItemTargetForm'
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- nullImage: require('../../../assets/image/common/dataNull.png'),
|
|
|
- undefinedImage: require('../../../assets/image/common/dataUndefined.png'),
|
|
|
- projectItemList: [],
|
|
|
- projectItemTargetList: [],
|
|
|
- visible: false,
|
|
|
- itemId: '',
|
|
|
- isUpdate: false,
|
|
|
- projectItem: {},
|
|
|
- projectItemTarget: {},
|
|
|
- drawer: false
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getProjectItemList();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getProjectItemList() {
|
|
|
- getProjectDetailById(this.$store.getters.project.id).then(res => {
|
|
|
- if (res.state) {
|
|
|
- this.projectItemList = res.data.projectItemList || [];
|
|
|
- if (this.projectItemList.length === 0) return;
|
|
|
- if (this.projectItem.id) {
|
|
|
- let item = this.projectItemList.filter(node => node.id === this.projectItem.id);
|
|
|
- if (item.length === 0) return this.selectTarget(this.projectItemList[0]);
|
|
|
- this.selectTarget(item[0]);
|
|
|
- } else {
|
|
|
- this.selectTarget(this.projectItemList[0]);
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- insert(type, projectItemId) {
|
|
|
- this.type = type;
|
|
|
- this.isUpdate = false;
|
|
|
- this.visible = true;
|
|
|
- },
|
|
|
- selectTarget(item) {
|
|
|
- this.projectItem = item;
|
|
|
- this.projectItemTargetList = item.projectItemTargetList;
|
|
|
- },
|
|
|
- commandFunc(operationType, item, type) {
|
|
|
- this.type = type;
|
|
|
- this.itemId = item.id;
|
|
|
- this[operationType]();
|
|
|
- },
|
|
|
- update() {
|
|
|
- this.isUpdate = true;
|
|
|
- this.visible = true;
|
|
|
- },
|
|
|
- detail() {
|
|
|
- this.drawer = true;
|
|
|
- },
|
|
|
- delete() {
|
|
|
- if (this.type === 'projectItem') {
|
|
|
- this.$confirm('确定要删除该楼宇?', () => {
|
|
|
- deleteProjectItemById(this.itemId).then(this.successFunc);
|
|
|
- });
|
|
|
- }
|
|
|
- if (this.type === 'projectItemTarget') {
|
|
|
- this.$confirm('确定要删除该楼层?', () => {
|
|
|
- deleteProjectItemTarget(this.itemId).then(this.successFunc);
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- successFunc(res) {
|
|
|
- if (res.state) {
|
|
|
- this.getProjectItemList();
|
|
|
- this.$message.success('操作成功');
|
|
|
- }
|
|
|
- },
|
|
|
- returnImage(item) {
|
|
|
- let imgUrl = 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/1da893e7d4264dc68ef43e00d5a708e9'
|
|
|
- if (item.picture) {
|
|
|
- let picture = JSON.parse(item.picture);
|
|
|
- if (picture.length > 0) imgUrl = picture[0].url;
|
|
|
- }
|
|
|
- return imgUrl;
|
|
|
- },
|
|
|
- callback(type) {
|
|
|
- this.visible = false;
|
|
|
- if (type === 'init') this.getProjectItemList();
|
|
|
- }
|
|
|
- },
|
|
|
- components: {
|
|
|
- projectItemForm,
|
|
|
- projectItemDetail,
|
|
|
- projectItemTargetForm,
|
|
|
- },
|
|
|
- }
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss">
|
|
|
- .space-index {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
-
|
|
|
- .space-null {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- flex-direction: column;
|
|
|
-
|
|
|
- img {
|
|
|
- width: 420px;
|
|
|
- }
|
|
|
-
|
|
|
- .space-null-text {
|
|
|
- padding: 30px 0 20px 0;
|
|
|
- }
|
|
|
-
|
|
|
- .el-button {
|
|
|
- padding-left: 12px;
|
|
|
-
|
|
|
- span {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
-
|
|
|
- .huifont-xinzeng {
|
|
|
- padding-right: 10px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .space-undefined {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- flex-direction: column;
|
|
|
-
|
|
|
- img {
|
|
|
- width: 160px;
|
|
|
- }
|
|
|
-
|
|
|
- .space-undefined-text {
|
|
|
- margin-top: 20px;
|
|
|
- opacity: 0.6;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .space-content {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- display: flex;
|
|
|
-
|
|
|
- .space-title {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 15px 20px;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- .space-title-label {
|
|
|
- font-size: 16px;
|
|
|
- }
|
|
|
-
|
|
|
- .el-button {
|
|
|
- padding: 8px 16px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .space-line {
|
|
|
- background: $--background;
|
|
|
- width: 12px;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
-
|
|
|
- .space-content-box {
|
|
|
- flex: 1;
|
|
|
- padding: 0 20px 15px 20px;
|
|
|
- height: 0;
|
|
|
- overflow-y: auto;
|
|
|
-
|
|
|
- .space-project-item {
|
|
|
- background: #242a36;
|
|
|
- margin-bottom: 20px;
|
|
|
- border-radius: 2px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .space-content-item {
|
|
|
- flex: 1;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- }
|
|
|
-
|
|
|
- .project-item-title {
|
|
|
- height: 56px;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 0 20px;
|
|
|
- align-items: center;
|
|
|
- border-bottom: 1px solid $--color-border;
|
|
|
- }
|
|
|
-
|
|
|
- .project-item-traget {
|
|
|
- .target-item {
|
|
|
- width: 100%;
|
|
|
- background: #232A37;
|
|
|
- padding: 15px;
|
|
|
- border-radius: 8px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- box-sizing: border-box;
|
|
|
- box-sizing: border-box;
|
|
|
- border: 1px solid #1f242f;
|
|
|
- }
|
|
|
-
|
|
|
- .target-item-insert {
|
|
|
- width: 100%;
|
|
|
- height: 70px;
|
|
|
- border: 1px dashed $--color-border;
|
|
|
- border-radius: 8px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- cursor: pointer;
|
|
|
-
|
|
|
- .huifont-xinzeng {
|
|
|
- margin-right: 5px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .target-item-insert:hover {
|
|
|
- border-color: $--color-primary;
|
|
|
- color: $--color-primary;
|
|
|
-
|
|
|
- .huifont-xinzeng {
|
|
|
- color: $--color-primary;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .target-item-num {
|
|
|
- width: 38px;
|
|
|
- height: 38px;
|
|
|
- text-align: center;
|
|
|
- line-height: 38px;
|
|
|
- background: #31353f;
|
|
|
- border-radius: 10px;
|
|
|
- margin-right: 10px;
|
|
|
-
|
|
|
- .iconfont {
|
|
|
- font-size: 20px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .target-item-label {
|
|
|
- flex: 1;
|
|
|
- width: 0;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .target-item-icon {
|
|
|
- transform: rotate(90deg);
|
|
|
- cursor: pointer;
|
|
|
-
|
|
|
- .huifont-jinhangzhong {
|
|
|
- font-size: 20px;
|
|
|
- color: $--color-common;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .el-col {
|
|
|
- padding-top: 5px;
|
|
|
- padding-bottom: 5px;
|
|
|
- }
|
|
|
-
|
|
|
- .space-room-list {
|
|
|
- .space-room-image {
|
|
|
- img {
|
|
|
- width: 80px;
|
|
|
- height: 80px;
|
|
|
- object-fit: fill;
|
|
|
- border-radius: 8px;
|
|
|
- }
|
|
|
-
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
-
|
|
|
- .space-room-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- padding: 0 15px;
|
|
|
- height: 110px;
|
|
|
- background: #232A37;
|
|
|
- border-radius: 8px;
|
|
|
- position: relative;
|
|
|
- cursor: pointer;
|
|
|
- border: 1px solid #1f242f;
|
|
|
-
|
|
|
- .space-room-icon {
|
|
|
- position: absolute;
|
|
|
- top: 12px;
|
|
|
- right: 12px;
|
|
|
- }
|
|
|
-
|
|
|
- .space-room-num {
|
|
|
- width: 48px;
|
|
|
- height: 48px;
|
|
|
- background: rgba(255, 255, 255, 0.08);
|
|
|
- border-radius: 10px;
|
|
|
- margin-right: 12px;
|
|
|
- text-align: center;
|
|
|
- line-height: 48px;
|
|
|
- font-size: 18px;
|
|
|
- }
|
|
|
-
|
|
|
- .space-room-text {
|
|
|
- flex: 1;
|
|
|
- width: 0;
|
|
|
-
|
|
|
- .space-room-label {
|
|
|
- font-size: 18px;
|
|
|
- font-weight: 500;
|
|
|
- margin-bottom: 4px;
|
|
|
- }
|
|
|
-
|
|
|
- .space-room-sub {
|
|
|
- font-size: 12px;
|
|
|
- opacity: 0.6;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .space-room-item.active,
|
|
|
- .space-room-item:hover {
|
|
|
- border-color: $--color-primary;
|
|
|
- box-shadow: -1px -1px 10px 1px rgba(51, 133, 255, 0.2) inset;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+<template>
|
|
|
+ <div class="space-index">
|
|
|
+ <div class="space-null" v-if="projectItemList.length ==0">
|
|
|
+ <img :src="nullImage" alt="" />
|
|
|
+ <div class="space-null-text">您还未添加楼宇信息,可新增楼宇,开启您的空间设置吧!</div>
|
|
|
+ <div class="flow-button">
|
|
|
+ <el-button size="medium" type="primary" @click="insert('projectItem')">
|
|
|
+ <i class="iconfont huifont-xinzeng"></i>新增楼宇
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="space-content" v-else>
|
|
|
+ <div class="space-content-item">
|
|
|
+ <div class="space-title">
|
|
|
+ <div class="space-title-label">楼宇</div>
|
|
|
+ <el-button size="medium" type="primary" @click="insert('projectItem')">
|
|
|
+ <i class="iconfont huifont-xinzeng"></i>新增
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="space-content-box">
|
|
|
+ <div class="space-room-list">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12" v-for="item in projectItemList" :key="item.id">
|
|
|
+ <div :class="projectItem.id === item.id?'space-room-item active' : 'space-room-item'"
|
|
|
+ @click="selectTarget(item)">
|
|
|
+ <div class="space-room-image">
|
|
|
+ <img :src="returnImage(item)" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="space-room-text">
|
|
|
+ <div class="space-room-label">{{item.name}}</div>
|
|
|
+ <div class="space-room-sub">{{item.remark}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="space-room-icon">
|
|
|
+ <el-dropdown trigger="click"
|
|
|
+ @command="command=>commandFunc(command,item,'projectItem')">
|
|
|
+ <div class="target-item-icon">
|
|
|
+ <i class="iconfont huifont-jinhangzhong"></i>
|
|
|
+ </div>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="detail">详情</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="update">编辑</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="delete">删除</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="space-line"></div>
|
|
|
+ <div class="space-content-item">
|
|
|
+ <div class="space-title">
|
|
|
+ <div class="space-title-label">楼层</div>
|
|
|
+ <el-button size="medium" type="primary" @click="insert('projectItemTarget')">
|
|
|
+ <i class="iconfont huifont-xinzeng"></i>新增
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div class="space-content-box">
|
|
|
+ <div class="space-undefined" v-if="projectItemTargetList.length === 0">
|
|
|
+ <img :src="undefinedImage" alt="" />
|
|
|
+ <div class="space-undefined-text">暂无数据</div>
|
|
|
+ </div>
|
|
|
+ <el-row class="project-item-traget" :gutter="10" v-else>
|
|
|
+ <el-col :span="8" v-for="(target,index) in projectItemTargetList" :key="target.id">
|
|
|
+ <div class="target-item">
|
|
|
+ <div class="target-item-num">
|
|
|
+ <i class="iconfont huifont-louceng"></i>
|
|
|
+ </div>
|
|
|
+ <div class="target-item-label">{{target.name}}</div>
|
|
|
+ <el-dropdown trigger="click"
|
|
|
+ @command="command=>commandFunc(command,target,'projectItemTarget')">
|
|
|
+ <div class="target-item-icon">
|
|
|
+ <i class="iconfont huifont-jinhangzhong"></i>
|
|
|
+ </div>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="update">编辑</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="delete">删除</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog :close-on-click-modal="false" :title="isUpdate?'编辑':'新增'" :visible.sync="visible" width="900px"
|
|
|
+ :append-to-body="true">
|
|
|
+ <project-item-form v-if="visible && type === 'projectItem'" @callback="callback" :isUpdate="isUpdate"
|
|
|
+ :detailId="itemId">
|
|
|
+ </project-item-form>
|
|
|
+ <project-item-target-form v-if="visible && type === 'projectItemTarget'" @callback="callback"
|
|
|
+ :isUpdate="isUpdate" :detailId="itemId" :projectItemId="projectItem.id">
|
|
|
+ </project-item-target-form>
|
|
|
+ </el-dialog>
|
|
|
+ <el-drawer title="楼宇详情" :visible.sync="drawer" :size="400" :append-to-body="true">
|
|
|
+ <project-item-detail v-if="drawer" :detailId="itemId"></project-item-detail>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ getProjectDetailById,
|
|
|
+ getProjectItemList,
|
|
|
+ deleteProjectItemById,
|
|
|
+ deleteProjectItemTarget,
|
|
|
+ deleteRoom
|
|
|
+ } from '@/httpApi/space';
|
|
|
+ import projectItemForm from '@/components/work/space/set/projectItemForm'
|
|
|
+ import projectItemDetail from '@/components/work/space/set/projectItemDetail'
|
|
|
+ import projectItemTargetForm from '@/components/work/space/set/projectItemTargetForm'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ nullImage: require('../../../assets/image/common/dataNull.png'),
|
|
|
+ undefinedImage: require('../../../assets/image/common/dataUndefined.png'),
|
|
|
+ projectItemList: [],
|
|
|
+ projectItemTargetList: [],
|
|
|
+ visible: false,
|
|
|
+ itemId: '',
|
|
|
+ isUpdate: false,
|
|
|
+ projectItem: {},
|
|
|
+ projectItemTarget: {},
|
|
|
+ drawer: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getProjectItemList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getProjectItemList() {
|
|
|
+ getProjectDetailById(this.$store.getters.project.id).then(res => {
|
|
|
+ if (res.state) {
|
|
|
+ this.projectItemList = res.data.projectItemList || [];
|
|
|
+ if (this.projectItemList.length === 0) return;
|
|
|
+ if (this.projectItem.id) {
|
|
|
+ let item = this.projectItemList.filter(node => node.id === this.projectItem.id);
|
|
|
+ if (item.length === 0) return this.selectTarget(this.projectItemList[0]);
|
|
|
+ this.selectTarget(item[0]);
|
|
|
+ } else {
|
|
|
+ this.selectTarget(this.projectItemList[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ insert(type, projectItemId) {
|
|
|
+ this.type = type;
|
|
|
+ this.isUpdate = false;
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ selectTarget(item) {
|
|
|
+ this.projectItem = item;
|
|
|
+ this.projectItemTargetList = item.projectItemTargetList;
|
|
|
+ },
|
|
|
+ commandFunc(operationType, item, type) {
|
|
|
+ this.type = type;
|
|
|
+ this.itemId = item.id;
|
|
|
+ this[operationType]();
|
|
|
+ },
|
|
|
+ update() {
|
|
|
+ this.isUpdate = true;
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ detail() {
|
|
|
+ this.drawer = true;
|
|
|
+ },
|
|
|
+ delete() {
|
|
|
+ if (this.type === 'projectItem') {
|
|
|
+ this.$confirm('确定要删除该楼宇?', () => {
|
|
|
+ deleteProjectItemById(this.itemId).then(this.successFunc);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (this.type === 'projectItemTarget') {
|
|
|
+ this.$confirm('确定要删除该楼层?', () => {
|
|
|
+ deleteProjectItemTarget(this.itemId).then(this.successFunc);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ successFunc(res) {
|
|
|
+ if (res.state) {
|
|
|
+ this.getProjectItemList();
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ returnImage(item) {
|
|
|
+ let imgUrl = 'https://file-node.oss-cn-shanghai.aliyuncs.com/youji/1da893e7d4264dc68ef43e00d5a708e9'
|
|
|
+ if (item.picture) {
|
|
|
+ let picture = JSON.parse(item.picture);
|
|
|
+ if (picture.length > 0) imgUrl = picture[0].url;
|
|
|
+ }
|
|
|
+ return imgUrl;
|
|
|
+ },
|
|
|
+ callback(type) {
|
|
|
+ this.visible = false;
|
|
|
+ if (type === 'init') this.getProjectItemList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ projectItemForm,
|
|
|
+ projectItemDetail,
|
|
|
+ projectItemTargetForm,
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ .space-index {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .space-null {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 420px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-null-text {
|
|
|
+ padding: 30px 0 20px 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ padding-left: 12px;
|
|
|
+
|
|
|
+ span {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .huifont-xinzeng {
|
|
|
+ padding-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-undefined {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 160px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-undefined-text {
|
|
|
+ margin-top: 20px;
|
|
|
+ opacity: 0.6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-content {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .space-title {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 15px 20px;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .space-title-label {
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ padding: 8px 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-line {
|
|
|
+ background: $--background;
|
|
|
+ width: 12px;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-content-box {
|
|
|
+ flex: 1;
|
|
|
+ padding: 0 20px 15px 20px;
|
|
|
+ height: 0;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
+ .space-project-item {
|
|
|
+ background: #242a36;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-content-item {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .project-item-title {
|
|
|
+ height: 56px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 0 20px;
|
|
|
+ align-items: center;
|
|
|
+ border-bottom: 1px solid $--color-border;
|
|
|
+ }
|
|
|
+
|
|
|
+ .project-item-traget {
|
|
|
+ .target-item {
|
|
|
+ width: 100%;
|
|
|
+ background: #232A37;
|
|
|
+ padding: 15px;
|
|
|
+ border-radius: 8px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border: 1px solid #1f242f;
|
|
|
+ }
|
|
|
+
|
|
|
+ .target-item-insert {
|
|
|
+ width: 100%;
|
|
|
+ height: 70px;
|
|
|
+ border: 1px dashed $--color-border;
|
|
|
+ border-radius: 8px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ .huifont-xinzeng {
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .target-item-insert:hover {
|
|
|
+ border-color: $--color-primary;
|
|
|
+ color: $--color-primary;
|
|
|
+
|
|
|
+ .huifont-xinzeng {
|
|
|
+ color: $--color-primary;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .target-item-num {
|
|
|
+ width: 38px;
|
|
|
+ height: 38px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 38px;
|
|
|
+ background: #31353f;
|
|
|
+ border-radius: 10px;
|
|
|
+ margin-right: 10px;
|
|
|
+
|
|
|
+ .iconfont {
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .target-item-label {
|
|
|
+ flex: 1;
|
|
|
+ width: 0;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .target-item-icon {
|
|
|
+ transform: rotate(90deg);
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ .huifont-jinhangzhong {
|
|
|
+ font-size: 20px;
|
|
|
+ color: $--color-common;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-col {
|
|
|
+ padding-top: 5px;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-room-list {
|
|
|
+ .space-room-image {
|
|
|
+ border-radius: 8px;
|
|
|
+ margin-right: 10px;
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ object-fit: fill;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-room-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 15px;
|
|
|
+ height: 110px;
|
|
|
+ background: #232A37;
|
|
|
+ border-radius: 8px;
|
|
|
+ position: relative;
|
|
|
+ cursor: pointer;
|
|
|
+ border: 1px solid #1f242f;
|
|
|
+
|
|
|
+ .space-room-icon {
|
|
|
+ position: absolute;
|
|
|
+ top: 12px;
|
|
|
+ right: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-room-num {
|
|
|
+ width: 48px;
|
|
|
+ height: 48px;
|
|
|
+ background: rgba(255, 255, 255, 0.08);
|
|
|
+ border-radius: 10px;
|
|
|
+ margin-right: 12px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 48px;
|
|
|
+ font-size: 18px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-room-text {
|
|
|
+ flex: 1;
|
|
|
+ width: 0;
|
|
|
+
|
|
|
+ .space-room-label {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 500;
|
|
|
+ margin-bottom: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-room-sub {
|
|
|
+ font-size: 12px;
|
|
|
+ opacity: 0.6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .space-room-item.active,
|
|
|
+ .space-room-item:hover {
|
|
|
+ border-color: $--color-primary;
|
|
|
+ box-shadow: -1px -1px 10px 1px rgba(51, 133, 255, 0.2) inset;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|