|
|
@@ -40,11 +40,11 @@
|
|
|
<el-icon :size="18" style="margin-top: 7px; margin-left: auto">
|
|
|
<Download />
|
|
|
</el-icon>
|
|
|
- <el-tooltip content="点击下载组织/用户id信息" placement="top" effect="light">
|
|
|
+ <el-tooltip content="点击下载组织/角色id信息" placement="top" effect="light">
|
|
|
<span
|
|
|
style="color: #409efc; margin-top: 6px; margin-right: 12px; cursor: pointer"
|
|
|
@click="handleDownloadInfoForm"
|
|
|
- >组织/用户id信息</span
|
|
|
+ >组织/角色id信息查询</span
|
|
|
>
|
|
|
</el-tooltip>
|
|
|
|
|
|
@@ -203,7 +203,7 @@
|
|
|
// const sucCount = ref<number>(0);
|
|
|
const errorCount = ref<number>(0);
|
|
|
|
|
|
- const props = defineProps<{ modelValue: boolean }>();
|
|
|
+ const props = defineProps<{ modelValue: boolean; colseAddUser: () => unknown }>();
|
|
|
const emits = defineEmits(['update:modelValue', 'change']);
|
|
|
|
|
|
const updateValue = (value) => {
|
|
|
@@ -256,7 +256,7 @@
|
|
|
let downloadLink: HTMLAnchorElement | null = document.createElement('a');
|
|
|
const url = window.URL.createObjectURL(blob);
|
|
|
downloadLink.href = url;
|
|
|
- downloadLink.download = '组织/用户id信息模板.xlsx';
|
|
|
+ downloadLink.download = '组织/角色id信息模板.xlsx';
|
|
|
downloadLink.click();
|
|
|
// 移除下载链接
|
|
|
window.URL.revokeObjectURL(url);
|
|
|
@@ -284,48 +284,59 @@
|
|
|
};
|
|
|
|
|
|
const handleUploadSuccess = (response, _file, _fileList) => {
|
|
|
- // console.log(response);
|
|
|
- // isSuc.value = response.data.isSuc;
|
|
|
- errDetail.value = response.data.errorList;
|
|
|
- successCount.value = response.data.successCount || 0;
|
|
|
- errorCount.value = response.data.errorCount || 0;
|
|
|
-
|
|
|
- try {
|
|
|
- if (errDetail.value.length > 0) {
|
|
|
- errDetail.value.forEach((item, index) => {
|
|
|
- if (item.indexOf('【添加失败】') >= 0) {
|
|
|
- errDetail.value[index] = item.replace(
|
|
|
- '【添加失败】',
|
|
|
- '<span style="color: #ff4d4f">【添加失败】</span>',
|
|
|
- );
|
|
|
- } else if (item.indexOf('【添加成功】') >= 0) {
|
|
|
- errDetail.value[index] = item.replace(
|
|
|
- '【添加成功】',
|
|
|
- '<span style="color: #52c41a">【添加成功】</span>',
|
|
|
- );
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- if (successCount.value != 0 && errorCount.value === 0 && errDetail.value.length === 0) {
|
|
|
- ElMessage({
|
|
|
- message: '添加成功', // 1.全部添加成功 —— failCount === 0
|
|
|
- type: 'success',
|
|
|
- });
|
|
|
- emits('update:modelValue', true);
|
|
|
- emits('change');
|
|
|
- // window.location.reload();
|
|
|
- } else {
|
|
|
- DialogVisible.value = true;
|
|
|
- }
|
|
|
- cardVisible.value = false;
|
|
|
- } catch (error) {
|
|
|
+ console.log(response);
|
|
|
+ if (response.code == 400) {
|
|
|
ElMessage({
|
|
|
- // console.log(res),
|
|
|
- message: response.data.msg,
|
|
|
+ message: response.message,
|
|
|
type: 'error',
|
|
|
});
|
|
|
emits('update:modelValue', false);
|
|
|
+ } else {
|
|
|
+ // isSuc.value = response.data.isSuc;
|
|
|
+ errDetail.value = response.data.errorList;
|
|
|
+ successCount.value = response.data.successCount || 0;
|
|
|
+ errorCount.value = response.data.errorCount || 0;
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (errDetail.value.length > 0) {
|
|
|
+ errDetail.value.forEach((item, index) => {
|
|
|
+ if (item.indexOf('【添加失败】') >= 0) {
|
|
|
+ errDetail.value[index] = item.replace(
|
|
|
+ '【添加失败】',
|
|
|
+ '<span style="color: #ff4d4f">【添加失败】</span>',
|
|
|
+ );
|
|
|
+ } else if (item.indexOf('【添加成功】') >= 0) {
|
|
|
+ errDetail.value[index] = item.replace(
|
|
|
+ '【添加成功】',
|
|
|
+ '<span style="color: #52c41a">【添加成功】</span>',
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (successCount.value != 0 && errorCount.value === 0 && errDetail.value.length === 0) {
|
|
|
+ ElMessage({
|
|
|
+ message: '添加成功', // 1.全部添加成功 —— failCount === 0
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ emits('update:modelValue', true);
|
|
|
+ emits('change');
|
|
|
+ //把上一级的AddUser窗口关掉
|
|
|
+ props.colseAddUser();
|
|
|
+ // window.location.reload();
|
|
|
+ } else {
|
|
|
+ console.log('code500');
|
|
|
+ DialogVisible.value = true;
|
|
|
+ }
|
|
|
+ cardVisible.value = false;
|
|
|
+ } catch (error) {
|
|
|
+ // console.log('code200'),
|
|
|
+ ElMessage({
|
|
|
+ message: response.message,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ emits('update:modelValue', false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// if (isSuc.value) {
|