1
This commit is contained in:
@@ -11,7 +11,7 @@ class ai_messagesClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/ai_messages/export", row);
|
||||
let res = window.framework.http.fileExport("/ai_messages/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class gamesClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/gme_games/export", row);
|
||||
let res = window.framework.http.fileExport("/gme_games/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class paymentOrdersClServer {
|
||||
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/pay_orders/export", row);
|
||||
let res = window.framework.http.fileExport("/pay_orders/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export function del(params) {
|
||||
|
||||
// 导出资源
|
||||
export function exportData(params) {
|
||||
return http.fileExport('/gal_resources/export', params)
|
||||
return window.framework.http.fileExport('/gal_resources/export', params)
|
||||
}
|
||||
|
||||
// 获取所有资源
|
||||
|
||||
@@ -13,7 +13,7 @@ class venuesClServer {
|
||||
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/ven_venues/export", row);
|
||||
let res = window.framework.http.fileExport("/ven_venues/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class walletTransactionsClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/wch_wallet_transactions/export", row);
|
||||
let res = window.framework.http.fileExport("/wch_wallet_transactions/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class walletsClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/wch_wallets/export", row);
|
||||
let res = window.framework.http.fileExport("/wch_wallets/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
class wch_usersClServer {
|
||||
async all(param) {
|
||||
let res= await window.framework.http.get('/wch_users/all', param);
|
||||
@@ -13,7 +12,7 @@ class wch_usersClServer {
|
||||
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/wch_users/export", row);
|
||||
let res = window.framework.http.fileExport("/wch_users/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class infoClServer {
|
||||
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/inf_info/export", row);
|
||||
let res = window.framework.http.fileExport("/inf_info/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class info_typeClServer {
|
||||
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/inf_info_type/export", row);
|
||||
let res = window.framework.http.fileExport("/inf_info_type/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class ntr_questionsClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/ntr_questions/export", row);
|
||||
let res = window.framework.http.fileExport("/ntr_questions/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class ntr_recordsClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/ntr_records/export", row);
|
||||
let res = window.framework.http.fileExport("/ntr_records/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class transfer_detailsClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/transfer_details/export", row);
|
||||
let res = window.framework.http.fileExport("/transfer_details/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class systemTypeClServer {
|
||||
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/sys_project_type/export", row);
|
||||
let res = window.framework.http.fileExport("/sys_project_type/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class UserServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/sys_user/export", row);
|
||||
let res = window.framework.http.fileExport("/sys_user/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class recommend_blocksClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/recommend_blocks/export", row);
|
||||
let res = window.framework.http.fileExport("/recommend_blocks/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class user_followsClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/user_follows/export", row);
|
||||
let res = window.framework.http.fileExport("/user_follows/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class user_trackingClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/user_tracking/export", row);
|
||||
let res = window.framework.http.fileExport("/user_tracking/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class wch_citiesClServer {
|
||||
}
|
||||
|
||||
async exportCsv(row) {
|
||||
let res = http.fileExport("/wch_cities/export", row);
|
||||
let res = window.framework.http.fileExport("/wch_cities/export", row);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
<template>
|
||||
<div style="padding: 20px;">
|
||||
<Card>
|
||||
<p slot="title">
|
||||
<Icon type="ios-cube" />
|
||||
自定义页面示例
|
||||
</p>
|
||||
|
||||
<div style="margin-bottom: 20px;">
|
||||
<Alert type="success" show-icon>
|
||||
这是一个自定义页面组件示例,展示如何在 Admin Framework 中添加自定义页面。
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
<Row :gutter="16">
|
||||
<Col span="12">
|
||||
<Card title="基本信息" style="margin-bottom: 16px;">
|
||||
<p><strong>当前时间:</strong> {{ currentTime }}</p>
|
||||
<p><strong>页面路径:</strong> {{ $route.path }}</p>
|
||||
<p><strong>框架版本:</strong> {{ framework.version }}</p>
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col span="12">
|
||||
<Card title="Vuex 状态" style="margin-bottom: 16px;">
|
||||
<p><strong>自定义数据:</strong> {{ customData }}</p>
|
||||
<p><strong>计数器:</strong> {{ count }}</p>
|
||||
<div style="margin-top: 10px;">
|
||||
<Button type="primary" @click="handleIncrement">增加计数</Button>
|
||||
<Button type="default" @click="handleIncrementAsync" style="margin-left: 8px;">
|
||||
异步增加
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Card title="API 测试" style="margin-bottom: 16px;">
|
||||
<Form :label-width="80">
|
||||
<FormItem label="请求地址">
|
||||
<Input v-model="apiUrl" placeholder="输入 API 地址" />
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<Button type="primary" @click="handleApiTest" :loading="apiLoading">
|
||||
发送请求
|
||||
</Button>
|
||||
<Button @click="handleClear" style="margin-left: 8px;">清空结果</Button>
|
||||
</FormItem>
|
||||
<FormItem label="响应结果" v-if="apiResult">
|
||||
<pre style="background: #f5f5f5; padding: 10px; border-radius: 4px;">{{ apiResult }}</pre>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Card>
|
||||
|
||||
<Card title="UI 工具测试">
|
||||
<Button type="success" @click="showSuccess">成功提示</Button>
|
||||
<Button type="warning" @click="showWarning" style="margin-left: 8px;">警告提示</Button>
|
||||
<Button type="error" @click="showError" style="margin-left: 8px;">错误提示</Button>
|
||||
<Button type="info" @click="showConfirm" style="margin-left: 8px;">确认对话框</Button>
|
||||
</Card>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapActions, mapMutations } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'CustomPage',
|
||||
data() {
|
||||
return {
|
||||
currentTime: new Date().toLocaleString(),
|
||||
timer: null,
|
||||
apiUrl: '/api/test',
|
||||
apiLoading: false,
|
||||
apiResult: null,
|
||||
framework: window.framework
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('custom', ['customData', 'count'])
|
||||
},
|
||||
methods: {
|
||||
...mapMutations('custom', ['INCREMENT']),
|
||||
...mapActions('custom', ['incrementAsync', 'updateCustomData']),
|
||||
|
||||
// 增加计数
|
||||
handleIncrement() {
|
||||
this.INCREMENT()
|
||||
this.$Message.success('计数已增加')
|
||||
},
|
||||
|
||||
// 异步增加
|
||||
handleIncrementAsync() {
|
||||
this.$Message.info('1秒后增加计数...')
|
||||
this.incrementAsync()
|
||||
},
|
||||
|
||||
// API 测试
|
||||
async handleApiTest() {
|
||||
this.apiLoading = true
|
||||
this.apiResult = null
|
||||
|
||||
try {
|
||||
const response = await this.$http.get(this.apiUrl)
|
||||
this.apiResult = JSON.stringify(response.data, null, 2)
|
||||
this.$Message.success('请求成功')
|
||||
} catch (error) {
|
||||
this.apiResult = JSON.stringify({
|
||||
error: error.message,
|
||||
details: error.toString()
|
||||
}, null, 2)
|
||||
this.$Message.error('请求失败: ' + error.message)
|
||||
} finally {
|
||||
this.apiLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// 清空结果
|
||||
handleClear() {
|
||||
this.apiResult = null
|
||||
},
|
||||
|
||||
// UI 工具测试
|
||||
showSuccess() {
|
||||
window.framework.uiTool.success('这是一个成功提示')
|
||||
},
|
||||
|
||||
showWarning() {
|
||||
window.framework.uiTool.warning('这是一个警告提示')
|
||||
},
|
||||
|
||||
showError() {
|
||||
window.framework.uiTool.error('这是一个错误提示')
|
||||
},
|
||||
|
||||
showConfirm() {
|
||||
window.framework.uiTool.confirm('确定要执行此操作吗?').then(() => {
|
||||
this.$Message.success('已确认')
|
||||
}).catch(() => {
|
||||
this.$Message.info('已取消')
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 定时更新时间
|
||||
this.timer = setInterval(() => {
|
||||
this.currentTime = new Date().toLocaleString()
|
||||
}, 1000)
|
||||
|
||||
console.log('CustomPage 组件已挂载')
|
||||
console.log('可用的工具函数:', this.$tools)
|
||||
console.log('可用的 UI 工具:', this.$uiTool)
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
pre {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@ import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import Vuex from 'vuex'
|
||||
import ViewUI from 'view-design'
|
||||
import axios from 'axios'
|
||||
|
||||
|
||||
// 引入样式
|
||||
import 'view-design/dist/styles/iview.css'
|
||||
@@ -19,7 +19,7 @@ Vue.use(ViewUI)
|
||||
|
||||
// 配置参数
|
||||
const config = {
|
||||
title: 'Admin Framework Demo',
|
||||
title: 'tennis管理系统',
|
||||
apiUrl: 'http://localhost:9098/admin_api/', // 修改为你的 API 地址
|
||||
uploadUrl: 'http://localhost:9098/admin_api/upload' // 修改为你的上传地址
|
||||
}
|
||||
|
||||
@@ -38,8 +38,6 @@ import UserTracking from '../views/users/user_tracking.vue'
|
||||
import WchCities from '../views/users/wch_cities.vue'
|
||||
import WchProfessions from '../views/users/wch_professions.vue'
|
||||
|
||||
// ========== 自定义组件 ==========
|
||||
import CustomPage from '../components/CustomPage.vue'
|
||||
|
||||
/**
|
||||
* 组件映射对象
|
||||
@@ -105,9 +103,7 @@ const componentMap = {
|
||||
"users/wch_professions.vue": WchProfessions,
|
||||
"users/wch_professions": WchProfessions,
|
||||
|
||||
// ===== 自定义组件 =====
|
||||
'custom/page': CustomPage,
|
||||
'custom/page.vue': CustomPage
|
||||
|
||||
}
|
||||
|
||||
export default componentMap
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
|
||||
import user_followsServer from '@/api/users/user_follows_server.js'
|
||||
export default {
|
||||
data() {
|
||||
@@ -43,7 +41,6 @@ export default {
|
||||
{ key: 'following_id', value: '被关注者ID' },
|
||||
{ key: 'nickname', value: '用户昵称' }
|
||||
],
|
||||
seachTypePlaceholder: '请选择搜索类型',
|
||||
gridOption: {
|
||||
param: {
|
||||
seachOption: {
|
||||
@@ -88,14 +85,31 @@ export default {
|
||||
},
|
||||
},
|
||||
]
|
||||
return window.framework.uiTool.getBtn(h, btns)
|
||||
return uiTool.getBtn(h, btns)
|
||||
},
|
||||
}
|
||||
],
|
||||
editColumns: [
|
||||
{ title: '关注者ID', key: 'follower_id', type: 'number', required: true },
|
||||
{ title: '被关注者ID', key: 'following_id', type: 'number', required: true },
|
||||
{ title: '关注时间', key: 'follow_time', type: 'datetime' }
|
||||
{
|
||||
title: '关注者ID',
|
||||
key: 'follower_id',
|
||||
data_type: 'number',
|
||||
com: 'InputNumber',
|
||||
is_show_edit: 1
|
||||
},
|
||||
{
|
||||
title: '被关注者ID',
|
||||
key: 'following_id',
|
||||
data_type: 'number',
|
||||
com: 'InputNumber',
|
||||
is_show_edit: 1
|
||||
},
|
||||
{
|
||||
title: '关注时间',
|
||||
key: 'follow_time',
|
||||
com: 'DatePicker',
|
||||
is_show_edit: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -111,13 +125,25 @@ export default {
|
||||
});
|
||||
},
|
||||
showAddWarp() {
|
||||
this.$refs.editModal.showModal();
|
||||
this.$refs.editModal.addShow({
|
||||
'follower_id': null,
|
||||
'following_id': null,
|
||||
'follow_time': null
|
||||
}, async (newRow) => {
|
||||
let res = await user_followsServer.add(newRow)
|
||||
rootVue.$Message.success('新增成功!')
|
||||
this.query(1)
|
||||
})
|
||||
},
|
||||
showEditWarp(row) {
|
||||
this.$refs.editModal.showModal(row);
|
||||
this.$refs.editModal.editShow(row, async (newRow) => {
|
||||
let res = await user_followsServer.edit(newRow)
|
||||
rootVue.$Message.success('修改成功!')
|
||||
this.query(1)
|
||||
})
|
||||
},
|
||||
delConfirm(row) {
|
||||
window.framework.uiTool.delConfirm(async () => {
|
||||
uiTool.delConfirm(async () => {
|
||||
await user_followsServer.del(row)
|
||||
rootVue.$Message.success('删除成功!')
|
||||
this.query(1)
|
||||
@@ -125,7 +151,7 @@ export default {
|
||||
},
|
||||
exportCsv() {
|
||||
user_followsServer.exportCsv(this.gridOption.param).then(res => {
|
||||
window.framework.funTool.downloadFile(res, '用户关注关系.csv');
|
||||
window.framework. funTool.downloadFile(res, '用户关注关系.csv');
|
||||
});
|
||||
},
|
||||
resetQuery() {
|
||||
|
||||
Reference in New Issue
Block a user