generated from Leo_Ding/web-template
Compare commits
No commits in common. "ff9383d79fb8781e0f272b70dd35383c638c0006" and "644cecc5218a38b19e20b135177a4b6f5bb8e40f" have entirely different histories.
ff9383d79f
...
644cecc521
2
.env.dev
2
.env.dev
@ -12,7 +12,7 @@ VITE_ROUTER_BASE=/
|
||||
VITE_ROUTER_HISTORY=hash
|
||||
|
||||
# api
|
||||
VITE_API_BASIC=http://10.10.1.22:8040
|
||||
VITE_API_BASIC=http://10.10.1.21:8040
|
||||
VITE_API_HTTP=/api/v1/
|
||||
# storage
|
||||
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
||||
@ -3,7 +3,7 @@ export default () => ({
|
||||
port: 8080,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://10.10.1.22:8040/api',
|
||||
target: 'http://10.10.1.21:8040/api',
|
||||
// target: 'http://127.0.0.1:8045/api',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace('/api', ''),
|
||||
|
||||
@ -5,7 +5,7 @@ import request from '@/utils/request'
|
||||
// 获取待审核列表
|
||||
export const getPageList = (params) => request.basic.get('/api/v1/contractPendingList', params)
|
||||
// 审核
|
||||
export const review = (params) => request.basic.post(`/api/v1/contractPendingList/review`,params)
|
||||
export const review = (id) => request.basic.post(`/api/v1/contractPendingList/review`,params)
|
||||
//合同详情
|
||||
export const getInfo=(id)=>request.basic.get('/api/v1/contractPendingList/'+id)
|
||||
// 审核失败列表
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
/**
|
||||
* 算力券接口
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
// 获取列表
|
||||
export const getPageList = (params) => request.basic.get('/api/v1/mirror', params)
|
||||
// 新增
|
||||
export const addVouchers = (params) => request.basic.post(`/api/v1/mirror`,params)
|
||||
// 编辑
|
||||
export const editeVouchers = (id,params) => request.basic.put(`/api/v1/mirror/${id}`, params)
|
||||
// 删除
|
||||
export const deleteVouchers = (id) => request.basic.delete('/api/v1/mirror/'+id)
|
||||
// 获取详情
|
||||
export const getImagesInfo = (params) => request.basic.get('/api/v1/mirror')
|
||||
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
/**
|
||||
* 提现接口
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
// 获取待审核列表
|
||||
export const getPageList = (params) => request.basic.get('/api/v1/pendingReviewList', params)
|
||||
// 审核
|
||||
export const review = (params) => request.basic.post(`/api/v1/review`,params)
|
||||
// 审核拒绝列表
|
||||
export const getFaildList = (params) => request.basic.get('/api/v1/withdrawRejectList', params)
|
||||
// 待提现列表
|
||||
export const getPendingList = (params) => request.basic.get('/api/v1/withdrawList', params)
|
||||
// 提现确认
|
||||
export const pendingUpload = (params) => request.basic.post('/api/v1/withdrawChecked', params)
|
||||
// 提现失败列表
|
||||
export const getPendingFaildList = (params) => request.basic.get('/api/v1/withdrawErrorList', params)
|
||||
//提现成功列表
|
||||
export const getInvoicingFailedList=(params)=>request.basic.get('/api/v1/withdrawSuccessList',params)
|
||||
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
/**
|
||||
* 算力券接口
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
// 获取列表
|
||||
export const getPageList = (params) => request.basic.get('/api/v1/vouchers', params)
|
||||
// 新增
|
||||
export const addVouchers = (params) => request.basic.post(`/api/v1/vouchers`,params)
|
||||
// 编辑
|
||||
export const editeVouchers = (params) => request.basic.put(`/api/v1/vouchers${params.id}`, params)
|
||||
// 删除
|
||||
export const deleteVouchers = (id) => request.basic.delete('/api/v1/vouchers/'+id)
|
||||
|
||||
//算力点列表
|
||||
export const getPointList=(params)=>request.basic.get('/api/v1/points',params)
|
||||
|
||||
//新增算力点
|
||||
export const addPoint=(params)=>request.basic.post('/api/v1/points',params)
|
||||
|
||||
|
||||
//余额列表
|
||||
export const getBalanceList=(params)=>request.basic.get('/api/v1/balances',params)
|
||||
//新增余额
|
||||
export const addBalance=(params)=>request.basic.post('/api/v1/balances',params)
|
||||
|
||||
//实例订单
|
||||
export const getOrderList=(params)=>request.basic.get('/api/v1/orders',params)
|
||||
|
||||
@ -71,36 +71,6 @@ class DisabledDict extends BaseDict {
|
||||
])
|
||||
}
|
||||
}
|
||||
//镜像类型
|
||||
class ImgType extends BaseDict{
|
||||
constructor(){
|
||||
super([
|
||||
['USER','用户镜像'],
|
||||
['SYSTEM','系统镜像']
|
||||
])
|
||||
}
|
||||
}
|
||||
//计费方式
|
||||
class PayType extends BaseDict{
|
||||
constructor(){
|
||||
super([
|
||||
['PayOnTime','按时付费'],
|
||||
['PayOnDay','按日付费'],
|
||||
['PayOnWeek','按周付费'],
|
||||
['PayOnMonth','按月付费'],
|
||||
['PayOnYear','按年付费'],
|
||||
])
|
||||
}
|
||||
}
|
||||
//算力券状态
|
||||
class TicketStatus extends BaseDict{
|
||||
constructor(){
|
||||
super([
|
||||
['ENABLED','启用'],
|
||||
['DISABLED','禁用'],
|
||||
])
|
||||
}
|
||||
}
|
||||
//如何使用:import {payTypeDict} from '@/enums/dict
|
||||
//获取下拉框列表:payTypeDict.options
|
||||
//获取label:payTypeDict.getLabel(1)
|
||||
@ -109,6 +79,3 @@ export const payStatusDict = new PayStatusDict()
|
||||
export const authenticationDict = new AuthenticationDict()
|
||||
export const authenticationTypeDict = new AuthenticationTypeDict()
|
||||
export const disabledDict = new DisabledDict()
|
||||
export const imgType =new ImgType()
|
||||
export const payType=new PayType()
|
||||
export const ticketStatus=new TicketStatus()
|
||||
|
||||
@ -16,7 +16,7 @@ export default [
|
||||
{
|
||||
path: 'balanceList',
|
||||
name: 'balanceList',
|
||||
component: 'balance/index.vue',
|
||||
component: 'balance/balanceList/index.vue',
|
||||
meta: {
|
||||
title: '余额列表',
|
||||
isMenu: true,
|
||||
|
||||
@ -1,30 +1,64 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||
@ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules">
|
||||
<a-form-item label="金额" name="amount">
|
||||
<a-input-number v-model:value="formData.amount" :precision="2" style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
<a-modal :open="modal.open" :title="modal.title" :width="640" :confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose" :cancel-text="cancelText" :ok-text="okText" @ok="handleOk" @cancel="handleCancel">
|
||||
<a-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="$t('pages.system.role.form.name')" name="name">
|
||||
<a-input v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="$t('pages.system.role.form.sequence')" name="sequence">
|
||||
<a-input :defaultValue="0" type="number" v-model:value="formData.sequence"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="$t('pages.system.role.form.status')" name="status">
|
||||
<a-radio-group v-model:value="formData.status" :options="[
|
||||
{ label: $t('pages.system.role.form.status.enabled'), value: 'enabled' },
|
||||
{ label: $t('pages.system.role.form.status.disabled'), value: 'disabled' },
|
||||
]"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'描述'">
|
||||
<a-textarea v-model:value="formData.description"></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item :label="'上传图片'" name="permissions">
|
||||
<GxUpload :fileNumber="1" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { ref, watch } from 'vue'
|
||||
import { config } from '@/config'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal } from '@/hooks'
|
||||
|
||||
import GxUpload from '@/components/GxUpload/index.vue'
|
||||
const emit = defineEmits(['ok'])
|
||||
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRef, formRules, formRecord, formData, resetForm } = useForm()
|
||||
|
||||
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const cancelText = ref(t('button.cancel'))
|
||||
const okText = ref(t('button.confirm'))
|
||||
formData.value.enabled='enabled'
|
||||
formRules.value = {
|
||||
point: { required: true, message: '请输入金额' },
|
||||
changeType:{required:true,message:'请选择变更类型'}
|
||||
name: { required: true, message: t('pages.system.role.form.name.placeholder') },
|
||||
code: { required: true, message: t('pages.system.role.form.code.placeholder') },
|
||||
status: { required: true, message: t('pages.system.role.form.status.placeholder') },
|
||||
}
|
||||
|
||||
/**
|
||||
@ -33,19 +67,34 @@ formRules.value = {
|
||||
function handleCreate() {
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: '新增算力点',
|
||||
title: t('pages.system.role.add'),
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function handleEdit(record = {}) {
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '添加余额',
|
||||
title: t('pages.system.role.edit'),
|
||||
})
|
||||
formData.value = cloneDeep(record)
|
||||
|
||||
const { data, success } = await apis.role.getRole(record.id).catch()
|
||||
if (!success) {
|
||||
message.error(t('component.message.error.save'))
|
||||
hideModal()
|
||||
return
|
||||
}
|
||||
let menus = []
|
||||
if (data.menus) {
|
||||
for (let item of data.menus) {
|
||||
menus.push(item.menu_id)
|
||||
}
|
||||
}
|
||||
checkedKeys.value = menus
|
||||
formRecord.value = data
|
||||
formData.value = cloneDeep(data)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -57,25 +106,22 @@ function handleOk() {
|
||||
.then(async (values) => {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
balanceId:formData.value.id,
|
||||
amount:formData.value.amount,
|
||||
}
|
||||
const params = {...values}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.vouchers.addPoint(params).catch(() => {
|
||||
result = await apis.banner.createBanner(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.vouchers.addBalance(params).catch(() => {
|
||||
result = await apis.banner.updateBanner(formData.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (result.success) {
|
||||
if (config('http.code.success') === result?.success) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
@ -100,6 +146,7 @@ function handleCancel() {
|
||||
*/
|
||||
function onAfterClose() {
|
||||
resetForm()
|
||||
hideLoading()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
||||
@ -4,20 +4,16 @@
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item :label="$t('pages.system.role.form.name')" name="name">
|
||||
<a-input :placeholder="$t('pages.system.role.form.code.placeholder')"
|
||||
v-model:value="searchFormData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<a-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
{{ $t('button.search') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
@ -25,68 +21,109 @@
|
||||
</a-form>
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<!-- <p><a-button type="primary" @click="$refs.editDialogRef.handleCreate()">新增</a-button></p> -->
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.dataIndex">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">添加余额</x-action-button>
|
||||
<!-- <x-action-button @click="handleDelete(record)">删除</x-action-button> -->
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
<a-row :gutter="8" :wrap="false">
|
||||
<a-col flex="auto">
|
||||
<a-card type="flex">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button v-action="'add'" type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
添加图片
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" :pagination="paginationState"
|
||||
:scroll="{ x: 1000 }" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'statusType' === column.key">
|
||||
<!--状态-->
|
||||
<a-tag v-if="statusTypeEnum.is('enabled', record.status)" color="processing">
|
||||
{{ statusTypeEnum.getDesc(record.status) }}
|
||||
</a-tag>
|
||||
<!--状态-->
|
||||
<a-tag v-if="statusTypeEnum.is('disabled', record.status)" color="processing">
|
||||
{{ statusTypeEnum.getDesc(record.status) }}
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="'createAt' === column.key">
|
||||
{{ formatUtcDateTime(record.created_at) }}
|
||||
</template>
|
||||
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||
<a-tooltip>
|
||||
<template #title> {{ $t('pages.system.role.edit') }}</template>
|
||||
<edit-outlined />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
<x-action-button @click="handleRemove(record)">
|
||||
<a-tooltip>
|
||||
<template #title> {{ $t('pages.system.delete') }}</template>
|
||||
<delete-outlined style="color: #ff4d4f" />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import apis from '@/apis'
|
||||
import { formatUtcDateTime } from '@/utils/util'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
import { statusTypeEnum } from '@/enums/system'
|
||||
import { usePagination, useForm } from '@/hooks'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineOptions({
|
||||
name: 'balance',
|
||||
name: 'systemRole',
|
||||
})
|
||||
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'userName' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '变更前', dataIndex: 'balanceBeforeChange',customRender: ({ text }) => '¥'+text },
|
||||
{ title: '变更后', dataIndex: 'remainingBalance',customRender: ({ text }) => '¥'+text },
|
||||
{ title: '变更量', dataIndex: 'changeAmount',customRender: ({ text }) => '¥'+text },
|
||||
{ title: '变更时间', dataIndex: 'lastChangeTime' },
|
||||
{ title: '变更类型', dataIndex: 'changeType' },
|
||||
{ title: '操作', dataIndex: 'action',align:'center' },
|
||||
{ title: '缩略图', dataIndex: 'code', width: 240 },
|
||||
{ title: '名称', dataIndex: 'name' },
|
||||
{ title: t('pages.system.role.form.status'), dataIndex: 'status', key: 'statusType', width: 80 },
|
||||
{ title: t('pages.system.role.form.sequence'), dataIndex: 'sequence', width: 100 },
|
||||
{ title: t('pages.system.role.form.created_at'), key: 'createAt', fixed: 'right', width: 120 },
|
||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
|
||||
const { listData, loading, showLoading, hideLoading, paginationState, searchFormData, resetPagination } =
|
||||
usePagination()
|
||||
const { resetForm } = useForm()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
* 获取用户列表
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data,total } = await apis.vouchers
|
||||
.getBalanceList({
|
||||
const { success, data, total } = await apis.role
|
||||
.getRoleList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
...searchFormData.value,
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
if (config('http.code.success') === success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
@ -96,30 +133,23 @@ async function getPageList() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* 移除
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
function handleDelete({ id }) {
|
||||
function handleRemove({ id }) {
|
||||
Modal.confirm({
|
||||
title: '删除提示',
|
||||
content: '确认删除?',
|
||||
title: t('pages.system.role.delTip'),
|
||||
content: t('button.confirm'),
|
||||
okText: t('button.confirm'),
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { code } = await apis.vouchers.deleteVouchers(id).catch(() => {
|
||||
const { success } = await apis.role.delRole(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === code) {
|
||||
if (config('http.code.success') === success) {
|
||||
resolve()
|
||||
message.success('删除成功')
|
||||
message.success(t('component.message.success.delete'))
|
||||
await getPageList()
|
||||
}
|
||||
} catch (error) {
|
||||
@ -132,17 +162,7 @@ function handleDelete({ id }) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 密度
|
||||
* @param {string} key
|
||||
*/
|
||||
function handleSize({ key }) {
|
||||
size.value = key
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格发生改变
|
||||
* @param current
|
||||
* @param pageSize
|
||||
* 分页
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
@ -150,12 +170,6 @@ function onTableChange({ current, pageSize }) {
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
@ -164,6 +178,22 @@ function handleResetSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetForm()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑完成
|
||||
*/
|
||||
async function onOk() {
|
||||
await getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@ -1,49 +1,222 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||
@ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules">
|
||||
<a-form-item label="算力点" name="point">
|
||||
<a-input-number v-model:value="formData.point" :precision="2" style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-modal
|
||||
:width="640"
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
:cancel-text="cancelText"
|
||||
:ok-text="okText"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
layout="vertical"
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.parent_name')"
|
||||
name="parent_id">
|
||||
<a-tree-select
|
||||
v-model:value="formData.parent_id"
|
||||
tree-default-expand-all></a-tree-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.type')"
|
||||
name="type">
|
||||
<a-radio-group
|
||||
v-model:value="formData.type"
|
||||
:options="menuTypeEnum.getOptions()"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.name')"
|
||||
name="name">
|
||||
<a-input v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.resource.form.path')"
|
||||
name="path">
|
||||
<a-input v-model:value="formData.path"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item name="code">
|
||||
<template #label>
|
||||
<span class="mr-4-1">{{ $t('pages.system.menu.form.code') }}</span>
|
||||
<a-tooltip :title="$t('pages.system.menu.form.code')">
|
||||
<question-circle-outlined class="color-secondary"></question-circle-outlined>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="formData.code"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.status')"
|
||||
name="status">
|
||||
<a-radio-group
|
||||
v-model:value="formData.status"
|
||||
:options="statusTypeEnum.getOptions()"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
style="width: 200px"
|
||||
:label="$t('pages.system.menu.form.sequence')"
|
||||
name="sequence">
|
||||
<a-input
|
||||
:defaultValue="0"
|
||||
type="number"
|
||||
v-model:value="formData.sequence"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.description')"
|
||||
name="description">
|
||||
<a-input v-model:value="formData.description"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.properties')"
|
||||
name="properties">
|
||||
<a-textarea v-model:value="formData.properties"></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
<a-card :title="$t('pages.system.menu.resource.form.title')">
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="formData.resources"
|
||||
:pagination="false"
|
||||
row-key="id">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.key === 'types'">
|
||||
<a-form-item :label="$t('pages.system.menu.resource.form.method')">
|
||||
<a-input-group
|
||||
style="display: inline-block; vertical-align: middle"
|
||||
:compact="true">
|
||||
<a-form-item-rest>
|
||||
<a-select
|
||||
v-model:value="record.method"
|
||||
:default-value="record.method || 'GET'"
|
||||
style="width: 100px">
|
||||
<a-select-option
|
||||
v-for="item of reqType"
|
||||
:key="item"
|
||||
:value="item"
|
||||
>{{ item }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item-rest>
|
||||
<a-input
|
||||
v-model:value="record.path"
|
||||
:style="{ width: 'calc(100% - 100px)' }" />
|
||||
</a-input-group>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<x-action-button @click="handleDelete(index)"> {{ $t('button.delete') }}</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<a-button
|
||||
@click="handleAddApi"
|
||||
block
|
||||
class="mt-8-2"
|
||||
type="dashed">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
{{ $t('button.add') }}
|
||||
</a-button>
|
||||
</a-card>
|
||||
<template v-if="menuTypeEnum.is('menu', formData.type)"> </template>
|
||||
<template v-if="statusTypeEnum.is('enabled', formData.status)"> </template>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { QuestionCircleOutlined } from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal } from '@/hooks'
|
||||
|
||||
import { useModal, useForm } from '@/hooks'
|
||||
import { menuTypeEnum, statusTypeEnum } from '@/enums/system'
|
||||
import { ref } from 'vue'
|
||||
import { config } from '@/config'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const emit = defineEmits(['ok'])
|
||||
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRef, formRules, formRecord, formData, resetForm } = useForm()
|
||||
const { formData, formRef, formRules, resetForm } = useForm()
|
||||
|
||||
formRules.value = {
|
||||
point: { required: true, message: '请输入算力点' }
|
||||
name: { required: true, message: t('pages.system.menu.form.name.placeholder') },
|
||||
code: { required: true, message: t('pages.system.menu.form.code.placeholder') },
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{ title: t('pages.system.menu.form.path'), dataIndex: 'types', key: 'types' },
|
||||
{ title: t('button.action'), dataIndex: 'action', key: 'action' },
|
||||
]
|
||||
const reqType = ['GET', 'POST', 'PUT', 'PATCH', 'HEAD', 'DELETE']
|
||||
const cancelText = ref(t('button.cancel'))
|
||||
const okText = ref(t('button.confirm'))
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
function handleCreate() {
|
||||
formData.value.resources = []
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: '新增算力点',
|
||||
title: t('pages.system.menu.add'),
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加下级
|
||||
* handleCreateChild
|
||||
*/
|
||||
|
||||
function handleCreateChild(record = {}) {
|
||||
formData.value.resources = []
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: t('pages.system.menu.button.addChild'),
|
||||
})
|
||||
formData.value.parent_id = record.id
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function handleEdit(record = {}) {
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '新增算力点',
|
||||
title: t('pages.system.menu.edit'),
|
||||
})
|
||||
formData.value = cloneDeep(record)
|
||||
const { data } = await apis.menu.getMenu(record.id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
formData.value = cloneDeep(data)
|
||||
formData.value.properties = formData.value.properties ? JSON.parse(formData.value.properties) : ''
|
||||
formData.value.resources = formData.value.resources || (formData.value.resources = [])
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,24 +229,28 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
point:formData.value.point,
|
||||
id:formData.value.id
|
||||
...values,
|
||||
}
|
||||
params.sequence = Number.parseInt(params.sequence) || 0
|
||||
params.properties = JSON.stringify(params.properties)
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.vouchers.addPoint(params).catch(() => {
|
||||
result = await apis.menu.createMenu(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.vouchers.addPoint(params).catch(() => {
|
||||
newApiData()
|
||||
params.resources = formData.value.resources
|
||||
result = await apis.menu.updateMenu(formData.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (result.success) {
|
||||
if (config('http.code.success') === result?.success) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
@ -93,15 +270,44 @@ function handleCancel() {
|
||||
hideModal()
|
||||
}
|
||||
|
||||
/**
|
||||
* 针对API 做一次 menu_id
|
||||
*/
|
||||
function newApiData() {
|
||||
if (formData.value.resources)
|
||||
formData.value.resources.forEach((item) => {
|
||||
item.menu_id = formData.value.id
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭后
|
||||
*/
|
||||
function onAfterClose() {
|
||||
resetForm()
|
||||
hideLoading()
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加API
|
||||
*/
|
||||
|
||||
function handleAddApi() {
|
||||
formData.value.resources.push({
|
||||
method: 'GET',
|
||||
path: '',
|
||||
})
|
||||
} /**
|
||||
* 删除API
|
||||
*/
|
||||
|
||||
function handleDelete(index) {
|
||||
formData.value.resources.splice(index, 1)
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleCreate,
|
||||
handleCreateChild,
|
||||
handleEdit,
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -1,23 +1,33 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form :label-col="{ style: { width: '100px' } }" :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item :label="$t('pages.system.menu.form.name')" name="name">
|
||||
<a-input :placeholder="$t('pages.system.menu.form.name.placeholder')"
|
||||
v-model:value="searchFormData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item name="code">
|
||||
<template #label>
|
||||
{{ $t('pages.system.menu.form.code') }}
|
||||
<a-tooltip :title="$t('pages.system.menu.form.code')">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input :placeholder="$t('pages.system.menu.form.code.placeholder')"
|
||||
v-model:value="searchFormData.code"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
|
||||
<a-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
{{ $t('button.search') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
@ -26,101 +36,168 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<!-- <p><a-button type="primary" @click="$refs.editDialogRef.handleCreate()">新增</a-button></p> -->
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<i class="iconfont icon-gonggao" style="color: red;"></i>
|
||||
<span>引入阿里巴巴图标</span>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button v-action="'add'" type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
{{ $t('pages.system.menu.add') }}
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table rowKey="id" :loading="loading" :pagination="true" :columns="columns" :data-source="listData">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.dataIndex">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">新增</x-action-button>
|
||||
<!-- <x-action-button @click="handleDelete(record)">删除</x-action-button> -->
|
||||
<template v-if="'menuType' === column.key">
|
||||
<!--菜单-->
|
||||
<a-tag v-if="menuTypeEnum.is('page', record.type)" color="processing">
|
||||
{{ menuTypeEnum.getDesc(record.type) }}
|
||||
</a-tag>
|
||||
<!--按钮-->
|
||||
<a-tag v-if="menuTypeEnum.is('button', record.type)" color="success">
|
||||
{{ menuTypeEnum.getDesc(record.type) }}
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="'createAt' === column.key">
|
||||
{{ formatUtcDateTime(record.created_at) }}
|
||||
</template>
|
||||
|
||||
<template v-if="'statusType' === column.key">
|
||||
<!--状态-->
|
||||
<a-tag v-if="statusTypeEnum.is('enabled', record.status)" color="processing">
|
||||
{{ statusTypeEnum.getDesc(record.status) }}
|
||||
</a-tag>
|
||||
<!--状态-->
|
||||
<a-tag v-if="statusTypeEnum.is('disabled', record.status)" color="processing">
|
||||
{{ statusTypeEnum.getDesc(record.status) }}
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.menu.edit') }}</template>
|
||||
<edit-outlined />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
|
||||
<x-action-button @click="$refs.editDialogRef.handleCreateChild(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.menu.button.addChild') }}</template>
|
||||
<plus-circle-outlined />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.delete') }}</template>
|
||||
<delete-outlined style="color: #ff4d4f" />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog @ok="onOk" ref="editDialogRef" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { Modal, message } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined, PlusCircleOutlined } from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
import { menuTypeEnum, statusTypeEnum } from '@/enums/system'
|
||||
import { usePagination, useForm } from '@/hooks'
|
||||
import { formatUtcDateTime } from '@/utils/util'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
|
||||
import { useI18n } from 'vue-i18n'
|
||||
defineOptions({
|
||||
name: 'listTable',
|
||||
// eslint-disable-next-line vue/no-reserved-component-names
|
||||
name: 'menu',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = ref([
|
||||
{ title: t('pages.system.menu.form.name'), dataIndex: 'name', key: 'name', fixed: true },
|
||||
{ title: t('pages.system.menu.form.code'), dataIndex: 'code', key: 'code' },
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'userName' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '变更前', dataIndex: 'pointsBeforeChange' },
|
||||
{ title: '变更后', dataIndex: 'remainingPoints' },
|
||||
{ title: '变更量', dataIndex: 'changeValue' },
|
||||
{ title: '变更时间', dataIndex: 'lastChangeTime' },
|
||||
{ title: '变更类型', dataIndex: 'changeType' },
|
||||
{ title: '操作', dataIndex: 'action',align:'center' },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
{ title: t('pages.system.menu.form.type'), dataIndex: 'type', key: 'menuType', width: 80 },
|
||||
{ title: t('pages.system.menu.form.status'), dataIndex: 'status', key: 'statusType', width: 80 },
|
||||
{ title: t('pages.system.menu.form.sequence'), dataIndex: 'sequence', width: 100 },
|
||||
{ title: t('pages.system.menu.form.created_at'), dataIndex: 'created_at', key: 'createAt', width: 180 },
|
||||
{ title: t('button.action'), key: 'action', width: 180 },
|
||||
])
|
||||
const { listData, loading, showLoading, hideLoading, searchFormData, paginationState, resetPagination } =
|
||||
usePagination()
|
||||
const { resetForm } = useForm()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
getMenuList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
* 获取菜单列表
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
async function getPageList() {
|
||||
async function getMenuList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success,total, data } = await apis.vouchers
|
||||
.getPointList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
// const { current } = paginationState
|
||||
const { data, success, total } = await apis.menu
|
||||
.getMenuList({
|
||||
...searchFormData.value,
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
if (config('http.code.success') === success) {
|
||||
data.forEach((item) => {
|
||||
item.name = t(item.code) || item.name
|
||||
})
|
||||
listData.value = data
|
||||
paginationState.total =total
|
||||
paginationState.total = total
|
||||
}
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetForm()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
getMenuList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getMenuList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
function handleDelete({ id }) {
|
||||
Modal.confirm({
|
||||
title: '删除提示',
|
||||
content: '确认删除?',
|
||||
title: t('pages.system.menu.delTip'),
|
||||
content: t('button.confirm'),
|
||||
okText: t('button.confirm'),
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { success } = await apis.vouchers.deleteVouchers(id).catch(() => {
|
||||
const { success } = await apis.menu.delMenu(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (success) {
|
||||
if (config('http.code.success') === success) {
|
||||
resolve()
|
||||
message.success('删除成功')
|
||||
await getPageList()
|
||||
message.success(t('component.message.success.delete'))
|
||||
await getMenuList()
|
||||
}
|
||||
} catch (error) {
|
||||
reject()
|
||||
@ -130,39 +207,11 @@ function handleDelete({ id }) {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 密度
|
||||
* @param {string} key
|
||||
* 编辑完成
|
||||
*/
|
||||
function handleSize({ key }) {
|
||||
size.value = key
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格发生改变
|
||||
* @param current
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
async function onOk() {
|
||||
await getMenuList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,84 +1,222 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||
@ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules">
|
||||
<a-form-item label="用户名" name="userName">
|
||||
<a-input v-model:value="formData.userName"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="手机号" name="phone">
|
||||
<a-input v-model:value="formData.phone"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="算力券名称" name="couponName">
|
||||
<a-input v-model:value="formData.couponName"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="券面点数" name="faceValue">
|
||||
<a-input-number v-model:value="formData.faceValue" style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
<a-form-item label="可用点数" name="availablePoints">
|
||||
<a-input-number v-model:value="formData.availablePoints" style="width: 100%;"></a-input-number>
|
||||
</a-form-item>
|
||||
<a-form-item label="生效时间" name="effectiveTime">
|
||||
<a-date-picker v-model:value="formData.effectiveTime" style="width: 100%;"/>
|
||||
</a-form-item>
|
||||
<a-form-item label="失效时间" name="expiryTime">
|
||||
<a-date-picker v-model:value="formData.expiryTime" style="width: 100%;"/>
|
||||
</a-form-item>
|
||||
<a-form-item label="状态" name="status">
|
||||
<a-radio-group v-model:value="formData.status" name="radioGroup">
|
||||
<a-radio v-for="item in ticketStatus.options" :value="item.value">{{ item.label }}</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-modal
|
||||
:width="640"
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
:cancel-text="cancelText"
|
||||
:ok-text="okText"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
layout="vertical"
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules">
|
||||
<a-card class="mb-8-2">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.parent_name')"
|
||||
name="parent_id">
|
||||
<a-tree-select
|
||||
v-model:value="formData.parent_id"
|
||||
tree-default-expand-all></a-tree-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.type')"
|
||||
name="type">
|
||||
<a-radio-group
|
||||
v-model:value="formData.type"
|
||||
:options="menuTypeEnum.getOptions()"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.name')"
|
||||
name="name">
|
||||
<a-input v-model:value="formData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.resource.form.path')"
|
||||
name="path">
|
||||
<a-input v-model:value="formData.path"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item name="code">
|
||||
<template #label>
|
||||
<span class="mr-4-1">{{ $t('pages.system.menu.form.code') }}</span>
|
||||
<a-tooltip :title="$t('pages.system.menu.form.code')">
|
||||
<question-circle-outlined class="color-secondary"></question-circle-outlined>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="formData.code"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.status')"
|
||||
name="status">
|
||||
<a-radio-group
|
||||
v-model:value="formData.status"
|
||||
:options="statusTypeEnum.getOptions()"></a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
style="width: 200px"
|
||||
:label="$t('pages.system.menu.form.sequence')"
|
||||
name="sequence">
|
||||
<a-input
|
||||
:defaultValue="0"
|
||||
type="number"
|
||||
v-model:value="formData.sequence"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.description')"
|
||||
name="description">
|
||||
<a-input v-model:value="formData.description"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<a-form-item
|
||||
:label="$t('pages.system.menu.form.properties')"
|
||||
name="properties">
|
||||
<a-textarea v-model:value="formData.properties"></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
<a-card :title="$t('pages.system.menu.resource.form.title')">
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="formData.resources"
|
||||
:pagination="false"
|
||||
row-key="id">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.key === 'types'">
|
||||
<a-form-item :label="$t('pages.system.menu.resource.form.method')">
|
||||
<a-input-group
|
||||
style="display: inline-block; vertical-align: middle"
|
||||
:compact="true">
|
||||
<a-form-item-rest>
|
||||
<a-select
|
||||
v-model:value="record.method"
|
||||
:default-value="record.method || 'GET'"
|
||||
style="width: 100px">
|
||||
<a-select-option
|
||||
v-for="item of reqType"
|
||||
:key="item"
|
||||
:value="item"
|
||||
>{{ item }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item-rest>
|
||||
<a-input
|
||||
v-model:value="record.path"
|
||||
:style="{ width: 'calc(100% - 100px)' }" />
|
||||
</a-input-group>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<x-action-button @click="handleDelete(index)"> {{ $t('button.delete') }}</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<a-button
|
||||
@click="handleAddApi"
|
||||
block
|
||||
class="mt-8-2"
|
||||
type="dashed">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
{{ $t('button.add') }}
|
||||
</a-button>
|
||||
</a-card>
|
||||
<template v-if="menuTypeEnum.is('menu', formData.type)"> </template>
|
||||
<template v-if="statusTypeEnum.is('enabled', formData.status)"> </template>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { QuestionCircleOutlined } from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal } from '@/hooks'
|
||||
import {ticketStatus} from '@/enums/dict'
|
||||
import dayjs from 'dayjs'
|
||||
import { useModal, useForm } from '@/hooks'
|
||||
import { menuTypeEnum, statusTypeEnum } from '@/enums/system'
|
||||
import { ref } from 'vue'
|
||||
import { config } from '@/config'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const emit = defineEmits(['ok'])
|
||||
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRef, formRules, formRecord, formData, resetForm } = useForm()
|
||||
const { formData, formRef, formRules, resetForm } = useForm()
|
||||
|
||||
formRules.value = {
|
||||
userName: { required: true, message: '请输入用户名' },
|
||||
phone: { required: true, message: '请输入手机号' },
|
||||
couponName: { required: true, message: '请输入算力券名称' },
|
||||
faceValue: { required: true, message: '请输入券面点数' },
|
||||
availablePoints: { required: true, message: '请输入可用点数' },
|
||||
effectiveTime: { required: true, message: '请选择开始时间',trigger:'change' },
|
||||
expiryTime: { required: true, message: '请选择结束时间',trigger:'change' },
|
||||
status: { required: true, message: '请选择状态',trigger:'change' },
|
||||
name: { required: true, message: t('pages.system.menu.form.name.placeholder') },
|
||||
code: { required: true, message: t('pages.system.menu.form.code.placeholder') },
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{ title: t('pages.system.menu.form.path'), dataIndex: 'types', key: 'types' },
|
||||
{ title: t('button.action'), dataIndex: 'action', key: 'action' },
|
||||
]
|
||||
const reqType = ['GET', 'POST', 'PUT', 'PATCH', 'HEAD', 'DELETE']
|
||||
const cancelText = ref(t('button.cancel'))
|
||||
const okText = ref(t('button.confirm'))
|
||||
|
||||
/**
|
||||
* 新建
|
||||
*/
|
||||
function handleCreate() {
|
||||
formData.value.status = 'ENABLED'
|
||||
formData.value.resources = []
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: '新建',
|
||||
title: t('pages.system.menu.add'),
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加下级
|
||||
* handleCreateChild
|
||||
*/
|
||||
|
||||
function handleCreateChild(record = {}) {
|
||||
formData.value.resources = []
|
||||
showModal({
|
||||
type: 'create',
|
||||
title: t('pages.system.menu.button.addChild'),
|
||||
})
|
||||
formData.value.parent_id = record.id
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function handleEdit(record = {}) {
|
||||
async function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '编辑',
|
||||
title: t('pages.system.menu.edit'),
|
||||
})
|
||||
formRecord.value = record
|
||||
formData.value = cloneDeep(record)
|
||||
formData.value.effectiveTime=dayjs(record.effectiveTime)
|
||||
formData.value.expiryTime=dayjs(record.expiryTime)
|
||||
const { data } = await apis.menu.getMenu(record.id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
formData.value = cloneDeep(data)
|
||||
formData.value.properties = formData.value.properties ? JSON.parse(formData.value.properties) : ''
|
||||
formData.value.resources = formData.value.resources || (formData.value.resources = [])
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,25 +229,28 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...formData.value,
|
||||
effectiveTime:dayjs(formData.value.effectiveTime).format('YYYY-MM-DD'),
|
||||
expiryTime:dayjs(formData.value.expiryTime).format('YYYY-MM-DD')
|
||||
...values,
|
||||
}
|
||||
params.sequence = Number.parseInt(params.sequence) || 0
|
||||
params.properties = JSON.stringify(params.properties)
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.vouchers.addVouchers(params).catch(() => {
|
||||
result = await apis.menu.createMenu(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.vouchers.editeVouchers(params).catch(() => {
|
||||
newApiData()
|
||||
params.resources = formData.value.resources
|
||||
result = await apis.menu.updateMenu(formData.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (result.success) {
|
||||
if (config('http.code.success') === result?.success) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
@ -129,15 +270,44 @@ function handleCancel() {
|
||||
hideModal()
|
||||
}
|
||||
|
||||
/**
|
||||
* 针对API 做一次 menu_id
|
||||
*/
|
||||
function newApiData() {
|
||||
if (formData.value.resources)
|
||||
formData.value.resources.forEach((item) => {
|
||||
item.menu_id = formData.value.id
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭后
|
||||
*/
|
||||
function onAfterClose() {
|
||||
resetForm()
|
||||
hideLoading()
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加API
|
||||
*/
|
||||
|
||||
function handleAddApi() {
|
||||
formData.value.resources.push({
|
||||
method: 'GET',
|
||||
path: '',
|
||||
})
|
||||
} /**
|
||||
* 删除API
|
||||
*/
|
||||
|
||||
function handleDelete(index) {
|
||||
formData.value.resources.splice(index, 1)
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleCreate,
|
||||
handleCreateChild,
|
||||
handleEdit,
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -1,28 +1,33 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form :label-col="{ style: { width: '100px' } }" :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item :label="$t('pages.system.menu.form.name')" name="name">
|
||||
<a-input :placeholder="$t('pages.system.menu.form.name.placeholder')"
|
||||
v-model:value="searchFormData.name"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item name="code">
|
||||
<template #label>
|
||||
{{ $t('pages.system.menu.form.code') }}
|
||||
<a-tooltip :title="$t('pages.system.menu.form.code')">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input :placeholder="$t('pages.system.menu.form.code.placeholder')"
|
||||
v-model:value="searchFormData.code"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="算力券名称" title="voucherName">
|
||||
<a-input v-model:value="searchFormData.voucherName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
|
||||
<a-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
{{ $t('button.search') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
@ -31,68 +36,125 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<p><a-button type="primary" @click="$refs.editDialogRef.handleCreate()">新增</a-button></p>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<i class="iconfont icon-gonggao" style="color: red;"></i>
|
||||
<span>引入阿里巴巴图标</span>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button v-action="'add'" type="primary" @click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
{{ $t('pages.system.menu.add') }}
|
||||
</a-button>
|
||||
</x-action-bar>
|
||||
<a-table rowKey="id" :loading="loading" :pagination="true" :columns="columns" :data-source="listData">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.dataIndex">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<template v-if="'menuType' === column.key">
|
||||
<!--菜单-->
|
||||
<a-tag v-if="menuTypeEnum.is('page', record.type)" color="processing">
|
||||
{{ menuTypeEnum.getDesc(record.type) }}
|
||||
</a-tag>
|
||||
<!--按钮-->
|
||||
<a-tag v-if="menuTypeEnum.is('button', record.type)" color="success">
|
||||
{{ menuTypeEnum.getDesc(record.type) }}
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="'createAt' === column.key">
|
||||
{{ formatUtcDateTime(record.created_at) }}
|
||||
</template>
|
||||
|
||||
<template v-if="'statusType' === column.key">
|
||||
<!--状态-->
|
||||
<a-tag v-if="statusTypeEnum.is('enabled', record.status)" color="processing">
|
||||
{{ statusTypeEnum.getDesc(record.status) }}
|
||||
</a-tag>
|
||||
<!--状态-->
|
||||
<a-tag v-if="statusTypeEnum.is('disabled', record.status)" color="processing">
|
||||
{{ statusTypeEnum.getDesc(record.status) }}
|
||||
</a-tag>
|
||||
</template>
|
||||
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.menu.edit') }}</template>
|
||||
<edit-outlined />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
|
||||
<x-action-button @click="$refs.editDialogRef.handleCreateChild(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.menu.button.addChild') }}</template>
|
||||
<plus-circle-outlined />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">
|
||||
<a-tooltip>
|
||||
<template #title>{{ $t('pages.system.delete') }}</template>
|
||||
<delete-outlined style="color: #ff4d4f" />
|
||||
</a-tooltip>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog @ok="onOk" ref="editDialogRef" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { Modal, message } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined, PlusCircleOutlined } from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
import { menuTypeEnum, statusTypeEnum } from '@/enums/system'
|
||||
import { usePagination, useForm } from '@/hooks'
|
||||
import { formatUtcDateTime } from '@/utils/util'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
import {ticketStatus} from '@/enums/dict'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
defineOptions({
|
||||
name: 'listTable',
|
||||
// eslint-disable-next-line vue/no-reserved-component-names
|
||||
name: 'menu',
|
||||
})
|
||||
const { t } = useI18n() // 解构出t方法
|
||||
const columns = ref([
|
||||
{ title: t('pages.system.menu.form.name'), dataIndex: 'name', key: 'name', fixed: true },
|
||||
{ title: t('pages.system.menu.form.code'), dataIndex: 'code', key: 'code' },
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'userName' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '算力券名称', dataIndex: 'couponName' },
|
||||
{ title: '券面点数', dataIndex: 'faceValue' },
|
||||
{ title: '可用点数', dataIndex: 'availablePoints' },
|
||||
{ title: '生效时间', dataIndex: 'effectiveTime' },
|
||||
{ title: '失效时间', dataIndex: 'expiryTime' },
|
||||
{ title: '状态', dataIndex: 'status',customRender: ({ text }) => ticketStatus.getLabel(text)},
|
||||
{ title: '操作', dataIndex: 'action' },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
{ title: t('pages.system.menu.form.type'), dataIndex: 'type', key: 'menuType', width: 80 },
|
||||
{ title: t('pages.system.menu.form.status'), dataIndex: 'status', key: 'statusType', width: 80 },
|
||||
{ title: t('pages.system.menu.form.sequence'), dataIndex: 'sequence', width: 100 },
|
||||
{ title: t('pages.system.menu.form.created_at'), dataIndex: 'created_at', key: 'createAt', width: 180 },
|
||||
{ title: t('button.action'), key: 'action', width: 180 },
|
||||
])
|
||||
const { listData, loading, showLoading, hideLoading, searchFormData, paginationState, resetPagination } =
|
||||
usePagination()
|
||||
const { resetForm } = useForm()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
getMenuList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
* 获取菜单列表
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
async function getPageList() {
|
||||
async function getMenuList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success,total, data } = await apis.vouchers
|
||||
.getPageList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
// const { current } = paginationState
|
||||
const { data, success, total } = await apis.menu
|
||||
.getMenuList({
|
||||
...searchFormData.value,
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
if (config('http.code.success') === success) {
|
||||
data.forEach((item) => {
|
||||
item.name = t(item.code) || item.name
|
||||
})
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
@ -100,33 +162,42 @@ async function getPageList() {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetForm()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
getMenuList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getMenuList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
*/
|
||||
function handleDelete({ id }) {
|
||||
Modal.confirm({
|
||||
title: '删除提示',
|
||||
content: '确认删除?',
|
||||
title: t('pages.system.menu.delTip'),
|
||||
content: t('button.confirm'),
|
||||
okText: t('button.confirm'),
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { success } = await apis.vouchers.deleteVouchers(id).catch(() => {
|
||||
const { success } = await apis.menu.delMenu(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (success) {
|
||||
if (config('http.code.success') === success) {
|
||||
resolve()
|
||||
message.success('删除成功')
|
||||
await getPageList()
|
||||
message.success(t('component.message.success.delete'))
|
||||
await getMenuList()
|
||||
}
|
||||
} catch (error) {
|
||||
reject()
|
||||
@ -136,39 +207,11 @@ function handleDelete({ id }) {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 密度
|
||||
* @param {string} key
|
||||
* 编辑完成
|
||||
*/
|
||||
function handleSize({ key }) {
|
||||
size.value = key
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格发生改变
|
||||
* @param current
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
async function onOk() {
|
||||
await getMenuList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,19 +1,23 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||
@ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules">
|
||||
<a-form-item label="审核" name="checked">
|
||||
<a-radio-group v-model:value="formData.checked" name="radioGroup">
|
||||
<a-radio :value="true">通过</a-radio>
|
||||
<a-radio :value="false">拒绝</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="原因" name="reason">
|
||||
<a-textarea v-model:value="formData.reason"></a-textarea>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
scroll-to-first-error
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
:label-col="{ style: { width: '80px' } }">
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
@ -28,7 +32,7 @@ const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRef, formRules, formRecord, formData, resetForm } = useForm()
|
||||
|
||||
formRules.value = {
|
||||
|
||||
title: { required: true, message: '请输入标题' },
|
||||
}
|
||||
|
||||
/**
|
||||
@ -47,10 +51,10 @@ function handleCreate() {
|
||||
function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '审核',
|
||||
title: '编辑',
|
||||
})
|
||||
formData.value.checked = true
|
||||
formData.value.contractId = record.id
|
||||
formRecord.value = record
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,11 +64,10 @@ function handleOk() {
|
||||
formRef.value
|
||||
.validateFields()
|
||||
.then(async (values) => {
|
||||
console.log(values)
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...formData.value,
|
||||
...values,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
@ -74,18 +77,17 @@ function handleOk() {
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.contract.review(params).catch(() => {
|
||||
result = await apis.common.update(formRecord.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (result?.success) {
|
||||
if (200 === result?.code) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
hideLoading()
|
||||
}
|
||||
})
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<a-input v-model:value="searchFormData.contractId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<a-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
@ -34,9 +34,9 @@
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.dataIndex">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
|
||||
<!-- <x-action-button @click="$refs.editDialogRef.handleEdit(record)">详情</x-action-button> -->
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="handleReview(record)">审核</x-action-button>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">详情</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -53,17 +53,19 @@ import { usePagination } from '@/hooks'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'contract',
|
||||
name: 'listTable',
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '合同编号', dataIndex: 'contractId' },
|
||||
{ title: '合同名称', dataIndex: 'contractName' },
|
||||
{ title: '合同类型', dataIndex: 'contractType' },
|
||||
{ title: '合同内容', dataIndex: 'contractContent' },
|
||||
{ title: '操作', dataIndex: 'action',width:120,align:'center' },
|
||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||
{ title: '状态', dataIndex: 'status' },
|
||||
{ title: '发票编号', dataIndex: 'invoiceNumber' },
|
||||
{ title: '开票日期', dataIndex: 'issueDate' },
|
||||
{ title: '开票方式', dataIndex: 'issueMethod' },
|
||||
{ title: '备注', dataIndex: 'remarks' },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
const editDialogRef = ref()
|
||||
@ -79,8 +81,8 @@ async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success,total, data } = await apis.contract
|
||||
.getPageList({
|
||||
const { code, data } = await apis.invoice
|
||||
.getDeliveriesFailedList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
@ -89,9 +91,10 @@ async function getPageList() {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
if (config('http.code.success') === code) {
|
||||
const { records, pagination } = data
|
||||
listData.value = records
|
||||
paginationState.total = pagination.total
|
||||
}
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="合同编号" title="contractId">
|
||||
<a-input v-model:value="searchFormData.contractId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,21 +66,101 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="handleReview(record)">上传合同</x-action-button>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -56,43 +171,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '合同编号', dataIndex: 'contractId' },
|
||||
{ title: '合同名称', dataIndex: 'contractName' },
|
||||
{ title: '合同类型', dataIndex: 'contractType' },
|
||||
{ title: '合同内容', dataIndex: 'contractContent' }
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success,total, data } = await apis.contract
|
||||
.getFaildList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,8 +219,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,7 +232,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -146,24 +265,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="合同编号" title="contractId">
|
||||
<a-input v-model:value="searchFormData.contractId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,75 +66,152 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'contractContent' === column.dataIndex">
|
||||
<a-image :width="100" :height="100" :src="config('http.apiBasic')+record.contractContent" />
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="handleReview(record)">上传合同</x-action-button>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'listTable',
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '合同编号', dataIndex: 'contractId' },
|
||||
{ title: '合同名称', dataIndex: 'contractName' },
|
||||
{ title: '合同类型', dataIndex: 'contractType' },
|
||||
{
|
||||
title: '合同内容',
|
||||
dataIndex: 'contractContent',
|
||||
|
||||
}
|
||||
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, total, data } = await apis.contract
|
||||
.getinvoiceSuccessList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,8 +219,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,7 +232,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -153,24 +265,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,14 +1,23 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||
@ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
scroll-to-first-error
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
:label-col="{ style: { width: '80px' } }">
|
||||
<a-form-item label="上传合同" name="url">
|
||||
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
@ -16,8 +25,7 @@
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal } from '@/hooks'
|
||||
import GxUpload from '@/components/GxUpload/index.vue'
|
||||
import {spliceUrl} from '@/utils/util.js'
|
||||
|
||||
const emit = defineEmits(['ok'])
|
||||
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
@ -43,10 +51,10 @@ function handleCreate() {
|
||||
function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '上传签章合同',
|
||||
title: '编辑',
|
||||
})
|
||||
|
||||
formData.value.id = record.id
|
||||
formRecord.value = record
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,16 +64,10 @@ function handleOk() {
|
||||
formRef.value
|
||||
.validateFields()
|
||||
.then(async (values) => {
|
||||
console.log(formData.value.fileList)
|
||||
if(formData.value.fileList===undefined||formData.value.fileList.length==0){
|
||||
return message.error('请上传签章图片')
|
||||
}
|
||||
try {
|
||||
showLoading()
|
||||
console.log(spliceUrl(formData.value.fileList[0]))
|
||||
const params = {
|
||||
id:formData.value.id,
|
||||
url:spliceUrl(formData.value.fileList[0])
|
||||
...values,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
@ -75,18 +77,17 @@ function handleOk() {
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.contract.pendingUpload(params).catch(() => {
|
||||
result = await apis.common.update(formRecord.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (result?.success) {
|
||||
if (200 === result?.code) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
hideLoading()
|
||||
}
|
||||
})
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="合同编号" title="contractId">
|
||||
<a-input v-model:value="searchFormData.contractId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,21 +66,101 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.dataIndex">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">上传签章</x-action-button>
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -56,44 +171,51 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '合同编号', dataIndex: 'contractId' },
|
||||
{ title: '合同名称', dataIndex: 'contractName' },
|
||||
{ title: '合同类型', dataIndex: 'contractType' },
|
||||
{ title: '合同内容', dataIndex: 'contractContent' },
|
||||
{title:"操作",dataIndex:'action',width:100}
|
||||
{ title: '计算卡ID', dataIndex: 'hostId' },
|
||||
{ title: '型号', dataIndex: 'hostName' },
|
||||
{ title: '显存容量', dataIndex: 'regionId' },
|
||||
{ title: '核心数', dataIndex: 'cpu' },
|
||||
{ title: '所属主机ID', dataIndex: 'memory' },
|
||||
{ title: '运行状态', dataIndex: 'storage' },
|
||||
{ title: '当前使用实例', dataIndex: 'ip' },
|
||||
{ title: '用户信息(租用者)', dataIndex: 'status' },
|
||||
{ title: '开始使用时间', dataIndex: 'bandwidth' },
|
||||
{ title: '预计释放时间', dataIndex: 'createdAt' },
|
||||
{ title: '固件版本', dataIndex: 'updatedAt' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success,total, data } = await apis.contract
|
||||
.getPendingList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,8 +223,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -114,7 +236,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -147,24 +269,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,33 +1,23 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||
@ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
|
||||
:label-col="{ style: { width: '80px' } }">
|
||||
<a-form-item label="镜像名称" name="imageName">
|
||||
<a-input v-model:value="formData.imageName"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="镜像类型" name="imageType">
|
||||
<a-select v-model:value="formData.imageType" placeholder="请选择类型">
|
||||
<a-select-option v-for="item in imgType.options" :key="item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="镜像路径" name="imagePath">
|
||||
<a-input v-model:value="formData.imagePath"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="镜像大小" name="imageSize">
|
||||
<a-input v-model:value="formData.imageSize"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="镜像版本" name="imageVersion">
|
||||
<a-input v-model:value="formData.imageVersion"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="描述" name="description">
|
||||
<a-input v-model:value="formData.description"></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
scroll-to-first-error
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
:label-col="{ style: { width: '80px' } }">
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
@ -35,21 +25,14 @@
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal } from '@/hooks'
|
||||
import { number } from 'echarts'
|
||||
import {imgType} from '@/enums/dict'
|
||||
|
||||
const emit = defineEmits(['ok'])
|
||||
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
const { formRef, formRules, formRecord, formData, resetForm } = useForm()
|
||||
|
||||
formRules.value = {
|
||||
imageName: { required: true, message: '请输入镜像名称' },
|
||||
imageType: { required: true, message: '请输入镜像类型' },
|
||||
description: { required: false, message: '请输入描述' },
|
||||
imagePath: { required: true, message: '请输入镜像路径' },
|
||||
imageSize: { required: true, message: '请输入镜像大小' },
|
||||
imageVersion: { required: true, message: '请输入镜像版本' },
|
||||
userName: { required: true, message: '请输入所属用户名' },
|
||||
title: { required: true, message: '请输入标题' },
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,8 +53,7 @@ function handleEdit(record = {}) {
|
||||
type: 'edit',
|
||||
title: '编辑',
|
||||
})
|
||||
console.log(record)
|
||||
// formRecord.value.id = record.id
|
||||
formRecord.value = record
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
@ -85,26 +67,23 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...formData.value,
|
||||
imageSize: Number(formData.value.imageSize),
|
||||
name:formData.value.imageName
|
||||
...values,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.images.addVouchers(params).catch(() => {
|
||||
result = await apis.common.create(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.images.editeVouchers(formData.value.id, params).catch(() => {
|
||||
result = await apis.common.update(formRecord.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
console.log(result)
|
||||
hideLoading()
|
||||
if (true === result?.success) {
|
||||
if (200 === result?.code) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="镜像名称" title="imageName">
|
||||
<a-input v-model:value="searchFormData.imageName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,74 +66,169 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<!-- <p><a-button type="primary" @click="$refs.editDialogRef.handleCreate()">新增</a-button></p> -->
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.dataIndex">
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<!-- <x-action-button @click="$refs.editDialogRef.handleEdit(record)">详情</x-action-button> -->
|
||||
<x-action-button @click="handleDelete(record)" style="color: red;">删除</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
import {imgType} from '@/enums/dict'
|
||||
|
||||
defineOptions({
|
||||
name: 'listTable',
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'userName', width: 120 },
|
||||
{ title: '手机号', dataIndex: 'phone', width: 120 },
|
||||
{ title: '镜像名称', dataIndex: 'imageName'},
|
||||
{ title: '镜像类型', dataIndex: 'imageType', width: 120, customRender: ({ text }) => imgType.getLabel(text) || text, },
|
||||
{ title: '镜像路径', dataIndex: 'imagePath' },
|
||||
{ title: '镜像大小', dataIndex: 'imageSize',customRender: ({ text }) => text },
|
||||
{ title: '镜像版本', dataIndex: 'imageVersion' },
|
||||
{ title: '描述', dataIndex: 'description' },
|
||||
{ title: '操作', dataIndex: 'action',width:130,align:'center' },
|
||||
{ title: '订单ID', dataIndex: 'hostId' },
|
||||
{ title: '订单编号', dataIndex: 'hostName' },
|
||||
{ title: '所属用户ID', dataIndex: 'regionId' },
|
||||
{ title: '用户名', dataIndex: 'cpu' },
|
||||
{ title: '手机号', dataIndex: 'memory' },
|
||||
{ title: '实例ID', dataIndex: 'ip' },
|
||||
{ title: '实例名称', dataIndex: 'hostId' },
|
||||
{ title: '租赁配置', dataIndex: 'hostName' },
|
||||
{ title: '计费方式', dataIndex: 'regionId' },
|
||||
{ title: '订单金额', dataIndex: 'cpu' },
|
||||
{ title: '实付金额', dataIndex: 'hostId' },
|
||||
{ title: '创建时间', dataIndex: 'hostName' },
|
||||
{ title: '支付时间', dataIndex: 'regionId' },
|
||||
{ title: '订单状态', dataIndex: 'cpu' },
|
||||
{ title: '到期时间', dataIndex: 'hostName' },
|
||||
{ title: '续费状态', dataIndex: 'regionId' },
|
||||
{ title: '支付方式', dataIndex: 'cpu' },
|
||||
{ title: '支付订单ID', dataIndex: 'hostId' },
|
||||
{ title: '发票状态', dataIndex: 'hostName' },
|
||||
{ title: '合同ID', dataIndex: 'regionId' },
|
||||
{ title: '是否开票', dataIndex: 'cpu' },
|
||||
{ title: '备注', dataIndex: 'hostId' },
|
||||
{ title: '当前运行状态', dataIndex: 'cpu' },
|
||||
{ title: '剩余时长', dataIndex: 'hostId' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data, total } = await apis.images
|
||||
.getPageList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,8 +236,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -119,12 +249,12 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { success } = await apis.images.deleteVouchers(id).catch(() => {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (success) {
|
||||
if (config('http.code.success') === code) {
|
||||
resolve()
|
||||
message.success('删除成功')
|
||||
await getPageList()
|
||||
@ -152,24 +282,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="orderNumber" label="订单编号">
|
||||
<a-input v-model:value="searchFormData.orderNumber"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="用户名" title="userName">
|
||||
<a-input v-model:value="searchFormData.userName"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,71 +66,171 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<!-- <p><a-button type="primary" @click="$refs.editDialogRef.handleCreate()">新增</a-button></p> -->
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
import {payType} from '@/enums/dict'
|
||||
|
||||
defineOptions({
|
||||
name: 'listTable',
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{title:'订单编号',dataIndex:'orderNumber'},
|
||||
{ title: '用户名', dataIndex: 'userName' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '实例名称', dataIndex: 'caseName' },
|
||||
{ title: '计费方式', dataIndex: 'billingMethod',customRender: ({ text }) => payType.getLabel(text) || text, },
|
||||
{ title: '计费开始时间', dataIndex: 'billingStart' },
|
||||
{ title: '计费结束时间', dataIndex: 'billingEnd' },
|
||||
{ title: '计费时长', dataIndex: 'billingTime' },
|
||||
{ title: '单价', dataIndex: 'price' },
|
||||
{ title: '总费用/元', dataIndex: 'totalAmount',customRender: ({ text }) => '¥'+text, },
|
||||
{ title: '算力券名称', dataIndex: 'voucherName' },
|
||||
{ title: '支付状态', dataIndex: 'payStatus' },
|
||||
{ title: '订单ID', dataIndex: 'hostId' },
|
||||
{ title: '订单编号', dataIndex: 'hostName' },
|
||||
{ title: '所属用户ID', dataIndex: 'regionId' },
|
||||
{ title: '用户名', dataIndex: 'cpu' },
|
||||
{ title: '手机号', dataIndex: 'memory' },
|
||||
{ title: '实例ID', dataIndex: 'ip' },
|
||||
{ title: '实例名称', dataIndex: 'hostId' },
|
||||
{ title: '租赁配置', dataIndex: 'hostName' },
|
||||
{ title: '计费方式', dataIndex: 'regionId' },
|
||||
{ title: '订单金额', dataIndex: 'cpu' },
|
||||
{ title: '实付金额', dataIndex: 'hostId' },
|
||||
{ title: '创建时间', dataIndex: 'hostName' },
|
||||
{ title: '支付时间', dataIndex: 'regionId' },
|
||||
{ title: '订单状态', dataIndex: 'cpu' },
|
||||
{ title: '到期时间', dataIndex: 'hostName' },
|
||||
{ title: '续费状态', dataIndex: 'regionId' },
|
||||
{ title: '支付方式', dataIndex: 'cpu' },
|
||||
{ title: '支付订单ID', dataIndex: 'hostId' },
|
||||
{ title: '发票状态', dataIndex: 'hostName' },
|
||||
{ title: '合同ID', dataIndex: 'regionId' },
|
||||
{ title: '是否开票', dataIndex: 'cpu' },
|
||||
{ title: '备注', dataIndex: 'hostId' },
|
||||
{ title: '结算时间', dataIndex: 'cpu' },
|
||||
{ title: '结算方式', dataIndex: 'hostId' },
|
||||
{ title: '对账状态', dataIndex: 'regionId' },
|
||||
{ title: '退款金额', dataIndex: 'cpu' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data ,total} = await apis.vouchers
|
||||
.getOrderList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,8 +238,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,9 +251,9 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.vouchers.deleteVouchers(id).catch(() => {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === code) {
|
||||
@ -149,24 +284,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,20 +1,23 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||
@ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
|
||||
:label-col="{ style: { width: '80px' } }">
|
||||
<a-form-item label="审核" name="checked">
|
||||
<a-radio-group v-model:value="formData.checked" name="radioGroup">
|
||||
<a-radio :value="true">通过</a-radio>
|
||||
<a-radio :value="false">拒绝</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="原因" name="reason">
|
||||
<a-textarea v-model:value="formData.reason"></a-textarea>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
scroll-to-first-error
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
:label-col="{ style: { width: '80px' } }">
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
@ -48,11 +51,12 @@ function handleCreate() {
|
||||
function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '审核',
|
||||
title: '编辑',
|
||||
})
|
||||
formData.value.checked=true
|
||||
formData.value.withdrawalOrderId = record.withdrawalOrderId
|
||||
formRecord.value = record
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定
|
||||
*/
|
||||
@ -63,7 +67,7 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...formData.value,
|
||||
...values,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
@ -73,13 +77,13 @@ function handleOk() {
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.review.review(params).catch(() => {
|
||||
result = await apis.common.update(formRecord.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (result?.success) {
|
||||
if (200 === result?.code) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="提现编号" title="withdrawalOrderId">
|
||||
<a-input v-model:value="searchFormData.withdrawalOrderId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,22 +66,101 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.dataIndex">
|
||||
<!-- <x-action-button @click="handleReview(record)">审核</x-action-button> -->
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -57,44 +171,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '提现编号', dataIndex: 'withdrawalOrderId' },
|
||||
{ title: '提现金额', dataIndex: 'withdrawalAmount' },
|
||||
{ title: '银行卡信息', dataIndex: 'bankCardInfo' },
|
||||
{title:'申请时间',dataIndex:'withdrawalTime'},
|
||||
{title:'操作',dataIndex:'action',align:'center'}
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success,total, data } = await apis.review
|
||||
.getPageList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total =total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,8 +219,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -115,7 +232,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -148,24 +265,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="提现编号" title="withdrawalOrderId">
|
||||
<a-input v-model:value="searchFormData.withdrawalOrderId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,63 +66,156 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
import EditDialog from './components/EditDialog.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'withdrawErrorList',
|
||||
name: 'listTable',
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '提现编号', dataIndex: 'withdrawalOrderId' },
|
||||
{ title: '提现金额', dataIndex: 'withdrawalAmount' },
|
||||
{ title: '银行卡信息', dataIndex: 'bankCardInfo' },
|
||||
{ title: "失败原因", dataIndex: 'reason' },
|
||||
{ title: '计算卡ID', dataIndex: 'hostId' },
|
||||
{ title: '型号', dataIndex: 'hostName' },
|
||||
{ title: '显存容量', dataIndex: 'regionId' },
|
||||
{ title: '核心数', dataIndex: 'cpu' },
|
||||
{ title: '所属主机ID', dataIndex: 'memory' },
|
||||
{ title: '运行状态', dataIndex: 'storage' },
|
||||
{ title: '当前使用实例', dataIndex: 'ip' },
|
||||
{ title: '用户信息(租用者)', dataIndex: 'status' },
|
||||
{ title: '开始使用时间', dataIndex: 'bandwidth' },
|
||||
{ title: '预计释放时间', dataIndex: 'createdAt' },
|
||||
{ title: '固件版本', dataIndex: 'updatedAt' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, total, data } = await apis.review
|
||||
.getPendingFaildList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,8 +223,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,7 +236,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -141,24 +269,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,20 +1,23 @@
|
||||
<template>
|
||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||
@ok="handleOk" @cancel="handleCancel">
|
||||
<a-card>
|
||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
|
||||
:label-col="{ style: { width: '80px' } }">
|
||||
<a-form-item label="打款结果" name="checked">
|
||||
<a-radio-group v-model:value="formData.checked" name="radioGroup">
|
||||
<a-radio :value="true">成功</a-radio>
|
||||
<a-radio :value="false">失败</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="原因" name="reason">
|
||||
<a-textarea v-model:value="formData.reason" placeholder="请输入原因" auto-size />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
:title="modal.title"
|
||||
:confirm-loading="modal.confirmLoading"
|
||||
:after-close="onAfterClose"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
scroll-to-first-error
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
:label-col="{ style: { width: '80px' } }">
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
@ -48,11 +51,10 @@ function handleCreate() {
|
||||
function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '提现确认',
|
||||
title: '编辑',
|
||||
})
|
||||
console.log(1111)
|
||||
formData.value.checked=true
|
||||
formData.value.withdrawalOrderId = record.withdrawalOrderId
|
||||
formRecord.value = record
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,7 +67,7 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...formData.value,
|
||||
...values,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
@ -75,13 +77,13 @@ function handleOk() {
|
||||
})
|
||||
break
|
||||
case 'edit':
|
||||
result = await apis.review.pendingUpload(params).catch(() => {
|
||||
result = await apis.common.update(formRecord.value.id, params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (result?.success) {
|
||||
if (200 === result?.code) {
|
||||
hideModal()
|
||||
emit('ok')
|
||||
}
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="提现编号" title="withdrawalOrderId">
|
||||
<a-input v-model:value="searchFormData.withdrawalOrderId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,22 +66,101 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.dataIndex">
|
||||
<!-- <x-action-button @click="handleReview(record)">提现确认</x-action-button> -->
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">提现确认</x-action-button>
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -57,45 +171,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '提现编号', dataIndex: 'withdrawalOrderId' },
|
||||
{ title: '提现金额', dataIndex: 'withdrawalAmount' },
|
||||
{ title: '银行卡信息', dataIndex: 'bankCardInfo' },
|
||||
{title:"申请时间",dataIndex:'withdrawalTime'},
|
||||
{title:"审核时间",dataIndex:'backendConfirmationTime'},
|
||||
{title:"操作",dataIndex:'action',align:'center'}
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success, data,total } = await apis.review
|
||||
.getPendingList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total = total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,8 +219,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,7 +232,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -149,24 +265,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="提现编号" title="withdrawalOrderId">
|
||||
<a-input v-model:value="searchFormData.withdrawalOrderId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,22 +66,101 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<!-- <template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="handleReview(record)">审核</x-action-button>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">详情</x-action-button>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
</template> -->
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -57,44 +171,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '提现编号', dataIndex: 'withdrawalOrderId' },
|
||||
{ title: '提现金额', dataIndex: 'withdrawalAmount' },
|
||||
{ title: '拒绝原因', dataIndex: 'reason' },
|
||||
{ title: '银行卡信息', dataIndex: 'bankCardInfo' },
|
||||
{title:'申请时间',dataIndex:'withdrawalTime'}
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success,total, data } = await apis.review
|
||||
.getFaildList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total =total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,8 +219,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -115,7 +232,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -148,24 +265,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,29 +1,64 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
<a-form-item name="title">
|
||||
<template #label>
|
||||
规则名称
|
||||
<a-tooltip title="规则名称是唯一的 key">
|
||||
<question-circle-outlined class="ml-4-1 color-placeholder" />
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model:value="searchFormData.title"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="提现编号" title="withdrawalOrderId">
|
||||
<a-input v-model:value="searchFormData.withdrawalOrderId"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col class="align-left" v-bind="colSpan">
|
||||
<template v-if="searchBarExpand">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="服务调用次数">
|
||||
<a-input></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="状态">
|
||||
<a-select></a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="上次调度时间">
|
||||
<a-date-picker placeholder=""></a-date-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<a-col
|
||||
class="align-right"
|
||||
v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
搜索
|
||||
</a-button>
|
||||
<a @click="() => (searchBarExpand = !searchBarExpand)">
|
||||
展开
|
||||
<template v-if="searchBarExpand">
|
||||
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
|
||||
</template>
|
||||
<template v-else>
|
||||
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
|
||||
</template>
|
||||
</a>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -31,22 +66,101 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
|
||||
:size="size" row-key="id" @change="onTableChange">
|
||||
<x-action-bar class="mb-8-2">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="$refs.editDialogRef.handleCreate()">
|
||||
<template #icon>
|
||||
<plus-outlined></plus-outlined>
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-tooltip title="刷新">
|
||||
<a-button
|
||||
type="text"
|
||||
@click="handleSearch">
|
||||
<template #icon>
|
||||
<reload-outlined></reload-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-dropdown>
|
||||
<a-tooltip title="密度">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<column-height-outlined></column-height-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selectedKeys="[size]"
|
||||
@click="handleSize">
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip title="设置">
|
||||
<a-button type="text">
|
||||
<template #icon>
|
||||
<setting-outlined></setting-outlined>
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</x-action-bar>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="listData"
|
||||
:loading="loading"
|
||||
:pagination="paginationState"
|
||||
:size="size"
|
||||
row-key="id"
|
||||
@change="onTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="'action' === column.key">
|
||||
<x-action-button @click="handleReview(record)">提现确认</x-action-button>
|
||||
<!-- <x-action-button @click="$refs.editDialogRef.handleEdit(record)">详情</x-action-button> -->
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button>
|
||||
<x-action-button @click="handleDelete(record)">删除</x-action-button>
|
||||
<x-action-button>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<more-outlined></more-outlined>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item>菜单1</a-menu-item>
|
||||
<a-menu-item>菜单2</a-menu-item>
|
||||
<a-menu-item>菜单3</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -57,44 +171,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '提现编号', dataIndex: 'withdrawalOrderId' },
|
||||
{ title: '提现金额', dataIndex: 'withdrawalAmount' },
|
||||
{ title: '银行卡信息', dataIndex: 'bankCardInfo' },
|
||||
{title:"申请时间",dataIndex:'withdrawalTime'},
|
||||
{title:"退款完成时间",dataIndex:'finishedTime'},
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
getPageList()
|
||||
// getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { success,total, data } = await apis.review
|
||||
.getInvoicingFailedList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (success) {
|
||||
listData.value = data
|
||||
paginationState.total =total
|
||||
}
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
} catch (error) {
|
||||
hideLoading()
|
||||
// hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,8 +219,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -115,7 +232,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
;(async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -148,24 +265,16 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
// getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user