Setting.vue 50 KB

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