123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- <template>
- <div class="app-container">
- <div class="filter-container margin-bottom">
- <div style="width:200px; display:inline-block; float:left">
- <el-input placeholder="请输入内容" v-model="input" clearable></el-input>
- </div>
- <div>
- <el-select
- style="display:inline-block; float:left; margin-left:15px; width:150px"
- v-model="value1"
- placeholder="分类"
- >
- <el-option
- v-for="item in options1"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- <el-select
- style="display:inline-block; float:left; margin-left:15px; width:150px"
- v-model="value2"
- placeholder="格式"
- >
- <el-option
- v-for="item in options2"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- <el-select
- style="display:inline-block; float:left; margin-left:15px; width:150px"
- v-model="value3"
- placeholder="状态"
- >
- <el-option
- v-for="item in options3"
- :key="item.value1"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- <el-button
- style="display:inline-block; float:left; margin-left:15px;"
- type="primary"
- icon="el-icon-search"
- >搜索</el-button>
- </div>
- <el-button
- class="inline-block"
- type="primary"
- icon="el-icon-folder-add"
- @click="dialogFormVisible = true"
- >新建</el-button>
- </div>
- <el-table :data="tableData" border style="width: 100%">
- <el-table-column label="名称" width="300">
- <template slot-scope="scope">
- <span style="margin-left: 10px">{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="所属分类" width="300">
- <template slot-scope="scope">
- <span style="margin-left: 10px">{{ scope.row.sort }}</span>
- </template>
- </el-table-column>
- <el-table-column label="播放次数" width="200">
- <template slot-scope="scope">
- <span style="margin-left: 10px">{{ scope.row.time }}</span>
- </template>
- </el-table-column>
- <el-table-column label="访问量" width="200">
- <template slot-scope="scope">
- <span style="margin-left: 10px">{{ scope.row.traffic }}</span>
- </template>
- </el-table-column>
- <el-table-column label="格式" width="200">
- <template slot-scope="scope">
- <span style="margin-left: 10px">{{ scope.row.type }}</span>
- </template>
- </el-table-column>
- <el-table-column label="状态" width="200">
- <template slot-scope="scope">
- <span style="margin-left: 10px">{{ scope.row.status }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
- <el-button size="mini" type="success" @click="handleModifyStatus(row,'published')">上架</el-button>
- <!-- <el-button size="mini" @click="handleModifyStatus(row,'draft')">下架</el-button> -->
- <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination style="margin-top:50px" background layout="prev, pager, next" :total="1000"></el-pagination>
- <el-dialog title="新建资料" :visible.sync="dialogFormVisible">
- <el-form :model="form">
- <el-form-item label="填写名称" :label-width="formLabelWidth">
- <el-input v-model="form.name" autocomplete="off"></el-input>
- </el-form-item>
- <el-form-item label="所在分类" :label-width="formLabelWidth">
- <el-select v-model="form.region" placeholder="请选择分类">
- <el-option label="区域一" value="区域一"></el-option>
- <el-option label="区域二" value="区域二"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="文件形式" :label-width="formLabelWidth">
- <el-select v-model="form.type" placeholder="请选择文件形式">
- <el-option label="视频" value="视频"></el-option>
- <el-option label="音频" value="音频"></el-option>
- <el-option label="图片" value="图片"></el-option>
- <el-option label="文字" value="文字"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">取 消</el-button>
- <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- input: "",
- tableData: [
- {
- sort: "教育",
- name: "王小虎",
- time: "2016-05-02",
- traffic:"54545",
- type:"视频",
- status:"下架",
- },
- {
- sort: "教育",
- name: "王小虎",
- time: "2016-05-02",
- traffic:"54545",
- type:"视频",
- status:"下架",
- },
- {
- sort: "教育",
- name: "王小虎",
- time: "2016-05-02",
- traffic:"54545",
- type:"视频",
- status:"下架",
- },
- {
- sort: "教育",
- name: "王小虎",
- time: "2016-05-02",
- traffic:"54545",
- type:"视频",
- status:"下架",
- },
- {
- sort: "教育",
- name: "王小虎",
- time: "2016-05-02",
- traffic:"54545",
- type:"视频",
- status:"下架",
- },
- {
- sort: "教育",
- name: "王小虎",
- time: "2016-05-02",
- traffic:"54545",
- type:"视频",
- status:"下架",
- }
- ],
- options1: [
- {
- value: "选项1",
- label: "按分类"
- },
- {
- value: "选项2",
- label: "双皮奶"
- },
- {
- value: "选项3",
- label: "蚵仔煎"
- },
- {
- value: "选项4",
- label: "龙须面"
- },
- {
- value: "选项5",
- label: "北京烤鸭"
- }
- ],
- options2: [
- {
- value: "选项1",
- label: "图片"
- },
- {
- value: "选项2",
- label: "音频"
- },
- {
- value: "选项3",
- label: "视频"
- },
- {
- value: "选项4",
- label: "文字"
- }
- ],
- options3: [
- {
- value: "选项1",
- label: "上架"
- },
- {
- value: "选项2",
- label: "下架"
- }
- ],
- value1: [],
- value2: [],
- value3: [],
- dialogFormVisible: false,
- form: {
- name: "",
- region: "",
- type: "",
- date1: "",
- date2: "",
- delivery: false,
- type: [],
- resource: "",
- desc: ""
- },
- formLabelWidth: "120px",
- methods: {
- handleEdit(index, row) {
- console.log(index, row);
- },
- handleDelete(index, row) {
- console.log(index, row);
- }
- }
- };
- }
- };
- </script>
- <style lang="scss" scoped>
- .margin-bottom {
- margin-bottom: 65px;
- }
- .inline-block {
- // display: inline-block;
- float: left;
- margin-left: 15px;
- }
- </style>
|