Skip to content

Commit

Permalink
feat: 查看功能
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Jul 23, 2020
1 parent 571a6cf commit 7d03e94
Show file tree
Hide file tree
Showing 56 changed files with 736 additions and 701 deletions.
14 changes: 12 additions & 2 deletions packages/d2-crud-plus-example/src/business/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,18 @@ Vue.use(d2CrudPlus, {
formOptions: {
defaultSpan: 12 // 默认的表单 span
},
pagination: {
background: true
viewOptions: {
disabled: false,
componentType: 'row' // 【form,row】 表单组件 或 行组件展示
},
rowHandle: {
width: 260,
view: {
show: true
},
edit: {
type: 'primary'
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ addFunction(formMenus, 'form/editor', '富文本')

const enhanceMenus = []
addFunction(enhanceMenus, 'form/d2crud', 'd2Crud原版')
addFunction(enhanceMenus, 'form/view', '查看', 'new')
addFunction(enhanceMenus, 'form/linkage', '选择联动', 'new')
addFunction(enhanceMenus, 'form/toolbar', '工具条', 'new')
addFunction(enhanceMenus, 'form/old', '旧版页面', '兼容')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange">
v-bind="_crudProps"
v-on="_crudListeners">

<div slot="header">
<crud-search ref="search" :options="crud.searchOptions" @submit="handleSearch" />
Expand All @@ -41,7 +24,7 @@
</div>

<template slot="FormBodyAppendSlot" slot-scope="scope">
<div class="d2-mt-10">
<div class="d2-mt-10" v-if="scope.mode!=='view'">
<el-button @click="addColumn(scope)">添加未分组字段</el-button>
<el-button @click="addGroupColumn(scope)">添加分组字段</el-button>
<el-button @click="addGroup(scope)">添加分组</el-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange">
v-bind="_crudProps"
v-on="_crudListeners">
<div slot="header">
<crud-search ref="search" :options="crud.searchOptions" @submit="handleSearch" />
<el-button size="small" type="primary" @click="addRow"><i class="el-icon-plus"/> 新增</el-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange"
:selectionRow="crud.selectionRow"
@selection-change="handleSelectionChange"
v-bind="_crudProps"
v-on="_crudListeners"
>

<div slot="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
:selectionRow="crud.selectionRow"
@selection-change="handleSelectionChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange"
v-bind="_crudProps"
v-on="_crudListeners"
@cell-data-change="handleCellDataChange"
>
<div slot="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import request from '@/business/api/request.mock'
export const crudOptions = {
rowHandle: {
// columnHeader: '操作',
width: 300,
width: 370,
custom: [
{
text: ' 自定义',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange"
v-bind="_crudProps"
v-on="_crudListeners"
>
<div slot="header">
<crud-search ref="search" :options="crud.searchOptions" @submit="handleSearch" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange"
v-bind="_crudProps"
v-on="_crudListeners"
>
<div slot="header">
<crud-search ref="search" :options="crud.searchOptions" @submit="handleSearch" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,8 @@
<template slot="header">日期选择</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange"
v-bind="_crudProps"
v-on="_crudListeners"
>

<div slot="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@dialog-opened="handleDialogOpened"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange"
v-bind="_crudProps"
v-on="_crudListeners"
>
<div slot="header">
<crud-search ref="search" :options="crud.searchOptions" @submit="handleSearch" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:indexRow="crud.indexRow"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange"
v-bind="_crudProps"
v-on="_crudListeners"
@form-component-ready="handleFormComponentReady"
>
<div slot="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,8 @@
<template slot="header">其他elementUI组件</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange">
v-bind="_crudProps"
v-on="_crudListeners">

<div slot="header">
<crud-search ref="search" :options="crud.searchOptions" @submit="handleSearch" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const crudOptions = {
rowHandle: {
columnHeader: '操作列固定',
width: 300,
width: 370,
custom: [
{
text: ' 自定义',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,8 @@
</template>
<d2-crud-x
ref="d2Crud"
:columns="crud.columns"
:data="crud.list"
:rowHandle="crud.rowHandle"
edit-title="修改"
:add-template="crud.addTemplate"
:add-rules="crud.addRules"
:edit-template="crud.editTemplate"
:edit-rules="crud.editRules"
:form-options="crud.formOptions"
:options="crud.options"
:loading="crud.loading"
:indexRow="crud.indexRow"
:selectionRow="crud.selectionRow"
:expandRow="crud.expandRow"
:pagination="crud.pagination"
@pagination-change="handlePaginationChange"
@dialog-open="handleDialogOpen"
@row-edit="handleRowEdit"
@row-add="handleRowAdd"
@row-remove="handleRowRemove"
@dialog-cancel="handleDialogCancel"
@form-data-change="handleFormDataChange"
@current-change="handleCurrentChange"
@selection-change="handleSelectionChange"
v-bind="_crudProps"
v-on="_crudListeners"
@customHandleBtn="customHandleBtnHandle"
>
<div slot="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ export const crudOptions = {
options: {
height: '100%' // 表格高度100%, 使用toolbar必须设置
},
viewOptions: {
disabled: false
},
columns: [
{
title: '商品标题',
Expand Down
Loading

0 comments on commit 7d03e94

Please sign in to comment.