bugfix
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
:key="'upload_' + rowIndex + colIndex"
|
||||
:action="col.actionUrl"
|
||||
:file-list="dataForm['files']"
|
||||
:disabled="detailMode || !dataForm.id"
|
||||
:disabled="detailMode"
|
||||
v-bind="col.elparams"
|
||||
@update-file-list="handleFilelistUpdate"
|
||||
/>
|
||||
@@ -211,7 +211,14 @@ export default {
|
||||
typeCode: file.typeCode,
|
||||
}));
|
||||
// 更新请求
|
||||
this.addOrUpdate("PUT");
|
||||
if ("id" in this.dataForm && this.dataForm.id !== null && this.dataForm.id !== undefined) this.addOrUpdate("PUT");
|
||||
else
|
||||
this.$notify({
|
||||
title: "等待保存",
|
||||
message: "已添加文件,请手动点击保存!",
|
||||
type: "warning",
|
||||
duration: 2500,
|
||||
});
|
||||
},
|
||||
|
||||
/** utitilities */
|
||||
@@ -322,11 +329,17 @@ export default {
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
console.log("[add&update] res is: ", res);
|
||||
this.loadingStatus = false;
|
||||
if (res.code === 0) {
|
||||
this.$message.success(method === "POST" ? "添加成功" : "更新成功");
|
||||
this.$emit("refreshDataList");
|
||||
this.loadingStatus = false;
|
||||
if (method === "POST") this.handleClose();
|
||||
} else {
|
||||
this.$message({
|
||||
message: `${res.code}: ${res.msg}`,
|
||||
type: "error",
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((errMsg) => {
|
||||
@@ -352,7 +365,7 @@ export default {
|
||||
break;
|
||||
case "add":
|
||||
case "update":
|
||||
this.addOrUpdate((payload.name === "add" ? "POST" : "PUT"));
|
||||
this.addOrUpdate(payload.name === "add" ? "POST" : "PUT");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -653,10 +653,19 @@ export default {
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
console.log("[add&update] res is: ", res);
|
||||
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
|
||||
this.$emit("refreshDataList");
|
||||
this.loadingStatus = false;
|
||||
this.handleClose();
|
||||
if (res.code === 0) {
|
||||
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
|
||||
this.$emit("refreshDataList");
|
||||
this.loadingStatus = false;
|
||||
this.handleClose();
|
||||
} else {
|
||||
this.$message({
|
||||
message: `${res.code}: ${res.msg}`,
|
||||
type: "error",
|
||||
duration: 2000,
|
||||
});
|
||||
this.loadingStatus = false;
|
||||
}
|
||||
})
|
||||
.catch((errMsg) => {
|
||||
this.$message.error("参数错误:" + errMsg);
|
||||
|
||||
@@ -66,10 +66,8 @@ export default {
|
||||
const optIsObj = typeof opt === 'object'
|
||||
|
||||
if (optIsObj) {
|
||||
// 可能需要验证权限,如 opt.permission 选项
|
||||
// 注意:为空字符串或null/undefined都会不验证权限
|
||||
if (!opt.permission || (opt.permission && this.$hasPermission(opt.permission))) {
|
||||
// console.log('[operation component]: ', opt.permission, this.$hasPermission(opt.permission))
|
||||
btns.push(
|
||||
h('el-button',
|
||||
{
|
||||
|
||||
@@ -71,7 +71,9 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
filteredList() {
|
||||
return this.fileList.filter((item) => item.name.startsWith(this.searchCondition));
|
||||
// return this.fileList.filter((item) => item.name.startsWith(this.searchCondition));
|
||||
// 改为模糊查询
|
||||
return this.fileList.filter((item) => item.name.indexOf(this.searchCondition) !== -1);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user