zhanbo.xu

优化掉弹出关闭刷新的逻辑

......@@ -8,7 +8,7 @@
:close-on-click-modal="false"
:destroy-on-close="true"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<el-form
......@@ -66,7 +66,7 @@
@click="submit"
>确 定</el-button
>
<el-button class="entrySaveButton" @click="close">关 闭</el-button>
<el-button class="entrySaveButton" @click="close(false)">关 闭</el-button>
</div>
</el-dialog>
</template>
......@@ -143,7 +143,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -155,13 +155,13 @@ export default {
});
},
close() {
close(flag) {
this.formData = {
operatorCode: "",
domesticTrafNo: "",
};
this.loadings.dialogLoading = false;
this.$emit("close");
this.$emit("close", flag);
},
},
};
......
......@@ -467,9 +467,11 @@ export default {
this.outerVisible = true;
},
dialogClose() {
dialogClose(flag = false) {
this.outerVisible = false;
this.search(1);
if (flag) {
this.search(0);
}
},
//分页
currentChange(val) {
......
......@@ -7,7 +7,7 @@
width="40%"
:close-on-click-modal="false"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<el-form
......@@ -82,7 +82,7 @@
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
@click="close(false)"
>关 闭</el-button
>
</div>
......@@ -212,7 +212,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -229,7 +229,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -240,13 +240,13 @@ export default {
this.loadings.dialogLoading = false;
});
},
close() {
close(flag) {
this.formData = {
availableUserCount: "",
cipherMachineNumber: "",
ipAddress: "",
};
this.$emit("close");
this.$emit("close", flag);
},
},
};
......
......@@ -236,10 +236,12 @@ export default {
this.outerVisible = true;
this.activeData = val;
},
dialogClose() {
dialogClose(flag = false) {
this.outerVisible = false;
this.activeData = null;
this.search(1);
if (flag) {
this.search(0);
}
},
//分页
currentChange(val) {
......@@ -261,11 +263,11 @@ export default {
}
},
clear() {
this.sreachFormData={
this.sreachFormData = {
cipherMachineNumber: "",
creationTime: [],
};
}
},
},
};
</script>
......
......@@ -7,7 +7,7 @@
width="40%"
:close-on-click-modal="false"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div
class="modelItem"
......@@ -389,7 +389,7 @@
<div
class="fileList"
v-if="
portConfig.TAO.certificateBase64 != '' ||
portConfig.TAO.certificateBase64 &&
portConfig.TAO.certificateName
"
>
......@@ -546,7 +546,7 @@
</el-select>
</Formitem>
</el-col>
<el-col :span="16" style="padding-right: 5px">
<el-col :span="16" style="padding-right: 5px" :key="refreshKey">
<div class="uploadItem">
<div class="uploadbox">
<el-button
......@@ -571,7 +571,7 @@
<div
class="fileList"
v-if="
portConfig.CAN.publicKeyBase64 != '' ||
portConfig.CAN.publicKeyBase64 &&
portConfig.CAN.publicKeyName
"
>
......@@ -590,7 +590,7 @@
<div class="uploadbox-option">
<el-popconfirm
:title="$t('entry.upload.delTip')"
@confirm="delQingdaoTypeDFile"
@confirm="delGzTypeDFile"
>
<el-button slot="reference" type="text"
>{{ $t("entry.upload.del") }}
......@@ -609,7 +609,8 @@
type="text"
v-loading="loadings.gzRivateKeyLoading"
@click="gzRivateKeyUploadFile"
>上传私钥
>
上传私钥
</el-button>
<el-upload
class="upload-demo"
......@@ -626,7 +627,7 @@
<div
class="fileList"
v-if="
portConfig.CAN.privateKeyBase64 != '' ||
portConfig.CAN.privateKeyBase64 &&
portConfig.CAN.privateKeyName
"
>
......@@ -798,7 +799,7 @@
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
@click="close(false)"
>关 闭
</el-button>
</div>
......@@ -873,6 +874,7 @@ export default {
methodOfSignature: "", // 加签方式
},
},
refreshKey: Date.now(),
choosePortCode: [],
formData: {
config: {},
......@@ -1031,6 +1033,10 @@ export default {
// }
},
methods: {
extractBase64(dataUrl) {
const base64Match = dataUrl.match(/;base64,(.+)$/);
return base64Match ? base64Match[1] : dataUrl;
},
fetchInfo(ojb) {
getCustomerDetails({
id: ojb.id,
......@@ -1119,7 +1125,9 @@ export default {
reader.onload = (e) => {
console.log(e);
this.portConfig.TAO.certificateName = file.name;
this.portConfig.TAO.certificateBase64 = e.target.result;
this.portConfig.TAO.certificateBase64 = this.extractBase64(
e.target.result
);
// let obj = {
// file: e.target.result,
// name: file.name,
......@@ -1134,7 +1142,9 @@ export default {
reader.onload = (e) => {
console.log(e);
this.portConfig.CAN.publicKeyName = file.name;
this.portConfig.CAN.publicKeyBase64 = e.target.result;
this.portConfig.CAN.publicKeyBase64 = this.extractBase64(
e.target.result
);
};
},
gzRivateKeyFileUpload({ file }) {
......@@ -1142,9 +1152,11 @@ export default {
reader.readAsDataURL(file);
console.log(file);
reader.onload = (e) => {
console.log(e);
console.log("====>", e);
this.portConfig.CAN.privateKeyName = file.name;
this.portConfig.CAN.privateKeyBase64 = e.target.result;
this.portConfig.CAN.privateKeyBase64 = this.extractBase64(
e.target.result
);
};
},
......@@ -1158,10 +1170,20 @@ export default {
delGzTypeDFile() {
this.portConfig.CAN.publicKeyName = null;
this.portConfig.CAN.publicKeyBase64 = null;
this.gzFileList = [];
this.$nextTick(() => {
this.refreshKey = Date.now();
});
},
gzRivateKeyTypeDFile() {
console.log("删除----------上传私钥");
this.portConfig.CAN.privateKeyName = null;
this.portConfig.CAN.privateKeyBase64 = null;
this.gzRivateKeyFileList = [];
this.refreshKey = Date.now();
this.$nextTick(() => {
this.refreshKey = Date.now();
});
},
//删除证书
delCertificate() {
......@@ -1269,7 +1291,7 @@ export default {
);
}
this.msgSuccess("客户添加成功!");
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -1285,7 +1307,7 @@ export default {
.then((uploadRes) => {
if (uploadRes.code === "200") {
// this.msgSuccess("客户添加和证书上传成功!");
this.close();
this.close(true);
} else {
this.alertWarningMsg(uploadRes.message);
}
......@@ -1302,7 +1324,7 @@ export default {
.then((uploadRes) => {
if (uploadRes.code === "200") {
// this.msgSuccess("客户添加和证书上传成功!");
this.close();
this.close(true);
} else {
this.alertWarningMsg(uploadRes.message);
}
......@@ -1318,8 +1340,6 @@ export default {
updateCustomerData(val)
.then((res) => {
if (res.code === "200") {
// this.msgSuccess(res.message);
// this.close();
if (this.formData.file) {
this.uploadCertificate(
val.ecomEntCode,
......@@ -1339,7 +1359,7 @@ export default {
);
}
this.msgSuccess("客户修改成功!");
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -1364,7 +1384,7 @@ export default {
// }
//
// },
close() {
close(flag = false) {
this.formData = {
id: null,
certificare: "",
......@@ -1387,7 +1407,7 @@ export default {
this.choosePortCode = [];
this.clearPortConfig(this.portConfig);
// this.handleRemove();
this.$emit("close");
this.$emit("close", flag);
},
clearPortConfig(obj) {
for (let key in obj) {
......
......@@ -386,10 +386,12 @@ export default {
this.outerVisible = true;
this.activeData = data;
},
dialogClose() {
dialogClose(flag = false) {
this.outerVisible = false;
this.activeData = null;
this.search(1);
if (flag) {
this.search(0);
}
},
//分页
currentChange(val) {
......
......@@ -7,7 +7,7 @@
width="40%"
:close-on-click-modal="false"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<el-form
......@@ -158,7 +158,7 @@
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
@click="close(false)"
>关 闭</el-button
>
</div>
......@@ -338,7 +338,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -355,7 +355,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -366,7 +366,7 @@ export default {
this.loadings.dialogLoading = false;
});
},
close() {
close(flag = false) {
this.formData = {
declarationPortCode: "",
declarationUnit10: "",
......@@ -377,7 +377,7 @@ export default {
portCode: "",
exportPortCode: "",
};
this.$emit("close");
this.$emit("close", flag);
},
},
};
......
......@@ -128,7 +128,7 @@
</template>
<script>
import { getPortConfigList,getPortCodeList } from "@/api/system/port-api.js";
import { getPortConfigList, getPortCodeList } from "@/api/system/port-api.js";
// import { getPortList } from "@/api/system/user.js";
import DialogVue from "./dialog.vue";
export default {
......@@ -265,10 +265,12 @@ export default {
this.outerVisible = true;
this.activeData = val;
},
dialogClose() {
dialogClose(flag = false) {
this.outerVisible = false;
this.activeData = null;
this.search(1);
if (flag) {
this.search(0);
}
},
//分页
currentChange(val) {
......
......@@ -8,7 +8,7 @@
:close-on-click-modal="false"
:destroy-on-close="true"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<el-form
......@@ -122,7 +122,7 @@
@click="submit"
>确 定</el-button
>
<el-button class="entrySaveButton" @click="close">关 闭</el-button>
<el-button class="entrySaveButton" @click="close(false)">关 闭</el-button>
</div>
</el-dialog>
</template>
......@@ -255,7 +255,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
}
......@@ -266,7 +266,7 @@ export default {
});
},
close() {
close(flag) {
this.formData = {
receiptType: "",
orderNo: [],
......@@ -274,7 +274,7 @@ export default {
};
this.loadings.dialogLoading = false;
this.receiptInfo = "";
this.$emit("close");
this.$emit("close", flag);
},
},
};
......
......@@ -252,9 +252,11 @@ export default {
this.outerVisible = true;
},
dialogClose() {
dialogClose(flag = false) {
this.outerVisible = false;
this.search(1);
if (flag) {
this.search(0);
}
},
//分页
currentChange(val) {
......
......@@ -8,7 +8,7 @@
:close-on-click-modal="false"
v-loading="loadings.dialogLoading"
:element-loading-text="loadingText"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<div class="modelItem-title">
......@@ -105,7 +105,7 @@
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
@click="close(false)"
>关闭</el-button
>
</div>
......@@ -214,7 +214,7 @@ export default {
if (arr.length == 0) {
this.msgSuccess("上传成功!");
this.handleRemove();
this.close();
this.close(true);
this.uploadType = true;
} else {
this.errorData = arr;
......@@ -237,10 +237,10 @@ export default {
this.fileList = [];
},
clearFile() {},
close() {
close(flag = false) {
this.handleRemove();
this.errorData = []
this.$emit("close", this.uploadType);
this.errorData = [];
this.$emit("close", flag);
},
},
};
......
......@@ -679,9 +679,11 @@ export default {
});
},
methods: {
dialogClose() {
dialogClose(flag = false) {
this.timeVisible = false;
if (flag) {
this.search(0);
}
},
calculateTableHeight() {
this.tableMaxheight = window.innerHeight - 300;
......@@ -901,11 +903,10 @@ export default {
this.dropdownName = val.name;
this.dropdownCode = val.code;
},
close(val) {
// if (val) {
// this.search(1);
// }
this.search(1);
close(flag = false) {
if (flag) {
this.search(0);
}
this.outerVisible = false;
this.tableMaxheight = window.innerHeight - 300;
this.$forceUpdate();
......@@ -913,8 +914,6 @@ export default {
popoverChange(val) {
this.tableData = val.tableData;
console.log(val);
this.receiptApi(val.data.declareId, val.status)
.then((res) => {
val.tableData.forEach((item) => {
......
......@@ -8,7 +8,7 @@
:close-on-click-modal="false"
:destroy-on-close="true"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<el-form
......@@ -57,7 +57,7 @@
@click="submit"
>确 定</el-button
>
<el-button class="entrySaveButton" @click="close">关 闭</el-button>
<el-button class="entrySaveButton" @click="close(false)">关 闭</el-button>
</div>
</el-dialog>
</template>
......@@ -112,7 +112,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -124,12 +124,12 @@ export default {
});
},
close() {
close(flag) {
this.formData = {
leaveTime: "",
};
this.loadings.dialogLoading = false;
this.$emit("close");
this.$emit("close", flag);
},
},
};
......
......@@ -8,7 +8,7 @@
:close-on-click-modal="false"
:destroy-on-close="true"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<el-form
......@@ -57,7 +57,7 @@
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
@click="close(false)"
>关 闭</el-button
>
</div>
......@@ -100,7 +100,7 @@ export default {
} else if (this.type == "menuChange") {
this.formData = this.active;
this.searchTreeData();
this.loadCheckedKeys();//加载已绑定的菜单
this.loadCheckedKeys(); //加载已绑定的菜单
}
}
},
......@@ -227,7 +227,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -244,7 +244,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -261,8 +261,8 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.$store.dispatch('GenerateRoutes')
this.close(true);
this.$store.dispatch("GenerateRoutes");
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -279,12 +279,12 @@ export default {
arr = checked.checkedKeys.concat(checked.halfCheckedKeys);
this.treeCheckData = arr;
},
close() {
close(flag = false) {
this.formData = {
roleName: "",
};
this.checkedKeys = []
this.$emit("close");
this.checkedKeys = [];
this.$emit("close", flag);
},
// 加载已绑定的菜单
loadCheckedKeys() {
......@@ -292,7 +292,9 @@ export default {
getMenuByRoleId(this.formData.roleId)
.then((res) => {
if (res.code === "200") {
this.checkedKeys = res.data.filter(item => item.isBinding && (item.parentMenuId!=0 ) ).map(item => item.menuId);
this.checkedKeys = res.data
.filter((item) => item.isBinding && item.parentMenuId != 0)
.map((item) => item.menuId);
//console.log('初始 checkedKeys:', this.checkedKeys);
this.$nextTick(() => {
this.$refs.tree.setCheckedKeys(this.checkedKeys);
......@@ -314,7 +316,6 @@ export default {
this.treeCheckData = checkedKeys.concat(halfCheckedKeys);
//console.log('合并后的 treeCheckData:', this.treeCheckData);
},
},
};
</script>
......
......@@ -191,10 +191,12 @@ export default {
this.outerVisible = true;
this.activeData = val;
},
dialogClose() {
dialogClose(flag = false) {
this.outerVisible = false;
this.activeData = null;
this.search(1);
if (flag) {
this.search(0);
}
},
//分页
currentChange(val) {
......
......@@ -242,7 +242,7 @@ export default {
};
getNewCustomerList(params)
.then((res) => {
if (res.code == 200) {
if (res.code == 200 && res.data?.[0]) {
this.ebcDataList = res.data;
} else {
this.ebcDataList = [];
......
......@@ -8,7 +8,7 @@
:close-on-click-modal="false"
:destroy-on-close="true"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<el-form
......@@ -131,7 +131,7 @@
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
@click="close(false)"
>关 闭</el-button
>
</div>
......@@ -253,7 +253,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -270,7 +270,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -282,7 +282,7 @@ export default {
});
},
close() {
close(flag = false) {
this.formData = {
operatorCode: "",
operatorName: "",
......@@ -291,7 +291,7 @@ export default {
operatorPersonInCharge: "",
contactNumber: "",
};
this.$emit("close");
this.$emit("close", flag);
},
},
};
......
......@@ -264,10 +264,12 @@ export default {
this.activeData = JSON.parse(JSON.stringify(val));
},
dialogClose() {
dialogClose(flag = false) {
this.outerVisible = false;
this.activeData = null;
this.search(1);
if (flag) {
this.search(0);
}
},
//分页
currentChange(val) {
......
......@@ -8,7 +8,7 @@
width="40%"
:close-on-click-modal="false"
v-loading="loadings.dialogLoading"
@close="close"
@close="close(false)"
>
<div class="modelItem">
<el-form
......@@ -188,7 +188,7 @@
<el-button
class="entrySaveButton"
:disabled="loadings.uploadLoading"
@click="close"
@click="close(false)"
>关 闭</el-button
>
</div>
......@@ -296,7 +296,7 @@ export default {
isDataLoaded(val) {
if (val) {
this.loadings.dialogLoading = false;
this.$emit('update:outerVisible', true); // 设置 outerVisible 为 true
this.$emit("update:outerVisible", true); // 设置 outerVisible 为 true
}
},
},
......@@ -362,7 +362,7 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.close(true);
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -379,8 +379,8 @@ export default {
.then((res) => {
if (res.code === "200") {
this.msgSuccess(res.message);
this.close();
this.$store.dispatch('GenerateRoutes')
this.close(true);
this.$store.dispatch("GenerateRoutes");
} else {
this.alertWarningMsg(res.message);
this.loadings.dialogLoading = false;
......@@ -462,7 +462,7 @@ export default {
this.customData = arr;
this.value = select;
},
close() {
close(flag = false) {
this.formData = {
id: null,
username: "",
......@@ -476,7 +476,7 @@ export default {
this.rightSelect = [];
this.value = [];
this.rightSelectIdx = 0;
this.$emit("close");
this.$emit("close", flag);
},
},
};
......
......@@ -301,10 +301,12 @@ export default {
this.outerVisible = true;
this.activeData = val;
},
dialogClose() {
dialogClose(flag) {
this.outerVisible = false;
this.activeData = null;
this.search(1);
if (flag) {
this.search(0);
}
},
//分页
currentChange(val) {
......