|
@@ -40,7 +40,7 @@
|
|
|
:underline="false"
|
|
|
style="font-size: 12px; vertical-align: baseline"
|
|
|
@click="importTemplate"
|
|
|
- >下载模板
|
|
|
+ >下载模板
|
|
|
</el-link>
|
|
|
</div>
|
|
|
</el-upload>
|
|
@@ -62,7 +62,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- >新增
|
|
|
+ >新增
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -73,7 +73,7 @@
|
|
|
size="mini"
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
- >修改
|
|
|
+ >修改
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -84,7 +84,7 @@
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -93,7 +93,7 @@
|
|
|
icon="el-icon-upload2"
|
|
|
size="mini"
|
|
|
@click="upload.open = true"
|
|
|
- >导入
|
|
|
+ >导入
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -103,7 +103,7 @@
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
- >导出
|
|
|
+ >导出
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar
|
|
@@ -116,7 +116,7 @@
|
|
|
:data="tableList"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
<!-- <span v-for="(key, val) in columns" :key="key">
|
|
|
<el-table-column :label="key" align="center" :prop="val" />
|
|
|
</span> -->
|
|
@@ -144,7 +144,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- >修改
|
|
|
+ >修改
|
|
|
</el-button>
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item>
|
|
@@ -153,7 +153,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
@@ -202,13 +202,13 @@ import {
|
|
|
addTableData,
|
|
|
batchEdit,
|
|
|
} from "@/api/tablelist/commonTable";
|
|
|
-import {getToken} from "@/utils/auth";
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
|
|
|
-import {camelCase} from "@/utils";
|
|
|
+import { camelCase } from "@/utils";
|
|
|
|
|
|
export default {
|
|
|
name: "listInfo",
|
|
|
- components: {Queryfrom},
|
|
|
+ components: { Queryfrom },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -245,7 +245,7 @@ export default {
|
|
|
// 是否更新已经存在的数据
|
|
|
updateSupport: 0,
|
|
|
// 设置上传的请求头部
|
|
|
- headers: {Authorization: "Bearer " + getToken()},
|
|
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
// 上传的地址
|
|
|
url: process.env.VUE_APP_BASE_API3 + "common/uploadData",
|
|
|
},
|
|
@@ -355,7 +355,7 @@ export default {
|
|
|
// 序列化当前查询参数列表
|
|
|
queryParams && (this.queryParams.queryMap = queryParams.queryMap);
|
|
|
// 获取当前表单结构信息
|
|
|
- dragTableInfo({queryMap: {sqlkey: this.sqlkey}})
|
|
|
+ dragTableInfo({ queryMap: { sqlkey: this.sqlkey } })
|
|
|
.then((res) => {
|
|
|
// 得到当前模版信息 --- sql columns queryWhere
|
|
|
this.templateInfo = res.data.resultMap;
|
|
@@ -404,9 +404,14 @@ export default {
|
|
|
// 分页查询
|
|
|
pageList(row) {
|
|
|
// 调用子组件-》携带子组件参数请求后台
|
|
|
- this.$refs.mychild.pageList(row == undefined ? {
|
|
|
- limit: this.queryParams.pageSize, page: this.queryParams.pageNum,
|
|
|
- } : row);
|
|
|
+ this.$refs.mychild.pageList(
|
|
|
+ row == undefined
|
|
|
+ ? {
|
|
|
+ limit: this.queryParams.pageSize,
|
|
|
+ page: this.queryParams.pageNum,
|
|
|
+ }
|
|
|
+ : row
|
|
|
+ );
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
@@ -434,7 +439,7 @@ export default {
|
|
|
handleAdd(row) {
|
|
|
// this.reset();
|
|
|
this.defaultValue = {};
|
|
|
- getInfoBySqlKey(this.sqlkey).then(({data}) => {
|
|
|
+ getInfoBySqlKey(this.sqlkey).then(({ data }) => {
|
|
|
if (!data || !data.dfVueTemplate) {
|
|
|
this.$message.error("当前表格未绑定表单!");
|
|
|
return;
|
|
@@ -450,7 +455,7 @@ export default {
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- getInfoBySqlKey(this.sqlkey).then(({data}) => {
|
|
|
+ getInfoBySqlKey(this.sqlkey).then(({ data }) => {
|
|
|
if (!data || !data.dfVueTemplate) {
|
|
|
this.$message.error("当前表格未绑定表单!");
|
|
|
return;
|
|
@@ -529,17 +534,19 @@ export default {
|
|
|
this.$refs.mychild.pageList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- });
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
+ console.log(this.tableList);
|
|
|
+ let primary = camelCase(this.templateInfo.template?.primaryKey);
|
|
|
+ console.log(primary);
|
|
|
if (this.ids.length > 0) {
|
|
|
this.queryParams["execlMap"] = [];
|
|
|
this.ids.forEach((item) => {
|
|
|
this.queryParams.execlMap.push(
|
|
|
this.tableList.find((ttem) => {
|
|
|
- return ttem.id === item;
|
|
|
+ return ttem[primary] === item;
|
|
|
})
|
|
|
);
|
|
|
});
|
|
@@ -562,7 +569,7 @@ export default {
|
|
|
importTemplate() {
|
|
|
this.download(
|
|
|
process.env.VUE_APP_BASE_API3 +
|
|
|
- `dragform/common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.sqlkey}`,
|
|
|
+ `dragform/common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.sqlkey}`,
|
|
|
{},
|
|
|
`下载模版名称${new Date().getTime()}.xlsx`
|
|
|
);
|
|
@@ -578,10 +585,10 @@ export default {
|
|
|
this.$refs.upload.clearFiles();
|
|
|
this.$alert(
|
|
|
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
- response.msg +
|
|
|
- "</div>",
|
|
|
+ response.msg +
|
|
|
+ "</div>",
|
|
|
"导入结果",
|
|
|
- {dangerouslyUseHTMLString: true}
|
|
|
+ { dangerouslyUseHTMLString: true }
|
|
|
);
|
|
|
this.$refs.mychild.pageList({
|
|
|
limit: this.queryParams.pageSize,
|
|
@@ -629,7 +636,7 @@ export default {
|
|
|
updateData.conditionMap[this.templateInfo.template?.primaryKey] =
|
|
|
this.defaultValue[
|
|
|
camelCase(this.templateInfo.template?.primaryKey)
|
|
|
- ];
|
|
|
+ ];
|
|
|
Object.keys(values).map((k) => {
|
|
|
updateData.commMap[k] = values[k];
|
|
|
});
|