Authored by 王涛

文档管理增加参数:是否展示标题,是否有切换展示类型,默认展示视图

@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <el-col :span="layout.left"> 3 <el-col :span="layout.left">
4 <div style="border-radius: 3px;background-color: white" 4 <div style="border-radius: 3px;background-color: white"
5 :style="{'height':height+'px','max-height':height + 'px','overflow':'auto'}"> 5 :style="{'height':height+'px','max-height':height + 'px','overflow':'auto'}">
6 - <div style="text-align: left;padding-left: 10px;padding-top: 3px;font-weight: bold"> 6 + <div v-if="showTitle" style="text-align: left;padding-left: 10px;padding-top: 3px;font-weight: bold">
7 <slot name="title"> 7 <slot name="title">
8 <el-link type="info" :underline="false"><i class="iconfont icon-ziliaoku"></i> 文档管理</el-link> 8 <el-link type="info" :underline="false"><i class="iconfont icon-ziliaoku"></i> 文档管理</el-link>
9 </slot> 9 </slot>
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
72 {{selectText}} 72 {{selectText}}
73 </el-button> 73 </el-button>
74 </div> 74 </div>
75 - <div style="text-align: right;width: 150px"> 75 + <div v-if="isCut" style="text-align: right;width: 150px">
76 <el-button-group> 76 <el-button-group>
77 <el-button :size="$global.elementSize" :type="activeBtn == 'view' ? 'primary' : ''" 77 <el-button :size="$global.elementSize" :type="activeBtn == 'view' ? 'primary' : ''"
78 @click="activeModel('view')"> 78 @click="activeModel('view')">
@@ -57,7 +57,22 @@ export default { @@ -57,7 +57,22 @@ export default {
57 isEditName:{ 57 isEditName:{
58 type:Boolean, 58 type:Boolean,
59 default:false 59 default:false
60 - } 60 + },
  61 + // 是否展示标题,默认不展示
  62 + showTitle:{
  63 + type:Boolean,
  64 + default:false
  65 + },
  66 + // 是否有切换展示类型,默认展示
  67 + isCut:{
  68 + type:Boolean,
  69 + default:true
  70 + },
  71 + // 默认展示视图,默认视图
  72 + defaultView:{
  73 + type:String,
  74 + default:'view'
  75 + },
61 }, 76 },
62 data() { 77 data() {
63 return { 78 return {
@@ -179,7 +194,7 @@ export default { @@ -179,7 +194,7 @@ export default {
179 194
180 let columns = Vue.ref([{ 195 let columns = Vue.ref([{
181 prop: 'fileName', 196 prop: 'fileName',
182 - label: '文档名称', 197 + label: '名称',
183 sortable: true, 198 sortable: true,
184 align: 'left', 199 align: 'left',
185 click: function (row) { 200 click: function (row) {
@@ -192,7 +207,7 @@ export default { @@ -192,7 +207,7 @@ export default {
192 }, 207 },
193 { 208 {
194 prop: 'fname', 209 prop: 'fname',
195 - label: '文档分类', 210 + label: '类型',
196 sortable: true, 211 sortable: true,
197 width: '120px' 212 width: '120px'
198 }, 213 },
@@ -207,22 +222,22 @@ export default { @@ -207,22 +222,22 @@ export default {
207 sortable: true, 222 sortable: true,
208 width: '180px' 223 width: '180px'
209 } 224 }
210 - /*,{  
211 - prop: 'handle',  
212 - label: '操作',  
213 - sortable: false,  
214 - width: '180px',  
215 - render: function (row) {  
216 - return `<i class="el-icon-plus " @click='handleView(row)'></i><i class="iconfont el-icon-download " @click='handleDownload(row)'></i><i class="iconfont el-icon-delete" @click='handleDelete(row)'></i>`  
217 - }  
218 - }*/ 225 + // ,{
  226 + // prop: 'handle',
  227 + // label: '操作',
  228 + // sortable: false,
  229 + // width: '180px',
  230 + // render: function (row) {
  231 + // return `<i class="el-icon-plus " @click='handleView(row)'></i><i class="iconfont el-icon-download " @click='handleDownload(row)'></i><i class="iconfont el-icon-delete" @click='handleDelete(row)'></i>`
  232 + // }
  233 + // }
219 ]); 234 ]);
220 // 表格数据 235 // 表格数据
221 let dataList = Vue.ref([]); 236 let dataList = Vue.ref([]);
222 // 总数 237 // 总数
223 let total = Vue.ref(0); 238 let total = Vue.ref(0);
224 // 当前展示视图 239 // 当前展示视图
225 - let activeBtn = Vue.ref('view'); 240 + let activeBtn = Vue.ref(props.defaultView);
226 // // 当前展示视图 241 // // 当前展示视图
227 // let viewEdit = Vue.ref(false); 242 // let viewEdit = Vue.ref(false);
228 //是否全选 243 //是否全选