mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-17 14:43:41 +08:00
feat(ui): 细节优化
This commit is contained in:
@@ -19,6 +19,7 @@ const columns = [
|
||||
{
|
||||
title: "key",
|
||||
dataIndex: "value",
|
||||
slotName: "value",
|
||||
},
|
||||
{
|
||||
title: "用途",
|
||||
@@ -100,6 +101,11 @@ const handleStatusChange = ({ filed, value, record, reload }) => {
|
||||
><template #icon> <icon-plus /> </template>新增
|
||||
</a-button>
|
||||
</template>
|
||||
<template #value="{ record, column }">
|
||||
<a-typography-text copyable ellipsis style="margin: 0">
|
||||
{{ record[column.dataIndex] }}
|
||||
</a-typography-text>
|
||||
</template>
|
||||
<template #status="{ record, reload }">
|
||||
<a-switch
|
||||
v-model="record.enabled"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, h } from "vue";
|
||||
import { Message, Modal } from "@arco-design/web-vue";
|
||||
import { dateFormat } from "@gpt-vue/packages/utils";
|
||||
import SearchTable from "@/components/SearchTable/SearchTable.vue";
|
||||
import type { SearchTableColumns } from "@/components/SearchTable/type";
|
||||
import app from "@/main";
|
||||
@@ -51,6 +52,7 @@ const columns: SearchTableColumns[] = [
|
||||
search: {
|
||||
valueType: "range",
|
||||
},
|
||||
render: ({ record }) => dateFormat(record.created_at),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import SearchTable from "@/components/SearchTable/SearchTable.vue";
|
||||
import type { SearchTableColumns } from "@/components/SearchTable/type";
|
||||
import { dateFormat } from "@gpt-vue/packages/utils";
|
||||
import { getList } from "./api";
|
||||
|
||||
const columns: SearchTableColumns[] = [
|
||||
@@ -10,6 +11,7 @@ const columns: SearchTableColumns[] = [
|
||||
search: {
|
||||
valueType: "input",
|
||||
},
|
||||
width: 280,
|
||||
},
|
||||
{
|
||||
dataIndex: "username",
|
||||
@@ -30,6 +32,8 @@ const columns: SearchTableColumns[] = [
|
||||
{
|
||||
dataIndex: "created_at",
|
||||
title: "下单时间",
|
||||
render: ({ record }) => dateFormat(record.created_at),
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
dataIndex: "status",
|
||||
@@ -52,6 +56,8 @@ const columns: SearchTableColumns[] = [
|
||||
search: {
|
||||
valueType: "range",
|
||||
},
|
||||
slotName: "pay_time",
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
dataIndex: "pay_way",
|
||||
@@ -60,11 +66,17 @@ const columns: SearchTableColumns[] = [
|
||||
{
|
||||
title: "操作",
|
||||
slotName: "actions",
|
||||
fixed: "right",
|
||||
width: 80,
|
||||
},
|
||||
];
|
||||
</script>
|
||||
<template>
|
||||
<SearchTable :request="getList" :columns="columns">
|
||||
<template #pay_time="{ record }">
|
||||
<a-tag v-if="!record.pay_time" color="blue">未支付</a-tag>
|
||||
<span v-else>{{ dateFormat(record.pay_time) }}</span>
|
||||
</template>
|
||||
<template #actions="{ record }">
|
||||
<a-link :key="record.id" status="danger">删除</a-link>
|
||||
</template>
|
||||
|
||||
@@ -148,7 +148,7 @@ onMounted(async () => {
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" :loading="submitting" @click="handleSave">提交</a-button>
|
||||
<a-button type="primary" :loading="submitting" @click="handleSave">保存</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
|
||||
@@ -141,7 +141,7 @@ onMounted(reload);
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" :loading="submitting" @click="handleSave">提交</a-button>
|
||||
<a-button type="primary" :loading="submitting" @click="handleSave">保存</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
|
||||
@@ -61,7 +61,7 @@ onMounted(reload);
|
||||
<md-editor v-model="formData.content" @on-upload-img="onUploadImg" />
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" :loading="submitting" @click="handleSave">提交</a-button>
|
||||
<a-button type="primary" :loading="submitting" @click="handleSave">保存</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user