This commit is contained in:
lb
2023-02-17 14:02:03 +08:00
parent c2657b190e
commit efb9d3f46e
23 ha cambiato i file con 442 aggiunte e 413 eliminazioni

Vedi File

@@ -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 {

Vedi File

@@ -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);

Vedi File

@@ -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',
{

Vedi File

@@ -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: {