| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <template>
- <div v-loading="loading">
- <el-form class="search" label-width="90px" inline>
- <el-form-item label="名称">
- <el-input size="small" v-model="search.name"></el-input>
- </el-form-item>
- <el-form-item label="副标题">
- <el-input size="small" v-model="search.sub_title"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button size="small" @click="search_" type="primary">搜索</el-button>
- </el-form-item>
- <el-form-item>
- <el-button size="small" @click="show_child_page('admin_category_add',{})" type="primary">添加标签</el-button>
- </el-form-item>
- </el-form>
- <el-table
- :data="list"
- style="width: 100%">
- <el-table-column prop="name" label="标签名称"></el-table-column>
- <el-table-column prop="sub_title" label="副标题"></el-table-column>
- <el-table-column prop="order" label="排序"></el-table-column>
- <el-table-column prop="works_num" label="作品数量"></el-table-column>
- <el-table-column fixed="right" width="100px" prop="act" label="操作">
- <template slot-scope="scope">
- <el-button type="primary" size="mini" @click="show_child_page('admin_category_add',{id:scope.row.id})">编辑标签</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- background
- style="margin-top: 10px"
- layout="total,prev, pager, next"
- :current-page="search.page"
- @current-change="page_event"
- :page-size="search.pagesize"
- :total="search.total">
- </el-pagination>
- <admin_category_add v-if="child_page.type=='admin_category_add'" :point="value" v-model="child_page.obj.id" :back="this"></admin_category_add>
- </div>
- </template>
- <script>
- import admin_category_add from '@/components/child_page/admin_category_add';
- export default {
- props: {
- value: {},
- },
- components: {admin_category_add},
- data() {
- return {
- loading:true,
- list: [],
- child_page:{
- type:"",
- obj:{}
- },
- search:{
- pagesize: 20,
- name:"",
- },
- }
- },
- mounted() {
- this.getList();
- },
- methods: {
- show_child_page(type,obj)
- {
- this.child_page.type=type;
- this.child_page.obj=obj;
- },
- page_event(page) {
- this.search.page = page;
- this.getList();
- },
- async search_() {
- this.search.page=1;
- this.getList();
- },
- async getList() {
- this.loading = true;
- let data=this.search;
- data.point=this.value-20;
- let res = await this.$post("/uapi/admin/pub/admin_category/list",data);
- if (res.status == 1) {
- this.list = res.data.list;
- this.search.total=res.data.total;
- }
- this.loading = false;
- },
- }
- }
- </script>
|