ap-dev 1.2.13 → 1.2.14

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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <ap-container>
3
- <ap-aside margin="1111" width="220px">
3
+ <ap-aside margin="1111" width="230px">
4
4
  <ap-aside-tree ref="cptTree" :options.sync="treeOptions">
5
5
  <el-form slot="form" ref="tDevCpt" :inline="true" label-width="80px"
6
6
  :model="tDevCptForm" :rules="tDevCptRules" class="ap-form">
@@ -95,7 +95,8 @@
95
95
  <ap-main margin="0110">
96
96
  <ap-table ref="tDevCptParamTemplateTableRef" :options.sync="tDevCptParamTemplateTable">
97
97
  <template #slotTemplate="searchProps">
98
- <el-input v-model="searchProps.rowData.fdTemplate" type="textarea" :rows=10></el-input>
98
+ <!-- <el-input v-model="searchProps.rowData.fdTemplate" type="textarea" :rows=10></el-input>-->
99
+ <cpt-template v-model="searchProps.rowData.fdTemplate" :cptId="selectedCptId"></cpt-template>
99
100
  </template>
100
101
  <template #slotDefault="searchProps">
101
102
  <el-input v-model="searchProps.rowData.fdDefault" type="textarea" :rows=10></el-input>
@@ -114,6 +115,37 @@
114
115
  <el-button type="primary" @click="doCopyParam('1')">复制参数和参数模板</el-button>
115
116
  </span>
116
117
  </el-dialog>
118
+ <el-dialog
119
+ title="参数脚本"
120
+ :visible.sync="showJsCodeDialog"
121
+ width="1500px">
122
+ <div style="width: 100%;height: 450px" class="flex-justify-start">
123
+ <div style="width: 400px;height: 100%">
124
+ <ap-aside-tree ref="cptParamTreeRef" :options.sync="cptParamTreeOptions">
125
+ <div slot="tree" slot-scope="scope" class="flex-justify-between" style="width: 100%">
126
+ <div>
127
+ <span @click="copyText(scope.data.fdName, $event)">{{ scope.data.fdName }} </span>
128
+ <span class="ap-color-blue"
129
+ @click="copyParamValue(scope.data.fdCode, $event)">{{ scope.data.fdCode }}</span>
130
+ </div>
131
+ <div style="margin-right: 10px">
132
+ <div class="ap-tag" style="font-size: 12px;padding: 2px 5px;"
133
+ @click="insertScript(scope.data)">
134
+ <span v-if="scope.data.fdShowType == 2">开</span>
135
+ <span v-else>不为空</span>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </ap-aside-tree>
140
+ </div>
141
+ <div class="flex-1" style="height: 100%;margin-left: 15px">
142
+ <ap-table ref="tDevCptScriptRef" :options.sync="tDevCptScriptOpt"></ap-table>
143
+ </div>
144
+ </div>
145
+ <span slot="footer" class="dialog-footer">
146
+ <el-button @click="showJsCodeDialog = false">取 消</el-button>
147
+ </span>
148
+ </el-dialog>
117
149
  <el-dialog
118
150
  title="参数编码/参数名称 批量更新"
119
151
  :visible.sync="showHandleCptCodeDialog"
@@ -145,9 +177,14 @@
145
177
  </template>
146
178
 
147
179
  <script>
180
+ import clipboard from 'ap-util/util/ClipboardUtil'
181
+ import CptTemplate from './CptTemplate'
148
182
 
149
183
  export default {
150
184
  name: 'DevCpt',
185
+ components: {
186
+ CptTemplate
187
+ },
151
188
  data() {
152
189
 
153
190
  return {
@@ -168,12 +205,17 @@ export default {
168
205
  optionType: "",
169
206
  showCopyDialog: false,
170
207
  showHandleCptCodeDialog: false,
208
+ showJsCodeDialog: false,
171
209
  replaceForm: {
172
210
  oldName: "",
173
211
  newName: "",
174
212
  oldCode: "",
175
213
  newCode: "",
176
214
  },
215
+ cptParamTreeOptions: this.getCptParamTreeOptions(),
216
+ isErrorScript: "0",
217
+ tDevCptScriptOpt: this.getDevCptScriptOpt(),
218
+ insertScriptId: ""
177
219
  }
178
220
  },
179
221
  mounted() {
@@ -184,13 +226,17 @@ export default {
184
226
  // 左侧树:配置
185
227
  getTreeOption() {
186
228
  let treeOptions = {
187
- title: "组件列表",
229
+ title: "组件",
188
230
  dialogWidth: "700px",
189
231
  toolbarBtn: [{
190
232
  icon: "el-icon-copy", onClick: () => {
191
233
  this.copyCpt();
192
234
  }
193
- }, "add", "edit", "del"],
235
+ }, {
236
+ icon: "el-icon-bug", onClick: () => {
237
+ this.clearCpt();
238
+ }
239
+ }, "add", "edit", "del", "sort"],
194
240
  dialogTitle: "组件信息",
195
241
  sortByDrag: true,
196
242
  onClick: (data, node, comp) => {
@@ -241,6 +287,7 @@ export default {
241
287
  },
242
288
  updateSortUrl: '/apd/TDevCpt/updateTDevCptSort',
243
289
  updateSortListUrl: '/apd/TDevCpt/updateTDevCptSortList',
290
+ sortByDrag: true,
244
291
  resetForm: () => {
245
292
  this.tDevCptForm = {
246
293
  fdName: '',
@@ -295,7 +342,7 @@ export default {
295
342
  prop: 'fdParamName',
296
343
  label: '参数名',
297
344
  type: 'input',
298
- width: '80',
345
+ width: '90',
299
346
  }, {
300
347
  prop: 'fdTemplate',
301
348
  label: '组件模板',
@@ -316,10 +363,16 @@ export default {
316
363
  help: `1、参数格式:\${xxxx}<br> xxx只能是字母,默认空格连接<br>
317
364
  2、数组参数格式:\${xxxx#abc}<br>使用#连接,abc为自定义连接符。使用\\n表示换行<br>`
318
365
  }, {
319
- prop: 'fdAddCondition',
320
- label: '模板添加条件',
321
- type: 'input',
322
- minWidth: '150',
366
+ prop: 'fdAddScriptId',
367
+ label: '模板添加脚本',
368
+ width: '150',
369
+ type: "select",
370
+ selectClearable: true,
371
+ selectOptionsRemote: "scriptList",
372
+ selectOptionsKey: {label: "fdName", value: "fdId"},
373
+ selectHtml: (value, text, row) => {
374
+ return `<span class="ap-color-blue" title='${row.addScript}'>${text}</span>`
375
+ },
323
376
  }, {
324
377
  prop: 'fdDefault',
325
378
  label: '默认模板',
@@ -335,10 +388,16 @@ export default {
335
388
  return true;
336
389
  },
337
390
  }, {
338
- prop: 'fdDefaultCondition',
339
- label: '默认模板使用条件',
340
- type: 'input',
341
- minWidth: '70',
391
+ prop: 'fdDefaultScriptId',
392
+ label: '默认模板使用脚本',
393
+ width: '150',
394
+ type: "select",
395
+ selectClearable: true,
396
+ selectOptionsRemote: "scriptList",
397
+ selectOptionsKey: {label: "fdName", value: "fdId"},
398
+ selectHtml: (value, text, row) => {
399
+ return `<span class="ap-color-blue" title='${row.defaultScript}'>${text}</span>`
400
+ }
342
401
  }, {
343
402
  prop: 'fdLeftSpace',
344
403
  label: '左侧空格',
@@ -360,6 +419,28 @@ export default {
360
419
  deletePk: "fdId", // 默认fdId
361
420
  deleteUrl: "/apd/TDevCptTemplate/deleteTDevCptTemplateGridData",
362
421
  toolbarBtn: [{
422
+ btnType: "primary", text: "脚本", icon: "el-icon-collection-tag", onClick: () => {
423
+ if (this.selectedCptId == null || this.selectedCptId == "") {
424
+ this.$message.error("请选择组件");
425
+ return;
426
+ }
427
+ if (this.$refs.tDevCptParamTableRef.getAddRowList().length > 0 ||
428
+ this.$refs.tDevCptParamTableRef.getEditRowList().length > 0 ||
429
+ this.$refs.tDevCptTemplateTableRef.getAddRowList().length > 0 ||
430
+ this.$refs.tDevCptTemplateTableRef.getEditRowList().length > 0 ||
431
+ this.$refs.tDevCptParamTemplateTableRef.getAddRowList().length > 0 ||
432
+ this.$refs.tDevCptParamTemplateTableRef.getEditRowList().length > 0) {
433
+ this.$message.error("请先保存数据");
434
+ return;
435
+ }
436
+
437
+ this.showJsCodeDialog = true;
438
+ this.$nextTick(() => {
439
+ this.$refs.tDevCptScriptRef.refresh();
440
+ this.$refs.cptParamTreeRef.reLoadTreeData();
441
+ })
442
+ }
443
+ }, "separator", {
363
444
  btnType: "primary", text: "编码替换", icon: "el-icon-transfer", onClick: () => {
364
445
  this.showHandleCptCodeDialog = true;
365
446
  }
@@ -400,13 +481,13 @@ export default {
400
481
  prop: 'fdName',
401
482
  label: '参数名称',
402
483
  type: 'input',
403
- width: '100',
484
+ width: '110',
404
485
  }, {
405
486
  prop: 'fdCode',
406
487
  label: '参数编码',
407
488
  type: 'input',
408
489
  minWidth: '120',
409
- help: `参数编码。<br>.value: 表示参数值<br>示例:"\${InputType.value}"`
490
+ help: `参数编码。<br>.value: 表示参数值<br>示例:"\${InputType.value}"<br>click点击可复制参数取值(如:"\${InputType.value}")`
410
491
  }, {
411
492
  prop: 'fdValue',
412
493
  label: '默认值',
@@ -415,21 +496,25 @@ export default {
415
496
  showOverflowTooltip: true,
416
497
  help: `默认值格式:<br>1、非数组参数:字符串<br>2、数组参数: 可执行js,格式:[{参数编码A:"参数值1"},{参数编码B:"参数值2"}]<br>示例:[{InputA:"add"},{InputB:"自定义",InputC:"按钮"}]`
417
498
  }, {
418
- prop: 'fdShowCondition',
419
- label: '显示条件',
420
- type: 'input',
421
- minWidth: '120',
499
+ prop: 'fdShowScriptId',
500
+ label: '显示条件脚本',
501
+ width: '130',
502
+ type: "select",
503
+ selectClearable: true,
504
+ selectOptionsRemote: "scriptList",
505
+ selectOptionsKey: {label: "fdName", value: "fdId"},
506
+ selectHtml: (value, text, row) => {
507
+ return `<span class="ap-color-blue" title='${row.showScript}'>${text}</span>`
508
+ },
422
509
  help: `判断页面是否显示组件。为空,默认显示。<br>示例:"\${InputType.value}" == "textarea"`
423
510
  }, {
424
511
  prop: 'fdShowType',
425
512
  label: '显示类型',
426
513
  type: 'select',
427
514
  width: '80',
428
- selectOptions: [{label: "input", value: 1}, {label: "下拉单选", value: 3}, {label: "数组参数", value: 4},
429
- {label: "text", value: 6}, {label: "计数文本", value: 7}, {label: "开关", value: 2}, {
430
- label: "单选框",
431
- value: 5
432
- }],
515
+ selectOptions: [{label: "input", value: 1}, {label: "开关", value: 2}, {label: "下拉单选", value: 3},
516
+ {label: "数组参数", value: 4}, {label: "单选框", value: 5}, {label: "text", value: 6},
517
+ {label: "计数文本", value: 7}, {label: "分割线", value: 8}, {label: "文本信息", value: 9}],
433
518
  }, {
434
519
  prop: 'fdOption',
435
520
  label: '值选项',
@@ -446,16 +531,22 @@ export default {
446
531
  return true;
447
532
  },
448
533
  }, {
449
- prop: 'fdChangeMethod',
450
- label: '参数值变化执行方法',
451
- type: 'input',
452
- minWidth: '120',
534
+ prop: 'fdMethodScriptId',
535
+ label: '参数值变化脚本',
536
+ width: '120',
537
+ type: "select",
538
+ selectClearable: true,
539
+ selectOptionsRemote: "scriptList",
540
+ selectOptionsKey: {label: "fdName", value: "fdId"},
541
+ selectHtml: (value, text, row) => {
542
+ return `<span class="ap-color-blue" title='${row.methodScript}'>${text}</span>`
543
+ },
453
544
  help: `参数值修改时,调用方法,用于直接设定其他参数值。<br>示例:"\${InputType.value}" = "123"`
454
545
  }, {
455
546
  prop: 'fdPlaceholder',
456
547
  label: '占位文本',
457
548
  type: 'input',
458
- width: '60',
549
+ width: '120',
459
550
  showOverflowTooltip: true
460
551
  }, {
461
552
  prop: 'fdTab',
@@ -466,21 +557,14 @@ export default {
466
557
  prop: 'fdTip',
467
558
  label: '提示',
468
559
  type: 'input',
469
- width: '60',
560
+ minWidth: '120',
470
561
  showOverflowTooltip: true
471
562
  }, {
472
563
  prop: 'fdRemark',
473
564
  label: '备注',
474
565
  type: 'input',
475
- width: '60',
476
- }, {
477
- prop: 'fdShowLine',
478
- label: '分割线',
479
- type: 'select',
480
- width: '60',
481
- help: '参数tab页分块,参数底部显示分割线',
482
- selectOptions: [{label: "隐藏", value: 0}, {label: "显示", value: 1}]
483
-
566
+ width: '80',
567
+ showOverflowTooltip: true,
484
568
  }, {
485
569
  prop: 'fdSort',
486
570
  label: '排序',
@@ -510,7 +594,7 @@ export default {
510
594
  cptId: this.selectedCptId
511
595
  }
512
596
  },
513
- rowClickEvent: (row) => {
597
+ rowClickEvent: (row, column, event) => {
514
598
  this.selectedParam = row.fdId;
515
599
  this.$refs.tDevCptParamTemplateTableRef.refresh();
516
600
  },
@@ -529,7 +613,7 @@ export default {
529
613
  type: "select",
530
614
  selectOptionsRemote: "paramList",
531
615
  selectOptionsKey: {label: "fdName", value: "fdId"},
532
- width: '100',
616
+ width: '110',
533
617
  addDefaultValue: () => {
534
618
  return this.selectedParam;
535
619
  }
@@ -546,6 +630,7 @@ export default {
546
630
  type: "search",
547
631
  searchTitle: "模板编辑",
548
632
  searchSlot: 'slotTemplate',
633
+ searchWidth:"1100px",
549
634
  searchConfirm: (row) => {
550
635
  return true
551
636
  },
@@ -558,12 +643,17 @@ export default {
558
643
  },
559
644
  help: `格式:参数格式必须为\${xxxx.xxx} 不能有空格`
560
645
  }, {
561
- prop: 'fdAddCondition',
562
- label: '模板添加条件',
563
- type: 'input',
564
- minWidth: '150',
565
- showOverflowTooltip: true,
566
- help: `判断是否添加模板。为空,表示默认添加。<br>示例:"\${InputSize.value}" != ""`
646
+ prop: 'fdAddScriptId',
647
+ label: '模板添加脚本',
648
+ width: '150',
649
+ help: `判断是否添加模板。为空,表示默认添加。`,
650
+ type: "select",
651
+ selectClearable: true,
652
+ selectOptionsRemote: "scriptList",
653
+ selectOptionsKey: {label: "fdName", value: "fdId"},
654
+ selectHtml: (value, text, row) => {
655
+ return `<span class="ap-color-blue" title='${row.addScript}'>${text}</span>`
656
+ }
567
657
  }, {
568
658
  prop: 'fdDefault',
569
659
  label: '默认模板',
@@ -580,22 +670,22 @@ export default {
580
670
  return true;
581
671
  },
582
672
  }, {
583
- prop: 'fdDefaultCondition',
584
- label: '默认模板使用条件',
585
- type: 'input',
586
- minWidth: '70',
587
- showOverflowTooltip: true,
588
- help: `判断是否使用默认模板。为空,不使用默认模板。<br>示例:"\${InputSize.value}" != ""`
673
+ prop: 'fdDefaultScriptId',
674
+ label: '默认模板使用脚本',
675
+ width: '140',
676
+ help: `判断是否使用默认模板。为空,不使用默认模板。<br>示例:"\${InputSize.value}" != ""`,
677
+ type: "select",
678
+ selectClearable: true,
679
+ selectOptionsRemote: "scriptList",
680
+ selectOptionsKey: {label: "fdName", value: "fdId"},
681
+ selectHtml: (value, text, row) => {
682
+ return `<span class="ap-color-blue" title='${row.defaultScript}'>${text}</span>`
683
+ }
589
684
  }, {
590
685
  prop: 'fdLeftSpace',
591
686
  label: '左侧空格',
592
687
  type: 'input',
593
688
  width: '60',
594
- }, {
595
- prop: 'fdSort',
596
- label: '排序',
597
- type: 'input',
598
- width: '60',
599
689
  }
600
690
  ];
601
691
  let tDevCptParamTemplateTable = {
@@ -611,9 +701,7 @@ export default {
611
701
  btnType: "primary", text: "复制", icon: "el-icon-copy", onClick: () => {
612
702
  this.doCopyParamTemplate()
613
703
  }
614
- }, "separator",
615
- "sortAuto", "sortDown", "sortUp", "separator",
616
- "add", "edit", "del", "refresh", "save"],
704
+ }, "separator", "add", "edit", "del", "refresh", "save"],
617
705
  showPagination: false,
618
706
  params: () => {
619
707
  return {
@@ -647,9 +735,25 @@ export default {
647
735
  return "";
648
736
  }
649
737
  str = str.replaceAll("<", "&lt;")
650
- let html = `<div class="api-code" style="line-height: 14px;">${str}</div>`;
738
+ let html = `<div class="api-code" style="line-height: 14px;width: 100%; max-height: 80px;overflow: auto;">${str}</div>`;
651
739
  return html;
652
740
  },
741
+ clearCpt() {
742
+ this.$confirm(`清空无效组件配置(已删除组件的模板、脚本、参数、demo)?`, '提示', {
743
+ confirmButtonText: '清空',
744
+ cancelButtonText: '取消',
745
+ type: 'warning'
746
+ }).then(() => {
747
+ this.$request({
748
+ url: '/apd/TDevCpt/clearCpt',
749
+ method: 'post',
750
+ data: {}
751
+ }).then(response => {
752
+ this.$message.success("清空成功");
753
+ this.$refs.cptTree.reLoadTreeData();
754
+ })
755
+ })
756
+ },
653
757
  copyCpt() {
654
758
  if (this.selectedCptId == "" || this.selectedCptId == null) {
655
759
  this.$message.error("请选择需要复制的行");
@@ -727,7 +831,195 @@ export default {
727
831
  this.$refs.tDevCptParamTemplateTableRef.refresh();
728
832
  })
729
833
 
730
- }
834
+ },
835
+ // 组件参数
836
+ getCptParamTreeOptions() {
837
+ let treeOptions = {
838
+ title: "组件参数",
839
+ initData: false,
840
+ onClick: (data, node, comp) => {
841
+ },
842
+ loadOptions: {
843
+ url: "/apd/TDevCptParam/getTDevCptParamList",
844
+ data: () => {
845
+ return {
846
+ cptId: this.selectedCptId
847
+ }
848
+ },
849
+ treeKey: {
850
+ idKey: "fdId",
851
+ parentKey: "fdParentId",
852
+ childrenKey: "children",
853
+ label: "fdName"
854
+ },
855
+ success: (response) => {
856
+ },
857
+ },
858
+ };
859
+
860
+ return treeOptions;
861
+ },
862
+ // 组件脚本
863
+ getDevCptScriptOpt() {
864
+ let columns = [
865
+ {
866
+ prop: 'fdName',
867
+ label: '名称',
868
+ type: 'input',
869
+ width: 150,
870
+ help: '参数- <br>显示- <br>显示事件- <br>显示方法-'
871
+ }, {
872
+ prop: 'fdCode',
873
+ label: '变量名',
874
+ type: 'input',
875
+ width: 100,
876
+ help: '模板中执行判断的变量名。<br>如<#if testName>'
877
+ }, {
878
+ prop: 'fdScript',
879
+ label: '脚本',
880
+ type: 'input',
881
+ help: 'js前段脚本。<br>示例:"\${InputSize.value}" != ""'
882
+ }, {
883
+ prop: 'fdComment',
884
+ label: '备注',
885
+ type: 'input',
886
+ width: 100,
887
+ }
888
+ ];
889
+ let tableOpt = {
890
+ title: "组件脚本",
891
+ columns: columns,
892
+ editPk: "fdId", //默认fdId
893
+ deletePk: "fdId", // 默认fdId
894
+ dataUrl: "/apd/TDevCptScript/getTDevCptScriptGridList",
895
+ saveUrl: "/apd/TDevCptScript/saveTDevCptScriptGridData",
896
+ deleteUrl: "/apd/TDevCptScript/deleteTDevCptScriptGridData",
897
+ toolbarBtn: [{
898
+ btnType: "primary", text: "异常筛选", icon: "el-icon-copy", onClick: () => {
899
+ this.isErrorScript = "1";
900
+ this.$refs.tDevCptScriptRef.refresh();
901
+ }
902
+ }, {
903
+ btnType: "primary", text: "复制", icon: "el-icon-copy", onClick: () => {
904
+ this.copyScript()
905
+ }
906
+ }, "separator", "add", "edit", "del", "cancel", "refresh", "save"],
907
+ initData: false, // 默认false
908
+ showPagination: false,
909
+ afterLoadData: () => {
910
+ this.isErrorScript = "0";
911
+ },
912
+ addDefaultObj: () => {
913
+ return {
914
+ fdCptId: this.selectedCptId
915
+ }
916
+ },
917
+ params: () => {
918
+ return {
919
+ cptId: this.selectedCptId,
920
+ isErrorScript: this.isErrorScript
921
+ }
922
+ },
923
+ rowDblClickEvent: (row, column, event) => {
924
+ this.$refs.tDevCptScriptRef.toggleEditRow(row);
925
+ },
926
+ afterSave: this.refreshScriptTable,
927
+ afterAll: () => {
928
+ if (this.insertScriptId == null || this.insertScriptId == "") {
929
+ return;
930
+ }
931
+ this.$refs.tDevCptScriptRef.toggleRowSelectionByRowKey(this.insertScriptId, true);
932
+ this.insertScriptId = "";
933
+ }
934
+ };
935
+ return tableOpt;
936
+ },
937
+ // 刷新脚本相关表格
938
+ refreshScriptTable() {
939
+ console.log("刷新外部表格");
940
+ this.$refs.tDevCptParamTableRef.refresh();
941
+ this.$refs.tDevCptTemplateTableRef.refresh();
942
+ this.$refs.tDevCptParamTemplateTableRef.refresh();
943
+ },
944
+ copyText(text, event) {
945
+ clipboard(text, event);
946
+ },
947
+ copyParamValue(code, event) {
948
+ let str = '"${' + code + '.value}"';
949
+ clipboard(str, event);
950
+ },
951
+ insertScript(data) {
952
+ let name = "";
953
+ if (data.fdName.indexOf("事件") > -1) {
954
+ name = "显示事件-" + data.fdName.replace("事件", "");
955
+ } else if (data.fdCode.indexOf("Method") > -1) {
956
+ name = "显示方法-" + data.fdName;
957
+ } else {
958
+ name = "显示-" + data.fdName;
959
+ }
960
+
961
+ let script = "";
962
+ if (data.fdShowType == 2) {
963
+ // 开
964
+ script = '"${' + data.fdCode + '.value}" == "1"';
965
+ } else {
966
+ // 不为空
967
+ script = '"${' + data.fdCode + '.value}" != ""';
968
+ }
969
+ let msg = `确定添加脚本?
970
+ <br><span style="font-weight: bold">名称:</span><span class="ap-color-blue">${name}</span>
971
+ <br><span style="font-weight: bold">脚本:</span><span class="ap-color-blue">${script}</span>`
972
+ this.$confirm(msg, '提示', {
973
+ confirmButtonText: '确定添加',
974
+ cancelButtonText: '取消',
975
+ dangerouslyUseHTMLString: true,
976
+ type: 'warning'
977
+ }).then(() => {
978
+ this.$request({
979
+ url: '/apd/TDevCptScript/insertTDevCptScript',
980
+ method: 'post',
981
+ data: {
982
+ fdCptId: this.selectedCptId,
983
+ fdName: name,
984
+ fdScript: script,
985
+ }
986
+ }).then(response => {
987
+ this.insertScriptId = response.data;
988
+ this.$message.success("添加成功:" + name);
989
+ this.$refs.tDevCptScriptRef.refresh();
990
+ this.refreshScriptTable();
991
+ })
992
+ }).catch(() => {
993
+ this.$message({
994
+ type: 'info',
995
+ message: '已取消添加'
996
+ });
997
+ });
998
+ },
999
+ // 复制参数模板
1000
+ copyScript() {
1001
+ let selectedRows = this.$refs.tDevCptScriptRef.getSelection();
1002
+ if (selectedRows.length < 1) {
1003
+ this.$message.error("请选择需要复制的行!");
1004
+ return;
1005
+ }
1006
+ if (selectedRows.length > 1) {
1007
+ this.$message.error("只能选择单行数据进行复制!");
1008
+ return;
1009
+ }
1010
+
1011
+ this.$request({
1012
+ url: '/apd/TDevCptScript/copyScript',
1013
+ method: 'post',
1014
+ data: {
1015
+ scriptId: selectedRows[0].fdId,
1016
+ }
1017
+ }).then(response => {
1018
+ this.$message.success("复制成功");
1019
+ this.$refs.tDevCptScriptRef.refresh();
1020
+ })
1021
+
1022
+ },
731
1023
  }
732
1024
  }
733
1025
  </script>
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <div class="api-code">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'ApiCode'
10
+ }
11
+ </script>
12
+
13
+
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div>
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'ApiContent'
10
+ }
11
+ </script>
12
+
13
+ <style scoped>
14
+ .api-content {
15
+
16
+ }
17
+ </style>