Commit c844c7ef19c7378514065fc7f23b8f425f823239
1 parent
b267b2c3
v3.6.0 FileUpload组件支持多文件上传
Showing
11 changed files
with
80 additions
and
84 deletions
yudao-module-tool/yudao-module-tool-impl/src/main/resources/codegen/vue/views/index.vue.vm
| @@ -74,7 +74,7 @@ | @@ -74,7 +74,7 @@ | ||
| 74 | #elseif("" != $column.dictType)## 数据字典 | 74 | #elseif("" != $column.dictType)## 数据字典 |
| 75 | <el-table-column label="${comment}" align="center" prop="${javaField}"> | 75 | <el-table-column label="${comment}" align="center" prop="${javaField}"> |
| 76 | <template slot-scope="scope"> | 76 | <template slot-scope="scope"> |
| 77 | - <span>{{ getDictDataLabel(DICT_TYPE.$dictType.toUpperCase(), scope.row.${column.javaField}) }}</span> | 77 | + <dict-type :type="DICT_TYPE.$dictType.toUpperCase()" :value="scope.row.${column.javaField}" /> |
| 78 | </template> | 78 | </template> |
| 79 | </el-table-column> | 79 | </el-table-column> |
| 80 | #else | 80 | #else |
yudao-ui-admin/src/api/bpm/processInstance.js
| @@ -33,3 +33,18 @@ export function getProcessInstance(id) { | @@ -33,3 +33,18 @@ export function getProcessInstance(id) { | ||
| 33 | method: 'get', | 33 | method: 'get', |
| 34 | }) | 34 | }) |
| 35 | } | 35 | } |
| 36 | + | ||
| 37 | +export class createProcessInstanceExt { | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +export class exportProcessInstanceExtExcel { | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +export class getProcessInstanceExtPage { | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +export class deleteProcessInstanceExt { | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +export class deleteProcessInstanceExt { | ||
| 50 | +} |
yudao-ui-admin/src/components/FileUpload/index.vue
| @@ -4,9 +4,7 @@ | @@ -4,9 +4,7 @@ | ||
| 4 | :action="uploadFileUrl" | 4 | :action="uploadFileUrl" |
| 5 | :before-upload="handleBeforeUpload" | 5 | :before-upload="handleBeforeUpload" |
| 6 | :file-list="fileList" | 6 | :file-list="fileList" |
| 7 | - :limit="1" | ||
| 8 | :on-error="handleUploadError" | 7 | :on-error="handleUploadError" |
| 9 | - :on-exceed="handleExceed" | ||
| 10 | :on-success="handleUploadSuccess" | 8 | :on-success="handleUploadSuccess" |
| 11 | :show-file-list="false" | 9 | :show-file-list="false" |
| 12 | :headers="headers" | 10 | :headers="headers" |
| @@ -26,8 +24,8 @@ | @@ -26,8 +24,8 @@ | ||
| 26 | 24 | ||
| 27 | <!-- 文件列表 --> | 25 | <!-- 文件列表 --> |
| 28 | <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> | 26 | <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul"> |
| 29 | - <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in list"> | ||
| 30 | - <el-link :href="file.url" :underline="false" target="_blank"> | 27 | + <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList"> |
| 28 | + <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank"> | ||
| 31 | <span class="el-icon-document"> {{ getFileName(file.name) }} </span> | 29 | <span class="el-icon-document"> {{ getFileName(file.name) }} </span> |
| 32 | </el-link> | 30 | </el-link> |
| 33 | <div class="ele-upload-list__item-content-action"> | 31 | <div class="ele-upload-list__item-content-action"> |
| @@ -42,6 +40,7 @@ | @@ -42,6 +40,7 @@ | ||
| 42 | import { getToken } from "@/utils/auth"; | 40 | import { getToken } from "@/utils/auth"; |
| 43 | 41 | ||
| 44 | export default { | 42 | export default { |
| 43 | + name: "FileUpload", | ||
| 45 | props: { | 44 | props: { |
| 46 | // 值 | 45 | // 值 |
| 47 | value: [String, Object, Array], | 46 | value: [String, Object, Array], |
| @@ -63,6 +62,7 @@ export default { | @@ -63,6 +62,7 @@ export default { | ||
| 63 | }, | 62 | }, |
| 64 | data() { | 63 | data() { |
| 65 | return { | 64 | return { |
| 65 | + baseUrl: process.env.VUE_APP_BASE_API, | ||
| 66 | uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 | 66 | uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 |
| 67 | headers: { | 67 | headers: { |
| 68 | Authorization: "Bearer " + getToken(), | 68 | Authorization: "Bearer " + getToken(), |
| @@ -70,30 +70,35 @@ export default { | @@ -70,30 +70,35 @@ export default { | ||
| 70 | fileList: [], | 70 | fileList: [], |
| 71 | }; | 71 | }; |
| 72 | }, | 72 | }, |
| 73 | + watch: { | ||
| 74 | + value: { | ||
| 75 | + handler(val) { | ||
| 76 | + if (val) { | ||
| 77 | + let temp = 1; | ||
| 78 | + // 首先将值转为数组 | ||
| 79 | + const list = Array.isArray(val) ? val : this.value.split(','); | ||
| 80 | + // 然后将数组转为对象数组 | ||
| 81 | + this.fileList = list.map(item => { | ||
| 82 | + if (typeof item === "string") { | ||
| 83 | + item = { name: item, url: item }; | ||
| 84 | + } | ||
| 85 | + item.uid = item.uid || new Date().getTime() + temp++; | ||
| 86 | + return item; | ||
| 87 | + }); | ||
| 88 | + } else { | ||
| 89 | + this.fileList = []; | ||
| 90 | + return []; | ||
| 91 | + } | ||
| 92 | + }, | ||
| 93 | + deep: true, | ||
| 94 | + immediate: true | ||
| 95 | + } | ||
| 96 | + }, | ||
| 73 | computed: { | 97 | computed: { |
| 74 | // 是否显示提示 | 98 | // 是否显示提示 |
| 75 | showTip() { | 99 | showTip() { |
| 76 | return this.isShowTip && (this.fileType || this.fileSize); | 100 | return this.isShowTip && (this.fileType || this.fileSize); |
| 77 | }, | 101 | }, |
| 78 | - // 列表 | ||
| 79 | - list() { | ||
| 80 | - let temp = 1; | ||
| 81 | - if (this.value) { | ||
| 82 | - // 首先将值转为数组 | ||
| 83 | - const list = Array.isArray(this.value) ? this.value : [this.value]; | ||
| 84 | - // 然后将数组转为对象数组 | ||
| 85 | - return list.map((item) => { | ||
| 86 | - if (typeof item === "string") { | ||
| 87 | - item = { name: item, url: item }; | ||
| 88 | - } | ||
| 89 | - item.uid = item.uid || new Date().getTime() + temp++; | ||
| 90 | - return item; | ||
| 91 | - }); | ||
| 92 | - } else { | ||
| 93 | - this.fileList = []; | ||
| 94 | - return []; | ||
| 95 | - } | ||
| 96 | - }, | ||
| 97 | }, | 102 | }, |
| 98 | methods: { | 103 | methods: { |
| 99 | // 上传前校检格式和大小 | 104 | // 上传前校检格式和大小 |
| @@ -124,10 +129,6 @@ export default { | @@ -124,10 +129,6 @@ export default { | ||
| 124 | } | 129 | } |
| 125 | return true; | 130 | return true; |
| 126 | }, | 131 | }, |
| 127 | - // 文件个数超出 | ||
| 128 | - handleExceed() { | ||
| 129 | - this.$message.error(`只允许上传单个文件`); | ||
| 130 | - }, | ||
| 131 | // 上传失败 | 132 | // 上传失败 |
| 132 | handleUploadError(err) { | 133 | handleUploadError(err) { |
| 133 | this.$message.error("上传失败, 请重试"); | 134 | this.$message.error("上传失败, 请重试"); |
| @@ -135,12 +136,13 @@ export default { | @@ -135,12 +136,13 @@ export default { | ||
| 135 | // 上传成功回调 | 136 | // 上传成功回调 |
| 136 | handleUploadSuccess(res, file) { | 137 | handleUploadSuccess(res, file) { |
| 137 | this.$message.success("上传成功"); | 138 | this.$message.success("上传成功"); |
| 138 | - this.$emit("input", res.url); | 139 | + this.fileList.push({ name: res.fileName, url: res.fileName }); |
| 140 | + this.$emit("input", this.listToString(this.fileList)); | ||
| 139 | }, | 141 | }, |
| 140 | // 删除文件 | 142 | // 删除文件 |
| 141 | handleDelete(index) { | 143 | handleDelete(index) { |
| 142 | this.fileList.splice(index, 1); | 144 | this.fileList.splice(index, 1); |
| 143 | - this.$emit("input", ''); | 145 | + this.$emit("input", this.listToString(this.fileList)); |
| 144 | }, | 146 | }, |
| 145 | // 获取文件名称 | 147 | // 获取文件名称 |
| 146 | getFileName(name) { | 148 | getFileName(name) { |
| @@ -149,11 +151,16 @@ export default { | @@ -149,11 +151,16 @@ export default { | ||
| 149 | } else { | 151 | } else { |
| 150 | return ""; | 152 | return ""; |
| 151 | } | 153 | } |
| 154 | + }, | ||
| 155 | + // 对象转成分隔字符串 | ||
| 156 | + listToString(list) { | ||
| 157 | + let files = ""; | ||
| 158 | + for (let key in list) { | ||
| 159 | + files += list[key].url + ","; | ||
| 160 | + } | ||
| 161 | + return files.substr(0, files.length - 1); | ||
| 152 | } | 162 | } |
| 153 | - }, | ||
| 154 | - created() { | ||
| 155 | - this.fileList = this.list; | ||
| 156 | - }, | 163 | + } |
| 157 | }; | 164 | }; |
| 158 | </script> | 165 | </script> |
| 159 | 166 | ||
| @@ -176,4 +183,4 @@ export default { | @@ -176,4 +183,4 @@ export default { | ||
| 176 | .ele-upload-list__item-content-action .el-link { | 183 | .ele-upload-list__item-content-action .el-link { |
| 177 | margin-right: 10px; | 184 | margin-right: 10px; |
| 178 | } | 185 | } |
| 179 | -</style> | ||
| 180 | \ No newline at end of file | 186 | \ No newline at end of file |
| 187 | +</style> |
yudao-ui-admin/src/views/bpm/definition/index.vue
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | </el-table-column> | 12 | </el-table-column> |
| 13 | <el-table-column label="定义分类" align="center" prop="category" width="100"> | 13 | <el-table-column label="定义分类" align="center" prop="category" width="100"> |
| 14 | <template slot-scope="scope"> | 14 | <template slot-scope="scope"> |
| 15 | - <span>{{ getDictDataLabel(DICT_TYPE.BPM_MODEL_CATEGORY, scope.row.category) }}</span> | 15 | + <dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category" /> |
| 16 | </template> | 16 | </template> |
| 17 | </el-table-column> | 17 | </el-table-column> |
| 18 | <el-table-column label="表单信息" align="center" prop="formType" width="200"> | 18 | <el-table-column label="表单信息" align="center" prop="formType" width="200"> |
yudao-ui-admin/src/views/bpm/model/index.vue
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 47 | </el-table-column> | 47 | </el-table-column> |
| 48 | <el-table-column label="流程分类" align="center" prop="category" width="100"> | 48 | <el-table-column label="流程分类" align="center" prop="category" width="100"> |
| 49 | <template slot-scope="scope"> | 49 | <template slot-scope="scope"> |
| 50 | - <span>{{ getDictDataLabel(DICT_TYPE.BPM_MODEL_CATEGORY, scope.row.category) }}</span> | 50 | + <dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category" /> |
| 51 | </template> | 51 | </template> |
| 52 | </el-table-column> | 52 | </el-table-column> |
| 53 | <el-table-column label="表单信息" align="center" prop="formType" width="200"> | 53 | <el-table-column label="表单信息" align="center" prop="formType" width="200"> |
| @@ -291,7 +291,7 @@ export default { | @@ -291,7 +291,7 @@ export default { | ||
| 291 | // 设置上传的请求头部 | 291 | // 设置上传的请求头部 |
| 292 | headers: getBaseHeader(), | 292 | headers: getBaseHeader(), |
| 293 | // 上传的地址 | 293 | // 上传的地址 |
| 294 | - url: process.env.VUE_APP_BASE_API + '/api/' + "/bpm/model/import", | 294 | + url: process.env.VUE_APP_BASE_API + '/admin-api/' + "/bpm/model/import", |
| 295 | // 表单 | 295 | // 表单 |
| 296 | form: {}, | 296 | form: {}, |
| 297 | // 校验规则 | 297 | // 校验规则 |
yudao-ui-admin/src/views/bpm/oa/leave/index.vue
| @@ -84,7 +84,7 @@ | @@ -84,7 +84,7 @@ | ||
| 84 | 84 | ||
| 85 | <script> | 85 | <script> |
| 86 | import { getLeavePage } from "@/api/bpm/leave" | 86 | import { getLeavePage } from "@/api/bpm/leave" |
| 87 | -import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict' | 87 | +import { getDictDatas, DICT_TYPE } from '@/utils/dict' |
| 88 | import {cancelProcessInstance} from "@/api/bpm/processInstance"; | 88 | import {cancelProcessInstance} from "@/api/bpm/processInstance"; |
| 89 | 89 | ||
| 90 | export default { | 90 | export default { |
| @@ -171,13 +171,7 @@ export default { | @@ -171,13 +171,7 @@ export default { | ||
| 171 | this.getList(); | 171 | this.getList(); |
| 172 | this.msgSuccess("取消成功"); | 172 | this.msgSuccess("取消成功"); |
| 173 | }) | 173 | }) |
| 174 | - }, | ||
| 175 | - resultFormat(row, column) { | ||
| 176 | - return getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, row.result) | ||
| 177 | - }, | ||
| 178 | - typeFormat(row, column) { | ||
| 179 | - return getDictDataLabel(DICT_TYPE.BPM_OA_LEAVE_TYPE, row.type) | ||
| 180 | - }, | 174 | + } |
| 181 | } | 175 | } |
| 182 | }; | 176 | }; |
| 183 | </script> | 177 | </script> |
yudao-ui-admin/src/views/bpm/processInstance/create.vue
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | </el-table-column> | 12 | </el-table-column> |
| 13 | <el-table-column label="流程分类" align="center" prop="category" width="100"> | 13 | <el-table-column label="流程分类" align="center" prop="category" width="100"> |
| 14 | <template slot-scope="scope"> | 14 | <template slot-scope="scope"> |
| 15 | - <span>{{ getDictDataLabel(DICT_TYPE.BPM_MODEL_CATEGORY, scope.row.category) }}</span> | 15 | + <dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category" /> |
| 16 | </template> | 16 | </template> |
| 17 | </el-table-column> | 17 | </el-table-column> |
| 18 | <el-table-column label="流程版本" align="center" prop="processDefinition.version" width="80"> | 18 | <el-table-column label="流程版本" align="center" prop="processDefinition.version" width="80"> |
yudao-ui-admin/src/views/bpm/processInstance/index.vue
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | <el-table-column label="流程名" align="center" prop="name" /> | 52 | <el-table-column label="流程名" align="center" prop="name" /> |
| 53 | <el-table-column label="流程分类" align="center" prop="category"> | 53 | <el-table-column label="流程分类" align="center" prop="category"> |
| 54 | <template slot-scope="scope"> | 54 | <template slot-scope="scope"> |
| 55 | - <span>{{ getDictDataLabel(DICT_TYPE.BPM_MODEL_CATEGORY, scope.row.category) }}</span> | 55 | + <dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category" /> |
| 56 | </template> | 56 | </template> |
| 57 | </el-table-column> | 57 | </el-table-column> |
| 58 | <el-table-column label="当前审批任务" align="center" prop="tasks"> | 58 | <el-table-column label="当前审批任务" align="center" prop="tasks"> |
| @@ -64,14 +64,7 @@ | @@ -64,14 +64,7 @@ | ||
| 64 | </el-table-column> | 64 | </el-table-column> |
| 65 | <el-table-column label="状态" align="center" prop="status"> | 65 | <el-table-column label="状态" align="center" prop="status"> |
| 66 | <template slot-scope="scope"> | 66 | <template slot-scope="scope"> |
| 67 | - <span> | ||
| 68 | - <el-tag type="primary" v-if="scope.row.status === 1"> <!-- 进行中 --> | ||
| 69 | - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, scope.row.status) }} | ||
| 70 | - </el-tag> | ||
| 71 | - <el-tag type="success" v-if="scope.row.status === 2"> <!-- 已结束 --> | ||
| 72 | - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, scope.row.status) }} | ||
| 73 | - </el-tag> | ||
| 74 | - </span> | 67 | + <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" /> |
| 75 | </template> | 68 | </template> |
| 76 | </el-table-column> | 69 | </el-table-column> |
| 77 | <el-table-column label="结果" align="center" prop="result"> | 70 | <el-table-column label="结果" align="center" prop="result"> |
| @@ -106,16 +99,7 @@ | @@ -106,16 +99,7 @@ | ||
| 106 | </template> | 99 | </template> |
| 107 | 100 | ||
| 108 | <script> | 101 | <script> |
| 109 | -import { | ||
| 110 | - getMyProcessInstancePage, | ||
| 111 | - createProcessInstanceExt, | ||
| 112 | - updateProcessInstanceExt, | ||
| 113 | - deleteProcessInstanceExt, | ||
| 114 | - getProcessInstanceExt, | ||
| 115 | - getProcessInstanceExtPage, | ||
| 116 | - exportProcessInstanceExtExcel, cancelProcessInstance | ||
| 117 | -} from "@/api/bpm/processInstance"; | ||
| 118 | -import {deleteErrorCode} from "@/api/system/errorCode"; | 102 | +import { getMyProcessInstancePage, cancelProcessInstance } from "@/api/bpm/processInstance"; |
| 119 | 103 | ||
| 120 | export default { | 104 | export default { |
| 121 | name: "ProcessInstance", | 105 | name: "ProcessInstance", |
yudao-ui-admin/src/views/bpm/taskAssignRule/taskAssignRuleDialog.vue
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | <el-table-column label="任务标识" align="center" prop="taskDefinitionKey" width="120" show-tooltip-when-overflow /> | 7 | <el-table-column label="任务标识" align="center" prop="taskDefinitionKey" width="120" show-tooltip-when-overflow /> |
| 8 | <el-table-column label="规则类型" align="center" prop="type" width="120"> | 8 | <el-table-column label="规则类型" align="center" prop="type" width="120"> |
| 9 | <template slot-scope="scope"> | 9 | <template slot-scope="scope"> |
| 10 | - <span>{{ getDictDataLabel(DICT_TYPE.BPM_TASK_ASSIGN_RULE_TYPE, scope.row.type) }}</span> | 10 | + <dict-tag :type="DICT_TYPE.BPM_TASK_ASSIGN_RULE_TYPE" :value="scope.row.type" /> |
| 11 | </template> | 11 | </template> |
| 12 | </el-table-column> | 12 | </el-table-column> |
| 13 | <el-table-column label="规则范围" align="center" prop="options" width="440px"> | 13 | <el-table-column label="规则范围" align="center" prop="options" width="440px"> |
yudao-ui-admin/src/views/infra/apiErrorLog/index.vue
| @@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
| 63 | <el-table-column label="异常名" align="center" prop="exceptionName" width="250" /> | 63 | <el-table-column label="异常名" align="center" prop="exceptionName" width="250" /> |
| 64 | <el-table-column label="处理状态" align="center" prop="processStatus"> | 64 | <el-table-column label="处理状态" align="center" prop="processStatus"> |
| 65 | <template slot-scope="scope"> | 65 | <template slot-scope="scope"> |
| 66 | - <span>{{ getDictDataLabel(DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS, scope.row.processStatus) }}</span> | 66 | + <dict-tag :type="DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS" :value="scope.row.processStatus" /> |
| 67 | </template> | 67 | </template> |
| 68 | </el-table-column> | 68 | </el-table-column> |
| 69 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | 69 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| @@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
| 93 | <el-form-item label="链路追踪:">{{ form.traceId }}</el-form-item> | 93 | <el-form-item label="链路追踪:">{{ form.traceId }}</el-form-item> |
| 94 | <el-form-item label="应用名:">{{ form.applicationName }}</el-form-item> | 94 | <el-form-item label="应用名:">{{ form.applicationName }}</el-form-item> |
| 95 | <el-form-item label="用户信息:"> | 95 | <el-form-item label="用户信息:"> |
| 96 | - {{ form.userId }} | {{ getDictDataLabel(DICT_TYPE.USER_TYPE, form.userType) }} | {{ form.userIp }} | {{ form.userAgent}} | 96 | + {{ form.userId }} <dict-tag :type="DICT_TYPE.USER_TYPE" :value="form.userType" /> | {{ form.userIp }} | {{ form.userAgent}} |
| 97 | </el-form-item> | 97 | </el-form-item> |
| 98 | <el-form-item label="请求信息:">{{ form.requestMethod }} | {{ form.requestUrl }} </el-form-item> | 98 | <el-form-item label="请求信息:">{{ form.requestMethod }} | {{ form.requestUrl }} </el-form-item> |
| 99 | <el-form-item label="请求参数:">{{ form.requestParams }}</el-form-item> | 99 | <el-form-item label="请求参数:">{{ form.requestParams }}</el-form-item> |
| @@ -103,7 +103,7 @@ | @@ -103,7 +103,7 @@ | ||
| 103 | <el-input type="textarea" :readonly="true" :autosize="{ maxRows: 20}" v-model="form.exceptionStackTrace"></el-input> | 103 | <el-input type="textarea" :readonly="true" :autosize="{ maxRows: 20}" v-model="form.exceptionStackTrace"></el-input> |
| 104 | </el-form-item> | 104 | </el-form-item> |
| 105 | <el-form-item label="处理状态"> | 105 | <el-form-item label="处理状态"> |
| 106 | - {{ getDictDataLabel(DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS, form.processStatus) }} | 106 | + <dict-tag :type="DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS" :value="form.processStatus" /> |
| 107 | </el-form-item> | 107 | </el-form-item> |
| 108 | <el-form-item label="处理人">{{ form.processUserId }}</el-form-item> | 108 | <el-form-item label="处理人">{{ form.processUserId }}</el-form-item> |
| 109 | <el-form-item label="处理时间">{{ parseTime(form.processTime) }}</el-form-item> | 109 | <el-form-item label="处理时间">{{ parseTime(form.processTime) }}</el-form-item> |
yudao-ui-admin/src/views/system/user/index.vue
| @@ -172,18 +172,9 @@ | @@ -172,18 +172,9 @@ | ||
| 172 | 172 | ||
| 173 | <!-- 用户导入对话框 --> | 173 | <!-- 用户导入对话框 --> |
| 174 | <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> | 174 | <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> |
| 175 | - <el-upload | ||
| 176 | - ref="upload" | ||
| 177 | - :limit="1" | ||
| 178 | - accept=".xlsx, .xls" | ||
| 179 | - :headers="upload.headers" | ||
| 180 | - :action="upload.url + '?updateSupport=' + upload.updateSupport" | ||
| 181 | - :disabled="upload.isUploading" | ||
| 182 | - :on-progress="handleFileUploadProgress" | ||
| 183 | - :on-success="handleFileSuccess" | ||
| 184 | - :auto-upload="false" | ||
| 185 | - drag | ||
| 186 | - > | 175 | + <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" |
| 176 | + :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" | ||
| 177 | + :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag> | ||
| 187 | <i class="el-icon-upload"></i> | 178 | <i class="el-icon-upload"></i> |
| 188 | <div class="el-upload__text"> | 179 | <div class="el-upload__text"> |
| 189 | 将文件拖到此处,或 | 180 | 将文件拖到此处,或 |
| @@ -253,6 +244,7 @@ import {CommonStatusEnum} from "@/utils/constants"; | @@ -253,6 +244,7 @@ import {CommonStatusEnum} from "@/utils/constants"; | ||
| 253 | import {DICT_TYPE, getDictDatas} from "@/utils/dict"; | 244 | import {DICT_TYPE, getDictDatas} from "@/utils/dict"; |
| 254 | import {assignUserRole, listUserRoles} from "@/api/system/permission"; | 245 | import {assignUserRole, listUserRoles} from "@/api/system/permission"; |
| 255 | import {listSimpleRoles} from "@/api/system/role"; | 246 | import {listSimpleRoles} from "@/api/system/role"; |
| 247 | +import {getBaseHeader} from "@/utils/request"; | ||
| 256 | 248 | ||
| 257 | export default { | 249 | export default { |
| 258 | name: "User", | 250 | name: "User", |
| @@ -306,9 +298,9 @@ export default { | @@ -306,9 +298,9 @@ export default { | ||
| 306 | // 是否更新已经存在的用户数据 | 298 | // 是否更新已经存在的用户数据 |
| 307 | updateSupport: 0, | 299 | updateSupport: 0, |
| 308 | // 设置上传的请求头部 | 300 | // 设置上传的请求头部 |
| 309 | - headers: { Authorization: "Bearer " + getToken() }, | 301 | + headers: getBaseHeader(), |
| 310 | // 上传的地址 | 302 | // 上传的地址 |
| 311 | - url: process.env.VUE_APP_BASE_API + '/api/' + "/system/user/import" | 303 | + url: process.env.VUE_APP_BASE_API + '/admin-api/' + "/system/user/import" |
| 312 | }, | 304 | }, |
| 313 | // 查询参数 | 305 | // 查询参数 |
| 314 | queryParams: { | 306 | queryParams: { |
| @@ -626,6 +618,10 @@ export default { | @@ -626,6 +618,10 @@ export default { | ||
| 626 | }, | 618 | }, |
| 627 | // 文件上传成功处理 | 619 | // 文件上传成功处理 |
| 628 | handleFileSuccess(response, file, fileList) { | 620 | handleFileSuccess(response, file, fileList) { |
| 621 | + if (response.code !== 0) { | ||
| 622 | + this.msgError(response.msg) | ||
| 623 | + return; | ||
| 624 | + } | ||
| 629 | this.upload.open = false; | 625 | this.upload.open = false; |
| 630 | this.upload.isUploading = false; | 626 | this.upload.isUploading = false; |
| 631 | this.$refs.upload.clearFiles(); | 627 | this.$refs.upload.clearFiles(); |