123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- <template>
- <div id="divGraphEdit">
- <div class="firstRow">
- <div class="firstOperDivContainer">
- <img
- class="imgBar"
- src="../../assets/images/systemGraph/editLogo.svg"
- />
- <span class="headerTitle">系统图编辑器</span>
- <div class="operBtnDiv" v-if="operState === 0">
- <span>回到首页</span>
- <span>编辑系统图</span>
- <span>上架系统图</span>
- <span>下架系统图</span>
- </div>
- <div class="operBtnDiv" v-if="operState === 1">
- <span>保存图纸</span>
- <span>放弃编辑</span>
- </div>
- <span class="delBtn">删除图纸</span>
- </div>
- <div class="secondOperDivContainer">
- <img
- class="imgBar"
- src="../../assets/images/systemGraph/barController.svg"
- />
- <span class="el-icon-caret-bottom sanjiaoBar"></span>
- <hr class="splitLine" />
- <el-select v-model="selectScale" value-key="value">
- <el-option
- v-for="item in scaleArr"
- :key="item.value"
- :label="item.name"
- :value="item"
- >
- </el-option>
- </el-select>
- <span class="el-icon-zoom-in zoomin"></span>
- <span class="el-icon-zoom-out zoomout"></span>
- <hr class="splitLine" v-if="operState == 1" />
- <img
- v-if="operState == 1"
- class="imgLeftTop"
- src="../../assets/images/systemGraph/leftTop.svg"
- />
- <img
- v-if="operState == 1"
- class="rightLeftTop"
- src="../../assets/images/systemGraph/rightTop.svg"
- />
- <hr class="splitLine" v-if="operState == 1" />
- <img
- v-if="operState == 1"
- class="imgLeftTop"
- src="../../assets/images/systemGraph/text.svg"
- />
- <span class="resetBtn" v-if="operState == 1">重置为自动出图样式</span>
- </div>
- </div>
- <div class="secondRow">
- <div class="graphInfoContainer" v-if="operState === 0 || operState === 1">
- <div class="graphInfoFirst">
- <span class="graphInfoName">系统图名称</span>
- <span class="graphInfoFirstEdit">编辑</span>
- </div>
- <div class="graphInfoContent">
- <span>高压系统1#系统图</span>
- </div>
- <div class="graphInfoName">
- <span>系统图类型</span>
- </div>
- <div class="graphInfoContent">
- <span>高压配电</span>
- </div>
- <div class="graphInfoName">
- <span>系统实例</span>
- </div>
- <div class="graphInfoContent">
- <span>实例1</span>
- </div>
- <div class="graphInfoName">
- <span>系统图模版</span>
- </div>
- <div class="graphInfoContent">
- <span>模版1</span>
- </div>
- <div class="graphInfoName">
- <span>所属项目</span>
- </div>
- <div class="graphInfoContent">
- <span>银泰中心</span>
- </div>
- <div class="graphInfoName">
- <span>当前状态</span>
- </div>
- <div class="graphInfoContent">
- <span>草稿</span>
- </div>
- </div>
- <div></div>
- </div>
- <el-dialog title="新建系统图" :visible="operState == 2" :show-close="false">
- <div class="createConContainer">
- <div>系统图名称*</div>
- <div class="createCdCon">
- <el-input v-model="createGraphName" placeholder="请输入"></el-input>
- </div>
- <div class="createCdTitle">项目*</div>
- <div class="createCdCon">
- <el-select
- v-model="selProject"
- value-key="id"
- placeholder="请选择项目"
- >
- <el-option
- v-for="item in projects"
- :key="item.id"
- :label="item.name"
- :value="item"
- >
- </el-option>
- </el-select>
- </div>
- <div class="createCdTitle">系统实例*</div>
- <div class="createCdCon">
- <el-select
- v-model="selSystemIns"
- value-key="id"
- placeholder="请选择系统实例"
- >
- <el-option
- v-for="item in systemInsArr"
- :key="item.id"
- :label="item.name"
- :value="item"
- >
- </el-option>
- </el-select>
- </div>
- <div class="createCdTitle">系统图模板*</div>
- <div class="createCdCon">
- <el-select
- v-model="selSystemTemplate"
- value-key="id"
- placeholder="请选择系统图模板"
- >
- <el-option
- v-for="item in systemTemplateArr"
- :key="item.id"
- :label="item.name"
- :value="item"
- >
- </el-option>
- </el-select>
- </div>
- <div class="createFoot">
- <el-button @click="cancelCreate">取消</el-button>
- <el-button type="primary">确定</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { mapState } from "vuex";
- export default {
- props: [],
- data() {
- return {
- //缩放范围
- scaleArr: [
- {
- name: "25%",
- value: 25,
- },
- {
- name: "50%",
- value: 50,
- },
- {
- name: "75%",
- value: 75,
- },
- {
- name: "100%",
- value: 100,
- },
- {
- name: "150%",
- value: 150,
- },
- ],
- //选择的缩放范围
- selectScale: {},
- //操作状态 0 预览; 1 编辑; 2 新建
- operState: -1,
- //系统图ID
- diagramId: "",
- //系统图名称,用于新建时绑定输入框
- createGraphName: "",
- //选择的项目,用于新建时绑定选择框
- selProject: {},
- //系统实例列表
- systemInsArr: [
- { id: "1", name: "实例1" },
- { id: "2", name: "实例2" },
- ],
- //选择的系统实例
- selSystemIns: {},
- //系统图模板列表
- systemTemplateArr: [
- { id: "1", name: "模板1" },
- { id: "2", name: "模板2" },
- ],
- //选择的系统图模板
- selSystemTemplate: {},
- };
- },
- computed: {
- ...mapState(["projects"]),
- },
- methods: {
- //取消创建
- cancelCreate: function () {
- window.close();
- },
- },
- created() {
- this.operState = !this.$route.query.ost
- ? -1
- : parseInt(this.$route.query.ost);
- this.diagramId = !this.$route.query.did
- ? -1
- : parseInt(this.$route.query.did);
- this.selectScale = this.scaleArr[3];
- },
- mounted() {},
- components: {},
- };
- </script>
- <style>
- #divGraphEdit {
- height: 100%;
- display: flex;
- flex-direction: column;
- }
- #divGraphEdit .firstRow {
- height: 96px;
- background: #ffffff;
- box-shadow: 0px 2px 10px rgb(31 36 41 / 10%);
- display: flex;
- flex-direction: column;
- }
- #divGraphEdit .firstOperDivContainer {
- flex: 1;
- border-bottom: solid 1px #f2f2f2;
- line-height: 48px;
- }
- #divGraphEdit .firstOperDivContainer > span:not(:first-child),
- #divGraphEdit .operBtnDiv span {
- cursor: pointer;
- }
- #divGraphEdit .secondOperDivContainer {
- flex: 1;
- }
- #divGraphEdit .headerTitle {
- font-weight: 600;
- margin-left: 15px;
- }
- #divGraphEdit .operBtnDiv {
- display: inline-block;
- margin-left: 52px;
- font-weight: 500;
- }
- #divGraphEdit .operBtnDiv span {
- margin-left: 20px;
- }
- #divGraphEdit .delBtn {
- float: right;
- margin-right: 49px;
- }
- #divGraphEdit .imgBar {
- margin-left: 33px;
- vertical-align: middle;
- }
- #divGraphEdit .sanjiaoBar {
- vertical-align: middle;
- }
- #divGraphEdit .splitLine {
- display: inline-block;
- height: 30px;
- border-left: solid 1px #d8d8d8;
- vertical-align: middle;
- margin-left: 26px;
- border-top: none;
- }
- #divGraphEdit .secondOperDivContainer input {
- border: none !important;
- width: 66px;
- padding: 0;
- }
- #divGraphEdit .secondOperDivContainer .el-select {
- margin-left: 26px;
- }
- #divGraphEdit .zoomin {
- margin-left: 20px;
- }
- #divGraphEdit .zoomout {
- margin-left: 14px;
- }
- #divGraphEdit .imgLeftTop {
- vertical-align: middle;
- margin-left: 26px;
- }
- #divGraphEdit .rightLeftTop {
- vertical-align: middle;
- margin-left: 22px;
- }
- #divGraphEdit .resetBtn {
- float: right;
- margin-right: 49px;
- line-height: 48px;
- cursor: pointer;
- }
- #divGraphEdit .createCdTitle {
- margin-top: 16px;
- }
- #divGraphEdit .createCdCon {
- margin-top: 8px;
- width: 360px;
- }
- #divGraphEdit .createCdCon .el-select {
- width: 100%;
- }
- #divGraphEdit .createConContainer {
- margin-left: 80px;
- }
- #divGraphEdit .createFoot {
- float: right;
- margin-right: 73px;
- margin-top: 80px;
- }
- #divGraphEdit .el-dialog {
- width: 560px;
- height: 520px;
- }
- #divGraphEdit .secondRow {
- flex: 1;
- display: flex;
- flex-direction: row;
- }
- #divGraphEdit .graphInfoContainer {
- background: #fafafa;
- width: 200px;
- height: 100%;
- box-shadow: 0px 0px 1px rgb(0 0 0 / 25%);
- }
- #divGraphEdit .graphInfoFirst {
- margin-top: 31px;
- }
- #divGraphEdit .graphInfoName {
- margin-left: 12px;
- margin-top: 21px;
- }
- #divGraphEdit .graphInfoFirstEdit {
- margin-right: 12px;
- float: right;
- color: #0091ff;
- cursor: pointer;
- }
- #divGraphEdit .graphInfoContent {
- margin-top: 12px;
- margin-left: 36px;
- }
- </style>
|