centaline-data-driven-v3 0.1.37 → 0.1.39

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,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven-v3",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -25,6 +25,7 @@
25
25
  "vue-cropper": "^1.1.1",
26
26
  "vue-router": "^4.2.5",
27
27
  "vue-ueditor-wrap": "^3.0.8",
28
+ "vue3-json-viewer": "^2.4.1",
28
29
  "vue3-pdf-app": "^1.0.3",
29
30
  "vuedraggable": "^4.1.0"
30
31
  },
@@ -21,7 +21,7 @@
21
21
  <template #tag>
22
22
  <template v-for="(v, i) in model.labelValue" :key="i">
23
23
  <el-tag class="ml-2" type="info" disable-transitions :closable="!v.locked && !model.locked"
24
- :style="{ marginRight: i+1==model.labelValue.length ? '20px' : '' }"
24
+ :style="{ marginRight: i + 1 == model.labelValue.length ? '20px' : '' }"
25
25
  @close="closeTag(v.code)">
26
26
  {{ v.name }}</el-tag>
27
27
  </template>
@@ -62,6 +62,7 @@ const refselect = ref()
62
62
  const open = ref(false)
63
63
  const isComposing = ref(false);
64
64
  const nodatatext = ref(' ')
65
+ const popperWidth = ref(null)
65
66
  model.value.itemKey = Math.random();
66
67
  let cancelTokenSource = null; // 用于存储取消令牌
67
68
 
@@ -77,6 +78,7 @@ onBeforeUnmount(() => {
77
78
 
78
79
  //下拉框出现/隐藏时触发
79
80
  function visibleChange(visible) {
81
+
80
82
  //是否有更多选择路由
81
83
  if (model.value.moreActionRouter) {
82
84
  refselect.value.popperRef.hidden = true
@@ -84,6 +86,9 @@ function visibleChange(visible) {
84
86
  else {
85
87
  //出现获取数据
86
88
  if (visible) {
89
+ if (refselect.value && popperWidth.value) {
90
+ refselect.value.popperSize = popperWidth.value;
91
+ }
87
92
  open.value = true;
88
93
  nodatatext.value = common.LocalizedString('加载中', '加載中');
89
94
  if (!model.value.filterable) {
@@ -256,9 +261,11 @@ function setminWidth() {
256
261
 
257
262
  if ((span.getBoundingClientRect().width + 40) <= refselect.value.selectRef.offsetWidth) {
258
263
  refselect.value.popperSize = refselect.value.selectRef.offsetWidth;
264
+ popperWidth.value = refselect.value.selectRef.offsetWidth;
259
265
  }
260
266
  else {
261
267
  refselect.value.popperSize = span.getBoundingClientRect().width + 40;
268
+ popperWidth.value = span.getBoundingClientRect().width + 40;
262
269
  }
263
270
 
264
271
  document.body.removeChild(span);
@@ -12,10 +12,10 @@
12
12
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
13
13
  <div v-if="col.show !== false"
14
14
  :class="index > 0 && (col.controlLabel == '' || col.is == 'ct-button') ? 'complex-left-10' : ''"
15
- :style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : ''), 'flex': (col.width && col.width>0? '0 0 ' + col.width + 'px' : '') }">
15
+ :style="{ 'width': (col.width && col.width > 0 ? col.width + 'px' : ''), 'flex': (col.width && col.width > 0 ? '0 0 ' + col.width + 'px' : '') }">
16
16
  <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
17
- v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
18
- @popupSearchList="popupSearchListHandler"></component>
17
+ :key="col.fieldItemKey" v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)"
18
+ @change="change(col)" @popupSearchList="popupSearchListHandler"></component>
19
19
  </div>
20
20
  </template>
21
21
  </template>
@@ -28,10 +28,10 @@
28
28
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed"></div>
29
29
  <el-col v-if="col.show !== false"
30
30
  :class="[index > 0 && (col.controlLabel == '' || col.is == 'ct-btn') ? 'complex-left-10' : '', 'containerCol']"
31
- :style="{ 'width': (col.width && col.width>0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width>0 ? '0 0 ' + col.width + 'px' : '100%') }">
31
+ :style="{ 'width': (col.width && col.width > 0 ? col.width + 'px' : '100%'), 'flex': (col.width && col.width > 0 ? '0 0 ' + col.width + 'px' : '100%') }">
32
32
  <component ref="Fields" :is="col.is" :vmodel="col" :parameterAction="parameterAction"
33
- v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)" @change="change(col)"
34
- @popupSearchList="popupSearchListHandler">
33
+ :key="col.fieldItemKey" v-bind="col.bindPara" @fieldClick="fieldClickHandler(col)"
34
+ @change="change(col)" @popupSearchList="popupSearchListHandler">
35
35
  </component>
36
36
  </el-col>
37
37
  </template>
@@ -1,25 +1,31 @@
1
1
  <template>
2
- <div ref="refForm" v-loading="loading" :style="{width:pageWidth?pageWidth+'px':'100%',margin:'auto','min-height': minHeight}">
2
+ <div ref="refForm" v-loading="loading"
3
+ :style="{ width: pageWidth ? pageWidth + 'px' : '100%', margin: 'auto', 'min-height': minHeight }">
3
4
  <div style="display: flex; width: 100%;">
4
5
  <div style="flex: 1; min-width: 0;">
5
6
  <div v-if="model !== null && !loading" class="ct-form">
6
7
  <el-affix target=".ct-form" v-if="model.tip" :offset="62">
7
- <div class="ct-form-tip">
8
+ <div class="ct-form-tip" ref="refTip">
8
9
  <span v-html="model.tip"></span>
9
10
  </div>
10
11
  </el-affix>
11
12
 
12
13
  <!--可根据场景判断显示el-card还是el-main-->
13
- <component :is="model.showTitle ? 'el-main' : 'el-card'">
14
+ <component :is="model.showTitle ? 'el-main' : 'el-card'" :key="itemKey">
15
+ <!-- <div class="ct-from-title" v-if="typeof model.title !== 'undefined' && model.flagShowTitle">
16
+ <span style="font-weight:bold">{{ model.title }}</span>
17
+ </div> -->
18
+
14
19
  <!--relationParentFormFields-->
15
20
  <el-row v-if="relationParentFormFields.length > 0">
16
21
  <template v-for="(col, index) in relationParentFormFields" :key="index">
17
22
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
18
23
  </div>
19
- <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
20
- <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
21
- :parameterAction="model.parameterAction" v-bind="col.bindPara"
22
- :fileData="getFileData(col)" @change="changeHandler"
24
+ <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px"
25
+ :class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
26
+ <component ref="Fields" :is="col.is" :vmodel="col" :key="col.fieldItemKey"
27
+ :listHeight="listHeight" :parameterAction="model.parameterAction"
28
+ v-bind="col.bindPara" :fileData="getFileData(col)" @change="changeHandler"
23
29
  @importComplete="importComplete" @popupLocation="popupLocationHandler"
24
30
  @fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
25
31
  @tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
@@ -34,10 +40,11 @@
34
40
  <template v-for="(col, index) in model.collapseFields[0]" :key="index">
35
41
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
36
42
  </div>
37
- <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
38
- <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
39
- :parameterAction="model.parameterAction" v-bind="col.bindPara"
40
- :fileData="getFileData(col)" @change="changeHandler"
43
+ <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px"
44
+ :class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
45
+ <component ref="Fields" :is="col.is" :vmodel="col" :key="col.fieldItemKey"
46
+ :listHeight="listHeight" :parameterAction="model.parameterAction"
47
+ v-bind="col.bindPara" :fileData="getFileData(col)" @change="changeHandler"
41
48
  @importComplete="importComplete" @popupLocation="popupLocationHandler"
42
49
  @fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
43
50
  @tableButtonClick="clickHandler" @popupGroupList="popupGroupListHandler"
@@ -47,36 +54,43 @@
47
54
  </template>
48
55
  </el-row>
49
56
  <!--tabs-->
50
- <el-tabs v-if="model.isHorizontalLayout" v-model="activeName">
57
+ <template v-if="model.isHorizontalLayout">
58
+ <component :is="model.flagFixedTabOnHorizontalLayout ? 'el-affix' : 'div'"
59
+ v-bind="model.flagFixedTabOnHorizontalLayout ? { offset: tabTopHight, target: '.ct-form' } : {}">
60
+ <el-tabs v-model="activeName" @tab-click="tabClick" style="background: #fff;">
61
+ <template v-for="(item, index) in model.collapse" :key="index">
62
+ <el-tab-pane :name="index.toString()" :lazy="item.lazyLoad"
63
+ v-if="item.show !== false" :key="index">
64
+ <template #label>
65
+ <span v-html="item.controlLabel"></span>
66
+ </template>
67
+ </el-tab-pane>
68
+ </template>
69
+ </el-tabs>
70
+ </component>
51
71
  <template v-for="(item, index) in model.collapse" :key="index">
52
- <el-tab-pane :name="index.toString()" :lazy="item.lazyLoad"
53
- v-if="item.show !== false" :key="index">
54
- <template #label>
55
- <span v-html="item.controlLabel"></span>
72
+ <el-row v-show="activeName === index.toString()">
73
+ <template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
74
+ <div style="display: flex; flex: 0 0 100%;"
75
+ v-if="col.show !== false && col.lineFeed"></div>
76
+ <el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px"
77
+ :class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
78
+ <component ref="Fields" :is="col.is" :vmodel="col" :key="col.fieldItemKey"
79
+ :listHeight="listHeight" :parameterAction="model.parameterAction"
80
+ v-bind="col.bindPara" :fileData="getFileData(col)"
81
+ @change="changeHandler" @fieldClick="fieldClickHandler"
82
+ @popupLocation="popupLocationHandler"
83
+ @popupSearchList="popupSearchListHandler"
84
+ @importComplete="importComplete" @popupGroupList="popupGroupListHandler"
85
+ @tableButtonClick="clickHandler"
86
+ @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
87
+ </component>
88
+ </el-col>
56
89
  </template>
57
- <el-row>
58
- <template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
59
- <div style="display: flex; flex: 0 0 100%;"
60
- v-if="col.show !== false && col.lineFeed"></div>
61
- <el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
62
- <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
63
- :parameterAction="model.parameterAction" v-bind="col.bindPara"
64
- :fileData="getFileData(col)" @change="changeHandler"
65
- @fieldClick="fieldClickHandler"
66
- @popupLocation="popupLocationHandler"
67
- @popupSearchList="popupSearchListHandler"
68
- @importComplete="importComplete"
69
- @popupGroupList="popupGroupListHandler"
70
- @tableButtonClick="clickHandler"
71
- @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged">
72
- </component>
73
- </el-col>
74
- </template>
75
- </el-row>
76
- </el-tab-pane>
90
+ </el-row>
77
91
  </template>
78
- </el-tabs>
79
-
92
+ <div style="height: 34px;"> </div>
93
+ </template>
80
94
  <!--分组-->
81
95
  <el-collapse v-else v-model="model.collapseActiveNames"
82
96
  :class="model.flagHideSaveLine ? 'el-collapse-saveLine' : ''">
@@ -86,7 +100,7 @@
86
100
  <template #title>
87
101
  <i class="sign"></i>
88
102
  <span :class="[item.required ? 'requiredLabel' : '']">{{ item.controlLabel
89
- }}</span>
103
+ }}</span>
90
104
  <span v-html="item.sufLabel1"></span>
91
105
  </template>
92
106
 
@@ -94,11 +108,12 @@
94
108
  <template v-for="(col, i) in model.collapseFields[index + 1]" :key="i">
95
109
  <div style="display: flex; flex: 0 0 100%;"
96
110
  v-if="col.show !== false && col.lineFeed"></div>
97
- <el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
98
- <component ref="Fields" :is="col.is" :vmodel="col" :key="itemKey"
99
- :parameterAction="model.parameterAction" v-bind="col.bindPara"
100
- :fileData="getFileData(col)" @change="changeHandler"
101
- @fieldClick="fieldClickHandler"
111
+ <el-col :span="col.colspan" v-if="col.show !== false" style="padding:5px"
112
+ :class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
113
+ <component ref="Fields" :is="col.is" :vmodel="col" :key="col.fieldItemKey"
114
+ :listHeight="listHeight" :parameterAction="model.parameterAction"
115
+ v-bind="col.bindPara" :fileData="getFileData(col)"
116
+ @change="changeHandler" @fieldClick="fieldClickHandler"
102
117
  @popupLocation="popupLocationHandler"
103
118
  @popupSearchList="popupSearchListHandler"
104
119
  @importComplete="importComplete"
@@ -117,10 +132,11 @@
117
132
  <template v-for="(col, index) in model.independentItem" :key="index">
118
133
  <div style="display: flex; flex: 0 0 100%;" v-if="col.show !== false && col.lineFeed">
119
134
  </div>
120
- <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px" :class="[col.is=='ct-button'&&col.labelPlacement=='1' ? 'el-col1' : '']">
121
- <component ref="Fields" :is="col.is" :vmodel="col"
135
+ <el-col v-if="col.show !== false" :span="col.colspan" style="padding:5px"
136
+ :class="[col.is == 'ct-button' && col.labelPlacement == '1' ? 'el-col1' : '']">
137
+ <component ref="Fields" :is="col.is" :vmodel="col" :listHeight="listHeight"
122
138
  :parameterAction="model.parameterAction" v-bind="col.bindPara"
123
- @change="changeHandler" :key="itemKey" :fileData="getFileData(col)"
139
+ @change="changeHandler" :key="col.fieldItemKey" :fileData="getFileData(col)"
124
140
  @fieldClick="fieldClickHandler" @popupSearchList="popupSearchListHandler"
125
141
  @importComplete="importComplete" @tableButtonClick="clickHandler"
126
142
  @popupGroupList="popupGroupListHandler" @popupLocation="popupLocationHandler"
@@ -130,7 +146,7 @@
130
146
  </template>
131
147
  </el-row>
132
148
  <el-row v-if="model.links.findIndex((v) => { return v.show }) > -1" style="margin-top: 8px;">
133
- <el-col :span="24" style="text-align:left" >
149
+ <el-col :span="24" style="text-align:left">
134
150
  <template v-for="(btn, index) in model.links" :key="index">
135
151
  <component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler">
136
152
  </component>
@@ -138,12 +154,11 @@
138
154
 
139
155
  </el-col>
140
156
  </el-row>
141
- <el-row v-if="model.buttons.findIndex((v) => { return v.show }) > -1"
142
- :class="isScroll ? 'button-absolute' : 'button-initial'"
157
+ <el-row v-if="model.buttons.findIndex((v) => { return v.show }) > -1" class="button-absolute"
143
158
  :style="['max-width:' + buttonsWidth(), isWebScroll ? 'position: fixed;' : '']">
144
159
  <el-col :span="24"
145
160
  style="text-align:center;padding-bottom: 1px;padding-left: 5px;padding-right: 5px;"
146
- class="btnPadBom" >
161
+ class="btnPadBom">
147
162
  <template v-for="(btn, index) in model.buttons" :key="index">
148
163
  <component :is="btn.is" :vmodel="btn" v-if="btn.show" @fieldClick="clickHandler"
149
164
  :style="{ 'float': btn.isCheckbox ? btn.alignCss : '' }"></component>
@@ -154,6 +169,12 @@
154
169
  <div v-if="isScroll && model.buttons.findIndex((v) => { return v.show }) > -1"
155
170
  style="height: 34px;">
156
171
  </div>
172
+ <el-affix target=".ct-form" position="bottom" v-if="model.bottomTip"
173
+ :offset="model.buttons.findIndex((v) => { return v.show }) > -1 ? 43 : 0">
174
+ <div class="ct-form-tip">
175
+ <span v-html="model.bottomTip"></span>
176
+ </div>
177
+ </el-affix>
157
178
  </component>
158
179
  </div>
159
180
 
@@ -196,7 +217,6 @@ import { useRouter } from 'vue-router';
196
217
  import util from '../../utils/pub-use'
197
218
  import Enum from '../../utils/Enum';
198
219
  import AIChat from '../web/AIChat.vue';
199
- import { fi } from 'element-plus/es/locale';
200
220
  const emit = defineEmits(['loaded', 'failLoad', 'submit', 'AIToggle'])
201
221
  const props = defineProps({
202
222
  api: String,
@@ -230,6 +250,10 @@ const props = defineProps({
230
250
  String,
231
251
  default: 'close',
232
252
  },
253
+ pageStyle: {
254
+ String,
255
+ default: '',
256
+ },
233
257
  openType: {
234
258
  String,
235
259
  default: '',
@@ -246,6 +270,7 @@ const props = defineProps({
246
270
  },
247
271
  dialogHeight: Number,
248
272
  dialoWidth: Number,
273
+ listHeight: Number,
249
274
  })
250
275
 
251
276
  const itemKey = ref(1)
@@ -261,6 +286,9 @@ const downloadUrl = ref('')
261
286
  const minHeight = ref('auto')
262
287
  const showAI = ref(false);
263
288
  const dialogHeight = ref(props.dialogHeight || (window.innerHeight - 60));
289
+ const tabActiveNameKey = ref('')
290
+ const refTip = ref()
291
+ const tabTopHight = ref(52)
264
292
 
265
293
  const qrtimer1 = ref(null)
266
294
  const qrtimer2 = ref(null)
@@ -336,6 +364,26 @@ function load(data) {
336
364
  });
337
365
  }
338
366
  loading.value = false;
367
+
368
+ if (props.openType == 'detail') {
369
+ tabActiveNameKey.value = props.api + model.value.title + props.pageStyle;
370
+ var tagkey = window.localStorage.getItem(tabActiveNameKey.value);
371
+ if (window.localStorage) {
372
+ if (model.value.collapseFields && model.value.collapse) {
373
+ for (var i = 0; i < model.value.collapse.length; i++) {
374
+ if (tagkey == model.value.collapse[i].fieldName1) {
375
+ activeName.value = i.toString();
376
+ }
377
+ }
378
+ }
379
+
380
+ }
381
+ }
382
+ nextTick(() => {
383
+ if (refTip.value) {
384
+ tabTopHight.value = tabTopHight.value + refTip.value.clientHeight + 10
385
+ }
386
+ })
339
387
  //通知父组件加载完成
340
388
  emit('loaded', model.value);
341
389
  }
@@ -378,9 +426,9 @@ function fieldClickHandler(field) {
378
426
  let data = Form.getRouterAndSubmitData(field, model.value);
379
427
  clickHandler(data.router, data.submitData);
380
428
  }
381
- function clickHandler(field, submitData,formList) {
429
+ function clickHandler(field, submitData, formList) {
382
430
  if (field.isOpenFileDialog) {
383
- common.excuteFunStr.call(model.value.scripts, field.onChanged, {files: field.fileList,columns: formList?.source?.rows[0].columns });
431
+ common.excuteFunStr.call(model.value.scripts, field.onChanged, { files: field.fileList, columns: formList?.source?.rows[0].columns });
384
432
  }
385
433
  else {
386
434
  RouterClickHandler(field, submitData, null, model.value, 'form');
@@ -655,6 +703,12 @@ function setCss() {
655
703
  if (props.topHeight > -1) {
656
704
  minHeight.value = (document.documentElement.clientHeight - props.topHeight - 20) + 'px';
657
705
  }
706
+ else if(props.dialogHeight){
707
+ minHeight.value = (props.dialogHeight) + 'px';
708
+ }
709
+ else{
710
+ minHeight.value = document.documentElement.clientHeight + 'px';
711
+ }
658
712
  }
659
713
 
660
714
 
@@ -678,6 +732,12 @@ function buttonsWidth() {
678
732
  return rtn;
679
733
  }
680
734
 
735
+ function tabClick(event) {
736
+ if (props.openType == 'detail') {
737
+ window.localStorage.setItem(tabActiveNameKey.value, model.value.collapse[event.index].fieldName1);//存储
738
+ }
739
+ }
740
+
681
741
  </script>
682
742
 
683
743
  <style scoped>
@@ -0,0 +1,123 @@
1
+ <template>
2
+ <div class="josnViewerBox" ref="jsonContent" tabindex="-1"
3
+ :style="{ height: model.height || 'auto', 'max-height': ('calc(100vh - '+topDistance+'px)') }"
4
+ v-if="isRefresh">
5
+ <JsonViewer :value="model.json" copyable show-array-index show-double-quotes theme="light" :expanded="true"
6
+ :expand-depth="2" @onKeyClick="keyClick">
7
+ <template #copy="{ copied }">
8
+ <div class="btn-iocn"><el-icon title="复原到初始状态" @click.stop="resetJSON">
9
+ <Refresh />
10
+ </el-icon>
11
+
12
+ <!-- 复制按钮 -->
13
+ <el-icon :class="{ 'copied': copied }" title="复制JSON内容">
14
+ <CopyDocument />
15
+ </el-icon>
16
+ </div>
17
+ </template>
18
+ </JsonViewer>
19
+ </div>
20
+ </template>
21
+
22
+ <script setup>
23
+ import { JsonViewer } from "vue3-json-viewer"
24
+ import "vue3-json-viewer/dist/vue3-json-viewer.css";
25
+ import { useDistanceCalculator } from '../../utils/distance-utils.js';
26
+
27
+ import { nextTick, ref, onMounted ,inject} from "vue";
28
+ const props = defineProps({
29
+ api: String,
30
+ vmodel: Object,
31
+ actionRouter: Array,
32
+ listHeight: Number,
33
+ })
34
+
35
+ const jsonContent = ref(null);
36
+
37
+ const model = ref({});
38
+ const isRefresh = ref(true);
39
+ const topDistance = ref(0);
40
+ const { getAllDistances } = useDistanceCalculator(jsonContent);
41
+
42
+
43
+
44
+
45
+ // 在组件挂载后或需要时调用
46
+ onMounted(() => {
47
+ nextTick(() => {
48
+ setTimeout(() => {
49
+ topDistance.value = getAllDistances()?.elementInfo?.top+40;
50
+ }, 100);
51
+ });
52
+
53
+ });
54
+
55
+ init()
56
+ //初始化数据
57
+ function init() {
58
+
59
+ nextTick(function () {
60
+ if (props.vmodel) {
61
+ load(props.vmodel);
62
+ }
63
+ });
64
+ }
65
+ function load(data) {
66
+ model.value = data;
67
+ }
68
+ const resetJSON = () => {
69
+ isRefresh.value = false;
70
+ nextTick(() => {
71
+ isRefresh.value = true;
72
+ });
73
+ };
74
+
75
+
76
+
77
+ const keyClick = (keyName) => {
78
+ console.log(keyName, "it was click")
79
+ }
80
+ </script>
81
+
82
+ <style scoped>
83
+ :deep(.jv-container .jv-code) {
84
+ padding: 0px !important;
85
+ }
86
+
87
+ :deep(.jv-tooltip) {
88
+ position: sticky !important;
89
+ top: 0 !important;
90
+ right: 0 !important;
91
+ /* 新增:靠右定位 */
92
+ z-index: 10;
93
+ margin-left: auto;
94
+ /* 辅助:确保靠右 */
95
+ float: right;
96
+
97
+ }
98
+
99
+
100
+
101
+ .josnViewerBox {
102
+ overflow: auto;
103
+ width: 100%;
104
+ border: 1px solid #eee;
105
+ border-radius: 4px;
106
+ padding: 2px;
107
+ /* 明确设置背景色 */
108
+ /* 增加内边距让边框更明显 */
109
+ box-sizing: border-box;
110
+ background-color: #ffffff;
111
+ }
112
+
113
+ .josnViewerBox:focus {
114
+ border: 1px solid #3D5ECC;
115
+ }
116
+
117
+
118
+ .btn-iocn {
119
+ display: flex;
120
+ gap: 10px;
121
+
122
+ }
123
+ </style>
@@ -7,8 +7,8 @@
7
7
 
8
8
  <div ref="detailForm" v-if="pageType == 'Form'" style="overflow: auto;"
9
9
  :style="{ height: (listHeight - 5) + 'px' }">
10
- <ct-form :api="rowSelectRouter.action" :apiParam="apiParam" @submit="submit" :flagScroll="'true'"
11
- :drowerClose="drowerClose" :openType="'detail'">
10
+ <ct-form :api="rowSelectRouter.action" :pageStyle="rowSelectRouter.pageStyle" :apiParam="apiParam" @submit="submit" :flagScroll="'true'"
11
+ :drowerClose="drowerClose" :openType="'detail'" :listHeight="listHeight">
12
12
  </ct-form>
13
13
  </div>
14
14
 
@@ -98,6 +98,9 @@ function loadFromModel(source, isFormList) {
98
98
  }
99
99
 
100
100
  rtn1[attrKey] = attrValue;
101
+ if (rtn1.fieldItemKey) {
102
+ rtn1.fieldItemKey = Math.random()
103
+ }
101
104
 
102
105
  if (rtn1.controlType === Enum.ControlType.Tags) {
103
106
  rtn1["value"] = JSON.parse(attrValue);
@@ -533,10 +536,12 @@ function loadFromModel(source, isFormList) {
533
536
  if (f.controlType == Enum.ControlType.Compound || f.controlType == Enum.ControlType.ContainerControl) {
534
537
  if (f.fields) {
535
538
  f.fields.forEach((v) => {
539
+ v.fieldItemKey = Math.random();
536
540
  rtn._fieldsDic[v.fieldName1] = v;
537
541
  });
538
542
  }
539
543
  }
544
+ f.fieldItemKey = Math.random();
540
545
  rtn._fieldsDic[f.fieldName1] = f;
541
546
  });
542
547
  }
@@ -765,6 +770,12 @@ function loadFromModel(source, isFormList) {
765
770
  get tip() {
766
771
  return source.tip;
767
772
  },
773
+ get bottomTip() {
774
+ return source.bottomTip;
775
+ },
776
+ get flagFixedTabOnHorizontalLayout() {
777
+ return source.flagFixedTabOnHorizontalLayout === true;
778
+ },
768
779
  get flagAlertCloseWindowAfterSave() {
769
780
  return source.flagAlertCloseWindowAfterSave === true;
770
781
  },
@@ -0,0 +1,20 @@
1
+ function loadJsonViewerModel(source) {
2
+ let rtn = {
3
+ get json() {
4
+ if (source.code1 && typeof source.code1 === 'string') {
5
+ return JSON.parse(source.code1);
6
+
7
+ } else {
8
+ return source.code1;
9
+ }
10
+ },
11
+ get height() {
12
+ return source.rows ? source.rows * 20 + 'px' : 'auto';
13
+ }
14
+ };
15
+ return rtn;
16
+ }
17
+ const JsonViewer = {
18
+ loadJsonViewerModel
19
+ };
20
+ export default JsonViewer;