index.vue 86 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782
  1. <!--
  2. revit扫楼数据整理
  3. -->
  4. <template>
  5. <div style="height:100%;">
  6. <div class="build_header" ref="header">
  7. <!-- 建筑选择 -->
  8. <span style="padding-right:12px;color:#999;vertical-align: middle;">建筑名称</span>
  9. <el-select v-model="buildId" style="margin-right:10px;" placeholder="请选择" @change="changeBuild">
  10. <el-option v-for="item in buildList" :key="item.BuildID" :label="item.BuildLocalName" :value="item.BuildID"></el-option>
  11. </el-select>
  12. <!-- 楼层选择 -->
  13. <span style="padding-right:12px;color:#999;">楼层</span>
  14. <el-select v-model="floorId" placeholder="请选择" @change="changeFloor">
  15. <el-option v-for="item in floorList" :key="item.FloorID" :label="item.FloorLocalName" :value="item.FloorID"></el-option>
  16. </el-select>
  17. <!-- 选择时间插件 -->
  18. <build-time :timeArr="timeArr" @checkTime="checkTime"></build-time>
  19. </div>
  20. <div class="left-main">
  21. <div id="buildData">
  22. <!-- 头部信息 -->
  23. <div class="point_view" ref="point">
  24. <!-- 点位标签 -->
  25. <div class="build_label" v-show="labelShow">
  26. <!-- 左按钮 -->
  27. <div class="turn_left">
  28. <i class="iconfont" @click="turn(0)">&#xe720;</i>
  29. </div>
  30. <!-- 主体视窗 -->
  31. <div class="label_view">
  32. <el-scrollbar>
  33. <div class="swiper-wrapper">
  34. <div class="swiper-slide" :class="checkPointClass == 'all' ? 'active_swiper' : ''" @click="checkPoint('all','all','all')">
  35. <div class="all_view">
  36. <h3>全部</h3>
  37. </div>
  38. </div>
  39. <div class="swiper-slide" v-for="(item,index) in PTArr" :key="index" :class="checkPointClass == index ? 'active_swiper' : ''" @click="checkPoint(index,item.Id,item.Name)">
  40. <div class="img_view">
  41. <div :class="index == 0 ? 'msg_view' : 'title_view'">
  42. <h3>{{item.Name}}</h3>
  43. <p>
  44. 附近的资产:
  45. <span>{{item.Total}}</span> 个(
  46. <em>{{item.Nocheck}}</em> 个未完成修订)
  47. </p>
  48. </div>
  49. <img v-if="index != 0" v-load @error="setErrorImg" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.Image +'&width=200'" :alt="item.Name">
  50. <el-button type="text" v-if="index != 0" class="btn" @click.stop="getTable(item.Id,index)">查看详情</el-button>
  51. <i v-if="index != 0" class="iconfont icon-shuaxin icon" @click.stop="refreshImg(index)"></i>
  52. </div>
  53. </div>
  54. </div>
  55. </el-scrollbar>
  56. <!-- <div class="swiper-container" id="swiper"> -->
  57. <!-- <div class="swiper-wrapper" ref="swiperPoint">
  58. <div class="swiper-slide" :class="checkPointClass == 'all' ? 'active_swiper' : ''" @click="checkPoint('all','all','all')">
  59. <div class="all_view">
  60. <h3>全部</h3>
  61. </div>
  62. </div>
  63. <div class="swiper-slide" v-for="(item,index) in PTArr" :key="index" :class="checkPointClass == index ? 'active_swiper' : ''" @click="checkPoint(index,item.Id,item.Name)">
  64. <div class="img_view">
  65. <div :class="index == 0 ? 'msg_view' : 'title_view'">
  66. <h3>{{item.Name}}</h3>
  67. <p>
  68. 附近的资产:
  69. <span>{{item.Total}}</span> 个(
  70. <em>{{item.Nocheck}}</em> 个未完成修订)
  71. </p>
  72. </div>
  73. <img v-if="index != 0" v-load @error="setErrorImg" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.Image +'&width=200'" :alt="item.Name">
  74. <p v-if="index != 0" class="btn" @click.stop="getTable(item.Id,index)">查看详情</p>
  75. <i v-if="index != 0" class="iconfont icon-shuaxin icon" @click.stop="refreshImg(index)"></i>
  76. </div>
  77. </div>
  78. </div> -->
  79. <!-- Add Pagination -->
  80. <!-- -->
  81. <!-- </div> -->
  82. </div>
  83. <!-- 右按钮 -->
  84. <div class="turn_right">
  85. <i class="iconfont" @click="turn(1)">&#xe6f8;</i>
  86. </div>
  87. </div>
  88. <!-- 控制点位标签显示 -->
  89. <div class="label_show">
  90. <el-button plain @click="labelShowBtn">{{labelChecked}}</el-button>
  91. <!-- <div class="label_btn" @click="labelShowBtn">
  92. <span>{{labelChecked}}</span>
  93. <i class="iconfont" :class="!labelShow ? 'icon-unfold' : 'icon-packup'"></i>
  94. </div> -->
  95. </div>
  96. </div>
  97. <!-- 全部与未完成 -->
  98. <div class="build_operate" ref="operate">
  99. <el-radio-group v-model="checked" @change="changeChecked(checked)">
  100. <el-radio-button label="" >全部</el-radio-button>
  101. <el-radio-button label="0">未完成修订</el-radio-button>
  102. </el-radio-group>
  103. <!-- <span @click="changeChecked('')" :class="checked === '' ? 'Blue' : ''">全部</span>
  104. <span @click="changeChecked(0)" :class="checked === 0 ? 'Blue' : ''">未完成修订</span> -->
  105. <div class="undo_btn" @click="undo">
  106. <!-- <i class="iconfont icon-undo"></i>
  107. <i>撤回</i> -->
  108. <el-button plain>撤回</el-button>
  109. </div>
  110. <div class="undo_btn" @click="refresh">
  111. <!-- <i class="iconfont icon-shuaxin"></i>
  112. <i>刷新</i> -->
  113. <el-button plain>刷新</el-button>
  114. </div>
  115. <div class="undo_btn" @click="download">
  116. <!-- <i class="iconfont icon-xiazai"></i>
  117. <i>下载</i> -->
  118. <el-button plain>下载</el-button>
  119. </div>
  120. <p class="build_msg" v-show="buildMsgShow" :class="buildMsg ? 'blink' : ''">其他设备族的资产只能在对应页签内维护,设备族变更的资产刷新后不匹配的信息点值将丢失,将会在对应的页签内显示</p>
  121. </div>
  122. <!-- 主体表格与tab -->
  123. <div class="build_table">
  124. <el-tabs type="card" v-model="tabAvtive" @tab-click="createHotBtn">
  125. <el-tab-pane v-for="(item,index) in facilityList" :key="index" :name="'table' + index" :label="item.Name + '(' + item.Total + ')'">
  126. <div style="padding: .2rem;width:100%;" v-loading="loading">
  127. <div :id="'table' + index" v-loading="tableLoading"></div>
  128. <div class="data_page center">
  129. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage[tabChecked]" :page-sizes="pageSizeArrs" :page-size="pageSizeArr[tabChecked]" layout="total, sizes, prev, pager, next, jumper" :total="pageCount[tabChecked]"></el-pagination>
  130. </div>
  131. </div>
  132. </el-tab-pane>
  133. </el-tabs>
  134. </div>
  135. <!-- 图片查看浮层 -->
  136. <div class="mouse_move" style="backgroundColor:#ccc;height:3px;cursor:n-resize;" @mousedown="drag" @mouseup="mouseUp"></div>
  137. <div class="build_pic" v-bind:style="{height:picHeight+'px'}" ref="picview">
  138. <!-- <div class="pic_show" @click="picNoShow">关闭</div> -->
  139. <div class="turn_left">
  140. <i class="iconfont" @click="turnPic(0)">&#xe720;</i>
  141. </div>
  142. <div class="pic_view">
  143. <div class="swiper-container" id="swiperPic" v-show="tablePicArr.Pic.length">
  144. <div class="swiper-wrapper">
  145. <div class="swiper-slide" v-for="(item,$index) in tablePicArr.Nameplate" :key="item.key">
  146. <div class="img_view">
  147. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key" :title="item.name" :alt="item.name">
  148. <i class="iconfont icon-shuaxin icon" @click.stop="changeImgUrl('Nameplate',$index)"></i>
  149. </div>
  150. </div>
  151. <div class="swiper-slide" v-for="(item,$index) in tablePicArr.Pic" :key="item.key">
  152. <div class="img_view" v-if="item.type != 'image_video'">
  153. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '铭牌照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  154. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '设备正面照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  155. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '带二维码的设备远景照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  156. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '设备左侧照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  157. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '设备右侧照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  158. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '设备背面照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  159. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '带二维码的设备近景照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  160. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '视频资料' && item.type == 'image'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  161. <div v-if="item.type == 'video'" style="width:100%;height:100%;">
  162. <video style="width:100%;height:100%;" :src="'/image-service/common/file_get/'+ item.key + '?systemId=dataPlatform'" controls :poster="'/image-service/common/image_get?systemId=dataPlatform&key='+ delVideo(item.key) +'&width=200'"></video>
  163. </div>
  164. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '其他照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  165. <img v-load @error="setErrorImg" @click="seeBig(item.key,item.name,item.type)" v-if="item.name == '全景照片'" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" :title="item.name" :alt="item.name">
  166. <!-- <i
  167. @click="delPic($index)"
  168. class="iconfont icon-guanbi"
  169. style="z-index:99;background:#fff;position:absolute;right:10px;top:10px;"
  170. ></i>-->
  171. <i class="iconfont icon-shuaxin icon" @click.stop="changeImgUrl('Pic',$index)"></i>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <div v-show="!tablePicArr.Pic.length">
  177. <p>{{ tablePicMsg ? tablePicMsg : '请选择资产'}}</p>
  178. </div>
  179. </div>
  180. <div class="turn_right">
  181. <i class="iconfont" @click="turnPic(1)">&#xe6f8;</i>
  182. </div>
  183. </div>
  184. <!-- 查看图片、视频、全景图页面唤起 -->
  185. <div class="iframe_view" v-if="iframeShow">
  186. <div class="iframe_no" @click="iframeShow = false">
  187. <i class="iconfont icon-guanbi"></i>
  188. </div>
  189. <iframe id="google_ads_frame2" name="google_ads_frame2" frameborder="0" :src="iframeSrc" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true"></iframe>
  190. </div>
  191. <!-- 编辑点位标签弹窗 -->
  192. <el-dialog title="点位标签编辑" class="modification" :visible.sync="dialogTableVisible" @close="closeDialog">
  193. <div class="content_box">
  194. <div class="mod_title">
  195. <div class="qr_code">
  196. <img v-if="pointList.PointId" :src="'/ScanBuilding/service/qrcode/point?projectId=' + projectId + '&pointId=' + pointList.PointId + '&FloorId=' + floorId + '&width=200&height=200'" alt>
  197. <p v-else>暂无二维码</p>
  198. </div>
  199. <!-- 头部信息 -->
  200. <div class="msg_main">
  201. <p :title="floorName">现场位置:{{floorName ? floorName : '暂无'}}</p>
  202. <div class="input_view">
  203. <input type="text" v-model="pointList.PointName" @focus="nameShow = true" @blur="nameNotShow" @keyup.enter="savePointChange" placeholder="点位标签的名称">
  204. <i class="iconfont icon-check" v-show="nameShow" @click="savePointChange"></i>
  205. </div>
  206. <div class="input_view">
  207. <input type="text" v-model="pointList.PointLocalId" @focus="noShow = true" @blur="noNotShow" @keyup.enter="savePointChange" placeholder="点位标签的本地编码">
  208. <i class="iconfont icon-check" v-show="noShow" @click="savePointChange"></i>
  209. </div>
  210. </div>
  211. </div>
  212. <!-- 表格信息 -->
  213. <div class="cant_mod">
  214. <div class="msg_table">
  215. <div class="table_header">编码及关系</div>
  216. <table>
  217. <tbody>
  218. <tr>
  219. <td>点位标签id</td>
  220. <td>{{pointList.PointId}}</td>
  221. </tr>
  222. <tr>
  223. <td>模型id</td>
  224. <td>{{pointList.BimId ? pointList.BimId : '暂无'}}</td>
  225. </tr>
  226. </tbody>
  227. </table>
  228. </div>
  229. <!-- 照片信息 -->
  230. <div class="locale_pic">
  231. <p>现场照片</p>
  232. <div v-if="pointList.ImageList">
  233. <!-- //图片排序 -->
  234. <ul>
  235. <li v-for="(item,index) in imgList.place" v-if="imgList.place.length" class="img_view">
  236. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  237. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  238. </li>
  239. <li v-for="(item,index) in imgList.nameplate" v-if="imgList.nameplate.length" class="img_view">
  240. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  241. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  242. </li>
  243. <li v-for="(item,index) in imgList.ahead" v-if="imgList.ahead.length" class="img_view">
  244. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  245. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  246. </li>
  247. <li v-for="(item,index) in imgList.qrCodeLooger" v-if="imgList.qrCodeLooger.length" class="img_view">
  248. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  249. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  250. </li>
  251. <li v-for="(item,index) in imgList.left" v-if="imgList.left.length" class="img_view">
  252. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  253. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  254. </li>
  255. <li v-for="(item,index) in imgList.right" v-if="imgList.right.length" class="img_view">
  256. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  257. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  258. </li>
  259. <li v-for="(item,index) in imgList.bottom" v-if="imgList.bottom.length" class="img_view">
  260. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  261. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  262. </li>
  263. <li v-for="(item,index) in imgList.qrCode" v-if="imgList.qrCode.length" class="img_view">
  264. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  265. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  266. </li>
  267. <li v-for="(item,index) in imgList.panorama" v-if="imgList.panorama.length" class="img_view">
  268. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  269. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  270. </li>
  271. <li v-for="(item,index) in imgList.else" v-if="imgList.else.length && item.type != 'image_video'" class="img_view">
  272. <img @click="seeBig(item.key,item.name,item.type)" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200'" alt>
  273. <i class="iconfont icon-shuaxin icon" @click.stop="changeImage(index)"></i>
  274. </li>
  275. <li v-for="item in imgList.video" style="border: 1px solid #ccc;">
  276. <video style="width:100%;height:100%;" :src="'/image-service/common/file_get/'+ item.key + '?systemId=dataPlatform'" controls :poster="'/image-service/common/image_get?systemId=dataPlatform&key='+ delVideo(item.key) +'&width=200'"></video>
  277. </li>
  278. </ul>
  279. </div>
  280. <div v-else>暂无照片</div>
  281. </div>
  282. <div id="viewer"></div>
  283. </div>
  284. </div>
  285. </el-dialog>
  286. <!-- 删除提示 -->
  287. <el-dialog title="提示" :visible.sync="deldialog">
  288. <span>你确定删除该资产吗?</span>
  289. <span slot="footer" class="dialog-footer">
  290. <el-button @click="refresh">取 消</el-button>
  291. <el-button type="primary" @click="delTrue">确 定</el-button>
  292. </span>
  293. </el-dialog>
  294. <drag v-show="dragShow" @closeDrag="dragShow = false" :iframeSrc="dragSrc"></drag>
  295. </div>
  296. </div>
  297. <div class="right-main">
  298. <recommend ref="recommend" @loadData="loadData"></recommend>
  299. </div>
  300. </div>
  301. </template>
  302. <script>
  303. import buildTime from "@/components/data_admin/selectTime";
  304. import drag from "@/components/data_admin/drag";
  305. import Swiper from "swiper";
  306. import tools from "@/utils/scan/tools"
  307. import recommend from "@/components/data_admin/buildData/recommend";
  308. import showTools from "@/utils/handsontable/notShow"
  309. import text from "@/utils/handsontable/mainText"
  310. // import DragResize from '@/assets/js/resize'
  311. import "@/assets/js/chosen.jquery.min";
  312. import "@/assets/js/handsontable-chosen-editor";
  313. import handsonUtils from "@/utils/scan/hasontableUtils"
  314. import 'swiper/dist/css/swiper.min.css'
  315. import Handsontable from "handsontable-pro"
  316. import 'handsontable-pro/dist/handsontable.full.css'
  317. import zhCN from 'handsontable-pro/languages/zh-CN';
  318. //接口
  319. import {
  320. getBuildSelect, //根据项目ID获得建筑列表
  321. getFloor, //根据建筑id获取楼层id
  322. getPT, //根据时间、建筑名称、楼层查询点位标签
  323. getPoint, //获取点位标签详情
  324. updatePoint, //修改点位标签
  325. getTabFamily, //获取tab标签
  326. getTableHeader, //获取表格数据头部
  327. getTableMain, //获取表格主体内容
  328. upDateTableMain, //提交修改设备资产
  329. delErrAssets, //删除设备资产
  330. getAllFamily, //获取所有设备族
  331. defaultFloor, //获取默认楼层
  332. getdelMain, //获取过滤掉后的表格主体
  333. getBasicMatch, //获取完全匹配的厂商库id
  334. buildingQuery, //数据中心-建筑查询
  335. floorQuery, //数据中心-楼层查询
  336. } from "@/api/scan/request";
  337. import { mapGetters, mapActions } from "vuex"
  338. export default {
  339. components: {
  340. "build-time": buildTime,
  341. "drag": drag,
  342. recommend
  343. },
  344. data() {
  345. return {
  346. buildList: [],
  347. buildId: "",
  348. floorList: [],
  349. floorId: "",
  350. timeArr: ["一个月内", "一周内", "近三天", "昨天", "今天"],
  351. checkTimeArr: [],
  352. PTArr: [],
  353. value: "", //select的值
  354. swiper: "", //点位标签的swiper
  355. labelChecked: "请选择点位标签!", //按钮文案
  356. labelShow: true, //头部的点位标签的显示
  357. swiper2: "", //图片的swiper
  358. dialogTableVisible: false, //编辑点位标签弹窗显示
  359. dialogVisible: false, //请求错误弹窗
  360. ajaxMsg: "", //请求错误提示
  361. picShow: false, //最底层图片窗
  362. pointList: "", //点位标签详情数组
  363. pointId: "", //点位标签详情查询需求的id
  364. // ProjId: this.$route.query.projId, //项目id
  365. // UserId: this.$route.query.userId, //用户id
  366. checkPointClass: "all", //点击点位标签的当前标签
  367. pointCheck: "", //当前点击到的点位标签
  368. checked: 0, //审核标志
  369. facilityList: [], //设备list
  370. myHotArr: [], //Handsontable实例数组
  371. code: "", //被选中的设备族
  372. myHotHeaderArr: [], //表格实例的头部数组
  373. myHotMainArr: [], //表格实例的主体内容数组
  374. tabChecked: 0, //tab当前被选中的
  375. currentPageArr: [], //当前选中页数数组
  376. pageCount: [], //总共数据条数
  377. pageSizeArrs: [10, 30, 50, 100], //下拉页数个数
  378. pageSizeArr: [], //数组当前页个数
  379. currentPage: [], //当前页数
  380. loading: false, //loading动画
  381. deldialog: false, //删除提示
  382. delArr: [], //需要删除的Fmid
  383. tablePicArr: {
  384. Pic: []
  385. }, //底部pic的数组
  386. tabAvtive: "table0", //tab活跃页
  387. deepArr: [], //删除存储数组
  388. iframeSrc: "", //iframe的src
  389. iframeShow: false, //iframe的显示
  390. tableLoading: false, //table的loading
  391. AllFamily: [], //所有的Family
  392. filtersArr: [], //表格数据被过滤后的下标
  393. tablePicMsg: "", //设备照片提示语
  394. rowArr: "", //鼠标单击表格时的位置
  395. nameShow: false, //点位标签名的勾号是否显示
  396. noShow: false, //点位标签no是否显示
  397. defaultFloorData: "", //默认楼层
  398. imgList: [], //点位标签的图片数组
  399. floorName: "", //被选中的楼层名
  400. buildMsgShow: false, //提示显示与否
  401. buildMsg: false, //是否跳动
  402. picHeight: 180, //图片容器的高度
  403. dragShow: false, //拖拽容器的显示
  404. dragSrc: '', //拖拽元素的src
  405. infos: "", //点击时的信息
  406. };
  407. },
  408. created() {
  409. //默认时间赋值
  410. this.checkTimeArr = [
  411. this.getNowFormatDate(new Date().setHours(0, 0, 0, 0)),
  412. this.getNowFormatDate(new Date())
  413. ];
  414. // 获取建筑信息
  415. this.getBuilding();
  416. //获取所有所有的设备族
  417. this.getAllFamily();
  418. },
  419. computed: {
  420. ...mapGetters("layout", [
  421. "projectId",
  422. "userId",
  423. "secret"
  424. ])
  425. },
  426. methods: {
  427. //获取所有设备族
  428. getAllFamily() {
  429. getAllFamily().then(result => {
  430. if (result.data.Result == "success") {
  431. this.AllFamily = this.changeArr(result.data.Content);
  432. } else {
  433. // this.dialogVisible = true;
  434. // this.ajaxMsg = "请求出错";
  435. this.$message.error("请求出错")
  436. }
  437. });
  438. },
  439. //重新获取数据loadhot
  440. loadData() {
  441. let param = {
  442. BeginTime: this.checkTimeArr[0],
  443. BuildId: this.buildId,
  444. Checked: this.checked,
  445. EndTime: this.checkTimeArr[1],
  446. Family: this.code,
  447. FloorId: this.floorId,
  448. PageNum: this.currentPage[this.tabChecked],
  449. PageSize: this.pageSizeArr[this.tabChecked],
  450. PointId: this.pointCheck,
  451. ProjId: this.projectId,
  452. UserId: this.userId
  453. };
  454. getdelMain(param).then(res => {
  455. if (res.data.Result == "success") {
  456. let data = res.data.FmList
  457. if (data && data.length) {
  458. //如果数据存在,有localname取localname,否则取随机生成name
  459. data = data.map(item => {
  460. item.Infos.EquipLocalName = item.Infos.EquipLocalName || item.Infos.EquipName
  461. return item
  462. })
  463. }
  464. this.myHotMainArr[this.tabChecked] = data;
  465. this.pageCount[this.tabChecked] = res.data.Count;
  466. let dom = this.myHotArr[this.tabChecked];
  467. //存储一个数组防止删除操作找寻不到删除的该数组
  468. this.tableLoading = false;
  469. this.deepArr = this.deepCopy(data);
  470. if (!!this.myHotArr[this.tabChecked]) {
  471. this.myHotArr[this.tabChecked].loadData(data)
  472. this.myHotMainArr[this.tabChecked] = data
  473. } else {
  474. console.log("创建实例", this.tabChecked,
  475. data,
  476. this.myHotHeaderArr[this.tabChecked])
  477. this.createHot(
  478. this.tabChecked,
  479. data,
  480. this.myHotHeaderArr[this.tabChecked]
  481. );
  482. }
  483. this.loading = false
  484. } else {
  485. this.$message.error("请求错误:" + res.data.ResultMsg)
  486. }
  487. })
  488. // .catch(_ => {
  489. // this.$message.error("请求错误")
  490. // })
  491. },
  492. //删除图片
  493. delPic(index) {
  494. let param = {}
  495. if (!!this.tablePicArr && this.tablePicArr.Pic.length) {
  496. this.$confirm("<p>你确定删除此照片吗?</p><div style='height:200px;'><img style='display: block;margin: auto;' src='/image-service/common/image_get?systemId=dataPlatform&width=200&height=200&key=" + this.tablePicArr.Pic[index].key + "' /></div>",
  497. "删除图片", {
  498. dangerouslyUseHTMLString: true
  499. }).then(() => {
  500. if (this.tablePicArr.Pic[index].name == "铭牌照片") {
  501. this.delPicPost("Nameplate", this.tablePicArr.Pic[index].key)
  502. } else {
  503. this.delPicPost("Pic", this.tablePicArr.Pic[index].key)
  504. }
  505. }).catch(_ => {
  506. this.$message("取消删除")
  507. })
  508. } else {
  509. this.$message.error("请确定该资产有pic信息")
  510. }
  511. },
  512. delPicPost(name, key) {
  513. let myInfos = this.infos.Infos[name].map(item => {
  514. if (item.key == key) {
  515. return undefined
  516. } else {
  517. return item
  518. }
  519. }).filter(b => b);
  520. let param = {}
  521. param.BuildId = this.infos.BuildId
  522. param.BuildName = this.infos.BuildName
  523. param.Checked = this.infos.Checked
  524. param.CodeType = this.infos.CodeType
  525. param.CreateTime = this.infos.CreateTime
  526. param.Family = this.infos.Family
  527. param.FamilyName = this.infos.FamilyName
  528. param.FloorId = this.infos.FloorId
  529. param.FmId = this.infos.FmId
  530. param.FmName = this.infos.FmName
  531. param.LastUpdate = this.infos.LastUpdate
  532. param.ProjId = this.infos.ProjId
  533. param.X = this.infos.X
  534. param.Y = this.infos.Y
  535. param.Infos = {}
  536. if (!!this.infos.Infos.Pic && this.infos.Infos.Pic.length) {
  537. param.Infos.Pic = tools.copyArr(this.infos.Infos.Pic)
  538. }
  539. if (!!this.infos.Infos.Nameplate && this.infos.Infos.Nameplate.length) {
  540. param.Infos.Nameplate = tools.copyArr(this.infos.Infos.Nameplate)
  541. }
  542. param.Infos[name] = myInfos
  543. let Pj = {
  544. ProjId: this.projectId,
  545. UserId: this.userId
  546. }
  547. upDateTableMain(Pj, [param]).then(res => {
  548. if (res.data.Result == "success") {
  549. if (!!param.Infos.Nameplate) {
  550. this.tablePicArr.Pic = param.Infos.Nameplate.concat(param.Infos.Pic)
  551. } else {
  552. this.tablePicArr.Pic = param.Infos.Pic
  553. }
  554. this.$message.success("删除成功")
  555. this.getTableMain()
  556. } else {
  557. this.$message.error("请求错误:" + res.data.ResultMsg)
  558. }
  559. }).catch(_ => {
  560. this.$message.error("请求错误")
  561. })
  562. },
  563. //图片div移动事件
  564. drag(el) {
  565. let picDiv = this.$refs["picview"];
  566. let startY = el.clientY;
  567. const _this = this;
  568. document.onmousemove = function(e) {
  569. e.preventDefault();
  570. let endY = e.clientY;
  571. // let headerH = _this.$refs['header'].offsetHeight + 48 + _this.$refs['operate'].offsetHeight + 300
  572. // if (headerH > endY) {
  573. // _this.mouseUp()
  574. // }
  575. _this.picHeight = _this.picHeight - endY + startY;
  576. if (_this.picHeight > 245){
  577. _this.mouseUp()
  578. }
  579. startY = endY;
  580. //如果图片容器高度大于表格最小高度,停止拖拽
  581. };
  582. },
  583. //移动图片容器的时候鼠标up时触发重新渲染表格高度
  584. mouseUp(el) {
  585. document.onmousemove = null;
  586. if (this.myHotArr[this.tabChecked]) {
  587. let windowH = document.documentElement.clientHeight
  588. let headerH = this.$refs["header"].offsetHeight;
  589. let pointH = this.$refs["point"].offsetHeight;
  590. let operateH = this.$refs["operate"].offsetHeight;
  591. let picH = this.$refs["picview"].offsetHeight;
  592. let height = windowH - headerH - 48 - operateH - picH - 32 - 32 - 32;
  593. this.myHotArr[this.tabChecked].container.children[0].style.height = height + 'px'
  594. this.myHotArr[this.tabChecked].container.parentNode.style.height = height + 'px'
  595. }
  596. this.createPicSwiper();
  597. },
  598. //获取建筑列表
  599. getBuilding() {
  600. buildingQuery({}, res => {
  601. this.buildList = res.Content;
  602. });
  603. },
  604. //获取点位标签详情
  605. getPointDetail() {
  606. let param = {
  607. PointId: this.pointId,
  608. UserId: this.userId,
  609. ProjId: this.projectId
  610. };
  611. getPoint(param).then(result => {
  612. if (result.data.Result == "success") {
  613. this.pointList = result.data.PointList[0];
  614. this.imgList = this.delImage(result.data.PointList[0].ImageList);
  615. this.dialogTableVisible = true;
  616. } else {
  617. // this.dialogVisible = true;
  618. // this.ajaxMsg = "请求出错";
  619. this.$message.error("请求出错")
  620. }
  621. });
  622. },
  623. delImage(imageList) {
  624. let list = {
  625. place: [],
  626. nameplate: [],
  627. ahead: [],
  628. qrCodeLooger: [],
  629. left: [],
  630. right: [],
  631. bottom: [],
  632. video: [],
  633. else: [],
  634. qrCode: [],
  635. panorama: []
  636. };
  637. let imgList = imageList;
  638. for (let i = 0; i < imgList.length; i++) {
  639. switch (imgList[i].name) {
  640. case "安装位置":
  641. list.place.push(imgList[i]);
  642. break;
  643. case "铭牌照片":
  644. list.nameplate.push(imgList[i]);
  645. break;
  646. case "设备正面照片":
  647. list.ahead.push(imgList[i]);
  648. break;
  649. case "带二维码的设备远景照片":
  650. list.qrCodeLooger.push(imgList[i]);
  651. break;
  652. case "设备左侧照片":
  653. list.left.push(imgList[i]);
  654. break;
  655. case "设备右侧照片":
  656. list.right.push(imgList[i]);
  657. break;
  658. case "设备背面照片":
  659. list.right.push(imgList[i]);
  660. break;
  661. case "带二维码的设备近景照片":
  662. list.qrCode.push(imgList[i]);
  663. break;
  664. case "视频":
  665. list.video.push(imgList[i]);
  666. break;
  667. case "全景照片":
  668. list.panorama.push(imgList[i]);
  669. break;
  670. default:
  671. list.else.push(imgList[i]);
  672. }
  673. }
  674. return list;
  675. },
  676. //获取楼层列表
  677. getFloorData() {
  678. let param = {
  679. Filters: `BuildID='${this.buildId}'`,
  680. Orders: 'FloorSequenceID desc'
  681. };
  682. floorQuery(param, res => {
  683. this.floorList = res.Content
  684. this.floorList.unshift({
  685. FloorName: "全部",
  686. FloorLocalName: "全部",
  687. FloorID: "all"
  688. }, {
  689. FloorName: "未明确楼层",
  690. FloorLocalName: "未明确楼层",
  691. FloorID: "noKnow"
  692. })
  693. });
  694. },
  695. //保存点位标签详情的修改
  696. savePoint() {
  697. let param = {
  698. ProjId: this.projectId,
  699. UserId: this.userId,
  700. PointList: this.pointList
  701. };
  702. updatePoint(param).then(result => {
  703. if (result.data.Result == "success") {
  704. this.$message({
  705. message: "保存成功",
  706. type: "success"
  707. });
  708. return;
  709. } else {
  710. this.$message.error("保存失败");
  711. }
  712. });
  713. },
  714. //获取点位标签
  715. getPT() {
  716. let param = {
  717. BeginTime: this.checkTimeArr[0],
  718. EndTime: this.checkTimeArr[1],
  719. BuildId: this.buildId,
  720. FloorId: this.floorId,
  721. ProjId: this.projectId,
  722. UserId: this.userId
  723. };
  724. getPT(param).then(result => {
  725. if (result.data.Result == "success") {
  726. this.PTArr = result.data.PointList;
  727. // this.labelShow = true
  728. //赋予swiper重新操作
  729. this.labelShow = true;
  730. this.createPTSwiper();
  731. } else {
  732. // this.dialogVisible = true;
  733. // this.ajaxMsg = "请求出错";
  734. this.$message.error("请求出错")
  735. }
  736. });
  737. },
  738. //保存设备资产的更新
  739. upDateTableMain(paramList) {
  740. let param = {
  741. ProjId: this.projectId,
  742. UserId: this.userId
  743. };
  744. console.log("data修改")
  745. upDateTableMain(param, paramList).then(result => {
  746. if (result.data.Result == "success") {
  747. return;
  748. } else {
  749. this.dialogVisible = true;
  750. this.ajaxMsg = "保存出错";
  751. }
  752. });
  753. },
  754. //获取设备族列表
  755. getTabFamily() {
  756. let param = {
  757. ProjId: this.projectId,
  758. UserId: this.userId,
  759. BeginTime: this.checkTimeArr[0],
  760. EndTime: this.checkTimeArr[1],
  761. PointId: this.pointId,
  762. FloorId: this.floorId,
  763. Checked: this.checked,
  764. BuildId: this.buildId
  765. };
  766. getTabFamily(param).then(result => {
  767. if (result.data.Result == "success") {
  768. //赋予页面arr的数组长度和默认数据
  769. this.myHotArr.length = this.myHotMainArr.length = this.myHotMainArr.length = this.pageCount.length = this.currentPageArr.length = this.pageSizeArr.length = this.currentPage.length =
  770. result.data.FamilyList.length;
  771. for (let i = 0; i < this.pageCount.length; i++) {
  772. this.pageCount[i] = 10;
  773. this.currentPageArr[i] = 1;
  774. this.pageSizeArr[i] = 10;
  775. this.currentPage[i] = 1;
  776. }
  777. if (this.facilityList.length == result.data.FamilyList.length) {
  778. this.facilityList = result.data.FamilyList;
  779. this.createHotBtn({
  780. index: this.tabAvtive.split("table")[1]
  781. });
  782. } else {
  783. this.facilityList = result.data.FamilyList;
  784. this.createHotBtn({
  785. index: 0
  786. });
  787. }
  788. } else {
  789. // this.dialogVisible = true;
  790. // this.ajaxMsg = "请求出错";
  791. this.$message.error("请求出错")
  792. }
  793. });
  794. },
  795. //点击刷新图片
  796. refreshImg(index) {
  797. if (this.PTArr[index].Image.indexOf("time") != "-1") {
  798. let url = this.PTArr[index].Image.split("time");
  799. this.PTArr[index].Image = url[0] + "time=" + new Date().getTime();
  800. } else {
  801. this.PTArr[index].Image =
  802. this.PTArr[index].Image + "&time=" + new Date().getTime();
  803. }
  804. },
  805. //第一个输入框失去焦点
  806. nameNotShow() {
  807. let that = this;
  808. let timer = window.setTimeout(function() {
  809. that.nameShow = false;
  810. if (!that.nameShow) {
  811. window.clearTimeout(timer);
  812. }
  813. }, 1000);
  814. },
  815. //第二个输入框失去焦点
  816. noNotShow() {
  817. let that = this;
  818. let timer = window.setTimeout(function() {
  819. that.noShow = false;
  820. if (!that.noShow) {
  821. window.clearTimeout(timer);
  822. }
  823. }, 1000);
  824. },
  825. //修改底部图片url
  826. changeImgUrl(name, index) {
  827. let data = this.tablePicArr[name][index];
  828. if (data.key.indexOf("time") != "-1") {
  829. let url = data.key.split("time");
  830. data.key = url[0] + "time=" + new Date().getTime();
  831. } else {
  832. data.key = data.key + "&time=" + new Date().getTime();
  833. }
  834. },
  835. labelShowBtn() {
  836. this.labelShow = !this.labelShow;
  837. },
  838. //弹窗图片刷新
  839. changeImage(index) {
  840. let data = this.pointList.ImageList[index];
  841. if (data.key.indexOf("time") != "-1") {
  842. let url = data.key.split("time");
  843. data.key = url[0] + "time=" + new Date().getTime();
  844. } else {
  845. data.key = data.key + "&time=" + new Date().getTime();
  846. }
  847. },
  848. //图片加载失败替换url
  849. setErrorImg(e) {
  850. let el = e.path[0];
  851. el.style.cssText = "width:100%;height100%;display:block;";
  852. },
  853. //获取表格头部内容与下拉内容
  854. getTableHeader() {
  855. let param = {
  856. code: this.code,
  857. ProjId: this.projectId
  858. };
  859. if (!!this.code) {
  860. getTableHeader(param).then(result => {
  861. if (result.data.Result == "success") {
  862. this.myHotHeaderArr[this.tabChecked] = result.data.Content;
  863. this.getTableMain();
  864. } else {
  865. this.dialogVisible = true;
  866. this.ajaxMsg = "请求出错";
  867. }
  868. });
  869. }
  870. },
  871. //获取表格主体内容
  872. async getTableMain() {
  873. let param = {
  874. BeginTime: this.checkTimeArr[0],
  875. BuildId: this.buildId,
  876. Checked: this.checked,
  877. EndTime: this.checkTimeArr[1],
  878. Family: this.code,
  879. FloorId: this.floorId,
  880. PageNum: this.currentPage[this.tabChecked],
  881. PageSize: this.pageSizeArr[this.tabChecked],
  882. PointId: this.pointCheck,
  883. ProjId: this.projectId,
  884. UserId: this.userId
  885. };
  886. getdelMain(param).then(res => {
  887. if (res.data.Result == "success") {
  888. // let paramData = res.data.FmList.map(item => {
  889. // return {
  890. // id: item.FmId,
  891. // family: item.Family,
  892. // infos: item.Infos
  893. // }
  894. // })
  895. // let data = await this.getIdForVender({
  896. // "criterias":paramData
  897. // })
  898. // let updateData = data.map(item => {
  899. // return {
  900. // FmId: item.id,
  901. // Family: item.family,
  902. // Infos: item.infos
  903. // }
  904. // })
  905. this.updateBusiness(res.data.FmList)
  906. } else {
  907. }
  908. })
  909. },
  910. getTabsData2() {
  911. let param = {
  912. BeginTime: this.checkTimeArr[0],
  913. BuildId: this.buildId,
  914. Checked: this.checked,
  915. EndTime: this.checkTimeArr[1],
  916. Family: this.code,
  917. FloorId: this.floorId,
  918. PageNum: this.currentPage[this.tabChecked],
  919. PageSize: this.pageSizeArr[this.tabChecked],
  920. PointId: this.pointCheck,
  921. ProjId: this.projectId,
  922. UserId: this.userId
  923. }
  924. getdelMain(param).then(result => {
  925. this.buildMsgShow = false;
  926. if (result.data.Result == "success") {
  927. let data = result.data.FmList
  928. if (data && data.length) {
  929. //如果数据存在,有localname取localname,否则取随机生成name
  930. data = data.map(item => {
  931. item.Infos.EquipLocalName = item.Infos.EquipLocalName || item.Infos.EquipName
  932. return item
  933. })
  934. }
  935. this.myHotMainArr[this.tabChecked] = result.data.FmList;
  936. this.pageCount[this.tabChecked] = result.data.Count;
  937. let dom = this.myHotArr[this.tabChecked];
  938. //存储一个数组防止删除操作找寻不到删除的该数组
  939. this.tableLoading = false;
  940. this.deepArr = this.deepCopy(result.data.FmList);
  941. if (!result.data.Count) {
  942. // this.loading = false;
  943. // this.myHotArr[this.tabChecked].loadData(result.data.FmList);
  944. } else {
  945. this.$nextTick(() => {
  946. if (this.myHotArr[this.tabChecked] && this.myHotArr[this.tabChecked] != '') {
  947. this.myHotArr[this.tabChecked].destroy()
  948. }
  949. this.createHot(
  950. this.tabChecked,
  951. result.data.FmList,
  952. this.myHotHeaderArr[this.tabChecked]
  953. );
  954. });
  955. }
  956. this.loading = false;
  957. } else {
  958. // this.dialogVisible = true;
  959. // this.ajaxMsg = "请求出错";
  960. this.$message.error("请求出错")
  961. }
  962. });
  963. },
  964. download() {
  965. if (!!this.myHotArr[this.tabChecked]) {
  966. let fileName = ''
  967. this.buildList.map(item => {
  968. if (item.BuildId == this.buildId) {
  969. fileName += item.BuildLocalName
  970. }
  971. })
  972. this.floorList.map(item => {
  973. if (item.FloorId == this.floorId) {
  974. fileName += '-' + item.FloorLocalName
  975. }
  976. })
  977. this.facilityList.map((item, index) => {
  978. if (index == this.tabChecked) {
  979. fileName += '-' + item.Name + item.Total
  980. }
  981. })
  982. this.myHotArr[this.tabChecked].getPlugin('exportFile').downloadFile("csv", {
  983. filename: fileName,
  984. columnHeaders: true,
  985. exportHiddenRows: true,
  986. exportHiddenColumns: true,
  987. rowHeaders: true
  988. })
  989. } else {
  990. this.$message("请确定存在表格")
  991. }
  992. },
  993. //删除资产
  994. delErrAssets() {
  995. let param = {
  996. ProjId: this.projectId,
  997. UserId: this.userId
  998. };
  999. let paramList = this.delArr;
  1000. delErrAssets(param, paramList).then(result => {
  1001. if (result.data.Result == "success") {
  1002. this.deldialog = false;
  1003. this.getTabFamily();
  1004. return;
  1005. } else {
  1006. // this.dialogVisible = true;
  1007. // this.ajaxMsg = "请求出错";
  1008. this.$message.error("请求出错")
  1009. }
  1010. });
  1011. },
  1012. delVideo(key) {
  1013. return key
  1014. },
  1015. //修改撕码状态
  1016. changeAeestsCode() {
  1017. let param = {
  1018. ProjId: this.projectId,
  1019. UserId: this.userId
  1020. };
  1021. let paramList = this.delArr;
  1022. paramList.map(item => {
  1023. item.CodeType = 3
  1024. return item
  1025. })
  1026. upDateTableMain(param, paramList).then(result => {
  1027. if (result.data.Result == "success") {
  1028. this.deldialog = false;
  1029. this.getTabFamily();
  1030. return;
  1031. } else {
  1032. // this.dialogVisible = true;
  1033. // this.ajaxMsg = "请求出错";
  1034. this.$message.error("请求出错")
  1035. }
  1036. });
  1037. },
  1038. //关闭点位标签详情
  1039. closeDialog() {
  1040. this.getPT();
  1041. },
  1042. //点击tab创建对应的表格
  1043. createHotBtn(tab) {
  1044. this.loading = true;
  1045. this.tabChecked = tab.index;
  1046. this.rowArr = "";
  1047. this.code = this.facilityList.length ? this.facilityList[tab.index].Code : null;
  1048. this.getTableHeader();
  1049. },
  1050. //创建点位标签swiper
  1051. createPTSwiper() {
  1052. this.$nextTick(() => {
  1053. if(this.$refs['swiperPoint']){
  1054. this.$refs['swiperPoint'].style.transform = ''
  1055. }
  1056. this.swiper = "";
  1057. this.swiper = new Swiper("#swiper", {
  1058. slidesPerView: 4,
  1059. spaceBetween: 30
  1060. });
  1061. });
  1062. },
  1063. //生成图片查看swiper
  1064. createPicSwiper() {
  1065. let sizeNum;
  1066. if (this.picHeight <= 200) {
  1067. sizeNum = 5;
  1068. } else if (this.picHeight < 400) {
  1069. sizeNum = 4;
  1070. } else if (this.picHeight < 600) {
  1071. sizeNum = 3;
  1072. } else {
  1073. sizeNum = 2;
  1074. }
  1075. this.$nextTick(() => {
  1076. this.swiper2 = new Swiper("#swiperPic", {
  1077. slidesPerView: sizeNum,
  1078. spaceBetween: 30
  1079. });
  1080. });
  1081. },
  1082. //点位标签详情中的enter事件
  1083. savePointChange() {
  1084. this.savePoint();
  1085. },
  1086. //点击点位标签整个swiper事件
  1087. checkPoint(val, id, name) {
  1088. // this.labelShow = false
  1089. name = name || "";
  1090. if (name == "") {
  1091. this.labelChecked = "请选择点位标签!";
  1092. } else if (name == "all") {
  1093. this.labelChecked = "全部";
  1094. } else {
  1095. this.labelChecked = name;
  1096. }
  1097. this.checkPointClass = val;
  1098. if (id) {
  1099. this.pointId = id;
  1100. } else {
  1101. this.pointId = "";
  1102. }
  1103. this.pointCheck = id;
  1104. this.changeChecked(0);
  1105. // let id = document.getElementById('table' + this.tabChecked)
  1106. },
  1107. getTable(pointId, index) {
  1108. this.pointId = pointId;
  1109. // this.loading = true
  1110. this.getPointDetail();
  1111. },
  1112. //表格实例的单击事件
  1113. tableDown(el, rowArr) {
  1114. if (rowArr.row < 0) {
  1115. return
  1116. }
  1117. //else{
  1118. // let infos = this.myHotMainArr[this.tabChecked][rowArr.row].Infos
  1119. // this.tablePicArr = infos.Pic || []
  1120. // this.tablePicMsg = '该设备照片为空'
  1121. // this.picShow = true
  1122. // this.createPicSwiper()
  1123. // }
  1124. let filter = this.filtersArr[this.tabChecked];
  1125. //被筛选过后的数组
  1126. let trimmedArr = this.trimmedRows();
  1127. //是否启用了排序
  1128. let isSort = this.myHotArr[this.tabChecked]
  1129. .getPlugin("columnSorting")
  1130. .isSorted();
  1131. if (trimmedArr.length && isSort) {
  1132. let sortArr = this.myHotArr[this.tabChecked].getPlugin("columnSorting")
  1133. .rowsMapper.__arrayMap;
  1134. let infos = this.myHotMainArr[this.tabChecked][
  1135. trimmedArr[sortArr[rowArr.row]]
  1136. ];
  1137. this.getInfors(infos, rowArr);
  1138. } else if (isSort) {
  1139. //排序后的数组
  1140. let sortArr = this.myHotArr[this.tabChecked].getPlugin("columnSorting")
  1141. .rowsMapper.__arrayMap;
  1142. let infos = this.myHotMainArr[this.tabChecked][sortArr[rowArr.row]];
  1143. this.getInfors(infos, rowArr);
  1144. } else if (trimmedArr.length) {
  1145. let infos = this.myHotMainArr[this.tabChecked][trimmedArr[rowArr.row]];
  1146. this.getInfors(infos, rowArr);
  1147. } else {
  1148. let infos = this.myHotMainArr[this.tabChecked][rowArr.row];
  1149. this.getInfors(infos, rowArr);
  1150. }
  1151. },
  1152. getInfors(data, rowArr, falg = false) {
  1153. let val = this.myHotArr[this.tabChecked].getActiveEditor().prop;
  1154. this.$refs.recommend.randerData(data, val, this.myHotHeaderArr[this.tabChecked])
  1155. let infos = data.Infos
  1156. if (infos.Pic || infos.Nameplate) {
  1157. if (!!infos.Nameplate) {
  1158. this.tablePicArr.Pic = infos.Nameplate.concat(infos.Pic) || [];
  1159. } else {
  1160. this.tablePicArr.Pic = infos.Pic || [];
  1161. }
  1162. } else {
  1163. this.tablePicArr.Pic = infos.Pic || [];
  1164. }
  1165. if (this.tablePicArr.Pic && this.tablePicArr.Pic.length) {
  1166. this.dragSrc =
  1167. process.env.BASE_URL + ":8890/photo-View.html?type=" +
  1168. // "http://172.16.0.181:8890/photo-View.html?type=" +
  1169. this.tablePicArr.Pic[0].type +
  1170. "&key=" +
  1171. this.tablePicArr.Pic[0].key +
  1172. "&name=" +
  1173. this.tablePicArr.Pic[0].name;
  1174. }
  1175. this.infos = tools.deepClone(data)
  1176. this.tablePicMsg = "该设备照片为空";
  1177. this.picShow = true;
  1178. this.createPicSwiper();
  1179. this.rowArr = rowArr;
  1180. },
  1181. //下层的弹窗不显示
  1182. picNoShow() {
  1183. this.picShow = false;
  1184. },
  1185. //修改楼层
  1186. changeFloor() {
  1187. this.checkPointClass = -1;
  1188. for (let i = 0; i < this.floorList.length; i++) {
  1189. if (this.floorId == this.floorList[i].FloorId) {
  1190. this.floorName = this.floorList[i].FloorLocalName;
  1191. }
  1192. }
  1193. this.getPT();
  1194. this.checkPoint("all", this.pointId);
  1195. },
  1196. //切换时间事件
  1197. checkTime(val) {
  1198. this.checkTimeArr = val;
  1199. this.getPT();
  1200. this.checkPoint("all", this.pointId);
  1201. this.refresh();
  1202. },
  1203. //swiper点击label切换按钮事件
  1204. turn(val) {
  1205. if (val) {
  1206. this.swiper.slideNext();
  1207. } else {
  1208. this.swiper.slidePrev();
  1209. }
  1210. },
  1211. //swiper切换照片按钮事件
  1212. turnPic(val) {
  1213. if (val) {
  1214. this.swiper2.slideNext();
  1215. } else {
  1216. this.swiper2.slidePrev();
  1217. }
  1218. },
  1219. //头部建筑名称切换事件
  1220. changeBuild() {
  1221. this.getFloorData();
  1222. },
  1223. //获取现在的时间
  1224. getNowFormatDate(str) {
  1225. var date = new Date(str);
  1226. var seperator1 = "-";
  1227. var seperator2 = ":";
  1228. var month = date.getMonth() + 1;
  1229. var strDate = date.getDate();
  1230. if (month >= 1 && month <= 9) {
  1231. month = "0" + month;
  1232. }
  1233. if (strDate >= 0 && strDate <= 9) {
  1234. strDate = "0" + strDate;
  1235. }
  1236. var currentdate =
  1237. date.getFullYear() +
  1238. seperator1 +
  1239. month +
  1240. seperator1 +
  1241. strDate +
  1242. " " +
  1243. date.getHours() +
  1244. seperator2 +
  1245. date.getMinutes() +
  1246. seperator2 +
  1247. date.getSeconds();
  1248. return currentdate;
  1249. },
  1250. //点击图片查看大图
  1251. seeBig(key, name, type) {
  1252. this.dragSrc =
  1253. process.env.BASE_URL + ":8890/photo-View.html?type=" +
  1254. type +
  1255. "&key=" +
  1256. key +
  1257. "&name=" +
  1258. name;
  1259. this.dragShow = true
  1260. },
  1261. //改变页条数
  1262. handleSizeChange(val) {
  1263. this.tableLoading = true;
  1264. this.pageSizeArr[this.tabChecked] = val;
  1265. this.clearHot();
  1266. this.getTableMain();
  1267. },
  1268. //改变当前页
  1269. handleCurrentChange(val) {
  1270. this.tableLoading = true;
  1271. this.currentPageArr[this.tabChecked] = val;
  1272. this.clearHot();
  1273. this.getTableMain();
  1274. },
  1275. //改变checked,全部未完成修订
  1276. changeChecked(val) {
  1277. this.checked = val;
  1278. this.tabChecked = 0;
  1279. this.tabAvtive = "table0";
  1280. this.clearHot();
  1281. this.getTabFamily();
  1282. // this.createHotBtn({index:0})
  1283. },
  1284. //当表格中的内容被修改
  1285. tdChange(changeData, source) {
  1286. // 修改了的数据
  1287. //过滤条件
  1288. // if(changeData[0][1] == "Family"){
  1289. // this.buildMsgShow = true
  1290. // }
  1291. let filter = this.filtersArr[this.tabChecked];
  1292. if (changeData) {
  1293. let trimmedArr = this.trimmedRows();
  1294. let param = handsonUtils.getParam(changeData, source, this.myHotArr[this.tabChecked], trimmedArr);
  1295. let data = [];
  1296. //获取第一个点击的数组
  1297. let firstObj = handsonUtils.getUnshiftParam(changeData, source, this.myHotArr[this.tabChecked], trimmedArr);
  1298. for (let i = 0; i < param.length; i++) {
  1299. data.push(param[i]);
  1300. }
  1301. //如果data中包含/且data长度为1,将其转换成.
  1302. if (changeData.length == 1 && changeData[0][1].indexOf("/") > 0) {
  1303. changeData[0][1] = changeData[0][1].split("/").join(".")
  1304. }
  1305. console.log(data)
  1306. //存在data进行修改请求
  1307. if (data && data.length) {
  1308. this.updateBusiness(data, changeData, firstObj);
  1309. }
  1310. }
  1311. },
  1312. //修改请求
  1313. async updateBusiness(data, change, obj) {
  1314. console.log(data, change, obj, "obj")
  1315. // let param = []
  1316. //生成对应修改数据
  1317. let infoArr = ["Brand", "Specification", "Manufacturer", "Supplier", "Maintainer", "Insurer"]
  1318. let versArr = ["Manufacturer", "Supplier", "Maintainer", "Insurer"]
  1319. let falg = true
  1320. let param = data.map(item => {
  1321. let obj = {}
  1322. obj.id = item.FmId
  1323. obj.Checked = item.Checked
  1324. obj.family = item.Family
  1325. obj.infos = item.Infos
  1326. return obj
  1327. })
  1328. console.log(param, "param")
  1329. let changeParam = await this.getIdForVender({
  1330. "projectId": this.projectId,
  1331. "criterias": param
  1332. })
  1333. console.log(changeParam, "changeParam")
  1334. let lastData = changeParam.map(item => {
  1335. return {
  1336. FmId: item.id,
  1337. Checked: param.find((value) => { return value.id === item.id }).Checked,
  1338. Family: item.family,
  1339. Infos: item.infos
  1340. }
  1341. })
  1342. upDateTableMain({
  1343. ProjId: this.projectId,
  1344. UserId: this.userId
  1345. }, lastData).then(res => {
  1346. if (falg) {
  1347. this.loadData()
  1348. }
  1349. })
  1350. },
  1351. //判断文案是否相同
  1352. async getIdForVender(param) {
  1353. return await getBasicMatch(param).then(res => {
  1354. if (res.data.result == "success") {
  1355. return res.data.content
  1356. } else {
  1357. this.$message.error("请求错误" + res.data.resultMsg)
  1358. }
  1359. }).catch(error => {
  1360. this.$message.error(error)
  1361. })
  1362. },
  1363. getParam(changeData, source) {
  1364. let param = "";
  1365. //被筛选过后的数组
  1366. let trimmedArr = this.trimmedRows();
  1367. //是否启用了排序
  1368. let isSort = this.myHotArr[this.tabChecked]
  1369. .getPlugin("columnSorting")
  1370. .isSorted();
  1371. if (trimmedArr.length && isSort) {
  1372. //排序后的数组
  1373. let sortArr = this.myHotArr[this.tabChecked].getPlugin(
  1374. "columnSorting"
  1375. ).rowsMapper.__arrayMap;
  1376. param = changeData.map(item => {
  1377. return this.myHotArr[this.tabChecked].getSourceDataAtRow(
  1378. trimmedArr[sortArr[item[0]]]
  1379. );
  1380. });
  1381. } else if (isSort) {
  1382. //排序后的数组
  1383. let sortArr = this.myHotArr[this.tabChecked].getPlugin(
  1384. "columnSorting"
  1385. ).rowsMapper.__arrayMap;
  1386. param = changeData.map(item => {
  1387. return this.myHotArr[this.tabChecked].getSourceDataAtRow(
  1388. sortArr[item[0]]
  1389. );
  1390. });
  1391. } else if (trimmedArr.length) {
  1392. param = changeData.map(item => {
  1393. return this.myHotArr[this.tabChecked].getSourceDataAtRow(
  1394. trimmedArr[item[0]]
  1395. );
  1396. });
  1397. } else {
  1398. param = changeData.map(item => {
  1399. return this.myHotArr[this.tabChecked].getSourceDataAtRow(item[0]);
  1400. });
  1401. }
  1402. return param
  1403. },
  1404. //处理右键删除
  1405. romoveFm(index, amout) {
  1406. let delData = tools.differenceArr(this.myHotMainArr[this.tabChecked], this.deepArr)
  1407. this.$confirm('确认删除?')
  1408. .then(_ => {
  1409. let param = {
  1410. ProjId: this.projectId,
  1411. UserId: this.userId
  1412. };
  1413. let paramList = delData.map(item => {
  1414. item.CodeType = 3
  1415. return item
  1416. })
  1417. upDateTableMain(param, paramList).then(result => {
  1418. if (result.data.Result == "success") {
  1419. this.deldialog = false;
  1420. this.getTabFamily();
  1421. return;
  1422. } else {
  1423. this.dialogVisible = true;
  1424. this.ajaxMsg = "请求出错";
  1425. }
  1426. });
  1427. })
  1428. .catch(_ => {
  1429. this.$message("取消删除")
  1430. });
  1431. },
  1432. // 刷新当前表格
  1433. refresh() {
  1434. this.deldialog = false;
  1435. this.loading = true;
  1436. if (this.myHotArr[this.tabChecked]) {
  1437. this.myHotArr[this.tabChecked].destroy();
  1438. }
  1439. this.myHotArr[this.tabChecked] = "";
  1440. this.getTableMain();
  1441. },
  1442. //确定要删除
  1443. delTrue() {
  1444. //删除
  1445. // this.delErrAssets();
  1446. //撕码
  1447. this.changeAeestsCode()
  1448. },
  1449. //撤回操作
  1450. undo() {
  1451. this.myHotArr[this.tabChecked].undo();
  1452. },
  1453. //创建表格实例
  1454. createHot(variableNum, data, headerArr) {
  1455. if(!headerArr){
  1456. return
  1457. }
  1458. let maxRow = "";
  1459. //当当前页数*当前页个数小于总个数时,当前表格行数为当前页数
  1460. if (
  1461. this.pageCount[this.tabChecked] >=
  1462. this.pageSizeArr[this.tabChecked] * this.currentPage[this.tabChecked]
  1463. ) {
  1464. maxRow = this.pageSizeArr[this.tabChecked];
  1465. } else {
  1466. maxRow =
  1467. this.pageCount[this.tabChecked] % this.pageSizeArr[this.tabChecked];
  1468. }
  1469. let containter = document.getElementById("table" + variableNum);
  1470. let height = 0;
  1471. let winHeight = document.documentElement.clientHeight;
  1472. let headerH = this.$refs["header"].offsetHeight;
  1473. let pointH = this.$refs["point"].offsetHeight;
  1474. let operateH = this.$refs["operate"].offsetHeight;
  1475. let picH = this.$refs["picview"].offsetHeight;
  1476. console.log(winHeight,headerH,operateH,picH)
  1477. height = winHeight - headerH - 48 - operateH - picH - 32 - 32 - 32 - 155;
  1478. let headers = this.delHeader(headerArr)
  1479. let customBorders = data.map((item, index) => {
  1480. //铭牌识别标志
  1481. if (item.Nametemplate == 1) {
  1482. return {
  1483. range: {
  1484. from: {
  1485. row: index,
  1486. col: 0
  1487. },
  1488. to: {
  1489. row: index,
  1490. col: headers.length
  1491. }
  1492. },
  1493. left: {
  1494. width: 2,
  1495. color: "red"
  1496. },
  1497. right: {
  1498. width: 2,
  1499. color: "red"
  1500. },
  1501. top: {
  1502. width: 2,
  1503. color: "red"
  1504. },
  1505. bottom: {
  1506. width: 2,
  1507. color: "red"
  1508. }
  1509. }
  1510. } else {
  1511. return undefined
  1512. }
  1513. }).filter(d => d)
  1514. console.log(customBorders)
  1515. let options = {
  1516. data: data,
  1517. colHeaders: headers,
  1518. manualColumnResize: true,
  1519. manualColumnMove: true,
  1520. maxRows: maxRow,
  1521. height: height,
  1522. columnSorting: true, //添加排序
  1523. sortIndicator: true, //添加排序
  1524. renderAllRows: true,
  1525. autoColumnSize: true,
  1526. fixedColumnsLeft: 5,
  1527. language: "zh-CN",
  1528. contextMenu: this.onlyRead ? false :{
  1529. items: {
  1530. remove_row: {
  1531. name: "删除资产"
  1532. }
  1533. }
  1534. },
  1535. // customBorders: customBorders,
  1536. columns: this.getType(headerArr),
  1537. afterOnCellMouseDown: this.tableDown, //鼠标单击
  1538. afterChange: this.tdChange, //修改后
  1539. afterRemoveRow: this.romoveFm, //右键删除
  1540. dropdownMenu: [
  1541. "filter_by_condition",
  1542. "filter_by_value",
  1543. "filter_action_bar"
  1544. ],
  1545. filters: true,
  1546. afterFilter: this.trimmedRows,
  1547. afterDocumentKeyDown: this.afterDocumentKeyDown
  1548. };
  1549. console.log(options, variableNum)
  1550. this.myHotArr[variableNum] = new Handsontable(containter, options);
  1551. //存在点击tab后分页不正确的问题,使用0转换
  1552. this.tabChecked = 0;
  1553. this.tabChecked = variableNum;
  1554. let pro = document.getElementById("hot-display-license-info");
  1555. pro.parentNode.removeChild(pro);
  1556. // this.loading = false
  1557. // this.$nextTick(
  1558. // document.getElementById('hot-display-license-info').style.display = 'none'
  1559. // )
  1560. },
  1561. afterDocumentKeyDown(e) {
  1562. // this.$nextTick(() => {
  1563. let activeEditer = this.myHotArr[this.tabChecked].getActiveEditor(), td, row, prop,
  1564. val = e.realTarget.value,
  1565. infoArr = ["Brand", "Specification", "Manufacturer", "Supplier", "Maintainer", "Insurer", "SupplierContactor", "SupplierPhone", "SupplierEmail", "SupplierWeb", "SupplierFax", "MaintainerContactor", "MaintainerPhone", "MaintainerEmail", "MaintainerWeb", "MaintainerFax", "InsurerContactor", "InsurerPhone", "InsurerEmail", "InsurerWeb", "InsurerFax"];
  1566. if(activeEditer){
  1567. td = activeEditer.TD
  1568. row = activeEditer.row
  1569. prop = activeEditer.prop
  1570. } else {
  1571. return false
  1572. }
  1573. let filter = this.filtersArr[this.tabChecked];
  1574. // console.log(activeEditer, val, document.getElementsByClassName("handsontableInput")[0].value)
  1575. //被筛选过后的数组
  1576. if (e.which == 8) {
  1577. console.log("val", val)
  1578. val = val.substring(0, val.length - 1)
  1579. console.log("val1", val)
  1580. }
  1581. let trimmedArr = this.trimmedRows();
  1582. //是否启用了排序
  1583. let isSort = this.myHotArr[this.tabChecked]
  1584. .getPlugin("columnSorting")
  1585. .isSorted();
  1586. let infos = "";
  1587. // if (infoArr.indexOf(prop.split('.')[1]) < 0) {
  1588. // return false
  1589. // }
  1590. if (trimmedArr.length && isSort) {
  1591. let sortArr = this.myHotArr[this.tabChecked].getPlugin("columnSorting")
  1592. .rowsMapper.__arrayMap;
  1593. infos = this.myHotMainArr[this.tabChecked][
  1594. trimmedArr[sortArr[row]]
  1595. ];
  1596. } else if (isSort) {
  1597. //排序后的数组
  1598. let sortArr = this.myHotArr[this.tabChecked].getPlugin("columnSorting")
  1599. .rowsMapper.__arrayMap;
  1600. infos = this.myHotMainArr[this.tabChecked][sortArr[row]];
  1601. } else if (trimmedArr.length) {
  1602. infos = this.myHotMainArr[this.tabChecked][trimmedArr[row]];
  1603. } else {
  1604. infos = this.myHotMainArr[this.tabChecked][row];
  1605. }
  1606. if(this.$refs.recommend){
  1607. this.$refs.recommend.randerData(infos, prop, this.myHotHeaderArr[this.tabChecked], true, val)
  1608. }
  1609. // })
  1610. },
  1611. //获取被筛选掉的行号
  1612. trimmedRows() {
  1613. // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
  1614. var plugin = this.myHotArr[this.tabChecked].getPlugin("trimRows")
  1615. .trimmedRows;
  1616. let dataLength = this.pageSizeArr[this.tabChecked];
  1617. let dataArr = new Array();
  1618. for (let i = 0; i < dataLength; i++) {
  1619. dataArr.push(i);
  1620. }
  1621. if (plugin.length <= 0) {
  1622. dataArr = undefined;
  1623. } else {
  1624. dataArr = this.array_diff(dataArr, plugin);
  1625. }
  1626. this.filtersArr[this.tabChecked] = dataArr;
  1627. return dataArr || [];
  1628. // var DataArray = new Array();
  1629. // for (var i = 0; i < plugin.length; i++) {
  1630. // // 通过行号获取数据
  1631. // DataArray.push(this.myHotArr[this.tabChecked].getSourceDataAtRow(plugin[i]));
  1632. // }
  1633. },
  1634. //去除数组中相同的元素
  1635. array_diff(a, b) {
  1636. for (var i = 0; i < b.length; i++) {
  1637. for (var j = 0; j < a.length; j++) {
  1638. if (a[j] == b[i]) {
  1639. a.splice(j, 1);
  1640. j = j - 1;
  1641. }
  1642. }
  1643. }
  1644. return a;
  1645. },
  1646. //清空所有实例
  1647. clearHot() {
  1648. this.myHotArr = this.myHotArr.map(item => {
  1649. if (item) {
  1650. return item.destroy();
  1651. } else {
  1652. return;
  1653. }
  1654. });
  1655. },
  1656. //处理头部header方法
  1657. delHeader(arr) {
  1658. let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2", "M"]
  1659. let data = showTools.changeHeader(arr, readArr, false, false, true, true, true)
  1660. data.unshift("标记", "点位标签", "设备族");
  1661. console.log(data)
  1662. return data;
  1663. },
  1664. //通过header生成columns
  1665. getType(arr) {
  1666. let data = showTools.changeTypes(arr, false, false, true, true, true)
  1667. data.unshift({
  1668. type: "checkbox",
  1669. checkedTemplate: 1,
  1670. uncheckedTemplate: 0,
  1671. data: "Checked",
  1672. label: {
  1673. position: "after",
  1674. value: "完成修订"
  1675. }
  1676. }, {
  1677. data: "PointName",
  1678. readOnly: true
  1679. }, {
  1680. editor: "chosen",
  1681. data: "Family",
  1682. renderer: tools.customDropdownRenderer,
  1683. chosenOptions: {
  1684. data: this.AllFamily
  1685. }
  1686. });
  1687. data = data.filter(item => item)
  1688. console.log(data)
  1689. return data;
  1690. },
  1691. changeArr(arr) {
  1692. if (arr.length) {
  1693. return arr.map(item => {
  1694. return {
  1695. Code: item.code,
  1696. Name: item.name
  1697. };
  1698. });
  1699. } else {
  1700. return "";
  1701. }
  1702. },
  1703. //工具函数浅复制深拷贝,防止共用存储空间
  1704. deepCopy(obj) {
  1705. var out = [],
  1706. i = 0,
  1707. len = obj.length;
  1708. for (; i < len; i++) {
  1709. if (obj[i] instanceof Array) {
  1710. out[i] = deepcopy(obj[i]);
  1711. } else out[i] = obj[i];
  1712. }
  1713. return out;
  1714. }
  1715. },
  1716. watch: {
  1717. projectId(){
  1718. //默认时间赋值
  1719. this.checkTimeArr = [
  1720. this.getNowFormatDate(new Date().setHours(0, 0, 0, 0)),
  1721. this.getNowFormatDate(new Date())
  1722. ];
  1723. this.buildId = ""
  1724. this.floorId = ""
  1725. this.buildList = []
  1726. this.floorList = []
  1727. this.tabAvtive = "table0"
  1728. this.labelChecked = "请选择点位标签!"
  1729. // 获取建筑信息
  1730. this.getBuilding();
  1731. //获取所有所有的设备族
  1732. this.getAllFamily();
  1733. this.checked = 0
  1734. }
  1735. }
  1736. };
  1737. </script>
  1738. <style lang="scss" scoped>
  1739. .page-content{
  1740. position: relative;
  1741. }
  1742. @import "../../../components/data_admin/buildData/style.scss";
  1743. </style>
  1744. <style lang="scss" scoped>
  1745. #buildData{
  1746. .el-tabs__header{
  1747. width: 100%;
  1748. }
  1749. .el-dialog{
  1750. width: 900px;
  1751. height: auto;
  1752. }
  1753. .center{
  1754. text-align: center
  1755. }
  1756. .el-radio-button__inner{
  1757. width: 90px;
  1758. }
  1759. .build_label{
  1760. .label_view{
  1761. padding: 0 4rem;
  1762. box-sizing: border-box;
  1763. }
  1764. }
  1765. .build_pic {
  1766. .turn_right {
  1767. right: 0;
  1768. }
  1769. }
  1770. }
  1771. .content_box {
  1772. max-height: 440px;
  1773. overflow-y: auto;
  1774. }
  1775. </style>