|
@@ -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"
|
|
@@ -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,7 +683,7 @@ 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];
|
|
|
|
|
@@ -670,6 +691,11 @@ export default {
|
|
|
obj[str] = row[key];
|
|
|
}
|
|
|
// console.log("row", row);
|
|
|
+ getInfoBySqlKey(this.templateInfo.template.sqlKey).then(({ data }) => {
|
|
|
+ if (!data || !data.dfVueTemplate) {
|
|
|
+ this.$message.error("当前表格未绑定表单!");
|
|
|
+ return;
|
|
|
+ }});
|
|
|
|
|
|
// 新的修改请求
|
|
|
try {
|
|
@@ -689,11 +715,10 @@ 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) {
|
|
|
+ //this.$message.error("当前表格未绑定表单!");
|
|
|
+ //return;
|
|
|
|
|
|
res.data.template.dfFormSql &&
|
|
|
(this.dynamicData = JSON.parse(res.data.template.dfFormSql));
|
|
@@ -709,6 +734,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 +745,7 @@ export default {
|
|
|
})
|
|
|
|
|
|
let tablesubKey = res.data.result.dragTables[1].tableKey
|
|
|
-
|
|
|
+
|
|
|
// 查询统计信息
|
|
|
getStatisticList({
|
|
|
queryMap: {
|
|
@@ -748,7 +774,7 @@ export default {
|
|
|
this.tableCount = res.data
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// let fieldList = Object.keys(resultMap);
|
|
|
// let tableName = this.longestCommonSubstring(fieldList);
|
|
|
// fieldList.forEach((field) => {
|
|
@@ -756,7 +782,7 @@ export default {
|
|
|
// realField = realField[0].toLocaleLowerCase() + realField.substring(1);
|
|
|
// resultMap[realField] = resultMap[field];
|
|
|
// });
|
|
|
-
|
|
|
+
|
|
|
} catch (error) {
|
|
|
this.$message.error("网络异常,请稍后再试");
|
|
|
console.log(error);
|