|
@@ -0,0 +1,345 @@
|
|
|
|
|
+import MessageBox from './MessageBox.vue'
|
|
|
|
|
+import icon from '../assets/icon/icon_17message.svg'
|
|
|
|
|
+import { flagOptions } from '@/constants'
|
|
|
|
|
+import type { IComponentModelConfig } from '../type'
|
|
|
|
|
+import i18n from '@/locales'
|
|
|
|
|
+import defaultStyle from './style.json'
|
|
|
|
|
+import Config from './Config.vue'
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ label: i18n.global.t('messageBox'),
|
|
|
|
|
+ icon,
|
|
|
|
|
+ component: MessageBox,
|
|
|
|
|
+ key: 'lv_msgbox',
|
|
|
|
|
+ group: i18n.global.t('layout'),
|
|
|
|
|
+ sort: 1,
|
|
|
|
|
+ hasChildren: false,
|
|
|
|
|
+ defaultStyle,
|
|
|
|
|
+ parts: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'main',
|
|
|
|
|
+ stateList: ['default']
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'title',
|
|
|
|
|
+ stateList: ['default']
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'content',
|
|
|
|
|
+ stateList: ['default']
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'btns',
|
|
|
|
|
+ stateList: ['default']
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ defaultSchema: {
|
|
|
|
|
+ name: 'msgbox',
|
|
|
|
|
+ props: {
|
|
|
|
|
+ x: 0,
|
|
|
|
|
+ y: 0,
|
|
|
|
|
+ width: 260,
|
|
|
|
|
+ height: 140,
|
|
|
|
|
+ addFlags: [],
|
|
|
|
|
+ removeFlags: [],
|
|
|
|
|
+ title: 'Title',
|
|
|
|
|
+ content: 'Content',
|
|
|
|
|
+ closeBtn: true,
|
|
|
|
|
+ btnWidth: 60,
|
|
|
|
|
+ btnHeight: 30,
|
|
|
|
|
+ btns: [{ text: 'Apply' }, { text: 'Close' }]
|
|
|
|
|
+ },
|
|
|
|
|
+ styles: [
|
|
|
|
|
+ {
|
|
|
|
|
+ part: {
|
|
|
|
|
+ name: 'main',
|
|
|
|
|
+ state: 'default'
|
|
|
|
|
+ },
|
|
|
|
|
+ background: {
|
|
|
|
|
+ color: '#ffffffff'
|
|
|
|
|
+ },
|
|
|
|
|
+ border: {
|
|
|
|
|
+ color: '#ffffff64',
|
|
|
|
|
+ width: 0,
|
|
|
|
|
+ radius: 4,
|
|
|
|
|
+ side: ['all']
|
|
|
|
|
+ },
|
|
|
|
|
+ shadow: {
|
|
|
|
|
+ color: '#2092f5ff',
|
|
|
|
|
+ x: 0,
|
|
|
|
|
+ y: 0,
|
|
|
|
|
+ spread: 0,
|
|
|
|
|
+ width: 0
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ part: {
|
|
|
|
|
+ name: 'title',
|
|
|
|
|
+ state: 'default'
|
|
|
|
|
+ },
|
|
|
|
|
+ background: {
|
|
|
|
|
+ color: '#ffffffff'
|
|
|
|
|
+ },
|
|
|
|
|
+ text: {
|
|
|
|
|
+ color: '#35383cff',
|
|
|
|
|
+ size: 12,
|
|
|
|
|
+ weight: 'normal',
|
|
|
|
|
+ family: 'xx'
|
|
|
|
|
+ },
|
|
|
|
|
+ spacer: {
|
|
|
|
|
+ letterSpacing: 0,
|
|
|
|
|
+ lineHeight: 15
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ part: {
|
|
|
|
|
+ name: 'content',
|
|
|
|
|
+ state: 'default'
|
|
|
|
|
+ },
|
|
|
|
|
+ text: {
|
|
|
|
|
+ color: '#35383cff',
|
|
|
|
|
+ size: 12,
|
|
|
|
|
+ weight: 'normal',
|
|
|
|
|
+ family: 'xx'
|
|
|
|
|
+ },
|
|
|
|
|
+ spacer: {
|
|
|
|
|
+ letterSpacing: 0,
|
|
|
|
|
+ lineHeight: 10
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ part: {
|
|
|
|
|
+ name: 'btns',
|
|
|
|
|
+ state: 'default'
|
|
|
|
|
+ },
|
|
|
|
|
+ background: {
|
|
|
|
|
+ color: '#e6e6e6ff'
|
|
|
|
|
+ },
|
|
|
|
|
+ text: {
|
|
|
|
|
+ color: '#35383cff',
|
|
|
|
|
+ size: 12,
|
|
|
|
|
+ weight: 'normal',
|
|
|
|
|
+ family: 'xx'
|
|
|
|
|
+ },
|
|
|
|
|
+ border: {
|
|
|
|
|
+ color: '#2092f5ff',
|
|
|
|
|
+ width: 0,
|
|
|
|
|
+ radius: 10,
|
|
|
|
|
+ side: ['all']
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ config: {
|
|
|
|
|
+ // 组件属性
|
|
|
|
|
+ props: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '名称',
|
|
|
|
|
+ field: 'name',
|
|
|
|
|
+ valueType: 'text',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ placeholder: '请输入名称'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '位置/大小',
|
|
|
|
|
+ valueType: 'group',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ field: 'props.x',
|
|
|
|
|
+ valueType: 'number',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ slots: { prefix: 'X' }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ field: 'props.y',
|
|
|
|
|
+ valueType: 'number',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ slots: { prefix: 'Y' }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ field: 'props.width',
|
|
|
|
|
+ valueType: 'number',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ slots: { prefix: 'W' }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ field: 'props.height',
|
|
|
|
|
+ valueType: 'number',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ span: 12
|
|
|
|
|
+ },
|
|
|
|
|
+ slots: { prefix: 'H' }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '添加标识',
|
|
|
|
|
+ field: 'props.addFlags',
|
|
|
|
|
+ valueType: 'checkbox',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ options: flagOptions,
|
|
|
|
|
+ defaultCollapsed: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '删除标识',
|
|
|
|
|
+ field: 'props.removeFlags',
|
|
|
|
|
+ valueType: 'checkbox',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ options: flagOptions,
|
|
|
|
|
+ defaultCollapsed: true
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ coreProps: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '标题',
|
|
|
|
|
+ field: 'props.title',
|
|
|
|
|
+ valueType: 'text'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '关闭按钮',
|
|
|
|
|
+ field: 'props.closeBtn',
|
|
|
|
|
+ valueType: 'switch'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '按钮尺寸',
|
|
|
|
|
+ valueType: 'group',
|
|
|
|
|
+ children: [
|
|
|
|
|
+ {
|
|
|
|
|
+ field: 'props.btnWidth',
|
|
|
|
|
+ valueType: 'number',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ span: 12,
|
|
|
|
|
+ min: 0,
|
|
|
|
|
+ max: 200
|
|
|
|
|
+ },
|
|
|
|
|
+ slots: { prefix: 'W' }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ field: 'props.btnHeight',
|
|
|
|
|
+ valueType: 'number',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ span: 12,
|
|
|
|
|
+ min: 0,
|
|
|
|
|
+ max: 200
|
|
|
|
|
+ },
|
|
|
|
|
+ slots: { prefix: 'Y' }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '按钮组',
|
|
|
|
|
+ field: 'props.btns',
|
|
|
|
|
+ render: (val) => {
|
|
|
|
|
+ return <Config values={val} />
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ // 组件样式
|
|
|
|
|
+ styles: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '模块状态',
|
|
|
|
|
+ field: 'part',
|
|
|
|
|
+ valueType: 'part'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ valueType: 'dependency',
|
|
|
|
|
+ name: ['part'],
|
|
|
|
|
+ dependency: ({ part }) => {
|
|
|
|
|
+ return part?.name === 'main'
|
|
|
|
|
+ ? [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '背景',
|
|
|
|
|
+ field: 'background',
|
|
|
|
|
+ valueType: 'background',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ onlyColor: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '边框',
|
|
|
|
|
+ field: 'border',
|
|
|
|
|
+ valueType: 'border'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '阴影',
|
|
|
|
|
+ field: 'shadow',
|
|
|
|
|
+ valueType: 'shadow'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ : part?.name === 'title'
|
|
|
|
|
+ ? [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '背景',
|
|
|
|
|
+ field: 'background',
|
|
|
|
|
+ valueType: 'background',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ onlyColor: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '字体',
|
|
|
|
|
+ field: 'text',
|
|
|
|
|
+ valueType: 'font',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ hideAlign: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '间距',
|
|
|
|
|
+ field: 'spacer',
|
|
|
|
|
+ valueType: 'spacer'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ : part?.name === 'content'
|
|
|
|
|
+ ? [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '字体',
|
|
|
|
|
+ field: 'text',
|
|
|
|
|
+ valueType: 'font',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ hideAlign: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '间距',
|
|
|
|
|
+ field: 'spacer',
|
|
|
|
|
+ valueType: 'spacer'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ : [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '背景',
|
|
|
|
|
+ field: 'background',
|
|
|
|
|
+ valueType: 'background',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ onlyColor: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '字体',
|
|
|
|
|
+ field: 'text',
|
|
|
|
|
+ valueType: 'font',
|
|
|
|
|
+ componentProps: {
|
|
|
|
|
+ hideAlign: true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '边框',
|
|
|
|
|
+ field: 'border',
|
|
|
|
|
+ valueType: 'border'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+} as IComponentModelConfig
|