From 5108d419f227bb5f0e2faa784bc38f9d78f21ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=99=8C?= Date: Thu, 20 Jul 2023 18:58:16 +0800 Subject: [PATCH] no message --- src/api/model/system.js | 3 ++ src/components/xTable/columnSetting.vue | 63 ++++++++++++++++++++----- src/components/xTable/index.vue | 15 +++--- src/config/table.js | 20 ++++---- src/views/system/table/index.vue | 13 ++++- src/views/system/tablegen/column.vue | 54 +++++++++++++++++---- 6 files changed, 125 insertions(+), 43 deletions(-) diff --git a/src/api/model/system.js b/src/api/model/system.js index 92ff55b..fcde21e 100644 --- a/src/api/model/system.js +++ b/src/api/model/system.js @@ -13,6 +13,9 @@ export default { }, getUpdate: async function(name = '', data=[]) { return await http.post('/system/table/getUpdate', {name:name}, data); + }, + columnSettingSave: async function(name = '', column=[]) { + return await http.post('/system/table/columnSettingSave', {name:name, column:column}); } }, } \ No newline at end of file diff --git a/src/components/xTable/columnSetting.vue b/src/components/xTable/columnSetting.vue index 5d78da0..feb6469 100644 --- a/src/components/xTable/columnSetting.vue +++ b/src/components/xTable/columnSetting.vue @@ -7,6 +7,8 @@ 宽度 排序 表格类型 + 表单类型 + 表单跨度 固定
@@ -29,6 +31,7 @@ + 请选择 用户 徽章 图组 @@ -40,6 +43,34 @@ 自定义组件 + + + 请选择 + Input + 标题占位 + 复选框 + 单选 + 下拉 + 复组组合 + 文件上传 + 多文件上传 + 开关 + 级联选择器 + 日期选择 + 数字 + 颜色选择 + 评分 + 滑块 + 表格选择 + 编辑器 + 文本 + 头像 + 表单表格 + + + + + @@ -51,6 +82,7 @@
+ 重置 保存
@@ -71,16 +103,16 @@ data() { return { isSave: false, - usercolumn: JSON.parse(JSON.stringify(this.column||[])) + usercolumn: this.column || [] } }, watch:{ - usercolumn: { - handler(){ - this.$emit('userChange', this.usercolumn) - }, - deep: true - } + // usercolumn: { + // handler(){ + // this.$emit('userChange', this.usercolumn) + // }, + // deep: true + // } }, mounted() { this.usercolumn.length>0 && this.rowDrop() @@ -100,6 +132,9 @@ } }) }, + Rendering(){ + this.$emit('userChange', this.usercolumn) + }, backDefaul(){ this.$emit('back', this.usercolumn) }, @@ -115,12 +150,13 @@ .setting-column__title {border-bottom: 1px solid #EBEEF5;padding-bottom:15px;} .setting-column__title span {display: inline-block;font-weight: bold;color: #909399;font-size: 12px;} .setting-column__title span.move_b {width: 30px;margin-right:15px;} - .setting-column__title span.show_b {width: 60px;} - .setting-column__title span.name_b {width: 140px;} - .setting-column__title span.width_b {width: 60px;margin-right:15px;} + .setting-column__title span.show_b {width: 58px;} + .setting-column__title span.name_b {width: 138px;} + .setting-column__title span.width_b {width: 72px;} + .setting-column__title span.tablespan {width: 100px;} .setting-column__title span.sortable_b {width: 60px;} - .setting-column__title span.tabletype {width: 160px;} - .setting-column__title span.fixed_b {width: 120px;} + .setting-column__title span.tabletype {width: 120px;} + .setting-column__title span.fixed_b {width: 80px;} .setting-column__list {max-height:314px;overflow: auto;} .setting-column__list li {list-style: none;margin:10px 0;display: flex;align-items: center;} .setting-column__list li>span {display: inline-block;font-size: 12px;} @@ -128,8 +164,9 @@ .setting-column__list li span.show_b {width: 60px;} .setting-column__list li span.name_b {width: 140px;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;cursor:default; padding-right:10px } .setting-column__list li span.width_b {width: 60px;margin-right:15px;} + .setting-column__list li span.tablespan {width: 80px;margin-right:15px;} .setting-column__list li span.sortable_b {width: 60px;} - .setting-column__list li span.tabletype {width: 140px; padding-right:20px;} + .setting-column__list li span.tabletype {width: 120px; padding-right:20px;} .setting-column__list li span.fixed_b {width: 120px;} .setting-column__list li.ghost {opacity: 0.3;} .setting-column__bottom {border-top: 1px solid #EBEEF5;padding-top:15px;text-align: right;} diff --git a/src/components/xTable/index.vue b/src/components/xTable/index.vue index 2ae2dd9..6aaee66 100644 --- a/src/components/xTable/index.vue +++ b/src/components/xTable/index.vue @@ -19,9 +19,6 @@ - - - - - + @@ -423,6 +438,27 @@ }, methods: { + querySearchSubmit(queryString, cb){ + if (this.form.api) { + var lastIndex = this.form.api.lastIndexOf('/'); + var updatedUrl = this.form.api.substring(0, lastIndex + 1) + 'submit'; + cb([{value: updatedUrl}]) + } + }, + querySearchGet(queryString, cb){ + if (this.form.api) { + var lastIndex = this.form.api.lastIndexOf('/'); + var updatedUrl = this.form.api.substring(0, lastIndex + 1) + 'info'; + cb([{value: updatedUrl}]) + } + }, + querySearchDelete(queryString, cb){ + if (this.form.api) { + var lastIndex = this.form.api.lastIndexOf('/'); + var updatedUrl = this.form.api.substring(0, lastIndex + 1) + 'delete'; + cb([{value: updatedUrl}]) + } + }, //显示 open(mode='add'){ this.mode = mode;