reactor:refine code&&demo

This commit is contained in:
Pan
2017-11-02 17:58:35 +08:00
parent ac5d087ea4
commit bb1d939a94
18 changed files with 138 additions and 139 deletions

View File

@@ -1,5 +1,5 @@
<template>
<el-table :data="list" border fit highlight-current-row style="width: 100%">
<el-table :data="list"border fit highlight-current-row style="width: 100%">
<el-table-column align="center" label="序号" width="65" v-loading="loading"
element-loading-text="请给我点时间">
@@ -39,7 +39,7 @@
</template>
</el-table-column>
<el-table-column class-name="status-col" label="状态" width="90">
<el-table-column class-name="status-col" label="状态" width="110">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">{{scope.row.status}}</el-tag>
</template>

View File

@@ -19,10 +19,10 @@
</el-option>
</el-select>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="edit">添加</el-button>
<el-button class="filter-item" type="primary" icon="document" @click="handleDownload">导出</el-button>
<el-checkbox class="filter-item" @change='tableKey=tableKey+1' v-model="showAuditor">显示审核人</el-checkbox>
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">添加</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-download" @click="handleDownload">导出</el-button>
<el-checkbox class="filter-item" style='margin-left:15px;' @change='tableKey=tableKey+1' v-model="showAuditor">显示审核人</el-checkbox>
</div>
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row style="width: 100%">
@@ -39,7 +39,7 @@
</template>
</el-table-column>
<el-table-column min-width="300px" label="标题">
<el-table-column min-width="150px" label="标题">
<template slot-scope="scope">
<span class="link-type" @click="handleUpdate(scope.row)">{{scope.row.title}}</span>
<el-tag>{{scope.row.type | typeFilter}}</el-tag>
@@ -70,7 +70,7 @@
</template>
</el-table-column>
<el-table-column class-name="status-col" label="状态" width="90">
<el-table-column class-name="status-col" label="状态" width="100">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">{{scope.row.status}}</el-tag>
</template>
@@ -121,7 +121,7 @@
</el-form-item>
<el-form-item label="重要性">
<el-rate style="margin-top:8px;" v-model="temp.importance" :colors="['#99A9BF', '#F7BA2A', '#FF9900']"></el-rate>
<el-rate style="margin-top:8px;" v-model="temp.importance" :colors="['#99A9BF', '#F7BA2A', '#FF9900']" :max='3'></el-rate>
</el-form-item>
<el-form-item label="点评">

View File

@@ -39,7 +39,7 @@
</template>
</el-table-column>
<el-table-column class-name="status-col" label="状态" width="90">
<el-table-column class-name="status-col" label="状态" width="110">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">{{scope.row.status}}</el-tag>
</template>

View File

@@ -9,7 +9,7 @@
</el-checkbox-group>
</div>
<el-table :data="tableData" :key='key' style="width: 100%">
<el-table :data="tableData" :key='key' border fit highlight-current-row style="width: 100%">
<el-table-column prop="name" label="fruitName" width="180"></el-table-column>
<el-table-column :key='fruit' v-for='(fruit,index) in formThead' :label="fruit">
<template slot-scope="scope">

View File

@@ -9,7 +9,7 @@
</el-checkbox-group>
</div>
<el-table :data="tableData" style="width: 100%">
<el-table :data="tableData" border fit highlight-current-row style="width: 100%">
<el-table-column prop="name" label="fruitName" width="180">
</el-table-column>
<el-table-column :key='fruit' v-for='(fruit,index) in formThead' :label="fruit">

View File

@@ -27,7 +27,7 @@
</template>
</el-table-column>
<el-table-column class-name="status-col" label="状态" width="100">
<el-table-column class-name="status-col" label="状态" width="110">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">{{scope.row.status}}</el-tag>
</template>

View File

@@ -1,5 +1,6 @@
<template>
<div class="app-container">
<el-input style='width:240px;' placeholder="请输入文件名(默认excel-list)" prefix-icon="el-icon-document" v-model="filename"></el-input>
<el-button style='margin-bottom:20px;' type="primary" icon="document" @click="handleDownload" :loading="downloadLoading">导出excel</el-button>
<el-table :data="list" v-loading.body="listLoading" element-loading-text="拼命加载中" border fit highlight-current-row>
<el-table-column align="center" label='ID' width="95">
@@ -42,7 +43,8 @@ export default {
return {
list: null,
listLoading: true,
downloadLoading: false
downloadLoading: false,
filename: ''
}
},
created() {
@@ -64,7 +66,7 @@ export default {
const filterVal = ['id', 'title', 'author', 'pageviews', 'display_time']
const list = this.list
const data = this.formatJson(filterVal, list)
export_json_to_excel(tHeader, data, '列表excel')
export_json_to_excel(tHeader, data, this.filename)
this.downloadLoading = false
})
},

View File

@@ -1,5 +1,6 @@
<template>
<div class="app-container">
<el-input style='width:240px;' placeholder="请输入文件名(默认excel-list)" prefix-icon="el-icon-document" v-model="filename"></el-input>
<el-button style='margin-bottom:20px' type="primary" icon="document" @click="handleDownload" :loading="downloadLoading">导出已选择项</el-button>
<el-table :data="list" v-loading.body="listLoading" element-loading-text="拼命加载中" border fit highlight-current-row @selection-change="handleSelectionChange"
ref="multipleTable">
@@ -44,7 +45,8 @@ export default {
list: null,
listLoading: true,
multipleSelection: [],
downloadLoading: false
downloadLoading: false,
filename: ''
}
},
created() {
@@ -70,7 +72,7 @@ export default {
const filterVal = ['id', 'title', 'author', 'pageviews', 'display_time']
const list = this.multipleSelection
const data = this.formatJson(filterVal, list)
export_json_to_excel(tHeader, data, '列表excel')
export_json_to_excel(tHeader, data, this.filename)
this.$refs.multipleTable.clearSelection()
this.downloadLoading = false
})

View File

@@ -25,7 +25,7 @@ export default {
return
}
const first = matched[0]
if (first && (first.name !== '首页' || first.path !== '')) {
if (first && first.name !== 'dashboard') {
matched = [{ path: '/', meta: { title: '首页' }}].concat(matched)
}
this.levelList = matched

View File

@@ -1,19 +1,22 @@
<template>
<div class="icons-container">
<div class="icons-wrapper">
<div v-for='item of iconsMap' :key='item' class='icon-item' @click='handleClipboard(generateIconCode(item),$event)'>
<el-tooltip placement="top" effect="light">
<div v-for='item of iconsMap' :key='item' @click='handleClipboard(generateIconCode(item),$event)'>
<el-tooltip placement="top">
<div slot="content">
{{generateIconCode(item)}}
</div>
<svg-icon :icon-class="item" />
<div class='icon-item'>
<svg-icon :icon-class="item" />
<span>{{item}}</span>
</div>
</el-tooltip>
<span>{{item}}</span>
</div>
</div>
</div>
</template>
<script>
import icons from './generateIconsView'
import clipboard from '@/utils/clipboard' // use clipboard directly
@@ -50,12 +53,12 @@ export default {
}
.icon-item {
margin: 20px;
height: 137px;
height: 110px;
text-align: center;
width: 120px;
width: 110px;
float: left;
font-size: 40px;
color: #666;
font-size: 30px;
color: #24292e;
cursor: pointer;
}
span {

View File

@@ -1,5 +1,6 @@
<template>
<div class="app-container">
<el-input style='width:240px;' placeholder="请输入文件名(默认file)" prefix-icon="el-icon-document" v-model="filename"></el-input>
<el-button style='margin-bottom:20px;' type="primary" icon="document" @click="handleDownload" :loading="downloadLoading">导出zip</el-button>
<el-table :data="list" v-loading.body="listLoading" element-loading-text="拼命加载中" border fit highlight-current-row>
<el-table-column align="center" label='ID' width="95">
@@ -41,7 +42,8 @@ export default {
return {
list: null,
listLoading: true,
downloadLoading: false
downloadLoading: false,
filename: ''
}
},
created() {
@@ -63,7 +65,7 @@ export default {
const filterVal = ['id', 'title', 'author', 'pageviews', 'display_time']
const list = this.list
const data = this.formatJson(filterVal, list)
export_txt_to_zip(tHeader, data, '列表文本', '压缩文本')
export_txt_to_zip(tHeader, data, this.filename, this.filename)
this.downloadLoading = false
})
},