cloud-web-corejs 1.0.54-dev.536 → 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.536",
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
  }
@@ -75,8 +75,14 @@
75
75
  if(this.designState || this.field.options.disabled)return
76
76
  let copyData = this.$baseLodash.cloneDeep(this.formModel);
77
77
 
78
- this.handleCustomEvent(this.field.options.copyDataHandle, ["copyData"], [copyData])
79
- this.getFormRef().openCopyEditTab(copyData);
78
+ const done = () => {
79
+ this.getFormRef().openCopyEditTab(copyData);
80
+ }
81
+ let result = this.handleCustomEvent(this.field.options.copyDataHandle, ["copyData",'done'], [copyData,done])
82
+ if(result === false){
83
+ return;
84
+ }
85
+ done();
80
86
  }
81
87
  }
82
88
 
@@ -2,8 +2,8 @@
2
2
  <static-content-wrapper :designer="designer" :field="field" :design-state="designState"
3
3
  :parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
4
4
  :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
5
- <div ref="fieldEditor" :style="!!field.options.fontSize ? `font-size: ${field.options.fontSize};`: ''">
6
- {{field.options.textContent}}</div>
5
+ <div ref="fieldEditor" :style="!!field.options.fontSize ? `font-size: ${field.options.fontSize};`: ''" :class="widgetClass">
6
+ <pre :style="{'white-space': !!field.options.preWrap ? 'pre-wrap' : 'pre', 'text-align': !!field.options.textAlign ? field.options.textAlign : 'left'}">{{field.options.textContent}}</pre></div>
7
7
  </static-content-wrapper>
8
8
  </template>
9
9
 
@@ -47,7 +47,12 @@
47
47
  StaticContentWrapper,
48
48
  },
49
49
  computed: {
50
-
50
+ widgetClass() {
51
+ let list = [];
52
+ let optionModel = this.field.options
53
+ if (optionModel.colorClass) list.push(optionModel.colorClass);
54
+ return list
55
+ }
51
56
  },
52
57
  beforeCreate() {
53
58
  /* 这里不能访问方法和属性!! */
@@ -25,7 +25,7 @@
25
25
  },
26
26
  data(){
27
27
  return {
28
- copyDataHandleParams: ["dataId", "formCode", "copyData"]
28
+ copyDataHandleParams: ["dataId", "formCode", "copyData", "done"]
29
29
  }
30
30
  },
31
31
  }
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <el-form-item :label="i18nt('designer.setting.preWrap')">
3
+ <el-switch v-model="optionModel.preWrap"></el-switch>
4
+ </el-form-item>
5
+ </template>
6
+
7
+ <script>
8
+ import i18n from "../../../../../../components/xform/utils/i18n"
9
+
10
+ export default {
11
+ name: "static-text-preWrap-editor",
12
+ mixins: [i18n],
13
+ props: {
14
+ designer: Object,
15
+ selectedWidget: Object,
16
+ optionModel: Object,
17
+ },
18
+ }
19
+ </script>
20
+
21
+ <style scoped>
22
+
23
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <el-form-item :label="i18nt('designer.setting.textContent')">
3
- <el-input v-model="optionModel.textContent"></el-input>
3
+ <el-input type="textarea" :rows="3" v-model="optionModel.textContent"></el-input>
4
4
  </el-form-item>
5
5
  </template>
6
6
 
@@ -83,6 +83,7 @@ const COMMON_PROPERTIES = {
83
83
  'copyButton': 'copyButton-editor',
84
84
  "tempStorageFlag": "tempStorage-editor",
85
85
  'formatType': 'formatType-editor',
86
+ 'preWrap': 'preWrap-editor',
86
87
 
87
88
  //容器
88
89
  'showBlankRow': 'showBlankRow-editor',
@@ -1722,6 +1722,8 @@ export const basicFields = [
1722
1722
  hidden: !1,
1723
1723
  textContent: "static text",
1724
1724
  fontSize: "13px",
1725
+ preWrap: true, //是否自动换行
1726
+ colorClass: "", //字体颜色
1725
1727
  customClass: "",
1726
1728
  onCreated: "",
1727
1729
  onMounted: "",