main.vue 96 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461
  1. <template>
  2. <div class="main mainVueIndex" :class="current_theme" id="defaultpage">
  3. <div class="oa-header-user" v-if="showIframe">
  4. <h3 v-show="menuType === '2'" class="oa-user-name" style="color: #fff">
  5. {{ store.state.userInfo ? store.state.userInfo.userName : '' }}
  6. </h3>
  7. <div class="oa-header-upt">
  8. <a
  9. ><template>
  10. <img
  11. @click="changeMenuType"
  12. v-if="userInfo.photo"
  13. class="oa-sign-tul-ui"
  14. :src="
  15. 'data:image/' + userInfo.photo + ';base64,' + userInfo.photo
  16. "
  17. alt="头像"
  18. />
  19. <img
  20. @click="changeMenuType"
  21. v-else
  22. class="oa-sign-tul-ui"
  23. src="../../static/img/photo-default.png"
  24. alt="头像"
  25. /> </template
  26. ></a>
  27. </div>
  28. <div class="oa-header-ucon">
  29. <div class="oa-header-ulist">
  30. <div class="oa-header-uin">
  31. <template>
  32. <img
  33. v-if="userInfo.photo"
  34. class="oa-sign-tul-ui"
  35. :src="
  36. 'data:image/' + userInfo.photo + ';base64,' + userInfo.photo
  37. "
  38. alt="头像"
  39. @click="photoModal = true"
  40. />
  41. <img
  42. v-else
  43. class="oa-sign-tul-ui"
  44. src="../../static/img/photo-default.png"
  45. alt="头像"
  46. @click="photoModal = true"
  47. />
  48. </template>
  49. <h3>
  50. {{ store.state.userInfo ? store.state.userInfo.userName : '' }}
  51. </h3>
  52. </div>
  53. <ul class="oa-header-uul">
  54. <li @click="showPersonInfo()">
  55. <span class="st-icons st-icons-user"></span>个人信息
  56. </li>
  57. <li @click="pwdModal.show = true">
  58. <span class="st-icons st-icons-pwd"></span>修改密码
  59. </li>
  60. <!-- <li @click="signOut">
  61. <span class="st-icons st-icons-out"></span>退出登录
  62. </li> -->
  63. <li @click="signOut">
  64. <span class="st-icons st-icons-out"></span>退出登录
  65. </li>
  66. </ul>
  67. </div>
  68. </div>
  69. </div>
  70. <div
  71. v-show="showIframe"
  72. class="icore-menu-main overFlowSet"
  73. :class="{ 'icore-menu-main2': menuType === '2' }"
  74. >
  75. <div id="menuDrag" v-if="menuType === '2'" class="menuDrag"></div>
  76. <el-menu
  77. :default-active="defaultActiveIndex"
  78. :collapse="menuType === '1'"
  79. class="el-menu-vertical-demo icore-menu icore-menu-level1"
  80. v-for="(item, index) in menuData"
  81. :key="item.id"
  82. @open="handleOperate"
  83. @close="handleOperate"
  84. >
  85. <el-submenu
  86. :index="index + ''"
  87. v-if="item.menuType && Number(item.status)"
  88. >
  89. <template slot="title">
  90. <i
  91. class="icore-menu-lic icore-menu-icons icore-icons-menu-default"
  92. :class="item.menuIcon ? item.menuIcon : ''"
  93. ></i>
  94. <div class="icore-menu-lit marignL15 nameText">{{ item.name }}</div>
  95. </template>
  96. <template v-for="(sitem, sindex) in item.children">
  97. <el-submenu
  98. :index="index + '-' + sindex"
  99. v-if="
  100. sitem.children &&
  101. sitem.children.length > 0 &&
  102. allNoMenu(sitem.children) &&
  103. Number(sitem.status)
  104. "
  105. :key="sitem.id"
  106. @click.native="
  107. selectMenu(sitem, [
  108. { menuId: 1, menuLabel: item.name },
  109. { menuId: 2, menuLabel: sitem.name }
  110. ])
  111. "
  112. >
  113. <template slot="title">
  114. <span>{{ sitem.name }}</span>
  115. </template>
  116. <template v-for="(ssitem, ssindex) in sitem.children">
  117. <el-submenu
  118. :index="index + '-' + sindex + '-' + ssindex"
  119. v-if="
  120. ssitem.children &&
  121. ssitem.children.length > 0 &&
  122. allNoMenu(ssitem.children) &&
  123. Number(ssitem.status)
  124. "
  125. :key="ssitem.id"
  126. >
  127. <template slot="title">
  128. <span>{{ ssitem.name }}</span>
  129. </template>
  130. <template v-for="(sssitem, sssindex) in ssitem.children">
  131. <el-menu-item
  132. @click.native="
  133. selectMenu(sssitem, [
  134. { menuId: 1, menuLabel: item.name },
  135. { menuId: 2, menuLabel: sitem.name },
  136. { menuId: 3, menuLabel: ssitem.name },
  137. { menuId: 4, menuLabel: sssitem.name }
  138. ])
  139. "
  140. v-if="
  141. (sssitem.menuType === '1' ||
  142. sssitem.menuType === '4') &&
  143. Number(sssitem.status)
  144. "
  145. :index="
  146. index + '-' + sindex + '-' + ssindex + '-' + sssindex
  147. "
  148. :key="sssitem.id"
  149. >{{ sssitem.name }}</el-menu-item
  150. >
  151. <!-- 分割线 -->
  152. <el-menu-item
  153. class="nav_menu"
  154. v-if="sssitem.menuType === '3' && Number(sssitem.status)"
  155. :index="
  156. index + '-' + sindex + '-' + ssindex + '-' + sssindex
  157. "
  158. :key="sssitem.id"
  159. >
  160. <template>
  161. <div></div>
  162. </template>
  163. </el-menu-item>
  164. <!-- 停用菜单 -->
  165. <el-menu-item
  166. v-if="Number(sssitem.status) === 0"
  167. :index="
  168. index + '-' + sindex + '-' + ssindex + '-' + sssindex
  169. "
  170. :key="sssitem.id"
  171. >{{ sssitem.name }}</el-menu-item
  172. >
  173. </template>
  174. </el-submenu>
  175. <!-- 停用菜单 -->
  176. <el-menu-item
  177. :index="index + '-' + sindex + '-' + ssindex"
  178. class="closeMenu"
  179. v-if="Number(ssitem.status) === 0"
  180. :key="ssitem.id"
  181. >
  182. {{ ssitem.name }}
  183. </el-menu-item>
  184. <!-- 分割线 -->
  185. <el-menu-item
  186. class="nav_menu"
  187. :index="index + '-' + sindex + '-' + ssindex"
  188. v-if="
  189. (!ssitem.children ||
  190. ssitem.children.length === 0 ||
  191. !allNoMenu(ssitem.children)) &&
  192. ssitem.menuType === '3' &&
  193. Number(ssitem.status)
  194. "
  195. :key="ssitem.id"
  196. >
  197. <template>
  198. <div></div>
  199. </template>
  200. </el-menu-item>
  201. <!-- 分割线 END -->
  202. <el-menu-item
  203. @click.native="
  204. selectMenu(ssitem, [
  205. { menuId: 1, menuLabel: item.name },
  206. { menuId: 2, menuLabel: sitem.name },
  207. { menuId: 3, menuLabel: ssitem.name }
  208. ])
  209. "
  210. :index="index + '-' + sindex + '-' + ssindex"
  211. v-if="
  212. (!ssitem.children ||
  213. ssitem.children.length === 0 ||
  214. !allNoMenu(ssitem.children)) &&
  215. (ssitem.menuType === '1' || ssitem.menuType === '4') &&
  216. Number(ssitem.status)
  217. "
  218. :key="ssitem.id"
  219. >{{ ssitem.name }}</el-menu-item
  220. >
  221. </template>
  222. </el-submenu>
  223. <!-- 停用菜单 -->
  224. <el-menu-item
  225. :index="index + '-' + sindex"
  226. class="closeMenu"
  227. v-if="Number(sitem.status) === 0"
  228. :key="sitem.id"
  229. >
  230. {{ sitem.name }}
  231. </el-menu-item>
  232. <el-menu-item
  233. @click.native="
  234. selectMenu(sitem, [
  235. { menuId: 1, menuLabel: item.name },
  236. { menuId: 2, menuLabel: sitem.name }
  237. ])
  238. "
  239. :index="index + '-' + sindex"
  240. v-if="
  241. (!sitem.children ||
  242. sitem.children.length === 0 ||
  243. !allNoMenu(sitem.children)) &&
  244. (sitem.menuType === '1' || sitem.menuType === '4') &&
  245. Number(sitem.status)
  246. "
  247. :key="sitem.id"
  248. >{{ sitem.name }}</el-menu-item
  249. >
  250. </template>
  251. </el-submenu>
  252. </el-menu>
  253. </div>
  254. <section
  255. class="sl-container"
  256. :class="{ 'sl-container2': menuType === '2' }"
  257. id="mainContainer"
  258. >
  259. <header class="sl-header">
  260. <div v-if="showIframe" class="sl-header-ul">
  261. <!-- <div class="sl-header-li-name">工业互联网平台 ICP-iCore 2.0</div> -->
  262. <!-- <div class="hnstLogo">
  263. <img src="../assets/img/logo_1.png" alt="" />
  264. </div> -->
  265. <!-- 下拉选择公司 -->
  266. <div
  267. class="company-select"
  268. v-if="companys !== '' && companys.length >= 1"
  269. >
  270. <span
  271. class="ifCompany el-dropdown-link"
  272. v-if="companys.length === 1"
  273. >
  274. {{ companyName }}
  275. </span>
  276. <el-dropdown trigger="click" @command="selectComPany" v-else>
  277. <span class="el-dropdown-link">
  278. {{ companyName }}
  279. <i class="el-icon-arrow-down el-icon--right"></i>
  280. </span>
  281. <el-dropdown-menu slot="dropdown">
  282. <div v-for="item in companys" :key="item.id">
  283. <el-dropdown-item :command="item">
  284. {{ item.companyName }}
  285. </el-dropdown-item>
  286. </div>
  287. </el-dropdown-menu>
  288. </el-dropdown>
  289. <el-dropdown
  290. trigger="click"
  291. @command="selectOrg"
  292. v-if="orgDutyLinks.length > 0"
  293. :style="{
  294. marginLeft: !styleControll ? '50px' : '20px',
  295. fontSize: '12px'
  296. }"
  297. >
  298. <span class="el-dropdown-link"
  299. ><!--<i class="el-icon-arrow-down el-icon--right"></i>-->
  300. {{ orgName }}
  301. </span>
  302. <el-dropdown-menu slot="dropdown">
  303. <div v-for="item in orgDutyLinks" :key="item.orgId">
  304. <el-dropdown-item :command="item">{{
  305. item.orgName
  306. }}</el-dropdown-item>
  307. </div>
  308. </el-dropdown-menu>
  309. </el-dropdown>
  310. <!-- <span style="margin-left: 20px; font-size: 12px">{{
  311. dutyName
  312. }}</span> -->
  313. </div>
  314. <div class="sl-header-li-lgbc">
  315. <span class="icore-icons icore-icons-right-arrow am-xz"></span>
  316. <span class="sl-breadcrumb-text">当前位置:</span>
  317. <el-breadcrumb
  318. separator-class="el-icon-arrow-right"
  319. class="sl-breadcrumb-list"
  320. >
  321. <el-breadcrumb-item
  322. v-for="item in pageBreadcrumb"
  323. :key="'bdb' + item.menuId"
  324. >{{ item.menuLabel }}</el-breadcrumb-item
  325. >
  326. </el-breadcrumb>
  327. </div>
  328. <div
  329. class="sl-header-li-websocket"
  330. @mouseenter="updatecss"
  331. @mouseleave="leave"
  332. >
  333. <el-badge
  334. :value="taskAllNum"
  335. :max="99"
  336. class="item"
  337. style="margin-right: 20px"
  338. :hidden="badgeshow"
  339. >
  340. <el-button type="text" size="small" @click="goMyTaskPage"
  341. >通知信息</el-button
  342. >
  343. </el-badge>
  344. <div class="Web_Notice" v-show="socketshow" style="z-index: 1 ; overflow-y: scroll">
  345. <div class="workspace_row-grid_mytask">
  346. <div
  347. class="workspace_message"
  348. v-for="(item, index) in noticedata"
  349. :key="index"
  350. @click="seeTaskContent(item)"
  351. >
  352. <div class="workspace_message-title">
  353. 标题: {{ item.noticetitle }}
  354. </div>
  355. <div class="workspace_message-content">
  356. 内容:{{ item.noticecontent }}
  357. </div>
  358. <div class="workspace_message-from">
  359. 来自: {{ item.insertusername }}
  360. </div>
  361. <div class="workspace_message-date">
  362. 时间:{{ item.inserttime }}
  363. </div>
  364. <div style="height: 20px"></div>
  365. <el-divider></el-divider>
  366. </div>
  367. <div class="workspace_replace_item"></div>
  368. </div>
  369. </div>
  370. </div>
  371. <div class="theme-defined">
  372. <div
  373. @click="fullScreenEvent"
  374. :class="fullScreen ? 'icore-return-screen' : 'icore-full-screen'"
  375. :title="fullScreen ? '退出全屏' : '全屏'"
  376. ></div>
  377. <div @click="themeEvent" class="icore-theme" title="主题"></div>
  378. <div @click="lockEvent" class="icore-lock" title="锁屏"></div>
  379. <div @click="backMain" class="icore-main" title="主页"></div>
  380. </div>
  381. </div>
  382. </header>
  383. <div class="sl-content-main">
  384. <template v-if="showIframe">
  385. <default-vue
  386. :menuData="menuData"
  387. @gotoSetPage="gotoSetPage"
  388. v-if="tabsData.length === 0"
  389. ></default-vue>
  390. <el-tabs
  391. id="menuTabId"
  392. v-show="tabsData.length > 0"
  393. v-model="selectedMenu"
  394. type="card"
  395. closable
  396. @tab-remove="removeTab"
  397. @tab-click="handleClick"
  398. style="padding: 10px 0px 0px; height: 100%"
  399. >
  400. <el-tab-pane
  401. :label="item.name"
  402. :name="item.menuId"
  403. :key="item.menuId"
  404. v-for="(item, index) in tabsData"
  405. >
  406. <span @contextmenu="rightShow($event, index, item)" slot="label">
  407. {{ item.name }}
  408. </span>
  409. <div class="pageBreadcrumb">
  410. {{ JSON.stringify(item.pageBreadcrumb) }}
  411. </div>
  412. <iframe
  413. :src="
  414. isDev(item.menuUrl)
  415. ? getDevUrl(item.menuUrl)
  416. : toTrustUrl(item.menuUrl)
  417. "
  418. :style="minHeight"
  419. ></iframe>
  420. </el-tab-pane>
  421. </el-tabs>
  422. <div class="contextmenu">
  423. <el-dropdown
  424. trigger="click"
  425. @visible-change="visibleChange"
  426. @command="handleCommand"
  427. >
  428. <span class="el-dropdown-link" v-show="false">
  429. 下拉菜单<i
  430. id="setClick"
  431. class="el-icon-arrow-down el-icon--right"
  432. ></i>
  433. </span>
  434. <el-dropdown-menu slot="dropdown">
  435. <el-dropdown-item command="a">关闭标签页</el-dropdown-item>
  436. <el-dropdown-item :disabled="tabsData.length === 1" command="b"
  437. >关闭其他标签页</el-dropdown-item
  438. >
  439. <el-dropdown-item
  440. :disabled="tabsData.length - menuTabIndex === 1"
  441. command="c"
  442. >关闭右侧标签页</el-dropdown-item
  443. >
  444. <el-dropdown-item command="d">刷新当前标签页</el-dropdown-item>
  445. </el-dropdown-menu>
  446. </el-dropdown>
  447. </div>
  448. </template>
  449. <transition
  450. enter-active-class="fade-in"
  451. leave-active-class="leave-immediately"
  452. :duration="{ enter: 400, leave: 100 }"
  453. ref="childrenPage"
  454. >
  455. <router-view
  456. @updateTaskNum="updateTaskNum"
  457. @updateMessageNum="updateMessageNum"
  458. >
  459. </router-view>
  460. </transition>
  461. </div>
  462. </section>
  463. <!-- -->
  464. <div
  465. is="usersAddAndEdit"
  466. v-if="userModal.show"
  467. :operate="'edit'"
  468. :operate1="'index'"
  469. :item="userInfo"
  470. @on-then="userModalThen"
  471. @on-close="userModalClose"
  472. @editFinish="updataUserInfo"
  473. ></div>
  474. <!-- -->
  475. <!-- 修改密码 -->
  476. <el-dialog
  477. ref="pwdModal"
  478. :visible.sync="pwdModal.show"
  479. class="oa-pwd-modal"
  480. title="修改密码"
  481. width="500px"
  482. @open="openPwd"
  483. >
  484. <el-form
  485. ref="pwdModal"
  486. :model="pwdModal.form"
  487. :rules="pwdModal.ruleValidate"
  488. label-width="120px"
  489. style="padding-right: 40px"
  490. >
  491. <el-form-item label="原密码" prop="userid" v-show="false">
  492. <el-input
  493. size="small"
  494. type="text"
  495. v-model="pwdModal.form.userid"
  496. :maxlength="64"
  497. ></el-input>
  498. </el-form-item>
  499. <el-form-item label="原密码" prop="prepassword">
  500. <el-input
  501. size="small"
  502. type="password"
  503. v-model="pwdModal.form.prepassword"
  504. :maxlength="64"
  505. ></el-input>
  506. </el-form-item>
  507. <el-form-item label="新密码" prop="newpassword">
  508. <el-input
  509. size="small"
  510. type="password"
  511. @input="inputThing"
  512. v-model="pwdModal.form.newpassword"
  513. :maxlength="64"
  514. ></el-input>
  515. <div
  516. class="strongBox"
  517. v-show="strongShow"
  518. :style="{ backgroundColor: strongColor }"
  519. >
  520. {{ strongText }}
  521. </div>
  522. </el-form-item>
  523. <el-form-item label="确认密码" prop="againNewpassword">
  524. <el-input
  525. size="small"
  526. type="password"
  527. v-model="pwdModal.form.againNewpassword"
  528. :maxlength="64"
  529. ></el-input>
  530. </el-form-item>
  531. </el-form>
  532. <div slot="footer" class="dialog-footer">
  533. <el-button size="small" @click="pwdModal.show = false">取 消</el-button>
  534. <el-button
  535. size="small"
  536. :loading="pwdModal.loading"
  537. type="primary"
  538. @click="pwdSubmit('pwdModal')"
  539. >确 定</el-button
  540. >
  541. </div>
  542. </el-dialog>
  543. <!-- 锁屏 -->
  544. <el-dialog
  545. title="锁屏"
  546. v-if="lockEventFlag"
  547. :visible.sync="lockEventFlag"
  548. width="500px"
  549. >
  550. <el-form
  551. :model="lockRuleForm"
  552. :rules="lockRules"
  553. ref="lockRuleForm"
  554. label-width="150px"
  555. >
  556. <el-form-item label="锁屏密码" prop="pwd">
  557. <el-input
  558. :class="checkedByLogin ? 'lockInput' : ''"
  559. :disabled="checkedByLogin"
  560. @keyup.enter.native="lockEventSet"
  561. v-model="lockRuleForm.pwd"
  562. style="width: 250px"
  563. ></el-input>
  564. <el-checkbox v-model="checkedByLogin">使用登录密码</el-checkbox>
  565. </el-form-item>
  566. </el-form>
  567. <div slot="footer" class="dialog-footer">
  568. <el-button @click="lockEventFlag = false">取 消</el-button>
  569. <el-button type="primary" @click="lockEventSet">确 定</el-button>
  570. </div>
  571. </el-dialog>
  572. <!-- /修改密码 -->
  573. <div v-if="lockScreenPwd" class="lock_screen">
  574. <div
  575. v-if="lockErrorMsg"
  576. class="el-message el-message--error"
  577. style="z-index: 2033"
  578. >
  579. <i class="el-message__icon el-icon-error"></i>
  580. <p class="el-message__content">密码错误!</p>
  581. </div>
  582. <div
  583. style="
  584. margin: 0 auto;
  585. width: 300px;
  586. position: relative;
  587. top: 45%;
  588. transform: translateY(-50%);
  589. "
  590. >
  591. <div>
  592. <el-input
  593. ref="lockInput"
  594. class="lockInput"
  595. placeholder="请输入密码"
  596. @keyup.enter.native="setLock"
  597. type="text"
  598. v-model="inputLockPwd"
  599. >
  600. <template slot="append">
  601. <div @click="setLock" class="lock_route">
  602. <i class="el-icon-back"></i>
  603. </div>
  604. </template>
  605. </el-input>
  606. </div>
  607. <div style="padding: 10px">
  608. 忘记密码?
  609. <a
  610. @click="lockSignOut"
  611. style="text-decoration: underline; color: #409eff; cursor: pointer"
  612. >退出登录</a
  613. >
  614. </div>
  615. </div>
  616. </div>
  617. <!-- 切换主题 -->
  618. <el-dialog
  619. title="选择主题"
  620. v-if="themeSetFlag"
  621. :visible.sync="themeSetFlag"
  622. width="30%"
  623. >
  624. <el-radio-group v-model="current_theme">
  625. <el-radio
  626. :label="theme.label"
  627. :key="theme.label"
  628. v-for="theme in theme_group"
  629. >{{ theme.desc }}</el-radio
  630. >
  631. </el-radio-group>
  632. <div slot="footer" class="dialog-footer"></div>
  633. </el-dialog>
  634. <!-- 权限被修改 -->
  635. <el-dialog
  636. v-if="privilegeUpdateIfo"
  637. :visible.sync="privilegeUpdateIfo"
  638. width="35%"
  639. top="20vh"
  640. :close-on-click-modal="false"
  641. :close-on-press-escape="false"
  642. :show-close="false"
  643. class="privilegeArea"
  644. >
  645. <span v-if="closeSecond > 0" style="font-size: 18px; color: #333">
  646. <i class="el-icon-warning"></i>
  647. {{ ' 您的权限已被管理员修改,' + closeSecond + 's后将自动退出' }}
  648. </span>
  649. <span v-else style="font-size: 20px; color: #f56c6c">
  650. <i class="el-icon-loading"></i>
  651. {{ '正在为您退出,请稍后...' }}
  652. </span>
  653. <div slot="footer" class="dialog-footer" v-if="closeSecond > 0">
  654. <el-button type="primary" size="small" @click="closeConfirm"
  655. >确 定</el-button
  656. >
  657. </div>
  658. </el-dialog>
  659. <!--通知弹窗-->
  660. <el-dialog
  661. :visible.sync="centerDialogVisible"
  662. >
  663. <div style="margin-left: 30px; font-size: 20px">
  664. <h1>{{noticedata1.noticetitle}}</h1>
  665. </div>
  666. <div style="height: 20px"></div>
  667. <div style="margin-left: 30px">
  668. <i class="el-icon-document"></i>{{noticedata1.noticecontent}}
  669. </div>
  670. <el-divider></el-divider>
  671. <div style="margin-left: 30px">
  672. <i class="el-icon-user-solid"></i>
  673. {{noticedata1.insertusername}}
  674. </div>
  675. <div style="margin-left: 30px">
  676. <i></i>{{noticedata1.inserttime}}
  677. </div>
  678. <span slot="footer" class="dialog-footer">
  679. <el-button type="primary" @click="makeSure">确 定</el-button>
  680. </span>
  681. </el-dialog>
  682. <!--通知-->
  683. <!-- <div class="Web_Notice">
  684. <span class="margin_R10">
  685. <i class="el-icon-message iconImg"></i>
  686. <el-badge :value="taskAllNum" :max="99" :hidden="taskAllNum < 1"></el-badge>
  687. </span>
  688. </div>-->
  689. </div>
  690. </template>
  691. <script>
  692. import element_css_json_import from '../assets/json/element_css.js'
  693. import objectAssign from 'object-assign'
  694. import generateColors from './utils/color'
  695. import usersAddAndEdit from '@/views/systemConfig/components/usersAddAndEdit.vue'
  696. import { getCookie } from '@/utils/util.js'
  697. import { checkCharLength } from '@/utils/validator.js'
  698. import store from '@/store/index.js'
  699. // 字典数据
  700. import dataDictionary from '@/store/dataDictionary.js'
  701. // import defaultVue from "./defaultVue.vue";
  702. import defaultVue from '@/views/homepage/components/homepage.vue'
  703. import { proPath } from '@/config/config.js'
  704. import draggable from 'vuedraggable'
  705. export default {
  706. components: {
  707. usersAddAndEdit,
  708. defaultVue
  709. },
  710. data() {
  711. const validateLockPass = (rule, value, callback) => {
  712. if (value === '') {
  713. callback(new Error('请输入锁屏密码'))
  714. } else {
  715. let reg = /^[A-Za-z0-9]+$/
  716. if (!reg.test(value)) {
  717. return callback(new Error('请输入英文和数字'))
  718. }
  719. callback()
  720. }
  721. }
  722. const validatePass = (rule, value, callback) => {
  723. if (value === '') {
  724. callback(new Error('请输入新密码'))
  725. } else {
  726. if (this.regular !== '') {
  727. let reg = eval('/' + this.regular + '/')
  728. if (!reg.test(value)) {
  729. let message =
  730. this.regularType === 1
  731. ? '至少包含英文、数字、特殊符号中的两种!'
  732. : ''
  733. message +=
  734. '长度需在' + this.minLength + '-' + this.maxLength + '之间'
  735. return callback(new Error(message))
  736. }
  737. } else {
  738. this.getPwdValid()
  739. this.$refs.pwdModal.validateField('newpassword')
  740. }
  741. // let reg = /^[A-Za-z0-9]+$/
  742. // if (!reg.test(value)) {
  743. // return callback(new Error('请输入英文和数字'));
  744. // }
  745. if (this.pwdModal.form.againNewpassword !== '') {
  746. // 对第二个密码框单独验证
  747. this.$refs.pwdModal.validateField('againNewpassword')
  748. }
  749. callback()
  750. }
  751. }
  752. const validatePassCheck = (rule, value, callback) => {
  753. if (value === '') {
  754. callback(new Error('请再次输入新密码'))
  755. } else if (value !== this.pwdModal.form.newpassword) {
  756. callback(new Error('两次输入密码不一致'))
  757. } else {
  758. callback()
  759. }
  760. }
  761. return {
  762. centerDialogVisible:false,
  763. badgeshow: '',
  764. dutyName: '',
  765. regular: '', // 密码策略校验正则表达式
  766. regularType: '',
  767. minLength: 0,
  768. maxLength: 0,
  769. websocket: '',
  770. interval: '',
  771. companys: [], // 用户公司列表
  772. companyId: '', // 选择公司Id
  773. companyName: '', // 选择公司名称
  774. checkedByLogin: false,
  775. strongShow: false,
  776. digit: false,
  777. strongText: '',
  778. strongColor: '',
  779. originalStyle: '',
  780. colors: {
  781. primary: '#20a0ff'
  782. },
  783. theme_color: '#409EFF',
  784. current_theme: 'deepBlue_theme',
  785. theme_group: [
  786. {
  787. label: 'basic_theme',
  788. desc: '默认主题'
  789. },
  790. {
  791. label: 'green_theme',
  792. desc: '护眼主题'
  793. },
  794. {
  795. label: 'deepBlue_theme',
  796. desc: '深蓝色主题'
  797. },
  798. {
  799. label: 'dark_theme',
  800. desc: '黑色主题'
  801. },
  802. {
  803. label: 'red_theme',
  804. desc: '红色主题'
  805. },
  806. {
  807. label: 'Cyan_theme',
  808. desc: '青色主题'
  809. },
  810. {
  811. label: 'yellow_theme',
  812. desc: '黄色主题'
  813. }
  814. ],
  815. theme_origin_color: {
  816. basic_theme: '#409EFF',
  817. deepBlue_theme: '#072ec5',
  818. dark_theme: '#000000',
  819. red_theme: '#F20808',
  820. green_theme: '#008000',
  821. Cyan_theme: '#00ffff',
  822. yellow_theme: '#FFFF00'
  823. },
  824. themeSetFlag: false,
  825. lockErrorMsg: false,
  826. inputLockPwd: '',
  827. lockScreenPwd: window.top.localStorage.getItem('lockpwd'),
  828. lockEventFlag: false,
  829. lockRuleForm: {
  830. pwd: ''
  831. },
  832. lockRules: {
  833. pwd: [
  834. {
  835. required: true,
  836. message: '请输入锁屏密码',
  837. trigger: 'blur'
  838. },
  839. {
  840. min: 1,
  841. max: 128,
  842. message: '长度在 1 到 128 个字符',
  843. trigger: 'change'
  844. },
  845. {
  846. validator: validateLockPass,
  847. trigger: 'change'
  848. }
  849. ]
  850. },
  851. fullScreen: false,
  852. oldMinHeight: 0,
  853. minHeight: 'width: 100%;height: 100%;border: 0px;min-height: 777px',
  854. menuTabIndex: 0,
  855. pageBreadcrumb: [
  856. {
  857. menuId: 1,
  858. menuLabel: '首页'
  859. }
  860. ],
  861. widthLog: '',
  862. leftLog: '',
  863. dragFlag: false,
  864. store,
  865. dataDictionary,
  866. showIframe: false,
  867. selectedMenu: '',
  868. menuType: '2',
  869. menuData: store.state.routes,
  870. tabsData: [],
  871. userInfo: {},
  872. userModal: {
  873. show: false
  874. },
  875. // 修改密码
  876. pwdModal: {
  877. loading: false,
  878. show: false,
  879. form: {
  880. userid: '',
  881. prepassword: '',
  882. newpassword: '',
  883. // 重复密码
  884. againNewpassword: ''
  885. },
  886. ruleValidate: {
  887. prepassword: [
  888. {
  889. required: true,
  890. message: '原密码不能为空',
  891. trigger: 'blur'
  892. }
  893. ],
  894. newpassword: [
  895. {
  896. required: true,
  897. message: '新密码不能为空',
  898. trigger: 'blur'
  899. },
  900. // { type: 'string', max: 64, message: '密码不能多于64个字符', trigger: 'blur' },
  901. {
  902. validator: validatePass,
  903. trigger: 'blur'
  904. }
  905. ],
  906. againNewpassword: [
  907. {
  908. required: true,
  909. message: '确认密码不能为空',
  910. trigger: 'blur'
  911. },
  912. // { type: 'string', max: 64, message: '密码不能多于64个字符', trigger: 'blur' },
  913. {
  914. validator: validatePassCheck,
  915. trigger: 'blur'
  916. }
  917. ]
  918. }
  919. },
  920. inter: undefined,
  921. task1Num: 0, // 我的待办任务
  922. task2Num: 0, // 委托待办任务
  923. myMessageLength: 0, // 我收到的公告
  924. privilegeUpdateIfo: false, // 权限被修改后退出提示框
  925. closeSecond: 5, // 系统退出倒计时
  926. mainPageList: [], //设为主页的菜单页面
  927. orgName: '',
  928. orgId: '',
  929. orgCode: '',
  930. orgDutyLinks: [],
  931. styleControll: false,
  932. dutyId: '',
  933. appId: '',
  934. defaultActiveIndex: '',
  935. taskAllNum: '', //任务数目
  936. socketshow: false, //通知框的显示
  937. orgcodezs: '', //cookie中的orgcode
  938. userId: '',//cookie中的userId
  939. noticedata:[],
  940. noticedata1: {
  941. noticeTitle:'ceshi',
  942. noticecontent:'ceshi',
  943. insertusername:'ceshi',
  944. inserttime:'ceshi'
  945. },
  946. allowed: []
  947. }
  948. },
  949. created() {
  950. this.orgcodezs = getCookie('orgCode')
  951. this.userId = getCookie('userId')
  952. this.current_theme = window.top.localStorage.getItem('current_theme')
  953. ? window.top.localStorage.getItem('current_theme')
  954. : 'deepBlue_theme'
  955. this.theme_color = this.theme_origin_color[this.current_theme]
  956. this.getIndexStyle()
  957. let w = document.documentElement.clientWidth || document.body.clientWidth
  958. let h = document.documentElement.clientHeight || document.body.clientHeight
  959. if (w <= 1500) {
  960. this.styleControll = true
  961. } else {
  962. this.styleControll = false
  963. }
  964. console.log('获取到的orgCode+++++++++++++' + this.orgcodezs)
  965. this.getinformation()
  966. },
  967. destroyed() {
  968. // 销毁浏览器返回监听
  969. // window.removeEventListener('popstate', this.goBack, false);
  970. clearInterval(this.inter)
  971. // 销毁websocket监听
  972. // this.websocket.onclose = this.close();
  973. },
  974. computed: {},
  975. beforeCreate() {
  976. let userId = getCookie('userId')
  977. this.appId = getCookie('appId')
  978. let menuId = window.top.localStorage.getItem('activeMenu')
  979. let companyId = window.top.localStorage.getItem('companyId')
  980. },
  981. watch: {
  982. checkedByLogin: function(n) {
  983. if (n) {
  984. try {
  985. this.lockRuleForm.pwd = JSON.parse(getCookie('userInfo')).password
  986. } catch (error) {
  987. this.lockRuleForm.pwd = ''
  988. }
  989. } else {
  990. this.lockRuleForm.pwd = ''
  991. }
  992. },
  993. theme_color: function(newV, oldV) {
  994. let that = this
  995. that.colors.primary = newV
  996. console.log(newV)
  997. console.log($(document.getElementsByTagName('iframe')))
  998. window.colorVal = newV
  999. that.primaryColor = this.colors.primary
  1000. that.colors = objectAssign(
  1001. {},
  1002. that.colors,
  1003. generateColors(that.colors.primary)
  1004. )
  1005. let theme_style = that.originalStyle
  1006. Object.keys(that.colors).forEach(key => {
  1007. theme_style = theme_style.replace(
  1008. new RegExp('(:|\\s+)' + key, 'g'),
  1009. '$1' + that.colors[key]
  1010. )
  1011. })
  1012. that.loadNewStyle(document, theme_style)
  1013. for (let i = 0; i < document.getElementsByTagName('iframe').length; i++) {
  1014. try {
  1015. that.loadNewStyle(
  1016. document.getElementsByTagName('iframe')[i].contentDocument,
  1017. theme_style
  1018. )
  1019. } catch (err) {}
  1020. }
  1021. },
  1022. current_theme: function(n) {
  1023. let that = this
  1024. window.top.localStorage.setItem('current_theme', n)
  1025. that.theme_color = that.theme_origin_color[n]
  1026. console.log(that.theme_color)
  1027. console.log('这是')
  1028. for (let i = 0; i < document.getElementsByTagName('iframe').length; i++) {
  1029. console.log(
  1030. document
  1031. .getElementsByTagName('iframe')
  1032. [i].contentDocument.getElementsByClassName('mainVueIndex')[0]
  1033. .className
  1034. )
  1035. try {
  1036. document
  1037. .getElementsByTagName('iframe')
  1038. [i].contentDocument.getElementsByClassName(
  1039. 'mainVueIndex'
  1040. )[0].className = 'main mainVueIndex ' + n
  1041. } catch (err) {}
  1042. }
  1043. },
  1044. menuType: function(newV, oldV) {
  1045. let that = this
  1046. if (newV === '2') {
  1047. that.$nextTick(function() {
  1048. $('.icore-menu-main2').css({
  1049. width: that.widthLog
  1050. })
  1051. $('.sl-container2').css({
  1052. 'padding-left': that.leftLog
  1053. })
  1054. $('.oa-header-user').css({
  1055. width: that.widthLog
  1056. })
  1057. $('.oa-header-upt').css({
  1058. width: ''
  1059. })
  1060. that.setDrag()
  1061. })
  1062. } else {
  1063. that.widthLog = $('.icore-menu-main2').css('width')
  1064. that.leftLog = $('.sl-container2').css('padding-left')
  1065. $('.icore-menu-main2').css({
  1066. width: ''
  1067. })
  1068. $('.sl-container2').css({
  1069. 'padding-left': ''
  1070. })
  1071. $('.oa-header-user').css({
  1072. width: '80px'
  1073. })
  1074. $('.oa-header-upt').css({
  1075. width: '80px'
  1076. })
  1077. }
  1078. },
  1079. selectedMenu: function(menuId) {
  1080. var currentMenu = this.getMenuIndexByMenuId(this.menuData, null, menuId)
  1081. currentMenu &&
  1082. window.top.localStorage.setItem(
  1083. 'currentMenuIndex',
  1084. currentMenu.menuIndex
  1085. )
  1086. }
  1087. },
  1088. mounted() {
  1089. let that = this
  1090. window.onresize = function() {
  1091. let isFull =
  1092. document.fullscreen ||
  1093. document.webkitIsFullScreen ||
  1094. document.msFullscreenEnabled
  1095. isFull = isFull ? true : false
  1096. if (that.fullScreen !== isFull) {
  1097. //要执行的动作
  1098. that.fullScreen = isFull
  1099. }
  1100. }
  1101. // // 监控浏览器返回
  1102. // if (window.history && window.history.pushState) {
  1103. // history.pushState(null, null, document.URL);
  1104. // window.addEventListener('popstate', this.goBack, false);
  1105. // }
  1106. // 取字典(用处不明,且加入租户id后报错!!!!!暂时注释掉!!!!!!!!!!)
  1107. // this.dataDictionary.dispatch('list').then(() => {
  1108. // // console.log(this.dataDictionary.state.dict)
  1109. // });
  1110. this.showIframeEvent()
  1111. this.$nextTick(() => {
  1112. this.minHeight =
  1113. 'width: 100%;height: 100%;border: 0px;min-height: ' +
  1114. ($('#menuTabId').height() - 91) +
  1115. 'px'
  1116. that.checkedByLogin = true
  1117. })
  1118. // 获取公司信息
  1119. this.companyId = window.top.localStorage.getItem('companyId')
  1120. this.companys = JSON.parse(window.top.localStorage.getItem('companys'))
  1121. if (this.companyId !== '' && this.companyId !== null) {
  1122. this.companyName = this.companys.find(
  1123. x => x.id === this.companyId
  1124. ).companyName
  1125. }
  1126. setTimeout(() => {
  1127. this.current_theme = window.top.localStorage.getItem('current_theme')
  1128. ? window.top.localStorage.getItem('current_theme')
  1129. : 'deepBlue_theme'
  1130. }, 1000)
  1131. // 获取我的待办任务
  1132. var arr = ['#/authManage']
  1133. if ($.inArray(location.hash, arr) == -1) {
  1134. //that.getMyToDoDelegateTask();
  1135. //that.getMyToDoTask();
  1136. }
  1137. that.getMyMessage()
  1138. // 直接关闭浏览器窗口或者标签页时,关闭websocket连接
  1139. // window.onbeforeunload = function () {
  1140. // // that.send("closesocket:");
  1141. // that.close();
  1142. // }
  1143. // 获取当前密码策略校验
  1144. that.getPwdValid()
  1145. // 获取机构职级
  1146. that.getOrgDutyList()
  1147. },
  1148. methods: {
  1149. //弹框删除
  1150. async makeSure(){
  1151. let noticeid=this.noticedata1.noticeid
  1152. console.log(this.noticedata1)
  1153. this.noticedata1=[] ;
  1154. this.centerDialogVisible=false;
  1155. await this.axios.post("/api/v1/ams/updateNoticeStatus",
  1156. {userId:this.userId,
  1157. noticeId:noticeid}).then((res)=>{
  1158. console.log(res.data)
  1159. if (res.data.data ===0){
  1160. this.badgeshow=true;
  1161. }else {
  1162. console.log('进入了小红点标记区')
  1163. this.taskAllNum=res.data.data;
  1164. }
  1165. })
  1166. },
  1167. // 判断是否为公司其他平台模块且处于开发模式
  1168. isDev(url) {
  1169. let isDevModule = false
  1170. if (
  1171. url.indexOf('steerinfo.com') !== -1 &&
  1172. document.domain.indexOf('steerinfo.com') === -1
  1173. ) {
  1174. isDevModule = true
  1175. }
  1176. return isDevModule
  1177. },
  1178. // 根据当前模式更改菜单跳转url
  1179. getDevUrl(url) {
  1180. let newUrl = ''
  1181. let index = url.indexOf('steerinfo.com')
  1182. return (newUrl = url.substring(index).replace('steerinfo.com/views', '.'))
  1183. },
  1184. // 根据https/http跳转
  1185. toTrustUrl(url) {
  1186. let newUrl = ''
  1187. if (url.indexOf('https:') === -1 && url.indexOf('http:') > -1) {
  1188. newUrl = url.replace('http:', window.top.location.protocol)
  1189. } else if (url.indexOf('https:') > -1) {
  1190. newUrl = url.replace('https:', window.top.location.protocol)
  1191. } else {
  1192. newUrl = url
  1193. }
  1194. return newUrl
  1195. },
  1196. // 获取当前密码策略
  1197. getPwdValid() {
  1198. this.axios
  1199. .get('pass/v1/syspwdpolicys/getExecutingPwdPolicy')
  1200. .then(res => {
  1201. if (res.code === '0') {
  1202. this.regular = res.data.regular
  1203. this.regularType = res.data.regularType
  1204. this.minLength = res.data.minLength
  1205. this.maxLength = res.data.maxLength
  1206. } else {
  1207. this.$message.error(res.message)
  1208. }
  1209. })
  1210. .catch(err => {
  1211. console.log(err)
  1212. })
  1213. },
  1214. /**
  1215. * 样式加载
  1216. *
  1217. */
  1218. loadNewStyle(doc, theme_style) {
  1219. let child = doc.getElementById('theme')
  1220. if (child !== null) {
  1221. doc.getElementsByTagName('head')[0].removeChild(child)
  1222. }
  1223. let a = document.createElement('style')
  1224. a.setAttribute('id', 'theme')
  1225. a.innerHTML = theme_style
  1226. doc.getElementsByTagName('head')[0].appendChild(a)
  1227. },
  1228. // 验证密码强度的事件
  1229. inputThing(val) {
  1230. let _this = this
  1231. let arr = []
  1232. let i = 0
  1233. arr[0] = /[^a-zA-Z0-9_]/g
  1234. arr[1] = /[a-z]/g
  1235. arr[2] = /[0-9]/g
  1236. arr[3] = /[A-Z]/g
  1237. if (val.length >= 6) {
  1238. arr.forEach(res => {
  1239. if (val.match(res)) {
  1240. i++
  1241. }
  1242. })
  1243. switch (i) {
  1244. case 0:
  1245. _this.strongShow = false
  1246. break
  1247. case 1:
  1248. _this.strongShow = true
  1249. _this.strongText = '弱'
  1250. _this.strongColor = '#F26299'
  1251. _this.digit = true
  1252. break
  1253. case 2:
  1254. _this.strongShow = true
  1255. _this.strongText = '中'
  1256. _this.strongColor = '#F29E55'
  1257. break
  1258. case 3:
  1259. _this.strongShow = true
  1260. _this.strongText = '强'
  1261. _this.strongColor = '#4CD995'
  1262. break
  1263. }
  1264. } else if (!val) {
  1265. _this.strongShow = false
  1266. } else {
  1267. _this.strongShow = true
  1268. _this.strongText = '弱'
  1269. _this.strongColor = '#F26299'
  1270. _this.digit = false
  1271. }
  1272. },
  1273. /**
  1274. * 加载全局样式;
  1275. */
  1276. getStyleTemplate(data) {
  1277. const colorMap = {
  1278. '#3a8ee6': 'shade-1',
  1279. '#409eff': 'primary',
  1280. '#53a8ff': 'light-1',
  1281. '#66b1ff': 'light-2',
  1282. '#79bbff': 'light-3',
  1283. '#8cc5ff': 'light-4',
  1284. '#a0cfff': 'light-5',
  1285. '#b3d8ff': 'light-6',
  1286. '#c6e2ff': 'light-7',
  1287. '#d9ecff': 'light-8',
  1288. '#ecf5ff': 'light-9'
  1289. }
  1290. Object.keys(colorMap).forEach(key => {
  1291. const value = colorMap[key]
  1292. data = data.replace(new RegExp(key, 'ig'), value)
  1293. })
  1294. return data
  1295. },
  1296. getIndexStyle() {
  1297. let data = `@charset "UTF-8"; ${element_css_json_import.element_css}`
  1298. this.originalStyle = this.getStyleTemplate(data)
  1299. },
  1300. /**
  1301. * 解除锁屏
  1302. *
  1303. */
  1304. setLock() {
  1305. let that = this
  1306. let crypto = require('crypto')
  1307. if (
  1308. that.lockScreenPwd === that.inputLockPwd ||
  1309. that.lockScreenPwd ===
  1310. crypto
  1311. .createHash('sha1')
  1312. .update(that.inputLockPwd)
  1313. .digest('hex')
  1314. ) {
  1315. window.top.localStorage.setItem('lockpwd', '')
  1316. that.lockScreenPwd = ''
  1317. that.inputLockPwd = ''
  1318. } else {
  1319. that.inputLockPwd = ''
  1320. that.lockErrorMsg = true
  1321. setTimeout(() => {
  1322. that.lockErrorMsg = false
  1323. }, 1000)
  1324. }
  1325. },
  1326. /**
  1327. * 锁屏退出登录
  1328. */
  1329. lockSignOut() {
  1330. let that = this
  1331. that.store
  1332. .dispatch('loginOut')
  1333. .then(function(res) {
  1334. window.location.href = './index.html'
  1335. })
  1336. .catch(function() {
  1337. // TODO
  1338. })
  1339. },
  1340. /**
  1341. *打开主页
  1342. */
  1343. backMain() {
  1344. this.$message.success('跳转主页')
  1345. // window.open(
  1346. // window.location.protocol + "//portal.steerinfo.com",
  1347. // "_blank"
  1348. // );
  1349. },
  1350. /**
  1351. * 主题
  1352. */
  1353. themeEvent() {
  1354. let that = this
  1355. that.themeSetFlag = true
  1356. },
  1357. /**
  1358. * 锁屏
  1359. */
  1360. lockEvent() {
  1361. let that = this
  1362. if (!that.checkedByLogin) {
  1363. that.lockRuleForm.pwd = ''
  1364. }
  1365. that.lockEventFlag = true
  1366. },
  1367. lockEventSet() {
  1368. let that = this
  1369. this.$refs.lockRuleForm.validate(valid => {
  1370. if (valid) {
  1371. window.top.localStorage.setItem('lockpwd', that.lockRuleForm.pwd)
  1372. that.lockScreenPwd = that.lockRuleForm.pwd
  1373. that.lockEventFlag = false
  1374. that.$nextTick(() => {
  1375. that.$refs.lockInput.focus()
  1376. })
  1377. } else {
  1378. return false
  1379. }
  1380. })
  1381. },
  1382. /*
  1383. 全屏
  1384. */
  1385. fullScreenEvent() {
  1386. let that = this
  1387. let main = document.documentElement
  1388. if (that.fullScreen) {
  1389. if (document.exitFullscreen) {
  1390. document.exitFullscreen()
  1391. } else if (document.mozCancelFullScreen) {
  1392. document.mozCancelFullScreen()
  1393. } else if (document.webkitCancelFullScreen) {
  1394. document.webkitCancelFullScreen()
  1395. } else if (document.msExitFullscreen) {
  1396. document.msExitFullscreen()
  1397. }
  1398. } else {
  1399. // 开始全屏操作
  1400. var currentIfrm = $('#menuTabId')
  1401. .find('div[role=tabpanel]:visible')
  1402. .find('iframe')
  1403. $('.oa-header-user')
  1404. .hide()
  1405. .next()
  1406. .hide()
  1407. $('#outerHeader').hide()
  1408. $('#mainContainer').css('paddingLeft', '0')
  1409. $('#menuTabId')
  1410. .css('padding', 0)
  1411. .children(':eq(0)')
  1412. .hide()
  1413. $('.sl-content-main', top.document).css('height', 'initial')
  1414. // 先保留全屏前的iframe高度
  1415. this.oldMinHeight = currentIfrm.css('min-height')
  1416. // 将最小高度设置成当前分辨率的高度
  1417. currentIfrm.css('min-height', window.screen.height)
  1418. if (main.requestFullscreen) {
  1419. main.requestFullscreen()
  1420. } else if (main.mozRequestFullScreen) {
  1421. main.mozRequestFullScreen()
  1422. } else if (main.webkitRequestFullScreen) {
  1423. main.webkitRequestFullScreen()
  1424. } else if (main.msRequestFullscreen) {
  1425. main.msRequestFullscreen()
  1426. }
  1427. }
  1428. that.fullScreen = !that.fullScreen
  1429. },
  1430. // 下拉选择公司
  1431. selectComPany(command) {
  1432. this.$confirm('此操作将刷新系统页面, 是否继续?', '提示', {
  1433. confirmButtonText: '确定',
  1434. cancelButtonText: '取消',
  1435. type: 'warning'
  1436. })
  1437. .then(() => {
  1438. this.companyId = command.id
  1439. this.companyName = command.companyName
  1440. // 查询列表
  1441. this.store
  1442. .dispatch('generateRoutes', {
  1443. companyId: command.id,
  1444. appId: this.appId
  1445. })
  1446. .then(res => {
  1447. if (res.code === '0') {
  1448. this.store.commit('addRouters', res.data)
  1449. } else {
  1450. this.$message({
  1451. message: res.message,
  1452. type: 'error'
  1453. })
  1454. }
  1455. })
  1456. window.top.localStorage.setItem('companyId', command.id)
  1457. window.location.reload()
  1458. this.$message({
  1459. type: 'success',
  1460. message: '正在为您更新数据...'
  1461. })
  1462. })
  1463. .catch(error => {
  1464. console.log(error)
  1465. this.$message({
  1466. type: 'info',
  1467. message: '已取消操作'
  1468. })
  1469. })
  1470. },
  1471. selectOrg(command) {
  1472. this.$confirm('此操作将切换用户所在机构及职级, 是否继续?', '提示', {
  1473. confirmButtonText: '确定',
  1474. cancelButtonText: '取消',
  1475. type: 'warning'
  1476. })
  1477. .then(() => {
  1478. this.orgName = command.orgName
  1479. this.orgId = command.orgId
  1480. this.dutyName = command.dutys ? command.dutys[0].dutyName : ''
  1481. this.dutyId = command.dutys ? command.dutys[0].dutyId : ''
  1482. window.top.localStorage.setItem('dutyName', this.dutyName)
  1483. window.top.localStorage.setItem('dutyId', this.dutyId)
  1484. window.top.localStorage.setItem('orgId', command.orgId)
  1485. window.top.localStorage.setItem('orgCode', command.orgCode)
  1486. window.location.reload()
  1487. this.$message({
  1488. type: 'success',
  1489. message: '正在为您更新数据...'
  1490. })
  1491. this.updateUserInfo()
  1492. })
  1493. .catch(error => {
  1494. console.log(error)
  1495. this.$message({
  1496. type: 'info',
  1497. message: '已取消操作'
  1498. })
  1499. })
  1500. },
  1501. // 更新用户当前机构及职级
  1502. async updateUserInfo() {
  1503. // do
  1504. },
  1505. getOrgDutyList() {
  1506. let that = this
  1507. that.axios
  1508. .get('pass/v1/sysorgs/findOrgs?companyId=' + this.companyId)
  1509. .then(res => {
  1510. if (res.code === '0') {
  1511. this.orgDutyLinks = res.data
  1512. if (this.orgDutyLinks.length > 0) {
  1513. let orgId = window.top.localStorage.getItem('orgId')
  1514. if (orgId && orgId !== '' && orgId !== null) {
  1515. let obj = this.orgDutyLinks.find(x => x.orgId === orgId)
  1516. if (obj) {
  1517. this.orgId = orgId
  1518. this.orgName = obj.orgName
  1519. this.orgCode = obj.orgCode
  1520. this.dutyName = obj.dutys ? obj.dutys[0].dutyName : ''
  1521. this.dutyId = obj.dutys ? obj.dutys[0].dutyId : ''
  1522. } else {
  1523. this.orgName = res.data[0].orgName
  1524. this.orgId = res.data[0].orgId
  1525. this.orgCode = res.data[0].orgCode
  1526. this.dutyName = res.data[0].dutys
  1527. ? res.data[0].dutys[0].dutyName
  1528. : ''
  1529. this.dutyId = res.data[0].dutys
  1530. ? res.data[0].dutys.dutyId
  1531. : ''
  1532. }
  1533. } else {
  1534. this.orgName = res.data[0].orgName
  1535. this.orgId = res.data[0].orgId
  1536. this.orgCode = res.data[0].orgCode
  1537. this.dutyName = res.data[0].dutys
  1538. ? res.data[0].dutys[0].dutyName
  1539. : ''
  1540. this.dutyId = res.data[0].dutys
  1541. ? res.data[0].dutys[0].dutyId
  1542. : ''
  1543. this.updateUserInfo()
  1544. }
  1545. window.top.localStorage.setItem('orgId', this.orgId)
  1546. window.top.localStorage.setItem('orgCode', this.orgCode)
  1547. window.top.localStorage.setItem('dutyName', this.dutyName)
  1548. window.top.localStorage.setItem('dutyId', this.dutyId)
  1549. }
  1550. } else {
  1551. this.$message.error(res.message)
  1552. }
  1553. })
  1554. .catch(err => {
  1555. console.log(err)
  1556. })
  1557. },
  1558. visibleChange(f) {
  1559. let that = this
  1560. if (!f) {
  1561. $('.contextmenu').css({
  1562. display: 'none'
  1563. })
  1564. }
  1565. },
  1566. handleCommand(command) {
  1567. let that = this
  1568. switch (command) {
  1569. case 'a': //关闭当前标签
  1570. $('#menuTabId .el-icon-close')
  1571. .eq(that.menuTabIndex)
  1572. .click()
  1573. break
  1574. case 'b': //关闭其他标签
  1575. var removeTarget = []
  1576. var len = that.tabsData.length - that.menuTabIndex - 1
  1577. for (let i = 0; i < len; i++) {
  1578. removeTarget.push(
  1579. $('#menuTabId .el-icon-close').eq(that.menuTabIndex + i + 1)
  1580. )
  1581. }
  1582. for (let i = 0; i < that.menuTabIndex; i++) {
  1583. removeTarget.push($('#menuTabId .el-icon-close').eq(i))
  1584. }
  1585. for (let i = 0; i < removeTarget.length; i++) {
  1586. $(removeTarget[i]).click()
  1587. }
  1588. break
  1589. case 'c': //关闭右侧标签
  1590. var removeTarget = []
  1591. var len = that.tabsData.length - that.menuTabIndex - 1
  1592. for (let i = 0; i < len; i++) {
  1593. removeTarget.push(
  1594. $('#menuTabId .el-icon-close').eq(that.menuTabIndex + i + 1)
  1595. )
  1596. }
  1597. for (let i = 0; i < removeTarget.length; i++) {
  1598. $(removeTarget[i]).click()
  1599. }
  1600. break
  1601. case 'd': // 刷新当前标签页
  1602. $('#menuTabId .el-tabs__item')
  1603. .eq(that.menuTabIndex)
  1604. .click()
  1605. $('#menuTabId iframe')
  1606. .eq(that.menuTabIndex)[0]
  1607. .contentWindow.location.reload(true)
  1608. break
  1609. }
  1610. },
  1611. // 右键菜单
  1612. rightShow($event, index, item) {
  1613. let that = this
  1614. that.menuTabIndex = index
  1615. $('.contextmenu').css({
  1616. left: $event.pageX + 120 + 'px',
  1617. top: $event.pageY + 'px',
  1618. display: 'block'
  1619. })
  1620. $('#setClick').click()
  1621. $event.preventDefault()
  1622. },
  1623. gotoSetPage(item) {
  1624. let that = this
  1625. let menuData = item.preTarget
  1626. if (!menuData) {
  1627. return
  1628. }
  1629. that.tabsData.push(menuData)
  1630. that.selectedMenu = menuData.menuId
  1631. that.pageBreadcrumb = item.pageBreadcrumb
  1632. that.axios
  1633. .post(proPath + 'v1/sysmenus/accessOwnAdd', {
  1634. userId: that.$store.state.userInfo.userId,
  1635. menuId: menuData.menuId
  1636. })
  1637. .then(function(response) {})
  1638. .catch(function() {})
  1639. },
  1640. // 判断是否在iframe下
  1641. showIframeEvent() {
  1642. var that = this
  1643. var thisDocument = document
  1644. try {
  1645. var topDocument = window.top.document
  1646. } catch (err) {
  1647. thisDocument.getElementsByClassName(
  1648. 'icore-menu-main'
  1649. )[0].style.display = 'none'
  1650. thisDocument.getElementsByClassName('sl-header')[0].style.display =
  1651. 'none'
  1652. thisDocument.getElementById('mainContainer').style.padding = '0px'
  1653. return
  1654. }
  1655. var routerCover = this.$router.history.current.query
  1656. var routerParams = this.$router.history.current.params
  1657. var routerFlag = 0
  1658. var routerFlagP = 0
  1659. for (var i in routerCover) {
  1660. routerFlag = routerFlag + 1
  1661. }
  1662. for (var j in routerParams) {
  1663. routerFlagP = routerFlagP + 1
  1664. }
  1665. that.showIframe =
  1666. thisDocument === topDocument && routerFlag === 0 && routerFlagP === 0
  1667. if (that.showIframe) {
  1668. that.getUserInfo()
  1669. thisDocument.getElementById('mainContainer').style['padding-left'] =
  1670. '179px'
  1671. // websocket初始化
  1672. let token = getCookie('accessToken')
  1673. if (token) {
  1674. this.init(token)
  1675. }
  1676. // 打开设为主页的菜单
  1677. // that.openMainPage();
  1678. // 自动打开上一次访问页面
  1679. that.autoOpenLatestPage()
  1680. }
  1681. if (routerFlag > 0 || routerFlagP > 0) {
  1682. that.menuType = '1'
  1683. }
  1684. var setShowIframe = setInterval(function() {
  1685. for (
  1686. let i = 0;
  1687. i < window.top.document.getElementsByTagName('iframe').length;
  1688. i++
  1689. ) {
  1690. if (
  1691. window.top.document.getElementsByTagName('iframe')[i]
  1692. .contentDocument !== null &&
  1693. window.top.document
  1694. .getElementsByTagName('iframe')
  1695. [i].contentDocument.getElementsByClassName('icore-menu-main')
  1696. .length > 0
  1697. ) {
  1698. $(
  1699. window.top.document.getElementsByTagName('iframe')[i].parentNode
  1700. .parentNode
  1701. ).css({
  1702. height: 'calc(100% - 31px)'
  1703. })
  1704. $(
  1705. window.top.document.getElementsByTagName('iframe')[i].parentNode
  1706. ).css({
  1707. height: '100%'
  1708. })
  1709. window.top.document
  1710. .getElementsByTagName('iframe')
  1711. [i].contentDocument.getElementsByClassName(
  1712. 'icore-menu-main'
  1713. )[0].style.display = 'none'
  1714. window.top.document
  1715. .getElementsByTagName('iframe')
  1716. [i].contentDocument.getElementsByClassName(
  1717. 'sl-header'
  1718. )[0].style.display = 'none'
  1719. window.top.document
  1720. .getElementsByTagName('iframe')
  1721. [i].contentDocument.getElementsByClassName(
  1722. 'sl-content-main'
  1723. )[0].style.height = '100%'
  1724. window.top.document
  1725. .getElementsByTagName('iframe')
  1726. [i].contentDocument.getElementById(
  1727. 'mainContainer'
  1728. ).style.padding = '0px'
  1729. if (
  1730. i ===
  1731. window.top.document.getElementsByTagName('iframe').length - 1
  1732. ) {
  1733. clearInterval(setShowIframe)
  1734. }
  1735. }
  1736. }
  1737. if (window.top.document.getElementsByTagName('iframe').length === 0) {
  1738. if (!that.showIframe) {
  1739. thisDocument.getElementById('mainContainer').style['padding-left'] =
  1740. '0px'
  1741. thisDocument.getElementsByClassName(
  1742. 'sl-content-main'
  1743. )[0].style.height = '100%'
  1744. }
  1745. clearInterval(setShowIframe)
  1746. }
  1747. }, 20)
  1748. that.setDrag()
  1749. },
  1750. handleOperate() {
  1751. setTimeout(() => {
  1752. this.$nextTick(() => {
  1753. let heightOld = $('.icore-menu-main')[0].clientHeight
  1754. let height = $('.icore-menu-main')[0].scrollHeight
  1755. if (height !== 0) {
  1756. // 菜单收缩后scrollHeight复原
  1757. window.top.document.getElementsByClassName(
  1758. 'menuDrag'
  1759. )[0].style.height = heightOld + 'px'
  1760. // 再次赋值
  1761. let heightNew = $('.icore-menu-main')[0].scrollHeight
  1762. window.top.document.getElementsByClassName(
  1763. 'menuDrag'
  1764. )[0].style.height = heightNew + 'px'
  1765. }
  1766. })
  1767. }, 500)
  1768. },
  1769. setDrag() {
  1770. let that = this
  1771. if (that.showIframe) {
  1772. that.$nextTick(() => {
  1773. window.top.document.getElementsByClassName(
  1774. 'menuDrag'
  1775. )[0].style.height = $('.icore-menu-main')[0].scrollHeight + 'px'
  1776. })
  1777. }
  1778. $('#menuDrag').unbind()
  1779. $('#menuDrag').mousedown(function(event) {
  1780. that.dragFlag = true
  1781. $(event.target).data('dragStart', event.pageX)
  1782. $(event.target).data('dragWidth', $('.icore-menu-main2').outerWidth())
  1783. $('body').css({
  1784. cursor: 'col-resize'
  1785. })
  1786. let _html =
  1787. '<div id="dragsc" style="height: 100%;width: 100%;position: absolute;top: 0;z-index: 888;"></div>'
  1788. $('body').append(_html)
  1789. $('body').mousemove(function(e) {
  1790. if (!that.dragFlag) {
  1791. $(this).css({
  1792. cursor: ''
  1793. })
  1794. $('#dragsc').remove()
  1795. $(this).unbind(e)
  1796. } else {
  1797. var startX = $('#menuDrag').data('dragStart')
  1798. var endX = e.pageX
  1799. var change = endX - startX
  1800. var containerWidth = $('#menuDrag').data('dragWidth')
  1801. // console.log('containerWidth + change = ' + (containerWidth + change))
  1802. if (containerWidth + change < 180) {
  1803. $('.icore-menu-main2').css({
  1804. width: '180px'
  1805. })
  1806. $('.oa-header-user').css({
  1807. width: ''
  1808. })
  1809. $('.sl-container2').css({
  1810. 'padding-left': '179px'
  1811. })
  1812. } else if (containerWidth + change <= 800) {
  1813. $('.icore-menu-main2').css({
  1814. width: containerWidth + change + 'px'
  1815. })
  1816. $('.sl-container2').css({
  1817. 'padding-left': containerWidth + change - 1 + 'px'
  1818. })
  1819. $('.oa-header-user').css({
  1820. width: containerWidth + change + 'px'
  1821. })
  1822. }
  1823. }
  1824. })
  1825. $('body').mouseup(function(ev) {
  1826. that.dragFlag = false
  1827. $(this).unbind(ev)
  1828. })
  1829. })
  1830. },
  1831. // tabs选项选择
  1832. handleClick(tab, event) {
  1833. let that = this
  1834. let pageBreadcrumb = $($('.pageBreadcrumb')[parseInt(tab.index)]).html()
  1835. that.pageBreadcrumb = JSON.parse(pageBreadcrumb)
  1836. window.top.localStorage.setItem('activeMenu', tab.name)
  1837. that.menuTabIndex = that.getTabIndex(tab.name)
  1838. for (let i = 0; i < this.mainPageList.length - 1; i++) {
  1839. if (
  1840. tab.name === this.mainPageList[i].menuId &&
  1841. this.mainPageList[i].mainPageLoading === true
  1842. ) {
  1843. $('#menuTabId iframe')
  1844. .eq(that.menuTabIndex)[0]
  1845. .contentWindow.location.reload(true)
  1846. this.mainPageList[i].mainPageLoading = false
  1847. }
  1848. }
  1849. },
  1850. removeTab(targetName) {
  1851. var that = this
  1852. var spliceIndex = null
  1853. var temp = []
  1854. for (let i = 0; i < this.mainPageList.length - 1; i++) {
  1855. if (targetName === this.mainPageList[i].menuId) {
  1856. this.mainPageList[i].mainPageLoading = false
  1857. }
  1858. }
  1859. for (var i = 0; i < that.tabsData.length; i++) {
  1860. temp.push(that.tabsData[i])
  1861. if (targetName === that.tabsData[i].menuId) {
  1862. spliceIndex = i
  1863. }
  1864. }
  1865. if (spliceIndex !== null) {
  1866. temp.splice(spliceIndex, 1)
  1867. }
  1868. if (that.selectedMenu === that.tabsData[spliceIndex].menuId) {
  1869. if (temp.length !== 0) {
  1870. var showIndex = spliceIndex
  1871. if (showIndex > temp.length - 1) {
  1872. showIndex = temp.length - 1
  1873. }
  1874. that.selectedMenu = temp[showIndex].menuId
  1875. window.top.localStorage.setItem('activeMenu', that.selectedMenu)
  1876. that.pageBreadcrumb = temp[showIndex].pageBreadcrumb
  1877. } else {
  1878. that.pageBreadcrumb = [
  1879. {
  1880. menuId: 1,
  1881. menuLabel: '首页'
  1882. }
  1883. ]
  1884. window.top.localStorage.setItem('currentMenuIndex', '')
  1885. }
  1886. }
  1887. that.tabsData = temp
  1888. },
  1889. // 菜单选择
  1890. selectMenu(menuData, pageBreadcrumb) {
  1891. console.log('menuData')
  1892. console.log(menuData)
  1893. // console.log(pageBreadcrumb)
  1894. var that = this
  1895. if (
  1896. menuData.menuUrl !== null &&
  1897. menuData.menuUrl !== '' &&
  1898. typeof menuData.menuUrl !== 'undefined'
  1899. ) {
  1900. window.top.localStorage.setItem('activeMenu', menuData.menuId)
  1901. var temp = []
  1902. menuData.pageBreadcrumb = pageBreadcrumb
  1903. var setTabsFlag = true
  1904. for (var i = 0; i < that.tabsData.length; i++) {
  1905. if (menuData.menuId === that.tabsData[i].menuId) {
  1906. setTabsFlag = false
  1907. break
  1908. }
  1909. }
  1910. if (setTabsFlag) {
  1911. for (var j = 0; j < that.tabsData.length; j++) {
  1912. temp.push(that.tabsData[j])
  1913. }
  1914. temp.push(menuData)
  1915. that.tabsData.push(menuData)
  1916. }
  1917. that.selectedMenu = menuData.menuId
  1918. that.pageBreadcrumb = pageBreadcrumb
  1919. that.axios
  1920. .post(proPath + 'v1/sysmenus/accessOwnAdd', {
  1921. userId: that.$store.state.userInfo.userId,
  1922. menuId: menuData.menuId
  1923. })
  1924. .then(function(response) {})
  1925. .catch(function() {})
  1926. this.$nextTick(() => {
  1927. console.log($(document.getElementsByTagName('iframe')))
  1928. })
  1929. }
  1930. // console.log('目录', that.selectedMenu, that.tabsData)
  1931. // 左侧菜单点击切换的时候需要重新加载页面
  1932. that.menuTabIndex = that.getTabIndex(menuData.menuId)
  1933. $('#menuTabId iframe').eq(that.menuTabIndex).length &&
  1934. $('#menuTabId iframe')
  1935. .eq(that.menuTabIndex)[0]
  1936. .contentWindow.location.reload(true)
  1937. },
  1938. // 是否合部都不是菜单就不用显示
  1939. allNoMenu(items) {
  1940. let bol = false
  1941. for (let item of items) {
  1942. if (item.menuType === '1' || item.menuType === '4') {
  1943. // 有菜单
  1944. bol = true
  1945. break
  1946. }
  1947. }
  1948. return bol
  1949. },
  1950. //
  1951. signOut() {
  1952. let _this = this
  1953. _this
  1954. .$msgbox({
  1955. title: '退出提示',
  1956. message: '确定退出登录吗?',
  1957. showCancelButton: true,
  1958. confirmButtonText: '确定',
  1959. cancelButtonText: '取消',
  1960. beforeClose: (action, instance, done) => {
  1961. if (action === 'confirm') {
  1962. instance.confirmButtonLoading = true
  1963. instance.confirmButtonText = '执行中...'
  1964. // ajax
  1965. let res = this.axios.get('pass/logout', {
  1966. params: {
  1967. authorization: getCookie('accessToken')
  1968. }
  1969. })
  1970. res
  1971. .then(function(res) {
  1972. console.log(111)
  1973. instance.confirmButtonText = '确定'
  1974. instance.confirmButtonLoading = false
  1975. done()
  1976. window.location.href = './index.html'
  1977. })
  1978. .catch(function() {
  1979. instance.confirmButtonText = '确定'
  1980. instance.confirmButtonLoading = false
  1981. done()
  1982. })
  1983. } else {
  1984. done()
  1985. }
  1986. }
  1987. })
  1988. .then(action => {})
  1989. },
  1990. // 查看个人信息
  1991. showPersonInfo() {
  1992. // 打开查看
  1993. this.userModal.show = true
  1994. let userId = this.$store.state.userInfo.userId
  1995. },
  1996. getUserInfo() {
  1997. let that = this
  1998. if (that.$store.state.userInfo) {
  1999. that.axios
  2000. .get(proPath + 'v1/sysusers/' + that.$store.state.userInfo.userId)
  2001. .then(function(response) {
  2002. if (response) {
  2003. that.userInfo = response.data
  2004. top.globalUserInfo = response.data
  2005. }
  2006. })
  2007. }
  2008. },
  2009. // 隐藏侧边栏
  2010. changeMenuType() {
  2011. if (this.menuType === '2') {
  2012. this.menuType = '1'
  2013. } else {
  2014. this.menuType = '2'
  2015. }
  2016. },
  2017. // 菜单选中
  2018. thisMenu(item) {
  2019. for (let b of this.pageBreadcrumb) {
  2020. if (b.menuId === item.menuId) {
  2021. return true
  2022. }
  2023. }
  2024. return false
  2025. },
  2026. // 弹窗完成
  2027. userModalThen(str, item) {
  2028. // console.log('代码执行了')
  2029. switch (str) {
  2030. case 'close':
  2031. this.userModal.show = false
  2032. break
  2033. case 'success':
  2034. this.userModal.show = false
  2035. // 刷新
  2036. this.store.dispatch('getUserInfo')
  2037. break
  2038. }
  2039. },
  2040. // 修改密码
  2041. pwdSubmit() {
  2042. // if (this.strongText === '弱' && this.digit) {
  2043. // this.$message.warning('密码安全等级太弱')
  2044. // return
  2045. // } else if (this.strongText === '弱' && !this.digit) {
  2046. // this.$message.warning('密码不能小于六位数')
  2047. // return
  2048. // }
  2049. this.$refs['pwdModal'].validate(valid => {
  2050. if (valid) {
  2051. // if (this.pwdModal.form.newpassword.length > 16) {
  2052. // this.$message.warning('密码最长为16个字符')
  2053. // return
  2054. // }
  2055. this.pwdModal.loading = true
  2056. this.pwdModal.form.userid = this.store.state.userInfo.id
  2057. this.store
  2058. .dispatch('system/usersManage/updpsw', this.pwdModal.form)
  2059. .then(res => {
  2060. this.pwdModal.loading = false
  2061. if (res.code === '0') {
  2062. this.$message.success('设置成功')
  2063. this.strongShow = false
  2064. this.pwdModal.show = false
  2065. } else {
  2066. this.$message.error(res.message)
  2067. }
  2068. })
  2069. }
  2070. })
  2071. },
  2072. // 打开修改密码弹窗
  2073. openPwd() {
  2074. this.$refs['pwdModal'].resetFields && this.$refs['pwdModal'].resetFields()
  2075. this.strongShow = false
  2076. },
  2077. // 弹窗完成
  2078. userModalThen(str, item) {
  2079. let that = this
  2080. switch (str) {
  2081. case 'close':
  2082. that.userModal.show = false
  2083. break
  2084. case 'success':
  2085. that.userModal.show = false
  2086. // 刷新
  2087. that.getUser(that.tableParams.form)
  2088. break
  2089. }
  2090. },
  2091. // 关闭弹窗
  2092. userModalClose() {},
  2093. // 修改完毕重新请求数据
  2094. updataUserInfo(data) {
  2095. this.getUserInfo()
  2096. this.$store.commit('userInfo', data)
  2097. },
  2098. init: function(token) {
  2099. let that = this
  2100. // 192.168.10.231:9008本地
  2101. let path = ''
  2102. if (
  2103. window.top.document.location.origin.indexOf('icore-paas-test') !== -1 ||
  2104. window.top.document.location.origin.indexOf('localhost') !== -1
  2105. ) {
  2106. path =
  2107. 'wss://websocket-dev.steerinfo.com/websocket?type=pass&token=' + token
  2108. } else {
  2109. path =
  2110. 'wss://websocket.steerinfo.com/websocket?type=pass&token=' + token
  2111. }
  2112. if ('WebSocket' in window) {
  2113. // 实例化websocket
  2114. this.websocket = new WebSocket(path)
  2115. // 监听websocket连接
  2116. this.websocket.onopen = this.open
  2117. // 监听websocket错误信息
  2118. this.websocket.onerror = this.error
  2119. // 监听websocket消息
  2120. this.websocket.onmessage = this.getMessage
  2121. //每隔30秒钟发送一次心跳,避免websocket连接因超时而自动断开
  2122. // this.interval = window.setInterval(function(){
  2123. // if(that.websocket !== null){
  2124. // if (that.websocket.readyState !== that.websocket.OPEN) {
  2125. // let token = getCookie('accessToken');
  2126. // if (token) {
  2127. // that.init(token);
  2128. // }
  2129. // }
  2130. // // } else {
  2131. // // that.websocket.send('HeartBeat');
  2132. // // // console.log("发送心跳包:HeartBeat");
  2133. // // }
  2134. // }
  2135. // },30000);
  2136. } else {
  2137. alert('您当前浏览器不支持WebSocket')
  2138. // 每隔30秒钟发送一次心跳,避免websocket连接因超时而自动断开
  2139. // forgeWebSocket这个方法是在不支持websocket的浏览器中去执行,这个方法作用是作为最早得轮询方式去保持长连接。这样不管浏览器支不支持websocket都能保持长连接的功能作用
  2140. // this.interval = window.setInterval(function(){
  2141. // that.forgeWebSocket();
  2142. // },30000);
  2143. }
  2144. },
  2145. open: function() {
  2146. console.log('websocket连接成功')
  2147. },
  2148. error: function() {
  2149. console.log('连接错误')
  2150. },
  2151. getTabIndex(menuId) {
  2152. let index = 0
  2153. for (let i = 0; i < this.tabsData.length; i++) {
  2154. if (this.tabsData[i].menuId === menuId) {
  2155. index = i
  2156. }
  2157. }
  2158. return index
  2159. },
  2160. getMessage: function(msg) {
  2161. let that = this
  2162. // console.log(msg.data);
  2163. let newMsg = JSON.parse(msg.data)
  2164. let message = ''
  2165. if (Object.prototype.toString.call(newMsg) === '[object Object]') {
  2166. message = newMsg
  2167. } else if (Object.prototype.toString.call(newMsg) === '[object Array]') {
  2168. message = JSON.parse(msg.data).find(item => item.offline === false)
  2169. }
  2170. if (message.hasOwnProperty('type')) {
  2171. let activeMenu = window.top.localStorage.getItem('activeMenu')
  2172. let obj = this.getTreeAll(
  2173. this.menuData,
  2174. './workFlow.html#/coverTask',
  2175. 1,
  2176. []
  2177. )
  2178. let taskObj = this.getTreeAll(
  2179. this.menuData,
  2180. './workFlow.html#/personalInitiatedTask',
  2181. 1,
  2182. []
  2183. )
  2184. let msgObj = this.getTreeAll(
  2185. this.menuData,
  2186. './systemConfig.html#/noticeUser',
  2187. 1,
  2188. []
  2189. )
  2190. switch (message.type) {
  2191. case 'ACT_TO_DO_TASK': // 待办任务;
  2192. this.$message.info('您收到一条新的待办任务,请前往待办任务中查看!')
  2193. if (activeMenu === obj.menuData.menuId) {
  2194. that.menuTabIndex = that.getTabIndex(obj.menuData.menuId)
  2195. $('#menuTabId .el-tabs__item')
  2196. .eq(that.menuTabIndex)
  2197. .click()
  2198. $('#menuTabId iframe')
  2199. .eq(that.menuTabIndex)[0]
  2200. .contentWindow.location.reload(true)
  2201. }
  2202. this.getMyToDoTask()
  2203. this.getMyToDoDelegateTask()
  2204. break
  2205. case 'ACT_TO_DO_DELEGATETASK': // 委托待办任务;
  2206. this.$message.info(
  2207. '您收到一条新的委托待办任务,请前往待办任务中查看!'
  2208. )
  2209. if (activeMenu === obj.menuData.menuId) {
  2210. that.menuTabIndex = that.getTabIndex(obj.menuData.menuId)
  2211. $('#menuTabId .el-tabs__item')
  2212. .eq(that.menuTabIndex)
  2213. .click()
  2214. $('#menuTabId iframe')
  2215. .eq(that.menuTabIndex)[0]
  2216. .contentWindow.location.reload(true)
  2217. }
  2218. this.getMyToDoTask()
  2219. this.getMyToDoDelegateTask()
  2220. break
  2221. case 'ACT_MY_APPLY_TASK': // 申请完成任务;
  2222. this.$message.info('您有一条申请审批已完成,请前往流程跟踪中查看!')
  2223. if (activeMenu === taskObj.menuData.menuId) {
  2224. that.menuTabIndex = that.getTabIndex(taskObj.menuData.menuId)
  2225. $('#menuTabId .el-tabs__item')
  2226. .eq(that.menuTabIndex)
  2227. .click()
  2228. $('#menuTabId iframe')
  2229. .eq(that.menuTabIndex)[0]
  2230. .contentWindow.location.reload(true)
  2231. }
  2232. break
  2233. case 'SSO_NOTICE': // 公告;
  2234. this.$message.info('您收到一条新的公告:' + message.payload.title)
  2235. if (activeMenu === msgObj.menuData.menuId) {
  2236. that.menuTabIndex = that.getTabIndex(msgObj.menuData.menuId)
  2237. $('#menuTabId .el-tabs__item')
  2238. .eq(that.menuTabIndex)
  2239. .click()
  2240. $('#menuTabId iframe')
  2241. .eq(that.menuTabIndex)[0]
  2242. .contentWindow.location.reload(true)
  2243. }
  2244. this.getMyMessage()
  2245. break
  2246. case 'SSO_ROLE': // 权限已被管理员修改
  2247. case 'SSO_MENU':
  2248. case 'SSO_ORG':
  2249. let userId = this.$store.state.userInfo.userId
  2250. if (userId !== 'admin') {
  2251. this.privilegeUpdateIfo = true
  2252. this.coutTime(5)
  2253. } else {
  2254. if (message.type === 'SSO_MENU') {
  2255. store
  2256. .dispatch('generateRoutes', {
  2257. companyId: this.companyId,
  2258. appId: this.appId
  2259. })
  2260. .then(res => {
  2261. if (res.code === '0') {
  2262. this.menuData = res.data
  2263. }
  2264. })
  2265. .catch(err => {
  2266. console.log(err)
  2267. })
  2268. }
  2269. }
  2270. break
  2271. case 'UPDATE_NUM':
  2272. this.getMyToDoTask()
  2273. this.getMyToDoDelegateTask()
  2274. this.getMyMessage()
  2275. if (
  2276. message.payload === 'updateMessageNumOfAuth' &&
  2277. activeMenu === msgObj.menuData.menuId
  2278. ) {
  2279. that.menuTabIndex = that.getTabIndex(msgObj.menuData.menuId)
  2280. $('#menuTabId .el-tabs__item')
  2281. .eq(that.menuTabIndex)
  2282. .click()
  2283. $('#menuTabId iframe')
  2284. .eq(that.menuTabIndex)[0]
  2285. .contentWindow.location.reload(true)
  2286. }
  2287. break
  2288. }
  2289. }
  2290. },
  2291. send: function(params) {
  2292. this.websocket.send(params)
  2293. },
  2294. close: function() {
  2295. console.log('websocket已经关闭')
  2296. if (this.interval) {
  2297. window.clearInterval(this.interval)
  2298. // console.log("清除定时器");
  2299. }
  2300. },
  2301. // 倒计时函数
  2302. coutTime(index) {
  2303. let that = this
  2304. that.closeSecond = index
  2305. setTimeout(function() {
  2306. if (index == 0) {
  2307. that.store
  2308. .dispatch('loginOut')
  2309. .then(function(res) {
  2310. window.location.href = './index.html'
  2311. })
  2312. .catch(function(err) {
  2313. console.log(err)
  2314. })
  2315. } else {
  2316. that.coutTime(--index)
  2317. }
  2318. }, 1000)
  2319. },
  2320. closeConfirm() {
  2321. this.closeSecond = 0
  2322. this.store
  2323. .dispatch('loginOut')
  2324. .then(function(res) {
  2325. window.location.href = './index.html'
  2326. })
  2327. .catch(function(err) {
  2328. console.log(err)
  2329. })
  2330. },
  2331. // 遍历树获取指定url菜单相关
  2332. // tree 整体树
  2333. // url 需要跳转的页面url
  2334. // num 递归层级,初始值传1,用于返回页面线性层级
  2335. // list 包括页面&页面父级&父级的父级...直到最外层
  2336. getTreeAll(tree, url, num, list) {
  2337. let menuObj = {}
  2338. if (!!tree && tree.length !== 0) {
  2339. for (let item of tree) {
  2340. menuObj['pageBreadcrumb'] = list
  2341. if (item.menuUrl === url) {
  2342. menuObj['menuData'] = item
  2343. let obj = {
  2344. menuId: num,
  2345. menuLabel: item.menuLabel
  2346. }
  2347. menuObj.pageBreadcrumb.push(obj)
  2348. return menuObj
  2349. } else {
  2350. let obj = {
  2351. menuId: num,
  2352. menuLabel: item.menuLabel
  2353. }
  2354. let a = []
  2355. a.push(obj)
  2356. let newList = list.concat(a)
  2357. if (
  2358. item.hasOwnProperty('children') &&
  2359. item.children !== null &&
  2360. item.children.length > 0
  2361. ) {
  2362. menuObj = this.getTreeAll(item.children, url, num + 1, newList)
  2363. if (menuObj.hasOwnProperty('menuData')) {
  2364. return menuObj
  2365. }
  2366. }
  2367. }
  2368. }
  2369. }
  2370. return menuObj
  2371. },
  2372. // 前往我的待办任务
  2373. goMyTaskPage() {
  2374. let that = this
  2375. let updateStatus = false
  2376. for (let item of this.tabsData) {
  2377. if (item.menuUrl === './workFlow.html#/coverTask') {
  2378. updateStatus = true
  2379. }
  2380. }
  2381. let obj = this.getTreeAll(
  2382. this.menuData,
  2383. './workFlow.html#/coverTask',
  2384. 1,
  2385. []
  2386. )
  2387. this.selectMenu(obj.menuData, obj.pageBreadcrumb)
  2388. if (updateStatus === true) {
  2389. that.menuTabIndex = that.getTabIndex(obj.menuData.menuId)
  2390. $('#menuTabId .el-tabs__item')
  2391. .eq(that.menuTabIndex)
  2392. .click()
  2393. $('#menuTabId iframe')
  2394. .eq(that.menuTabIndex)[0]
  2395. .contentWindow.location.reload(true)
  2396. }
  2397. },
  2398. // 前往公告页面
  2399. goNoticePage() {
  2400. let that = this
  2401. let updateStatus = false
  2402. for (let item of this.tabsData) {
  2403. if (item.menuUrl === './systemConfig.html#/noticeUser') {
  2404. updateStatus = true
  2405. }
  2406. }
  2407. let obj = this.getTreeAll(
  2408. this.menuData,
  2409. './systemConfig.html#/noticeUser',
  2410. 1,
  2411. []
  2412. )
  2413. this.selectMenu(obj.menuData, obj.pageBreadcrumb)
  2414. if (updateStatus === true) {
  2415. that.menuTabIndex = that.getTabIndex(obj.menuData.menuId)
  2416. $('#menuTabId .el-tabs__item')
  2417. .eq(that.menuTabIndex)
  2418. .click()
  2419. $('#menuTabId iframe')
  2420. .eq(that.menuTabIndex)[0]
  2421. .contentWindow.location.reload(true)
  2422. }
  2423. },
  2424. updateTaskNum() {
  2425. let userId = getCookie('userId')
  2426. let messageType = {
  2427. payload: 'updateTaskNum',
  2428. type: 'UPDATE_NUM',
  2429. userId: userId
  2430. }
  2431. this.axios
  2432. .post('pass/websocket/socket/frontSendMessage', messageType, {
  2433. individualType: 'json'
  2434. })
  2435. .then(res => {
  2436. if (res.code === '0') {
  2437. // do
  2438. } else {
  2439. this.$message.error(res.message)
  2440. }
  2441. })
  2442. .catch(error => {
  2443. console.log(error.message)
  2444. })
  2445. },
  2446. updateMessageNum() {
  2447. let userId = getCookie('userId')
  2448. let messageType = {
  2449. payload: 'updateTaskNum',
  2450. type: 'UPDATE_NUM',
  2451. userId: userId
  2452. }
  2453. this.axios
  2454. .post('pass/websocket/socket/frontSendMessage', messageType, {
  2455. individualType: 'json'
  2456. })
  2457. .then(res => {
  2458. if (res.code === '0') {
  2459. // do
  2460. } else {
  2461. this.$message.error(res.message)
  2462. }
  2463. })
  2464. .catch(error => {
  2465. console.log(error.message)
  2466. })
  2467. },
  2468. // 获取我的待办任务个数
  2469. getMyToDoTask() {
  2470. // 获取当前用户
  2471. let userId = getCookie('userId')
  2472. this.axios
  2473. .get(
  2474. 'pass/act/v1/actusertasks/findMyToDoTask?userId=' +
  2475. userId +
  2476. '&companyId=' +
  2477. this.companyId +
  2478. '&pageNum=1&pageSize=1000000'
  2479. )
  2480. .then(res => {
  2481. if (res.code === '0') {
  2482. this.task1Num = res.data.list.length
  2483. } else {
  2484. this.$message.error(res.message)
  2485. }
  2486. })
  2487. .catch(error => {
  2488. console.log(error.message)
  2489. })
  2490. },
  2491. // 获取委托我代办的任务
  2492. getMyToDoDelegateTask() {
  2493. // 获取当前用户
  2494. let userId = getCookie('userId')
  2495. this.axios
  2496. .get(
  2497. 'pass/act/v1/actusertasks/findMyToDoDelegateTask?userId=' +
  2498. userId +
  2499. '&companyId=' +
  2500. this.companyId +
  2501. '&pageNum=1&pageSize=1000000'
  2502. )
  2503. .then(res => {
  2504. if (res.code === '0') {
  2505. this.task2Num = res.data.list.length
  2506. } else {
  2507. this.$message.error(res.message)
  2508. }
  2509. })
  2510. .catch(error => {
  2511. console.log(error.message)
  2512. })
  2513. },
  2514. // 获取我的公告信息
  2515. getMyMessage() {
  2516. // 获取当前用户
  2517. let userId = getCookie('userId')
  2518. this.axios
  2519. .get(
  2520. 'pass/v1/sysnotices/getUserNoticelike?status=0&pageNum=1&pageSize=1000000&companyId=' +
  2521. this.companyId
  2522. )
  2523. .then(res => {
  2524. if (res.code === '0') {
  2525. this.myMessageLength = res.data.list.length
  2526. } else {
  2527. this.$message.error(res.message)
  2528. }
  2529. })
  2530. .catch(error => {
  2531. console.log(error.message)
  2532. })
  2533. },
  2534. // 获取主页页面
  2535. getMainPage(tree, index, list) {
  2536. list = list ? list : []
  2537. if (!!tree && tree.length !== 0) {
  2538. for (let i = 0; i < tree.length; i++) {
  2539. let menuIndex = index ? index + '-' + i.toString() : i
  2540. if (
  2541. tree[i].loginDispaly &&
  2542. tree[i].loginDispaly === '1' &&
  2543. tree[i].status === '1'
  2544. ) {
  2545. tree[i]['menuIndex'] = menuIndex
  2546. tree[i]['mainPageLoading'] = true
  2547. list.push(tree[i])
  2548. } else {
  2549. if (
  2550. tree[i].hasOwnProperty('children') &&
  2551. tree[i].children !== null &&
  2552. tree[i].children.length > 0
  2553. ) {
  2554. this.getMainPage(tree[i].children, menuIndex, list)
  2555. }
  2556. }
  2557. }
  2558. }
  2559. return list
  2560. },
  2561. getMenuIndexByMenuId(tree, index, menuId) {
  2562. if (!!tree && tree.length !== 0) {
  2563. for (let i = 0; i < tree.length; i++) {
  2564. let menuIndex = index ? index + '-' + i.toString() : i.toString()
  2565. if (tree[i].menuId == menuId) {
  2566. tree[i]['menuIndex'] = menuIndex
  2567. return tree[i]
  2568. }
  2569. if (
  2570. tree[i].hasOwnProperty('children') &&
  2571. tree[i].children !== null &&
  2572. tree[i].children.length > 0
  2573. ) {
  2574. var result = this.getMenuIndexByMenuId(
  2575. tree[i].children,
  2576. menuIndex,
  2577. menuId
  2578. )
  2579. if (result) {
  2580. return result
  2581. }
  2582. }
  2583. }
  2584. }
  2585. },
  2586. autoOpenLatestPage() {
  2587. var that = this
  2588. var currentMenuIndex = window.top.localStorage.getItem('currentMenuIndex')
  2589. let menuList = window.top.document.getElementsByClassName('el-menu-item')
  2590. for (let i = 0; i < menuList.length; i++) {
  2591. if (menuList[i].__vue__.index === currentMenuIndex) {
  2592. setTimeout(function() {
  2593. that.defaultActiveIndex = currentMenuIndex
  2594. menuList[i].click()
  2595. }, 20)
  2596. }
  2597. }
  2598. },
  2599. // 打开设为主页菜单页面
  2600. openMainPage() {
  2601. this.mainPageList = this.getMainPage(this.menuData)
  2602. // console.log(this.mainPageList)
  2603. let menuList = window.top.document.getElementsByClassName('el-menu-item')
  2604. let s = 0
  2605. for (let item of this.mainPageList) {
  2606. for (let i = 0; i < menuList.length; i++) {
  2607. if (
  2608. menuList[i].innerHTML === item.menuLabel &&
  2609. menuList[i].__vue__.index === item.menuIndex
  2610. ) {
  2611. s++
  2612. setTimeout(() => {
  2613. menuList[i].click()
  2614. // console.log('点击行为')
  2615. }, 200)
  2616. }
  2617. }
  2618. }
  2619. },
  2620. // 浏览器返回操作
  2621. goBack() {
  2622. this.$router.replace({
  2623. path: '/'
  2624. })
  2625. },
  2626. updatecss() {
  2627. this.socketshow = true
  2628. //let height = document.body.clientHeight - 125
  2629. /*this.$nextTick(() => {
  2630. $('.Web_Notice')[0].style.height = height + 'px;'
  2631. })*/
  2632. },
  2633. leave() {
  2634. this.socketshow = false
  2635. },
  2636. getinformation() {
  2637. console.log('获取到的userId----------------' + this.userId)
  2638. this.axios
  2639. .post('/api/v1/ams/getNotice',
  2640. { userId: this.userId})
  2641. .then(res => {
  2642. this.noticedata = res.data.data
  2643. this.taskAllNum = res.data.data[0].taskAllNum
  2644. console.log(this.noticedata)
  2645. console.log(this.taskAllNum)
  2646. if (this.taskAllNum !=null){
  2647. if (this.taskAllNum==0){
  2648. console.log("进入了标记为0")
  2649. this.badgeshow=true
  2650. }else{
  2651. console.log("进入了标记不为0")
  2652. this.badgeshow=false
  2653. }
  2654. }else {
  2655. console.log("进入了标记值为null的值")
  2656. this.taskAllNum=null
  2657. }
  2658. })
  2659. },
  2660. // 查看待办任务详情
  2661. seeTaskContent(item) {
  2662. console.log("点击后的事件")
  2663. console.log(item)
  2664. let data={
  2665. noticetitle:item.noticetitle,
  2666. noticecontent:item.noticecontent,
  2667. insertusername:item.insertusername,
  2668. inserttime:item.inserttime,
  2669. noticeid:item.noticeId
  2670. }
  2671. this.noticedata1=data
  2672. this.centerDialogVisible=true;
  2673. console.log(this.noticedata1)
  2674. console.log(this.centerDialogVisible)
  2675. console.log(this.noticedata1.noticetitle)
  2676. //this.$refs.defaultpage.seeTaskContent(item)
  2677. // // this.dialogVisible = true;
  2678. // this.itemTask = item;
  2679. }
  2680. }
  2681. }
  2682. </script>
  2683. <!-- Add "scoped" attribute to limit CSS to this component only -->
  2684. <style lang="less" scoped>
  2685. .Web_Notice {
  2686. width: 400px;
  2687. position: absolute;
  2688. left: -200px;
  2689. height: 500px;
  2690. background-color: #f1f6fd;
  2691. }
  2692. /deep/ .privilegeArea {
  2693. .el-dialog {
  2694. min-width: 400px;
  2695. min-height: 120px;
  2696. padding-bottom: 10px;
  2697. }
  2698. }
  2699. .contextmenu {
  2700. width: 150px;
  2701. height: 150px;
  2702. top: 0px;
  2703. position: absolute;
  2704. display: none;
  2705. }
  2706. /deep/.lockInput .el-input__inner {
  2707. -webkit-text-security: disc !important;
  2708. }
  2709. .theme-defined {
  2710. position: absolute;
  2711. right: 20px;
  2712. top: 20px;
  2713. width: 150px;
  2714. }
  2715. .theme-defined > div {
  2716. float: right;
  2717. margin-right: 10px;
  2718. }
  2719. .company-select {
  2720. position: absolute;
  2721. left: 225px;
  2722. // top: 20px;
  2723. // float: left;
  2724. height: 60px;
  2725. line-height: 60px;
  2726. margin-left: 20px;
  2727. color: #fff;
  2728. font-size: 20px;
  2729. }
  2730. .el-dropdown {
  2731. font-size: 16px;
  2732. color: #ffffff;
  2733. cursor: pointer;
  2734. }
  2735. .ifCompany {
  2736. font-size: 16px;
  2737. color: #ffffff;
  2738. }
  2739. .lock_route {
  2740. transform: rotateY(180deg);
  2741. cursor: pointer;
  2742. position: absolute;
  2743. width: 40px;
  2744. height: 39px;
  2745. top: 0px;
  2746. right: 0px;
  2747. text-align: center;
  2748. line-height: 40px;
  2749. background-color: #ccc;
  2750. color: #fff;
  2751. }
  2752. .lock_screen {
  2753. position: absolute;
  2754. z-index: 9999999999;
  2755. background-color: #fff;
  2756. top: 0;
  2757. left: 0;
  2758. width: 100%;
  2759. height: 100%;
  2760. min-width: 1600px;
  2761. background: url(../assets/img/default-bg.png) center bottom no-repeat;
  2762. }
  2763. .main {
  2764. height: 100%;
  2765. }
  2766. .sl-header {
  2767. /* position: fixed; */
  2768. top: 0;
  2769. left: 0;
  2770. z-index: 1002;
  2771. width: 100%;
  2772. /* min-width: 1150px; */
  2773. background-color: #fff;
  2774. background-color: rgba(255, 255, 255, 0.9);
  2775. }
  2776. .sl-container {
  2777. height: 100%;
  2778. position: relative;
  2779. /* padding-top: 60px; */
  2780. padding-left: 79px;
  2781. /* transition: padding-left .3s ease-out; */
  2782. }
  2783. .sl-container2 {
  2784. padding-left: 0px;
  2785. }
  2786. .sl-content-main {
  2787. width: 100%;
  2788. // min-width: 1200px;
  2789. height: calc(100% - 60px);
  2790. overflow: auto;
  2791. ::-webkit-scrollbar {
  2792. //滚动条宽高,如果不需要显示滚动条可设置宽高为0
  2793. width: 0px;
  2794. // height: 0px;
  2795. }
  2796. ::-webkit-scrollbar-thumb {
  2797. //滚动条颜色和圆角
  2798. background-color: #dfe0e0;
  2799. border-radius: 3px;
  2800. }
  2801. ::-webkit-scrollbar-track-piece {
  2802. // border: 2px solid #000;
  2803. background-color: #f2f6f8;
  2804. border-radius: 3px;
  2805. }
  2806. }
  2807. .icore-menu-main {
  2808. position: fixed;
  2809. top: 0;
  2810. left: 0;
  2811. z-index: 1001;
  2812. width: 80px;
  2813. height: calc(100% - 60px);
  2814. margin-top: 60px;
  2815. border-right: 1px solid #efefef;
  2816. background-color: #fff;
  2817. /* transition: width .25s ease-out;*/
  2818. }
  2819. .icore-menu-main2 {
  2820. width: 180px;
  2821. -webkit-touch-callout: none;
  2822. -webkit-user-select: none;
  2823. -khtml-user-select: none;
  2824. -moz-user-select: none;
  2825. -ms-user-select: none;
  2826. user-select: none;
  2827. }
  2828. .sl-content {
  2829. transition: margin-left 0.2s linear;
  2830. }
  2831. .sl-header-li-logo {
  2832. float: left;
  2833. margin-top: 13px;
  2834. margin-left: 20px;
  2835. }
  2836. .sl-header-li-name {
  2837. float: left;
  2838. height: 60px;
  2839. line-height: 60px;
  2840. margin-left: 20px;
  2841. color: #fff;
  2842. font-size: 20px;
  2843. }
  2844. .sl-header-li-line {
  2845. float: left;
  2846. margin-top: 5px;
  2847. height: 26px;
  2848. }
  2849. .sl-header-li-lgo {
  2850. float: right;
  2851. margin-top: 21px;
  2852. width: 120px;
  2853. }
  2854. .sl-header-li-lgob {
  2855. display: inline-block;
  2856. padding-left: 25px;
  2857. position: relative;
  2858. color: white;
  2859. height: 20px;
  2860. line-height: 20px;
  2861. vertical-align: middle;
  2862. }
  2863. .sl-header-li-lgob > .xs-icons {
  2864. position: absolute;
  2865. top: -8px;
  2866. left: -18px;
  2867. }
  2868. .icore-menu-ops {
  2869. font-size: 16px;
  2870. color: #666;
  2871. transition: transform 0.3s ease-out;
  2872. }
  2873. .icore-menu-main2 .icore-menu-ops {
  2874. transform: rotate(180deg);
  2875. }
  2876. /* header menu style --> begin */
  2877. .icore-menu {
  2878. border-right: solid 0px #e6e6e6;
  2879. }
  2880. .icore-menu-a {
  2881. position: relative;
  2882. display: inline-block;
  2883. width: 100%;
  2884. padding-left: 54px;
  2885. -webkit-transition: color 0.3s;
  2886. transition: color 0.3s;
  2887. cursor: pointer;
  2888. border-right: 2px solid #fff;
  2889. }
  2890. .icore-menu-tip-cover {
  2891. position: absolute;
  2892. top: 0;
  2893. left: 0;
  2894. width: 100%;
  2895. height: 100%;
  2896. }
  2897. .icore-menu-a-noc {
  2898. padding-right: 2px;
  2899. }
  2900. .icore-menu-lit {
  2901. opacity: 0;
  2902. display: inline-block;
  2903. margin-top: 4px;
  2904. height: 36px;
  2905. line-height: 36px;
  2906. vertical-align: middle;
  2907. overflow: hidden;
  2908. transition: opacity 0.3s ease-out;
  2909. }
  2910. .nameText {
  2911. max-width: 85%;
  2912. text-overflow: ellipsis;
  2913. }
  2914. .icore-menu-main2 .icore-menu-lit {
  2915. opacity: 1;
  2916. }
  2917. .icore-menu-main2 .icore-menu-tip-cover {
  2918. display: none;
  2919. }
  2920. .icore-menu-lic {
  2921. position: absolute;
  2922. top: 50%;
  2923. left: 10px;
  2924. margin-top: -11px;
  2925. }
  2926. .icore-menu-ric {
  2927. position: absolute;
  2928. top: 50%;
  2929. right: 4px;
  2930. margin-top: -3px;
  2931. font-family: element-icons !important;
  2932. speak: none;
  2933. font-style: normal;
  2934. font-weight: 400;
  2935. font-variant: normal;
  2936. color: #999;
  2937. text-transform: none;
  2938. line-height: 1;
  2939. vertical-align: baseline;
  2940. display: inline-block;
  2941. -webkit-font-smoothing: antialiased;
  2942. font-smoothing: antialiased;
  2943. -webkit-transition: transform 0.3s;
  2944. transition: transform 0.3s;
  2945. }
  2946. /* .icore-menu-ric:before{
  2947. content: "\E603";
  2948. }*/
  2949. .icore-menu-ricr {
  2950. color: #999;
  2951. }
  2952. .icore-menu-s {
  2953. position: absolute;
  2954. top: -7px;
  2955. left: 100%;
  2956. z-index: 1004;
  2957. border: 1px solid #ccc;
  2958. box-shadow: 0 2px 8px #999;
  2959. border-radius: 2px;
  2960. background-color: #fff;
  2961. min-width: 130px;
  2962. padding: 10px 0;
  2963. }
  2964. .icore-menu-sham {
  2965. -webkit-transform: scaleY(0);
  2966. transform: scaleY(0);
  2967. -webkit-transition: transform, display 0.4s;
  2968. transition: transform 0.4s;
  2969. -webkit-transform-origin: center top;
  2970. transform-origin: center top;
  2971. }
  2972. .icore-menu-a:hover > .icore-menu-sham,
  2973. .icore-menu-sa:hover > .icore-menu-sham {
  2974. opacity: 1;
  2975. -webkit-transform: scaleY(1);
  2976. transform: scaleY(1);
  2977. }
  2978. .icore-menu-s.icore-menu-s-right {
  2979. left: auto;
  2980. right: 15px;
  2981. }
  2982. .main-upload_text_logo {
  2983. display: block;
  2984. text-align: center;
  2985. position: relative;
  2986. margin: 0px -20px;
  2987. top: -35px;
  2988. border-bottom: 1px solid #cccccc;
  2989. }
  2990. .main-file_upload {
  2991. width: 100%;
  2992. text-align: center;
  2993. position: relative;
  2994. display: inline-block;
  2995. vertical-align: top;
  2996. }
  2997. .main-file_con .hide {
  2998. width: 120px;
  2999. position: absolute;
  3000. height: 30px;
  3001. left: 58px;
  3002. margin-top: -8px;
  3003. opacity: 0;
  3004. filter: alpha(opacity=0);
  3005. z-index: 22;
  3006. }
  3007. .main-file_con .main-file_uploader,
  3008. .upload_bt {
  3009. left: 0;
  3010. top: -5px;
  3011. position: relative;
  3012. color: #fff;
  3013. display: inline-block;
  3014. padding: 0px 20px;
  3015. background: #2ecc71;
  3016. text-align: center;
  3017. z-index: 11;
  3018. border-radius: 15px;
  3019. cursor: pointer;
  3020. }
  3021. .upload_bt {
  3022. left: 130px;
  3023. }
  3024. .main-file_con .hide:hover {
  3025. box-shadow: 1px 2px #44795b;
  3026. }
  3027. .main-img_holder,
  3028. .m_main-img_holder {
  3029. height: 100px;
  3030. line-height: 70px;
  3031. }
  3032. .main-img_holder img,
  3033. .m_main-img_holder img {
  3034. max-width: 200px;
  3035. }
  3036. .main-file_btn_upload {
  3037. margin-top: -20px;
  3038. margin-bottom: 20px;
  3039. }
  3040. .icore-menu-sa {
  3041. display: block;
  3042. min-width: 120px;
  3043. white-space: nowrap;
  3044. padding: 0 20px;
  3045. line-height: 32px;
  3046. position: relative;
  3047. }
  3048. .icore-menu-a:hover {
  3049. color: #2391e5;
  3050. background-color: #e2f1fc;
  3051. border-right-color: #e2f1fc;
  3052. }
  3053. .icore-menu-a:hover > .icore-menu-ric {
  3054. color: #2391e5;
  3055. -webkit-transform: rotate(180deg);
  3056. transform: rotate(180deg);
  3057. }
  3058. .icore-menu-sa:hover {
  3059. background-color: #e2f1fc;
  3060. color: #2391e5;
  3061. }
  3062. .icore-menu-sa:hover > .icore-menu-ricr {
  3063. color: #2391e5;
  3064. }
  3065. .icore-menu-ss {
  3066. opacity: 0;
  3067. position: absolute;
  3068. left: 100%;
  3069. top: -11px;
  3070. z-index: 1005;
  3071. padding: 10px 0;
  3072. border: 1px solid #ccc;
  3073. box-shadow: 0 2px 8px #999;
  3074. border-radius: 2px;
  3075. background-color: #fff;
  3076. }
  3077. .icore-menu-sed {
  3078. border-right-color: #2391e5;
  3079. }
  3080. .icore-menu-sed,
  3081. .icore-menu-ssed,
  3082. .icore-menu-sssed {
  3083. color: #2391e5;
  3084. }
  3085. .icore-menu-sed > .icore-menu-ricr,
  3086. .icore-menu-ssed > .icore-menu-ricr,
  3087. .icore-menu-sed > .icore-menu-ric {
  3088. color: #2391e5;
  3089. }
  3090. .icore-menu-sdis {
  3091. cursor: default !important;
  3092. cursor: not-allowed !important;
  3093. color: #999 !important;
  3094. background-color: #fff !important;
  3095. }
  3096. .icore-menu-reverse > .icore-menu-s,
  3097. .icore-menu-reverse > .icore-menu-ss {
  3098. top: auto;
  3099. bottom: -11px;
  3100. -webkit-transform-origin: center bottom;
  3101. transform-origin: center bottom;
  3102. }
  3103. /* header menu style --> end */
  3104. .sl-breadcrumb {
  3105. overflow: hidden;
  3106. background-color: #fff;
  3107. height: 30px;
  3108. padding: 7px 0 0 20px;
  3109. }
  3110. .sl-header-li-lgbc {
  3111. position: absolute;
  3112. right: 40%;
  3113. top: 20px;
  3114. }
  3115. .sl-header-li-websocket {
  3116. position: absolute;
  3117. right: 210px;
  3118. top: 17px;
  3119. .el-button--text {
  3120. color: white;
  3121. }
  3122. }
  3123. .sl-breadcrumb-text {
  3124. float: left;
  3125. color: white;
  3126. }
  3127. .sl-breadcrumb-list {
  3128. float: left;
  3129. padding-left: 10px;
  3130. font-size: 12px;
  3131. position: relative;
  3132. top: 6px;
  3133. }
  3134. .sl-footer {
  3135. padding: 20px 0 0px;
  3136. }
  3137. .sl-footer > p {
  3138. text-align: center;
  3139. height: 20px;
  3140. line-height: 20px;
  3141. vertical-align: middle;
  3142. }
  3143. .am-xz {
  3144. float: left;
  3145. margin-right: 7px;
  3146. margin-top: 2px;
  3147. animation: amXuanzhuan 4s linear infinite;
  3148. }
  3149. @keyframes amXuanzhuan {
  3150. 0% {
  3151. transform: rotate3d(1, 0, 0, 360deg);
  3152. }
  3153. 100% {
  3154. transform: rotate3d(1, 0, 0, 0);
  3155. }
  3156. }
  3157. .oa-header-photo-uld {
  3158. width: 200px;
  3159. height: 200px;
  3160. line-height: 200px;
  3161. vertical-align: middle;
  3162. margin: 0 auto;
  3163. overflow: hidden;
  3164. cursor: pointer;
  3165. }
  3166. .oa-header-photo-uld > img {
  3167. max-width: 100%;
  3168. max-height: 100%;
  3169. vertical-align: middle;
  3170. }
  3171. /*.oa-header-content {*/
  3172. /*background: url("../../static/img/top_bgimg.png") left center no-repeat rgb(60,207,255);*/
  3173. /*height: 60px;*/
  3174. /*}*/
  3175. .oa-header-logo {
  3176. float: left;
  3177. padding: 15px 0 0 30px;
  3178. height: 50px;
  3179. overflow: hidden;
  3180. }
  3181. .oa-header-logo > img {
  3182. animation: fadeInLeft 0.5s ease-out 0s both;
  3183. }
  3184. .oa-header-upt {
  3185. position: absolute;
  3186. left: 0;
  3187. top: 0;
  3188. width: 100px;
  3189. height: 60px;
  3190. overflow: hidden;
  3191. text-align: center;
  3192. }
  3193. .oa-header-upt > a {
  3194. display: inline-block;
  3195. width: 40px;
  3196. height: 40px;
  3197. margin-top: 10px;
  3198. animation: fadeInRight 0.5s ease-out 0s both;
  3199. }
  3200. .oa-header-upt > a > img {
  3201. width: 40px;
  3202. height: 40px;
  3203. line-height: 40px;
  3204. vertical-align: middle;
  3205. color: #333;
  3206. border-radius: 20px;
  3207. box-shadow: 0 0 10px #333;
  3208. }
  3209. .oa-header-user:hover .oa-header-upt > a > img {
  3210. animation: circle 4s linear 0s infinite;
  3211. }
  3212. .oa-header-ucon {
  3213. display: none;
  3214. overflow: hidden;
  3215. position: absolute;
  3216. top: 50px;
  3217. left: 10px;
  3218. z-index: 18000;
  3219. padding: 10px 0 10px 10px;
  3220. font-size: 15px;
  3221. }
  3222. .oa-header-ulist {
  3223. position: relative;
  3224. width: 215px;
  3225. border: 1px solid #ddd;
  3226. box-shadow: 0 0 8px #999;
  3227. background-color: #fff;
  3228. background-color: rgba(255, 255, 255, 0.95);
  3229. }
  3230. .oa-header-user:hover .oa-header-ucon {
  3231. display: block;
  3232. }
  3233. .oa-header-user:hover .oa-header-ulist {
  3234. animation: fadeInRight 0.4s ease-out 0s both;
  3235. }
  3236. .oa-header-uin {
  3237. text-align: center;
  3238. overflow: hidden;
  3239. padding: 20px 0 15px 0;
  3240. }
  3241. .oa-header-uin > img {
  3242. width: 60px;
  3243. height: 60px;
  3244. border-radius: 30px;
  3245. cursor: pointer;
  3246. }
  3247. .oa-header-uin > img:hover {
  3248. animation: largen2 0.6s ease-out 0s both;
  3249. }
  3250. .oa-header-uin > h3 {
  3251. padding-top: 10px;
  3252. color: #666;
  3253. }
  3254. .oa-header-uul {
  3255. padding-bottom: 10px;
  3256. }
  3257. .oa-header-uul > li {
  3258. height: 40px;
  3259. line-height: 40px;
  3260. text-align: center;
  3261. vertical-align: middle;
  3262. cursor: pointer;
  3263. transition: background-color 0.3s linear 0s;
  3264. }
  3265. .oa-header-uul .st-icons {
  3266. position: relative;
  3267. top: 6px;
  3268. margin-right: 8px;
  3269. transition: all 0.3s linear;
  3270. }
  3271. .st-icons-out {
  3272. margin-right: 4px;
  3273. }
  3274. .oa-header-uul > li:hover {
  3275. background-color: #ebebeb;
  3276. }
  3277. .oa-header-uul::before,
  3278. .oa-header-uul::after {
  3279. border-bottom-color: rgba(0, 0, 0, 0.2);
  3280. content: '';
  3281. display: inline-block;
  3282. position: absolute;
  3283. }
  3284. .oa-header-uul::after {
  3285. left: 41px;
  3286. top: -6px;
  3287. border-bottom: 6px solid #fff;
  3288. border-left: 6px solid transparent;
  3289. border-right: 6px solid transparent;
  3290. }
  3291. .oa-header-uul::before {
  3292. left: 40px;
  3293. top: -7px;
  3294. border-bottom: 7px solid #ccc;
  3295. border-left: 7px solid transparent;
  3296. border-right: 7px solid transparent;
  3297. }
  3298. .hnstLogo {
  3299. position: absolute;
  3300. left: 190px;
  3301. top: 14px;
  3302. }
  3303. .hnstLogo > img {
  3304. height: 32px;
  3305. }
  3306. .marignL15 {
  3307. margin-left: 15px;
  3308. }
  3309. .menuDrag {
  3310. height: calc(100% - 120px);
  3311. width: 18px;
  3312. position: absolute;
  3313. right: -6px;
  3314. cursor: col-resize;
  3315. z-index: 22;
  3316. }
  3317. .pageBreadcrumb {
  3318. display: none;
  3319. }
  3320. .oa-user-name {
  3321. position: absolute;
  3322. top: 21px;
  3323. left: 100px;
  3324. max-width: 44%;
  3325. white-space: nowrap;
  3326. overflow: hidden;
  3327. text-overflow: ellipsis;
  3328. }
  3329. .strongBox {
  3330. position: absolute;
  3331. right: 0;
  3332. top: 0;
  3333. width: 28px;
  3334. height: 28px;
  3335. line-height: 28px;
  3336. text-align: center;
  3337. color: white;
  3338. background: red;
  3339. border-radius: 5px;
  3340. font-size: 14px;
  3341. }
  3342. </style>