|
@@ -41,7 +41,7 @@
|
|
|
:underline="false"
|
|
|
style="font-size: 12px; vertical-align: baseline"
|
|
|
@click="importTemplate"
|
|
|
- >下载模板
|
|
|
+ >下载模板
|
|
|
</el-link>
|
|
|
</div>
|
|
|
</el-upload>
|
|
@@ -64,7 +64,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- >新增
|
|
|
+ >新增
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5" v-if="false">
|
|
@@ -75,7 +75,7 @@
|
|
|
size="mini"
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
- >修改
|
|
|
+ >修改
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -86,7 +86,7 @@
|
|
|
size="mini"
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -95,7 +95,7 @@
|
|
|
icon="el-icon-upload2"
|
|
|
size="mini"
|
|
|
@click="upload.open = true"
|
|
|
- >导入
|
|
|
+ >导入
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -105,7 +105,7 @@
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
- >导出
|
|
|
+ >导出
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar
|
|
@@ -153,7 +153,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- >修改
|
|
|
+ >修改
|
|
|
</el-button>
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item>
|
|
@@ -162,7 +162,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
@@ -211,14 +211,14 @@ 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 { inputDisableComplete } from "@/utils/other";
|
|
|
+import {camelCase} from "@/utils";
|
|
|
+import {inputDisableComplete} from "@/utils/other";
|
|
|
|
|
|
export default {
|
|
|
name: "listInfo",
|
|
|
- components: { Queryfrom },
|
|
|
+ components: {Queryfrom},
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -257,18 +257,18 @@ export default {
|
|
|
// 是否更新已经存在的数据
|
|
|
updateSupport: 0,
|
|
|
// 设置上传的请求头部
|
|
|
- headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ headers: {Authorization: "Bearer " + getToken()},
|
|
|
// 上传的地址
|
|
|
url: process.env.VUE_APP_BASE_API3 + "common/uploadData",
|
|
|
},
|
|
|
// 排序方式 默认降序
|
|
|
- sortState: true,
|
|
|
+ sortOrder: true,
|
|
|
// 共通查询参数接受子组件的参数
|
|
|
queryParams: {
|
|
|
pageNum: 1, // 第几页
|
|
|
pageSize: 10, // 每页大小
|
|
|
orderByColumn: "", // 根据某列排序
|
|
|
- isAsc: this.sortState ? "DESC" : "ASC", // desc(降序)或 asc(升序)
|
|
|
+ isAsc: "", // desc(降序)或 asc(升序)
|
|
|
// 基本查询参数
|
|
|
basicMap: {
|
|
|
tableName: "drag_form",
|
|
@@ -367,13 +367,15 @@ 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;
|
|
|
this.queryParams.orderByColumn =
|
|
|
res.data.resultMap.querySql.orderByColumn;
|
|
|
- this.queryParams.isAsc = res.data.resultMap.querySql.sortOrder;
|
|
|
+ this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
|
|
|
+ // 根据拖拽时设置当前列表排列顺序
|
|
|
+ this.queryParams.isAsc = this.sortOrder ? "DESC" : "ASC"
|
|
|
this.tableName = this.templateInfo.template.dtTableName;
|
|
|
// 得到查询条件
|
|
|
this.queryFromWhere = res.data.resultMap.where;
|
|
@@ -419,9 +421,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
|
|
|
);
|
|
|
},
|
|
@@ -451,7 +453,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;
|
|
@@ -468,7 +470,7 @@ export default {
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- getInfoBySqlKey(this.sqlkey).then(({ data }) => {
|
|
|
+ getInfoBySqlKey(this.sqlkey).then(({data}) => {
|
|
|
if (!data || !data.dfVueTemplate) {
|
|
|
this.$message.error("当前表格未绑定表单!");
|
|
|
return;
|
|
@@ -547,7 +549,8 @@ export default {
|
|
|
this.$refs.mychild.pageList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
@@ -580,7 +583,7 @@ export default {
|
|
|
importTemplate() {
|
|
|
this.download(
|
|
|
process.env.VUE_APP_BASE_API3 +
|
|
|
- `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.sqlkey}`,
|
|
|
+ `common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.sqlkey}`,
|
|
|
{},
|
|
|
`下载模版名称${new Date().getTime()}.xlsx`
|
|
|
);
|
|
@@ -596,10 +599,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,
|
|
@@ -647,7 +650,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];
|
|
|
});
|