main.vue 94 KB

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