attr_select.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884
  1. <template>
  2. <div id="attr-select">
  3. <!--选中-->
  4. <div class="attr-select" v-if="type==='baseLine'">
  5. <span class="grid-title">外观</span>
  6. <div class="row">
  7. <div class="row-tit">线宽</div>
  8. <div class="grid-content">
  9. <a-input-number
  10. v-model="lineWidth"
  11. :min="1"
  12. :max="9"
  13. @change="changeLineWidth"
  14. style="width: 168px"
  15. />
  16. </div>
  17. <div class="color-choice">
  18. <swatches v-model="borderColor" popover-x="left" @close="changeBorderColor" />
  19. </div>
  20. </div>
  21. <div class="row">
  22. <div class="row-tit">线型</div>
  23. <a-select
  24. style="width: 208px"
  25. v-model="borderStyle"
  26. :default-value="borderLineOption[0].id"
  27. @change="changeBorder"
  28. >
  29. <a-select-option
  30. v-for="item in borderLineOption"
  31. :key="item.id"
  32. :label="item.src"
  33. :value="item.id"
  34. >
  35. <img :src="item.src" alt width='180' />
  36. </a-select-option>
  37. </a-select>
  38. </div>
  39. </div>
  40. <!--文字内容-->
  41. <div class="attr-select" v-if="type==='baseText'">
  42. <span class="grid-title">文字内容</span>
  43. <div class="grid-content">
  44. <a-textarea
  45. placeholder="请在此处输入文字!"
  46. v-model="textMsg"
  47. allow-clear
  48. @change="changeTextArea"
  49. :rows="4"
  50. />
  51. </div>
  52. <span class="grid-title">外观</span>
  53. <div class="row">
  54. <div class="row-tit">字号</div>
  55. <div class="grid-content">
  56. <a-input-number v-model="fontSize" :min="1" @change="changeFont" style="width: 168px" />
  57. </div>
  58. <div class="color-choice">
  59. <swatches v-model="fontColor" :swatches="swatchesFont" popover-x="left" @close="changeFontColor" />
  60. </div>
  61. </div>
  62. <div class="row">
  63. <div class="row-tit">背景色</div>
  64. <div class="color-choice">
  65. <swatches
  66. v-model="backColor"
  67. :swatches="swatches"
  68. popover-x="left"
  69. @close="changebackColor"
  70. />
  71. </div>
  72. </div>
  73. </div>
  74. <!--图片-->
  75. <div class="attr-select" v-if="type=='baseImage'">
  76. <span class="grid-title">图片</span>
  77. <section class="grid">
  78. <div class="grid-content">
  79. <a-upload-dragger
  80. name="file"
  81. accept="image/*"
  82. :customRequest="customRequest"
  83. :showUploadList="false"
  84. action="https://jsonplaceholder.typicode.com/posts/"
  85. @change="changeImage"
  86. >
  87. <p class="icon-image">
  88. <a-icon type="cloud-upload" />
  89. </p>
  90. <p class="ant-upload-text">将图片拖动到这里替换</p>
  91. <p class="ant-upload-hint">本地上传</p>
  92. </a-upload-dragger>
  93. </div>
  94. </section>
  95. <span class="grid-title">外观</span>
  96. <div class="row">
  97. <div class="row-tit">边框</div>
  98. <div class="grid-content">
  99. <a-input-number
  100. v-model="lineWidth"
  101. :min="1"
  102. :max="9"
  103. @change="changeLineWidth"
  104. style="width: 168px"
  105. />
  106. </div>
  107. <div class="color-choice">
  108. <swatches v-model="borderColor" popover-x="left" @close="changeBorderColor" />
  109. </div>
  110. </div>
  111. </div>
  112. <!--针对“设备/位置/管线/分区”属性示例-->
  113. <div class="attr-select" v-show="type =='Image'|| type == 'Line' || type == 'Zone'">
  114. <div v-if="type =='Image'|| type == 'Line'">
  115. <div class="row">
  116. <div class="row-tit">显示名称</div>
  117. <a-button type="link" class="edit-option-btn" @click="OpenEditStatus">{{isEdit? "取消编辑" : editStatus[type]}}</a-button>
  118. </div>
  119. <div :class="['row' ,type == 'Line'?'disabled-textarea':'']">
  120. <a-textarea :disabled="type == 'Line' "
  121. placeholder=""
  122. v-model="lengedName"
  123. allow-clear
  124. @change="changeLengedName"
  125. :auto-size="{ minRows: 2}"
  126. />
  127. <!-- <a-input v-model="lengedName" @change="changeLengedName" />-->
  128. </div>
  129. <div class="row" v-show="type =='Image'">
  130. <div class="row-tit">字号</div>
  131. <div class="grid-content">
  132. <a-input-number v-model="fontSize" :min="1" @change="changeFont" style="width: 168px" />
  133. </div>
  134. <div class="color-choice">
  135. <swatches v-model="fontColor" :swatches="swatchesFont" @close="changeFontColor" popover-x="left" />
  136. </div>
  137. </div>
  138. <!-- 当为设备状态时 -->
  139. <div class="row" v-if="type =='Image'">
  140. <div class="row-tit">数量</div>
  141. <div class="grid-content">
  142. <a-input-number
  143. v-model="imageNum"
  144. :min="attrCards.length==imageNum?imageNum:1"
  145. @change="changeImageNum"
  146. style="width: 208px"
  147. />
  148. </div>
  149. </div>
  150. <!-- 当为管道状态时 -->
  151. <div class="row" v-if="type =='Line'">
  152. <div class="row-tit">线宽</div>
  153. <div class="grid-content">
  154. <a-input-number
  155. v-model="lineWidth"
  156. :min="1"
  157. :max="9"
  158. @change="changeLineWidth"
  159. style="width: 208px"
  160. />
  161. </div>
  162. </div>
  163. </div>
  164. <div v-if="type == 'Zone'">
  165. <div v-if="SubType=='FHFQ'">
  166. <!-- 防火分区 -->
  167. <div class="row-tit">颜色</div>
  168. <div class="row">
  169. <swatches @input="fhfqchangefillColor" :swatches="swatchess" v-model="fillColor" inline></swatches>
  170. </div>
  171. <div class="row">
  172. <div class="row-tit">显示名称</div>
  173. <a-button
  174. type="link"
  175. class="edit-option-btn"
  176. @click="OpenEditStatus"
  177. >{{isEdit? "取消编辑" : editStatus[type]}}</a-button>
  178. </div>
  179. <div class="row">
  180. <a-textarea
  181. placeholder=""
  182. v-model="lengedName"
  183. allow-clear
  184. @change="changeLengedName"
  185. :auto-size="{ minRows: 2}"
  186. />
  187. <!-- <a-input v-model="lengedName" @change="changeLengedName" />-->
  188. </div>
  189. <div class="row">
  190. <div class="row-tit">字号</div>
  191. <div class="grid-content">
  192. <a-input-number
  193. v-model="fontSize"
  194. :min="1"
  195. @change="changeFont"
  196. style="width: 168px"
  197. />
  198. </div>
  199. <div class="color-choice">
  200. <swatches v-model="fontColor" :swatches="swatchesFont" @close="changeFontColor" popover-x="left" />
  201. </div>
  202. </div>
  203. </div>
  204. <div v-if="SubType=='SCPZ'">
  205. <!-- 石材铺装 -->
  206. <div class="row">
  207. <div class="row-tit">图例说明</div>
  208. <a-button type="link" class="edit-option-btn" @click="OpenEditStatus">{{isEdit? "取消编辑" : editStatus[type]}}</a-button>
  209. </div>
  210. <div class="row">
  211. <a-textarea
  212. @change="changeitemExplain"
  213. v-model="itemExplain"
  214. :auto-size="{ minRows: 4, maxRows: 6 }"
  215. />
  216. </div>
  217. <div class="row">
  218. <div class="row-tit">描边</div>
  219. <div class="grid-content">
  220. <a-input-number
  221. v-model="lineWidth"
  222. :min="1"
  223. :max="9"
  224. @change="changeLineWidth"
  225. style="width: 168px"
  226. />
  227. </div>
  228. <div class="color-choice">
  229. <swatches v-model="borderColor" @close="changeBorderColor" popover-x="left" />
  230. </div>
  231. </div>
  232. <div class="row">
  233. <div class="row-tit">填充</div>
  234. <div class="color-choice">
  235. <swatches v-model="fillColor" @close="changefillColor" popover-x="left" />
  236. </div>
  237. </div>
  238. </div>
  239. <div v-if="SubType=='CUSTOM'">
  240. <!-- 自定义 -->
  241. <div class="row-tit">
  242. <span style="margin-right:10px;color:#8d9399">填充颜色</span>
  243. <el-color-picker show-alpha v-model="CUSTOMbgColor" @change='changBgColor' style="vertical-align:middle;"></el-color-picker>
  244. </div>
  245. <div class="row-tit">
  246. <span style="margin-right:10px;color:#8d9399">边框颜色</span>
  247. <el-color-picker show-alpha v-model="CUSTOMbdColor" @change='changBdColor' style="vertical-align:middle;"></el-color-picker>
  248. </div>
  249. <div class="row">
  250. <div class="row-tit">显示名称</div>
  251. <a-button type="link" class="edit-option-btn" @click="OpenEditStatus">{{isEdit? "取消编辑" : editStatus[type]}}</a-button>
  252. </div>
  253. <div class="row">
  254. <a-textarea placeholder="" v-model="lengedName" allow-clear @change="changeLengedName" :auto-size="{ minRows: 2}"/>
  255. </div>
  256. <div class="row">
  257. <div class="row-tit">字号</div>
  258. <div class="grid-content">
  259. <a-input-number v-model="fontSize" :min="1" @change="changeFont" style="width: 168px" />
  260. </div>
  261. <div class="color-choice">
  262. <swatches v-model="fontColor" :swatches="swatchesFont" @close="changeFontColor" popover-x="left" />
  263. </div>
  264. </div>
  265. </div>
  266. <div v-if="!SubType">
  267. <!-- 普通分区 -->
  268. <div class="row">
  269. <div class="row-tit">显示名称</div>
  270. <a-button
  271. type="link"
  272. class="edit-option-btn"
  273. @click="OpenEditStatus"
  274. >{{isEdit? "取消编辑" : editStatus[type]}}</a-button>
  275. </div>
  276. <div class="row">
  277. <a-textarea
  278. placeholder=""
  279. v-model="lengedName"
  280. allow-clear
  281. @change="changeLengedName"
  282. :auto-size="{ minRows: 2}"
  283. />
  284. <!-- <a-input v-model="lengedName" @change="changeLengedName" />-->
  285. </div>
  286. <div class="row">
  287. <div class="row-tit">字号</div>
  288. <div class="grid-content">
  289. <a-input-number
  290. v-model="fontSize"
  291. :min="1"
  292. @change="changeFont"
  293. style="width: 168px"
  294. />
  295. </div>
  296. <div class="color-choice">
  297. <swatches v-model="fontColor" :swatches="swatchesFont" @close="changeFontColor" popover-x="left" />
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. <!--设备/工程信息化ID/工程信息化中的位置类型-->
  304. <div
  305. class="attr-select attr-select-bottom"
  306. v-if="type =='Zone' || type =='Image'||type == 'Line'"
  307. >
  308. <a-spin :spinning="spinning">
  309. <div class="row">
  310. <span class="edit-option-text">{{type =='Zone'?`工程信息化中的位置类型`:'工程信息化中的设备类型'}}</span>
  311. <a-button type="link" class="edit-option-btn" @click="handleEdit">选择编辑</a-button>
  312. </div>
  313. <div class="grid-content" style="margin-top: 12px;">
  314. <a-card class="attr-card" v-for="(item,index) in attrCards" :key="index">{{item.sbjc ||item.wzjc}}</a-card>
  315. </div>
  316. </a-spin>
  317. </div>
  318. <!-- 快捷操作提示-->
  319. <div style="position: fixed;bottom: 0;width: 280px;" class="key-boards">
  320. <a-collapse :bordered="false" expand-icon-position="right">
  321. <template #expandIcon="props">
  322. <a-icon type="caret-up" :rotate="props.isActive ? 180 : 0" />
  323. </template>
  324. <a-collapse-panel key="1" :style="customStyle">
  325. <template slot="header">
  326. <div style="font-size: 12px;color: #8D9399;">
  327. <a-icon type="exclamation-circle" />
  328. <span style="margin-left: 5px;">键盘操作提示</span>
  329. </div>
  330. </template>
  331. <p
  332. v-for="item in keyboardOperation"
  333. :key="item.value"
  334. style="display: flex;margin-top: 13px;"
  335. >
  336. <span>{{item.value}}</span>
  337. <span class="key-board">{{item.keys}}</span>
  338. <span v-if="item.events" style="margin: 0 5px;">
  339. +
  340. <img style="width:13px;height:18px;" src="./../../assets/images/shubiao.png" alt />
  341. </span>
  342. <span>{{item.events}}</span>
  343. </p>
  344. </a-collapse-panel>
  345. </a-collapse>
  346. </div>
  347. <editDialog ref="dialog" :attrCards="attrCards" :GraphElementId="GraphElementId" :InfoLocal="InfoLocal" :sysNum="imageNum" :key="new Date().getTime()" />
  348. <!-- <editDialog ref="dialog" :attrCards="attrCards" :getmajorId="getmajorId" :InfoLocal="InfoLocal" :sysNum="imageNum" :key="new Date().getTime()" />-->
  349. <!-- <editDialog ref="dialog" :typeEdit="2" :getmajorId="'1001'" :sysNum="5" />-->
  350. </div>
  351. </template>
  352. <script>
  353. import editDialog from "./edit-dialog";
  354. import Swatches from "vue-swatches";
  355. import bus from "@/bus";
  356. import "vue-swatches/dist/vue-swatches.css";
  357. import { SLineStyle } from "@saga-web/graph/lib";
  358. import { SItemStatus } from "@saga-web/big";
  359. import {
  360. uploadImg,
  361. queryGlsmsLocation,
  362. queryGlsmsAsset
  363. } from "@/api/editer.js";
  364. import { getUrlMsg } from "@/components/urlMsg.js";
  365. // mapclass里边的没有透明度
  366. import { hexify } from "@/utils/rgbaUtil"
  367. import { SCustomLegendItem } from '@/lib/items/SCustomLegendItem';
  368. export default {
  369. name: "attr_select",
  370. props: ["type", "focusItemList"],
  371. components: { editDialog, Swatches },
  372. data() {
  373. return {
  374. precisionList: [{ value: 10 }, { value: 20 }, { value: 30 }],
  375. precision: true,
  376. customStyle:
  377. "background: #fff;overflow: hidden; box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.11);border:0",
  378. keyboardOperation: [
  379. { value: "拖动画布:", keys: "Space", events: "Click" },
  380. { value: "加选对象:", keys: "Ctrl", events: "Press" },
  381. { value: "确认操作:", keys: "Enter" },
  382. { value: "取消对象:", keys: "Enter" }
  383. ],
  384. numberValue: 3,
  385. fontSize: 12, //字体大小
  386. lineWidth: 0,
  387. textMsg: "", //
  388. color: "#1CA085",
  389. fontColor: "#1CA085", //文字颜色
  390. borderColor: "", // 边框颜色 直线,折线,多边形等
  391. backColor: "", //背景色 用于text文字
  392. borderStyle: "solid",
  393. borderLineOption: [
  394. {
  395. id: "solid",
  396. src: require("@/assets/images/solidLine.png")
  397. },
  398. {
  399. id: "dashed",
  400. src: require("@/assets/images/dashedLine.png")
  401. },
  402. {
  403. id: "dotted",
  404. src: require("@/assets/images/dotLine.png")
  405. }
  406. ],
  407. linepxOption: [
  408. {
  409. id: 1,
  410. src: require("@/assets/images/1pxline.jpg")
  411. },
  412. {
  413. id: 2,
  414. src: require("@/assets/images/2pxline.jpg")
  415. },
  416. {
  417. id: 3,
  418. src: require("@/assets/images/3pxline.jpg")
  419. }
  420. ],
  421. editStatus: {
  422. Image: "编辑设备",
  423. Line: "管道编辑",
  424. Zone: "编辑区域"
  425. },
  426. swatchess: ["#57C5FC", "#5F6CE1", "#71B312", "#00A177"],
  427. swatches: [
  428. "#f7f9facc",
  429. "#1FBC9C",
  430. "#1CA085",
  431. "#2ECC70",
  432. "#27AF60",
  433. "#3398DB",
  434. "#2980B9",
  435. "#A463BF",
  436. "#8E43AD",
  437. "#3D556E",
  438. "#222F3D",
  439. "#00000000",
  440. ],
  441. swatchesFont: [
  442. "#1fbc9c",
  443. "#1ca085",
  444. "#2ecc70",
  445. "#27af60",
  446. "#3398db",
  447. "#2980b9",
  448. "#a463bf",
  449. "#8e43ad",
  450. "#646c73",
  451. "#1f2429",
  452. "#f2c511",
  453. "#f39c19",
  454. "#e84b3c",
  455. "#c0382b",
  456. "#dde6e8",
  457. "#bdc3c8"
  458. ],
  459. lengedName: "", // 图例名称
  460. imageNum: 1, //设备数量
  461. fillColor: "", //修改填充色 (主要针对防火风区以及石材铺装)
  462. SubType: "", //空间类型,区分石材铺装
  463. itemExplain: "", //图例说明 只针对石材铺装
  464. attrCards: [],
  465. spinning: false,
  466. isEdit: false,
  467. getmajorId: "",
  468. InfoLocal:[],
  469. GraphElementId:'',//图例Id
  470. CUSTOMbgColor: 'rgba(0,0,0,0.15)', // 自定义多边形背景色
  471. CUSTOMbdColor: 'rgba(0,0,0,1)', // 自定义多边形线条色
  472. };
  473. },
  474. methods: {
  475. onChange(e) {
  476. this.precision = e.target.checked === true ? false : true;
  477. },
  478. changeBorder(value) {
  479. bus.$emit("changeBorder", value);
  480. },
  481. changeNumber() {
  482. bus.$emit("changeFont", this.fontSize);
  483. },
  484. // 改变字体大小
  485. changeFont() {
  486. bus.$emit("changeFont", this.fontSize);
  487. },
  488. // 改变线宽
  489. changeLineWidth() {
  490. bus.$emit("changeLineWidth", this.lineWidth);
  491. },
  492. // 改变文案
  493. changeTextArea() {
  494. bus.$emit("changeText", this.textMsg);
  495. },
  496. // 改变线的颜色
  497. changeBorderColor() {
  498. if (this.borderColor) {
  499. bus.$emit("changeBorderColor", this.borderColor);
  500. }
  501. },
  502. // 改变字体颜色
  503. changeFontColor(color) {
  504. if (color) {
  505. bus.$emit("changeFontColor", color);
  506. }
  507. },
  508. changebackColor(color) {
  509. if (color) {
  510. bus.$emit("changebackColor", color);
  511. }
  512. },
  513. // 用户自定义多边形 修改背景色
  514. changBgColor(val){
  515. const color = hexify(val); // 转为16进制
  516. bus.$emit('CUSTOMbgColor',color)
  517. },
  518. // 用户自定义多边形 修改现调颜色
  519. changBdColor(val){
  520. const color = hexify(val); // 转为16进制
  521. bus.$emit('CUSTOMbdColor',color)
  522. },
  523. customRequest(info) {
  524. const formData = new FormData();
  525. formData.append("file", info.file);
  526. const postParams = formData;
  527. uploadImg({ postParams }).then(res => {
  528. if (res.Result == "success") {
  529. bus.$emit("upadataImageUrl", res.EntityList[0]);
  530. this.$message.success(
  531. `${info.file.name} file uploaded successfully.`
  532. );
  533. } else {
  534. this.$message.error(`${info.file.name} file upload failed.`);
  535. }
  536. });
  537. },
  538. //更改图例名称
  539. changeLengedName() {
  540. bus.$emit("changeLengedName", this.lengedName);
  541. },
  542. changeImage(info) {
  543. const status = info.file.status;
  544. console.log(status);
  545. if (status !== "uploading") {
  546. console.log(info.file, info.fileList);
  547. }
  548. if (status === "done") {
  549. this.$message.success(`${info.file.name} file uploaded successfully.`);
  550. } else if (status === "error") {
  551. this.$message.error(`${info.file.name} file upload failed.`);
  552. }
  553. },
  554. handleEdit() {
  555. this.$refs.dialog.showModal();
  556. },
  557. // 修改设备数量
  558. changeImageNum() {
  559. if (this.imageNum < this.attrCards.length) {
  560. this.imageNum = this.attrCards.length;
  561. return false;
  562. }
  563. if (!this.imageNum) {
  564. this.imageNum = 1;
  565. }
  566. bus.$emit("changeImageNum", this.imageNum);
  567. },
  568. // 石材铺装
  569. changefillColor() {
  570. if (this.fillColor) {
  571. bus.$emit("changefillColor", this.fillColor);
  572. }
  573. },
  574. // 防火分区
  575. fhfqchangefillColor() {
  576. if (this.fillColor) {
  577. bus.$emit("changeBorderColor", this.fillColor);
  578. bus.$emit("changefillColor", this.fillColor);
  579. }
  580. },
  581. //设置缩小item为编辑状态
  582. OpenEditStatus() {
  583. this.isEdit = !this.isEdit;
  584. bus.$emit("OpenEditStatus");
  585. },
  586. // 编辑图例说明
  587. changeitemExplain() {
  588. bus.$emit("changeitemExplain", this.itemExplain);
  589. },
  590. // 更改工程信息化数据
  591. changeAttachObjectIds(arr) {
  592. bus.$emit("changeAttachObjectIds", arr);
  593. }
  594. },
  595. watch: {
  596. focusItemList: function(newval) {
  597. console.log('------------')
  598. console.log(FENGMAP)
  599. console.log('newval',newval)
  600. const Item = newval.itemList[0];
  601. this.GraphElementId = Item.data.GraphElementId;
  602. this.imageNum = 1; //切换item初始化
  603. if (Item.data && Item.data.SubType) {
  604. this.SubType = Item.data.SubType;
  605. } else {
  606. this.SubType = "";
  607. }
  608. this.getmajorId = Item.data.Properties.InfoSystemId;
  609. this.InfoLocal = Item.data.Properties.InfoLocal;
  610. //判断点 面 带回专业类
  611. // let InfoTypeIdArr = [];
  612. // if( Item.data.Properties.InfoTypeId.length){
  613. // let InfoTypeId = Item.data.Properties.InfoTypeId;
  614. // console.log('poiList',11111111111111,FENGMAP.poiList);
  615. // console.log('spaceType',2222222222222222,FENGMAP.spaceType);
  616. // if(FENGMAP.poiList.length){
  617. // FENGMAP.poiList.join(',').split(',').map((item,index)=>{
  618. // let n = InfoTypeId.includes(item)
  619. // if(n){
  620. // InfoTypeIdArr.push(item);
  621. // }
  622. // })
  623. // }else if(FENGMAP.spaceType.length){
  624. // FENGMAP.spaceType.join(',').split(',').map((item,index)=>{
  625. // let n = InfoTypeId.includes(item)
  626. // if(n){
  627. // InfoTypeIdArr.push(item);
  628. // }
  629. // })
  630. // }else{
  631. // this.getmajorId = '';
  632. // }
  633. // }
  634. // InfoTypeIdArr.length? this.getmajorId = InfoTypeIdArr[0]:this.getmajorId ='';
  635. //结束
  636. if (newval.itemList.length == 1) {
  637. if (newval.itemType == "baseText") {
  638. this.textMsg = Item.text;
  639. this.fontSize = Item.font.size;
  640. this.fontColor = Item.color.value;
  641. this.backColor = Item.backgroundColor.value;
  642. } else if (newval.itemType == "baseLine") {
  643. this.lineWidth = Item.lineWidth;
  644. this.borderColor = Item.strokeColor.value;
  645. if (Item.lineStyle == SLineStyle.Solid) {
  646. this.borderStyle = "solid";
  647. } else if (Item.lineStyle == SLineStyle.Dashed) {
  648. this.borderStyle = "dashed";
  649. } else if (Item.lineStyle == SLineStyle.Dotted) {
  650. this.borderStyle = "dotted";
  651. }
  652. } else if (newval.itemType == "baseImage") {
  653. this.lineWidth = Item.lineWidth;
  654. this.borderColor = Item.strokeColor.value;
  655. }else if (
  656. newval.itemType == "Zone" ||
  657. newval.itemType == "Line" ||
  658. newval.itemType == "Image"
  659. ) {
  660. setTimeout(() => {
  661. this.isEdit = (Item.status == SItemStatus.Edit);
  662. }, 300)
  663. if (newval.itemType == "Image") {
  664. this.imageNum = Item.num;
  665. this.lengedName = Item.name;
  666. this.color = Item.color.value;
  667. this.fontSize = Item.font.size;
  668. } else if (newval.itemType == "Line") {
  669. // this.color = Item.color.value;
  670. this.fillColor = Item.fillColor.value;
  671. this.borderColor = Item.strokeColor.value;
  672. this.lineWidth = Item.lineWidth;
  673. this.lengedName = Item.name;
  674. } else if (newval.itemType == "Zone") {
  675. this.lengedName = Item.name;
  676. this.fontSize = Item.font.size;
  677. this.fontColor = Item.color.value;
  678. this.lineWidth = Item.lineWidth;
  679. this.borderColor = Item.strokeColor ? Item.strokeColor.value : "";
  680. this.fillColor = Item.fillColor ? Item.fillColor.value : "";
  681. this.itemExplain = "";
  682. if (Item.data.Properties.ItemExplain) {
  683. this.itemExplain = Item.data.Properties.ItemExplain
  684. ? Item.data.Properties.ItemExplain
  685. : "";
  686. }
  687. if (newval.itemList.length) {
  688. if (newval.itemList[0] instanceof SCustomLegendItem) {
  689. const fColor = newval.itemList[0].fillColor;
  690. this.CUSTOMbgColor = `rgba(${fColor.red}, ${fColor.green}, ${fColor.blue}, ${fColor.alpha/100})`
  691. const bColor = newval.itemList[0].strokeColor;
  692. this.CUSTOMbdColor = `rgba(${bColor.red}, ${bColor.green}, ${bColor.blue}, ${bColor.alpha/100})`
  693. }
  694. }
  695. }
  696. }
  697. }
  698. const locationList = [];
  699. const assetnumList = [];
  700. let params = {};
  701. this.attrCards = [];
  702. if(Item.data.AttachObjectIds && Item.data.AttachObjectIds.length ){
  703. Item.data.AttachObjectIds.map(item => {
  704. if (item.type == "Zone") {
  705. locationList.push(item.id);
  706. } else if (item.type == "Image") {
  707. assetnumList.push(item.id);
  708. }
  709. });
  710. }
  711. // if(newval.itemType == 'Zone'){
  712. this.spinning = true;
  713. if (locationList.length) {
  714. params = { locationList: locationList };
  715. } else {
  716. params = { locationList: [""] };
  717. }
  718. queryGlsmsLocation({ plazaId: getUrlMsg().projectId }, params).then(
  719. res => {
  720. this.spinning = false;
  721. if (res.data.result == "success") {
  722. console.log(res.data);
  723. if (res.data.data && res.data.data.length) {
  724. this.attrCards = this.attrCards.concat(res.data.data);
  725. }
  726. } else {
  727. // this.$message.error("工程信息化中的位置信息获取失败");
  728. }
  729. }
  730. ).catch(()=>{
  731. this.spinning = false;
  732. // this.$message.error("工程信息化中的位置信息获取失败");
  733. });
  734. // }else if(newval.itemType == 'Image'){
  735. this.spinning = true;
  736. if (assetnumList.length) {
  737. params = { assetnumList: assetnumList };
  738. } else {
  739. params = { assetnumList: [""] };
  740. }
  741. queryGlsmsAsset({ plazaId: getUrlMsg().projectId }, params).then(res => {
  742. this.spinning = false;
  743. if (res.data.result == "success") {
  744. console.log(res.data);
  745. if (res.data.data && res.data.data.length) {
  746. this.attrCards = this.attrCards.concat(res.data.data);
  747. }
  748. } else {
  749. // this.$message.error("工程信息化中的设备信息获取失败");
  750. }
  751. }).catch(()=>{
  752. this.spinning = false;
  753. // this.$message.error("工程信息化中的设备信息获取失败");
  754. });
  755. // }
  756. console.log(this.attrCards);
  757. }
  758. }
  759. };
  760. </script>
  761. <style scoped lang="less">
  762. .disabled-textarea{
  763. /deep/ .ant-input{
  764. resize: none;
  765. }
  766. }
  767. /deep/ .ant-spin-nested-loading {
  768. height: 100% !important;
  769. .ant-spin-container {
  770. height: 100% !important;
  771. }
  772. }
  773. .attr-select {
  774. padding: 12px 16px;
  775. box-sizing: border-box;
  776. .grid-title {
  777. font-size: 12px;
  778. color: #8d9399;
  779. }
  780. .row {
  781. width: 100%;
  782. display: flex;
  783. justify-content: space-between;
  784. align-items: center;
  785. margin-top: 12px;
  786. .color-choice {
  787. width: 26px;
  788. height: 26px;
  789. & /deep/ .vue-swatches__trigger {
  790. width: 26px !important;
  791. height: 26px !important;
  792. border-radius: 2px !important;
  793. border: 1px solid #dcdcdc;
  794. }
  795. }
  796. .row-tit {
  797. color: #8d9399;
  798. font-size: 14px;
  799. }
  800. }
  801. .row:first-child{
  802. margin-top: 0;
  803. }
  804. .grid {
  805. margin: 10px 15px;
  806. .grid-title {
  807. font-size: 12px;
  808. color: #8d9399;
  809. }
  810. }
  811. .grid-content {
  812. /*margin-top: 12px;*/
  813. position: relative;
  814. }
  815. .icon-image {
  816. font-size: 25px;
  817. }
  818. .edit-option-text {
  819. color: #8d9399;
  820. height: 32px;
  821. line-height: 32px;
  822. /*margin-top: -5px;*/
  823. }
  824. .edit-option-btn {
  825. float: right;
  826. /*margin-top: -5px;*/
  827. }
  828. .attr-card {
  829. width: 250px;
  830. margin-bottom: 10px;
  831. white-space: normal;
  832. box-shadow: 0px 2px 6px 0px rgba(31, 36, 41, 0.05);
  833. border-radius: 4px;
  834. }
  835. .ant-upload.ant-upload-drag p.ant-upload-text {
  836. font-size: 14px;
  837. color: #c3c7cb;
  838. }
  839. .ant-upload.ant-upload-drag p.ant-upload-hint {
  840. color: #0091ff;
  841. }
  842. }
  843. .key-boards {
  844. .key-board {
  845. width: 52px;
  846. height: 24px;
  847. border-radius: 3px;
  848. border: 1px solid rgba(195, 199, 203, 1);
  849. font-size: 14px;
  850. color: #646a73;
  851. text-align: center;
  852. }
  853. /deep/ .ant-collapse-content {
  854. border-top: 1px solid #eff0f1;
  855. }
  856. }
  857. #attr-select {
  858. width: 100%;
  859. height: 100%;
  860. .attr-select-bottom {
  861. height: 100%;
  862. width: 100%;
  863. position: absolute;
  864. overflow-y: auto;
  865. padding-bottom: 400px;
  866. }
  867. }
  868. </style>