|
|
@@ -1,21 +1,137 @@
|
|
|
<template>
|
|
|
<scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
|
|
|
<el-table-column type="selection" width="50" fixed="left"></el-table-column>
|
|
|
-
|
|
|
+ <el-table-column label="达人姓名" prop="truename" width="150"></el-table-column>
|
|
|
+ <el-table-column label="联系电话" prop="mobile" width="150"></el-table-column>
|
|
|
+ <el-table-column label="常驻城市" prop="city" width="150"></el-table-column>
|
|
|
+ <el-table-column label="性别" prop="truename" width="150">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-tag type="success" v-if="scope.row.sex==1">男</el-tag>
|
|
|
+ <el-tag type="danger" v-if="scope.row.sex==2">女</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="绑定平台" prop="city" minWidth="150">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="scope.row.platform.length == 0">-</span>
|
|
|
+ <div class="pm-flex" v-else>
|
|
|
+ <div class="pm-item" v-for="(item,index) in scope.row.platform" :key="index">
|
|
|
+ <el-image style="width: 20px;" :src="'img/'+item.source+'.png'"></el-image>
|
|
|
+ <span class="name">{{ item.source_name }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建时间" prop="create_at" width="150"></el-table-column>
|
|
|
+ <el-table-column label="状态" prop="status" align="center" width="150">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="status-warning" v-if="scope.row.status==0"><sc-status-indicator type="warning"></sc-status-indicator> 待审核</div>
|
|
|
+ <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 正常</div>
|
|
|
+ <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 禁用</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="200" align="left" fixed="right">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="success" size="small" @click="table_detail(scope.row)">平台</el-button>
|
|
|
+ <el-button size="small" @click="table_view(scope.row)">详情</el-button>
|
|
|
+ <el-button type="danger" size="small" @click="table_del(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</scTable>
|
|
|
+ <formMain ref="formMain" @success="handleSuccess"></formMain>
|
|
|
+ <detailMain ref="detailMain" @success="handleSuccess"></detailMain>
|
|
|
+ <platformMain ref="platformMain" @success="handleSuccess"></platformMain>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import formMain from './form';
|
|
|
+import detailMain from './detail';
|
|
|
+import platformMain from './platform';
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ formMain,detailMain,platformMain
|
|
|
+ },
|
|
|
data(){
|
|
|
return {
|
|
|
list: {
|
|
|
- apiObj: this.$API.article.list
|
|
|
+ apiObj: this.$API.expert.list
|
|
|
},
|
|
|
dataSelect:[],
|
|
|
dataSelectFull:[],
|
|
|
searchKey:{}
|
|
|
}
|
|
|
},
|
|
|
+ methods: {
|
|
|
+ table_detail(data){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.platformMain.open("edit").setData(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ table_auth(data){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.comboMain.open("edit").setData(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ table_view(data){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.detailMain.open("edit").setData(data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ table_del(data){
|
|
|
+ this.$confirm(`确定要执行删除吗`, '提示', {
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async ()=>{
|
|
|
+ var resp = await this.$API.task.del.post({"id":data.id});
|
|
|
+ if (resp.code == 0) {
|
|
|
+ return this.$message.error(resp.msg);
|
|
|
+ }
|
|
|
+ this.$message.success(resp.msg);
|
|
|
+ this.refresh()
|
|
|
+ }).catch(()=>{})
|
|
|
+ },
|
|
|
+ refresh(){
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ },
|
|
|
+ upData(data){
|
|
|
+ this.$refs.table.upData(data)
|
|
|
+ },
|
|
|
+ handleSuccess(){
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ },
|
|
|
+ sortChange(event){
|
|
|
+ if (event.order) {
|
|
|
+ var data = {
|
|
|
+ "field":event.prop,
|
|
|
+ "order":event.order
|
|
|
+ }
|
|
|
+ this.$refs.table.upData(data)
|
|
|
+ } else {
|
|
|
+ this.$refs.table.reload(this.searchKey)
|
|
|
+ }
|
|
|
+ return ;
|
|
|
+ },
|
|
|
+ selectionChange(event){
|
|
|
+ this.dataSelect = [];
|
|
|
+ var arr = [];
|
|
|
+ var arrCompany = [];
|
|
|
+ event.forEach(function(val,index){
|
|
|
+ arr[index] = val.id;
|
|
|
+ arrCompany[index] = val;
|
|
|
+ });
|
|
|
+ this.dataSelectFull = arrCompany;
|
|
|
+ this.dataSelect = arr;
|
|
|
+ this.$emit("success",this.dataSelect);
|
|
|
+ this.$emit("successFull",this.dataSelectFull);
|
|
|
+ },
|
|
|
+ table_passwd(row){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.userPasswd.open("edit").setData(row)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-</script>
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+.pm-flex{display: flex;align-items: center;gap: 10px;}
|
|
|
+.pm-flex .pm-item{display: flex;align-items: center;gap: 5px;}
|
|
|
+</style>
|