cloud-web-corejs 1.0.54-dev.537 → 1.0.54-dev.538

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.537",
4
+ "version": "1.0.54-dev.538",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -0,0 +1,57 @@
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
+ :disabled="disabled"
15
+ @confirm="confirmUniverDialog"
16
+ :options="options"
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
+ disabled: {
31
+ type: Boolean,
32
+ default: false,
33
+ },
34
+ options: {
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>
@@ -0,0 +1,123 @@
1
+ <template>
2
+ <el-dialog
3
+ :visible.sync="showDialog"
4
+ :fullscreen="true"
5
+ @close="close"
6
+ :appendToBody="true"
7
+ :modalAppendToBody="true"
8
+ :closeOnClickModal="false"
9
+ :modal="false"
10
+ :title="title"
11
+ custom-class="dialog-style list-dialog dialog-checkbox pd_0"
12
+ >
13
+ <div class="cont" id="containt">
14
+ <univer ref="univer" :data="json" v-if="showUniver" :options="options"></univer>
15
+ </div>
16
+ <span slot="footer" class="dialog-footer" v-if="!disabled">
17
+ <el-button type="primary" plain class="button-sty" @click="close">
18
+ <i class="el-icon-close el-icon"></i>
19
+ {{ $t2("取 消", "system.button.cancel2") }}
20
+ </el-button>
21
+ <el-button type="primary" @click="dialogSubmit" class="button-sty">
22
+ <i class="el-icon-check el-icon"></i>
23
+ {{ $t2("确 定", "system.button.confirm2") }}
24
+ </el-button>
25
+ </span>
26
+ </el-dialog>
27
+ </template>
28
+
29
+ <script>
30
+ import univer from "./univerSheet.vue";
31
+
32
+ export default {
33
+ name: "univerDialog",
34
+ components: { univer },
35
+ props: {
36
+ visiable: Boolean,
37
+ data: String,
38
+ title: {
39
+ type: String,
40
+ default: "excel",
41
+ },
42
+ disabled: {
43
+ type: Boolean,
44
+ default: false,
45
+ },
46
+ options: {
47
+ type: Object,
48
+ default: () => {},
49
+ },
50
+ },
51
+ mounted() {},
52
+ data() {
53
+ return {
54
+ showDialog: true,
55
+ json: {},
56
+ showUniver: false,
57
+ };
58
+ },
59
+ computed: {},
60
+ created() {
61
+ this.init();
62
+ },
63
+ methods: {
64
+ init() {
65
+ if (this.data) {
66
+ this.json = JSON.parse(this.data);
67
+ }
68
+ this.$nextTick(() => {
69
+ this.showUniver = true;
70
+ });
71
+ },
72
+ close() {
73
+ this.showDialog = false;
74
+ this.$emit("update:visiable", false);
75
+ },
76
+ dialogSubmit() {
77
+ let univerRef = this.$refs.univer;
78
+ this.$refs.univer.getValue().then((value) => {
79
+ let result = JSON.stringify(value);
80
+ this.$emit("confirm", result);
81
+ this.close();
82
+ });
83
+ },
84
+ },
85
+ };
86
+ </script>
87
+
88
+ <style lang="scss" scoped>
89
+ .list-dialog {
90
+ .el-dialog__body {
91
+ height: calc(100% - 42px);
92
+ .cont {
93
+ height: calc(100vh - 210px);
94
+
95
+ &.nfootBtn {
96
+ height: calc(100vh - 158px);
97
+ }
98
+ &#containt {
99
+ padding: 0;
100
+ ::v-deep .grid-container {
101
+ outline: none;
102
+ &.detail-wrap .d-cont {
103
+ height: calc(100vh - 150px);
104
+ .title .field-wrapper {
105
+ display: inline-block !important;
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
112
+
113
+ &.is-fullscreen .el-dialog__body {
114
+ .cont {
115
+ height: calc(100vh - 110px);
116
+
117
+ &.nfootBtn {
118
+ height: calc(100vh - 58px);
119
+ }
120
+ }
121
+ }
122
+ }
123
+ </style>
@@ -0,0 +1,3 @@
1
+ export { default as univerSheet } from "./univerSheet.vue";
2
+ export { default as asuniverDialog } from "./dialog.vue";
3
+ export { default as asuniverButton } from "./button.vue";
@@ -40,11 +40,16 @@ import "@univerjs/sheets-zen-editor/lib/index.css";
40
40
  import "@univerjs/sheets-crosshair-highlight/lib/index.css";
41
41
 
42
42
  export default {
43
+ name: "univerSheet",
43
44
  props: {
44
45
  data: {
45
46
  type: Object,
46
47
  default: () => {},
47
48
  },
49
+ options: {
50
+ type: Object,
51
+ default: () => {},
52
+ },
48
53
  },
49
54
  data() {
50
55
  return {
@@ -129,8 +134,9 @@ export default {
129
134
  this.univerInstance = univer;
130
135
  this.univerAPIInstance = univerAPI;
131
136
  },
132
- getValue() {
137
+ async getValue() {
133
138
  const fWorkbook = this.univerAPIInstance.getActiveWorkbook();
139
+ await fWorkbook.endEditingAsync(true);
134
140
  const snapshot = fWorkbook.save();
135
141
  return snapshot;
136
142
  // return this.workbook.save();
@@ -8,7 +8,7 @@
8
8
  @close="close"
9
9
  >
10
10
  <div class="cont designer-view" v-bind="bodyConfig" id="containt">
11
- <univer ref="univer" :data="option.data"></univer>
11
+ <univerSheet ref="univer" :data="json" v-if="showUniver"></univerSheet>
12
12
  </div>
13
13
  <span
14
14
  slot="footer"
@@ -29,11 +29,12 @@
29
29
  </template>
30
30
 
31
31
  <script>
32
- import univer from "@base/components/univer";
32
+ // import univerSheet from "@base/components/univer/univerSheet.vue";
33
+ import { univerSheet } from "@base/components/univer/index.js";
33
34
 
34
35
  export default {
35
36
  // name: "vabSearchDialog",
36
- components: { univer },
37
+ components: { univerSheet },
37
38
  props: {
38
39
  visiable: Boolean,
39
40
  option: Object,
@@ -41,7 +42,9 @@ export default {
41
42
  mixins: [],
42
43
  inject: ["getFormConfig"],
43
44
 
44
- mounted() {},
45
+ mounted() {
46
+ this.init();
47
+ },
45
48
  data() {
46
49
  var that = this;
47
50
  return {
@@ -63,6 +66,8 @@ export default {
63
66
  currentLayoutType: null,
64
67
  dataId: null,
65
68
  formConfig: {},
69
+ showUniver: true,
70
+ json: {},
66
71
  };
67
72
  },
68
73
  computed: {
@@ -115,6 +120,14 @@ export default {
115
120
  this.currentLayoutType = currentFormConfig.layoutType;
116
121
  },
117
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
+ },
118
131
  reload(e, option) {
119
132
  let updateParam = option?.updateParam || {};
120
133
  if (this.formConfig) Object.assign(this.formConfig, updateParam);
@@ -131,9 +144,12 @@ export default {
131
144
  let univerRef = this.$refs.univer;
132
145
  if (this.option.confirm) {
133
146
  let excelJson = this.$refs.univer.getValue();
134
- if (this.option.confirm(excelJson, univerRef, this) !== false) {
135
- this.close();
136
- }
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
+ });
137
153
  } else {
138
154
  this.close();
139
155
  }
@@ -98,14 +98,13 @@
98
98
  :option="baseFormulaDialogOption"
99
99
  ></baseFormulaDialog>
100
100
  <template v-if="showQrCanvas">
101
- <canvas
102
- ref="qrCanvas"
103
- v-show="false"
104
- :width="qrWidth"
105
- :height="qrHeight"
106
- ></canvas>
101
+ <canvas ref="qrCanvas" v-show="false" :width="qrWidth" :height="qrHeight"></canvas>
107
102
  </template>
108
- <univerDialog v-if="showUniverDialog" :visiable.sync="showUniverDialog" :option="univerDialogOption"></univerDialog>
103
+ <univerDialog
104
+ v-if="showUniverDialog"
105
+ :visiable.sync="showUniverDialog"
106
+ :option="univerDialogOption"
107
+ ></univerDialog>
109
108
  </div>
110
109
  </template>
111
110
 
@@ -114,6 +113,7 @@
114
113
  import "./container-item/index";
115
114
  import FieldComponents from "../../../components/xform/form-designer/form-widget/field-widget/index";
116
115
  import indexMixin from "../../../components/xform/form-render/indexMixin";
116
+ import univerDialog from "../../../components/xform/form-designer/form-widget/dialog/univerDialog.vue";
117
117
 
118
118
  export default {
119
119
  name: "VFormRender",
@@ -135,8 +135,11 @@ export default {
135
135
  import(
136
136
  "../../../components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue"
137
137
  ),
138
- univerDialog: () =>
139
- import("../../../components/xform/form-designer/form-widget/dialog/univerDialog.vue"),
138
+ univerDialog,
139
+ /* univerDialog: () =>
140
+ import(
141
+ "../../../components/xform/form-designer/form-widget/dialog/univerDialog.vue"
142
+ ), */
140
143
  },
141
144
  mixins: [indexMixin],
142
145
  };
@@ -80,6 +80,16 @@ export const constantRoutes = [
80
80
  },
81
81
  },
82
82
 
83
+ {
84
+ path: "/test_univer2",
85
+ component: () =>
86
+ import("@/views/test/test_univer2.vue"),
87
+ name: "test_univer2",
88
+ meta: {
89
+ title: "测试excel",
90
+ },
91
+ },
92
+
83
93
  // {
84
94
  // path: "/test_table",
85
95
  // component: () =>