cloud-web-corejs 1.0.54-dev.533 → 1.0.54-dev.535

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.533",
4
+ "version": "1.0.54-dev.535",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -16,6 +16,12 @@
16
16
  "publishDev": "npm publish --tag dev"
17
17
  },
18
18
  "dependencies": {
19
+ "@univerjs/preset-sheets-core": "^0.15.0",
20
+ "@univerjs/preset-sheets-drawing": "^0.15.0",
21
+ "@univerjs/presets": "^0.15.0",
22
+ "@univerjs/sheets-crosshair-highlight": "^0.15.0",
23
+ "@univerjs/sheets-zen-editor": "^0.15.0",
24
+ "@univerjs/watermark": "^0.15.0",
19
25
  "@codemirror/lang-javascript": "^6.1.9",
20
26
  "@formulajs/formulajs": "^4.3.1",
21
27
  "@vue/preload-webpack-plugin": "^2.0.0",
@@ -152,6 +158,7 @@
152
158
  "src/components/table",
153
159
  "src/components/tempStorage",
154
160
  "src/components/Tinymce",
161
+ "src/components/univer",
155
162
  "src/components/obsUpload",
156
163
  "src/components/VabUpload",
157
164
  "src/components/vb-tabs",
@@ -42,6 +42,7 @@
42
42
  </el-dialog>
43
43
  </template>
44
44
  <script>
45
+ import xeUtils from "xe-utils";
45
46
  export default {
46
47
  name: "exportFieldDialog",
47
48
  props: ["param"],
@@ -75,14 +76,76 @@ export default {
75
76
  Math.random() * 100000 + Math.random() * 20000 + Math.random() * 5000
76
77
  );
77
78
  },
79
+ filterExportVisible(items) {
80
+ if (!Array.isArray(items)) return [];
81
+
82
+ return items
83
+ .filter((item) => item.exportItemVisible === true) // 只保留 exportItemVisible 严格等于 true 的项
84
+ .map((item) => {
85
+ // 如果有 children,递归过滤
86
+ if (Array.isArray(item.children)) {
87
+ return {
88
+ ...item,
89
+ children: this.filterExportVisible(item.children),
90
+ };
91
+ }
92
+ return item;
93
+ });
94
+ },
78
95
  init() {
79
96
  let target = this.getGrid();
80
- let { fullColumn, collectColumn: columns } = target.getTableColumn();
97
+ let { fullColumn, collectColumn: column1s } = target.getTableColumn();
98
+
99
+ let checkMethod = target.$refs.xTable.customOpts?.checkMethod;
100
+ // var checkMethod = $xetable ? $xetable.customOpts.checkMethod : null;
81
101
  // let columns = target.getTableColumn().collectColumn;
102
+ let columns = [];
103
+ let allFields = [];
104
+ if (checkMethod) {
105
+ const handleColumnVisible = (column) => {
106
+ if (!column.title) return false;
107
+ let visible = true;
108
+
109
+ let isColGroup = column.children && column.children.length;
110
+
111
+ if (isColGroup) {
112
+ // 如果是分组字段,则根据子字段的显示状态来处理
113
+ let parentVisible = false;
114
+ column.children.forEach((item) => {
115
+ let itemVisible = handleColumnVisible(item);
116
+ if (itemVisible) {
117
+ parentVisible = true;
118
+ }
119
+ });
120
+ visible = parentVisible;
121
+ /* visible = column.children.some((item) => {
122
+ return handleColumnVisible(item);
123
+ }); */
124
+ } else {
125
+ let isDisabled = !checkMethod({
126
+ column: column,
127
+ });
128
+ if (isDisabled) {
129
+ // 如果字段被禁用勾选,根据显示状态来处理
130
+ visible = column.visible;
131
+ }
132
+ if (column.field && visible) {
133
+ allFields.push(column.field);
134
+ }
135
+ }
136
+ column.exportItemVisible = visible;
137
+ return visible;
138
+ };
139
+ column1s.forEach((column) => {
140
+ return handleColumnVisible(column);
141
+ });
142
+ columns = this.filterExportVisible(column1s);
143
+ } else {
144
+ columns = column1s;
145
+ }
82
146
 
83
147
  let exportItem = this.param.type === "exportItem";
84
148
 
85
- let allFields = [];
86
149
  let defaultCheckedKeys = [];
87
150
  let cols = [];
88
151
 
@@ -92,6 +155,7 @@ export default {
92
155
  let exportColumns = !exportItem
93
156
  ? target.exportColumns || []
94
157
  : target.exportItemColumns || [];
158
+ debugger;
95
159
 
96
160
  this.loopColumnHandle(exportColumns, (item) => {
97
161
  if (item.field) {
@@ -113,7 +177,6 @@ export default {
113
177
  } else if (!noFields.includes(column.field) && column.visible) {
114
178
  defaultCheckedKeys.push(column.id);
115
179
  }
116
- allFields.push(column.field);
117
180
  }
118
181
  });
119
182
  columns.forEach((column) => {
@@ -129,13 +192,13 @@ export default {
129
192
 
130
193
  this.loopColumnHandle(oriExportItemColumns, (item) => {
131
194
  item.id = this.generateId();
132
- if (item.field) {
195
+ if (item.field && allFields.includes(item.field)) {
133
196
  if (yesFields.includes(item.field)) {
134
197
  defaultCheckedKeys.push(item.id);
135
198
  } else if (!noFields.includes(item.field)) {
136
199
  defaultCheckedKeys.push(item.id);
137
200
  }
138
- allFields.push(item.field);
201
+ // allFields.push(item.field);
139
202
  }
140
203
  });
141
204
  oriExportItemColumns.forEach((column) => {
@@ -197,9 +260,8 @@ export default {
197
260
  });
198
261
  $grid.exportItemColumns = exportItemColumns;
199
262
  }
200
-
201
- this.$vxeTableUtil.addTableJson(originOption.vue, $grid, originOption.tableName);
202
263
  }
264
+ this.$vxeTableUtil.addTableJson(originOption.vue, $grid, originOption.tableName);
203
265
  },
204
266
  handleBeforeClose(hide) {
205
267
  // this.$emit('cancel');
@@ -825,6 +825,7 @@ function addTableJson(that, $grid, tableName, columns, success) {
825
825
  }
826
826
  let json = encodeURIComponent(JSON.stringify(jsonData));
827
827
 
828
+ debugger
828
829
  var url = USER_PREFIX + "/table_column/addTableJson";
829
830
  var data = {
830
831
  tableName: tableName,
@@ -0,0 +1,161 @@
1
+ <script>
2
+ import { UniverSheetsConditionalFormattingPreset } from "@univerjs/preset-sheets-conditional-formatting";
3
+ import sheetsConditionalFormattingZhCN from "@univerjs/preset-sheets-conditional-formatting/locales/zh-CN";
4
+ import { UniverSheetsCorePreset } from "@univerjs/preset-sheets-core";
5
+ import sheetsCoreZhCN from "@univerjs/preset-sheets-core/locales/zh-CN";
6
+ import { UniverSheetsDataValidationPreset } from "@univerjs/preset-sheets-data-validation";
7
+ import sheetsDataValidationZhCN from "@univerjs/preset-sheets-data-validation/locales/zh-CN";
8
+ import { UniverSheetsDrawingPreset } from "@univerjs/preset-sheets-drawing";
9
+ import sheetsDrawingZhCN from "@univerjs/preset-sheets-drawing/locales/zh-CN";
10
+ import { UniverSheetsFilterPreset } from "@univerjs/preset-sheets-filter";
11
+ import UniverPresetSheetsFilterZhCN from "@univerjs/preset-sheets-filter/locales/zh-CN";
12
+ import { UniverSheetsFindReplacePreset } from "@univerjs/preset-sheets-find-replace";
13
+ import UniverPresetSheetsFindReplaceZhCN from "@univerjs/preset-sheets-find-replace/locales/zh-CN";
14
+ import { UniverSheetsHyperLinkPreset } from "@univerjs/preset-sheets-hyper-link";
15
+ import sheetsHyperLinkZhCN from "@univerjs/preset-sheets-hyper-link/locales/zh-CN";
16
+ import { UniverSheetsSortPreset } from "@univerjs/preset-sheets-sort";
17
+ import SheetsSortZhCN from "@univerjs/preset-sheets-sort/locales/zh-CN";
18
+ import { UniverSheetsThreadCommentPreset } from "@univerjs/preset-sheets-thread-comment";
19
+ import UniverPresetSheetsThreadCommentZhCN from "@univerjs/preset-sheets-thread-comment/locales/zh-CN";
20
+ import { createUniver, LocaleType, mergeLocales } from "@univerjs/presets";
21
+ import { UniverSheetsCrosshairHighlightPlugin } from "@univerjs/sheets-crosshair-highlight";
22
+ import SheetsCrosshairHighlightZhCN from "@univerjs/sheets-crosshair-highlight/locale/zh-CN";
23
+ import { UniverSheetsZenEditorPlugin } from "@univerjs/sheets-zen-editor";
24
+ import SheetsZenEditorZhCN from "@univerjs/sheets-zen-editor/locale/zh-CN";
25
+ // import { UniverWatermarkPlugin } from "@univerjs/watermark";
26
+
27
+ // import { WORKBOOK_DATA } from "./data";
28
+
29
+ // import "./styles.css";
30
+ import "@univerjs/preset-sheets-core/lib/index.css";
31
+ import "@univerjs/preset-sheets-sort/lib/index.css";
32
+ import "@univerjs/preset-sheets-filter/lib/index.css";
33
+ import "@univerjs/preset-sheets-conditional-formatting/lib/index.css";
34
+ import "@univerjs/preset-sheets-data-validation/lib/index.css";
35
+ import "@univerjs/preset-sheets-drawing/lib/index.css";
36
+ import "@univerjs/preset-sheets-hyper-link/lib/index.css";
37
+ import "@univerjs/preset-sheets-find-replace/lib/index.css";
38
+ import "@univerjs/preset-sheets-thread-comment/lib/index.css";
39
+ import "@univerjs/sheets-zen-editor/lib/index.css";
40
+ import "@univerjs/sheets-crosshair-highlight/lib/index.css";
41
+
42
+ export default {
43
+ props: {
44
+ data: {
45
+ type: Object,
46
+ default: () => {},
47
+ },
48
+ },
49
+ data() {
50
+ return {
51
+ univerInstance: null,
52
+ univerAPIInstance: null,
53
+ workbook: null,
54
+ };
55
+ },
56
+ mounted() {
57
+ this.init();
58
+ },
59
+ beforeUnmount() {
60
+ this.univerInstance?.dispose();
61
+ this.univerAPIInstance?.dispose();
62
+ this.univerInstance = null;
63
+ this.univerAPIInstance = null;
64
+ },
65
+ methods: {
66
+ initStyle() {},
67
+ init() {
68
+ const { univer, univerAPI } = createUniver({
69
+ locale: LocaleType.ZH_CN,
70
+ locales: {
71
+ [LocaleType.ZH_CN]: mergeLocales(
72
+ sheetsCoreZhCN,
73
+ SheetsSortZhCN,
74
+ UniverPresetSheetsFilterZhCN,
75
+ sheetsConditionalFormattingZhCN,
76
+ sheetsDataValidationZhCN,
77
+ UniverPresetSheetsFindReplaceZhCN,
78
+ sheetsDrawingZhCN,
79
+ sheetsHyperLinkZhCN,
80
+ UniverPresetSheetsThreadCommentZhCN,
81
+ SheetsCrosshairHighlightZhCN,
82
+ SheetsZenEditorZhCN
83
+ ),
84
+ },
85
+ presets: [
86
+ UniverSheetsCorePreset({
87
+ container: this.$refs.container,
88
+ // zIndex: 3000,
89
+ }),
90
+ UniverSheetsFindReplacePreset(),
91
+ UniverSheetsSortPreset(),
92
+ UniverSheetsFilterPreset(),
93
+ UniverSheetsConditionalFormattingPreset(),
94
+ UniverSheetsDataValidationPreset(),
95
+ UniverSheetsDrawingPreset(),
96
+ UniverSheetsFilterPreset(),
97
+ UniverSheetsHyperLinkPreset(),
98
+ UniverSheetsThreadCommentPreset(),
99
+ ],
100
+ plugins: [
101
+ /* [
102
+ UniverWatermarkPlugin,
103
+ {
104
+ textWatermarkSettings: {
105
+ content: "Hello, Univer!",
106
+ fontSize: 16,
107
+ color: "rgb(0,0,0)",
108
+ bold: false,
109
+ italic: false,
110
+ direction: "ltr",
111
+ x: 60,
112
+ y: 36,
113
+ repeat: true,
114
+ spacingX: 200,
115
+ spacingY: 100,
116
+ rotate: 0,
117
+ opacity: 0.15,
118
+ },
119
+ },
120
+ ], */
121
+ UniverSheetsCrosshairHighlightPlugin,
122
+ UniverSheetsZenEditorPlugin,
123
+ ],
124
+ });
125
+
126
+ // univerAPI.createWorkbook(WORKBOOK_DATA);
127
+ this.workbook = univerAPI.createWorkbook(this.data);
128
+
129
+ this.univerInstance = univer;
130
+ this.univerAPIInstance = univerAPI;
131
+ },
132
+ getValue() {
133
+ const fWorkbook = this.univerAPIInstance.getActiveWorkbook();
134
+ const snapshot = fWorkbook.save();
135
+ return snapshot;
136
+ // return this.workbook.save();
137
+ },
138
+ },
139
+ };
140
+ </script>
141
+
142
+ <template>
143
+ <div id="univer" ref="container" />
144
+ </template>
145
+
146
+ <style scoped>
147
+ #univer {
148
+ height: 100%;
149
+ margin: 0;
150
+ padding: 0;
151
+ }
152
+ ::v-deep aside.univer-h-full {
153
+ padding-left: 0;
154
+ padding-right: 0;
155
+ }
156
+ </style>
157
+ <style>
158
+ div[data-radix-popper-content-wrapper] {
159
+ z-index: 999999 !important;
160
+ }
161
+ </style>
@@ -0,0 +1,184 @@
1
+ <template>
2
+ <el-dialog
3
+ :visible.sync="showDialog"
4
+ v-el-drag-dialog
5
+ v-el-dialog-center
6
+ v-bind="dialogConfig"
7
+ :fullscreen="true"
8
+ @close="close"
9
+ >
10
+ <div class="cont designer-view" v-bind="bodyConfig" id="containt">
11
+ <univer ref="univer" :data="option.data"></univer>
12
+ </div>
13
+ <span
14
+ slot="footer"
15
+ class="dialog-footer"
16
+ v-if="option.showFooter !== false"
17
+ v-bind="option.footerConfig"
18
+ >
19
+ <el-button type="primary" plain class="button-sty" @click="close">
20
+ <i class="el-icon-close el-icon"></i>
21
+ {{ $t2("取 消", "system.button.cancel2") }}
22
+ </el-button>
23
+ <el-button type="primary" @click="dialogSubmit" class="button-sty">
24
+ <i class="el-icon-check el-icon"></i>
25
+ {{ $t2("确 定", "system.button.confirm2") }}
26
+ </el-button>
27
+ </span>
28
+ </el-dialog>
29
+ </template>
30
+
31
+ <script>
32
+ import univer from "@base/components/univer";
33
+
34
+ export default {
35
+ // name: "vabSearchDialog",
36
+ components: { univer },
37
+ props: {
38
+ visiable: Boolean,
39
+ option: Object,
40
+ },
41
+ mixins: [],
42
+ inject: ["getFormConfig"],
43
+
44
+ mounted() {},
45
+ data() {
46
+ var that = this;
47
+ return {
48
+ showFormField: "_tt",
49
+ showDialog: true,
50
+ falseValue: false,
51
+ selectMulti: true,
52
+
53
+ formJson: {},
54
+ formData: {},
55
+ optionData: {},
56
+ showRender: false,
57
+ formTemplate: {},
58
+ /* formCode: null,*/
59
+ layoutType: null,
60
+ conditionParam: null,
61
+ formInsData: null,
62
+ $grid: null,
63
+ currentLayoutType: null,
64
+ dataId: null,
65
+ formConfig: {},
66
+ };
67
+ },
68
+ computed: {
69
+ formCode() {
70
+ return this.option.formCode;
71
+ },
72
+ dialogParam() {
73
+ return this.option?.param;
74
+ },
75
+ /* formConfig() {
76
+ return this.option?.formConfig;
77
+ }, */
78
+ dialogConfig() {
79
+ let customClass = "dialog-style list-dialog dialog-checkbox pd_0";
80
+ if (this.option.dialogConfig?.customClass) {
81
+ customClass = customClass + " " + this.option.dialogConfig.customClass;
82
+ }
83
+ let config = {
84
+ title: this.formTemplate.formName,
85
+ appendToBody: true,
86
+ modalAppendToBody: true,
87
+ // appendToBody: false,
88
+ // modalAppendToBody: false,
89
+ closeOnClickModal: false,
90
+ modal: false,
91
+ width: "1200px",
92
+ fullscreen: this.option.fullscreen,
93
+ };
94
+ config = Object.assign({}, config, this.option.dialogConfig, { customClass });
95
+ config.title = this.$t1(config.title);
96
+ return config;
97
+ },
98
+ bodyConfig() {
99
+ let config = {};
100
+ let classStr = this.currentLayoutType;
101
+ if (this.option.bodyConfig?.class) {
102
+ classStr = classStr + " " + this.option.bodyConfig.class;
103
+ }
104
+ if (this.option.showFooter == false) {
105
+ classStr = classStr + " nfootBtn";
106
+ }
107
+ config = Object.assign({}, config, this.option.bodyConfig, { class: classStr });
108
+ return config;
109
+ },
110
+ },
111
+ created() {
112
+ this.formConfig = this.option?.formConfig || {};
113
+
114
+ let currentFormConfig = this.getFormConfig();
115
+ this.currentLayoutType = currentFormConfig.layoutType;
116
+ },
117
+ methods: {
118
+ reload(e, option) {
119
+ let updateParam = option?.updateParam || {};
120
+ if (this.formConfig) Object.assign(this.formConfig, updateParam);
121
+ this.showRender = false;
122
+ },
123
+
124
+ close() {
125
+ let univerRef = this.$refs.univer;
126
+ this.showDialog = false;
127
+ this.$emit("update:visiable", false);
128
+ this.option.close && this.option.close(univerRef, this);
129
+ },
130
+ dialogSubmit() {
131
+ let univerRef = this.$refs.univer;
132
+ if (this.option.confirm) {
133
+ let excelJson = this.$refs.univer.getValue();
134
+ if (this.option.confirm(excelJson, univerRef, this) !== false) {
135
+ this.close();
136
+ }
137
+ } else {
138
+ this.close();
139
+ }
140
+ },
141
+ },
142
+ };
143
+ </script>
144
+
145
+ <style lang="scss" scoped>
146
+ ::v-deep .H5 .h5-fixed-bottom-btns {
147
+ bottom: 95px;
148
+ }
149
+
150
+ .list-dialog {
151
+ .el-dialog__body {
152
+ height: calc(100% - 42px);
153
+ .cont {
154
+ height: calc(100vh - 210px);
155
+
156
+ &.nfootBtn {
157
+ height: calc(100vh - 158px);
158
+ }
159
+ &#containt {
160
+ padding: 0;
161
+ ::v-deep .grid-container {
162
+ outline: none;
163
+ &.detail-wrap .d-cont {
164
+ height: calc(100vh - 150px);
165
+ .title .field-wrapper {
166
+ display: inline-block !important;
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+
174
+ &.is-fullscreen .el-dialog__body {
175
+ .cont {
176
+ height: calc(100vh - 110px);
177
+
178
+ &.nfootBtn {
179
+ height: calc(100vh - 58px);
180
+ }
181
+ }
182
+ }
183
+ }
184
+ </style>