国学标签

This commit is contained in:
2024-05-21 13:22:16 +08:00
parent 86b1851fcc
commit 83687ef134
6 changed files with 202 additions and 158 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div
class="commonShopproduct"
:style="`width: 100%; height: 100%; margin-top: -50px`"
:style="`width: 100%; height: 100%; margin-top: ${!isNoSearch?'-50px':'0'}`"
>
<!-- <el-form
:inline="true"
@@ -286,7 +286,7 @@ export default {
// }
await this.$http({
url: this.$http.adornUrl(this.urlList.getAssociatedGoodsList),
url: this.$http.adornUrl(this.urlList.hasBindProductList),
method: "post",
params: this.$http.adornParams({
...this.defaultForm,
@@ -322,36 +322,13 @@ export default {
this.dataListLoading = true;
if (this.axiosType == "raw") {
this.$http
.request({
url: this.$http.adornUrl(`${this.urlList.getAssociatedGoodsList}`),
method: "POST",
data: {
...form
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json"
}
})
.then(async ({ data }) => {
console.log('data at line 338:', data)
if (data && data.code === 0) {
this.associatedGoodsList = [...data[this.otherInfo.httpDataValueName]];
this.dataListLoading = false;
}
});
}
else if (this.defaultForm.httpType == "raw") {
if (this.otherInfo.httpType == "raw") {
this.$http
.request({
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
method: "POST",
data: {
productId: this.defaultForm.productId
...form
},
header: {
//默认 无 说明:请求头
@@ -360,7 +337,7 @@ export default {
})
.then(async ({ data }) => {
if (data && data.code === 0) {
this.associatedGoodsList = [...data[this.defaultForm.httpDataValueName]];
this.associatedGoodsList = [...data[this.otherInfo.httpDataValueName]];
this.dataListLoading = false;
}

View File

@@ -246,7 +246,7 @@ export default {
// }
this.dataListLoading = true;
this.clear();
if (this.defaultForm.httpType == "raw"||this.otherInfo.httpType == "raw") {
if (this.otherInfo.httpType == "raw") {
form.page = this.pageIndex;
this.$http
.request({
@@ -261,9 +261,10 @@ export default {
}
})
.then(({ data }) => {
console.log('data at line 263:', data)
if (data && data.code === 0) {
this.dataList = [...data.page[this.defaultForm.httpDataValueName]];
this.totalPage = data.page[this.defaultForm.httpDataTotalName];
this.dataList = [...data.page[this.otherInfo.httpDataValueName]];
this.totalPage = data.page[this.otherInfo.httpDataTotalName];
} else {
this.dataList = [];
this.totalPage = 0;

View File

@@ -35,6 +35,8 @@
<!-- :allow-drop="allowDrop" -->
<div class="custom-tree-container">
<el-tree
:draggable="false"
:allow-drop="false"
:highlight-current="true"
class="filter-tree"
node-key="id"
@@ -43,7 +45,6 @@
default-expand-all
:filter-node-method="filterNode"
ref="tree"
:draggable="true"
@node-click="handleNodeClick"
:expand-on-click-node="false"
>
@@ -326,11 +327,10 @@ export default {
...this.addForm
})
}).then(async ({ data }) => {
console.log('data at line 328:', data)
console.log("data at line 328:", data);
if (data && data.code === 0) {
if(this.axiosResultKey){
console.log('at line 331:',data[this.axiosResultKey] )
if (this.axiosResultKey) {
console.log("at line 331:", data[this.axiosResultKey]);
}
var status = await this.correlationShop(
data[this.axiosResultKey ? this.axiosResultKey : "result"].id

View File

@@ -92,7 +92,9 @@
</div>
<!-- :isNoSearch="true" -->
<commonShop
:isNoSearch="true"
:otherInfo="{
httpType: 'raw',
httpDataValueName: 'courseList'
}"
:defaultForm="{
@@ -222,9 +224,9 @@
<commonShopTable
title="课程"
:otherInfo="{
httpType:'raw',
httpDataValueName:'records',
httpDataTotalName:'total'
httpType: 'raw',
httpDataValueName: 'records',
httpDataTotalName: 'total'
}"
:defaultForm="{
keywords: '',
@@ -314,13 +316,14 @@ export default {
urlList: {
treeList: "/master/courseSociologyMarket/marketTree",
delete: "/master/courseSociologyMarket/delMarket",
deleteShop: "/master/courseSociologyMarket/delToMarket",
saveShop: "/master/courseSociologyMarket/saveToMarket",
deleteShop:
"/master/courseSociologyMarket/unbindCourseAndSociologyMarket",
saveShop: "/master/courseSociologyMarket/bindCourseAndSociologyMarket",
add: "/master/courseSociologyMarket/addSociologyMarket",
edit: "/master/courseSociologyMarket/editSociologyMarket",
getAssociatedGoodsList:
hasBindProductList:
"/master/courseSociologyMarket/getCourseListByMarketId",
CanBindProductList: "/master/courseSociologyMarket/getNotToMarketList"
CanBindProductList: "/master/courseSociologyMarket/getNotToMarketList"
},
addForm: {},
isFresh: false,
@@ -426,32 +429,38 @@ export default {
});
},
handleSubmitShopTable: debounce(async function(ids) {
await this.$http({
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
method: "post",
data: this.$http.adornData({
courseId: ids,
marketId: this.addForm.id
await this.$http
.request({
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
method: "POST",
data: {
courseId: ids,
marketId: this.addForm.id
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json"
}
})
}).then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success(data.msg);
.then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success(data.msg);
if (this.$refs.commonShop) {
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
// id:this.addForm.id ? this.addForm.id : null
// }
if (this.$refs.commonShop) {
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
// id:this.addForm.id ? this.addForm.id : null
// }
this.$refs.commonShop.getAssociatedGoodsList();
this.$refs.commonShop.getAssociatedGoodsList();
}
if (this.$refs.commonShopTable) {
this.$refs.commonShopTable.close();
}
} else {
this.$message.error(data.msg);
}
if (this.$refs.commonShopTable) {
this.$refs.commonShopTable.close();
}
} else {
this.$message.error(data.msg);
}
});
});
}, 200),
openTable() {
this.isEdit = false;
@@ -538,6 +547,12 @@ export default {
});
} else {
this.$message.error(data.msg);
setTimeout(()=>{
this.addForm = { ...this.currentNode.data };
},500)
// console.log('this.addForm at line 550:', this.addForm)
// console.log('this.addForm at line 550:', this.currentNode)
}
});
}
@@ -568,31 +583,36 @@ export default {
// return false;
// }
this.$refs.commonShop.dataListLoading = true;
await this.$http({
url: this.$http.adornUrl(
`${this.urlList.deleteShop}?marketId=${
this.addForm.id
}&courseId=${productIds}`
),
method: "post"
}).then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success("删除成功");
} else {
this.$message.error(data.msg);
}
this.$nextTick(() => {
// this.$refs.commonShop.selectShopArr = [];
if (this.$refs.commonShop) {
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
// id:this.addForm.id ? this.addForm.id : null
// }
this.$refs.commonShop.getAssociatedGoodsList();
await this.$http
.request({
url: this.$http.adornUrl(`${this.urlList.deleteShop}`),
method: "POST",
data: {
courseId: productIds,
marketId: this.addForm.id
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json"
}
})
.then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success("删除成功");
} else {
this.$message.error(data.msg);
}
this.$nextTick(() => {
// this.$refs.commonShop.selectShopArr = [];
if (this.$refs.commonShop) {
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
// id:this.addForm.id ? this.addForm.id : null
// }
this.$refs.commonShop.getAssociatedGoodsList();
}
});
});
});
})
.catch(() => {});
}, 200),

View File

@@ -2,6 +2,8 @@
<div class="mod-config">
<commonTree
source="tags"
axiosType="raw"
axiosResultKey="market"
@changeCurrentNode="changeCurrentNode"
ref="commonTree"
:dataList="treeDataList"
@@ -88,12 +90,19 @@
<!-- </div> -->
</div>
</div>
<!-- :isNoSearch="true" -->
<commonShop
:defaultForm="{
title: '',
marketId:addForm.id
:isNoSearch="true"
:otherInfo="{
httpType: 'raw',
httpDataValueName: 'courseList'
}"
:defaultForm="{
marketId: addForm.id
}"
axiosType="raw"
getAssociatedGoodsListKey="marketId"
:isNoPaging="true"
getAssociatedGoodsListValue="result"
:tableColumnList="tableColumnList"
:currentId="addForm.id ? addForm.id : ''"
@@ -106,7 +115,12 @@
:style="`height: calc(100% - 50px); `"
>
<template slot="searchFormItem" slot-scope="slotProps">
<el-form-item label="课程名称" prop="title" class="form_item" style="width: 240px;">
<!-- <el-form-item
label="课程名称"
prop="title"
class="form_item"
style="width: 240px;"
>
<el-input
size="small"
placeholder="请输入课程名称"
@@ -115,7 +129,7 @@
clearable
>
</el-input>
</el-form-item>
</el-form-item> -->
<!-- <el-form-item label="商品类型" prop="goodsType" class="form_item">
<el-select
size="small"
@@ -209,9 +223,14 @@
</el-form> -->
<commonShopTable
title="课程"
:otherInfo="{
httpType: 'raw',
httpDataValueName: 'records',
httpDataTotalName: 'total'
}"
:defaultForm="{
title: '',
marketId:addForm.id
keywords: '',
id: addForm.id
}"
:urlList="urlList"
:tableColumnList="tableColumnList"
@@ -222,12 +241,12 @@
@submit="handleSubmitShopTable"
>
<template slot="searchFormItem" slot-scope="slotProps">
<el-form-item label="课程名称" prop="title" class="form_item">
<el-form-item label="课程名称" prop="keywords" class="form_item">
<el-input
size="small"
placeholder="请输入课程名称"
style="width: 100%"
v-model="slotProps.dataForm.title"
v-model="slotProps.dataForm.keywords"
clearable
>
</el-input>
@@ -291,18 +310,20 @@ import commonTree from "@/views/components/commonBookTags/tags.vue";
export default {
data() {
return {
isEdit: false,
checkAll: false,
isIndeterminate: true,
urlList: {
treeList: "/master/courseMedicineMarket/marketTree",
delete: "/master/courseMarket/delMarket",
deleteShop: "/master/courseMarket/delToMarket",
saveShop: "/master/courseMarket/saveToMarket",
add: "/master/courseSociologyMarket/saveOrUpdateMarket",
getAssociatedGoodsList: "/master/courseMarket/getCourseByMarketId",
getNotToLabelList: "/master/courseMarket/getNotToMarketList"
treeList: "/master/courseSociologyMarket/marketTree",
delete: "/master/courseSociologyMarket/delMarket",
deleteShop:
"/master/courseSociologyMarket/unbindCourseAndSociologyMarket",
saveShop: "/master/courseSociologyMarket/bindCourseAndSociologyMarket",
add: "/master/courseSociologyMarket/addSociologyMarket",
edit: "/master/courseSociologyMarket/editSociologyMarket",
hasBindProductList:
"/master/courseSociologyMarket/getCourseListByMarketId",
CanBindProductList: "/master/courseSociologyMarket/getNotToMarketList"
},
addForm: {},
isFresh: false,
@@ -408,32 +429,38 @@ export default {
});
},
handleSubmitShopTable: debounce(async function(ids) {
await this.$http({
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
method: "post",
data: this.$http.adornData({
courseId: ids,
marketId: this.addForm.id
await this.$http
.request({
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
method: "POST",
data: {
courseId: ids,
marketId: this.addForm.id
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json"
}
})
}).then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success(data.msg);
.then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success(data.msg);
if (this.$refs.commonShop) {
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
// id:this.addForm.id ? this.addForm.id : null
// }
if (this.$refs.commonShop) {
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
// id:this.addForm.id ? this.addForm.id : null
// }
this.$refs.commonShop.getAssociatedGoodsList();
this.$refs.commonShop.getAssociatedGoodsList();
}
if (this.$refs.commonShopTable) {
this.$refs.commonShopTable.close();
}
} else {
this.$message.error(data.msg);
}
if (this.$refs.commonShopTable) {
this.$refs.commonShopTable.close();
}
} else {
this.$message.error(data.msg);
}
});
});
}, 200),
openTable() {
this.isEdit = false;
@@ -492,7 +519,9 @@ export default {
await this.$refs[formName].validate(async valid => {
if (valid) {
await this.$http({
url: this.$http.adornUrl(`${this.urlList.add}`),
url: this.$http.adornUrl(
this.addForm.id ? this.urlList.edit : this.urlList.add
),
method: "post",
data: this.$http.adornData({
...this.addForm
@@ -503,7 +532,7 @@ export default {
await this.getDataList();
this.$nextTick(async () => {
this.$refs.commonTree.setCurrentNodeShow(data.result.id);
this.$refs.commonTree.setCurrentNodeShow(data.market.id);
this.addForm = data.result;
this.currentNode = { data: { ...data.result } };
@@ -518,6 +547,12 @@ export default {
});
} else {
this.$message.error(data.msg);
setTimeout(()=>{
this.addForm = { ...this.currentNode.data };
},500)
// console.log('this.addForm at line 550:', this.addForm)
// console.log('this.addForm at line 550:', this.currentNode)
}
});
}
@@ -548,31 +583,36 @@ export default {
// return false;
// }
this.$refs.commonShop.dataListLoading = true;
await this.$http({
url: this.$http.adornUrl(
`${this.urlList.deleteShop}?marketId=${
this.addForm.id
}&courseId=${productIds}`
),
method: "post"
}).then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success("删除成功");
} else {
this.$message.error(data.msg);
}
this.$nextTick(() => {
// this.$refs.commonShop.selectShopArr = [];
if (this.$refs.commonShop) {
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
// id:this.addForm.id ? this.addForm.id : null
// }
this.$refs.commonShop.getAssociatedGoodsList();
await this.$http
.request({
url: this.$http.adornUrl(`${this.urlList.deleteShop}`),
method: "POST",
data: {
courseId: productIds,
marketId: this.addForm.id
},
header: {
//默认 无 说明:请求头
"Content-Type": "application/json"
}
})
.then(async ({ data }) => {
if (data && data.code === 0) {
this.$message.success("删除成功");
} else {
this.$message.error(data.msg);
}
this.$nextTick(() => {
// this.$refs.commonShop.selectShopArr = [];
if (this.$refs.commonShop) {
// this.$refs.commonShop.getAssociatedGoodsList.dataForm={
// ...this.$refs.commonShop.getAssociatedGoodsList.dataForm,
// id:this.addForm.id ? this.addForm.id : null
// }
this.$refs.commonShop.getAssociatedGoodsList();
}
});
});
});
})
.catch(() => {});
}, 200),
@@ -997,7 +1037,7 @@ export default {
.tree_content_box {
height: calc(100% - 110px) !important;
.shopFormBox{
.shopFormBox {
width: auto !important;
}
}

View File

@@ -20,11 +20,14 @@
</div>
<commonShop
:isNoSearch="true"
:otherInfo="{
httpType: 'raw',
httpDataValueName: this.source == 'book' ? 'books' : 'course'
}"
:defaultForm="{
title: '',
productId: this.productId,
httpType: 'raw',
httpDataValueName: this.source == 'book' ? 'books' : 'course'
// marketId: addForm.id
}"
getAssociatedGoodsListKey="marketId"
@@ -257,12 +260,15 @@
</el-form> -->
<commonShopTable
:title="title"
:otherInfo="{
httpType:'raw',
httpDataValueName: this.source == 'book' ? 'records' : 'data',
httpDataTotalName: this.source == 'book' ? 'total' : 'count'
}"
:defaultForm="{
keywords: '',
id: productId,
httpType: 'raw',
httpDataValueName: this.source == 'book' ? 'records' : 'data',
httpDataTotalName: this.source == 'book' ? 'total' : 'count'
}"
:urlList="urlList"
:tableColumnList="tableColumnList"