From e6f7d8a207689a125b8bbdb14e4ea73690f6aac5 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 6 Apr 2021 10:19:23 +0800 Subject: [PATCH] =?UTF-8?q?iscs=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs_new/core/form/allElments.js | 19 - src/iscs_new/core/form/builderFactory.js | 37 ++ src/iscs_new/core/form/elementConst.js | 19 + .../core/form/elementForm/lineForm.js | 3 - src/iscs_new/core/form/form2Base.js | 70 ++-- src/views/iscs_new/components/dataForm.vue | 81 ++++ src/views/iscs_new/iscsDraw/index.vue | 61 +-- .../newMap/displayNew/demon/runPlanView2.vue | 373 ++++++++++++++++++ 8 files changed, 579 insertions(+), 84 deletions(-) delete mode 100644 src/iscs_new/core/form/allElments.js create mode 100644 src/iscs_new/core/form/builderFactory.js create mode 100644 src/iscs_new/core/form/elementConst.js delete mode 100644 src/iscs_new/core/form/elementForm/lineForm.js create mode 100644 src/views/iscs_new/components/dataForm.vue create mode 100644 src/views/newMap/displayNew/demon/runPlanView2.vue diff --git a/src/iscs_new/core/form/allElments.js b/src/iscs_new/core/form/allElments.js deleted file mode 100644 index 6e51e78eb..000000000 --- a/src/iscs_new/core/form/allElments.js +++ /dev/null @@ -1,19 +0,0 @@ - -// export const allElements = { -// elementsList:[ -// {code:'line', name:'线段'}, -// {code:'text', name:'文字'}, -// {code:'rect', name:'矩形'}, -// {code:'circle', name:'圆形'}, -// {code:'polygon', name:'多边形'}, -// {code:'triangle', name:'三角形'}, -// {code:'arrow', name:'箭头'}, -// {code:'polyline', name:'多边形折线段'}, -// {code:'isogon', name:'正多边形'}, -// {code:'ellipse', name:'椭圆'}, -// {code:'arc', name:'圆弧'}, -// {code:'sector', name:'扇形'}, -// {code:'heart', name:'心形'}, -// {code:'droplet', name:'水滴'} -// ] -// }; diff --git a/src/iscs_new/core/form/builderFactory.js b/src/iscs_new/core/form/builderFactory.js new file mode 100644 index 000000000..22d525f52 --- /dev/null +++ b/src/iscs_new/core/form/builderFactory.js @@ -0,0 +1,37 @@ +import {elementConst} from './elementConst'; +import form2Base from './form2Base'; +class BuilderFactory { + constructor() { + this.formList = []; + } + getFormList() { + const elementList = elementConst.elementsList; + elementList.forEach(element=>{ + const temp = Object.assign({}, element); + + temp.formGroup = []; + temp.model = {}; + temp.rules = {}; + + // 添加通用配置 + temp.formGroup.push({name:'通用配置', code:'base', styleList:form2Base}); + form2Base.forEach(each=>{ + temp.model[each.prop] = each.defValue; + temp.rules[each.prop] = each.rules; + }); + + // 添加绘图配置 shape + // temp.formGroup.push({name:'绘图配置', code:'shape', styleList:form2Base}); + // temp.rules + // let ClassName=element.code; + // const = elementTypeList[element]; + // temp.formStyle=new ClassName(); + // 添加样式配置 style + + this.formList.push(temp); + }); + return this.formList; + } +} + +export default BuilderFactory; diff --git a/src/iscs_new/core/form/elementConst.js b/src/iscs_new/core/form/elementConst.js new file mode 100644 index 000000000..6880d7112 --- /dev/null +++ b/src/iscs_new/core/form/elementConst.js @@ -0,0 +1,19 @@ + +export const elementConst = { + elementsList:[ + {code:'line', name:'线段', formList:{style:[], shape:[] }}, + {code:'text', name:'文字', formList:{style:[], shape:[] }}, + {code:'rect', name:'矩形', formList:{style:[], shape:[] }}, + {code:'circle', name:'圆形', formList:{style:[], shape:[] }}, + {code:'polygon', name:'多边形', formList:{style:[], shape:[] }}, + {code:'triangle', name:'三角形', formList:{style:[], shape:[] }}, + {code:'arrow', name:'箭头', formList:{style:[], shape:[] }}, + {code:'polyline', name:'多边形折线段', formList:{style:[], shape:[] }}, + {code:'isogon', name:'正多边形', formList:{style:[], shape:[] }}, + {code:'ellipse', name:'椭圆', formList:{style:[], shape:[] }}, + {code:'arc', name:'圆弧', formList:{style:[], shape:[] }}, + {code:'sector', name:'扇形', formList:{style:[], shape:[] }}, + {code:'heart', name:'心形', formList:{style:[], shape:[] }}, + {code:'droplet', name:'水滴', formList:{style:[], shape:[] }} + ] +}; diff --git a/src/iscs_new/core/form/elementForm/lineForm.js b/src/iscs_new/core/form/elementForm/lineForm.js deleted file mode 100644 index f545a1fb2..000000000 --- a/src/iscs_new/core/form/elementForm/lineForm.js +++ /dev/null @@ -1,3 +0,0 @@ -class lineForm { - -} diff --git a/src/iscs_new/core/form/form2Base.js b/src/iscs_new/core/form/form2Base.js index 002e52015..8ebbac736 100644 --- a/src/iscs_new/core/form/form2Base.js +++ b/src/iscs_new/core/form/form2Base.js @@ -1,37 +1,33 @@ -export default { - // number 0 控制图形的前后顺序。z2 值小的图形会被 z2 值大的图形覆盖。z2 相比 z1 优先级更低,而且不会创建新的 Canvas。 - z2: { - prop: 'z', label: '层级 z2', type: 'select', defValue: 10, - }, - name: { - - }, - // boolean false 是否进行裁剪。 - culling: { - - }, - // string 'pointer' 鼠标移到元素上时的鼠标样式。 - cursor: { - - }, - // boolean false 图形是否可拖曳。 - draggable: { - - }, - // boolean false 图形是否不可见,为 true 时不绘制图形,但是仍能触发鼠标事件。 - invisible: { - - }, - // number -1 是否渐进式渲染。当图形元素过多时才使用,用大于 0 的数字表示渲染顺序。 - progressive: { - - }, - // boolean false 是否使用包围盒检验鼠标是否移动到物体。false 则检测元素实际的内容。 - rectHover: { - - }, - // boolean false 是否响应鼠标事件。 - silent: { - - } -} +export default [ + // number 0 控制图形的前后顺序。z 值小的图形会被 z 值大的图形覆盖。z 相比 zlevel 优先级更低,而且不会创建新的 Canvas。 + { prop: 'z', label: '层级 z', + type: 'number', precisionFlag:0, min:0, max:100, step:1, + rules:[{ required: true, message:'请输入层级z', trigger: 'blur' }], + defValue: 1, required:true + }, + // number 0 控制图形的前后顺序。z2 值小的图形会被 z2 值大的图形覆盖。z2 相比 z1 优先级更低,而且不会创建新的 Canvas。 + { prop: 'z2', label: '层级 z2', + type: 'number', precisionFlag:0, min:0, max:100, step:1, + rules:[{ required: true, message:'请输入层级z2', trigger: 'blur' }], + defValue: 10, required:true + } + // boolean false 图形是否不可见,为 true 时不绘制图形,但是仍能触发鼠标事件。 + // {prop: 'invisible', label: '不可见', type: 'switch', defValue: false,required:true}, + // // boolean false 是否响应鼠标事件。 + // {prop: 'silent', label: '响应鼠标事件', type: 'switch', defValue: false,required:true} + // // boolean false 是否进行裁剪。 + // culling: { + // }, + // // string 'pointer' 鼠标移到元素上时的鼠标样式。 + // cursor: { + // }, + // // boolean false 图形是否可拖曳。 + // draggable: { + // }, + // // number -1 是否渐进式渲染。当图形元素过多时才使用,用大于 0 的数字表示渲染顺序。 + // progressive: { + // }, + // // boolean false 是否使用包围盒检验鼠标是否移动到物体。false 则检测元素实际的内容。 + // rectHover: { + // }, +]; diff --git a/src/views/iscs_new/components/dataForm.vue b/src/views/iscs_new/components/dataForm.vue new file mode 100644 index 000000000..5f0323576 --- /dev/null +++ b/src/views/iscs_new/components/dataForm.vue @@ -0,0 +1,81 @@ + + + + + {{ styleGroup.name }} + + + + + + + + + + + + + + + + + + + diff --git a/src/views/iscs_new/iscsDraw/index.vue b/src/views/iscs_new/iscsDraw/index.vue index ca49cd044..554778bfb 100644 --- a/src/views/iscs_new/iscsDraw/index.vue +++ b/src/views/iscs_new/iscsDraw/index.vue @@ -14,27 +14,35 @@ @click="handleSave" >保存 - + + + + + - + +