edit.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <template>
  2. <div id="divGraphEdit">
  3. <div class="firstRow">
  4. <div class="firstOperDivContainer">
  5. <img
  6. class="imgBar"
  7. src="../../assets/images/systemGraph/editLogo.svg"
  8. />
  9. <span class="headerTitle">系统图编辑器</span>
  10. <div class="operBtnDiv" v-if="operState === 0">
  11. <span>回到首页</span>
  12. <span>编辑系统图</span>
  13. <span>上架系统图</span>
  14. <span>下架系统图</span>
  15. </div>
  16. <div class="operBtnDiv" v-if="operState === 1">
  17. <span>保存图纸</span>
  18. <span>放弃编辑</span>
  19. </div>
  20. <span class="delBtn">删除图纸</span>
  21. </div>
  22. <div class="secondOperDivContainer">
  23. <img
  24. class="imgBar"
  25. src="../../assets/images/systemGraph/barController.svg"
  26. />
  27. <span class="el-icon-caret-bottom sanjiaoBar"></span>
  28. <hr class="splitLine" />
  29. <el-select v-model="selectScale" value-key="value">
  30. <el-option
  31. v-for="item in scaleArr"
  32. :key="item.value"
  33. :label="item.name"
  34. :value="item"
  35. >
  36. </el-option>
  37. </el-select>
  38. <span class="el-icon-zoom-in zoomin"></span>
  39. <span class="el-icon-zoom-out zoomout"></span>
  40. <hr class="splitLine" v-if="operState == 1" />
  41. <img
  42. v-if="operState == 1"
  43. class="imgLeftTop"
  44. src="../../assets/images/systemGraph/leftTop.svg"
  45. />
  46. <img
  47. v-if="operState == 1"
  48. class="rightLeftTop"
  49. src="../../assets/images/systemGraph/rightTop.svg"
  50. />
  51. <hr class="splitLine" v-if="operState == 1" />
  52. <img
  53. v-if="operState == 1"
  54. class="imgLeftTop"
  55. src="../../assets/images/systemGraph/text.svg"
  56. />
  57. <span class="resetBtn" v-if="operState == 1">重置为自动出图样式</span>
  58. </div>
  59. </div>
  60. <div class="secondRow">
  61. <div class="graphInfoContainer" v-if="operState === 0 || operState === 1">
  62. <div class="graphInfoFirst">
  63. <span class="graphInfoName">系统图名称</span>
  64. <span class="graphInfoFirstEdit">编辑</span>
  65. </div>
  66. <div class="graphInfoContent">
  67. <span>高压系统1#系统图</span>
  68. </div>
  69. <div class="graphInfoName">
  70. <span>系统图类型</span>
  71. </div>
  72. <div class="graphInfoContent">
  73. <span>高压配电</span>
  74. </div>
  75. <div class="graphInfoName">
  76. <span>系统实例</span>
  77. </div>
  78. <div class="graphInfoContent">
  79. <span>实例1</span>
  80. </div>
  81. <div class="graphInfoName">
  82. <span>系统图模版</span>
  83. </div>
  84. <div class="graphInfoContent">
  85. <span>模版1</span>
  86. </div>
  87. <div class="graphInfoName">
  88. <span>所属项目</span>
  89. </div>
  90. <div class="graphInfoContent">
  91. <span>银泰中心</span>
  92. </div>
  93. <div class="graphInfoName">
  94. <span>当前状态</span>
  95. </div>
  96. <div class="graphInfoContent">
  97. <span>草稿</span>
  98. </div>
  99. </div>
  100. <div></div>
  101. </div>
  102. <el-dialog title="新建系统图" :visible="operState == 2" :show-close="false">
  103. <div class="createConContainer">
  104. <div>系统图名称*</div>
  105. <div class="createCdCon">
  106. <el-input v-model="createGraphName" placeholder="请输入"></el-input>
  107. </div>
  108. <div class="createCdTitle">项目*</div>
  109. <div class="createCdCon">
  110. <el-select
  111. v-model="selProject"
  112. value-key="id"
  113. placeholder="请选择项目"
  114. >
  115. <el-option
  116. v-for="item in projects"
  117. :key="item.id"
  118. :label="item.name"
  119. :value="item"
  120. >
  121. </el-option>
  122. </el-select>
  123. </div>
  124. <div class="createCdTitle">系统实例*</div>
  125. <div class="createCdCon">
  126. <el-select
  127. v-model="selSystemIns"
  128. value-key="id"
  129. placeholder="请选择系统实例"
  130. >
  131. <el-option
  132. v-for="item in systemInsArr"
  133. :key="item.id"
  134. :label="item.name"
  135. :value="item"
  136. >
  137. </el-option>
  138. </el-select>
  139. </div>
  140. <div class="createCdTitle">系统图模板*</div>
  141. <div class="createCdCon">
  142. <el-select
  143. v-model="selSystemTemplate"
  144. value-key="id"
  145. placeholder="请选择系统图模板"
  146. >
  147. <el-option
  148. v-for="item in systemTemplateArr"
  149. :key="item.id"
  150. :label="item.name"
  151. :value="item"
  152. >
  153. </el-option>
  154. </el-select>
  155. </div>
  156. <div class="createFoot">
  157. <el-button @click="cancelCreate">取消</el-button>
  158. <el-button type="primary">确定</el-button>
  159. </div>
  160. </div>
  161. </el-dialog>
  162. </div>
  163. </template>
  164. <script>
  165. import { mapState } from "vuex";
  166. export default {
  167. props: [],
  168. data() {
  169. return {
  170. //缩放范围
  171. scaleArr: [
  172. {
  173. name: "25%",
  174. value: 25,
  175. },
  176. {
  177. name: "50%",
  178. value: 50,
  179. },
  180. {
  181. name: "75%",
  182. value: 75,
  183. },
  184. {
  185. name: "100%",
  186. value: 100,
  187. },
  188. {
  189. name: "150%",
  190. value: 150,
  191. },
  192. ],
  193. //选择的缩放范围
  194. selectScale: {},
  195. //操作状态 0 预览; 1 编辑; 2 新建
  196. operState: -1,
  197. //系统图ID
  198. diagramId: "",
  199. //系统图名称,用于新建时绑定输入框
  200. createGraphName: "",
  201. //选择的项目,用于新建时绑定选择框
  202. selProject: {},
  203. //系统实例列表
  204. systemInsArr: [
  205. { id: "1", name: "实例1" },
  206. { id: "2", name: "实例2" },
  207. ],
  208. //选择的系统实例
  209. selSystemIns: {},
  210. //系统图模板列表
  211. systemTemplateArr: [
  212. { id: "1", name: "模板1" },
  213. { id: "2", name: "模板2" },
  214. ],
  215. //选择的系统图模板
  216. selSystemTemplate: {},
  217. };
  218. },
  219. computed: {
  220. ...mapState(["projects"]),
  221. },
  222. methods: {
  223. //取消创建
  224. cancelCreate: function () {
  225. window.close();
  226. },
  227. },
  228. created() {
  229. this.operState = !this.$route.query.ost
  230. ? -1
  231. : parseInt(this.$route.query.ost);
  232. this.diagramId = !this.$route.query.did
  233. ? -1
  234. : parseInt(this.$route.query.did);
  235. this.selectScale = this.scaleArr[3];
  236. },
  237. mounted() {},
  238. components: {},
  239. };
  240. </script>
  241. <style>
  242. #divGraphEdit {
  243. height: 100%;
  244. display: flex;
  245. flex-direction: column;
  246. }
  247. #divGraphEdit .firstRow {
  248. height: 96px;
  249. background: #ffffff;
  250. box-shadow: 0px 2px 10px rgb(31 36 41 / 10%);
  251. display: flex;
  252. flex-direction: column;
  253. }
  254. #divGraphEdit .firstOperDivContainer {
  255. flex: 1;
  256. border-bottom: solid 1px #f2f2f2;
  257. line-height: 48px;
  258. }
  259. #divGraphEdit .firstOperDivContainer > span:not(:first-child),
  260. #divGraphEdit .operBtnDiv span {
  261. cursor: pointer;
  262. }
  263. #divGraphEdit .secondOperDivContainer {
  264. flex: 1;
  265. }
  266. #divGraphEdit .headerTitle {
  267. font-weight: 600;
  268. margin-left: 15px;
  269. }
  270. #divGraphEdit .operBtnDiv {
  271. display: inline-block;
  272. margin-left: 52px;
  273. font-weight: 500;
  274. }
  275. #divGraphEdit .operBtnDiv span {
  276. margin-left: 20px;
  277. }
  278. #divGraphEdit .delBtn {
  279. float: right;
  280. margin-right: 49px;
  281. }
  282. #divGraphEdit .imgBar {
  283. margin-left: 33px;
  284. vertical-align: middle;
  285. }
  286. #divGraphEdit .sanjiaoBar {
  287. vertical-align: middle;
  288. }
  289. #divGraphEdit .splitLine {
  290. display: inline-block;
  291. height: 30px;
  292. border-left: solid 1px #d8d8d8;
  293. vertical-align: middle;
  294. margin-left: 26px;
  295. border-top: none;
  296. }
  297. #divGraphEdit .secondOperDivContainer input {
  298. border: none !important;
  299. width: 66px;
  300. padding: 0;
  301. }
  302. #divGraphEdit .secondOperDivContainer .el-select {
  303. margin-left: 26px;
  304. }
  305. #divGraphEdit .zoomin {
  306. margin-left: 20px;
  307. }
  308. #divGraphEdit .zoomout {
  309. margin-left: 14px;
  310. }
  311. #divGraphEdit .imgLeftTop {
  312. vertical-align: middle;
  313. margin-left: 26px;
  314. }
  315. #divGraphEdit .rightLeftTop {
  316. vertical-align: middle;
  317. margin-left: 22px;
  318. }
  319. #divGraphEdit .resetBtn {
  320. float: right;
  321. margin-right: 49px;
  322. line-height: 48px;
  323. cursor: pointer;
  324. }
  325. #divGraphEdit .createCdTitle {
  326. margin-top: 16px;
  327. }
  328. #divGraphEdit .createCdCon {
  329. margin-top: 8px;
  330. width: 360px;
  331. }
  332. #divGraphEdit .createCdCon .el-select {
  333. width: 100%;
  334. }
  335. #divGraphEdit .createConContainer {
  336. margin-left: 80px;
  337. }
  338. #divGraphEdit .createFoot {
  339. float: right;
  340. margin-right: 73px;
  341. margin-top: 80px;
  342. }
  343. #divGraphEdit .el-dialog {
  344. width: 560px;
  345. height: 520px;
  346. }
  347. #divGraphEdit .secondRow {
  348. flex: 1;
  349. display: flex;
  350. flex-direction: row;
  351. }
  352. #divGraphEdit .graphInfoContainer {
  353. background: #fafafa;
  354. width: 200px;
  355. height: 100%;
  356. box-shadow: 0px 0px 1px rgb(0 0 0 / 25%);
  357. }
  358. #divGraphEdit .graphInfoFirst {
  359. margin-top: 31px;
  360. }
  361. #divGraphEdit .graphInfoName {
  362. margin-left: 12px;
  363. margin-top: 21px;
  364. }
  365. #divGraphEdit .graphInfoFirstEdit {
  366. margin-right: 12px;
  367. float: right;
  368. color: #0091ff;
  369. cursor: pointer;
  370. }
  371. #divGraphEdit .graphInfoContent {
  372. margin-top: 12px;
  373. margin-left: 36px;
  374. }
  375. </style>