list.vue 52 KB

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