clientConfig.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306
  1. <template>
  2. <el-container>
  3. <el-main class="el-main-padding">
  4. <el-form
  5. ref="ruleForm"
  6. :model="ruleForm"
  7. :rules="rules"
  8. label-width="136px"
  9. class="demo-ruleForm"
  10. :inline-message="true"
  11. >
  12. <div style="margin-bottom: 10px">
  13. <el-select
  14. v-if="isSuperAdmin"
  15. v-model="ruleForm.orgId"
  16. placeholder="请选择"
  17. style="width: 180px"
  18. filterable
  19. >
  20. <el-option
  21. v-for="item in rootSchoolSelect"
  22. :key="item.id"
  23. :label="item.name"
  24. :value="item.id"
  25. />
  26. </el-select>
  27. <el-button
  28. style="margin-left: 10px"
  29. :disabled="btnSaveDiabled"
  30. type="primary"
  31. @click="submitForm('ruleForm')"
  32. >保 存</el-button
  33. >
  34. </div>
  35. <el-tabs v-model="tabActiveName" type="border-card">
  36. <el-tab-pane label="学生端配置" name="first">
  37. <el-form-item label="系统名称" prop="OE_STUDENT_SYS_NAME">
  38. <el-input
  39. v-model="ruleForm.OE_STUDENT_SYS_NAME"
  40. placeholder="请输入系统名称"
  41. class="input-width"
  42. ></el-input>
  43. </el-form-item>
  44. <el-form-item label="学校logo" prop="LOGO_FILE_URL">
  45. <el-upload
  46. ref="upload"
  47. class="upload-width"
  48. accept=".png"
  49. :action="uploadAction"
  50. :headers="uploadHeaders"
  51. :data="uploadData"
  52. :before-upload="beforeUpload"
  53. :on-progress="uploadProgress"
  54. :on-success="uploadSuccess"
  55. :on-error="uploadError"
  56. :on-remove="handleRemove"
  57. :file-list="fileList"
  58. :auto-upload="false"
  59. :multiple="false"
  60. :limit="1"
  61. :on-exceed="handleExceed"
  62. list-type="picture"
  63. >
  64. <el-button slot="trigger" size="small" type="primary"
  65. >选择文件</el-button
  66. >&nbsp;
  67. <el-button size="small" type="success" @click="submitUpload"
  68. >确认上传</el-button
  69. >
  70. <el-button size="small" type="danger" @click="removeFile"
  71. >清空文件</el-button
  72. >
  73. <div slot="tip" class="el-upload__tip">
  74. 图片大小(长*宽)为400*100的png文件
  75. </div>
  76. </el-upload>
  77. <el-input
  78. v-show="false"
  79. v-model="ruleForm.LOGO_FILE_URL"
  80. ></el-input>
  81. </el-form-item>
  82. <el-form-item label="登录帐号选择" prop="loginType">
  83. <el-checkbox-group v-model="ruleForm.loginType">
  84. <el-checkbox
  85. v-for="lt in loginTypes"
  86. :key="lt.code"
  87. v-model="lt.code"
  88. name="loginType"
  89. :label="lt.code"
  90. >{{ lt.name }}</el-checkbox
  91. >
  92. </el-checkbox-group>
  93. </el-form-item>
  94. <el-form-item label="学号登录别名" prop="STUDENT_CODE_LOGIN_ALIAS">
  95. <el-input
  96. v-model="ruleForm.STUDENT_CODE_LOGIN_ALIAS"
  97. placeholder="请输入学号登录别名"
  98. class="input-width"
  99. ></el-input>
  100. </el-form-item>
  101. <el-form-item
  102. label="身份证号登录别名"
  103. prop="IDENTITY_NUMBER_LOGIN_ALIAS"
  104. >
  105. <el-input
  106. v-model="ruleForm.IDENTITY_NUMBER_LOGIN_ALIAS"
  107. placeholder="请输入身份号登录别名"
  108. class="input-width"
  109. ></el-input>
  110. </el-form-item>
  111. <el-form-item label="考生端登录方式" prop="loginSupport">
  112. <el-checkbox-group v-model="ruleForm.loginSupport">
  113. <el-checkbox
  114. v-for="lt in loginSupports"
  115. :key="lt.code"
  116. v-model="lt.code"
  117. name="loginSupport"
  118. :label="lt.code"
  119. >{{ lt.name }}</el-checkbox
  120. >
  121. </el-checkbox-group>
  122. </el-form-item>
  123. <el-form-item
  124. label="控制台配置"
  125. prop="STUDENT_CLIENT_CONSOLE_CONFIG"
  126. >
  127. <el-input
  128. v-model="ruleForm.STUDENT_CLIENT_CONSOLE_CONFIG"
  129. placeholder="系统预留,无需配置"
  130. class="input-width"
  131. ></el-input>
  132. </el-form-item>
  133. </el-tab-pane>
  134. <el-tab-pane label="防作弊配置" name="second">
  135. <el-form-item label="防作弊配置" prop="preventCheatingConfig">
  136. <el-checkbox-group v-model="ruleForm.preventCheatingConfig">
  137. <el-checkbox
  138. v-for="pcc in preventCheatingConfigs"
  139. :key="pcc.code"
  140. v-model="pcc.code"
  141. name="preventCheatingConfig"
  142. :label="pcc.code"
  143. >{{ pcc.name }}</el-checkbox
  144. >
  145. </el-checkbox-group>
  146. </el-form-item>
  147. <el-form-item
  148. v-show="false"
  149. label="窗口默认大小"
  150. prop="STUDENT_CLIENT_DEFAULT_SIZE"
  151. >
  152. <el-input
  153. v-model="ruleForm.STUDENT_CLIENT_DEFAULT_SIZE"
  154. placeholder="窗口大小格式为:宽度*高度"
  155. class="input-width"
  156. ></el-input>
  157. </el-form-item>
  158. <el-form-item label="学生端版本" prop="studentClientVersion">
  159. <el-checkbox-group v-model="ruleForm.studentClientVersion">
  160. <el-checkbox
  161. v-for="pcc in studentClientVersions"
  162. :key="pcc.code"
  163. v-model="pcc.code"
  164. name="studentClientVersion"
  165. :label="pcc.code"
  166. >{{ pcc.name }}</el-checkbox
  167. >
  168. </el-checkbox-group>
  169. </el-form-item>
  170. </el-tab-pane>
  171. <el-tab-pane label="自定义菜单配置" name="third">
  172. <el-form-item label="自定义菜单logo">
  173. <el-radio-group
  174. v-model="ruleForm.IS_CUSTOM_MENU_LOGO"
  175. class="input"
  176. @change="csutomMenuLogoChange"
  177. >
  178. <el-radio label="true">是</el-radio>
  179. <el-radio label="false">否</el-radio>
  180. </el-radio-group>
  181. </el-form-item>
  182. <el-form-item
  183. v-if="ruleForm.IS_CUSTOM_MENU_LOGO == 'true'"
  184. label="菜单logo"
  185. prop="CUS_MENU_LOGO_FILE_URL"
  186. >
  187. <el-upload
  188. ref="menuLogUpload"
  189. class="upload-width"
  190. accept=".png"
  191. :action="uploadMenuLogoAction"
  192. :headers="uploadMenuLogoHeaders"
  193. :data="uploadMenuLogoData"
  194. :before-upload="beforeUploadMenuLogo"
  195. :on-progress="uploadMenuLogoProgress"
  196. :on-success="uploadMenuLogoSuccess"
  197. :on-error="uploadMenuLogoError"
  198. :on-remove="handleMenuLogoRemove"
  199. :file-list="menuLogoFileList"
  200. :auto-upload="false"
  201. :multiple="false"
  202. :limit="1"
  203. :on-exceed="handleMenuLogoExceed"
  204. list-type="picture"
  205. >
  206. <el-button slot="trigger" size="small" type="primary"
  207. >选择文件</el-button
  208. >&nbsp;
  209. <el-button
  210. size="small"
  211. type="success"
  212. @click="submitUploadMenuLogo"
  213. >确认上传</el-button
  214. >
  215. <el-button
  216. size="small"
  217. type="danger"
  218. @click="removeMenuLogoFile"
  219. >清空文件</el-button
  220. >
  221. <div slot="tip" class="el-upload__tip">
  222. 图片大小(长*宽)为80*68的png文件
  223. </div>
  224. </el-upload>
  225. <el-input
  226. v-show="false"
  227. v-model="ruleForm.CUS_MENU_LOGO_FILE_URL"
  228. ></el-input>
  229. </el-form-item>
  230. <el-form-item label="菜单自定义">
  231. <!-- 权限树 -->
  232. <div style="width: 80%">
  233. <el-tree
  234. ref="tree"
  235. :data="treeData"
  236. :props="defaultProps"
  237. node-key="id"
  238. highlight-current
  239. :default-expanded-keys="[-1]"
  240. :expand-on-click-node="false"
  241. :render-content="renderMenuTreeContent"
  242. :show-checkbox="true"
  243. style="padding: 10px"
  244. @check-change="treeCheckeChange"
  245. />
  246. </div>
  247. </el-form-item>
  248. </el-tab-pane>
  249. </el-tabs>
  250. </el-form>
  251. <!-- 修改权限 -->
  252. <el-dialog
  253. title="修改权限"
  254. width="450px"
  255. :visible.sync="cusMenuTreeDialog.show"
  256. :close-on-click-modal="false"
  257. >
  258. <el-form
  259. ref="updateForm"
  260. :model="cusMenuTreeDialog.privilege"
  261. inline
  262. inline-message
  263. label-width="100px"
  264. :rules="menuRules"
  265. >
  266. <el-form-item label="权限名称" prop="name">
  267. <el-input
  268. v-model="cusMenuTreeDialog.privilege.name"
  269. :disabled="cusMenuTreeDialog.optType == 'view'"
  270. class="input_width"
  271. maxlength="8"
  272. show-word-limit
  273. />
  274. </el-form-item>
  275. <el-form-item label="权限编码" prop="code">
  276. <el-input
  277. v-model="cusMenuTreeDialog.privilege.code"
  278. disabled
  279. class="input_width"
  280. />
  281. </el-form-item>
  282. <el-form-item label="描述" prop="description">
  283. <el-input
  284. v-model="cusMenuTreeDialog.privilege.description"
  285. :disabled="cusMenuTreeDialog.optType == 'view'"
  286. class="input_width"
  287. />
  288. </el-form-item>
  289. <el-form-item v-if="false" label="权重" prop="weight">
  290. <el-input
  291. v-model="cusMenuTreeDialog.privilege.weight"
  292. :disabled="cusMenuTreeDialog.optType == 'view'"
  293. class="input_width"
  294. />
  295. </el-form-item>
  296. <el-form-item v-if="false" label="属性1">
  297. <el-input
  298. v-model="cusMenuTreeDialog.privilege.ext1"
  299. :disabled="cusMenuTreeDialog.optType == 'view'"
  300. class="input_width"
  301. />
  302. </el-form-item>
  303. <el-form-item v-if="false" label="属性2">
  304. <el-input
  305. v-model="cusMenuTreeDialog.privilege.ext2"
  306. :disabled="cusMenuTreeDialog.optType == 'view'"
  307. class="input_width"
  308. />
  309. </el-form-item>
  310. <el-form-item v-if="false" label="属性3">
  311. <el-input
  312. v-model="cusMenuTreeDialog.privilege.ext3"
  313. :disabled="cusMenuTreeDialog.optType == 'view'"
  314. class="input_width"
  315. />
  316. </el-form-item>
  317. <el-form-item v-if="false" label="属性4">
  318. <el-input
  319. v-model="cusMenuTreeDialog.privilege.ext4"
  320. :disabled="cusMenuTreeDialog.optType == 'view'"
  321. class="input_width"
  322. />
  323. </el-form-item>
  324. <el-form-item v-if="false" label="属性5">
  325. <el-input
  326. v-model="cusMenuTreeDialog.privilege.ext5"
  327. :disabled="cusMenuTreeDialog.optType == 'view'"
  328. class="input_width"
  329. />
  330. </el-form-item>
  331. <el-form-item class="d-flex justify-content-center">
  332. <el-button
  333. v-show="cusMenuTreeDialog.optType != 'view'"
  334. type="primary"
  335. @click="updatePrivilege"
  336. >确 定</el-button
  337. >
  338. <el-button
  339. v-show="cusMenuTreeDialog.optType != 'view'"
  340. @click="cusMenuTreeDialog.show = false"
  341. >取 消</el-button
  342. >
  343. <el-button
  344. v-show="cusMenuTreeDialog.optType == 'view'"
  345. @click="cusMenuTreeDialog.show = false"
  346. >关 闭</el-button
  347. >
  348. </el-form-item>
  349. </el-form>
  350. </el-dialog>
  351. </el-main>
  352. </el-container>
  353. </template>
  354. <script>
  355. import { mapState } from "vuex";
  356. import {
  357. LOGIN_TYPE,
  358. PREVENT_CHEATING_CONFIG,
  359. STUDENT_CLIENT_VERSION,
  360. CORE_API,
  361. LOGIN_SUPPORT,
  362. } from "@/constants/constants.js";
  363. let checkWeight = (rule, value, callback) => {
  364. if ("0" != value && !value) {
  365. return new Error("请输入权重");
  366. } else if ("0" != value && !value.match(/^[1-9][0-9]*$/)) {
  367. callback(new Error("请输入整数"));
  368. } else if (value < 0) {
  369. callback(new Error("不能小于0"));
  370. } else if (value > 10000) {
  371. callback(new Error("不能大于10000"));
  372. } else {
  373. callback();
  374. }
  375. };
  376. let checkCode = (rule, value, callback) => {
  377. if (0 != value && !value) {
  378. callback(new Error("请输入权限编码"));
  379. } else if (!value.match(/^[0-9a-zA-Z_]*$/)) {
  380. callback(new Error('只能由数字、字母和"_"组成'));
  381. } else {
  382. callback();
  383. }
  384. };
  385. export default {
  386. data() {
  387. return {
  388. rootOrgList: [],
  389. loginTypes: LOGIN_TYPE,
  390. loginSupports: LOGIN_SUPPORT,
  391. propertyGroupId: "",
  392. preventCheatingConfigs: PREVENT_CHEATING_CONFIG,
  393. studentClientVersions: STUDENT_CLIENT_VERSION,
  394. formDataChanged: false,
  395. originalRuleForm: {},
  396. ruleForm: {
  397. relatedPropertyGroupIdList: [],
  398. orgId: null,
  399. OE_STUDENT_SYS_NAME: "",
  400. LOGO_FILE_URL: "",
  401. LOGIN_TYPE: "",
  402. PREVENT_CHEATING_CONFIG: "",
  403. STUDENT_CLIENT_VERSION: "",
  404. STUDENT_CLIENT_DEFAULT_SIZE: "",
  405. STUDENT_CLIENT_CONSOLE_CONFIG: "",
  406. STUDENT_CODE_LOGIN_ALIAS: "学号登录",
  407. IDENTITY_NUMBER_LOGIN_ALIAS: "身份证号登录",
  408. LOGIN_SUPPORT: "",
  409. IS_CUSTOM_MENU_LOGO: "false",
  410. CUS_MENU_LOGO_FILE_URL: "",
  411. properties: {
  412. OE_STUDENT_SYS_NAME: "",
  413. LOGO_FILE_URL: "",
  414. LOGIN_TYPE: "",
  415. PREVENT_CHEATING_CONFIG: "",
  416. STUDENT_CLIENT_VERSION: "",
  417. STUDENT_CLIENT_DEFAULT_SIZE: "",
  418. STUDENT_CLIENT_CONSOLE_CONFIG: "",
  419. STUDENT_CODE_LOGIN_ALIAS: "学号登录",
  420. IDENTITY_NUMBER_LOGIN_ALIAS: "身份证号登录",
  421. LOGIN_SUPPORT: "",
  422. IS_CUSTOM_MENU_LOGO: "false",
  423. CUS_MENU_LOGO_FILE_URL: "",
  424. },
  425. loginType: [],
  426. preventCheatingConfig: [],
  427. studentClientVersion: [],
  428. loginSupport: [],
  429. },
  430. logoDialog: false,
  431. uploadAction: "",
  432. uploadHeaders: {},
  433. uploadData: {},
  434. fileList: [],
  435. menuRules: {
  436. name: [
  437. {
  438. required: true,
  439. message: "请输入权限名称",
  440. trigger: "blur",
  441. },
  442. ],
  443. code: [
  444. {
  445. required: true,
  446. message: "请输入权限编码",
  447. trigger: "blur",
  448. },
  449. {
  450. validator: checkCode,
  451. trigger: "blur",
  452. },
  453. ],
  454. weight: [
  455. {
  456. required: true,
  457. message: "请输入权重",
  458. trigger: "blur",
  459. },
  460. {
  461. validator: checkWeight,
  462. trigger: "blur",
  463. },
  464. ],
  465. },
  466. rules: {
  467. OE_STUDENT_SYS_NAME: [
  468. { required: true, message: "请输入系统名称", trigger: "blur" },
  469. {
  470. min: 1,
  471. max: 50,
  472. message: "长度在 1 到 50 个字符",
  473. trigger: "blur",
  474. },
  475. ],
  476. LOGO_FILE_URL: [
  477. { required: true, message: "请上传学校logo", trigger: "change" },
  478. ],
  479. loginType: [
  480. {
  481. type: "array",
  482. required: true,
  483. message: "请至少选择一个登录账号选择",
  484. trigger: "change",
  485. },
  486. ],
  487. loginSupport: [
  488. {
  489. type: "array",
  490. required: true,
  491. message: "请至少选择一个考生端登录方式",
  492. trigger: "change",
  493. },
  494. ],
  495. STUDENT_CLIENT_DEFAULT_SIZE: [
  496. { required: true, message: "请输入客户端默认大小", trigger: "blur" },
  497. ],
  498. STUDENT_CODE_LOGIN_ALIAS: [
  499. { required: true, message: "请输入学号登录别名", trigger: "blur" },
  500. {
  501. min: 1,
  502. max: 10,
  503. message: "长度在 1 到 10 个字符",
  504. trigger: "blur",
  505. },
  506. ],
  507. IDENTITY_NUMBER_LOGIN_ALIAS: [
  508. {
  509. required: true,
  510. message: "请输入身份证号登录别名",
  511. trigger: "blur",
  512. },
  513. {
  514. min: 1,
  515. max: 10,
  516. message: "长度在 1 到 10 个字符",
  517. trigger: "blur",
  518. },
  519. ],
  520. studentClientVersion: [
  521. {
  522. type: "array",
  523. required: true,
  524. message: "请至少选择一个学生端版本",
  525. trigger: "change",
  526. },
  527. ],
  528. CUS_MENU_LOGO_FILE_URL: [
  529. {
  530. required: true,
  531. message: "请上传自定义菜单logo",
  532. trigger: "change",
  533. },
  534. ],
  535. },
  536. tabActiveName: "first",
  537. uploadMenuLogoAction: "",
  538. uploadMenuLogoHeaders: {},
  539. uploadMenuLogoData: {},
  540. menuLogoFileList: [],
  541. originalCusMenuForm: {},
  542. cusMenuTreeDialog: {
  543. show: false,
  544. parentName: null,
  545. optType: null,
  546. privilege: {
  547. id: null,
  548. groupId: null,
  549. parentId: null,
  550. name: null,
  551. code: null,
  552. description: null,
  553. weight: null,
  554. ext1: null,
  555. ext2: null,
  556. ext3: null,
  557. ext4: null,
  558. ext5: null,
  559. },
  560. },
  561. treeData: [],
  562. data: null,
  563. defaultProps: {
  564. children: "children",
  565. label: "label",
  566. },
  567. privilegeGroupId: null,
  568. checkedKeys: [],
  569. originalCheckedKeys: [],
  570. treeCheckedChanged: false,
  571. };
  572. },
  573. computed: {
  574. ...mapState({ user: (state) => state.user }),
  575. btnSaveDiabled() {
  576. // console.log(this.formDataChanged);
  577. return !this.formDataChanged && !this.treeCheckedChanged;
  578. },
  579. isSuperAdmin() {
  580. return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
  581. },
  582. rootSchoolSelect() {
  583. let rootSchools = [];
  584. for (let i = 0; i < this.rootOrgList.length; i++) {
  585. let info = {
  586. name: this.rootOrgList[i].name + "(" + this.rootOrgList[i].id + ")",
  587. id: this.rootOrgList[i].id,
  588. };
  589. rootSchools.push(info);
  590. }
  591. return rootSchools;
  592. },
  593. },
  594. watch: {
  595. "ruleForm.orgId": {
  596. handler: function () {
  597. this.initForm();
  598. },
  599. },
  600. checkedKeys: {
  601. handler: function (newVal) {
  602. this.treeCheckedChanged = !this.equalArrayIgnoreSequence(
  603. this.originalCheckedKeys,
  604. newVal
  605. );
  606. },
  607. },
  608. ruleForm: {
  609. deep: true,
  610. handler: function (newForm) {
  611. if (Object.keys(this.originalRuleForm).length > 0) {
  612. this.formDataChanged = !(
  613. newForm.OE_STUDENT_SYS_NAME ==
  614. this.originalRuleForm.OE_STUDENT_SYS_NAME &&
  615. newForm.LOGO_FILE_URL == this.originalRuleForm.LOGO_FILE_URL &&
  616. this.equalArrayIgnoreSequence(
  617. newForm.loginType,
  618. this.originalRuleForm.loginType
  619. ) &&
  620. this.equalArrayIgnoreSequence(
  621. newForm.loginSupport,
  622. this.originalRuleForm.loginSupport
  623. ) &&
  624. this.equalArrayIgnoreSequence(
  625. newForm.preventCheatingConfig,
  626. this.originalRuleForm.preventCheatingConfig
  627. ) &&
  628. this.equalArrayIgnoreSequence(
  629. newForm.studentClientVersion,
  630. this.originalRuleForm.studentClientVersion
  631. ) &&
  632. newForm.STUDENT_CLIENT_CONSOLE_CONFIG ==
  633. this.originalRuleForm.STUDENT_CLIENT_CONSOLE_CONFIG &&
  634. newForm.STUDENT_CODE_LOGIN_ALIAS ==
  635. this.originalRuleForm.STUDENT_CODE_LOGIN_ALIAS &&
  636. newForm.IDENTITY_NUMBER_LOGIN_ALIAS ==
  637. this.originalRuleForm.IDENTITY_NUMBER_LOGIN_ALIAS &&
  638. newForm.IS_CUSTOM_MENU_LOGO ==
  639. this.originalRuleForm.IS_CUSTOM_MENU_LOGO &&
  640. newForm.CUS_MENU_LOGO_FILE_URL ==
  641. this.originalRuleForm.CUS_MENU_LOGO_FILE_URL
  642. );
  643. } else {
  644. this.formDataChanged = false;
  645. }
  646. },
  647. },
  648. },
  649. created() {
  650. this.ruleForm.orgId = this.user.rootOrgId;
  651. this.propertyGroupId = "config4Edit3";
  652. this.uploadHeaders = {
  653. key: this.user.key,
  654. token: this.user.token,
  655. };
  656. this.uploadMenuLogoHeaders = {
  657. key: this.user.key,
  658. token: this.user.token,
  659. };
  660. if (this.isSuperAdmin) {
  661. this.$httpWithMsg
  662. .get(CORE_API + "/org/getRootOrgList")
  663. .then((response) => {
  664. this.rootOrgList = response.data;
  665. });
  666. }
  667. this.initForm();
  668. },
  669. methods: {
  670. submitForm(formName) {
  671. this.$refs[formName].validate((valid) => {
  672. if (valid) {
  673. if (
  674. this.$refs.tree.getCheckedKeys() == null ||
  675. this.$refs.tree.getCheckedKeys().length == 0
  676. ) {
  677. this.$notify({
  678. message: "请至少选择一个菜单功能",
  679. type: "error",
  680. });
  681. return;
  682. }
  683. this.ruleForm.properties.OE_STUDENT_SYS_NAME = this.ruleForm.OE_STUDENT_SYS_NAME;
  684. this.ruleForm.properties.LOGO_FILE_URL = this.ruleForm.LOGO_FILE_URL;
  685. this.ruleForm.properties.STUDENT_CLIENT_DEFAULT_SIZE = this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE;
  686. this.ruleForm.properties.STUDENT_CLIENT_CONSOLE_CONFIG = this.ruleForm.STUDENT_CLIENT_CONSOLE_CONFIG;
  687. this.ruleForm.properties.LOGIN_TYPE = this.ruleForm.LOGIN_TYPE = this.ruleForm.loginType.join(
  688. ","
  689. );
  690. this.ruleForm.properties.LOGIN_SUPPORT = this.ruleForm.LOGIN_SUPPORT = this.ruleForm.loginSupport.join(
  691. ","
  692. );
  693. this.ruleForm.properties.STUDENT_CODE_LOGIN_ALIAS = this.ruleForm.STUDENT_CODE_LOGIN_ALIAS;
  694. this.ruleForm.properties.IDENTITY_NUMBER_LOGIN_ALIAS = this.ruleForm.IDENTITY_NUMBER_LOGIN_ALIAS;
  695. if (
  696. this.ruleForm.preventCheatingConfig == null ||
  697. this.ruleForm.preventCheatingConfig.length == 0
  698. ) {
  699. this.ruleForm.properties.PREVENT_CHEATING_CONFIG = this.ruleForm.PREVENT_CHEATING_CONFIG =
  700. "NONE";
  701. } else {
  702. let defaultArr = [];
  703. for (let lt of PREVENT_CHEATING_CONFIG) {
  704. defaultArr.push(lt.code);
  705. }
  706. let validArr = [];
  707. //保存时清理一下历史数据
  708. for (
  709. let i = 0;
  710. i < this.ruleForm.preventCheatingConfig.length;
  711. i++
  712. ) {
  713. let code = this.ruleForm.preventCheatingConfig[i];
  714. if (defaultArr.indexOf(code) > -1) {
  715. validArr.push(code);
  716. }
  717. }
  718. let res = "";
  719. if (validArr.length == 0) {
  720. res = "NONE";
  721. } else {
  722. res = validArr.join(",");
  723. }
  724. this.ruleForm.properties.PREVENT_CHEATING_CONFIG = this.ruleForm.PREVENT_CHEATING_CONFIG = res;
  725. }
  726. if (
  727. this.ruleForm.studentClientVersion == null ||
  728. this.ruleForm.studentClientVersion.length == 0
  729. ) {
  730. this.ruleForm.properties.STUDENT_CLIENT_VERSION = this.ruleForm.STUDENT_CLIENT_VERSION =
  731. "NONE";
  732. } else {
  733. let defaultArr = [];
  734. for (let lt of STUDENT_CLIENT_VERSION) {
  735. defaultArr.push(lt.code);
  736. }
  737. let validArr = [];
  738. //保存时清理一下历史数据
  739. for (
  740. let i = 0;
  741. i < this.ruleForm.studentClientVersion.length;
  742. i++
  743. ) {
  744. let code = this.ruleForm.studentClientVersion[i];
  745. if (defaultArr.indexOf(code) > -1) {
  746. validArr.push(code);
  747. }
  748. }
  749. let res = "";
  750. if (validArr.length == 0) {
  751. res = "NONE";
  752. } else {
  753. res = validArr.join(",");
  754. }
  755. this.ruleForm.properties.STUDENT_CLIENT_VERSION = this.ruleForm.STUDENT_CLIENT_VERSION = res;
  756. }
  757. this.ruleForm.properties.IS_CUSTOM_MENU_LOGO = this.ruleForm.IS_CUSTOM_MENU_LOGO;
  758. if (this.ruleForm.IS_CUSTOM_MENU_LOGO == "true") {
  759. this.ruleForm.properties.CUS_MENU_LOGO_FILE_URL = this.ruleForm.CUS_MENU_LOGO_FILE_URL;
  760. }
  761. Promise.all([
  762. this.$httpWithMsg.put(
  763. CORE_API + "/org/saveOrgProperties",
  764. this.ruleForm
  765. ),
  766. this.$httpWithMsg.post(
  767. CORE_API + "/rolePrivilege/updateRootOrgPrivilegeRelations",
  768. {
  769. rootOrgId: this.ruleForm.orgId,
  770. privilegeGroupId: this.privilegeGroupId,
  771. privilegeIdSet: this.checkedKeys,
  772. }
  773. ),
  774. ]).then(([resp1, resp2]) => {
  775. console.log("resp1:" + resp1);
  776. console.log("resp1:" + resp2);
  777. this.$notify({
  778. message: "保存成功",
  779. type: "success",
  780. });
  781. this.originalRuleForm = Object.assign({}, this.ruleForm);
  782. this.formDataChanged = false;
  783. this.treeCheckedChanged = false;
  784. this.originalCheckedKeys = this.$refs.tree.getCheckedKeys();
  785. });
  786. } else {
  787. console.log("error submit!!");
  788. return false;
  789. }
  790. });
  791. },
  792. async initForm() {
  793. this.uploadAction = CORE_API + "/org/importLogo/" + this.ruleForm.orgId;
  794. this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE = "1400*900";
  795. this.ruleForm.relatedPropertyGroupIdList = ["studentClientConfig"];
  796. await this.initConfig();
  797. this.initTree();
  798. },
  799. beforeUpload(file) {
  800. if (!this.checkUpload()) {
  801. return false;
  802. }
  803. console.log(file);
  804. },
  805. uploadProgress() {
  806. console.log("uploadProgress");
  807. },
  808. uploadSuccess(response) {
  809. console.log("uploadSuccess");
  810. console.log(response);
  811. if (response && response.length > 0) {
  812. this.$notify({
  813. message: "上传成功",
  814. type: "success",
  815. });
  816. let fileUrl = response;
  817. this.ruleForm.LOGO_FILE_URL = this.ruleForm.properties.LOGO_FILE_URL = fileUrl;
  818. } else {
  819. this.errDialog = true;
  820. }
  821. this.fileLoading = false;
  822. this.logoDialog = false;
  823. // this.removeFile();
  824. },
  825. uploadError(response) {
  826. let json = JSON.parse(response.message);
  827. if (response.status == 500) {
  828. this.$notify({
  829. message: json.desc,
  830. type: "error",
  831. });
  832. }
  833. this.fileLoading = false;
  834. },
  835. //确定上传
  836. submitUpload() {
  837. if (!this.checkUpload()) {
  838. return false;
  839. }
  840. this.$refs.upload.submit();
  841. this.fileLoading = true;
  842. },
  843. checkUpload() {
  844. let fileList = this.$refs.upload.uploadFiles;
  845. if (fileList.length == 0) {
  846. this.$notify({
  847. message: "上传文件不能为空",
  848. type: "error",
  849. });
  850. return false;
  851. }
  852. if (fileList.length > 1) {
  853. this.$notify({
  854. message: "每次只能上传一个文件",
  855. type: "error",
  856. });
  857. return false;
  858. }
  859. for (let file of fileList) {
  860. let fileName = file.name;
  861. if (
  862. // !fileName.endsWith(".jpg") &&
  863. // !fileName.endsWith(".gif") &&
  864. !fileName.endsWith(".png")
  865. ) {
  866. this.$notify({
  867. message: "上传文件格式必须为[png]",
  868. type: "error",
  869. });
  870. this.fileList = [];
  871. return false;
  872. }
  873. }
  874. return true;
  875. },
  876. //清空文件
  877. removeFile() {
  878. this.fileList = [];
  879. this.ruleForm.LOGO_FILE_URL = this.ruleForm.properties.LOGO_FILE_URL = "";
  880. if (this.$refs.upload) {
  881. this.$refs.upload.clearFiles();
  882. }
  883. },
  884. handleRemove(file, fileList) {
  885. console.log(file, fileList);
  886. this.removeFile();
  887. },
  888. handleExceed() {
  889. this.$notify({
  890. message: "当前限制选择 1 个文件,请先清空文件再试",
  891. type: "error",
  892. });
  893. },
  894. equalArrayIgnoreSequence(arr1, arr2) {
  895. // 判断数组的长度
  896. if (arr1.length !== arr2.length) {
  897. return false;
  898. } else {
  899. let a = Object.assign([], arr1);
  900. let b = Object.assign([], arr2);
  901. a.sort();
  902. b.sort();
  903. // 循环遍历数组的值进行比较
  904. for (let i = 0; i < a.length; i++) {
  905. if (a[i] !== b[i]) {
  906. return false;
  907. }
  908. }
  909. return true;
  910. }
  911. },
  912. //初始化配置
  913. async initConfig() {
  914. let url =
  915. CORE_API +
  916. "/org/getOrgPropertiesByGroupWithoutCache/" +
  917. this.ruleForm.orgId +
  918. "/" +
  919. this.propertyGroupId;
  920. await this.$httpWithMsg.get(url).then((response) => {
  921. console.log(response);
  922. if (response) {
  923. this.ruleForm.properties = response.data;
  924. // if (this.ruleForm.properties.OE_STUDENT_SYS_NAME) {
  925. this.ruleForm.OE_STUDENT_SYS_NAME =
  926. this.ruleForm.properties.OE_STUDENT_SYS_NAME ||
  927. this.ruleForm.OE_STUDENT_SYS_NAME;
  928. // }
  929. this.ruleForm.LOGO_FILE_URL =
  930. this.ruleForm.properties.LOGO_FILE_URL ||
  931. this.ruleForm.LOGO_FILE_URL;
  932. this.ruleForm.LOGIN_TYPE =
  933. this.ruleForm.properties.LOGIN_TYPE || this.ruleForm.LOGIN_TYPE;
  934. this.ruleForm.LOGIN_SUPPORT =
  935. this.ruleForm.properties.LOGIN_SUPPORT ||
  936. this.ruleForm.LOGIN_SUPPORT;
  937. this.ruleForm.PREVENT_CHEATING_CONFIG =
  938. this.ruleForm.properties.PREVENT_CHEATING_CONFIG ||
  939. this.ruleForm.PREVENT_CHEATING_CONFIG;
  940. this.ruleForm.STUDENT_CLIENT_VERSION =
  941. this.ruleForm.properties.STUDENT_CLIENT_VERSION ||
  942. this.ruleForm.STUDENT_CLIENT_VERSION;
  943. this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE =
  944. this.ruleForm.properties.STUDENT_CLIENT_DEFAULT_SIZE ||
  945. this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE;
  946. this.ruleForm.STUDENT_CLIENT_CONSOLE_CONFIG =
  947. this.ruleForm.properties.STUDENT_CLIENT_CONSOLE_CONFIG ||
  948. this.ruleForm.STUDENT_CLIENT_CONSOLE_CONFIG;
  949. this.ruleForm.STUDENT_CODE_LOGIN_ALIAS =
  950. this.ruleForm.properties.STUDENT_CODE_LOGIN_ALIAS ||
  951. this.ruleForm.STUDENT_CODE_LOGIN_ALIAS;
  952. this.ruleForm.IDENTITY_NUMBER_LOGIN_ALIAS =
  953. this.ruleForm.properties.IDENTITY_NUMBER_LOGIN_ALIAS ||
  954. this.ruleForm.IDENTITY_NUMBER_LOGIN_ALIAS;
  955. if (this.ruleForm.properties.LOGIN_TYPE) {
  956. this.ruleForm.loginType = this.ruleForm.properties.LOGIN_TYPE.split(
  957. ","
  958. );
  959. } else {
  960. let defaultValue = [];
  961. for (let lt of LOGIN_TYPE) {
  962. defaultValue.push(lt.code);
  963. }
  964. this.ruleForm.loginType = defaultValue;
  965. console.log(defaultValue);
  966. }
  967. if (this.ruleForm.properties.LOGIN_SUPPORT) {
  968. this.ruleForm.loginSupport = this.ruleForm.properties.LOGIN_SUPPORT.split(
  969. ","
  970. );
  971. }
  972. if (this.ruleForm.properties.PREVENT_CHEATING_CONFIG) {
  973. if (this.ruleForm.properties.PREVENT_CHEATING_CONFIG != "NONE") {
  974. this.ruleForm.preventCheatingConfig = this.ruleForm.properties.PREVENT_CHEATING_CONFIG.split(
  975. ","
  976. );
  977. } else {
  978. this.ruleForm.preventCheatingConfig = [];
  979. }
  980. } else {
  981. let defaultValue = [];
  982. for (let lt of PREVENT_CHEATING_CONFIG) {
  983. defaultValue.push(lt.code);
  984. }
  985. this.ruleForm.preventCheatingConfig = defaultValue;
  986. // console.log(defaultValue);
  987. }
  988. if (this.ruleForm.properties.STUDENT_CLIENT_VERSION) {
  989. if (this.ruleForm.properties.STUDENT_CLIENT_VERSION != "NONE") {
  990. this.ruleForm.studentClientVersion = this.ruleForm.properties.STUDENT_CLIENT_VERSION.split(
  991. ","
  992. );
  993. } else {
  994. this.ruleForm.studentClientVersion = [];
  995. }
  996. } else {
  997. let defaultValue = [];
  998. // for (let lt of STUDENT_CLIENT_VERSION) {
  999. // defaultValue.push(lt.code);
  1000. // }
  1001. this.ruleForm.studentClientVersion = defaultValue;
  1002. // console.log(defaultValue);
  1003. }
  1004. let fileUrl = response.data.LOGO_FILE_URL;
  1005. let fname = "";
  1006. if (fileUrl) {
  1007. let lastIndex = fileUrl.lastIndexOf("/");
  1008. let len = fileUrl.length;
  1009. fname = fileUrl.substr(lastIndex + 1, len - lastIndex);
  1010. this.fileList = [{ name: fname, url: this.ruleForm.LOGO_FILE_URL }];
  1011. } else {
  1012. this.fileList = [];
  1013. }
  1014. this.uploadMenuLogoAction =
  1015. CORE_API + "/org/importCusMenuLogo/" + this.ruleForm.orgId;
  1016. this.ruleForm.IS_CUSTOM_MENU_LOGO =
  1017. this.ruleForm.properties.IS_CUSTOM_MENU_LOGO ||
  1018. this.ruleForm.IS_CUSTOM_MENU_LOGO;
  1019. if (this.ruleForm.IS_CUSTOM_MENU_LOGO == "true") {
  1020. this.ruleForm.CUS_MENU_LOGO_FILE_URL =
  1021. this.ruleForm.properties.CUS_MENU_LOGO_FILE_URL ||
  1022. this.ruleForm.CUS_MENU_LOGO_FILE_URL;
  1023. let fileUrl2 = response.data.CUS_MENU_LOGO_FILE_URL;
  1024. let fname2 = "";
  1025. if (fileUrl2) {
  1026. let lastIndex = fileUrl2.lastIndexOf("/");
  1027. let len = fileUrl2.length;
  1028. fname2 = fileUrl2.substr(lastIndex + 1, len - lastIndex);
  1029. this.menuLogoFileList = [
  1030. { name: fname2, url: this.ruleForm.CUS_MENU_LOGO_FILE_URL },
  1031. ];
  1032. } else {
  1033. this.menuLogoFileList = [];
  1034. }
  1035. }
  1036. this.originalRuleForm = Object.assign({}, this.ruleForm);
  1037. } else {
  1038. this.$notify({
  1039. message: "学生客户端信息暂未初始化,请立即初始化",
  1040. type: "warning",
  1041. });
  1042. }
  1043. });
  1044. },
  1045. //初始化权限树
  1046. async initTree() {
  1047. var url =
  1048. CORE_API +
  1049. "/rolePrivilege/getStudentClientMenuTree/" +
  1050. this.ruleForm.orgId +
  1051. "?includeDisabledCodes=false";
  1052. this.$httpWithMsg.get(url).then((response) => {
  1053. if (response) {
  1054. this.treeData = [];
  1055. this.treeData.push(response.data.treeData);
  1056. this.privilegeGroupId = response.data.privilegeGroupId;
  1057. this.originalCheckedKeys = response.data.ownedPrivilegeIds;
  1058. this.checkedKeys = response.data.ownedPrivilegeIds;
  1059. this.setCheckedKeys(this.checkedKeys);
  1060. } else {
  1061. this.$notify({
  1062. message: "自定义菜单权限树初始化失败",
  1063. type: "warning",
  1064. });
  1065. }
  1066. });
  1067. },
  1068. setCheckedKeys(keys) {
  1069. this.$refs.tree.setCheckedKeys(keys);
  1070. },
  1071. renderMenuTreeContent(h, { node, data, store }) {
  1072. if (node.key == -1) {
  1073. return (
  1074. <span>
  1075. <span>
  1076. <span>{node.label}</span>
  1077. </span>
  1078. </span>
  1079. );
  1080. }
  1081. return (
  1082. <span>
  1083. <span>
  1084. <span>{node.label}</span>
  1085. </span>
  1086. <span style="float: right; margin-left: 20px; margin-right: 20px">
  1087. <el-button
  1088. size="mini"
  1089. type="text"
  1090. on-click={() => this.openCusMenuTreeDialog(store, data, "view")}
  1091. >
  1092. 查看
  1093. </el-button>
  1094. <el-button
  1095. size="mini"
  1096. type="text"
  1097. on-click={() => this.openCusMenuTreeDialog(store, data, "edit")}
  1098. >
  1099. 修改
  1100. </el-button>
  1101. </span>
  1102. </span>
  1103. );
  1104. },
  1105. treeCheckeChange(data, checked, indeterminate) {
  1106. console.log(data, checked, indeterminate);
  1107. this.checkedKeys = this.$refs.tree.getCheckedKeys();
  1108. },
  1109. openCusMenuTreeDialog(store, data, optType) {
  1110. this.store = store;
  1111. this.data = data;
  1112. this.getPrivilege(data.id, optType);
  1113. },
  1114. getPrivilege(id, type) {
  1115. var url = CORE_API + "/rolePrivilege/getPrivilege/" + id;
  1116. this.$httpWithMsg.get(url).then((response) => {
  1117. var resp = response.data;
  1118. this.cusMenuTreeDialog.show = true;
  1119. this.cusMenuTreeDialog.optType = type;
  1120. this.cusMenuTreeDialog.privilege.id = resp.id;
  1121. this.cusMenuTreeDialog.privilege.groupId = resp.groupId;
  1122. this.cusMenuTreeDialog.privilege.parentId = resp.parentId;
  1123. this.cusMenuTreeDialog.privilege.name = resp.name;
  1124. this.cusMenuTreeDialog.privilege.code = resp.code;
  1125. this.cusMenuTreeDialog.privilege.description = resp.description;
  1126. this.cusMenuTreeDialog.privilege.weight = resp.weight + "";
  1127. this.cusMenuTreeDialog.privilege.ext1 = resp.ext1;
  1128. this.cusMenuTreeDialog.privilege.ext2 = resp.ext2;
  1129. this.cusMenuTreeDialog.privilege.ext3 = resp.ext3;
  1130. this.cusMenuTreeDialog.privilege.ext4 = resp.ext4;
  1131. this.cusMenuTreeDialog.privilege.ext5 = resp.ext5;
  1132. });
  1133. },
  1134. beforeUploadMenuLogo(file) {
  1135. if (!this.checkUploadMenuLogo()) {
  1136. return false;
  1137. }
  1138. console.log(file);
  1139. },
  1140. uploadMenuLogoProgress() {
  1141. console.log("uploadProgress");
  1142. },
  1143. uploadMenuLogoSuccess(response) {
  1144. console.log("uploadSuccess");
  1145. // console.log(response);
  1146. if (response && response.length > 0) {
  1147. this.$notify({
  1148. message: "上传成功",
  1149. type: "success",
  1150. });
  1151. let fileUrl = response;
  1152. this.ruleForm.CUS_MENU_LOGO_FILE_URL = this.ruleForm.properties.CUS_MENU_LOGO_FILE_URL = fileUrl;
  1153. } else {
  1154. this.errDialog = true;
  1155. }
  1156. this.fileLoading = false;
  1157. this.logoDialog = false;
  1158. // this.removeFile();
  1159. },
  1160. uploadMenuLogoError(response) {
  1161. let json = JSON.parse(response.message);
  1162. if (response.status == 500) {
  1163. this.$notify({
  1164. message: json.desc,
  1165. type: "error",
  1166. });
  1167. }
  1168. this.fileLoading = false;
  1169. },
  1170. //确定上传
  1171. submitUploadMenuLogo() {
  1172. if (!this.checkUploadMenuLogo()) {
  1173. return false;
  1174. }
  1175. this.$refs.menuLogUpload.submit();
  1176. this.fileLoading = true;
  1177. },
  1178. checkUploadMenuLogo() {
  1179. let fileList = this.$refs.menuLogUpload.uploadFiles;
  1180. if (fileList.length == 0) {
  1181. this.$notify({
  1182. message: "上传文件不能为空",
  1183. type: "error",
  1184. });
  1185. return false;
  1186. }
  1187. if (fileList.length > 1) {
  1188. this.$notify({
  1189. message: "每次只能上传一个文件",
  1190. type: "error",
  1191. });
  1192. return false;
  1193. }
  1194. for (let file of fileList) {
  1195. let fileName = file.name;
  1196. if (
  1197. // !fileName.endsWith(".jpg") &&
  1198. // !fileName.endsWith(".gif") &&
  1199. !fileName.endsWith(".png")
  1200. ) {
  1201. this.$notify({
  1202. message: "上传文件格式必须为[png]",
  1203. type: "error",
  1204. });
  1205. this.menuLogoFileList = [];
  1206. return false;
  1207. }
  1208. }
  1209. return true;
  1210. },
  1211. //清空文件
  1212. removeMenuLogoFile() {
  1213. this.menuLogoFileList = [];
  1214. this.ruleForm.CUS_MENU_LOGO_FILE_URL = this.ruleForm.properties.CUS_MENU_LOGO_FILE_URL =
  1215. "";
  1216. if (this.$refs.menuLogUpload) {
  1217. this.$refs.menuLogUpload.clearFiles();
  1218. }
  1219. },
  1220. handleMenuLogoRemove(file, fileList) {
  1221. console.log(file, fileList);
  1222. this.removeMenuLogoFile();
  1223. },
  1224. handleMenuLogoExceed() {
  1225. this.$notify({
  1226. message: "当前限制选择 1 个文件,请先清空文件再试",
  1227. type: "error",
  1228. });
  1229. },
  1230. updatePrivilege() {
  1231. this.$refs.updateForm.validate((valid) => {
  1232. if (!valid) {
  1233. return;
  1234. }
  1235. var url = CORE_API + "/rolePrivilege/updatePrivilege";
  1236. this.$httpWithMsg
  1237. .put(url, this.cusMenuTreeDialog.privilege)
  1238. .then(() => {
  1239. this.$notify({
  1240. message: "修改成功",
  1241. type: "success",
  1242. });
  1243. this.data.label = this.cusMenuTreeDialog.privilege.name;
  1244. });
  1245. this.cusMenuTreeDialog.show = false;
  1246. });
  1247. },
  1248. csutomMenuLogoChange(val) {
  1249. if (val == "false") {
  1250. this.removeMenuLogoFile();
  1251. }
  1252. },
  1253. },
  1254. };
  1255. </script>
  1256. <style scoped>
  1257. .input-width {
  1258. width: 638px;
  1259. }
  1260. .upload-width {
  1261. width: 638px;
  1262. }
  1263. /* .btn-margin-left {
  1264. margin-left: 20px;
  1265. } */
  1266. </style>