ExportSetting.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="manage-root personnel-create">
  3. <Header />
  4. <div class="manage-root-contain">
  5. <nav-menu class="manage-root-contain-left" :activeMenuIndex="activeMenuIndex"></nav-menu>
  6. <div class="manage-root-contain-right">
  7. <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
  8. <div class="create-bottom">
  9. <h3>导入配置</h3>
  10. <el-form :model="registerForm" ref="registerForm" label-width="100px" class="registerForm" label-position="top">
  11. <el-form-item label="人员导入模板" prop="resource">
  12. <upload :datafileList="registerForm.resource" :changeFillId="handleAvatarSuccess" :fileName="'courseResource'" :filleNumber="1" :uploadType="'xls'" />
  13. </el-form-item>
  14. <el-form-item>
  15. <el-button type="primary" @click="onSubmit('registerForm')" size="small" :loading="loading">保存</el-button>
  16. <el-button @click="onCancel('registerForm')" size="small">取消</el-button>
  17. </el-form-item>
  18. </el-form>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  26. //例如:import 《组件名称》from ‘《组件路径》';
  27. import Header from "../../components/Header.vue";
  28. import NavMenu from "../../components/NavMenu.vue"
  29. import Breadcrumb from '../../components/Breadcrumb.vue';
  30. import Upload from "../../components/Upload.vue"
  31. import { getLogin } from "@/api/ajax";
  32. export default {
  33. //import引入的组件需要注入到对象中才能使用
  34. components: { Header, NavMenu, Breadcrumb, Upload },
  35. props: {},
  36. data() {
  37. //这里存放数据
  38. return {
  39. activeMenuIndex: "export_setting",
  40. breadcrumbList:[
  41. {
  42. icon:'setting',
  43. url:'',
  44. text:''
  45. },
  46. {
  47. icon:'',
  48. url:'',
  49. notLink: true,
  50. text:'系统配置'
  51. },
  52. {
  53. icon:'',
  54. url:'',
  55. text:'导入配置'
  56. }
  57. ],
  58. registerForm:{
  59. resource:[],
  60. file_id: '',
  61. file_url: ''
  62. },
  63. loading: false
  64. }
  65. },
  66. //计算属性 类似于data概念
  67. computed: {
  68. },
  69. //监控data中数据变化
  70. watch: {
  71. },
  72. //方法集合
  73. methods: {
  74. // 去掉前后空格
  75. handleTrim(form,fild){
  76. this[form][fild] = this[form][fild].trim()
  77. },
  78. changeIcon(flag){
  79. this[flag] = !this[flag]
  80. },
  81. // 提交表单
  82. onSubmit(formName){
  83. this.$refs[formName].validate((valid) => {
  84. if (valid) {
  85. this.loading = true
  86. let MethodName = "/OrgServer/Manager/SysUserManager/UpdateSysUser_BaseInfo";
  87. let data = {
  88. email: this.registerForm.email,
  89. smtp: this.registerForm.smtp,
  90. emailName: this.registerForm.emailName,
  91. newPwd: this.registerForm.newPwd
  92. }
  93. getLogin(MethodName, data)
  94. .then((res) => {
  95. this.loading = false
  96. if(res.status===1){
  97. this.$message.success("保存成功")
  98. }
  99. }).catch((res) =>{
  100. this.loading = false
  101. })
  102. } else {
  103. return false;
  104. }
  105. });
  106. },
  107. // 取消 恢复到修改前状态
  108. onCancel(formName){
  109. this.$refs[formName].resetFields();
  110. },
  111. handleAvatarSuccess(fileList,name) {
  112. this.registerForm.resource = fileList
  113. this.registerForm.file_id = fileList[0]&&fileList[0].response&&fileList[0].response.file_info_list&&fileList[0].response.file_info_list[0]?fileList[0].response.file_info_list[0].file_id:''
  114. this.registerForm.file_url = fileList[0]&&fileList[0].response&&fileList[0].response.file_info_list&&fileList[0].response.file_info_list[0]?fileList[0].response.file_info_list[0].file_url:''
  115. },
  116. },
  117. //生命周期 - 创建完成(可以访问当前this实例)
  118. created() {
  119. },
  120. //生命周期 - 挂载完成(可以访问DOM元素)
  121. mounted() {
  122. },
  123. //生命周期-创建之前
  124. beforeCreated() { },
  125. //生命周期-挂载之前
  126. beforeMount() { },
  127. //生命周期-更新之前
  128. beforUpdate() { },
  129. //生命周期-更新之后
  130. updated() { },
  131. //生命周期-销毁之前
  132. beforeDestory() { },
  133. //生命周期-销毁完成
  134. destoryed() { },
  135. //如果页面有keep-alive缓存功能,这个函数会触发
  136. activated() { }
  137. }
  138. </script>
  139. <style lang="scss" scoped>
  140. /* @import url(); 引入css类 */
  141. .create-bottom{
  142. padding: 40px 40px;
  143. margin-top: 16px;
  144. background: #FFFFFF;
  145. border-radius: 4px;
  146. height: calc(100vh - 140px);
  147. overflow: auto;
  148. h3{
  149. font-size: 20px;
  150. font-weight: 500;
  151. line-height: 28px;
  152. margin: 0 0 28px 0;
  153. color: #1D2129;
  154. }
  155. }
  156. </style>
  157. <style lang="scss">
  158. </style>