|
@@ -1279,9 +1279,12 @@ export default {
|
|
|
},
|
|
|
// 自定义字段校验
|
|
|
checkBtnFormKey(rule, value, callback) {
|
|
|
- let { btnType } = this.btnGroupFormData;
|
|
|
+ let { btnType, btnFormType } = this.btnGroupFormData;
|
|
|
console.log(btnType);
|
|
|
- if (btnType == "INSERT" || btnType == "UPDATE") {
|
|
|
+ if (
|
|
|
+ (btnType == "INSERT" || btnType == "UPDATE") &&
|
|
|
+ btnFormType != "noNeed"
|
|
|
+ ) {
|
|
|
if (!value) {
|
|
|
callback(new Error("请绑定表单"));
|
|
|
}
|
|
@@ -1603,61 +1606,66 @@ export default {
|
|
|
// },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["btnGroupFormRef"].validate(async (valid) => {
|
|
|
- console.log(this.btnGroupFormData);
|
|
|
- console.log(valid);
|
|
|
- if (valid) {
|
|
|
- let validateRes = this.myValidate(this.btnGroupFormData);
|
|
|
- if (!validateRes.flag) {
|
|
|
- this.$message.error(validateRes.msg);
|
|
|
- return;
|
|
|
- }
|
|
|
- // 获取公共参数
|
|
|
- // let commonData=this.getCommonData(this.commonFieldData)
|
|
|
- if (
|
|
|
- this.btnGroupFormData.btnType != "OUTLINK" &&
|
|
|
- this.btnGroupFormData.btnType != "INNERLINK"
|
|
|
- ) {
|
|
|
- let temp = {
|
|
|
- commonFieldData: this.commonFieldData,
|
|
|
- conditionData: this.conditionData,
|
|
|
- };
|
|
|
- this.btnGroupFormData.btnParams = JSON.stringify(temp);
|
|
|
- } else {
|
|
|
- let tempObj = {};
|
|
|
- tempObj.url = this.btnGroupFormData.btnParams;
|
|
|
- tempObj.commonFieldData = JSON.stringify(this.commonFieldData);
|
|
|
- this.btnGroupFormData.btnParams = JSON.stringify(tempObj);
|
|
|
- }
|
|
|
- this.btnGroupFormData.btnShowCondition = this.getHidenConditions();
|
|
|
- console.log(this.btnGroupFormData.btnShowCondition);
|
|
|
- this.btnGroupFormData.btnGroupType = this.queryParams.btnGroupType; //添加按钮组类型
|
|
|
- if (this.btnGroupFormData.btnGroupType == "top") {
|
|
|
- this.btnGroupFormData.btnIcon += `@${this.btnGroupFormData.btnStyle}`;
|
|
|
- }
|
|
|
- if (this.editType) {
|
|
|
- // 新增按钮组
|
|
|
- this.btnGroupFormData.btnKey = uuidv4();
|
|
|
- let res = await addBtn(this.btnGroupFormData);
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message.success("添加成功");
|
|
|
+ this.$refs["btnGroupFormRef"].validate(
|
|
|
+ async (valid) => {
|
|
|
+ console.log(this.btnGroupFormData);
|
|
|
+ console.log(valid);
|
|
|
+ if (valid) {
|
|
|
+ let validateRes = this.myValidate(this.btnGroupFormData);
|
|
|
+ if (!validateRes.flag) {
|
|
|
+ this.$message.error(validateRes.msg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 获取公共参数
|
|
|
+ // let commonData=this.getCommonData(this.commonFieldData)
|
|
|
+ if (
|
|
|
+ this.btnGroupFormData.btnType != "OUTLINK" &&
|
|
|
+ this.btnGroupFormData.btnType != "INNERLINK"
|
|
|
+ ) {
|
|
|
+ let temp = {
|
|
|
+ commonFieldData: this.commonFieldData,
|
|
|
+ conditionData: this.conditionData,
|
|
|
+ };
|
|
|
+ this.btnGroupFormData.btnParams = JSON.stringify(temp);
|
|
|
} else {
|
|
|
- this.$message.error("网络异常,请稍后添加");
|
|
|
+ let tempObj = {};
|
|
|
+ tempObj.url = this.btnGroupFormData.btnParams;
|
|
|
+ tempObj.commonFieldData = JSON.stringify(this.commonFieldData);
|
|
|
+ this.btnGroupFormData.btnParams = JSON.stringify(tempObj);
|
|
|
}
|
|
|
- } else {
|
|
|
- // 修改按钮组
|
|
|
- let res = await updateBtn(this.btnGroupFormData);
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message.success("修改成功");
|
|
|
+ this.btnGroupFormData.btnShowCondition = this.getHidenConditions();
|
|
|
+ console.log(this.btnGroupFormData.btnShowCondition);
|
|
|
+ this.btnGroupFormData.btnGroupType = this.queryParams.btnGroupType; //添加按钮组类型
|
|
|
+ if (this.btnGroupFormData.btnGroupType == "top") {
|
|
|
+ this.btnGroupFormData.btnIcon += `@${this.btnGroupFormData.btnStyle}`;
|
|
|
+ }
|
|
|
+ if (this.editType) {
|
|
|
+ // 新增按钮组
|
|
|
+ this.btnGroupFormData.btnKey = uuidv4();
|
|
|
+ let res = await addBtn(this.btnGroupFormData);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("添加成功");
|
|
|
+ } else {
|
|
|
+ this.$message.error("网络异常,请稍后添加");
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.$message.error("网络异常,请稍后修改");
|
|
|
+ // 修改按钮组
|
|
|
+ let res = await updateBtn(this.btnGroupFormData);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ } else {
|
|
|
+ this.$message.error("网络异常,请稍后修改");
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- this.getList();
|
|
|
- this.open = false;
|
|
|
+ this.getList();
|
|
|
+ this.open = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err);
|
|
|
}
|
|
|
- });
|
|
|
+ );
|
|
|
},
|
|
|
// 格式化按钮隐藏条件
|
|
|
getHidenConditions() {
|