🐞 fix(标签): 标签模块parentId传空字符串

dev
zhangjiabao 12 months ago
parent 649647add1
commit ab562bad25

@ -51,9 +51,9 @@ export default {
* @param {*} data * @param {*} data
* @returns * @returns
*/ */
update(data) { update(id, data) {
return request({ return request({
url: `/luoo-tag/tag/${data.id}`, url: `/luoo-tag/tag/${id}`,
method: "put", method: "put",
data data
}); });

@ -355,7 +355,7 @@ export default {
let queryParam = { let queryParam = {
...param ...param
}; };
queryParam.level = this.tagType queryParam.level = this.tagType;
if (param.timeRange) { if (param.timeRange) {
if (param.timeRange[0]) { if (param.timeRange[0]) {
queryParam.createTimeStart = param.timeRange[0] + " 00:00:00"; queryParam.createTimeStart = param.timeRange[0] + " 00:00:00";
@ -392,14 +392,14 @@ export default {
tagApi.parentNameList().then(res => { tagApi.parentNameList().then(res => {
if (res.code === 200) { if (res.code === 200) {
if (!res.data) { if (!res.data) {
this.queryForm.remoteData.parentTag = [] this.queryForm.remoteData.parentTag = [];
return return;
} }
let newList = [] let newList = [];
for (let index in res.data) { for (let index in res.data) {
if (res.data[index].level === 1) { if (res.data[index].level === 1) {
newList.push(res.data[index]) newList.push(res.data[index]);
} }
} }
this.queryForm.remoteData.parentTag = newList; this.queryForm.remoteData.parentTag = newList;
@ -511,9 +511,18 @@ export default {
handleDialogSubmit() { handleDialogSubmit() {
this.$refs.modifyDialogForm.validate(valid => { this.$refs.modifyDialogForm.validate(valid => {
if (valid) { if (valid) {
let data = {
nameCh: this.modifyDialog.form.data["nameCh"],
nameEn: this.modifyDialog.form.data["nameEn"],
parentId:
this.modifyDialog.form.data["parentId"] === null ||
this.modifyDialog.form.data["parentId"] === undefined
? ""
: this.modifyDialog.form.data["parentId"]
};
// //
if (this.modifyDialog.type === 0) { if (this.modifyDialog.type === 0) {
tagApi.create(this.modifyDialog.form.data).then(res => { tagApi.create(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.modifyDialog.visible = false; this.modifyDialog.visible = false;
@ -530,7 +539,7 @@ export default {
// //
if (this.modifyDialog.type === 1) { if (this.modifyDialog.type === 1) {
tagApi.update(this.modifyDialog.form.data).then(res => { tagApi.update(this.modifyDialog.form.data.id, data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.modifyDialog.visible = false; this.modifyDialog.visible = false;
@ -544,7 +553,7 @@ export default {
// //
if (this.modifyDialog.type === 2) { if (this.modifyDialog.type === 2) {
tagApi.create(this.modifyDialog.form.data).then(res => { tagApi.create(data).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.modifyDialog.visible = false; this.modifyDialog.visible = false;

Loading…
Cancel
Save