This commit is contained in:
Air 2024-08-19 18:14:28 +08:00
parent 09c561c845
commit 9a653fb891
4 changed files with 996 additions and 559 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,161 @@
<template>
<t-card :bordered="false">
<div class="form-step-container">
<t-tabs v-model="state" @change="tabIndexChange">
<t-tab-panel :value="1" label="待审核" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="2" label="已通过" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="3" label="已拒绝" :destroyOnHide="false"></t-tab-panel>
</t-tabs>
<t-table
rowKey="index"
:data="list"
:columns="columns"
:stripe="false"
:bordered="false"
:hover="true"
size="large"
table-layout="auto"
cellEmptyContent="-"
:pagination="pagination"
>
<template #tweet="{ row }">
<div>{{row.tweet.title}}</div>
</template>
<template #member_info="{ row }">
<div>{{row.member.nikename}}</div>
</template>
<template #status="{ row }">
<t-tag v-if="row.status==1" theme="primary">待审核</t-tag>
<t-tag v-if="row.status==2" theme="success">已发布</t-tag>
<t-tag v-if="row.status==3" theme="danger">已拒绝</t-tag>
</template>
<template #select="{ row }">
<t-space :size="0">
<t-popconfirm v-if="row.status==1" content="确定要审核通过吗?" @confirm="review(row,1)">
<t-button theme="primary">通过</t-button>
</t-popconfirm>
<t-popconfirm v-if="row.status==1" theme="danger" @confirm="review(row,2)">
<template slot="content">
<p class="title">拒绝理由</p>
<p class="describe" style="margin-top: 10px">
<t-input v-model="reason" placeholder="请输入拒绝理由"/>
</p>
</template>
<t-button theme="warning" style="margin: 0px 10px">拒绝</t-button>
</t-popconfirm>
<!-- <t-popconfirm content="确认删除吗?" @confirm="del(row)">-->
<!-- <t-button theme="danger">删除</t-button>-->
<!-- </t-popconfirm>-->
</t-space>
</template>
</t-table>
<div style="margin-top: 30px">
<t-pagination
:total="pagination.total"
:page-size="pagination.size"
@current-change="onCurrentChange"
:showPageSize="false"
></t-pagination>
</div>
</div>
</t-card>
</template>
<script lang="ts">
import store from "@/store";
export default {
data() {
return {
state: 1,
list: [],
reason:'',
columns: [
{colKey: 'tweet', title: '帖子标题', align: 'center'},
{colKey: 'content', title: '评论内容', align: 'center'},
{colKey: 'member_info', title: '发布者', align: 'center'},
{colKey: 'createtime', title: '评论时间', align: 'center'},
{colKey: 'status', title: '状态', align: 'center'},
{colKey: 'select', title: '操作', width: 200},
],
pagination: {
page: 1,
size: 10,
total: 0,
},
}
},
mounted() {
//this.member_id=this.$route.query.id;
if(typeof (store.state.user.association)=='object'){
this.association=store.state.user.association;
}else{
this.association=JSON.parse(store.state.user.association);
}
this.getList();
//this.getGory();
},
methods: {
tabIndexChange(index){
this.state=index;
this.pagination.page=1;
this.list=[];
this.getList();
},
review(d,type){
console.log(d);
this.$request
.post('/tweet_comments/review', {id: d.id,status:type,reason:this.reason,member_id:d.member_id})
.then((res) => {
if (res.code == 1) {
this.$message.success(res.msg);
this.getList();
} else {
this.$message.error(res.msg);
}
console.log(res);
})
.catch((e) => {
console.log(e);
});
},
del(d) {
console.log(d);
this.$request
.post('/tweets/destroy', {id: d.id})
.then((res) => {
if (res.code == 1) {
this.$message.success('删除成功!');
this.pagination.page=1;
this.getList();
} else {
this.$message.error(res.msg);
}
console.log(res);
})
.catch((e) => {
console.log(e);
});
},
onCurrentChange(d){
this.page=d;
this.getList();
},
getList() {
this.$request
.post("/tweet_comments/index", {state:this.state,page: this.pagination.page, size: this.pagination.size})
.then((res) => {
console.log(res);
if (res.code == 1) {
this.list = res.data.data;
this.pagination.total = res.data.total;
}
})
.catch((e) => {
console.log(e);
});
},
}
}
</script>

View File

@ -10,9 +10,9 @@
<t-form-item label="手机号" name="phone" :requiredMark="true">
<t-input v-model="formData.phone" placeholder="请输入手机号"></t-input>
</t-form-item>
<t-form-item label="密码" name="password">
<t-input v-model="formData.password" placeholder="请输入密码"></t-input>
</t-form-item>
<!-- <t-form-item label="密码" name="password">-->
<!-- <t-input v-model="formData.password" placeholder="请输入密码"></t-input>-->
<!-- </t-form-item>-->
<t-form-item label="职位" name="position_id">
<t-select v-model="formData.position_id" :style="{ width: '200px' }">
<t-option v-for="(item,index) in plan_list" :label="item.position_name" :value="item.id"></t-option>
@ -24,10 +24,10 @@
</t-select>
</t-form-item>
<t-form-item label="区域" name="region_id">
<!-- <t-select v-model="formData.region_id" :style="{ width: '200px' }">-->
<!-- <t-option v-for="(item,index) in region_list" :label="item.region_name" :value="item.id"></t-option>-->
<!-- </t-select>-->
<t-cascader v-model="formData.region_id" :options="region_list" clearable @change="onChange"></t-cascader>
<!-- <t-select v-model="formData.region_id" :style="{ width: '200px' }">-->
<!-- <t-option v-for="(item,index) in region_list" :label="item.region_name" :value="item.id"></t-option>-->
<!-- </t-select>-->
<t-cascader v-model="formData.region_id" :options="region_list" @change="onChange"></t-cascader>
</t-form-item>
</t-form>
</div>
@ -43,8 +43,8 @@
<t-form-item label="性别" name="gender">
<t-select v-model="formData.gender" :style="{ width: '200px' }">
<t-option key="0" label="女" value="0"></t-option>
<t-option key="1" label="男" value="1"></t-option>
<t-option :key="0" label="女" :value="0"></t-option>
<t-option :key="1" label="男" :value="1"></t-option>
</t-select>
</t-form-item>
<t-form-item label="民族" name="nation">
@ -111,8 +111,10 @@
<t-form-item label="形象照">
<div class="t-upload" @click="openCai">
<div class="t-upload__card-container" style="cursor: pointer">
<img :src="$store.state.user.apiUrl+formData.photo_image" style="width: 110px;height: 110px;" v-if="formData.photo_image!=''">
<svg fill="none" viewBox="0 0 24 24" width="1em" height="1em" class="t-icon t-icon-add" v-if="formData.photo_image==''">
<img :src="$store.state.user.apiUrl+formData.photo_image" style="width: 110px;height: 110px;"
v-if="formData.photo_image!=''">
<svg fill="none" viewBox="0 0 24 24" width="1em" height="1em" class="t-icon t-icon-add"
v-if="formData.photo_image==''">
<path fill="currentColor" d="M13 4v7h7v2h-7v7h-2v-7H4v-2h7V4h2z"></path>
</svg>
<p class="t-size-s t-upload__add-text" v-if="formData.photo_image==''">点击上传图片</p>
@ -272,7 +274,7 @@
<t-dialog header="图片上传" :visible="caiMode" width="40%" top="20px" :onClose="onCloseMy" @confirm="onSubmit">
<div class="cropper-content">
<div class="cropper">
<vueCropper
<vue-cropper
ref="cropper"
:img="caiImg"
:canMoveBox="false"
@ -288,7 +290,7 @@
@imgLoad="imgLoad"
:fixed="true"
:fixedNumber="[1,1]"
></vueCropper>
></vue-cropper>
</div>
<div class="show-preview"
:style="{'width': previews.w + 'px', 'height': previews.h + 'px', 'overflow': 'hidden', 'margin': '5px'}">
@ -308,8 +310,7 @@
</div>
</template>
<script lang="ts">
import {UserIcon, LockOnIcon} from 'tdesign-icons-vue';
import {CheckCircleIcon} from 'tdesign-icons-vue';
import {UserIcon, LockOnIcon,CheckCircleIcon} from 'tdesign-icons-vue';
import store from '@/store';
import {VueCropper} from 'vue-cropper';
import axios from 'axios';
@ -326,7 +327,7 @@ export default {
caiMode: false,
previews: {},
caiImg: '',
association:{},
association: {},
formData: {
phone: '',
password: '',
@ -384,24 +385,24 @@ export default {
documents_file_show: [],
introduction: '',
enterprise_name: '',
company_image:'',
company_image_show:[],
region_id:null,
company_image: '',
company_image_show: [],
region_id: null,
},
id: 0,
info: '',
plan_list: [],
region_list:[],
region_list: [],
industry_list: []
};
},
mounted() {
if(typeof (store.state.user.association)=='object'){
this.association=store.state.user.association;
}else{
this.association=JSON.parse(store.state.user.association);
if (typeof (store.state.user.association) === 'object') {
this.association = store.state.user.association;
} else {
this.association = JSON.parse(store.state.user.association);
}
console.log( this.association);
console.log(this.association);
this.id = this.$route.query.id;
this.getInfo();
this.getPlan();
@ -414,28 +415,28 @@ export default {
// do something
console.log(data)
console.log(this.caiImg);
let formData = new FormData();
const formData = new FormData();
formData.append('file', data, 'image.jpg');
formData.append('association_id', this.association.association_id);
console.log(formData);
axios.post(store.state.user.apiUrl + '/api/common/upload', formData, {
axios.post(`${store.state.user.apiUrl }/api/common/upload`, formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(response => {
console.log(response);
var data=response.data;
if(data.code==1){
this.formData.photo_image=data.data.url;
this.$message.success('图片上传成功!');
this.caiMode=false;
this.caiImg='';
this.$refs.cropper.stopCrop();
this.$refs.cropper.clearCrop();
}else{
this.$message.error('图片上传失败!');
}
console.log(response);
const {data} = response;
if (data.code == 1) {
this.formData.photo_image = data.data.url;
this.$message.success('图片上传成功!');
this.caiMode = false;
this.caiImg = '';
this.$refs.cropper.stopCrop();
this.$refs.cropper.clearCrop();
} else {
this.$message.error('图片上传失败!');
}
})
.catch(error => {
console.error('文件上传失败', error);
@ -453,14 +454,14 @@ export default {
this.previews = data
},
uploadImg(e, num) {
//
//
// this.option.img
var file = e.target.files[0]
const file = e.target.files[0]
if (!/\.(gif|jpg|jpeg|png|bmp|GIF|JPG|PNG)$/.test(e.target.value)) {
alert('图片类型必须是.gif,jpeg,jpg,png,bmp中的一种')
return false
}
var reader = new FileReader()
const reader = new FileReader()
reader.onload = (e) => {
let data
if (typeof e.target.result === 'object') {
@ -493,27 +494,31 @@ export default {
this.formData.cardf_image = res.data.url;
} else if (type == 3) {
this.formData.business_license_image = res.data.url;
} else if(type==4){
} else if (type == 4) {
this.formData.documents_file = res.data.url;
}else{
} else {
this.formData.company_image = res.data.url;
}
return {url: res.data.fullurl};
},
getRegion() {
this.$request
.post("/region")
.then((res) => {
console.log(res);
if (res.code == 1) {
this.region_list = res.data;
}
})
.catch((e) => {
console.log(e);
});
},
getRegion() {
this.$request
.post("/region")
.then((res) => {
console.log(res);
if (res.code == 1) {
this.region_list = res.data;
}
})
.catch((e) => {
console.log(e);
});
},
onChange(val, context) {
console.log(val, context);
console.log('path: ', context.node.getPath());
},
getIndustry() {
this.$request
.post("/industry")
@ -562,7 +567,7 @@ getRegion() {
this.formData.education = res.data.education;
this.formData.academic_degree = res.data.academic_degree;
this.formData.card_number = res.data.card_number;
//this.formData.work_unit = res.data.work_unit;
// this.formData.work_unit = res.data.work_unit;
this.formData.unit_position = res.data.unit_position;
this.formData.wx_number = res.data.wx_number;
this.formData.mailbox = res.data.mailbox;
@ -748,7 +753,6 @@ getRegion() {
// }
this.formData.member_id = this.id;
console.log(this.formData);
return;
this.$request
.post("/member/update", this.formData)
.then((res) => {

View File

@ -99,6 +99,11 @@ export default [
name: 'tweetsIndex',
component: () => import('@/pages/tweets/index.vue'),
meta: {title: '内容列表'},
}, {
path: 'pl_index',
name: 'tweetsPlIndex',
component: () => import('@/pages/tweets/pl_index.vue'),
meta: {title: '评论列表'},
},
],
},