|
@@ -126,6 +126,15 @@
|
|
|
>{{ item.name }}</a-select-option
|
|
|
>
|
|
|
</a-select>
|
|
|
+ <div class="exam-question-edit-search exam-question-edit-btn">
|
|
|
+ <span class="exam-question-edit-search-title">搜索:</span>
|
|
|
+ <a-input-search
|
|
|
+ v-model="searchInputVal"
|
|
|
+ placeholder="请输入试题内容关键字"
|
|
|
+ :maxLength="100"
|
|
|
+ @search="searchInputFun"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -188,6 +197,7 @@ export default {
|
|
|
current: 1,
|
|
|
total: 0,
|
|
|
}, // 分页参数
|
|
|
+ searchInputVal: '', // 搜索name
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -294,9 +304,9 @@ export default {
|
|
|
};
|
|
|
this.$_http
|
|
|
.post(this.$_API.INTERFACE_POST_CAROUSELS_ADD, params)
|
|
|
- .then(() => {
|
|
|
+ .then((res) => {
|
|
|
this.loading = false;
|
|
|
- this.handleShowDialog(data); // 操作:打开弹框
|
|
|
+ this.handleShowDialog(res.data, true); // 操作:打开弹框
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.$message.error(`${err.response.data}`);
|
|
@@ -304,22 +314,29 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 操作:打开弹框
|
|
|
- handleShowDialog(data) {
|
|
|
+ handleShowDialog(data, isUpload) {
|
|
|
if (!data) {
|
|
|
return;
|
|
|
}
|
|
|
this.toBindCarouselData = data;
|
|
|
+ this.toBindCarouselData.isUpload = isUpload; // 是否是新建轮播图
|
|
|
this.getArticleListFun(); // 查询:文章列表数据
|
|
|
this.isVisible = true;
|
|
|
},
|
|
|
// 操作:关闭弹框
|
|
|
handleCloseDialog() {
|
|
|
+ this.searchInputVal = '';
|
|
|
this.toBindCarouselData = null;
|
|
|
this.articleArticleType = this.articleTypeList[0].id;
|
|
|
this.articleTypeChildrenList = [{ name: '全部', id: '' }];
|
|
|
this.initPagination(); // 初始化分页参数
|
|
|
- this.getCarouselListFun(); // 查询:轮播图列表
|
|
|
this.isVisible = false;
|
|
|
+ this.getCarouselListFun(); // 查询:轮播图列表
|
|
|
+ },
|
|
|
+ // 操作:搜索
|
|
|
+ searchInputFun() {
|
|
|
+ this.initPagination(); // 初始化分页参数
|
|
|
+ this.getArticleListFun(); // 查询:试题列表数据
|
|
|
},
|
|
|
// 查询:文章分类-父类
|
|
|
getArticleTypeFun() {
|
|
@@ -365,6 +382,7 @@ export default {
|
|
|
engineertypeid: this.engineeringWorkChooseValue, // 工种ID
|
|
|
page: this.pagination.current - 1,
|
|
|
size: this.pagination.pageSize,
|
|
|
+ materialtitle: this.searchInputVal,
|
|
|
};
|
|
|
this.$_http
|
|
|
.get(this.$_API.INTERFACE_GET_ARTICLE_LIST, { params })
|
|
@@ -456,19 +474,18 @@ export default {
|
|
|
}
|
|
|
this.loading = true;
|
|
|
let params = {
|
|
|
+ id: this.toBindCarouselData.id,
|
|
|
materialId: record.id,
|
|
|
- imageUrl: this.toBindCarouselData.url
|
|
|
- ? this.toBindCarouselData.url
|
|
|
- : this.toBindCarouselData.imageUrl,
|
|
|
+ imageUrl: this.toBindCarouselData.imageUrl,
|
|
|
};
|
|
|
this.$_http
|
|
|
.put(this.$_API.INTERFACE_POST_CAROUSELS_ADD, params)
|
|
|
.then((res) => {
|
|
|
if (res.success && res.data) {
|
|
|
- if (this.toBindCarouselData.id) {
|
|
|
- this.$message.success(`修改绑定文章成功`);
|
|
|
- } else {
|
|
|
+ if (this.toBindCarouselData.isUpload) {
|
|
|
this.$message.success(`成功上传一张轮播图并绑定了文章`);
|
|
|
+ } else {
|
|
|
+ this.$message.success(`修改绑定文章成功`);
|
|
|
}
|
|
|
} else {
|
|
|
this.$message.error(`${res.data || res.message}`);
|