permissionSettingDialog.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737
  1. <template>
  2. <div>
  3. <el-dialog
  4. title="权限设置"
  5. class="permissionSettingDialog"
  6. :visible.sync="show"
  7. :close-on-click-modal="false"
  8. width="1000px"
  9. top="8vh"
  10. >
  11. <div v-loading="loading" class="ps_area">
  12. <div class="pa_a_head">
  13. <span
  14. :class="{ pa_a_h_active: tagType == 'basics' }"
  15. @click="changeTagType('basics')"
  16. >基本信息</span
  17. >
  18. <span
  19. :class="{ pa_a_h_active: tagType == 'desktop' }"
  20. @click="changeTagType('desktop')"
  21. >桌面工具</span
  22. >
  23. <span
  24. :class="{ pa_a_h_active: tagType == 'admin-index' }"
  25. @click="changeTagType('admin-index')"
  26. >管理平台侧首页</span
  27. >
  28. <span
  29. :class="{ pa_a_h_active: tagType == 'admin-cocoFlow' }"
  30. @click="changeTagType('admin-cocoFlow')"
  31. >管理平台首页CocoFlow</span
  32. >
  33. <span
  34. :class="{ pa_a_h_active: tagType == 'admin-sidebar' }"
  35. @click="changeTagType('admin-sidebar')"
  36. >管理平台侧边栏</span
  37. >
  38. <div class="ea_add">
  39. <el-button
  40. size="mini"
  41. v-if="['admin-sidebar'].includes(tagType)"
  42. type="primary"
  43. @click="addMenu()"
  44. >添加菜单</el-button
  45. >
  46. <el-button
  47. size="mini"
  48. v-if="['admin-cocoFlow'].includes(tagType)"
  49. type="primary"
  50. @click="addApp()"
  51. >添加应用</el-button
  52. >
  53. <el-button
  54. size="mini"
  55. v-if="
  56. ['desktop', 'admin-index', 'admin-sidebar'].includes(tagType)
  57. "
  58. type="primary"
  59. @click="addTool(tagType)"
  60. >添加工具</el-button
  61. >
  62. </div>
  63. </div>
  64. <div class="pa_a_editBox">
  65. <div class="editArea pa_a_eb_basics" v-show="tagType == 'basics'">
  66. <div class="ea_basics_input">
  67. <span>标题</span>
  68. <el-input
  69. v-model="form.basics.title"
  70. placeholder="请输入标题内容"
  71. ></el-input>
  72. </div>
  73. <div class="ea_basics_input">
  74. <span>简介</span>
  75. <el-input
  76. v-model="form.basics.brief"
  77. placeholder="请输入简介内容"
  78. ></el-input>
  79. </div>
  80. <div class="ea_basics_logo">
  81. <span>logo</span>
  82. <el-tooltip
  83. class="item"
  84. effect="dark"
  85. :content="form.basics.logo ? '更改图标' : '上传图标'"
  86. placement="top"
  87. >
  88. <el-image
  89. style="width: 60px; height: 60px;margin-left: 20px;"
  90. :src="form.basics.logo"
  91. fit="cover"
  92. @click="addBasicsIcon('logo')"
  93. >
  94. <div slot="error" class="image-slot" @click="addBasicsIcon('logo')">
  95. <i class="el-icon-picture-outline"></i>
  96. </div>
  97. </el-image>
  98. </el-tooltip>
  99. </div>
  100. <div class="ea_basics_logo">
  101. <span>登录页logo</span>
  102. <el-tooltip
  103. class="item"
  104. effect="dark"
  105. :content="form.basics.loginLogo ? '更改图标' : '上传图标'"
  106. placement="top"
  107. >
  108. <el-image
  109. style="width: 60px; height: 60px;margin-left: 20px;"
  110. :src="form.basics.loginLogo"
  111. fit="cover"
  112. @click="addBasicsIcon('loginLogo')"
  113. >
  114. <div slot="error" class="image-slot" @click="addBasicsIcon('loginLogo')">
  115. <i class="el-icon-picture-outline"></i>
  116. </div>
  117. </el-image>
  118. </el-tooltip>
  119. </div>
  120. <div class="ea_basics_logo">
  121. <span>登录页banner</span>
  122. <el-tooltip
  123. class="item"
  124. effect="dark"
  125. :content="form.basics.loginBanner ? '更改' : '上传'"
  126. placement="top"
  127. >
  128. <el-image
  129. style="width: 60px; height: 60px;margin-left: 20px;"
  130. :src="form.basics.loginBanner"
  131. fit="cover"
  132. @click="addBasicsIcon('loginBanner')"
  133. >
  134. <div slot="error" class="image-slot" @click="addBasicsIcon('loginBanner')">
  135. <i class="el-icon-picture-outline"></i>
  136. </div>
  137. </el-image>
  138. </el-tooltip>
  139. </div>
  140. </div>
  141. <div class="editArea pa_a_eb_desktop" v-show="tagType == 'desktop'">
  142. <div class="ea_table">
  143. <el-table
  144. :data="form.desktop.list"
  145. stripe
  146. border
  147. style="width: 100%"
  148. :header-cell-style="headerCellStyle"
  149. >
  150. <el-table-column
  151. label="标识"
  152. min-width="100"
  153. show-overflow-tooltip
  154. >
  155. <template slot-scope="scope">{{
  156. scope.row.toolId ? scope.row.toolId : "-"
  157. }}</template>
  158. </el-table-column>
  159. <!-- <el-table-column
  160. label="宽度"
  161. min-width="45"
  162. show-overflow-tooltip
  163. >
  164. <template slot-scope="scope">{{
  165. scope.row.dialogWidth ? scope.row.dialogWidth : "-"
  166. }}</template>
  167. </el-table-column>
  168. <el-table-column
  169. label="高度"
  170. min-width="45"
  171. show-overflow-tooltip
  172. >
  173. <template slot-scope="scope">{{
  174. scope.row.dialogHeight ? scope.row.dialogHeight : "-"
  175. }}</template>
  176. </el-table-column> -->
  177. <el-table-column
  178. label="描述"
  179. min-width="200"
  180. show-overflow-tooltip
  181. >
  182. <template slot-scope="scope">{{
  183. scope.row.description ? scope.row.description : "-"
  184. }}</template>
  185. </el-table-column>
  186. <el-table-column
  187. label="工具设置"
  188. min-width="80"
  189. show-overflow-tooltip
  190. >
  191. <template slot-scope="scope">
  192. <el-popover placement="bottom" width="840" trigger="hover">
  193. <div class="urlItemBox">
  194. <div
  195. class="urlItem"
  196. v-for="(item, index) in scope.row.url"
  197. :key="scope.row.id + '-' + index"
  198. >
  199. <span>{{ item.region }}</span>
  200. <div class="ui_message">
  201. <div>名称:{{ item.name ? item.name : "-" }}</div>
  202. <div>
  203. <span>链接:</span
  204. ><a
  205. :href="item.url"
  206. v-if="item.url"
  207. target="_blank"
  208. >{{ item.url }}</a
  209. ><span v-else>-</span>
  210. </div>
  211. <div>
  212. <span>桌面图标:</span>
  213. <div class="ui_m_image">
  214. <el-image
  215. v-if="item.icon"
  216. style="width: 100%; height: 100%"
  217. :src="item.icon"
  218. fit="cover"
  219. ></el-image>
  220. <span v-else>-</span>
  221. </div>
  222. </div>
  223. <div>
  224. <span>平台图标:</span>
  225. <div class="ui_m_image">
  226. <el-image
  227. v-if="item.platformIcon"
  228. style="width: 100%; height: 100%"
  229. :src="item.platformIcon"
  230. fit="cover"
  231. ></el-image>
  232. <span v-else>-</span>
  233. </div>
  234. </div>
  235. <div>
  236. <span>默认图标:</span>
  237. <div class="ui_m_image">
  238. <el-image
  239. v-if="item.defaultIcon"
  240. style="width: 100%; height: 100%"
  241. :src="item.defaultIcon"
  242. fit="cover"
  243. ></el-image>
  244. <span v-else>-</span>
  245. </div>
  246. </div>
  247. <div>
  248. <span>激活图标:</span>
  249. <div class="ui_m_image">
  250. <el-image
  251. v-if="item.activeIcon"
  252. style="width: 100%; height: 100%"
  253. :src="item.activeIcon"
  254. fit="cover"
  255. ></el-image>
  256. <span v-else>-</span>
  257. </div>
  258. </div>
  259. <div>
  260. <span>hover图标:</span>
  261. <div class="ui_m_image">
  262. <el-image
  263. v-if="item.hoverIcon"
  264. style="width: 100%; height: 100%"
  265. :src="item.hoverIcon"
  266. fit="cover"
  267. ></el-image>
  268. <span v-else>-</span>
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. <el-button slot="reference" size="small"
  275. >查看设置</el-button
  276. >
  277. </el-popover>
  278. </template>
  279. </el-table-column>
  280. <el-table-column
  281. label="仅管理员显示"
  282. min-width="80"
  283. show-overflow-tooltip
  284. >
  285. <template slot-scope="scope">{{
  286. scope.row.isAdmin == "1" ? "是" : "否"
  287. }}</template>
  288. </el-table-column>
  289. <el-table-column
  290. label="操作"
  291. width="200px"
  292. show-overflow-tooltip
  293. >
  294. <template slot-scope="scope">
  295. <button
  296. @click="moveUp(scope.row)"
  297. v-if="scope.$index > 0"
  298. style="
  299. color: #308fff;
  300. background: none;
  301. border: none;
  302. cursor: pointer;
  303. margin-left: 25px;
  304. "
  305. >
  306. 上移
  307. </button>
  308. <button
  309. @click="moveDown(scope.row)"
  310. v-if="form.desktop.list.length - 1 > scope.$index"
  311. style="
  312. color: #308fff;
  313. background: none;
  314. border: none;
  315. cursor: pointer;
  316. margin-left: 25px;
  317. "
  318. >
  319. 下移
  320. </button>
  321. <button
  322. @click="del(scope.row)"
  323. style="
  324. color: #ff2570;
  325. background: none;
  326. border: none;
  327. cursor: pointer;
  328. margin-left: 25px;
  329. "
  330. >
  331. 删除
  332. </button>
  333. </template>
  334. </el-table-column>
  335. </el-table>
  336. </div>
  337. </div>
  338. <div class="editArea appList" v-show="tagType == 'admin-cocoFlow'">
  339. <template v-if="form.admin.cocoFlow">
  340. <div
  341. class="appItem"
  342. v-for="(item,index) in form.admin.cocoFlow"
  343. :key="item.id"
  344. >
  345. <div class="ai_left">
  346. <el-image
  347. style="width: 100%; height: 100%"
  348. :src="item.json.icon"
  349. fit="cover"
  350. ></el-image>
  351. </div>
  352. <div class="ai_right">
  353. <div>{{ item.name }}</div>
  354. <div class="ai_r_btn">
  355. <svg @click="moveApp(item.id,0)" v-if="index!=0" t="1744598539024" class="icon" viewBox="0 0 1470 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2613" width="200" height="200"><path d="M664.965051 36.390373L20.010522 880.212016c-44.471546 58.191134-2.978155 142.114864 70.271066 142.114863h1289.8254c73.232489 0 114.725879-83.923729 70.271065-142.114863L805.473719 36.390373a88.441155 88.441155 0 0 0-140.508668 0z" p-id="2614"></path></svg>
  356. <svg @click="moveApp(item.id,1)" v-if="index!=(form.admin.cocoFlow.length-1)" style="transform: rotate(180deg);" t="1744598539024" class="icon" viewBox="0 0 1470 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2613" width="200" height="200"><path d="M664.965051 36.390373L20.010522 880.212016c-44.471546 58.191134-2.978155 142.114864 70.271066 142.114863h1289.8254c73.232489 0 114.725879-83.923729 70.271065-142.114863L805.473719 36.390373a88.441155 88.441155 0 0 0-140.508668 0z" p-id="2614"></path></svg>
  357. </div>
  358. <span>{{ item.detail }}</span>
  359. </div>
  360. </div>
  361. </template>
  362. </div>
  363. <div
  364. class="editArea pa_a_eb_admin-index"
  365. v-show="tagType == 'admin-index'"
  366. >
  367. <div class="ea_table">
  368. <el-table
  369. :data="form.admin.index.list"
  370. stripe
  371. border
  372. style="width: 100%"
  373. :header-cell-style="headerCellStyle"
  374. >
  375. <el-table-column
  376. label="标识"
  377. min-width="100"
  378. show-overflow-tooltip
  379. >
  380. <template slot-scope="scope">{{
  381. scope.row.toolId ? scope.row.toolId : "-"
  382. }}</template>
  383. </el-table-column>
  384. <!-- <el-table-column
  385. label="宽度"
  386. min-width="45"
  387. show-overflow-tooltip
  388. >
  389. <template slot-scope="scope">{{
  390. scope.row.dialogWidth ? scope.row.dialogWidth : "-"
  391. }}</template>
  392. </el-table-column>
  393. <el-table-column
  394. label="高度"
  395. min-width="45"
  396. show-overflow-tooltip
  397. >
  398. <template slot-scope="scope">{{
  399. scope.row.dialogHeight ? scope.row.dialogHeight : "-"
  400. }}</template>
  401. </el-table-column> -->
  402. <el-table-column
  403. label="描述"
  404. min-width="200"
  405. show-overflow-tooltip
  406. >
  407. <template slot-scope="scope">{{
  408. scope.row.description ? scope.row.description : "-"
  409. }}</template>
  410. </el-table-column>
  411. <el-table-column
  412. label="工具设置"
  413. min-width="80"
  414. show-overflow-tooltip
  415. >
  416. <template slot-scope="scope">
  417. <el-popover placement="bottom" width="840" trigger="hover">
  418. <div class="urlItemBox">
  419. <div
  420. class="urlItem"
  421. v-for="(item, index) in scope.row.url"
  422. :key="scope.row.id + '-' + index"
  423. >
  424. <span>{{ item.region }}</span>
  425. <div class="ui_message">
  426. <div>名称:{{ item.name ? item.name : "-" }}</div>
  427. <div>
  428. <span>链接:</span
  429. ><a
  430. :href="item.url"
  431. v-if="item.url"
  432. target="_blank"
  433. >{{ item.url }}</a
  434. ><span v-else>-</span>
  435. </div>
  436. <div>
  437. <span>桌面图标:</span>
  438. <div class="ui_m_image">
  439. <el-image
  440. v-if="item.icon"
  441. style="width: 100%; height: 100%"
  442. :src="item.icon"
  443. fit="cover"
  444. ></el-image>
  445. <span v-else>-</span>
  446. </div>
  447. </div>
  448. <div>
  449. <span>平台图标:</span>
  450. <div class="ui_m_image">
  451. <el-image
  452. v-if="item.platformIcon"
  453. style="width: 100%; height: 100%"
  454. :src="item.platformIcon"
  455. fit="cover"
  456. ></el-image>
  457. <span v-else>-</span>
  458. </div>
  459. </div>
  460. <div>
  461. <span>默认图标:</span>
  462. <div class="ui_m_image">
  463. <el-image
  464. v-if="item.defaultIcon"
  465. style="width: 100%; height: 100%"
  466. :src="item.defaultIcon"
  467. fit="cover"
  468. ></el-image>
  469. <span v-else>-</span>
  470. </div>
  471. </div>
  472. <div>
  473. <span>激活图标:</span>
  474. <div class="ui_m_image">
  475. <el-image
  476. v-if="item.activeIcon"
  477. style="width: 100%; height: 100%"
  478. :src="item.activeIcon"
  479. fit="cover"
  480. ></el-image>
  481. <span v-else>-</span>
  482. </div>
  483. </div>
  484. <div>
  485. <span>hover图标:</span>
  486. <div class="ui_m_image">
  487. <el-image
  488. v-if="item.hoverIcon"
  489. style="width: 100%; height: 100%"
  490. :src="item.hoverIcon"
  491. fit="cover"
  492. ></el-image>
  493. <span v-else>-</span>
  494. </div>
  495. </div>
  496. </div>
  497. </div>
  498. </div>
  499. <el-button slot="reference" size="small"
  500. >查看设置</el-button
  501. >
  502. </el-popover>
  503. </template>
  504. </el-table-column>
  505. <el-table-column
  506. label="仅管理员显示"
  507. min-width="80"
  508. show-overflow-tooltip
  509. >
  510. <template slot-scope="scope">{{
  511. scope.row.isAdmin == "1" ? "是" : "否"
  512. }}</template>
  513. </el-table-column>
  514. <el-table-column
  515. label="操作"
  516. width="200px"
  517. show-overflow-tooltip
  518. >
  519. <template slot-scope="scope">
  520. <button
  521. @click="moveUp(scope.row)"
  522. v-if="scope.$index > 0"
  523. style="
  524. color: #308fff;
  525. background: none;
  526. border: none;
  527. cursor: pointer;
  528. margin-left: 25px;
  529. "
  530. >
  531. 上移
  532. </button>
  533. <button
  534. @click="moveDown(scope.row)"
  535. v-if="form.admin.index.list.length - 1 > scope.$index"
  536. style="
  537. color: #308fff;
  538. background: none;
  539. border: none;
  540. cursor: pointer;
  541. margin-left: 25px;
  542. "
  543. >
  544. 下移
  545. </button>
  546. <button
  547. @click="del(scope.row)"
  548. style="
  549. color: #ff2570;
  550. background: none;
  551. border: none;
  552. cursor: pointer;
  553. margin-left: 25px;
  554. "
  555. >
  556. 删除
  557. </button>
  558. </template>
  559. </el-table-column>
  560. </el-table>
  561. </div>
  562. </div>
  563. <div
  564. class="editArea pa_a_eb_admin-sidebar"
  565. v-show="tagType == 'admin-sidebar'"
  566. >
  567. <div class="ea_table">
  568. <el-table
  569. :data="form.admin.sidebar.list"
  570. stripe
  571. border
  572. style="width: 100%"
  573. row-key="typeId"
  574. :header-cell-style="headerCellStyle"
  575. :tree-props="{
  576. children: 'children',
  577. hasChildren: 'hasChildren',
  578. }"
  579. >
  580. <el-table-column
  581. label="标识"
  582. min-width="100"
  583. show-overflow-tooltip
  584. >
  585. <template slot-scope="scope">{{
  586. scope.row.toolId ? scope.row.toolId : "-"
  587. }}</template>
  588. </el-table-column>
  589. <el-table-column
  590. label="描述"
  591. min-width="200"
  592. show-overflow-tooltip
  593. >
  594. <template slot-scope="scope">{{
  595. scope.row.description ? scope.row.description : "-"
  596. }}</template>
  597. </el-table-column>
  598. <el-table-column
  599. label="菜单名称"
  600. min-width="200"
  601. show-overflow-tooltip
  602. >
  603. <template slot-scope="scope">{{
  604. scope.row.menuName ? scope.row.menuName : "-"
  605. }}</template>
  606. </el-table-column>
  607. <el-table-column
  608. label="菜单默认图标"
  609. min-width="200"
  610. show-overflow-tooltip
  611. >
  612. <template slot-scope="scope">
  613. <el-image
  614. v-if="scope.row.menuIcon"
  615. style="width: 50px; height: 50px"
  616. :src="scope.row.menuIcon"
  617. fit="cover"
  618. >
  619. <div slot="error" class="image-slot">
  620. <i class="el-icon-picture-outline"></i>
  621. </div>
  622. </el-image>
  623. <span v-else>-</span>
  624. </template>
  625. </el-table-column>
  626. <el-table-column
  627. label="菜单激活图标"
  628. min-width="200"
  629. show-overflow-tooltip
  630. >
  631. <template slot-scope="scope">
  632. <el-image
  633. v-if="scope.row.menuActiveIcon"
  634. style="width: 50px; height: 50px"
  635. :src="scope.row.menuActiveIcon"
  636. fit="cover"
  637. >
  638. <div slot="error" class="image-slot">
  639. <i class="el-icon-picture-outline"></i>
  640. </div>
  641. </el-image>
  642. <span v-else>-</span>
  643. </template>
  644. </el-table-column>
  645. <el-table-column
  646. label="工具设置"
  647. min-width="110"
  648. show-overflow-tooltip
  649. >
  650. <template slot-scope="scope">
  651. <el-popover
  652. placement="bottom"
  653. width="840"
  654. trigger="hover"
  655. v-if="scope.row.url"
  656. >
  657. <div class="urlItemBox">
  658. <div
  659. class="urlItem"
  660. v-for="(item, index) in scope.row.url"
  661. :key="scope.row.id + '-' + index"
  662. >
  663. <span>{{ item.region }}</span>
  664. <div class="ui_message">
  665. <div>名称:{{ item.name ? item.name : "-" }}</div>
  666. <div>
  667. <span>链接:</span
  668. ><a
  669. :href="item.url"
  670. v-if="item.url"
  671. target="_blank"
  672. >{{ item.url }}</a
  673. ><span v-else>-</span>
  674. </div>
  675. <div>
  676. <span>桌面图标:</span>
  677. <div class="ui_m_image">
  678. <el-image
  679. v-if="item.icon"
  680. style="width: 100%; height: 100%"
  681. :src="item.icon"
  682. fit="cover"
  683. ></el-image>
  684. <span v-else>-</span>
  685. </div>
  686. </div>
  687. <div>
  688. <span>平台图标:</span>
  689. <div class="ui_m_image">
  690. <el-image
  691. v-if="item.platformIcon"
  692. style="width: 100%; height: 100%"
  693. :src="item.platformIcon"
  694. fit="cover"
  695. ></el-image>
  696. <span v-else>-</span>
  697. </div>
  698. </div>
  699. <div>
  700. <span>默认图标:</span>
  701. <div class="ui_m_image">
  702. <el-image
  703. v-if="item.defaultIcon"
  704. style="width: 100%; height: 100%"
  705. :src="item.defaultIcon"
  706. fit="cover"
  707. ></el-image>
  708. <span v-else>-</span>
  709. </div>
  710. </div>
  711. <div>
  712. <span>激活图标:</span>
  713. <div class="ui_m_image">
  714. <el-image
  715. v-if="item.activeIcon"
  716. style="width: 100%; height: 100%"
  717. :src="item.activeIcon"
  718. fit="cover"
  719. ></el-image>
  720. <span v-else>-</span>
  721. </div>
  722. </div>
  723. <div>
  724. <span>hover图标:</span>
  725. <div class="ui_m_image">
  726. <el-image
  727. v-if="item.hoverIcon"
  728. style="width: 100%; height: 100%"
  729. :src="item.hoverIcon"
  730. fit="cover"
  731. ></el-image>
  732. <span v-else>-</span>
  733. </div>
  734. </div>
  735. </div>
  736. </div>
  737. </div>
  738. <el-button slot="reference" size="small"
  739. >查看设置</el-button
  740. >
  741. </el-popover>
  742. <span v-else>-</span>
  743. </template>
  744. </el-table-column>
  745. <el-table-column
  746. label="仅管理员显示"
  747. min-width="80"
  748. show-overflow-tooltip
  749. >
  750. <template slot-scope="scope">
  751. <span v-if="scope.row.isAdmin">{{
  752. scope.row.isAdmin == "1" ? "是" : "否"
  753. }}</span>
  754. <span v-else>-</span>
  755. </template>
  756. </el-table-column>
  757. <el-table-column
  758. label="操作"
  759. width="320px"
  760. fixed="right"
  761. show-overflow-tooltip
  762. >
  763. <template slot-scope="scope">
  764. <button
  765. @click="addToolSidebar(scope.row.id)"
  766. v-if="scope.row.menuName"
  767. style="
  768. color: #308fff;
  769. background: none;
  770. border: none;
  771. cursor: pointer;
  772. margin-left: 25px;
  773. "
  774. >
  775. 添加工具
  776. </button>
  777. <button
  778. @click="editMenu(scope.row)"
  779. v-if="scope.row.menuName"
  780. style="
  781. color: #308fff;
  782. background: none;
  783. border: none;
  784. cursor: pointer;
  785. margin-left: 25px;
  786. "
  787. >
  788. 修改
  789. </button>
  790. <button
  791. @click="moveUp(scope.row, scope.row.typeId)"
  792. style="
  793. color: #308fff;
  794. background: none;
  795. border: none;
  796. cursor: pointer;
  797. margin-left: 25px;
  798. "
  799. >
  800. 上移
  801. </button>
  802. <button
  803. @click="moveDown(scope.row, scope.row.typeId)"
  804. style="
  805. color: #308fff;
  806. background: none;
  807. border: none;
  808. cursor: pointer;
  809. margin-left: 25px;
  810. "
  811. >
  812. 下移
  813. </button>
  814. <button
  815. @click="del(scope.row, scope.row.typeId)"
  816. style="
  817. color: #ff2570;
  818. background: none;
  819. border: none;
  820. cursor: pointer;
  821. margin-left: 25px;
  822. "
  823. >
  824. 删除
  825. </button>
  826. </template>
  827. </el-table-column>
  828. </el-table>
  829. </div>
  830. </div>
  831. </div>
  832. </div>
  833. <!-- 按钮区域 -->
  834. <div slot="footer" class="el-dialog__footer">
  835. <el-button @click="close()">取 消</el-button>
  836. <el-button type="primary" @click="submit()">确认</el-button>
  837. </div>
  838. </el-dialog>
  839. <selectToolDialog ref="selectToolDialogRef" @success="selectToolSuccess" />
  840. <addMenuDialog ref="addMenuDialogRef" @success="addMenuSuccess" />
  841. <selectAppDialog ref="selectAppDialogRef" @success="selectAppSuccess" />
  842. </div>
  843. </template>
  844. <script>
  845. import "@/common/aws-sdk-2.235.1.min.js";
  846. import selectToolDialog from "./selectToolDialog.vue";
  847. import { API_CONFIG } from "@/common/apiConfig";
  848. import addMenuDialog from "./addMenuDialog.vue";
  849. import { addOp } from "@/api/user";
  850. import { mapGetters } from "vuex";
  851. import selectAppDialog from "./selectAppDialog.vue";
  852. export default {
  853. components: {
  854. selectToolDialog,
  855. addMenuDialog,
  856. selectAppDialog,
  857. },
  858. computed: {
  859. ...mapGetters(["userid"]),
  860. },
  861. data() {
  862. return {
  863. show: false,
  864. loading: false,
  865. data: null,
  866. type: null,
  867. tagType: "basics",
  868. addToolIndex: null,
  869. toolList: [],
  870. appList: [],
  871. form: {
  872. basics: {
  873. title: "",
  874. brief: "",
  875. logo: "",
  876. },
  877. //桌面 管理平台首页 管理平台侧边栏
  878. desktop: {
  879. list: [],
  880. },
  881. admin: {
  882. index: {
  883. list: [],
  884. cocoFlow: [],
  885. },
  886. sidebar: {
  887. list: [],
  888. },
  889. },
  890. },
  891. };
  892. },
  893. methods: {
  894. open(data, type) {
  895. this.init();
  896. let _data = JSON.parse(JSON.stringify(data));
  897. if (_data.json) {
  898. this.form = JSON.parse(_data.json);
  899. }
  900. // this.getToolData();
  901. Promise.all([this.getToolData(), this.getAppData()])
  902. .then(() => {
  903. // console.log(JSON.parse(JSON.stringify([this.toolList,this.appList])))
  904. this.setDataListToo(this.toolList, this.appList);
  905. })
  906. .catch((e) => {
  907. console.log("👉", e);
  908. });
  909. this.data = _data;
  910. this.type = type;
  911. this.show = true;
  912. },
  913. close() {
  914. this.show = false;
  915. this.init();
  916. },
  917. init() {
  918. this.form = {
  919. basics: {
  920. title: "",
  921. brief: "",
  922. logo: "",
  923. loginLogo:"",
  924. loginBanner:"",
  925. },
  926. //桌面 管理平台首页 管理平台侧边栏
  927. desktop: {
  928. list: [],
  929. },
  930. admin: {
  931. index: {
  932. list: [],
  933. cocoFlow: [],
  934. },
  935. sidebar: {
  936. list: [],
  937. },
  938. },
  939. };
  940. this.type = null;
  941. this.data = null;
  942. this.tagType = "basics";
  943. },
  944. submit() {
  945. // this.close();
  946. console.log(this.form);
  947. this.setJson();
  948. },
  949. async addBasicsIcon(type='logo') {
  950. let _url = await this.uploadFile("image/*");
  951. if (_url) {
  952. this.form.basics[type] = _url;
  953. this.$forceUpdate()
  954. console.log(this.form)
  955. await addOp({
  956. uid: this.userid,
  957. cid: this.data.id,
  958. type: "user_op",
  959. content: `修改了${this.data.name}的基本信息的${type}`,
  960. });
  961. } else {
  962. return console.log("无图片");
  963. }
  964. },
  965. uploadFile(accept = "*") {
  966. return new Promise((resolve) => {
  967. const input = document.createElement("input");
  968. input.type = "file";
  969. input.accept = accept;
  970. input.onchange = (event) => {
  971. const file = event.target.files[0];
  972. if (file) {
  973. let credentials = {
  974. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  975. secretAccessKey: "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",
  976. }; //秘钥形式的登录上传
  977. window.AWS.config.update(credentials);
  978. window.AWS.config.region = "cn-northwest-1"; //设置区域
  979. let bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
  980. // let _name = file.name;
  981. // let size = file.size;
  982. let params = {
  983. Key:
  984. file.name.split(".")[0] +
  985. new Date().getTime() +
  986. "." +
  987. file.name.split(".")[file.name.split(".").length - 1],
  988. ContentType: file.type,
  989. Body: file,
  990. "Access-Control-Allow-Credentials": "*",
  991. ACL: "public-read",
  992. }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
  993. let options = {
  994. partSize: 2048 * 1024 * 1024,
  995. queueSize: 2,
  996. leavePartsOnError: true,
  997. };
  998. bucket
  999. .upload(params, options)
  1000. .on("httpUploadProgress", (evt) => {
  1001. console.log(evt);
  1002. })
  1003. .send((err, data) => {
  1004. if (err) {
  1005. this.$message.error("上传失败");
  1006. return resolve("");
  1007. } else {
  1008. return resolve(data.Location);
  1009. }
  1010. });
  1011. } else {
  1012. resolve("");
  1013. }
  1014. };
  1015. input.click();
  1016. });
  1017. },
  1018. changeTagType(newType) {
  1019. this.tagType = newType;
  1020. },
  1021. addTool(type) {
  1022. let selectList = [];
  1023. if (type == "desktop") selectList = this.form.desktop.list;
  1024. if (type == "admin-index") selectList = this.form.admin.index.list;
  1025. if (type == "admin-sidebar") selectList = this.form.admin.sidebar.list;
  1026. this.$refs.selectToolDialogRef.open(
  1027. selectList,
  1028. type,
  1029. ["admin-index", "admin-sidebar"].includes(type)
  1030. ? this.form.desktop.list
  1031. : []
  1032. );
  1033. },
  1034. async selectToolSuccess([_list, type]) {
  1035. console.log(type, "===", _list);
  1036. let list = _list;
  1037. if (type == "desktop") {
  1038. this.form.desktop.list = list;
  1039. this.$refs.selectToolDialogRef.close();
  1040. await addOp({
  1041. uid: this.userid,
  1042. cid: this.data.id,
  1043. type: "user_op",
  1044. content: `修改了${this.data.name}的桌面端工具`,
  1045. });
  1046. } else if (type == "admin-index") {
  1047. this.form.admin.index.list = list;
  1048. this.$refs.selectToolDialogRef.close();
  1049. await addOp({
  1050. uid: this.userid,
  1051. cid: this.data.id,
  1052. type: "user_op",
  1053. content: `修改了${this.data.name}的平台首页工具`,
  1054. });
  1055. } else if (type == "admin-sidebar" || type == "admin-sidebar2") {
  1056. if (this.addToolIndex != null) {
  1057. let _index = this.form.admin.sidebar.list.findIndex(
  1058. (i) => i.id == this.addToolIndex
  1059. );
  1060. if (_index == -1) return this.$message.error("未找到对应的菜单");
  1061. list.forEach((i) => (i.typeId = this.addToolIndex + "," + i.id));
  1062. this.form.admin.sidebar.list[_index].children.push(
  1063. ...JSON.parse(JSON.stringify(list))
  1064. );
  1065. this.addToolIndex = null;
  1066. } else {
  1067. list.forEach((i) => (i.typeId = i.id));
  1068. this.form.admin.sidebar.list.push(
  1069. ...JSON.parse(JSON.stringify(list))
  1070. );
  1071. }
  1072. await addOp({
  1073. uid: this.userid,
  1074. cid: this.data.id,
  1075. type: "user_op",
  1076. content: `修改了${this.data.name}的平台侧边栏工具`,
  1077. });
  1078. this.$refs.selectToolDialogRef.close();
  1079. }
  1080. this.$forceUpdate();
  1081. },
  1082. // 表头的背景色
  1083. headerCellStyle() {
  1084. return { backgroundColor: "#f1f1f1" };
  1085. },
  1086. moveUp(row, typeId) {
  1087. console.log(typeId);
  1088. if (this.tagType == "desktop") {
  1089. let _index = this.form.desktop.list.findIndex((i) => i.id == row.id);
  1090. if (_index > 0) {
  1091. const itemToMove = this.form.desktop.list.splice(_index, 1)[0];
  1092. this.form.desktop.list.splice(_index - 1, 0, itemToMove);
  1093. }
  1094. } else if (this.tagType == "admin-index") {
  1095. let _index = this.form.admin.index.list.findIndex(
  1096. (i) => i.id == row.id
  1097. );
  1098. if (_index > 0) {
  1099. const itemToMove = this.form.admin.index.list.splice(_index, 1)[0];
  1100. this.form.admin.index.list.splice(_index - 1, 0, itemToMove);
  1101. }
  1102. } else if (this.tagType == "admin-sidebar") {
  1103. let typeIdList = typeId.split(",");
  1104. console.log(typeIdList);
  1105. if (typeIdList.length == 1) {
  1106. let _index = this.form.admin.sidebar.list.findIndex(
  1107. (i) => i.typeId == typeIdList[0]
  1108. );
  1109. if (_index > 0) {
  1110. const itemToMove = this.form.admin.sidebar.list.splice(
  1111. _index,
  1112. 1
  1113. )[0];
  1114. this.form.admin.sidebar.list.splice(_index - 1, 0, itemToMove);
  1115. }
  1116. } else if (typeIdList.length == 2) {
  1117. let _index = this.form.admin.sidebar.list.findIndex(
  1118. (i) => i.typeId == typeIdList[0]
  1119. );
  1120. let _index2 = this.form.admin.sidebar.list[_index].children.findIndex(
  1121. (i) => i.id == typeIdList[1]
  1122. );
  1123. console.log(_index2);
  1124. if (_index2 > 0) {
  1125. const itemToMove = this.form.admin.sidebar.list[
  1126. _index
  1127. ].children.splice(_index2, 1)[0];
  1128. this.form.admin.sidebar.list[_index].children.splice(
  1129. _index2 - 1,
  1130. 0,
  1131. itemToMove
  1132. );
  1133. }
  1134. }
  1135. }
  1136. },
  1137. moveDown(row, typeId) {
  1138. console.log(typeId);
  1139. if (this.tagType == "desktop") {
  1140. let _index = this.form.desktop.list.findIndex((i) => i.id == row.id);
  1141. if (_index < this.form.desktop.list.length - 1) {
  1142. const itemToMove = this.form.desktop.list.splice(_index, 1)[0];
  1143. this.form.desktop.list.splice(_index + 1, 0, itemToMove);
  1144. }
  1145. } else if (this.tagType == "admin-index") {
  1146. let _index = this.form.admin.index.list.findIndex(
  1147. (i) => i.id == row.id
  1148. );
  1149. if (_index < this.form.admin.index.list.length - 1) {
  1150. const itemToMove = this.form.admin.index.list.splice(_index, 1)[0];
  1151. this.form.admin.index.list.splice(_index + 1, 0, itemToMove);
  1152. }
  1153. } else if (this.tagType == "admin-sidebar") {
  1154. let typeIdList = typeId.split(",");
  1155. if (typeIdList.length == 1) {
  1156. let _index = this.form.admin.sidebar.list.findIndex(
  1157. (i) => i.typeId == typeIdList[0]
  1158. );
  1159. if (_index < this.form.admin.sidebar.list.length - 1) {
  1160. const itemToMove = this.form.admin.sidebar.list.splice(
  1161. _index,
  1162. 1
  1163. )[0];
  1164. this.form.admin.sidebar.list.splice(_index + 1, 0, itemToMove);
  1165. }
  1166. } else if (typeIdList.length == 2) {
  1167. let _index = this.form.admin.sidebar.list.findIndex(
  1168. (i) => i.typeId == typeIdList[0]
  1169. );
  1170. let _index2 = this.form.admin.sidebar.list[_index].children.findIndex(
  1171. (i) => i.id == typeIdList[1]
  1172. );
  1173. if (
  1174. _index2 <
  1175. this.form.admin.sidebar.list[_index].children.length - 1
  1176. ) {
  1177. const itemToMove = this.form.admin.sidebar.list[
  1178. _index
  1179. ].children.splice(_index2, 1)[0];
  1180. this.form.admin.sidebar.list[_index].children.splice(
  1181. _index2 + 1,
  1182. 0,
  1183. itemToMove
  1184. );
  1185. }
  1186. }
  1187. }
  1188. },
  1189. del(row, typeId) {
  1190. if (this.tagType == "desktop") {
  1191. const index = this.form.desktop.list.findIndex((i) => i.id === row.id);
  1192. if (index > -1) {
  1193. this.form.desktop.list.splice(index, 1);
  1194. }
  1195. } else if (this.tagType == "admin-index") {
  1196. const index = this.form.admin.index.list.findIndex(
  1197. (i) => i.id === row.id
  1198. );
  1199. if (index > -1) {
  1200. this.form.admin.index.list.splice(index, 1);
  1201. }
  1202. } else if (this.tagType == "admin-sidebar") {
  1203. let typeIdList = typeId.split(",");
  1204. if (typeIdList.length == 1) {
  1205. let _index = this.form.admin.sidebar.list.findIndex(
  1206. (i) => i.typeId == typeIdList[0]
  1207. );
  1208. this.form.admin.sidebar.list.splice(_index, 1);
  1209. } else if (typeIdList.length == 2) {
  1210. let _index = this.form.admin.sidebar.list.findIndex(
  1211. (i) => i.typeId == typeIdList[0]
  1212. );
  1213. let _index2 = this.form.admin.sidebar.list[_index].children.findIndex(
  1214. (i) => i.typeId == typeIdList[1]
  1215. );
  1216. this.form.admin.sidebar.list[_index].children.splice(_index2, 1);
  1217. }
  1218. // this.form.admin.sidebar.list.splice(_index, 1);
  1219. }
  1220. },
  1221. getToolData() {
  1222. return new Promise((resolve) => {
  1223. let params = [
  1224. {
  1225. functionName: "select_desktopToolByPage",
  1226. status: "",
  1227. page: 1,
  1228. lim: 9999999,
  1229. },
  1230. ];
  1231. this.loading = true;
  1232. this.$ajax
  1233. .post(API_CONFIG.baseUrl, params)
  1234. .then((res) => {
  1235. let _data = res.data;
  1236. let _list = _data[0];
  1237. _list.forEach((i) => {
  1238. i.url = JSON.parse(i.url);
  1239. i.json = JSON.parse(i.json);
  1240. i.argumentList = JSON.parse(i.argumentList);
  1241. });
  1242. this.toolList = _list;
  1243. this.loading = false;
  1244. resolve(_list);
  1245. })
  1246. .catch((err) => {
  1247. console.log(err);
  1248. this.loading = false;
  1249. this.$message.error("获取工具数据失败");
  1250. this.close();
  1251. });
  1252. });
  1253. },
  1254. getAppData() {
  1255. return new Promise((resolve) => {
  1256. let params = [
  1257. {
  1258. functionName: "select_schUsuallyApp",
  1259. userid: "",
  1260. stand: "cn",
  1261. },
  1262. ];
  1263. this.loading = true;
  1264. this.$ajax
  1265. .post(API_CONFIG.baseUrl, params)
  1266. .then((res) => {
  1267. let _data = res.data;
  1268. let _list = _data[0];
  1269. _list.forEach((i) => {
  1270. i.json = JSON.parse(i.json);
  1271. });
  1272. this.appList = _list;
  1273. this.loading = false;
  1274. resolve(_list);
  1275. })
  1276. .catch((err) => {
  1277. console.log(err);
  1278. this.loading = false;
  1279. this.$message.error("获取应用数据失败");
  1280. this.close();
  1281. });
  1282. });
  1283. },
  1284. setJson() {
  1285. let _form = JSON.parse(JSON.stringify(this.form));
  1286. _form.desktop.list = _form.desktop.list.map((i) => i.id);
  1287. _form.admin.index.list = _form.admin.index.list.map((i) => i.id);
  1288. _form.admin.sidebar.list.forEach((i, index) => {
  1289. if (i.children) {
  1290. _form.admin.sidebar.list[index].children = i.children.map(
  1291. (i) => i.id
  1292. );
  1293. } else {
  1294. _form.admin.sidebar.list[index] = i.id;
  1295. }
  1296. });
  1297. _form.admin.cocoFlow = _form.admin.cocoFlow
  1298. ? _form.admin.cocoFlow.map((i) => i.id)
  1299. : [];
  1300. let params = [
  1301. {
  1302. functionName: "update_orgOroid_json_byId",
  1303. id: this.data.id,
  1304. ujson: JSON.stringify(_form),
  1305. type: this.type,
  1306. },
  1307. ];
  1308. console.log(_form);
  1309. this.loading = true;
  1310. this.$ajax
  1311. .post(API_CONFIG.baseUrl, params)
  1312. .then(async (res) => {
  1313. let _data = res.data;
  1314. if (_data == 1) {
  1315. this.$message.success("修改权限成功");
  1316. this.$emit("getData");
  1317. await addOp({
  1318. uid: this.userid,
  1319. cid: this.data.id,
  1320. type: "user_op",
  1321. content: `修改了${this.data.name}的权限设置`,
  1322. });
  1323. this.close();
  1324. } else {
  1325. this.$message.error("修改权限失败");
  1326. }
  1327. this.loading = false;
  1328. })
  1329. .catch((err) => {
  1330. console.log(err);
  1331. this.loading = false;
  1332. this.$message.error("修改权限失败");
  1333. });
  1334. },
  1335. setDataListToo(toolList = [], appList = []) {
  1336. let _form = JSON.parse(JSON.stringify(this.form));
  1337. _form.desktop.list.forEach((i, index) => {
  1338. let _index = toolList.findIndex((i2) => i == i2.id);
  1339. if (_index != -1) {
  1340. _form.desktop.list[index] = toolList[_index];
  1341. } else {
  1342. console.log("无工具", i);
  1343. }
  1344. });
  1345. if (_form.admin.cocoFlow) {
  1346. _form.admin.cocoFlow.forEach((i, index) => {
  1347. let _index = appList.findIndex((i2) => i == i2.id);
  1348. if (_index != -1) {
  1349. _form.admin.cocoFlow[index] = appList[_index];
  1350. } else {
  1351. console.log("无应用", i);
  1352. }
  1353. });
  1354. }
  1355. _form.admin.index.list.forEach((i, index) => {
  1356. let _index = toolList.findIndex((i2) => i == i2.id);
  1357. if (_index != -1) {
  1358. _form.admin.index.list[index] = toolList[_index];
  1359. } else {
  1360. console.log("无工具", i);
  1361. }
  1362. });
  1363. _form.admin.sidebar.list.forEach((i, index) => {
  1364. if (i.children) {
  1365. i.children.forEach((i2, index2) => {
  1366. let _toolList = JSON.parse(JSON.stringify(toolList));
  1367. let _index = _toolList.findIndex((i3) => i2 == i3.id);
  1368. if (_index != -1) {
  1369. _form.admin.sidebar.list[index].children[index2] =
  1370. _toolList[_index];
  1371. _form.admin.sidebar.list[index].children[index2].typeId =
  1372. _form.admin.sidebar.list[index].typeId +
  1373. "," +
  1374. _toolList[_index].id;
  1375. } else {
  1376. console.log("无工具", i);
  1377. }
  1378. });
  1379. } else {
  1380. let _toolList = JSON.parse(JSON.stringify(toolList));
  1381. let _index = _toolList.findIndex((i2) => i == i2.id);
  1382. if (_index != -1) {
  1383. _form.admin.sidebar.list[index] = _toolList[_index];
  1384. _form.admin.sidebar.list[index].typeId =
  1385. _form.admin.sidebar.list[index].id;
  1386. } else {
  1387. console.log("无工具", i);
  1388. }
  1389. }
  1390. });
  1391. this.form = _form;
  1392. this.$forceUpdate();
  1393. },
  1394. addToolSidebar(id) {
  1395. this.addToolIndex = id;
  1396. let index = this.form.admin.sidebar.list.findIndex((i) => i.id == id);
  1397. if (index == -1) return this.$message.error("未找到对应菜单");
  1398. let selectList = [];
  1399. selectList = this.form.admin.sidebar.list[index].children;
  1400. this.$refs.selectToolDialogRef.open(
  1401. selectList,
  1402. "admin-sidebar",
  1403. this.form.desktop.list
  1404. );
  1405. },
  1406. async addMenuSuccess({ item, type }) {
  1407. console.log(item, type);
  1408. if (type == "add") {
  1409. this.form.admin.sidebar.list.push(item);
  1410. item.id = String(new Date().getTime());
  1411. item.typeId = item.id;
  1412. await addOp({
  1413. uid: this.userid,
  1414. cid: "",
  1415. type: "user_op",
  1416. content: `添加了一级菜单:${item.menuName}`,
  1417. });
  1418. } else if (type == "edit") {
  1419. let _index = this.form.admin.sidebar.list.findIndex(
  1420. (i) => i.typeId == item.typeId
  1421. );
  1422. if (_index != -1) {
  1423. let _sidebar = JSON.parse(JSON.stringify(this.form.admin.sidebar));
  1424. _sidebar.list[_index] = item;
  1425. this.form.admin.sidebar = JSON.parse(JSON.stringify(_sidebar));
  1426. this.$forceUpdate();
  1427. await addOp({
  1428. uid: this.userid,
  1429. cid: "",
  1430. type: "user_op",
  1431. content: `修改了了一级菜单:${item.menuName}`,
  1432. });
  1433. }
  1434. }
  1435. this.$refs.addMenuDialogRef.close();
  1436. },
  1437. addMenu() {
  1438. this.$refs.addMenuDialogRef.open();
  1439. },
  1440. editMenu(row) {
  1441. this.$refs.addMenuDialogRef.open(row, "edit");
  1442. },
  1443. addApp() {
  1444. this.$refs.selectAppDialogRef.open({
  1445. select: this.form.admin.cocoFlow ? this.form.admin.cocoFlow : [],
  1446. });
  1447. },
  1448. moveApp(id,type){
  1449. let _index = this.form.admin.cocoFlow.findIndex(i=>i.id==id);
  1450. if(type == 0 && _index!=0){//上移
  1451. let temp = this.form.admin.cocoFlow[_index - 1];
  1452. this.form.admin.cocoFlow[_index - 1] = this.form.admin.cocoFlow[_index];
  1453. this.form.admin.cocoFlow[_index] = temp;
  1454. }else if(type == 1 && _index!=this.form.admin.cocoFlow.length-1){
  1455. let temp = this.form.admin.cocoFlow[_index + 1];
  1456. this.form.admin.cocoFlow[_index + 1] = this.form.admin.cocoFlow[_index];
  1457. this.form.admin.cocoFlow[_index] = temp;
  1458. }
  1459. this.$forceUpdate()
  1460. },
  1461. selectAppSuccess(data) {
  1462. this.form.admin.cocoFlow = JSON.parse(JSON.stringify(data));
  1463. this.$forceUpdate();
  1464. this.$refs.selectAppDialogRef.close();
  1465. },
  1466. },
  1467. };
  1468. </script>
  1469. <style scoped>
  1470. .permissionSettingDialog >>> .el-dialog__header {
  1471. padding: 15px 20px;
  1472. background: #454545;
  1473. }
  1474. .permissionSettingDialog >>> .el-dialog__title {
  1475. color: #fff;
  1476. }
  1477. .el-dialog__footer {
  1478. padding: 10px 0 0 10px;
  1479. }
  1480. .ps_area {
  1481. width: 100%;
  1482. height: 800px;
  1483. }
  1484. .pa_a_head {
  1485. width: 100%;
  1486. height: 40px;
  1487. display: flex;
  1488. align-items: center;
  1489. box-sizing: border-box;
  1490. overflow: auto;
  1491. border-bottom: 1px solid #e4e7ed;
  1492. }
  1493. .pa_a_head > span {
  1494. font-size: 16px;
  1495. display: block;
  1496. width: auto;
  1497. height: 100%;
  1498. padding: 0 20px;
  1499. display: flex;
  1500. justify-content: center;
  1501. align-items: center;
  1502. margin-right: 10px;
  1503. cursor: pointer;
  1504. transition: 0.2s;
  1505. white-space: nowrap;
  1506. }
  1507. .pa_a_h_active {
  1508. color: #409eff;
  1509. }
  1510. .pa_a_editBox {
  1511. width: 100%;
  1512. height: 100%;
  1513. overflow: auto;
  1514. }
  1515. .editArea {
  1516. width: 100%;
  1517. height: auto;
  1518. box-sizing: border-box;
  1519. }
  1520. .ea_basics_input {
  1521. width: 100%;
  1522. height: auto;
  1523. margin-top: 20px;
  1524. display: flex;
  1525. align-items: center;
  1526. }
  1527. .ea_basics_input > span {
  1528. display: block;
  1529. width: 60px;
  1530. height: auto;
  1531. }
  1532. .ea_basics_logo {
  1533. margin-top: 30px;
  1534. width: auto;
  1535. height: auto;
  1536. cursor: pointer;
  1537. display: flex;
  1538. align-items: center;
  1539. }
  1540. .ea_basics_logo > span {
  1541. display: block;
  1542. min-width: 80px;
  1543. }
  1544. .ea_basics_logo >>> .image-slot {
  1545. width: 100%;
  1546. height: 100%;
  1547. font-size: 22px;
  1548. display: flex;
  1549. justify-content: center;
  1550. align-items: center;
  1551. }
  1552. .ea_item {
  1553. width: 83px;
  1554. height: 83px;
  1555. margin: 10px;
  1556. display: flex;
  1557. align-items: center;
  1558. justify-content: center;
  1559. }
  1560. .pa_a_eb_desktop {
  1561. display: flex;
  1562. flex-direction: column;
  1563. padding: 0;
  1564. }
  1565. .ea_add {
  1566. width: 100%;
  1567. display: flex;
  1568. align-items: center;
  1569. justify-content: flex-end;
  1570. }
  1571. .urlItemBox {
  1572. display: flex;
  1573. flex-wrap: wrap;
  1574. }
  1575. .urlItem {
  1576. width: 400px;
  1577. height: 300px;
  1578. overflow: auto;
  1579. position: relative;
  1580. box-sizing: border-box;
  1581. border-bottom: solid 1px #ebeef5;
  1582. }
  1583. .urlItem:nth-child(2n) {
  1584. margin-left: 20px;
  1585. }
  1586. .urlItem > span {
  1587. font-size: 18px;
  1588. font-weight: bold;
  1589. }
  1590. .ui_m_image {
  1591. width: 40px;
  1592. height: 40px;
  1593. float: left;
  1594. display: flex;
  1595. align-items: center;
  1596. }
  1597. .ui_message > div {
  1598. display: flex;
  1599. align-items: center;
  1600. }
  1601. .ui_message > div > span {
  1602. white-space: nowrap;
  1603. }
  1604. .appList {
  1605. display: flex;
  1606. flex-wrap: wrap;
  1607. box-sizing: border-box;
  1608. padding-top:20px ;
  1609. }
  1610. .appItem {
  1611. width: 298px;
  1612. height: 100px;
  1613. background-color: white;
  1614. box-sizing: border-box;
  1615. border: solid 1px #f3f4f6;
  1616. padding: 10px;
  1617. border-radius: 8px;
  1618. cursor: pointer;
  1619. margin-bottom: 20px;
  1620. margin-right: 20px;
  1621. display: flex;
  1622. align-items: center;
  1623. justify-content: center;
  1624. transition: 0.3s;
  1625. }
  1626. .appActive {
  1627. border-color: #409eff;
  1628. box-shadow: 0px 6px 30px 5px #00000015;
  1629. }
  1630. .appItem:hover {
  1631. box-shadow: 0px 6px 30px 5px #00000015;
  1632. }
  1633. .ai_left {
  1634. width: 80px;
  1635. height: 80px;
  1636. box-sizing: border-box;
  1637. padding: 10px;
  1638. margin-right: 10px;
  1639. }
  1640. .ai_right {
  1641. width: calc(100% - 80px - 10px);
  1642. position: relative;
  1643. }
  1644. .ai_right > div {
  1645. max-width: calc( 100% - 50px);
  1646. font-weight: bold;
  1647. overflow: hidden;
  1648. white-space: nowrap;
  1649. text-overflow: ellipsis;
  1650. font-size: 16px;
  1651. color: #000;
  1652. margin-bottom: 10px;
  1653. }
  1654. .ai_r_btn{
  1655. width: auto;
  1656. display: flex;
  1657. position: absolute;
  1658. right: 0;
  1659. top: 0;
  1660. }
  1661. .ai_r_btn>svg{
  1662. width: 10px;
  1663. height: 10px;
  1664. margin-left: 15px;
  1665. cursor: pointer;
  1666. }
  1667. .ai_right > span {
  1668. font-size: 14px;
  1669. color: #00000099;
  1670. display: -webkit-box;
  1671. -webkit-box-orient: vertical;
  1672. -webkit-line-clamp: 2;
  1673. overflow: hidden;
  1674. text-overflow: ellipsis;
  1675. }
  1676. </style>