cloud-web-corejs 1.0.54-dev.542 → 1.0.54-dev.543

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.
@@ -28,6 +28,23 @@ export const constantRoutes = [
28
28
  },
29
29
  hidden: true
30
30
  },
31
+ {
32
+ path: '/test_luckysheet',
33
+ component: () => import('@/views/test/HelloWorld.vue'),
34
+ meta: {
35
+ checkToken: false,
36
+ },
37
+ hidden: true
38
+ },
39
+ {
40
+ path: '/test_luckysheet2',
41
+ component: () => import('@/views/test/HelloWorld2.vue'),
42
+ meta: {
43
+ checkToken: false,
44
+ },
45
+ hidden: true
46
+ },
47
+
31
48
  {
32
49
  path: "",
33
50
  component: () => import("@/layout/index"),
@@ -1,57 +0,0 @@
1
- <template>
2
- <el-button
3
- @click="openUniverDialog"
4
- type="primary"
5
- class="button-sty"
6
- icon="el-icon-edit"
7
- >
8
- {{ !!value ? "已维护" : "" }}
9
- <univerDialog
10
- v-if="showDialog"
11
- :visiable.sync="showDialog"
12
- :data.sync="value"
13
- title="title"
14
- :readonly="readonly"
15
- @confirm="confirmUniverDialog"
16
- :univerConfig="univerConfig"
17
- ></univerDialog>
18
- </el-button>
19
- </template>
20
- <script>
21
- import univerDialog from "./dialog.vue";
22
- export default {
23
- name: "univerButton",
24
- props: {
25
- value: String,
26
- title: {
27
- type: String,
28
- default: "excel",
29
- },
30
- readonly: {
31
- type: Boolean,
32
- default: false,
33
- },
34
- univerConfig: {
35
- type: Object,
36
- default: () => {},
37
- },
38
- },
39
- components: {
40
- univerDialog,
41
- },
42
- data() {
43
- return {
44
- showDialog: false,
45
- };
46
- },
47
- methods: {
48
- openUniverDialog() {
49
- this.showDialog = true;
50
- },
51
- confirmUniverDialog(result) {
52
- this.$emit("input", result);
53
- this.$emit("change", result);
54
- },
55
- },
56
- };
57
- </script>
@@ -1,200 +0,0 @@
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 { createUniver, LocaleType, mergeLocales } from "@univerjs/presets";
19
- import { UniverSheetsCrosshairHighlightPlugin } from "@univerjs/sheets-crosshair-highlight";
20
- import SheetsCrosshairHighlightZhCN from "@univerjs/sheets-crosshair-highlight/locale/zh-CN";
21
- import { UniverSheetsZenEditorPlugin } from "@univerjs/sheets-zen-editor";
22
- import SheetsZenEditorZhCN from "@univerjs/sheets-zen-editor/locale/zh-CN";
23
- // import { UniverWatermarkPlugin } from "@univerjs/watermark";
24
-
25
- // import { WORKBOOK_DATA } from "./data";
26
-
27
- // import "./styles.css";
28
- import "@univerjs/preset-sheets-core/lib/index.css";
29
- import "@univerjs/preset-sheets-sort/lib/index.css";
30
- import "@univerjs/preset-sheets-filter/lib/index.css";
31
- import "@univerjs/preset-sheets-conditional-formatting/lib/index.css";
32
- import "@univerjs/preset-sheets-data-validation/lib/index.css";
33
- import "@univerjs/preset-sheets-hyper-link/lib/index.css";
34
- import "@univerjs/preset-sheets-find-replace/lib/index.css";
35
- import "@univerjs/sheets-zen-editor/lib/index.css";
36
- import "@univerjs/sheets-crosshair-highlight/lib/index.css";
37
- import "@univerjs/preset-sheets-drawing/lib/index.css";
38
-
39
- export default {
40
- name: "univerSheet",
41
- props: {
42
- data: {
43
- type: Object,
44
- default: () => {},
45
- },
46
- readonly: {
47
- type: Boolean,
48
- default: false,
49
- },
50
- options: {
51
- type: Object,
52
- default: () => {},
53
- },
54
- },
55
- data() {
56
- return {
57
- univerInstance: null,
58
- univerAPIInstance: null,
59
- workbook: null,
60
- };
61
- },
62
- mounted() {
63
- this.init();
64
- },
65
- beforeUnmount() {
66
- this.univerInstance?.dispose();
67
- this.univerAPIInstance?.dispose();
68
- this.univerInstance = null;
69
- this.univerAPIInstance = null;
70
- },
71
- methods: {
72
- initStyle() {},
73
- init() {
74
- // 基础国际化文件
75
- const localeFiles = [
76
- sheetsCoreZhCN,
77
- SheetsSortZhCN,
78
- UniverPresetSheetsFilterZhCN,
79
- sheetsConditionalFormattingZhCN,
80
- sheetsDataValidationZhCN,
81
- UniverPresetSheetsFindReplaceZhCN,
82
- sheetsHyperLinkZhCN,
83
- SheetsCrosshairHighlightZhCN,
84
- SheetsZenEditorZhCN,
85
- ];
86
-
87
- // 基础预设
88
- const presets = [
89
- UniverSheetsCorePreset({
90
- container: this.$refs.container,
91
- menu: {
92
- "sheet.contextMenu.permission": {
93
- hidden: true,
94
- },
95
- "sheet.command.add-range-protection-from-toolbar": {
96
- hidden: true,
97
- },
98
- },
99
- }),
100
- UniverSheetsFindReplacePreset(),
101
- UniverSheetsSortPreset(),
102
- UniverSheetsFilterPreset(),
103
- UniverSheetsConditionalFormattingPreset(),
104
- UniverSheetsDataValidationPreset(),
105
- UniverSheetsFilterPreset(),
106
- UniverSheetsHyperLinkPreset(),
107
- ];
108
-
109
- // 根据options.enableImage参数条件性添加图片相关功能
110
- if (this.options?.enableImage) {
111
- localeFiles.push(sheetsDrawingZhCN);
112
- presets.push(UniverSheetsDrawingPreset());
113
- }
114
-
115
- const { univer, univerAPI } = createUniver({
116
- locale: LocaleType.ZH_CN,
117
- locales: {
118
- [LocaleType.ZH_CN]: mergeLocales(...localeFiles),
119
- },
120
- presets,
121
- plugins: [
122
- /* [
123
- UniverWatermarkPlugin,
124
- {
125
- textWatermarkSettings: {
126
- content: "Hello, Univer!",
127
- fontSize: 16,
128
- color: "rgb(0,0,0)",
129
- bold: false,
130
- italic: false,
131
- direction: "ltr",
132
- x: 60,
133
- y: 36,
134
- repeat: true,
135
- spacingX: 200,
136
- spacingY: 100,
137
- rotate: 0,
138
- opacity: 0.15,
139
- },
140
- },
141
- ], */
142
- UniverSheetsCrosshairHighlightPlugin,
143
- UniverSheetsZenEditorPlugin,
144
- ],
145
- });
146
-
147
- // univerAPI.createWorkbook(WORKBOOK_DATA);
148
- this.workbook = univerAPI.createWorkbook(this.data);
149
-
150
- this.univerInstance = univer;
151
- this.univerAPIInstance = univerAPI;
152
-
153
- // 获取工作表
154
- const worksheets = this.workbook.getSheets();
155
-
156
- this.$nextTick(() => {
157
- const fWorkbook = univerAPI.getActiveWorkbook();
158
- const permission = fWorkbook.getWorkbookPermission();
159
- if (this.readonly) {
160
- // 设置为只读模式
161
- permission.setMode("viewer");
162
- permission.setPoint(univerAPI.Enum.WorkbookPermissionPoint.CopyContent, true);
163
- }
164
- });
165
- },
166
- async getValue() {
167
- const fWorkbook = this.univerAPIInstance.getActiveWorkbook();
168
- await fWorkbook.endEditingAsync(true);
169
- const snapshot = fWorkbook.save();
170
- return snapshot;
171
- },
172
- },
173
- };
174
- </script>
175
-
176
- <template>
177
- <div id="univer" ref="container" />
178
- </template>
179
-
180
- <style scoped>
181
- #univer {
182
- height: 100%;
183
- margin: 0;
184
- padding: 0;
185
- }
186
- ::v-deep aside.univer-h-full {
187
- padding-left: 0;
188
- padding-right: 0;
189
- }
190
- </style>
191
- <style>
192
- div[data-radix-popper-content-wrapper],
193
- .univer-popup.univer-popup-enter-done,
194
- .univer-menu-submenu,
195
- [data-u-comp="rect-popup"],
196
- .univer-grid,
197
- div[role="tooltip"] {
198
- z-index: 999999 !important;
199
- }
200
- </style>
@@ -1,200 +0,0 @@
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
- <univerSheet ref="univer" :data="json" v-if="showUniver"></univerSheet>
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 univerSheet from "@base/components/univer/univerSheet.vue";
33
- import { univerSheet } from "@base/components/univer/index.js";
34
-
35
- export default {
36
- // name: "vabSearchDialog",
37
- components: { univerSheet },
38
- props: {
39
- visiable: Boolean,
40
- option: Object,
41
- },
42
- mixins: [],
43
- inject: ["getFormConfig"],
44
-
45
- mounted() {
46
- this.init();
47
- },
48
- data() {
49
- var that = this;
50
- return {
51
- showFormField: "_tt",
52
- showDialog: true,
53
- falseValue: false,
54
- selectMulti: true,
55
-
56
- formJson: {},
57
- formData: {},
58
- optionData: {},
59
- showRender: false,
60
- formTemplate: {},
61
- /* formCode: null,*/
62
- layoutType: null,
63
- conditionParam: null,
64
- formInsData: null,
65
- $grid: null,
66
- currentLayoutType: null,
67
- dataId: null,
68
- formConfig: {},
69
- showUniver: true,
70
- json: {},
71
- };
72
- },
73
- computed: {
74
- formCode() {
75
- return this.option.formCode;
76
- },
77
- dialogParam() {
78
- return this.option?.param;
79
- },
80
- /* formConfig() {
81
- return this.option?.formConfig;
82
- }, */
83
- dialogConfig() {
84
- let customClass = "dialog-style list-dialog dialog-checkbox pd_0";
85
- if (this.option.dialogConfig?.customClass) {
86
- customClass = customClass + " " + this.option.dialogConfig.customClass;
87
- }
88
- let config = {
89
- title: this.formTemplate.formName,
90
- appendToBody: true,
91
- modalAppendToBody: true,
92
- // appendToBody: false,
93
- // modalAppendToBody: false,
94
- closeOnClickModal: false,
95
- modal: false,
96
- width: "1200px",
97
- fullscreen: this.option.fullscreen,
98
- };
99
- config = Object.assign({}, config, this.option.dialogConfig, { customClass });
100
- config.title = this.$t1(config.title);
101
- return config;
102
- },
103
- bodyConfig() {
104
- let config = {};
105
- let classStr = this.currentLayoutType;
106
- if (this.option.bodyConfig?.class) {
107
- classStr = classStr + " " + this.option.bodyConfig.class;
108
- }
109
- if (this.option.showFooter == false) {
110
- classStr = classStr + " nfootBtn";
111
- }
112
- config = Object.assign({}, config, this.option.bodyConfig, { class: classStr });
113
- return config;
114
- },
115
- },
116
- created() {
117
- this.formConfig = this.option?.formConfig || {};
118
-
119
- let currentFormConfig = this.getFormConfig();
120
- this.currentLayoutType = currentFormConfig.layoutType;
121
- },
122
- methods: {
123
- init() {
124
- if (this.option.data) {
125
- this.json = JSON.parse(this.option.data);
126
- }
127
- this.$nextTick(() => {
128
- this.showRender = true;
129
- });
130
- },
131
- reload(e, option) {
132
- let updateParam = option?.updateParam || {};
133
- if (this.formConfig) Object.assign(this.formConfig, updateParam);
134
- this.showRender = false;
135
- },
136
-
137
- close() {
138
- let univerRef = this.$refs.univer;
139
- this.showDialog = false;
140
- this.$emit("update:visiable", false);
141
- this.option.close && this.option.close(univerRef, this);
142
- },
143
- dialogSubmit() {
144
- let univerRef = this.$refs.univer;
145
- if (this.option.confirm) {
146
- let excelJson = this.$refs.univer.getValue();
147
- this.$refs.univer.getValue().then((value) => {
148
- let result = JSON.stringify(value);
149
- if (this.option.confirm(result, univerRef, this) !== false) {
150
- this.close();
151
- }
152
- });
153
- } else {
154
- this.close();
155
- }
156
- },
157
- },
158
- };
159
- </script>
160
-
161
- <style lang="scss" scoped>
162
- ::v-deep .H5 .h5-fixed-bottom-btns {
163
- bottom: 95px;
164
- }
165
-
166
- .list-dialog {
167
- .el-dialog__body {
168
- height: calc(100% - 42px);
169
- .cont {
170
- height: calc(100vh - 210px);
171
-
172
- &.nfootBtn {
173
- height: calc(100vh - 158px);
174
- }
175
- &#containt {
176
- padding: 0;
177
- ::v-deep .grid-container {
178
- outline: none;
179
- &.detail-wrap .d-cont {
180
- height: calc(100vh - 150px);
181
- .title .field-wrapper {
182
- display: inline-block !important;
183
- }
184
- }
185
- }
186
- }
187
- }
188
- }
189
-
190
- &.is-fullscreen .el-dialog__body {
191
- .cont {
192
- height: calc(100vh - 110px);
193
-
194
- &.nfootBtn {
195
- height: calc(100vh - 58px);
196
- }
197
- }
198
- }
199
- }
200
- </style>