Browse Source

增加分类排序

master
taozi 5 years ago
parent
commit
52f6b038d0
  1. 11
      src/views/shop/cate/index.vue

11
src/views/shop/cate/index.vue

@ -24,6 +24,9 @@
<el-radio :label="0">隐藏</el-radio> <el-radio :label="0">隐藏</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 370px;" />
</el-form-item>
<el-form-item style="margin-bottom: 0;" label="上级分类" prop="pid"> <el-form-item style="margin-bottom: 0;" label="上级分类" prop="pid">
<treeselect v-model="form.pid" :options="depts" style="width: 370px;" placeholder="选择上级分类" /> <treeselect v-model="form.pid" :options="depts" style="width: 370px;" placeholder="选择上级分类" />
</el-form-item> </el-form-item>
@ -34,7 +37,7 @@
</div> </div>
</el-dialog> </el-dialog>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" default-expand-all :data="crud.data" row-key="id" @select="crud.selectChange" @select-all="crud.selectAllChange" @selection-change="crud.selectionChangeHandler"> <el-table ref="table" v-loading="crud.loading" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :data="crud.data" row-key="id" @select="crud.selectChange" @select-all="crud.selectAllChange" @selection-change="crud.selectionChangeHandler">
<el-table-column :selectable="checkboxT" type="selection" width="55" /> <el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column v-if="columns.visible('cateName')" label="名称" prop="cateName" /> <el-table-column v-if="columns.visible('cateName')" label="名称" prop="cateName" />
<el-table-column v-if="columns.visible('isShow')" label="状态" align="center" prop="isShow"> <el-table-column v-if="columns.visible('isShow')" label="状态" align="center" prop="isShow">
@ -45,7 +48,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="columns.visible('sort')" label="排序" prop="sort" /> <el-table-column v-if="columns.visible('sort')" label="排序" prop="sort" sortable/>
<el-table-column v-permission="['admin','cate:edit','cate:del']" label="操作" width="130px" align="center" fixed="right"> <el-table-column v-permission="['admin','cate:edit','cate:del']" label="操作" width="130px" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<udOperation <udOperation
@ -72,8 +75,8 @@ import picUpload from '@/components/pic-upload'
import MaterialList from '@/components/material' import MaterialList from '@/components/material'
// crudpresenter // crudpresenter
const defaultCrud = CRUD({ title: '分类', url: 'api/yxStoreCategory', crudMethod: { ...crudDept }}) const defaultCrud = CRUD({ title: '分类', url: 'api/yxStoreCategory', sort: 'sort,desc', crudMethod: { ...crudDept }})
const defaultForm = { id: null, cateName: null, pid: 0, isShow: 1 } const defaultForm = { id: null, cateName: null, pid: 0, isShow: 1 , sort: 1}
export default { export default {
name: 'Dept', name: 'Dept',
components: { Treeselect, crudOperation, rrOperation, udOperation, picUpload, MaterialList }, components: { Treeselect, crudOperation, rrOperation, udOperation, picUpload, MaterialList },

Loading…
Cancel
Save