Commit 664f717f authored by Davve's avatar Davve

完善标签

parent 8654a4c3
......@@ -16,7 +16,7 @@ __pycache__/
env/
build/
develop-eggs/
dist/
# dist/
downloads/
.vscode
eggs/
......
......@@ -81,7 +81,6 @@ class GroupRelatedUser(APIView):
filters = {'group_id': id}
try:
data = self.rpc['venus/sun/group/user/list'](filters=filters, offset=offset, limit=count).unwrap()
print(data, '--------------')
except Exception as e:
raise e
return data
......
......@@ -12,7 +12,7 @@ class TagListView(APIView):
limit = int(request.GET.get('limit', 10))
filter = self.handle_filter(request.GET.get('filter', ""))
try:
data = self.rpc['venus/sun/tag/list'](offset=offset, limit=limit, filters=filter).unwrap()
data = self.rpc['venus/sun/tag/list'](offset=(offset-1) * limit, limit=limit, filters=filter).unwrap()
except Exception as e:
raise e
return data
......@@ -49,11 +49,15 @@ class TagUpdateOrCreateView(APIView):
def post(self, request):
id = request.POST.get('id')
print(type(request.POST.get('down_tags')))
down_tags = list(set(request.POST.get('down_tags').split(',')))
up_tags = list(set(request.POST.get('up_tags').split(',')))
data = {
'name': request.POST.get('name'),
'description': request.POST.get('description'),
'down_tag': list(set(request.POST.get('down_tags', '').split(','))),
'up_tag': list(set(request.POST.get('down_tags', '').split(','))),
'down_tags': list(filter(lambda x: x, down_tags)),
'up_tags': list(filter(lambda x: x, up_tags)),
}
try:
self.rpc['venus/sun/tag/edit'](id=id, data=data).unwrap()
......
......@@ -47,7 +47,7 @@ class UserUpdateOrCreate(APIView):
'phone': request.POST.get('phone'),
'email': request.POST.get('email'),
'gender': request.POST.get('gender'),
'group_ids': json.loads(request.POST.get('group_ids')),
# 'group_ids': json.loads(request.POST.get('group_ids')),
}
try:
......
......@@ -70,13 +70,13 @@ export const constantRouterMap = [
{
path: '',
component: Layout,
redirect: 'dashboard',
redirect: 'home',
children: [
{
path: 'dashboard',
path: 'home',
component: () => import('@/views/dashboard/index'),
name: 'Dashboard',
meta: { title: 'dashboard', icon: 'dashboard', noCache: true }
name: 'Home',
meta: { title: '首页', icon: 'dashboard', noCache: true }
}
]
},
......
<template>
<div class="dashboard-editor-container">
<div class=" clearfix">
<pan-thumb :image="avatar" style="float: left"> Your roles:
<span v-for="item in roles" :key="item" class="pan-info-roles">{{ item }}</span>
</pan-thumb>
<github-corner style="position: absolute; top: 0px; border: 0; right: 0;"/>
<div class="info-container">
<span class="display_name">{{ name }}</span>
<span style="font-size:20px;padding-top:20px;display:inline-block;">Editor's Dashboard</span>
</div>
</div>
<div>
<img :src="emptyGif" class="emptyGif">
</div>
</div>
</template>
......@@ -19,11 +13,10 @@
<script>
import { mapGetters } from 'vuex'
import PanThumb from '@/components/PanThumb'
import GithubCorner from '@/components/GithubCorner'
export default {
name: 'DashboardEditor',
components: { PanThumb, GithubCorner },
components: { PanThumb },
data() {
return {
emptyGif: 'https://wpimg.wallstcn.com/0e03b7da-db9e-4819-ba10-9016ddfdaed3'
......
......@@ -10,7 +10,7 @@ import adminDashboard from './admin'
import editorDashboard from './editor'
export default {
name: 'Dashboard',
name: 'Home',
components: { adminDashboard, editorDashboard },
data() {
return {
......
......@@ -16,7 +16,6 @@
<size-select class="international right-menu-item"/>
</el-tooltip>
<lang-select class="international right-menu-item"/>
<el-tooltip :content="$t('navbar.theme')" effect="dark" placement="bottom">
<theme-picker class="theme-switch right-menu-item"/>
</el-tooltip>
......@@ -56,7 +55,6 @@ import ErrorLog from '@/components/ErrorLog'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import ThemePicker from '@/components/ThemePicker'
import LangSelect from '@/components/LangSelect'
export default {
components: {
......@@ -66,7 +64,6 @@ export default {
Screenfull,
SizeSelect,
ThemePicker,
LangSelect
},
computed: {
...mapGetters([
......
......@@ -132,60 +132,60 @@
</div>
</el-card>
</el-row>
<el-row :gutter="20" style="margin-top:50px;">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>小组相关</span>
</div>
<div style="margin-bottom:50px;">
<div class="filter-container">
<el-select v-model="temp_group_ids" :remote-method="getRemoteGroupList" filterable remote
value-key="id"
placeholder="小组" style="width: 220px">
<el-option v-for="(item,index) in groupListOptions" :key="item+index" :label="item.id + ':' + item.name" :value="item.id"/>
</el-select>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-edit" @click="appendGroup">添加
</el-button>
</div>
<el-table :data="list" border fit highlight-current-row style="width: 100%"
ref="multipleTable">
<el-table-column align="center" label="小组ID">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="小组名称">
<template slot-scope="scope">
<span>{{ scope.row.group_name }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="小组简介">
<template slot-scope="scope">
<span>{{ scope.row.group_desc }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="组长">
<template slot-scope="scope">
<span>{{ scope.row.nick_name }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="帖子数">
<template slot-scope="scope">
<span>{{ scope.row.topic_nums }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="组内身份">
<template slot-scope="scope">
<span>{{ scope.row.group_identify }}</span>
</template>
</el-table-column>
<!--<el-row :gutter="20" style="margin-top:50px;">-->
<!--<el-card class="box-card">-->
<!--<div slot="header" class="clearfix">-->
<!--<span>小组相关</span>-->
<!--</div>-->
<!--<div style="margin-bottom:50px;">-->
<!--<div class="filter-container">-->
<!--<el-select v-model="temp_group_ids" :remote-method="getRemoteGroupList" filterable remote-->
<!--value-key="id"-->
<!--placeholder="小组" style="width: 220px">-->
<!--<el-option v-for="(item,index) in groupListOptions" :key="item+index" :label="item.id + ':' + item.name" :value="item.id"/>-->
<!--</el-select>-->
<!--<el-button v-waves class="filter-item" type="primary" icon="el-icon-edit" @click="appendGroup">添加-->
<!--</el-button>-->
<!--</div>-->
<!--<el-table :data="list" border fit highlight-current-row style="width: 100%"-->
<!--ref="multipleTable">-->
<!--<el-table-column align="center" label="小组ID">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.id }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="小组名称">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.group_name }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="小组简介">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.group_desc }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="组长">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.nick_name }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="帖子数">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.topic_nums }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column align="center" label="组内身份">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.group_identify }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
style="margin-left: 250px;" @pagination="getList"/>
</div>
</el-card>
</el-row>
<!--</el-table>-->
<!--<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"-->
<!--style="margin-left: 250px;" @pagination="getList"/>-->
<!--</div>-->
<!--</el-card>-->
<!--</el-row>-->
</div>
</el-form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment