main.vue 96 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460
  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. }
  947. },
  948. created() {
  949. this.orgcodezs = getCookie('orgCode')
  950. this.userId = getCookie('userId')
  951. this.current_theme = window.top.localStorage.getItem('current_theme')
  952. ? window.top.localStorage.getItem('current_theme')
  953. : 'deepBlue_theme'
  954. this.theme_color = this.theme_origin_color[this.current_theme]
  955. this.getIndexStyle()
  956. let w = document.documentElement.clientWidth || document.body.clientWidth
  957. let h = document.documentElement.clientHeight || document.body.clientHeight
  958. if (w <= 1500) {
  959. this.styleControll = true
  960. } else {
  961. this.styleControll = false
  962. }
  963. console.log('获取到的orgCode+++++++++++++' + this.orgcodezs)
  964. this.getinformation()
  965. },
  966. destroyed() {
  967. // 销毁浏览器返回监听
  968. // window.removeEventListener('popstate', this.goBack, false);
  969. clearInterval(this.inter)
  970. // 销毁websocket监听
  971. // this.websocket.onclose = this.close();
  972. },
  973. computed: {},
  974. beforeCreate() {
  975. let userId = getCookie('userId')
  976. this.appId = getCookie('appId')
  977. let menuId = window.top.localStorage.getItem('activeMenu')
  978. let companyId = window.top.localStorage.getItem('companyId')
  979. },
  980. watch: {
  981. checkedByLogin: function(n) {
  982. if (n) {
  983. try {
  984. this.lockRuleForm.pwd = JSON.parse(getCookie('userInfo')).password
  985. } catch (error) {
  986. this.lockRuleForm.pwd = ''
  987. }
  988. } else {
  989. this.lockRuleForm.pwd = ''
  990. }
  991. },
  992. theme_color: function(newV, oldV) {
  993. let that = this
  994. that.colors.primary = newV
  995. console.log(newV)
  996. console.log($(document.getElementsByTagName('iframe')))
  997. window.colorVal = newV
  998. that.primaryColor = this.colors.primary
  999. that.colors = objectAssign(
  1000. {},
  1001. that.colors,
  1002. generateColors(that.colors.primary)
  1003. )
  1004. let theme_style = that.originalStyle
  1005. Object.keys(that.colors).forEach(key => {
  1006. theme_style = theme_style.replace(
  1007. new RegExp('(:|\\s+)' + key, 'g'),
  1008. '$1' + that.colors[key]
  1009. )
  1010. })
  1011. that.loadNewStyle(document, theme_style)
  1012. for (let i = 0; i < document.getElementsByTagName('iframe').length; i++) {
  1013. try {
  1014. that.loadNewStyle(
  1015. document.getElementsByTagName('iframe')[i].contentDocument,
  1016. theme_style
  1017. )
  1018. } catch (err) {}
  1019. }
  1020. },
  1021. current_theme: function(n) {
  1022. let that = this
  1023. window.top.localStorage.setItem('current_theme', n)
  1024. that.theme_color = that.theme_origin_color[n]
  1025. console.log(that.theme_color)
  1026. console.log('这是')
  1027. for (let i = 0; i < document.getElementsByTagName('iframe').length; i++) {
  1028. console.log(
  1029. document
  1030. .getElementsByTagName('iframe')
  1031. [i].contentDocument.getElementsByClassName('mainVueIndex')[0]
  1032. .className
  1033. )
  1034. try {
  1035. document
  1036. .getElementsByTagName('iframe')
  1037. [i].contentDocument.getElementsByClassName(
  1038. 'mainVueIndex'
  1039. )[0].className = 'main mainVueIndex ' + n
  1040. } catch (err) {}
  1041. }
  1042. },
  1043. menuType: function(newV, oldV) {
  1044. let that = this
  1045. if (newV === '2') {
  1046. that.$nextTick(function() {
  1047. $('.icore-menu-main2').css({
  1048. width: that.widthLog
  1049. })
  1050. $('.sl-container2').css({
  1051. 'padding-left': that.leftLog
  1052. })
  1053. $('.oa-header-user').css({
  1054. width: that.widthLog
  1055. })
  1056. $('.oa-header-upt').css({
  1057. width: ''
  1058. })
  1059. that.setDrag()
  1060. })
  1061. } else {
  1062. that.widthLog = $('.icore-menu-main2').css('width')
  1063. that.leftLog = $('.sl-container2').css('padding-left')
  1064. $('.icore-menu-main2').css({
  1065. width: ''
  1066. })
  1067. $('.sl-container2').css({
  1068. 'padding-left': ''
  1069. })
  1070. $('.oa-header-user').css({
  1071. width: '80px'
  1072. })
  1073. $('.oa-header-upt').css({
  1074. width: '80px'
  1075. })
  1076. }
  1077. },
  1078. selectedMenu: function(menuId) {
  1079. var currentMenu = this.getMenuIndexByMenuId(this.menuData, null, menuId)
  1080. currentMenu &&
  1081. window.top.localStorage.setItem(
  1082. 'currentMenuIndex',
  1083. currentMenu.menuIndex
  1084. )
  1085. }
  1086. },
  1087. mounted() {
  1088. let that = this
  1089. window.onresize = function() {
  1090. let isFull =
  1091. document.fullscreen ||
  1092. document.webkitIsFullScreen ||
  1093. document.msFullscreenEnabled
  1094. isFull = isFull ? true : false
  1095. if (that.fullScreen !== isFull) {
  1096. //要执行的动作
  1097. that.fullScreen = isFull
  1098. }
  1099. }
  1100. // // 监控浏览器返回
  1101. // if (window.history && window.history.pushState) {
  1102. // history.pushState(null, null, document.URL);
  1103. // window.addEventListener('popstate', this.goBack, false);
  1104. // }
  1105. // 取字典(用处不明,且加入租户id后报错!!!!!暂时注释掉!!!!!!!!!!)
  1106. // this.dataDictionary.dispatch('list').then(() => {
  1107. // // console.log(this.dataDictionary.state.dict)
  1108. // });
  1109. this.showIframeEvent()
  1110. this.$nextTick(() => {
  1111. this.minHeight =
  1112. 'width: 100%;height: 100%;border: 0px;min-height: ' +
  1113. ($('#menuTabId').height() - 91) +
  1114. 'px'
  1115. that.checkedByLogin = true
  1116. })
  1117. // 获取公司信息
  1118. this.companyId = window.top.localStorage.getItem('companyId')
  1119. this.companys = JSON.parse(window.top.localStorage.getItem('companys'))
  1120. if (this.companyId !== '' && this.companyId !== null) {
  1121. this.companyName = this.companys.find(
  1122. x => x.id === this.companyId
  1123. ).companyName
  1124. }
  1125. setTimeout(() => {
  1126. this.current_theme = window.top.localStorage.getItem('current_theme')
  1127. ? window.top.localStorage.getItem('current_theme')
  1128. : 'deepBlue_theme'
  1129. }, 1000)
  1130. // 获取我的待办任务
  1131. var arr = ['#/authManage']
  1132. if ($.inArray(location.hash, arr) == -1) {
  1133. //that.getMyToDoDelegateTask();
  1134. //that.getMyToDoTask();
  1135. }
  1136. that.getMyMessage()
  1137. // 直接关闭浏览器窗口或者标签页时,关闭websocket连接
  1138. // window.onbeforeunload = function () {
  1139. // // that.send("closesocket:");
  1140. // that.close();
  1141. // }
  1142. // 获取当前密码策略校验
  1143. that.getPwdValid()
  1144. // 获取机构职级
  1145. that.getOrgDutyList()
  1146. },
  1147. methods: {
  1148. //弹框删除
  1149. async makeSure(){
  1150. let noticeid=this.noticedata1.noticeid
  1151. console.log(this.noticedata1)
  1152. this.noticedata1=[] ;
  1153. this.centerDialogVisible=false;
  1154. await this.axios.post("/api/v1/ams/updateNoticeStatus",
  1155. {userId:this.userId,
  1156. noticeId:noticeid}).then((res)=>{
  1157. console.log(res.data)
  1158. if (res.data.data ===0){
  1159. this.badgeshow=true;
  1160. }else {
  1161. console.log('进入了小红点标记区')
  1162. this.taskAllNum=res.data.data;
  1163. }
  1164. })
  1165. },
  1166. // 判断是否为公司其他平台模块且处于开发模式
  1167. isDev(url) {
  1168. let isDevModule = false
  1169. if (
  1170. url.indexOf('steerinfo.com') !== -1 &&
  1171. document.domain.indexOf('steerinfo.com') === -1
  1172. ) {
  1173. isDevModule = true
  1174. }
  1175. return isDevModule
  1176. },
  1177. // 根据当前模式更改菜单跳转url
  1178. getDevUrl(url) {
  1179. let newUrl = ''
  1180. let index = url.indexOf('steerinfo.com')
  1181. return (newUrl = url.substring(index).replace('steerinfo.com/views', '.'))
  1182. },
  1183. // 根据https/http跳转
  1184. toTrustUrl(url) {
  1185. let newUrl = ''
  1186. if (url.indexOf('https:') === -1 && url.indexOf('http:') > -1) {
  1187. newUrl = url.replace('http:', window.top.location.protocol)
  1188. } else if (url.indexOf('https:') > -1) {
  1189. newUrl = url.replace('https:', window.top.location.protocol)
  1190. } else {
  1191. newUrl = url
  1192. }
  1193. return newUrl
  1194. },
  1195. // 获取当前密码策略
  1196. getPwdValid() {
  1197. this.axios
  1198. .get('pass/v1/syspwdpolicys/getExecutingPwdPolicy')
  1199. .then(res => {
  1200. if (res.code === '0') {
  1201. this.regular = res.data.regular
  1202. this.regularType = res.data.regularType
  1203. this.minLength = res.data.minLength
  1204. this.maxLength = res.data.maxLength
  1205. } else {
  1206. this.$message.error(res.message)
  1207. }
  1208. })
  1209. .catch(err => {
  1210. console.log(err)
  1211. })
  1212. },
  1213. /**
  1214. * 样式加载
  1215. *
  1216. */
  1217. loadNewStyle(doc, theme_style) {
  1218. let child = doc.getElementById('theme')
  1219. if (child !== null) {
  1220. doc.getElementsByTagName('head')[0].removeChild(child)
  1221. }
  1222. let a = document.createElement('style')
  1223. a.setAttribute('id', 'theme')
  1224. a.innerHTML = theme_style
  1225. doc.getElementsByTagName('head')[0].appendChild(a)
  1226. },
  1227. // 验证密码强度的事件
  1228. inputThing(val) {
  1229. let _this = this
  1230. let arr = []
  1231. let i = 0
  1232. arr[0] = /[^a-zA-Z0-9_]/g
  1233. arr[1] = /[a-z]/g
  1234. arr[2] = /[0-9]/g
  1235. arr[3] = /[A-Z]/g
  1236. if (val.length >= 6) {
  1237. arr.forEach(res => {
  1238. if (val.match(res)) {
  1239. i++
  1240. }
  1241. })
  1242. switch (i) {
  1243. case 0:
  1244. _this.strongShow = false
  1245. break
  1246. case 1:
  1247. _this.strongShow = true
  1248. _this.strongText = '弱'
  1249. _this.strongColor = '#F26299'
  1250. _this.digit = true
  1251. break
  1252. case 2:
  1253. _this.strongShow = true
  1254. _this.strongText = '中'
  1255. _this.strongColor = '#F29E55'
  1256. break
  1257. case 3:
  1258. _this.strongShow = true
  1259. _this.strongText = '强'
  1260. _this.strongColor = '#4CD995'
  1261. break
  1262. }
  1263. } else if (!val) {
  1264. _this.strongShow = false
  1265. } else {
  1266. _this.strongShow = true
  1267. _this.strongText = '弱'
  1268. _this.strongColor = '#F26299'
  1269. _this.digit = false
  1270. }
  1271. },
  1272. /**
  1273. * 加载全局样式;
  1274. */
  1275. getStyleTemplate(data) {
  1276. const colorMap = {
  1277. '#3a8ee6': 'shade-1',
  1278. '#409eff': 'primary',
  1279. '#53a8ff': 'light-1',
  1280. '#66b1ff': 'light-2',
  1281. '#79bbff': 'light-3',
  1282. '#8cc5ff': 'light-4',
  1283. '#a0cfff': 'light-5',
  1284. '#b3d8ff': 'light-6',
  1285. '#c6e2ff': 'light-7',
  1286. '#d9ecff': 'light-8',
  1287. '#ecf5ff': 'light-9'
  1288. }
  1289. Object.keys(colorMap).forEach(key => {
  1290. const value = colorMap[key]
  1291. data = data.replace(new RegExp(key, 'ig'), value)
  1292. })
  1293. return data
  1294. },
  1295. getIndexStyle() {
  1296. let data = `@charset "UTF-8"; ${element_css_json_import.element_css}`
  1297. this.originalStyle = this.getStyleTemplate(data)
  1298. },
  1299. /**
  1300. * 解除锁屏
  1301. *
  1302. */
  1303. setLock() {
  1304. let that = this
  1305. let crypto = require('crypto')
  1306. if (
  1307. that.lockScreenPwd === that.inputLockPwd ||
  1308. that.lockScreenPwd ===
  1309. crypto
  1310. .createHash('sha1')
  1311. .update(that.inputLockPwd)
  1312. .digest('hex')
  1313. ) {
  1314. window.top.localStorage.setItem('lockpwd', '')
  1315. that.lockScreenPwd = ''
  1316. that.inputLockPwd = ''
  1317. } else {
  1318. that.inputLockPwd = ''
  1319. that.lockErrorMsg = true
  1320. setTimeout(() => {
  1321. that.lockErrorMsg = false
  1322. }, 1000)
  1323. }
  1324. },
  1325. /**
  1326. * 锁屏退出登录
  1327. */
  1328. lockSignOut() {
  1329. let that = this
  1330. that.store
  1331. .dispatch('loginOut')
  1332. .then(function(res) {
  1333. window.location.href = './index.html'
  1334. })
  1335. .catch(function() {
  1336. // TODO
  1337. })
  1338. },
  1339. /**
  1340. *打开主页
  1341. */
  1342. backMain() {
  1343. this.$message.success('跳转主页')
  1344. // window.open(
  1345. // window.location.protocol + "//portal.steerinfo.com",
  1346. // "_blank"
  1347. // );
  1348. },
  1349. /**
  1350. * 主题
  1351. */
  1352. themeEvent() {
  1353. let that = this
  1354. that.themeSetFlag = true
  1355. },
  1356. /**
  1357. * 锁屏
  1358. */
  1359. lockEvent() {
  1360. let that = this
  1361. if (!that.checkedByLogin) {
  1362. that.lockRuleForm.pwd = ''
  1363. }
  1364. that.lockEventFlag = true
  1365. },
  1366. lockEventSet() {
  1367. let that = this
  1368. this.$refs.lockRuleForm.validate(valid => {
  1369. if (valid) {
  1370. window.top.localStorage.setItem('lockpwd', that.lockRuleForm.pwd)
  1371. that.lockScreenPwd = that.lockRuleForm.pwd
  1372. that.lockEventFlag = false
  1373. that.$nextTick(() => {
  1374. that.$refs.lockInput.focus()
  1375. })
  1376. } else {
  1377. return false
  1378. }
  1379. })
  1380. },
  1381. /*
  1382. 全屏
  1383. */
  1384. fullScreenEvent() {
  1385. let that = this
  1386. let main = document.documentElement
  1387. if (that.fullScreen) {
  1388. if (document.exitFullscreen) {
  1389. document.exitFullscreen()
  1390. } else if (document.mozCancelFullScreen) {
  1391. document.mozCancelFullScreen()
  1392. } else if (document.webkitCancelFullScreen) {
  1393. document.webkitCancelFullScreen()
  1394. } else if (document.msExitFullscreen) {
  1395. document.msExitFullscreen()
  1396. }
  1397. } else {
  1398. // 开始全屏操作
  1399. var currentIfrm = $('#menuTabId')
  1400. .find('div[role=tabpanel]:visible')
  1401. .find('iframe')
  1402. $('.oa-header-user')
  1403. .hide()
  1404. .next()
  1405. .hide()
  1406. $('#outerHeader').hide()
  1407. $('#mainContainer').css('paddingLeft', '0')
  1408. $('#menuTabId')
  1409. .css('padding', 0)
  1410. .children(':eq(0)')
  1411. .hide()
  1412. $('.sl-content-main', top.document).css('height', 'initial')
  1413. // 先保留全屏前的iframe高度
  1414. this.oldMinHeight = currentIfrm.css('min-height')
  1415. // 将最小高度设置成当前分辨率的高度
  1416. currentIfrm.css('min-height', window.screen.height)
  1417. if (main.requestFullscreen) {
  1418. main.requestFullscreen()
  1419. } else if (main.mozRequestFullScreen) {
  1420. main.mozRequestFullScreen()
  1421. } else if (main.webkitRequestFullScreen) {
  1422. main.webkitRequestFullScreen()
  1423. } else if (main.msRequestFullscreen) {
  1424. main.msRequestFullscreen()
  1425. }
  1426. }
  1427. that.fullScreen = !that.fullScreen
  1428. },
  1429. // 下拉选择公司
  1430. selectComPany(command) {
  1431. this.$confirm('此操作将刷新系统页面, 是否继续?', '提示', {
  1432. confirmButtonText: '确定',
  1433. cancelButtonText: '取消',
  1434. type: 'warning'
  1435. })
  1436. .then(() => {
  1437. this.companyId = command.id
  1438. this.companyName = command.companyName
  1439. // 查询列表
  1440. this.store
  1441. .dispatch('generateRoutes', {
  1442. companyId: command.id,
  1443. appId: this.appId
  1444. })
  1445. .then(res => {
  1446. if (res.code === '0') {
  1447. this.store.commit('addRouters', res.data)
  1448. } else {
  1449. this.$message({
  1450. message: res.message,
  1451. type: 'error'
  1452. })
  1453. }
  1454. })
  1455. window.top.localStorage.setItem('companyId', command.id)
  1456. window.location.reload()
  1457. this.$message({
  1458. type: 'success',
  1459. message: '正在为您更新数据...'
  1460. })
  1461. })
  1462. .catch(error => {
  1463. console.log(error)
  1464. this.$message({
  1465. type: 'info',
  1466. message: '已取消操作'
  1467. })
  1468. })
  1469. },
  1470. selectOrg(command) {
  1471. this.$confirm('此操作将切换用户所在机构及职级, 是否继续?', '提示', {
  1472. confirmButtonText: '确定',
  1473. cancelButtonText: '取消',
  1474. type: 'warning'
  1475. })
  1476. .then(() => {
  1477. this.orgName = command.orgName
  1478. this.orgId = command.orgId
  1479. this.dutyName = command.dutys ? command.dutys[0].dutyName : ''
  1480. this.dutyId = command.dutys ? command.dutys[0].dutyId : ''
  1481. window.top.localStorage.setItem('dutyName', this.dutyName)
  1482. window.top.localStorage.setItem('dutyId', this.dutyId)
  1483. window.top.localStorage.setItem('orgId', command.orgId)
  1484. window.top.localStorage.setItem('orgCode', command.orgCode)
  1485. window.location.reload()
  1486. this.$message({
  1487. type: 'success',
  1488. message: '正在为您更新数据...'
  1489. })
  1490. this.updateUserInfo()
  1491. })
  1492. .catch(error => {
  1493. console.log(error)
  1494. this.$message({
  1495. type: 'info',
  1496. message: '已取消操作'
  1497. })
  1498. })
  1499. },
  1500. // 更新用户当前机构及职级
  1501. async updateUserInfo() {
  1502. // do
  1503. },
  1504. getOrgDutyList() {
  1505. let that = this
  1506. that.axios
  1507. .get('pass/v1/sysorgs/findOrgs?companyId=' + this.companyId)
  1508. .then(res => {
  1509. if (res.code === '0') {
  1510. this.orgDutyLinks = res.data
  1511. if (this.orgDutyLinks.length > 0) {
  1512. let orgId = window.top.localStorage.getItem('orgId')
  1513. if (orgId && orgId !== '' && orgId !== null) {
  1514. let obj = this.orgDutyLinks.find(x => x.orgId === orgId)
  1515. if (obj) {
  1516. this.orgId = orgId
  1517. this.orgName = obj.orgName
  1518. this.orgCode = obj.orgCode
  1519. this.dutyName = obj.dutys ? obj.dutys[0].dutyName : ''
  1520. this.dutyId = obj.dutys ? obj.dutys[0].dutyId : ''
  1521. } else {
  1522. this.orgName = res.data[0].orgName
  1523. this.orgId = res.data[0].orgId
  1524. this.orgCode = res.data[0].orgCode
  1525. this.dutyName = res.data[0].dutys
  1526. ? res.data[0].dutys[0].dutyName
  1527. : ''
  1528. this.dutyId = res.data[0].dutys
  1529. ? res.data[0].dutys.dutyId
  1530. : ''
  1531. }
  1532. } else {
  1533. this.orgName = res.data[0].orgName
  1534. this.orgId = res.data[0].orgId
  1535. this.orgCode = res.data[0].orgCode
  1536. this.dutyName = res.data[0].dutys
  1537. ? res.data[0].dutys[0].dutyName
  1538. : ''
  1539. this.dutyId = res.data[0].dutys
  1540. ? res.data[0].dutys[0].dutyId
  1541. : ''
  1542. this.updateUserInfo()
  1543. }
  1544. window.top.localStorage.setItem('orgId', this.orgId)
  1545. window.top.localStorage.setItem('orgCode', this.orgCode)
  1546. window.top.localStorage.setItem('dutyName', this.dutyName)
  1547. window.top.localStorage.setItem('dutyId', this.dutyId)
  1548. }
  1549. } else {
  1550. this.$message.error(res.message)
  1551. }
  1552. })
  1553. .catch(err => {
  1554. console.log(err)
  1555. })
  1556. },
  1557. visibleChange(f) {
  1558. let that = this
  1559. if (!f) {
  1560. $('.contextmenu').css({
  1561. display: 'none'
  1562. })
  1563. }
  1564. },
  1565. handleCommand(command) {
  1566. let that = this
  1567. switch (command) {
  1568. case 'a': //关闭当前标签
  1569. $('#menuTabId .el-icon-close')
  1570. .eq(that.menuTabIndex)
  1571. .click()
  1572. break
  1573. case 'b': //关闭其他标签
  1574. var removeTarget = []
  1575. var len = that.tabsData.length - that.menuTabIndex - 1
  1576. for (let i = 0; i < len; i++) {
  1577. removeTarget.push(
  1578. $('#menuTabId .el-icon-close').eq(that.menuTabIndex + i + 1)
  1579. )
  1580. }
  1581. for (let i = 0; i < that.menuTabIndex; i++) {
  1582. removeTarget.push($('#menuTabId .el-icon-close').eq(i))
  1583. }
  1584. for (let i = 0; i < removeTarget.length; i++) {
  1585. $(removeTarget[i]).click()
  1586. }
  1587. break
  1588. case 'c': //关闭右侧标签
  1589. var removeTarget = []
  1590. var len = that.tabsData.length - that.menuTabIndex - 1
  1591. for (let i = 0; i < len; i++) {
  1592. removeTarget.push(
  1593. $('#menuTabId .el-icon-close').eq(that.menuTabIndex + i + 1)
  1594. )
  1595. }
  1596. for (let i = 0; i < removeTarget.length; i++) {
  1597. $(removeTarget[i]).click()
  1598. }
  1599. break
  1600. case 'd': // 刷新当前标签页
  1601. $('#menuTabId .el-tabs__item')
  1602. .eq(that.menuTabIndex)
  1603. .click()
  1604. $('#menuTabId iframe')
  1605. .eq(that.menuTabIndex)[0]
  1606. .contentWindow.location.reload(true)
  1607. break
  1608. }
  1609. },
  1610. // 右键菜单
  1611. rightShow($event, index, item) {
  1612. let that = this
  1613. that.menuTabIndex = index
  1614. $('.contextmenu').css({
  1615. left: $event.pageX + 120 + 'px',
  1616. top: $event.pageY + 'px',
  1617. display: 'block'
  1618. })
  1619. $('#setClick').click()
  1620. $event.preventDefault()
  1621. },
  1622. gotoSetPage(item) {
  1623. let that = this
  1624. let menuData = item.preTarget
  1625. if (!menuData) {
  1626. return
  1627. }
  1628. that.tabsData.push(menuData)
  1629. that.selectedMenu = menuData.menuId
  1630. that.pageBreadcrumb = item.pageBreadcrumb
  1631. that.axios
  1632. .post(proPath + 'v1/sysmenus/accessOwnAdd', {
  1633. userId: that.$store.state.userInfo.userId,
  1634. menuId: menuData.menuId
  1635. })
  1636. .then(function(response) {})
  1637. .catch(function() {})
  1638. },
  1639. // 判断是否在iframe下
  1640. showIframeEvent() {
  1641. var that = this
  1642. var thisDocument = document
  1643. try {
  1644. var topDocument = window.top.document
  1645. } catch (err) {
  1646. thisDocument.getElementsByClassName(
  1647. 'icore-menu-main'
  1648. )[0].style.display = 'none'
  1649. thisDocument.getElementsByClassName('sl-header')[0].style.display =
  1650. 'none'
  1651. thisDocument.getElementById('mainContainer').style.padding = '0px'
  1652. return
  1653. }
  1654. var routerCover = this.$router.history.current.query
  1655. var routerParams = this.$router.history.current.params
  1656. var routerFlag = 0
  1657. var routerFlagP = 0
  1658. for (var i in routerCover) {
  1659. routerFlag = routerFlag + 1
  1660. }
  1661. for (var j in routerParams) {
  1662. routerFlagP = routerFlagP + 1
  1663. }
  1664. that.showIframe =
  1665. thisDocument === topDocument && routerFlag === 0 && routerFlagP === 0
  1666. if (that.showIframe) {
  1667. that.getUserInfo()
  1668. thisDocument.getElementById('mainContainer').style['padding-left'] =
  1669. '179px'
  1670. // websocket初始化
  1671. let token = getCookie('accessToken')
  1672. if (token) {
  1673. this.init(token)
  1674. }
  1675. // 打开设为主页的菜单
  1676. // that.openMainPage();
  1677. // 自动打开上一次访问页面
  1678. that.autoOpenLatestPage()
  1679. }
  1680. if (routerFlag > 0 || routerFlagP > 0) {
  1681. that.menuType = '1'
  1682. }
  1683. var setShowIframe = setInterval(function() {
  1684. for (
  1685. let i = 0;
  1686. i < window.top.document.getElementsByTagName('iframe').length;
  1687. i++
  1688. ) {
  1689. if (
  1690. window.top.document.getElementsByTagName('iframe')[i]
  1691. .contentDocument !== null &&
  1692. window.top.document
  1693. .getElementsByTagName('iframe')
  1694. [i].contentDocument.getElementsByClassName('icore-menu-main')
  1695. .length > 0
  1696. ) {
  1697. $(
  1698. window.top.document.getElementsByTagName('iframe')[i].parentNode
  1699. .parentNode
  1700. ).css({
  1701. height: 'calc(100% - 31px)'
  1702. })
  1703. $(
  1704. window.top.document.getElementsByTagName('iframe')[i].parentNode
  1705. ).css({
  1706. height: '100%'
  1707. })
  1708. window.top.document
  1709. .getElementsByTagName('iframe')
  1710. [i].contentDocument.getElementsByClassName(
  1711. 'icore-menu-main'
  1712. )[0].style.display = 'none'
  1713. window.top.document
  1714. .getElementsByTagName('iframe')
  1715. [i].contentDocument.getElementsByClassName(
  1716. 'sl-header'
  1717. )[0].style.display = 'none'
  1718. window.top.document
  1719. .getElementsByTagName('iframe')
  1720. [i].contentDocument.getElementsByClassName(
  1721. 'sl-content-main'
  1722. )[0].style.height = '100%'
  1723. window.top.document
  1724. .getElementsByTagName('iframe')
  1725. [i].contentDocument.getElementById(
  1726. 'mainContainer'
  1727. ).style.padding = '0px'
  1728. if (
  1729. i ===
  1730. window.top.document.getElementsByTagName('iframe').length - 1
  1731. ) {
  1732. clearInterval(setShowIframe)
  1733. }
  1734. }
  1735. }
  1736. if (window.top.document.getElementsByTagName('iframe').length === 0) {
  1737. if (!that.showIframe) {
  1738. thisDocument.getElementById('mainContainer').style['padding-left'] =
  1739. '0px'
  1740. thisDocument.getElementsByClassName(
  1741. 'sl-content-main'
  1742. )[0].style.height = '100%'
  1743. }
  1744. clearInterval(setShowIframe)
  1745. }
  1746. }, 20)
  1747. that.setDrag()
  1748. },
  1749. handleOperate() {
  1750. setTimeout(() => {
  1751. this.$nextTick(() => {
  1752. let heightOld = $('.icore-menu-main')[0].clientHeight
  1753. let height = $('.icore-menu-main')[0].scrollHeight
  1754. if (height !== 0) {
  1755. // 菜单收缩后scrollHeight复原
  1756. window.top.document.getElementsByClassName(
  1757. 'menuDrag'
  1758. )[0].style.height = heightOld + 'px'
  1759. // 再次赋值
  1760. let heightNew = $('.icore-menu-main')[0].scrollHeight
  1761. window.top.document.getElementsByClassName(
  1762. 'menuDrag'
  1763. )[0].style.height = heightNew + 'px'
  1764. }
  1765. })
  1766. }, 500)
  1767. },
  1768. setDrag() {
  1769. let that = this
  1770. if (that.showIframe) {
  1771. that.$nextTick(() => {
  1772. window.top.document.getElementsByClassName(
  1773. 'menuDrag'
  1774. )[0].style.height = $('.icore-menu-main')[0].scrollHeight + 'px'
  1775. })
  1776. }
  1777. $('#menuDrag').unbind()
  1778. $('#menuDrag').mousedown(function(event) {
  1779. that.dragFlag = true
  1780. $(event.target).data('dragStart', event.pageX)
  1781. $(event.target).data('dragWidth', $('.icore-menu-main2').outerWidth())
  1782. $('body').css({
  1783. cursor: 'col-resize'
  1784. })
  1785. let _html =
  1786. '<div id="dragsc" style="height: 100%;width: 100%;position: absolute;top: 0;z-index: 888;"></div>'
  1787. $('body').append(_html)
  1788. $('body').mousemove(function(e) {
  1789. if (!that.dragFlag) {
  1790. $(this).css({
  1791. cursor: ''
  1792. })
  1793. $('#dragsc').remove()
  1794. $(this).unbind(e)
  1795. } else {
  1796. var startX = $('#menuDrag').data('dragStart')
  1797. var endX = e.pageX
  1798. var change = endX - startX
  1799. var containerWidth = $('#menuDrag').data('dragWidth')
  1800. // console.log('containerWidth + change = ' + (containerWidth + change))
  1801. if (containerWidth + change < 180) {
  1802. $('.icore-menu-main2').css({
  1803. width: '180px'
  1804. })
  1805. $('.oa-header-user').css({
  1806. width: ''
  1807. })
  1808. $('.sl-container2').css({
  1809. 'padding-left': '179px'
  1810. })
  1811. } else if (containerWidth + change <= 800) {
  1812. $('.icore-menu-main2').css({
  1813. width: containerWidth + change + 'px'
  1814. })
  1815. $('.sl-container2').css({
  1816. 'padding-left': containerWidth + change - 1 + 'px'
  1817. })
  1818. $('.oa-header-user').css({
  1819. width: containerWidth + change + 'px'
  1820. })
  1821. }
  1822. }
  1823. })
  1824. $('body').mouseup(function(ev) {
  1825. that.dragFlag = false
  1826. $(this).unbind(ev)
  1827. })
  1828. })
  1829. },
  1830. // tabs选项选择
  1831. handleClick(tab, event) {
  1832. let that = this
  1833. let pageBreadcrumb = $($('.pageBreadcrumb')[parseInt(tab.index)]).html()
  1834. that.pageBreadcrumb = JSON.parse(pageBreadcrumb)
  1835. window.top.localStorage.setItem('activeMenu', tab.name)
  1836. that.menuTabIndex = that.getTabIndex(tab.name)
  1837. for (let i = 0; i < this.mainPageList.length - 1; i++) {
  1838. if (
  1839. tab.name === this.mainPageList[i].menuId &&
  1840. this.mainPageList[i].mainPageLoading === true
  1841. ) {
  1842. $('#menuTabId iframe')
  1843. .eq(that.menuTabIndex)[0]
  1844. .contentWindow.location.reload(true)
  1845. this.mainPageList[i].mainPageLoading = false
  1846. }
  1847. }
  1848. },
  1849. removeTab(targetName) {
  1850. var that = this
  1851. var spliceIndex = null
  1852. var temp = []
  1853. for (let i = 0; i < this.mainPageList.length - 1; i++) {
  1854. if (targetName === this.mainPageList[i].menuId) {
  1855. this.mainPageList[i].mainPageLoading = false
  1856. }
  1857. }
  1858. for (var i = 0; i < that.tabsData.length; i++) {
  1859. temp.push(that.tabsData[i])
  1860. if (targetName === that.tabsData[i].menuId) {
  1861. spliceIndex = i
  1862. }
  1863. }
  1864. if (spliceIndex !== null) {
  1865. temp.splice(spliceIndex, 1)
  1866. }
  1867. if (that.selectedMenu === that.tabsData[spliceIndex].menuId) {
  1868. if (temp.length !== 0) {
  1869. var showIndex = spliceIndex
  1870. if (showIndex > temp.length - 1) {
  1871. showIndex = temp.length - 1
  1872. }
  1873. that.selectedMenu = temp[showIndex].menuId
  1874. window.top.localStorage.setItem('activeMenu', that.selectedMenu)
  1875. that.pageBreadcrumb = temp[showIndex].pageBreadcrumb
  1876. } else {
  1877. that.pageBreadcrumb = [
  1878. {
  1879. menuId: 1,
  1880. menuLabel: '首页'
  1881. }
  1882. ]
  1883. window.top.localStorage.setItem('currentMenuIndex', '')
  1884. }
  1885. }
  1886. that.tabsData = temp
  1887. },
  1888. // 菜单选择
  1889. selectMenu(menuData, pageBreadcrumb) {
  1890. console.log('menuData')
  1891. console.log(menuData)
  1892. // console.log(pageBreadcrumb)
  1893. var that = this
  1894. if (
  1895. menuData.menuUrl !== null &&
  1896. menuData.menuUrl !== '' &&
  1897. typeof menuData.menuUrl !== 'undefined'
  1898. ) {
  1899. window.top.localStorage.setItem('activeMenu', menuData.menuId)
  1900. var temp = []
  1901. menuData.pageBreadcrumb = pageBreadcrumb
  1902. var setTabsFlag = true
  1903. for (var i = 0; i < that.tabsData.length; i++) {
  1904. if (menuData.menuId === that.tabsData[i].menuId) {
  1905. setTabsFlag = false
  1906. break
  1907. }
  1908. }
  1909. if (setTabsFlag) {
  1910. for (var j = 0; j < that.tabsData.length; j++) {
  1911. temp.push(that.tabsData[j])
  1912. }
  1913. temp.push(menuData)
  1914. that.tabsData.push(menuData)
  1915. }
  1916. that.selectedMenu = menuData.menuId
  1917. that.pageBreadcrumb = pageBreadcrumb
  1918. that.axios
  1919. .post(proPath + 'v1/sysmenus/accessOwnAdd', {
  1920. userId: that.$store.state.userInfo.userId,
  1921. menuId: menuData.menuId
  1922. })
  1923. .then(function(response) {})
  1924. .catch(function() {})
  1925. this.$nextTick(() => {
  1926. console.log($(document.getElementsByTagName('iframe')))
  1927. })
  1928. }
  1929. // console.log('目录', that.selectedMenu, that.tabsData)
  1930. // 左侧菜单点击切换的时候需要重新加载页面
  1931. that.menuTabIndex = that.getTabIndex(menuData.menuId)
  1932. $('#menuTabId iframe').eq(that.menuTabIndex).length &&
  1933. $('#menuTabId iframe')
  1934. .eq(that.menuTabIndex)[0]
  1935. .contentWindow.location.reload(true)
  1936. },
  1937. // 是否合部都不是菜单就不用显示
  1938. allNoMenu(items) {
  1939. let bol = false
  1940. for (let item of items) {
  1941. if (item.menuType === '1' || item.menuType === '4') {
  1942. // 有菜单
  1943. bol = true
  1944. break
  1945. }
  1946. }
  1947. return bol
  1948. },
  1949. //
  1950. signOut() {
  1951. let _this = this
  1952. _this
  1953. .$msgbox({
  1954. title: '退出提示',
  1955. message: '确定退出登录吗?',
  1956. showCancelButton: true,
  1957. confirmButtonText: '确定',
  1958. cancelButtonText: '取消',
  1959. beforeClose: (action, instance, done) => {
  1960. if (action === 'confirm') {
  1961. instance.confirmButtonLoading = true
  1962. instance.confirmButtonText = '执行中...'
  1963. // ajax
  1964. let res = this.axios.get('pass/logout', {
  1965. params: {
  1966. authorization: getCookie('accessToken')
  1967. }
  1968. })
  1969. res
  1970. .then(function(res) {
  1971. console.log(111)
  1972. instance.confirmButtonText = '确定'
  1973. instance.confirmButtonLoading = false
  1974. done()
  1975. window.location.href = './index.html'
  1976. })
  1977. .catch(function() {
  1978. instance.confirmButtonText = '确定'
  1979. instance.confirmButtonLoading = false
  1980. done()
  1981. })
  1982. } else {
  1983. done()
  1984. }
  1985. }
  1986. })
  1987. .then(action => {})
  1988. },
  1989. // 查看个人信息
  1990. showPersonInfo() {
  1991. // 打开查看
  1992. this.userModal.show = true
  1993. let userId = this.$store.state.userInfo.userId
  1994. },
  1995. getUserInfo() {
  1996. let that = this
  1997. if (that.$store.state.userInfo) {
  1998. that.axios
  1999. .get(proPath + 'v1/sysusers/' + that.$store.state.userInfo.userId)
  2000. .then(function(response) {
  2001. if (response) {
  2002. that.userInfo = response.data
  2003. top.globalUserInfo = response.data
  2004. }
  2005. })
  2006. }
  2007. },
  2008. // 隐藏侧边栏
  2009. changeMenuType() {
  2010. if (this.menuType === '2') {
  2011. this.menuType = '1'
  2012. } else {
  2013. this.menuType = '2'
  2014. }
  2015. },
  2016. // 菜单选中
  2017. thisMenu(item) {
  2018. for (let b of this.pageBreadcrumb) {
  2019. if (b.menuId === item.menuId) {
  2020. return true
  2021. }
  2022. }
  2023. return false
  2024. },
  2025. // 弹窗完成
  2026. userModalThen(str, item) {
  2027. // console.log('代码执行了')
  2028. switch (str) {
  2029. case 'close':
  2030. this.userModal.show = false
  2031. break
  2032. case 'success':
  2033. this.userModal.show = false
  2034. // 刷新
  2035. this.store.dispatch('getUserInfo')
  2036. break
  2037. }
  2038. },
  2039. // 修改密码
  2040. pwdSubmit() {
  2041. // if (this.strongText === '弱' && this.digit) {
  2042. // this.$message.warning('密码安全等级太弱')
  2043. // return
  2044. // } else if (this.strongText === '弱' && !this.digit) {
  2045. // this.$message.warning('密码不能小于六位数')
  2046. // return
  2047. // }
  2048. this.$refs['pwdModal'].validate(valid => {
  2049. if (valid) {
  2050. // if (this.pwdModal.form.newpassword.length > 16) {
  2051. // this.$message.warning('密码最长为16个字符')
  2052. // return
  2053. // }
  2054. this.pwdModal.loading = true
  2055. this.pwdModal.form.userid = this.store.state.userInfo.id
  2056. this.store
  2057. .dispatch('system/usersManage/updpsw', this.pwdModal.form)
  2058. .then(res => {
  2059. this.pwdModal.loading = false
  2060. if (res.code === '0') {
  2061. this.$message.success('设置成功')
  2062. this.strongShow = false
  2063. this.pwdModal.show = false
  2064. } else {
  2065. this.$message.error(res.message)
  2066. }
  2067. })
  2068. }
  2069. })
  2070. },
  2071. // 打开修改密码弹窗
  2072. openPwd() {
  2073. this.$refs['pwdModal'].resetFields && this.$refs['pwdModal'].resetFields()
  2074. this.strongShow = false
  2075. },
  2076. // 弹窗完成
  2077. userModalThen(str, item) {
  2078. let that = this
  2079. switch (str) {
  2080. case 'close':
  2081. that.userModal.show = false
  2082. break
  2083. case 'success':
  2084. that.userModal.show = false
  2085. // 刷新
  2086. that.getUser(that.tableParams.form)
  2087. break
  2088. }
  2089. },
  2090. // 关闭弹窗
  2091. userModalClose() {},
  2092. // 修改完毕重新请求数据
  2093. updataUserInfo(data) {
  2094. this.getUserInfo()
  2095. this.$store.commit('userInfo', data)
  2096. },
  2097. init: function(token) {
  2098. let that = this
  2099. // 192.168.10.231:9008本地
  2100. let path = ''
  2101. if (
  2102. window.top.document.location.origin.indexOf('icore-paas-test') !== -1 ||
  2103. window.top.document.location.origin.indexOf('localhost') !== -1
  2104. ) {
  2105. path =
  2106. 'wss://websocket-dev.steerinfo.com/websocket?type=pass&token=' + token
  2107. } else {
  2108. path =
  2109. 'wss://websocket.steerinfo.com/websocket?type=pass&token=' + token
  2110. }
  2111. if ('WebSocket' in window) {
  2112. // 实例化websocket
  2113. this.websocket = new WebSocket(path)
  2114. // 监听websocket连接
  2115. this.websocket.onopen = this.open
  2116. // 监听websocket错误信息
  2117. this.websocket.onerror = this.error
  2118. // 监听websocket消息
  2119. this.websocket.onmessage = this.getMessage
  2120. //每隔30秒钟发送一次心跳,避免websocket连接因超时而自动断开
  2121. // this.interval = window.setInterval(function(){
  2122. // if(that.websocket !== null){
  2123. // if (that.websocket.readyState !== that.websocket.OPEN) {
  2124. // let token = getCookie('accessToken');
  2125. // if (token) {
  2126. // that.init(token);
  2127. // }
  2128. // }
  2129. // // } else {
  2130. // // that.websocket.send('HeartBeat');
  2131. // // // console.log("发送心跳包:HeartBeat");
  2132. // // }
  2133. // }
  2134. // },30000);
  2135. } else {
  2136. alert('您当前浏览器不支持WebSocket')
  2137. // 每隔30秒钟发送一次心跳,避免websocket连接因超时而自动断开
  2138. // forgeWebSocket这个方法是在不支持websocket的浏览器中去执行,这个方法作用是作为最早得轮询方式去保持长连接。这样不管浏览器支不支持websocket都能保持长连接的功能作用
  2139. // this.interval = window.setInterval(function(){
  2140. // that.forgeWebSocket();
  2141. // },30000);
  2142. }
  2143. },
  2144. open: function() {
  2145. console.log('websocket连接成功')
  2146. },
  2147. error: function() {
  2148. console.log('连接错误')
  2149. },
  2150. getTabIndex(menuId) {
  2151. let index = 0
  2152. for (let i = 0; i < this.tabsData.length; i++) {
  2153. if (this.tabsData[i].menuId === menuId) {
  2154. index = i
  2155. }
  2156. }
  2157. return index
  2158. },
  2159. getMessage: function(msg) {
  2160. let that = this
  2161. // console.log(msg.data);
  2162. let newMsg = JSON.parse(msg.data)
  2163. let message = ''
  2164. if (Object.prototype.toString.call(newMsg) === '[object Object]') {
  2165. message = newMsg
  2166. } else if (Object.prototype.toString.call(newMsg) === '[object Array]') {
  2167. message = JSON.parse(msg.data).find(item => item.offline === false)
  2168. }
  2169. if (message.hasOwnProperty('type')) {
  2170. let activeMenu = window.top.localStorage.getItem('activeMenu')
  2171. let obj = this.getTreeAll(
  2172. this.menuData,
  2173. './workFlow.html#/coverTask',
  2174. 1,
  2175. []
  2176. )
  2177. let taskObj = this.getTreeAll(
  2178. this.menuData,
  2179. './workFlow.html#/personalInitiatedTask',
  2180. 1,
  2181. []
  2182. )
  2183. let msgObj = this.getTreeAll(
  2184. this.menuData,
  2185. './systemConfig.html#/noticeUser',
  2186. 1,
  2187. []
  2188. )
  2189. switch (message.type) {
  2190. case 'ACT_TO_DO_TASK': // 待办任务;
  2191. this.$message.info('您收到一条新的待办任务,请前往待办任务中查看!')
  2192. if (activeMenu === obj.menuData.menuId) {
  2193. that.menuTabIndex = that.getTabIndex(obj.menuData.menuId)
  2194. $('#menuTabId .el-tabs__item')
  2195. .eq(that.menuTabIndex)
  2196. .click()
  2197. $('#menuTabId iframe')
  2198. .eq(that.menuTabIndex)[0]
  2199. .contentWindow.location.reload(true)
  2200. }
  2201. this.getMyToDoTask()
  2202. this.getMyToDoDelegateTask()
  2203. break
  2204. case 'ACT_TO_DO_DELEGATETASK': // 委托待办任务;
  2205. this.$message.info(
  2206. '您收到一条新的委托待办任务,请前往待办任务中查看!'
  2207. )
  2208. if (activeMenu === obj.menuData.menuId) {
  2209. that.menuTabIndex = that.getTabIndex(obj.menuData.menuId)
  2210. $('#menuTabId .el-tabs__item')
  2211. .eq(that.menuTabIndex)
  2212. .click()
  2213. $('#menuTabId iframe')
  2214. .eq(that.menuTabIndex)[0]
  2215. .contentWindow.location.reload(true)
  2216. }
  2217. this.getMyToDoTask()
  2218. this.getMyToDoDelegateTask()
  2219. break
  2220. case 'ACT_MY_APPLY_TASK': // 申请完成任务;
  2221. this.$message.info('您有一条申请审批已完成,请前往流程跟踪中查看!')
  2222. if (activeMenu === taskObj.menuData.menuId) {
  2223. that.menuTabIndex = that.getTabIndex(taskObj.menuData.menuId)
  2224. $('#menuTabId .el-tabs__item')
  2225. .eq(that.menuTabIndex)
  2226. .click()
  2227. $('#menuTabId iframe')
  2228. .eq(that.menuTabIndex)[0]
  2229. .contentWindow.location.reload(true)
  2230. }
  2231. break
  2232. case 'SSO_NOTICE': // 公告;
  2233. this.$message.info('您收到一条新的公告:' + message.payload.title)
  2234. if (activeMenu === msgObj.menuData.menuId) {
  2235. that.menuTabIndex = that.getTabIndex(msgObj.menuData.menuId)
  2236. $('#menuTabId .el-tabs__item')
  2237. .eq(that.menuTabIndex)
  2238. .click()
  2239. $('#menuTabId iframe')
  2240. .eq(that.menuTabIndex)[0]
  2241. .contentWindow.location.reload(true)
  2242. }
  2243. this.getMyMessage()
  2244. break
  2245. case 'SSO_ROLE': // 权限已被管理员修改
  2246. case 'SSO_MENU':
  2247. case 'SSO_ORG':
  2248. let userId = this.$store.state.userInfo.userId
  2249. if (userId !== 'admin') {
  2250. this.privilegeUpdateIfo = true
  2251. this.coutTime(5)
  2252. } else {
  2253. if (message.type === 'SSO_MENU') {
  2254. store
  2255. .dispatch('generateRoutes', {
  2256. companyId: this.companyId,
  2257. appId: this.appId
  2258. })
  2259. .then(res => {
  2260. if (res.code === '0') {
  2261. this.menuData = res.data
  2262. }
  2263. })
  2264. .catch(err => {
  2265. console.log(err)
  2266. })
  2267. }
  2268. }
  2269. break
  2270. case 'UPDATE_NUM':
  2271. this.getMyToDoTask()
  2272. this.getMyToDoDelegateTask()
  2273. this.getMyMessage()
  2274. if (
  2275. message.payload === 'updateMessageNumOfAuth' &&
  2276. activeMenu === msgObj.menuData.menuId
  2277. ) {
  2278. that.menuTabIndex = that.getTabIndex(msgObj.menuData.menuId)
  2279. $('#menuTabId .el-tabs__item')
  2280. .eq(that.menuTabIndex)
  2281. .click()
  2282. $('#menuTabId iframe')
  2283. .eq(that.menuTabIndex)[0]
  2284. .contentWindow.location.reload(true)
  2285. }
  2286. break
  2287. }
  2288. }
  2289. },
  2290. send: function(params) {
  2291. this.websocket.send(params)
  2292. },
  2293. close: function() {
  2294. console.log('websocket已经关闭')
  2295. if (this.interval) {
  2296. window.clearInterval(this.interval)
  2297. // console.log("清除定时器");
  2298. }
  2299. },
  2300. // 倒计时函数
  2301. coutTime(index) {
  2302. let that = this
  2303. that.closeSecond = index
  2304. setTimeout(function() {
  2305. if (index == 0) {
  2306. that.store
  2307. .dispatch('loginOut')
  2308. .then(function(res) {
  2309. window.location.href = './index.html'
  2310. })
  2311. .catch(function(err) {
  2312. console.log(err)
  2313. })
  2314. } else {
  2315. that.coutTime(--index)
  2316. }
  2317. }, 1000)
  2318. },
  2319. closeConfirm() {
  2320. this.closeSecond = 0
  2321. this.store
  2322. .dispatch('loginOut')
  2323. .then(function(res) {
  2324. window.location.href = './index.html'
  2325. })
  2326. .catch(function(err) {
  2327. console.log(err)
  2328. })
  2329. },
  2330. // 遍历树获取指定url菜单相关
  2331. // tree 整体树
  2332. // url 需要跳转的页面url
  2333. // num 递归层级,初始值传1,用于返回页面线性层级
  2334. // list 包括页面&页面父级&父级的父级...直到最外层
  2335. getTreeAll(tree, url, num, list) {
  2336. let menuObj = {}
  2337. if (!!tree && tree.length !== 0) {
  2338. for (let item of tree) {
  2339. menuObj['pageBreadcrumb'] = list
  2340. if (item.menuUrl === url) {
  2341. menuObj['menuData'] = item
  2342. let obj = {
  2343. menuId: num,
  2344. menuLabel: item.menuLabel
  2345. }
  2346. menuObj.pageBreadcrumb.push(obj)
  2347. return menuObj
  2348. } else {
  2349. let obj = {
  2350. menuId: num,
  2351. menuLabel: item.menuLabel
  2352. }
  2353. let a = []
  2354. a.push(obj)
  2355. let newList = list.concat(a)
  2356. if (
  2357. item.hasOwnProperty('children') &&
  2358. item.children !== null &&
  2359. item.children.length > 0
  2360. ) {
  2361. menuObj = this.getTreeAll(item.children, url, num + 1, newList)
  2362. if (menuObj.hasOwnProperty('menuData')) {
  2363. return menuObj
  2364. }
  2365. }
  2366. }
  2367. }
  2368. }
  2369. return menuObj
  2370. },
  2371. // 前往我的待办任务
  2372. goMyTaskPage() {
  2373. let that = this
  2374. let updateStatus = false
  2375. for (let item of this.tabsData) {
  2376. if (item.menuUrl === './workFlow.html#/coverTask') {
  2377. updateStatus = true
  2378. }
  2379. }
  2380. let obj = this.getTreeAll(
  2381. this.menuData,
  2382. './workFlow.html#/coverTask',
  2383. 1,
  2384. []
  2385. )
  2386. this.selectMenu(obj.menuData, obj.pageBreadcrumb)
  2387. if (updateStatus === true) {
  2388. that.menuTabIndex = that.getTabIndex(obj.menuData.menuId)
  2389. $('#menuTabId .el-tabs__item')
  2390. .eq(that.menuTabIndex)
  2391. .click()
  2392. $('#menuTabId iframe')
  2393. .eq(that.menuTabIndex)[0]
  2394. .contentWindow.location.reload(true)
  2395. }
  2396. },
  2397. // 前往公告页面
  2398. goNoticePage() {
  2399. let that = this
  2400. let updateStatus = false
  2401. for (let item of this.tabsData) {
  2402. if (item.menuUrl === './systemConfig.html#/noticeUser') {
  2403. updateStatus = true
  2404. }
  2405. }
  2406. let obj = this.getTreeAll(
  2407. this.menuData,
  2408. './systemConfig.html#/noticeUser',
  2409. 1,
  2410. []
  2411. )
  2412. this.selectMenu(obj.menuData, obj.pageBreadcrumb)
  2413. if (updateStatus === true) {
  2414. that.menuTabIndex = that.getTabIndex(obj.menuData.menuId)
  2415. $('#menuTabId .el-tabs__item')
  2416. .eq(that.menuTabIndex)
  2417. .click()
  2418. $('#menuTabId iframe')
  2419. .eq(that.menuTabIndex)[0]
  2420. .contentWindow.location.reload(true)
  2421. }
  2422. },
  2423. updateTaskNum() {
  2424. let userId = getCookie('userId')
  2425. let messageType = {
  2426. payload: 'updateTaskNum',
  2427. type: 'UPDATE_NUM',
  2428. userId: userId
  2429. }
  2430. this.axios
  2431. .post('pass/websocket/socket/frontSendMessage', messageType, {
  2432. individualType: 'json'
  2433. })
  2434. .then(res => {
  2435. if (res.code === '0') {
  2436. // do
  2437. } else {
  2438. this.$message.error(res.message)
  2439. }
  2440. })
  2441. .catch(error => {
  2442. console.log(error.message)
  2443. })
  2444. },
  2445. updateMessageNum() {
  2446. let userId = getCookie('userId')
  2447. let messageType = {
  2448. payload: 'updateTaskNum',
  2449. type: 'UPDATE_NUM',
  2450. userId: userId
  2451. }
  2452. this.axios
  2453. .post('pass/websocket/socket/frontSendMessage', messageType, {
  2454. individualType: 'json'
  2455. })
  2456. .then(res => {
  2457. if (res.code === '0') {
  2458. // do
  2459. } else {
  2460. this.$message.error(res.message)
  2461. }
  2462. })
  2463. .catch(error => {
  2464. console.log(error.message)
  2465. })
  2466. },
  2467. // 获取我的待办任务个数
  2468. getMyToDoTask() {
  2469. // 获取当前用户
  2470. let userId = getCookie('userId')
  2471. this.axios
  2472. .get(
  2473. 'pass/act/v1/actusertasks/findMyToDoTask?userId=' +
  2474. userId +
  2475. '&companyId=' +
  2476. this.companyId +
  2477. '&pageNum=1&pageSize=1000000'
  2478. )
  2479. .then(res => {
  2480. if (res.code === '0') {
  2481. this.task1Num = res.data.list.length
  2482. } else {
  2483. this.$message.error(res.message)
  2484. }
  2485. })
  2486. .catch(error => {
  2487. console.log(error.message)
  2488. })
  2489. },
  2490. // 获取委托我代办的任务
  2491. getMyToDoDelegateTask() {
  2492. // 获取当前用户
  2493. let userId = getCookie('userId')
  2494. this.axios
  2495. .get(
  2496. 'pass/act/v1/actusertasks/findMyToDoDelegateTask?userId=' +
  2497. userId +
  2498. '&companyId=' +
  2499. this.companyId +
  2500. '&pageNum=1&pageSize=1000000'
  2501. )
  2502. .then(res => {
  2503. if (res.code === '0') {
  2504. this.task2Num = res.data.list.length
  2505. } else {
  2506. this.$message.error(res.message)
  2507. }
  2508. })
  2509. .catch(error => {
  2510. console.log(error.message)
  2511. })
  2512. },
  2513. // 获取我的公告信息
  2514. getMyMessage() {
  2515. // 获取当前用户
  2516. let userId = getCookie('userId')
  2517. this.axios
  2518. .get(
  2519. 'pass/v1/sysnotices/getUserNoticelike?status=0&pageNum=1&pageSize=1000000&companyId=' +
  2520. this.companyId
  2521. )
  2522. .then(res => {
  2523. if (res.code === '0') {
  2524. this.myMessageLength = res.data.list.length
  2525. } else {
  2526. this.$message.error(res.message)
  2527. }
  2528. })
  2529. .catch(error => {
  2530. console.log(error.message)
  2531. })
  2532. },
  2533. // 获取主页页面
  2534. getMainPage(tree, index, list) {
  2535. list = list ? list : []
  2536. if (!!tree && tree.length !== 0) {
  2537. for (let i = 0; i < tree.length; i++) {
  2538. let menuIndex = index ? index + '-' + i.toString() : i
  2539. if (
  2540. tree[i].loginDispaly &&
  2541. tree[i].loginDispaly === '1' &&
  2542. tree[i].status === '1'
  2543. ) {
  2544. tree[i]['menuIndex'] = menuIndex
  2545. tree[i]['mainPageLoading'] = true
  2546. list.push(tree[i])
  2547. } else {
  2548. if (
  2549. tree[i].hasOwnProperty('children') &&
  2550. tree[i].children !== null &&
  2551. tree[i].children.length > 0
  2552. ) {
  2553. this.getMainPage(tree[i].children, menuIndex, list)
  2554. }
  2555. }
  2556. }
  2557. }
  2558. return list
  2559. },
  2560. getMenuIndexByMenuId(tree, index, menuId) {
  2561. if (!!tree && tree.length !== 0) {
  2562. for (let i = 0; i < tree.length; i++) {
  2563. let menuIndex = index ? index + '-' + i.toString() : i.toString()
  2564. if (tree[i].menuId == menuId) {
  2565. tree[i]['menuIndex'] = menuIndex
  2566. return tree[i]
  2567. }
  2568. if (
  2569. tree[i].hasOwnProperty('children') &&
  2570. tree[i].children !== null &&
  2571. tree[i].children.length > 0
  2572. ) {
  2573. var result = this.getMenuIndexByMenuId(
  2574. tree[i].children,
  2575. menuIndex,
  2576. menuId
  2577. )
  2578. if (result) {
  2579. return result
  2580. }
  2581. }
  2582. }
  2583. }
  2584. },
  2585. autoOpenLatestPage() {
  2586. var that = this
  2587. var currentMenuIndex = window.top.localStorage.getItem('currentMenuIndex')
  2588. let menuList = window.top.document.getElementsByClassName('el-menu-item')
  2589. for (let i = 0; i < menuList.length; i++) {
  2590. if (menuList[i].__vue__.index === currentMenuIndex) {
  2591. setTimeout(function() {
  2592. that.defaultActiveIndex = currentMenuIndex
  2593. menuList[i].click()
  2594. }, 20)
  2595. }
  2596. }
  2597. },
  2598. // 打开设为主页菜单页面
  2599. openMainPage() {
  2600. this.mainPageList = this.getMainPage(this.menuData)
  2601. // console.log(this.mainPageList)
  2602. let menuList = window.top.document.getElementsByClassName('el-menu-item')
  2603. let s = 0
  2604. for (let item of this.mainPageList) {
  2605. for (let i = 0; i < menuList.length; i++) {
  2606. if (
  2607. menuList[i].innerHTML === item.menuLabel &&
  2608. menuList[i].__vue__.index === item.menuIndex
  2609. ) {
  2610. s++
  2611. setTimeout(() => {
  2612. menuList[i].click()
  2613. // console.log('点击行为')
  2614. }, 200)
  2615. }
  2616. }
  2617. }
  2618. },
  2619. // 浏览器返回操作
  2620. goBack() {
  2621. this.$router.replace({
  2622. path: '/'
  2623. })
  2624. },
  2625. updatecss() {
  2626. this.socketshow = true
  2627. //let height = document.body.clientHeight - 125
  2628. /*this.$nextTick(() => {
  2629. $('.Web_Notice')[0].style.height = height + 'px;'
  2630. })*/
  2631. },
  2632. leave() {
  2633. this.socketshow = false
  2634. },
  2635. getinformation() {
  2636. console.log('获取到的userId----------------' + this.userId)
  2637. this.axios
  2638. .post('/api/v1/ams/getNotice',
  2639. { userId: this.userId})
  2640. .then(res => {
  2641. this.noticedata = res.data.data
  2642. this.taskAllNum = res.data.data[0].taskAllNum
  2643. console.log(this.noticedata)
  2644. console.log(this.taskAllNum)
  2645. if (this.taskAllNum !=null){
  2646. if (this.taskAllNum==0){
  2647. console.log("进入了标记为0")
  2648. this.badgeshow=true
  2649. }else{
  2650. console.log("进入了标记不为0")
  2651. this.badgeshow=false
  2652. }
  2653. }else {
  2654. console.log("进入了标记值为null的值")
  2655. this.taskAllNum=null
  2656. }
  2657. })
  2658. },
  2659. // 查看待办任务详情
  2660. seeTaskContent(item) {
  2661. console.log("点击后的事件")
  2662. console.log(item)
  2663. let data={
  2664. noticetitle:item.noticetitle,
  2665. noticecontent:item.noticecontent,
  2666. insertusername:item.insertusername,
  2667. inserttime:item.inserttime,
  2668. noticeid:item.noticeId
  2669. }
  2670. this.noticedata1=data
  2671. this.centerDialogVisible=true;
  2672. console.log(this.noticedata1)
  2673. console.log(this.centerDialogVisible)
  2674. console.log(this.noticedata1.noticetitle)
  2675. //this.$refs.defaultpage.seeTaskContent(item)
  2676. // // this.dialogVisible = true;
  2677. // this.itemTask = item;
  2678. }
  2679. }
  2680. }
  2681. </script>
  2682. <!-- Add "scoped" attribute to limit CSS to this component only -->
  2683. <style lang="less" scoped>
  2684. .Web_Notice {
  2685. width: 400px;
  2686. position: absolute;
  2687. left: -200px;
  2688. height: 500px;
  2689. background-color: #f1f6fd;
  2690. }
  2691. /deep/ .privilegeArea {
  2692. .el-dialog {
  2693. min-width: 400px;
  2694. min-height: 120px;
  2695. padding-bottom: 10px;
  2696. }
  2697. }
  2698. .contextmenu {
  2699. width: 150px;
  2700. height: 150px;
  2701. top: 0px;
  2702. position: absolute;
  2703. display: none;
  2704. }
  2705. /deep/.lockInput .el-input__inner {
  2706. -webkit-text-security: disc !important;
  2707. }
  2708. .theme-defined {
  2709. position: absolute;
  2710. right: 20px;
  2711. top: 20px;
  2712. width: 150px;
  2713. }
  2714. .theme-defined > div {
  2715. float: right;
  2716. margin-right: 10px;
  2717. }
  2718. .company-select {
  2719. position: absolute;
  2720. left: 225px;
  2721. // top: 20px;
  2722. // float: left;
  2723. height: 60px;
  2724. line-height: 60px;
  2725. margin-left: 20px;
  2726. color: #fff;
  2727. font-size: 20px;
  2728. }
  2729. .el-dropdown {
  2730. font-size: 16px;
  2731. color: #ffffff;
  2732. cursor: pointer;
  2733. }
  2734. .ifCompany {
  2735. font-size: 16px;
  2736. color: #ffffff;
  2737. }
  2738. .lock_route {
  2739. transform: rotateY(180deg);
  2740. cursor: pointer;
  2741. position: absolute;
  2742. width: 40px;
  2743. height: 39px;
  2744. top: 0px;
  2745. right: 0px;
  2746. text-align: center;
  2747. line-height: 40px;
  2748. background-color: #ccc;
  2749. color: #fff;
  2750. }
  2751. .lock_screen {
  2752. position: absolute;
  2753. z-index: 9999999999;
  2754. background-color: #fff;
  2755. top: 0;
  2756. left: 0;
  2757. width: 100%;
  2758. height: 100%;
  2759. min-width: 1600px;
  2760. background: url(../assets/img/default-bg.png) center bottom no-repeat;
  2761. }
  2762. .main {
  2763. height: 100%;
  2764. }
  2765. .sl-header {
  2766. /* position: fixed; */
  2767. top: 0;
  2768. left: 0;
  2769. z-index: 1002;
  2770. width: 100%;
  2771. /* min-width: 1150px; */
  2772. background-color: #fff;
  2773. background-color: rgba(255, 255, 255, 0.9);
  2774. }
  2775. .sl-container {
  2776. height: 100%;
  2777. position: relative;
  2778. /* padding-top: 60px; */
  2779. padding-left: 79px;
  2780. /* transition: padding-left .3s ease-out; */
  2781. }
  2782. .sl-container2 {
  2783. padding-left: 0px;
  2784. }
  2785. .sl-content-main {
  2786. width: 100%;
  2787. // min-width: 1200px;
  2788. height: calc(100% - 60px);
  2789. overflow: auto;
  2790. ::-webkit-scrollbar {
  2791. //滚动条宽高,如果不需要显示滚动条可设置宽高为0
  2792. width: 0px;
  2793. // height: 0px;
  2794. }
  2795. ::-webkit-scrollbar-thumb {
  2796. //滚动条颜色和圆角
  2797. background-color: #dfe0e0;
  2798. border-radius: 3px;
  2799. }
  2800. ::-webkit-scrollbar-track-piece {
  2801. // border: 2px solid #000;
  2802. background-color: #f2f6f8;
  2803. border-radius: 3px;
  2804. }
  2805. }
  2806. .icore-menu-main {
  2807. position: fixed;
  2808. top: 0;
  2809. left: 0;
  2810. z-index: 1001;
  2811. width: 80px;
  2812. height: calc(100% - 60px);
  2813. margin-top: 60px;
  2814. border-right: 1px solid #efefef;
  2815. background-color: #fff;
  2816. /* transition: width .25s ease-out;*/
  2817. }
  2818. .icore-menu-main2 {
  2819. width: 180px;
  2820. -webkit-touch-callout: none;
  2821. -webkit-user-select: none;
  2822. -khtml-user-select: none;
  2823. -moz-user-select: none;
  2824. -ms-user-select: none;
  2825. user-select: none;
  2826. }
  2827. .sl-content {
  2828. transition: margin-left 0.2s linear;
  2829. }
  2830. .sl-header-li-logo {
  2831. float: left;
  2832. margin-top: 13px;
  2833. margin-left: 20px;
  2834. }
  2835. .sl-header-li-name {
  2836. float: left;
  2837. height: 60px;
  2838. line-height: 60px;
  2839. margin-left: 20px;
  2840. color: #fff;
  2841. font-size: 20px;
  2842. }
  2843. .sl-header-li-line {
  2844. float: left;
  2845. margin-top: 5px;
  2846. height: 26px;
  2847. }
  2848. .sl-header-li-lgo {
  2849. float: right;
  2850. margin-top: 21px;
  2851. width: 120px;
  2852. }
  2853. .sl-header-li-lgob {
  2854. display: inline-block;
  2855. padding-left: 25px;
  2856. position: relative;
  2857. color: white;
  2858. height: 20px;
  2859. line-height: 20px;
  2860. vertical-align: middle;
  2861. }
  2862. .sl-header-li-lgob > .xs-icons {
  2863. position: absolute;
  2864. top: -8px;
  2865. left: -18px;
  2866. }
  2867. .icore-menu-ops {
  2868. font-size: 16px;
  2869. color: #666;
  2870. transition: transform 0.3s ease-out;
  2871. }
  2872. .icore-menu-main2 .icore-menu-ops {
  2873. transform: rotate(180deg);
  2874. }
  2875. /* header menu style --> begin */
  2876. .icore-menu {
  2877. border-right: solid 0px #e6e6e6;
  2878. }
  2879. .icore-menu-a {
  2880. position: relative;
  2881. display: inline-block;
  2882. width: 100%;
  2883. padding-left: 54px;
  2884. -webkit-transition: color 0.3s;
  2885. transition: color 0.3s;
  2886. cursor: pointer;
  2887. border-right: 2px solid #fff;
  2888. }
  2889. .icore-menu-tip-cover {
  2890. position: absolute;
  2891. top: 0;
  2892. left: 0;
  2893. width: 100%;
  2894. height: 100%;
  2895. }
  2896. .icore-menu-a-noc {
  2897. padding-right: 2px;
  2898. }
  2899. .icore-menu-lit {
  2900. opacity: 0;
  2901. display: inline-block;
  2902. margin-top: 4px;
  2903. height: 36px;
  2904. line-height: 36px;
  2905. vertical-align: middle;
  2906. overflow: hidden;
  2907. transition: opacity 0.3s ease-out;
  2908. }
  2909. .nameText {
  2910. max-width: 85%;
  2911. text-overflow: ellipsis;
  2912. }
  2913. .icore-menu-main2 .icore-menu-lit {
  2914. opacity: 1;
  2915. }
  2916. .icore-menu-main2 .icore-menu-tip-cover {
  2917. display: none;
  2918. }
  2919. .icore-menu-lic {
  2920. position: absolute;
  2921. top: 50%;
  2922. left: 10px;
  2923. margin-top: -11px;
  2924. }
  2925. .icore-menu-ric {
  2926. position: absolute;
  2927. top: 50%;
  2928. right: 4px;
  2929. margin-top: -3px;
  2930. font-family: element-icons !important;
  2931. speak: none;
  2932. font-style: normal;
  2933. font-weight: 400;
  2934. font-variant: normal;
  2935. color: #999;
  2936. text-transform: none;
  2937. line-height: 1;
  2938. vertical-align: baseline;
  2939. display: inline-block;
  2940. -webkit-font-smoothing: antialiased;
  2941. font-smoothing: antialiased;
  2942. -webkit-transition: transform 0.3s;
  2943. transition: transform 0.3s;
  2944. }
  2945. /* .icore-menu-ric:before{
  2946. content: "\E603";
  2947. }*/
  2948. .icore-menu-ricr {
  2949. color: #999;
  2950. }
  2951. .icore-menu-s {
  2952. position: absolute;
  2953. top: -7px;
  2954. left: 100%;
  2955. z-index: 1004;
  2956. border: 1px solid #ccc;
  2957. box-shadow: 0 2px 8px #999;
  2958. border-radius: 2px;
  2959. background-color: #fff;
  2960. min-width: 130px;
  2961. padding: 10px 0;
  2962. }
  2963. .icore-menu-sham {
  2964. -webkit-transform: scaleY(0);
  2965. transform: scaleY(0);
  2966. -webkit-transition: transform, display 0.4s;
  2967. transition: transform 0.4s;
  2968. -webkit-transform-origin: center top;
  2969. transform-origin: center top;
  2970. }
  2971. .icore-menu-a:hover > .icore-menu-sham,
  2972. .icore-menu-sa:hover > .icore-menu-sham {
  2973. opacity: 1;
  2974. -webkit-transform: scaleY(1);
  2975. transform: scaleY(1);
  2976. }
  2977. .icore-menu-s.icore-menu-s-right {
  2978. left: auto;
  2979. right: 15px;
  2980. }
  2981. .main-upload_text_logo {
  2982. display: block;
  2983. text-align: center;
  2984. position: relative;
  2985. margin: 0px -20px;
  2986. top: -35px;
  2987. border-bottom: 1px solid #cccccc;
  2988. }
  2989. .main-file_upload {
  2990. width: 100%;
  2991. text-align: center;
  2992. position: relative;
  2993. display: inline-block;
  2994. vertical-align: top;
  2995. }
  2996. .main-file_con .hide {
  2997. width: 120px;
  2998. position: absolute;
  2999. height: 30px;
  3000. left: 58px;
  3001. margin-top: -8px;
  3002. opacity: 0;
  3003. filter: alpha(opacity=0);
  3004. z-index: 22;
  3005. }
  3006. .main-file_con .main-file_uploader,
  3007. .upload_bt {
  3008. left: 0;
  3009. top: -5px;
  3010. position: relative;
  3011. color: #fff;
  3012. display: inline-block;
  3013. padding: 0px 20px;
  3014. background: #2ecc71;
  3015. text-align: center;
  3016. z-index: 11;
  3017. border-radius: 15px;
  3018. cursor: pointer;
  3019. }
  3020. .upload_bt {
  3021. left: 130px;
  3022. }
  3023. .main-file_con .hide:hover {
  3024. box-shadow: 1px 2px #44795b;
  3025. }
  3026. .main-img_holder,
  3027. .m_main-img_holder {
  3028. height: 100px;
  3029. line-height: 70px;
  3030. }
  3031. .main-img_holder img,
  3032. .m_main-img_holder img {
  3033. max-width: 200px;
  3034. }
  3035. .main-file_btn_upload {
  3036. margin-top: -20px;
  3037. margin-bottom: 20px;
  3038. }
  3039. .icore-menu-sa {
  3040. display: block;
  3041. min-width: 120px;
  3042. white-space: nowrap;
  3043. padding: 0 20px;
  3044. line-height: 32px;
  3045. position: relative;
  3046. }
  3047. .icore-menu-a:hover {
  3048. color: #2391e5;
  3049. background-color: #e2f1fc;
  3050. border-right-color: #e2f1fc;
  3051. }
  3052. .icore-menu-a:hover > .icore-menu-ric {
  3053. color: #2391e5;
  3054. -webkit-transform: rotate(180deg);
  3055. transform: rotate(180deg);
  3056. }
  3057. .icore-menu-sa:hover {
  3058. background-color: #e2f1fc;
  3059. color: #2391e5;
  3060. }
  3061. .icore-menu-sa:hover > .icore-menu-ricr {
  3062. color: #2391e5;
  3063. }
  3064. .icore-menu-ss {
  3065. opacity: 0;
  3066. position: absolute;
  3067. left: 100%;
  3068. top: -11px;
  3069. z-index: 1005;
  3070. padding: 10px 0;
  3071. border: 1px solid #ccc;
  3072. box-shadow: 0 2px 8px #999;
  3073. border-radius: 2px;
  3074. background-color: #fff;
  3075. }
  3076. .icore-menu-sed {
  3077. border-right-color: #2391e5;
  3078. }
  3079. .icore-menu-sed,
  3080. .icore-menu-ssed,
  3081. .icore-menu-sssed {
  3082. color: #2391e5;
  3083. }
  3084. .icore-menu-sed > .icore-menu-ricr,
  3085. .icore-menu-ssed > .icore-menu-ricr,
  3086. .icore-menu-sed > .icore-menu-ric {
  3087. color: #2391e5;
  3088. }
  3089. .icore-menu-sdis {
  3090. cursor: default !important;
  3091. cursor: not-allowed !important;
  3092. color: #999 !important;
  3093. background-color: #fff !important;
  3094. }
  3095. .icore-menu-reverse > .icore-menu-s,
  3096. .icore-menu-reverse > .icore-menu-ss {
  3097. top: auto;
  3098. bottom: -11px;
  3099. -webkit-transform-origin: center bottom;
  3100. transform-origin: center bottom;
  3101. }
  3102. /* header menu style --> end */
  3103. .sl-breadcrumb {
  3104. overflow: hidden;
  3105. background-color: #fff;
  3106. height: 30px;
  3107. padding: 7px 0 0 20px;
  3108. }
  3109. .sl-header-li-lgbc {
  3110. position: absolute;
  3111. right: 40%;
  3112. top: 20px;
  3113. }
  3114. .sl-header-li-websocket {
  3115. position: absolute;
  3116. right: 210px;
  3117. top: 17px;
  3118. .el-button--text {
  3119. color: white;
  3120. }
  3121. }
  3122. .sl-breadcrumb-text {
  3123. float: left;
  3124. color: white;
  3125. }
  3126. .sl-breadcrumb-list {
  3127. float: left;
  3128. padding-left: 10px;
  3129. font-size: 12px;
  3130. position: relative;
  3131. top: 6px;
  3132. }
  3133. .sl-footer {
  3134. padding: 20px 0 0px;
  3135. }
  3136. .sl-footer > p {
  3137. text-align: center;
  3138. height: 20px;
  3139. line-height: 20px;
  3140. vertical-align: middle;
  3141. }
  3142. .am-xz {
  3143. float: left;
  3144. margin-right: 7px;
  3145. margin-top: 2px;
  3146. animation: amXuanzhuan 4s linear infinite;
  3147. }
  3148. @keyframes amXuanzhuan {
  3149. 0% {
  3150. transform: rotate3d(1, 0, 0, 360deg);
  3151. }
  3152. 100% {
  3153. transform: rotate3d(1, 0, 0, 0);
  3154. }
  3155. }
  3156. .oa-header-photo-uld {
  3157. width: 200px;
  3158. height: 200px;
  3159. line-height: 200px;
  3160. vertical-align: middle;
  3161. margin: 0 auto;
  3162. overflow: hidden;
  3163. cursor: pointer;
  3164. }
  3165. .oa-header-photo-uld > img {
  3166. max-width: 100%;
  3167. max-height: 100%;
  3168. vertical-align: middle;
  3169. }
  3170. /*.oa-header-content {*/
  3171. /*background: url("../../static/img/top_bgimg.png") left center no-repeat rgb(60,207,255);*/
  3172. /*height: 60px;*/
  3173. /*}*/
  3174. .oa-header-logo {
  3175. float: left;
  3176. padding: 15px 0 0 30px;
  3177. height: 50px;
  3178. overflow: hidden;
  3179. }
  3180. .oa-header-logo > img {
  3181. animation: fadeInLeft 0.5s ease-out 0s both;
  3182. }
  3183. .oa-header-upt {
  3184. position: absolute;
  3185. left: 0;
  3186. top: 0;
  3187. width: 100px;
  3188. height: 60px;
  3189. overflow: hidden;
  3190. text-align: center;
  3191. }
  3192. .oa-header-upt > a {
  3193. display: inline-block;
  3194. width: 40px;
  3195. height: 40px;
  3196. margin-top: 10px;
  3197. animation: fadeInRight 0.5s ease-out 0s both;
  3198. }
  3199. .oa-header-upt > a > img {
  3200. width: 40px;
  3201. height: 40px;
  3202. line-height: 40px;
  3203. vertical-align: middle;
  3204. color: #333;
  3205. border-radius: 20px;
  3206. box-shadow: 0 0 10px #333;
  3207. }
  3208. .oa-header-user:hover .oa-header-upt > a > img {
  3209. animation: circle 4s linear 0s infinite;
  3210. }
  3211. .oa-header-ucon {
  3212. display: none;
  3213. overflow: hidden;
  3214. position: absolute;
  3215. top: 50px;
  3216. left: 10px;
  3217. z-index: 18000;
  3218. padding: 10px 0 10px 10px;
  3219. font-size: 15px;
  3220. }
  3221. .oa-header-ulist {
  3222. position: relative;
  3223. width: 215px;
  3224. border: 1px solid #ddd;
  3225. box-shadow: 0 0 8px #999;
  3226. background-color: #fff;
  3227. background-color: rgba(255, 255, 255, 0.95);
  3228. }
  3229. .oa-header-user:hover .oa-header-ucon {
  3230. display: block;
  3231. }
  3232. .oa-header-user:hover .oa-header-ulist {
  3233. animation: fadeInRight 0.4s ease-out 0s both;
  3234. }
  3235. .oa-header-uin {
  3236. text-align: center;
  3237. overflow: hidden;
  3238. padding: 20px 0 15px 0;
  3239. }
  3240. .oa-header-uin > img {
  3241. width: 60px;
  3242. height: 60px;
  3243. border-radius: 30px;
  3244. cursor: pointer;
  3245. }
  3246. .oa-header-uin > img:hover {
  3247. animation: largen2 0.6s ease-out 0s both;
  3248. }
  3249. .oa-header-uin > h3 {
  3250. padding-top: 10px;
  3251. color: #666;
  3252. }
  3253. .oa-header-uul {
  3254. padding-bottom: 10px;
  3255. }
  3256. .oa-header-uul > li {
  3257. height: 40px;
  3258. line-height: 40px;
  3259. text-align: center;
  3260. vertical-align: middle;
  3261. cursor: pointer;
  3262. transition: background-color 0.3s linear 0s;
  3263. }
  3264. .oa-header-uul .st-icons {
  3265. position: relative;
  3266. top: 6px;
  3267. margin-right: 8px;
  3268. transition: all 0.3s linear;
  3269. }
  3270. .st-icons-out {
  3271. margin-right: 4px;
  3272. }
  3273. .oa-header-uul > li:hover {
  3274. background-color: #ebebeb;
  3275. }
  3276. .oa-header-uul::before,
  3277. .oa-header-uul::after {
  3278. border-bottom-color: rgba(0, 0, 0, 0.2);
  3279. content: '';
  3280. display: inline-block;
  3281. position: absolute;
  3282. }
  3283. .oa-header-uul::after {
  3284. left: 41px;
  3285. top: -6px;
  3286. border-bottom: 6px solid #fff;
  3287. border-left: 6px solid transparent;
  3288. border-right: 6px solid transparent;
  3289. }
  3290. .oa-header-uul::before {
  3291. left: 40px;
  3292. top: -7px;
  3293. border-bottom: 7px solid #ccc;
  3294. border-left: 7px solid transparent;
  3295. border-right: 7px solid transparent;
  3296. }
  3297. .hnstLogo {
  3298. position: absolute;
  3299. left: 190px;
  3300. top: 14px;
  3301. }
  3302. .hnstLogo > img {
  3303. height: 32px;
  3304. }
  3305. .marignL15 {
  3306. margin-left: 15px;
  3307. }
  3308. .menuDrag {
  3309. height: calc(100% - 120px);
  3310. width: 18px;
  3311. position: absolute;
  3312. right: -6px;
  3313. cursor: col-resize;
  3314. z-index: 22;
  3315. }
  3316. .pageBreadcrumb {
  3317. display: none;
  3318. }
  3319. .oa-user-name {
  3320. position: absolute;
  3321. top: 21px;
  3322. left: 100px;
  3323. max-width: 44%;
  3324. white-space: nowrap;
  3325. overflow: hidden;
  3326. text-overflow: ellipsis;
  3327. }
  3328. .strongBox {
  3329. position: absolute;
  3330. right: 0;
  3331. top: 0;
  3332. width: 28px;
  3333. height: 28px;
  3334. line-height: 28px;
  3335. text-align: center;
  3336. color: white;
  3337. background: red;
  3338. border-radius: 5px;
  3339. font-size: 14px;
  3340. }
  3341. </style>