1
0
mirror of synced 2025-12-11 00:28:09 +08:00

修复列头标题修改后无法更新问题 #1680

This commit is contained in:
xuliangzhan
2022-05-02 17:32:43 +08:00
parent 2e9091aaaa
commit 16d6160b93
5 changed files with 28 additions and 28 deletions

View File

@@ -120,10 +120,10 @@ export default defineComponent({
filters.forEach(({ property, values }) => {
queryParams[property] = values.join(',')
})
return XEAjax.get(`https://api.xuliangzhan.com:10443/demo/api/pub/page/list/${page.pageSize}/${page.currentPage}`, queryParams)
return XEAjax.get(`https://api.vxetable.cn/demo/api/pub/page/list/${page.pageSize}/${page.currentPage}`, queryParams)
},
delete: ({ body }) => XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body),
save: ({ body }) => XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body)
delete: ({ body }) => XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body),
save: ({ body }) => XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body)
}
},
columns: [
@@ -194,7 +194,7 @@ export default defineComponent({
const $grid = xGrid.value
const formBody = new FormData()
formBody.append('file', file)
return XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/import', formBody).then(data => {
return XEAjax.post('https://api.vxetable.cn/demo/api/pub/import', formBody).then(data => {
VXETable.modal.message({ content: `成功导入 ${data.result.insertRows} 条记录!`, status: 'success' })
// 导入完成,刷新表格
$grid.commitProxy('query')
@@ -228,11 +228,11 @@ export default defineComponent({
})
}
// 开始服务端导出
return XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/export', body).then(data => {
return XEAjax.post('https://api.vxetable.cn/demo/api/pub/export', body).then(data => {
if (data.id) {
VXETable.modal.message({ content: '导出成功,开始下载', status: 'success' })
// 读取路径,请求文件
fetch(`https://api.xuliangzhan.com:10443/demo/api/pub/export/download/${data.id}`).then(response => {
fetch(`https://api.vxetable.cn/demo/api/pub/export/download/${data.id}`).then(response => {
response.blob().then(blob => {
// 开始下载
VXETable.saveFile({ filename: '导出数据', type: 'xlsx', content: blob })
@@ -396,10 +396,10 @@ export default defineComponent({
filters.forEach(({ property, values }) => {
queryParams[property] = values.join(',')
})
return XEAjax.get(\`https://api.xuliangzhan.com:10443/demo/api/pub/page/list/\${page.pageSize}/\${page.currentPage}\`, queryParams)
return XEAjax.get(\`https://api.vxetable.cn/demo/api/pub/page/list/\${page.pageSize}/\${page.currentPage}\`, queryParams)
},
delete: ({ body }) => XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body),
save: ({ body }) => XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body)
delete: ({ body }) => XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body),
save: ({ body }) => XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body)
}
},
columns: [
@@ -469,7 +469,7 @@ export default defineComponent({
const $grid = xGrid.value
const formBody = new FormData()
formBody.append('file', file)
return XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/import', formBody).then(data => {
return XEAjax.post('https://api.vxetable.cn/demo/api/pub/import', formBody).then(data => {
VXETable.modal.message({ content: \`成功导入 \${data.result.insertRows} 条记录!\`, status: 'success' })
// 导入完成,刷新表格
$grid.commitProxy('query')
@@ -503,11 +503,11 @@ export default defineComponent({
})
}
// 开始服务端导出
return XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/export', body).then(data => {
return XEAjax.post('https://api.vxetable.cn/demo/api/pub/export', body).then(data => {
if (data.id) {
VXETable.modal.message({ content: '导出成功,开始下载', status: 'success' })
// 读取路径,请求文件
fetch(\`https://api.xuliangzhan.com:10443/demo/api/pub/export/download/\${data.id}\`).then(response => {
fetch(\`https://api.vxetable.cn/demo/api/pub/export/download/\${data.id}\`).then(response => {
response.blob().then(blob => {
// 开始下载
VXETable.saveFile({ filename: '导出数据', type: 'xlsx', content: blob })

View File

@@ -120,10 +120,10 @@ export default defineComponent({
filters.forEach(({ property, values }) => {
queryParams[property] = values.join(',')
})
return XEAjax.get(`https://api.xuliangzhan.com:10443/demo/api/pub/page/list/${page.pageSize}/${page.currentPage}`, queryParams)
return XEAjax.get(`https://api.vxetable.cn/demo/api/pub/page/list/${page.pageSize}/${page.currentPage}`, queryParams)
},
// 被某些特殊功能所触发,例如:导出数据 mode=all 时,会触发该方法并对返回的数据进行导出
queryAll: () => fetch('https://api.xuliangzhan.com:10443/demo/api/pub/all').then(response => response.json())
queryAll: () => fetch('https://api.vxetable.cn/demo/api/pub/all').then(response => response.json())
}
},
toolbarConfig: {
@@ -297,10 +297,10 @@ export default defineComponent({
filters.forEach(({ property, values }) => {
queryParams[property] = values.join(',')
})
return XEAjax.get(\`https://api.xuliangzhan.com:10443/demo/api/pub/page/list/\${page.pageSize}/\${page.currentPage}\`, queryParams)
return XEAjax.get(\`https://api.vxetable.cn/demo/api/pub/page/list/\${page.pageSize}/\${page.currentPage}\`, queryParams)
},
// 被某些特殊功能所触发,例如:导出数据 mode=all 时,会触发该方法并对返回的数据进行导出
queryAll: () => fetch('https://api.xuliangzhan.com:10443/demo/api/pub/all').then(response => response.json())
queryAll: () => fetch('https://api.vxetable.cn/demo/api/pub/all').then(response => response.json())
}
},
toolbarConfig: {

View File

@@ -74,7 +74,7 @@ export default defineComponent({
const loadList = async () => {
demo1.loading = true
try {
const res = await fetch('https://api.xuliangzhan.com:10443/demo/api/pub/all').then(response => response.json())
const res = await fetch('https://api.vxetable.cn/demo/api/pub/all').then(response => response.json())
demo1.tableData = res
} catch (e) {
demo1.tableData = []
@@ -104,7 +104,7 @@ export default defineComponent({
demo1.loading = true
try {
const body = { removeRecords: checkboxRecords }
await XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body)
await XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body)
await loadList()
} catch (e) {}
demo1.loading = false
@@ -123,7 +123,7 @@ export default defineComponent({
demo1.loading = true
try {
const body = { removeRecords: [row] }
await XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body)
await XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body)
await loadList()
} catch (e) {}
}
@@ -142,7 +142,7 @@ export default defineComponent({
demo1.loading = true
try {
const body = { insertRecords, removeRecords, updateRecords }
await XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body)
await XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body)
await loadList()
VXETable.modal.message({ content: `操作成功,新增 ${insertRecords.length} 条,更新 ${updateRecords.length} 条,删除 ${removeRecords.length}`, status: 'success' })
} catch (e) {
@@ -235,7 +235,7 @@ export default defineComponent({
const loadList = async () => {
demo1.loading = true
try {
const res = await fetch('https://api.xuliangzhan.com:10443/demo/api/pub/all').then(response => response.json())
const res = await fetch('https://api.vxetable.cn/demo/api/pub/all').then(response => response.json())
demo1.tableData = res
} catch (e) {
demo1.tableData = []
@@ -265,7 +265,7 @@ export default defineComponent({
demo1.loading = true
try {
const body = { removeRecords: checkboxRecords }
await XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body)
await XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body)
await loadList()
} catch (e) {}
demo1.loading = false
@@ -284,7 +284,7 @@ export default defineComponent({
demo1.loading = true
try {
const body = { removeRecords: [row] }
await XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body)
await XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body)
await loadList()
} catch (e) {}
}
@@ -303,7 +303,7 @@ export default defineComponent({
demo1.loading = true
try {
const body = { insertRecords, removeRecords, updateRecords }
await XEAjax.post('https://api.xuliangzhan.com:10443/demo/api/pub/save', body)
await XEAjax.post('https://api.vxetable.cn/demo/api/pub/save', body)
await loadList()
VXETable.modal.message({ content: \`操作成功,新增 \${insertRecords.length} 条,更新 \${updateRecords.length} 条,删除 \${removeRecords.length}\`, status: 'success' })
} catch (e) {