star-horse-lowcode 2.7.65 → 2.7.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/index.es.js +491 -253
- package/package.json +1 -1
- package/.env.development +0 -3
- package/.env.production +0 -3
- package/.eslintrc-auto-import.json +0 -77
- package/.gitignore +0 -27
- package/.idea/.gitignore +0 -5
- package/.idea/MarsCodeWorkspaceAppSettings.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/modules.xml +0 -8
- package/.idea/testcode.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.idea/watcherTasks.xml +0 -4
- package/.idea/workspace.xml +0 -207
- package/.npmignore +0 -21
- package/.prettierignore +0 -26
- package/auto-imports.d.ts +0 -137
- package/components.d.ts +0 -189
- package/eslint.config.js +0 -37
- package/index.html +0 -14
- package/package-lock.json +0 -8276
- package/prettier.config.js +0 -20
- package/public/logo.svg +0 -660
- package/src/App.vue +0 -11
- package/src/api/date_utils.ts +0 -219
- package/src/api/finger_utils.ts +0 -71
- package/src/api/form_utils.ts +0 -281
- package/src/api/jquery.min.js +0 -2
- package/src/api/pcas-code.json +0 -1
- package/src/api/settings.ts +0 -81
- package/src/api/star_horse_apis.ts +0 -196
- package/src/api/star_horse_utils.ts +0 -797
- package/src/api/system.ts +0 -351
- package/src/api/user_func.ts +0 -147
- package/src/api/valid_utils.ts +0 -165
- package/src/assets/css/index.scss +0 -908
- package/src/assets/icons.css +0 -574
- package/src/assets/star-horse-icons.woff +0 -0
- package/src/components/comp/ShDynamicForm.vue +0 -160
- package/src/components/comp/ShForm.vue +0 -30
- package/src/components/comp/ShTableListColumn.vue +0 -61
- package/src/components/comp/StarHorseDataSelector.vue +0 -139
- package/src/components/comp/StarHorseDataView.vue +0 -110
- package/src/components/comp/StarHorseDataViewItems.vue +0 -61
- package/src/components/comp/StarHorseDataViewTable.vue +0 -102
- package/src/components/comp/StarHorseDialog.vue +0 -383
- package/src/components/comp/StarHorseDraggable.vue +0 -401
- package/src/components/comp/StarHorseForm.vue +0 -458
- package/src/components/comp/StarHorseFormItem.vue +0 -82
- package/src/components/comp/StarHorseFormList.vue +0 -516
- package/src/components/comp/StarHorseFormTable.vue +0 -56
- package/src/components/comp/StarHorseIcon.vue +0 -76
- package/src/components/comp/StarHorseItem.vue +0 -302
- package/src/components/comp/StarHorseJsonEditor.vue +0 -115
- package/src/components/comp/StarHorsePopover.vue +0 -66
- package/src/components/comp/StarHorseSearchComp.vue +0 -253
- package/src/components/comp/StarHorseStaticTable.vue +0 -395
- package/src/components/comp/StarHorseTableColumn.vue +0 -249
- package/src/components/comp/StarHorseTableComp.vue +0 -1193
- package/src/components/comp/StarHorseTableViewColumn.vue +0 -61
- package/src/components/comp/StarHorseTree.vue +0 -494
- package/src/components/comp/index.ts +0 -22
- package/src/components/comp/items/UTableColumn.vue +0 -65
- package/src/components/comp/items/boxItem.vue +0 -98
- package/src/components/comp/items/callitem.ts +0 -9
- package/src/components/comp/items/cardItem.vue +0 -152
- package/src/components/comp/items/collapseItem.vue +0 -134
- package/src/components/comp/items/dytableItem.vue +0 -135
- package/src/components/comp/items/otherItem.vue +0 -65
- package/src/components/comp/items/tabItem.vue +0 -155
- package/src/components/comp/items/tabPanelItem.vue +0 -110
- package/src/components/comp/items/tableColumn.vue +0 -129
- package/src/components/comp/items/tableItem.vue +0 -97
- package/src/components/comp/items/tablebtn.vue +0 -158
- package/src/components/comp/items/viewBoxItem.vue +0 -55
- package/src/components/comp/items/viewCardItem.vue +0 -47
- package/src/components/comp/items/viewCollapseItem.vue +0 -71
- package/src/components/comp/items/viewDytableItem.vue +0 -77
- package/src/components/comp/items/viewOtherItem.vue +0 -55
- package/src/components/comp/items/viewTabItem.vue +0 -77
- package/src/components/comp/items/viewTabPanelItem.vue +0 -54
- package/src/components/comp/items/viewTableItem.vue +0 -74
- package/src/components/comp/selfcomp.ts +0 -9
- package/src/components/comp/utils/DataPicker.vue +0 -302
- package/src/components/comp/utils/DataTag.vue +0 -51
- package/src/components/cron/Crontab-Day.vue +0 -230
- package/src/components/cron/Crontab-Hour.vue +0 -165
- package/src/components/cron/Crontab-Min.vue +0 -166
- package/src/components/cron/Crontab-Month.vue +0 -166
- package/src/components/cron/Crontab-Result.vue +0 -615
- package/src/components/cron/Crontab-Second.vue +0 -185
- package/src/components/cron/Crontab-Week.vue +0 -208
- package/src/components/cron/Crontab-Year.vue +0 -183
- package/src/components/cron/Crontab.vue +0 -474
- package/src/components/enums/ModuleEnums.ts +0 -10
- package/src/components/enums/ServiceEnums.ts +0 -18
- package/src/components/formcomp/container/box-container.vue +0 -162
- package/src/components/formcomp/container/callitem.ts +0 -9
- package/src/components/formcomp/container/card-container.vue +0 -170
- package/src/components/formcomp/container/collapse-container.vue +0 -133
- package/src/components/formcomp/container/dytable-col.vue +0 -448
- package/src/components/formcomp/container/dytable-container.vue +0 -57
- package/src/components/formcomp/container/dytableUtils.ts +0 -358
- package/src/components/formcomp/container/group-box-container.vue +0 -331
- package/src/components/formcomp/container/index.ts +0 -6
- package/src/components/formcomp/container/tab-container.vue +0 -153
- package/src/components/formcomp/container/table-container.vue +0 -249
- package/src/components/formcomp/items/allitem.ts +0 -9
- package/src/components/formcomp/items/area-item.vue +0 -116
- package/src/components/formcomp/items/audio-item.vue +0 -163
- package/src/components/formcomp/items/autocomplete-item.vue +0 -118
- package/src/components/formcomp/items/barcode-item.vue +0 -87
- package/src/components/formcomp/items/base-json-item.vue +0 -207
- package/src/components/formcomp/items/button-item.vue +0 -228
- package/src/components/formcomp/items/cascade-item.vue +0 -113
- package/src/components/formcomp/items/checkbox-item.vue +0 -97
- package/src/components/formcomp/items/color-item.vue +0 -70
- package/src/components/formcomp/items/cron-item.vue +0 -115
- package/src/components/formcomp/items/datetime-item.vue +0 -99
- package/src/components/formcomp/items/depart-item.vue +0 -51
- package/src/components/formcomp/items/dialog-input-item.vue +0 -207
- package/src/components/formcomp/items/divider-item.vue +0 -66
- package/src/components/formcomp/items/html-item.vue +0 -65
- package/src/components/formcomp/items/htmleditor-item.vue +0 -104
- package/src/components/formcomp/items/icon-item.vue +0 -195
- package/src/components/formcomp/items/image-item.vue +0 -247
- package/src/components/formcomp/items/index.ts +0 -44
- package/src/components/formcomp/items/input-item.vue +0 -150
- package/src/components/formcomp/items/json-array-item.vue +0 -67
- package/src/components/formcomp/items/json-item.vue +0 -66
- package/src/components/formcomp/items/markdown-item.vue +0 -77
- package/src/components/formcomp/items/number-item.vue +0 -94
- package/src/components/formcomp/items/number-range-item.vue +0 -278
- package/src/components/formcomp/items/page-select-item.vue +0 -407
- package/src/components/formcomp/items/password-item.vue +0 -71
- package/src/components/formcomp/items/qrcode-item.vue +0 -84
- package/src/components/formcomp/items/radio-item.vue +0 -112
- package/src/components/formcomp/items/rate-item.vue +0 -68
- package/src/components/formcomp/items/select-item.vue +0 -133
- package/src/components/formcomp/items/signature-item.vue +0 -216
- package/src/components/formcomp/items/slider-item.vue +0 -68
- package/src/components/formcomp/items/starhorse-form-item.vue +0 -334
- package/src/components/formcomp/items/switch-item.vue +0 -77
- package/src/components/formcomp/items/tag-item.vue +0 -77
- package/src/components/formcomp/items/text-item.vue +0 -75
- package/src/components/formcomp/items/textarea-item.vue +0 -85
- package/src/components/formcomp/items/time-item.vue +0 -77
- package/src/components/formcomp/items/time-picker-item.vue +0 -74
- package/src/components/formcomp/items/transfer-item.vue +0 -93
- package/src/components/formcomp/items/tselect-item.vue +0 -121
- package/src/components/formcomp/items/unknown-item.vue +0 -51
- package/src/components/formcomp/items/upload-item.vue +0 -189
- package/src/components/formcomp/items/user-item.vue +0 -177
- package/src/components/formcomp/items/usercomp-item.vue +0 -85
- package/src/components/formcomp/items/view-markdown-item.vue +0 -77
- package/src/components/formcomp/utils/EditDataDialog.vue +0 -67
- package/src/components/formcomp/utils/FieldList.vue +0 -125
- package/src/components/formcomp/utils/ItemRelationEventUtils.ts +0 -284
- package/src/components/help.vue +0 -31
- package/src/components/menu/MenuItem.vue +0 -95
- package/src/components/menu/SubMenu.vue +0 -68
- package/src/components/menu/SubSystemMenu.vue +0 -142
- package/src/components/register.ts +0 -24
- package/src/components/system/ContentMenu.vue +0 -260
- package/src/components/system/StarHorseButtonList.vue +0 -344
- package/src/components/system/StarHorseMenu.vue +0 -97
- package/src/components/system/StarHorseSvg.vue +0 -62
- package/src/components/system/SystemComp.ts +0 -9
- package/src/components/system/index.ts +0 -4
- package/src/components/types/ApiUrls.ts +0 -168
- package/src/components/types/BtnAction.ts +0 -51
- package/src/components/types/BtnAuth.ts +0 -43
- package/src/components/types/CompInfo.ts +0 -81
- package/src/components/types/DialogProps.ts +0 -55
- package/src/components/types/DyCompField.ts +0 -23
- package/src/components/types/DynamicNode.ts +0 -42
- package/src/components/types/MenusInfo.ts +0 -45
- package/src/components/types/PageFieldInfo.ts +0 -530
- package/src/components/types/PageProps.ts +0 -25
- package/src/components/types/Params.ts +0 -93
- package/src/components/types/RuleType.ts +0 -10
- package/src/components/types/SearchProps.ts +0 -42
- package/src/components/types/ShortKey.ts +0 -30
- package/src/components/types/StarHorseType.ts +0 -18
- package/src/components/types/index.ts +0 -15
- package/src/config/element.ts +0 -15
- package/src/config/styles.ts +0 -4
- package/src/index.ts +0 -98
- package/src/install.ts +0 -33
- package/src/lang/en_US.ts +0 -81
- package/src/lang/index.ts +0 -35
- package/src/lang/zh_CN.ts +0 -84
- package/src/main.ts +0 -57
- package/src/plugins/AblesPlugin.ts +0 -618
- package/src/plugins/registerCompPlugin.ts +0 -15
- package/src/sample/test.vue +0 -9
- package/src/store/ButtonPermission.ts +0 -101
- package/src/store/ConsumerView.ts +0 -52
- package/src/store/ContinusConfig.ts +0 -78
- package/src/store/CopyerOperation.ts +0 -74
- package/src/store/DesignForm.ts +0 -481
- package/src/store/DesignPage.ts +0 -59
- package/src/store/DynamicForm.ts +0 -241
- package/src/store/GlobalConfig.ts +0 -90
- package/src/store/SelfOperation.ts +0 -95
- package/src/store/UserInfo.ts +0 -88
- package/src/store/index.ts +0 -6
- package/src/theme/localStorge.ts +0 -16
- package/src/theme/theme.ts +0 -27
- package/src/utils/FieldOperationUtils.ts +0 -91
- package/src/utils/auth.ts +0 -83
- package/src/utils/message.ts +0 -69
- package/src/utils/preview.ts +0 -125
- package/tsconfig.json +0 -39
- package/tsconfig.node.json +0 -10
- package/vite-env.d.ts +0 -16
- package/vite.config.ts +0 -162
- package/yarn.lock +0 -4627
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import { uuid } from "@/api/system";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 定义td 数据
|
|
5
|
-
*/
|
|
6
|
-
export const colDataInfo = () => {
|
|
7
|
-
return { _uuid: uuid(), colspan: 1, rowspan: 1, items: [] };
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* 左方插入列
|
|
11
|
-
*/
|
|
12
|
-
const insertLeftCol = (props: any) => {
|
|
13
|
-
const rows = props.parentField.preps.elements;
|
|
14
|
-
const position = props.isFirstCol ? 0 : props.colIndex - 1;
|
|
15
|
-
for (let index = 0; index < rows.length; index++) {
|
|
16
|
-
const cols = rows[index].columns;
|
|
17
|
-
cols.splice(position, 0, colDataInfo());
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const insertRightCol = (props: any) => {
|
|
21
|
-
const rows = props.parentField.preps.elements;
|
|
22
|
-
const position = props.isLastCol ? props.colIndex : props.colIndex + 1;
|
|
23
|
-
for (let index = 0; index < rows.length; index++) {
|
|
24
|
-
const cols = rows[index].columns;
|
|
25
|
-
cols.splice(position, 0, colDataInfo());
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const insertAboveRow = (props: any) => {
|
|
29
|
-
const rows = props.parentField.preps.elements;
|
|
30
|
-
let len = 1;
|
|
31
|
-
const cols: Array<any> = [];
|
|
32
|
-
for (let index = 0; index < rows.length; index++) {
|
|
33
|
-
const colLen = rows[index].columns.length;
|
|
34
|
-
if (colLen > len) {
|
|
35
|
-
len = colLen;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
for (let i = 0; i < len; i++) {
|
|
39
|
-
cols.push(colDataInfo());
|
|
40
|
-
}
|
|
41
|
-
const position = props.isFirstRow ? 0 : props.rowIndex - 1;
|
|
42
|
-
rows.splice(position, 0, cols);
|
|
43
|
-
};
|
|
44
|
-
const insertBelowRow = (props: any) => {
|
|
45
|
-
const rows = props.parentField.preps.elements;
|
|
46
|
-
let len = 1;
|
|
47
|
-
const cols: Array<any> = [];
|
|
48
|
-
for (let index = 0; index < rows.length; index++) {
|
|
49
|
-
const colLen = rows[index].columns.length;
|
|
50
|
-
if (colLen > len) {
|
|
51
|
-
len = colLen;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
for (let i = 0; i < len; i++) {
|
|
55
|
-
cols.push(colDataInfo());
|
|
56
|
-
}
|
|
57
|
-
const position = props.isLastRow ? props.rowIndex : props.rowIndex + 1;
|
|
58
|
-
rows.splice(position, 0, cols);
|
|
59
|
-
};
|
|
60
|
-
const tableCellInfo = (props: any) => {
|
|
61
|
-
const rows = props.parentField.preps.elements;
|
|
62
|
-
const row = rows[props.rowIndex];
|
|
63
|
-
const col = row.columns[props.colIndex];
|
|
64
|
-
return { rows, row, col };
|
|
65
|
-
};
|
|
66
|
-
const mergeLeftCol = (props: any) => {
|
|
67
|
-
const { row, col } = tableCellInfo(props);
|
|
68
|
-
col.colspan = col.colspan + 1;
|
|
69
|
-
row.columns.splice(props.colIndex - 1, 1);
|
|
70
|
-
};
|
|
71
|
-
const mergeRightCol = (props: any) => {
|
|
72
|
-
const { row, col } = tableCellInfo(props);
|
|
73
|
-
col.colspan = col.colspan + 1;
|
|
74
|
-
row.columns.splice(props.colIndex + 1, 1);
|
|
75
|
-
};
|
|
76
|
-
const mergeWholeCol = (props: any) => {
|
|
77
|
-
const { rows, col } = tableCellInfo(props);
|
|
78
|
-
// let currentCol: any = {};
|
|
79
|
-
for (const index in rows) {
|
|
80
|
-
const row1 = rows[index];
|
|
81
|
-
const cols = row1.columns;
|
|
82
|
-
for (const cIndex in cols) {
|
|
83
|
-
if (cIndex == props.colIndex) {
|
|
84
|
-
cols.splice(cIndex, 1);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
col.rowspan = rows.length;
|
|
89
|
-
rows[0].columns.splice(props.colIndex, 0, col);
|
|
90
|
-
};
|
|
91
|
-
const mergeAboveRow = (props: any) => {
|
|
92
|
-
const { rows, row, col } = tableCellInfo(props);
|
|
93
|
-
const aboveRow = rows[props.rowIndex - 1];
|
|
94
|
-
col.rowspan = col.rowspan + 1;
|
|
95
|
-
for (const index in aboveRow.columns) {
|
|
96
|
-
if (index == props.colIndex) {
|
|
97
|
-
aboveRow.columns.splice(index, 1, col);
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
for (const index in row.columns) {
|
|
102
|
-
if (index == props.colIndex) {
|
|
103
|
-
row.columns.splice(index, 1);
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
const mergeBelowRow = (props: any) => {
|
|
109
|
-
const { rows, col } = tableCellInfo(props);
|
|
110
|
-
col.rowspan = col.rowspan + 1;
|
|
111
|
-
const belowRow = rows[props.rowIndex + 1];
|
|
112
|
-
for (const index in belowRow.columns) {
|
|
113
|
-
if (index == props.colIndex) {
|
|
114
|
-
belowRow.columns.splice(index, 1);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const mergeWholeRow = (props: any) => {
|
|
120
|
-
const { row, col } = tableCellInfo(props);
|
|
121
|
-
let totalCols: number = 0;
|
|
122
|
-
for (const index in row.columns) {
|
|
123
|
-
const col = row.columns[index];
|
|
124
|
-
totalCols += col.colspan;
|
|
125
|
-
}
|
|
126
|
-
col.colspan = totalCols;
|
|
127
|
-
row.columns = [col];
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* 需要判断需要还原的周边数据
|
|
131
|
-
* @param props
|
|
132
|
-
*/
|
|
133
|
-
const undoMergeRow = (props: any) => {
|
|
134
|
-
const { rows, row, col } = tableCellInfo(props);
|
|
135
|
-
if (row.columns.length == 1) {
|
|
136
|
-
//说明是合并了整行
|
|
137
|
-
col.colspan = col.colspan - 1;
|
|
138
|
-
row.columns.splice(props.colIndex, 0, colDataInfo());
|
|
139
|
-
} else {
|
|
140
|
-
col.rowspan = col.rowspan - 1;
|
|
141
|
-
row.columns.splice(props.colIndex, 1, colDataInfo());
|
|
142
|
-
rows[props.rowIndex + 1].columns.splice(props.colIndex, 0, col);
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* 需要判断要还原的周边数据
|
|
147
|
-
* @param props
|
|
148
|
-
*/
|
|
149
|
-
const undoMergeCol = (props: any) => {
|
|
150
|
-
const { rows, row, col } = tableCellInfo(props);
|
|
151
|
-
//如果 列的行合并和整个表格的行相同,则表示已合并的整列
|
|
152
|
-
if (col.rowspan == rows.length) {
|
|
153
|
-
col.rowspan = col.rowspan - 1;
|
|
154
|
-
//在当前位置插入新的单元格
|
|
155
|
-
row.columns.splice(props.colIndex, 1, colDataInfo());
|
|
156
|
-
//将数据移入下一行
|
|
157
|
-
rows[props.rowIndex + 1].columns.splice(props.colIndex, 0, col);
|
|
158
|
-
} else {
|
|
159
|
-
//在同一行合并了单元格
|
|
160
|
-
col.colspan = col.colspan - 1;
|
|
161
|
-
row.columns.splice(props.colIndex, 0, colDataInfo());
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* 删除整列,在删除列的同时需要,考虑合并的情况,否则有可能导致整行被删除
|
|
166
|
-
* @param props
|
|
167
|
-
*/
|
|
168
|
-
const deleteWholeCol = (props: any) => {
|
|
169
|
-
const rows = props.parentField.preps.elements;
|
|
170
|
-
for (const index in rows) {
|
|
171
|
-
const cols = rows[index].columns;
|
|
172
|
-
for (const sIndex in cols) {
|
|
173
|
-
if (props.colIndex == sIndex) {
|
|
174
|
-
cols.splice(sIndex, 1);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
const deleteWholeRow = (props: any) => {
|
|
180
|
-
props.parentField.preps.elements.splice(props.rowIndex, 1);
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* 单元格操作方法
|
|
185
|
-
* @param command
|
|
186
|
-
* @param props
|
|
187
|
-
*/
|
|
188
|
-
export const tableCellOperation = (command: string, props: any) => {
|
|
189
|
-
switch (command) {
|
|
190
|
-
case "insertLeftCol":
|
|
191
|
-
insertLeftCol(props);
|
|
192
|
-
break;
|
|
193
|
-
case "insertRightCol":
|
|
194
|
-
insertRightCol(props);
|
|
195
|
-
break;
|
|
196
|
-
case "insertAboveRow":
|
|
197
|
-
insertAboveRow(props);
|
|
198
|
-
break;
|
|
199
|
-
case "insertBelowRow":
|
|
200
|
-
insertBelowRow(props);
|
|
201
|
-
break;
|
|
202
|
-
case "mergeLeftCol":
|
|
203
|
-
mergeLeftCol(props);
|
|
204
|
-
break;
|
|
205
|
-
case "mergeRightCol":
|
|
206
|
-
mergeRightCol(props);
|
|
207
|
-
break;
|
|
208
|
-
case "mergeWholeCol":
|
|
209
|
-
mergeWholeCol(props);
|
|
210
|
-
break;
|
|
211
|
-
case "mergeAboveRow":
|
|
212
|
-
mergeAboveRow(props);
|
|
213
|
-
break;
|
|
214
|
-
case "mergeBelowRow":
|
|
215
|
-
mergeBelowRow(props);
|
|
216
|
-
break;
|
|
217
|
-
case "mergeWholeRow":
|
|
218
|
-
mergeWholeRow(props);
|
|
219
|
-
break;
|
|
220
|
-
case "undoMergeRow":
|
|
221
|
-
undoMergeRow(props);
|
|
222
|
-
break;
|
|
223
|
-
case "undoMergeCol":
|
|
224
|
-
undoMergeCol(props);
|
|
225
|
-
break;
|
|
226
|
-
case "deleteWholeCol":
|
|
227
|
-
deleteWholeCol(props);
|
|
228
|
-
break;
|
|
229
|
-
case "deleteWholeRow":
|
|
230
|
-
deleteWholeRow(props);
|
|
231
|
-
break;
|
|
232
|
-
case "colConfig":
|
|
233
|
-
console.log();
|
|
234
|
-
}
|
|
235
|
-
//操作单元格后再次调用控制按钮函数
|
|
236
|
-
// tableAction(props, buttonControl);
|
|
237
|
-
};
|
|
238
|
-
const mergeLeftColAction = (props: any) => {
|
|
239
|
-
const { row, col } = tableCellInfo(props);
|
|
240
|
-
if (!row || !row.columns?.length) {
|
|
241
|
-
return true;
|
|
242
|
-
}
|
|
243
|
-
const leftCol = row.columns[props.colIndex - 1];
|
|
244
|
-
return col.rowspan > 1 && leftCol
|
|
245
|
-
? leftCol.rowspan != col.rowspan
|
|
246
|
-
: props.isFirstCol;
|
|
247
|
-
};
|
|
248
|
-
const mergeRightColAction = (props: any) => {
|
|
249
|
-
const { row, col } = tableCellInfo(props);
|
|
250
|
-
if (!row || !row.columns?.length) {
|
|
251
|
-
return true;
|
|
252
|
-
}
|
|
253
|
-
const rightCol = row.columns[props.colIndex + 1];
|
|
254
|
-
return col.rowspan > 1 && rightCol
|
|
255
|
-
? rightCol.rowspan != col.rowspan
|
|
256
|
-
: props.isLastCol;
|
|
257
|
-
};
|
|
258
|
-
const mergeWholeColAction = (props: any) => {
|
|
259
|
-
return colCommonAction(props);
|
|
260
|
-
};
|
|
261
|
-
const mergeAboveRowAction = (props: any) => {
|
|
262
|
-
const { rows, col } = tableCellInfo(props);
|
|
263
|
-
const aboveRow = rows[props.rowIndex - 1];
|
|
264
|
-
if (!aboveRow || !aboveRow.columns.length) {
|
|
265
|
-
return true;
|
|
266
|
-
}
|
|
267
|
-
const aboveCol = aboveRow?.columns[props.colIndex];
|
|
268
|
-
if (!aboveCol || col.colspan != aboveCol.colspan) {
|
|
269
|
-
return true;
|
|
270
|
-
}
|
|
271
|
-
return props.isFirstRow;
|
|
272
|
-
};
|
|
273
|
-
const mergeBelowRowAction = (props: any) => {
|
|
274
|
-
const { rows, col } = tableCellInfo(props);
|
|
275
|
-
const belowRow = rows[props.rowIndex + 1];
|
|
276
|
-
if (!belowRow || !belowRow.columns?.length) {
|
|
277
|
-
return true;
|
|
278
|
-
}
|
|
279
|
-
const belowCol = belowRow?.columns[props.colIndex];
|
|
280
|
-
if (!belowCol || col.colspan != belowCol.colspan) {
|
|
281
|
-
return true;
|
|
282
|
-
}
|
|
283
|
-
return props.isLastRow;
|
|
284
|
-
};
|
|
285
|
-
const mergeWholeRowAction = (props: any) => {
|
|
286
|
-
return rowCommonAction(props);
|
|
287
|
-
};
|
|
288
|
-
const colCommonAction = (props: any) => {
|
|
289
|
-
const { rows, col } = tableCellInfo(props);
|
|
290
|
-
for (const index in rows) {
|
|
291
|
-
const tempRow = rows[index];
|
|
292
|
-
if (!tempRow || !tempRow.columns?.length) {
|
|
293
|
-
return true;
|
|
294
|
-
}
|
|
295
|
-
const tempCol = tempRow.columns[props.colIndex];
|
|
296
|
-
if (!tempCol || tempCol.colspan != col.colspan) {
|
|
297
|
-
// console.log(tempCol, col);
|
|
298
|
-
return true;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return false;
|
|
302
|
-
};
|
|
303
|
-
const rowCommonAction = (props: any) => {
|
|
304
|
-
const { row, col } = tableCellInfo(props);
|
|
305
|
-
|
|
306
|
-
for (const index in row.columns) {
|
|
307
|
-
const tempCol = row.columns[index];
|
|
308
|
-
if (col.rowspan != tempCol.rowspan) {
|
|
309
|
-
return true;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return false;
|
|
313
|
-
};
|
|
314
|
-
const deleteWholeColAction = (props: any) => {
|
|
315
|
-
return colCommonAction(props);
|
|
316
|
-
};
|
|
317
|
-
const deleteWholeRowAction = (props: any) => {
|
|
318
|
-
return rowCommonAction(props);
|
|
319
|
-
};
|
|
320
|
-
const undoMergeRowAction = (props: any) => {
|
|
321
|
-
const { rows, col } = tableCellInfo(props);
|
|
322
|
-
let columns: number = 0;
|
|
323
|
-
for (const index in rows) {
|
|
324
|
-
const len = rows[index].columns?.length;
|
|
325
|
-
if (columns < len) {
|
|
326
|
-
columns = len;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
if (columns == col.colspan && col.colspan > 1) {
|
|
330
|
-
return false;
|
|
331
|
-
}
|
|
332
|
-
return props.field.rowspan == 1;
|
|
333
|
-
};
|
|
334
|
-
const undoMergeColAction = (props: any) => {
|
|
335
|
-
const { rows, col } = tableCellInfo(props);
|
|
336
|
-
// console.log(rows.length, col);
|
|
337
|
-
if (rows.length == col.rowspan && col.rowspan > 1) {
|
|
338
|
-
return false;
|
|
339
|
-
}
|
|
340
|
-
return props.field.colspan == 1;
|
|
341
|
-
};
|
|
342
|
-
/**
|
|
343
|
-
* 单元格按钮是否可点击控制
|
|
344
|
-
* @param props
|
|
345
|
-
* @param buttonControl 按钮控制
|
|
346
|
-
*/
|
|
347
|
-
export const tableAction = (props: any, buttonControl: any) => {
|
|
348
|
-
buttonControl.mergeLeftColDisabled = mergeLeftColAction(props);
|
|
349
|
-
buttonControl.mergeRightColDisabled = mergeRightColAction(props);
|
|
350
|
-
buttonControl.mergeWholeColDisabled = mergeWholeColAction(props);
|
|
351
|
-
buttonControl.mergeAboveRowDisabled = mergeAboveRowAction(props);
|
|
352
|
-
buttonControl.mergeBelowRowDisabled = mergeBelowRowAction(props);
|
|
353
|
-
buttonControl.mergeWholeRowDisabled = mergeWholeRowAction(props);
|
|
354
|
-
buttonControl.deleteWholeColDisabled = deleteWholeColAction(props);
|
|
355
|
-
buttonControl.deleteWholeRowDisabled = deleteWholeRowAction(props);
|
|
356
|
-
buttonControl.undoMergeRowDisabled = undoMergeRowAction(props);
|
|
357
|
-
buttonControl.undoMergeColDisabled = undoMergeColAction(props);
|
|
358
|
-
};
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" name="GroupBoxContainer">
|
|
2
|
-
import { operationConfirm, warning } from "@/utils/message";
|
|
3
|
-
import piniaInstance from "@/store/index";
|
|
4
|
-
import { useDesignFormStore } from "@/store/DesignForm";
|
|
5
|
-
import { computed, ref } from "vue";
|
|
6
|
-
import { colDataInfo } from "@/components/formcomp/container/dytableUtils";
|
|
7
|
-
import { dynamicFormContextMenuData } from "@/plugins/AblesPlugin";
|
|
8
|
-
import FieldList from "@/components/formcomp/utils/FieldList.vue";
|
|
9
|
-
import StarHorseDialog from "@/components/comp/StarHorseDialog.vue";
|
|
10
|
-
import { fieldCopy } from "@/utils/FieldOperationUtils";
|
|
11
|
-
|
|
12
|
-
const props = defineProps({
|
|
13
|
-
isDesign: { type: Boolean, default: false },
|
|
14
|
-
disabled: { type: Boolean, default: false },
|
|
15
|
-
parentField: { type: Object },
|
|
16
|
-
formItem: { type: Object, required: true },
|
|
17
|
-
});
|
|
18
|
-
let designForm = useDesignFormStore(piniaInstance);
|
|
19
|
-
let compList = computed(() => designForm.compList);
|
|
20
|
-
let currentItemId = computed(() => designForm.currentItemId);
|
|
21
|
-
let componentVisible = computed(() => {
|
|
22
|
-
return (
|
|
23
|
-
designForm.componentVisible &&
|
|
24
|
-
currentItemId.value == props.formItem?.preps.id
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
let isEdit = computed(() => props.isDesign);
|
|
28
|
-
const selectData = () => {
|
|
29
|
-
let container = props.formItem;
|
|
30
|
-
designForm.selectItem(container, container?.itemType, "");
|
|
31
|
-
};
|
|
32
|
-
const removeData = () => {
|
|
33
|
-
operationConfirm("删除容器,容器内的所有元素都会被删除").then((res) => {
|
|
34
|
-
if (res) {
|
|
35
|
-
let id = props.formItem.preps?.id || props.formItem.id;
|
|
36
|
-
if (props.parentField?.itemType == "tab") {
|
|
37
|
-
let elements = props.parentField!.preps.elements;
|
|
38
|
-
for (let i = 0; i < elements.length; i++) {
|
|
39
|
-
let items = elements[i].items;
|
|
40
|
-
for (let j = 0; j < items.length; j++) {
|
|
41
|
-
if (id === items[j]?.id) {
|
|
42
|
-
items.splice(j, 1);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
} else if (props.parentField?.itemType == "box") {
|
|
48
|
-
} else {
|
|
49
|
-
let dataList = compList.value;
|
|
50
|
-
for (let i = 0; i < dataList.length; i++) {
|
|
51
|
-
if (id === dataList[i].id) {
|
|
52
|
-
dataList.splice(i, 1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
const containerContextMenuRef = ref();
|
|
60
|
-
const containerContextMenu = (evt: MouseEvent | any) => {
|
|
61
|
-
if (!isEdit.value) return;
|
|
62
|
-
evt.stopPropagation();
|
|
63
|
-
evt.preventDefault();
|
|
64
|
-
evt.props = props;
|
|
65
|
-
containerContextMenuRef.value?.show(evt);
|
|
66
|
-
};
|
|
67
|
-
const close = () => {
|
|
68
|
-
designForm.setComponentVisible(false);
|
|
69
|
-
};
|
|
70
|
-
const addItem = (item: any) => {
|
|
71
|
-
let type = item.category == 2 ? "container" : "formItem";
|
|
72
|
-
let data = fieldCopy(item, type);
|
|
73
|
-
let itemType = props.formItem.itemType;
|
|
74
|
-
let activeItemName = props.formItem.activeItemName;
|
|
75
|
-
let elements = props.formItem.preps.elements;
|
|
76
|
-
for (let index in elements) {
|
|
77
|
-
let element = elements[index];
|
|
78
|
-
if (activeItemName && activeItemName != element.tabName) {
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
let columns = element.columns;
|
|
82
|
-
if (!columns) {
|
|
83
|
-
let items = element.items;
|
|
84
|
-
if (itemType == "table") {
|
|
85
|
-
if (items.length == 0) {
|
|
86
|
-
items.push(data);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
items.push(data);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
for (let colIndex in columns) {
|
|
95
|
-
let col = columns[colIndex];
|
|
96
|
-
if (col.items.length == 0) {
|
|
97
|
-
col.items.push(data);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
const tableOperation = (actonName: string, _preps: any) => {
|
|
104
|
-
let preps = props.formItem.preps;
|
|
105
|
-
if (!preps.elements) {
|
|
106
|
-
preps["elements"] = [];
|
|
107
|
-
}
|
|
108
|
-
let isBox = props.formItem.itemType == "box";
|
|
109
|
-
if (actonName == "insertRow") {
|
|
110
|
-
//获取最大的数字
|
|
111
|
-
let rows: Array<any> = preps.elements;
|
|
112
|
-
if (rows.length > 0) {
|
|
113
|
-
let columns: Array<any> = [];
|
|
114
|
-
let len: number = 1;
|
|
115
|
-
for (let index in rows) {
|
|
116
|
-
let colLen = rows[index]?.columns?.length;
|
|
117
|
-
if (colLen > len) {
|
|
118
|
-
len = colLen;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
for (let i = 0; i < len; i++) {
|
|
122
|
-
let col = colDataInfo();
|
|
123
|
-
if (isBox) {
|
|
124
|
-
col.colspan = 24 / len;
|
|
125
|
-
}
|
|
126
|
-
columns.push(col);
|
|
127
|
-
}
|
|
128
|
-
preps.elements.push({
|
|
129
|
-
columns: columns,
|
|
130
|
-
});
|
|
131
|
-
} else {
|
|
132
|
-
let col = colDataInfo();
|
|
133
|
-
if (isBox) {
|
|
134
|
-
col.colspan = 24;
|
|
135
|
-
}
|
|
136
|
-
preps.elements.push({
|
|
137
|
-
columns: [],
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
} else if (actonName == "insertCol") {
|
|
141
|
-
if (props.formItem.itemType == "table") {
|
|
142
|
-
preps.columns = (preps.columns || 1) + 1;
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
for (let index in preps.elements) {
|
|
146
|
-
let row: any = preps.elements[index];
|
|
147
|
-
if (!row.columns) {
|
|
148
|
-
row["columns"] = [];
|
|
149
|
-
}
|
|
150
|
-
let col = colDataInfo();
|
|
151
|
-
if (isBox) {
|
|
152
|
-
col.colspan = 24 / (row.columns.length + 1);
|
|
153
|
-
row.columns.forEach((item: any) => {
|
|
154
|
-
item.colspan = col.colspan;
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
row.columns.push(col);
|
|
158
|
-
}
|
|
159
|
-
} else if (actonName == "copy") {
|
|
160
|
-
//拷贝容器
|
|
161
|
-
warning("功能开发中");
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
</script>
|
|
165
|
-
<template>
|
|
166
|
-
<star-horse-dialog
|
|
167
|
-
box-width="450px"
|
|
168
|
-
:is-view="true"
|
|
169
|
-
:full-screen="false"
|
|
170
|
-
title="添加组件"
|
|
171
|
-
:self-func="true"
|
|
172
|
-
:dialog-visible="componentVisible"
|
|
173
|
-
@closeAction="close"
|
|
174
|
-
>
|
|
175
|
-
<template #footer>
|
|
176
|
-
<el-button type="primary" size="default" @click="close">确定</el-button>
|
|
177
|
-
</template>
|
|
178
|
-
<field-list @selectData="addItem" />
|
|
179
|
-
</star-horse-dialog>
|
|
180
|
-
<div
|
|
181
|
-
class="field-item"
|
|
182
|
-
v-if="isEdit && isDesign"
|
|
183
|
-
@contextmenu="containerContextMenu"
|
|
184
|
-
>
|
|
185
|
-
<slot></slot>
|
|
186
|
-
<div
|
|
187
|
-
class="drag-handler"
|
|
188
|
-
v-if="isEdit && isDesign && currentItemId == formItem.id"
|
|
189
|
-
>
|
|
190
|
-
<el-tooltip content="拖动">
|
|
191
|
-
<star-horse-icon
|
|
192
|
-
icon-class="drag"
|
|
193
|
-
size="18px"
|
|
194
|
-
style="color: var(--star-horse-white)"
|
|
195
|
-
/>
|
|
196
|
-
</el-tooltip>
|
|
197
|
-
<el-tooltip content="选中容器">
|
|
198
|
-
<star-horse-icon
|
|
199
|
-
cursor="pointer"
|
|
200
|
-
@click.stop="selectData"
|
|
201
|
-
icon-class="select-parent"
|
|
202
|
-
style="color: var(--star-horse-white)"
|
|
203
|
-
/>
|
|
204
|
-
</el-tooltip>
|
|
205
|
-
<el-tooltip content="删除容器">
|
|
206
|
-
<star-horse-icon
|
|
207
|
-
cursor="pointer"
|
|
208
|
-
@click.stop="removeData"
|
|
209
|
-
icon-class="clear-all"
|
|
210
|
-
style="color: var(--star-horse-white)"
|
|
211
|
-
/>
|
|
212
|
-
</el-tooltip>
|
|
213
|
-
</div>
|
|
214
|
-
<div
|
|
215
|
-
class="field-action"
|
|
216
|
-
v-if="isEdit && isDesign && currentItemId == formItem.id"
|
|
217
|
-
>
|
|
218
|
-
<template
|
|
219
|
-
v-if="formItem.itemType == 'dytable' || formItem.itemType == 'box'"
|
|
220
|
-
>
|
|
221
|
-
<el-tooltip content="插入行">
|
|
222
|
-
<star-horse-icon
|
|
223
|
-
@click.stop="tableOperation('insertRow', formItem?.preps)"
|
|
224
|
-
icon-class="insert_row"
|
|
225
|
-
cursor="pointer"
|
|
226
|
-
style="color: var(--star-horse-white)"
|
|
227
|
-
/>
|
|
228
|
-
</el-tooltip>
|
|
229
|
-
</template>
|
|
230
|
-
<template
|
|
231
|
-
v-if="
|
|
232
|
-
formItem.itemType == 'dytable' ||
|
|
233
|
-
formItem.itemType == 'box' ||
|
|
234
|
-
formItem.itemType == 'table'
|
|
235
|
-
"
|
|
236
|
-
>
|
|
237
|
-
<el-tooltip content="插入列">
|
|
238
|
-
<star-horse-icon
|
|
239
|
-
@click.stop="tableOperation('insertCol', formItem?.preps)"
|
|
240
|
-
icon-class="insert_col"
|
|
241
|
-
cursor="pointer"
|
|
242
|
-
style="color: var(--star-horse-white)"
|
|
243
|
-
/>
|
|
244
|
-
</el-tooltip>
|
|
245
|
-
</template>
|
|
246
|
-
<el-tooltip content="复制容器">
|
|
247
|
-
<star-horse-icon
|
|
248
|
-
@click.stop="tableOperation('copy', formItem?.preps)"
|
|
249
|
-
icon-class="copy"
|
|
250
|
-
style="color: var(--star-horse-white)"
|
|
251
|
-
/>
|
|
252
|
-
</el-tooltip>
|
|
253
|
-
</div>
|
|
254
|
-
<Teleport to="body">
|
|
255
|
-
<ContentMenu
|
|
256
|
-
ref="containerContextMenuRef"
|
|
257
|
-
:menu-data="
|
|
258
|
-
dynamicFormContextMenuData(formItem, parentField, 'container')
|
|
259
|
-
"
|
|
260
|
-
/>
|
|
261
|
-
</Teleport>
|
|
262
|
-
</div>
|
|
263
|
-
<div class="field-item" style="border: unset" v-else>
|
|
264
|
-
<slot></slot>
|
|
265
|
-
</div>
|
|
266
|
-
</template>
|
|
267
|
-
<style lang="scss" scoped>
|
|
268
|
-
.field-item {
|
|
269
|
-
border: 1px dashed #e6a23c;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.el-form-item {
|
|
273
|
-
position: relative;
|
|
274
|
-
|
|
275
|
-
:deep(.el-form-item__label) {
|
|
276
|
-
white-space: nowrap;
|
|
277
|
-
text-overflow: ellipsis;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
span.custom-label .icon-cls {
|
|
281
|
-
margin: 0 3px;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
:deep(.hide-spin-button) input::-webkit-outer-spin-button,
|
|
285
|
-
:deep(.hide-spin-button) input::-webkit-inner-spin-button {
|
|
286
|
-
-webkit-appearance: none !important;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
:deep(.hide-spin-button) input[type="number"] {
|
|
290
|
-
-moz-appearance: textfield;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.required :deep(.el-form-item__label)::before {
|
|
295
|
-
content: "*";
|
|
296
|
-
color: #f56c6c;
|
|
297
|
-
margin-right: 4px;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.static-content-item {
|
|
301
|
-
min-height: 20px;
|
|
302
|
-
display: flex;
|
|
303
|
-
/* 垂直居中 */
|
|
304
|
-
align-items: center;
|
|
305
|
-
|
|
306
|
-
/* 垂直居中 */
|
|
307
|
-
:deep(.el-divider--horizontal) {
|
|
308
|
-
margin: 0;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.el-form-item.selected,
|
|
313
|
-
.static-content-item.selected {
|
|
314
|
-
outline: 2px solid var(--star-horse-style);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
:deep(.label-left-align) .el-form-item__label {
|
|
318
|
-
text-align: left;
|
|
319
|
-
justify-content: flex-start !important;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
:deep(.label-center-align) .el-form-item__label {
|
|
323
|
-
text-align: center;
|
|
324
|
-
justify-content: center !important;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
:deep(.label-right-align) .el-form-item__label {
|
|
328
|
-
text-align: right;
|
|
329
|
-
justify-content: flex-end !important;
|
|
330
|
-
}
|
|
331
|
-
</style>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as boxContainer } from "./box-container.vue";
|
|
2
|
-
export { default as cardContainer } from "./card-container.vue";
|
|
3
|
-
export { default as collapseContainer } from "./collapse-container.vue";
|
|
4
|
-
export { default as dytableContainer } from "./dytable-container.vue";
|
|
5
|
-
export { default as tabContainer } from "./tab-container.vue";
|
|
6
|
-
export { default as tableContainer } from "./table-container.vue";
|