micro-app/packages/icpx-form/public/form/data/data.js
2023-05-30 19:27:03 +08:00

1021 lines
21 KiB
JavaScript

/* eslint-disable no-unused-vars */
/* global $ dataset_1 dataset_2 */
'use strict';
var cells = [
//1
{
rowspan: 1,
colspan: 1,
x: 1,
y: 1,
//"border-color": { value: "#4ACD9B", timestamp: 1649957576286 },
'border-style': { value: 'border-solid', timestamp: 1565854327418 },
//"border-style": { value: ["border-solid-heavy", "border-none", "border-solid-heavy", "border-solid-heavy"], timestamp: 1565854327418 },
'border-color': { value: '#474fc4', timestamp: 1565854293240 },
'oblique-line': 'obliqueline-left-one',
},
//{ rowspan: 2, colspan: 1, x: 1, y: 1 },
{
rowspan: 1,
colspan: 1,
x: 1,
y: 2,
// "border-style": { value: "border-solid", timestamp: 1565854327418 },
// "border-color": { value: "#474fc4", timestamp: 1565854293240 }
},
{ rowspan: 1, colspan: 1, x: 1, y: 3 },
{ rowspan: 1, colspan: 1, x: 1, y: 4 },
//2
{
rowspan: 1,
colspan: 1,
x: 2,
y: 1,
},
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-none",
// timestamp: 1549957576284
// },
x: 2,
y: 2,
},
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-none",
// timestamp: 1549957576284
// },
x: 2,
y: 3,
},
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-solid",
// timestamp: null
// },
x: 2,
y: 4,
},
//3
{ rowspan: 1, colspan: 1, x: 3, y: 1 },
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-none",
// timestamp: 1549957576284
// },
x: 3,
y: 2,
},
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-none",
// timestamp: 1549957576284
// },
'border-style': { value: 'border-solid', timestamp: 1565854327418 },
'border-color': { value: '#474fc4', timestamp: 1565854293240 },
//"border-color":"#474fc4",
x: 3,
y: 3,
},
{ rowspan: 1, colspan: 1, x: 3, y: 4 },
//4
{ rowspan: 1, colspan: 1, x: 4, y: 1 },
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-none",
// timestamp: 1549957576284
// },
x: 4,
y: 2,
},
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-none",
// timestamp: 1549957576284
// },
x: 4,
y: 3,
},
{
rowspan: 1,
colspan: 1,
x: 4,
y: 4,
},
//5
{
rowspan: 1,
colspan: 3,
x: 5,
y: 1,
},
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-solid",
// timestamp: 1549957576280
// },
// "border-color": { value: "#4ACD9B", timestamp: 1649957576286 },
x: 5,
y: 2,
},
{
rowspan: 1,
colspan: 1,
// "border-style": {
// value: "border-solid",
// timestamp: 1549957576280
// },
x: 5,
y: 3,
},
{
rowspan: 1,
colspan: 1,
x: 5,
y: 4,
},
//6
{
rowspan: 2,
colspan: 1,
x: 6,
y: 1,
},
//
{
rowspan: 1,
colspan: 2,
x: 10,
y: 1,
},
//10
{
rowspan: 1,
colspan: 2,
x: 10,
y: 1,
},
{
rowspan: 1,
colspan: 2,
x: 10,
y: 3,
},
];
//普通元件
var row_1 = [
{
label: '',
value: ' label1\nlable2 ',
'word-vertical': false,
className: '',
type: 'label',
align: 'left',
'vertical-align': 'top',
//color: "#D93025",
//"text-decoration-underline": true,
'font-style-italic': true,
'font-size': 16,
'font-family': 'Trebuchet MS',
'font-weight': true,
indent: 'auto',
'line-height': 30,
x: 1,
y: 1,
id: '1553580762590-5-1',
},
{
label: '',
value: '奔跑吧\nMAN',
'word-vertical': true,
className: '',
type: 'label',
align: 'center',
'vertical-align': 'bottom',
color: '#2287FE',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
x: 1,
y: 2,
id: '1553580762590-1',
},
{
label: '',
value: '中英文\nENGLISH',
//value:"",
'word-vertical': false,
className: '',
type: 'label',
align: 'center',
'vertical-align': 'middle',
color: '#333',
'text-decoration-underline': false,
'font-style-italic': false,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': false,
//"text-align": "center",
x: 1,
y: 3,
id: '1553580762590-3-2',
'multi-language': 'i18n',
i18n: {
en: 'ENGLISH',
'zh-CN': '中文',
},
},
{
type: 'image',
x: 1,
y: 4,
id: '1553580762590-8',
align: 'center',
'vertical-align': 'middle',
},
];
var row_2 = [
{
name: '',
label: '',
value: '中文验证\n中文验证\n中文验证\n中文验证\n中文验证',
className: '',
type: 'textarea',
x: 2,
y: 1,
id: '1553580762590-2',
anchoring: false,
check: $.formbuilder.REGEX.CHINESE,
'check-tooltip': '请输入中文!',
overflow: true,
},
{
required: false,
name: 'muil-selected',
value: ['option1', 'option2'],
className: '',
regex: '',
items: [
{ text: 'option1', value: 'option1' },
{ text: 'option2', value: 'option2' },
],
type: 'checkboxgroup',
'font-style-italic': true,
'font-family': 'Trebuchet MS',
'font-size': 20,
x: 2,
y: 3,
id: '1553580762590-6',
},
{
required: false,
name: 'radio-group',
className: '',
regex: '',
'font-size': 16,
'font-family': 'Trebuchet MS',
value: 'option2',
items: [
{ text: 'option1', value: 'option1' },
{ text: 'option2', value: 'option2' },
{ text: 'option3', value: 'option3' },
{ text: 'option4', value: 'option4' },
{ text: 'option5', value: 'option5' },
],
type: 'radiogroup',
'vertical-align': 'top',
x: 2,
y: 4,
id: '1553580762590-7',
overflow: 'auto',
},
{
required: false,
name: 'link',
className: '',
regex: '',
value: [
{ text: '链接1', value: 'link1' },
{ text: '链接测试长度很长很长.............', value: 'link2' },
{ text: '链接3', value: 'link3' },
{ text: '链接4', value: 'link4' },
{ text: '链接5', value: 'link5' },
{ text: '链接6', value: 'link6' },
],
type: 'link',
onclick: 'onLinkClick',
'vertical-align': 'top',
'font-style-italic': true,
overflow: 'auto',
'font-family': 'Trebuchet MS',
x: 2,
y: 5,
id: '1753580762591-11',
},
{
required: false,
name: 'multiple select label',
className: '',
regex: '',
value: [
{ text: '池上(其二)', value: 'label1' },
{ text: '小娃', value: 'label2' },
{ text: '撑小艇', value: 'label3' },
{ text: '', value: 'label4' },
{ text: '偷采白莲回', value: 'label5' },
{ text: '不解藏踪迹,浮萍一道开。', value: 'label6' },
],
type: 'multipleselectlabel',
onclick: 'onMulLabelClick',
'vertical-align': 'top',
'font-style-italic': true,
overflow: 'auto',
'font-family': 'Trebuchet MS',
x: 2,
y: 6,
id: '1753580762591-12',
},
];
var row_3 = [
{
label: '',
required: false,
placeholder: '',
name: '',
value: 'textbox',
type: 'textbox',
className: '',
regex: '',
//check: "onCheckValue",
'font-family': 'Trebuchet MS',
'text-align': 'right',
width: '100%',
x: 3,
y: 2,
id: '1553580762590-5',
},
{
required: false,
name: '',
value: '2018-08-08',
type: 'date',
width: '100%',
className: '',
regex: '',
'text-align': 'right',
x: 3,
y: 3,
id: '1553580762590-3',
},
{
required: false,
name: '',
className: '',
regex: '',
value: '2',
items: [
{ text: 't1', value: '1' },
{ text: 't2', value: '2' },
{ text: 't3', value: '3' },
],
type: 'select',
width: 60,
'font-family': 'Trebuchet MS',
//"font-size": 20,
'vertical-align': 'middle',
align: 'center',
x: 3,
y: 4,
id: '1553580762590-4',
},
];
//元件级联扩展
var cascade = [
{
required: false,
name: '',
className: '',
regex: '',
items: [
{ text: '级联top1', value: '1' },
{ text: '级联top2', value: '2' },
{ text: '级联top3', value: '3' },
],
type: 'select',
width: '100%',
'vertical-align': 'middle',
'font-family': 'Trebuchet MS',
'font-size': 12,
x: 4,
y: 1,
id: '1773580762590-1',
value: '2',
color: '#319D5A',
'cascade-source': 'cascadeSourceOne',
'cascade-control': '4:2',
},
{
required: false,
name: '',
className: '',
regex: '',
items: [],
type: 'select',
width: '100%',
'vertical-align': 'middle',
'font-family': 'Trebuchet MS',
'font-size': 12,
x: 4,
y: 2,
id: '1773580762590-2',
value: '2::2-2',
color: '#319D5A',
'cascade-parentId': '2',
'cascade-source': 'cascadeSourceTwo',
'cascade-control': '4:3',
},
{
required: false,
name: '',
className: '',
regex: '',
items: [],
type: 'select',
width: '100%',
'vertical-align': 'middle',
'font-family': 'Trebuchet MS',
'font-size': 12,
x: 4,
y: 3,
id: '1773580762590-3',
value: '2::2-2::3-3',
color: '#319D5A',
'cascade-parentId': '2::2-2',
'cascade-source': 'cascadeSourceThree',
'cascade-control': '',
},
];
var row_5 = [
{
type: 'fileupload',
readonly: false,
x: 5,
y: 1,
id: '1553580762590-5-5',
value:
'P_STO_FILE_633a81c9e4b0ae2dc6774cca;P_STO_FILE_633be075e4b0ae2dc6774dfb;P_STO_FILE_633be075e4b0ae2dc6774dfd;P_STO_FILE_633be075e4b0ae2dc6774dff;P_STO_FILE_633be075e4b0ae2dc6774e01',
},
{
type: 'contenteditable',
x: 5,
y: 4,
id: '1553580762590-5-4',
value: 'contenteditable-row1\ncontenteditable-row2',
},
];
var row_6 = [
{
label: '',
value: '垂直居中',
'word-vertical': false,
className: '',
type: 'label',
align: 'center',
'vertical-align': 'middle',
color: '#333',
'text-decoration-underline': false,
'font-style-italic': false,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': false,
//"text-align": "center",
x: 6,
y: 1,
id: '1999580762590',
// "multi-language": "i18n",
// i18n: {
// "en": "ENGLISH",
// "zh-CN": "中文"
// }
},
];
var row_9 = [
{
x: 9,
y: 1,
type: 'datactrls',
id: 'datactrls-1999',
'relation-dataset': '10:1',
},
// ,
// {
// x: 9,
// y: 2,
// type: "data-remove",
// id: "data-remove-1999",
// "relation-position": "10:1"
// }
];
var row_11 = [
{
label: '',
value: '第一行\n第二行',
'word-vertical': false,
className: '',
type: 'label',
align: 'center',
'vertical-align': 'middle',
color: '#333',
'text-decoration-underline': false,
'font-style-italic': false,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': false,
//"text-align": "center",
x: 11,
y: 1,
id: '199958076259011',
// "multi-language": "i18n",
// i18n: {
// "en": "ENGLISH",
// "zh-CN": "中文"
// }
},
];
var common = []
.concat(row_1)
.concat(row_2)
.concat(row_3)
.concat(cascade)
.concat(row_5)
.concat(row_6)
.concat(row_9)
.concat(row_11);
//纵向元件扩展
var edv = [
//10
//纵向扩展:列合并情况
{
label: '',
value: '纵向扩展-列合并-1',
className: '',
type: 'label',
align: 'right',
color: '#2DA6FD',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 16,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
'vertical-align': 'middle',
width: '100%',
x: 10,
y: 1,
'relation-position': '',
id: 'dataset-v-test-column-1-1',
'dataset-type': true,
'extension-direction': 'vertical',
'fill-dynamic-data': 'onFillDynamicData',
},
{
required: false,
name: '',
value: '12:12:12',
type: 'time',
className: '',
regex: '',
x: 10,
y: 3,
color: '#2DA6FD',
align: 'center',
'relation-position': '10:1',
id: 'dataset-v-test-column-1-2',
'dataset-type': true,
'dataset-index': null,
},
{
required: false,
name: '',
value: '12:12:12',
type: 'time',
className: '',
regex: '',
x: 10,
y: 5,
color: '#2DA6FD',
align: 'center',
'relation-position': '10:3',
id: 'dataset-v-test-column-1-3',
'dataset-type': true,
'dataset-index': null,
},
//12
{
label: '',
value: 'top-fixed',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#D93025',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 12,
y: 3,
'relation-position': null,
id: 'label-top-fixed',
'dataset-type': null,
},
//13 示例1
{
label: '',
value: 'left-fixed',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#D93025',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 13,
y: 1,
'relation-position': null,
id: 'label-left-fixed',
'dataset-type': null,
},
{
label: '',
value: '纵向扩展start',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#2DDE56',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 13,
y: 2,
'relation-position': '',
id: 'dataset-v-test-1-1',
'dataset-type': true,
'extension-direction': 'vertical',
},
{
required: false,
name: '',
value: '12:20:20',
type: 'time',
className: '',
regex: '',
x: 13,
y: 3,
color: '#2DDE56',
align: 'center',
'relation-position': '13:2',
'auto-merger-cell': true,
id: 'dataset-v-test-1-2',
'dataset-type': true,
'dataset-index': null,
},
{
label: '',
value: '纵向扩展end',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#2DDE56',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 13,
y: 4,
'relation-position': '13:3',
id: 'dataset-v-test-1-3',
'dataset-type': true,
},
{
label: '',
value: 'right-fixed',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#D93025',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 13,
y: 5,
'relation-position': null,
id: 'label-right-fixed',
'dataset-type': null,
},
//14 示例2
{
label: '',
value: '纵向扩展开始',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#2BB1FB',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 13,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 14,
y: 2,
id: 'dataset-v-test-2-1',
'extension-direction': 'vertical',
'relation-position': null,
'dataset-type': true,
},
{
label: '',
value: '纵向扩展结束',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#2BB1FB',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 13,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
//"auto-merger-cell": true,
x: 14,
y: 4,
'relation-position': '14:2',
id: 'dataset-v-test-2-2',
'dataset-type': true,
},
//15
{
label: '',
value: 'bottom-fixed',
className: '',
type: 'label',
align: 'center',
'vertical-align': 'bottom',
color: '#D93025',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 15,
y: 3,
'relation-position': null,
id: 'label-bottom-fixed',
'dataset-type': null,
},
];
//横向元件扩展
var edh = [
{
label: '',
value: '横向扩展-1',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#004EA2',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 17,
y: 1,
id: 'dataset-h-test-1-1',
'extension-direction': 'horizontal',
'relation-position': null,
'dataset-type': true,
},
{
required: false,
name: '',
value: '00:00:00',
type: 'text',
className: '',
regex: '',
x: 18,
y: 1,
color: '#004EA2',
align: 'center',
'relation-position': '17:1',
id: 'dataset-v-test-1-2',
'dataset-type': true,
'dataset-index': null,
},
{
label: '',
value: '横向扩展-2',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#004EA2',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 19,
y: 1,
'relation-position': '18:1',
id: 'dataset-v-test-1-2',
'dataset-type': true,
},
{
label: '',
value: 'h-right-fixed',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#D93025',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 18,
y: 3,
'relation-position': null,
id: 'label-right-fixed-2',
'dataset-type': null,
},
{
label: '',
value: 'h-bottom-fixed',
className: '',
type: 'label',
align: 'right',
'vertical-align': 'bottom',
color: '#D93025',
'text-decoration-underline': true,
'font-style-italic': true,
'font-size': 12,
'font-family': 'Trebuchet MS',
'font-weight': true,
'text-align': 'center',
width: '100%',
x: 20,
y: 2,
'relation-position': null,
id: 'label-v-bottom-fixed-2',
'dataset-type': null,
},
];
var controls = [].concat(common).concat(edv).concat(edh);
var datasets_all = [];
var datasets_v = [
{
id: 'dataset-v-test-column-1-1',
//rows: [3,3]
//第 index 页 num 条数据
rows: [2, 3],
},
{
id: 'dataset-v-test-1-1',
//rows: [dataset_1, 2, 2]
//rows: [3, 1]
rows: [dataset_1],
},
{
id: 'dataset-v-test-2-1',
//rows: [3,3]
rows: [2, 1],
},
];
var datasets_h = [
{
id: 'dataset-h-test-1-1',
rows: 5,
},
];
datasets_all = [].concat(datasets_v).concat(datasets_h);
//type: reset replace insert delete
var datasets = {
template: null,
data: datasets_all,
};
var data = {
// eslint-disable-line
table: {
width: 800,
//width: "90%",
height: '100%',
rows: 22,
columns: 7,
//"border-style": "border-none",
//"border-color":"#F23655",
className: '',
x: -1,
y: -1,
paging: false,
},
rows: [
{ height: 60, x: 1, y: -1 },
{ height: 64, x: 2, y: -1 },
{ height: 32, x: 3, y: -1 },
{ height: 32, x: 4, y: -1 },
{ height: 'auto', x: 5, y: -1 },
{ height: 32, x: 6, y: -1 },
{ height: 32, x: 7, y: -1 },
{ height: 32, x: 8, y: -1 },
{ height: 32, x: 9, y: -1 },
{ height: 40, x: 10, y: -1 },
{ height: 22, x: 11, y: -1 },
{ height: 32, x: 13, y: -1 },
{ height: 22, x: 14, y: -1 },
],
columns: [
{ width: 120, x: -1, y: 1 },
{ width: 100, x: -1, y: 2 },
{ width: 120, x: -1, y: 3 },
{ width: 120, x: -1, y: 4 },
{ width: 120, x: -1, y: 5 },
{ width: 160, x: -1, y: 6 },
],
cells: cells,
controls: controls,
datasets: datasets,
};