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

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.
@@ -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>