addPage.vue 50 KB

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