tijiao
This commit is contained in:
@@ -78,6 +78,8 @@ const mainRoutes = {
|
||||
{ path: '/training-course-list', component: _import('modules/trainingCourse/training-course-list'), name: 'training-course-list', meta: { title: '培训班管理', isTab: true } },
|
||||
{ path: '/training-course-user', component: _import('modules/trainingCourse/training-course-user'), name: 'training-course-user', meta: { title: '用户列表', isTab: true } },
|
||||
{ path: '/talents-list', component: _import('modules/talents/talents-list'), name: 'talents-list', meta: { title: '太湖英才列表', isTab: true } },
|
||||
{ path: '/talents-articleList', component: _import('modules/talents/talents-articleList'), name: 'talents-articleList', meta: { title: '文章列表', isTab: true } },
|
||||
{ path: '/talents-commontList', component: _import('modules/talents/talents-commontList'), name: 'talents-commontList', meta: { title: '评论列表', isTab: true } },
|
||||
|
||||
{ path: '/course-taihumedList', component: _import('modules/course/taihumedList'), name: 'course-taihumedList', meta: { title: '太湖标签', isTab: true } },
|
||||
{ path: '/courses-list', component: _import('modules/talents/courses-list'), name: 'courses-list', meta: { title: '查看课程', isTab: true } },
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
label-width="80px"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item label="课程名" prop="title">
|
||||
<el-input v-model="dataForm.title" placeholder="课程名"></el-input>
|
||||
@@ -31,6 +31,16 @@
|
||||
inactive-text="关闭">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否直接购买" prop="adminControl">
|
||||
<el-switch
|
||||
v-model="dataForm.adminControl"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="课程长图"
|
||||
prop="image"
|
||||
@@ -633,6 +643,7 @@ export default {
|
||||
id: this.dataForm.id || undefined,
|
||||
title: this.dataForm.title,
|
||||
canzk: this.dataForm.canzk ? '1' : '0', // 是否可以自考 0/ 1 0 否 1 是
|
||||
adminControl: this.dataForm.adminControl, // 是否可以自考 0/ 1 0 否 1 是
|
||||
sort: this.dataForm.sort,
|
||||
image: this.dataForm.image,
|
||||
squareImage: this.dataForm.squareImage,
|
||||
|
||||
@@ -185,6 +185,19 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="adminControl"
|
||||
width="110"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="是否直接购买"
|
||||
>
|
||||
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.adminControl == 0" style="color: #606266;font-weight: 700;">是</span>
|
||||
<span v-else style="color: red;font-weight: 700;">否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
width="80"
|
||||
|
||||
203
src/views/modules/talents/PrecisionImageGrid.vue
Normal file
203
src/views/modules/talents/PrecisionImageGrid.vue
Normal file
@@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div class="penBoxListImages com_Img_box" style="width: 100%;height: 100%;">
|
||||
<!-- 这里替换 wx:key 为 vue 的 v-bind:key -->
|
||||
<el-image
|
||||
:key="index"
|
||||
v-for="(item, index) in imageList"
|
||||
|
||||
:src="item"
|
||||
:class="[
|
||||
'img_list',
|
||||
imageList.length === 1 ? 'com_Img_box_images1' : '',
|
||||
imageList.length === 2 ? 'com_Img_box_images2' : '',
|
||||
imageList.length === 3 ? 'com_Img_box_images3' : '',
|
||||
imageList.length === 4 ? 'com_Img_box_images4' : '',
|
||||
imageList.length === 5 ? 'com_Img_box_images5' : '',
|
||||
imageList.length === 6 ? 'com_Img_box_images6' : '',
|
||||
imageList.length === 7 ? 'com_Img_box_images7' : '',
|
||||
imageList.length === 8 ? 'com_Img_box_images8' : '',
|
||||
imageList.length === 9 ? 'com_Img_box_images9' : ''
|
||||
]"
|
||||
mode="aspectFill"
|
||||
:preview-src-list="imageList"
|
||||
>
|
||||
</el-image>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
// 图片地址列表
|
||||
imageList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => []
|
||||
},
|
||||
// 网格间距(rpx)
|
||||
gap: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
// 容器宽度占父元素比例
|
||||
containerRatio: {
|
||||
type: Number,
|
||||
default: 1 // 100%宽度
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 预览图片
|
||||
previewImage(index) {
|
||||
// uni.previewImage({
|
||||
// current: index,
|
||||
// urls: this.imageList,
|
||||
// loop: true
|
||||
// });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.com_Img_box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.com_Img_box_images1:nth-child(1) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.com_Img_box_images2 {
|
||||
width: 49%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.com_Img_box_images3 {
|
||||
width: 49%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.com_Img_box_images3:nth-child(2) {
|
||||
width: 49%;
|
||||
height: 49%;
|
||||
}
|
||||
|
||||
.com_Img_box_images3:nth-child(3) {
|
||||
width: 49%;
|
||||
height: 49%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.com_Img_box_images4 {
|
||||
width: 49%;
|
||||
height: 49%;
|
||||
}
|
||||
|
||||
.com_Img_box_images5 {
|
||||
width: 69%;
|
||||
height: 69%;
|
||||
}
|
||||
|
||||
.com_Img_box_images5:nth-child(2) {
|
||||
width: 28%;
|
||||
height: 69%;
|
||||
}
|
||||
|
||||
.com_Img_box_images5:nth-child(n + 3):nth-child(-n + 5) {
|
||||
width: 32%;
|
||||
height: 29%;
|
||||
}
|
||||
|
||||
.com_Img_box_images6 {
|
||||
width: 69%;
|
||||
height: 69%;
|
||||
}
|
||||
|
||||
.com_Img_box_images6:nth-child(2) {
|
||||
width: 29%;
|
||||
height: 34%;
|
||||
}
|
||||
|
||||
.com_Img_box_images6:nth-child(3) {
|
||||
width: 29%;
|
||||
height: 34%;
|
||||
position: absolute;
|
||||
bottom: 29%;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.com_Img_box_images6:nth-child(n + 4):nth-child(-n + 5) {
|
||||
width: 34%;
|
||||
height: 29%;
|
||||
}
|
||||
|
||||
.com_Img_box_images6:nth-child(6) {
|
||||
width: 29%;
|
||||
height: 29%;
|
||||
}
|
||||
|
||||
.com_Img_box_images7 {
|
||||
width: 32%;
|
||||
height: 69%;
|
||||
}
|
||||
|
||||
.com_Img_box_images7:nth-child(3) {
|
||||
width: 32%;
|
||||
height: 34%;
|
||||
}
|
||||
|
||||
.com_Img_box_images7:nth-child(4) {
|
||||
width: 32%;
|
||||
height: 34%;
|
||||
position: absolute;
|
||||
bottom: 29%;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.com_Img_box_images7:nth-child(n + 5):nth-child(-n + 7) {
|
||||
width: 32%;
|
||||
height: 29%;
|
||||
}
|
||||
|
||||
.com_Img_box_images8 {
|
||||
width: 32%;
|
||||
height: 69%;
|
||||
}
|
||||
|
||||
.com_Img_box_images8:nth-child(n + 2):nth-child(-n + 3) {
|
||||
width: 32%;
|
||||
height: 34%;
|
||||
}
|
||||
|
||||
.com_Img_box_images8:nth-child(4) {
|
||||
width: 32%;
|
||||
height: 34%;
|
||||
position: absolute;
|
||||
right: 33%;
|
||||
bottom: 29%;
|
||||
}
|
||||
|
||||
.com_Img_box_images8:nth-child(5) {
|
||||
width: 32%;
|
||||
height: 34%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 29%;
|
||||
}
|
||||
|
||||
.com_Img_box_images8:nth-child(n + 6):nth-child(-n + 8) {
|
||||
width: 32%;
|
||||
height: 29%;
|
||||
}
|
||||
|
||||
.com_Img_box_images9 {
|
||||
width: 32%;
|
||||
height: 32%;
|
||||
}
|
||||
</style>
|
||||
721
src/views/modules/talents/talents-articleList.vue
Normal file
721
src/views/modules/talents/talents-articleList.vue
Normal file
@@ -0,0 +1,721 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<el-form-item label="姓名">
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="dataForm.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标题">
|
||||
<el-input
|
||||
size="small"
|
||||
v-model="dataForm.title"
|
||||
placeholder="请输入标题"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
size="small"type="primary"
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList();
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button size="small" @click="this.resetForm()"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="序号" type="index" align="center" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="用户信息" align="center" width="120">
|
||||
<template slot-scope="scope">{{ scope.row.taihuTalent.name }}</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="文章标题" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.title
|
||||
}}<span
|
||||
v-if="scope.row.come == 1"
|
||||
style="color: #5188e5;margin-left: 20px;"
|
||||
>[医案]</span
|
||||
></template
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="文章状态" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
size="mini"
|
||||
:value="scope.row.showFlag"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
|
||||
active-text="上架"
|
||||
@change="e=>editHandle(scope.row,e)"
|
||||
|
||||
inactive-text="下架">
|
||||
</el-switch>
|
||||
<!-- <el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="editHandle(scope.row, 1)"
|
||||
v-if="scope.row.showFlag == 0"
|
||||
>恢复</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="editHandle(scope.row, 0)"
|
||||
v-if="scope.row.showFlag == 1 && scope.row.come == 0"
|
||||
style="color: #918f8f;"
|
||||
>下架</el-button
|
||||
> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="图片" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<PrecisionImageGrid
|
||||
v-if="scope.row.img"
|
||||
:imageList="scope.row.img.split(',')"
|
||||
style="
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
|
||||
|
||||
"
|
||||
/>
|
||||
<p v-else>暂无图片</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="创建时间" align="center" width="160">
|
||||
<template slot-scope="scope">{{ scope.row.createTime }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
width="120"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<!-- <router-link
|
||||
:to="{
|
||||
path: '/courses-list',
|
||||
query: { id: scope.row.id }
|
||||
}"
|
||||
> -->
|
||||
<el-button type="text" size="small" @click="detailHandle(scope.row)"
|
||||
>详情</el-button
|
||||
>
|
||||
|
||||
<!-- </router-link> -->
|
||||
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row)"
|
||||
v-if="scope.row.come == 0"
|
||||
style="color: #eb5c5c;"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<el-dialog
|
||||
v-if="addOrUpdateVisible"
|
||||
:visible.sync="addOrUpdateVisible"
|
||||
:title="titlesub"
|
||||
class="dialog_box"
|
||||
@close="cancleClose"
|
||||
width="1000px"
|
||||
>
|
||||
<p
|
||||
style="font-size: 20px;font-weight: 700;margin-top:-20px;margin-bottom: 20px;"
|
||||
>
|
||||
{{ addForm.title }}
|
||||
</p>
|
||||
|
||||
<div class="detail_info_medical" v-html="addForm.content"></div>
|
||||
|
||||
<el-image
|
||||
v-if="addForm.img && addForm.img != ''"
|
||||
:key="index"
|
||||
class="el-upload-list__item-thumbnail"
|
||||
v-for="(item, index) in addForm.img.split(',')"
|
||||
:style="
|
||||
addForm.img.split(',').length == 1
|
||||
? 'width: 600px;height:auto;border-radius: 2px;margin: 0 20px 20px 0;'
|
||||
: 'width: 300px;height:300px;border-radius: 2px;margin: 0 20px 20px 0;'
|
||||
"
|
||||
:src="item"
|
||||
:preview-src-list="addForm.img.split(',')"
|
||||
>
|
||||
</el-image>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancleClose" size="small">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import global from "../../common/common.vue"; //引入共用组间
|
||||
import debounce from "lodash/debounce"; //导入lodash中的debounce
|
||||
import PrecisionImageGrid from "./PrecisionImageGrid.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selecDepartmentList: [],
|
||||
baseUrl: global.baseUrl,
|
||||
dataForm: {
|
||||
name: "",
|
||||
title: ""
|
||||
},
|
||||
addForm: {},
|
||||
departmentList: [],
|
||||
editId: "",
|
||||
addFormRule: {
|
||||
tel: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入手机号/邮箱"
|
||||
}
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入姓名"
|
||||
}
|
||||
]
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
fileList: [],
|
||||
statusType: 0,
|
||||
dialogVisible: false,
|
||||
dataListLoading: false,
|
||||
addOrUpdateVisible: false,
|
||||
titlesub: "",
|
||||
|
||||
current: 1,
|
||||
limit: 10,
|
||||
|
||||
// 选择的值
|
||||
selectedCountry: "",
|
||||
selectedProvince: "",
|
||||
selectedCity: "",
|
||||
|
||||
// 加载状态
|
||||
countryLoading: false,
|
||||
provinceLoading: false,
|
||||
cityLoading: false,
|
||||
|
||||
// 数据存储
|
||||
countries: [],
|
||||
provinces: [],
|
||||
cities: [],
|
||||
chinaStatus: false,
|
||||
selectCode: null,
|
||||
selectedProvId: null,
|
||||
changeStatus: false,
|
||||
urlList: {
|
||||
saveShop: "/master/taihuTalent/bindCourseAndTalent",
|
||||
hasBindProductList: "/master/taihuTalent/getCourseListForTalent",
|
||||
CanBindProductList: "/master/taihuTalent/getCourseListCanTalent"
|
||||
}
|
||||
};
|
||||
},
|
||||
components: { PrecisionImageGrid },
|
||||
activated() {
|
||||
this.getDepartmentList();
|
||||
this.getDataList();
|
||||
},
|
||||
mounted() {
|
||||
this.getDepartmentList();
|
||||
},
|
||||
methods: {
|
||||
detailHandle(data) {
|
||||
console.log("data at line 394:", data);
|
||||
this.addOrUpdateVisible = true;
|
||||
this.titlesub = `文章详情`;
|
||||
this.addForm = { ...data };
|
||||
},
|
||||
resetForm() {
|
||||
this.dataForm = {
|
||||
name: "",
|
||||
title: ""
|
||||
};
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
getDepartmentList() {
|
||||
// this.dataListLoading = true;
|
||||
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
"/master/medicalRecords/getMedicalRecordsLabelList"
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.departmentList = data.Medicals;
|
||||
} else {
|
||||
this.departmentList = [];
|
||||
}
|
||||
});
|
||||
},
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalentArticle/getArticleList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
current: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
name: this.dataForm.name,
|
||||
title: this.dataForm.title
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.records;
|
||||
this.total = data.page.total;
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
loadAll(queryString, cb) {
|
||||
if (queryString == "") {
|
||||
return false;
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/user/getUserList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
page: 1,
|
||||
limit: 9999,
|
||||
key: queryString
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
var arr = data.user.records;
|
||||
cb(arr);
|
||||
} else {
|
||||
cb([]);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSelect(item) {
|
||||
console.log(item);
|
||||
this.addForm.tel = item.tel;
|
||||
this.addForm.userId = item.id;
|
||||
},
|
||||
//新增
|
||||
addHandle() {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.titlesub = "新增";
|
||||
this.statusType = 0; //新增
|
||||
|
||||
this.changeStatus = true;
|
||||
this.chinaStatus = false;
|
||||
this.selectCode = null;
|
||||
this.selectedProvId = null;
|
||||
this.selectedCity = "";
|
||||
|
||||
this.selectCode = null;
|
||||
this.selectedProvId = null;
|
||||
this.selectedCity = "";
|
||||
this.fileList = [];
|
||||
this.stopLoad = false;
|
||||
this.addForm = {
|
||||
tel: "",
|
||||
name: "",
|
||||
title: "",
|
||||
department: "",
|
||||
specialty: "",
|
||||
region: "",
|
||||
reservation: "",
|
||||
introduce: "",
|
||||
clinic: "",
|
||||
icon: ""
|
||||
};
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormRef.clearValidate();
|
||||
});
|
||||
},
|
||||
//点击确定
|
||||
addOrEditCate() {
|
||||
//如果是中国 城市必选
|
||||
if (this.chinaStatus) {
|
||||
if (!this.selectedCity) {
|
||||
this.$message({
|
||||
message: "请选择城市",
|
||||
type: "warning"
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.addForm.department.length == 0) {
|
||||
this.$message({
|
||||
message: "请选择科室",
|
||||
type: "warning"
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
if (this.statusType == 0) {
|
||||
//如果是新增
|
||||
this.addCate();
|
||||
} else if (this.statusType == 1) {
|
||||
//如果是修改
|
||||
this.editCate(this.addForm);
|
||||
}
|
||||
},
|
||||
addCate() {
|
||||
console.log("this.addForm at line 490:", this.addForm);
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = "";
|
||||
var region = "";
|
||||
if (this.fileList && this.fileList.length > 0) {
|
||||
icon = this.fileList[0].url;
|
||||
}
|
||||
if (this.selectedCountry) {
|
||||
if (!this.selectedProvince) {
|
||||
region = this.selectedCountry;
|
||||
} else {
|
||||
region = this.selectedProvince + this.selectedCity;
|
||||
}
|
||||
}
|
||||
const department = Array.isArray(this.addForm.department)
|
||||
? this.addForm.department[this.addForm.department.length - 1]
|
||||
: this.addForm.department;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalent/addTaihuTalent"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
userId: this.addForm.userId,
|
||||
name: this.addForm.name,
|
||||
title: this.addForm.title,
|
||||
deptLabelId: department,
|
||||
specialty: this.addForm.specialty,
|
||||
region: region,
|
||||
reservation: this.addForm.reservation,
|
||||
introduce: this.addForm.introduce,
|
||||
clinic: this.addForm.clinic,
|
||||
icon: icon
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
this.dataList = [];
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
editCate(data) {
|
||||
console.log("data at line 524:", data);
|
||||
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = "";
|
||||
var region = "";
|
||||
if (this.fileList && this.fileList.length > 0) {
|
||||
icon = this.fileList[0].url;
|
||||
}
|
||||
if (this.selectedCountry) {
|
||||
if (!this.selectedProvince) {
|
||||
region = this.selectedCountry;
|
||||
} else {
|
||||
region = this.selectedProvince + this.selectedCity;
|
||||
}
|
||||
}
|
||||
const department = Array.isArray(data.department)
|
||||
? data.department[data.department.length - 1]
|
||||
: data.department;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalent/updateTaihuTalent"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
title: data.title,
|
||||
deptLabelId: department,
|
||||
specialty: data.specialty,
|
||||
region: region ? region : data.region,
|
||||
reservation: data.reservation,
|
||||
introduce: data.introduce,
|
||||
clinic: data.clinic,
|
||||
icon: icon
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
this.dataList = [];
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//修改地域
|
||||
changeCountry() {
|
||||
this.changeStatus = true;
|
||||
this.chinaStatus = false;
|
||||
this.selectCode = null;
|
||||
this.selectedProvId = null;
|
||||
},
|
||||
//取消
|
||||
cancleClose() {
|
||||
this.addOrUpdateVisible = false;
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
//操作
|
||||
//点击修改
|
||||
editHandle(data, type) {
|
||||
console.log('type at line 531:', type)
|
||||
|
||||
console.log("data at line 522:", data);
|
||||
this.$confirm(`确定${type==0 ? "下架" : "上架"}该文章吗?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalentArticle/editArticle"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: data.id,
|
||||
showFlag: type
|
||||
})
|
||||
})
|
||||
.then(({ data }) => {
|
||||
if (data.code == 0) {
|
||||
|
||||
this.getDataList();
|
||||
}
|
||||
})
|
||||
.catch(({ e }) => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
//点击删除
|
||||
deleteHandle(data) {
|
||||
this.$confirm("确定删除该文章吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalentArticle/delArticle"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: data.id
|
||||
})
|
||||
})
|
||||
.then(({ data }) => {
|
||||
if (data.code == 0) {
|
||||
this.$message.success("删除成功");
|
||||
this.getDataList();
|
||||
}
|
||||
})
|
||||
.catch(({ e }) => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
//上传图片
|
||||
handlePreview(file) {
|
||||
this.fileList = [];
|
||||
this.addForm.icon = file.url;
|
||||
this.fileList.push({
|
||||
url: file.url
|
||||
});
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
//图片上传成功
|
||||
handleSuccess(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.fileList.push({
|
||||
url: res.url
|
||||
});
|
||||
this.$message.success("图片上传成功");
|
||||
} else {
|
||||
this.$message.error("图片上传失败");
|
||||
}
|
||||
},
|
||||
//图片删除操作
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep.custom-height {
|
||||
height: 370px;
|
||||
}
|
||||
.avatar-uploader {
|
||||
height: 1px;
|
||||
}
|
||||
.general_editor {
|
||||
height: 420px;
|
||||
width: 1060px !important;
|
||||
}
|
||||
.editor_form {
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.dialog_box {
|
||||
.el-form-item__content {
|
||||
width: calc(100% - 120px) !important;
|
||||
}
|
||||
.form_item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.el-form-item {
|
||||
width: 290px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.checkbox-group .el-checkbox {
|
||||
margin-left: 0;
|
||||
margin-right: 20px;
|
||||
|
||||
.el-checkbox__label {
|
||||
padding-left: 6px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.hufen_block {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span {
|
||||
width: 70px;
|
||||
display: inline-block;
|
||||
}
|
||||
.el-input {
|
||||
width: 90%;
|
||||
line-height: 34px;
|
||||
}
|
||||
.el-input__inner {
|
||||
width: 220px;
|
||||
height: 30px;
|
||||
line-height: 34px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.el-input__inner::placeholder {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.custom-flatpickr .el-range-input {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
::v-deep.el-form-item__label {
|
||||
width: 110px;
|
||||
}
|
||||
.editBtn {
|
||||
margin-left: 10px;
|
||||
width: 70px;
|
||||
border-color: #17b3a3;
|
||||
color: #17b3a3;
|
||||
}
|
||||
|
||||
.addFormBox {
|
||||
overflow: hidden;
|
||||
|
||||
.form_item {
|
||||
width: 33%;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
/deep/ .detail_info_medical {
|
||||
margin-bottom: 40px;
|
||||
li {
|
||||
line-height: 24px !important;
|
||||
}
|
||||
ul {
|
||||
margin: 0 !important;
|
||||
list-style-type: disc !important; /* 强制使用实心圆点 */
|
||||
}
|
||||
p {
|
||||
margin: 0 !important;
|
||||
}
|
||||
h1 {
|
||||
margin: 0 !important;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
282
src/views/modules/talents/talents-commontList.vue
Normal file
282
src/views/modules/talents/talents-commontList.vue
Normal file
@@ -0,0 +1,282 @@
|
||||
<template>
|
||||
<div style="width: 100%;height: 100%;">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="query"
|
||||
@keyup.enter.native="getList()"
|
||||
style="position: relative;"
|
||||
>
|
||||
<el-form-item label="评论内容">
|
||||
<el-input size="small"
|
||||
style="width: 100%;"
|
||||
v-model="query.content"
|
||||
placeholder="请输入评论内容"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户信息">
|
||||
<el-input
|
||||
style="width: 100%;"
|
||||
v-model="query.userInfo"
|
||||
placeholder="请输入用户 姓名 / 电话 / 邮箱"
|
||||
size="small"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="width: 200px;">
|
||||
<el-button
|
||||
size="small" type="primary"
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getList();
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button size="small" @click="resetForm()"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<!-- <el-button
|
||||
v-if="tableData.length > 0"
|
||||
style="position: absolute;right: 0;"
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="deleteHandle('all')"
|
||||
>批量删除</el-button
|
||||
> -->
|
||||
<!-- <el-button type="text"
|
||||
@click="changeDefalutExpand()"
|
||||
style="position: absolute;right: 0;"
|
||||
:style="`color:${defaultExpand?'#17B3A3':'#333'}`"
|
||||
>{{ !defaultExpand ? "收起" : "展开" }}全部评论
|
||||
<i class="el-icon-s-comment" ></i
|
||||
></el-button> -->
|
||||
</el-form>
|
||||
|
||||
<!-- -->
|
||||
<el-table
|
||||
size="mini"
|
||||
row-key="id"
|
||||
v-if="refreshTable"
|
||||
:default-expand-all="defaultExpand"
|
||||
:data="tableData"
|
||||
style="width: 100%"
|
||||
height="70vh"
|
||||
@selection-change="handleSelectionChange"
|
||||
:default-sort="{ prop: 'date', order: 'descending' }"
|
||||
>
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column
|
||||
fixed
|
||||
prop="createTime"
|
||||
label="日期"
|
||||
width="200"
|
||||
sortable
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="120">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tooltip placement="top" v-if="scope.row.user">
|
||||
<div slot="content">
|
||||
<div>
|
||||
<p v-if="scope.row.user.nickname">
|
||||
昵称:{{ scope.row.user.nickname }}
|
||||
</p>
|
||||
<p v-if="scope.row.user.name">
|
||||
姓名:{{ scope.row.user.name }}
|
||||
</p>
|
||||
<p v-if="scope.row.user.email">
|
||||
邮箱:{{ scope.row.user.email }}
|
||||
</p>
|
||||
<p v-if="scope.row.user.tel">
|
||||
手机号:{{ scope.row.user.tel }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="avatar">
|
||||
<img
|
||||
:src="scope.row.user ? scope.row.user.avatar : ''"
|
||||
alt=""
|
||||
v-if="scope.row.user && scope.row.user.avatar"
|
||||
/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
|
||||
<div class="avatar" v-else></div>
|
||||
|
||||
<span></span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="content" label="评论内容">
|
||||
<template slot-scope="scope">
|
||||
<div v-html="scope.row.content" style="font-size: 14px !important;"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="60">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
style="color: red;cursor: pointer;"
|
||||
@click="deleteHandle('one', scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
style="padding: 0 0; text-align: center;"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ["courseId"],
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
selectData: [],
|
||||
query: {
|
||||
content: "",
|
||||
userInfo:""
|
||||
},
|
||||
pageIndex: 1,
|
||||
defaultExpand: false,
|
||||
refreshTable: true,
|
||||
pageSize: 10,
|
||||
totalPage: 0
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(data) {
|
||||
console.log("data at line 141:", data);
|
||||
this.selectData = data;
|
||||
},
|
||||
changeDefalutExpand() {
|
||||
this.refreshTable = false;
|
||||
this.$nextTick(() => {
|
||||
this.refreshTable = true;
|
||||
this.defaultExpand = !this.defaultExpand;
|
||||
});
|
||||
this.$forceUpdate();
|
||||
},
|
||||
resetForm() {
|
||||
this.query = {
|
||||
content: "",
|
||||
userInfo: ""
|
||||
};
|
||||
this.pageIndex = 1;
|
||||
this.getList();
|
||||
},
|
||||
init() {
|
||||
this.getList();
|
||||
},
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
"/master/taihuTalentArticle/getCommentList"
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
limit: this.pageSize,
|
||||
current: this.pageIndex,
|
||||
|
||||
content: this.query.content, //内容
|
||||
userInfo: this.query.userInfo, //内容
|
||||
})
|
||||
}).then(res => {
|
||||
console.log("res at line 68:", res);
|
||||
|
||||
if (res.data.code == 0 && res.data.page.records.length > 0) {
|
||||
this.tableData = res.data.page.records ? res.data.page.records : [];
|
||||
this.totalPage = res.data.page.total;
|
||||
this.$forceUpdate();
|
||||
} else {
|
||||
this.tableData = [];
|
||||
this.totalPage = 0;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
// console.log(row, "row" , res.data.resList,this.resList);
|
||||
});
|
||||
},
|
||||
|
||||
deleteHandle(type, id) {
|
||||
if (type == "all") {
|
||||
if (this.selectData.length == 0) {
|
||||
this.$message.error("请至少选择一条评论");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.$confirm(`请确认是否${type == "all" ? "批量" : ""}删除?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
var ids = this.selectData.map(e => e.id).join(",");
|
||||
console.log("ids at line 205:", ids);
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
`/master/taihuTalentArticle/delComment`
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: type == "all" ? ids : id
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
|
||||
}
|
||||
}); this.getList();
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 40px;
|
||||
overflow: hidden;
|
||||
background-color: #f0f0f0;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user