clientConfig.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  1. <template>
  2. <el-container>
  3. <el-main class="el-main-padding">
  4. <el-form
  5. :model="ruleForm"
  6. :rules="rules"
  7. ref="ruleForm"
  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 rootOrgList"
  22. :label="item.name"
  23. :value="item.id"
  24. :key="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. class="upload-width"
  47. ref="upload"
  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 size="small" slot="trigger" 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. name="loginType"
  87. :label="lt.code"
  88. v-model="lt.code"
  89. :key="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. name="loginSupport"
  116. :label="lt.code"
  117. v-model="lt.code"
  118. :key="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. name="preventCheatingConfig"
  140. :label="pcc.code"
  141. v-model="pcc.code"
  142. :key="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. name="studentClientVersion"
  163. :label="pcc.code"
  164. v-model="pcc.code"
  165. :key="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. @change="csutomMenuLogoChange"
  175. v-model="ruleForm.IS_CUSTOM_MENU_LOGO"
  176. class="input"
  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. label="菜单logo"
  184. prop="CUS_MENU_LOGO_FILE_URL"
  185. v-if="ruleForm.IS_CUSTOM_MENU_LOGO == 'true'"
  186. >
  187. <el-upload
  188. class="upload-width"
  189. ref="menuLogUpload"
  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 size="small" slot="trigger" 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. :data="treeData"
  235. :props="defaultProps"
  236. node-key="id"
  237. ref="tree"
  238. highlight-current
  239. :default-expanded-keys="[-1]"
  240. :expand-on-click-node="false"
  241. :render-content="renderMenuTreeContent"
  242. :show-checkbox="true"
  243. @check-change="treeCheckeChange"
  244. style="padding: 10px;"
  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. :model="cusMenuTreeDialog.privilege"
  260. inline
  261. inline-message
  262. ref="updateForm"
  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 label="权重" prop="weight" v-if="false">
  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 label="属性1" v-if="false">
  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 label="属性2" v-if="false">
  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 label="属性3" v-if="false">
  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 label="属性4" v-if="false">
  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 label="属性5" v-if="false">
  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. { required: true, message: "请上传自定义菜单logo", trigger: "change" }
  530. ]
  531. },
  532. tabActiveName: "first",
  533. uploadMenuLogoAction: "",
  534. uploadMenuLogoHeaders: {},
  535. uploadMenuLogoData: {},
  536. menuLogoFileList: [],
  537. originalCusMenuForm: {},
  538. cusMenuTreeDialog: {
  539. show: false,
  540. parentName: null,
  541. optType: null,
  542. privilege: {
  543. id: null,
  544. groupId: null,
  545. parentId: null,
  546. name: null,
  547. code: null,
  548. description: null,
  549. weight: null,
  550. ext1: null,
  551. ext2: null,
  552. ext3: null,
  553. ext4: null,
  554. ext5: null
  555. }
  556. },
  557. treeData: [],
  558. data: null,
  559. defaultProps: {
  560. children: "children",
  561. label: "label"
  562. },
  563. privilegeGroupId: null,
  564. checkedKeys: [],
  565. originalCheckedKeys: [],
  566. treeCheckedChanged: false
  567. };
  568. },
  569. methods: {
  570. submitForm(formName) {
  571. this.$refs[formName].validate(valid => {
  572. if (valid) {
  573. if (
  574. this.$refs.tree.getCheckedKeys() == null ||
  575. this.$refs.tree.getCheckedKeys().length == 0
  576. ) {
  577. this.$notify({
  578. message: "请至少选择一个菜单功能",
  579. type: "error"
  580. });
  581. return;
  582. }
  583. this.ruleForm.properties.OE_STUDENT_SYS_NAME = this.ruleForm.OE_STUDENT_SYS_NAME;
  584. this.ruleForm.properties.LOGO_FILE_URL = this.ruleForm.LOGO_FILE_URL;
  585. this.ruleForm.properties.STUDENT_CLIENT_DEFAULT_SIZE = this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE;
  586. this.ruleForm.properties.STUDENT_CLIENT_CONSOLE_CONFIG = this.ruleForm.STUDENT_CLIENT_CONSOLE_CONFIG;
  587. this.ruleForm.properties.LOGIN_TYPE = this.ruleForm.LOGIN_TYPE = this.ruleForm.loginType.join(
  588. ","
  589. );
  590. this.ruleForm.properties.LOGIN_SUPPORT = this.ruleForm.LOGIN_SUPPORT = this.ruleForm.loginSupport.join(
  591. ","
  592. );
  593. this.ruleForm.properties.STUDENT_CODE_LOGIN_ALIAS = this.ruleForm.STUDENT_CODE_LOGIN_ALIAS;
  594. this.ruleForm.properties.IDENTITY_NUMBER_LOGIN_ALIAS = this.ruleForm.IDENTITY_NUMBER_LOGIN_ALIAS;
  595. if (
  596. this.ruleForm.preventCheatingConfig == null ||
  597. this.ruleForm.preventCheatingConfig.length == 0
  598. ) {
  599. this.ruleForm.properties.PREVENT_CHEATING_CONFIG = this.ruleForm.PREVENT_CHEATING_CONFIG =
  600. "NONE";
  601. } else {
  602. let defaultArr = [];
  603. for (let lt of PREVENT_CHEATING_CONFIG) {
  604. defaultArr.push(lt.code);
  605. }
  606. let validArr = [];
  607. //保存时清理一下历史数据
  608. for (
  609. let i = 0;
  610. i < this.ruleForm.preventCheatingConfig.length;
  611. i++
  612. ) {
  613. let code = this.ruleForm.preventCheatingConfig[i];
  614. if (defaultArr.indexOf(code) > -1) {
  615. validArr.push(code);
  616. }
  617. }
  618. let res = "";
  619. if (validArr.length == 0) {
  620. res = "NONE";
  621. } else {
  622. res = validArr.join(",");
  623. }
  624. this.ruleForm.properties.PREVENT_CHEATING_CONFIG = this.ruleForm.PREVENT_CHEATING_CONFIG = res;
  625. }
  626. if (
  627. this.ruleForm.studentClientVersion == null ||
  628. this.ruleForm.studentClientVersion.length == 0
  629. ) {
  630. this.ruleForm.properties.STUDENT_CLIENT_VERSION = this.ruleForm.STUDENT_CLIENT_VERSION =
  631. "NONE";
  632. } else {
  633. let defaultArr = [];
  634. for (let lt of STUDENT_CLIENT_VERSION) {
  635. defaultArr.push(lt.code);
  636. }
  637. let validArr = [];
  638. //保存时清理一下历史数据
  639. for (
  640. let i = 0;
  641. i < this.ruleForm.studentClientVersion.length;
  642. i++
  643. ) {
  644. let code = this.ruleForm.studentClientVersion[i];
  645. if (defaultArr.indexOf(code) > -1) {
  646. validArr.push(code);
  647. }
  648. }
  649. let res = "";
  650. if (validArr.length == 0) {
  651. res = "NONE";
  652. } else {
  653. res = validArr.join(",");
  654. }
  655. this.ruleForm.properties.STUDENT_CLIENT_VERSION = this.ruleForm.STUDENT_CLIENT_VERSION = res;
  656. }
  657. this.ruleForm.properties.IS_CUSTOM_MENU_LOGO = this.ruleForm.IS_CUSTOM_MENU_LOGO;
  658. if (this.ruleForm.IS_CUSTOM_MENU_LOGO == "true") {
  659. this.ruleForm.properties.CUS_MENU_LOGO_FILE_URL = this.ruleForm.CUS_MENU_LOGO_FILE_URL;
  660. }
  661. Promise.all([
  662. this.$httpWithMsg.put(
  663. CORE_API + "/org/saveOrgProperties",
  664. this.ruleForm
  665. ),
  666. this.$httpWithMsg.post(
  667. CORE_API + "/rolePrivilege/updateRootOrgPrivilegeRelations",
  668. {
  669. rootOrgId: this.ruleForm.orgId,
  670. privilegeGroupId: this.privilegeGroupId,
  671. privilegeIdSet: this.checkedKeys
  672. }
  673. )
  674. ]).then(([resp1, resp2]) => {
  675. console.log("resp1:" + resp1);
  676. console.log("resp1:" + resp2);
  677. this.$notify({
  678. message: "保存成功",
  679. type: "success"
  680. });
  681. this.originalRuleForm = Object.assign({}, this.ruleForm);
  682. this.formDataChanged = false;
  683. this.treeCheckedChanged = false;
  684. this.originalCheckedKeys = this.$refs.tree.getCheckedKeys();
  685. });
  686. } else {
  687. console.log("error submit!!");
  688. return false;
  689. }
  690. });
  691. },
  692. async initForm() {
  693. this.uploadAction = CORE_API + "/org/importLogo/" + this.ruleForm.orgId;
  694. this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE = "1400*900";
  695. this.ruleForm.relatedPropertyGroupIdList = ["studentClientConfig"];
  696. await this.initConfig();
  697. this.initTree();
  698. },
  699. beforeUpload(file) {
  700. if (!this.checkUpload()) {
  701. return false;
  702. }
  703. console.log(file);
  704. },
  705. uploadProgress() {
  706. console.log("uploadProgress");
  707. },
  708. uploadSuccess(response) {
  709. console.log("uploadSuccess");
  710. console.log(response);
  711. if (response && response.length > 0) {
  712. this.$notify({
  713. message: "上传成功",
  714. type: "success"
  715. });
  716. let fileUrl = response;
  717. this.ruleForm.LOGO_FILE_URL = this.ruleForm.properties.LOGO_FILE_URL = fileUrl;
  718. } else {
  719. this.errDialog = true;
  720. }
  721. this.fileLoading = false;
  722. this.logoDialog = false;
  723. // this.removeFile();
  724. },
  725. uploadError(response) {
  726. let json = JSON.parse(response.message);
  727. if (response.status == 500) {
  728. this.$notify({
  729. message: json.desc,
  730. type: "error"
  731. });
  732. }
  733. this.fileLoading = false;
  734. },
  735. //确定上传
  736. submitUpload() {
  737. if (!this.checkUpload()) {
  738. return false;
  739. }
  740. this.$refs.upload.submit();
  741. this.fileLoading = true;
  742. },
  743. checkUpload() {
  744. let fileList = this.$refs.upload.uploadFiles;
  745. if (fileList.length == 0) {
  746. this.$notify({
  747. message: "上传文件不能为空",
  748. type: "error"
  749. });
  750. return false;
  751. }
  752. if (fileList.length > 1) {
  753. this.$notify({
  754. message: "每次只能上传一个文件",
  755. type: "error"
  756. });
  757. return false;
  758. }
  759. for (let file of fileList) {
  760. let fileName = file.name;
  761. if (
  762. // !fileName.endsWith(".jpg") &&
  763. // !fileName.endsWith(".gif") &&
  764. !fileName.endsWith(".png")
  765. ) {
  766. this.$notify({
  767. message: "上传文件格式必须为[png]",
  768. type: "error"
  769. });
  770. this.fileList = [];
  771. return false;
  772. }
  773. }
  774. return true;
  775. },
  776. //清空文件
  777. removeFile() {
  778. this.fileList = [];
  779. this.ruleForm.LOGO_FILE_URL = this.ruleForm.properties.LOGO_FILE_URL = "";
  780. if (this.$refs.upload) {
  781. this.$refs.upload.clearFiles();
  782. }
  783. },
  784. handleRemove(file, fileList) {
  785. console.log(file, fileList);
  786. this.removeFile();
  787. },
  788. handleExceed() {
  789. this.$notify({
  790. message: "当前限制选择 1 个文件,请先清空文件再试",
  791. type: "error"
  792. });
  793. },
  794. equalArrayIgnoreSequence(arr1, arr2) {
  795. // 判断数组的长度
  796. if (arr1.length !== arr2.length) {
  797. return false;
  798. } else {
  799. let a = Object.assign([], arr1);
  800. let b = Object.assign([], arr2);
  801. a.sort();
  802. b.sort();
  803. // 循环遍历数组的值进行比较
  804. for (let i = 0; i < a.length; i++) {
  805. if (a[i] !== b[i]) {
  806. return false;
  807. }
  808. }
  809. return true;
  810. }
  811. },
  812. //初始化配置
  813. async initConfig() {
  814. let url =
  815. CORE_API +
  816. "/org/getOrgPropertiesByGroupWithoutCache/" +
  817. this.ruleForm.orgId +
  818. "/" +
  819. this.propertyGroupId;
  820. await this.$httpWithMsg.get(url).then(response => {
  821. console.log(response);
  822. if (response) {
  823. this.ruleForm.properties = response.data;
  824. // if (this.ruleForm.properties.OE_STUDENT_SYS_NAME) {
  825. this.ruleForm.OE_STUDENT_SYS_NAME =
  826. this.ruleForm.properties.OE_STUDENT_SYS_NAME ||
  827. this.ruleForm.OE_STUDENT_SYS_NAME;
  828. // }
  829. this.ruleForm.LOGO_FILE_URL =
  830. this.ruleForm.properties.LOGO_FILE_URL ||
  831. this.ruleForm.LOGO_FILE_URL;
  832. this.ruleForm.LOGIN_TYPE =
  833. this.ruleForm.properties.LOGIN_TYPE || this.ruleForm.LOGIN_TYPE;
  834. this.ruleForm.LOGIN_SUPPORT =
  835. this.ruleForm.properties.LOGIN_SUPPORT ||
  836. this.ruleForm.LOGIN_SUPPORT;
  837. this.ruleForm.PREVENT_CHEATING_CONFIG =
  838. this.ruleForm.properties.PREVENT_CHEATING_CONFIG ||
  839. this.ruleForm.PREVENT_CHEATING_CONFIG;
  840. this.ruleForm.STUDENT_CLIENT_VERSION =
  841. this.ruleForm.properties.STUDENT_CLIENT_VERSION ||
  842. this.ruleForm.STUDENT_CLIENT_VERSION;
  843. this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE =
  844. this.ruleForm.properties.STUDENT_CLIENT_DEFAULT_SIZE ||
  845. this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE;
  846. this.ruleForm.STUDENT_CLIENT_CONSOLE_CONFIG =
  847. this.ruleForm.properties.STUDENT_CLIENT_CONSOLE_CONFIG ||
  848. this.ruleForm.STUDENT_CLIENT_CONSOLE_CONFIG;
  849. this.ruleForm.STUDENT_CODE_LOGIN_ALIAS =
  850. this.ruleForm.properties.STUDENT_CODE_LOGIN_ALIAS ||
  851. this.ruleForm.STUDENT_CODE_LOGIN_ALIAS;
  852. this.ruleForm.IDENTITY_NUMBER_LOGIN_ALIAS =
  853. this.ruleForm.properties.IDENTITY_NUMBER_LOGIN_ALIAS ||
  854. this.ruleForm.IDENTITY_NUMBER_LOGIN_ALIAS;
  855. if (this.ruleForm.properties.LOGIN_TYPE) {
  856. this.ruleForm.loginType = this.ruleForm.properties.LOGIN_TYPE.split(
  857. ","
  858. );
  859. } else {
  860. let defaultValue = [];
  861. for (let lt of LOGIN_TYPE) {
  862. defaultValue.push(lt.code);
  863. }
  864. this.ruleForm.loginType = defaultValue;
  865. console.log(defaultValue);
  866. }
  867. if (this.ruleForm.properties.LOGIN_SUPPORT) {
  868. this.ruleForm.loginSupport = this.ruleForm.properties.LOGIN_SUPPORT.split(
  869. ","
  870. );
  871. }
  872. if (this.ruleForm.properties.PREVENT_CHEATING_CONFIG) {
  873. if (this.ruleForm.properties.PREVENT_CHEATING_CONFIG != "NONE") {
  874. this.ruleForm.preventCheatingConfig = this.ruleForm.properties.PREVENT_CHEATING_CONFIG.split(
  875. ","
  876. );
  877. } else {
  878. this.ruleForm.preventCheatingConfig = [];
  879. }
  880. } else {
  881. let defaultValue = [];
  882. for (let lt of PREVENT_CHEATING_CONFIG) {
  883. defaultValue.push(lt.code);
  884. }
  885. this.ruleForm.preventCheatingConfig = defaultValue;
  886. console.log(defaultValue);
  887. }
  888. if (this.ruleForm.properties.STUDENT_CLIENT_VERSION) {
  889. if (this.ruleForm.properties.STUDENT_CLIENT_VERSION != "NONE") {
  890. this.ruleForm.studentClientVersion = this.ruleForm.properties.STUDENT_CLIENT_VERSION.split(
  891. ","
  892. );
  893. } else {
  894. this.ruleForm.studentClientVersion = [];
  895. }
  896. } else {
  897. let defaultValue = [];
  898. // for (let lt of STUDENT_CLIENT_VERSION) {
  899. // defaultValue.push(lt.code);
  900. // }
  901. this.ruleForm.studentClientVersion = defaultValue;
  902. console.log(defaultValue);
  903. }
  904. let fileUrl = response.data.LOGO_FILE_URL;
  905. let fname = "";
  906. if (fileUrl) {
  907. let lastIndex = fileUrl.lastIndexOf("/");
  908. let len = fileUrl.length;
  909. fname = fileUrl.substr(lastIndex + 1, len - lastIndex);
  910. this.fileList = [{ name: fname, url: this.ruleForm.LOGO_FILE_URL }];
  911. } else {
  912. this.fileList = [];
  913. }
  914. this.uploadMenuLogoAction =
  915. CORE_API + "/org/importCusMenuLogo/" + this.ruleForm.orgId;
  916. this.ruleForm.IS_CUSTOM_MENU_LOGO =
  917. this.ruleForm.properties.IS_CUSTOM_MENU_LOGO ||
  918. this.ruleForm.IS_CUSTOM_MENU_LOGO;
  919. if (this.ruleForm.IS_CUSTOM_MENU_LOGO == "true") {
  920. this.ruleForm.CUS_MENU_LOGO_FILE_URL =
  921. this.ruleForm.properties.CUS_MENU_LOGO_FILE_URL ||
  922. this.ruleForm.CUS_MENU_LOGO_FILE_URL;
  923. let fileUrl2 = response.data.CUS_MENU_LOGO_FILE_URL;
  924. let fname2 = "";
  925. if (fileUrl2) {
  926. let lastIndex = fileUrl2.lastIndexOf("/");
  927. let len = fileUrl2.length;
  928. fname2 = fileUrl2.substr(lastIndex + 1, len - lastIndex);
  929. this.menuLogoFileList = [
  930. { name: fname2, url: this.ruleForm.CUS_MENU_LOGO_FILE_URL }
  931. ];
  932. } else {
  933. this.menuLogoFileList = [];
  934. }
  935. }
  936. this.originalRuleForm = Object.assign({}, this.ruleForm);
  937. } else {
  938. this.$notify({
  939. message: "学生客户端信息暂未初始化,请立即初始化",
  940. type: "warning"
  941. });
  942. }
  943. });
  944. },
  945. //初始化权限树
  946. async initTree() {
  947. var url =
  948. CORE_API +
  949. "/rolePrivilege/getStudentClientMenuTree/" +
  950. this.ruleForm.orgId +
  951. "?includeDisabledCodes=false";
  952. this.$httpWithMsg.get(url).then(response => {
  953. if (response) {
  954. this.treeData = [];
  955. this.treeData.push(response.data.treeData);
  956. this.privilegeGroupId = response.data.privilegeGroupId;
  957. this.originalCheckedKeys = response.data.ownedPrivilegeIds;
  958. this.checkedKeys = response.data.ownedPrivilegeIds;
  959. this.setCheckedKeys(this.checkedKeys);
  960. } else {
  961. this.$notify({
  962. message: "自定义菜单权限树初始化失败",
  963. type: "warning"
  964. });
  965. }
  966. });
  967. },
  968. setCheckedKeys(keys) {
  969. this.$refs.tree.setCheckedKeys(keys);
  970. },
  971. renderMenuTreeContent(h, { node, data, store }) {
  972. if (node.key == -1) {
  973. return (
  974. <span>
  975. <span>
  976. <span>{node.label}</span>
  977. </span>
  978. </span>
  979. );
  980. }
  981. return (
  982. <span>
  983. <span>
  984. <span>{node.label}</span>
  985. </span>
  986. <span style="float: right; margin-left: 20px; margin-right: 20px">
  987. <el-button
  988. size="mini"
  989. type="text"
  990. on-click={() => this.openCusMenuTreeDialog(store, data, "view")}
  991. >
  992. 查看
  993. </el-button>
  994. <el-button
  995. size="mini"
  996. type="text"
  997. on-click={() => this.openCusMenuTreeDialog(store, data, "edit")}
  998. >
  999. 修改
  1000. </el-button>
  1001. </span>
  1002. </span>
  1003. );
  1004. },
  1005. treeCheckeChange(data, checked, indeterminate) {
  1006. console.log(data, checked, indeterminate);
  1007. this.checkedKeys = this.$refs.tree.getCheckedKeys();
  1008. },
  1009. openCusMenuTreeDialog(store, data, optType) {
  1010. this.store = store;
  1011. this.data = data;
  1012. this.getPrivilege(data.id, optType);
  1013. },
  1014. getPrivilege(id, type) {
  1015. var url = CORE_API + "/rolePrivilege/getPrivilege/" + id;
  1016. this.$httpWithMsg.get(url).then(response => {
  1017. var resp = response.data;
  1018. this.cusMenuTreeDialog.show = true;
  1019. this.cusMenuTreeDialog.optType = type;
  1020. this.cusMenuTreeDialog.privilege.id = resp.id;
  1021. this.cusMenuTreeDialog.privilege.groupId = resp.groupId;
  1022. this.cusMenuTreeDialog.privilege.parentId = resp.parentId;
  1023. this.cusMenuTreeDialog.privilege.name = resp.name;
  1024. this.cusMenuTreeDialog.privilege.code = resp.code;
  1025. this.cusMenuTreeDialog.privilege.description = resp.description;
  1026. this.cusMenuTreeDialog.privilege.weight = resp.weight + "";
  1027. this.cusMenuTreeDialog.privilege.ext1 = resp.ext1;
  1028. this.cusMenuTreeDialog.privilege.ext2 = resp.ext2;
  1029. this.cusMenuTreeDialog.privilege.ext3 = resp.ext3;
  1030. this.cusMenuTreeDialog.privilege.ext4 = resp.ext4;
  1031. this.cusMenuTreeDialog.privilege.ext5 = resp.ext5;
  1032. });
  1033. },
  1034. beforeUploadMenuLogo(file) {
  1035. if (!this.checkUploadMenuLogo()) {
  1036. return false;
  1037. }
  1038. console.log(file);
  1039. },
  1040. uploadMenuLogoProgress() {
  1041. console.log("uploadProgress");
  1042. },
  1043. uploadMenuLogoSuccess(response) {
  1044. console.log("uploadSuccess");
  1045. console.log(response);
  1046. if (response && response.length > 0) {
  1047. this.$notify({
  1048. message: "上传成功",
  1049. type: "success"
  1050. });
  1051. let fileUrl = response;
  1052. this.ruleForm.CUS_MENU_LOGO_FILE_URL = this.ruleForm.properties.CUS_MENU_LOGO_FILE_URL = fileUrl;
  1053. } else {
  1054. this.errDialog = true;
  1055. }
  1056. this.fileLoading = false;
  1057. this.logoDialog = false;
  1058. // this.removeFile();
  1059. },
  1060. uploadMenuLogoError(response) {
  1061. let json = JSON.parse(response.message);
  1062. if (response.status == 500) {
  1063. this.$notify({
  1064. message: json.desc,
  1065. type: "error"
  1066. });
  1067. }
  1068. this.fileLoading = false;
  1069. },
  1070. //确定上传
  1071. submitUploadMenuLogo() {
  1072. if (!this.checkUploadMenuLogo()) {
  1073. return false;
  1074. }
  1075. this.$refs.menuLogUpload.submit();
  1076. this.fileLoading = true;
  1077. },
  1078. checkUploadMenuLogo() {
  1079. let fileList = this.$refs.menuLogUpload.uploadFiles;
  1080. if (fileList.length == 0) {
  1081. this.$notify({
  1082. message: "上传文件不能为空",
  1083. type: "error"
  1084. });
  1085. return false;
  1086. }
  1087. if (fileList.length > 1) {
  1088. this.$notify({
  1089. message: "每次只能上传一个文件",
  1090. type: "error"
  1091. });
  1092. return false;
  1093. }
  1094. for (let file of fileList) {
  1095. let fileName = file.name;
  1096. if (
  1097. // !fileName.endsWith(".jpg") &&
  1098. // !fileName.endsWith(".gif") &&
  1099. !fileName.endsWith(".png")
  1100. ) {
  1101. this.$notify({
  1102. message: "上传文件格式必须为[png]",
  1103. type: "error"
  1104. });
  1105. this.menuLogoFileList = [];
  1106. return false;
  1107. }
  1108. }
  1109. return true;
  1110. },
  1111. //清空文件
  1112. removeMenuLogoFile() {
  1113. this.menuLogoFileList = [];
  1114. this.ruleForm.CUS_MENU_LOGO_FILE_URL = this.ruleForm.properties.CUS_MENU_LOGO_FILE_URL =
  1115. "";
  1116. if (this.$refs.menuLogUpload) {
  1117. this.$refs.menuLogUpload.clearFiles();
  1118. }
  1119. },
  1120. handleMenuLogoRemove(file, fileList) {
  1121. console.log(file, fileList);
  1122. this.removeMenuLogoFile();
  1123. },
  1124. handleMenuLogoExceed() {
  1125. this.$notify({
  1126. message: "当前限制选择 1 个文件,请先清空文件再试",
  1127. type: "error"
  1128. });
  1129. },
  1130. updatePrivilege() {
  1131. this.$refs.updateForm.validate(valid => {
  1132. if (!valid) {
  1133. return;
  1134. }
  1135. var url = CORE_API + "/rolePrivilege/updatePrivilege";
  1136. this.$httpWithMsg
  1137. .put(url, this.cusMenuTreeDialog.privilege)
  1138. .then(() => {
  1139. this.$notify({
  1140. message: "修改成功",
  1141. type: "success"
  1142. });
  1143. this.data.label = this.cusMenuTreeDialog.privilege.name;
  1144. });
  1145. this.cusMenuTreeDialog.show = false;
  1146. });
  1147. },
  1148. csutomMenuLogoChange(val) {
  1149. if (val == "false") {
  1150. this.removeMenuLogoFile();
  1151. }
  1152. }
  1153. },
  1154. created() {
  1155. this.ruleForm.orgId = this.user.rootOrgId;
  1156. this.propertyGroupId = "config4Edit3";
  1157. this.uploadHeaders = {
  1158. key: this.user.key,
  1159. token: this.user.token
  1160. };
  1161. this.uploadMenuLogoHeaders = {
  1162. key: this.user.key,
  1163. token: this.user.token
  1164. };
  1165. if (this.isSuperAdmin) {
  1166. this.$httpWithMsg.get(CORE_API + "/org/getRootOrgList").then(response => {
  1167. this.rootOrgList = response.data;
  1168. });
  1169. }
  1170. this.initForm();
  1171. },
  1172. watch: {
  1173. "ruleForm.orgId": {
  1174. handler: function() {
  1175. this.initForm();
  1176. }
  1177. },
  1178. checkedKeys: {
  1179. handler: function(newVal) {
  1180. this.treeCheckedChanged = !this.equalArrayIgnoreSequence(
  1181. this.originalCheckedKeys,
  1182. newVal
  1183. );
  1184. }
  1185. },
  1186. ruleForm: {
  1187. deep: true,
  1188. handler: function(newForm) {
  1189. if (Object.keys(this.originalRuleForm).length > 0) {
  1190. this.formDataChanged = !(
  1191. newForm.OE_STUDENT_SYS_NAME ==
  1192. this.originalRuleForm.OE_STUDENT_SYS_NAME &&
  1193. newForm.LOGO_FILE_URL == this.originalRuleForm.LOGO_FILE_URL &&
  1194. this.equalArrayIgnoreSequence(
  1195. newForm.loginType,
  1196. this.originalRuleForm.loginType
  1197. ) &&
  1198. this.equalArrayIgnoreSequence(
  1199. newForm.loginSupport,
  1200. this.originalRuleForm.loginSupport
  1201. ) &&
  1202. this.equalArrayIgnoreSequence(
  1203. newForm.preventCheatingConfig,
  1204. this.originalRuleForm.preventCheatingConfig
  1205. ) &&
  1206. this.equalArrayIgnoreSequence(
  1207. newForm.studentClientVersion,
  1208. this.originalRuleForm.studentClientVersion
  1209. ) &&
  1210. newForm.STUDENT_CLIENT_CONSOLE_CONFIG ==
  1211. this.originalRuleForm.STUDENT_CLIENT_CONSOLE_CONFIG &&
  1212. newForm.STUDENT_CODE_LOGIN_ALIAS ==
  1213. this.originalRuleForm.STUDENT_CODE_LOGIN_ALIAS &&
  1214. newForm.IDENTITY_NUMBER_LOGIN_ALIAS ==
  1215. this.originalRuleForm.IDENTITY_NUMBER_LOGIN_ALIAS &&
  1216. newForm.IS_CUSTOM_MENU_LOGO ==
  1217. this.originalRuleForm.IS_CUSTOM_MENU_LOGO &&
  1218. newForm.CUS_MENU_LOGO_FILE_URL ==
  1219. this.originalRuleForm.CUS_MENU_LOGO_FILE_URL
  1220. );
  1221. } else {
  1222. this.formDataChanged = false;
  1223. }
  1224. }
  1225. }
  1226. },
  1227. computed: {
  1228. ...mapState({ user: state => state.user }),
  1229. btnSaveDiabled() {
  1230. console.log(this.formDataChanged);
  1231. return !this.formDataChanged && !this.treeCheckedChanged;
  1232. },
  1233. isSuperAdmin() {
  1234. return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
  1235. }
  1236. }
  1237. };
  1238. </script>
  1239. <style scoped>
  1240. .input-width {
  1241. width: 638px;
  1242. }
  1243. .upload-width {
  1244. width: 638px;
  1245. }
  1246. /* .btn-margin-left {
  1247. margin-left: 20px;
  1248. } */
  1249. </style>