cloud-web-corejs 1.1.0-dev.84 → 1.1.0-dev.87

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.1.0-dev.84",
4
+ "version": "1.1.0-dev.87",
5
5
  "scripts": {
6
6
  "build:ace-resources": "node build/build-ace-resources.js",
7
7
  "build:tinymce-resources": "node build/build-tinymce-resources.js",
@@ -22,9 +22,7 @@
22
22
  :clearable="field.options.clearable"
23
23
  :filterable="field.options.filterable"
24
24
  :collapse-tags="!field.options.flatCollapseTags"
25
- :placeholder="
26
- field.options.placeholder || i18nt('render.hint.selectPlaceholder')
27
- "
25
+ :placeholder="getI18nLabel(field.options.placeholder || $t1('请选择'))"
28
26
  :show-all-levels="showFullPath"
29
27
  :props="cascaderProps"
30
28
  @visible-change="hideDropDownOnClick"
@@ -99,7 +97,7 @@ export default {
99
97
  cascaderOptions() {
100
98
  return this.lazyEnabled
101
99
  ? this.lazyEmptyOptions
102
- : this.field.options.optionItems;
100
+ : this.translateOptionNodes(this.field.options.optionItems);
103
101
  },
104
102
 
105
103
  cascaderProps() {
@@ -287,7 +285,7 @@ export default {
287
285
  settled = true;
288
286
  const nodes = this.normalizeLazyNodes(list);
289
287
  this.rememberLazyNodes(node, nodes);
290
- resolve(nodes);
288
+ resolve(this.translateOptionNodes(nodes));
291
289
  };
292
290
  const abortLazyLoad = () => {
293
291
  if (settled) return;
@@ -318,7 +316,7 @@ export default {
318
316
  settled = true;
319
317
  const nodes = this.normalizeLazyNodes(list);
320
318
  this.rememberLazyNodes(node, nodes);
321
- resolve(nodes);
319
+ resolve(this.translateOptionNodes(nodes));
322
320
  };
323
321
  // 请求失败不能 resolve([]):Element 会把 node.loaded 置 true,之后不再 lazyLoad
324
322
  const abortLazyLoad = () => {
@@ -349,6 +347,48 @@ export default {
349
347
  error: abortLazyLoad,
350
348
  });
351
349
  },
350
+ // 展示用副本。原文留在不可枚举的 __rawLabel,脚本仍拿原文
351
+ translateOptionNodes(list) {
352
+ if (!Array.isArray(list) || this.designState) return list;
353
+ const labelKey = this.labelKey;
354
+ const childrenKey = this.childrenKey;
355
+ return list.map((item) => {
356
+ if (!item || typeof item !== "object") return item;
357
+ const next = { ...item };
358
+ const rawLabel = item[labelKey];
359
+ Object.defineProperty(next, "__rawLabel", {
360
+ value: rawLabel,
361
+ enumerable: false,
362
+ });
363
+ if (rawLabel != null && rawLabel !== "") {
364
+ next[labelKey] = this.getI18nLabel(rawLabel);
365
+ }
366
+ if (Array.isArray(item[childrenKey])) {
367
+ next[childrenKey] = this.translateOptionNodes(item[childrenKey]);
368
+ }
369
+ return next;
370
+ });
371
+ },
372
+ rawNodeLabel(node) {
373
+ const data = node && node.data;
374
+ if (data && Object.prototype.hasOwnProperty.call(data, "__rawLabel")) {
375
+ return data.__rawLabel;
376
+ }
377
+ return node && node.label != null ? node.label : "";
378
+ },
379
+ rawOptionData(data) {
380
+ if (!data || typeof data !== "object") return data || null;
381
+ if (!Object.prototype.hasOwnProperty.call(data, "__rawLabel")) return data;
382
+ const next = { ...data };
383
+ next[this.labelKey] = data.__rawLabel;
384
+ const childrenKey = this.childrenKey;
385
+ if (Array.isArray(data[childrenKey])) {
386
+ next[childrenKey] = data[childrenKey].map((child) =>
387
+ this.rawOptionData(child)
388
+ );
389
+ }
390
+ return next;
391
+ },
352
392
  // 展开节点时的路径上下文(与 onSelect 的 item 字段含义一致)
353
393
  buildCascaderNodePathContext(node) {
354
394
  if (!node || node.root || node.level === 0) {
@@ -366,15 +406,15 @@ export default {
366
406
  const levels = pathNodes.map((seg, index) => ({
367
407
  level: index,
368
408
  value: seg.value,
369
- label: seg.label,
370
- data: seg.data || null,
409
+ label: this.rawNodeLabel(seg),
410
+ data: this.rawOptionData(seg.data),
371
411
  }));
372
412
  return {
373
- row: node.data || null,
413
+ row: this.rawOptionData(node.data),
374
414
  level: path.length ? path.length - 1 : 0,
375
415
  path: path,
376
- pathLabels: node.pathLabels ? node.pathLabels.slice() : [],
377
- pathRows: pathNodes.map((seg) => seg.data || null),
416
+ pathLabels: pathNodes.map((seg) => this.rawNodeLabel(seg)),
417
+ pathRows: pathNodes.map((seg) => this.rawOptionData(seg.data)),
378
418
  levels: levels,
379
419
  };
380
420
  },
@@ -579,7 +619,7 @@ export default {
579
619
  const ctx = this.buildCascaderNodePathContext(node);
580
620
  return {
581
621
  value: node.value,
582
- label: node.label,
622
+ label: this.rawNodeLabel(node),
583
623
  level: ctx.level == null ? 0 : ctx.level,
584
624
  path: ctx.path,
585
625
  pathLabels: ctx.pathLabels,
@@ -12,14 +12,14 @@
12
12
  :limit="field.options.limit" :on-exceed="handleFileExceed" :before-upload="beforeFileUpload"
13
13
  :on-success="handleFileUpload" :on-error="handleUploadError">
14
14
  <div slot="tip" class="el-upload__tip"
15
- v-if="!!field.options.uploadTip">{{field.options.uploadTip}}</div>
15
+ v-if="!!field.options.uploadTip">{{getI18nLabel(field.options.uploadTip)}}</div>
16
16
  <i slot="default" class="el-icon-plus avatar-uploader-icon"></i>
17
17
  <template #file="{ file }">
18
18
  <div class="upload-file-list">
19
19
  <span class="upload-file-name" :title="file.name">{{file.name}}</span>
20
20
  <a :href="file.url" download="" target="_blank">
21
- <i class="el-icon-download file-action" :title="i18nt('render.hint.downloadFile')"></i></a>
22
- <i class="el-icon-delete file-action" :title="i18nt('render.hint.removeFile')" v-if="!field.options.disabled"
21
+ <i class="el-icon-download file-action" :title="$t1('下载')"></i></a>
22
+ <i class="el-icon-delete file-action" :title="$t1('移除')" v-if="!field.options.disabled"
23
23
  @click="removeUploadFile(file.name, file.url, file.uid)"></i>
24
24
  </div>
25
25
  </template>
@@ -30,16 +30,13 @@
30
30
  <script>
31
31
  import FormItemWrapper from './form-item-wrapper'
32
32
  import emitter from '../../../../../components/xform/utils/emitter'
33
- import i18n, {translate} from "../../../../../components/xform/utils/i18n";
34
33
  import {deepClone} from "../../../../../components/xform/utils/util";
35
34
  import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
36
35
 
37
- let selectFileText = "'" + translate('render.hint.selectFile') + "'"
38
-
39
36
  export default {
40
37
  name: "file-upload-widget",
41
38
  componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
42
- mixins: [emitter, fieldMixin, i18n],
39
+ mixins: [emitter, fieldMixin],
43
40
  props: {
44
41
  field: Object,
45
42
  parentWidget: Object,
@@ -86,14 +83,14 @@
86
83
  },
87
84
  fileList: [], //上传文件列表
88
85
  uploadBtnHidden: false,
89
-
90
- styleVariables: {
91
- '--select-file-action': selectFileText,
92
- },
93
86
  }
94
87
  },
95
88
  computed: {
96
-
89
+ styleVariables() {
90
+ return {
91
+ '--select-file-action': "' " + this.$t1('选择文件') + "'",
92
+ };
93
+ },
97
94
  },
98
95
  beforeCreate() {
99
96
  /* 这里不能访问方法和属性!! */
@@ -121,7 +118,7 @@
121
118
  methods: {
122
119
  handleFileExceed() {
123
120
  let uploadLimit = this.field.options.limit
124
- this.$message.warning( this.i18nt('render.hint.uploadExceed').replace('${uploadLimit}', uploadLimit) )
121
+ this.$message.warning(this.$t1('最大上传数量({p0})已超出.', { p0: uploadLimit }))
125
122
  },
126
123
 
127
124
  beforeFileUpload(file) {
@@ -136,7 +133,7 @@
136
133
  }
137
134
  }
138
135
  if (!fileTypeCheckResult) {
139
- this.$message.error(this.i18nt('render.hint.unsupportedFileType') + extFileName)
136
+ this.$message.error(this.$t1('不支持格式: {p0}', { p0: extFileName }))
140
137
  return false;
141
138
  }
142
139
 
@@ -147,7 +144,7 @@
147
144
  }
148
145
  fileSizeCheckResult = file.size / 1024 / 1024 <= uploadFileMaxSize
149
146
  if (!fileSizeCheckResult) {
150
- this.$message.error(this.i18nt('render.hint.fileSizeExceed') + uploadFileMaxSize + 'MB')
147
+ this.$message.error(this.$t1('文件大小已超出: {p0}MB', { p0: uploadFileMaxSize }))
151
148
  return false;
152
149
  }
153
150
 
@@ -250,7 +247,7 @@
250
247
  customFn.call(this, err, file, fileList)
251
248
  } else {
252
249
  this.$message({
253
- message: this.i18nt('render.hint.uploadError') + err,
250
+ message: this.$t1('上传错误: {p0}', { p0: err }),
254
251
  duration: 3000,
255
252
  type: 'error',
256
253
  })
@@ -108,7 +108,7 @@
108
108
  <template v-if="field.options.labelIconPosition === 'front'">
109
109
  <template v-if="!!field.options.labelTooltip">
110
110
  <el-tooltip
111
- :content="field.options.labelTooltip"
111
+ :content="getI18nLabel(field.options.labelTooltip)"
112
112
  effect="dark"
113
113
  popper-class="label-tooltip-pre-line"
114
114
  >
@@ -130,7 +130,7 @@
130
130
  label
131
131
  }}</span
132
132
  ><el-tooltip
133
- :content="field.options.labelTooltip"
133
+ :content="getI18nLabel(field.options.labelTooltip)"
134
134
  effect="dark"
135
135
  popper-class="label-tooltip-pre-line"
136
136
  >
@@ -127,7 +127,7 @@
127
127
  methods: {
128
128
  handlePictureExceed() {
129
129
  let uploadLimit = this.field.options.limit
130
- this.$message.warning( this.i18nt('render.hint.uploadExceed').replace('${uploadLimit}', uploadLimit) )
130
+ this.$message.warning(this.$t1('最大上传数量({p0})已超出.', { p0: uploadLimit }))
131
131
  },
132
132
 
133
133
  handlePicturePreview(file) {
@@ -146,7 +146,7 @@
146
146
  }
147
147
  }
148
148
  if (!fileTypeCheckResult) {
149
- this.$message.error(this.i18nt('render.hint.unsupportedFileType') + file.type)
149
+ this.$message.error(this.$t1('不支持格式: {p0}', { p0: file.type }))
150
150
  return false;
151
151
  }
152
152
 
@@ -157,7 +157,7 @@
157
157
  }
158
158
  fileSizeCheckResult = file.size / 1024 / 1024 <= uploadFileMaxSize
159
159
  if (!fileSizeCheckResult) {
160
- this.$message.error(this.i18nt('render.hint.fileSizeExceed') + uploadFileMaxSize + 'MB')
160
+ this.$message.error(this.$t1('文件大小已超出: {p0}MB', { p0: uploadFileMaxSize }))
161
161
  return false;
162
162
  }
163
163
 
@@ -246,7 +246,7 @@
246
246
  customFn.call(this, err, file, fileList)
247
247
  } else {
248
248
  this.$message({
249
- message: this.i18nt('render.hint.uploadError') + err,
249
+ message: this.$t1('上传错误: {p0}', { p0: err }),
250
250
  duration: 3000,
251
251
  type: 'error',
252
252
  })
@@ -3,7 +3,7 @@
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
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>
6
+ <pre :style="{'white-space': !!field.options.preWrap ? 'pre-wrap' : 'pre', 'text-align': !!field.options.textAlign ? field.options.textAlign : 'left'}">{{getI18nLabel(field.options.textContent)}}</pre></div>
7
7
  </static-content-wrapper>
8
8
  </template>
9
9
 
@@ -4,7 +4,7 @@
4
4
  :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
5
5
  <el-switch ref="fieldEditor" v-model="fieldModel"
6
6
  :disabled="field.options.disabled"
7
- :active-text="field.options.activeText" :inactive-text="field.options.inactiveText"
7
+ :active-text="getI18nLabel(field.options.activeText)" :inactive-text="getI18nLabel(field.options.inactiveText)"
8
8
  :active-color="field.options.activeColor" :inactive-color="field.options.inactiveColor"
9
9
  :width="field.options.switchWidth"
10
10
  @change="handleChangeEvent">
@@ -92,8 +92,8 @@
92
92
  return rawValue;
93
93
  }
94
94
  return rawValue
95
- ? this.field.options.activeText
96
- : this.field.options.inactiveText;
95
+ ? this.getI18nLabel(this.field.options.activeText)
96
+ : this.getI18nLabel(this.field.options.inactiveText);
97
97
  },
98
98
  }
99
99
  }
@@ -7,8 +7,8 @@
7
7
  :size="field.options.size"
8
8
  :clearable="field.options.clearable" :editable="field.options.editable"
9
9
  :format="field.options.format" value-format="HH:mm:ss"
10
- :start-placeholder="field.options.startPlaceholder || i18nt('render.hint.startTimePlaceholder')"
11
- :end-placeholder="field.options.endPlaceholder || i18nt('render.hint.endTimePlaceholder')"
10
+ :start-placeholder="getI18nLabel(field.options.startPlaceholder || $t1('起始时间'))"
11
+ :end-placeholder="getI18nLabel(field.options.endPlaceholder || $t1('截止时间'))"
12
12
  @focus="handleFocusCustomEvent" @blur="handleBlurCustomEvent"
13
13
  @change="handleChangeEvent">
14
14
  </el-time-picker>
@@ -2,7 +2,7 @@
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 class="title" :class="field.options.styleTitClass"><b v-html="field.options.htmlContent"></b></div>
5
+ <div class="title" :class="field.options.styleTitClass"><b v-html="getI18nLabel(field.options.htmlContent)"></b></div>
6
6
  </static-content-wrapper>
7
7
  </template>
8
8
 
@@ -5,10 +5,10 @@
5
5
  v-show="!widget.options.hidden">
6
6
  <el-row class="header-row">
7
7
  <div class="action-header-column">
8
- <span class="action-label">{{i18nt('render.hint.subFormAction')}}</span>
8
+ <span class="action-label">{{$t1('操作')}}</span>
9
9
  <el-button :disabled="actionDisabled" round type="primary" size="mini" class="action-button" @click="addSubFormRow"
10
- :title="i18nt('render.hint.subFormAddActionHint')">
11
- {{i18nt('render.hint.subFormAddAction')}}<i class="el-icon-plus el-icon-right"></i></el-button>
10
+ :title="$t1('新增行')">
11
+ {{$t1('新增')}}<i class="el-icon-plus el-icon-right"></i></el-button>
12
12
  </div>
13
13
  <template v-for="(subWidget) in widget.widgetList">
14
14
  <div :key="subWidget.id + 'thc'" class="field-header-column"
@@ -18,28 +18,28 @@
18
18
  <template v-if="subWidget.options.labelIconPosition === 'front'">
19
19
  <template v-if="!!subWidget.options.labelTooltip">
20
20
  <el-tooltip
21
- :content="subWidget.options.labelTooltip"
21
+ :content="getI18nLabel(subWidget.options.labelTooltip)"
22
22
  effect="light"
23
23
  popper-class="label-tooltip-pre-line"
24
24
  >
25
- <i :class="subWidget.options.labelIconClass"></i></el-tooltip>{{subWidget.options.label}}</template>
25
+ <i :class="subWidget.options.labelIconClass"></i></el-tooltip>{{getI18nLabel(subWidget.options.label)}}</template>
26
26
  <template v-else>
27
- <i :class="subWidget.options.labelIconClass"></i>{{subWidget.options.label}}</template>
27
+ <i :class="subWidget.options.labelIconClass"></i>{{getI18nLabel(subWidget.options.label)}}</template>
28
28
  </template>
29
29
  <template v-else-if="subWidget.options.labelIconPosition === 'rear'">
30
30
  <template v-if="!!subWidget.options.labelTooltip">
31
- {{subWidget.options.label}}<el-tooltip
32
- :content="subWidget.options.labelTooltip"
31
+ {{getI18nLabel(subWidget.options.label)}}<el-tooltip
32
+ :content="getI18nLabel(subWidget.options.labelTooltip)"
33
33
  effect="light"
34
34
  popper-class="label-tooltip-pre-line"
35
35
  >
36
36
  <i :class="subWidget.options.labelIconClass"></i></el-tooltip></template>
37
37
  <template v-else>
38
- {{subWidget.options.label}}<i :class="subWidget.options.labelIconClass"></i></template>
38
+ {{getI18nLabel(subWidget.options.label)}}<i :class="subWidget.options.labelIconClass"></i></template>
39
39
  </template>
40
40
  </span>
41
41
  <template v-else>
42
- <span :title="subWidget.options.labelTooltip">{{subWidget.options.label}}</span></template>
42
+ <span :title="getI18nLabel(subWidget.options.labelTooltip)">{{getI18nLabel(subWidget.options.label)}}</span></template>
43
43
  </div>
44
44
  </template>
45
45
  </el-row>
@@ -47,9 +47,9 @@
47
47
  <div class="sub-form-action-column hide-label">
48
48
  <div class="action-button-column">
49
49
  <el-button :disabled="actionDisabled" circle type="" icon="el-icon-circle-plus-outline" @click="insertSubFormRow(sfrIdx)"
50
- :title="i18nt('render.hint.insertSubFormRow')"></el-button>
50
+ :title="$t1('插入行')"></el-button>
51
51
  <el-button :disabled="actionDisabled" circle type="" icon="el-icon-delete" @click="deleteSubFormRow(sfrIdx)"
52
- :title="i18nt('render.hint.deleteSubFormRow')"></el-button>
52
+ :title="$t1('删除行')"></el-button>
53
53
  <span v-if="widget.options.showRowNumber" class="row-number-span">#{{sfrIdx+1}}</span>
54
54
  </div>
55
55
  </div>
@@ -267,9 +267,9 @@
267
267
  },
268
268
 
269
269
  deleteSubFormRow(formRowIndex) {
270
- this.$confirm(this.i18nt('render.hint.deleteSubFormRow') + '?', this.i18nt('render.hint.prompt'), {
271
- confirmButtonText: this.i18nt('render.hint.confirm'),
272
- cancelButtonText: this.i18nt('render.hint.cancel')
270
+ this.$confirm(this.$t1('删除行?'), this.$t1('提示'), {
271
+ confirmButtonText: this.$t1('确定'),
272
+ cancelButtonText: this.$t1('取消')
273
273
  }).then(() => {
274
274
  let oldSubFormData = this.formModel[this.widget.options.name] || []
275
275
  let deletedDataRow = deepClone(oldSubFormData[formRowIndex])
@@ -0,0 +1,173 @@
1
+ <template>
2
+ <el-dialog
3
+ :title="$t1('复制表单模板')"
4
+ :append-to-body="true"
5
+ :modal-append-to-body="true"
6
+ :close-on-click-modal="false"
7
+ :visible.sync="showDialog"
8
+ :modal="false"
9
+ custom-class="dialog-style list-dialog dialog-checkbox pd_8"
10
+ width="360px"
11
+ v-el-drag-dialog
12
+ v-el-dialog-center
13
+ @close="close"
14
+ >
15
+ <div class="cont">
16
+ <el-form
17
+ ref="editForm"
18
+ :model="formData"
19
+ label-width="110px"
20
+ class="adSearchForm"
21
+ style="width: 322px; height: auto;"
22
+ >
23
+ <el-form-item :label="$t1('后缀')" prop="suffix" :rules="suffixRules">
24
+ <el-input
25
+ v-model="formData.suffix"
26
+ clearable
27
+ :placeholder="$t1('追加到编码和名称')"
28
+ />
29
+ </el-form-item>
30
+ <el-form-item :label="$t1('表单分类')" prop="menuKindName">
31
+ <el-input
32
+ class="search-input"
33
+ v-model="formData.menuKindName"
34
+ @clear="clearMenuKind"
35
+ v-el-readonly
36
+ clearable
37
+ :placeholder="$t1('不填则保持原分类')"
38
+ >
39
+ <i
40
+ slot="suffix"
41
+ class="el-input__icon el-icon-search"
42
+ @click="showMenuKindDialog = true"
43
+ ></i>
44
+ </el-input>
45
+ </el-form-item>
46
+ </el-form>
47
+ </div>
48
+ <span slot="footer" class="dialog-footer">
49
+ <el-button type="primary" plain class="button-sty" @click="close">
50
+ <i class="el-icon-close el-icon"></i>
51
+ {{ $t1('取 消') }}
52
+ </el-button>
53
+ <el-button type="primary" @click="saveData" class="button-sty">
54
+ <i class="el-icon-check el-icon"></i>
55
+ {{ $t1('确 定') }}
56
+ </el-button>
57
+ </span>
58
+ <MenuKindDialog
59
+ v-if="showMenuKindDialog"
60
+ :visiable.sync="showMenuKindDialog"
61
+ :serviceName="serviceName"
62
+ @confirm="confirmMenuKind"
63
+ :param="{ taType: 0 }"
64
+ :multi="false"
65
+ />
66
+ </el-dialog>
67
+ </template>
68
+
69
+ <script>
70
+ import MenuKindDialog from "@base/views/bd/setting/menu_kind/dialog.vue";
71
+
72
+ export default {
73
+ name: "formTemplateCopyAppendDialog",
74
+ components: { MenuKindDialog },
75
+ props: {
76
+ visiable: Boolean,
77
+ ids: {
78
+ type: Array,
79
+ default() {
80
+ return [];
81
+ },
82
+ },
83
+ serviceName: String,
84
+ },
85
+ data() {
86
+ return {
87
+ showDialog: true,
88
+ showMenuKindDialog: false,
89
+ formData: {
90
+ suffix: "",
91
+ menuKindCode: "",
92
+ menuKindName: "",
93
+ },
94
+ };
95
+ },
96
+ computed: {
97
+ suffixRules() {
98
+ return [
99
+ {
100
+ required: true,
101
+ message: this.$t1("请输入后缀"),
102
+ trigger: "blur",
103
+ },
104
+ {
105
+ validator: (rule, value, callback) => {
106
+ let suffix = (value || "").trim();
107
+ if (!suffix) {
108
+ callback(new Error(this.$t1("请输入后缀")));
109
+ return;
110
+ }
111
+ if (!/^[A-Za-z0-9_.-]+$/.test(suffix)) {
112
+ callback(new Error(this.$t1("后缀只允许是字母或数字或'_.-'")));
113
+ return;
114
+ }
115
+ callback();
116
+ },
117
+ trigger: "blur",
118
+ },
119
+ ];
120
+ },
121
+ },
122
+ methods: {
123
+ clearMenuKind() {
124
+ this.formData.menuKindCode = "";
125
+ this.formData.menuKindName = "";
126
+ },
127
+ confirmMenuKind(rows) {
128
+ if (rows && rows.length) {
129
+ let row = rows[0];
130
+ this.formData.menuKindCode = row.menuKindCode;
131
+ this.formData.menuKindName = row.name;
132
+ }
133
+ },
134
+ saveData() {
135
+ this.$refs.editForm.validate((valid) => {
136
+ if (!valid) {
137
+ return;
138
+ }
139
+ this.$baseConfirm(this.$t1("您确定要复制吗?")).then(() => {
140
+ let data = {
141
+ ids: this.ids,
142
+ suffix: (this.formData.suffix || "").trim(),
143
+ };
144
+ if (this.formData.menuKindCode) {
145
+ data.menuKindCode = this.formData.menuKindCode;
146
+ }
147
+ this.$http({
148
+ url: USER_PREFIX + "/formTemplate/copyAppend",
149
+ method: "post",
150
+ data,
151
+ isLoading: true,
152
+ success: (res) => {
153
+ this.$message({
154
+ message: res.content,
155
+ type: "success",
156
+ duration: 500,
157
+ onClose: () => {
158
+ this.close();
159
+ this.$emit("confirm");
160
+ },
161
+ });
162
+ },
163
+ });
164
+ });
165
+ });
166
+ },
167
+ close() {
168
+ this.showDialog = false;
169
+ this.$emit("update:visiable", false);
170
+ },
171
+ },
172
+ };
173
+ </script>
@@ -63,6 +63,14 @@
63
63
  v-if="isDev && currentFormType.addAuth === 1"
64
64
  >{{ $t1("新增") }}
65
65
  </vxe-button>
66
+ <vxe-button
67
+ status="primary"
68
+ class="button-sty"
69
+ icon="el-icon-document-copy"
70
+ @click="openCopyAppendDialog"
71
+ v-if="isDev && currentFormType.addAuth === 1"
72
+ >{{ $t1("复制") }}
73
+ </vxe-button>
66
74
  <vxe-button
67
75
  status="success"
68
76
  class="button-sty"
@@ -290,6 +298,13 @@
290
298
  :rows="checkTags"
291
299
  :multi="true"
292
300
  ></projectTagDialog>
301
+ <copyAppendDialog
302
+ v-if="showCopyAppendDialog"
303
+ :visiable.sync="showCopyAppendDialog"
304
+ :ids="copyIds"
305
+ :serviceName="copyServiceName"
306
+ @confirm="confirmCopyAppendDialog"
307
+ ></copyAppendDialog>
293
308
  </div>
294
309
  </template>
295
310
 
@@ -19,6 +19,7 @@ import {
19
19
  getJsxStatus,
20
20
  } from "@base/views/bd/setting/utils/index";
21
21
  import formVersionButton from "@base/views/bd/setting/formVersion/link.vue";
22
+ import copyAppendDialog from "@base/views/bd/setting/form_template/copyAppendDialog.vue";
22
23
  import settingConfig from "@/settings";
23
24
  import {
24
25
  getDesignerLayoutType,
@@ -45,6 +46,7 @@ modules = {
45
46
  formDesignerDialog: () =>
46
47
  import("@base/views/bd/setting/form_template/formDesignerDialog.vue"),
47
48
  formVersionButton,
49
+ copyAppendDialog,
48
50
  },
49
51
  data() {
50
52
  return {
@@ -148,6 +150,9 @@ modules = {
148
150
  showTree: false,
149
151
  designerReadonly: false,
150
152
  designerLayoutType: "PC",
153
+ showCopyAppendDialog: false,
154
+ copyIds: [],
155
+ copyServiceName: "",
151
156
  };
152
157
  },
153
158
  computed: {
@@ -190,6 +195,22 @@ modules = {
190
195
  this.checkTags = [];
191
196
  this.$refs["table-m1"].commitProxy("reload");
192
197
  },
198
+ openCopyAppendDialog() {
199
+ let rows = this.$refs["table-m1"].getCheckboxRecords(true) || [];
200
+ if (!rows.length) {
201
+ this.$baseAlert(this.$t1("请选择需要复制的数据"));
202
+ return;
203
+ }
204
+ this.copyIds = rows.map((item) => item.id);
205
+ let serviceNames = [
206
+ ...new Set(rows.map((item) => item.serviceName).filter((item) => item)),
207
+ ];
208
+ this.copyServiceName = serviceNames.length === 1 ? serviceNames[0] : "";
209
+ this.showCopyAppendDialog = true;
210
+ },
211
+ confirmCopyAppendDialog() {
212
+ this.searchEvent();
213
+ },
193
214
  openEditDialog(row) {
194
215
  let dataId = row?.id || 0;
195
216
  /*this.dataId = !id || typeof id === 'object' ? 0 : id;