Commit 2faa230e authored by tianhongyang's avatar tianhongyang

fix bug

parent 784433ae
...@@ -572,15 +572,19 @@ export async function elementMessageSingleton(type = "success", messgage = "") { ...@@ -572,15 +572,19 @@ export async function elementMessageSingleton(type = "success", messgage = "") {
* @returns * @returns
*/ */
export function hasDuplicates(arr, mapKey = null) { export function hasDuplicates(arr, mapKey = null) {
const map = new Map(); try {
for (const item of arr) { const map = new Map();
const key = mapKey ? item[mapKey] : JSON.stringify(item); for (const item of arr) {
if (map.has(key)) { const key = mapKey ? item[mapKey] : JSON.stringify(item);
return { hasRepeat: true, repeatKey: key }; if (map.has(key)) {
return { hasRepeat: true, repeatKey: key };
}
map.set(key, true);
} }
map.set(key, true); return { hasRepeat: false };
} catch (error) {
console.log(error);
} }
return { hasRepeat: false, repeatKey: key };
} }
// 甲方详情左侧菜单映射 // 甲方详情左侧菜单映射
......
...@@ -379,11 +379,10 @@ export default { ...@@ -379,11 +379,10 @@ export default {
submitForm: function () { submitForm: function () {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
const text = this.form.id ? "正在修改企业数据,请耐心等待" : "正在添加企业数据,请耐心等待";
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: '数据处理中...', text,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
}); });
this.form.startTime = this.form.dateRange[0]; this.form.startTime = this.form.dateRange[0];
this.form.expireTime = this.form.dateRange[1]; this.form.expireTime = this.form.dateRange[1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment