|
@@ -38,7 +38,7 @@
|
|
|
:underline="false"
|
|
|
style="font-size: 12px; vertical-align: baseline"
|
|
|
@click="importTemplate"
|
|
|
- >下载模板
|
|
|
+ >下载模板
|
|
|
</el-link>
|
|
|
</div>
|
|
|
</el-upload>
|
|
@@ -60,7 +60,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- >新增
|
|
|
+ >新增
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -71,7 +71,7 @@
|
|
|
size="mini"
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
- >修改
|
|
|
+ >修改
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -82,7 +82,7 @@
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -91,7 +91,7 @@
|
|
|
icon="el-icon-upload2"
|
|
|
size="mini"
|
|
|
@click="upload.open = true"
|
|
|
- >导入
|
|
|
+ >导入
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -101,7 +101,7 @@
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
- >导出
|
|
|
+ >导出
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar
|
|
@@ -114,9 +114,9 @@
|
|
|
: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" />
|
|
|
+ <el-table-column :label="key" align="center" :prop="val"/>
|
|
|
</span>
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
@@ -129,14 +129,14 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- >修改
|
|
|
+ >修改
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -180,12 +180,12 @@ import {
|
|
|
getInfoBySqlKey,
|
|
|
addTableData,
|
|
|
} from "@/api/tablelist/commonTable";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
+import {getToken} from "@/utils/auth";
|
|
|
import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "listInfo",
|
|
|
- components: { Queryfrom },
|
|
|
+ components: {Queryfrom},
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -222,7 +222,7 @@ export default {
|
|
|
// 是否更新已经存在的数据
|
|
|
updateSupport: 0,
|
|
|
// 设置上传的请求头部
|
|
|
- headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ headers: {Authorization: "Bearer " + getToken()},
|
|
|
// 上传的地址
|
|
|
url: process.env.VUE_APP_BASE_API3 + "common/uploadData",
|
|
|
},
|
|
@@ -276,7 +276,7 @@ export default {
|
|
|
// 序列化当前查询参数列表
|
|
|
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;
|
|
@@ -285,7 +285,14 @@ export default {
|
|
|
// 得到查询条件
|
|
|
this.queryFromWhere = res.data.resultMap.where;
|
|
|
// 得到当前列表信息
|
|
|
- this.columns = JSON.parse(this.templateInfo.template.dtColumnName);
|
|
|
+ let test = []
|
|
|
+ test = JSON.parse(this.templateInfo.template.dtColumnName);
|
|
|
+ test.forEach(item => {
|
|
|
+ this.columns = {
|
|
|
+ ...this.columns,
|
|
|
+ ...item,
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
.finally((fes) => {
|
|
|
if (this.templateInfo == {}) return;
|
|
@@ -314,9 +321,9 @@ export default {
|
|
|
this.$refs.mychild.pageList(
|
|
|
row == undefined
|
|
|
? {
|
|
|
- limit: this.queryParams.pageSize,
|
|
|
- page: this.queryParams.pageNum,
|
|
|
- }
|
|
|
+ limit: this.queryParams.pageSize,
|
|
|
+ page: this.queryParams.pageNum,
|
|
|
+ }
|
|
|
: row
|
|
|
);
|
|
|
},
|
|
@@ -344,7 +351,7 @@ export default {
|
|
|
handleAdd(row) {
|
|
|
// this.reset();
|
|
|
this.defaultValue = {};
|
|
|
- getInfoBySqlKey(this.sqlkey).then(({ data }) => {
|
|
|
+ getInfoBySqlKey(this.sqlkey).then(({data}) => {
|
|
|
const htmlCode = data.dfHtmlTemplate;
|
|
|
this.iframeUrl = "data:text/html;charset=utf-8," + encodeURI(htmlCode);
|
|
|
this.jsonData = JSON.parse(data.dfVueTemplate);
|
|
@@ -358,7 +365,7 @@ export default {
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- getInfoBySqlKey(this.sqlkey).then(({ data }) => {
|
|
|
+ getInfoBySqlKey(this.sqlkey).then(({data}) => {
|
|
|
const htmlCode = data.dfHtmlTemplate;
|
|
|
this.iframeUrl = "data:text/html;charset=utf-8," + encodeURI(htmlCode);
|
|
|
Object.assign(this.defaultValue, row);
|
|
@@ -437,7 +444,8 @@ export default {
|
|
|
this.$refs.mychild.pageList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
@@ -470,7 +478,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`
|
|
|
);
|
|
@@ -486,10 +494,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,
|