国学标签

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

View File

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

View File

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

View File

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

View File

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

View File

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