国学标签修改
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script type="text/javascript">
|
||||
// const baseUrl = "http://192.168.110.100:9200/pb"; //张川川后端
|
||||
// const baseUrl = "http://168.110.100:9200/pb"; //张川川后端
|
||||
// const baseUrl = 'http://59.110.212.44:9100/pb'
|
||||
const baseUrl = 'https://testapi.nuttyreading.com'
|
||||
// const baseUrl = 'https://api.nuttyreading.com'
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<template>
|
||||
<div
|
||||
style="width: 100%; height: 100%; margin-top: -50px"
|
||||
style="width: 100%; height: 100%;"
|
||||
|
||||
>
|
||||
<!-- <el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
|
||||
style="float: right"
|
||||
>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="dataForm.key"
|
||||
placeholder="商品名称"
|
||||
v-model="dataForm.keywords"
|
||||
placeholder="课程名称"
|
||||
clearable
|
||||
size="small"
|
||||
></el-input>
|
||||
@@ -21,7 +21,7 @@
|
||||
<el-button
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList(bookMarketId);
|
||||
getDataList();
|
||||
"
|
||||
size="small"
|
||||
>查询</el-button
|
||||
@@ -29,19 +29,19 @@
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
<div class="search_form">
|
||||
<div class="addFormBox shopFormBox">
|
||||
<!-- <div class="addFormBox shopFormBox">
|
||||
<el-form ref="addForm" label-width="80px" :model="dataForm">
|
||||
<!-- <el-form-item label="商品名称" prop="title" class="form_item">
|
||||
<el-form-item label="课程名称" prop="title" class="form_item">
|
||||
<el-input
|
||||
size="small"
|
||||
placeholder="请输入商品名称"
|
||||
style="width: 100%"
|
||||
v-model="dataForm.productName"
|
||||
v-model="dataForm.keywords"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="商品类型" prop="goodsType" class="form_item">
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" prop="goodsType" class="form_item">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="dataForm.goodsType"
|
||||
@@ -58,7 +58,7 @@
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label=""
|
||||
@@ -69,12 +69,10 @@
|
||||
<el-button @click="getAssociatedGoodsList(dataForm)" size="mini"
|
||||
>查询</el-button
|
||||
>
|
||||
<!-- <el-button @click="handleCommonShopReset()" size="mini"
|
||||
>重置</el-button
|
||||
> -->
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="shop_box">
|
||||
@@ -103,14 +101,14 @@
|
||||
label="课程ID"
|
||||
width="70"
|
||||
align="center"
|
||||
prop="productId"
|
||||
prop="id"
|
||||
>
|
||||
<!-- <template slot-scope="scope">
|
||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="product.productName"
|
||||
prop="title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="课程名称"
|
||||
@@ -262,7 +260,7 @@ export default {
|
||||
bookIds: [],
|
||||
selectShopArr: [],
|
||||
dataForm: {
|
||||
productName: "",
|
||||
keywords: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -290,7 +288,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
shopDelete(row){
|
||||
this.$emit('delete',[row])
|
||||
this.$emit('delete',row)
|
||||
},
|
||||
// 获取商品类型
|
||||
getGoodsTypeList() {
|
||||
@@ -350,8 +348,8 @@ this.$emit('delete',[row])
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
async getDataList(bookMarketId) {
|
||||
this.bookMarketId = bookMarketId;
|
||||
async getDataList() {
|
||||
// this.bookMarketId = bookMarketId;
|
||||
this.dataListLoading = true;
|
||||
this.getDataList = [];
|
||||
this.clear();
|
||||
@@ -365,16 +363,18 @@ this.$emit('delete',[row])
|
||||
params: this.$http.adornParams({
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
key: this.dataForm.key,
|
||||
keywords: this.dataForm.keywords,
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list;
|
||||
this.totalPage = data.page.totalCount;
|
||||
console.log('this.dataList at line 372:', this.dataList)
|
||||
this.totalPage = data.page.totalPage;
|
||||
} else {
|
||||
this.dataList = [];
|
||||
this.totalPage = 0;
|
||||
}
|
||||
this.$forceUpdate()
|
||||
// setTimeout(async () => {
|
||||
// await this.setSelectRow();
|
||||
// }, 200);
|
||||
@@ -408,10 +408,10 @@ this.$emit('delete',[row])
|
||||
url: this.$http.adornUrl(`${this.urlList.getAssociatedGoodsList}`),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
current: 1,
|
||||
page: 1,
|
||||
limit: 99999999,
|
||||
// productName: "",
|
||||
productId: "",
|
||||
|
||||
|
||||
...form,
|
||||
// bookLabelId: bookLabelId,
|
||||
}),
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <el-drawer title="新增关联商品" v-if="drawer" :wrapperClosable="false" :visible.sync="drawer" destroy-on-close
|
||||
direction="rtl" size="70%"> -->
|
||||
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="drawer"
|
||||
@close="handlereset">
|
||||
<el-drawer title="新增关联课程" v-show="drawer" :wrapperClosable="false" :visible.sync="drawer" destroy-on-close
|
||||
direction="rtl" size="70%">
|
||||
<!-- <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="drawer"
|
||||
@close="handlereset"> -->
|
||||
<div class="shop_drawer_box demo-drawer__content">
|
||||
<!-- <div class="addFormBox">
|
||||
<div class="addFormBox">
|
||||
<el-form ref="addForm" label-width="80px" :model="dataForm">
|
||||
<el-form-item label="商品名称" prop="title" class="form_item">
|
||||
<el-input size="small" placeholder="请输入商品名称" style="width: 100%" v-model="dataForm.productName" clearable>
|
||||
<el-form-item label="课程名称" prop="keywords" class="form_item">
|
||||
<el-input size="small" placeholder="请输入商品名称" style="width: 100%" v-model="dataForm.keywords" clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" prop="goodsType" class="form_item">
|
||||
<!-- <el-form-item label="商品类型" prop="goodsType" class="form_item">
|
||||
<el-select size="small" v-model="dataForm.goodsType" placeholder="请选择" style="width: 100%" clearable>
|
||||
<el-option v-for="item in goodsTypeList" :key="item.dictType" :label="item.dictValue"
|
||||
:value="item.dictType">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="" class="form_item" label-width="20px" style="width: 160px !important">
|
||||
<el-button type="primary" plain @click="
|
||||
@@ -27,19 +27,28 @@
|
||||
<el-button @click="handleReset()" size="small" plain>重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<el-table ref="table" height="80%" :data="dataList" :row-key="getRowKeys" border size="mini"
|
||||
v-loading="dataListLoading" @selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column :reserve-selection="true" type="selection" header-align="center" align="center" width="50">
|
||||
<el-table ref="table" height="80%" :data="dataList" :row-key="getRowKeys" border size="mini" highlight-current-row
|
||||
v-loading="dataListLoading" @selection-change="handleSelectionChange" @current-change="handleCurrentChange" style="width: 100%">
|
||||
<!-- <el-table-column :reserve-selection="true" type="selection" header-align="center" align="center" width="50">
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column align="center" width="40px">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="currentRow" :label="scope.row"> </el-radio>
|
||||
<!-- //或者是<el-radio v-model="currentRow" :label="scope.row"><i></i></el-radio> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- -->
|
||||
<el-table-column label="课程ID" width="70" align="center" prop="productId">
|
||||
<el-table-column label="课程ID" width="70" align="center" prop="id">
|
||||
<!-- <template slot-scope="scope">
|
||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column prop="productName" header-align="center" align="center" label="课程名称">
|
||||
<el-table-column prop="title" header-align="center" align="center" label="课程名称">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="price" width="120" header-align="center" align="center" sortable label="价格">
|
||||
</el-table-column>
|
||||
@@ -60,18 +69,18 @@
|
||||
</el-pagination>
|
||||
|
||||
<div class="demo-drawer__footer">
|
||||
<div style="float: right; margin-top: 20px">
|
||||
<!-- <div style="float: right; margin-top: 20px">
|
||||
<el-button @click="close" size="small">取 消</el-button>
|
||||
<el-button type="primary" @click="submit" :loading="loading" size="small">{{ loading ? "提交中 ..." : "确 定"
|
||||
}}</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @showchooseBookf = "showchooseBookf"></add-or-update>
|
||||
<choose-book v-if="chooseBookVisible" :bookIds = bookIds ref="chooseBook" :chooseBookVisible = chooseBookVisible @closeBookf = "closeBookf"></choose-book> -->
|
||||
</div>
|
||||
<!-- </el-drawer> -->
|
||||
</el-dialog>
|
||||
</el-drawer>
|
||||
<!-- </el-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -91,6 +100,7 @@ export default {
|
||||
dataForm: {
|
||||
productName: "",
|
||||
},
|
||||
currentRow:null,
|
||||
bookMarketId: null,
|
||||
dataList: [],
|
||||
publishStatus: false,
|
||||
@@ -119,7 +129,7 @@ export default {
|
||||
this.getDataList();
|
||||
},
|
||||
submit() {
|
||||
var ids = this.multipleSelection.map((e) => e.productId).toString(",");
|
||||
var ids = this.multipleSelection.map((e) => e.id).toString(",");
|
||||
this.$emit("submit", ids);
|
||||
console.log(
|
||||
"🚀 ~ submit ~ this.multipleSelection:",
|
||||
@@ -158,6 +168,18 @@ export default {
|
||||
getRowKeys(row) {
|
||||
return row.productId;
|
||||
},
|
||||
|
||||
handleCurrentChange(val) {
|
||||
console.log("🚀 ~ handleSelectionChange ~ val:", val);
|
||||
|
||||
this.$emit("submit", val.id);
|
||||
|
||||
|
||||
// table组件选中事件,记得加上@selection-change="handleSelectionChange"
|
||||
// this.multipleSelection = val;
|
||||
// this.changePageCoreRecordData();
|
||||
},
|
||||
|
||||
handleSelectionChange(val) {
|
||||
console.log("🚀 ~ handleSelectionChange ~ val:", val);
|
||||
// table组件选中事件,记得加上@selection-change="handleSelectionChange"
|
||||
@@ -188,8 +210,8 @@ export default {
|
||||
};
|
||||
// this.multipleSelection=[]
|
||||
// if (this.currentType == "bookLabelId") {
|
||||
form.id = this.currentId;
|
||||
console.log("🚀 ~ getAssociatedGoodsList ~ form:", form);
|
||||
form.id = this.currentId;
|
||||
console.log("🚀 ~ getAssociatedGoodsList ~ form:", form);
|
||||
// } else if (this.currentType == "bookMarketId") {
|
||||
// form.bookMarketId = this.currentId;
|
||||
// console.log("🚀 ~ getAssociatedGoodsList ~ form:", form);
|
||||
@@ -203,8 +225,8 @@ export default {
|
||||
data: this.$http.adornData(form),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.result.records;
|
||||
this.totalPage = data.result.total;
|
||||
this.dataList = data.page.records;
|
||||
this.totalPage = data.page.total;
|
||||
} else {
|
||||
this.dataList = [];
|
||||
this.totalPage = 0;
|
||||
|
||||
@@ -30,7 +30,9 @@
|
||||
</div>
|
||||
<div style=" border: 1px dashed #bababa;" v-if="currentNode && currentNode.data.isLast == 1"></div>
|
||||
</div>
|
||||
|
||||
<div class="border_box tree_content_box" v-if="currentNode && currentNode.data.isLast == 1">
|
||||
|
||||
<div class="title_box" style="margin-bottom: 10px; height: 40px">
|
||||
<div class="title">
|
||||
<span class="line"></span>已绑定课程列表
|
||||
@@ -38,7 +40,7 @@
|
||||
size="mini">新增</el-button>
|
||||
|
||||
<!-- <div style="" class="button_box"> -->
|
||||
<el-button plain type="danger" @click="handleCheckAllChange(true)" size="mini">清空</el-button>
|
||||
<!-- <el-button plain type="danger" @click="handleCheckAllChange(true)" size="mini">清空</el-button> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -178,19 +180,22 @@ export default {
|
||||
url: this.$http.adornUrl(`${this.urlList.saveShop}`),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
productId: ids,
|
||||
bookLabelId: this.addForm.id,
|
||||
courseId: ids,
|
||||
sociologyId: this.addForm.id,
|
||||
}),
|
||||
}).then(async ({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success(data.msg);
|
||||
if (this.$refs.commonShop) {
|
||||
this.$refs.commonShop.getAssociatedGoodsList({
|
||||
bookLabelId: this.addForm.id,
|
||||
courseId: this.addForm.id,
|
||||
});
|
||||
}
|
||||
if (this.$refs.commonShopTable) {
|
||||
|
||||
this.$refs.commonShopTable.close();
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -202,7 +207,7 @@ export default {
|
||||
this.isEdit = false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.commonShopTable.open(this.addForm.id);
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
handleChangeIsLast(e) {
|
||||
@@ -255,7 +260,7 @@ export default {
|
||||
await this.$refs[formName].validate(async (valid) => {
|
||||
if (valid) {
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl(`${this.addForm.id?this.urlList.edit:this.urlList.add}`),
|
||||
url: this.$http.adornUrl(`${this.addForm.id ? this.urlList.edit : this.urlList.add}`),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
...this.addForm,
|
||||
@@ -264,9 +269,9 @@ export default {
|
||||
if (data && data.code === 0) {
|
||||
await this.getDataList();
|
||||
this.$nextTick(async () => {
|
||||
this.$refs.commonTree.setCurrentNodeShow(data.result.id);
|
||||
this.addForm = data.result;
|
||||
this.currentNode = { data: { ...data.result } }
|
||||
this.$refs.commonTree.setCurrentNodeShow(data.sociology.id);
|
||||
this.addForm = data.sociology;
|
||||
this.currentNode = { data: { ...data.sociology } }
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
@@ -285,14 +290,15 @@ export default {
|
||||
}, 200),
|
||||
//删除关联图书
|
||||
dataFormDelete: debounce(async function (row, deleteType) {
|
||||
this.$confirm(`确定要删除${deleteType != 'all' ? '该' : '所有'}关联商品嘛?`, "提示", {
|
||||
console.log('row at line 292:', row)
|
||||
this.$confirm(`确定要删除${deleteType != 'all' ? '该' : '所有'}关联课程吗?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(async () => {
|
||||
var lableIds = row[0].bookLabelId
|
||||
var productIds = row.map(e => e.productId)
|
||||
// var lableIds = row[0].bookLabelId
|
||||
var bindId = row.bindId
|
||||
|
||||
// // return false
|
||||
// var selectShopArr = this.$refs.commonShop.selectShopArr;
|
||||
@@ -305,24 +311,29 @@ export default {
|
||||
this.$refs.commonShop.dataListLoading = true;
|
||||
await this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
`${this.urlList.deleteShop}?lableId=${this.addForm.id}&productId=${productIds.toString(",")}`
|
||||
// `${this.urlList.deleteShop}?id=${this.addForm.id}&sociologyId=${sociologyId.toString(",")}`
|
||||
`${this.urlList.deleteShop}`
|
||||
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: bindId
|
||||
}),
|
||||
}).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({
|
||||
bookLabelId: this.addForm.id,
|
||||
});
|
||||
}
|
||||
} this.$nextTick(() => {
|
||||
// this.$refs.commonShop.selectShopArr = [];
|
||||
if (this.$refs.commonShop) {
|
||||
this.$refs.commonShop.getAssociatedGoodsList({
|
||||
bookLabelId: this.addForm.id,
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
// api接口请求地址
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';//张川川
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
||||
window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境11
|
||||
// window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境11
|
||||
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user