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 @@
-
-
-
@@ -34,9 +31,9 @@
-
+
-
+
@@ -279,19 +276,19 @@
this.$refs.columnSetting.isSave = true
try {
await config.columnSettingSave(this.name, column)
+ this.$message.success('保存成功')
+ this.$refs.columnSetting.isSave = false
}catch(error){
this.$message.error('保存失败')
this.$refs.columnSetting.isSave = false
}
- this.$message.success('保存成功')
- this.$refs.columnSetting.isSave = false
+
},
//自定义列重置
async columnSettingBack(){
this.$refs.columnSetting.isSave = true
try {
- const column = await config.columnSettingReset(this.name, this.column)
- this.column = column
+ await config.columnSettingReset(this.name, this.column)
this.$refs.columnSetting.column = JSON.parse(JSON.stringify(this.column||[]))
}catch(error){
this.$message.error('重置失败')
diff --git a/src/config/table.js b/src/config/table.js
index 44bf2bc..92fa3da 100644
--- a/src/config/table.js
+++ b/src/config/table.js
@@ -1,5 +1,5 @@
//数据表格配置
-import tool from '@/utils/tool'
+import api from '@/api'
export default {
successCode: 200, //请求完成代码
pageSize: 20, //表格每一页条数
@@ -28,11 +28,11 @@ export default {
*/
columnSettingSave: function(tablename, column) {
return new Promise((resolve) => {
- setTimeout(() => {
- //这里为了演示使用了session和setTimeout演示,开发时应用数据请求
- tool.session.set(tablename, column)
- resolve(true)
- }, 1000)
+
+
+ api.system.table.columnSettingSave(tablename,column);
+
+ resolve(true)
})
},
/**
@@ -43,10 +43,10 @@ export default {
columnSettingReset: function(tablename, column) {
return new Promise((resolve) => {
//这里为了演示使用了session和setTimeout演示,开发时应用数据请求
- setTimeout(() => {
- tool.session.remove(tablename)
- resolve(column)
- }, 1000)
+ // tool.session.remove(tablename)
+
+ api.system.table.columnSettingSave(tablename,[]);
+ resolve(column)
})
}
}
\ No newline at end of file
diff --git a/src/views/system/table/index.vue b/src/views/system/table/index.vue
index 75b824c..24b1057 100644
--- a/src/views/system/table/index.vue
+++ b/src/views/system/table/index.vue
@@ -31,7 +31,17 @@
-
+
@@ -73,7 +83,6 @@
save: false,
stat: false,
},
- columnSetting:false,
isselection:true,
selection: [],
column: [],
diff --git a/src/views/system/tablegen/column.vue b/src/views/system/tablegen/column.vue
index f9b10bc..2a035f7 100644
--- a/src/views/system/tablegen/column.vue
+++ b/src/views/system/tablegen/column.vue
@@ -56,7 +56,7 @@
-
+
@@ -75,7 +75,7 @@
-
+
@@ -87,7 +87,7 @@
-
+
@@ -105,7 +105,7 @@
-
+
@@ -117,7 +117,7 @@
-
+
@@ -143,7 +143,7 @@
-
+
@@ -189,6 +189,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -322,15 +338,14 @@
-
-
+
@@ -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;