mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-07 01:28:28 +08:00
commit
c332fd8174
84
README.md
84
README.md
@ -1,40 +1,74 @@
|
||||
# ddei-editor
|
||||
# DDei-在线设计器简介
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
## 概述
|
||||
|
||||
## Recommended IDE Setup
|
||||
  DDei是一个遵循Apache2.0开源协议开发的设计器组件,允许用户通过拖拉拽等方式创建和编辑图形。
|
||||
使用者可以通过组件引用的方式,将其嵌入到应用的任意位置,使之拥有在线绘图的能力。
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
||||
|
||||
## Type Support for `.vue` Imports in TS
|
||||
## 功能特性
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
||||
  DDei以组件的方式提供使用,功能强大且易于集成,大多数功能都可以通过初始化配置和引入插件完成,无需复杂编码。以下是DDei的功能特性
|
||||
|
||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
||||
**画布大小**
|
||||
|
||||
1. Disable the built-in TypeScript Extension
|
||||
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
||||
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
||||
  支持设置设计器的大小。
|
||||
|
||||
## Customize configuration
|
||||
**背景**
|
||||
|
||||
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
||||
  支持空白、图片、纯色以及透明度设置。
|
||||
|
||||
## Project Setup
|
||||
**纸张**
|
||||
|
||||
```sh
|
||||
npm install
|
||||
```
|
||||
  开启后会在背景上显示纸张。允许设置纸张的大小(如:A4、A5、自定义)以及方向(横向、纵向)。
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
**标尺**
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
  开启后会在绘图区域的周围显示标尺,同时会影响辅助网格的尺寸。支持毫米、厘米、米、英寸、像素等单位。
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
**辅助对齐**
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
  开启后拖拽时会显示对齐辅助线。
|
||||
|
||||
**辅助网格**
|
||||
|
||||
  开启后会在背景上绘制用于对齐的辅助网格线。支持点阵和网格两种类型。
|
||||
|
||||
**水印**
|
||||
|
||||
  开启后图形上方显示水印。支持文字、图像两种水印类型,可以调整水印的字体、文本、图片、方向、颜色和透明度。
|
||||
|
||||
**无限画布**
|
||||
|
||||
  开启后在操作超出画布大小时会自动扩展画布。可以限制扩展方向(横向或纵向)。
|
||||
|
||||
**权限控制**
|
||||
|
||||
  可以配置操作权限。支持全局只读设置,或到图形实例级的创建、修改、选择、删除、连线等权限。
|
||||
**多文件**
|
||||
|
||||
  可以配置插件实现多文件编辑。
|
||||
|
||||
**多页签**
|
||||
|
||||
  可以配置插件实现多页签编辑。
|
||||
|
||||
**多图层**
|
||||
|
||||
  开启后可以创建多个图层,并在不同图层之间切换、锁定或删除图层。
|
||||
|
||||
**数据驱动**
|
||||
|
||||
  DDei采用数据驱动,图形的绘制与JSON模型绑定,图形操作和模型数据会相互同步。可以通过API获取图形的JSON数据,或通过已有的JSON数据显示加载画布。
|
||||
|
||||
|
||||
**插件机制**
|
||||
  DDei提供了插件机制,使用者可以通过扩展插件对设计器功能进行装载或卸载。也可以通过自定义插件扩展个性化功能,从而满足使用需求。
|
||||
|
||||
|
||||
## 安装、示例与API
|
||||
  作者提供了完整的安装指南和示例,请进入[DDei官网]https://www.ddei.top查看最新文档。
|
||||
|
||||
|
||||
## 技术支持
|
||||
<center>QQ:3697355039     邮箱:3697355039@qq.com</center>
|
||||
10
index.html
10
index.html
@ -2,9 +2,15 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vite App</title>
|
||||
<meta name="author" content="hoslay,3697355039@qq.com">
|
||||
<meta name="copyright" content="hoslay">
|
||||
<meta name="applicable-device" content="pc">
|
||||
<meta http-equiv="windows-Target" content="_top" >
|
||||
<meta name="description" content="DDei在线设计器——简单、好用、免费的在线绘图和流程编排工具。流程设计、UML、思维导图、数据库设计、泳道图、时序图、类图、在线绘图、二次开发、API接口、协作!">
|
||||
<meta name="Keywords" content="流程设计,UML,思维导图,数据库设计,泳道图,时序图,类图,在线绘图,免费,二次开发,API接口,协作">
|
||||
<meta name="replace">
|
||||
<title>DDei-在线设计器V1.2.0</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
2156
package-lock.json
generated
2156
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
54
package.json
54
package.json
@ -1,25 +1,67 @@
|
||||
{
|
||||
"name": "ddei-editor",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"version": "1.2.13",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"author": "hoslay <3697355039@qq.com>",
|
||||
"license": "Apache License 2.0",
|
||||
"description": "ddei在线设计器,提供在线图形设计工具及扩展API,支持用户自己创建页面、每个页面中可以创建多个页签、在页签中通过拖拉拽的方式绘制UML、数据库设计图、软件架构图等多种类型的设计图形。支持等圆形、矩形、三角形、平行四边形等多边形绘图;支持流程图、思维导图、组织架构图的在线绘制;支持多文件、多页签编辑;支持复制、粘贴、复制样式、修改字体大小、颜色等特性;提供扩展API,能够允许外部程序调用扩展能力",
|
||||
"keywords": [
|
||||
"ddei",
|
||||
"ddei-plugin",
|
||||
"ddei-editor",
|
||||
"图形框架",
|
||||
"流程图",
|
||||
"思维导图",
|
||||
"插件扩展",
|
||||
"在线设计器"
|
||||
],
|
||||
"homepage": "https://www.ddei.top",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitee.com/hoslay/ddei-editor.git"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
"package.json"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://gitee.com/hoslay/ddei-editor",
|
||||
"email": "3697355039@qq.com"
|
||||
},
|
||||
"main": "./dist/ddei-editor.umd.cjs",
|
||||
"module": "./dist/ddei-editor.umd.cjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/ddei-editor.umd.cjs",
|
||||
"require": "./dist/ddei-editor.umd.cjs"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "run-p type-check build-only",
|
||||
"dev": "vite --host=0.0.0.0",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.3.4"
|
||||
"ddei-framework": "^1.2.37"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "^18.2.0",
|
||||
"@types/node": "^18.17.0",
|
||||
"@types/lodash": "^4.14.197",
|
||||
"@types/node": "^18.17.6",
|
||||
"@vitejs/plugin-vue": "^4.2.3",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
"less": "^4.2.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"typescript": "~5.1.6",
|
||||
"vite": "^4.4.6",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vue-tsc": "^1.8.6"
|
||||
}
|
||||
}
|
||||
|
||||
255
plugins/core/components/buttons/QBTBorderDash.vue
Normal file
255
plugins/core/components/buttons/QBTBorderDash.vue
Normal file
@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<div
|
||||
:class="{ 'ddei-pv-border-dash-combox': true, 'ddei-pv-border-dash-combox--disabled': !attrDefine || attrDefine.readonly }">
|
||||
<div class="textinput" @click="attrDefine && !attrDefine.readonly && showDialog($event)">
|
||||
<svg class="div_input">
|
||||
<line x1=0 y1=0 x2="100%" y2=0 stroke="black" fill="white" stroke-width="3"
|
||||
:stroke-dasharray="attrDefine?.value">
|
||||
</line>
|
||||
</svg>
|
||||
<div v-if="hiddenCombo != '1'" style="display:flex;justify-content: center;align-items: center;">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-a-ziyuan466"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from 'ddei-framework';
|
||||
import {DDeiUtil} from 'ddei-framework';
|
||||
import {DDeiEnumBusCommandType} from 'ddei-framework';
|
||||
import {DDeiEnumOperateState} from 'ddei-framework';
|
||||
import {DDeiModelArrtibuteValue} from 'ddei-framework';
|
||||
import { DDeiEditorUtil, DDeiEnumOperateType } from 'ddei-framework';
|
||||
export default {
|
||||
name: "ddei-core-btn-borderdash",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
attrCode: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
|
||||
hiddenCombo: {
|
||||
type: String,
|
||||
default: '0'
|
||||
},
|
||||
|
||||
extcls: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
},
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
value: null
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
refreshEditor() {
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get(this.attrCode);
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
let valueDefine = this.getDataValue();
|
||||
if (valueDefine && !valueDefine.isDefault) {
|
||||
this.value = valueDefine.value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.attrDefine = null
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//打开弹出框
|
||||
showDialog(evt) {
|
||||
let srcElement = evt.currentTarget;
|
||||
DDeiEditorUtil.showOrCloseDialog(this.editor,"ddei-core-dialog-selectborderdash", {
|
||||
|
||||
value: this.attrDefine.value,
|
||||
dataSource: this.attrDefine.dataSource,
|
||||
callback: {
|
||||
ok: this.valueChange
|
||||
},
|
||||
group: "property-dialog"
|
||||
}, { type: 5 }, srcElement, false, true)
|
||||
},
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
//获取光标范围内的特殊样式,如果有且相同,则返回值,否则不返回值
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//获取特殊样式
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths)
|
||||
if (value === undefined) {
|
||||
value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true);
|
||||
}
|
||||
return { value: value };
|
||||
}
|
||||
}
|
||||
}
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue }
|
||||
}
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return { isDefault: true, value: this.attrDefine?.getParser().getDefaultValue() };
|
||||
},
|
||||
|
||||
|
||||
valueChange(value) {
|
||||
|
||||
this.value = value;
|
||||
this.attrDefine.value = value;
|
||||
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach(element => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code]
|
||||
}
|
||||
let hasEditSetted = false;
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue)
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos);
|
||||
setTimeout(() => {
|
||||
editorText.focus();
|
||||
}, 20);
|
||||
hasEditSetted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach(element => {
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: paths, value: parsedValue }, null, true);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
this.editor.bus.executeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ddei-pv-border-dash-combox {
|
||||
height: 28px;
|
||||
&--disabled .textinput {
|
||||
background-color: var(--panel-background);
|
||||
height: 28px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.textinput {
|
||||
width: 100%;
|
||||
padding-right: 5px;
|
||||
border: 0.5px solid var(--panel-border);//var(--panel-header);//darken(var(--panel-header), 13%);
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-left: 5px;
|
||||
height: 28px;
|
||||
|
||||
&:hover {
|
||||
border: 1px solid var(--dot);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.div_input {
|
||||
flex: 1 1 calc(100% - 10px);
|
||||
width: calc(100% - 10px);
|
||||
height: 3px;
|
||||
}
|
||||
|
||||
div {
|
||||
flex: 0 0 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 16px
|
||||
}
|
||||
</style>
|
||||
243
plugins/core/components/buttons/QBTBorderWeight.vue
Normal file
243
plugins/core/components/buttons/QBTBorderWeight.vue
Normal file
@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<div
|
||||
:class="{ 'ddei_pv_border_weight_combox': true, 'ddei_pv_border_weight_combox_disabled': !attrDefine || attrDefine.readonly }">
|
||||
<div class="textinput" @click="attrDefine && !attrDefine.readonly && showDialog($event)">
|
||||
<svg class="div_input">
|
||||
<line x1=0 y1=0 x2="100%" y2=0 stroke="black" fill="white" :stroke-width="attrDefine?.value">
|
||||
</line>
|
||||
</svg>
|
||||
<div v-if="hiddenCombo != '1'" style="display:flex;justify-content: center;align-items: center;">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-a-ziyuan466"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from 'ddei-framework';
|
||||
import {DDeiUtil} from 'ddei-framework';
|
||||
import {DDeiEnumBusCommandType} from 'ddei-framework';
|
||||
import {DDeiEnumOperateState} from 'ddei-framework';
|
||||
import { DDeiEnumOperateType } from 'ddei-framework';
|
||||
import {DDeiEditorUtil} from 'ddei-framework';
|
||||
export default {
|
||||
name: "ddei-core-btn-borderweight",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
attrCode: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
hiddenCombo: {
|
||||
type: String,
|
||||
default: '0'
|
||||
},
|
||||
|
||||
extcls: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
}
|
||||
,
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
value: null,
|
||||
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
refreshEditor() {
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get(this.attrCode);
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
let valueDefine = this.getDataValue();
|
||||
if (valueDefine && !valueDefine.isDefault) {
|
||||
this.value = valueDefine.value;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
this.attrDefine = null
|
||||
}
|
||||
},
|
||||
|
||||
//打开弹出框
|
||||
showDialog(evt) {
|
||||
let srcElement = evt.currentTarget;
|
||||
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectboderweight", {
|
||||
|
||||
value: this.attrDefine.value,
|
||||
dataSource: [
|
||||
{ value: "0.1" },
|
||||
{ value: "0.5" },
|
||||
{ value: "1" },
|
||||
{ value: "2" },
|
||||
{ value: "3" },
|
||||
{ value: "4" },
|
||||
{ value: "5" },
|
||||
{ value: "6" },
|
||||
{ value: "8" },
|
||||
{ value: "10" },
|
||||
{ value: "12" },
|
||||
],
|
||||
callback: {
|
||||
ok: this.valueChange
|
||||
},
|
||||
group: "property-dialog"
|
||||
}, { type: 5 }, srcElement, false, true)
|
||||
},
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
//文本编辑状态
|
||||
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue }
|
||||
}
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return { isDefault: true, value: this.attrDefine?.getParser().getDefaultValue() };
|
||||
},
|
||||
|
||||
|
||||
valueChange(value) {
|
||||
|
||||
this.value = value;
|
||||
this.attrDefine.value = value;
|
||||
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach(element => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code]
|
||||
}
|
||||
let hasEditSetted = false;
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue)
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos);
|
||||
setTimeout(() => {
|
||||
editorText.focus();
|
||||
}, 20);
|
||||
hasEditSetted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach(element => {
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: paths, value: parsedValue }, null, true);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
this.editor.bus.executeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ddei_pv_border_weight_combox {
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.ddei_pv_border_weight_combox_disabled .textinput {
|
||||
background-color: rgb(210, 210, 210);
|
||||
height: 28px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ddei_pv_border_weight_combox .textinput {
|
||||
width: 100%;
|
||||
padding-right: 5px;
|
||||
border: 0.5px solid rgb(210, 210, 210);
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-left: 5px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.ddei_pv_border_weight_combox .textinput:hover {
|
||||
border: 1px solid #017fff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ddei_pv_border_weight_combox .textinput {
|
||||
.div_input {
|
||||
flex: 1 1 calc(100% - 10px);
|
||||
width: calc(100% - 10px);
|
||||
height: 3px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.ddei_pv_border_weight_combox .textinput div {
|
||||
flex: 0 0 20px;
|
||||
}
|
||||
|
||||
|
||||
.icon {
|
||||
font-size: 16px
|
||||
}
|
||||
</style>
|
||||
243
plugins/core/components/buttons/QBTEditAddFontSize.vue
Normal file
243
plugins/core/components/buttons/QBTEditAddFontSize.vue
Normal file
@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<div :class="{ 'ddei-editor-quickifat-item-box': true, 'ddei-editor-quickifat-item-box--disabled': !attrDefine }"
|
||||
@click="attrDefine && valueChange($event)">
|
||||
<svg :class="'icon ' + (extcls ? extcls : '')" aria-hidden="true">
|
||||
<use :xlink:href="'#' + img"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from 'ddei-framework';
|
||||
import {DDeiUtil} from 'ddei-framework';
|
||||
import {DDeiEnumBusCommandType} from 'ddei-framework';
|
||||
import {DDeiEnumOperateState} from 'ddei-framework';
|
||||
import {DDeiModelArrtibuteValue} from 'ddei-framework';
|
||||
import {DDeiEditorEnumBusCommandType} from 'ddei-framework';
|
||||
import { DDeiEditorState, DDeiEnumOperateType } from 'ddei-framework';
|
||||
|
||||
export default {
|
||||
name: "ddei-core-btn-addfontsize",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
attrCode: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
addValue: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
extcls: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
},
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
value: 0
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
// 监听obj对象中prop属性的变化
|
||||
this.$watch("editor.textEditorSelectedChange", function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.refreshEditor();
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor()
|
||||
},
|
||||
methods: {
|
||||
|
||||
refreshEditor() {
|
||||
this.value = 0;
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get(this.attrCode);
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
let valueDefine = this.getDataValue();
|
||||
|
||||
if (valueDefine) {
|
||||
this.value = valueDefine.value;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
this.attrDefine = null
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
//获取光标范围内的特殊样式,如果有且相同,则返回值,否则不返回值
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths)
|
||||
if (value === undefined) {
|
||||
value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true);
|
||||
}
|
||||
return { value: value };
|
||||
}
|
||||
}
|
||||
}
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue }
|
||||
}
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return { isDefault: true, value: this.attrDefine?.getParser().getDefaultValue() };
|
||||
},
|
||||
|
||||
|
||||
valueChange(evt) {
|
||||
let value = this.value + this.addValue;
|
||||
this.value = value;
|
||||
this.attrDefine.value = value;
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach(element => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code]
|
||||
}
|
||||
let hasEditSetted = false;
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue)
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos);
|
||||
setTimeout(() => {
|
||||
editorText.focus();
|
||||
}, 20);
|
||||
hasEditSetted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach(element => {
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: paths, value: parsedValue }, evt, true);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {
|
||||
parts: ["topmenu"],
|
||||
});
|
||||
this.editor.bus.executeAll();
|
||||
if (this.editor.state != DDeiEditorState.QUICK_EDITING) {
|
||||
this.editor.changeState(DDeiEditorState.DESIGNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ddei-editor-quickifat-item-box {
|
||||
width: 22px;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
|
||||
&--disabled {
|
||||
pointer-events: none;
|
||||
filter: grayscale(1);
|
||||
opacity: 40%;
|
||||
background:var(--panel-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
background-color: var(--panel-hover);
|
||||
}
|
||||
|
||||
.magtop-1 {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.magtop-2 {
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.magtop-3 {
|
||||
margin-top: -3px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
295
plugins/core/components/buttons/QBTEditBox.vue
Normal file
295
plugins/core/components/buttons/QBTEditBox.vue
Normal file
@ -0,0 +1,295 @@
|
||||
<template>
|
||||
<div
|
||||
:class="{ 'ddei-editor-quick-fat-item-box': true, 'ddei-editor-quick-fat-item-box--selected': value, 'ddei-editor-quick-fat-item-box--disabled': !attrDefine }"
|
||||
@click="attrDefine && valueChange($event)">
|
||||
<svg :class="'icon ' + (extcls ? extcls : '')" aria-hidden="true">
|
||||
<use :xlink:href="'#' + img"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiEnumOperateState} from "ddei-framework";
|
||||
import {DDeiModelArrtibuteValue} from "ddei-framework";
|
||||
import {DDeiEditorEnumBusCommandType} from "ddei-framework";
|
||||
import { DDeiEditorState, DDeiEnumOperateType } from "ddei-framework";
|
||||
|
||||
export default {
|
||||
name: "ddei-core-btn-editbox",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {},
|
||||
props: {
|
||||
attrCode: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
unSelectValue: {
|
||||
default: null,
|
||||
},
|
||||
|
||||
supportQuickEdit: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
onlyQuickEdit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
selectedValue: {
|
||||
default: null,
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
extcls: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
},
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
value: false,
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
// 监听obj对象中prop属性的变化
|
||||
this.$watch("editor.textEditorSelectedChange", function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.refreshEditor();
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
|
||||
refreshEditor() {
|
||||
if (!this.supportQuickEdit && this.editor?.ddInstance?.stage?.render?.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
this.attrDefine = null
|
||||
return;
|
||||
}
|
||||
if (this.onlyQuickEdit && this.editor?.ddInstance?.stage?.render?.operateState != DDeiEnumOperateState.QUICK_EDITING) {
|
||||
this.attrDefine = null
|
||||
return;
|
||||
}
|
||||
this.value = false;
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get(this.attrCode);
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
let valueDefine = this.getDataValue();
|
||||
if (
|
||||
valueDefine &&
|
||||
!valueDefine.isDefault &&
|
||||
valueDefine.value + "" == this.selectedValue + ""
|
||||
) {
|
||||
this.value = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.attrDefine = null;
|
||||
}
|
||||
},
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
//获取光标范围内的特殊样式,如果有且相同,则返回值,否则不返回值
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//获取特殊样式
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
|
||||
|
||||
let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths)
|
||||
if (value === undefined) {
|
||||
value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true);
|
||||
}
|
||||
return { value: value };
|
||||
}
|
||||
}
|
||||
}
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(
|
||||
this.attrDefine.model,
|
||||
this.attrDefine.code,
|
||||
this.attrDefine.mapping
|
||||
);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue };
|
||||
}
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return {
|
||||
isDefault: true,
|
||||
value: this.attrDefine?.getParser().getDefaultValue(),
|
||||
};
|
||||
},
|
||||
|
||||
valueChange(evt) {
|
||||
if (this.value == true) {
|
||||
this.value = false;
|
||||
} else {
|
||||
this.value = true;
|
||||
}
|
||||
let value = this.unSelectValue;
|
||||
if (this.value == true) {
|
||||
value = this.selectedValue;
|
||||
}
|
||||
|
||||
this.attrDefine.value = value;
|
||||
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
let hasEditSetted = false;
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue)
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos);
|
||||
setTimeout(() => {
|
||||
editorText.focus();
|
||||
}, 20);
|
||||
hasEditSetted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach((element) => {
|
||||
this.editor.bus.push(
|
||||
DDeiEnumBusCommandType.ModelChangeValue,
|
||||
{ mids: [element.id], paths: paths, value: parsedValue },
|
||||
evt,
|
||||
true
|
||||
);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt);
|
||||
this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {
|
||||
parts: ["topmenu"],
|
||||
});
|
||||
this.editor.bus.executeAll();
|
||||
if (this.editor.state != DDeiEditorState.QUICK_EDITING) {
|
||||
this.editor.changeState(DDeiEditorState.DESIGNING);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ddei-editor-quick-fat-item-box {
|
||||
width: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
background-color: var(--panel-hover);
|
||||
}
|
||||
|
||||
&--selected {
|
||||
background-color: var(--panel-selected);
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
background-color: var(--panel-disabled);
|
||||
pointer-events: none;
|
||||
cursor: not-allowed;
|
||||
filter: grayscale(1);
|
||||
opacity: 40%;
|
||||
}
|
||||
|
||||
.rotate-90 {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.ext-underline {
|
||||
margin-top: 5.5px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.magtop-1 {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.magtop-2 {
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.magtop-3 {
|
||||
margin-top: -3px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
254
plugins/core/components/buttons/QBTEditColor.vue
Normal file
254
plugins/core/components/buttons/QBTEditColor.vue
Normal file
@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<div :class="{ 'ddei-editor-quick-fat-item-box': true, 'ddei-editor-quick-fat-item-box--disabled': !attrDefine }"
|
||||
@click="attrDefine && showColor($event)">
|
||||
<svg :class="'icon ' + (extcls ? extcls : '')" aria-hidden="true">
|
||||
<use :xlink:href="'#' + img"></use>
|
||||
</svg>
|
||||
<div class="colorbar" :style="{ 'background-color': value ? value : 'black' }"></div>
|
||||
<input ref="colorInput" type="color" v-model="value" class="colinput" autocomplete="off" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from 'ddei-framework';
|
||||
import {DDeiUtil} from 'ddei-framework';
|
||||
import {DDeiEnumBusCommandType} from 'ddei-framework';
|
||||
import {DDeiEnumOperateState} from 'ddei-framework';
|
||||
import {DDeiModelArrtibuteValue} from 'ddei-framework';
|
||||
import { DDeiEditorUtil, DDeiEnumOperateType } from 'ddei-framework';
|
||||
export default {
|
||||
name: "ddei-core-btn-color",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
attrCode: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
extcls: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
},
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
value: null
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
// 监听obj对象中prop属性的变化
|
||||
this.$watch("editor.textEditorSelectedChange", function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.refreshEditor();
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
refreshEditor() {
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get(this.attrCode);
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
let valueDefine = this.getDataValue();
|
||||
if (valueDefine && !valueDefine.isDefault) {
|
||||
this.value = valueDefine.value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.attrDefine = null
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
showColor(evt) {
|
||||
let editorState = this.editor.state
|
||||
let colorInput = this.$refs.colorInput
|
||||
// colorInput.showPicker()
|
||||
let srcElement = evt.currentTarget;
|
||||
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectcolor", {
|
||||
value: colorInput.value,
|
||||
callback: {
|
||||
ok: this.valueChange
|
||||
},
|
||||
group: "property-dialog"
|
||||
}, { type: 5 }, srcElement, false, true)
|
||||
this.editor.state = editorState
|
||||
},
|
||||
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
//获取光标范围内的特殊样式,如果有且相同,则返回值,否则不返回值
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//获取特殊样式
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths)
|
||||
if (value === undefined) {
|
||||
value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true);
|
||||
}
|
||||
return { value: value };
|
||||
}
|
||||
}
|
||||
}
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue }
|
||||
}
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return { isDefault: true, value: this.attrDefine?.getParser().getDefaultValue() };
|
||||
},
|
||||
|
||||
|
||||
valueChange(value) {
|
||||
|
||||
this.value = value;
|
||||
this.attrDefine.value = value;
|
||||
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach(element => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code]
|
||||
}
|
||||
let hasEditSetted = false;
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue)
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos);
|
||||
setTimeout(() => {
|
||||
editorText.focus();
|
||||
}, 20);
|
||||
hasEditSetted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach(element => {
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: paths, value: parsedValue }, null, true);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
this.editor.bus.executeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ddei-editor-quick-fat-item-box {
|
||||
width: 15px;
|
||||
height: 24px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
.icon {
|
||||
flex: 0 0 16px;
|
||||
}
|
||||
|
||||
.colorbar {
|
||||
width: 100%;
|
||||
flex: 0 0 3px;
|
||||
}
|
||||
|
||||
.colinput {
|
||||
border: none;
|
||||
outline: none;
|
||||
display: block;
|
||||
margin-top: 5px
|
||||
}
|
||||
.magtop-1 {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
background-color: var(--panel-hover);
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
background-color: var(--panel-disabled);
|
||||
pointer-events: none;
|
||||
cursor: not-allowed;
|
||||
filter: grayscale(1);
|
||||
opacity: 40%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
224
plugins/core/components/buttons/QBTEditTextAlign.vue
Normal file
224
plugins/core/components/buttons/QBTEditTextAlign.vue
Normal file
@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<div
|
||||
:class="{ 'ddei-editor-quick-fat-item-box': true, 'ddei-editor-quick-fat-item-box--disabled': !(attrDefine || valignAttrDefine) }"
|
||||
@click="(attrDefine || valignAttrDefine) && showTextAlignDialog($event)">
|
||||
<svg :class="'icon ' + (extcls ? extcls : '')" aria-hidden="true">
|
||||
<use :xlink:href="'#' + img"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiEditorEnumBusCommandType} from "ddei-framework";
|
||||
import { DDeiEditorUtil, DDeiEnumOperateType, DDeiUtil } from "ddei-framework";
|
||||
|
||||
export default {
|
||||
name: "ddei-core-btn-textalign",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {},
|
||||
props: {
|
||||
|
||||
img: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
extcls: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
},
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
valignAttrDefine: null,
|
||||
value: false,
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
|
||||
showTextAlignDialog(evt: Event) {
|
||||
let srcElement = evt.currentTarget;
|
||||
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-textalign", {
|
||||
group: "top-dialog",
|
||||
align: this.attrDefine.value,
|
||||
valign: this.valignAttrDefine.value,
|
||||
callback: {
|
||||
ok: this.valueChange
|
||||
}
|
||||
}, { type: 5 }, srcElement, false, true)
|
||||
},
|
||||
|
||||
refreshEditor() {
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get("textStyle.align");
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
this.valignAttrDefine = this.controlDefine.attrDefineMap.get(
|
||||
"textStyle.valign"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
this.attrDefine = null;
|
||||
this.valignAttrDefine = null;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
valueChange(value = 5) {
|
||||
|
||||
switch (value) {
|
||||
case 1:
|
||||
this.attrDefine.value = 1
|
||||
this.valignAttrDefine.value = 1
|
||||
break;
|
||||
case 2:
|
||||
this.attrDefine.value = 2
|
||||
this.valignAttrDefine.value = 1
|
||||
break;
|
||||
case 3:
|
||||
this.attrDefine.value = 3
|
||||
this.valignAttrDefine.value = 1
|
||||
break;
|
||||
case 4:
|
||||
this.attrDefine.value = 1
|
||||
this.valignAttrDefine.value = 2
|
||||
break;
|
||||
case 5:
|
||||
this.attrDefine.value = 2
|
||||
this.valignAttrDefine.value = 2
|
||||
break;
|
||||
case 6:
|
||||
this.attrDefine.value = 3
|
||||
this.valignAttrDefine.value = 2
|
||||
break;
|
||||
case 7:
|
||||
this.attrDefine.value = 1
|
||||
this.valignAttrDefine.value = 3
|
||||
break;
|
||||
case 8:
|
||||
this.attrDefine.value = 2
|
||||
this.valignAttrDefine.value = 3
|
||||
break;
|
||||
case 9:
|
||||
this.attrDefine.value = 3
|
||||
this.valignAttrDefine.value = 3
|
||||
break;
|
||||
}
|
||||
|
||||
this.editor.ddInstance.stage.selectedModels.forEach((element) => {
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
let paths1 = [];
|
||||
this.valignAttrDefine?.mapping?.forEach((element) => {
|
||||
paths1.push(element);
|
||||
});
|
||||
if (!(paths1?.length > 0)) {
|
||||
paths1 = [this.valignAttrDefine.code];
|
||||
}
|
||||
this.editor.bus.push(
|
||||
DDeiEnumBusCommandType.ModelChangeValue,
|
||||
{ mids: [element.id], paths: paths, value: this.attrDefine.value },
|
||||
null,
|
||||
true
|
||||
);
|
||||
this.editor.bus.push(
|
||||
DDeiEnumBusCommandType.ModelChangeValue,
|
||||
{ mids: [element.id], paths: paths1, value: this.valignAttrDefine.value },
|
||||
null,
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
this.editor.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts, {
|
||||
parts: ["topmenu"],
|
||||
});
|
||||
this.editor.bus.executeAll();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ddei-editor-quick-fat-item-box {
|
||||
width: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
background-color: var(--panel-hover);
|
||||
}
|
||||
|
||||
&--selected {
|
||||
background-color: var(--panel-selected);
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
pointer-events: none;
|
||||
color: var(--panel-title-selected);
|
||||
cursor: not-allowed;
|
||||
background-color: var(--panel-selected);
|
||||
}
|
||||
|
||||
.rotate-90 {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.ext-underline {
|
||||
margin-top: 5.5px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.magtop-1 {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.magtop-2 {
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.magtop-3 {
|
||||
margin-top: -3px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
323
plugins/core/components/buttons/QBTFontFamily.vue
Normal file
323
plugins/core/components/buttons/QBTFontFamily.vue
Normal file
@ -0,0 +1,323 @@
|
||||
<template>
|
||||
<div>
|
||||
<div id="ddei-editor-quick-fat-item-fontfamily"
|
||||
:class="{ 'ddei-editor-quick-fat-item-fontfamily': true, 'ddei-editor-quick-fat-item-fontfamily--disabled': !attrDefine }">
|
||||
<input class="ddei-editor-quick-fat-item-fontfamily_input"
|
||||
:readonly="!attrDefine || (attrDefine && (attrDefine.readonly || !canSearch))" v-model="text"
|
||||
:placeholder="defaultText" @click="attrDefine && !attrDefine.readonly && !canSearch && showDialog($event)"
|
||||
@keydown="search($event)" autocomplete="off" />
|
||||
<div class="ddei-editor-quick-fat-item-fontfamily_combox"
|
||||
@click="attrDefine && !attrDefine.readonly && showDialog($event)">
|
||||
<svg class="icon iconfont-45" aria-hidden="true">
|
||||
<use xlink:href="#icon-a-ziyuan478"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { debounce } from "lodash";
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEditorUtil} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiEnumOperateState} from "ddei-framework";
|
||||
import { DDeiModelArrtibuteValue, DDeiEnumOperateType } from "ddei-framework";
|
||||
|
||||
export default {
|
||||
name: "ddei-core-btn-fontfamily",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {},
|
||||
props: {
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
},
|
||||
controlDefine:{
|
||||
type:Object,
|
||||
default:null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
dataSource: null,
|
||||
value: null,
|
||||
text: null,
|
||||
defaultText: null,
|
||||
expanded: false,
|
||||
canSearch: true
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
// 搜索框防抖
|
||||
this.search = debounce(this.search, 200);
|
||||
// 监听obj对象中prop属性的变化
|
||||
this.$watch("editor.textEditorSelectedChange", function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.refreshEditor();
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
|
||||
refreshEditor() {
|
||||
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get("font.family");
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0){
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1){
|
||||
this.attrDefine = attrD
|
||||
}
|
||||
|
||||
} else {
|
||||
this.attrDefine = null;
|
||||
}
|
||||
|
||||
this.getDataSource(this.attrDefine);
|
||||
let type = this.getDataValue();
|
||||
let define = this.getDataDefine(type.value);
|
||||
if (!type.isDefault) {
|
||||
this.attrDefine.value = type.value;
|
||||
this.text = define.text;
|
||||
if (define.img) {
|
||||
this.$refs.combox.img = define.img;
|
||||
}
|
||||
} else {
|
||||
this.defaultText = define.text;
|
||||
}
|
||||
this.value = type.value;
|
||||
|
||||
},
|
||||
|
||||
|
||||
search() {
|
||||
//过滤dataSource,找到text
|
||||
this.searchText = this.text;
|
||||
this.getDataSource(this.attrDefine);
|
||||
this.showDialog();
|
||||
},
|
||||
|
||||
//打开弹出框
|
||||
showDialog(evt: Event) {
|
||||
let srcElement = evt.currentTarget;
|
||||
|
||||
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectfont", {
|
||||
dataSource: this.dataSource,
|
||||
value: this.attrDefine.value,
|
||||
group: "property-dialog",
|
||||
callback: {
|
||||
ok: this.valueChange
|
||||
}
|
||||
}, { type: 5 }, srcElement, false, true)
|
||||
},
|
||||
/**
|
||||
* 根据值获取选项定义
|
||||
* @param value 值
|
||||
*/
|
||||
getDataDefine(value) {
|
||||
if (this.dataSource && value) {
|
||||
for (let i = 0; i < this.dataSource.length; i++) {
|
||||
if (this.dataSource[i].value.toString() == value.toString()) {
|
||||
return this.dataSource[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return { text: "" };
|
||||
},
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
//获取光标范围内的特殊样式,如果有且相同,则返回值,否则不返回值
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//获取特殊样式
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths)
|
||||
if (value === undefined) {
|
||||
value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true);
|
||||
}
|
||||
return { value: value };
|
||||
}
|
||||
}
|
||||
}
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(
|
||||
this.attrDefine.model,
|
||||
this.attrDefine.code,
|
||||
this.attrDefine.mapping
|
||||
);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue };
|
||||
}
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return {
|
||||
isDefault: true,
|
||||
value: this.attrDefine?.getParser().getDefaultValue(),
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取数据源数据
|
||||
*/
|
||||
getDataSource(attrDefine) {
|
||||
if (this.attrDefine) {
|
||||
let dataSources = DDeiEditorUtil.getDataSource(
|
||||
this.editor,
|
||||
this.attrDefine,
|
||||
this.searchText
|
||||
);
|
||||
this.dataSource = dataSources;
|
||||
return this.dataSource;
|
||||
}
|
||||
},
|
||||
|
||||
valueChange(value, evt) {
|
||||
this.attrDefine.value = value;
|
||||
let itemDefine = this.getDataDefine(value);
|
||||
let text = itemDefine.text;
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
let hasEditSetted = false;
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue)
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos);
|
||||
setTimeout(() => {
|
||||
editorText.focus();
|
||||
}, 20);
|
||||
|
||||
hasEditSetted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach((element) => {
|
||||
this.editor.bus.push(
|
||||
DDeiEnumBusCommandType.ModelChangeValue,
|
||||
{ mids: [element.id], paths: paths, value: parsedValue },
|
||||
evt,
|
||||
true
|
||||
);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt);
|
||||
this.editor.bus.executeAll();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/*字体选择框*/
|
||||
|
||||
.ddei-editor-quick-fat-item-fontfamily {
|
||||
background-color: var(--panel-background);
|
||||
height: 24px;
|
||||
display: flex;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1px solid var(--panel-border);//darken(var(--panel-header), 13%);
|
||||
border-right: none;
|
||||
|
||||
&:hover {
|
||||
border: 0.5px solid var(--dot);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&--disabled{
|
||||
&:hover {
|
||||
background-color: var(--panel-disabled);
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
}
|
||||
|
||||
&_input {
|
||||
width: calc(100% - 20px);
|
||||
border: transparent;
|
||||
outline: none;
|
||||
font-size: 15px;
|
||||
color:var(--panel-title);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&_combox {
|
||||
height: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.iconfont-45 {
|
||||
font-size: 13px
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
373
plugins/core/components/buttons/QBTFontSize.vue
Normal file
373
plugins/core/components/buttons/QBTFontSize.vue
Normal file
@ -0,0 +1,373 @@
|
||||
<template>
|
||||
<div>
|
||||
<div id="ddei-editor-quick-fat-item-fontsize"
|
||||
:class="{ 'ddei-editor-quick-fat-item-fontsize': true, 'ddei-editor-quick-fat-item-fontsize--disabled': !attrDefine }">
|
||||
<input class="ddei-editor-quick-fat-item-fontsize_input"
|
||||
:readonly="!attrDefine || (attrDefine && (attrDefine.readonly))" v-model="text" @input="inputValue()"
|
||||
:placeholder="defaultText" autocomplete="off" />
|
||||
<div class="ddei-editor-quick-fat-item-fontsize_combox"
|
||||
@click="attrDefine && !attrDefine.readonly && showDialog($event)">
|
||||
<svg class="icon iconfont-45" aria-hidden="true">
|
||||
<use xlink:href="#icon-a-ziyuan478"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from "ddei-framework";
|
||||
import {DDeiEditorUtil} from "ddei-framework";
|
||||
import {DDeiUtil} from "ddei-framework";
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiEnumOperateState} from "ddei-framework";
|
||||
import { DDeiModelArrtibuteValue, DDeiEnumOperateType } from "ddei-framework";
|
||||
|
||||
export default {
|
||||
name: "ddei-core-btn-fontsize",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {},
|
||||
props: {
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
},
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
dataSource: null,
|
||||
value: null,
|
||||
text: null,
|
||||
defaultText: null,
|
||||
expanded: false,
|
||||
canSearch: true,
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
// 监听obj对象中prop属性的变化
|
||||
this.$watch("editor.textEditorSelectedChange", function (newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.refreshEditor();
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
|
||||
refreshEditor() {
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get("font.size");
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
}
|
||||
} else {
|
||||
this.attrDefine = null;
|
||||
}
|
||||
if (this.attrDefine) {
|
||||
this.getDataSource(this.attrDefine);
|
||||
let type = this.getDataValue()
|
||||
|
||||
let define = this.getDataDefine(type.value);
|
||||
if (!type.isDefault) {
|
||||
this.attrDefine.value = type.value;
|
||||
this.text = define.text;
|
||||
} else {
|
||||
this.defaultText = define.text;
|
||||
}
|
||||
if (this.attrDefine.value) {
|
||||
this.value = this.attrDefine.value;
|
||||
this.text = this.attrDefine.value;
|
||||
} else {
|
||||
this.value = type.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
inputValue(value) {
|
||||
//过滤dataSource,找到text
|
||||
let dialogSet = false;
|
||||
if (value) {
|
||||
dialogSet = true
|
||||
this.attrDefine.value = value;
|
||||
let itemDefine = this.getDataDefine(value);
|
||||
let text = itemDefine.text;
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
} else {
|
||||
value = this.text;
|
||||
this.attrDefine.value = value;
|
||||
this.value = value;
|
||||
let itemDefine = this.getDataDefine(value);
|
||||
if (itemDefine?.text) {
|
||||
this.text = itemDefine.text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
parsedValue = isNaN(parsedValue) || parsedValue <= 0 ? null : parsedValue
|
||||
parsedValue = parsedValue > 300 ? 300 : parsedValue
|
||||
let hasEditSetted = false;
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue)
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos);
|
||||
if (dialogSet) {
|
||||
setTimeout(() => {
|
||||
editorText.focus();
|
||||
}, 20);
|
||||
}
|
||||
hasEditSetted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach((element) => {
|
||||
this.editor.bus.push(
|
||||
DDeiEnumBusCommandType.ModelChangeValue,
|
||||
{ mids: [element.id], paths: paths, value: parsedValue },
|
||||
null,
|
||||
true
|
||||
);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
this.editor.bus.executeAll();
|
||||
},
|
||||
|
||||
|
||||
//打开弹出框
|
||||
showDialog(evt: Event) {
|
||||
let srcElement = evt.currentTarget;
|
||||
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-selectfontsize", {
|
||||
dataSource: this.dataSource,
|
||||
value: this.attrDefine.value,
|
||||
group: "property-dialog",
|
||||
callback: {
|
||||
ok: this.inputValue
|
||||
}
|
||||
}, { type: 5 }, srcElement, false, true)
|
||||
},
|
||||
/**
|
||||
* 根据值获取选项定义
|
||||
* @param value 值
|
||||
*/
|
||||
getDataDefine(value) {
|
||||
if (this.dataSource && value) {
|
||||
for (let i = 0; i < this.dataSource.length; i++) {
|
||||
if (this.dataSource[i].value.toString() == value.toString()) {
|
||||
return this.dataSource[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return { text: "" };
|
||||
},
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
//获取光标范围内的特殊样式,如果有且相同,则返回值,否则不返回值
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//获取特殊样式
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
|
||||
let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths)
|
||||
if (value === undefined) {
|
||||
value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true);
|
||||
return { isDefault: true, value: value };
|
||||
} else {
|
||||
return { value: value };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(
|
||||
this.attrDefine.model,
|
||||
this.attrDefine.code,
|
||||
this.attrDefine.mapping
|
||||
);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue };
|
||||
}
|
||||
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return {
|
||||
isDefault: true,
|
||||
value: this.attrDefine?.getParser().getDefaultValue(),
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取数据源数据
|
||||
*/
|
||||
getDataSource(attrDefine) {
|
||||
if (this.attrDefine) {
|
||||
this.attrDefine.dataSource = [
|
||||
{ text: "9", value: 9 },
|
||||
{ text: "10", value: 10 },
|
||||
{ text: "10.5", value: 10.5 },
|
||||
{ text: "11", value: 11 },
|
||||
{ text: "12", value: 12 },
|
||||
{ text: "13", value: 13 },
|
||||
{ text: "14", value: 14 },
|
||||
{ text: "18", value: 18 },
|
||||
{ text: "24", value: 24 },
|
||||
{ text: "36", value: 36 },
|
||||
{ text: "48", value: 48 },
|
||||
{ text: "64", value: 64 },
|
||||
{ text: "72", value: 72 },
|
||||
{ text: "96", value: 96 },
|
||||
{ text: "144", value: 144 },
|
||||
{ text: "288", value: 288 },
|
||||
];
|
||||
let dataSources = DDeiEditorUtil.getDataSource(
|
||||
this.editor,
|
||||
this.attrDefine,
|
||||
this.searchText
|
||||
);
|
||||
this.dataSource = dataSources;
|
||||
return this.dataSource;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
/*字体大小设置框 */
|
||||
|
||||
.ddei-editor-quick-fat-item-fontsize {
|
||||
background-color: var(--panel-background);
|
||||
height: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border: 1px solid var(--panel-border);//darken(var(--panel-header), 13%);
|
||||
|
||||
&:hover {
|
||||
border: 0.5px solid var(--dot);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&--disabled:hover {
|
||||
background-color: var(--panel-disabled);
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
&_input {
|
||||
width: calc(100% - 20px);
|
||||
border: transparent;
|
||||
outline: none;
|
||||
color:var(--panel-title);
|
||||
font-size: 15px;
|
||||
background: transparent;
|
||||
|
||||
}
|
||||
|
||||
&_combox {
|
||||
height: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.iconfont-45 {
|
||||
font-size: 13px
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ddei-editor-quick-fat-item-box {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
|
||||
|
||||
&--disabled {
|
||||
color: var(--panel-title-disabled);
|
||||
filter: brightness(200%) !important;
|
||||
}
|
||||
|
||||
&--disabled:hover {
|
||||
background-color: var(--panel-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(--panel-hover);
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
214
plugins/core/components/buttons/QBTLinePointType.vue
Normal file
214
plugins/core/components/buttons/QBTLinePointType.vue
Normal file
@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<div
|
||||
:class="{ 'ddei_pv_line_point_combox': true, 'ddei_pv_line_point_combox_disabled': !attrDefine || attrDefine.readonly }">
|
||||
<div class="textinput" @click="attrDefine && !attrDefine.readonly && showDialog($event)">
|
||||
<div class="div_input">
|
||||
{{ text }}
|
||||
</div>
|
||||
<div style="display:flex;justify-content: center;align-items: center;">
|
||||
<svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-a-ziyuan466"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from 'ddei-framework';
|
||||
import {DDeiUtil} from 'ddei-framework';
|
||||
import {DDeiEnumBusCommandType} from 'ddei-framework';
|
||||
import { DDeiEditorUtil, DDeiEnumOperateType } from 'ddei-framework';
|
||||
export default {
|
||||
name: "ddei-core-btn-linepointtype",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
attrCode: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
|
||||
extcls: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
}
|
||||
,
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
value: null,
|
||||
text: ""
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
refreshText() {
|
||||
let text = ""
|
||||
if (this.attrDefine?.dataSource) {
|
||||
|
||||
for (let i = 0; i < this.attrDefine.dataSource.length; i++) {
|
||||
if (this.attrDefine.dataSource[i].value == this.value) {
|
||||
text = this.attrDefine.dataSource[i].text
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.text = text
|
||||
},
|
||||
refreshEditor() {
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get(this.attrCode);
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
let valueDefine = this.getDataValue();
|
||||
if (valueDefine && !valueDefine.isDefault) {
|
||||
this.value = valueDefine.value;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
this.attrDefine = null
|
||||
}
|
||||
this.refreshText();
|
||||
},
|
||||
|
||||
//打开弹出框
|
||||
showDialog(evt) {
|
||||
let srcElement = evt.currentTarget;
|
||||
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-linepointtype", {
|
||||
|
||||
value: this.attrDefine.value,
|
||||
dataSource: this.attrDefine.dataSource,
|
||||
callback: {
|
||||
ok: this.valueChange
|
||||
},
|
||||
group: "property-dialog"
|
||||
}, { type: 5 }, srcElement, false, true)
|
||||
},
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue }
|
||||
}
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return { isDefault: true, value: this.attrDefine?.getParser().getDefaultValue() };
|
||||
},
|
||||
|
||||
|
||||
valueChange(value) {
|
||||
|
||||
this.value = value;
|
||||
this.attrDefine.value = value;
|
||||
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach(element => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code]
|
||||
}
|
||||
let hasEditSetted = false;
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach(element => {
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: paths, value: parsedValue }, null, true);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
this.editor.bus.executeAll();
|
||||
this.refreshText();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ddei_pv_line_point_combox {
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.ddei_pv_line_point_combox_disabled .textinput {
|
||||
background-color: var(--panel-background);
|
||||
height: 28px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ddei_pv_line_point_combox .textinput {
|
||||
width: 100%;
|
||||
padding-right: 5px;
|
||||
border: 0.5px solid var(--panel-border);//darken(var(--panel-header), 13%);
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-left: 5px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.ddei_pv_line_point_combox .textinput:hover {
|
||||
border: 1px solid var(--dot);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ddei_pv_line_point_combox .textinput {
|
||||
.div_input {
|
||||
flex: 1 1 calc(100% - 10px);
|
||||
width: calc(100% - 10px);
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.ddei_pv_line_point_combox .textinput div {
|
||||
flex: 0 0 20px;
|
||||
}
|
||||
|
||||
|
||||
.icon {
|
||||
font-size: 16px
|
||||
}
|
||||
</style>
|
||||
223
plugins/core/components/buttons/QBTLineType.vue
Normal file
223
plugins/core/components/buttons/QBTLineType.vue
Normal file
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div @click="attrDefine && showDialog($event)"
|
||||
:class="{ 'ddei-pv-line-type-combox': true, 'ddei-pv-line-type-combox--disabled': !attrDefine || attrDefine.readonly }">
|
||||
<svg :class="'icon ' + (extcls ? extcls : '')" aria-hidden="true">
|
||||
<use :xlink:href="'#' + img"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {DDeiEditor} from 'ddei-framework';
|
||||
import {DDeiUtil} from 'ddei-framework';
|
||||
import {DDeiEnumBusCommandType} from 'ddei-framework';
|
||||
import {DDeiEnumOperateState} from 'ddei-framework';
|
||||
import {DDeiModelArrtibuteValue} from 'ddei-framework';
|
||||
import { DDeiEditorUtil, DDeiEnumOperateType } from 'ddei-framework';
|
||||
export default {
|
||||
name: "ddei-core-btn-linetype",
|
||||
extends: null,
|
||||
mixins: [],
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
attrCode: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
|
||||
extcls: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
//外部传入的插件扩展参数
|
||||
options: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
, editor: {
|
||||
type: DDeiEditor,
|
||||
default: null,
|
||||
},
|
||||
controlDefine: {
|
||||
type: Object,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
attrDefine: null,
|
||||
value: null
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.refreshEditor();
|
||||
},
|
||||
methods: {
|
||||
refreshEditor() {
|
||||
if (this.controlDefine) {
|
||||
let attrD = this.controlDefine.attrDefineMap.get(this.attrCode);
|
||||
let mds = []
|
||||
if (this.editor.ddInstance.stage.selectedModels?.size > 0) {
|
||||
mds = Array.from(this.editor.ddInstance.stage.selectedModels.values())
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_EDIT_BEFORE", DDeiEnumOperateType.EDIT, { models: mds, propName: attrD?.code }, this.editor.ddInstance)
|
||||
if (rsState != -1) {
|
||||
this.attrDefine = attrD
|
||||
let valueDefine = this.getDataValue();
|
||||
if (valueDefine && !valueDefine.isDefault) {
|
||||
this.value = valueDefine.value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.attrDefine = null
|
||||
}
|
||||
},
|
||||
|
||||
//打开弹出框
|
||||
showDialog(evt) {
|
||||
let srcElement = evt.currentTarget;
|
||||
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-linetype", {
|
||||
|
||||
value: this.attrDefine.value,
|
||||
dataSource: this.attrDefine.dataSource,
|
||||
callback: {
|
||||
ok: this.valueChange
|
||||
},
|
||||
group: "property-dialog"
|
||||
}, { type: 5 }, srcElement, false, true)
|
||||
},
|
||||
|
||||
//获取数据值
|
||||
getDataValue() {
|
||||
if (this.attrDefine) {
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
//获取光标范围内的特殊样式,如果有且相同,则返回值,否则不返回值
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//获取特殊样式
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach((element) => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code];
|
||||
}
|
||||
let value = shadowControl.getSptStyle(curSIdx, curEIdx, paths)
|
||||
if (value === undefined) {
|
||||
value = DDeiModelArrtibuteValue.getAttrValueByState(shadowControl, paths[0], true);
|
||||
}
|
||||
return { value: value };
|
||||
}
|
||||
}
|
||||
}
|
||||
let dataValue = this.attrDefine.value;
|
||||
if (!dataValue) {
|
||||
dataValue = DDeiUtil.getDataByPathList(this.attrDefine.model, this.attrDefine.code, this.attrDefine.mapping);
|
||||
}
|
||||
if (dataValue) {
|
||||
return { value: dataValue }
|
||||
}
|
||||
}
|
||||
//通过解析器获取有效值
|
||||
return { isDefault: true, value: this.attrDefine?.getParser().getDefaultValue() };
|
||||
},
|
||||
|
||||
|
||||
valueChange(value) {
|
||||
|
||||
this.value = value;
|
||||
this.attrDefine.value = value;
|
||||
|
||||
//通过解析器获取有效值
|
||||
let parser: DDeiAbstractArrtibuteParser = this.attrDefine.getParser();
|
||||
//属性值
|
||||
let parsedValue = parser.parseValue(value);
|
||||
//获取属性路径
|
||||
let paths = [];
|
||||
this.attrDefine?.mapping?.forEach(element => {
|
||||
paths.push(element);
|
||||
});
|
||||
if (!(paths?.length > 0)) {
|
||||
paths = [this.attrDefine.code]
|
||||
}
|
||||
let hasEditSetted = false;
|
||||
//文本编辑状态
|
||||
if (this.editor.ddInstance.stage.render.operateState == DDeiEnumOperateState.QUICK_EDITING) {
|
||||
//读取文本的一部分修改其样式
|
||||
let shadowControl = this.editor.ddInstance.stage.render.editorShadowControl
|
||||
if (shadowControl?.render.isEditoring) {
|
||||
let editorText = DDeiUtil.getEditorText();
|
||||
//开始光标与结束光标
|
||||
let curSIdx = -1
|
||||
let curEIdx = -1
|
||||
if (editorText) {
|
||||
curSIdx = editorText.selectionStart
|
||||
curEIdx = editorText.selectionEnd
|
||||
}
|
||||
if (curSIdx != -1 && curEIdx != -1 && curSIdx <= curSIdx) {
|
||||
//增加特殊样式
|
||||
shadowControl.setSptStyle(curSIdx, curEIdx, paths, parsedValue)
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.TextEditorChangeSelectPos);
|
||||
setTimeout(() => {
|
||||
editorText.focus();
|
||||
}, 20);
|
||||
hasEditSetted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasEditSetted) {
|
||||
this.editor.ddInstance.stage.selectedModels.forEach(element => {
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.ModelChangeValue, { mids: [element.id], paths: paths, value: parsedValue }, null, true);
|
||||
});
|
||||
}
|
||||
this.editor.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
this.editor.bus.executeAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ddei-pv-line-type-combox {
|
||||
width: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
background-color: var(--panel-hover);
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
pointer-events: none;
|
||||
background-color: var(--panel-disabled);
|
||||
color: var(--panel-title-disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
42
plugins/core/components/buttons/qbt-addfontsize.ts
Normal file
42
plugins/core/components/buttons/qbt-addfontsize.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTEditAddFontSize from './QBTEditAddFontSize.vue';
|
||||
|
||||
class DDeiCoreAddFontSizeButton extends DDeiPluginBase{
|
||||
name: string = QBTEditAddFontSize.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreAddFontSizeButton = new DDeiCoreAddFontSizeButton(null);
|
||||
|
||||
|
||||
plugins: object[] = [QBTEditAddFontSize]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTEditAddFontSize.name]) {
|
||||
for (let i in options[QBTEditAddFontSize.name]) {
|
||||
newOptions[i] = options[QBTEditAddFontSize.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreAddFontSizeButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreAddFontSizeButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreAddFontSizeButton
|
||||
42
plugins/core/components/buttons/qbt-borderdash.ts
Normal file
42
plugins/core/components/buttons/qbt-borderdash.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTBorderDash from './QBTBorderDash.vue';
|
||||
|
||||
class DDeiCoreBorderDashButton extends DDeiPluginBase{
|
||||
name: string = QBTBorderDash.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreBorderDashButton = new DDeiCoreBorderDashButton(null);
|
||||
|
||||
plugins: object[] = [QBTBorderDash]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTBorderDash.name]) {
|
||||
for (let i in options[QBTBorderDash.name]) {
|
||||
newOptions[i] = options[QBTBorderDash.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreBorderDashButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreBorderDashButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreBorderDashButton
|
||||
41
plugins/core/components/buttons/qbt-borderweight.ts
Normal file
41
plugins/core/components/buttons/qbt-borderweight.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTBorderWeight from './QBTBorderWeight.vue';
|
||||
|
||||
class DDeiCoreBorderWeightButton extends DDeiPluginBase{
|
||||
name: string = QBTBorderWeight.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreBorderWeightButton = new DDeiCoreBorderWeightButton(null);
|
||||
|
||||
plugins: object[] = [QBTBorderWeight]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTBorderWeight.name]) {
|
||||
for (let i in options[QBTBorderWeight.name]) {
|
||||
newOptions[i] = options[QBTBorderWeight.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreBorderWeightButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreBorderWeightButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreBorderWeightButton
|
||||
41
plugins/core/components/buttons/qbt-editbox.ts
Normal file
41
plugins/core/components/buttons/qbt-editbox.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTEditBox from './QBTEditBox.vue';
|
||||
|
||||
class DDeiCoreEditBoxButton extends DDeiPluginBase{
|
||||
name: string = QBTEditBox.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreEditBoxButton = new DDeiCoreEditBoxButton(null);
|
||||
|
||||
plugins: object[] = [QBTEditBox]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTEditBox.name]) {
|
||||
for (let i in options[QBTEditBox.name]) {
|
||||
newOptions[i] = options[QBTEditBox.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreEditBoxButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreEditBoxButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreEditBoxButton
|
||||
42
plugins/core/components/buttons/qbt-editcolor.ts
Normal file
42
plugins/core/components/buttons/qbt-editcolor.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTEditColor from './QBTEditColor.vue';
|
||||
|
||||
class DDeiCoreEditColorButton extends DDeiPluginBase{
|
||||
name: string = QBTEditColor.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreEditColorButton = new DDeiCoreEditColorButton(null);
|
||||
|
||||
|
||||
plugins: object[] = [QBTEditColor]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTEditColor.name]) {
|
||||
for (let i in options[QBTEditColor.name]) {
|
||||
newOptions[i] = options[QBTEditColor.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreEditColorButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreEditColorButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreEditColorButton
|
||||
42
plugins/core/components/buttons/qbt-fontfamily.ts
Normal file
42
plugins/core/components/buttons/qbt-fontfamily.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTFontFamily from './QBTFontFamily.vue';
|
||||
|
||||
class DDeiCoreEditFontFamilyButton extends DDeiPluginBase{
|
||||
name: string = QBTFontFamily.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreEditFontFamilyButton = new DDeiCoreEditFontFamilyButton(null);
|
||||
|
||||
plugins: object[] = [QBTFontFamily]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTFontFamily.name]) {
|
||||
for (let i in options[QBTFontFamily.name]) {
|
||||
newOptions[i] = options[QBTFontFamily.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreEditFontFamilyButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreEditFontFamilyButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreEditFontFamilyButton
|
||||
45
plugins/core/components/buttons/qbt-fontsize.ts
Normal file
45
plugins/core/components/buttons/qbt-fontsize.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTFontSize from './QBTFontSize.vue';
|
||||
|
||||
class DDeiCoreEditFontSizeButton extends DDeiPluginBase{
|
||||
|
||||
name: string = QBTFontSize.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreEditFontSizeButton = new DDeiCoreEditFontSizeButton(null);
|
||||
|
||||
|
||||
|
||||
plugins: object[] = [QBTFontSize]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTFontSize.name]) {
|
||||
for (let i in options[QBTFontSize.name]) {
|
||||
newOptions[i] = options[QBTFontSize.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreEditFontSizeButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreEditFontSizeButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreEditFontSizeButton
|
||||
44
plugins/core/components/buttons/qbt-linepointtype.ts
Normal file
44
plugins/core/components/buttons/qbt-linepointtype.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTLinePointType from './QBTLinePointType.vue';
|
||||
|
||||
class DDeiCoreEditLinePointTypeButton extends DDeiPluginBase{
|
||||
name: string = QBTLinePointType.name
|
||||
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreEditLinePointTypeButton = new DDeiCoreEditLinePointTypeButton(null);
|
||||
|
||||
|
||||
plugins: object[] = [QBTLinePointType]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTLinePointType.name]) {
|
||||
for (let i in options[QBTLinePointType.name]) {
|
||||
newOptions[i] = options[QBTLinePointType.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreEditLinePointTypeButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreEditLinePointTypeButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreEditLinePointTypeButton
|
||||
45
plugins/core/components/buttons/qbt-linetype.ts
Normal file
45
plugins/core/components/buttons/qbt-linetype.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTLineType from './QBTLineType.vue';
|
||||
|
||||
class DDeiCoreEditLineTypeButton extends DDeiPluginBase{
|
||||
name: string = QBTLineType.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreEditLineTypeButton = new DDeiCoreEditLineTypeButton(null);
|
||||
|
||||
|
||||
|
||||
plugins: object[] = [QBTLineType]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTLineType.name]) {
|
||||
for (let i in options[QBTLineType.name]) {
|
||||
newOptions[i] = options[QBTLineType.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreEditLineTypeButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreEditLineTypeButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreEditLineTypeButton
|
||||
42
plugins/core/components/buttons/qbt-textalign.ts
Normal file
42
plugins/core/components/buttons/qbt-textalign.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import QBTEditTextAlign from './QBTEditTextAlign.vue';
|
||||
|
||||
class DDeiCoreEditTextAlignButton extends DDeiPluginBase{
|
||||
name: string = QBTEditTextAlign.name
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: DDeiCoreEditTextAlignButton = new DDeiCoreEditTextAlignButton(null);
|
||||
|
||||
|
||||
plugins: object[] = [QBTEditTextAlign]
|
||||
|
||||
getComponents(editor){
|
||||
return this.plugins;
|
||||
}
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[QBTEditTextAlign.name]) {
|
||||
for (let i in options[QBTEditTextAlign.name]) {
|
||||
newOptions[i] = options[QBTEditTextAlign.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new DDeiCoreEditTextAlignButton(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return DDeiCoreEditTextAlignButton;
|
||||
}
|
||||
}
|
||||
|
||||
export default DDeiCoreEditTextAlignButton
|
||||
62
plugins/core/components/index.ts
Normal file
62
plugins/core/components/index.ts
Normal file
@ -0,0 +1,62 @@
|
||||
import {DDeiPluginBase} from "ddei-framework";
|
||||
import DDeiCoreAddFontSizeButton from "./buttons/qbt-addfontsize"
|
||||
import DDeiCoreBorderDashButton from "./buttons/qbt-borderdash"
|
||||
import DDeiCoreBorderWeightButton from "./buttons/qbt-borderweight"
|
||||
import DDeiCoreEditBoxButton from "./buttons/qbt-editbox"
|
||||
import DDeiCoreEditColorButton from "./buttons/qbt-editcolor"
|
||||
import DDeiCoreEditFontFamilyButton from "./buttons/qbt-fontfamily"
|
||||
import DDeiCoreEditFontSizeButton from "./buttons/qbt-fontsize"
|
||||
import DDeiCoreEditLinePointTypeButton from "./buttons/qbt-linepointtype"
|
||||
import DDeiCoreEditLineTypeButton from "./buttons/qbt-linetype"
|
||||
import DDeiCoreEditTextAlignButton from "./buttons/qbt-textalign"
|
||||
|
||||
class DDeiCoreComponents extends DDeiPluginBase{
|
||||
|
||||
type: string = "package"
|
||||
|
||||
plugins: object[] = [DDeiCoreAddFontSizeButton, DDeiCoreBorderDashButton, DDeiCoreBorderWeightButton
|
||||
, DDeiCoreEditBoxButton, DDeiCoreEditColorButton,
|
||||
DDeiCoreEditFontFamilyButton, DDeiCoreEditFontSizeButton, DDeiCoreEditLinePointTypeButton, DDeiCoreEditLineTypeButton, DDeiCoreEditTextAlignButton]
|
||||
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns:DDeiCoreComponents = new DDeiCoreComponents(null);
|
||||
|
||||
|
||||
getComponents(editor){
|
||||
let components = []
|
||||
this.plugins?.forEach(plugin => {
|
||||
let ls
|
||||
if (DDeiPluginBase.isSubclass(plugin, DDeiPluginBase)) {
|
||||
ls = plugin.defaultIns.getComponents(editor);
|
||||
} else if (plugin instanceof DDeiPluginBase) {
|
||||
ls = plugin.getComponents(editor);
|
||||
}
|
||||
if (ls?.length > 0) {
|
||||
components = components.concat(ls);
|
||||
}
|
||||
})
|
||||
return components
|
||||
}
|
||||
|
||||
|
||||
|
||||
static configuration(options) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
//解析options,只使用自己相关的
|
||||
let components = new DDeiCoreComponents(options);
|
||||
for (let i = 0; i < components.plugins?.length; i++) {
|
||||
components.plugins[i] = components.plugins[i].configuration(options, true)
|
||||
}
|
||||
return components;
|
||||
}
|
||||
return DDeiCoreComponents;
|
||||
}
|
||||
}
|
||||
|
||||
export {DDeiCoreComponents,DDeiCoreAddFontSizeButton, DDeiCoreBorderDashButton, DDeiCoreBorderWeightButton
|
||||
, DDeiCoreEditBoxButton, DDeiCoreEditColorButton,
|
||||
DDeiCoreEditFontFamilyButton, DDeiCoreEditFontSizeButton, DDeiCoreEditLinePointTypeButton, DDeiCoreEditLineTypeButton, DDeiCoreEditTextAlignButton}
|
||||
export default DDeiCoreComponents
|
||||
14
plugins/core/controls/control/base/compose-container.ts
Normal file
14
plugins/core/controls/control/base/compose-container.ts
Normal file
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
'id': '100202',
|
||||
'name': '组合容器',
|
||||
'code': 'comp',
|
||||
'desc': '用于组合关系的容器',
|
||||
'type': 'DDeiRectContainer',
|
||||
'from': '100201',
|
||||
|
||||
'define': {
|
||||
ext: {
|
||||
groups: []
|
||||
}
|
||||
}
|
||||
}
|
||||
521
plugins/core/controls/control/base/container.ts
Normal file
521
plugins/core/controls/control/base/container.ts
Normal file
@ -0,0 +1,521 @@
|
||||
export default {
|
||||
'id': '100201',
|
||||
'name': '矩形容器',
|
||||
'code': 'rectange_container',
|
||||
'desc': '矩形形状的容器,能够包含其他容器',
|
||||
'type': 'DDeiRectContainer',
|
||||
|
||||
/**
|
||||
* 定义组件属性
|
||||
* 样式属性会影响图形的显示,修改样式属性也会刷新图形
|
||||
* 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系
|
||||
* 事件属性一般用来作为扩展用
|
||||
* 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写)
|
||||
* 特殊属性:
|
||||
* code属性编码在统一个组中,code唯一
|
||||
* mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射
|
||||
* hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题
|
||||
* display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row
|
||||
*/
|
||||
attrs: [
|
||||
{
|
||||
'code': 'layout',
|
||||
'name': '布局',
|
||||
'desc': '文本的字体名称',
|
||||
'controlType': 'radio',
|
||||
'dataSource': [
|
||||
{ 'text': '自由布局', 'value': 'free' },
|
||||
{ 'text': '完全填充', 'value': 'full' },
|
||||
{ 'text': '九宫格', 'value': 'nine' },
|
||||
{ 'text': '表格', 'value': 'table' },
|
||||
{ 'text': '圆心', 'value': 'cc' },
|
||||
],
|
||||
'defaultValue': null,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'dataType': 'string',
|
||||
},
|
||||
{
|
||||
'code': 'width',
|
||||
'name': '宽度',
|
||||
'desc': '控件的宽度',
|
||||
'controlType': 'text',
|
||||
'dataSource': null,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': "150",
|
||||
},
|
||||
{
|
||||
'code': 'height',
|
||||
'name': '高度',
|
||||
'desc': '控件的高度',
|
||||
'controlType': 'text',
|
||||
'dataSource': null,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': "150",
|
||||
},
|
||||
{
|
||||
'id': '100500003',
|
||||
'code': 'border.type',
|
||||
'name': '边框类型',
|
||||
'desc': '用来快速选择边框的类型,以便于套用相关的样式',
|
||||
'controlType': 'border-type',
|
||||
'dataSource': [{ 'text': '无线条', 'value': '0' }, { 'text': '实线', 'value': '1' }],
|
||||
'dataType': 'string',
|
||||
'defaultValue': '1',
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'id': '100500004',
|
||||
'code': 'border.color',
|
||||
'name': '颜色',
|
||||
'desc': '图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': 'black',
|
||||
},
|
||||
{
|
||||
'code': 'borderOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的边框的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 1,
|
||||
'step': 0.01,
|
||||
'mapping': ["border.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 1,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'borderWidth',
|
||||
'name': '粗细',
|
||||
'desc': '图形的边框的粗细,0为无边框',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'mapping': ["border.width"],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 1,
|
||||
},
|
||||
{
|
||||
'code': 'borderDash',
|
||||
'name': '虚线',
|
||||
'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成',
|
||||
'controlType': 'border-dash',
|
||||
'dataSource': [
|
||||
{ 'text': '1', 'value': [] },
|
||||
{ 'text': '2', 'value': [10, 5] },
|
||||
{ 'text': '3', 'value': [5, 5] },
|
||||
{ 'text': '4', 'value': [10, 4, 2, 4] },
|
||||
{ 'text': '5', 'value': [10, 4, 2, 4, 2, 4] },
|
||||
{ 'text': '6', 'value': [10, 4, 10, 4, 2, 4] },
|
||||
{ 'text': '7', 'value': [20, 5, 10, 5] },
|
||||
{ 'text': '8', 'value': [20, 5, 10, 5, 10, 5] },
|
||||
{ 'text': '9', 'value': [3, 3] },
|
||||
{ 'text': '10', 'value': [2, 2] },
|
||||
{ 'text': '11', 'value': [3, 2, 2, 2] },
|
||||
{ 'text': '13', 'value': [20, 10] },
|
||||
],
|
||||
'mapping': ["border.dash"],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': [],
|
||||
'isArray': true,
|
||||
},
|
||||
{
|
||||
'code': 'borderRound',
|
||||
'name': '圆角',
|
||||
'desc': '图形的边框的是否为为圆角的弧度',
|
||||
'controlType': 'range',
|
||||
'mapping': ["border.round"],
|
||||
'min': 0,
|
||||
'max': 30,
|
||||
'step': 1,
|
||||
'defaultValue': 0,
|
||||
'dataType': 'integer',
|
||||
},
|
||||
{
|
||||
'code': 'fill.type',
|
||||
'name': '填充类型',
|
||||
'desc': '图形填充的类型快速设置',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '无', 'value': 0 }, { 'text': '纯色', 'value': 1 }, { 'text': '图片', 'value': 2 }],
|
||||
'defaultValue': 1,
|
||||
'type': 1,
|
||||
'orderNo': 2,
|
||||
'cascadeDisplay': { 1: { show: ['fill.color', 'fill.opacity'], hidden: ['fill.image'] }, 2: { show: ['fill.image', 'fill.opacity'], hidden: ['fill.color'] }, default: { show: ['fill.color', 'fill.opacity'], hidden: ['fill.image'] }, empty: { hidden: ['fill.color', 'fill.image', 'fill.opacity'] } },
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'fill.color',
|
||||
'name': '颜色',
|
||||
'desc': '图形的填充颜色',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': 'white',
|
||||
},
|
||||
{
|
||||
'code': 'fill.image',
|
||||
'name': '图片',
|
||||
'desc': '图形的填充图片',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '',
|
||||
'type': 1,
|
||||
},
|
||||
{
|
||||
'code': 'fill.opacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的填充的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 1,
|
||||
'step': 0.01,
|
||||
'defaultValue': 1,
|
||||
'dataType': 'float',
|
||||
'display': 'column',
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
'code': 'font.family',
|
||||
'name': '字体',
|
||||
'desc': '文本的字体名称',
|
||||
'controlType': 'combox',
|
||||
'dataType': 'string',
|
||||
'dataSource': {
|
||||
'type': 'config',
|
||||
'data': 'fonts',
|
||||
'text': 'ch',
|
||||
'value': 'en',
|
||||
'bold': 'isSystemDefault',
|
||||
'fontFamily': 'en'
|
||||
},
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 },
|
||||
'canSearch': true,
|
||||
'defaultValue': "Microsoft YaHei",
|
||||
},
|
||||
{
|
||||
'code': 'font.size',
|
||||
'name': '大小',
|
||||
'desc': '文本的字体大小',
|
||||
'max': 50,
|
||||
'min': 5,
|
||||
'step': 0.5,
|
||||
'controlType': 'font-size',
|
||||
'dataType': 'float',
|
||||
'defaultValue': 14,
|
||||
},
|
||||
{
|
||||
'code': 'font.color',
|
||||
'name': '颜色',
|
||||
'desc': '文本的颜色',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': "#252525",
|
||||
},
|
||||
{
|
||||
'code': 'fontAlign',
|
||||
'name': '对齐',
|
||||
'desc': '文本的对齐,采用九宫格式设置',
|
||||
'controlType': 'align-type',
|
||||
'mapping': [],
|
||||
'dataType': 'string',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.feed',
|
||||
'name': '换行',
|
||||
'desc': '自动换行',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.scale',
|
||||
'name': '缩小字体',
|
||||
'desc': '文本的自动缩小字体填充',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.hollow',
|
||||
'name': '镂空',
|
||||
'desc': '文本的镂空显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.bold',
|
||||
'name': '粗体',
|
||||
'desc': '文本的加粗显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.italic',
|
||||
'name': '斜体',
|
||||
'desc': '文本的斜体显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.underline',
|
||||
'name': '下划线',
|
||||
'desc': '文本的下划线显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.deleteline',
|
||||
'name': '删除线',
|
||||
'desc': '文本的删除线显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.topline',
|
||||
'name': '顶部线',
|
||||
'desc': '文本的删除线显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.bgcolor',
|
||||
'name': '文字背景',
|
||||
'desc': '文本的背景颜色',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.subtype',
|
||||
'name': '标注类型',
|
||||
'desc': '文本的标注类型',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'integer',
|
||||
'dataSource': [{ 'text': '正常', 'value': 0 }, { 'text': '上标', 'value': 1 }, { 'text': '中标', 'value': 2 }, { 'text': '下标', 'value': 3 }],
|
||||
'defaultValue': 0,
|
||||
},
|
||||
|
||||
{
|
||||
'code': 'textStyle.align',
|
||||
'name': '水平对齐',
|
||||
'desc': '文本的水平对齐',
|
||||
'controlType': 'text',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 2,
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.valign',
|
||||
'name': '垂直对齐',
|
||||
'desc': '文本的垂直对齐',
|
||||
'controlType': 'text',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 2,
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.hspace',
|
||||
'name': '水平间距',
|
||||
'desc': '文本之间的水平间距',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.vspace',
|
||||
'name': '垂直间距',
|
||||
'desc': '文本之间的垂直间距',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
},
|
||||
{
|
||||
'code': 'borderCreatingOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的边框的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'text',
|
||||
'mapping': ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'fillCreatingOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的填充的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'text',
|
||||
'mapping': ["fill.creating.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'imageCreatingOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的填充图片的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'text',
|
||||
'mapping': ["fill.creating.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'id',
|
||||
'name': 'id',
|
||||
'desc': '控件在画布的全局唯一ID',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'readonly': true,
|
||||
},
|
||||
{
|
||||
'code': 'code',
|
||||
'name': '编码',
|
||||
'desc': '控件在业务上的唯一编码,缺省和控件ID一致',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '编码001',
|
||||
},
|
||||
{
|
||||
'code': 'text',
|
||||
'name': '文本',
|
||||
'desc': '控件的主体显示文本',
|
||||
'controlType': 'textarea',
|
||||
'defaultValue': '',
|
||||
'dataType': 'string',
|
||||
'type': [1, 2], //类别,1图形,2业务,3事件
|
||||
'readonly': true,
|
||||
},
|
||||
{
|
||||
'code': 'fmt.type',
|
||||
'name': '格式',
|
||||
'desc': '文本的显示格式',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'integer',
|
||||
'dataSource': [{ 'text': '文本', 'value': 0 }, { 'text': '数字', 'value': 1 }, { 'text': '金额', 'value': 2 }, { 'text': '时间', 'value': 3 }],
|
||||
'defaultValue': 0,
|
||||
'type': [1, 2],
|
||||
'cascadeDisplay': { 1: { show: ['fmt.nscale', 'fmt.tmark'], hidden: ['fmt.mmark', 'fmt.munit', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] }, 2: { show: ['fmt.nscale', 'fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.mrmb'], hidden: ['fmt.dtype', 'fmt.format'] }, 3: { show: ['fmt.dtype', 'fmt.format'], hidden: ['fmt.mrmb', 'fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale'] }, default: { hidden: ['fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] }, empty: { hidden: ['fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] } },
|
||||
},
|
||||
{
|
||||
'code': 'fmt.nscale',
|
||||
'name': '小数位数',
|
||||
'desc': '格式化小数位数',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 5,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 0,
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'fmt.tmark',
|
||||
'name': '千分符',
|
||||
'desc': '显示逗号千分符',
|
||||
'controlType': 'switch-checkbox',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 0,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'fmt.mmark',
|
||||
'name': '货币符号',
|
||||
'desc': '显示货币符号',
|
||||
'controlType': 'combox',
|
||||
'dataSource': [{ 'text': '无', 'value': '' }, { 'text': '人民币', 'value': '¥' }, { 'text': '美元', 'value': '$' }, { 'text': '欧元', 'value': '€' }, { 'text': '英镑', 'value': '£' }, { 'text': '日元', 'value': '¥' }, { 'text': '卢布', 'value': '₽' }, { 'text': '法郎', 'value': '€' }],
|
||||
'defaultValue': '',
|
||||
'dataType': 'string',
|
||||
'type': [1, 2],
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 },
|
||||
},
|
||||
{
|
||||
'code': 'fmt.munit',
|
||||
'name': '货币单位',
|
||||
'desc': '显示在后方的货币单位',
|
||||
'controlType': 'text',
|
||||
'defaultValue': '',
|
||||
'dataType': 'string',
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'fmt.mrmb',
|
||||
'name': '人民币大写',
|
||||
'desc': '显示为人民币大写',
|
||||
'controlType': 'switch-checkbox',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 0,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'fmt.dtype',
|
||||
'name': '日期类型',
|
||||
'desc': '日期和时间的格式化类型',
|
||||
'controlType': 'radio',
|
||||
'dataSource': [{ 'text': '2023-01-01', 'value': 1 }, { 'text': '23:59:59', 'value': 2 }, { 'text': '2023-01-01 23:59:59', 'value': 3 }, { 'text': '自定义', 'value': 99 }],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 1,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'cascadeDisplay': { 1: { show: [], hidden: ['fmt.format'] }, 2: { show: [], hidden: ['fmt.format'] }, 3: { show: [], hidden: ['fmt.format'] }, 99: { hidden: [], show: ['fmt.format'] }, default: { hidden: ['fmt.format'] }, empty: { hidden: ['fmt.format'] } },
|
||||
},
|
||||
{
|
||||
'code': 'fmt.format',
|
||||
'name': '格式化',
|
||||
'desc': '自定义格式化字符串',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
/**
|
||||
* 定义分组,用于属性编辑
|
||||
*/
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "布局",
|
||||
attrs: ["layout"]
|
||||
},
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
},
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
250
plugins/core/controls/control/base/line.ts
Normal file
250
plugins/core/controls/control/base/line.ts
Normal file
@ -0,0 +1,250 @@
|
||||
export default {
|
||||
'id': '100401',
|
||||
'name': '连接线',
|
||||
'code': 'line',
|
||||
'desc': '直线、折线、曲线三种连接线',
|
||||
'type': 'DDeiLine',
|
||||
'icon': 'icon-line-fold',
|
||||
/**
|
||||
* 定义组件属性
|
||||
* 样式属性会影响图形的显示,修改样式属性也会刷新图形
|
||||
* 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系
|
||||
* 事件属性一般用来作为扩展用
|
||||
* 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写)
|
||||
* 特殊属性:
|
||||
* code属性编码在统一个组中,code唯一
|
||||
* mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射
|
||||
* hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题
|
||||
* display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row
|
||||
*/
|
||||
attrs: [
|
||||
{
|
||||
'code': 'type',
|
||||
'name': '类型',
|
||||
'desc': '用来快速连线类型,以便于套用相关的样式',
|
||||
'controlType': 'radio',
|
||||
'dataSource': [{ 'text': '直线', 'value': 1 }, { 'text': '折线', 'value': 2 }, { 'text': '曲线', 'value': 3 }],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 1,
|
||||
'cascadeDisplay': { 2: { show: ['round'], hidden: [] }, default: { show: [], hidden: ['round'] }, notempty: { hidden: ['round'] } },
|
||||
'mapping': [],
|
||||
'type': 1
|
||||
},
|
||||
{
|
||||
'code': 'weight',
|
||||
'name': '线段',
|
||||
'desc': '控件的宽度',
|
||||
'controlType': 'range',
|
||||
'min': 0.1,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'dataType': 'float',
|
||||
'defaultValue': 1,
|
||||
},
|
||||
{
|
||||
'code': 'color',
|
||||
'name': '颜色',
|
||||
'desc': '线段的边框显示颜色',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '',
|
||||
},
|
||||
{
|
||||
'code': 'fill.weight',
|
||||
'name': '填充',
|
||||
'desc': '填充的大小',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 30,
|
||||
'step': 1,
|
||||
'defaultValue': 0,
|
||||
'dataType': 'integer',
|
||||
},
|
||||
{
|
||||
'code': 'fill.color',
|
||||
'name': '填充色',
|
||||
'desc': '线段的边框显示颜色',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': 'black',
|
||||
},
|
||||
|
||||
{
|
||||
'code': 'dash',
|
||||
'name': '虚线',
|
||||
'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成',
|
||||
'controlType': 'border-dash',
|
||||
'dataSource': [
|
||||
{ 'text': '1', 'value': [] },
|
||||
{ 'text': '2', 'value': [10, 5] },
|
||||
{ 'text': '3', 'value': [5, 5] },
|
||||
{ 'text': '4', 'value': [10, 4, 2, 4] },
|
||||
{ 'text': '5', 'value': [10, 4, 2, 4, 2, 4] },
|
||||
{ 'text': '6', 'value': [10, 4, 10, 4, 2, 4] },
|
||||
{ 'text': '7', 'value': [20, 5, 10, 5] },
|
||||
{ 'text': '8', 'value': [20, 5, 10, 5, 10, 5] },
|
||||
{ 'text': '9', 'value': [3, 3] },
|
||||
{ 'text': '10', 'value': [2, 2] },
|
||||
{ 'text': '11', 'value': [3, 2, 2, 2] },
|
||||
{ 'text': '13', 'value': [20, 10] },
|
||||
],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': [],
|
||||
'isArray': true,
|
||||
},
|
||||
{
|
||||
'code': 'opacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的边框的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 1,
|
||||
'step': 0.01,
|
||||
'dataType': 'float',
|
||||
'defaultValue': 1,
|
||||
'display': 'column',
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
'code': 'sp.type',
|
||||
'name': '起点类型',
|
||||
'desc': '起点的样式样式',
|
||||
'controlType': 'combox',
|
||||
'dataSource': [
|
||||
{ 'text': '无', 'value': -1 },
|
||||
{ 'text': '箭头', 'value': 1 },
|
||||
{ 'text': '圆形', 'value': 2 },
|
||||
{ 'text': '圆形-实心', 'value': 21 },
|
||||
{ 'text': '方形', 'value': 3 },
|
||||
{ 'text': '方形-实心', 'value': 31 },
|
||||
{ 'text': '菱形', 'value': 4 },
|
||||
{ 'text': '菱形-实心', 'value': 41 },
|
||||
{ 'text': '三角形', 'value': 5 },
|
||||
{ 'text': '三角形-实心', 'value': 51 },
|
||||
{ 'text': '半圆', 'value': 6 },
|
||||
{ 'text': '半圆-实心', 'value': 61 },
|
||||
|
||||
],
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 6 },
|
||||
'dataType': 'integer',
|
||||
'cascadeDisplay': { "-1": { hidden: ['startWeidht'] }, empty: { hidden: ['startWeidht'] }, notempty: { show: ['startWeidht'] } },
|
||||
'defaultValue': -1,
|
||||
},
|
||||
{
|
||||
'code': 'sp.weight',
|
||||
'name': '大小',
|
||||
'desc': '起点的箭头的宽度',
|
||||
'controlType': 'range',
|
||||
'min': 1,
|
||||
'max': 30,
|
||||
'step': 1,
|
||||
'defaultValue': 6,
|
||||
'dataType': 'integer',
|
||||
},
|
||||
{
|
||||
'code': 'ep.type',
|
||||
'name': '终点类型',
|
||||
'desc': '终点的样式样式',
|
||||
'controlType': 'combox',
|
||||
'dataSource': [
|
||||
{ 'text': '无', 'value': -1 },
|
||||
{ 'text': '箭头', 'value': 1 },
|
||||
{ 'text': '圆形', 'value': 2 },
|
||||
{ 'text': '圆形-实心', 'value': 21 },
|
||||
{ 'text': '方形', 'value': 3 },
|
||||
{ 'text': '方形-实心', 'value': 31 },
|
||||
{ 'text': '菱形', 'value': 4 },
|
||||
{ 'text': '菱形-实心', 'value': 41 },
|
||||
{ 'text': '三角形', 'value': 5 },
|
||||
{ 'text': '三角形-实心', 'value': 51 },
|
||||
{ 'text': '半圆', 'value': 6 },
|
||||
{ 'text': '半圆-实心', 'value': 61 },
|
||||
],
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 6 },
|
||||
'dataType': 'integer',
|
||||
'cascadeDisplay': { "-1": { hidden: ['endWeidht'] }, empty: { hidden: ['endWeidht'] }, notempty: { show: ['endWeidht'] } },
|
||||
'defaultValue': 5,
|
||||
},
|
||||
{
|
||||
'code': 'ep.weight',
|
||||
'name': '大小',
|
||||
'desc': '终点的箭头的宽度',
|
||||
'controlType': 'range',
|
||||
'min': 1,
|
||||
'max': 30,
|
||||
'step': 1,
|
||||
'defaultValue': 6,
|
||||
'dataType': 'integer',
|
||||
},
|
||||
|
||||
{
|
||||
'code': 'round',
|
||||
'name': '圆角',
|
||||
'desc': '图形的边框的是否为为圆角的弧度',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 30,
|
||||
'step': 1,
|
||||
'defaultValue': 0,
|
||||
'dataType': 'integer',
|
||||
},
|
||||
{
|
||||
'code': 'jumpline',
|
||||
'name': '跳线',
|
||||
'desc': '用来控制当前线段的跳线类型',
|
||||
'controlType': 'radio',
|
||||
'dataSource': [{ 'text': '是', 'value': 1 }, { 'text': '否', 'value': 2 }, { 'text': '全局', 'value': 0 }],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 0,
|
||||
'type': 1,
|
||||
},
|
||||
{
|
||||
'code': 'id',
|
||||
'name': 'id',
|
||||
'desc': '控件在画布的全局唯一ID',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'readonly': true,
|
||||
},
|
||||
{
|
||||
'code': 'code',
|
||||
'name': '编码',
|
||||
'desc': '控件在业务上的唯一编码,缺省和控件ID一致',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '编码001',
|
||||
},
|
||||
],
|
||||
/**
|
||||
* 定义分组,用于属性编辑
|
||||
*/
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["type", "weight", "color", "fill.weight", "fill.color", "dash", "opacity",
|
||||
"sp.type", "sp.weight", "ep.type", "ep.weight", "round", "jumpline"
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "属性",
|
||||
icon: 'icon-a-ziyuan409',
|
||||
subGroups: [
|
||||
{
|
||||
name: "属性",
|
||||
attrs: ["code"]
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
545
plugins/core/controls/control/base/polygon.ts
Normal file
545
plugins/core/controls/control/base/polygon.ts
Normal file
@ -0,0 +1,545 @@
|
||||
export default {
|
||||
'id': '100500',
|
||||
'name': '多边形',
|
||||
'code': 'polygon',
|
||||
'desc': '多个3-N边构成的多边形',
|
||||
'type': 'DDeiPolygon',
|
||||
|
||||
/**
|
||||
* 定义组件属性
|
||||
* 样式属性会影响图形的显示,修改样式属性也会刷新图形
|
||||
* 数据属性一般用于业务计算,数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系
|
||||
* 事件属性一般用来作为扩展用
|
||||
* 属性采用三层结构:组---子分组---属性,在基础json中先定义而后使用(可以复写)
|
||||
* 特殊属性:
|
||||
* code属性编码在统一个组中,code唯一
|
||||
* mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射
|
||||
* hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题
|
||||
* display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row
|
||||
*/
|
||||
attrs: [
|
||||
{
|
||||
'code': 'width',
|
||||
'name': '宽度',
|
||||
'desc': '控件的宽度',
|
||||
'controlType': 'text',
|
||||
'dataSource': null,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': "150",
|
||||
},
|
||||
{
|
||||
'code': 'height',
|
||||
'name': '高度',
|
||||
'desc': '控件的高度',
|
||||
'controlType': 'text',
|
||||
'dataSource': null,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': "150",
|
||||
},
|
||||
{
|
||||
'code': 'border.type',
|
||||
'name': '边框类型',
|
||||
'desc': '用来快速选择边框的类型,以便于套用相关的样式',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '无线条', 'value': 0 }, { 'text': '实线', 'value': 1 }],
|
||||
'defaultValue': 1,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'cascadeDisplay': { 1: { show: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"], hidden: [] }, default: { show: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"], hidden: [] }, empty: { hidden: ["border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"] } },
|
||||
},
|
||||
{
|
||||
'code': 'border.color',
|
||||
'name': '颜色',
|
||||
'desc': '图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式',
|
||||
'controlType': 'color-combo',
|
||||
|
||||
'dataType': 'string',
|
||||
'defaultValue': '',
|
||||
},
|
||||
{
|
||||
'code': 'borderOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的边框的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 1,
|
||||
'step': 0.01,
|
||||
'mapping': ["border.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 1,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'borderWidth',
|
||||
'name': '粗细',
|
||||
'desc': '图形的边框的粗细,0为无边框',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'mapping': ["border.width"],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 1,
|
||||
},
|
||||
{
|
||||
'code': 'borderDash',
|
||||
'name': '虚线',
|
||||
'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成',
|
||||
'controlType': 'border-dash',
|
||||
'dataSource': [
|
||||
{ 'text': '1', 'value': [] },
|
||||
{ 'text': '2', 'value': [10, 5] },
|
||||
{ 'text': '3', 'value': [5, 5] },
|
||||
{ 'text': '4', 'value': [10, 4, 2, 4] },
|
||||
{ 'text': '5', 'value': [10, 4, 2, 4, 2, 4] },
|
||||
{ 'text': '6', 'value': [10, 4, 10, 4, 2, 4] },
|
||||
{ 'text': '7', 'value': [20, 5, 10, 5] },
|
||||
{ 'text': '8', 'value': [20, 5, 10, 5, 10, 5] },
|
||||
{ 'text': '9', 'value': [3, 3] },
|
||||
{ 'text': '10', 'value': [2, 2] },
|
||||
{ 'text': '11', 'value': [3, 2, 2, 2] },
|
||||
{ 'text': '13', 'value': [20, 10] },
|
||||
],
|
||||
'mapping': ["border.dash"],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': [],
|
||||
'isArray': true,
|
||||
},
|
||||
{
|
||||
'code': 'borderRound',
|
||||
'name': '圆角',
|
||||
'desc': '图形的边框的是否为为圆角的弧度',
|
||||
'controlType': 'range',
|
||||
'mapping': ["border.round"],
|
||||
'min': 0,
|
||||
'max': 30,
|
||||
'step': 1,
|
||||
'defaultValue': 0,
|
||||
'dataType': 'integer',
|
||||
},
|
||||
{
|
||||
'code': 'fill.type',
|
||||
'name': '填充类型',
|
||||
'desc': '图形填充的类型快速设置',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '无', 'value': 0 }, { 'text': '纯色', 'value': 1 }, { 'text': '图片', 'value': 2 }],
|
||||
'defaultValue': 1,
|
||||
'type': 1,
|
||||
'orderNo': 2,
|
||||
'cascadeDisplay': { 1: { show: ['fill.color', 'fill.opacity'], hidden: ['fill.image'] }, 2: { show: ['fill.image', 'fill.opacity'], hidden: ['fill.color'] }, default: { show: ['fill.color', 'fill.opacity'], hidden: ['fill.image'] }, empty: { hidden: ['fill.color', 'fill.image', 'fill.opacity'] } },
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'fill.color',
|
||||
'name': '颜色',
|
||||
'desc': '图形的填充颜色',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '',
|
||||
},
|
||||
{
|
||||
'code': 'fill.image',
|
||||
'name': '图片',
|
||||
'desc': '图形的填充图片',
|
||||
'controlType': 'image',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '',
|
||||
'type': 1,
|
||||
},
|
||||
{
|
||||
'code': 'fill.opacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的填充的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 1,
|
||||
'step': 0.01,
|
||||
'defaultValue': 1,
|
||||
'dataType': 'float',
|
||||
'display': 'column',
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
'code': 'font.family',
|
||||
'name': '字体',
|
||||
'desc': '文本的字体名称',
|
||||
'controlType': 'combox',
|
||||
'dataType': 'string',
|
||||
'dataSource': {
|
||||
'type': 'config',
|
||||
'data': 'fonts',
|
||||
'text': 'ch',
|
||||
'value': 'en',
|
||||
'bold': 'isSystemDefault',
|
||||
'fontFamily': 'en'
|
||||
},
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 },
|
||||
'canSearch': true,
|
||||
'defaultValue': "Microsoft YaHei",
|
||||
},
|
||||
{
|
||||
'code': 'font.size',
|
||||
'name': '大小',
|
||||
'desc': '文本的字体大小',
|
||||
'max': 50,
|
||||
'min': 5,
|
||||
'step': 0.5,
|
||||
'controlType': 'font-size',
|
||||
'dataType': 'float',
|
||||
'defaultValue': 14,
|
||||
},
|
||||
{
|
||||
'code': 'font.color',
|
||||
'name': '颜色',
|
||||
'desc': '文本的颜色',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': "",
|
||||
},
|
||||
{
|
||||
'code': 'fontAlign',
|
||||
'name': '对齐',
|
||||
'desc': '文本的对齐,采用九宫格式设置',
|
||||
'controlType': 'align-type',
|
||||
'mapping': [],
|
||||
'dataType': 'string',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.feed',
|
||||
'name': '换行',
|
||||
'desc': '自动换行',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '1',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.scale',
|
||||
'name': '超出范围',
|
||||
'desc': '文本的超出范围后的策略',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '隐藏', 'value': '0' }, { 'text': '省略', 'value': '2' }, { 'text': '缩小', 'value': '1' }, { 'text': '扩展', 'value': '3' }],
|
||||
'defaultValue': '0',
|
||||
'cascadeDisplay': { 3: { show: ['textStyle.lockWidth'], hidden: [] }, default: { hidden: ['textStyle.lockWidth'] }, empty: { hidden: ['textStyle.lockWidth'] }, notempty: { hidden: ['textStyle.lockWidth'] } }
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.lockWidth',
|
||||
'name': '锁定宽度',
|
||||
'desc': '超范围自动扩展的情况下锁定宽度',
|
||||
'controlType': 'switch-checkbox',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 0,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.hollow',
|
||||
'name': '镂空',
|
||||
'desc': '文本的镂空显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.bold',
|
||||
'name': '粗体',
|
||||
'desc': '文本的加粗显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.italic',
|
||||
'name': '斜体',
|
||||
'desc': '文本的斜体显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.underline',
|
||||
'name': '下划线',
|
||||
'desc': '文本的下划线显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.deleteline',
|
||||
'name': '删除线',
|
||||
'desc': '文本的删除线显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.topline',
|
||||
'name': '顶部线',
|
||||
'desc': '文本的删除线显示',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.bgcolor',
|
||||
'name': '文字背景',
|
||||
'desc': '文本的背景颜色',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '',
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.subtype',
|
||||
'name': '标注类型',
|
||||
'desc': '文本的标注类型',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'integer',
|
||||
'dataSource': [{ 'text': '正常', 'value': 0 }, { 'text': '上标', 'value': 1 }, { 'text': '中标', 'value': 2 }, { 'text': '下标', 'value': 3 }],
|
||||
'defaultValue': 0,
|
||||
},
|
||||
|
||||
{
|
||||
'code': 'textStyle.align',
|
||||
'name': '水平对齐',
|
||||
'desc': '文本的水平对齐',
|
||||
'controlType': 'text',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 2,
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.valign',
|
||||
'name': '垂直对齐',
|
||||
'desc': '文本的垂直对齐',
|
||||
'controlType': 'text',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 2,
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.hspace',
|
||||
'name': '水平间距',
|
||||
'desc': '文本之间的水平间距',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
},
|
||||
{
|
||||
'code': 'textStyle.vspace',
|
||||
'name': '垂直间距',
|
||||
'desc': '文本之间的垂直间距',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
},
|
||||
{
|
||||
'code': 'borderCreatingOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的边框的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'text',
|
||||
'mapping': ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'fillCreatingOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的填充的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'text',
|
||||
'mapping': ["fill.creating.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'imageCreatingOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的填充图片的透明度,0完全透明~1完全不透明',
|
||||
'controlType': 'text',
|
||||
'mapping': ["fill.creating.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
'display': 'column',
|
||||
},
|
||||
{
|
||||
'code': 'id',
|
||||
'name': 'id',
|
||||
'desc': '控件在画布的全局唯一ID',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'readonly': true,
|
||||
},
|
||||
{
|
||||
'code': 'code',
|
||||
'name': '编码',
|
||||
'desc': '控件在业务上的唯一编码,缺省和控件ID一致',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '编码001',
|
||||
},
|
||||
{
|
||||
'code': 'text',
|
||||
'name': '文本',
|
||||
'desc': '控件的主体显示文本',
|
||||
'controlType': 'textarea',
|
||||
'defaultValue': '',
|
||||
'dataType': 'string',
|
||||
'type': [1, 2], //类别,1图形,2业务,3事件
|
||||
'readonly': true,
|
||||
},
|
||||
{
|
||||
'code': 'text1',
|
||||
'name': '文本1',
|
||||
'desc': '控件的主体显示文本',
|
||||
'controlType': 'excheckbox',
|
||||
'dataType': 'integer',
|
||||
'dataSource': [{ 'text': '文本', 'value': 0 }, { 'text': '数字', 'value': 1 }, { 'text': '金额', 'value': 2 }, { 'text': '时间', 'value': 3 }],
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 },
|
||||
'isArray':true,
|
||||
'defaultValue': [1,2],
|
||||
'type': [1, 2], //类别,1图形,2业务,3事件
|
||||
'readonly': true,
|
||||
},
|
||||
{
|
||||
'code': 'fmt.type',
|
||||
'name': '格式',
|
||||
'desc': '文本的显示格式',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'integer',
|
||||
'dataSource': [{ 'text': '文本', 'value': 0 }, { 'text': '数字', 'value': 1 }, { 'text': '金额', 'value': 2 }, { 'text': '时间', 'value': 3 }],
|
||||
'defaultValue': 0,
|
||||
'type': [1, 2],
|
||||
'cascadeDisplay': { 1: { show: ['fmt.nscale', 'fmt.tmark'], hidden: ['fmt.mmark', 'fmt.munit', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] }, 2: { show: ['fmt.nscale', 'fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.mrmb'], hidden: ['fmt.dtype', 'fmt.format'] }, 3: { show: ['fmt.dtype', 'fmt.format'], hidden: ['fmt.mrmb', 'fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale'] }, default: { hidden: ['fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] }, empty: { hidden: ['fmt.tmark', 'fmt.mmark', 'fmt.munit', 'fmt.nscale', 'fmt.dtype', 'fmt.format', 'fmt.mrmb'] } },
|
||||
},
|
||||
{
|
||||
'code': 'fmt.nscale',
|
||||
'name': '小数位数',
|
||||
'desc': '格式化小数位数',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 5,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 0,
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'fmt.tmark',
|
||||
'name': '千分符',
|
||||
'desc': '显示逗号千分符',
|
||||
'controlType': 'switch-checkbox',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 0,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'fmt.mmark',
|
||||
'name': '货币符号',
|
||||
'desc': '显示货币符号',
|
||||
'controlType': 'combox',
|
||||
'dataSource': [{ 'text': '无', 'value': '' }, { 'text': '人民币', 'value': '¥' }, { 'text': '美元', 'value': '$' }, { 'text': '欧元', 'value': '€' }, { 'text': '英镑', 'value': '£' }, { 'text': '日元', 'value': '¥' }, { 'text': '卢布', 'value': '₽' }, { 'text': '法郎', 'value': '€' }],
|
||||
'defaultValue': '',
|
||||
'dataType': 'string',
|
||||
'type': [1, 2],
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 },
|
||||
},
|
||||
{
|
||||
'code': 'fmt.munit',
|
||||
'name': '货币单位',
|
||||
'desc': '显示在后方的货币单位',
|
||||
'controlType': 'text',
|
||||
'defaultValue': '',
|
||||
'dataType': 'string',
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'fmt.mrmb',
|
||||
'name': '人民币大写',
|
||||
'desc': '显示为人民币大写',
|
||||
'controlType': 'switch-checkbox',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 0,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'type': [1, 2]
|
||||
},
|
||||
{
|
||||
'code': 'fmt.dtype',
|
||||
'name': '日期类型',
|
||||
'desc': '日期和时间的格式化类型',
|
||||
'controlType': 'radio',
|
||||
'dataSource': [{ 'text': '2023-01-01', 'value': 1 }, { 'text': '23:59:59', 'value': 2 }, { 'text': '2023-01-01 23:59:59', 'value': 3 }, { 'text': '自定义', 'value': 99 }],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 1,
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'cascadeDisplay': { 1: { show: [], hidden: ['fmt.format'] }, 2: { show: [], hidden: ['fmt.format'] }, 3: { show: [], hidden: ['fmt.format'] }, 99: { hidden: [], show: ['fmt.format'] }, default: { hidden: ['fmt.format'] }, empty: { hidden: ['fmt.format'] } },
|
||||
},
|
||||
{
|
||||
'code': 'fmt.format',
|
||||
'name': '格式化',
|
||||
'desc': '自定义格式化字符串',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
/**
|
||||
* 定义分组,用于属性编辑
|
||||
*/
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
},
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
|
||||
{
|
||||
name: "文本",
|
||||
attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed"
|
||||
, "textStyle.scale", "textStyle.lockWidth", "textStyle.hollow", "textStyle.bold", "textStyle.italic"
|
||||
, "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "数据",
|
||||
icon: 'icon-a-ziyuan409',
|
||||
subGroups: [
|
||||
{
|
||||
name: "基础信息",
|
||||
attrs: ["code", "text", "text1", "fmt.type", "fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb", "fmt.dtype", "fmt.format"]
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
467
plugins/core/controls/control/base/table-cell.ts
Normal file
467
plugins/core/controls/control/base/table-cell.ts
Normal file
@ -0,0 +1,467 @@
|
||||
export default {
|
||||
'id': '100302',
|
||||
'name': '单元格',
|
||||
'code': 'table-cell',
|
||||
'desc': '表格的单元格',
|
||||
'type': 'DDeiTableCell',
|
||||
'icon': 'toolbox-shape-rect'
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定义组件的样式属性,样式属性会影响图形的显示,修改样式属性也会刷新图形
|
||||
* 样式属性通常从001段ID开始计数
|
||||
* 属性采用三层结构:组(styles、datas、events)、子分组(group)、以及属性
|
||||
* 特殊属性:
|
||||
* code属性编码在统一个组中,code唯一
|
||||
* mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射
|
||||
* hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题
|
||||
* display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row
|
||||
*/
|
||||
export const styles = {
|
||||
'name': '样式',
|
||||
'children': [
|
||||
{
|
||||
'id': '100302001',
|
||||
'code': 'width',
|
||||
'name': '宽度',
|
||||
'desc': '控件的宽度',
|
||||
'group': '布局',
|
||||
'controlType': 'text',
|
||||
'dataSource': null,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': "160",
|
||||
'orderNo': 1,
|
||||
'visiable': false
|
||||
},
|
||||
{
|
||||
'id': '100302002',
|
||||
'code': 'height',
|
||||
'name': '高度',
|
||||
'desc': '控件的高度',
|
||||
'group': '布局',
|
||||
'controlType': 'text',
|
||||
'dataSource': null,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': "80",
|
||||
'orderNo': 2,
|
||||
'visiable': false
|
||||
},
|
||||
{
|
||||
'id': '100302003',
|
||||
'code': 'border.type',
|
||||
'name': '边框类型',
|
||||
'desc': '用来快速选择边框的类型,以便于套用相关的样式',
|
||||
'group': '边框',
|
||||
'controlType': 'border-type',
|
||||
'dataSource': [{ 'text': '无线条', 'value': '0' }, { 'text': '实线', 'value': '1' }],
|
||||
'dataType': 'string',
|
||||
'defaultValue': '1',
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'exmapping': ['border.top.disabled', 'border.right.disabled', 'border.bottom.disabled', 'border.left.disabled'],
|
||||
'orderNo': 1,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302004',
|
||||
'code': 'border.color',
|
||||
'name': '颜色',
|
||||
'desc': '图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式',
|
||||
'group': '边框',
|
||||
'controlType': 'color-combo',
|
||||
'mapping': ["border.top.color", "border.right.color", "border.bottom.color", "border.left.color"],
|
||||
'dataType': 'string',
|
||||
'defaultValue': 'rgb(219,219,233)',
|
||||
'orderNo': 2,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302005',
|
||||
'code': 'borderOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的边框的透明度,0完全透明~1完全不透明',
|
||||
'group': '边框',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 1,
|
||||
'step': 0.01,
|
||||
'mapping': ["border.top.opacity", "border.right.opacity", "border.bottom.opacity", "border.left.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 1,
|
||||
'display': 'column',
|
||||
'orderNo': 3,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302006',
|
||||
'code': 'borderWidth',
|
||||
'name': '粗细',
|
||||
'desc': '图形的边框的粗细,0为无边框',
|
||||
'group': '边框',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'mapping': ["border.top.width", "border.right.width", "border.bottom.width", "border.left.width"],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 1,
|
||||
'orderNo': 4,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302007',
|
||||
'code': 'borderDash',
|
||||
'name': '虚线',
|
||||
'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成',
|
||||
'group': '边框',
|
||||
'controlType': 'combox',
|
||||
'dataSource': [
|
||||
{ 'img': 'icon-line-00', 'text': '1', 'value': [] },
|
||||
{ 'img': 'icon-line-00', 'text': '2', 'value': [10, 5] },
|
||||
{ 'img': 'icon-line-00', 'text': '3', 'value': [5, 5] },
|
||||
{ 'img': 'icon-line-00', 'text': '4', 'value': [10, 4, 2, 4] },
|
||||
{ 'img': 'icon-line-00', 'text': '5', 'value': [10, 4, 2, 4, 2, 4] },
|
||||
{ 'img': 'icon-line-00', 'text': '6', 'value': [10, 4, 10, 4, 2, 4] },
|
||||
{ 'img': 'icon-line-00', 'text': '7', 'value': [20, 5, 10, 5] },
|
||||
{ 'img': 'icon-line-00', 'text': '8', 'value': [20, 5, 10, 5, 10, 5] },
|
||||
{ 'img': 'icon-line-00', 'text': '9', 'value': [3, 3] },
|
||||
{ 'img': 'icon-line-00', 'text': '10', 'value': [2, 2] },
|
||||
{ 'img': 'icon-line-00', 'text': '11', 'value': [3, 2, 2, 2] },
|
||||
{ 'img': 'icon-line-00', 'text': '12', 'value': [3, 2, 2, 2, 2, 2] },
|
||||
],
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 6, imgWidth: 60, imgHeight: 20, display: "img-text" },
|
||||
'mapping': ["border.top.dash", "border.right.dash", "border.bottom.dash", "border.left.dash"],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': [],
|
||||
'isArray': true,
|
||||
'orderNo': 5,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302008',
|
||||
'code': 'borderRound',
|
||||
'name': '圆角',
|
||||
'desc': '图形的边框的是否为为圆角的弧度',
|
||||
'group': '边框',
|
||||
'controlType': 'range',
|
||||
'mapping': ["border.top.round", "border.right.round", "border.bottom.round", "border.left.round"],
|
||||
'min': 0,
|
||||
'max': 100,
|
||||
'step': 1,
|
||||
'defaultValue': 0,
|
||||
'dataType': 'integer',
|
||||
'orderNo': 6,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302101',
|
||||
'code': 'fillType',
|
||||
'name': '填充类型',
|
||||
'desc': '图形填充的类型快速设置',
|
||||
'group': '填充',
|
||||
'controlType': 'fill-type',
|
||||
'dataSource': [{ 'text': '无填充', 'value': '0' }, { 'text': '单色填充', 'value': '1' }],
|
||||
'exmapping': ['fill.disabled'],
|
||||
'dataType': 'string',
|
||||
'defaultValue': '1',
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'orderNo': 1,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302102',
|
||||
'code': 'fill.color',
|
||||
'name': '颜色',
|
||||
'desc': '图形的填充颜色',
|
||||
'group': '填充',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': 'white',
|
||||
'orderNo': 2,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302103',
|
||||
'code': 'fill.opacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的填充的透明度,0完全透明~1完全不透明',
|
||||
'group': '填充',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 1,
|
||||
'step': 0.01,
|
||||
'defaultValue': 1,
|
||||
'dataType': 'float',
|
||||
'display': 'column',
|
||||
'orderNo': 3,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302201',
|
||||
'code': 'font.family',
|
||||
'name': '字体',
|
||||
'desc': '文本的字体名称',
|
||||
'group': '文本',
|
||||
'controlType': 'combox',
|
||||
'dataType': 'string',
|
||||
'dataSource': {
|
||||
'type': 'config',
|
||||
'data': 'fonts',
|
||||
'text': 'ch',
|
||||
'value': 'en',
|
||||
'bold': 'isSystemDefault',
|
||||
'fontFamily': 'en'
|
||||
},
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 },
|
||||
'canSearch': true,
|
||||
'defaultValue': "Microsoft YaHei",
|
||||
'orderNo': 1,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302202',
|
||||
'code': 'font.size',
|
||||
'name': '大小',
|
||||
'desc': '文本的字体大小',
|
||||
'group': '文本',
|
||||
'max': 50,
|
||||
'min': 5,
|
||||
'step': 0.5,
|
||||
'controlType': 'font-size',
|
||||
'dataType': 'float',
|
||||
'defaultValue': 14,
|
||||
'orderNo': 2,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302203',
|
||||
'code': 'font.color',
|
||||
'name': '颜色',
|
||||
'desc': '文本的颜色',
|
||||
'group': '文本',
|
||||
'controlType': 'color-combo',
|
||||
'dataType': 'string',
|
||||
'defaultValue': "#252525",
|
||||
'orderNo': 3,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302204',
|
||||
'code': 'fontAlign',
|
||||
'name': '对齐',
|
||||
'desc': '文本的对齐,采用九宫格式设置',
|
||||
'group': '文本',
|
||||
'controlType': 'align-type',
|
||||
'mapping': [],
|
||||
'dataType': 'string',
|
||||
'orderNo': 4,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302205',
|
||||
'code': 'textStyle.feed',
|
||||
'name': '换行',
|
||||
'desc': '自动换行',
|
||||
'group': '文本',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
'orderNo': 10,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302206',
|
||||
'code': 'textStyle.scale',
|
||||
'name': '缩小字体',
|
||||
'desc': '文本的自动缩小字体填充',
|
||||
'group': '文本',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
'orderNo': 11,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302207',
|
||||
'code': 'textStyle.hollow',
|
||||
'name': '镂空',
|
||||
'desc': '文本的镂空显示',
|
||||
'group': '文本',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
'orderNo': 9,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302208',
|
||||
'code': 'textStyle.bold',
|
||||
'name': '粗体',
|
||||
'desc': '文本的加粗显示',
|
||||
'group': '文本',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
'orderNo': 5,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302209',
|
||||
'code': 'textStyle.italic',
|
||||
'name': '斜体',
|
||||
'desc': '文本的斜体显示',
|
||||
'group': '文本',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
'orderNo': 6,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302210',
|
||||
'code': 'textStyle.underline',
|
||||
'name': '下划线',
|
||||
'desc': '文本的下划线显示',
|
||||
'group': '文本',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
'orderNo': 7,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302211',
|
||||
'code': 'textStyle.deleteline',
|
||||
'name': '删除线',
|
||||
'desc': '文本的删除线显示',
|
||||
'group': '文本',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
'orderNo': 8,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100302212',
|
||||
'code': 'textStyle.topline',
|
||||
'name': '顶部线',
|
||||
'desc': '文本的删除线显示',
|
||||
'group': '文本',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '是', 'value': '1' }, { 'text': '否', 'value': '0' }],
|
||||
'defaultValue': '0',
|
||||
'orderNo': 8,
|
||||
'visiable': true
|
||||
},
|
||||
|
||||
{
|
||||
'id': '100302303',
|
||||
'code': 'textStyle.align',
|
||||
'name': '水平对齐',
|
||||
'desc': '文本的水平对齐',
|
||||
'group': '文本',
|
||||
'controlType': 'text',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 2,
|
||||
'visiable': false
|
||||
},
|
||||
{
|
||||
'id': '100302304',
|
||||
'code': 'textStyle.valign',
|
||||
'name': '垂直对齐',
|
||||
'desc': '文本的垂直对齐',
|
||||
'group': '文本',
|
||||
'controlType': 'text',
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 2,
|
||||
'visiable': false
|
||||
},
|
||||
],
|
||||
'visiable': false,
|
||||
'order': 1
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义组件的数据属性,数据属性一般用于业务就算,修改数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系
|
||||
* 数据属性通常占用400段ID,开始计数
|
||||
*/
|
||||
export const datas = {
|
||||
'name': '数据',
|
||||
'children': [
|
||||
{
|
||||
'id': '100302401',
|
||||
'code': 'id',
|
||||
'name': 'id',
|
||||
'desc': '控件在画布的全局唯一ID',
|
||||
'group': '布局与文本',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'readonly': true,
|
||||
'orderNo': 1,
|
||||
'visiable': false
|
||||
},
|
||||
{
|
||||
'id': '100302403',
|
||||
'code': 'text',
|
||||
'name': '文本',
|
||||
'desc': '控件的主体显示文本',
|
||||
'group': '布局与文本',
|
||||
'controlType': 'textarea',
|
||||
'defaultValue': '文本',
|
||||
'hiddenTitle': false,
|
||||
'display': 'column',
|
||||
'dataType': 'string',
|
||||
'type': [1, 2], //类别,1图形,2业务,3事件
|
||||
'orderNo': 3,
|
||||
'visiable': true,
|
||||
},
|
||||
{
|
||||
'id': '100302404',
|
||||
'code': 'layout',
|
||||
'name': '布局',
|
||||
'desc': '文本的字体名称',
|
||||
'group': '布局与文本',
|
||||
'controlType': 'radio',
|
||||
'dataSource': [
|
||||
{ 'text': '自由布局', 'value': 'free' },
|
||||
{ 'text': '完全填充', 'value': 'full' },
|
||||
{ 'text': '九宫格', 'value': 'nine' },
|
||||
{ 'text': '表格', 'value': 'table' },
|
||||
{ 'text': '圆心', 'value': 'cc' },
|
||||
],
|
||||
'defaultValue': 'full',
|
||||
'hiddenTitle': false,
|
||||
'display': 'column',
|
||||
'dataType': 'string',
|
||||
'orderNo': 2,
|
||||
'visiable': true
|
||||
},
|
||||
],
|
||||
'visiable': true,
|
||||
'order': 2
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 定义组件的事件属性,事件属性一般用于外部扩展
|
||||
* 数据属性通常占用800段ID,开始计数
|
||||
*/
|
||||
export const events = {
|
||||
'name': '事件',
|
||||
'children': [
|
||||
],
|
||||
'visiable': false,
|
||||
'order': 3
|
||||
}
|
||||
281
plugins/core/controls/control/base/table.ts
Normal file
281
plugins/core/controls/control/base/table.ts
Normal file
@ -0,0 +1,281 @@
|
||||
export default {
|
||||
'id': '100301',
|
||||
'name': '表格',
|
||||
'code': 'table',
|
||||
'desc': '表格控件,可以通过插入、移动、合并单元格完成复杂的布局',
|
||||
'type': 'DDeiTable',
|
||||
'icon': 'icon-table',
|
||||
'subcontrol': '100302'
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定义组件的样式属性,样式属性会影响图形的显示,修改样式属性也会刷新图形
|
||||
* 样式属性通常从001段ID开始计数
|
||||
* 属性采用三层结构:组(styles、datas、events)、子分组(group)、以及属性
|
||||
* 特殊属性:
|
||||
* code属性编码在统一个组中,code唯一
|
||||
* mapping建立与模型中属性的映射关系,为null时为默认,采用code指向的属性映射;mapping为[]时交由控件编辑器处理值映射
|
||||
* hiddenTitle隐藏标题,为true时不会显示属性标题,默认false不隐藏标题
|
||||
* display控件显示模式,有row(横向排列)和column(纵向排列)两个选项,默认row
|
||||
*/
|
||||
export const styles = {
|
||||
'name': '样式',
|
||||
'children': [
|
||||
{
|
||||
'id': '100301001',
|
||||
'code': 'width',
|
||||
'name': '宽度',
|
||||
'desc': '控件的宽度',
|
||||
'group': '布局',
|
||||
'controlType': 'text',
|
||||
'dataSource': null,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': "600",
|
||||
'orderNo': 1,
|
||||
'visiable': false
|
||||
},
|
||||
{
|
||||
'id': '100301002',
|
||||
'code': 'height',
|
||||
'name': '高度',
|
||||
'desc': '控件的高度',
|
||||
'group': '布局',
|
||||
'controlType': 'text',
|
||||
'dataSource': null,
|
||||
'dataType': 'integer',
|
||||
'defaultValue': "200",
|
||||
'orderNo': 2,
|
||||
'visiable': false
|
||||
},
|
||||
{
|
||||
'id': '100301003',
|
||||
'code': 'border.type',
|
||||
'name': '边框类型',
|
||||
'desc': '用来快速选择边框的类型,以便于套用相关的样式',
|
||||
'group': '边框',
|
||||
'controlType': 'border-type',
|
||||
'dataSource': [{ 'text': '无线条', 'value': '0' }, { 'text': '实线', 'value': '1' }],
|
||||
'dataType': 'string',
|
||||
'defaultValue': '1',
|
||||
'hiddenTitle': true,
|
||||
'display': 'column',
|
||||
'exmapping': ['border.top.disabled', 'border.right.disabled', 'border.bottom.disabled', 'border.left.disabled'],
|
||||
'orderNo': 1,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100301004',
|
||||
'code': 'border.color',
|
||||
'name': '颜色',
|
||||
'desc': '图形的边框显示颜色,在高级设置中,可以分别设置不同方向边框的样式',
|
||||
'group': '边框',
|
||||
'controlType': 'color-combo',
|
||||
'mapping': ["border.top.color", "border.right.color", "border.bottom.color", "border.left.color"],
|
||||
'dataType': 'string',
|
||||
'defaultValue': 'black',
|
||||
'orderNo': 2,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100301005',
|
||||
'code': 'borderOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的边框的透明度,0完全透明~1完全不透明',
|
||||
'group': '边框',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 1,
|
||||
'step': 0.01,
|
||||
'mapping': ["border.top.opacity", "border.right.opacity", "border.bottom.opacity", "border.left.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 1,
|
||||
'display': 'column',
|
||||
'orderNo': 3,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100301006',
|
||||
'code': 'borderWidth',
|
||||
'name': '粗细',
|
||||
'desc': '图形的边框的粗细,0为无边框',
|
||||
'group': '边框',
|
||||
'controlType': 'range',
|
||||
'min': 0,
|
||||
'max': 10,
|
||||
'step': 0.1,
|
||||
'mapping': ["border.top.width", "border.right.width", "border.bottom.width", "border.left.width"],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': 1,
|
||||
'orderNo': 4,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100301007',
|
||||
'code': 'borderDash',
|
||||
'name': '虚线',
|
||||
'desc': '图形的边框的是否为虚线样式,虚线由长短不一的线段构成',
|
||||
'group': '边框',
|
||||
'controlType': 'combox',
|
||||
'dataSource': [
|
||||
{ 'img': 'icon-line-00', 'text': '1', 'value': [] },
|
||||
{ 'img': 'icon-line-00', 'text': '2', 'value': [10, 5] },
|
||||
{ 'img': 'icon-line-00', 'text': '3', 'value': [5, 5] },
|
||||
{ 'img': 'icon-line-00', 'text': '4', 'value': [10, 4, 2, 4] },
|
||||
{ 'img': 'icon-line-00', 'text': '5', 'value': [10, 4, 2, 4, 2, 4] },
|
||||
{ 'img': 'icon-line-00', 'text': '6', 'value': [10, 4, 10, 4, 2, 4] },
|
||||
{ 'img': 'icon-line-00', 'text': '7', 'value': [20, 5, 10, 5] },
|
||||
{ 'img': 'icon-line-00', 'text': '8', 'value': [20, 5, 10, 5, 10, 5] },
|
||||
{ 'img': 'icon-line-00', 'text': '9', 'value': [3, 3] },
|
||||
{ 'img': 'icon-line-00', 'text': '10', 'value': [2, 2] },
|
||||
{ 'img': 'icon-line-00', 'text': '11', 'value': [3, 2, 2, 2] },
|
||||
{ 'img': 'icon-line-00', 'text': '12', 'value': [3, 2, 2, 2, 2, 2] },
|
||||
],
|
||||
'itemStyle': { width: 80, height: 25, col: 2, row: 6, imgWidth: 60, imgHeight: 20, display: "img-text" },
|
||||
'mapping': ["border.top.dash", "border.right.dash", "border.bottom.dash", "border.left.dash"],
|
||||
'dataType': 'integer',
|
||||
'defaultValue': [],
|
||||
'isArray': true,
|
||||
'orderNo': 5,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100301008',
|
||||
'code': 'borderRound',
|
||||
'name': '圆角',
|
||||
'desc': '图形的边框的是否为为圆角的弧度',
|
||||
'group': '边框',
|
||||
'controlType': 'range',
|
||||
'mapping': ["border.top.round", "border.right.round", "border.bottom.round", "border.left.round"],
|
||||
'min': 0,
|
||||
'max': 100,
|
||||
'step': 1,
|
||||
'defaultValue': 0,
|
||||
'dataType': 'integer',
|
||||
'orderNo': 6,
|
||||
'visiable': true
|
||||
},
|
||||
{
|
||||
'id': '100301305',
|
||||
'code': 'borderCreatingOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的边框的透明度,0完全透明~1完全不透明',
|
||||
'group': '边框',
|
||||
'controlType': 'text',
|
||||
'mapping': ["border.creating.top.opacity", "border.creating.right.opacity", "border.creating.bottom.opacity", "border.creating.left.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
'display': 'column',
|
||||
'orderNo': 3,
|
||||
'visiable': false
|
||||
},
|
||||
{
|
||||
'id': '100301306',
|
||||
'code': 'fillCreatingOpacity',
|
||||
'name': '透明度',
|
||||
'desc': '图形的填充的透明度,0完全透明~1完全不透明',
|
||||
'group': '填充',
|
||||
'controlType': 'text',
|
||||
'mapping': ["fill.creating.opacity"],
|
||||
'dataType': 'float',
|
||||
'defaultValue': 0.5,
|
||||
'display': 'column',
|
||||
'orderNo': 3,
|
||||
'visiable': false
|
||||
},
|
||||
],
|
||||
'visiable': false,
|
||||
'order': 1
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义组件的数据属性,数据属性一般用于业务就算,修改数据属性一般不会刷新图形,除非数据属性和样式属性产生联动关系
|
||||
* 数据属性通常占用400段ID,开始计数
|
||||
*/
|
||||
export const datas = {
|
||||
'name': '数据',
|
||||
'children': [
|
||||
{
|
||||
'id': '100301401',
|
||||
'code': 'id',
|
||||
'name': 'id',
|
||||
'desc': '控件在画布的全局唯一ID',
|
||||
'group': '基础信息',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'readonly': true,
|
||||
'orderNo': 1,
|
||||
'visiable': false
|
||||
},
|
||||
{
|
||||
'id': '100301402',
|
||||
'code': 'code',
|
||||
'name': '编码',
|
||||
'desc': '控件在业务上的唯一编码,缺省和控件ID一致',
|
||||
'group': '基础信息',
|
||||
'controlType': 'text',
|
||||
'dataType': 'string',
|
||||
'defaultValue': '编码001',
|
||||
'orderNo': 2,
|
||||
'visiable': true
|
||||
},
|
||||
|
||||
],
|
||||
'visiable': true,
|
||||
'order': 1
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定义组件的事件属性,事件属性一般用于外部扩展
|
||||
* 数据属性通常占用800段ID,开始计数
|
||||
*/
|
||||
export const events = {
|
||||
'name': '事件',
|
||||
'children': [
|
||||
],
|
||||
'visiable': false,
|
||||
'order': 3
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 定义组件的右键菜单
|
||||
*/
|
||||
export const menus = [
|
||||
{
|
||||
'code': 'insert-row',
|
||||
'name': '插入行',
|
||||
'icon': 'icon-insert-row',
|
||||
},
|
||||
{
|
||||
'code': 'insert-col',
|
||||
'name': '插入列',
|
||||
'icon': 'icon-insert-col',
|
||||
},
|
||||
{
|
||||
'code': 'remove-row',
|
||||
'name': '删除行',
|
||||
'icon': 'icon-delete-row',
|
||||
},
|
||||
{
|
||||
'code': 'remove-col',
|
||||
'name': '删除列',
|
||||
'icon': 'icon-delete-column',
|
||||
},
|
||||
{
|
||||
'code': 'split',
|
||||
},
|
||||
{
|
||||
'code': 'merge-cell',
|
||||
'name': '合并单元格',
|
||||
'icon': 'icon-merge-cells',
|
||||
},
|
||||
{
|
||||
'code': 'cancel-merge-cell',
|
||||
'name': '取消合并单元格',
|
||||
'icon': 'icon-merge-cells',
|
||||
},
|
||||
|
||||
]
|
||||
33
plugins/core/controls/control/basic/circle-split.ts
Normal file
33
plugins/core/controls/control/basic/circle-split.ts
Normal file
@ -0,0 +1,33 @@
|
||||
export default {
|
||||
'id': '100104',
|
||||
'name': '圆形-切割',
|
||||
'code': 'circle',
|
||||
'desc': '由圆形,从中间横向/纵向切割开',
|
||||
'from': '100103',
|
||||
'icon': 'toolbox-shape-circle',
|
||||
'define': {
|
||||
//扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息
|
||||
ext: {
|
||||
//追加一个从中间切开的采样点,用于横向切割
|
||||
sample: {
|
||||
direct: 1,//1横向切割,2纵向切割
|
||||
pvalue: 0,//切割的坐标,横向切割时为纵坐标,纵向切割时为横坐标
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
if(sample.direct == 1){
|
||||
pvs.push({begin:1,x:-50,y:sample.pvalue,stroke:1,type:1});
|
||||
pvs.push({end:1,x:50,y:sample.pvalue,stroke:1,type:1});
|
||||
}else{
|
||||
pvs.push({begin:1,x:sample.pvalue,y:-50,stroke:1,type:1});
|
||||
pvs.push({end:1,x:sample.pvalue,y:50,stroke:1,type:1});
|
||||
}
|
||||
}
|
||||
}`
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
47
plugins/core/controls/control/basic/circle-text.ts
Normal file
47
plugins/core/controls/control/basic/circle-text.ts
Normal file
@ -0,0 +1,47 @@
|
||||
export default {
|
||||
'id': '100003',
|
||||
'name': '圆形',
|
||||
'code': 'circle',
|
||||
'desc': '由极坐标系构造的圆形,带有text',
|
||||
'from': '100103',
|
||||
|
||||
|
||||
'define': {
|
||||
ext: {
|
||||
//采样信息
|
||||
sample: {
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1});
|
||||
}`,
|
||||
]
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
},
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"]
|
||||
},
|
||||
{
|
||||
name: "文本",
|
||||
attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed"
|
||||
, "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic"
|
||||
, "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"]
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
67
plugins/core/controls/control/basic/circle.ts
Normal file
67
plugins/core/controls/control/basic/circle.ts
Normal file
@ -0,0 +1,67 @@
|
||||
export default {
|
||||
'id': '100103',
|
||||
'name': '圆形',
|
||||
'code': 'circle',
|
||||
'desc': '由极坐标系构造的圆形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: 1,
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 45,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({x:x,y:y,r:er,select:1});
|
||||
}`,
|
||||
//操作点
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({x:x,y:y,r:sample.r ,oppoint:1});
|
||||
if(i == 3){
|
||||
pvs.push({x:0,y:0,r:sample.r ,oppoint:3});
|
||||
}
|
||||
}`,
|
||||
//绘制线段、填充区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1});
|
||||
}
|
||||
}`
|
||||
]
|
||||
},
|
||||
ext: {
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
},
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"]
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
58
plugins/core/controls/control/basic/cube.ts
Normal file
58
plugins/core/controls/control/basic/cube.ts
Normal file
@ -0,0 +1,58 @@
|
||||
export default {
|
||||
'id': '100501',
|
||||
'name': '正方体',
|
||||
'code': 'cube',
|
||||
'desc': '正方体',
|
||||
'from': '100500',
|
||||
'icon': 'toolbox-shape-square',
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: true,
|
||||
//只采样一次
|
||||
loop: 1,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//允许文本输入
|
||||
textInput: 1,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({begin:1,x:50,y:50,stroke:1,select:1,oppoint:2,fill:1});
|
||||
pvs.push({x:-50,y:50,stroke:1,select:1,oppoint:2,fill:1});
|
||||
pvs.push({x:-50,y:-50,stroke:1,select:1,oppoint:2,fill:1});
|
||||
pvs.push({x:-45,y:-60,stroke:1,select:1,oppoint:1,fill:1});
|
||||
pvs.push({x:55,y:-60,stroke:1,select:1,oppoint:1,fill:1});
|
||||
pvs.push({end:1,x:55,y:40,stroke:1,select:1,oppoint:1,fill:1});
|
||||
}`,
|
||||
//内部连线
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({begin:1,x:-50,y:-50,stroke:1});
|
||||
pvs.push({x:50,y:-50,stroke:1,oppoint:2,op2close:1});
|
||||
pvs.push({x:55,y:-60,stroke:1});
|
||||
pvs.push({x:-50,y:-50,type:3});
|
||||
pvs.push({x:50,y:-50,stroke:1});
|
||||
pvs.push({x:50,y:50,stroke:1});
|
||||
pvs.push({x:-50,y:-50,type:3});
|
||||
}`,
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({x:-48,y:48,text:sample.textInput});
|
||||
pvs.push({x:-48,y:-48,text:sample.textInput});
|
||||
pvs.push({x:48,y:-48,text:sample.textInput});
|
||||
pvs.push({x:48,y:48,text:sample.textInput});
|
||||
}`,
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
14
plugins/core/controls/control/basic/diamond-round.ts
Normal file
14
plugins/core/controls/control/basic/diamond-round.ts
Normal file
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
'id': '100041',
|
||||
'name': '菱形',
|
||||
'code': 'diamond',
|
||||
'desc': '圆角的菱形',
|
||||
'from': '100040',
|
||||
|
||||
'define': {
|
||||
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
36
plugins/core/controls/control/basic/diamond.ts
Normal file
36
plugins/core/controls/control/basic/diamond.ts
Normal file
@ -0,0 +1,36 @@
|
||||
export default {
|
||||
'id': '100040',
|
||||
'name': '菱形',
|
||||
'code': 'diamond',
|
||||
'desc': '标准的菱形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 80,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: -90,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({begin:i==0,end:i==3,x:sample.x,y:sample.y,select:1,oppoint:1,stroke:1,fill:1,clip:1});
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r * Math.cos(45)
|
||||
let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({begin:i==0,end:i==3,x:x,y:y,text:1});
|
||||
}`,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
52
plugins/core/controls/control/basic/ellipse.ts
Normal file
52
plugins/core/controls/control/basic/ellipse.ts
Normal file
@ -0,0 +1,52 @@
|
||||
export default {
|
||||
'id': '100006',
|
||||
'name': '椭圆',
|
||||
'code': 'ellipse',
|
||||
'desc': '由极坐标系构造的椭圆形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 80,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 45,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({x:x,y:y,r:er,select:1});
|
||||
}`,
|
||||
//操作点
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({x:x,y:y,r:sample.r ,oppoint:1});
|
||||
if(i == 3){
|
||||
pvs.push({x:0,y:0,r:sample.r ,oppoint:3});
|
||||
}
|
||||
}`,
|
||||
//绘制线段、填充区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({r:sample.r,stroke:1,fill:1,clip:1,begin:1,end:1});
|
||||
}
|
||||
}`,
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1});
|
||||
}`,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
65
plugins/core/controls/control/basic/fivestar.ts
Normal file
65
plugins/core/controls/control/basic/fivestar.ts
Normal file
@ -0,0 +1,65 @@
|
||||
export default {
|
||||
'id': '100070',
|
||||
'name': '五角星',
|
||||
'code': 'fivestar',
|
||||
'desc': '由极坐标系构造的五角星',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: true,
|
||||
//一圈10次采样
|
||||
loop: 10,
|
||||
//初始次采样的开始角度
|
||||
angle: -90,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model,ovs){
|
||||
let er = i % 2 == 0 ? sample.r : sample.r / 2.7+(ovs[0].x-ovs[0].ovi.x)
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({ begin:i==0,end:i==9,x: x, y: y ,fill:1,select:1,stroke:1,clip:1,oppoint:1});
|
||||
}`,
|
||||
`(i, sample, pvs, model,ovs){
|
||||
if (i == 0) {
|
||||
let er = sample.r / 3+(ovs[0].x-ovs[0].ovi.x)
|
||||
let x = er * Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let y = er * Math.sin(45 * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({ begin:1,x: x, y: y, text:1 });
|
||||
x = er * Math.cos(135 * DDeiConfig.ROTATE_UNIT)
|
||||
y = er * Math.sin(135 * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({ x: x, y: y, text:1 });
|
||||
x = er * Math.cos(225 * DDeiConfig.ROTATE_UNIT)
|
||||
y = er * Math.sin(225 * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({ x: x, y: y, text:1 });
|
||||
x = er * Math.cos(315 * DDeiConfig.ROTATE_UNIT)
|
||||
y = er * Math.sin(315 * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({ end:1,x: x, y: y, text:1 });
|
||||
}
|
||||
}`,
|
||||
]
|
||||
|
||||
},
|
||||
//操作点定义
|
||||
ovs: [
|
||||
{
|
||||
x: 10, y: 0, ix: 10, iy: 0,
|
||||
//约束,控制点的移动路径和位置
|
||||
constraint: {
|
||||
type: 2,//矩形范围
|
||||
x0: 0,
|
||||
x1: 30,
|
||||
y0: 0,
|
||||
y1: 0,
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
78
plugins/core/controls/control/basic/half-circle.ts
Normal file
78
plugins/core/controls/control/basic/half-circle.ts
Normal file
@ -0,0 +1,78 @@
|
||||
export default {
|
||||
'id': '100110',
|
||||
'name': '半圆',
|
||||
'code': 'hcircle',
|
||||
'desc': '由极坐标系构造的半圆形',
|
||||
'from': '100500',
|
||||
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: 1,
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 45,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//方向,上右下左1,2,3,4
|
||||
direct: 2,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
let deltaRotate = 0
|
||||
switch(sample.direct){
|
||||
case 1:
|
||||
deltaRotate = -90
|
||||
break;
|
||||
case 3:
|
||||
deltaRotate = -270
|
||||
break;
|
||||
case 4:
|
||||
deltaRotate = -180
|
||||
break;
|
||||
}
|
||||
let rad1 = (90+deltaRotate) * DDeiConfig.ROTATE_UNIT
|
||||
let rad2 = (-90+deltaRotate) * DDeiConfig.ROTATE_UNIT
|
||||
let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT
|
||||
let x0 = sample.r * Math.cos(rad0)
|
||||
let y0 = sample.r * Math.sin(rad0)
|
||||
let x1 = sample.r * Math.cos(rad1)
|
||||
let y1 = sample.r * Math.sin(rad1)
|
||||
let x2 = sample.r * Math.cos(rad2)
|
||||
let y2 = sample.r * Math.sin(rad2)
|
||||
pvs.push({begin:1,x:x2,y:y2,r:sample.r,rad:rad2,stroke:1,type:2,direct:1});
|
||||
pvs.push({x:x2,y:y2,r:sample.r,rad:rad1,stroke:1,type:2,direct:1});
|
||||
pvs.push({x:x2,y:y2});
|
||||
pvs.push({end:1,x:0,y:0});
|
||||
pvs.push({x:x1,y:y1,type:0,oppoint:1});
|
||||
pvs.push({x:x2,y:y2,type:0,oppoint:1});
|
||||
|
||||
pvs.push({x:x0,y:0,type:0,oppoint:1});
|
||||
pvs.push({x:x2,y:0,type:0,oppoint:1});
|
||||
pvs.push({x:x0,y:y2,type:0});
|
||||
pvs.push({x:x0,y:y1,type:0});
|
||||
}
|
||||
}`,
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({x:x,y:y,r:er,select:1});
|
||||
}`,
|
||||
],
|
||||
|
||||
},
|
||||
iconPos: {
|
||||
dx: -50
|
||||
}
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basic/hexagon-round.ts
Normal file
13
plugins/core/controls/control/basic/hexagon-round.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '100031',
|
||||
'name': '六边形',
|
||||
'code': 'hexagon',
|
||||
'desc': '由六个点构成的六边形',
|
||||
'from': '100030',
|
||||
|
||||
'define': {
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
51
plugins/core/controls/control/basic/hexagon.ts
Normal file
51
plugins/core/controls/control/basic/hexagon.ts
Normal file
@ -0,0 +1,51 @@
|
||||
export default {
|
||||
'id': '100030',
|
||||
'name': '六边形',
|
||||
'code': 'hexagon',
|
||||
'desc': '由六个点构成的六边形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 6,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({begin:i == 0,end:i == 5,op2close:i == 5 ? 1 :0,oppoint:2,x:x,y:y,select:1,clip:1,stroke:1,fill:1});
|
||||
}`,
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
|
||||
switch(i){
|
||||
case 0:;
|
||||
case 2:;
|
||||
case 3:;
|
||||
case 5:
|
||||
let er = sample.r / Math.cos(30 * DDeiConfig.ROTATE_UNIT)
|
||||
let rad = (sample.sita+30) * DDeiConfig.ROTATE_UNIT
|
||||
let x = er * Math.cos(rad)
|
||||
let y = er * Math.sin(rad)
|
||||
pvs.push({begin:i == 0,end:i == 5,x:x,y:y,text:1});
|
||||
;
|
||||
}
|
||||
}`,
|
||||
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
55
plugins/core/controls/control/basic/hexstar.ts
Normal file
55
plugins/core/controls/control/basic/hexstar.ts
Normal file
@ -0,0 +1,55 @@
|
||||
export default {
|
||||
'id': '100075',
|
||||
'name': '六芒星',
|
||||
'code': 'hexstar',
|
||||
'desc': '由极坐标系构造的六芒星',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈6次采样
|
||||
loop: 12,
|
||||
//初始次采样的开始角度
|
||||
angle: -90,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = i%2 == 0 ? sample.r : sample.r * 0.58
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({begin:i==0,end:i==11, x: x, y: y, oppoint:1,select:1,clip:1,stroke:1,fill:1 });
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 2 == 1){
|
||||
let er = sample.r * 0.58
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({begin:i==1,end:i==11, x: x, y: y,stroke:1,fill:1 });
|
||||
}
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 2 == 0 && i != 6 && i !=0){
|
||||
let er = sample.r * 0.5
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({begin:i==2,end:i==10, x: x, y: y,text:1 });
|
||||
}
|
||||
}`,
|
||||
|
||||
]
|
||||
},
|
||||
textArea: [
|
||||
{ x: -2.5, y: 32.5, z: 1 },
|
||||
{ x: 102.5, y: 32.5, z: 1 },
|
||||
{ x: 102.5, y: 142.5, z: 1 },
|
||||
{ x: -2.5, y: 142.5, z: 1 },
|
||||
],
|
||||
}
|
||||
}
|
||||
40
plugins/core/controls/control/basic/hexstar1.ts
Normal file
40
plugins/core/controls/control/basic/hexstar1.ts
Normal file
@ -0,0 +1,40 @@
|
||||
export default {
|
||||
'id': '100076',
|
||||
'name': '六角形',
|
||||
'code': 'hexstar',
|
||||
'desc': '由极坐标系构造的六角星',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈6次采样
|
||||
loop: 12,
|
||||
//初始次采样的开始角度
|
||||
angle: -90,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = i%2 == 0 ? sample.r : sample.r * 0.58
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({begin:i==0,end:i==11, x: x, y: y,select:1,clip:1,stroke:1,fill:1,oppoint:1 });
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 2 == 0 && i != 6 && i !=0){
|
||||
let x = sample.x * 0.5
|
||||
let y = sample.y * 0.5
|
||||
pvs.push({begin:i==2,end:i==10, x: x, y: y,text:1 });
|
||||
}
|
||||
}`,
|
||||
|
||||
]
|
||||
},
|
||||
}
|
||||
}
|
||||
74
plugins/core/controls/control/basic/hexstar2.ts
Normal file
74
plugins/core/controls/control/basic/hexstar2.ts
Normal file
@ -0,0 +1,74 @@
|
||||
export default {
|
||||
'id': '100077',
|
||||
'name': '六芒星',
|
||||
'code': 'hexstar',
|
||||
'desc': '由极坐标系构造的六芒星',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈6次采样
|
||||
loop: 12,
|
||||
//初始次采样的开始角度
|
||||
angle: -90,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选择范围
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 3 == 0){
|
||||
let er = (sample.r+5) / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({ begin:i==0,end:i==9,x: x, y: y,select:1 });
|
||||
}
|
||||
}`,
|
||||
//第一层圈
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
let er = sample.r+5
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({begin:1,end:1, x: x, y: y,r:er,clip:1,stroke:1,fill:1 });
|
||||
}
|
||||
}`,
|
||||
//第二层圈
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,end:1, x: sample.x, y: sample.y,r:sample.r,stroke:1,fill:1 });
|
||||
}
|
||||
}`,
|
||||
//六边形外围
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = i%2 == 0 ? sample.r : sample.r * 0.58
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({ begin:i==0,end:i==11,x: x, y: y,oppoint:1,stroke:1,fill:1 });
|
||||
}`,
|
||||
//内部五边形
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 2 == 1){
|
||||
let x = sample.x * 0.58
|
||||
let y = sample.y * 0.58
|
||||
pvs.push({ begin:i==1,end:i==11,x: x, y: y,stroke:1,fill:1 });
|
||||
}
|
||||
}`,
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 2 == 0 && i != 6 && i !=0){
|
||||
let x = sample.x*0.5
|
||||
let y = sample.y*0.5
|
||||
pvs.push({ begin:i==2,end:i==10,x: x, y: y,text:1 });
|
||||
}
|
||||
}`,
|
||||
|
||||
],
|
||||
},
|
||||
}
|
||||
}
|
||||
16
plugins/core/controls/control/basic/left-arrow.ts
Normal file
16
plugins/core/controls/control/basic/left-arrow.ts
Normal file
@ -0,0 +1,16 @@
|
||||
export default {
|
||||
'id': '100121',
|
||||
'name': '左箭头',
|
||||
'code': 'arr-l',
|
||||
'desc': '指向左边的箭头',
|
||||
'from': '100120',
|
||||
|
||||
'define': {
|
||||
//采样信息
|
||||
ext: {
|
||||
sample: {
|
||||
angle: 180
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
plugins/core/controls/control/basic/parallelogram-round.ts
Normal file
14
plugins/core/controls/control/basic/parallelogram-round.ts
Normal file
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
'id': '100051',
|
||||
'name': '平行四边形',
|
||||
'code': 'paralgram',
|
||||
'desc': '由4个点组成的平行四边形',
|
||||
'from': '100050',
|
||||
|
||||
'define': {
|
||||
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
97
plugins/core/controls/control/basic/parallelogram.ts
Normal file
97
plugins/core/controls/control/basic/parallelogram.ts
Normal file
@ -0,0 +1,97 @@
|
||||
export default {
|
||||
'id': '100050',
|
||||
'name': '平行四边形',
|
||||
'code': 'paralgram',
|
||||
'desc': '由4个点组成的平行四边形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model,ovs){
|
||||
switch(i){
|
||||
case 0:
|
||||
pvs.push({begin:1,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1});
|
||||
break;
|
||||
case 1:
|
||||
pvs.push({x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1});
|
||||
break;
|
||||
case 2:
|
||||
pvs.push({x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,stroke:1,fill:1});
|
||||
break;
|
||||
case 3:
|
||||
pvs.push({end:1,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,op2close:1,stroke:1,fill:1});
|
||||
pvs[0].y = pvs[1].y
|
||||
pvs[1].x = pvs[2].x
|
||||
pvs[2].y = pvs[3].y
|
||||
pvs[3].x = pvs[0].x+(ovs[0].x-ovs[0].ovi.x)
|
||||
pvs[2].x = pvs[2].x+(ovs[0].x-ovs[0].ovi.x)
|
||||
pvs[0].x = pvs[0].x-(ovs[0].x-ovs[0].ovi.x)
|
||||
pvs[1].x = pvs[1].x-(ovs[0].x-ovs[0].ovi.x)
|
||||
break;
|
||||
}
|
||||
}`,
|
||||
//文本区域
|
||||
`(i, sample, pvs, model,ovs){
|
||||
switch(i){
|
||||
case 0:
|
||||
pvs.push({begin:1,x:sample.x,y:sample.y,text:1});
|
||||
break;
|
||||
case 1:
|
||||
pvs.push({x:sample.x,y:sample.y,text:1});
|
||||
break;
|
||||
case 2:
|
||||
pvs.push({x:sample.x,y:sample.y,text:1});
|
||||
break;
|
||||
case 3:
|
||||
pvs.push({end:1,x:sample.x,y:sample.y,text:1});
|
||||
pvs[0].y = pvs[1].y
|
||||
pvs[1].x = pvs[2].x
|
||||
pvs[2].y = pvs[3].y
|
||||
pvs[3].x = pvs[0].x+(ovs[0].x-ovs[0].ovi.x)
|
||||
pvs[2].x = pvs[2].x+(ovs[0].x-ovs[0].ovi.x)
|
||||
pvs[0].x = pvs[0].x-(ovs[0].x-ovs[0].ovi.x)
|
||||
pvs[1].x = pvs[1].x-(ovs[0].x-ovs[0].ovi.x)
|
||||
|
||||
let x0 = Math.max(pvs[1].x,pvs[2].x)
|
||||
let x1 = Math.min(pvs[3].x,pvs[0].x)
|
||||
pvs[0].x = x1
|
||||
pvs[3].x = x1
|
||||
pvs[1].x = x0
|
||||
pvs[2].x = x0
|
||||
|
||||
break;
|
||||
}
|
||||
}`
|
||||
|
||||
],
|
||||
},
|
||||
//操作点定义
|
||||
ovs: [
|
||||
{
|
||||
x: 25, y: -50, ix: 0, iy: -50,
|
||||
//约束,控制点的移动路径和位置
|
||||
constraint: {
|
||||
type: 2,//矩形范围
|
||||
x0: -100,
|
||||
x1: 100,
|
||||
y0: -50,
|
||||
y1: -50,
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
14
plugins/core/controls/control/basic/pentagon-round.ts
Normal file
14
plugins/core/controls/control/basic/pentagon-round.ts
Normal file
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
'id': '100021',
|
||||
'name': '五边形',
|
||||
'code': 'pentagon',
|
||||
'desc': '由五个点构成的五边形',
|
||||
'from': '100020',
|
||||
|
||||
'define': {
|
||||
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
47
plugins/core/controls/control/basic/pentagon.ts
Normal file
47
plugins/core/controls/control/basic/pentagon.ts
Normal file
@ -0,0 +1,47 @@
|
||||
export default {
|
||||
'id': '100020',
|
||||
'name': '五边形',
|
||||
'code': 'pentagon',
|
||||
'desc': '由五个点构成的五边形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 154,
|
||||
height: 154,
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: true,
|
||||
//一圈5次采样
|
||||
loop: 5,
|
||||
//初始次采样的开始角度
|
||||
angle: 198,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 4:
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,clip:1,oppoint:2,op2close:i == 4?1:0,stroke:1,fill:1});
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:28,y:35,text:1});
|
||||
pvs.push({x:-28,y:35,text:1});
|
||||
pvs.push({x:-28,y:-28,text:1});
|
||||
pvs.push({end:1,x:28,y:-28,text:1});
|
||||
}
|
||||
}`,
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
87
plugins/core/controls/control/basic/rectangle-border.ts
Normal file
87
plugins/core/controls/control/basic/rectangle-border.ts
Normal file
@ -0,0 +1,87 @@
|
||||
export default {
|
||||
'id': '100007',
|
||||
'name': '矩形边框',
|
||||
'code': 'rect',
|
||||
'desc': '带边框的矩形',
|
||||
'from': '100002',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 80,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
cIndex: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈采样次数
|
||||
loop: 4,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r * 1.25
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
let begin = 0,end = 0,op2close = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
begin = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=x
|
||||
break;
|
||||
case 3:
|
||||
op2close = 1
|
||||
pvs[2].y=y
|
||||
x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:begin,end:end,x:x,y:y,r:er,select:1,clip:1,oppoint:2,op2close:op2close});
|
||||
}`,
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r
|
||||
let x = sample.x
|
||||
let y = sample.y
|
||||
let begin = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
begin = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=x
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=y
|
||||
x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:begin,end:end,x:x,y:y,r:er,stroke:1,fill:1,text:1});
|
||||
}`,
|
||||
],
|
||||
|
||||
|
||||
},
|
||||
//组合控件
|
||||
composes: [
|
||||
{
|
||||
width: 200,
|
||||
height: 100,
|
||||
id: '100002',
|
||||
cIndex: 1,
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basic/rectangle-round.ts
Normal file
13
plugins/core/controls/control/basic/rectangle-round.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '100005',
|
||||
'name': '圆角矩形',
|
||||
'code': 'rect',
|
||||
'desc': '由4个点组成的矩形',
|
||||
'from': '100002',
|
||||
|
||||
'define': {
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
33
plugins/core/controls/control/basic/rectangle-split.ts
Normal file
33
plugins/core/controls/control/basic/rectangle-split.ts
Normal file
@ -0,0 +1,33 @@
|
||||
export default {
|
||||
'id': '100009',
|
||||
'name': '长方形-切割',
|
||||
'code': 'rect',
|
||||
'desc': '由4个点组成的长方形,从中间横向/纵向切割开',
|
||||
'from': '100008',
|
||||
|
||||
'define': {
|
||||
//扩展采样信息,用于在原有的基础上增加采样,或者覆盖采样的部分信息
|
||||
ext: {
|
||||
//追加一个从中间切开的采样点,用于横向切割
|
||||
sample: {
|
||||
direct: 1,//1横向切割,2纵向切割
|
||||
pvalue: -10,//切割的坐标,横向切割时为纵坐标,纵向切割时为横坐标
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
if(sample.direct == 1){
|
||||
pvs.push({begin:1,x:-50,y:sample.pvalue,stroke:1,type:1});
|
||||
pvs.push({end:1,x:50,y:sample.pvalue,stroke:1,type:1});
|
||||
}else{
|
||||
pvs.push({begin:1,x:sample.pvalue,y:-50,stroke:1,type:1});
|
||||
pvs.push({end:1,x:sample.pvalue,y:50,stroke:1,type:1});
|
||||
}
|
||||
}
|
||||
}`
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
40
plugins/core/controls/control/basic/rectangle-text.ts
Normal file
40
plugins/core/controls/control/basic/rectangle-text.ts
Normal file
@ -0,0 +1,40 @@
|
||||
export default {
|
||||
'id': '100002',
|
||||
'name': '长方形-带文本',
|
||||
'code': 'rect',
|
||||
'desc': '由4个点组成的长方形',
|
||||
'from': '100008',
|
||||
|
||||
'define': {
|
||||
ext: {
|
||||
sample: {
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1});
|
||||
}`
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
19
plugins/core/controls/control/basic/rectangle.ts
Normal file
19
plugins/core/controls/control/basic/rectangle.ts
Normal file
@ -0,0 +1,19 @@
|
||||
export default {
|
||||
'id': '100008',
|
||||
'name': '长方形',
|
||||
'code': 'rect',
|
||||
'desc': '由4个点组成的长方形',
|
||||
'from': '100000',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 80,
|
||||
ext: {
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
35
plugins/core/controls/control/basic/right-arrow.ts
Normal file
35
plugins/core/controls/control/basic/right-arrow.ts
Normal file
@ -0,0 +1,35 @@
|
||||
export default {
|
||||
'id': '100120',
|
||||
'name': '左箭头',
|
||||
'code': 'arr-r',
|
||||
'desc': '指向左边的箭头',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈12次采样
|
||||
loop: 12,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 4 == 0){
|
||||
let op2close = 0
|
||||
if(i == 8){
|
||||
op2close = 1
|
||||
}
|
||||
pvs.push({begin:i == 0,end:i == 8,x:sample.x,y:sample.y,select:1,clip:1,oppoint:2,op2close:op2close,stroke:1,fill:1});
|
||||
}
|
||||
}`
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basic/square-round.ts
Normal file
13
plugins/core/controls/control/basic/square-round.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '100004',
|
||||
'name': '圆角正方形',
|
||||
'code': 'square',
|
||||
'desc': '由4个点组成的正方形',
|
||||
'from': '100001',
|
||||
'icon': 'toolbox-shape-square',
|
||||
'define': {
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
38
plugins/core/controls/control/basic/square-text.ts
Normal file
38
plugins/core/controls/control/basic/square-text.ts
Normal file
@ -0,0 +1,38 @@
|
||||
export default {
|
||||
'id': '100001',
|
||||
'name': '正方形-带文本',
|
||||
'code': 'square',
|
||||
'desc': '由4个点组成的正方形',
|
||||
'from': '100000',
|
||||
'icon': 'toolbox-shape-square',
|
||||
'define': {
|
||||
ext: {
|
||||
sample: {
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1});
|
||||
}`
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
50
plugins/core/controls/control/basic/square.ts
Normal file
50
plugins/core/controls/control/basic/square.ts
Normal file
@ -0,0 +1,50 @@
|
||||
export default {
|
||||
'id': '100000',
|
||||
'name': '正方形',
|
||||
'code': 'square',
|
||||
'desc': '由4个点组成的正方形',
|
||||
'from': '100500',
|
||||
'icon': 'toolbox-shape-square',
|
||||
'define': {
|
||||
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: true,
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0,op2close = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
break;
|
||||
case 3:
|
||||
op2close = 1
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,r:sample.r,select:1,clip:1,oppoint:2,op2close:op2close,align:1,stroke:1,fill:1});
|
||||
}`,
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
71
plugins/core/controls/control/basic/text.ts
Normal file
71
plugins/core/controls/control/basic/text.ts
Normal file
@ -0,0 +1,71 @@
|
||||
export default {
|
||||
'id': '100200',
|
||||
'name': '文本',
|
||||
'code': 'text',
|
||||
'desc': '跟随内容变化大小的文本',
|
||||
'from': '100002',
|
||||
'define': {
|
||||
borderType: 0,
|
||||
border: {
|
||||
type: 0
|
||||
},
|
||||
fill: {
|
||||
type: 0
|
||||
},
|
||||
text: "文本",
|
||||
ext: {
|
||||
/**
|
||||
* 定义分组,用于属性编辑
|
||||
*/
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "文本",
|
||||
attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed"
|
||||
, "textStyle.scale", "textStyle.lockWidth", "textStyle.hollow", "textStyle.bold", "textStyle.italic"
|
||||
, "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"]
|
||||
},
|
||||
{
|
||||
name: "边框",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "数据",
|
||||
icon: 'icon-a-ziyuan409',
|
||||
subGroups: [
|
||||
{
|
||||
name: "数据属性",
|
||||
attrs: ["code", "text", "fmt.type", "fmt.nscale", "fmt.tmark", "fmt.mmark", "fmt.munit", "fmt.mrmb", "fmt.dtype", "fmt.format"]
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
attrs: [
|
||||
{
|
||||
'code': 'textStyle.scale',
|
||||
'name': '超出范围',
|
||||
'desc': '文本的超出范围后的策略',
|
||||
'controlType': 'radio',
|
||||
'dataType': 'string',
|
||||
'dataSource': [{ 'text': '隐藏', 'value': '0' }, { 'text': '省略', 'value': '2' }, { 'text': '缩小', 'value': '1' }, { 'text': '扩展', 'value': '3' }],
|
||||
'defaultValue': '3',
|
||||
'cascadeDisplay': { 3: { show: ['textStyle.lockWidth'], hidden: [] }, default: { hidden: ['textStyle.lockWidth'] }, empty: { hidden: ['textStyle.lockWidth'] }, notempty: { hidden: ['textStyle.lockWidth'] } }
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
14
plugins/core/controls/control/basic/trapezoid-round.ts
Normal file
14
plugins/core/controls/control/basic/trapezoid-round.ts
Normal file
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
'id': '100061',
|
||||
'name': '圆角梯形',
|
||||
'code': 'trapezoid',
|
||||
'desc': '由4个点组成的梯形',
|
||||
'from': '100060',
|
||||
|
||||
'define': {
|
||||
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
74
plugins/core/controls/control/basic/trapezoid.ts
Normal file
74
plugins/core/controls/control/basic/trapezoid.ts
Normal file
@ -0,0 +1,74 @@
|
||||
export default {
|
||||
'id': '100060',
|
||||
'name': '梯形',
|
||||
'code': 'trapezoid',
|
||||
'desc': '由4个点组成的梯形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
|
||||
width: 160,
|
||||
height: 80,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: true,
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0,op2close = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
sample.x+=20
|
||||
break;
|
||||
case 3:
|
||||
op2close = 1
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x-20
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:op2close,select:1,clip:1,stroke:1,fill:1});
|
||||
}`,
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
sample.x -= 20
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
sample.x += 20
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1});
|
||||
}`
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
'id': '100014',
|
||||
'name': '直角三角形',
|
||||
'code': 'triangle',
|
||||
'desc': '由三个点构成的三角形',
|
||||
'from': '100011',
|
||||
|
||||
'define': {
|
||||
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
47
plugins/core/controls/control/basic/triangle-left-90.ts
Normal file
47
plugins/core/controls/control/basic/triangle-left-90.ts
Normal file
@ -0,0 +1,47 @@
|
||||
export default {
|
||||
'id': '100011',
|
||||
'name': '直角三角形',
|
||||
'code': 'triangle',
|
||||
'desc': '由三个点构成的三角形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈1次采样
|
||||
loop: 1,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({begin:1,x:50,y:50,select:1,clip:1});
|
||||
pvs.push({x:-50,y:50,select:1,clip:1});
|
||||
pvs.push({x:-50,y:-50,select:1,clip:1});
|
||||
pvs.push({end:1,x:50,y:-50,select:1,clip:1});
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({begin:1,x:50,y:50,oppoint:2,align:1,stroke:1,fill:1});
|
||||
pvs.push({x:-50,y:50,oppoint:2,align:1,stroke:1,fill:1});
|
||||
pvs.push({end:1,x:-50,y:-50,oppoint:2,op2close:1,align:1,stroke:1,fill:1});
|
||||
}`,
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:-50,y:50,text:1});
|
||||
pvs.push({x:0,y:50,text:1});
|
||||
pvs.push({x:0,y:0,text:1});
|
||||
pvs.push({end:1,x:-50,y:0,text:1});
|
||||
}
|
||||
}`,
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
'id': '100015',
|
||||
'name': '直角三角形',
|
||||
'code': 'triangle',
|
||||
'desc': '由三个点构成的三角形',
|
||||
'from': '100012',
|
||||
|
||||
'define': {
|
||||
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
47
plugins/core/controls/control/basic/triangle-right-90.ts
Normal file
47
plugins/core/controls/control/basic/triangle-right-90.ts
Normal file
@ -0,0 +1,47 @@
|
||||
export default {
|
||||
'id': '100012',
|
||||
'name': '直角三角形',
|
||||
'code': 'triangle',
|
||||
'desc': '由三个点构成的三角形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈1次采样
|
||||
loop: 1,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({begin:1,x:50,y:50,select:1,clip:1});
|
||||
pvs.push({x:-50,y:50,select:1,clip:1});
|
||||
pvs.push({x:-50,y:-50,select:1,clip:1});
|
||||
pvs.push({end:1,x:50,y:-50,select:1,clip:1});
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({begin:1,x:50,y:50,oppoint:2,align:1,stroke:1,fill:1});
|
||||
pvs.push({x:-50,y:50,oppoint:2,align:1,stroke:1,fill:1});
|
||||
pvs.push({end:1,x:50,y:-50,oppoint:2,op2close:1,align:1,stroke:1,fill:1});
|
||||
}`,
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:50,y:50,text:1});
|
||||
pvs.push({x:0,y:50,text:1});
|
||||
pvs.push({x:0,y:0,text:1});
|
||||
pvs.push({end:1,x:50,y:0,text:1});
|
||||
}
|
||||
}`,
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basic/triangle-round.ts
Normal file
13
plugins/core/controls/control/basic/triangle-round.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '100013',
|
||||
'name': '三角形',
|
||||
'code': 'triangle',
|
||||
'desc': '由三个点构成的三角形',
|
||||
'from': '100010',
|
||||
|
||||
'define': {
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
86
plugins/core/controls/control/basic/triangle.ts
Normal file
86
plugins/core/controls/control/basic/triangle.ts
Normal file
@ -0,0 +1,86 @@
|
||||
export default {
|
||||
'id': '100010',
|
||||
'name': '三角形',
|
||||
'code': 'triangle',
|
||||
'desc': '由三个点构成的三角形',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: true,
|
||||
//一圈12次采样
|
||||
loop: 12,
|
||||
//初始次采样的开始角度
|
||||
angle: -90,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 4 == 0){
|
||||
let op2close = 0
|
||||
if(i == 8){
|
||||
op2close = 1
|
||||
}
|
||||
pvs.push({begin:i == 0,end:i == 8,x:sample.x,y:sample.y,clip:1,oppoint:2,op2close:op2close,stroke:1,fill:1});
|
||||
}
|
||||
}`,
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i % 3 == 0){
|
||||
let er = sample.r/2
|
||||
let x = er * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
let y = er * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({begin:i == 0,end:i == 9,x:x,y:y,text:1});
|
||||
}
|
||||
}`,
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
let sita = 45;
|
||||
let rad = sita * DDeiConfig.ROTATE_UNIT
|
||||
let cos = parseFloat(Math.cos(rad).toFixed(4))
|
||||
let sin = parseFloat(Math.sin(rad).toFixed(4))
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let x = er * cos
|
||||
let y = er * sin
|
||||
pvs.push({x:x,y:y,r:er,select:1});
|
||||
sita = 135;
|
||||
rad = sita * DDeiConfig.ROTATE_UNIT
|
||||
cos = parseFloat(Math.cos(rad).toFixed(4))
|
||||
sin = parseFloat(Math.sin(rad).toFixed(4))
|
||||
er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
x = er * cos
|
||||
y = er * sin
|
||||
pvs.push({x:x,y:y,r:er,select:1});
|
||||
sita = 225;
|
||||
rad = sita * DDeiConfig.ROTATE_UNIT
|
||||
cos = parseFloat(Math.cos(rad).toFixed(4))
|
||||
sin = parseFloat(Math.sin(rad).toFixed(4))
|
||||
er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
x = er * cos
|
||||
y = er * sin
|
||||
pvs.push({x:x,y:y,r:er,select:1});
|
||||
sita = 315;
|
||||
rad = sita * DDeiConfig.ROTATE_UNIT
|
||||
cos = parseFloat(Math.cos(rad).toFixed(4))
|
||||
sin = parseFloat(Math.sin(rad).toFixed(4))
|
||||
er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
x = er * cos
|
||||
y = er * sin
|
||||
pvs.push({x:x,y:y,r:er,select:1});
|
||||
}
|
||||
}`,
|
||||
],
|
||||
|
||||
},
|
||||
iconPos: {
|
||||
dy: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
53
plugins/core/controls/control/basicflow/flow-card-tab.ts
Normal file
53
plugins/core/controls/control/basicflow/flow-card-tab.ts
Normal file
@ -0,0 +1,53 @@
|
||||
export default {
|
||||
'id': '102053',
|
||||
'name': '卡片',
|
||||
'code': 'fct',
|
||||
'desc': '流程的卡片',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 110,
|
||||
height: 70,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let weight = 20
|
||||
switch(i){
|
||||
case 0:
|
||||
pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y+weight
|
||||
pvs.push({x:pvs[2].x+weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1});
|
||||
sample.x = pvs[0].x
|
||||
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,fill:1,oppoint:2,op2close:1,end:1});
|
||||
|
||||
pvs.push({x:sample.x,y:pvs[2].y,text:1,type:0});
|
||||
break;
|
||||
}
|
||||
|
||||
}`
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
export default {
|
||||
'id': '102058',
|
||||
'name': '控制传递',
|
||||
'code': 'ctran',
|
||||
'desc': '控制传递',
|
||||
'from': '100401',
|
||||
|
||||
'define': {
|
||||
type: 2,
|
||||
ep: {
|
||||
type: 1
|
||||
},
|
||||
pvs: [
|
||||
{ x: -75, y: 0, z: 1 },
|
||||
{ x: 0, y: 0, z: 1 },
|
||||
{ x: 75, y: 0, z: 1 },
|
||||
],
|
||||
cpv: {
|
||||
x: 0, y: 0
|
||||
},
|
||||
//组合控件
|
||||
composes: [
|
||||
{
|
||||
width: 30,
|
||||
height: 30,
|
||||
id: '100120',
|
||||
cIndex: 1,
|
||||
initCPV: {
|
||||
x: 0, y: 0, z: 1
|
||||
}
|
||||
},
|
||||
],
|
||||
//操作点
|
||||
ovs: [
|
||||
{
|
||||
x: 0, y: 0, ix: 0, iy: 0,
|
||||
//约束,控制点的移动路径和位置
|
||||
constraint: {
|
||||
type: 1,//跟随线段
|
||||
pvs: ["pvs"]//当前对象的pvs
|
||||
},
|
||||
//联动,点移动后控制的其它点
|
||||
links: [
|
||||
{
|
||||
type: 1,//1施加矩阵
|
||||
pvs: ["composes[0]"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
40
plugins/core/controls/control/basicflow/flow-data.ts
Normal file
40
plugins/core/controls/control/basicflow/flow-data.ts
Normal file
@ -0,0 +1,40 @@
|
||||
export default {
|
||||
'id': '102030',
|
||||
'name': '数据',
|
||||
'code': 'fdata',
|
||||
'desc': '流程的数据节点',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 150,
|
||||
height: 90,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈采样次数
|
||||
loop: 4,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//初始次采样的开始角度
|
||||
angle: 45,
|
||||
//半径距离
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i,sample, pvs, model){
|
||||
let ds = i == 2 || i ==3 ? 5: -5
|
||||
let x = sample.x+ds
|
||||
let y = sample.y
|
||||
let op2close = i == 3 ? 1 :0
|
||||
pvs.push({begin:i==0,end:i==3, x: x, y: y,select:1,clip:1,fill:1,stroke:1,oppoint:2,op2close:op2close });
|
||||
}`,
|
||||
`(i,sample, pvs, model){
|
||||
let ds = i == 1 || i ==2 ? 5: -5
|
||||
let x = sample.x+ds
|
||||
let y = sample.y
|
||||
pvs.push({ begin:i==0,end:i==3, x: x, y: y,text:1 });
|
||||
}`,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basicflow/flow-data1.ts
Normal file
13
plugins/core/controls/control/basicflow/flow-data1.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '102031',
|
||||
'name': '数据',
|
||||
'code': 'fdata',
|
||||
'desc': '流程的数据节点',
|
||||
'from': '102030',
|
||||
|
||||
'define': {
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
65
plugins/core/controls/control/basicflow/flow-data2.ts
Normal file
65
plugins/core/controls/control/basicflow/flow-data2.ts
Normal file
@ -0,0 +1,65 @@
|
||||
export default {
|
||||
'id': '102032',
|
||||
'name': '存储数据',
|
||||
'code': 'fdata',
|
||||
'desc': '流程的数据节点',
|
||||
'from': '102030',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 70,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈采样次数
|
||||
loop: 1,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let dr = -50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({begin:1,x:-dr,y:50,select:1})
|
||||
pvs.push({x:dr,y:50,select:1})
|
||||
pvs.push({x:dr,y:-50,select:1})
|
||||
pvs.push({end:1,x:-dr,y:-50,select:1})
|
||||
}`,
|
||||
//操作点
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({x:100-dr,y:0,oppoint:1})
|
||||
pvs.push({x:-dr,y:0,oppoint:1})
|
||||
pvs.push({x:0,y:50,oppoint:1})
|
||||
pvs.push({x:0,y:-50,oppoint:1})
|
||||
}`,
|
||||
//主体区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let rad1 = 135 * DDeiConfig.ROTATE_UNIT
|
||||
let rad2 = 225 * DDeiConfig.ROTATE_UNIT
|
||||
pvs.push({begin:1,x:50,y:50,stroke:1,fill:1,clip:1})
|
||||
pvs.push({x:-50,y:50,r:dr,rad:rad1,stroke:1,fill:1,clip:1})
|
||||
pvs.push({x:-50,y:-50,type:2,r:dr,rad:rad2,direct:1,stroke:1,fill:1,clip:1})
|
||||
pvs.push({x:50,y:-50,r:dr,rad:rad2,stroke:1,fill:1,clip:1})
|
||||
pvs.push({end:1,dx:100,type:2,r:dr,rad:rad1,direct:0,stroke:1,fill:1,clip:1})
|
||||
}`,
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let dr = 50/ Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({begin:1,x:100-dr,y:50,text:1})
|
||||
pvs.push({x:-50,y:50,text:1})
|
||||
pvs.push({x:-50,y:-50,text:1})
|
||||
pvs.push({end:1,x:100-dr,y:-50,text:1})
|
||||
}`,
|
||||
],
|
||||
|
||||
}, iconPos: {
|
||||
dw: 15
|
||||
}
|
||||
}
|
||||
}
|
||||
57
plugins/core/controls/control/basicflow/flow-data3.ts
Normal file
57
plugins/core/controls/control/basicflow/flow-data3.ts
Normal file
@ -0,0 +1,57 @@
|
||||
export default {
|
||||
'id': '102033',
|
||||
'name': '顺序数据',
|
||||
'code': 'sqdata',
|
||||
'desc': '流程的顺序数据节点',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: 1,
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 45,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT) + 2
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({x:x,y:y,r:er,select:1});
|
||||
}`,
|
||||
//操作点
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let x = sample.r * Math.cos((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
let y = sample.r * Math.sin((sample.sita+45) * DDeiConfig.ROTATE_UNIT)
|
||||
pvs.push({x:x,y:y,r:sample.r ,oppoint:1});
|
||||
|
||||
}`,
|
||||
//绘制线段、填充区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:50,y:50});
|
||||
pvs.push({y:50,x:0,stroke:1,type:1,end:1});
|
||||
}
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({r:sample.r,stroke:1,fill:1,begin:1,end:1});
|
||||
}
|
||||
}`,
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({x:sample.x,y:sample.y,r:sample.r,text:1});
|
||||
}`,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
57
plugins/core/controls/control/basicflow/flow-defflow.ts
Normal file
57
plugins/core/controls/control/basicflow/flow-defflow.ts
Normal file
@ -0,0 +1,57 @@
|
||||
export default {
|
||||
'id': '102041',
|
||||
'name': '预定义流程',
|
||||
'code': 'defflow',
|
||||
'desc': '流程的子流程节点',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈采样次数
|
||||
loop: 4,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//初始次采样的开始角度
|
||||
angle: 45,
|
||||
//半径距离
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({ begin:i==0,end:i==3,x: sample.x, y: sample.y,select:1,clip:1,stroke:1,fill:1 });
|
||||
}`,
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r
|
||||
let x = sample.x
|
||||
let y = sample.y
|
||||
let op2close = i == 3?1:0
|
||||
pvs.push({x:x,y:y,r:er,type:0,oppoint:2,op2close:op2close});
|
||||
|
||||
}`,
|
||||
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 1){
|
||||
pvs.push({begin:1, x: sample.x, y: sample.y,stroke:1});
|
||||
}else if(i == 2){
|
||||
pvs[3] = {end:1, x: sample.x, y: sample.y,stroke:1};
|
||||
pvs[1] = { x: sample.x+10, y: sample.y,stroke:1};
|
||||
pvs[2] = { x: pvs[0].x+10, y: pvs[0].y,stroke:1};
|
||||
}
|
||||
}`,
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let ds = i == 1 || i ==2 ? 10: -10
|
||||
let x = sample.x+ds
|
||||
let y = sample.y
|
||||
pvs.push({ begin:i==0,end:i==3,x: x, y: y,text:1,stroke:1 });
|
||||
}`,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
87
plugins/core/controls/control/basicflow/flow-delay.ts
Normal file
87
plugins/core/controls/control/basicflow/flow-delay.ts
Normal file
@ -0,0 +1,87 @@
|
||||
export default {
|
||||
'id': '102055',
|
||||
'name': '推迟',
|
||||
'code': 'fdy',
|
||||
'desc': '数据库图标',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 80,
|
||||
height: 80,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
cIndex: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈采样次数
|
||||
loop: 4,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:100,y:50,select:1,clip:1})
|
||||
pvs.push({x:-50,y:50,select:1,clip:1})
|
||||
pvs.push({x:-50,y:-50,select:1,clip:1})
|
||||
pvs.push({end:1,x:100,y:-50,select:1,clip:1})
|
||||
}
|
||||
}`,
|
||||
//操作点
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:100,y:0,oppoint:1})
|
||||
pvs.push({x:0,y:50,oppoint:1})
|
||||
pvs.push({x:-50,y:0,oppoint:1})
|
||||
pvs.push({end:1,x:0,y:-50,oppoint:1})
|
||||
}
|
||||
}`,
|
||||
//绘制线段区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT
|
||||
let x = er * Math.cos(rad)
|
||||
let y = er * Math.sin(rad)
|
||||
let rad90 = 90 * DDeiConfig.ROTATE_UNIT
|
||||
switch(i){
|
||||
case 0:
|
||||
pvs.push({begin:1,x:x,y:y,fill:1,stroke:1,r:er,rad:0});
|
||||
break;
|
||||
case 1:
|
||||
pvs.push({x:x,y:y,fill:1,stroke:1});
|
||||
break;
|
||||
case 2:
|
||||
|
||||
pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:rad90});
|
||||
break;
|
||||
case 3:
|
||||
pvs.push({x:x,y:y,fill:1,stroke:1,r:er,rad:-rad90});
|
||||
pvs.push({r:er,dx:50,rad:rad90,stroke:1,type:4,direct:1,end:1});
|
||||
pvs.push({r:sample.r});
|
||||
pvs.push({r:sample.r});
|
||||
break;
|
||||
}
|
||||
}`,
|
||||
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:50,y:50,text:1})
|
||||
pvs.push({x:-50,y:50,text:1})
|
||||
pvs.push({x:-50,y:-50,text:1})
|
||||
pvs.push({end:1,x:50,y:-50,text:1})
|
||||
}
|
||||
}`,
|
||||
],
|
||||
|
||||
},
|
||||
iconPos: {
|
||||
dx: -20,
|
||||
dw: 10
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
export default {
|
||||
'id': '102056',
|
||||
'name': '显示内容',
|
||||
'code': 'fdc',
|
||||
'desc': '显示内容',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 80,
|
||||
height: 80,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
cIndex: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈采样次数
|
||||
loop: 4,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:135,y:50,select:1,clip:1})
|
||||
pvs.push({x:-135,y:50,select:1,clip:1})
|
||||
pvs.push({x:-135,y:-50,select:1,clip:1})
|
||||
pvs.push({end:1,x:135,y:-50,select:1,clip:1})
|
||||
}
|
||||
}`,
|
||||
//操作点
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:65,y:0,oppoint:1})
|
||||
pvs.push({x:0,y:50,oppoint:1})
|
||||
pvs.push({x:-135,y:0,oppoint:1})
|
||||
pvs.push({end:1,x:0,y:-50,oppoint:1})
|
||||
}
|
||||
}`,
|
||||
//绘制线段区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let rad = (sample.sita+45) * DDeiConfig.ROTATE_UNIT
|
||||
let x = er * Math.cos(rad)
|
||||
let y = er * Math.sin(rad)
|
||||
let rad90 = 90 * DDeiConfig.ROTATE_UNIT
|
||||
switch(i){
|
||||
case 0:
|
||||
pvs.push({begin:1,x:x-10,y:y,fill:1,stroke:1,r:er,rad:0});
|
||||
break;
|
||||
case 1:
|
||||
pvs.push({x:x,y:y,fill:1,stroke:1});
|
||||
break;
|
||||
case 2:
|
||||
pvs.push({x:-135,y:0,fill:1,stroke:1});
|
||||
pvs.push({x:x,y:y,fill:1,stroke:1});
|
||||
break;
|
||||
case 3:
|
||||
pvs.push({x:x-10,y:y,fill:1,stroke:1,r:er,rad:-rad90,rd:0});
|
||||
pvs.push({r:er,dx:40,rad:rad90,stroke:1,type:4,direct:1,end:1});
|
||||
pvs.push({r:25});
|
||||
pvs.push({r:sample.r});
|
||||
break;
|
||||
}
|
||||
}`,
|
||||
|
||||
//文本区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
pvs.push({begin:1,x:50,y:50,text:1})
|
||||
pvs.push({x:-50,y:50,text:1})
|
||||
pvs.push({x:-50,y:-50,text:1})
|
||||
pvs.push({end:1,x:50,y:-50,text:1})
|
||||
}
|
||||
}`,
|
||||
],
|
||||
|
||||
},
|
||||
iconPos: {
|
||||
dx: 20,
|
||||
dw: 10,
|
||||
},
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
34
plugins/core/controls/control/basicflow/flow-end.ts
Normal file
34
plugins/core/controls/control/basicflow/flow-end.ts
Normal file
@ -0,0 +1,34 @@
|
||||
export default {
|
||||
'id': '102090',
|
||||
'name': '结束',
|
||||
'code': 'end',
|
||||
'desc': '流程的开始节点',
|
||||
'from': '102001',
|
||||
|
||||
'define': {
|
||||
width: 40,
|
||||
height: 40,
|
||||
fill: {
|
||||
color: 'black'
|
||||
},
|
||||
ext: {
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
},
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
44
plugins/core/controls/control/basicflow/flow-end1.ts
Normal file
44
plugins/core/controls/control/basicflow/flow-end1.ts
Normal file
@ -0,0 +1,44 @@
|
||||
export default {
|
||||
'id': '102091',
|
||||
'name': '结束',
|
||||
'code': 'end',
|
||||
'desc': '流程的开始节点',
|
||||
'from': '100003',
|
||||
|
||||
'define': {
|
||||
width: 40,
|
||||
height: 40,
|
||||
cIndex: 1,
|
||||
composes: [
|
||||
{
|
||||
id: "102090",
|
||||
width: 30,
|
||||
height: 30,
|
||||
cIndex: 2,
|
||||
attrLinks: [
|
||||
{ code: "fill", mapping: ["*"] },
|
||||
{ code: "border", mapping: ["*"] },
|
||||
]
|
||||
}
|
||||
],
|
||||
ext: {
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
},
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
37
plugins/core/controls/control/basicflow/flow-end2.ts
Normal file
37
plugins/core/controls/control/basicflow/flow-end2.ts
Normal file
@ -0,0 +1,37 @@
|
||||
export default {
|
||||
'id': '102092',
|
||||
'name': '结束',
|
||||
'code': 'end',
|
||||
'desc': '流程的开始节点',
|
||||
'from': '100003',
|
||||
|
||||
'define': {
|
||||
width: 40,
|
||||
height: 40,
|
||||
fill: {
|
||||
color: 'red'
|
||||
},
|
||||
border: {
|
||||
type: 0
|
||||
},
|
||||
ext: {
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
},
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
45
plugins/core/controls/control/basicflow/flow-end3.ts
Normal file
45
plugins/core/controls/control/basicflow/flow-end3.ts
Normal file
@ -0,0 +1,45 @@
|
||||
export default {
|
||||
'id': '102093',
|
||||
'name': '结束',
|
||||
'code': 'end',
|
||||
'desc': '流程的开始节点',
|
||||
'from': '100003',
|
||||
|
||||
'define': {
|
||||
width: 40,
|
||||
height: 40,
|
||||
cIndex: 1,
|
||||
composes: [
|
||||
{
|
||||
id: "102001",
|
||||
width: 30,
|
||||
height: 30,
|
||||
cIndex: 2,
|
||||
attrLinks: [
|
||||
{ code: "fill", mapping: ["*"] },
|
||||
{ code: "border", mapping: ["*"] },
|
||||
]
|
||||
}
|
||||
],
|
||||
ext: {
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "填充",
|
||||
attrs: ["fill.type", "fill.color", "fill.image", "fill.opacity"]
|
||||
},
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash"]
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
52
plugins/core/controls/control/basicflow/flow-hand-input.ts
Normal file
52
plugins/core/controls/control/basicflow/flow-hand-input.ts
Normal file
@ -0,0 +1,52 @@
|
||||
export default {
|
||||
'id': '102052',
|
||||
'name': '手动输入',
|
||||
'code': 'fhi',
|
||||
'desc': '流程的手动输入节点',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 110,
|
||||
height: 70,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let weight = 20
|
||||
switch(i){
|
||||
case 0:
|
||||
pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y+weight
|
||||
|
||||
sample.x = pvs[0].x
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,fill:1,oppoint:2,op2close:1,end:1});
|
||||
pvs.push({x:sample.x,y:pvs[2].y,text:1,type:0});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}`
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
52
plugins/core/controls/control/basicflow/flow-loop-area.ts
Normal file
52
plugins/core/controls/control/basicflow/flow-loop-area.ts
Normal file
@ -0,0 +1,52 @@
|
||||
export default {
|
||||
'id': '102050',
|
||||
'name': '循环界限',
|
||||
'code': 'fla',
|
||||
'desc': '流程的循环界限',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 110,
|
||||
height: 70,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let weight = 20
|
||||
switch(i){
|
||||
case 0:
|
||||
pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1});
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y+weight
|
||||
pvs.push({x:pvs[2].x+weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1});
|
||||
sample.x = pvs[0].x
|
||||
pvs.push({x:sample.x-weight,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1});
|
||||
pvs.push({x:sample.x,y:sample.y+weight,select:1,clip:1,text:1,stroke:1,oppoint:2,op2close:1,fill:1,end:1});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}`
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
export default {
|
||||
'id': '102057',
|
||||
'name': '手动操作',
|
||||
'code': 'fmo',
|
||||
'desc': '由人工手动完成的节点',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 140,
|
||||
height: 70,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
eqrat: true,
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
sample.x -= 20
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x = sample.x+20
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x+20
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 :0,select:1,clip:1,stroke:1,fill:1});
|
||||
}`,
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
sample.x +=20
|
||||
pvs[1].x = sample.x
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,text:1});
|
||||
}`
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
46
plugins/core/controls/control/basicflow/flow-page-ref.ts
Normal file
46
plugins/core/controls/control/basicflow/flow-page-ref.ts
Normal file
@ -0,0 +1,46 @@
|
||||
export default {
|
||||
'id': '102051',
|
||||
'name': '跨页引用',
|
||||
'code': 'fpr',
|
||||
'desc': '流程的跨页引用',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 70,
|
||||
height: 70,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
`(i, sample, pvs, model, ovs){
|
||||
switch(i){
|
||||
case 0:
|
||||
pvs.push({begin:1,x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1});
|
||||
break;
|
||||
case 1:
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,stroke:1,oppoint:2,fill:1});
|
||||
break;
|
||||
case 2:
|
||||
pvs.push({x:sample.x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1});
|
||||
break;
|
||||
case 3:
|
||||
pvs.push({x:-pvs[0].x,y:sample.y,select:1,clip:1,text:1,oppoint:2,stroke:1,fill:1});
|
||||
pvs.push({x:pvs[0].x,y:sample.y,select:1,clip:1,text:1,oppoint:2,op2close:1,stroke:1,fill:1,end:1});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}`
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
12
plugins/core/controls/control/basicflow/flow-prepare.ts
Normal file
12
plugins/core/controls/control/basicflow/flow-prepare.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'id': '102054',
|
||||
'name': '准备',
|
||||
'code': 'prepare',
|
||||
'desc': '流程的准备',
|
||||
'from': '100030',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 70
|
||||
}
|
||||
}
|
||||
12
plugins/core/controls/control/basicflow/flow-start.ts
Normal file
12
plugins/core/controls/control/basicflow/flow-start.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'id': '102001',
|
||||
'name': '开始',
|
||||
'code': 'start',
|
||||
'desc': '流程的开始节点',
|
||||
'from': '100103',
|
||||
|
||||
'define': {
|
||||
width: 40,
|
||||
height: 40,
|
||||
}
|
||||
}
|
||||
12
plugins/core/controls/control/basicflow/flow-start1.ts
Normal file
12
plugins/core/controls/control/basicflow/flow-start1.ts
Normal file
@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'id': '102002',
|
||||
'name': '开始',
|
||||
'code': 'start',
|
||||
'desc': '流程的开始节点',
|
||||
'from': '102001',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 50,
|
||||
}
|
||||
}
|
||||
45
plugins/core/controls/control/basicflow/flow-subflow.ts
Normal file
45
plugins/core/controls/control/basicflow/flow-subflow.ts
Normal file
@ -0,0 +1,45 @@
|
||||
export default {
|
||||
'id': '102040',
|
||||
'name': '子流程',
|
||||
'code': 'subflow',
|
||||
'desc': '流程的子流程节点',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈采样次数
|
||||
loop: 4,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//初始次采样的开始角度
|
||||
angle: 45,
|
||||
//半径距离
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
pvs.push({ begin:i==0,end:i==3,x: sample.x, y: sample.y,select:1,clip:1,stroke:1,fill:1 });
|
||||
}`,
|
||||
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r
|
||||
let x = sample.x
|
||||
let y = sample.y
|
||||
pvs.push({x:x,y:y,r:er,type:0,oppoint:2,op2close:i == 3 ? 1: 0});
|
||||
|
||||
}`,
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let ds = i == 1 || i ==2 ? 10: -10
|
||||
let x = sample.x+ds
|
||||
let y = sample.y
|
||||
pvs.push({ begin:i==0,end:i==3,x: x, y: y,text:1,stroke:1 });
|
||||
}`,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basicflow/flow-switch.ts
Normal file
13
plugins/core/controls/control/basicflow/flow-switch.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '102020',
|
||||
'name': '分支',
|
||||
'code': 'switch',
|
||||
'desc': '流程的分支节点',
|
||||
'from': '100040',
|
||||
|
||||
'define': {
|
||||
width: 110,
|
||||
height: 70,
|
||||
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basicflow/flow-switch1.ts
Normal file
13
plugins/core/controls/control/basicflow/flow-switch1.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '102021',
|
||||
'name': '分支',
|
||||
'code': 'switch',
|
||||
'desc': '流程的分支节点',
|
||||
'from': '102020',
|
||||
|
||||
'define': {
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basicflow/flow-task.ts
Normal file
13
plugins/core/controls/control/basicflow/flow-task.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '102010',
|
||||
'name': '任务',
|
||||
'code': 'task',
|
||||
'desc': '流程的任务节点',
|
||||
'from': '100002',
|
||||
|
||||
'define': {
|
||||
width: 110,
|
||||
height: 70,
|
||||
|
||||
}
|
||||
}
|
||||
13
plugins/core/controls/control/basicflow/flow-task1.ts
Normal file
13
plugins/core/controls/control/basicflow/flow-task1.ts
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
'id': '102011',
|
||||
'name': '任务',
|
||||
'code': 'task',
|
||||
'desc': '流程的任务节点',
|
||||
'from': '102010',
|
||||
|
||||
'define': {
|
||||
border: {
|
||||
round: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
15
plugins/core/controls/control/basicflow/flow-task2.ts
Normal file
15
plugins/core/controls/control/basicflow/flow-task2.ts
Normal file
@ -0,0 +1,15 @@
|
||||
export default {
|
||||
'id': '102012',
|
||||
'name': '开始或结束',
|
||||
'code': 'flowsoe',
|
||||
'desc': '流程的开始或结束节点',
|
||||
'from': '102010',
|
||||
|
||||
'define': {
|
||||
height: 60,
|
||||
width: 100,
|
||||
border: {
|
||||
round: 15
|
||||
}
|
||||
}
|
||||
}
|
||||
56
plugins/core/controls/control/common/bidfunnel.ts
Normal file
56
plugins/core/controls/control/common/bidfunnel.ts
Normal file
@ -0,0 +1,56 @@
|
||||
export default {
|
||||
'id': '103007',
|
||||
'name': '双向漏斗',
|
||||
'code': 'bidfunnel',
|
||||
'desc': '双向漏斗',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 100,
|
||||
height: 100,
|
||||
//2为极坐标,缺省点为原点
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈采样次数
|
||||
loop: 6,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i !=0 && i != 3){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
pvs.push({begin:i == 1,end:i == 5,x:x,y:y,select:1,clip:1});
|
||||
}
|
||||
}`,
|
||||
//主体图形
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let er = sample.r / Math.cos(45 * DDeiConfig.ROTATE_UNIT)
|
||||
let x = er * sample.cos
|
||||
let y = er * sample.sin
|
||||
switch(i){
|
||||
case 1:
|
||||
pvs.push({begin:1,x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1});
|
||||
break;
|
||||
case 2:
|
||||
pvs.push({x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1});
|
||||
pvs.push({x:0,y:0,oppoint:1,clip:1,stroke:1,fill:1});
|
||||
break;
|
||||
case 4:
|
||||
pvs.push({end:1,x:x,y:y,oppoint:2,op2close:1,clip:1,stroke:1,fill:1});
|
||||
break;
|
||||
case 5:
|
||||
pvs.splice(3,0,{x:x,y:y,oppoint:2,clip:1,stroke:1,fill:1})
|
||||
break;
|
||||
}
|
||||
}`
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
112
plugins/core/controls/control/common/bracket-big-left-text.ts
Normal file
112
plugins/core/controls/control/common/bracket-big-left-text.ts
Normal file
@ -0,0 +1,112 @@
|
||||
export default {
|
||||
'id': '104124',
|
||||
'name': '大括号',
|
||||
'code': 'bmt',
|
||||
'desc': '左大括号,带文本编辑',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1});
|
||||
}`
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
//组合控件
|
||||
composes: [
|
||||
{
|
||||
width: 30,
|
||||
height: 100,
|
||||
id: '104122',
|
||||
cIndex: 2,
|
||||
initCPV: {
|
||||
x: -65, y: 0, z: 1
|
||||
},
|
||||
attrLinks: [
|
||||
{ code: "border", mapping: ["*"] },
|
||||
]
|
||||
},
|
||||
{
|
||||
width: 150,
|
||||
height: 95,
|
||||
id: '100002',
|
||||
cIndex: 1,
|
||||
initCPV: {
|
||||
x: 5, y: 0, z: 1
|
||||
},
|
||||
border: {
|
||||
type: 0
|
||||
},
|
||||
fill: {
|
||||
type: 0
|
||||
},
|
||||
textStyle: {
|
||||
feed: 1,
|
||||
scale: 1,
|
||||
align: 1
|
||||
},
|
||||
attrLinks: [
|
||||
{ code: "textStyle", mapping: ["*"] },
|
||||
{ code: "font", mapping: ["*"] }
|
||||
]
|
||||
},
|
||||
],
|
||||
ext: {
|
||||
/**
|
||||
* 定义分组,用于属性编辑
|
||||
*/
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
|
||||
{
|
||||
name: "文本",
|
||||
attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed"
|
||||
, "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic"
|
||||
, "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"]
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
18
plugins/core/controls/control/common/bracket-big-left.ts
Normal file
18
plugins/core/controls/control/common/bracket-big-left.ts
Normal file
@ -0,0 +1,18 @@
|
||||
export default {
|
||||
'id': '104122',
|
||||
'name': '大括号',
|
||||
'code': 'bb',
|
||||
'desc': '由极坐标系构造的右大括号,不带任何文本',
|
||||
'from': '104121',
|
||||
|
||||
'define': {
|
||||
width: 50,
|
||||
height: 100,
|
||||
ext: {
|
||||
//采样信息
|
||||
sample: {
|
||||
direct: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
112
plugins/core/controls/control/common/bracket-big-right-text.ts
Normal file
112
plugins/core/controls/control/common/bracket-big-right-text.ts
Normal file
@ -0,0 +1,112 @@
|
||||
export default {
|
||||
'id': '104123',
|
||||
'name': '大括号',
|
||||
'code': 'bbt',
|
||||
'desc': '右大括号,带文本编辑',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,oppoint:2,op2close:i == 3 ? 1 : 0,select:1,clip:1});
|
||||
}`
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
//组合控件
|
||||
composes: [
|
||||
{
|
||||
width: 30,
|
||||
height: 100,
|
||||
id: '104121',
|
||||
cIndex: 2,
|
||||
initCPV: {
|
||||
x: 65, y: 0, z: 1
|
||||
},
|
||||
attrLinks: [
|
||||
{ code: "border", mapping: ["*"] },
|
||||
]
|
||||
},
|
||||
{
|
||||
width: 150,
|
||||
height: 95,
|
||||
id: '100002',
|
||||
cIndex: 1,
|
||||
initCPV: {
|
||||
x: -5, y: 0, z: 1
|
||||
},
|
||||
border: {
|
||||
type: 0
|
||||
},
|
||||
fill: {
|
||||
type: 0
|
||||
},
|
||||
textStyle: {
|
||||
feed: 1,
|
||||
scale: 1,
|
||||
align: 3
|
||||
},
|
||||
attrLinks: [
|
||||
{ code: "textStyle", mapping: ["*"] },
|
||||
{ code: "font", mapping: ["*"] }
|
||||
]
|
||||
},
|
||||
],
|
||||
ext: {
|
||||
/**
|
||||
* 定义分组,用于属性编辑
|
||||
*/
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
|
||||
{
|
||||
name: "文本",
|
||||
attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed"
|
||||
, "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic"
|
||||
, "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"]
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
197
plugins/core/controls/control/common/bracket-big-right.ts
Normal file
197
plugins/core/controls/control/common/bracket-big-right.ts
Normal file
@ -0,0 +1,197 @@
|
||||
export default {
|
||||
'id': '104121',
|
||||
'name': '大括号',
|
||||
'code': 'bb',
|
||||
'desc': '由极坐标系构造的右大括号,不带任何文本',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 50,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 45,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//方向,上右下左1,2,3,4
|
||||
direct: 2,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
if(i == 0){
|
||||
let deltaRotate = 0
|
||||
switch(sample.direct){
|
||||
case 1:
|
||||
deltaRotate = -90
|
||||
break;
|
||||
case 3:
|
||||
deltaRotate = -270
|
||||
break;
|
||||
case 4:
|
||||
deltaRotate = -180
|
||||
break;
|
||||
}
|
||||
let rad1 = (72+deltaRotate) * DDeiConfig.ROTATE_UNIT
|
||||
let rad2 = (-72+deltaRotate) * DDeiConfig.ROTATE_UNIT
|
||||
let rad0 = (deltaRotate) * DDeiConfig.ROTATE_UNIT
|
||||
let x0 = sample.r * Math.cos(rad0)
|
||||
let y0 = sample.r * Math.sin(rad0)
|
||||
let x1 = sample.r * Math.cos(rad1)
|
||||
let y1 = sample.r * Math.sin(rad1)
|
||||
let x2 = sample.r * Math.cos(rad2)
|
||||
let y2 = sample.r * Math.sin(rad2)
|
||||
switch(sample.direct){
|
||||
case 1:
|
||||
pvs.push({begin:1,x:x2,y:y1+10,type:3});
|
||||
pvs.push({x:x2,y:y1+10,type:5,stroke:1});
|
||||
pvs.push({x:x2-2,y:y0+10});
|
||||
pvs.push({x:(x2+10)/2,y:y0+25});
|
||||
pvs.push({x:-10,y:y0+20});
|
||||
|
||||
pvs.push({x:-10,y:y0+20,type:5,stroke:1});
|
||||
pvs.push({x:-3,y:y0+18});
|
||||
pvs.push({x:0,y:y0+10});
|
||||
pvs.push({x:0,y:y0});
|
||||
|
||||
pvs.push({x:0,y:y0,stroke:1,type:5});
|
||||
pvs.push({x:0,y:y0+10});
|
||||
pvs.push({x:3,y:y0+18});
|
||||
pvs.push({x:10,y:y0+20});
|
||||
|
||||
pvs.push({x:10,y:y0+20,stroke:1,type:5});
|
||||
pvs.push({x:(x1-10)/2,y:y0+25});
|
||||
pvs.push({x:x1+2,y:y0+10});
|
||||
pvs.push({x:x1,y:y2+10});
|
||||
|
||||
|
||||
pvs.push({x:x1,y:y1+10,type:0,oppoint:1,select:1});
|
||||
pvs.push({x:x2,y:y2+10,type:0,oppoint:1,select:1});
|
||||
pvs.push({x:0,y:y0,type:0,oppoint:1});
|
||||
pvs.push({x:0,y:y2+10,type:0,oppoint:1});
|
||||
pvs.push({x:x2,y:y0,type:0,select:1});
|
||||
pvs.push({x:x1,y:y0,type:0,select:1});
|
||||
break;
|
||||
case 2:
|
||||
//由4段贝塞尔曲线构造
|
||||
pvs.push({begin:1,x:x2-10,y:y2,type:3});
|
||||
pvs.push({x:x2-10,y:y2,type:5,stroke:1});
|
||||
pvs.push({x:x0-10,y:y2-2});
|
||||
pvs.push({x:x0-25,y:(y2-10)/2});
|
||||
pvs.push({x:x0-20,y:-10});
|
||||
|
||||
pvs.push({x:x0-20,y:-10,stroke:1,type:5});
|
||||
pvs.push({x:x0-18,y:-3});
|
||||
pvs.push({x:x0-10,y:0});
|
||||
pvs.push({x:x0,y:0});
|
||||
|
||||
pvs.push({x:x0,y:0,stroke:1,type:5});
|
||||
pvs.push({x:x0-10,y:0});
|
||||
pvs.push({x:x0-18,y:3});
|
||||
pvs.push({x:x0-20,y:10});
|
||||
|
||||
pvs.push({x:x0-20,y:10,stroke:1,type:5});
|
||||
pvs.push({x:x0-25,y:(y1-10)/2});
|
||||
pvs.push({x:x0-10,y:y1+2});
|
||||
pvs.push({x:x2-10,y:y1});
|
||||
|
||||
pvs.push({x:x1-10,y:y1,type:0,oppoint:1,select:1});
|
||||
pvs.push({x:x2-10,y:y2,type:0,oppoint:1,select:1});
|
||||
pvs.push({x:x0,y:0,type:0,oppoint:1});
|
||||
pvs.push({x:x2-10,y:0,type:0,oppoint:1});
|
||||
pvs.push({x:x0,y:y2,type:0,select:1});
|
||||
pvs.push({x:x0,y:y1,type:0,select:1});
|
||||
break;
|
||||
case 3:
|
||||
//由4段贝塞尔曲线构造
|
||||
pvs.push({begin:1,x:x1,y:y1-10,type:3});
|
||||
pvs.push({x:x1,y:y1-10,type:5,stroke:1});
|
||||
pvs.push({x:x1-2,y:y0-10});
|
||||
pvs.push({x:(x1+10)/2,y:y0-25});
|
||||
pvs.push({x:-10,y:y0-20});
|
||||
|
||||
pvs.push({x:-10,y:y0-20,type:5,stroke:1});
|
||||
pvs.push({x:-3,y:y0-18});
|
||||
pvs.push({x:0,y:y0-10});
|
||||
pvs.push({x:0,y:y0});
|
||||
|
||||
pvs.push({x:0,y:y0,stroke:1,type:5});
|
||||
pvs.push({x:0,y:y0-10});
|
||||
pvs.push({x:3,y:y0-18});
|
||||
pvs.push({x:10,y:y0-20});
|
||||
|
||||
pvs.push({x:10,y:y0-20,stroke:1,type:5});
|
||||
pvs.push({x:(x2-10)/2,y:y0-25});
|
||||
pvs.push({x:x2+2,y:y0-10});
|
||||
pvs.push({x:x2,y:y2-10});
|
||||
|
||||
|
||||
pvs.push({x:x1,y:y1-10,type:0,oppoint:1,select:1});
|
||||
pvs.push({x:x2,y:y2-10,type:0,oppoint:1,select:1});
|
||||
pvs.push({x:0,y:y0,type:0,oppoint:1});
|
||||
pvs.push({x:0,y:y2-10,type:0,oppoint:1});
|
||||
pvs.push({x:x2,y:y0,type:0,select:1});
|
||||
pvs.push({x:x1,y:y0,type:0,select:1});
|
||||
|
||||
break;
|
||||
case 4:
|
||||
//由4段贝塞尔曲线构造
|
||||
pvs.push({begin:1,x:x2+10,y:y1,type:3});
|
||||
pvs.push({x:x2+10,y:y1,type:5,stroke:1});
|
||||
pvs.push({x:x0+10,y:y1-2});
|
||||
pvs.push({x:x0+25,y:(y1-10)/2});
|
||||
pvs.push({x:x0+20,y:-10});
|
||||
|
||||
pvs.push({x:x0+20,y:-10,stroke:1,type:5});
|
||||
pvs.push({x:x0+18,y:-3});
|
||||
pvs.push({x:x0+10,y:0});
|
||||
pvs.push({x:x0,y:0});
|
||||
|
||||
pvs.push({x:x0,y:0,stroke:1,type:5});
|
||||
pvs.push({x:x0+10,y:0});
|
||||
pvs.push({x:x0+18,y:3});
|
||||
pvs.push({x:x0+20,y:10});
|
||||
|
||||
pvs.push({x:x0+20,y:10,stroke:1,type:5});
|
||||
pvs.push({x:x0+25,y:(y2-10)/2});
|
||||
pvs.push({x:x0+10,y:y2+2});
|
||||
pvs.push({x:x2+10,y:y2});
|
||||
|
||||
pvs.push({x:x1+10,y:y2,type:0,oppoint:1,select:1});
|
||||
pvs.push({x:x2+10,y:y1,type:0,oppoint:1,select:1});
|
||||
pvs.push({x:x0,y:0,type:0,oppoint:1});
|
||||
pvs.push({x:x2+10,y:0,type:0,oppoint:1});
|
||||
pvs.push({x:x0,y:y1,type:0,select:1});
|
||||
pvs.push({x:x0,y:y2,type:0,select:1});
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}`,
|
||||
]
|
||||
},
|
||||
ext: {
|
||||
/**
|
||||
* 定义分组,用于属性编辑
|
||||
*/
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
123
plugins/core/controls/control/common/bracket-big-text.ts
Normal file
123
plugins/core/controls/control/common/bracket-big-text.ts
Normal file
@ -0,0 +1,123 @@
|
||||
export default {
|
||||
'id': '104125',
|
||||
'name': '大括号',
|
||||
'code': 'bmt',
|
||||
'desc': '左右大括号,带文本编辑',
|
||||
'from': '100500',
|
||||
|
||||
'define': {
|
||||
width: 160,
|
||||
height: 100,
|
||||
//2为极坐标,以cpv为圆心,半径r采样获得点,在以width/100、height/100的的原始比例进行缩放
|
||||
poly: 2,
|
||||
//采样信息
|
||||
sample: {
|
||||
//一圈4次采样
|
||||
loop: 4,
|
||||
//初始次采样的开始角度
|
||||
angle: 0,
|
||||
//半径距离
|
||||
r: 50,
|
||||
//采样的规则,多组采样返回多组规则
|
||||
rules: [
|
||||
//选中区域
|
||||
`(i, sample, pvs, model, ovs){
|
||||
let start = 0,end = 0
|
||||
switch(i){
|
||||
case 0:
|
||||
start = 1
|
||||
break;
|
||||
case 1:
|
||||
pvs[0].y=sample.y
|
||||
break;
|
||||
case 2:
|
||||
pvs[1].x=sample.x
|
||||
break;
|
||||
case 3:
|
||||
pvs[2].y=sample.y
|
||||
sample.x = pvs[0].x
|
||||
end = 1
|
||||
break;
|
||||
}
|
||||
pvs.push({begin:start,end:end,x:sample.x,y:sample.y,select:1,oppoint:2,op2close:i == 3 ? 1 : 0,clip:1});
|
||||
}`
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
//组合控件
|
||||
composes: [
|
||||
{
|
||||
width: 30,
|
||||
height: 100,
|
||||
id: '104122',
|
||||
cIndex: 2,
|
||||
initCPV: {
|
||||
x: -65, y: 0, z: 1
|
||||
},
|
||||
attrLinks: [
|
||||
{ code: "border", mapping: ["*"] },
|
||||
]
|
||||
},
|
||||
{
|
||||
width: 30,
|
||||
height: 100,
|
||||
id: '104121',
|
||||
cIndex: 2,
|
||||
initCPV: {
|
||||
x: 65, y: 0, z: 1
|
||||
},
|
||||
attrLinks: [
|
||||
{ code: "border", mapping: ["*"] },
|
||||
]
|
||||
},
|
||||
{
|
||||
width: 140,
|
||||
height: 95,
|
||||
id: '100002',
|
||||
cIndex: 1,
|
||||
initCPV: {
|
||||
x: 0, y: 0, z: 1
|
||||
},
|
||||
border: {
|
||||
type: 0
|
||||
},
|
||||
fill: {
|
||||
type: 0
|
||||
},
|
||||
textStyle: {
|
||||
feed: 1,
|
||||
scale: 1,
|
||||
},
|
||||
attrLinks: [
|
||||
{ code: "textStyle", mapping: ["*"] },
|
||||
{ code: "font", mapping: ["*"] }
|
||||
]
|
||||
},
|
||||
],
|
||||
ext: {
|
||||
/**
|
||||
* 定义分组,用于属性编辑
|
||||
*/
|
||||
groups: [
|
||||
{
|
||||
name: "样式",
|
||||
icon: 'icon-a-ziyuan375',
|
||||
subGroups: [
|
||||
{
|
||||
name: "线条",
|
||||
attrs: ["border.type", "border.color", "borderOpacity", "borderWidth", "borderDash", "borderRound"]
|
||||
},
|
||||
|
||||
{
|
||||
name: "文本",
|
||||
attrs: ["font.family", "font.size", "font.color", "fontAlign", "textStyle.feed"
|
||||
, "textStyle.scale", "textStyle.hollow", "textStyle.bold", "textStyle.italic"
|
||||
, "textStyle.underline", "textStyle.deleteline", "textStyle.topline", "textStyle.hspace", "textStyle.vspace"]
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user