Browse Source

Merge branch 'v3'

liwenxuan_v2
超级管理员 2 years ago
parent
commit
3da221aa77
  1. 1
      index.html
  2. 30
      src/components/DesignForm/assembly/index.ts
  3. 109
      src/components/DesignForm/dragControl.vue
  4. 14
      src/components/DesignForm/public/headTools.vue

1
index.html

@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="数通智联化工云平台" />
<meta name="keywords" content="数通智联化工云平台" />
<link rel="stylesheet" href="./static/iconfont/iconfont.css">
<title>数通智联化工云平台</title>
</head>

30
src/components/DesignForm/assembly/index.ts

@ -23,6 +23,7 @@ const selectOption: any = [
type: 'input',
label: '单行文本',
icon: 'input',
iconFont: 'fa-text-width',
control: {
// 组件所有属性
modelValue: ''
@ -33,6 +34,7 @@ const selectOption: any = [
type: 'textarea',
label: '多行文本',
icon: 'textarea',
iconFont: 'fa-text-height',
control: {
modelValue: ''
},
@ -42,6 +44,7 @@ const selectOption: any = [
type: 'radio',
label: '单选框组',
icon: 'radio',
iconFont: 'fa-dot-circle-o',
control: {
modelValue: ''
},
@ -52,6 +55,7 @@ const selectOption: any = [
type: 'checkbox',
label: '多选框组',
icon: 'checkbox',
iconFont: 'fa-check-square-o',
control: {
modelValue: []
},
@ -62,6 +66,7 @@ const selectOption: any = [
type: 'select',
label: '下拉选择框',
icon: 'select',
iconFont: 'fa-toggle-down',
control: {
modelValue: '',
appendToBody: true
@ -72,7 +77,8 @@ const selectOption: any = [
{
type: 'datePicker',
label: '日期选择器',
icon: 'date',
icon: 'todo',
iconFont: 'fa-calendar',
control: {
modelValue: '',
type: 'date'
@ -83,6 +89,7 @@ const selectOption: any = [
type: 'timePicker',
label: '时间选择器',
icon: 'time',
iconFont: 'fa-clock-o',
control: {
modelValue: ''
},
@ -92,6 +99,7 @@ const selectOption: any = [
type: 'colorPicker',
label: '取色器',
icon: 'color',
iconFont: '',
control: {
modelValue: ''
},
@ -101,6 +109,7 @@ const selectOption: any = [
type: 'switch',
label: '开关',
icon: 'switch',
iconFont: 'fa-toggle-on',
control: {
modelValue: false
},
@ -110,6 +119,7 @@ const selectOption: any = [
type: 'inputNumber',
label: '计数器',
icon: 'number',
iconFont: 'fa-sort-numeric-asc',
control: {
modelValue: 0
},
@ -119,6 +129,7 @@ const selectOption: any = [
type: 'cascader',
label: '级联选择器',
icon: 'cascader',
iconFont: 'fa-sitemap',
control: {
modelValue: []
},
@ -129,6 +140,7 @@ const selectOption: any = [
type: 'rate',
label: '评分',
icon: 'rate',
iconFont: 'fa-star-o',
control: {
modelValue: 0
},
@ -138,6 +150,7 @@ const selectOption: any = [
type: 'slider',
label: '滑块',
icon: 'slider',
iconFont: 'fa-sliders',
control: {
modelValue: 0
},
@ -147,6 +160,7 @@ const selectOption: any = [
type: 'treeSelect',
label: '树形控件',
icon: 'tree2',
iconFont: '',
control: {
modelValue: '',
data: [],
@ -160,6 +174,7 @@ const selectOption: any = [
type: 'txt',
label: '文字',
icon: 'text',
iconFont: 'fa-file-word-o',
control: {
modelValue: ''
},
@ -169,6 +184,7 @@ const selectOption: any = [
type: 'title',
label: '标题',
icon: 'title',
iconFont: 'fa-header',
control: {
modelValue: '标题'
},
@ -178,6 +194,7 @@ const selectOption: any = [
type: 'button',
label: '按钮',
icon: 'button',
iconFont: 'fa-square-o',
control: {
label: '保存'
},
@ -192,6 +209,7 @@ const selectOption: any = [
type: 'table',
label: '子表',
icon: 'table',
iconFont: 'fa-table',
list: [],
tableData: [], // 子表表格列表数据集合
control: {
@ -205,6 +223,7 @@ const selectOption: any = [
type: 'component',
label: '自定义组件',
icon: 'component',
iconFont: 'fa-cubes',
control: {
modelValue: ''
},
@ -216,6 +235,7 @@ const selectOption: any = [
type: 'upload',
label: '图片/文件',
icon: 'image',
iconFont: 'fa-photo',
control: {
modelValue: '' // 也可以是[{name:'',url:''}]形式
},
@ -225,6 +245,7 @@ const selectOption: any = [
type: 'tinymce',
label: '富文本',
icon: 'tinymce',
iconFont: '',
control: {
modelValue: ''
},
@ -239,6 +260,7 @@ const selectOption: any = [
type: 'grid',
label: '格栅布局',
icon: 'grid',
iconFont: 'fa-th-large',
columns: [
// 格栅列数据
{
@ -257,6 +279,7 @@ const selectOption: any = [
type: 'tabs',
label: '标签页',
icon: 'tabs',
iconFont: 'fa-folder-o',
columns: [
{
label: 'Tab1',
@ -270,6 +293,7 @@ const selectOption: any = [
type: 'card',
label: '卡片布局',
icon: 'card',
iconFont: 'fa-credit-card',
list: [],
control: {},
config: {},
@ -279,6 +303,7 @@ const selectOption: any = [
type: 'flex',
label: '弹性布局',
icon: 'flex',
iconFont: 'fa-file-text-o',
list: [],
tableData: [], // 值集合
control: {},
@ -290,6 +315,7 @@ const selectOption: any = [
type: 'divider',
label: '分割线',
icon: 'divider',
iconFont: '',
control: {},
config: {}
},
@ -297,6 +323,7 @@ const selectOption: any = [
type: 'div',
label: '容器',
icon: 'div',
iconFont: '',
control: {},
config: {},
list: []
@ -310,6 +337,7 @@ const selectOption: any = [
type: 'expand-user',
label: '选择用户',
icon: 'user',
iconFont: 'fa-user-o',
control: {
// 组件所有属性
modelValue: ''

109
src/components/DesignForm/dragControl.vue

@ -16,6 +16,8 @@ import UseTemplate from './template.vue'
import { customerFormVersionCont } from '@/api/DesignForm/type'
import '@/assets/iconfont/iconfont.css'
const props = withDefaults(
defineProps<{
// eslint-disable-next-line vue/require-default-prop
@ -122,13 +124,13 @@ const forEachGetData = (data: FormList[]) => {
const activeName = ref<any>(6)
//
const handleTabsClick = (val:any) =>{
console.log("切换版本",val)
// console.log("",val)
emits("update:versionid",val)
}
watch(()=>props.versioncont,(val: any)=>{
console.log("versioncont---版本-->",val)
// console.log("versioncont----->",val)
if(val.length>0){
val.forEach((item:any,index:number) => {
if(item.status == 1){
@ -137,7 +139,7 @@ watch(()=>props.versioncont,(val: any)=>{
});
}
console.log("选定版本------->",activeName.value)
// console.log("------->",activeName.value)
})
//
const setupStatus = (val:any) =>{
@ -163,25 +165,27 @@ const setupStatus = (val:any) =>{
<div class="title">
{{ list.title }}
<div
class="template"
v-if="index === 0 && !isSearch"
class="template"
@click="useTemplateClick"
>
使用模板
</div>
</div>
<draggable
itemKey="key123"
tag="ul"
v-model="list.children"
tag="ul"
:group="{ name: 'form', pull: 'clone', put: false }"
ghost-class="ghost"
:sort="false"
:clone="clone"
item-key="key123"
>
<template #item="{ element }">
<li :class="[element.type]">
<i :class="`icon-${element.icon}`"></i>
<li class="fontIcon" :class="[element.type]">
<i v-if="element.iconFont==''" :class="`icon-${element.icon}`"></i>
<i v-if="element.iconFont!=''" :class="`fa ${element.iconFont} `"></i>
<span :title="element.label">{{ element.label }}</span>
</li>
</template>
@ -201,11 +205,98 @@ const setupStatus = (val:any) =>{
</el-tab-pane>
</el-tabs>
<div style="display:none">
<i class="icon-mouse"></i>
<i class="icon-hand"></i>
<i class="icon-lock-open"></i>
<i class="icon-lock"></i>
<i class="icon-eye-close"></i>
<i class="icon-border"></i><br>
<i class="icon-text2"></i>
<i class="icon-stext"></i>
<i class="icon-apply"></i>
<i class="icon-work"></i>
<i class="icon-todo"></i>
<i class="icon-applyed"></i>
<i class="icon-done"></i><br>
<i class="icon-button"></i>
<i class="icon-design"></i>
<i class="icon-data-source"></i>
<i class="icon-sp"></i>
<i class="icon-cs"></i>
<i class="icon-branch"></i>
<i class="icon-doc"></i><br>
<i class="icon-sys"></i>
<i class="icon-creat"></i>
<i class="icon-data"></i>
<i class="icon-menu"></i>
<i class="icon-user"></i>
<i class="icon-form"></i>
<i class="icon-list"></i>
<i class="icon-log"></i><br>
<i class="icon-dict"></i>
<i class="icon-post"></i>
<i class="icon-role"></i>
<i class="icon-log2"></i>
<i class="icon-tool"></i>
<i class="icon-bar"></i>
<i class="icon-pie"></i>
<i class="icon-line"></i>
<i class="icon-tree2"></i><br>
<i class="icon-flex"></i>
<i class="icon-div"></i>
<i class="icon-tree"></i>
<i class="icon-time"></i>
<i class="icon-tinymce"></i>
<i class="icon-rate"></i>
<i class="icon-slider"></i>
<i class="icon-divider"></i>
<i class="icon-color"></i>
<i class="icon-import"></i><br>
<i class="icon-image"></i>
<i class="icon-card"></i>
<i class="icon-help"></i>
<i class="icon-table"></i>
<i class="icon-component"></i>
<i class="icon-link"></i>
<i class="icon-cascader"></i>
<i class="icon-number"></i>
<i class="icon-title"></i>
<i class="icon-tabs"></i>
<i class="icon-close"></i><br>
<i class="icon-plus"></i>
<i class="icon-arrow"></i>
<i class="icon-check"></i>
<i class="icon-vue"></i>
<i class="icon-switch"></i>
<i class="icon-save"></i>
<i class="icon-move"></i>
<i class="icon-clone"></i>
<i class="icon-del"></i>
<i class="icon-eye"></i>
<i class="icon-json"></i><br>
<i class="icon-grid"></i>
<i class="icon-text"></i>
<i class="icon-date"></i>
<i class="icon-input"></i>
<i class="icon-checkbox"></i>
<i class="icon-textarea"></i>
<i class="icon-radio"></i>
<i class="icon-select"></i>
</div>
</div>
</template>
<style lang='scss' scoped>
.tab_pane_body{
text-align: center;
}
.fontIcon{
i{
padding: 4px 0px 0 0px;
}
}
</style>

14
src/components/DesignForm/public/headTools.vue

@ -29,13 +29,13 @@ const btnClick = (type: string) => {
}
const btnList = computed(() => {
const list = [
{ icon: 'del', label: '清空', key: 1 },
{ icon: 'eye', label: '预览', key: 2 },
{ icon: 'json', label: '生成脚本预览', key: 3 },
{ icon: 'del',iconFont:"", label: '清空', key: 1 },
{ icon: 'eye',iconFont:"", label: '预览', key: 2 },
{ icon: 'json',iconFont:"", label: '生成脚本预览', key: 3 },
// { icon: 'vue', label: 'vue', key: 4 },
{ icon: 'save', label: '保存', key: 5 },
{ icon: 'branch', label: '另存为新版', key: 4 },
{ icon: 'close', label: '关闭', key: 6 }
{ icon: 'save',iconFont:"fa-save", label: '保存', key: 5 },
{ icon: 'branch',iconFont:"fa-code-fork", label: '另存为新版', key: 4 },
{ icon: 'close',iconFont:"fa-close", label: '关闭', key: 6 }
]
if (props.showKey?.length) {
// key
@ -67,7 +67,7 @@ watch(()=>props.customerformid,(val: any)=>{
:key="item.icon"
:type="item.key==6?'danger':item.key==5?'success':item.key==4?'warning':'primary'"
>
<i :class="['icon-' + item.icon]" ></i>{{ item.label }}
<i v-if="item.iconFont==''" :class="['icon-' + item.icon]" ></i><i v-if="item.iconFont!=''" :class="['fa ' + item.iconFont]" ></i>{{ item.label }}
</el-button>
</span>

Loading…
Cancel
Save