addPage.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620
  1. <template>
  2. <div class="teacher-add-page">
  3. <div class="public-form-box scrollbar-box">
  4. <div class="top-title-box">
  5. <p>{{titleName}}</p>
  6. </div>
  7. <el-form :model="form" class="top-info-box" ref="form" :inline="true" :rules="rules" label-width="180px">
  8. <div class="left-info-box">
  9. <img :src="form.avatar" v-if="form.avatar">
  10. <img src="@/assets/ZDimages/tx_cion.png" v-if="!form.avatar">
  11. <el-upload
  12. v-if="!editType"
  13. class="certificate-avatar-uploader"
  14. :action="uploadImgUrl"
  15. :show-file-list="false"
  16. accept="image/jpeg,image/gif,image/png"
  17. :on-success="handleAvatarSuccess"
  18. :headers="headers"
  19. :before-upload="beforeAvatarUpload">
  20. <p>上传证件照</p>
  21. </el-upload>
  22. </div>
  23. <div class="right-info-box">
  24. <el-form-item label="姓名:" prop="nickName">
  25. <el-input
  26. :disabled="editType"
  27. style="width:218px;"
  28. maxlength="50"
  29. v-model="form.nickName"
  30. placeholder="请输入名称"
  31. clearable
  32. size="small"
  33. />
  34. </el-form-item>
  35. <el-form-item label="性别:" prop="sex">
  36. <el-radio-group v-model="form.sex" v-if="!editType">
  37. <el-radio :label="0" style="margin-left:20px;width:70px;">男</el-radio>
  38. <el-radio :label="1">女</el-radio>
  39. </el-radio-group>
  40. <p v-if="editType" style="line-height:40px;color:#999;width:180px;padding-left:40px;">{{form.sex==0?'男':'女'}}</p>
  41. </el-form-item>
  42. <el-form-item label="工号:" prop="userName">
  43. <el-input
  44. style="width:218px;"
  45. :disabled="editType"
  46. maxlength="50"
  47. v-model="form.userName"
  48. placeholder="请输入工号"
  49. clearable
  50. size="small"
  51. />
  52. </el-form-item>
  53. <el-form-item label="所在部门:" prop="deptId">
  54. <el-cascader
  55. :disabled="editType"
  56. :show-all-levels="false"
  57. v-model="form.deptId"
  58. :options="deptOptions"
  59. :props="{ checkStrictly: true, value: 'id', label: 'label',emitPath:false }"></el-cascader>
  60. </el-form-item>
  61. <el-form-item label="身份:" prop="position">
  62. <el-select
  63. :disabled="editType"
  64. v-model="form.position"
  65. filterable
  66. remote
  67. clearable
  68. reserve-keyword
  69. @change="positionSelectClick"
  70. @clear="positionClearClick"
  71. placeholder="请选择身份"
  72. :remote-method="positionSelect">
  73. <el-option
  74. v-for="item in positionOptions"
  75. :key="item.postId"
  76. :label="item.postName"
  77. :value="item.postId">
  78. </el-option>
  79. </el-select>
  80. </el-form-item>
  81. <el-form-item label="手机号码:" prop="phonenumber">
  82. <el-input
  83. :disabled="editType"
  84. style="width:218px;"
  85. maxlength="25"
  86. onkeyup="this.value=this.value.replace(/[^\d.]/g,'')"
  87. v-model="form.phonenumber"
  88. placeholder="请输入手机号码"
  89. clearable
  90. size="small"
  91. />
  92. </el-form-item>
  93. <el-form-item label="职称:" prop="category">
  94. <el-select
  95. :disabled="editType"
  96. v-model="form.category"
  97. filterable
  98. remote
  99. clearable
  100. reserve-keyword
  101. @change="categorySelectClick"
  102. @clear="categoryClearClick"
  103. placeholder="请选择身份"
  104. :remote-method="categorySelect">
  105. <el-option
  106. v-for="item in categoryOptions"
  107. :key="item.dictValue"
  108. :label="item.dictLabel"
  109. :value="item.dictValue">
  110. </el-option>
  111. </el-select>
  112. </el-form-item>
  113. <el-form-item label="邮箱:" prop="email">
  114. <el-input
  115. :disabled="editType"
  116. style="width:218px;"
  117. maxlength="40"
  118. v-model="form.email"
  119. placeholder="请输入邮箱"
  120. clearable
  121. size="small"
  122. />
  123. </el-form-item>
  124. <el-form-item label="校园卡号:" prop="cardNum">
  125. <el-input
  126. :disabled="editType"
  127. style="width:218px;"
  128. onkeyup="this.value=this.value.replace(/^\s*|\s*$/g,'')"
  129. maxlength="30"
  130. v-model="form.cardNum"
  131. placeholder="请输入校园卡号"
  132. clearable
  133. size="small"
  134. />
  135. </el-form-item>
  136. <el-form-item label="文化程度:" prop="education">
  137. <el-select
  138. :disabled="editType"
  139. v-model="form.education"
  140. filterable
  141. remote
  142. clearable
  143. reserve-keyword
  144. @change="educationSelectClick"
  145. @clear="educationClearClick"
  146. placeholder="请选择身份"
  147. :remote-method="educationSelect">
  148. <el-option
  149. v-for="item in educationOptions"
  150. :key="item.dictValue"
  151. :label="item.dictLabel"
  152. :value="item.dictValue">
  153. </el-option>
  154. </el-select>
  155. </el-form-item>
  156. <el-form-item label="出生日期:" prop="dateBirth">
  157. <el-date-picker
  158. :disabled="editType"
  159. v-model="form.dateBirth"
  160. type="date"
  161. placeholder="请选择出生日期">
  162. </el-date-picker>
  163. </el-form-item>
  164. </div>
  165. </el-form>
  166. <user-list-one ref="userOpen"></user-list-one>
  167. </div>
  168. <div class="bottom-button-box" v-if="editType">
  169. <p class="null-p"></p>
  170. <p class="button-p-1 reset-button-one" @click="outPageButton">返回</p>
  171. <p class="null-p"></p>
  172. </div>
  173. <div class="bottom-button-box" v-if="!editType">
  174. <p class="null-p"></p>
  175. <p class="button-p-1 reset-button-one" @click="outPageButton">返回</p>
  176. <addPageSubPageSZDX class="button-p-2" v-if="versionField() === 'suZhouDaXue'"></addPageSubPageSZDX>
  177. <addPageSubPagePublic class="button-p-2" v-else></addPageSubPagePublic>
  178. <p class="null-p"></p>
  179. </div>
  180. </div>
  181. </template>
  182. <script>
  183. import userListOne from "./userListOne.vue"
  184. import { listMenuAll} from "@/api/system/menu";
  185. import { getToken } from "@/utils/auth";
  186. import { treeselect } from "@/api/system/dept";
  187. import { optionselect, getVaguet, userPermit, addUserTeacher, putUserTeacherNew } from "@/api/system/user_teacher";
  188. import { getPermitOptionList, getPermitInfo } from "@/api/laboratory/managePermissionTemplates";
  189. import { addSystemPermit } from "@/api/laboratory/managePermissionTemplates";
  190. import Treeselect from "@riophae/vue-treeselect";
  191. import addPageSubPagePublic from './differenceComponent/addPageSubPagePublic.vue'
  192. import addPageSubPageSZDX from './differenceComponent/addPageSubPageSZDX.vue'
  193. export default {
  194. name: "addPage",
  195. props:{
  196. editType:{},
  197. propsData:{},
  198. titleName:{},
  199. },
  200. components: {
  201. userListOne,
  202. Treeselect,
  203. addPageSubPagePublic,
  204. addPageSubPageSZDX
  205. },
  206. data() {
  207. return {
  208. uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
  209. headers: {
  210. Authorization: "Bearer " + getToken(),
  211. },
  212. menuList:[],
  213. menuListData:[],
  214. originalMenuList:[],
  215. form:{
  216. avatar:"", //头像
  217. nickName:"", //姓名
  218. sex:0, //性别
  219. userName:"", //工号
  220. deptId:"", //所在部门
  221. position:"", //身份
  222. category:"", //职称
  223. phonenumber:"", //联系方式
  224. cardNum:"", //校园卡号
  225. education:"", //文化程度
  226. dateBirth:"", //出生日期
  227. email:"", //邮箱
  228. nature:0, //在职离职
  229. isCheck:0, //是否检查者 0否 1是
  230. faceImg:"", //人脸照片
  231. signature:"", //电子签名
  232. status:0, //账户状态,启用停用
  233. },
  234. rules:{
  235. nickName: [{ required: true, message: "请输入姓名", trigger: "blur" },
  236. { required: true, message: "请输入姓名", validator: this.spaceJudgment, trigger: "blur" }],
  237. userName: [{ required: true, message: "请输入工号", trigger: "blur" },
  238. { required: true, message: "请输入工号", validator: this.spaceJudgment, trigger: "blur" }],
  239. deptId: [{ required: true, message: "请选择部门", trigger: "blur" }],
  240. position: [{ required: true, message: "请选择身份", trigger: "blur" }],
  241. name: [{ required: true, message: "请输入模板名称", trigger: "blur" },
  242. { required: true, message: "请输入模板名称", validator: this.spaceJudgment, trigger: "blur" }],
  243. deptIds: [{ required: true, message: "请选择指定部门", trigger: "blur" }],
  244. phonenumber: [
  245. { required: true, message: "请输入手机号码", trigger: "blur" },
  246. { required: true, message: "请输入手机号码", validator: this.spaceJudgment, trigger: "blur" }
  247. ],
  248. },
  249. textType:false,
  250. //数据范围列表
  251. optionsDataListOne:[
  252. {type: 1, value: "所有数据",},
  253. {type: 2, value: "本部门及下级部门数据",},
  254. {type: 3, value: "本部门及指定部门数据",},
  255. ],
  256. optionsDataList:[
  257. {type: 1, value: "所有数据",},
  258. {type: 2, value: "本部门及下级部门数据",},
  259. {type: 3, value: "本部门及指定部门数据",},
  260. {type: 4, value: "当前账号数据",},
  261. ],
  262. //数据范围部门弹窗
  263. deptOpen:false,
  264. deptOpenType:'',
  265. //部门数据结构树
  266. treeselectList:[],
  267. //指定部门数据
  268. deptForm:{
  269. deptIds:[],
  270. maxIndex:"",
  271. bigIndex:"",
  272. minIndex:"",
  273. dataScope:"",
  274. },
  275. //快捷权限列表
  276. templateList:[],
  277. templateKey:"",
  278. templateName:"",
  279. //权限勾选数据
  280. permissionOpen:false,
  281. permissionCheckData:{},
  282. allCheckType:false,
  283. maxIndex:'',
  284. bigIndex:'',
  285. minIndex:'',
  286. //身份列表
  287. positionOptions:[],
  288. //部门列表
  289. deptOptions:[],
  290. //职称列表
  291. categoryOptions:[],
  292. //文化列表
  293. educationOptions:[],
  294. //另存
  295. saveOpen:false,
  296. saveForm:{
  297. name:"",
  298. type:0,
  299. text:"",
  300. },
  301. }
  302. },
  303. created(){
  304. let self = this;
  305. if(this.propsData.userId){
  306. if(this.propsData.avatar){
  307. this.form.avatar = this.propsData.avatar;
  308. }else{
  309. this.form.avatar = '';
  310. }
  311. if(this.propsData.nickName){
  312. this.form.nickName = this.propsData.nickName;
  313. }else{
  314. this.form.nickName = '';
  315. }
  316. if(this.propsData.sex){
  317. this.form.sex = parseInt(this.propsData.sex);
  318. }else{
  319. this.form.sex = 0;
  320. }
  321. if(this.propsData.userName){
  322. this.form.userName = this.propsData.userName;
  323. }else{
  324. this.form.userName = ''
  325. }
  326. if(this.propsData.deptId){
  327. this.form.deptId = this.propsData.deptId;
  328. }else{
  329. this.form.deptId = '';
  330. }
  331. if(this.propsData.position){
  332. this.form.position = parseInt(this.propsData.position);
  333. }else{
  334. this.form.position = '';
  335. }
  336. if(this.propsData.category){
  337. this.form.category = this.propsData.category;
  338. }else{
  339. this.form.category = '';
  340. }
  341. if(this.propsData.phonenumber){
  342. this.form.phonenumber = this.propsData.phonenumber;
  343. }else{
  344. this.form.phonenumber = '';
  345. }
  346. if(this.propsData.cardNum){
  347. this.form.cardNum = this.propsData.cardNum;
  348. }else{
  349. this.form.cardNum = '';
  350. }
  351. if(this.propsData.education){
  352. this.form.education = this.propsData.education;
  353. }else{
  354. this.form.education = '';
  355. }
  356. if(this.propsData.dateBirth){
  357. this.form.dateBirth = this.propsData.dateBirth;
  358. }else{
  359. this.form.dateBirth = '';
  360. }
  361. if(this.propsData.email){
  362. this.form.email = this.propsData.email;
  363. }else{
  364. this.form.email = '';
  365. }
  366. if(this.propsData.nature){
  367. this.form.nature = this.propsData.nature;
  368. }else{
  369. this.form.nature = '';
  370. }
  371. if(this.propsData.isCheck){
  372. this.form.isCheck = this.propsData.isCheck;
  373. }else{
  374. this.form.isCheck = '';
  375. }
  376. if(this.propsData.faceImg){
  377. this.form.faceImg = this.propsData.faceImg;
  378. }else{
  379. this.form.faceImg = '';
  380. }
  381. if(this.propsData.signature){
  382. this.form.signature = this.propsData.signature;
  383. }else{
  384. this.form.signature = '';
  385. }
  386. if(this.propsData.status){
  387. this.form.status = this.propsData.status;
  388. }else{
  389. this.form.status = '';
  390. }
  391. if(!this.editType){
  392. this.getPermitOptionList();
  393. this.getMenuOne();
  394. }
  395. // if(this.propsData.position){
  396. // this.form.position = this.propsData.position.split(',');
  397. // for(let i=0;i<self.form.position.length;i++){
  398. // self.form.position[i] = parseInt(self.form.position[i]);//字符串转数字
  399. // }
  400. // }else{
  401. // this.form.position = [];
  402. // }
  403. }else{
  404. this.getPermitOptionList();
  405. this.getMenu();
  406. }
  407. this.getTreeselect();
  408. this.getAll();
  409. },
  410. mounted(){
  411. },
  412. methods:{
  413. //另存权限
  414. saveDataButton(){
  415. this.saveForm = {
  416. name:"",
  417. type:0,
  418. text:"",
  419. }
  420. this.saveOpen = true;
  421. },
  422. saveOpenOff(){
  423. this.saveOpen = false;
  424. },
  425. saveUpData(){
  426. this.$refs["saveForm"].validate(valid => {
  427. if (valid) {
  428. let list = this.toArray();
  429. console.log("list",list)
  430. let obj = {
  431. name:this.saveForm.name,
  432. type:this.saveForm.type,
  433. remark:this.saveForm.text,
  434. permitMenus:[]
  435. };
  436. for(let i=0;i<list.length;i++){
  437. let minObj = {
  438. menuId:list[i].menuId,
  439. }
  440. if(list[i].dataScope){
  441. minObj.dataScope = list[i].dataScope
  442. if(list[i].dataScope == 3){
  443. minObj.deptIds = list[i].deptIds;
  444. minObj.deptIdsList = list[i].deptIdsList;
  445. }
  446. }else{
  447. minObj.dataScope = 0
  448. }
  449. obj.permitMenus.push(minObj)
  450. }
  451. if(!obj.permitMenus[0]){
  452. this.msgError('请先勾选权限项');
  453. return
  454. }
  455. this.addSystemPermit(obj);
  456. }
  457. })
  458. },
  459. //保存权限
  460. addSystemPermit(obj){
  461. addSystemPermit(obj).then(response => {
  462. if(response.code == 200){
  463. this.saveOpenOff();
  464. this.msgSuccess(response.msg);
  465. }
  466. });
  467. },
  468. //根据选择人员获取权限
  469. takeUserData(ids){
  470. this.userPermit(ids[0]);
  471. this.$refs.userOpen.show();
  472. },
  473. //提交按钮
  474. upDataButton(){
  475. this.$refs["form"].validate(valid => {
  476. if (valid) {
  477. if(this.form.email){
  478. let re = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
  479. if(!re.test(this.form.email)){
  480. this.msgError('请输入正确的邮箱地址')
  481. return
  482. }
  483. }
  484. let list = this.toArray();
  485. let obj = JSON.parse(JSON.stringify(this.form));
  486. // obj.position = obj.position+'';
  487. obj.permitMenus = [];
  488. if(obj.status == 0){
  489. for(let i=0;i<list.length;i++){
  490. let minObj = {
  491. menuId:list[i].menuId,
  492. }
  493. if(list[i].dataScope){
  494. minObj.dataScope = list[i].dataScope
  495. if(list[i].dataScope == 3){
  496. minObj.deptIds = list[i].deptIds;
  497. minObj.deptIdsList = list[i].deptIdsList;
  498. }
  499. }else{
  500. minObj.dataScope = 0
  501. }
  502. obj.permitMenus.push(minObj)
  503. }
  504. }
  505. if(this.propsData.userId){
  506. //修改
  507. obj.userId = this.propsData.userId;
  508. this.putUserTeacherNew(obj);
  509. }else{
  510. //发布
  511. this.addUserTeacher(obj);
  512. }
  513. }
  514. });
  515. },
  516. putUserTeacherNew(obj){
  517. putUserTeacherNew(obj).then(response => {
  518. if(response.code == 200){
  519. this.msgSuccess(response.msg);
  520. this.outPageButton();
  521. }else if(response.code==205){
  522. this.$confirm(response.msg, "警告", {
  523. confirmButtonText: "确定",
  524. cancelButtonText: "取消",
  525. type: "warning"
  526. }).then(() => {
  527. // 确定
  528. this.$router.push({ path: '/comprehensive/laboratoryManagement/accessAuthorization' });
  529. }).catch(function() {
  530. // 取消
  531. this.outPageButton();
  532. });
  533. }
  534. });
  535. },
  536. addUserTeacher(obj){
  537. addUserTeacher(obj).then(response => {
  538. if(response.code == 200){
  539. this.msgSuccess(response.msg);
  540. this.outPageButton();
  541. }else if(response.code==205){
  542. this.$confirm(response.msg, "警告", {
  543. confirmButtonText: "确定",
  544. cancelButtonText: "取消",
  545. type: "warning"
  546. }).then(() => {
  547. // 确定
  548. this.$router.push({ path: '/comprehensive/laboratoryManagement/accessAuthorization' });
  549. }).catch(function() {
  550. // 取消
  551. this.outPageButton();
  552. });
  553. }
  554. });
  555. },
  556. //根据用户查询权限
  557. userPermit(userId){
  558. let self = this;
  559. userPermit(userId).then(response => {
  560. if(response.code == 200){
  561. let newList = JSON.parse(JSON.stringify(this.originalMenuList));
  562. for(let i=0;i<response.data.length;i++){
  563. for(let o=0;o<newList.length;o++){
  564. if(response.data[i].menuId == newList[o].menuId){
  565. newList[o].checkType = true;
  566. if(response.data[i].dataScope == 3){
  567. newList[o].dataScope = response.data[i].dataScope;
  568. newList[o].deptIds =response.data[i].deptIds;
  569. newList[o].deptIdsList =response.data[i].deptIdsList;
  570. newList[o].scopeCheckType = true;
  571. }else if(response.data[i].dataScope != 0){
  572. newList[o].dataScope = response.data[i].dataScope;
  573. newList[o].scopeCheckType = true;
  574. }
  575. }
  576. if(response.data[i].menuType == 'F' && response.data[i].parentId == newList[o].menuId && !newList[o].permissionCheckType){
  577. newList[o].permissionCheckType = true;
  578. }
  579. }
  580. }
  581. let newMenu = JSON.parse(JSON.stringify(this.handleTree(newList, "menuId")))
  582. this.$set(this,'menuList',newMenu);
  583. }
  584. });
  585. },
  586. getAll(){
  587. //身份
  588. optionselect({postName:""}).then(response => {
  589. this.positionOptions = response.data;
  590. });
  591. //职称
  592. getVaguet({dictType:"professional",dictLabel:""}).then(response => {
  593. this.categoryOptions = response.data;
  594. });
  595. //文化程度
  596. getVaguet({dictType:"education",dictLabel:""}).then(response => {
  597. this.educationOptions = response.data;
  598. });
  599. },
  600. //获取快捷权限列表
  601. getPermitOptionList(){
  602. getPermitOptionList().then(response => {
  603. this.templateList = response.data
  604. });
  605. },
  606. //查询身份
  607. positionSelect(query){
  608. if (query !== '') {
  609. let obj = {
  610. postName:query,
  611. };
  612. optionselect(obj).then(response => {
  613. this.positionOptions = response.data;
  614. });
  615. } else {
  616. this.positionOptions = [];
  617. }
  618. },
  619. positionSelectClick(){
  620. },
  621. positionClearClick(){
  622. },
  623. //查询职称列表
  624. categorySelect(query){
  625. let obj = {
  626. dictType:"professional",
  627. dictLabel:query
  628. };
  629. getVaguet(obj).then(response => {
  630. this.categoryOptions = response.data;
  631. });
  632. },
  633. categorySelectClick(){
  634. },
  635. categoryClearClick(){
  636. },
  637. //查询文化程度
  638. educationSelect(query){
  639. if (query !== '') {
  640. let obj = {
  641. dictType:"education",
  642. dictLabel:query
  643. };
  644. getVaguet(obj).then(response => {
  645. this.educationOptions = response.data;
  646. });
  647. } else {
  648. this.educationOptions = [];
  649. }
  650. },
  651. educationSelectClick(){
  652. },
  653. educationClearClick(){
  654. },
  655. /** 查询部门下拉树结构 */
  656. getTreeselect() {
  657. treeselect().then(response => {
  658. this.deptOptions = response.data;
  659. this.$set(this,'treeselectList',response.data[0].children);
  660. });
  661. },
  662. natureCaptcha(){
  663. this.form.nature = this.form.nature == 1?'0':'1';
  664. if(this.form.nature == 1){
  665. this.form.status = 1;
  666. }
  667. },
  668. isCheckCaptcha(){
  669. this.form.isCheck = this.form.isCheck == 1?0:1;
  670. },
  671. statusCaptcha(){
  672. this.form.status = this.form.status == 1?'0':'1';
  673. },
  674. //上传
  675. handleAvatarSuccess(res, file) {
  676. console.log(res.data.url);
  677. this.form.avatar = res.data.url;
  678. this.$forceUpdate()
  679. },
  680. beforeAvatarUpload(file) {
  681. let type = false;
  682. console.log('file',file);
  683. if (file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif') {
  684. type = true;
  685. }else{
  686. this.$message.error('只能上传png/jpeg/gif格式图片');
  687. type = false;
  688. }
  689. return type;
  690. },
  691. //导入用户权限
  692. importUser(){
  693. this.$refs.userOpen.show();
  694. },
  695. //返回事件
  696. outPageButton(){
  697. this.$parent.outPage(1);
  698. },
  699. //模板选中
  700. templateClick(id){
  701. let self = this;
  702. getPermitInfo(id).then(response => {
  703. for(let a=0;a<response.data.length;a++){
  704. if(response.data[a].isRequired == 1){
  705. response.data[a].checkType = true;
  706. }
  707. }
  708. let newList = JSON.parse(JSON.stringify(this.originalMenuList));
  709. for(let i=0;i<response.data.permitMenus.length;i++){
  710. for(let o=0;o<newList.length;o++){
  711. if(response.data.permitMenus[i].menuId == newList[o].menuId){
  712. newList[o].checkType = true;
  713. if(response.data.permitMenus[i].dataScope == 3){
  714. newList[o].dataScope = response.data.permitMenus[i].dataScope;
  715. newList[o].deptIds =response.data.permitMenus[i].deptIds;
  716. newList[o].deptIdsList =response.data.permitMenus[i].deptIdsList;
  717. newList[o].scopeCheckType = true;
  718. }else if(response.data.permitMenus[i].dataScope != 0){
  719. newList[o].dataScope = response.data.permitMenus[i].dataScope;
  720. newList[o].scopeCheckType = true;
  721. }
  722. }
  723. if(response.data.permitMenus[i].menuType == 'F' && response.data.permitMenus[i].parentId == newList[o].menuId && !newList[o].permissionCheckType){
  724. newList[o].permissionCheckType = true;
  725. }
  726. }
  727. }
  728. this.menuList = JSON.parse(JSON.stringify(this.handleTree(newList, "menuId")))
  729. });
  730. if(this.templateKey != id){
  731. this.templateKey = id;
  732. for(let i=0;i<self.templateList.length;i++){
  733. if(id == self.templateList[i].id){
  734. this.templateName = self.templateList[i].name;
  735. }
  736. }
  737. }else{
  738. this.templateKey = "";
  739. this.templateName = "";
  740. }
  741. this.$forceUpdate();
  742. },
  743. //清除模板选中
  744. templateDel(){
  745. this.templateKey = "";
  746. this.templateName = "";
  747. this.$set(this,'menuList',JSON.parse(JSON.stringify(this.menuListData)))
  748. },
  749. //权限详情按钮
  750. permissionDetails(obj,maxIndex,bigIndex,minIndex){
  751. let item = JSON.parse(JSON.stringify(obj));
  752. this.maxIndex = maxIndex;
  753. this.bigIndex = bigIndex;
  754. this.minIndex = minIndex;
  755. let num = 0;
  756. for(let i=0;i<item.children.length;i++){
  757. if(item.children[i].checkType){
  758. num++
  759. }
  760. }
  761. this.allCheckType = num != 0;
  762. this.$set(this,'permissionCheckData',item)
  763. this.permissionOpen = true;
  764. },
  765. surePermissionOpen(){
  766. if(this.maxIndex != undefined && this.bigIndex != undefined && this.minIndex != undefined){
  767. this.menuList[this.maxIndex].children[this.bigIndex].children[this.minIndex] = JSON.parse(JSON.stringify(this.permissionCheckData));
  768. this.menuList[this.maxIndex].children[this.bigIndex].children[this.minIndex].permissionCheckType = JSON.parse(JSON.stringify(this.allCheckType))
  769. }else if(this.maxIndex != undefined && this.bigIndex != undefined){
  770. this.menuList[this.maxIndex].children[this.bigIndex] = JSON.parse(JSON.stringify(this.permissionCheckData));
  771. this.menuList[this.maxIndex].children[this.bigIndex].permissionCheckType = JSON.parse(JSON.stringify(this.allCheckType))
  772. }else if(this.maxIndex != undefined){
  773. this.menuList[this.maxIndex] = JSON.parse(JSON.stringify(this.permissionCheckData));
  774. this.menuList[this.maxIndex].permissionCheckType = JSON.parse(JSON.stringify(this.allCheckType))
  775. }
  776. this.permissionOpen = false;
  777. },
  778. permissionOpenOff(){
  779. this.permissionOpen = false;
  780. },
  781. //展开时触发
  782. visibleChange(type,item,maxIndex,bigIndex,minIndex){
  783. if(type){
  784. if(minIndex!=undefined){
  785. this.deptOpenType = this.menuList[maxIndex].children[bigIndex].children[minIndex].dataScope
  786. }else{
  787. this.deptOpenType = this.menuList[maxIndex].children[bigIndex].dataScope
  788. }
  789. }
  790. },
  791. //数据范围选中指定部门
  792. optionChange(type,item,maxIndex,bigIndex,minIndex){
  793. if(type == 3){
  794. console.log('deptIdsList',item.deptIdsList);
  795. if(item.deptIdsList){
  796. this.deptForm.deptIds = JSON.parse(item.deptIdsList);
  797. }else{
  798. this.deptForm.deptIds = "";
  799. }
  800. this.deptForm.maxIndex = maxIndex;
  801. this.deptForm.bigIndex = bigIndex;
  802. this.deptForm.minIndex = minIndex;
  803. this.deptForm.dataScope = item.dataScope;
  804. this.deptOpen = true;
  805. }
  806. console.log(type);
  807. this.$forceUpdate()
  808. },
  809. //指定部门弹窗取消
  810. deptCancel(){
  811. if(this.deptForm.minIndex || this.deptForm.minIndex == 0){
  812. this.$set(this.menuList[this.deptForm.maxIndex].children[this.deptForm.bigIndex].children[this.deptForm.minIndex],'dataScope',this.deptOpenType)
  813. }else{
  814. this.$set(this.menuList[this.deptForm.maxIndex].children[this.deptForm.bigIndex],'dataScope',this.deptOpenType)
  815. }
  816. this.deptForm.deptIds = [];
  817. this.deptForm.maxIndex = "";
  818. this.deptForm.bigIndex = "";
  819. this.deptForm.minIndex = "";
  820. this.deptForm.dataScope = "";
  821. this.deptOpen = false;
  822. this.$forceUpdate()
  823. },
  824. //指定部门弹窗确定
  825. deptSure(){
  826. let self = this;
  827. this.$refs["deptForm"].validate(valid => {
  828. if (valid) {
  829. let list = [];
  830. for(let i=0;i<self.deptForm.deptIds.length;i++){
  831. for(let o=0;o<self.deptForm.deptIds[i].length;o++){
  832. list.push(self.deptForm.deptIds[i][o])
  833. }
  834. }
  835. let newList = [];
  836. for (var i = 0,len=list.length; i < len; i++) {
  837. if(newList.indexOf(list[i]) === -1){
  838. newList.push(list[i]);
  839. }
  840. }
  841. if(this.deptForm.minIndex || this.deptForm.minIndex == 0){
  842. this.$set(this.menuList[this.deptForm.maxIndex].children[this.deptForm.bigIndex].children[this.deptForm.minIndex],'deptIds',newList)
  843. this.$set(this.menuList[this.deptForm.maxIndex].children[this.deptForm.bigIndex].children[this.deptForm.minIndex],'deptIdsList',JSON.stringify(self.deptForm.deptIds))
  844. }else{
  845. this.$set(this.menuList[this.deptForm.maxIndex].children[this.deptForm.bigIndex],'deptIds',newList)
  846. this.$set(this.menuList[this.deptForm.maxIndex].children[this.deptForm.bigIndex],'deptIdsList',JSON.stringify(self.deptForm.deptIds))
  847. }
  848. this.deptOpen = false;
  849. this.deptForm.deptIds = [];
  850. this.deptForm.maxIndex = "";
  851. this.deptForm.bigIndex = "";
  852. this.deptForm.minIndex = "";
  853. this.deptForm.dataScope = "";
  854. this.$forceUpdate()
  855. }
  856. });
  857. },
  858. //模块勾选逻辑
  859. itemCheckClick(status,type,item,bigItem,maxItem){
  860. if(status == 1 || status == 2 || status == 3){
  861. //一级菜单勾选
  862. if(item.children){
  863. for(let i=0;i<item.children.length;i++){
  864. item.children[i].checkType = !!type;
  865. if(item.children[i].children){
  866. for(let o=0;o<item.children[i].children.length;o++){
  867. item.children[i].children[o].checkType = !!type;
  868. if(item.children[i].children[o].children){
  869. for(let x=0;x<item.children[i].children[o].children.length;x++){
  870. item.children[i].children[o].children[x].checkType = !!type;
  871. }
  872. }
  873. if(item.children[i].children[o].menuType == 'C'){
  874. item.children[i].children[o].scopeCheckType = !!type;
  875. item.children[i].children[o].dataScope = type?1:"";
  876. item.children[i].children[o].permissionCheckType = !!type;
  877. }
  878. }
  879. }
  880. if(item.children[i].menuType == 'C'){
  881. item.children[i].scopeCheckType = !!type;
  882. item.children[i].dataScope = type?1:"";
  883. item.children[i].permissionCheckType = !!type;
  884. }
  885. }
  886. }
  887. if(item.menuType == 'C'){
  888. item.scopeCheckType = !!type;
  889. item.dataScope = type?1:"";
  890. item.permissionCheckType = !!type;
  891. }
  892. if(bigItem&&type){
  893. bigItem.checkType = type;
  894. }
  895. if(maxItem&&type){
  896. maxItem.checkType = type;
  897. }
  898. }else if(status == 4){
  899. //数据范围勾选
  900. item.scopeCheckType = !!type;
  901. item.dataScope = type?1:"";
  902. }else if(status == 5){
  903. //管理权限勾选
  904. item.permissionCheckType = !!type;
  905. for(let i=0;i<item.children.length;i++){
  906. item.children[i].checkType = !!type;
  907. }
  908. }
  909. },
  910. //权限勾选逻辑
  911. permissionCheckClick(status,type){
  912. let self = this;
  913. if(status == 1){
  914. for(let i=0;i<self.permissionCheckData.children.length;i++){
  915. self.permissionCheckData.children[i].checkType = !!type;
  916. self.permissionCheckData.permissionCheckType = !!type;
  917. }
  918. }else if(status == 2){
  919. if(type&&!this.allCheckType){
  920. this.allCheckType = true;
  921. this.permissionCheckData.permissionCheckType = true;
  922. }else{
  923. let num = 0;
  924. for(let i=0;i<self.permissionCheckData.children.length;i++){
  925. if(!self.permissionCheckData.children[i].checkType){
  926. num++
  927. }
  928. }
  929. if(num == self.permissionCheckData.children.length){
  930. this.allCheckType = false;
  931. this.permissionCheckData.permissionCheckType = false;
  932. }
  933. }
  934. }
  935. this.$forceUpdate();
  936. },
  937. showText(){
  938. console.log("1")
  939. this.textType = true;
  940. },
  941. hideText(){
  942. console.log("2")
  943. this.textType = false;
  944. },
  945. /** 查询菜单列表 */
  946. getMenuOne(){
  947. let self = this;
  948. this.loading = true;
  949. listMenuAll(this.queryParams).then(response => {
  950. for(let a=0;a<response.data.length;a++){
  951. if(response.data[a].isRequired == 1){
  952. response.data[a].checkType = true;
  953. }
  954. }
  955. if(this.propsData.userId){
  956. console.log(this.propsData)
  957. let newList = JSON.parse(JSON.stringify(response.data));
  958. this.form.name = this.propsData.name;
  959. this.form.type = this.propsData.type;
  960. this.form.text = this.propsData.remark;
  961. for(let i=0;i<self.propsData.permitMenus.length;i++){
  962. for(let o=0;o<newList.length;o++){
  963. if(self.propsData.permitMenus[i].menuId == newList[o].menuId){
  964. newList[o].checkType = true;
  965. if(self.propsData.permitMenus[i].dataScope == 3){
  966. newList[o].dataScope = self.propsData.permitMenus[i].dataScope;
  967. newList[o].deptIds =self.propsData.permitMenus[i].deptIds;
  968. newList[o].scopeCheckType = true;
  969. }else if(self.propsData.permitMenus[i].dataScope != 0){
  970. newList[o].dataScope = self.propsData.permitMenus[i].dataScope;
  971. newList[o].scopeCheckType = true;
  972. }
  973. }
  974. if(self.propsData.permitMenus[i].menuType == 'F' && self.propsData.permitMenus[i].parentId == newList[o].menuId && !newList[o].permissionCheckType){
  975. newList[o].permissionCheckType = true;
  976. }
  977. }
  978. }
  979. this.menuList = JSON.parse(JSON.stringify(this.handleTree(newList, "menuId")))
  980. this.menuListData = JSON.parse(JSON.stringify(this.handleTree(response.data, "menuId")))
  981. this.originalMenuList = JSON.parse(JSON.stringify(response.data));
  982. }else{
  983. this.menuList = JSON.parse(JSON.stringify(this.handleTree(response.data, "menuId")))
  984. this.menuListData = JSON.parse(JSON.stringify(this.handleTree(response.data, "menuId")))
  985. this.originalMenuList = JSON.parse(JSON.stringify(response.data));
  986. }
  987. this.loading = false;
  988. this.userPermit(this.propsData.userId);
  989. });
  990. },
  991. getMenu() {
  992. let self = this;
  993. this.loading = true;
  994. listMenuAll(this.queryParams).then(response => {
  995. for(let a=0;a<response.data.length;a++){
  996. if(response.data[a].isRequired == 1){
  997. response.data[a].checkType = true;
  998. }
  999. }
  1000. if(this.propsData.userId){
  1001. let newList = JSON.parse(JSON.stringify(response.data));
  1002. this.form.name = this.propsData.name;
  1003. this.form.type = this.propsData.type;
  1004. this.form.text = this.propsData.remark;
  1005. for(let i=0;i<self.propsData.permitMenus.length;i++){
  1006. for(let o=0;o<newList.length;o++){
  1007. if(self.propsData.permitMenus[i].menuId == newList[o].menuId){
  1008. newList[o].checkType = true;
  1009. if(self.propsData.permitMenus[i].dataScope == 3){
  1010. newList[o].dataScope = self.propsData.permitMenus[i].dataScope;
  1011. newList[o].deptIds =self.propsData.permitMenus[i].deptIds;
  1012. newList[o].scopeCheckType = true;
  1013. }else if(self.propsData.permitMenus[i].dataScope != 0){
  1014. newList[o].dataScope = self.propsData.permitMenus[i].dataScope;
  1015. newList[o].scopeCheckType = true;
  1016. }
  1017. }
  1018. if(self.propsData.permitMenus[i].menuType == 'F' && self.propsData.permitMenus[i].parentId == newList[o].menuId && !newList[o].permissionCheckType){
  1019. newList[o].permissionCheckType = true;
  1020. }
  1021. }
  1022. }
  1023. this.menuList = JSON.parse(JSON.stringify(this.handleTree(newList, "menuId")))
  1024. this.menuListData = JSON.parse(JSON.stringify(this.handleTree(response.data, "menuId")))
  1025. this.originalMenuList = JSON.parse(JSON.stringify(response.data));
  1026. }else{
  1027. this.menuList = JSON.parse(JSON.stringify(this.handleTree(response.data, "menuId")))
  1028. this.menuListData = JSON.parse(JSON.stringify(this.handleTree(response.data, "menuId")))
  1029. this.originalMenuList = JSON.parse(JSON.stringify(response.data));
  1030. }
  1031. this.loading = false;
  1032. });
  1033. },
  1034. //结构树转数组并筛选选中项
  1035. toArray(){
  1036. let list = [];
  1037. let newList = JSON.parse(JSON.stringify(this.menuList));
  1038. for(let i=0;i<newList.length;i++){
  1039. pushNode(newList[i]);
  1040. }
  1041. function pushNode(node){
  1042. if(node.children){
  1043. for (let nodeItem of node.children){
  1044. pushNode(nodeItem)
  1045. }
  1046. delete node.children;
  1047. if(node.checkType){
  1048. list.push(node)
  1049. }
  1050. }else{
  1051. if(node.children){
  1052. delete node.children
  1053. }
  1054. if(node.checkType){
  1055. list.push(node)
  1056. }
  1057. }
  1058. }
  1059. return list
  1060. }
  1061. }
  1062. }
  1063. </script>
  1064. <style scoped lang="scss">
  1065. .teacher-add-page{
  1066. flex:1;
  1067. display: flex;
  1068. flex-direction: column;
  1069. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  1070. padding:0 0 20px!important;
  1071. overflow: hidden;
  1072. *{
  1073. margin:0;
  1074. }
  1075. .public-form-box{
  1076. flex:1;
  1077. overflow-y: scroll;
  1078. overflow-x: hidden;
  1079. }
  1080. .top-title-box{
  1081. border-bottom:1px solid #E0E0E0;
  1082. display: flex;
  1083. p:nth-child(1){
  1084. color:#0045AF;
  1085. line-height:80px;
  1086. margin-left:24px;
  1087. font-size:18px;
  1088. flex:1;
  1089. }
  1090. p:nth-child(2){
  1091. border:1px solid #0045AF;
  1092. color:#0045AF;
  1093. width:80px;
  1094. height:30px;
  1095. text-align: center;
  1096. font-size:16px;
  1097. border-radius: 6px;
  1098. line-height:30px;
  1099. margin:25px 20px 0 0;
  1100. cursor: pointer;
  1101. }
  1102. }
  1103. .top-info-box{
  1104. display: flex;
  1105. padding:40px 20px 0;
  1106. .left-info-box{
  1107. margin-right:20px;
  1108. img{
  1109. width:100px;
  1110. height:120px;
  1111. }
  1112. p{
  1113. width: 80px;
  1114. height: 26px;
  1115. border: 1px solid #0183FA;
  1116. border-radius: 6px;
  1117. line-height:24px;
  1118. font-size:12px;
  1119. color:#0183FA;
  1120. text-align: center;
  1121. margin:24px 10px;
  1122. }
  1123. }
  1124. }
  1125. .top-title-one{
  1126. display: flex;
  1127. border-top:1px solid #E0E0E0;
  1128. position: relative;
  1129. .title-p{
  1130. font-size:18px;
  1131. color:#0045AF;
  1132. line-height:80px;
  1133. margin-left:24px;
  1134. }
  1135. .img-p{
  1136. font-size:18px;
  1137. margin:0 10px;
  1138. line-height:80px;
  1139. color:#FFC000;
  1140. }
  1141. .position-box{
  1142. width: 420px;
  1143. height: 194px;
  1144. padding:20px;
  1145. background: #F5F5F5;
  1146. position: absolute;
  1147. top:10px;
  1148. left:134px;
  1149. p{
  1150. font-size:12px;
  1151. line-height:18px;
  1152. color:#333;
  1153. }
  1154. }
  1155. }
  1156. .name-input-box{
  1157. height:100px;
  1158. }
  1159. .for-button-list{
  1160. background: #E5F2FE;
  1161. margin:0 20px;
  1162. display: flex;
  1163. .for-title-p{
  1164. width:175px;
  1165. height:80px;
  1166. line-height:80px;
  1167. font-size:16px;
  1168. color:#333;
  1169. text-align: center;
  1170. }
  1171. .for-button-max-box{
  1172. flex:1;
  1173. .for-button-min-box{
  1174. font-size:16px;
  1175. display: inline-block;
  1176. overflow: hidden;
  1177. height:30px;
  1178. line-height:30px;
  1179. border-radius:6px;
  1180. margin:25px 28px 0 0;
  1181. cursor: pointer;
  1182. i{
  1183. height:30px;
  1184. line-height:30px;
  1185. font-size:16px;
  1186. color:#fff;
  1187. margin-right:6px;
  1188. }
  1189. }
  1190. .colorAA{
  1191. color: #ffffff;
  1192. background: #0183FA;
  1193. padding:0 26px 0 16px;
  1194. }
  1195. .colorBB{
  1196. padding:0 26px;
  1197. color: #333;
  1198. background: #E0E0E0;
  1199. }
  1200. }
  1201. }
  1202. .template-name-box{
  1203. display: flex;
  1204. .template-name-p{
  1205. font-weight:500;
  1206. height:80px;
  1207. line-height:80px;
  1208. font-size:16px;
  1209. color:#333;
  1210. margin-left:20px;
  1211. flex: 1;
  1212. }
  1213. .template-name-button{
  1214. width:80px;
  1215. height:40px;
  1216. line-height:40px;
  1217. margin:20px 20px 0 0;
  1218. }
  1219. .template-name-button-one{
  1220. width:180px;
  1221. height:40px;
  1222. line-height:40px;
  1223. margin:20px 40px 0 0;
  1224. color:#fff;
  1225. background: #0183FA;
  1226. border: 1px solid #E0E0E0;
  1227. cursor: pointer;
  1228. font-size: 14px;
  1229. text-align: center;
  1230. border-radius: 6px;
  1231. }
  1232. }
  1233. .table-for-max-box{
  1234. border:1px solid #D7D7D7;
  1235. margin:0 20px;
  1236. *{
  1237. margin:0;
  1238. padding:0;
  1239. }
  1240. .table-title-box{
  1241. background: rgba(1,131,250,0.1);
  1242. display: flex;
  1243. p{
  1244. font-size:14px;
  1245. font-weight:700;
  1246. color:#333;
  1247. line-height:48px;
  1248. padding-left:20px;
  1249. }
  1250. p:nth-child(1){
  1251. width:615px;
  1252. border-right:1px solid #D7D7D7;
  1253. }
  1254. }
  1255. .table-for-big-box{
  1256. border-top:1px solid #D7D7D7;
  1257. display: flex;
  1258. font-size:14px;
  1259. .max-title-box-null{
  1260. width:615px!important;
  1261. }
  1262. .max-title-box{
  1263. width:230px;
  1264. border-right:1px solid #D7D7D7;
  1265. min-height:48px;
  1266. position: relative;
  1267. p{
  1268. position: absolute;
  1269. top:50%;
  1270. left:20px;
  1271. height:18px;
  1272. line-height:18px;
  1273. margin-top:-9px;
  1274. }
  1275. }
  1276. .max-right-box{
  1277. flex:5;
  1278. min-height:48px;
  1279. .big-box:nth-child(1){
  1280. border:none!important;
  1281. }
  1282. .big-box-null{
  1283. line-height:48px;
  1284. margin-left:20px;
  1285. color:#606266;
  1286. }
  1287. .big-box{
  1288. display: flex;
  1289. border-top:1px solid #D7D7D7;
  1290. .big-title-box-null{
  1291. width:385px!important;
  1292. }
  1293. .big-title-box{
  1294. width:180px;
  1295. border-right:1px solid #D7D7D7;
  1296. min-height:48px;
  1297. position: relative;
  1298. overflow: hidden;
  1299. p{
  1300. position: absolute;
  1301. top:50%;
  1302. left:20px;
  1303. height:48px;
  1304. line-height:48px;
  1305. margin-top:-24px;
  1306. }
  1307. }
  1308. .big-right-box-null{
  1309. display: flex;
  1310. .scope-box{
  1311. width:430px;
  1312. position: relative;
  1313. overflow: hidden;
  1314. border-right:1px solid #D7D7D7;
  1315. p{
  1316. position: absolute;
  1317. top:50%;
  1318. left:20px;
  1319. height:48px;
  1320. line-height:48px;
  1321. margin-top:-24px;
  1322. }
  1323. }
  1324. .permission-box{
  1325. flex:1;
  1326. position: relative;
  1327. overflow: hidden;
  1328. display: flex;
  1329. .check-left-p{
  1330. margin-left:20px;
  1331. height:48px;
  1332. line-height:48px;
  1333. }
  1334. .check-button-box{
  1335. width:130px;
  1336. height:36px;
  1337. margin:6px 0 0 36px;
  1338. line-height:36px;
  1339. display: flex;
  1340. color:#333;
  1341. cursor: pointer;
  1342. img{
  1343. width:16px;
  1344. height:16px;
  1345. margin:10px 14px 0 19px;
  1346. }
  1347. }
  1348. .check-button-box-colorA{
  1349. background: #CCE6FE;
  1350. color:#0183FA;
  1351. }
  1352. .check-button-box-colorB{
  1353. background: #E0E0E0;
  1354. color:#333;
  1355. }
  1356. }
  1357. }
  1358. .big-right-box{
  1359. flex:5;
  1360. min-height:48px;
  1361. .min-box:nth-child(1){
  1362. border:none!important;
  1363. }
  1364. .min-box{
  1365. display: flex;
  1366. border-top:1px solid #D7D7D7;
  1367. .min-title-box{
  1368. width:205px;
  1369. border-right:1px solid #D7D7D7;
  1370. min-height:48px;
  1371. position: relative;
  1372. overflow: hidden;
  1373. p{
  1374. position: absolute;
  1375. top:50%;
  1376. left:20px;
  1377. height:48px;
  1378. line-height:48px;
  1379. margin-top:-24px;
  1380. }
  1381. }
  1382. .min-right-box{
  1383. flex:5;
  1384. min-height:48px;
  1385. display: flex;
  1386. .scope-box{
  1387. width:430px;
  1388. position: relative;
  1389. overflow: hidden;
  1390. border-right:1px solid #D7D7D7;
  1391. p{
  1392. position: absolute;
  1393. top:50%;
  1394. left:20px;
  1395. height:48px;
  1396. line-height:48px;
  1397. margin-top:-24px;
  1398. }
  1399. }
  1400. .permission-box{
  1401. flex:1;
  1402. position: relative;
  1403. overflow: hidden;
  1404. display: flex;
  1405. .check-left-p{
  1406. margin-left:20px;
  1407. height:48px;
  1408. line-height:48px;
  1409. }
  1410. .check-button-box{
  1411. width:130px;
  1412. height:36px;
  1413. margin:6px 0 0 36px;
  1414. line-height:36px;
  1415. display: flex;
  1416. color:#333;
  1417. cursor: pointer;
  1418. img{
  1419. width:16px;
  1420. height:16px;
  1421. margin:10px 14px 0 19px;
  1422. }
  1423. }
  1424. .check-button-box-colorA{
  1425. background: #CCE6FE;
  1426. color:#0183FA;
  1427. }
  1428. .check-button-box-colorB{
  1429. background: #E0E0E0;
  1430. color:#333;
  1431. }
  1432. }
  1433. }
  1434. }
  1435. }
  1436. }
  1437. }
  1438. }
  1439. }
  1440. .bottom-button-box{
  1441. display: flex;
  1442. width:600px;
  1443. margin:30px auto 10px;
  1444. .null-p{
  1445. flex:1;
  1446. }
  1447. .button-p-1{
  1448. width:100px;
  1449. margin-right:20px;
  1450. }
  1451. .button-p-2{
  1452. width:100px;
  1453. margin-right:20px;
  1454. }
  1455. .button-p-3{
  1456. width:180px;
  1457. }
  1458. }
  1459. }
  1460. </style>
  1461. <style lang="scss">
  1462. .teacher-add-page{
  1463. .top-info-box{
  1464. .el-form-item{
  1465. height:70px;
  1466. }
  1467. .el-input--small{
  1468. width:250px!important;
  1469. }
  1470. .el-select{
  1471. width:250px!important;
  1472. }
  1473. .el-input{
  1474. width:250px!important;
  1475. }
  1476. .el-input__inner{
  1477. width:250px!important;
  1478. }
  1479. .el-radio-group{
  1480. width:250px!important;
  1481. }
  1482. .is-disabled{
  1483. width:250px!important;
  1484. }
  1485. .switch .el-switch__label {
  1486. position: absolute;
  1487. display: none;
  1488. color: #fff !important;
  1489. }
  1490. .switch .el-switch__label--right {
  1491. z-index: 1;
  1492. }
  1493. .switch .el-switch__label--right span{
  1494. margin-left: 10px;
  1495. }
  1496. .switch .el-switch__label--left {
  1497. z-index: 1;
  1498. }
  1499. .switch .el-switch__label--left span{
  1500. margin-left: 24px;
  1501. }
  1502. .switch .el-switch__label.is-active {
  1503. display: block;
  1504. }
  1505. .switch.el-switch .el-switch__core,
  1506. .el-switch .el-switch__label {
  1507. width: 64px !important;
  1508. margin: 0;
  1509. }
  1510. }
  1511. }
  1512. .managePermissionTemplates-permission-dialog-box{
  1513. *{
  1514. margin:0;
  1515. }
  1516. .title-p{
  1517. font-size:15px;
  1518. font-weight:700;
  1519. margin-bottom:30px;
  1520. }
  1521. .managePermissionTemplates-permission-dialog-form-box{
  1522. .title-box{
  1523. display: flex;
  1524. height: 60px;
  1525. background: #F5F5F5;
  1526. .left-title-p{
  1527. width:198px;
  1528. border-right:1px solid #E0E0E0;
  1529. font-size:15px;
  1530. font-weight:700;
  1531. padding-left:26px;
  1532. line-height:60px;
  1533. color:#333;
  1534. }
  1535. .right-box{
  1536. flex:1;
  1537. .right-box-min{
  1538. height:20px;
  1539. margin:20px 0 0 50px;
  1540. .el-checkbox__label{
  1541. font-size:15px;
  1542. font-weight:700;
  1543. }
  1544. }
  1545. }
  1546. }
  1547. .check-box{
  1548. display: flex;
  1549. .left-title-box{
  1550. width:198px;
  1551. border:1px solid #E0E0E0;
  1552. position: relative;
  1553. .left-title-p{
  1554. position: absolute;
  1555. left:27px;
  1556. height:20px;
  1557. line-height:20px;
  1558. top:50%;
  1559. margin-top:-10px;
  1560. }
  1561. }
  1562. .right-box{
  1563. padding:0 50px 41px 0;
  1564. flex:1;
  1565. border:1px solid #E0E0E0;
  1566. border-left:none;
  1567. .for-check-box{
  1568. margin:41px 0 0 50px;
  1569. }
  1570. }
  1571. }
  1572. }
  1573. .managePermissionTemplates-permission-dialog-button-box{
  1574. display: flex;
  1575. width:160px;
  1576. margin:0 auto;
  1577. p{
  1578. margin:0;
  1579. width:70px;
  1580. height:30px;
  1581. line-height:30px;
  1582. font-size:14px;
  1583. }
  1584. p:nth-child(1){
  1585. margin-right:20px;
  1586. }
  1587. }
  1588. }
  1589. .managePermissionTemplates-dept-dialog-box{
  1590. *{
  1591. margin:0;
  1592. }
  1593. .managePermissionTemplates-dept-dialog-button-box{
  1594. display: flex;
  1595. width:190px;
  1596. margin:0 auto;
  1597. p{
  1598. margin:0;
  1599. width:70px;
  1600. height:30px;
  1601. line-height:30px;
  1602. font-size:14px;
  1603. }
  1604. p:nth-child(1){
  1605. margin-right:50px;
  1606. }
  1607. }
  1608. }
  1609. </style>