Setting.vue 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677
  1. <template>
  2. <div class="setting" v-if="info">
  3. <template v-if="!settingFlag">
  4. <div class="setting-top">
  5. <div class="avator-box">
  6. <el-image
  7. :src="
  8. info.sys_user && info.sys_user.image_url
  9. ? info.sys_user.image_url
  10. : info.image_url
  11. ? info.image_url
  12. : require('../assets/avatar.png')
  13. "
  14. fit="cover"
  15. style="width: 96px; height: 96px"
  16. >
  17. </el-image>
  18. <a class="img-crop" v-if="page !== 'personCheck'">
  19. <upload
  20. :datafileList="infoForm.cover_image_list"
  21. :filleNumber="99"
  22. :changeFillId="handleAvatarSuccess"
  23. :fileName="'cover'"
  24. :showList="true"
  25. uploadType="image"
  26. />
  27. </a>
  28. </div>
  29. <div class="center">
  30. <div class="info-items">
  31. <label>用户名:</label>
  32. <span>{{
  33. page === "editPerson" || page === "personal"
  34. ? info.sys_user.user_name
  35. : info.user_name
  36. }}</span>
  37. </div>
  38. <div class="info-items">
  39. <label>手机号码:</label>
  40. <span>{{
  41. (page === "editPerson" || page === "personal") &&
  42. info.sys_user.phone
  43. ? info.sys_user.phone.substring(0, 3) +
  44. "******" +
  45. info.sys_user.phone.substring(9, 11)
  46. : info.phone
  47. ? info.phone.substring(0, 3) +
  48. "******" +
  49. info.phone.substring(9, 11)
  50. : "-"
  51. }}</span>
  52. </div>
  53. <div class="info-items">
  54. <label>账号ID:</label>
  55. <span>{{
  56. page === "editPerson" || page === "personal"
  57. ? info.sys_user.id
  58. : info.id
  59. }}</span>
  60. </div>
  61. <div class="info-items">
  62. <label>邮箱:</label>
  63. <span>{{
  64. (page === "editPerson" || page === "personal") &&
  65. info.sys_user.email
  66. ? info.sys_user.email
  67. : info.email
  68. ? info.email
  69. : "-"
  70. }}</span>
  71. </div>
  72. <div class="info-items">
  73. <label>{{
  74. page === "editPerson" || page === "personal"
  75. ? "创建时间:"
  76. : "注册时间:"
  77. }}</label>
  78. <span>{{
  79. page === "editPerson" || page === "personal"
  80. ? info.sys_user.create_time
  81. : info.register_time
  82. }}</span>
  83. </div>
  84. <div
  85. class="info-items"
  86. v-if="page === 'editOrgPerson' || page === 'personCheck'"
  87. >
  88. <label>机构:</label>
  89. <span>{{ info.org_name }}</span>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="setting-bottom">
  94. <div class="tabs-box">
  95. <a
  96. :class="[tabsIndex === 0 ? 'active' : '']"
  97. @click="handleChangeTabs(0)"
  98. >基本信息</a
  99. >
  100. <a
  101. :class="[tabsIndex === 1 ? 'active' : '']"
  102. @click="handleChangeTabs(1)"
  103. v-if="page !== 'personCheck'"
  104. >安全设置</a
  105. >
  106. <a
  107. :class="[tabsIndex === 2 ? 'active' : '']"
  108. @click="handleChangeTabs(2)"
  109. v-if="page !== 'personCheck'"
  110. >{{
  111. page === "editPerson" || page === "personal"
  112. ? "我的权限"
  113. : "权限设置"
  114. }}</a
  115. >
  116. </div>
  117. <template v-if="tabsIndex === 0">
  118. <el-form
  119. :model="infoForm"
  120. :rules="rules"
  121. ref="ruleForm"
  122. label-width="150px"
  123. class="setting-form"
  124. >
  125. <el-form-item label="用户名" prop="name">
  126. <el-input
  127. v-model="infoForm.name"
  128. disabled
  129. placeholder="请输入用户名"
  130. maxlength="20"
  131. ></el-input>
  132. </el-form-item>
  133. <el-form-item label="真实姓名" prop="realName">
  134. <el-input
  135. v-model="infoForm.realName"
  136. placeholder="请输入真实姓名"
  137. @blur="handleTrim('infoForm', 'realName')"
  138. maxlength="20"
  139. ></el-input>
  140. </el-form-item>
  141. <el-form-item label="性别" prop="sex">
  142. <el-radio-group v-model="infoForm.sex">
  143. <el-radio :label="1">男</el-radio>
  144. <el-radio :label="0">女</el-radio>
  145. </el-radio-group>
  146. </el-form-item>
  147. <el-form-item label="所在省市" prop="selectedOptions">
  148. <el-cascader
  149. size="medium"
  150. :options="$provinceCityList"
  151. v-model="infoForm.selectedOptions"
  152. @change="handleCity"
  153. >
  154. </el-cascader>
  155. </el-form-item>
  156. <el-form-item label="备注" prop="desc">
  157. <el-input
  158. type="textarea"
  159. v-model="infoForm.desc"
  160. placeholder="请输入备注"
  161. maxlength="100"
  162. :rows="4"
  163. show-word-limit
  164. @blur="handleTrim('infoForm', 'desc')"
  165. ></el-input>
  166. </el-form-item>
  167. <el-form-item v-if="page !== 'personCheck'">
  168. <el-button
  169. type="primary"
  170. @click="onSubmit('ruleForm')"
  171. size="small"
  172. :loading="loading"
  173. >保存</el-button
  174. >
  175. <el-button @click="onCancel('ruleForm')" size="small"
  176. >取消</el-button
  177. >
  178. </el-form-item>
  179. <el-form-item v-else>
  180. <el-button
  181. type="primary"
  182. @click="handleAudit('up')"
  183. size="small"
  184. :loading="loading"
  185. >通过</el-button
  186. >
  187. <el-button @click="handleAudit('down')" size="small"
  188. >拒绝</el-button
  189. >
  190. </el-form-item>
  191. </el-form>
  192. </template>
  193. <template v-if="tabsIndex === 1">
  194. <div class="safe-items">
  195. <label>登录密码</label>
  196. <div class="safe-items-right">
  197. <p class="hasContent">
  198. 已设置。密码至少6位字符,支持数字和字母,且必须同时包含数字和大小写字母。
  199. </p>
  200. <!-- <p v-else class="noContent">
  201. 您暂未设置密码,密码可以有效的保护账号的安全。
  202. </p> -->
  203. <a @click="handleSetting('passwordFlag')">{{ "修改" }}</a>
  204. </div>
  205. </div>
  206. <div class="safe-items">
  207. <label>绑定手机</label>
  208. <div class="safe-items-right">
  209. <p
  210. v-if="info.phone || (info.sys_user && info.sys_user.phone)"
  211. class="hasContent"
  212. >
  213. 已绑定:
  214. {{
  215. (page === "editPerson" || page === "personal") &&
  216. info.sys_user.phone
  217. ? info.sys_user.phone.substring(0, 3) +
  218. "******" +
  219. info.sys_user.phone.substring(9, 11)
  220. : info.phone
  221. ? info.phone.substring(0, 3) +
  222. "******" +
  223. info.phone.substring(9, 11)
  224. : "-"
  225. }}
  226. </p>
  227. <p v-else class="noContent">
  228. 您暂未绑定手机,绑定手机可以有效的保护账号的安全。
  229. </p>
  230. <a @click="handleSetting('phoneFlag')">{{
  231. info.phone || (info.sys_user && info.sys_user.phone)
  232. ? "修改"
  233. : "设置"
  234. }}</a>
  235. </div>
  236. </div>
  237. <div class="safe-items">
  238. <label>绑定邮箱</label>
  239. <div class="safe-items-right">
  240. <p
  241. v-if="info.email || (info.sys_user && info.sys_user.email)"
  242. class="hasContent"
  243. >
  244. 已绑定: {{ info.email || info.sys_user.email }}
  245. </p>
  246. <p v-else class="noContent">
  247. 您暂未设置邮箱,绑定邮箱可以用来找回密码、接收通知等。
  248. </p>
  249. <a @click="handleSetting('emailFlag')">{{
  250. info.email || (info.sys_user && info.sys_user.email)
  251. ? "修改"
  252. : "设置"
  253. }}</a>
  254. </div>
  255. </div>
  256. </template>
  257. <template
  258. v-if="
  259. tabsIndex === 2 && (page === 'editPerson' || page === 'personal')
  260. "
  261. >
  262. <table class="step-table">
  263. <tr>
  264. <td rowspan="2" class="step-table-header">管理权限</td>
  265. <td>系统用户</td>
  266. <td>机构管理</td>
  267. </tr>
  268. <tr>
  269. <td>
  270. <el-checkbox
  271. v-model="manageAuth"
  272. :label="10001"
  273. :disabled="page === 'personal' ? true : false"
  274. ><br
  275. /></el-checkbox>
  276. </td>
  277. <td>
  278. <el-checkbox
  279. v-model="manageAuth"
  280. :label="10002"
  281. :disabled="page === 'personal' ? true : false"
  282. ><br
  283. /></el-checkbox>
  284. </td>
  285. </tr>
  286. </table>
  287. <table class="step-table">
  288. <tr>
  289. <td rowspan="2" class="step-table-header">内容权限</td>
  290. <td class="td1">报纸管理</td>
  291. <td class="td1">画刊管理</td>
  292. <td class="td1">专辑管理</td>
  293. <td class="td1">评测管理</td>
  294. <td class="td1">练习册管理</td>
  295. <td class="td1">课程管理</td>
  296. <td class="td1">广告管理</td>
  297. </tr>
  298. <tr>
  299. <td class="td1">
  300. <el-checkbox
  301. v-model="manageAuth"
  302. :label="20001"
  303. :disabled="page === 'personal' ? true : false"
  304. ><br
  305. /></el-checkbox>
  306. </td>
  307. <td class="td1">
  308. <el-checkbox
  309. v-model="manageAuth"
  310. :label="20002"
  311. :disabled="page === 'personal' ? true : false"
  312. ><br
  313. /></el-checkbox>
  314. </td>
  315. <td class="td1">
  316. <el-checkbox
  317. v-model="manageAuth"
  318. :label="20003"
  319. :disabled="page === 'personal' ? true : false"
  320. ><br
  321. /></el-checkbox>
  322. </td>
  323. <td class="td1">
  324. <el-checkbox
  325. v-model="manageAuth"
  326. :label="20004"
  327. :disabled="page === 'personal' ? true : false"
  328. ><br
  329. /></el-checkbox>
  330. </td>
  331. <td class="td1">
  332. <el-checkbox
  333. v-model="manageAuth"
  334. :label="20005"
  335. :disabled="page === 'personal' ? true : false"
  336. ><br
  337. /></el-checkbox>
  338. </td>
  339. <td class="td1">
  340. <el-checkbox
  341. v-model="manageAuth"
  342. :label="20006"
  343. :disabled="page === 'personal' ? true : false"
  344. ><br
  345. /></el-checkbox>
  346. </td>
  347. <td class="td1">
  348. <el-checkbox
  349. v-model="manageAuth"
  350. :label="20007"
  351. :disabled="page === 'personal' ? true : false"
  352. ><br
  353. /></el-checkbox>
  354. </td>
  355. </tr>
  356. </table>
  357. <table class="step-table">
  358. <tr>
  359. <td rowspan="2" class="step-table-header">兑换码权限</td>
  360. <td>生成兑换码</td>
  361. <td>查看兑换码使用情况</td>
  362. <td>消费报表</td>
  363. </tr>
  364. <tr>
  365. <td>
  366. <el-checkbox
  367. v-model="manageAuth"
  368. :label="30001"
  369. :disabled="page === 'personal' ? true : false"
  370. ><br
  371. /></el-checkbox>
  372. </td>
  373. <td>
  374. <el-radio-group
  375. v-model="codeAuth.viewCode"
  376. :disabled="page === 'personal' ? true : false"
  377. >
  378. <el-radio :label="1">全部</el-radio>
  379. <el-radio :label="0">自己生成的</el-radio>
  380. </el-radio-group>
  381. </td>
  382. <td>
  383. <el-checkbox
  384. v-model="manageAuth"
  385. :label="30003"
  386. :disabled="page === 'personal' ? true : false"
  387. ><br
  388. /></el-checkbox>
  389. </td>
  390. </tr>
  391. </table>
  392. <table class="step-table">
  393. <tr>
  394. <td rowspan="2" class="step-table-header">财务权限</td>
  395. <td>查看数据</td>
  396. <td>导出数据</td>
  397. <td>授权地区</td>
  398. </tr>
  399. <tr>
  400. <td>
  401. <el-checkbox
  402. v-model="manageAuth"
  403. :label="40001"
  404. :disabled="page === 'personal' ? true : false"
  405. ><br
  406. /></el-checkbox>
  407. </td>
  408. <td>
  409. <el-checkbox
  410. v-model="manageAuth"
  411. :label="40002"
  412. :disabled="page === 'personal' ? true : false"
  413. ><br
  414. /></el-checkbox>
  415. </td>
  416. <td>
  417. <el-cascader
  418. :disabled="page === 'personal' ? true : false"
  419. class="step-cascader"
  420. size="medium"
  421. :props="props"
  422. collapse-tags
  423. clearable
  424. :options="$provinceCityListAll"
  425. v-model="financeAuth.selectedOptions"
  426. @change="handleCity"
  427. >
  428. </el-cascader>
  429. </td>
  430. </tr>
  431. </table>
  432. <table class="step-table">
  433. <tr>
  434. <td rowspan="2" class="step-table-header">系统配置</td>
  435. <td>系统配置</td>
  436. </tr>
  437. <tr>
  438. <td>
  439. <el-checkbox
  440. v-model="manageAuth"
  441. :label="50001"
  442. :disabled="page === 'personal' ? true : false"
  443. ><br
  444. /></el-checkbox>
  445. </td>
  446. </tr>
  447. </table>
  448. <template v-if="page === 'editPerson'">
  449. <el-button
  450. type="primary"
  451. @click="onSubmitAuth()"
  452. size="small"
  453. :loading="loading"
  454. >保存</el-button
  455. >
  456. <el-button @click="onCancelAuth()" size="small">取消</el-button>
  457. </template>
  458. </template>
  459. <template v-if="tabsIndex === 2 && page === 'editOrgPerson'">
  460. <el-form
  461. :model="managerForm"
  462. ref="managerForm"
  463. label-width="150px"
  464. class="setting-form"
  465. >
  466. <el-form-item label="机构管理员" prop="is_manager">
  467. <el-radio-group v-model="managerForm.is_manager">
  468. <el-radio label="true">是</el-radio>
  469. <el-radio label="false">否</el-radio>
  470. </el-radio-group>
  471. </el-form-item>
  472. <el-form-item label="阅读全部内容" prop="is_can_see_all_content">
  473. <el-radio-group v-model="managerForm.is_can_see_all_content">
  474. <el-radio label="true">是</el-radio>
  475. <el-radio label="false">否</el-radio>
  476. </el-radio-group>
  477. </el-form-item>
  478. <el-form-item>
  479. <el-button
  480. type="primary"
  481. @click="onSubmitManager('managerForm')"
  482. size="small"
  483. :loading="loading"
  484. >保存</el-button
  485. >
  486. <el-button @click="onCancel('managerForm')" size="small"
  487. >取消</el-button
  488. >
  489. </el-form-item>
  490. </el-form>
  491. </template>
  492. </div>
  493. </template>
  494. <div class="setting-iframe" v-if="settingFlag && passwordFlag">
  495. <p class="title">
  496. <i
  497. class="el-icon-arrow-left"
  498. @click="handleSetting('passwordFlag')"
  499. ></i>
  500. 修改登录密码
  501. </p>
  502. <el-form
  503. :model="passwordForm"
  504. :rules="rulesPassword"
  505. ref="passwordForm"
  506. label-width="100px"
  507. class="passwordForm"
  508. >
  509. <!-- <el-form-item label="原始密码" prop="oldPwd">
  510. <el-input v-model="passwordForm.oldPwd" :type="oldPwdFlag?'text':'password'" autocomplete="off" placeholder="请输入密码" >
  511. <i slot="suffix" class="el-icon-view show-icon" @click="changeIcon('oldPwdFlag')" v-if="oldPwdFlag"></i>
  512. <i slot="suffix" class="show-icon" @click="changeIcon('oldPwdFlag')" v-else>
  513. <svg-icon icon-class="eye-invisible"></svg-icon>
  514. </i>
  515. </el-input>
  516. </el-form-item> -->
  517. <el-form-item label="修改密码" prop="newPwd">
  518. <el-input
  519. v-model="passwordForm.newPwd"
  520. :type="newPwdFlag ? 'text' : 'password'"
  521. autocomplete="off"
  522. placeholder="请输入密码"
  523. @blur="handleTrim('passwordForm', 'newPwd')"
  524. maxlength="20"
  525. >
  526. <i
  527. slot="suffix"
  528. class="el-icon-view show-icon"
  529. @click="changeIcon('newPwdFlag')"
  530. v-if="newPwdFlag"
  531. ></i>
  532. <i
  533. slot="suffix"
  534. class="show-icon"
  535. @click="changeIcon('newPwdFlag')"
  536. v-else
  537. >
  538. <svg-icon icon-class="eye-invisible"></svg-icon>
  539. </i>
  540. </el-input>
  541. <p class="tips">不少于6位,且必须同时包含数字和大小写字母</p>
  542. </el-form-item>
  543. <el-form-item label="再次输入" prop="confirmPwd">
  544. <el-input
  545. v-model="passwordForm.confirmPwd"
  546. :type="comfirmPwdFlag ? 'text' : 'password'"
  547. autocomplete="off"
  548. placeholder="请输入密码"
  549. @blur="handleTrim('passwordForm', 'confirmPwd')"
  550. maxlength="20"
  551. >
  552. <i
  553. slot="suffix"
  554. class="el-icon-view show-icon"
  555. @click="changeIcon('comfirmPwdFlag')"
  556. v-if="comfirmPwdFlag"
  557. ></i>
  558. <i
  559. slot="suffix"
  560. class="show-icon"
  561. @click="changeIcon('comfirmPwdFlag')"
  562. v-else
  563. >
  564. <svg-icon icon-class="eye-invisible"></svg-icon>
  565. </i>
  566. </el-input>
  567. </el-form-item>
  568. <el-form-item>
  569. <el-button
  570. type="primary"
  571. @click="onSubmitPassword('passwordForm')"
  572. size="small"
  573. :loading="loading"
  574. >保存</el-button
  575. >
  576. <el-button @click="onCancel('passwordForm')" size="small"
  577. >取消</el-button
  578. >
  579. </el-form-item>
  580. </el-form>
  581. </div>
  582. <div class="setting-iframe" v-if="settingFlag && phoneFlag">
  583. <p class="title">
  584. <i class="el-icon-arrow-left" @click="handleSetting('phoneFlag')"></i>
  585. 修改绑定手机
  586. </p>
  587. <el-form
  588. :model="phoneForm"
  589. :rules="rulesPhone"
  590. ref="phoneForm"
  591. label-width="100px"
  592. class="phoneForm"
  593. >
  594. <el-form-item
  595. label="原手机号"
  596. prop="oldPhone"
  597. v-if="phoneForm.oldPhone"
  598. >
  599. <el-input
  600. v-model="phoneForm.oldPhone"
  601. autocomplete="off"
  602. :disabled="phoneForm.oldPhone ? true : false"
  603. placeholder="请输入完整手机号"
  604. @blur="handleTrim('phoneForm', 'oldPhone')"
  605. maxlength="20"
  606. >
  607. <template slot="prepend">+86</template>
  608. </el-input>
  609. </el-form-item>
  610. <el-form-item label="新手机号" prop="newPhone">
  611. <el-input
  612. v-model="phoneForm.newPhone"
  613. autocomplete="off"
  614. placeholder="请输入完整手机号"
  615. @blur="handleTrim('phoneForm', 'newPhone')"
  616. maxlength="20"
  617. >
  618. <template slot="prepend">+86</template>
  619. </el-input>
  620. </el-form-item>
  621. <el-form-item>
  622. <el-button
  623. type="primary"
  624. @click="onSubmitPhone('phoneForm')"
  625. size="small"
  626. :loading="loading"
  627. >保存</el-button
  628. >
  629. <el-button @click="onCancel('phoneForm')" size="small"
  630. >取消</el-button
  631. >
  632. </el-form-item>
  633. </el-form>
  634. </div>
  635. <div class="setting-iframe" v-if="settingFlag && emailFlag">
  636. <p class="title">
  637. <i class="el-icon-arrow-left" @click="handleSetting('emailFlag')"></i>
  638. 修改安全邮箱
  639. </p>
  640. <el-form
  641. :model="emailForm"
  642. :rules="rulesEmail"
  643. ref="emailForm"
  644. label-width="100px"
  645. class="emailForm"
  646. >
  647. <el-form-item label="原邮箱" prop="email" v-if="emailForm.email">
  648. <el-input
  649. v-model="emailForm.email"
  650. autocomplete="off"
  651. :disabled="emailForm.email ? true : false"
  652. placeholder="请输入邮箱地址"
  653. @blur="handleTrim('emailForm', 'email')"
  654. maxlength="100"
  655. >
  656. </el-input>
  657. </el-form-item>
  658. <el-form-item label="新邮箱" prop="newEmail">
  659. <el-input
  660. v-model="emailForm.newEmail"
  661. autocomplete="off"
  662. placeholder="请输入邮箱地址"
  663. @blur="handleTrim('emailForm', 'newEmail')"
  664. maxlength="100"
  665. >
  666. </el-input>
  667. </el-form-item>
  668. <el-form-item>
  669. <el-button
  670. type="primary"
  671. @click="onSubmitEmail('emailForm')"
  672. size="small"
  673. :loading="loading"
  674. >保存</el-button
  675. >
  676. <el-button @click="onCancel('emailForm')" size="small"
  677. >取消</el-button
  678. >
  679. </el-form-item>
  680. </el-form>
  681. </div>
  682. </div>
  683. </template>
  684. <script>
  685. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  686. //例如:import 《组件名称》from ‘《组件路径》';
  687. import Upload from "./Upload.vue";
  688. import { getLogin } from "@/api/ajax";
  689. import { getToken } from "@/utils/auth";
  690. import { mapState } from "vuex";
  691. export default {
  692. //import引入的组件需要注入到对象中才能使用
  693. components: { Upload },
  694. props: ["page", "info"],
  695. data() {
  696. //这里存放数据
  697. const validatePass = (rule, value, callback) => {
  698. if (value === "") {
  699. callback(new Error("请输入密码"));
  700. } else {
  701. let reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]+)[a-zA-Z\d]{6,200}$/;
  702. let result = reg.test(value);
  703. if (result) {
  704. callback();
  705. } else {
  706. callback(new Error("密码必须同时包含数字和大小写字母"));
  707. }
  708. }
  709. };
  710. const validatePass2 = (rule, value, callback) => {
  711. if (value === "") {
  712. callback(new Error("请再次输入密码"));
  713. } else if (value !== this.passwordForm.newPwd) {
  714. callback(new Error("两次输入密码不一致!"));
  715. } else {
  716. callback();
  717. }
  718. };
  719. const validatePhone = (rule, value, callback) => {
  720. if (value === "") {
  721. callback(new Error("请输入手机号"));
  722. } else {
  723. let reg = /^1[3-9]\d{9}$/;
  724. let result = reg.test(value);
  725. if (result) {
  726. callback();
  727. } else {
  728. callback(new Error("请输入正确的手机号"));
  729. }
  730. }
  731. };
  732. const validateEmail = (rule, value, callback) => {
  733. if (value === "") {
  734. callback(new Error("请输入邮箱地址"));
  735. } else {
  736. let reg = /^[a-zA-Z0-9_\.-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
  737. let result = reg.test(value);
  738. if (result) {
  739. callback();
  740. } else {
  741. callback(new Error("请输入正确的邮箱地址"));
  742. }
  743. }
  744. };
  745. const validateProvince = (rule, value, callback) => {
  746. if (value === []) {
  747. callback(new Error("请选择所在省市"));
  748. } else if (value.length === 2) {
  749. if (value[0] === "" || value[1] === "") {
  750. callback(new Error("请选择所在省市"));
  751. } else {
  752. callback();
  753. }
  754. } else {
  755. callback();
  756. }
  757. };
  758. return {
  759. show: false, // 编辑头像flag
  760. tabsIndex: 0,
  761. infoForm: {
  762. cover_image_url: "",
  763. cover_image_list: [],
  764. cover_image_id: null,
  765. name:
  766. this.page === "editPerson" || this.page === "personal"
  767. ? JSON.parse(JSON.stringify(this.info.sys_user.user_name))
  768. : JSON.parse(JSON.stringify(this.info.user_name)),
  769. realName:
  770. this.page === "editPerson" || this.page === "personal"
  771. ? JSON.parse(JSON.stringify(this.info.sys_user.real_name))
  772. : JSON.parse(JSON.stringify(this.info.real_name)),
  773. sex:
  774. this.page === "editPerson" || this.page === "personal"
  775. ? JSON.parse(JSON.stringify(this.info.sys_user.sex))
  776. : JSON.parse(JSON.stringify(this.info.sex)),
  777. selectedOptions:
  778. this.page === "editPerson" || this.page === "personal"
  779. ? [
  780. JSON.parse(JSON.stringify(this.info.sys_user.province_id)),
  781. JSON.parse(JSON.stringify(this.info.sys_user.city_id)),
  782. ]
  783. : [
  784. JSON.parse(JSON.stringify(this.info.province_id)),
  785. JSON.parse(JSON.stringify(this.info.city_id)),
  786. ],
  787. desc:
  788. this.page === "editPerson" || this.page === "personal"
  789. ? JSON.parse(JSON.stringify(this.info.sys_user.memo))
  790. : JSON.parse(JSON.stringify(this.info.memo)),
  791. },
  792. rules: {
  793. name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
  794. selectedOptions: [
  795. {
  796. type: "array",
  797. required: true,
  798. validator: validateProvince,
  799. trigger: "change",
  800. },
  801. ],
  802. sex: [{ required: true, message: "请选择性别", trigger: "change" }],
  803. },
  804. settingFlag: false, // 修改设置
  805. passwordFlag: false, // 修改密码
  806. phoneFlag: false, // 修改手机
  807. emailFlag: false, // 修改邮箱
  808. passwordForm: {
  809. newPwd: "", // 新密码
  810. confirmPwd: "", // 确认密码
  811. },
  812. rulesPassword: {
  813. newPwd: [
  814. { required: true, validator: validatePass, trigger: "blur" },
  815. {
  816. min: 6,
  817. message: "请输入不少于 6 位密码,且必须同时包含数字和大小写字母",
  818. trigger: "change",
  819. },
  820. ],
  821. confirmPwd: [
  822. { required: true, validator: validatePass2, trigger: "blur" },
  823. ],
  824. },
  825. oldPwdFlag: false, // 查看旧密码
  826. newPwdFlag: false, // 查看新密码
  827. comfirmPwdFlag: false, // 查看确认密码
  828. phoneForm: {
  829. oldPhone:
  830. this.page === "editPerson" || this.page === "personal"
  831. ? JSON.parse(JSON.stringify(this.info.sys_user.phone))
  832. : JSON.parse(JSON.stringify(this.info.phone)), // 旧手机
  833. newPhone: "", // 新手机
  834. },
  835. rulesPhone: {
  836. oldPhone: [
  837. { required: true, validator: validatePhone, trigger: "blur" },
  838. ],
  839. newPhone: [
  840. { required: true, validator: validatePhone, trigger: "blur" },
  841. ],
  842. },
  843. time: 60, //获取验证码的时间
  844. verificationCodeShow: false, //是否已经获取了验证码
  845. times: 60, //获取验证码的时间
  846. verificationCodesShow: false, //是否已经获取了验证码
  847. timee: 60, //获取验证码的时间
  848. verificationCodeeShow: false, //是否已经获取了验证码
  849. emailForm: {
  850. email:
  851. this.page === "editPerson" || this.page === "personal"
  852. ? JSON.parse(JSON.stringify(this.info.sys_user.email))
  853. : JSON.parse(JSON.stringify(this.info.email)),
  854. newEmail: "",
  855. },
  856. rulesEmail: {
  857. email: [{ required: true, validator: validateEmail, trigger: "blur" }],
  858. newEmail: [
  859. { required: true, validator: validateEmail, trigger: "blur" },
  860. ],
  861. },
  862. manageAuth:
  863. this.page === "editPerson" || this.page === "personal"
  864. ? JSON.parse(JSON.stringify(this.info.popedom_code_list))
  865. : [], // 管理权限
  866. codeAuth: {
  867. auth: [],
  868. viewCode:
  869. this.page === "editPerson" || this.page === "personal"
  870. ? JSON.parse(
  871. JSON.stringify(this.info.data_scope.discount_code_view_scope)
  872. )
  873. : 0,
  874. }, // 兑换码权限
  875. financeAuth: {
  876. auth: [],
  877. selectedOptions:
  878. this.page === "editPerson" || this.page === "personal"
  879. ? JSON.parse(
  880. JSON.stringify(this.info.data_scope.finance_popedom_data_scope)
  881. )
  882. : [],
  883. }, // 财务权限
  884. props: { multiple: true },
  885. loading: false,
  886. id: this.$route.query.id ? this.$route.query.id : "",
  887. managerForm: {
  888. is_manager:
  889. this.page === "editOrgPerson"
  890. ? JSON.parse(JSON.stringify(this.info.is_manager))
  891. : "false",
  892. is_can_see_all_content:
  893. this.page === "editOrgPerson"
  894. ? JSON.parse(JSON.stringify(this.info.is_can_see_all_content))
  895. : "false",
  896. },
  897. };
  898. },
  899. //计算属性 类似于data概念
  900. computed: {
  901. ...mapState(["$provinceCityList", "$provinceCityListAll"]),
  902. },
  903. //监控data中数据变化
  904. watch: {},
  905. //方法集合
  906. methods: {
  907. handleAvatarSuccess(fileList, name) {
  908. let MethodName = "/OrgServer/Manager/SysUserManager/UpdateSysUser_Image";
  909. if (this.page === "editOrgPerson") {
  910. MethodName = "/OrgServer/Manager/PersonManager/UpdatePerson_Image";
  911. }
  912. let data = {
  913. id: this.page === "personal" ? JSON.parse(getToken()).user_id : this.id,
  914. image_id:
  915. fileList.length > 0 &&
  916. fileList[fileList.length - 1].response &&
  917. fileList[fileList.length - 1].response.file_info_list &&
  918. fileList[fileList.length - 1].response.file_info_list[0]
  919. ? fileList[fileList.length - 1].response.file_info_list[0].file_id
  920. : "",
  921. };
  922. getLogin(MethodName, data)
  923. .then((res) => {
  924. if (res.status === 1) {
  925. this.$emit("getInfo");
  926. }
  927. })
  928. .catch((res) => {});
  929. },
  930. // 切换tabs
  931. handleChangeTabs(value) {
  932. this.tabsIndex = value;
  933. let breadcrumb = [];
  934. if (this.page === "editOrgPerson") {
  935. breadcrumb = [
  936. {
  937. icon: "school-line",
  938. url: "",
  939. text: "",
  940. },
  941. {
  942. icon: "",
  943. url: "",
  944. text: "机构管理",
  945. },
  946. {
  947. icon: "",
  948. url: "",
  949. text: this.info.org_name,
  950. },
  951. {
  952. icon: "",
  953. url: "",
  954. notLink: true,
  955. text:
  956. value === 0 ? "人员信息" : value === 1 ? "安全设置" : "权限设置",
  957. },
  958. ];
  959. this.$emit("changeBread", breadcrumb);
  960. }
  961. },
  962. // 级联选择器
  963. handleCity(value) {
  964. // console.log(value)
  965. },
  966. // 提交表单
  967. onSubmit(formName) {
  968. this.$refs[formName].validate((valid) => {
  969. if (valid) {
  970. this.loading = true;
  971. let MethodName =
  972. "/OrgServer/Manager/SysUserManager/UpdateSysUser_BaseInfo";
  973. if (this.page === "editOrgPerson") {
  974. MethodName =
  975. "/OrgServer/Manager/PersonManager/UpdatePerson_BaseInfo";
  976. }
  977. let data = {
  978. id:
  979. this.page === "personal"
  980. ? JSON.parse(getToken()).user_id
  981. : this.id,
  982. user_name: this.infoForm.name,
  983. real_name: this.infoForm.realName,
  984. sex: this.infoForm.sex,
  985. city_id: this.infoForm.selectedOptions[1],
  986. memo: this.infoForm.desc,
  987. };
  988. getLogin(MethodName, data)
  989. .then((res) => {
  990. this.loading = false;
  991. if (res.status === 1) {
  992. this.$emit("getInfo");
  993. this.$message({
  994. message: "修改成功",
  995. type: "success",
  996. duration: 3000,
  997. });
  998. }
  999. })
  1000. .catch((res) => {
  1001. this.loading = false;
  1002. });
  1003. } else {
  1004. return false;
  1005. }
  1006. });
  1007. },
  1008. // 取消 恢复到修改前状态
  1009. onCancel(formName) {
  1010. if (formName === "managerForm") {
  1011. this.managerForm.is_manager =
  1012. this.page === "editOrgPerson"
  1013. ? JSON.parse(JSON.stringify(this.info.is_manager))
  1014. : "false";
  1015. this.managerForm.is_can_see_all_content =
  1016. this.page === "editOrgPerson"
  1017. ? JSON.parse(JSON.stringify(this.info.is_can_see_all_content))
  1018. : "false";
  1019. } else {
  1020. this.$refs[formName].resetFields();
  1021. }
  1022. },
  1023. // 修改设置
  1024. handleSetting(flag) {
  1025. this.settingFlag = !this.settingFlag;
  1026. this[flag] = !this[flag];
  1027. let breadcrumb = [];
  1028. if (this.page === "editPerson") {
  1029. if (this[flag]) {
  1030. breadcrumb = [
  1031. {
  1032. icon: "contacts-line",
  1033. url: "",
  1034. text: "",
  1035. },
  1036. {
  1037. icon: "",
  1038. url: "",
  1039. text: "系统用户",
  1040. },
  1041. {
  1042. icon: "",
  1043. url: "",
  1044. notLink: true,
  1045. text: "安全设置",
  1046. },
  1047. {
  1048. icon: "",
  1049. url: "",
  1050. text:
  1051. flag === "passwordFlag"
  1052. ? "修改密码"
  1053. : flag === "phoneFlag"
  1054. ? "绑定手机"
  1055. : "安全邮箱",
  1056. },
  1057. ];
  1058. } else {
  1059. breadcrumb = [
  1060. {
  1061. icon: "contacts-line",
  1062. url: "",
  1063. text: "",
  1064. },
  1065. {
  1066. icon: "",
  1067. url: "",
  1068. text: "系统用户",
  1069. },
  1070. {
  1071. icon: "",
  1072. url: "",
  1073. text: "编辑",
  1074. },
  1075. ];
  1076. }
  1077. this.$emit("changeBread", breadcrumb);
  1078. }
  1079. },
  1080. changeIcon(flag) {
  1081. this[flag] = !this[flag];
  1082. },
  1083. // 修改密码提交表单
  1084. onSubmitPassword(formName) {
  1085. this.$refs[formName].validate((valid) => {
  1086. if (valid) {
  1087. this.loading = true;
  1088. let MethodName =
  1089. "/OrgServer/Manager/SysUserManager/UpdateSysUser_Password";
  1090. if (this.page === "editOrgPerson") {
  1091. MethodName =
  1092. "/OrgServer/Manager/PersonManager/UpdatePerson_Password";
  1093. }
  1094. let data = {
  1095. id:
  1096. this.page === "personal"
  1097. ? JSON.parse(getToken()).user_id
  1098. : this.id,
  1099. password: this.passwordForm.newPwd,
  1100. };
  1101. getLogin(MethodName, data)
  1102. .then((res) => {
  1103. this.loading = false;
  1104. if (res.status === 1) {
  1105. this.$message({
  1106. message: "修改成功",
  1107. type: "success",
  1108. duration: 3000,
  1109. });
  1110. this.$emit("getInfo");
  1111. this.handleSetting("passwordFlag");
  1112. }
  1113. })
  1114. .catch((res) => {
  1115. this.loading = false;
  1116. });
  1117. } else {
  1118. return false;
  1119. }
  1120. });
  1121. },
  1122. // 修改手机提交表单
  1123. onSubmitPhone(formName) {
  1124. this.$refs[formName].validate((valid) => {
  1125. if (valid) {
  1126. this.loading = true;
  1127. let MethodName =
  1128. "/OrgServer/Manager/SysUserManager/UpdateSysUser_Phone";
  1129. if (this.page === "editOrgPerson") {
  1130. MethodName = "/OrgServer/Manager/PersonManager/UpdatePerson_Phone";
  1131. }
  1132. let data = {
  1133. id:
  1134. this.page === "personal"
  1135. ? JSON.parse(getToken()).user_id
  1136. : this.id,
  1137. phone: this.phoneForm.newPhone,
  1138. };
  1139. getLogin(MethodName, data)
  1140. .then((res) => {
  1141. this.loading = false;
  1142. if (res.status === 1) {
  1143. this.$message({
  1144. message: "修改成功",
  1145. type: "success",
  1146. duration: 3000,
  1147. });
  1148. this.$emit("getInfo");
  1149. this.handleSetting("phoneFlag");
  1150. this.phoneForm.oldPhone = JSON.parse(
  1151. JSON.stringify(this.phoneForm.newPhone)
  1152. );
  1153. this.phoneForm.newPhone = "";
  1154. }
  1155. })
  1156. .catch((res) => {
  1157. this.loading = false;
  1158. });
  1159. } else {
  1160. return false;
  1161. }
  1162. });
  1163. },
  1164. // 修改邮箱
  1165. onSubmitEmail(formName) {
  1166. this.$refs[formName].validate((valid) => {
  1167. if (valid) {
  1168. this.loading = true;
  1169. let MethodName =
  1170. "/OrgServer/Manager/SysUserManager/UpdateSysUser_Email";
  1171. if (this.page === "editOrgPerson") {
  1172. MethodName = "/OrgServer/Manager/PersonManager/UpdatePerson_Email";
  1173. }
  1174. let data = {
  1175. id:
  1176. this.page === "personal"
  1177. ? JSON.parse(getToken()).user_id
  1178. : this.id,
  1179. email: this.emailForm.newEmail,
  1180. };
  1181. getLogin(MethodName, data)
  1182. .then((res) => {
  1183. this.loading = false;
  1184. if (res.status === 1) {
  1185. this.$message({
  1186. message: "修改成功",
  1187. type: "success",
  1188. duration: 3000,
  1189. });
  1190. this.$emit("getInfo");
  1191. this.handleSetting("emailFlag");
  1192. this.emailForm.email = JSON.parse(
  1193. JSON.stringify(this.emailForm.newEmail)
  1194. );
  1195. this.emailForm.newEmail = "";
  1196. }
  1197. })
  1198. .catch((res) => {
  1199. this.loading = false;
  1200. });
  1201. } else {
  1202. return false;
  1203. }
  1204. });
  1205. },
  1206. // 去掉前后空格
  1207. handleTrim(form, fild) {
  1208. this[form][fild] = this[form][fild].trim();
  1209. },
  1210. // 修改权限
  1211. onSubmitAuth() {
  1212. this.loading = true;
  1213. let MethodName =
  1214. "/OrgServer/Manager/SysUserManager/UpdateSysUser_Popedom";
  1215. let finance_popedom_data_scope = {};
  1216. if (this.financeAuth.selectedOptions.length > 0) {
  1217. if (
  1218. this.financeAuth.selectedOptions[0][0] &&
  1219. this.financeAuth.selectedOptions[0][0] === "0"
  1220. ) {
  1221. finance_popedom_data_scope.is_all = "true";
  1222. } else {
  1223. finance_popedom_data_scope.is_all = "false";
  1224. let province_id_list = [];
  1225. let city_id_list = [];
  1226. this.financeAuth.selectedOptions.forEach((item) => {
  1227. if (province_id_list.indexOf(item[0]) === -1) {
  1228. province_id_list.push(item[0]);
  1229. }
  1230. city_id_list.push(item[1] ? item[1] : "");
  1231. });
  1232. finance_popedom_data_scope.province_id_list = province_id_list;
  1233. finance_popedom_data_scope.city_id_list = city_id_list;
  1234. }
  1235. }
  1236. let data = {
  1237. id: this.page === "personal" ? JSON.parse(getToken()).user_id : this.id,
  1238. popedom_code_list: this.manageAuth,
  1239. data_scope: {
  1240. discount_code_view_scope: this.codeAuth.viewCode,
  1241. finance_popedom_data_scope: finance_popedom_data_scope,
  1242. },
  1243. };
  1244. getLogin(MethodName, data)
  1245. .then((res) => {
  1246. this.loading = false;
  1247. if (res.status === 1) {
  1248. this.$message({
  1249. message: "修改成功",
  1250. type: "success",
  1251. duration: 3000,
  1252. });
  1253. }
  1254. })
  1255. .catch((res) => {
  1256. this.loading = false;
  1257. });
  1258. },
  1259. // 取消权限
  1260. onCancelAuth() {
  1261. this.handleUserAuth();
  1262. // this.manageAuth = []
  1263. // this.codeAuth.viewCode = 0
  1264. // this.financeAuth.selectedOptions = []
  1265. },
  1266. // 赋值权限
  1267. handleUserAuth() {
  1268. if (this.page === "editPerson" || this.page === "personal") {
  1269. this.manageAuth = this.info.popedom_code_list
  1270. ? JSON.parse(JSON.stringify(this.info.popedom_code_list))
  1271. : [];
  1272. this.codeAuth.viewCode = this.info.data_scope.discount_code_view_scope
  1273. ? JSON.parse(
  1274. JSON.stringify(this.info.data_scope.discount_code_view_scope)
  1275. )
  1276. : 0;
  1277. if (
  1278. this.info.data_scope.finance_popedom_data_scope &&
  1279. this.info.data_scope.finance_popedom_data_scope.is_all === "true"
  1280. ) {
  1281. this.financeAuth.selectedOptions = ["0"];
  1282. } else {
  1283. let arr = [];
  1284. this.info.data_scope.finance_popedom_data_scope.city_id_list.forEach(
  1285. (item) => {
  1286. arr.push([item.substring(0, 2), item]);
  1287. }
  1288. );
  1289. this.financeAuth.selectedOptions = arr;
  1290. }
  1291. }
  1292. },
  1293. // 修改管理员权限
  1294. onSubmitManager() {
  1295. this.loading = true;
  1296. let MethodName = "/OrgServer/Manager/PersonManager/UpdatePerson_Popedom";
  1297. let data = {
  1298. id: this.page === "personal" ? JSON.parse(getToken()).user_id : this.id,
  1299. is_manager: this.managerForm.is_manager,
  1300. is_can_see_all_content: this.managerForm.is_can_see_all_content,
  1301. };
  1302. getLogin(MethodName, data)
  1303. .then((res) => {
  1304. this.loading = false;
  1305. if (res.status === 1) {
  1306. this.$message({
  1307. message: "修改成功",
  1308. type: "success",
  1309. duration: 3000,
  1310. });
  1311. }
  1312. })
  1313. .catch((res) => {
  1314. this.loading = false;
  1315. });
  1316. },
  1317. // 通过 拒绝
  1318. handleAudit(type) {
  1319. let Mname = "/OrgServer/Manager/PersonManager/AuditPerson";
  1320. let data = {
  1321. id_list: [this.id],
  1322. };
  1323. if (type === "up") {
  1324. // 下架状态
  1325. data.is_pass = "true";
  1326. } else if (type === "down") {
  1327. data.is_pass = "false";
  1328. }
  1329. getLogin(Mname, data).then((res) => {
  1330. this.$message({
  1331. message: "操作成功",
  1332. type: "success",
  1333. duration: 3000,
  1334. });
  1335. this.$router.go(-1);
  1336. });
  1337. },
  1338. },
  1339. //生命周期 - 创建完成(可以访问当前this实例)
  1340. created() {
  1341. if (this.info) {
  1342. this.handleUserAuth();
  1343. }
  1344. },
  1345. //生命周期 - 挂载完成(可以访问DOM元素)
  1346. mounted() {},
  1347. //生命周期-创建之前
  1348. beforeCreated() {},
  1349. //生命周期-挂载之前
  1350. beforeMount() {},
  1351. //生命周期-更新之前
  1352. beforUpdate() {},
  1353. //生命周期-更新之后
  1354. updated() {},
  1355. //生命周期-销毁之前
  1356. beforeDestory() {},
  1357. //生命周期-销毁完成
  1358. destoryed() {},
  1359. //如果页面有keep-alive缓存功能,这个函数会触发
  1360. activated() {},
  1361. };
  1362. </script>
  1363. <style lang="scss" scoped>
  1364. /* @import url(); 引入css类 */
  1365. .setting {
  1366. height: 100%;
  1367. &-top {
  1368. margin: 0 0 12px 0;
  1369. background: #ffffff;
  1370. border-radius: 8px;
  1371. display: flex;
  1372. align-items: center;
  1373. width: 100%;
  1374. padding: 22px 40px;
  1375. .avator-box {
  1376. width: 96px;
  1377. height: 96px;
  1378. position: relative;
  1379. .img-crop {
  1380. position: absolute;
  1381. // padding: 4px;
  1382. width: 30px;
  1383. height: 30px;
  1384. right: -4px;
  1385. bottom: -4px;
  1386. border-radius: 50%;
  1387. display: block;
  1388. text-align: center;
  1389. font-size: 0;
  1390. border: 2px solid #ffffff;
  1391. background: #f2f3f5 url("../assets/camera.png") center no-repeat;
  1392. background-size: 12px;
  1393. }
  1394. .el-image {
  1395. border-radius: 50%;
  1396. overflow: hidden;
  1397. }
  1398. }
  1399. .center {
  1400. flex: 1;
  1401. display: flex;
  1402. flex-flow: wrap;
  1403. margin-top: 12px;
  1404. .info-items {
  1405. margin-bottom: 12px;
  1406. width: 40%;
  1407. }
  1408. label {
  1409. font-weight: 400;
  1410. font-size: 14px;
  1411. line-height: 22px;
  1412. color: #86909c;
  1413. width: 156px;
  1414. text-align: right;
  1415. display: inline-block;
  1416. padding-right: 10px;
  1417. }
  1418. span {
  1419. font-size: 14px;
  1420. line-height: 22px;
  1421. color: #1d2129;
  1422. }
  1423. }
  1424. }
  1425. &-bottom {
  1426. padding: 24px;
  1427. background: #ffffff;
  1428. border-radius: 4px;
  1429. min-height: calc(100vh - 270px);
  1430. .tabs-box {
  1431. display: flex;
  1432. padding-bottom: 16px;
  1433. a {
  1434. font-size: 14px;
  1435. line-height: 22px;
  1436. color: #4e5969;
  1437. border-radius: 100px;
  1438. padding: 5px 16px;
  1439. margin-right: 12px;
  1440. &:hover {
  1441. background: #f2f3f5;
  1442. }
  1443. &.active {
  1444. background: #f2f3f5;
  1445. font-weight: 500;
  1446. color: #165dff;
  1447. }
  1448. }
  1449. }
  1450. .btn {
  1451. margin-left: 16px;
  1452. }
  1453. .safe-items {
  1454. display: flex;
  1455. width: 100%;
  1456. padding: 30px 20px 13px 20px;
  1457. label {
  1458. font-weight: 500;
  1459. font-size: 14px;
  1460. line-height: 22px;
  1461. color: #4e5969;
  1462. }
  1463. &-right {
  1464. border-bottom: 1px solid #e5e6eb;
  1465. padding-bottom: 20px;
  1466. flex: 1;
  1467. margin-left: 16px;
  1468. display: flex;
  1469. justify-content: space-between;
  1470. p {
  1471. margin: 0;
  1472. font-weight: 400;
  1473. font-size: 14px;
  1474. line-height: 22px;
  1475. color: #4e5969;
  1476. &.noContent {
  1477. color: #86909c;
  1478. }
  1479. }
  1480. a {
  1481. font-weight: 400;
  1482. font-size: 14px;
  1483. line-height: 22px;
  1484. color: #165dff;
  1485. }
  1486. }
  1487. }
  1488. }
  1489. &-iframe {
  1490. width: 100%;
  1491. height: 100%;
  1492. background: #ffffff;
  1493. padding: 24px;
  1494. .title {
  1495. margin: 0;
  1496. font-weight: 400;
  1497. font-size: 20px;
  1498. line-height: 28px;
  1499. color: #000000;
  1500. .el-icon-arrow-left {
  1501. margin-right: 8px;
  1502. cursor: pointer;
  1503. }
  1504. }
  1505. .passwordForm,
  1506. .phoneForm,
  1507. .emailForm {
  1508. padding-top: 40px;
  1509. .show-icon {
  1510. cursor: pointer;
  1511. color: #4e5969;
  1512. }
  1513. }
  1514. .code-input {
  1515. width: 268px;
  1516. .el-input__inner {
  1517. border-radius: 2px 0 0 2px;
  1518. }
  1519. }
  1520. }
  1521. }
  1522. .step-table {
  1523. border: 1px solid #e5e6eb;
  1524. border-collapse: collapse;
  1525. font-size: 14px;
  1526. line-height: 22px;
  1527. color: #1d2129;
  1528. text-align: center;
  1529. margin-bottom: 24px;
  1530. &-header {
  1531. background: #f7f8fa;
  1532. width: 120px !important;
  1533. color: #86909c;
  1534. font-weight: 500;
  1535. }
  1536. td {
  1537. height: 40px;
  1538. width: 260px;
  1539. border: 1px solid #e5e6eb;
  1540. &.td1 {
  1541. width: 130px;
  1542. }
  1543. }
  1544. .step-cascader {
  1545. width: 250px;
  1546. height: 32px;
  1547. line-height: 32px;
  1548. }
  1549. }
  1550. .tips {
  1551. margin: 0;
  1552. color: #86909c;
  1553. font-size: 12px;
  1554. line-height: 20px;
  1555. }
  1556. </style>
  1557. <style lang="scss">
  1558. .setting {
  1559. .el-input,
  1560. .el-textarea {
  1561. width: 360px;
  1562. }
  1563. .el-input__inner {
  1564. height: 32px;
  1565. color: #1d2129;
  1566. background: #f2f3f5;
  1567. border: none;
  1568. }
  1569. .el-textarea__inner,
  1570. .el-input-group__prepend {
  1571. color: #1d2129;
  1572. background: #f2f3f5;
  1573. border: none;
  1574. }
  1575. .el-input__count {
  1576. background: #f2f3f5;
  1577. }
  1578. .el-form-item__label {
  1579. font-weight: 400;
  1580. font-size: 14px;
  1581. line-height: 32px;
  1582. color: #4e5969;
  1583. }
  1584. .el-form-item__content,
  1585. .el-input__icon {
  1586. line-height: 32px;
  1587. color: #4e5969 !important;
  1588. }
  1589. .el-form-item {
  1590. margin-bottom: 20px;
  1591. }
  1592. .el-radio__input.is-checked + .el-radio__label {
  1593. color: #165dff;
  1594. }
  1595. .el-radio__input.is-checked .el-radio__inner {
  1596. background: #165dff;
  1597. border-color: #165dff;
  1598. }
  1599. .el-button--primary {
  1600. background: #165dff;
  1601. border-color: #165dff;
  1602. border-radius: 2px;
  1603. &:hover {
  1604. background: #4080ff;
  1605. border-color: #4080ff;
  1606. }
  1607. &:focus {
  1608. background: #0e42d2;
  1609. border-color: #0e42d2;
  1610. }
  1611. }
  1612. .el-button--default {
  1613. background: #f2f3f5;
  1614. border-radius: 2px;
  1615. border: none;
  1616. color: #4e5969;
  1617. height: 32px;
  1618. &:hover {
  1619. background: #e5e6eb;
  1620. }
  1621. &:focus {
  1622. background: #c9cdd4;
  1623. }
  1624. }
  1625. .setting-form {
  1626. padding-top: 26px;
  1627. }
  1628. .code-box {
  1629. .el-form-item__content {
  1630. display: flex;
  1631. }
  1632. }
  1633. .code-input {
  1634. height: 32px;
  1635. .el-input__inner {
  1636. border-radius: 4px 0 0 4px;
  1637. }
  1638. }
  1639. .sendCode {
  1640. border-radius: 0 4px 4px 0;
  1641. margin-top: 1px;
  1642. width: 92px;
  1643. }
  1644. .el-input-group__prepend {
  1645. width: 54px;
  1646. height: 32px;
  1647. border: none;
  1648. background: #f2f3f5;
  1649. border-radius: 2px 0px 0px 2px;
  1650. line-height: 32px;
  1651. text-align: center;
  1652. padding: 0;
  1653. }
  1654. .el-input-group--prepend {
  1655. display: flex;
  1656. .el-input__inner {
  1657. margin-left: 8px;
  1658. flex: 1;
  1659. }
  1660. }
  1661. .step-cascader {
  1662. .el-input {
  1663. width: 100% !important;
  1664. }
  1665. }
  1666. .upload {
  1667. width: 30px;
  1668. height: 30px;
  1669. overflow: hidden;
  1670. .upload-demo {
  1671. opacity: 0;
  1672. width: 100% !important;
  1673. }
  1674. }
  1675. }
  1676. </style>