|
@@ -261,10 +261,31 @@
|
|
|
title="提示"
|
|
|
:visible.sync="btnDialogVisible"
|
|
|
:before-close="handleClose">
|
|
|
- <DialogTemplate
|
|
|
+ <DialogTemplate
|
|
|
ref="dialogRef"
|
|
|
:groupKey="groupKey"
|
|
|
- :rowobj="rowobj"
|
|
|
+ :rowobj="rowobj"
|
|
|
+ :subCount="subCount"
|
|
|
+ :tableCount="tableCount"
|
|
|
+ :subTableName="subTableName"
|
|
|
+ @addList="addListHandler"
|
|
|
+ >
|
|
|
+ </DialogTemplate>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="btnDialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="btnComfirm">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 绑定按钮dialog -->
|
|
|
+ <el-dialog
|
|
|
+ title="提示"
|
|
|
+ :visible.sync="btnDialogVisible"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <DialogTemplate
|
|
|
+ ref="dialogRef"
|
|
|
+ :groupKey="groupKey"
|
|
|
+ :rowobj="rowobj"
|
|
|
:subCount="subCount"
|
|
|
:tableCount="tableCount"
|
|
|
:subTableName="subTableName"
|
|
@@ -416,14 +437,14 @@ export default {
|
|
|
watch: {
|
|
|
tableList: {
|
|
|
handler(val) {
|
|
|
- console.log(JSON.parse(JSON.stringify(val)), "tableListChange");
|
|
|
+ // console.log(JSON.parse(JSON.stringify(val)), "tableListChange");
|
|
|
},
|
|
|
deep: true,
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
isShowExcuteCol() {
|
|
|
- console.log(!this.excuteBtnArr?.every((arr) => arr.children.length == 0));
|
|
|
+ // console.log(!this.excuteBtnArr?.every((arr) => arr.children.length == 0));
|
|
|
// return true;
|
|
|
return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
|
|
|
},
|
|
@@ -654,7 +675,7 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
async handleUpdate(row, btnData) {
|
|
|
// console.log(this.currentBtnData);
|
|
|
-
|
|
|
+
|
|
|
let nameTable = this.templateInfo.template.dtTableName
|
|
|
// console.log(nameTable);
|
|
|
// console.log('row', row);
|
|
@@ -662,14 +683,19 @@ export default {
|
|
|
let obj = {}
|
|
|
for(let key in row) {
|
|
|
|
|
|
- let modifiedTable = key.replace(/[A-Z]/g, (match) => `_${match}`).toLowerCase();
|
|
|
+ let modifiedTable = key.replace(/[A-Z]/g, (match) => `_${match}`).toLowerCase();
|
|
|
|
|
|
this.rowobj[modifiedTable] = row[key];
|
|
|
|
|
|
let str = modifiedTable.substring(nameTable.length+1)
|
|
|
obj[str] = row[key];
|
|
|
}
|
|
|
- console.log("row", row);
|
|
|
+ // console.log("row", row);
|
|
|
+ // getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
|
|
|
+ // if (!data || !data.dfVueTemplate) {
|
|
|
+ // this.$message.error("当前表格未绑定表单!");
|
|
|
+ // return;
|
|
|
+ // }});
|
|
|
|
|
|
// 新的修改请求
|
|
|
try {
|
|
@@ -689,11 +715,12 @@ export default {
|
|
|
payLoad.conditionMap[this.templateInfo.template?.primaryKey] =
|
|
|
row[primary];
|
|
|
let res = await btnCommonApi(payLoad);
|
|
|
- this.subTableName = res.data.result.dragTables[1].dtTableName
|
|
|
// 判断是否绑定dialog弹窗
|
|
|
- if (this.currentBtnData.btnTableFormGroupKey == '') {
|
|
|
- this.$message.error("当前表格未绑定表单!");
|
|
|
- return;
|
|
|
+ if (!this.currentBtnData.btnTableFormGroupKey) {
|
|
|
+ if (!res.data || !res.data.template) {
|
|
|
+ this.$message.error("当前按钮未绑定表单!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
res.data.template.dfFormSql &&
|
|
|
(this.dynamicData = JSON.parse(res.data.template.dfFormSql));
|
|
@@ -709,6 +736,7 @@ export default {
|
|
|
this.$refs.addFromRef.setData(res.data.result.resultMap);
|
|
|
});
|
|
|
}else{
|
|
|
+ this.subTableName = res.data.result.dragTables[1].dtTableName
|
|
|
this.btnDialogVisible = true
|
|
|
this.groupKey = this.currentBtnData.btnTableFormGroupKey
|
|
|
this.$nextTick(()=>{
|
|
@@ -719,7 +747,7 @@ export default {
|
|
|
})
|
|
|
|
|
|
let tablesubKey = res.data.result.dragTables[1].tableKey
|
|
|
-
|
|
|
+
|
|
|
// 查询统计信息
|
|
|
getStatisticList({
|
|
|
queryMap: {
|
|
@@ -748,7 +776,7 @@ export default {
|
|
|
this.tableCount = res.data
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// let fieldList = Object.keys(resultMap);
|
|
|
// let tableName = this.longestCommonSubstring(fieldList);
|
|
|
// fieldList.forEach((field) => {
|
|
@@ -756,7 +784,7 @@ export default {
|
|
|
// realField = realField[0].toLocaleLowerCase() + realField.substring(1);
|
|
|
// resultMap[realField] = resultMap[field];
|
|
|
// });
|
|
|
-
|
|
|
+
|
|
|
} catch (error) {
|
|
|
this.$message.error("网络异常,请稍后再试");
|
|
|
console.log(error);
|
|
@@ -951,7 +979,7 @@ export default {
|
|
|
// 弹窗新增的数
|
|
|
addListHandler(val){
|
|
|
this.addLists.push(...val)
|
|
|
- console.log(this.addLists);
|
|
|
+ // console.log(this.addLists);
|
|
|
},
|
|
|
// 绑定弹窗Dialog确定按钮
|
|
|
btnComfirm(){
|
|
@@ -972,7 +1000,7 @@ export default {
|
|
|
},
|
|
|
// 去掉表名 开头字母小写
|
|
|
formatField(field = "", tableName) {
|
|
|
- console.log(field, tableName);
|
|
|
+ // console.log(field, tableName);
|
|
|
let temp = field.replace(tableName, "");
|
|
|
return toUnderline(temp[0].toLowerCase() + temp.slice(1));
|
|
|
},
|
|
@@ -1131,7 +1159,7 @@ export default {
|
|
|
);
|
|
|
if (!fieldConditionList.length) return tableList;
|
|
|
let res = await this.setDictStyleData();
|
|
|
- console.log(res);
|
|
|
+ // console.log(res);
|
|
|
this.dictStyleObj = res;
|
|
|
// console.log(JSON.parse(JSON.stringify(this.dictStyleObj)));
|
|
|
tableList.forEach((row) => {
|
|
@@ -1252,7 +1280,7 @@ export default {
|
|
|
|
|
|
// k-form-build表单变化回调
|
|
|
formChangeHandler(value, label) {
|
|
|
- console.log(value, label);
|
|
|
+ // console.log(value, label);
|
|
|
},
|
|
|
},
|
|
|
};
|