|
@@ -62,6 +62,7 @@ import TopToolBar from "./TopToolBar.vue"; //右侧tab
|
|
import { updateFormGroup } from "@/api/system/formGroup";
|
|
import { updateFormGroup } from "@/api/system/formGroup";
|
|
import JSONViewer from "./JSONViewer.vue";
|
|
import JSONViewer from "./JSONViewer.vue";
|
|
import PreView from "./PreView.vue";
|
|
import PreView from "./PreView.vue";
|
|
|
|
+import Result from "@/components/Crontab/result.vue";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "DragPosition",
|
|
name: "DragPosition",
|
|
@@ -249,9 +250,41 @@ export default {
|
|
handleStart(type) {
|
|
handleStart(type) {
|
|
this.startType = type;
|
|
this.startType = type;
|
|
},
|
|
},
|
|
|
|
+ checkIsRepeat(dfNickname) {
|
|
|
|
+ console.log(dfNickname, this.layoutData);
|
|
|
|
+ let res = {
|
|
|
|
+ result: false,
|
|
|
|
+ };
|
|
|
|
+ let checkDF = (list, res) => {
|
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
|
+ let temp = list[i];
|
|
|
|
+ if (temp.type == "form") {
|
|
|
|
+ console.log(temp.dfNickname, dfNickname);
|
|
|
|
+ if (temp.dfNickname == dfNickname) {
|
|
|
|
+ res.result = true;
|
|
|
|
+ }
|
|
|
|
+ } else if (temp.type == "tabs" || temp.type == "grid") {
|
|
|
|
+ for (let k = 0; k < temp.columns.length; k++) {
|
|
|
|
+ checkDF(temp.columns[k].list, res);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ checkDF(this.layoutData.list, res);
|
|
|
|
+ return res.result;
|
|
|
|
+ },
|
|
|
|
+ // 校验当前表单是否已存在
|
|
handleListPush(item) {
|
|
handleListPush(item) {
|
|
console.log(this.selectItem);
|
|
console.log(this.selectItem);
|
|
console.log(item);
|
|
console.log(item);
|
|
|
|
+ if (item.type == "form") {
|
|
|
|
+ let isRepeat = this.checkIsRepeat(item.dfNickname);
|
|
|
|
+ console.log("isRepeat", isRepeat);
|
|
|
|
+ if (isRepeat) {
|
|
|
|
+ this.$message.error("该表单已存在!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// 生成key值
|
|
// 生成key值
|
|
// if (!this.selectItem?.key) {
|
|
// if (!this.selectItem?.key) {
|
|
// 在没有选择表单时,将数据push到this.data.list
|
|
// 在没有选择表单时,将数据push到this.data.list
|