国学标签修改

This commit is contained in:
2024-04-12 13:24:50 +08:00
parent 4f1a71004e
commit b88aaf1736
5 changed files with 108 additions and 75 deletions

View File

@@ -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,
}),

View File

@@ -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">&nbsp;</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;