extend.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. <template>
  2. <div class="app-container">
  3. <h3 class="title">编辑管理人员信息</h3>
  4. <div class="info-box">
  5. <el-descriptions >
  6. <el-descriptions-item v-for="v in dataInfo" :label="v.label" :key="v.key">{{ v.value }}</el-descriptions-item>
  7. <el-descriptions-item label="角色">{{ roleName }}</el-descriptions-item>
  8. <el-descriptions-item label="性别">{{ sex }}</el-descriptions-item>
  9. <el-descriptions-item label="状态">{{ status }}</el-descriptions-item>
  10. </el-descriptions>
  11. </div>
  12. <div class="info-box">
  13. <el-form inline :model="formData" :rules="rules" ref="form" label-position="left" label-width="140px">
  14. <el-row>
  15. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  16. <el-form-item label="是否专职" prop="isFullTime">
  17. <el-switch
  18. v-model="formData.isFullTime"
  19. active-value="1"
  20. inactive-value="0"
  21. ></el-switch>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  25. <el-form-item label="是否持证上岗" prop="certificateWork">
  26. <el-switch
  27. v-model="formData.certificateWork"
  28. active-value="1"
  29. inactive-value="0"
  30. ></el-switch>
  31. </el-form-item>
  32. </el-col>
  33. </el-row>
  34. <el-row >
  35. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  36. <el-form-item label="所属部门" prop="deptId">
  37. <el-select style="width: 217px;" v-model="formData.deptId" placeholder="请选择">
  38. <el-option
  39. v-for="dict in dict.type.sys_department_type"
  40. :key="dict.value"
  41. :label="dict.label"
  42. :value="dict.value"
  43. />
  44. </el-select>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  48. <el-form-item label="责任职务" prop="duties">
  49. <el-select style="width: 217px;" v-model="formData.duties" placeholder="请选择">
  50. <el-option
  51. v-for="dict in dict.type.sys_duties"
  52. :key="dict.value"
  53. :label="dict.label"
  54. :value="dict.value"
  55. />
  56. </el-select>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  60. <el-form-item label="最高学历" prop="highestEducation">
  61. <el-select style="width: 217px;" v-model="formData.highestEducation" placeholder="请选择">
  62. <el-option
  63. v-for="dict in dict.type.sys_highest_education"
  64. :key="dict.value"
  65. :label="dict.label"
  66. :value="dict.value"
  67. />
  68. </el-select>
  69. </el-form-item>
  70. </el-col>
  71. </el-row>
  72. <el-row>
  73. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  74. <el-form-item label="用工形式" prop="workType">
  75. <el-select style="width: 217px;" v-model="formData.workType" placeholder="请选择">
  76. <el-option
  77. v-for="dict in dict.type.sys_work_type"
  78. :key="dict.value"
  79. :label="dict.label"
  80. :value="dict.value"
  81. />
  82. </el-select>
  83. </el-form-item>
  84. </el-col>
  85. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  86. <el-form-item label="学历取得方式" prop="educationType">
  87. <el-select style="width: 217px;" v-model="formData.educationType" placeholder="请选择">
  88. <el-option
  89. v-for="dict in dict.type.sys_education_type"
  90. :key="dict.value"
  91. :label="dict.label"
  92. :value="dict.value"
  93. />
  94. </el-select>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  98. <el-form-item label="初级以上相关专业技术职业资格" prop="professionalQualifications">
  99. <el-input style="width: 217px;" v-model="formData.professionalQualifications" placeholder="请输入">
  100. </el-input>
  101. </el-form-item>
  102. </el-col>
  103. </el-row>
  104. <el-row>
  105. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  106. <el-form-item label="持证上岗未通过原因" prop="certificateFailReason">
  107. <el-input style="width: 217px;" v-model="formData.certificateFailReason" placeholder="请输入">
  108. </el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  112. <el-form-item style="width: 517px;" label="参加工作时间" prop="workTime">
  113. <el-date-picker
  114. clearable
  115. v-model="formData.workTime"
  116. type="date"
  117. value-format="yyyy-MM-dd HH:mm:ss"
  118. placeholder="请选择时间">
  119. </el-date-picker>
  120. </el-form-item>
  121. </el-col>
  122. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  123. <el-form-item style="width: 517px;" label="现任职时间" prop="workTime">
  124. <el-date-picker
  125. clearable
  126. v-model="formData.entryTime"
  127. type="date"
  128. value-format="yyyy-MM-dd HH:mm:ss"
  129. placeholder="请选择时间">
  130. </el-date-picker>
  131. </el-form-item>
  132. </el-col>
  133. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  134. <el-form-item style="width: 517px;" label="出生日期" prop="bornTime">
  135. <el-date-picker
  136. clearable
  137. v-model="formData.bornTime"
  138. type="date"
  139. value-format="yyyy-MM-dd HH:mm:ss"
  140. placeholder="请选择时间">
  141. </el-date-picker>
  142. </el-form-item>
  143. </el-col>
  144. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  145. <el-form-item label="分管领导姓名" prop="responsibilitiesLeaderName">
  146. <el-input style="width: 217px;" v-model="formData.responsibilitiesLeaderName" placeholder="请输入">
  147. </el-input>
  148. </el-form-item>
  149. </el-col>
  150. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  151. <el-form-item label="分管领导职务" prop="responsibilitiesLeaderDuties">
  152. <el-select style="width: 217px;" v-model="formData.responsibilitiesLeaderDuties" placeholder="请选择">
  153. <el-option
  154. v-for="dict in dict.type.sys_duties"
  155. :key="dict.value"
  156. :label="dict.label"
  157. :value="dict.value"
  158. />
  159. </el-select>
  160. </el-form-item>
  161. </el-col>
  162. </el-row>
  163. <el-row>
  164. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  165. <el-form-item label="上传相关证书">
  166. <image-upload :limit="5" :value="formData.qualificationCertificateUrl" :fileSize="2" @input="getImgUrl"></image-upload>
  167. </el-form-item>
  168. </el-col>
  169. <el-col :xs="24" :sm="12" :md="8" :lg="6" >
  170. <el-form-item label="示例图">
  171. <div style="width: 280px;">
  172. <el-image :src="uplp"></el-image>
  173. </div>
  174. </el-form-item>
  175. </el-col>
  176. </el-row>
  177. </el-form>
  178. </div>
  179. <div style="margin-top: 50px; margin-left: 42%">
  180. <el-button type="primary" @click="saveExtend" size="small">提交</el-button>
  181. <el-button type="primary" @click="nosaveExtend" size="small">取消</el-button>
  182. </div>
  183. </div>
  184. </template>
  185. <script>
  186. import uploadpng from "@/assets/images/upload.png";
  187. import uplpng from "@/assets/images/upl.png";
  188. import {getUser} from "@/api/system/user";
  189. import TreeSelect from '@riophae/vue-treeselect'
  190. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  191. import { deptTreeList } from "@/api/system/public";
  192. import {extendUserInformation} from "@/api/system/information";
  193. export default {
  194. props: [],
  195. components: {TreeSelect},
  196. dicts:['sys_highest_education',"sys_work_type","sys_duties","sys_education_type",'sys_department_type'],
  197. data() {
  198. return {
  199. //基础信息key
  200. infoKeys:[
  201. {label:'用户名称',key:'username'},
  202. {label:'用户昵称',key:'name'},
  203. {label:'工号',key:'jobNumber'},
  204. // {label:'部门',key:'orgName'},
  205. {label:'手机',key:'phone'},
  206. // {label:'性别',key:'gender'},
  207. // {label:'状态',key:'isLock'},
  208. {label:'机构',key:'orgName'},
  209. ],
  210. dataInfo:[],
  211. formData:{
  212. deptId: null,
  213. duties: null,
  214. workType: null,
  215. isFullTime: "1",
  216. highestEducation: null,
  217. educationType: null,
  218. certificateWork: "1",
  219. professionalQualifications: null,
  220. certificateFailReason: null,
  221. workTime: null,
  222. entryTime: null,
  223. bornTime: null,
  224. responsibilitiesLeaderName: null,
  225. responsibilitiesLeaderDuties: null,
  226. qualificationCertificateUrl: null,
  227. userId: null,
  228. },
  229. rules: {
  230. deptId: [
  231. { required: true,message: '请选择所属部门', trigger: 'blur' },
  232. ],
  233. duties:[
  234. { required: true,message: '请选择职务', trigger: 'blur' },
  235. ],
  236. workType:[
  237. { required: true, message: '请选择用工形式',trigger: 'blur' },
  238. ],
  239. isFullTime:[
  240. { required: true,message: '请选择是否专职', trigger: 'blur' },
  241. ],
  242. highestEducation:[
  243. { required: true,message: '请选择最高学历', trigger: 'blur' },
  244. ],
  245. educationType:[
  246. { required: true,message: '请选择学历取得形式', trigger: 'blur' },
  247. ],
  248. certificateWork:[
  249. { required: true,message: '请选择是否持证上岗', trigger: 'blur' },
  250. ],
  251. workTime:[
  252. { required: true,message: '请选择参加工作时间',trigger: 'blur' },
  253. ],
  254. entryTime: [
  255. { required: true,message: '请选择入职时间', trigger: 'change' }
  256. ],
  257. bornTime: [
  258. { required: true,message: '请选择出生时间', trigger: 'change' }
  259. ],
  260. responsibilitiesLeaderName: [
  261. { required: true,message: '请输入分管领导名字', trigger: 'change' }
  262. ],
  263. responsibilitiesLeaderDuties: [
  264. { required: true,message: '请选择分管领导职务', trigger: 'change' }
  265. ],
  266. qualificationCertificateUrl: [
  267. { required: true,message: '请选择上传资格证', trigger: 'change' }
  268. ],
  269. professionalQualifications:[
  270. { required: true,message: '请输入初级以上相关专业技术职业资格', trigger: 'change' }
  271. ],
  272. date1: [
  273. { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
  274. ],
  275. date2: [
  276. { type: 'date', required: true, message: '请选择时间', trigger: 'change' }
  277. ],
  278. type: [
  279. { type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }
  280. ],
  281. resource: [
  282. { required: true, message: '请选择活动资源', trigger: 'change' }
  283. ],
  284. desc: [
  285. { required: true, message: '请填写活动形式', trigger: 'blur' }
  286. ]
  287. },
  288. // 机构树选项
  289. deptList: undefined,
  290. // 遮罩层
  291. orgloading: true,
  292. // 选中数组
  293. orgids: [],
  294. // 选中数组
  295. Bankids: [],
  296. // 非单个禁用
  297. single: true,
  298. // 非多个禁用
  299. multiple: true,
  300. // 显示搜索条件
  301. showSearch: true,
  302. // 总条数
  303. total: 0,
  304. // 机构物防建设表格数据
  305. constructionList: [],
  306. // 银行物防建设表格数据
  307. BankPhysicalDefenseConstructionList: [],
  308. // 弹出层标题
  309. orgtitle: "",
  310. // 弹出层标题
  311. Banktitle: "",
  312. // 是否显示弹出层
  313. Bankopen: false,
  314. // 表单参数
  315. Bankform: {},
  316. // 是否显示弹出层
  317. orgopen: false,
  318. roleName: null,
  319. sex: null,
  320. status: null,
  321. // 表单参数
  322. orgform: {},
  323. //2个图片信息
  324. uploadp: uploadpng,
  325. uplp: uplpng,
  326. //下拉框生成信息
  327. orgTypes: {
  328. orgTyp1: { label: "营业网点", value: 0 },
  329. orgTyp2: { label: "监控中心", value: 1 },
  330. },
  331. businessLibraryTypes: {
  332. businessLibraryTyp1: { label: "1类业务库", value: 1 },
  333. businessLibraryTyp2: { label: "2类业务库", value: 2 },
  334. businessLibraryTyp3: { label: "3类业务库", value: 3 },
  335. },
  336. platformBrands: {
  337. platformBrand1: { label: "品牌1", value: 0 },
  338. platformBrand2: { label: "品牌2", value: 1 },
  339. },
  340. platformSupplierBrands: {
  341. platformSupplierBrand1: { label: "品牌1", value: 0 },
  342. platformSupplierBrand2: { label: "品牌2", value: 1 },
  343. },
  344. prop: "",
  345. propItem: "",
  346. row: "",
  347. imgs:[]
  348. };
  349. },
  350. computed: {
  351. switchModel: {
  352. get() {
  353. return this.switchValue === 1; // 将0转换为false,1转换为true
  354. },
  355. set(value) {
  356. this.switchValue = value ? 1 : 0; // 将false转换为0,true转换为1
  357. },
  358. },
  359. },
  360. created() {
  361. this.getInfo();
  362. this.getDeptTreeList();
  363. },
  364. mounted() {},
  365. methods: {
  366. getImgUrl(img){
  367. this.imgs.push(img);
  368. console.log(this.imgs,'imgs')
  369. },
  370. handleChange(value) {},
  371. //自定义数据
  372. tenantIdnormalizer(node, instanceId) {
  373. if (node.children && !node.children.length) {
  374. delete node.children
  375. }
  376. return {
  377. id: node.deptId,
  378. label: node.deptName,
  379. children: node.children
  380. }
  381. },
  382. getInfo() {
  383. getUser(this.$route.params.userId).then((data) => {
  384. console.log(data,'userdata');
  385. if (!data.data ) return;
  386. let res = data.data;
  387. this.dataInfo = this.infoKeys.map((v,i)=> {
  388. v.value = res[v.key];
  389. return v
  390. })
  391. this.roleName=data.roleName;
  392. this.sex=data.sex;
  393. this.status=data.status;
  394. this.formData=data.information;
  395. console.log(this.formData, 'formData')
  396. });
  397. },
  398. saveExtend(){
  399. this.formData.userId = this.$route.params.userId;
  400. this.formData.qualificationCertificateUrl = this.imgs.toString(',');
  401. this.$refs['form'].validate((valid) => {
  402. if (valid) {
  403. extendUserInformation(this.formData).then(res=>{
  404. this.$message.success('保存成功!')
  405. this.$router.go(-1)
  406. })
  407. }
  408. });
  409. },
  410. getExtendInfo() {
  411. getExtendByOrgId(this.$route.params.id).then((data) => {
  412. console.log(data.data);
  413. if (data.data != null) {
  414. this.orgType = data.data.orgType;
  415. this.weatherAreaCode = data.data.weatherAreaCode;
  416. this.premisesArea = data.data.premisesArea;
  417. this.ownership = data.data.ownership;
  418. this.outsideArea = data.data.outsideArea;
  419. this.askari = data.data.askari;
  420. this.remoteControl = data.data.remoteControl;
  421. this.selfServiceBank = data.data.selfServiceBank;
  422. this.lobbyEquipment = data.data.lobbyEquipment;
  423. this.wallPenetratingEquipment = data.data.wallPenetratingEquipment;
  424. this.extendId = data.data.id;
  425. }
  426. });
  427. },
  428. /** 查询机构下拉树结构 */
  429. getDeptTreeList() {
  430. deptTreeList().then(response => {
  431. this.deptList = response.data;
  432. this.defaultKeys = response.data[0];
  433. });
  434. },
  435. getOrgPhysicalDefenseConstructionInfo() {
  436. this.orgloading = true;
  437. let dat = { orgId: this.$route.params.id };
  438. listOrgPhysicalDefenseConstruction(dat).then((data) => {
  439. this.constructionList = data.rows;
  440. this.orgloading = false;
  441. });
  442. },
  443. getBankPhysicalDefenseConstructionInfo() {
  444. this.bankloading = true;
  445. let dat = { orgId: this.$route.params.id };
  446. listBankPhysicalDefenseConstruction(dat).then((data) => {
  447. this.BankPhysicalDefenseConstructionList = data.rows;
  448. this.bankloading = false;
  449. });
  450. },
  451. // 取消按钮
  452. Bankcancel() {
  453. this.Bankopen = false;
  454. this.Bankreset();
  455. },
  456. // 表单重置
  457. Bankreset() {
  458. this.Bankform = {
  459. id: null,
  460. standard: null,
  461. dateOfCompliance: null,
  462. certificateEvidence: null,
  463. certificate: null,
  464. evidence: null,
  465. createTime: null,
  466. updateTime: null,
  467. createBy: null,
  468. updateBy: null,
  469. orgId: null,
  470. };
  471. this.resetForm("Bankform");
  472. },
  473. // 多选框选中数据
  474. handleBankSelectionChange(selection) {
  475. this.Bankids = selection.map((item) => item.id);
  476. this.single = selection.length !== 1;
  477. this.multiple = !selection.length;
  478. },
  479. /** 新增按钮操作 */
  480. handleBankAdd() {
  481. this.Bankreset();
  482. this.Bankopen = true;
  483. this.Banktitle = "添加银行物防建设";
  484. },
  485. /** 修改按钮操作 */
  486. handleBankUpdate(row) {
  487. this.Bankreset();
  488. const id = row.id || this.Bankids;
  489. getBankPhysicalDefenseConstruction(id).then((response) => {
  490. this.Bankform = response.data;
  491. this.Bankopen = true;
  492. this.Banktitle = "修改银行物防建设";
  493. });
  494. },
  495. /** 提交按钮 */
  496. submitBankForm() {
  497. this.Bankform.orgId = this.$route.params.id;
  498. this.$refs["Bankform"].validate((valid) => {
  499. if (valid) {
  500. if (this.Bankform.id != null) {
  501. updateBankPhysicalDefenseConstruction(this.Bankform).then(
  502. (response) => {
  503. this.$modal.msgSuccess("修改成功");
  504. this.Bankopen = false;
  505. this.getBankPhysicalDefenseConstructionInfo();
  506. }
  507. );
  508. } else {
  509. addBankPhysicalDefenseConstruction(this.Bankform).then(
  510. (response) => {
  511. this.$modal.msgSuccess("新增成功");
  512. this.Bankopen = false;
  513. this.getBankPhysicalDefenseConstructionInfo();
  514. }
  515. );
  516. }
  517. }
  518. });
  519. },
  520. /** 删除按钮操作 */
  521. handleBankDelete(row) {
  522. const Bankids = row.id || this.Bankids;
  523. this.$modal
  524. .confirm('是否确认删除银行物防建设编号为"' + Bankids + '"的数据项?')
  525. .then(function () {
  526. return delBankPhysicalDefenseConstruction(Bankids);
  527. })
  528. .then(() => {
  529. this.getBankPhysicalDefenseConstructionInfo();
  530. this.$modal.msgSuccess("删除成功");
  531. })
  532. .catch(() => {});
  533. },
  534. // 表单重置
  535. orgreset() {
  536. this.orgform = {
  537. id: null,
  538. standard: null,
  539. dateOfCompliance: null,
  540. certificateEvidence: null,
  541. certificate: null,
  542. evidence: null,
  543. createTime: null,
  544. updateTime: null,
  545. createBy: null,
  546. updateBy: null,
  547. orgId: null,
  548. };
  549. this.resetForm("orgform");
  550. },
  551. // 取消按钮
  552. orgcancel() {
  553. this.orgopen = false;
  554. this.orgreset();
  555. },
  556. // 多选框选中数据
  557. handleOrgSelectionChange(selection) {
  558. this.orgids = selection.map((item) => item.id);
  559. this.single = selection.length !== 1;
  560. this.multiple = !selection.length;
  561. },
  562. /** 新增按钮操作 */
  563. handleOrgAdd() {
  564. this.orgreset();
  565. this.orgopen = true;
  566. this.orgtitle = "添加机构物防建设";
  567. },
  568. /** 修改按钮操作 */
  569. handleOrgUpdate(row) {
  570. this.orgreset();
  571. const id = row.id || this.orgids;
  572. getOrgPhysicalDefenseConstruction(id).then((response) => {
  573. this.orgform = response.data;
  574. this.orgopen = true;
  575. this.orgtitle = "修改机构物防建设";
  576. });
  577. },
  578. /** 提交按钮 */
  579. submitOrgForm() {
  580. this.orgform.orgId = this.$route.params.id;
  581. this.$refs["orgform"].validate((valid) => {
  582. if (valid) {
  583. if (this.orgform.id != null) {
  584. updateOrgPhysicalDefenseConstruction(this.orgform).then(
  585. (response) => {
  586. this.$modal.msgSuccess("修改成功");
  587. this.orgopen = false;
  588. this.getOrgPhysicalDefenseConstructionInfo();
  589. }
  590. );
  591. } else {
  592. addOrgPhysicalDefenseConstruction(this.orgform).then((response) => {
  593. this.$modal.msgSuccess("新增成功");
  594. this.orgopen = false;
  595. this.getOrgPhysicalDefenseConstructionInfo();
  596. });
  597. }
  598. }
  599. });
  600. },
  601. /** 删除按钮操作 */
  602. handleOrgDelete(row) {
  603. const orgids = row.id || this.orgids;
  604. this.$modal
  605. .confirm('是否确认删除机构物防建设编号为"' + orgids + '"的数据项?')
  606. .then(function () {
  607. return delOrgPhysicalDefenseConstruction(orgids);
  608. })
  609. .then(() => {
  610. this.getOrgPhysicalDefenseConstructionInfo();
  611. this.$modal.msgSuccess("删除成功");
  612. })
  613. .catch(() => {});
  614. },
  615. nosaveExtend() {
  616. this.$router.go(-1);
  617. },
  618. triggerFileInput() {
  619. this.$refs.fileInput.click();
  620. },
  621. async handleFileChange(event) {
  622. const file = event.target.files[0];
  623. if (!file) return;
  624. // 创建 FormData 对象并添加文件
  625. const formData = new FormData();
  626. formData.append('file', file);
  627. // // 发送文件到您的文件上传 API
  628. try {
  629. uploadFile(formData).then((res) => {
  630. console.log(res);
  631. // this.orgform.certificateEvidence = res.data;
  632. });
  633. // 处理上传成功的逻辑
  634. console.log('上传成功');
  635. } catch (error) {
  636. // 处理上传失败的逻辑
  637. console.log('上传失败');
  638. }
  639. // try {
  640. // const response = await request.post('http://localhost:9527/dev-api/file/file/upload', formData, {
  641. // headers: {
  642. // 'Content-Type': 'multipart/form-data',
  643. // },
  644. // });
  645. // // 处理上传成功的逻辑
  646. // console.log('上传成功', response);
  647. // } catch (error) {
  648. // // 处理上传失败的逻辑
  649. // console.log('上传失败', error);
  650. // }
  651. // 重置 input 元素,以便下次选择相同文件时仍能触发 change 事件
  652. event.target.value = '';
  653. },
  654. },
  655. fillter: {},
  656. };
  657. </script>
  658. <style scoped lang="scss">
  659. .title{
  660. font-size: 18px;
  661. text-align: left;
  662. background: #008CD6bd;
  663. color:#fff;
  664. height: 36px;
  665. line-height: 36px;
  666. padding-left: 8px;
  667. margin: 0;
  668. }
  669. .info-box{
  670. margin: 30px;
  671. }
  672. .demo-form-inline {
  673. }
  674. .dialog-footer {
  675. }
  676. .container {
  677. }
  678. .image-container {
  679. display: inline-block;
  680. width: 200px;
  681. margin-right: 20px; /* 设置与下一个div的水平间距 */
  682. }
  683. .zoom-image {
  684. transition: transform 0.3s ease;
  685. }
  686. .zoom-image:hover {
  687. transform: scale(1.02);
  688. }
  689. .border-color-change {
  690. border: 1px solid #ccc;
  691. transition: border-color 0.3s ease;
  692. }
  693. .border-color-change:hover {
  694. border-color: #1ea8e9; /* 您可以将此颜色更改为所需的颜色 */
  695. }
  696. </style>