list.vue 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908
  1. <template>
  2. <!-- 背景层,覆盖整个页面 -->
  3. <div class="list_container">
  4. <!-- 头部区域 -->
  5. <div class="title_examine">
  6. <div class="pub_title">账号列表</div>
  7. <div style="margin-left: auto">
  8. <el-input
  9. v-model="s_name"
  10. placeholder="输入检索用户名"
  11. size="normal"
  12. clearable
  13. @input="changeOid"
  14. style="margin-right: 10px; width: 200px"
  15. ></el-input>
  16. <el-input
  17. v-model="s_username"
  18. placeholder="输入检索账号"
  19. size="normal"
  20. clearable
  21. @input="changeOid"
  22. style="margin-right: 10px; width: 200px"
  23. ></el-input>
  24. <el-select
  25. v-model="checkRole"
  26. placeholder="选择身份"
  27. clearable
  28. filterable
  29. @change="changeOid"
  30. style="margin-right: 10px; width: 120px"
  31. >
  32. <el-option
  33. v-for="item in roleArray"
  34. :key="item.value"
  35. :label="item.label"
  36. :value="item.value"
  37. >
  38. </el-option>
  39. </el-select>
  40. <el-select
  41. v-model="checkOid"
  42. placeholder="选择学校"
  43. clearable
  44. filterable
  45. @change="changeOid"
  46. style="margin-right: 10px"
  47. >
  48. <el-option
  49. v-for="item in getSchool"
  50. :key="item.id"
  51. :label="item.name"
  52. :value="item.id"
  53. >
  54. </el-option>
  55. </el-select>
  56. <el-select
  57. v-model="checkOrg"
  58. placeholder="选择组织"
  59. clearable
  60. filterable
  61. @change="changeOrg"
  62. style="margin-right: 10px"
  63. >
  64. <el-option
  65. v-for="item in organizations"
  66. :key="item.id"
  67. :label="item.name"
  68. :value="item.id"
  69. >
  70. </el-option>
  71. </el-select>
  72. <el-button type="primary" size="small" @click="nextStep()"
  73. >新增账户</el-button
  74. >
  75. </div>
  76. </div>
  77. <!-- 学习名称组织名称表单区域 -->
  78. <el-dialog
  79. title="移动选择"
  80. class="table"
  81. :visible.sync="isOrgFormVisible"
  82. :before-close="close_table"
  83. width="920px"
  84. >
  85. <!-- 搜索框区域 -->
  86. <div class="input-container">
  87. <div class="input_box">
  88. <input
  89. type="text"
  90. v-model="searchQuery"
  91. placeholder="搜索学校"
  92. @change="ajax_org_check"
  93. class="table_find"
  94. />
  95. </div>
  96. <el-select
  97. style="margin-left: 10px"
  98. v-model="school.OrgId"
  99. placeholder="请选择组织"
  100. class="custom-select"
  101. @change="ajax_org_check"
  102. filterable
  103. clearable
  104. >
  105. <!-- 动态生成 <el-option> -->
  106. <el-option
  107. v-for="(org, index) in organizations"
  108. :key="index"
  109. :label="org.name"
  110. :value="org.id"
  111. >
  112. {{ org.name }}
  113. </el-option>
  114. </el-select>
  115. <el-select
  116. style="margin-left: 10px"
  117. v-model="selReg"
  118. placeholder="请选择区域"
  119. class="custom-select"
  120. @change="ajax_org_check"
  121. filterable
  122. clearable
  123. >
  124. <el-option
  125. v-for="(org, index) in regionCList"
  126. :key="index"
  127. :label="org.name"
  128. :value="org.name"
  129. >
  130. {{ org.name }}
  131. </el-option>
  132. </el-select>
  133. </div>
  134. <div class="table_down">
  135. <div v-if="cn_org">
  136. <div class="checkbox-container">
  137. <!-- 循环渲染每个学校 -->
  138. <div
  139. v-for="(school, index) in cn_school"
  140. :key="index"
  141. class="checkbox_comment"
  142. >
  143. <div class="checkbox-left">
  144. <label class="checkbox-label">
  145. <!-- 学校名称,显示 school.name -->
  146. <a>{{ school.name }}</a>
  147. </label>
  148. <!-- 单选框,使用 v-model 绑定到一个变量 -->
  149. <input
  150. type="radio"
  151. class="checkbox_input_org"
  152. name="school_selection"
  153. :value="school.id"
  154. v-model="selectedSchool"
  155. />
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. <!-- 按钮区域 -->
  162. <div slot="footer" class="dialog-footer">
  163. <el-button @click="close_table">取 消</el-button>
  164. <el-button type="primary" @click="add_school_dialog = true"
  165. >新增学校</el-button
  166. >
  167. <el-button type="primary" @click="add_org_dialog = true"
  168. >新增组织</el-button
  169. >
  170. <el-button type="primary" @click="ajax_confirm">确认移动</el-button>
  171. </div>
  172. </el-dialog>
  173. <!-- 新增账户弹窗 -->
  174. <el-dialog
  175. title="新增账户"
  176. class="table"
  177. :visible.sync="isTableUseVisible"
  178. :before-close="close_table"
  179. width="700px"
  180. >
  181. <div class="el-form-item">
  182. <label class="el-form-item__label">选择组织</label>
  183. <div class="el-form-item__content">
  184. <el-select
  185. v-model="person.selectedOrg"
  186. placeholder="请选择组织"
  187. class="custom-select"
  188. @change="orgChange"
  189. clearable
  190. filterable
  191. >
  192. <el-option
  193. v-for="item in organizations"
  194. :key="item.id"
  195. :label="item.name"
  196. :value="item.id"
  197. >
  198. </el-option>
  199. </el-select>
  200. </div>
  201. </div>
  202. <div class="el-form-item">
  203. <label class="el-form-item__label">选择学校</label>
  204. <div class="el-form-item__content">
  205. <el-select
  206. v-model="person.selectedSchool"
  207. placeholder="请选择学校"
  208. class="custom-select"
  209. @change="schoolChange"
  210. clearable
  211. filterable
  212. >
  213. <el-option
  214. v-for="item in getSchool2"
  215. :key="item.id"
  216. :label="item.name"
  217. :value="item.id"
  218. >
  219. </el-option>
  220. </el-select>
  221. </div>
  222. </div>
  223. <div>
  224. <form class="el-form">
  225. <div class="el-form-item">
  226. <label class="el-form-item__label">姓名</label>
  227. <div class="el-form-item__content">
  228. <el-input
  229. v-model="person.name"
  230. placeholder="请输入姓名"
  231. autocomplete="off"
  232. class="add_input"
  233. ></el-input>
  234. </div>
  235. </div>
  236. <div class="el-form-item">
  237. <label class="el-form-item__label">账号</label>
  238. <div class="el-form-item__content">
  239. <el-input
  240. v-model="person.account"
  241. placeholder="请输入账号"
  242. autocomplete="off"
  243. class="add_input"
  244. ></el-input>
  245. </div>
  246. <span style="margin-left: 5px;">{{ this.SuffixData }}</span>
  247. </div>
  248. <!-- <div class="el-form-item">
  249. <label class="el-form-item__label">选择身份</label>
  250. <div class="el-form-item__content">
  251. <el-select
  252. v-model="person.type"
  253. placeholder="请选择身份"
  254. class="custom-select"
  255. >
  256. <el-option :value="1" label="学生">学生</el-option>
  257. <el-option :value="2" label="老师">老师</el-option>
  258. </el-select>
  259. </div>
  260. </div> -->
  261. </form>
  262. </div>
  263. <!-- 按钮区域 -->
  264. <div slot="footer" class="el-dialog__footer">
  265. <el-button @click="close_table">取 消</el-button>
  266. <el-button type="primary" @click="addUser">确认</el-button>
  267. </div>
  268. </el-dialog>
  269. <!-- 新增学校弹窗 -->
  270. <el-dialog
  271. title="新增学校"
  272. class="table"
  273. :visible.sync="add_school_dialog"
  274. :before-close="close_add_school"
  275. width="700px"
  276. >
  277. <div class="el_dialog_school_content">
  278. <form class="el-form">
  279. <!-- 学校名称 -->
  280. <div class="el-form-item" style="margin-top: 15px">
  281. <label class="el-form-item__label" style="width: 100px"
  282. >学校名称</label
  283. >
  284. <div class="el-form-item__content" style="margin-left: 5px">
  285. <span>
  286. <div class="add_input el-input el-input--suffix">
  287. <input
  288. v-model="sch_name"
  289. type="text"
  290. autocomplete="off"
  291. placeholder="学校名称"
  292. class="el-input__inner"
  293. />
  294. </div>
  295. </span>
  296. </div>
  297. </div>
  298. <!-- 地区 -->
  299. <div class="el-form-item">
  300. <label class="el-form-item__label" style="width: 100px">地区</label>
  301. <div class="el-form-item__content" style="margin-left: 5px">
  302. <span>
  303. <div class="add_input el-input el-input--suffix">
  304. <input
  305. v-model="region"
  306. type="text"
  307. autocomplete="off"
  308. placeholder="请输入地区"
  309. class="el-input__inner"
  310. />
  311. </div>
  312. </span>
  313. </div>
  314. </div>
  315. <!-- 学校编码 -->
  316. <div class="el-form-item">
  317. <label class="el-form-item__label" style="width: 100px"
  318. >学校编码</label
  319. >
  320. <div class="el-form-item__content" style="margin-left: 5px">
  321. <span>
  322. <div class="add_input el-input el-input--suffix">
  323. <input
  324. v-model="schoolCode"
  325. type="text"
  326. autocomplete="off"
  327. placeholder="请输入编码"
  328. class="el-input__inner"
  329. />
  330. </div>
  331. </span>
  332. </div>
  333. </div>
  334. <!-- 学校类型
  335. <div class="el-form-item">
  336. <div class="el-form-item__content" style="margin-left: 100px;">
  337. <span>
  338. <el-radio v-model="schoolType" label="1">普通学校</el-radio>
  339. <el-radio v-model="schoolType" label="2">协同学校</el-radio>
  340. </span>
  341. </div>
  342. </div> -->
  343. <!-- 登录权限
  344. <div class="el-form-item">
  345. <div class="el-form-item__content" style="margin-left: 100px;">
  346. <span>
  347. <el-radio v-model="loginPermission" label="1">允许登录</el-radio>
  348. <el-radio v-model="loginPermission" label="2">不可登录</el-radio>
  349. </span>
  350. </div>
  351. </div> -->
  352. <!-- 上级组织 -->
  353. <div class="el-form-item">
  354. <label class="el-form-item__label" style="width: 100px"
  355. >上级组织</label
  356. >
  357. <div class="el-form-item__content" style="margin-left: 5px">
  358. <span>
  359. <div class="add_input el-input el-input--suffix">
  360. <el-form
  361. :model="school"
  362. ref="form"
  363. >
  364. <el-select
  365. v-model="school.parentOrgId"
  366. placeholder="请选择组织"
  367. class="custom-select"
  368. filterable
  369. >
  370. <el-option
  371. v-for="(org, index) in organizations"
  372. :key="index"
  373. :label="org.name"
  374. :value="org.id"
  375. >
  376. {{ org.name }}
  377. </el-option>
  378. </el-select>
  379. </el-form>
  380. </div>
  381. </span>
  382. </div>
  383. </div>
  384. <!-- 区域 -->
  385. <div class="el-form-item">
  386. <label class="el-form-item__label" style="width: 100px"
  387. >区域</label
  388. >
  389. <div class="el-form-item__content" style="margin-left: 5px">
  390. <span>
  391. <div class="add_input el-input el-input--suffix">
  392. <!-- <el-form
  393. :model="school"
  394. ref="form"
  395. > -->
  396. <el-select
  397. v-model="regionC"
  398. placeholder="请选择区域"
  399. class="custom-select"
  400. filterable
  401. >
  402. <el-option
  403. v-for="(org, index) in regionCList"
  404. :key="index"
  405. :label="org.name"
  406. :value="org.name"
  407. >
  408. {{ org.name }}
  409. </el-option>
  410. </el-select>
  411. <!-- </el-form> -->
  412. </div>
  413. </span>
  414. </div>
  415. </div>
  416. </form>
  417. </div>
  418. <!-- 按钮区域 -->
  419. <div slot="footer" class="el-dialog__footer">
  420. <el-button @click="close_add_school">取 消</el-button>
  421. <el-button type="primary" @click="ajax_add_school">确认</el-button>
  422. </div>
  423. </el-dialog>
  424. <!-- 新增组织弹窗 -->
  425. <el-dialog
  426. title="新增组织"
  427. class="table"
  428. :visible.sync="add_org_dialog"
  429. :before-close="close_add_school"
  430. width="700px"
  431. >
  432. <div class="el_dialog_org_content">
  433. <form class="el-form">
  434. <!-- 组织名称 -->
  435. <div class="el-form-item" style="margin-top: 15px">
  436. <label class="el-form-item__label" style="width: 100px"
  437. >组织名称</label
  438. >
  439. <div class="el-form-item__content" style="margin-left: 5px">
  440. <span>
  441. <div class="add_input el-input el-input--suffix">
  442. <input
  443. v-model="orgName"
  444. type="text"
  445. autocomplete="off"
  446. placeholder="组织名称"
  447. class="el-input__inner"
  448. />
  449. </div>
  450. </span>
  451. </div>
  452. </div>
  453. <!-- 地区 -->
  454. <div class="el-form-item">
  455. <label class="el-form-item__label" style="width: 100px"
  456. >组织编码</label
  457. >
  458. <div class="el-form-item__content" style="margin-left: 5px">
  459. <span>
  460. <div class="add_input el-input el-input--suffix">
  461. <input
  462. v-model="randomCode"
  463. type="text"
  464. autocomplete="off"
  465. placeholder="请输入随机码"
  466. class="el-input__inner"
  467. />
  468. </div>
  469. </span>
  470. </div>
  471. </div>
  472. <!-- 区域 -->
  473. <div class="el-form-item">
  474. <label class="el-form-item__label" style="width: 100px"
  475. >区域</label
  476. >
  477. <div class="el-form-item__content" style="margin-left: 5px">
  478. <span>
  479. <div class="add_input el-input el-input--suffix">
  480. <!-- <el-form
  481. :model="school"
  482. ref="form"
  483. > -->
  484. <el-select
  485. v-model="regionC"
  486. placeholder="请选择区域"
  487. class="custom-select"
  488. filterable
  489. >
  490. <el-option
  491. v-for="(org, index) in regionCList"
  492. :key="index"
  493. :label="org.name"
  494. :value="org.name"
  495. >
  496. {{ org.name }}
  497. </el-option>
  498. </el-select>
  499. <!-- </el-form> -->
  500. </div>
  501. </span>
  502. </div>
  503. </div>
  504. <!-- 登录权限
  505. <div class="el-form-item">
  506. <div class="el-form-item__content" style="margin-left: 100px;">
  507. <span>
  508. <el-radio v-model="radio" label="1">允许登录</el-radio>
  509. <el-radio v-model="radio" label="2">不可登录</el-radio>
  510. </span>
  511. </div>
  512. </div> -->
  513. </form>
  514. </div>
  515. <!-- 按钮区域 -->
  516. <div slot="footer" class="dialog-footer">
  517. <el-button @click="close_add_school">取 消</el-button>
  518. <el-button type="primary" @click="ajax_add_org">确认</el-button>
  519. </div>
  520. </el-dialog>
  521. <!-- 内容区域 -->
  522. <div class="content">
  523. <!-- 按钮区域 -->
  524. <div class="button_top">
  525. <!-- "启用中"按钮 -->
  526. <a
  527. @click="showType(1)"
  528. :style="{ color: type == 1 ? 'black' : 'rgb(179, 179, 179)' }"
  529. >启用中({{ tableData_start }})</a
  530. >
  531. <!-- "已停用"按钮 -->
  532. <a
  533. @click="showType(0)"
  534. :style="{ color: type == 0 ? 'black' : 'rgb(179, 179, 179)' }"
  535. >已停用({{ tableData_stop }})</a
  536. >
  537. </div>
  538. <!-- 启用中区域 -->
  539. <div>
  540. <el-table
  541. :data="tableData"
  542. border
  543. style="width: 100%"
  544. stripe
  545. :header-cell-style="headerCellStyle"
  546. v-loading="tableLoading"
  547. @selection-change="handleSelectionChange"
  548. :row-key="(row) => row.userid"
  549. >
  550. <!-- <el-table-column type="selection" width="50px" :reserve-selection="true"></el-table-column> -->
  551. <el-table-column
  552. show-overflow-tooltip
  553. prop="company_name"
  554. label="组织名称"
  555. min-width="32"
  556. header-align="center"
  557. align="center"
  558. />
  559. <el-table-column
  560. show-overflow-tooltip
  561. prop="company_number"
  562. label="学校名称"
  563. min-width="32"
  564. header-align="center"
  565. align="center"
  566. />
  567. <el-table-column
  568. show-overflow-tooltip
  569. prop="company_number"
  570. label="组织编号"
  571. min-width="32"
  572. header-align="center"
  573. align="center"
  574. >
  575. <template slot-scope="{ row }">
  576. <div>{{ row.orgCode ? row.orgCode : row.schoolCode ? row.schoolCode : '暂无' }}</div>
  577. </template>
  578. </el-table-column>
  579. <el-table-column
  580. show-overflow-tooltip
  581. prop="name"
  582. label="姓名"
  583. min-width="32"
  584. header-align="center"
  585. align="center"
  586. />
  587. <el-table-column
  588. show-overflow-tooltip
  589. prop="account"
  590. label="账户"
  591. min-width="32"
  592. header-align="center"
  593. align="center"
  594. />
  595. <el-table-column
  596. show-overflow-tooltip
  597. prop="Ctime"
  598. label="账户开通时间"
  599. min-width="40"
  600. header-align="center"
  601. align="center"
  602. />
  603. <el-table-column
  604. show-overflow-tooltip
  605. label="身份"
  606. min-width="32"
  607. header-align="center"
  608. align="center"
  609. >
  610. <template slot-scope="{ row }">
  611. <div>{{ roleType(row) }}</div>
  612. </template>
  613. </el-table-column>
  614. <el-table-column
  615. show-overflow-toolti
  616. label="操作"
  617. min-width="35"
  618. header-align="center"
  619. align="center"
  620. >
  621. <template slot-scope="{ row }">
  622. <el-button
  623. link
  624. type="text"
  625. size="small"
  626. @click="ajax__open_stop(row)"
  627. v-if="row.state == 1"
  628. >停用</el-button
  629. >
  630. <el-button
  631. link
  632. type="text"
  633. size="small"
  634. @click="run(row)"
  635. v-if="row.state == 1"
  636. >移动</el-button
  637. >
  638. <el-button
  639. link
  640. type="text"
  641. size="small"
  642. @click="ajax__open_stop(row)"
  643. v-if="row.state == 0"
  644. >启用</el-button
  645. >
  646. <!-- 管理员操作按钮,只有当 row.type === 1 时才显示 -->
  647. <el-button
  648. v-if="row.type === 1 && row.state == 1"
  649. link
  650. type="text"
  651. size="small"
  652. @click="ajax_admin(row.userid, row.role, row.type)"
  653. >
  654. {{ row.role === 1 ? "取消管理员" : "设置管理员" }}
  655. </el-button>
  656. </template>
  657. </el-table-column>
  658. </el-table>
  659. <!-- 分页区域 -->
  660. <div class="Pagetion" v-if="total">
  661. <el-pagination
  662. :current-page="currentPage"
  663. :page-size="pageSize"
  664. :total="total"
  665. layout="total, prev, pager, next, jumper"
  666. @current-change="handlePageChange"
  667. >
  668. </el-pagination>
  669. </div>
  670. </div>
  671. </div>
  672. </div>
  673. </template>
  674. <script>
  675. import { API_CONFIG } from "@/common/apiConfig";
  676. import { addOp } from "@/api/user";
  677. import { mapGetters } from "vuex";
  678. import { debounce } from "lodash";
  679. import { addUser } from "@/api/user.js";
  680. export default {
  681. name: "HelloWorld",
  682. components: {},
  683. data() {
  684. return {
  685. // 新增账户默认后缀
  686. SuffixData:'',
  687. // 储存筛选完后的学校
  688. schoolList:[],
  689. // 控制下拉菜单的显示与隐藏
  690. dropdownVisible: false,
  691. checked: true,
  692. showCompany: false, // 默认隐藏
  693. // 响应式数据
  694. //移动弹窗
  695. isOrgFormVisible: false,
  696. //新增账户
  697. isTableUseVisible: false,
  698. //新增组织
  699. add_org_dialog: false,
  700. //新增组织的变量定义
  701. orgName: "", // 组织名称
  702. u_create: "", // 创建人
  703. randomCode: "", //随机码(可以为空)
  704. uLogin: "1", // 登录状态 (1 或 2)
  705. radio: "1",
  706. //新增学校参数的定义
  707. sch_name: "", //学校名称
  708. region: "", //地区
  709. schoolType: "1", //学校单选框类型
  710. schoolCode: "", //学校编码
  711. loginPermission: "1", //是否允许登录
  712. //学校弹窗
  713. add_school_dialog: false,
  714. isCompanyDropdownVisible: false,
  715. companyListVisibility: [false, false, false],
  716. open_content: true,
  717. add_button: true,
  718. stop_content: false,
  719. open: true,
  720. stop: false,
  721. // 用来存储选中的学校名称
  722. selectedSchool: "",
  723. // 启用区域分页
  724. currentPage: 1, // 当前第几页
  725. pageSize: 10, // 每页显示条目数
  726. // 停止区域分页
  727. down_currentPage: 1, // 当前第几页
  728. down_pageSize: 10, // 每页显示的条目数
  729. // 两个分页初始化状态
  730. up_page: true,
  731. down_page: false,
  732. company_name: 0,
  733. // 启用数组
  734. tableData: [],
  735. // 停用数组
  736. tableData_start: "",
  737. tableData_stop: "",
  738. // 添加账户初始化
  739. form: {
  740. name: "",
  741. account: "",
  742. organization: "",
  743. school: "",
  744. },
  745. //移动组织初始化
  746. cn_org: true,
  747. hk_org: false,
  748. com_org: false,
  749. // 用于存放从后台获取的组织数据
  750. organizations: [],
  751. // 用于存放从后台获取的学校数据
  752. cn_school: [],
  753. searchQuery: "", // 用来存储输入框的值
  754. dialogVisible: true,
  755. school: {
  756. OrgId: null, // 初始化 OrgId 为 null 或适当的默认值
  757. },
  758. regionCList:[
  759. {id:1,name:'hk'},
  760. {id:2,name:'cn'}
  761. ], //区域列表
  762. regionC:'cn', //区域
  763. selReg:'', //区域搜索
  764. // 用来存储传递的参数
  765. ajaxParams: null,
  766. check_user_id: "", // 存放当前选择的用户的ID
  767. type: 1,
  768. total: 0,
  769. tableLoading: false,
  770. checkOrg: "",
  771. checkOid: "",
  772. s_name: "",
  773. s_username: "",
  774. checkRole: "",
  775. roleArray: [
  776. { value: "1", label: "老师" },
  777. { value: "2", label: "学生" },
  778. { value: "3", label: "管理员" },
  779. ],
  780. opUser: {},
  781. person: {
  782. name: "",
  783. account: "",
  784. type: "",
  785. selectedOrg: "", // 存放所选的组织
  786. selectedSchool: "", // 存放所选的学校
  787. },
  788. checkArray: [],
  789. };
  790. },
  791. computed: {
  792. ...mapGetters(["userid"]),
  793. roleType() {
  794. return function (row) {
  795. if (row.type == 2) {
  796. return "学生";
  797. } else if (row.type == 1) {
  798. return row.role == 1 ? "管理员" : "老师";
  799. }
  800. };
  801. },
  802. getSchool() {
  803. return this.checkOrg
  804. ? this.cn_school.filter((e) => e.org === this.checkOrg)
  805. : this.cn_school;
  806. },
  807. getSchool2() {
  808. return this.person.selectedOrg
  809. ? this.cn_school.filter((e) => e.org === this.person.selectedOrg)
  810. : this.cn_school;
  811. },
  812. getSchool3() {
  813. return this.school.OrgId || this.searchQuery
  814. ? this.cn_school.filter((e) => e.org === this.school.OrgId || e.name.includes(this.searchQuery))
  815. : this.cn_school;
  816. },
  817. },
  818. watch: {},
  819. methods: {
  820. handleSelectionChange(selectedRows) {
  821. this.checkArray = selectedRows.map((row) => row.userid);
  822. },
  823. // 移动按钮,将isOrgFormVisible区域显示
  824. run(row) {
  825. this.opUser = row;
  826. this.check_user_id = row.userid; // 将选中的userid存储到check_user_id中
  827. this.isOrgFormVisible = true; // 显示区域
  828. // console.log("选中的用户ID:", this.check_user_id); // 打印出当前的选中用户ID
  829. },
  830. // 移动关闭按钮
  831. close_table() {
  832. // 清空补充信息查询数据
  833. this.searchQuery = '';
  834. this.school.OrgId = null;
  835. this.selReg = '';
  836. this.ajax_school()
  837. this.SuffixData = ''
  838. this.isOrgFormVisible = false;
  839. this.isTableUseVisible = false;
  840. this.selectedSchool = ''
  841. },
  842. // 新增账户
  843. nextStep() {
  844. this.isTableUseVisible = true;
  845. this.person = {
  846. name: "",
  847. account: "",
  848. type: 2,
  849. selectedOrg: "", // 存放所选的组织
  850. selectedSchool: "", // 存放所选的学校
  851. };
  852. },
  853. //新增账户关闭
  854. form_clost() {
  855. this.isTableUseVisible = false;
  856. },
  857. //新增组织关闭
  858. // close_add_org() {
  859. // this.add_org_dialog = false;
  860. // },
  861. //新增学校关闭
  862. close_add_school() {
  863. this.regionC = 'cn'
  864. this.add_org_dialog = false;
  865. this.add_school_dialog = false;
  866. },
  867. showType(type) {
  868. this.type = type;
  869. this.currentPage = 1;
  870. this.getData();
  871. },
  872. // 页码扩展按钮
  873. handlePageChange(page) {
  874. this.currentPage = page;
  875. this.getData();
  876. },
  877. // 表头的背景色
  878. headerCellStyle() {
  879. return { backgroundColor: "#f1f1f1" };
  880. },
  881. // 已启用
  882. getData() {
  883. // 确认后发起请求
  884. this.tableLoading = true;
  885. let params = [
  886. {
  887. functionName: API_CONFIG.ajaxstart.functionName, // 使用配置中的存储过程名称
  888. r_type: this.type,
  889. cn: this.s_name,
  890. un: this.s_username,
  891. oid: this.checkOid,
  892. org: this.checkOrg,
  893. userType: this.checkRole,
  894. page: this.currentPage, // 使用当前页码
  895. num: this.pageSize, // 每页条目数
  896. },
  897. ];
  898. this.tableData = [];
  899. this.$ajax
  900. .post(API_CONFIG.baseUrl, params)
  901. .then((res) => {
  902. // 假设 res.data[0] 是返回的用户数据数组
  903. const users = res.data[0].map((user) => ({
  904. company_name: user.org_name || "暂无", // 组织名称
  905. company_number: user.school_name || "暂无", // 学校名称
  906. name: user.user_name || "暂无", // 姓名
  907. account: user.account_name || "暂无", // 账户
  908. userid: user.user_id,
  909. role: user.admin_role || 0, // 角色,假设 1 为管理员,0 为普通用户
  910. school: user.s_id,
  911. org: user.org,
  912. type: user.usertype,
  913. state: user.user_state,
  914. orgCode: user.org_code,
  915. schoolCode: user.school_code,
  916. Ctime: user.Ctime,
  917. }));
  918. // this.tableData = Array(this.pageSize * (this.currentPage - 1)).fill(null).concat(users);
  919. this.tableData = users;
  920. this.total = res.data[0][0].total_count;
  921. this.tableData_stop = res.data[2][0].num;
  922. this.tableData_start = res.data[1][0].num;
  923. this.tableLoading = false;
  924. console.log("you",res.data);
  925. })
  926. .catch((err) => {
  927. // 处理失败的响应
  928. this.tableLoading = false;
  929. // this.$message.error("查询失败");
  930. console.error("请求失败,错误信息:", err); // 打印更详细的错误信息
  931. });
  932. },
  933. // 停用或者启用
  934. ajax__open_stop(row) {
  935. const actionMessage = row.state == 1 ? "停用该用户" : "启用该用户";
  936. const successMessage = row.state == 1 ? "停用成功!" : "启用成功!";
  937. const cancelMessage = row.state == 1 ? "已取消停用" : "已取消启用";
  938. let params = [
  939. {
  940. functionName: API_CONFIG.userstate.functionName, // 调用存储过程的名称
  941. u_id: row.userid, // 将传入的userid设置为 u_id
  942. },
  943. ];
  944. // 弹窗提示确认
  945. this.$confirm(`此操作将会${actionMessage}, 是否继续?`, "提示", {
  946. confirmButtonText: "确定",
  947. cancelButtonText: "取消",
  948. type: "warning",
  949. })
  950. .then(() => {
  951. // 在用户点击确定后,发起 AJAX 请求
  952. this.$ajax
  953. .post(API_CONFIG.baseUrl, params)
  954. .then(async () => {
  955. // 提示操作成功
  956. this.$message({
  957. type: "success",
  958. message: successMessage,
  959. });
  960. this.getData();
  961. await addOp({
  962. uid: this.userid,
  963. cid: "",
  964. type: "user_op",
  965. content: `${row.state == 1 ? "停用" : "启用"}了${row.userid}`,
  966. });
  967. })
  968. .catch((err) => {
  969. // 处理失败的响应
  970. this.$message.error("处理失败");
  971. console.error("请求失败,错误信息:", err); // 打印详细错误信息
  972. });
  973. })
  974. .catch(() => {
  975. // 取消操作后提示
  976. this.$message({
  977. type: "info",
  978. message: cancelMessage,
  979. });
  980. });
  981. },
  982. //设置管理员
  983. ajax_admin(userid, role) {
  984. // 判断用户的角色,弹出相应的提示
  985. let messageContent =
  986. role === 1
  987. ? "此操作将会取消此用户的管理员状态,是否继续?"
  988. : "此操作将会设置该用户为管理员,是否继续?";
  989. // 弹窗确认操作
  990. this.$confirm(messageContent, "提示", {
  991. confirmButtonText: "确定",
  992. cancelButtonText: "取消",
  993. type: "warning",
  994. })
  995. .then(() => {
  996. // 发送请求时的参数
  997. let params = [
  998. {
  999. functionName: API_CONFIG.ajax_admin.functionName, // 存储过程的名称
  1000. u_id: userid,
  1001. },
  1002. ];
  1003. this.$ajax
  1004. .post(API_CONFIG.baseUrl, params)
  1005. .then(async () => {
  1006. // 只有在成功执行时调用这两个函数
  1007. this.getData();
  1008. // 如果更新成功,显示成功提示并调用 ajax_user_stop 和 getData
  1009. this.$message({
  1010. type: "success",
  1011. message: "已成功执行!",
  1012. });
  1013. await addOp({
  1014. uid: this.userid,
  1015. cid: "",
  1016. type: "user_op",
  1017. content: `将${userid}${
  1018. role == 1 ? "取消了管理员" : "设置了管理员"
  1019. }`,
  1020. });
  1021. })
  1022. .catch((error) => {
  1023. // 请求失败的处理
  1024. console.error("请求失败:", error);
  1025. this.$message({
  1026. type: "error",
  1027. message: "操作失败,请稍后再试",
  1028. });
  1029. });
  1030. })
  1031. .catch(() => {
  1032. // 取消操作时的提示
  1033. this.$message({
  1034. type: "info",
  1035. message: "已取消操作",
  1036. });
  1037. });
  1038. },
  1039. addUser() {
  1040. // 检查必填项
  1041. if (
  1042. !this.person.name ||
  1043. !this.person.account ||
  1044. !this.person.selectedSchool
  1045. ) {
  1046. this.$message({
  1047. type: "error",
  1048. message: "请填写所有必填项:姓名、账号、组织和学校。",
  1049. });
  1050. return; // 终止函数执行
  1051. }
  1052. let emailData = this.getEmailWithAt(this.person.account)
  1053. let zSuffix = ''
  1054. if (this.SuffixData && emailData) {
  1055. zSuffix = this.person.account.split('@')[0] + this.SuffixData
  1056. }else{
  1057. zSuffix = this.person.account + this.SuffixData
  1058. }
  1059. console.log('zSuffix',zSuffix);
  1060. // this.person.account
  1061. if (!/\S+@\S+\.\S+/.test(zSuffix)) {
  1062. this.$message.error("账号要填写邮箱格式");
  1063. return;
  1064. }
  1065. let params = {
  1066. alias: this.person.name,
  1067. username: zSuffix,
  1068. org: this.person.selectedOrg,
  1069. oid: this.person.selectedSchool,
  1070. ph: "",
  1071. cid: "",
  1072. type: 1,
  1073. opid: "",
  1074. dest: "",
  1075. eduid: "",
  1076. };
  1077. addUser(params)
  1078. .then(async (response) => {
  1079. if (response) {
  1080. await addOp({
  1081. uid: this.userid,
  1082. cid: "",
  1083. type: "user_op",
  1084. content: `添加了${this.person.name} 账号为${zSuffix}`,
  1085. });
  1086. this.$message({
  1087. type: "success",
  1088. message: "操作成功",
  1089. });
  1090. this.SuffixData = '';
  1091. this.isTableUseVisible = false;
  1092. this.getData(); // 例如刷新表格数据
  1093. }
  1094. })
  1095. .catch((error) => {
  1096. console.error("请求失败,错误信息:", error);
  1097. });
  1098. },
  1099. // 学校查询
  1100. ajax_school() {
  1101. // const params = [API_CONFIG.ajax_school]; // 使用配置中的接口参数
  1102. // 构建请求参数
  1103. let params = [
  1104. {
  1105. functionName: API_CONFIG.ajax_school.functionName, // 调用存储过程的名称
  1106. u_name: this.searchQuery, // 学校名称,绑定到 orgName
  1107. u_org: this.school.OrgId || '', // 选择的组织的 ID,绑定到 school.parentOrgId,如果没有选择则为空
  1108. u_regC: this.selReg
  1109. },
  1110. ];
  1111. this.$ajax
  1112. .post(API_CONFIG.baseUrl, params)
  1113. .then((res) => {
  1114. // console.log("返回的数据为:", res.data); // 检查返回的数据
  1115. if (res.data && Array.isArray(res.data[0])) {
  1116. // 将 name 和 org 都存入 cn_school 数组中
  1117. this.cn_school = res.data[0].map((item) => ({
  1118. name: item.name,
  1119. id: item.id,
  1120. org: item.org,
  1121. area:item.area
  1122. }));
  1123. // this.schoolList= res.data[0].map((item) => ({
  1124. // name: item.name,
  1125. // id: item.id,
  1126. // org: item.org,
  1127. // area:item.area
  1128. // }));
  1129. console.log(this.cn_school);
  1130. }
  1131. })
  1132. .catch((err) => {
  1133. this.$message.error("查询失败");
  1134. console.error("请求失败,错误信息:", err);
  1135. });
  1136. },
  1137. //组织查询
  1138. ajax_org() {
  1139. const params = [API_CONFIG.ajax_org]; // 使用配置中的接口参数
  1140. this.$ajax
  1141. .post(API_CONFIG.baseUrl, params)
  1142. .then((res) => {
  1143. // console.log("返回的数据为:", res.data); // 检查返回的数据
  1144. if (res.data && Array.isArray(res.data[0])) {
  1145. // 使用 map() 提取所有组织名称
  1146. this.organizations = res.data[0].map((item) => ({
  1147. name: item.name,
  1148. id: item.id,
  1149. }));
  1150. }
  1151. // console.log("返回的结果为:",this.organizations);
  1152. })
  1153. .catch((err) => {
  1154. this.$message.error("查询失败");
  1155. console.error("请求失败,错误信息:", err);
  1156. });
  1157. },
  1158. //关键词查询
  1159. ajax_school_name() {
  1160. this.selectedSchool = ""
  1161. },
  1162. //组织下拉菜单查询
  1163. ajax_org_check() {
  1164. this.selectedSchool = "";
  1165. this.ajax_school()
  1166. },
  1167. //新增学校
  1168. ajax_add_school() {
  1169. // 校验学校名称是否为空
  1170. if (!this.sch_name || this.sch_name.trim() === "") {
  1171. this.$message.error("学校名称不能为空!");
  1172. return;
  1173. }
  1174. // 构建请求参数
  1175. let params = [
  1176. {
  1177. functionName: API_CONFIG.ajax_add_school.functionName, // 调用存储过程的名称
  1178. u_name: this.sch_name, // 学校名称,绑定到 orgName
  1179. u_org: this.school.parentOrgId || "", // 选择的组织的 ID,绑定到 school.parentOrgId,如果没有选择则为空
  1180. u_dest: this.region || "", // 地区,绑定到 region,如果为空则传空字符串
  1181. u_type: this.schoolType || "", // 学校类型,绑定到 schoolType,如果没有选择则为空
  1182. u_code: this.schoolCode || "", // 学校编码,绑定到 schoolCode,如果为空则传空字符串
  1183. u_regionC: this.regionC || "",
  1184. u_isLogin: this.loginPermission === "1" ? 1 : 2, // 是否允许登录,默认传 2(不允许登录)如果没有选择
  1185. uid: this.userid,
  1186. },
  1187. ];
  1188. // 发起请求
  1189. this.$ajax
  1190. .post(API_CONFIG.baseUrl, params)
  1191. .then(() => {
  1192. this.$message({
  1193. type: "success",
  1194. message: "已成功执行!",
  1195. });
  1196. // 刷新学校列表
  1197. this.ajax_school();
  1198. // 关闭弹窗
  1199. this.add_school_dialog = false;
  1200. // 清空输入框、下拉菜单选择和单选框
  1201. this.sch_name = ""; // 清空学校名称
  1202. this.school.parentOrgId = ""; // 清空组织选择
  1203. this.region = ""; // 清空地区选择
  1204. this.schoolType = "1"; // 清空学校类型选择
  1205. this.schoolCode = ""; // 清空学校编码
  1206. this.regionC = 'cn'
  1207. this.loginPermission = "1"; // 清空登录权限的选择
  1208. })
  1209. .catch((err) => {
  1210. this.$message.error("插入失败");
  1211. console.error("请求失败,错误信息:", err);
  1212. });
  1213. },
  1214. //新增组织
  1215. ajax_add_org() {
  1216. // 获取弹窗中的输入内容
  1217. let orgName = this.orgName; // 组织名称
  1218. let randomCode = this.randomCode || ""; // 随机码(可为空)
  1219. let uLogin = this.radio; // 获取复选框选中的值(1 或 2)
  1220. // 验证组织名称不能为空
  1221. if (!orgName) {
  1222. this.$message.error("组织名称不能为空");
  1223. return;
  1224. }
  1225. // 构造请求参数
  1226. let params = [
  1227. {
  1228. functionName: API_CONFIG.ajax_add_org.functionName, // 调用存储过程的名称
  1229. u_name: orgName, // 组织名称
  1230. u_create: this.userid, // u_create 固定为0
  1231. u_code: randomCode, // 随机码(可以为空)
  1232. u_regionC: this.regionC,
  1233. u_login: uLogin, // 登录状态
  1234. },
  1235. ];
  1236. // 发起请求
  1237. this.$ajax
  1238. .post(API_CONFIG.baseUrl, params)
  1239. .then(() => {
  1240. this.$message({
  1241. type: "success",
  1242. message: "已成功执行!",
  1243. });
  1244. // 刷新组织列表
  1245. this.ajax_org();
  1246. //关闭弹窗
  1247. this.add_org_dialog = false;
  1248. // 清空输入框、下拉菜单选择和单选框
  1249. this.orgName = ""; // 清空学校名称
  1250. this.regionC = 'cn'
  1251. this.randomCode = ""; // 清空地区选择
  1252. this.uLogin = "1"; // 清空学校类型选择
  1253. })
  1254. .catch((err) => {
  1255. this.$message.error("插入失败");
  1256. console.error("请求失败,错误信息:", err);
  1257. });
  1258. },
  1259. //确认移动
  1260. ajax_confirm() {
  1261. // 获取选择的组织ID,确保 orgId 在调用之前已经定义
  1262. let orgId = this.school.OrgId || ""; // 如果没有选择组织,则为空字符串
  1263. // 获取选中的学校对象
  1264. const selectedSchoolObject = this.cn_school.find(
  1265. (school) => school.id === this.selectedSchool
  1266. );
  1267. // 判断学校ID是否为空
  1268. if (!selectedSchoolObject || !selectedSchoolObject.id) {
  1269. this.$message({
  1270. type: "warning",
  1271. message: "请选择你要移动的学校!",
  1272. });
  1273. return; // 学校ID为空时,阻止后续操作
  1274. }
  1275. if (selectedSchoolObject.org) {
  1276. orgId = selectedSchoolObject.org;
  1277. }
  1278. // 构造请求参数
  1279. let params = [
  1280. {
  1281. functionName: API_CONFIG.ajax_confirm.functionName, // 调用存储过程的名称
  1282. u_id: this.check_user_id, // 使用this.check_user_id来获取用户id
  1283. o_id: orgId || "", // 选择的组织的 ID,绑定到 school.parentOrgId,如果没有选择则为空
  1284. s_id: selectedSchoolObject.id, // 选中的学校的id
  1285. },
  1286. ];
  1287. // 发起请求
  1288. this.$ajax
  1289. .post(API_CONFIG.baseUrl, params)
  1290. .then(async () => {
  1291. this.$message({
  1292. type: "success",
  1293. message: "移动成功!",
  1294. });
  1295. this.isOrgFormVisible = false; // 隐藏区域
  1296. // 在此之后再进行输出
  1297. // console.log("选择的用户id为:", this.check_user_id);
  1298. // console.log("选择的组织id为:", orgId);
  1299. // console.log("选择的学校id为:", selectedSchoolObject.id);
  1300. this.getData(); // 刷新
  1301. //清空数据
  1302. this.school.OrgId = ""; // 清空所选组织
  1303. // 在此之后清空选中的学校
  1304. this.selectedSchool = null; // 取消选择,重置单选框
  1305. //刷新学校选择
  1306. this.ajax_school();
  1307. await addOp({
  1308. uid: this.userid,
  1309. cid: "",
  1310. type: "user_op",
  1311. content: `将${this.opUser.userid} 原组织id ${
  1312. this.opUser.org ? this.opUser.org : "无"
  1313. } 原学校id ${this.opUser.school}移动到 组织id ${
  1314. orgId ? orgId : "无"
  1315. } 学校id ${selectedSchoolObject.id}`,
  1316. });
  1317. })
  1318. .catch((err) => {
  1319. this.$message.error("移动失败");
  1320. console.error("请求失败,错误信息:", err);
  1321. });
  1322. },
  1323. changeOrg() {
  1324. this.checkOid = "";
  1325. this.currentPage = 1;
  1326. this.getData();
  1327. },
  1328. changeOid: debounce(function () {
  1329. this.currentPage = 1; // 重置当前页
  1330. this.getData(); // 调用获取数据的方法
  1331. }, 300),
  1332. orgChange() {
  1333. this.SuffixData = ''
  1334. this.person.selectedSchool = "";
  1335. this.getSuffix()
  1336. this.$forceUpdate()
  1337. },
  1338. getSuffix(){
  1339. let params = [
  1340. {
  1341. functionName: API_CONFIG.ajax_Suffix.functionName, // 调用存储过程的名称
  1342. org: this.person.selectedOrg, //组织id
  1343. oid: this.person.selectedSchool, //学校id
  1344. },
  1345. ];
  1346. // 发起请求
  1347. this.$ajax
  1348. .post(API_CONFIG.baseUrl, params)
  1349. .then((res) => {
  1350. console.log('getSuffix',res)
  1351. let data = res.data[0]
  1352. let orgData = res.data[1]
  1353. if(data.length > 0){
  1354. let ap = data[0].username
  1355. this.SuffixData = this.getEmailWithAt(ap)[0]
  1356. } else if (orgData.length > 0) {
  1357. let ap = orgData[0].username
  1358. this.SuffixData = this.getEmailWithAt(ap)[0]
  1359. }
  1360. })
  1361. .catch((err) => {
  1362. console.error("请求失败,错误信息:", err);
  1363. });
  1364. },
  1365. getEmailWithAt(email) {
  1366. const regex = /@[^@]+$/; // 匹配最后一个 @ 及其后的内容
  1367. const match = email.match(regex);
  1368. return match ? match : '';
  1369. },
  1370. schoolChange() {
  1371. for (var i = 0; i < this.cn_school.length; i++) {
  1372. if (
  1373. this.cn_school[i].id == this.person.selectedSchool &&
  1374. this.cn_school[i].org
  1375. ) {
  1376. this.person.selectedOrg = this.cn_school[i].org;
  1377. }
  1378. }
  1379. this.SuffixData = ''
  1380. if (this.person.selectedSchool != '') {
  1381. this.getSuffix()
  1382. }
  1383. this.$forceUpdate()
  1384. },
  1385. },
  1386. mounted() {
  1387. // this.ajax_user_stop(); // 如果是在启用区域,停用
  1388. this.getData(); // 如果是在停用区域,启用
  1389. this.ajax_org(); // 组件创建时,立即调用 ajax_org 获取数据
  1390. this.ajax_school(); // 组件创建时,立即调用 ajax_org 获取数据
  1391. },
  1392. };
  1393. </script>
  1394. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1395. <style scoped>
  1396. .list_container {
  1397. width: 100%;
  1398. height: 100%;
  1399. padding: 10px;
  1400. box-sizing: border-box;
  1401. overflow: auto;
  1402. }
  1403. /* 内容区域 */
  1404. .content {
  1405. width: 100%;
  1406. overflow: auto;
  1407. height: calc(100% - 75px);
  1408. }
  1409. /* 按钮区域 */
  1410. .button_top {
  1411. width: 100%;
  1412. display: flex;
  1413. align-items: center;
  1414. margin: 10px 0;
  1415. }
  1416. .button_top a {
  1417. cursor: pointer;
  1418. color: black;
  1419. font-weight: bold;
  1420. }
  1421. .button_top a + a {
  1422. margin-left: 20px;
  1423. }
  1424. /* 表单移动弹窗 */
  1425. .el-table--scrollable-x .el-table__body-wrapper {
  1426. overflow-x: hidden;
  1427. }
  1428. /* 表单头高度 */
  1429. .el-table .el-table__header th {
  1430. height: 60px; /* 设置表头行高 */
  1431. color: rgb(51, 51, 51);
  1432. }
  1433. .el-table th {
  1434. background-color: rgb(247, 247, 247) !important;
  1435. }
  1436. /* 表格内容的高度以及字体颜色 */
  1437. .el-table__row {
  1438. height: 60px;
  1439. color: black;
  1440. }
  1441. /* 表单中操作栏的文字间距 */
  1442. .el-button + .el-button,
  1443. .el-checkbox {
  1444. margin-left: 25px;
  1445. }
  1446. /* 添加账户的按钮 */
  1447. .add-button {
  1448. display: flex;
  1449. align-items: center;
  1450. background-color: transparent;
  1451. border: none;
  1452. cursor: pointer;
  1453. font-size: 18px;
  1454. color: black;
  1455. font-weight: bold;
  1456. margin-left: -900px;
  1457. margin-top: 35px;
  1458. float: left;
  1459. }
  1460. /* +号图标 */
  1461. .add-icon {
  1462. border: 2px solid black; /* 设置黑色边框 */
  1463. color: black; /* 设置加号颜色为黑色 */
  1464. border-radius: 50%; /* 设置为圆形 */
  1465. width: 15px; /* 设置圆圈的宽度 */
  1466. height: 15px; /* 设置圆圈的高度 */
  1467. display: flex; /* 使用 Flexbox 使加号居中 */
  1468. align-items: center; /* 垂直居中 */
  1469. justify-content: center; /* 水平居中 */
  1470. margin-right: 8px; /* 图标与文本之间的间距 */
  1471. }
  1472. .el_title {
  1473. font-size: 18px !important;
  1474. color: #fff !important;
  1475. line-height: 40px;
  1476. }
  1477. /* 移动弹窗的选择区域 */
  1478. .table_down {
  1479. width: 100%;
  1480. height: 450px;
  1481. /* 添加滚动条 */
  1482. overflow-y: auto; /* 当内容超出时,显示垂直滚动条 */
  1483. max-height: 450px; /* 设置最大高度以限制显示区域 */
  1484. }
  1485. /* 头部区域 */
  1486. .table_top {
  1487. width: 630px;
  1488. height: 40px;
  1489. float: left;
  1490. margin-left: 250px;
  1491. margin-top: 20px;
  1492. /* border: 1px solid red; */
  1493. }
  1494. /* 移动弹窗头部区域文字 */
  1495. .organzition_top {
  1496. font-size: 15px;
  1497. text-align: center;
  1498. float: left;
  1499. padding-right: 95px;
  1500. color: #0076fe;
  1501. cursor: pointer;
  1502. }
  1503. /* X号推出弹窗按钮 */
  1504. .table_close {
  1505. color: #999;
  1506. position: absolute;
  1507. font-size: 25px;
  1508. float: left;
  1509. margin-left: 420px;
  1510. cursor: pointer;
  1511. margin-top: 10px;
  1512. }
  1513. /* 输入框容器*/
  1514. .input-container {
  1515. width: 100%;
  1516. display: flex;
  1517. align-items: center;
  1518. /* border: 1px solid red; */
  1519. }
  1520. /* 搜索框 */
  1521. .table_find {
  1522. width: 100%;
  1523. height: 40px;
  1524. padding-right: 50px;
  1525. padding-left: 10px;
  1526. border: 1px solid rgb(189, 189, 189);
  1527. font-size: 15px;
  1528. outline: none;
  1529. cursor: pointer;
  1530. border-radius: 10px;
  1531. box-sizing: border-box;
  1532. }
  1533. /* 按钮选择区域 */
  1534. .check_box_content {
  1535. width: 90%;
  1536. height: 45px;
  1537. float: left;
  1538. margin-top: 64px;
  1539. border: 1px solid red;
  1540. }
  1541. /* 按钮样式 */
  1542. .check_box_content .el-button {
  1543. float: left;
  1544. margin-top: 5px;
  1545. }
  1546. /* 搜索放大镜符号 */
  1547. .el-icon-search {
  1548. font-size: 25px;
  1549. position: absolute;
  1550. display: block;
  1551. color: black;
  1552. font-weight: bold;
  1553. cursor: pointer;
  1554. top: 50%;
  1555. transform: translateY(-50%);
  1556. right: 20px;
  1557. }
  1558. /* 自定义 el-select 的外部样式 */
  1559. .custom-select {
  1560. width: 220px; /* 设置宽度 */
  1561. font-size: 14px; /* 设置字体大小 */
  1562. }
  1563. /* 修改 el-input__inner 样式 */
  1564. .custom-select .el-input__inner {
  1565. height: 30px; /* 修改输入框的高度 */
  1566. font-size: 16px; /* 修改字体大小 */
  1567. padding-left: 15px; /* 修改左边的内边距 */
  1568. border-radius: 6px; /* 设置圆角 */
  1569. border: 1px solid #dcdfe6; /* 设置边框 */
  1570. }
  1571. /* 如果需要修改选项的样式,可以使用 .el-select-dropdown__item */
  1572. .custom-select .el-select-dropdown__item {
  1573. font-size: 14px; /* 修改下拉框选项的字体大小 */
  1574. padding: 12px; /* 修改选项的内边距 */
  1575. }
  1576. .custom-select .el-select-dropdown__item.selected {
  1577. background-color: #409eff; /* 设置选中项的背景色 */
  1578. color: #fff; /* 设置选中项的字体颜色 */
  1579. }
  1580. /* 弹窗选择区域 */
  1581. .checkbox-container {
  1582. height: auto;
  1583. width: 100%;
  1584. display: flex;
  1585. flex-direction: row;
  1586. flex-wrap: wrap;
  1587. }
  1588. /* .checkbox_comment样式 */
  1589. .checkbox_comment {
  1590. position: relative; /* 为复选框和下划线提供定位 */
  1591. width: 50%;
  1592. height: 50px;
  1593. margin-top: 10px;
  1594. display: flex; /* 使用flexbox对齐 */
  1595. align-items: center; /* 垂直居中 */
  1596. justify-content: space-between; /* 确保文本和复选框分别位于两端 */
  1597. float: left;
  1598. }
  1599. /* 下划线 */
  1600. .checkbox_comment::after {
  1601. content: "";
  1602. position: absolute;
  1603. bottom: 0;
  1604. left: 13%;
  1605. width: 250px;
  1606. height: 1px;
  1607. background-color: #e7e7e7;
  1608. }
  1609. /* .checkbox-left部分 */
  1610. .checkbox-left {
  1611. flex-grow: 1; /* 使该部分占据剩余空间 */
  1612. display: flex;
  1613. align-items: center;
  1614. }
  1615. .checkbox-left a {
  1616. color: #000000;
  1617. font-size: 14px;
  1618. margin-left: 70px; /* Adjust the spacing between text and checkbox */
  1619. float: left;
  1620. white-space: nowrap; /* Prevent line breaks */
  1621. overflow: hidden; /* Hide overflow */
  1622. text-overflow: ellipsis; /* Add ellipsis for overflow text */
  1623. max-width: 240px; /* Set a maximum width to trigger ellipsis */
  1624. }
  1625. /* 去除原生复选框样式 */
  1626. .checkbox_input {
  1627. -webkit-appearance: none; /* 去除Safari等浏览器默认样式 */
  1628. -moz-appearance: none; /* 去除Firefox的默认样式 */
  1629. appearance: none; /* 去除默认样式 */
  1630. width: 20px; /* 设置复选框的宽度 */
  1631. height: 20px; /* 设置复选框的高度 */
  1632. border: 1.5px solid #000000; /* 默认边框颜色 */
  1633. position: relative; /* 设置定位,方便后面绝对定位勾号 */
  1634. cursor: pointer; /* 鼠标悬停时显示为可点击状态 */
  1635. float: right;
  1636. margin-top: 20px;
  1637. margin-right: 10px;
  1638. }
  1639. .checkbox_input:checked {
  1640. background-color: #007bff; /* 选中时背景颜色为蓝色 */
  1641. border-color: #007bff; /* 边框颜色为蓝色 */
  1642. }
  1643. /* 选中时的白色勾号 */
  1644. .checkbox_input:checked::before {
  1645. content: "";
  1646. position: absolute;
  1647. top: 0px;
  1648. left: 5px;
  1649. width: 6px;
  1650. height: 12px;
  1651. border: solid white;
  1652. border-width: 0 2px 2px 0;
  1653. transform: rotate(45deg);
  1654. }
  1655. /* 去除原生复选框样式 */
  1656. .checkbox_input_org {
  1657. -webkit-appearance: none; /* 去除Safari等浏览器默认样式 */
  1658. -moz-appearance: none; /* 去除Firefox的默认样式 */
  1659. appearance: none; /* 去除默认样式 */
  1660. width: 20px; /* 设置复选框的宽度 */
  1661. height: 20px; /* 设置复选框的高度 */
  1662. border: 1.5px solid #000000; /* 默认边框颜色 */
  1663. cursor: pointer; /* 鼠标悬停时显示为可点击状态 */
  1664. position: absolute; /* 使用绝对定位,确保其位于右侧 */
  1665. right: 15px; /* 右侧间距 */
  1666. }
  1667. /* 组织表的选择框样式 */
  1668. /* 选中时的样式 */
  1669. .checkbox_input_org:checked {
  1670. background-color: #007bff; /* 选中时背景颜色为蓝色 */
  1671. border-color: #007bff; /* 边框颜色为蓝色 */
  1672. }
  1673. /* 选中时的白色勾号 */
  1674. .checkbox_input_org:checked::before {
  1675. content: "";
  1676. position: absolute;
  1677. top: 0px;
  1678. left: 5px;
  1679. width: 6px;
  1680. height: 12px;
  1681. border: solid white;
  1682. border-width: 0 2px 2px 0;
  1683. transform: rotate(45deg);
  1684. }
  1685. /* 组织名称 */
  1686. .checkbox-company {
  1687. margin-top: 60px; /* 可选:设置顶部间距 */
  1688. float: left;
  1689. /* border: 1px solid red; */
  1690. height: auto;
  1691. width: 350px;
  1692. }
  1693. /* 分页区域 */
  1694. .Pagetion {
  1695. width: auto;
  1696. margin-top: 10px;
  1697. /* border: 1px solid red; */
  1698. }
  1699. /* 分页页数间隔 */
  1700. /* 设置分页按钮的宽度 */
  1701. .el-pagination .el-pagination__prev,
  1702. .el-pagination .el-pagination__next {
  1703. width: 60px; /* 设置上一页和下一页按钮的宽 */
  1704. }
  1705. .el-pager li {
  1706. padding: 0px 35px;
  1707. background: #fff;
  1708. font-size: 13px;
  1709. min-width: 35.5px;
  1710. height: 28px;
  1711. line-height: 30px;
  1712. box-sizing: border-box;
  1713. text-align: center;
  1714. }
  1715. /* 操作字体 */
  1716. .el-button--text {
  1717. border-color: transparent;
  1718. color: #0076fe;
  1719. background: 0 0;
  1720. padding-left: 0;
  1721. padding-right: 0;
  1722. }
  1723. /* 添加账户头顶 */
  1724. /* 输入框 */
  1725. .form_input {
  1726. width: 400px;
  1727. }
  1728. .el-form {
  1729. /* margin-left: 66px;
  1730. width: 60%; */
  1731. /* border: 1px solid red; */
  1732. }
  1733. /* 确认跟取消区域 */
  1734. .form_tool {
  1735. margin-top: 20px;
  1736. float: left;
  1737. margin-left: 90px;
  1738. }
  1739. /* 按钮样式 */
  1740. .form_tool .el-button {
  1741. width: 100px;
  1742. }
  1743. /* 添加账户的容器 */
  1744. .el-dialog__body {
  1745. color: #606266;
  1746. font-size: 14px;
  1747. height: 180px;
  1748. }
  1749. /* 新增组织的内容容器 */
  1750. .el_dialog_org_content {
  1751. color: #606266;
  1752. font-size: 14px;
  1753. height: 120px;
  1754. }
  1755. /* 新增学校的内容容器 */
  1756. .el_dialog_school_content {
  1757. color: #606266;
  1758. font-size: 14px;
  1759. /* height: 300px; */
  1760. }
  1761. /* 新增学校按钮 */
  1762. .add_school {
  1763. float: left;
  1764. margin-top: 40px;
  1765. margin-left: 100px;
  1766. }
  1767. /* 确认移动按钮 */
  1768. .add_run {
  1769. float: right;
  1770. margin-top: 40px;
  1771. margin-right: 100px;
  1772. }
  1773. /* 使用v-deep深度,进入元素设置表格行的背景色 */
  1774. ::v-deep
  1775. .el-table--striped
  1776. .el-table__body
  1777. tr.el-table__row--striped
  1778. td.el-table__cell {
  1779. background-color: #f1f1f1;
  1780. }
  1781. .el-form-item {
  1782. margin-bottom: 22px;
  1783. display: flex;
  1784. align-items: center;
  1785. /* border: 1px solid black; */
  1786. }
  1787. .el-form-item__label {
  1788. font-size: 14px;
  1789. color: #606266;
  1790. line-height: 40px;
  1791. margin-left: 20px;
  1792. width: 70px;
  1793. }
  1794. .el-form-item__content {
  1795. line-height: 40px;
  1796. position: relative;
  1797. font-size: 14px;
  1798. }
  1799. .el-dialog {
  1800. position: relative;
  1801. margin: 0;
  1802. background: #fff;
  1803. border-radius: 2px;
  1804. box-sizing: border-box;
  1805. width: 50%;
  1806. height: auto;
  1807. }
  1808. /* 停用表单的滑动条 */
  1809. ::v-deep.el-table--scrollable-x .el-table__body-wrapper {
  1810. overflow-x: hidden;
  1811. }
  1812. ::v-deep.el-table__body-wrapper is-scrolling-left {
  1813. overflow-x: hidden;
  1814. }
  1815. /* 选择组织下拉菜单的鼠标悬浮效果 */
  1816. ::v-deep.el-select-dropdown__item:hover {
  1817. background-color: #f5f7fa;
  1818. }
  1819. /* 下拉菜单的滚动条 */
  1820. ::v-deep.el-select-dropdown__wrap .el-scrollbar__wrap {
  1821. overflow-y: auto;
  1822. overflow-x: hidden;
  1823. height: 100%;
  1824. }
  1825. /* 下拉菜单的ul顶部 */
  1826. ::v-deep.el-scrollbar__view .el-select-dropdown__list {
  1827. list-style: none;
  1828. padding: 5px 0;
  1829. margin: 0;
  1830. box-sizing: border-box;
  1831. }
  1832. /* 下拉菜单底部部分 */
  1833. ::v-deep.el-scrollbar__bar .is-vertical {
  1834. width: 0px;
  1835. height: 0px;
  1836. }
  1837. ::v-deep.el-scrollbar__bar .is-horizontal {
  1838. width: 0px;
  1839. height: 0px;
  1840. }
  1841. .table >>> .el-dialog__header {
  1842. padding: 15px 20px;
  1843. background: #454545;
  1844. }
  1845. .table >>> .el-dialog__title {
  1846. color: #fff;
  1847. }
  1848. .input_box {
  1849. position: relative;
  1850. height: 40px;
  1851. width: 200px;
  1852. }
  1853. </style>