-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
336 additions
and
53 deletions.
There are no files selected for viewing
114 changes: 74 additions & 40 deletions
114
packages/d2-crud-plus-example/src/business/modules/example/views/form/editor/crud.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,79 @@ | ||
export const crudOptions = { | ||
indexRow: { // 或者直接传true,不显示title,不居中 | ||
title: '序号', | ||
align: 'center' | ||
}, | ||
columns: [ | ||
{ | ||
title: 'id', | ||
key: 'id', | ||
sortable: true, | ||
width: 100, | ||
form: { disabled: true } | ||
export const crudOptions = (vm) => { | ||
return { | ||
indexRow: { // 或者直接传true,不显示title,不居中 | ||
title: '序号', | ||
align: 'center' | ||
}, | ||
{ | ||
title: '标题', | ||
key: 'title', | ||
sortable: true, | ||
width: 400, | ||
form: { component: { span: 24 } } | ||
}, | ||
{ | ||
title: '摘要', | ||
key: 'text', | ||
sortable: true, | ||
type: 'text-area' | ||
}, | ||
{ | ||
title: '内容', | ||
key: 'content', | ||
sortable: true, | ||
width: 300, | ||
type: 'editor-quill', // 富文本图片上传依赖file-uploader,请先配置好file-uploader | ||
disabled: true, // 设置true可以在行展示中隐藏 | ||
form: { | ||
component: { | ||
props: { | ||
uploader: { | ||
type: 'form' // 上传后端类型【cos,aliyun,oss,form】 | ||
} | ||
columns: [ | ||
{ | ||
title: 'id', | ||
key: 'id', | ||
sortable: true, | ||
width: 100, | ||
form: { disabled: true } | ||
}, | ||
{ | ||
title: '标题', | ||
key: 'title', | ||
sortable: true, | ||
width: 400, | ||
form: { component: { span: 24 } } | ||
}, | ||
{ | ||
title: '摘要', | ||
key: 'text', | ||
sortable: true, | ||
type: 'text-area' | ||
}, | ||
{ | ||
title: '切换编辑器', | ||
key: 'change', | ||
sortable: false, | ||
type: 'radio', | ||
disabled: true, | ||
dict: { data: [{ value: 'quill', label: 'Quill' }, { value: 'ueditor', label: 'UEditor' }] }, | ||
form: { | ||
valueChange (key, value, form) { | ||
vm.changeEditor(value) | ||
} | ||
} | ||
}, | ||
{ | ||
title: '内容', | ||
key: 'content', | ||
sortable: true, | ||
width: 300, | ||
type: 'editor-quill', // 富文本图片上传依赖file-uploader,请先配置好file-uploader | ||
disabled: true, // 设置true可以在行展示中隐藏 | ||
form: { | ||
component: { | ||
props: { | ||
uploader: { | ||
type: 'form' // 上传后端类型【cos,aliyun,oss,form】 | ||
} | ||
}, | ||
show: true | ||
} | ||
} | ||
}, | ||
{ | ||
title: '内容', | ||
key: 'content_ueditor', | ||
sortable: true, | ||
width: 300, | ||
type: 'editor-ueditor', // 富文本图片上传依赖file-uploader,请先配置好file-uploader | ||
disabled: true, // 设置true可以在行展示中隐藏 | ||
form: { | ||
component: { | ||
props: { | ||
uploader: { | ||
type: 'form' // 上传后端类型【cos,aliyun,oss,form】 | ||
} | ||
}, | ||
show: false | ||
} | ||
} | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/d2-crud-plus-extends/src/full-editor/lib/d2-ueditor/button/d2admin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default { | ||
name: 'd2admin', | ||
icon: './lib/UEditor/button-icon/d2admin.png', | ||
tip: 'D2Admin', | ||
handler: (editor, name) => { | ||
editor.execCommand('inserthtml', '<p><span style="border: 1px solid rgb(0, 0, 0); font-family: impact, chicago; color: rgb(127, 127, 127);">https://github.com/d2-projects/</span><span style="border: 1px solid rgb(0, 0, 0); font-family: impact, chicago; background-color: rgb(23, 54, 93); color: rgb(255, 255, 255);">d2-admin</span></p>') | ||
} | ||
} |
Oops, something went wrong.