input.jsp 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. <%@ page language="java" pageEncoding="UTF-8" isELIgnored="false" %>
  2. <%@ taglib uri="/ssTag" prefix="ss"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta http-equiv="pragma" content="no-cache">
  7. <meta http-equiv="cache-control" content="no-cache">
  8. <meta http-equiv="expires" content="0">
  9. <!-- 在 head 标签中修改或添加 meta 标签 -->
  10. <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval' 'unsafe-inline' http://127.0.0.1:* http://localhost:* http://192.168.3.174:*; worker-src 'self' blob: http://192.168.3.174:*; script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: http://192.168.3.174:*; img-src 'self' data: blob:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src 'self' blob: http://192.168.3.174:*; frame-src 'self' blob:;">
  11. <script src="../ss/js/base.js"></script>
  12. <script type="module" src="../ss/js/validation-manager.js"></script>
  13. <script type="module" src="../ss/js/validator-rules.js"></script>
  14. <style type="text/css">
  15. .avatar .el-form-item__content {
  16. position: relative;
  17. }
  18. .upload {
  19. width: 124px;
  20. height: 124px;
  21. border-radius: 6px;
  22. cursor: pointer;
  23. position: absolute;
  24. top: 0;
  25. left: 0;
  26. overflow: hidden;
  27. text-align: center;
  28. line-height: 124px;
  29. font-size: 40px;
  30. color: #c0c4cc;
  31. background-color: rgba(0, 0, 0, 0.5);
  32. opacity: 0;
  33. }
  34. .upload:hover {
  35. color: #fff;
  36. opacity: 1;
  37. }
  38. /* .icon {
  39. width: 116px;
  40. height: 116px;
  41. border-radius: 3px;
  42. float: left;
  43. } */
  44. .icon-border {
  45. background-color: rgba(243, 246, 248, 0.94);
  46. border: 4px solid #fff;
  47. box-shadow: inset 0 1.5px 3px 0 rgba(0, 0, 0, 0.15),
  48. 0 1.5px 3px 0 rgba(0, 0, 0, 0.15);
  49. box-sizing: content-box;
  50. margin: auto;
  51. position: relative;
  52. }
  53. </style>
  54. </head>
  55. <body>
  56. <div id="app">
  57. <form class="form-container" @submit.prevent>
  58. <div class="content-box fit-height-content">
  59. <table class="table-container">
  60. <tr>
  61. <th rowspan="4">相片</th>
  62. <td rowspan="4">
  63. <div class="photo">
  64. <!-- 证件照 -->
  65. <ss-photo-upload
  66. v-model:url="idPhotoUrl"
  67. class="id-photo"
  68. :cropper-options="{
  69. width: 360,
  70. height: 360,
  71. aspectRatio: 1
  72. }"
  73. ></ss-photo-upload>
  74. <!-- 生活照 -->
  75. <ss-photo-upload
  76. v-model:url="lifePhotoUrl"
  77. class="life-photo"
  78. :cropper-options="{
  79. width: 400,
  80. height: 300,
  81. aspectRatio: 4/3
  82. }"
  83. ></ss-photo-upload>
  84. </div>
  85. <!-- <div class="photo">
  86. <div class="left">
  87. <div class="content">
  88. <input
  89. type="file"
  90. accept="image/*"
  91. id="iconFile"
  92. style="display: none"
  93. />
  94. <div class="icon" onclick="$('#iconFile').click();">
  95. <ss-icon name="user" size="140px" />
  96. </div>
  97. <div class="text">证件照</div>
  98. </div>
  99. </div>
  100. <div class="right">
  101. <div class="content">
  102. <div class="icon">
  103. <ss-icon name="photo" type="common" size="70px" />
  104. </div>
  105. <div class="text">生活照</div>
  106. </div>
  107. </div>
  108. </div> -->
  109. </td>
  110. <th>姓名</th>
  111. <td height="60">
  112. <ss-input
  113. v-model="username"
  114. name="username"
  115. placeholder="请输入姓名"
  116. type="text"
  117. ></ss-input>
  118. </td>
  119. </tr>
  120. <tr>
  121. <th>身份证类别</th>
  122. <td height="60">
  123. <ss-objp
  124. v-model="zhengjianType"
  125. name="zhengjianType"
  126. :opt="[{label:'请选择',value:''},{ label: '居民身份证', value: '1' },{ label: '香港特区护照或身份证', value: '6' },{ label: '澳门特区护照或身份证', value: '7' },{ label: '台湾居民来往大陆通行证', value: '8' },{ label: '外国人永久居留证', value: '10' }]"
  127. placeholder="请选择证件类别"
  128. width="300"
  129. load="objPickerLoad"
  130. />
  131. </td>
  132. <script>
  133. zhengjianTypeLoad:{
  134. var url='';
  135. ajax(url);
  136. }
  137. </script>
  138. </tr>
  139. <tr>
  140. <th>证件号</th>
  141. <td height="60">
  142. <ss-input
  143. v-model="idCardNo"
  144. name="idCardNo"
  145. placeholder="请输入证件号"
  146. type="text"
  147. ></ss-input>
  148. </td>
  149. </tr>
  150. <tr>
  151. <th>生日日期</th>
  152. <td height="60">
  153. <ss-date-picker
  154. v-model="date"
  155. name="date"
  156. type="date"
  157. placeholder="请选择生日日期"
  158. width="300px"
  159. @change="dateChange"
  160. ></ss-date-picker>
  161. </td>
  162. </tr>
  163. <tr>
  164. <th>当前时间</th>
  165. <td height="60">
  166. <ss-date-picker
  167. v-model="datetime"
  168. name="datetime"
  169. :type="datetimeType"
  170. placeholder="请选择当前时间"
  171. width="300px"
  172. ></ss-date-picker>
  173. </td>
  174. <th>时间</th>
  175. <td height="60">
  176. <ss-date-picker
  177. v-model="time"
  178. name="time"
  179. type="time"
  180. placeholder="请选择时间"
  181. width="300px"
  182. ></ss-date-picker>
  183. </td>
  184. </tr>
  185. <tr>
  186. <th>英文名</th>
  187. <td height="60">
  188. <ss-input
  189. v-model="enName"
  190. name="enName"
  191. placeholder="请输入英文名"
  192. type="text"
  193. ></ss-input>
  194. </td>
  195. <th>出生地</th>
  196. <td height="60">
  197. <div style="display: flex; width: 100%; height: 100%">
  198. <ss-hidden
  199. v-model="csdqm"
  200. name="csdqm"
  201. rule="226699"
  202. ></ss-hidden>
  203. <ss-cascader
  204. v-model="sheng"
  205. name="csdqm"
  206. placeholder="省"
  207. :opt="groups_sheng"
  208. width="200px"
  209. @change="handleCsdqProvinceChange"
  210. :level="1"
  211. ></ss-cascader>
  212. <ss-cascader
  213. v-model="shi"
  214. name="csdqm"
  215. placeholder="市"
  216. :opt="groups_shi"
  217. width="200px"
  218. @change="handleCsdqCityChange"
  219. :level="2"
  220. ></ss-cascader>
  221. <ss-cascader
  222. v-model="qu"
  223. name="csdqm"
  224. placeholder="区"
  225. :opt="groups_qu"
  226. width="200px"
  227. :level="3"
  228. ></ss-cascader>
  229. </div>
  230. </td>
  231. </tr>
  232. <tr>
  233. <th>户籍所在地</th>
  234. <td height="60">
  235. <div style="display: flex; width: 100%; height: 100%">
  236. <ss-hidden
  237. v-model="hjzsdm"
  238. name="hjzsdm"
  239. rule="226699"
  240. ></ss-hidden>
  241. <ss-cascader
  242. v-model="hjzsdmSheng"
  243. name="hjzsdm"
  244. placeholder="省"
  245. :opt="groups_hjzsdmSheng"
  246. width="200px"
  247. @change="handleHjzsdmProvinceChange"
  248. :level="1"
  249. ></ss-cascader>
  250. <ss-cascader
  251. v-model="hjzsdmShi"
  252. name="hjzsdm"
  253. placeholder="市"
  254. :opt="groups_hjzsdmShi"
  255. width="200px"
  256. @change="handleHjzsdmCityChange"
  257. :level="2"
  258. ></ss-cascader>
  259. <ss-cascader
  260. v-model="hjzsdmQu"
  261. name="hjzsdm"
  262. placeholder="区"
  263. :opt="groups_hjzsdmQu"
  264. width="200px"
  265. :level="3"
  266. ></ss-cascader>
  267. </div>
  268. </td>
  269. </tr>
  270. <tr>
  271. <th>专业</th>
  272. <td>
  273. <ss-cascader
  274. v-model="zyid"
  275. name="zyid"
  276. placeholder="请选择专业"
  277. :opt="groups_zyid"
  278. width="250px"
  279. @change="zyidChange"
  280. :level="1"
  281. mode="2"
  282. ></ss-cascader>
  283. </td>
  284. <th>班级</th>
  285. <td>
  286. <ss-cascader
  287. v-model="bjid"
  288. name="bjid"
  289. placeholder="请选择班级"
  290. :opt="groups_bjid"
  291. width="250px"
  292. :level="2"
  293. mode="2"
  294. ></ss-cascader>
  295. </td>
  296. </tr>
  297. <tr>
  298. <th>班级2</th>
  299. <td>
  300. <ss-cascader
  301. v-model="bjid2"
  302. name="bjid2"
  303. placeholder="请选择班级2"
  304. :opt="groups_bjid2"
  305. width="250px"
  306. :level="2"
  307. mode="2"
  308. ></ss-cascader>
  309. </td>
  310. </tr>
  311. <tr>
  312. <th>婚姻状况</th>
  313. <td height="60">
  314. <!-- <ss-onoffbutton-array
  315. v-model="hyzk"
  316. name="hyzk"
  317. :opt="[{ label: '已婚', value: '1', width: '100px' },{ label: '未婚', value: '2', width: '100px' },]"
  318. multiple
  319. /> -->
  320. <!-- 多选模式 -->
  321. <ss-onoffbutton
  322. v-model="hyzk"
  323. name="hyzk"
  324. label="已婚"
  325. value="1"
  326. ></ss-onoffbutton>
  327. <ss-onoffbutton
  328. v-model="hyzk"
  329. name="hyzk"
  330. label="未婚"
  331. value="2"
  332. ></ss-onoffbutton>
  333. <ss-onoffbutton
  334. v-model="hyzk"
  335. name="hyzk"
  336. label="离异"
  337. value="3"
  338. ></ss-onoffbutton>
  339. </td>
  340. <th>民族(可输入筛选)</th>
  341. <td height="60">
  342. <ss-objp
  343. v-model="mingzu"
  344. name="mingzu"
  345. :opt="groups"
  346. placeholder="民族"
  347. width="150"
  348. :input="true"
  349. />
  350. </td>
  351. </tr>
  352. <tr>
  353. <th>邮箱</th>
  354. <td height="60">
  355. <ss-input
  356. v-model="email"
  357. name="email"
  358. placeholder="请输入邮箱"
  359. type="text"
  360. ></ss-input>
  361. </td>
  362. <th>自定义校验</th>
  363. <td height="60">
  364. <ss-input
  365. v-model="fieldName"
  366. name="fieldName"
  367. placeholder="请输入自定义校验"
  368. type="text"
  369. ></ss-input>
  370. </td>
  371. </tr>
  372. <tr>
  373. <th>
  374. <div style="height: 150px">备注</div>
  375. </th>
  376. <td colspan="3" height="150px">
  377. <div class="input">
  378. <ss-textarea name="remark" v-model="remark" />
  379. </div>
  380. </td>
  381. </tr>
  382. <tr>
  383. <th>
  384. <div style="height: 150px">jodit</div>
  385. </th>
  386. <td colspan="3" height="150px">
  387. <ss-editor
  388. v-model="content"
  389. name="content"
  390. :url="contentUrl"
  391. :height="500"
  392. upload-url="/your-upload-url"
  393. :readonly="false"
  394. placeholder="请输入内容"
  395. @ready="onEditorReady"
  396. @change="onChange"
  397. ></ss-editor>
  398. </td>
  399. </tr>
  400. </table>
  401. </div>
  402. <div>
  403. <ss-validate err-msg="后台返回的错误" text-align="left" />
  404. </div>
  405. <div class="bottom-div">
  406. <ss-bottom-button
  407. text="取消"
  408. @click="onDialogClose"
  409. icon-class="bottom-div-close"
  410. ></ss-bottom-button>
  411. <ss-bottom-button
  412. text="保存"
  413. @click="onSubmit"
  414. icon-class="bottom-div-save"
  415. ></ss-bottom-button>
  416. </div>
  417. </form>
  418. </div>
  419. <script type="module">
  420. const doCascade = async function({
  421. children = [],
  422. url,
  423. vm,
  424. prefix = 'groups_',
  425. loadData = () => {},
  426. value,
  427. mode = 1
  428. }) {
  429. try {
  430. // 清空所有子级的值和选项
  431. children.forEach(child => {
  432. vm[child] = '';
  433. // 使用字符串拼接替代模板字符串
  434. vm[prefix + child] = [];
  435. });
  436. console.log(vm,prefix,children);
  437. if (loadData && value) {
  438. const data = await loadData(value);
  439. if (mode == '2') {
  440. children.forEach(child => {
  441. // 使用字符串拼接替代模板字符串
  442. vm[prefix + child] = data;
  443. });
  444. } else {
  445. if (children.length > 0) {
  446. // 使用字符串拼接替代模板字符串
  447. vm[prefix + children[0]] = data;
  448. }
  449. }
  450. return;
  451. }
  452. if (url) {
  453. const response = await fetch(url);
  454. const data = await response.json();
  455. if (children.length > 0) {
  456. // 使用字符串拼接替代模板字符串
  457. vm[prefix + children[0]] = data;
  458. }
  459. }
  460. } catch (error) {
  461. console.error('级联数据加载失败:', error);
  462. if (children.length > 0) {
  463. // 使用字符串拼接替代模板字符串
  464. vm[prefix + children[0]] = [];
  465. }
  466. }
  467. };
  468. // 模拟 Ajax 请求的工具函数
  469. const mockAjax = {
  470. // 缓存数据,避免重复请求
  471. _cache: null,
  472. // 获取完整数据
  473. async getData() {
  474. if (this._cache) return this._cache;
  475. const response = await fetch("../ss/js/level.json");
  476. this._cache = await response.json();
  477. return this._cache;
  478. },
  479. // 获取所有省份
  480. async getProvinces() {
  481. const data = await this.getData();
  482. return data.map((item) => ({
  483. label: item.name,
  484. value: item.code,
  485. }));
  486. },
  487. // 根据省份代码获取城市
  488. async getCities(provinceCode) {
  489. const data = await this.getData();
  490. const province = data.find((p) => p.code === provinceCode);
  491. if (!province || !province.children) return [];
  492. const cities = province.children
  493. .filter((item) => item.city) // 确保是市级数据
  494. .map((item) => ({
  495. label: item.name,
  496. value: item.code,
  497. }));
  498. return cities
  499. },
  500. // 根据城市代码获取区县
  501. async getDistricts(cityCode) {
  502. const data = await this.getData();
  503. for (const province of data) {
  504. if (!province.children) continue;
  505. const city = province.children.find((c) => c.code === cityCode);
  506. if (city && city.children) {
  507. return city.children.map((item) => ({
  508. label: item.name,
  509. value: item.code,
  510. }));
  511. }
  512. }
  513. return [];
  514. },
  515. // 模拟专业数据
  516. getMajors() {
  517. return new Promise((resolve) => {
  518. setTimeout(() => {
  519. resolve([
  520. { label: '计算机科学与技术', value: '08010000' }, // 补齐8位
  521. { label: '软件工程', value: '08020000' },
  522. { label: '网络工程', value: '08030000' }
  523. ]);
  524. }, 1000);
  525. });
  526. },
  527. // 模拟班级数据
  528. getClasses(majorCode) {
  529. // majorCode 会是 '08010000' 这样的格式
  530. const classData = {
  531. '08010000': [
  532. { label: '计科1班', value: '08010001' },
  533. { label: '计科2班', value: '08010002' }
  534. ],
  535. '08020000': [
  536. { label: '软件1班', value: '08020001' },
  537. { label: '软件2班', value: '08020002' }
  538. ],
  539. '08030000': [
  540. { label: '网络1班', value: '08030001' },
  541. { label: '网络2班', value: '08030002' }
  542. ]
  543. };
  544. return new Promise((resolve) => {
  545. setTimeout(() => {
  546. resolve(classData[majorCode] || []);
  547. }, 1000);
  548. });
  549. }
  550. };
  551. SS.ready(function () {
  552. ssVm.add("ss.commonValidator.notNull", ["username"], {
  553. msgPrfx: "姓名",
  554. });
  555. ssVm.add("ss.commonValidator.notNull", ["enName"], {
  556. msgPrfx: "英文名",
  557. });
  558. ssVm.add("ss.commonValidator.notNull", ["csdqm"], {
  559. msgPrfx: "出生地",
  560. });
  561. ssVm.add("ss.commonValidator.notNull", ["hjzsdm"], {
  562. msgPrfx: "户籍所在地",
  563. });
  564. ssVm.add("ss.commonValidator.idCard", ["idCardNo"], {
  565. msgPrfx: "证件号",
  566. relField: "zhengjianType",
  567. });
  568. ssVm.add("ss.commonValidator.notNull", ["date"], {
  569. msgPrfx: "生日日期",
  570. });
  571. ssVm.add("ss.commonValidator.notNull", ["content"], {
  572. msgPrfx: "内容",
  573. });
  574. ssVm.add("ss.commonValidator.notNull", ["zhengjianType"], {
  575. msgPrfx: "证件类别",
  576. });
  577. ssVm.add("ss.commonValidator.notNull", ["csd"], { msgPrfx: "出生地" });
  578. ssVm.add("ss.commonValidator.notNull", ["mingzu"], { msgPrfx: "民族" });
  579. ssVm.add("ss.commonValidator.notNull", ["hyzk"], {
  580. msgPrfx: "婚姻状况",
  581. });
  582. ssVm.add("ss.commonValidator.notNull", ["remark"], { msgPrfx: "备注" });
  583. // 邮箱格式验证
  584. ssVm.add("ss.commonValidator.email", ["email"], {
  585. msgPrfx: "邮箱",
  586. required: true,
  587. });
  588. ssVm.add("ss.commonValidator.custom", ["fieldName"], {
  589. msgPrfx: "字段名",
  590. validate: (value) => {
  591. // 返回 true/false 或者带消息的对象
  592. if (value.includes("test")) {
  593. return {
  594. valid: false,
  595. message: "不能输入test",
  596. };
  597. }
  598. return true;
  599. },
  600. });
  601. // 继承父页面的eventBus
  602. const eventBus = window.parent.sharedEventBus;
  603. function sonClose() {
  604. // console.log("孙组件关闭了");
  605. }
  606. // 调用组件中的初始化方法
  607. window.SS.dom.initializeFormApp({
  608. el: "#app",
  609. data() {
  610. return {
  611. date: "",
  612. datetime: "",
  613. time:"",
  614. username: "",
  615. enName: "",
  616. idCardNo: "",
  617. zhengjianType: "",
  618. csd: "",
  619. mingzu: "",
  620. zhengzhimianmao: "",
  621. hyzk: "",
  622. email: "",
  623. fieldName: "",
  624. remark: "",
  625. visible: true,
  626. idPhotoUrl: "",
  627. lifePhotoUrl: "",
  628. // lifePhotoUrl: "https://m.gzgs.edu.cn/skin/easy/image/default-personalPhoto.png",
  629. groups: [
  630. {
  631. value: "1",
  632. label: "汉族",
  633. },
  634. {
  635. value: "02",
  636. label: "蒙古族",
  637. },
  638. ],
  639. reslutVisible: false,
  640. csdqm: "",
  641. sheng: "",
  642. shi: "",
  643. qu: "",
  644. groups_sheng: [],
  645. groups_shi: [],
  646. groups_qu: [],
  647. hjzsdm: "440105",
  648. hjzsdmSheng: "",
  649. hjzsdmShi: "",
  650. hjzsdmQu: "",
  651. groups_hjzsdmSheng: [],
  652. groups_hjzsdmShi: [],
  653. groups_hjzsdmQu: [],
  654. zyid: '08010000',
  655. bjid: '08010001',
  656. bjid2: '',
  657. groups_zyid: [],
  658. groups_bjid: [],
  659. groups_bjid2: [] ,
  660. content: '<p>初始内容</p>'
  661. };
  662. },
  663. setup() {},
  664. methods: {
  665. showDialog() {
  666. this.visible = !this.visible;
  667. },
  668. onDialogClose() {
  669. SS.closeDialog();
  670. // eventBus.publish('inputDialog', false);
  671. },
  672. dateChange(value){
  673. console.log(value);
  674. },
  675. onSubmit() {
  676. console.trace("onSubmit called"); // 这会显示调用栈
  677. },
  678. // 加载省份数据
  679. async loadProvinces() {
  680. const provinces = await mockAjax.getProvinces();
  681. this.groups_sheng = provinces;
  682. this.groups_hjzsdmSheng = provinces;
  683. },
  684. // 加载专业数据
  685. async loadMajors() {
  686. this.groups_zyid = await mockAjax.getMajors();;
  687. },
  688. // 出生地区的处理方法
  689. async handleCsdqProvinceChange(value) {
  690. await doCascade({
  691. children: ['shi', 'qu'],
  692. value,
  693. vm: this,
  694. loadData: (value) => mockAjax.getCities(value), // 使用箭头函数
  695. });
  696. },
  697. async handleCsdqCityChange(value) {
  698. await doCascade({
  699. children: ['qu'],
  700. value,
  701. vm: this,
  702. loadData: (value) => mockAjax.getDistricts(value), // 使用箭头函数
  703. });
  704. },
  705. // 户籍住所的处理方法
  706. async handleHjzsdmProvinceChange(value) {
  707. console.log("处罚了",value);
  708. await doCascade({
  709. children: ['hjzsdmShi', 'hjzsdmQu'],
  710. value,
  711. vm: this,
  712. loadData: (value) => mockAjax.getCities(value),
  713. });
  714. console.log(this.groups_hjzsdmShi);
  715. },
  716. async handleHjzsdmCityChange(value) {
  717. await doCascade({
  718. children: ['hjzsdmQu'],
  719. value,
  720. vm: this,
  721. loadData: (value) => mockAjax.getDistricts(value),
  722. });
  723. },
  724. async zyidChange(value) {
  725. // this.bjid = '';
  726. // this.bjid2 = '';
  727. // this.groups_bjid = [];
  728. // this.groups_bjid2 = [];
  729. // this.groups_bjid = await mockAjax.getClasses(value);
  730. // this.groups_bjid2 = await mockAjax.getClasses(value);
  731. await doCascade({
  732. children: ['bjid', 'bjid2'],
  733. value,
  734. vm: this,
  735. loadData: (value) => mockAjax.getClasses(value),
  736. mode:2
  737. });
  738. },
  739. onEditorReady(editor) {
  740. // console.log('编辑器初始化完成', editor);
  741. },
  742. onChange(content) {
  743. console.log('内容变化:', content);
  744. },
  745. },
  746. mounted() {
  747. // 先加载初始数据
  748. this.loadProvinces(); // 确保第一时间加载省份数据
  749. this.loadMajors();
  750. },
  751. isDialogPage: true,
  752. });
  753. // window.SS.cropper.init({
  754. // el: $("#iconFile"),
  755. // photoSize: {
  756. // // 裁剪的图片大小,注意需要和 aspectRatio 保持统一比例
  757. // width: 360,
  758. // height: 360,
  759. // },
  760. // success: function (path) {
  761. // // 成功后的回调方法,path为裁剪后的img路径
  762. // console.log(path)
  763. // },
  764. // });
  765. });
  766. </script>
  767. </body>
  768. </html>