添加商城
This commit is contained in:
parent
5425800b42
commit
1e26d75369
2
admin-client/src/components.d.ts
vendored
2
admin-client/src/components.d.ts
vendored
|
|
@ -85,8 +85,10 @@ declare module 'vue' {
|
|||
FindBack: typeof import('./core/components/FindBack.vue')['default']
|
||||
GenerateCron: typeof import('./core/components/GenerateCron.vue')['default']
|
||||
HmActionTypeSelect: typeof import('./core/components/curd/select-components/hm-action-type-select.vue')['default']
|
||||
HmCommonSelect: typeof import('./core/components/curd/select-components/hm-common-select.vue')['default']
|
||||
HmImage: typeof import('./core/components/huanmeng/hm-image.vue')['default']
|
||||
HmImageTypeSelect: typeof import('./core/components/curd/select-components/hm-image-type-select.vue')['default']
|
||||
HmProductTypeSelect: typeof import('./core/components/curd/select-components/hm-product-type-select.vue')['default']
|
||||
HmTenantGroupSelect: typeof import('./core/components/curd/select-components/hm-tenant-group-select.vue')['default']
|
||||
HmTenantSelect: typeof import('./core/components/curd/select-components/hm-tenant-select.vue')['default']
|
||||
Index: typeof import('./core/components/vue3-cron-core/Index.vue')['default']
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
<template>
|
||||
<a-select :options="options" :value="modelValue" @change="updateValue" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import type { SelectProps } from "ant-design-vue";
|
||||
import { AbstractDictionaryCache } from "@/core/utils/cache/AbstractDictionaryCache";
|
||||
import type { SelectValue } from "ant-design-vue/lib/select";
|
||||
|
||||
// 定义 options
|
||||
const options = ref<SelectProps["options"]>([]);
|
||||
|
||||
// 使用 withDefaults 添加默认值
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
abstractDictionaryCache: AbstractDictionaryCache;
|
||||
modelValue: SelectValue;
|
||||
ShowAll: boolean;
|
||||
}>(),
|
||||
{
|
||||
ShowAll: false, // 默认值设置为 true
|
||||
}
|
||||
);
|
||||
|
||||
// 定义 emits
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
|
||||
// 异步获取数据并更新 options
|
||||
props.abstractDictionaryCache.getDataListSelect().then((data) => {
|
||||
options.value?.push(...data);
|
||||
if (props.ShowAll) {
|
||||
options.value?.unshift({ value: "-1", label: "全部" });
|
||||
}
|
||||
});
|
||||
|
||||
// 定义方法以触发 update:modelValue 事件
|
||||
function updateValue(value: SelectValue) {
|
||||
emits("update:modelValue", value);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/* 你的样式代码 */
|
||||
</style>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<template>
|
||||
<a-select :options="options" :value="modelValue" @change="updateValue" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import type { SelectProps } from 'ant-design-vue';
|
||||
import AppDictionaryCache from "@/core/utils/AppDictionaryCache";
|
||||
import type { SelectValue } from 'ant-design-vue/lib/select';
|
||||
|
||||
// 定义 options
|
||||
const options = ref<SelectProps['options']>([]);
|
||||
|
||||
// 使用 withDefaults 添加默认值
|
||||
const props = withDefaults(defineProps<{
|
||||
modelValue: SelectValue,
|
||||
ShowAll: boolean
|
||||
}>(), {
|
||||
ShowAll: false // 默认值设置为 true
|
||||
});
|
||||
|
||||
// 定义 emits
|
||||
const emits = defineEmits(['update:modelValue']);
|
||||
|
||||
// 异步获取数据并更新 options
|
||||
AppDictionaryCache.appDictionaryProductTypeCache.getDataListSelect().then(data => {
|
||||
// console.log(data);
|
||||
options.value?.push(...data);
|
||||
if (props.ShowAll) {
|
||||
options.value?.unshift({ value: '-1', label: '全部' });
|
||||
}
|
||||
});
|
||||
|
||||
// 定义方法以触发 update:modelValue 事件
|
||||
function updateValue(value: SelectValue) {
|
||||
emits('update:modelValue', value);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/* 你的样式代码 */
|
||||
</style>
|
||||
|
|
@ -6,6 +6,9 @@ import AppDictionaryTypesCache from "./cache/AppDictionaryTypesCache";
|
|||
import AppDictionaryPersonalitysCache from "./cache/AppDictionaryPersonalitysCache";
|
||||
import AppDictionaryLablesCache from "./cache/AppDictionaryLablesCache";
|
||||
import AppDictionaryActionTypeCache from "./cache/AppDictionaryActionTypeCache";
|
||||
import AppDictionaryProductTypeCache from "./cache/AppDictionaryProductTypeCache";
|
||||
import AppDictionaryCurrencyCache from "./cache/AppDictionaryCurrencyCache";
|
||||
|
||||
/**
|
||||
* 基础数据缓存类
|
||||
*/
|
||||
|
|
@ -39,6 +42,17 @@ class AppDictionaryCache {
|
|||
* 动作类型
|
||||
*/
|
||||
static appDictionaryActionTypeCache: AbstractDictionaryCache = new AppDictionaryActionTypeCache();
|
||||
|
||||
/**
|
||||
* 产品类型 hm-product-type
|
||||
*/
|
||||
static appDictionaryProductTypeCache: AbstractDictionaryCache = new AppDictionaryProductTypeCache();
|
||||
|
||||
/**
|
||||
* 用户货币类型
|
||||
*/
|
||||
static appDictionaryCurrencyCache: AbstractDictionaryCache = new AppDictionaryCurrencyCache();
|
||||
|
||||
}
|
||||
|
||||
export default AppDictionaryCache;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { AbstractDictionaryCache, AppDictionaryModel, _AbstractDictionaryCache }
|
|||
import { DefaultOptionType } from "ant-design-vue/es/select";
|
||||
|
||||
/**
|
||||
* 图片类型配置
|
||||
* 图片类型配置
|
||||
*/
|
||||
class AppDictionaryActionTypeCache extends AbstractDictionaryCache {
|
||||
protected code: string = "categorymenu_actiontype";
|
||||
|
|
|
|||
22
admin-client/src/core/utils/cache/AppDictionaryCurrencyCache.ts
vendored
Normal file
22
admin-client/src/core/utils/cache/AppDictionaryCurrencyCache.ts
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { AbstractDictionaryCache } from './AbstractDictionaryCache'
|
||||
import { DefaultOptionType } from "ant-design-vue/es/select";
|
||||
|
||||
/**
|
||||
* 产品配置
|
||||
*/
|
||||
class AppDictionaryCurrencyCache extends AbstractDictionaryCache {
|
||||
protected code: string = "aiproject_currency_type";
|
||||
public static _lock: Promise<void> | null = null;
|
||||
constructor() {
|
||||
super(AppDictionaryCurrencyCache._lock);
|
||||
}
|
||||
public async getDataListSelect(): Promise<DefaultOptionType[]> {
|
||||
const _data = await this.getDataList();
|
||||
return _data.map((item) => {
|
||||
return { label: item.name, value: item.value, name: item.name, } as DefaultOptionType;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default AppDictionaryCurrencyCache;
|
||||
22
admin-client/src/core/utils/cache/AppDictionaryProductTypeCache.ts
vendored
Normal file
22
admin-client/src/core/utils/cache/AppDictionaryProductTypeCache.ts
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { AbstractDictionaryCache } from './AbstractDictionaryCache'
|
||||
import { DefaultOptionType } from "ant-design-vue/es/select";
|
||||
|
||||
/**
|
||||
* 产品配置
|
||||
*/
|
||||
class AppDictionaryProductTypeCache extends AbstractDictionaryCache {
|
||||
protected code: string = "aiproject_product_type";
|
||||
public static _lock: Promise<void> | null = null;
|
||||
constructor() {
|
||||
super(AppDictionaryProductTypeCache._lock);
|
||||
}
|
||||
public async getDataListSelect(): Promise<DefaultOptionType[]> {
|
||||
const _data = await this.getDataList();
|
||||
return _data.map((item) => {
|
||||
return { label: item.name, value: item.value, name: item.name, } as DefaultOptionType;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default AppDictionaryProductTypeCache;
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import Http from "@/core/utils/Http";
|
||||
|
||||
/**
|
||||
* T_Products_Reward服务
|
||||
*/
|
||||
export default class T_Products_RewardService {
|
||||
|
||||
static urlPrefix = "/api/v1/admin/T_Products_Reward";
|
||||
|
||||
/**
|
||||
* 获取数据列表
|
||||
* @param current
|
||||
* @param pageSize
|
||||
* @param search
|
||||
* @param searchSort
|
||||
* @returns
|
||||
*/
|
||||
static findList(current: number, pageSize: number, search: any = {}, searchSort: any[] = []) {
|
||||
return Http.post(`${this.urlPrefix}/findList`, {
|
||||
page: current,
|
||||
size: pageSize,
|
||||
search,
|
||||
searchSort
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除集合数据
|
||||
*
|
||||
* @param ids
|
||||
* @returns
|
||||
*/
|
||||
static deleteList(ids: string[]) {
|
||||
return Http.post(`${this.urlPrefix}/deleteList`, ids)
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询表单
|
||||
*
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
static findForm(id?: string | undefined) {
|
||||
return Http.get(`${this.urlPrefix}/findForm${(id ? '/' + id : '')}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存表单数据
|
||||
*
|
||||
* @param id
|
||||
* @param formData
|
||||
* @returns
|
||||
*/
|
||||
static saveForm(id: string | undefined, formData: any) {
|
||||
return Http.post(`${this.urlPrefix}/${id ? 'update' : 'create'}`, formData)
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出 excel
|
||||
*
|
||||
* @param search
|
||||
* @param searchSort
|
||||
* @returns
|
||||
*/
|
||||
static exportExcel(search: any = {}, searchSort: any[] = []) {
|
||||
return Http.download(`${this.urlPrefix}/exportExcel`, {
|
||||
page: -1,
|
||||
size: -1,
|
||||
search,
|
||||
searchSort
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取数据列表
|
||||
* @param productId
|
||||
* @returns
|
||||
*/
|
||||
static getList(productId: number) {
|
||||
return Http.get(`${this.urlPrefix}/findList/${productId}`,)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
import Http from "@/core/utils/Http";
|
||||
|
||||
/**
|
||||
* T_Products服务
|
||||
*/
|
||||
export default class T_ProductsService {
|
||||
|
||||
static urlPrefix = "/api/v1/admin/T_Products";
|
||||
|
||||
/**
|
||||
* 获取数据列表
|
||||
* @param current
|
||||
* @param pageSize
|
||||
* @param search
|
||||
* @param searchSort
|
||||
* @returns
|
||||
*/
|
||||
static findList(current: number, pageSize: number, search: any = {}, searchSort: any[] = []) {
|
||||
return Http.post(`${this.urlPrefix}/findList`, {
|
||||
page: current,
|
||||
size: pageSize,
|
||||
search,
|
||||
searchSort
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除集合数据
|
||||
*
|
||||
* @param ids
|
||||
* @returns
|
||||
*/
|
||||
static deleteList(ids: string[]) {
|
||||
return Http.post(`${this.urlPrefix}/deleteList`, ids)
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询表单
|
||||
*
|
||||
* @param id
|
||||
* @returns
|
||||
*/
|
||||
static findForm(id?: string | undefined) {
|
||||
return Http.get(`${this.urlPrefix}/findForm${(id ? '/' + id : '')}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存表单数据
|
||||
*
|
||||
* @param id
|
||||
* @param formData
|
||||
* @returns
|
||||
*/
|
||||
static saveForm(id: string | undefined, formData: any) {
|
||||
return Http.post(`${this.urlPrefix}/${id ? 'update' : 'create'}`, formData)
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出 excel
|
||||
*
|
||||
* @param search
|
||||
* @param searchSort
|
||||
* @returns
|
||||
*/
|
||||
static exportExcel(search: any = {}, searchSort: any[] = []) {
|
||||
return Http.download(`${this.urlPrefix}/exportExcel`, {
|
||||
page: -1,
|
||||
size: -1,
|
||||
search,
|
||||
searchSort
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改首充状态
|
||||
* @param id
|
||||
* @param v
|
||||
* @returns
|
||||
*/
|
||||
static async setFirstCharge(id: number | undefined, v: boolean | undefined) {
|
||||
return await Http.post(`${this.urlPrefix}/UpdateFirstCharge/${id}/${(v == true ? "1" : "0")}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改修改上架,下架状态
|
||||
* @param id
|
||||
* @param v
|
||||
* @returns
|
||||
*/
|
||||
static async setState(id: number | undefined, v: boolean | undefined) {
|
||||
return await Http.post(`${this.urlPrefix}/UpdateState/${id}/${(v == true ? "1" : "0")}`)
|
||||
}
|
||||
}
|
||||
232
admin-client/src/views/apps/T_Products_Rewards/Index.vue
Normal file
232
admin-client/src/views/apps/T_Products_Rewards/Index.vue
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import { FormInstance } from "ant-design-vue";
|
||||
import { useAuthority } from "@/utils/Authority";
|
||||
import AppIcon from "@/core/components/AppIcon.vue";
|
||||
import Info from "./Info.vue";
|
||||
import Tools from "@/core/utils/Tools";
|
||||
import PageContainer from "@/core/components/PageContainer.vue";
|
||||
import TableCurd from "@/core/components/curd/TableCurd.vue";
|
||||
import T_Products_RewardService from "@/services/apps/T_Products_Rewards/T_Products_RewardService";
|
||||
|
||||
defineOptions({ name: "T_Products_RewardIndex" });
|
||||
|
||||
const state = reactive({
|
||||
search: {
|
||||
state: false,
|
||||
vm: {
|
||||
name: undefined,
|
||||
},
|
||||
sort: [] as any[],
|
||||
},
|
||||
loading: false,
|
||||
page: 1,
|
||||
size: 50,
|
||||
total: 100,
|
||||
columns: [] as any,
|
||||
data: [] as any,
|
||||
});
|
||||
|
||||
//权限
|
||||
const power = useAuthority();
|
||||
//表格
|
||||
const refTableCurd = ref<InstanceType<typeof TableCurd>>();
|
||||
//表单操作对象
|
||||
const refInfo = ref<InstanceType<typeof Info>>();
|
||||
//检索表单
|
||||
const refSearchForm = ref<FormInstance>();
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
onMounted(() => {
|
||||
findList();
|
||||
});
|
||||
|
||||
/**
|
||||
*获取数据
|
||||
*/
|
||||
async function findList() {
|
||||
try{
|
||||
state.loading = true;
|
||||
let keys = Object.keys(state.search.vm);
|
||||
keys.map(k => {
|
||||
if (state.search.vm[k] == null || state.search.vm[k] == "") {
|
||||
delete state.search.vm[k];
|
||||
}
|
||||
});
|
||||
const result = await T_Products_RewardService.findList(state.page, state.size, state.search.vm, state.search.sort);
|
||||
state.loading = false;
|
||||
if (result.code != 200) return;
|
||||
state.page = result.data.page;
|
||||
state.size = result.data.size;
|
||||
state.total = result.data.total;
|
||||
state.columns = result.data.columns;
|
||||
state.data = result.data.dataSource;
|
||||
// state.visible = false;
|
||||
} catch (error) {
|
||||
state.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param id
|
||||
*/
|
||||
async function deleteList(id?: string) {
|
||||
let ids: string[] = [];
|
||||
if (id) {
|
||||
ids.push(id);
|
||||
} else {
|
||||
ids = refTableCurd.value?.getSelectedRowKeys() ?? [];
|
||||
}
|
||||
|
||||
if (ids.length == 0) return Tools.message.error("请选择要删除的行!");
|
||||
|
||||
try{
|
||||
state.loading = true;
|
||||
const result = await T_Products_RewardService.deleteList(ids);
|
||||
state.loading = false;
|
||||
if (result.code != 200) return;
|
||||
Tools.message.success("删除成功!");
|
||||
findList();
|
||||
} catch (error) {
|
||||
state.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
function exportExcel() {
|
||||
T_Products_RewardService.exportExcel(state.search.vm, state.search.sort);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageContainer>
|
||||
<TableCurd
|
||||
ref="refTableCurd"
|
||||
:config="state"
|
||||
@change="
|
||||
(changeTable) => {
|
||||
state.page = changeTable.pagination.current ?? 1;
|
||||
state.size = changeTable.pagination.pageSize ?? state.size;
|
||||
state.search.sort = changeTable.sorter instanceof Array ? [...changeTable.sorter] : [changeTable.sorter];
|
||||
findList();
|
||||
}
|
||||
"
|
||||
@show-size-change="
|
||||
({ current, size }) => {
|
||||
state.page = current == 0 ? 1 : current;
|
||||
state.size = size;
|
||||
findList();
|
||||
}
|
||||
"
|
||||
>
|
||||
<!-- search -->
|
||||
<template #search>
|
||||
<a-form ref="refSearchForm" :model="state.search.vm" v-if="power.search">
|
||||
<a-row :gutter="[16, 0]">
|
||||
<!--
|
||||
<a-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<a-form-item class="mb-0" name="name" label="名称">
|
||||
<a-input v-model:value="state.search.vm.name" placeholder="名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
-->
|
||||
<a-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<a-form-item class="mb-0" name="tenantId" label="项目">
|
||||
<hm-tenant-select v-model:value="state.search.vm.tenantId" :ShowAll="true" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!--button-->
|
||||
<a-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="text-right">
|
||||
<a-space :size="8">
|
||||
<a-button
|
||||
@click="
|
||||
state.page = 1;
|
||||
refSearchForm?.resetFields();
|
||||
findList();
|
||||
"
|
||||
>
|
||||
重置
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="
|
||||
state.page = 1;
|
||||
findList();
|
||||
"
|
||||
>
|
||||
查询
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
<!-- toolbar-left -->
|
||||
<template #toolbar-left>
|
||||
<a-button @click="state.search.state = !state.search.state" v-if="power.search">
|
||||
<div v-if="state.search.state"><AppIcon name="UpOutlined" /> 收起</div>
|
||||
<div v-else><AppIcon name="DownOutlined" /> 展开</div>
|
||||
</a-button>
|
||||
<a-button type="primary" @click="() => refInfo?.open()" v-if="power.insert">
|
||||
<template #icon>
|
||||
<AppIcon name="PlusOutlined" />
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<a-popconfirm title="您确定要删除?" @confirm="deleteList()" okText="确定" cancelText="取消" v-if="power.delete">
|
||||
<a-button type="primary" danger>
|
||||
<template #icon>
|
||||
<AppIcon name="DeleteOutlined" />
|
||||
</template>
|
||||
批量删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
<!-- toolbar-right -->
|
||||
<template #toolbar-right>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="exportExcel()">导出 Excel</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button> 更多 <AppIcon name="ellipsis-outlined" /> </a-button>
|
||||
</a-dropdown>
|
||||
<!-- 列设置 -->
|
||||
<a-popover>
|
||||
<template #content>
|
||||
<div v-for="item in state.columns.filter((w:any) => w.fieldName.substr(0, 1) != '_')">
|
||||
<a-checkbox v-model:checked="item.show">{{ item.title }}</a-checkbox>
|
||||
</div>
|
||||
</template>
|
||||
<a-button type="text">
|
||||
<template #icon><AppIcon name="setting-outlined" /> </template>
|
||||
</a-button>
|
||||
</a-popover>
|
||||
</template>
|
||||
<!-- table-col -->
|
||||
<template #table-col>
|
||||
<template v-for="item,index in state.columns.filter((w:any) => w.fieldName !== 'id' && w.show)" :key="item.fieldName">
|
||||
<a-table-column :title="item.title" :data-index="item.fieldName" :sorter="item.sort ? { multiple: index + 1 } : false" />
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<a-table-column title="操作" data-index="id" v-if="power.update || power.delete" width="200px" fixed="right">
|
||||
<template #default="{ record }">
|
||||
<a href="javascript:;" @click="() => refInfo?.open(record.id)" v-if="power.update">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm title="您确定要删除?" @confirm="deleteList(record.id)" okText="确定" cancelText="取消" v-if="power.delete">
|
||||
<a class="text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</a-table-column>
|
||||
</template>
|
||||
</TableCurd>
|
||||
<!-- Info -->
|
||||
<Info ref="refInfo" :onSuccess="() => findList()" />
|
||||
</PageContainer>
|
||||
</template>
|
||||
155
admin-client/src/views/apps/T_Products_Rewards/Info.vue
Normal file
155
admin-client/src/views/apps/T_Products_Rewards/Info.vue
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref } from "vue";
|
||||
import { FormInstance } from "ant-design-vue";
|
||||
import Tools from "@/core/utils/Tools";
|
||||
import T_Products_RewardService from "@/services/apps/T_Products_Rewards/T_Products_RewardService";
|
||||
import AppDictionaryCache from "@/core/utils/AppDictionaryCache";
|
||||
//定义组件事件
|
||||
const props = defineProps<{ onSuccess: () => void }>();
|
||||
|
||||
const state = reactive({
|
||||
vm: {
|
||||
id: "",
|
||||
form: {} as any,
|
||||
},
|
||||
visible: false,
|
||||
loading: false,
|
||||
});
|
||||
|
||||
//表单实例
|
||||
const refForm = ref<FormInstance>();
|
||||
|
||||
//向父级导出 函数
|
||||
defineExpose({
|
||||
/**
|
||||
* 打开表单初始化
|
||||
* @param key
|
||||
*/
|
||||
open: (key: string = "") => {
|
||||
state.visible = true;
|
||||
if (state.visible) {
|
||||
state.vm.id = key;
|
||||
}
|
||||
refForm.value?.resetFields();
|
||||
//初始化表单数据
|
||||
state.loading = true;
|
||||
T_Products_RewardService.findForm(key).then((res) => {
|
||||
state.loading = false;
|
||||
if (res.code != 200) return;
|
||||
state.vm = res.data;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
*保存数据
|
||||
*/
|
||||
function save() {
|
||||
refForm.value?.validate().then(async () => {
|
||||
try {
|
||||
state.loading = true;
|
||||
const result = await T_Products_RewardService.saveForm(
|
||||
state.vm.id,
|
||||
state.vm.form
|
||||
);
|
||||
state.loading = false;
|
||||
if (result.code != 200) return;
|
||||
Tools.message.success("操作成功!");
|
||||
props.onSuccess();
|
||||
state.visible = false;
|
||||
} catch (error) {
|
||||
state.loading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-modal
|
||||
v-model:open="state.visible"
|
||||
:title="state.vm.id ? '编辑' : '新建'"
|
||||
centered
|
||||
@ok="state.visible = false"
|
||||
:width="800"
|
||||
>
|
||||
<template #footer>
|
||||
<a-button type="primary" :loading="state.loading" @click="save()">
|
||||
提交</a-button
|
||||
>
|
||||
<a-button @click="state.visible = false">关闭</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="state.loading">
|
||||
<a-form ref="refForm" layout="vertical" :model="state.vm.form">
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item label="项目" name="tenantId">
|
||||
<hm-tenant-select v-model:value="state.vm.form.tenantId" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item
|
||||
label="奖励类型"
|
||||
name="currencyType"
|
||||
>
|
||||
<hm-common-select
|
||||
:abstractDictionaryCache="
|
||||
AppDictionaryCache.appDictionaryCurrencyCache
|
||||
"
|
||||
v-model:value="state.vm.form.currencyType"
|
||||
></hm-common-select>
|
||||
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item
|
||||
label="赠送金额"
|
||||
name="money"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.money"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item
|
||||
label="首充赠送金额"
|
||||
name="firstChargeMoney"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.firstChargeMoney"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item
|
||||
label="所属商品"
|
||||
name="productId"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.productId"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item
|
||||
label="所属商品"
|
||||
name="t_ProductId"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.t_ProductId"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
584
admin-client/src/views/apps/T_Productss/Index.vue
Normal file
584
admin-client/src/views/apps/T_Productss/Index.vue
Normal file
|
|
@ -0,0 +1,584 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import { FormInstance } from "ant-design-vue";
|
||||
import { useAuthority } from "@/utils/Authority";
|
||||
import AppIcon from "@/core/components/AppIcon.vue";
|
||||
import Info from "./Info.vue";
|
||||
import RewardsInfo from "./Rewards.vue";
|
||||
import Tools from "@/core/utils/Tools";
|
||||
import PageContainer from "@/core/components/PageContainer.vue";
|
||||
import TableCurd from "@/core/components/curd/TableCurd.vue";
|
||||
import T_ProductsService from "@/services/apps/T_Productss/T_ProductsService";
|
||||
import AppDictionaryCache from "@/core/utils/AppDictionaryCache";
|
||||
|
||||
defineOptions({ name: "T_ProductsIndex" });
|
||||
|
||||
var ProductTypeCache = [];
|
||||
AppDictionaryCache.appDictionaryProductTypeCache.getDataList().then((data) => {
|
||||
console.log(data);
|
||||
|
||||
ProductTypeCache = data;
|
||||
});
|
||||
|
||||
const state = reactive({
|
||||
search: {
|
||||
state: false,
|
||||
vm: {
|
||||
name: undefined,
|
||||
},
|
||||
sort: [] as any[],
|
||||
},
|
||||
loading: false,
|
||||
page: 1,
|
||||
size: 50,
|
||||
total: 100,
|
||||
columns: [] as any,
|
||||
data: [] as any,
|
||||
// scroll: { x: "100vw", y: "60vh" },
|
||||
});
|
||||
|
||||
//权限
|
||||
const power = useAuthority();
|
||||
//表格
|
||||
const refTableCurd = ref<InstanceType<typeof TableCurd>>();
|
||||
//表单操作对象
|
||||
const refInfo = ref<InstanceType<typeof Info>>();
|
||||
//表单操作对象
|
||||
const refRewardsInfo = ref<InstanceType<typeof RewardsInfo>>();
|
||||
//检索表单
|
||||
const refSearchForm = ref<FormInstance>();
|
||||
|
||||
var columns = [
|
||||
{
|
||||
fieldName: "id",
|
||||
dataIndex: "id",
|
||||
title: "道具Id",
|
||||
show: true,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 1,
|
||||
},
|
||||
{
|
||||
fieldName: "tenantId",
|
||||
dataIndex: "tenantId",
|
||||
title: "租户ID",
|
||||
show: false,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 2,
|
||||
},
|
||||
{
|
||||
fieldName: "productId",
|
||||
dataIndex: "productId",
|
||||
title: "道具Id",
|
||||
show: true,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 3,
|
||||
},
|
||||
{
|
||||
fieldName: "productName",
|
||||
dataIndex: "productName",
|
||||
title: "道具名称",
|
||||
show: true,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 4,
|
||||
},
|
||||
{
|
||||
fieldName: "productType",
|
||||
dataIndex: "productType",
|
||||
title: "道具类型",
|
||||
show: true,
|
||||
width: "240px",
|
||||
sorter: true,
|
||||
orderById: 5,
|
||||
},
|
||||
{
|
||||
fieldName: "productDesc",
|
||||
dataIndex: "productDesc",
|
||||
title: "道具描述",
|
||||
show: true,
|
||||
width: "255px",
|
||||
sorter: true,
|
||||
orderById: 6,
|
||||
},
|
||||
{
|
||||
fieldName: "price",
|
||||
dataIndex: "price",
|
||||
title: "价格",
|
||||
show: true,
|
||||
width: "50px",
|
||||
sorter: true,
|
||||
orderById: 7,
|
||||
},
|
||||
{
|
||||
fieldName: "productImgId",
|
||||
dataIndex: "productImgId",
|
||||
title: "产品图片",
|
||||
show: true,
|
||||
width: "220px",
|
||||
sorter: true,
|
||||
orderById: 8,
|
||||
},
|
||||
{
|
||||
fieldName: "isProductDelisting",
|
||||
dataIndex: "isProductDelisting",
|
||||
title: "商品状态",
|
||||
show: true,
|
||||
width: "220px",
|
||||
sorter: true,
|
||||
orderById: 9,
|
||||
},
|
||||
{
|
||||
fieldName: "orderById",
|
||||
dataIndex: "orderById",
|
||||
title: "排序",
|
||||
show: true,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 10,
|
||||
},
|
||||
{
|
||||
fieldName: "isFirstCharge",
|
||||
dataIndex: "isFirstCharge",
|
||||
title: "首充",
|
||||
show: true,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 10,
|
||||
},
|
||||
{
|
||||
fieldName: "firstChargeImgId",
|
||||
dataIndex: "firstChargeImgId",
|
||||
title: "首充图片",
|
||||
show: true,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 11,
|
||||
},
|
||||
{
|
||||
fieldName: "firstChargePrice",
|
||||
dataIndex: "firstChargePrice",
|
||||
title: "首充价格",
|
||||
show: true,
|
||||
width: "80px",
|
||||
sorter: true,
|
||||
orderById: 12,
|
||||
},
|
||||
{
|
||||
fieldName: "createTime",
|
||||
dataIndex: "createTime",
|
||||
title: "创建时间",
|
||||
show: false,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 13,
|
||||
},
|
||||
{
|
||||
fieldName: "updateTime",
|
||||
dataIndex: "updateTime",
|
||||
title: "更新时间",
|
||||
show: false,
|
||||
width: "100px",
|
||||
sorter: true,
|
||||
orderById: 14,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
onMounted(() => {
|
||||
findList();
|
||||
});
|
||||
|
||||
/**
|
||||
*获取数据
|
||||
*/
|
||||
async function findList() {
|
||||
try {
|
||||
state.loading = true;
|
||||
let keys = Object.keys(state.search.vm);
|
||||
keys.map((k) => {
|
||||
if (k != "productType") {
|
||||
if (state.search.vm[k] == null || state.search.vm[k] == "") {
|
||||
console.log(k);
|
||||
|
||||
delete state.search.vm[k];
|
||||
}
|
||||
}
|
||||
});
|
||||
const result = await T_ProductsService.findList(
|
||||
state.page,
|
||||
state.size,
|
||||
state.search.vm,
|
||||
state.search.sort
|
||||
);
|
||||
state.loading = false;
|
||||
if (result.code != 200) return;
|
||||
state.page = result.data.page;
|
||||
state.size = result.data.size;
|
||||
state.total = result.data.total;
|
||||
state.columns = columns; // result.data.columns;
|
||||
state.data = result.data.dataSource;
|
||||
// state.visible = false;
|
||||
} catch (error) {
|
||||
state.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param id
|
||||
*/
|
||||
async function deleteList(id?: string) {
|
||||
let ids: string[] = [];
|
||||
if (id) {
|
||||
ids.push(id);
|
||||
} else {
|
||||
ids = refTableCurd.value?.getSelectedRowKeys() ?? [];
|
||||
}
|
||||
|
||||
if (ids.length == 0) return Tools.message.error("请选择要删除的行!");
|
||||
|
||||
try {
|
||||
state.loading = true;
|
||||
const result = await T_ProductsService.deleteList(ids);
|
||||
state.loading = false;
|
||||
if (result.code != 200) return;
|
||||
Tools.message.success("删除成功!");
|
||||
findList();
|
||||
} catch (error) {
|
||||
state.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
function exportExcel() {
|
||||
T_ProductsService.exportExcel(state.search.vm, state.search.sort);
|
||||
}
|
||||
function GetProductTypeCache(type: number) {
|
||||
if (ProductTypeCache != null) {
|
||||
var x = ProductTypeCache.find((it) => it.value == type);
|
||||
if (x != null) {
|
||||
return x.name;
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
async function isProductDelistingChange(
|
||||
id: number,
|
||||
delisting: number,
|
||||
record: any
|
||||
) {
|
||||
console.log(delisting);
|
||||
var response = await T_ProductsService.setState(
|
||||
id,
|
||||
delisting == 1 ? true : false
|
||||
);
|
||||
// var response = await T_CharacterService.setVisibility(id, visibility);
|
||||
// console.log(visibility, response);
|
||||
// record.visibility=visibility;
|
||||
}
|
||||
|
||||
async function isFirstChargeChange(
|
||||
id: number,
|
||||
isFirstCharge: boolean,
|
||||
record: any
|
||||
) {
|
||||
var response = await T_ProductsService.setFirstCharge(id, isFirstCharge);
|
||||
|
||||
// record.visibility=visibility;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageContainer>
|
||||
<TableCurd
|
||||
ref="refTableCurd"
|
||||
:config="state"
|
||||
@change="
|
||||
(changeTable) => {
|
||||
state.page = changeTable.pagination.current ?? 1;
|
||||
state.size = changeTable.pagination.pageSize ?? state.size;
|
||||
state.search.sort =
|
||||
changeTable.sorter instanceof Array
|
||||
? [...changeTable.sorter]
|
||||
: [changeTable.sorter];
|
||||
findList();
|
||||
}
|
||||
"
|
||||
@show-size-change="
|
||||
({ current, size }) => {
|
||||
state.page = current == 0 ? 1 : current;
|
||||
state.size = size;
|
||||
findList();
|
||||
}
|
||||
"
|
||||
>
|
||||
<!-- search -->
|
||||
<template #search>
|
||||
<a-form
|
||||
ref="refSearchForm"
|
||||
:model="state.search.vm"
|
||||
v-if="power.search"
|
||||
>
|
||||
<a-row :gutter="[16, 0]">
|
||||
<!--
|
||||
<a-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<a-form-item class="mb-0" name="name" label="名称">
|
||||
<a-input v-model:value="state.search.vm.name" placeholder="名称" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
-->
|
||||
<a-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<a-form-item class="mb-0" name="tenantId" label="项目">
|
||||
<hm-tenant-select
|
||||
v-model:value="state.search.vm.tenantId"
|
||||
:ShowAll="true"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<a-form-item class="mb-0" name="ProductType" label="道具类型">
|
||||
<hm-product-type-select
|
||||
v-model:value="state.search.vm.productType"
|
||||
:ShowAll="true"
|
||||
></hm-product-type-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
|
||||
<a-form-item class="mb-0" name="ProductName" label="道具名称">
|
||||
<a-input
|
||||
v-model:value="state.search.vm.productName"
|
||||
placeholder="道具名称"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<!--button-->
|
||||
<a-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6" class="text-right">
|
||||
<a-space :size="8">
|
||||
<a-button
|
||||
@click="
|
||||
state.page = 1;
|
||||
refSearchForm?.resetFields();
|
||||
findList();
|
||||
"
|
||||
>
|
||||
重置
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="
|
||||
state.page = 1;
|
||||
findList();
|
||||
"
|
||||
>
|
||||
查询
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
<!-- toolbar-left -->
|
||||
<template #toolbar-left>
|
||||
<a-button
|
||||
@click="state.search.state = !state.search.state"
|
||||
v-if="power.search"
|
||||
>
|
||||
<div v-if="state.search.state">
|
||||
<AppIcon name="UpOutlined" /> 收起
|
||||
</div>
|
||||
<div v-else><AppIcon name="DownOutlined" /> 展开</div>
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
@click="() => refInfo?.open()"
|
||||
v-if="power.insert"
|
||||
>
|
||||
<template #icon>
|
||||
<AppIcon name="PlusOutlined" />
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
<a-popconfirm
|
||||
title="您确定要删除?"
|
||||
@confirm="deleteList()"
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
v-if="power.delete"
|
||||
>
|
||||
<a-button type="primary" danger>
|
||||
<template #icon>
|
||||
<AppIcon name="DeleteOutlined" />
|
||||
</template>
|
||||
批量删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
<!-- toolbar-right -->
|
||||
<template #toolbar-right>
|
||||
<a-dropdown>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="exportExcel()"
|
||||
>导出 Excel</a-menu-item
|
||||
>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button> 更多 <AppIcon name="ellipsis-outlined" /> </a-button>
|
||||
</a-dropdown>
|
||||
<!-- 列设置 -->
|
||||
<a-popover>
|
||||
<template #content>
|
||||
<div
|
||||
v-for="item in state.columns.filter((w:any) => w.fieldName.substr(0, 1) != '_')"
|
||||
>
|
||||
<a-checkbox v-model:checked="item.show">{{
|
||||
item.title
|
||||
}}</a-checkbox>
|
||||
</div>
|
||||
</template>
|
||||
<a-button type="text">
|
||||
<template #icon><AppIcon name="setting-outlined" /> </template>
|
||||
</a-button>
|
||||
</a-popover>
|
||||
</template>
|
||||
<!-- table-col -->
|
||||
<template #table-col>
|
||||
<template
|
||||
v-for="item,index in state.columns.filter((w:any) => w.fieldName !== 'id' && w.show)"
|
||||
:key="item.fieldName"
|
||||
>
|
||||
<a-table-column
|
||||
v-if="item.fieldName == 'productType'"
|
||||
:title="item.title"
|
||||
:data-index="item.fieldName"
|
||||
:sorter="item.sort ? { multiple: index + 1 } : false"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
{{ GetProductTypeCache(record.productType) }}
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
v-else-if="item.fieldName == 'isProductDelisting'"
|
||||
:title="item.title"
|
||||
:data-index="item.fieldName"
|
||||
:sorter="item.sort ? { multiple: index + 1 } : false"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<a-switch
|
||||
v-model:checked="record.isProductDelisting"
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
checked-children="上架"
|
||||
un-checked-children="下架"
|
||||
@change="
|
||||
isProductDelistingChange(
|
||||
record.id,
|
||||
record.isProductDelisting,
|
||||
record
|
||||
)
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
v-else-if="item.fieldName == 'productImgId'"
|
||||
:title="item.title"
|
||||
:data-index="item.fieldName"
|
||||
:sorter="item.sort ? { multiple: index + 1 } : false"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<a-image
|
||||
:width="100"
|
||||
:src="record.productImg + '/htslt'"
|
||||
:preview="{ src: record.productImg }"
|
||||
/>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
v-else-if="item.fieldName == 'firstChargeImgId'"
|
||||
:title="item.title"
|
||||
:data-index="item.fieldName"
|
||||
:sorter="item.sort ? { multiple: index + 1 } : false"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<a-image
|
||||
:width="100"
|
||||
:src="record.firstChargeImg + '/htslt'"
|
||||
:preview="{ src: record.firstChargeImg }"
|
||||
/>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
v-else-if="item.fieldName == 'isFirstCharge'"
|
||||
:title="item.title"
|
||||
:data-index="item.fieldName"
|
||||
:sorter="item.sort ? { multiple: index + 1 } : false"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<a-switch
|
||||
v-model:checked="record.isFirstCharge"
|
||||
checked-children="首充"
|
||||
un-checked-children="首充"
|
||||
@change="
|
||||
isFirstChargeChange(record.id, record.isFirstCharge, record)
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
v-else
|
||||
:title="item.title"
|
||||
:data-index="item.fieldName"
|
||||
:sorter="item.sort ? { multiple: index + 1 } : false"
|
||||
/>
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<a-table-column
|
||||
title="操作"
|
||||
data-index="id"
|
||||
v-if="power.update || power.delete"
|
||||
width="200px"
|
||||
fixed="right"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<a
|
||||
href="javascript:;"
|
||||
@click="() => refRewardsInfo?.open(record.id, record)"
|
||||
v-if="power.update"
|
||||
>设置奖励</a
|
||||
>
|
||||
<a-divider type="vertical" />
|
||||
<a
|
||||
href="javascript:;"
|
||||
@click="() => refInfo?.open(record.id)"
|
||||
v-if="power.update"
|
||||
>编辑</a
|
||||
>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="您确定要删除?"
|
||||
@confirm="deleteList(record.id)"
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
v-if="power.delete"
|
||||
>
|
||||
<a class="text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</a-table-column>
|
||||
</template>
|
||||
</TableCurd>
|
||||
<!-- Info -->
|
||||
<Info ref="refInfo" :onSuccess="() => findList()" />
|
||||
<RewardsInfo ref="refRewardsInfo" :onSuccess="() => findList()" />
|
||||
</PageContainer>
|
||||
</template>
|
||||
204
admin-client/src/views/apps/T_Productss/Info.vue
Normal file
204
admin-client/src/views/apps/T_Productss/Info.vue
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref } from "vue";
|
||||
import { FormInstance } from "ant-design-vue";
|
||||
import Tools from "@/core/utils/Tools";
|
||||
import T_ProductsService from "@/services/apps/T_Productss/T_ProductsService";
|
||||
|
||||
//定义组件事件
|
||||
const props = defineProps<{ onSuccess: () => void }>();
|
||||
|
||||
const state = reactive({
|
||||
vm: {
|
||||
id: "",
|
||||
form: {} as any,
|
||||
},
|
||||
visible: false,
|
||||
loading: false,
|
||||
});
|
||||
|
||||
//表单实例
|
||||
const refForm = ref<FormInstance>();
|
||||
|
||||
//向父级导出 函数
|
||||
defineExpose({
|
||||
/**
|
||||
* 打开表单初始化
|
||||
* @param key
|
||||
*/
|
||||
open: (key: string = "") => {
|
||||
state.visible = true;
|
||||
if (state.visible) {
|
||||
state.vm.id = key;
|
||||
}
|
||||
refForm.value?.resetFields();
|
||||
//初始化表单数据
|
||||
state.loading = true;
|
||||
T_ProductsService.findForm(key).then((res) => {
|
||||
state.loading = false;
|
||||
if (res.code != 200) return;
|
||||
state.vm = res.data;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
*保存数据
|
||||
*/
|
||||
function save() {
|
||||
refForm.value?.validate().then(async () => {
|
||||
try {
|
||||
state.loading = true;
|
||||
const result = await T_ProductsService.saveForm(
|
||||
state.vm.id,
|
||||
state.vm.form
|
||||
);
|
||||
state.loading = false;
|
||||
if (result.code != 200) return;
|
||||
Tools.message.success("操作成功!");
|
||||
props.onSuccess();
|
||||
state.visible = false;
|
||||
} catch (error) {
|
||||
state.loading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-modal
|
||||
v-model:open="state.visible"
|
||||
:title="state.vm.id ? '编辑' : '新建'"
|
||||
centered
|
||||
@ok="state.visible = false"
|
||||
:width="800" :maskClosable="false"
|
||||
>
|
||||
<template #footer>
|
||||
<a-button type="primary" :loading="state.loading" @click="save()">
|
||||
提交</a-button
|
||||
>
|
||||
<a-button @click="state.visible = false">关闭</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="state.loading">
|
||||
<a-form ref="refForm" layout="vertical" :model="state.vm.form">
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item label="项目" name="tenantId">
|
||||
<hm-tenant-select v-model:value="state.vm.form.tenantId" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
|
||||
<a-form-item
|
||||
label="道具Id"
|
||||
name="productId"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.productId"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
|
||||
<a-form-item
|
||||
label="道具类型"
|
||||
name="productType"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<hm-product-type-select v-model:value="state.vm.form.productType" ></hm-product-type-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item
|
||||
label="道具名称"
|
||||
name="productName"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.productName"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
|
||||
<a-form-item
|
||||
label="排序"
|
||||
name="orderById"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.orderById"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
|
||||
<a-form-item
|
||||
label="道具描述"
|
||||
name="productDesc"
|
||||
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.productDesc"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="6" :sm="6" :md="6" :lg="6" :xl="6">
|
||||
<a-form-item
|
||||
label="价格"
|
||||
name="price"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.price"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :xs="6" :sm="6" :md="6" :lg="6" :xl="6">
|
||||
<a-form-item
|
||||
label="商品状态"
|
||||
name="isProductDelisting"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-select v-model:value="state.vm.form.isProductDelisting">
|
||||
<a-select-option :value="1">上架</a-select-option>
|
||||
<a-select-option :value="0">下架</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="6" :sm="6" :md="6" :lg="6" :xl="6">
|
||||
<a-form-item label="首充" name="isFirstCharge">
|
||||
<a-select v-model:value="state.vm.form.isFirstCharge">
|
||||
<a-select-option :value="true">有</a-select-option>
|
||||
<a-select-option :value="false">无</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="6" :sm="6" :md="6" :lg="6" :xl="6">
|
||||
<a-form-item label="首充价格" name="firstChargePrice">
|
||||
<a-input
|
||||
v-model:value="state.vm.form.firstChargePrice"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item
|
||||
label="道具图片"
|
||||
name="productImgId"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<hm-image v-model="state.vm.form.productImgId" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
||||
<a-form-item label="首充图片" name="firstChargeImgId">
|
||||
<hm-image v-model="state.vm.form.firstChargeImgId" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
137
admin-client/src/views/apps/T_Productss/InfoRawards.vue
Normal file
137
admin-client/src/views/apps/T_Productss/InfoRawards.vue
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref } from "vue";
|
||||
import { FormInstance } from "ant-design-vue";
|
||||
import Tools from "@/core/utils/Tools";
|
||||
import T_Products_RewardService from "@/services/apps/T_Products_Rewards/T_Products_RewardService";
|
||||
import AppDictionaryCache from "@/core/utils/AppDictionaryCache";
|
||||
//定义组件事件
|
||||
const props = defineProps<{ onSuccess: () => void }>();
|
||||
|
||||
const state = reactive({
|
||||
vm: {
|
||||
id: "",
|
||||
form: {} as any,
|
||||
},
|
||||
visible: false,
|
||||
loading: false,
|
||||
});
|
||||
|
||||
//表单实例
|
||||
const refForm = ref<FormInstance>();
|
||||
|
||||
//向父级导出 函数
|
||||
defineExpose({
|
||||
/**
|
||||
* 打开表单初始化
|
||||
* @param key
|
||||
*/
|
||||
open: (key: string = "", data: any = null) => {
|
||||
state.visible = true;
|
||||
if (state.visible) {
|
||||
state.vm.id = key;
|
||||
}
|
||||
refForm.value?.resetFields();
|
||||
//初始化表单数据
|
||||
state.loading = true;
|
||||
if (key == "0" && data != null) {
|
||||
console.log(data, data.id);
|
||||
state.vm.form = {
|
||||
currencyType: 0,
|
||||
money: 0,
|
||||
t_ProductId: data.id,
|
||||
firstChargeMoney: 0,
|
||||
productId: data.productId,
|
||||
tenantId: data.tenantId,
|
||||
id: 0,
|
||||
};
|
||||
state.loading = false;
|
||||
} else {
|
||||
T_Products_RewardService.findForm(key).then((res) => {
|
||||
state.loading = false;
|
||||
if (res.code != 200) return;
|
||||
state.vm = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
*保存数据
|
||||
*/
|
||||
function save() {
|
||||
refForm.value?.validate().then(async () => {
|
||||
try {
|
||||
state.loading = true;
|
||||
const result = await T_Products_RewardService.saveForm(
|
||||
state.vm.id,
|
||||
state.vm.form
|
||||
);
|
||||
state.loading = false;
|
||||
if (result.code != 200) return;
|
||||
Tools.message.success("操作成功!");
|
||||
props.onSuccess();
|
||||
state.visible = false;
|
||||
} catch (error) {
|
||||
state.loading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-modal
|
||||
v-model:open="state.visible"
|
||||
:title="state.vm.id ? '编辑' : '新建'"
|
||||
centered
|
||||
:maskClosable="false"
|
||||
@ok="state.visible = false"
|
||||
:width="800"
|
||||
>
|
||||
<template #footer>
|
||||
<a-button type="primary" :loading="state.loading" @click="save()">
|
||||
提交</a-button
|
||||
>
|
||||
<a-button @click="state.visible = false">关闭</a-button>
|
||||
</template>
|
||||
<a-spin :spinning="state.loading">
|
||||
<a-form ref="refForm" layout="vertical" :model="state.vm.form">
|
||||
<a-row :gutter="[16, 0]">
|
||||
<a-col :xs="8" :sm="8" :md="8" :lg="8" :xl="8">
|
||||
<a-form-item label="奖励类型" name="currencyType">
|
||||
<hm-common-select :abstractDictionaryCache="AppDictionaryCache.appDictionaryCurrencyCache" v-model:value="state.vm.form.currencyType"
|
||||
></hm-common-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="8" :sm="8" :md="8" :lg="8" :xl="8">
|
||||
<a-form-item
|
||||
label="赠送金额"
|
||||
name="money"
|
||||
:rules="[{ required: true, message: '请输入', trigger: 'blur' }]"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.money"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="8" :sm="8" :md="8" :lg="8" :xl="8">
|
||||
<a-form-item
|
||||
label="首充额外赠送金额"
|
||||
name="firstChargeMoney"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="state.vm.form.firstChargeMoney"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<div>
|
||||
<input type="hidden" :value="state.vm.form.tenantId" />
|
||||
<input type="hidden" :value="state.vm.form.t_ProductId" />
|
||||
<input type="hidden" :value="state.vm.form.productId" />
|
||||
</div>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
191
admin-client/src/views/apps/T_Productss/Rewards.vue
Normal file
191
admin-client/src/views/apps/T_Productss/Rewards.vue
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref } from "vue";
|
||||
import { FormInstance } from "ant-design-vue";
|
||||
import Tools from "@/core/utils/Tools";
|
||||
import T_Products_RewardService from "@/services/apps/T_Products_Rewards/T_Products_RewardService";
|
||||
import AppDictionaryCache from "@/core/utils/AppDictionaryCache";
|
||||
import InfoRawards from "./InfoRawards.vue";
|
||||
import type { TableColumnsType } from "ant-design-vue";
|
||||
|
||||
//表单操作对象
|
||||
const refInfoRawards = ref<InstanceType<typeof InfoRawards>>();
|
||||
var currencyCache = null;
|
||||
AppDictionaryCache.appDictionaryCurrencyCache.getDataList().then((data) => {
|
||||
currencyCache = data;
|
||||
});
|
||||
const columns: TableColumnsType = [
|
||||
{
|
||||
title: "奖励类型",
|
||||
width: 10,
|
||||
dataIndex: "currencyType",
|
||||
key: "currencyType",
|
||||
customRender: ({ text, record, index, column }) => {
|
||||
console.log(record, text, currencyCache);
|
||||
var temp = currencyCache.find((it) => it.value == record.currencyType);
|
||||
return temp?.name;
|
||||
},
|
||||
},
|
||||
{ title: "赠送金额", dataIndex: "money", key: "money", width: 10 },
|
||||
{
|
||||
title: "首充赠送金额",
|
||||
dataIndex: "firstChargeMoney",
|
||||
key: "firstChargeMoney",
|
||||
width: 10,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "operation",
|
||||
|
||||
width: 10,
|
||||
},
|
||||
];
|
||||
|
||||
interface DataItem {
|
||||
id: number;
|
||||
currencyType: string;
|
||||
money: number;
|
||||
firstChargeMoney: number;
|
||||
}
|
||||
|
||||
const data = reactive([]);
|
||||
// for (let i = 0; i < 100; i++) {
|
||||
// data.push({
|
||||
// key: i,
|
||||
// name: `Edrward ${i}`,
|
||||
// age: 32,
|
||||
// address: `London Park no. ${i}`,
|
||||
// });
|
||||
// }
|
||||
|
||||
//定义组件事件
|
||||
const props = defineProps<{ onSuccess: () => void }>();
|
||||
|
||||
const state = reactive({
|
||||
vm: {
|
||||
id: "",
|
||||
form: {} as any,
|
||||
},
|
||||
visible: false,
|
||||
loading: false,
|
||||
});
|
||||
|
||||
//表单实例
|
||||
const refForm = ref<FormInstance>();
|
||||
let _data = null;
|
||||
let _key = null;
|
||||
//向父级导出 函数
|
||||
defineExpose({
|
||||
/**
|
||||
* 打开表单初始化
|
||||
* @param key
|
||||
*/
|
||||
open: (key: number = 0, ldata: any) => {
|
||||
_data = ldata;
|
||||
_key = key;
|
||||
loadData();
|
||||
// data.splice(0, data.length);
|
||||
// state.visible = true;
|
||||
// T_Products_RewardService.getList(key).then((res) => {
|
||||
// console.log(res);
|
||||
// if (res.data != null) {
|
||||
// res.data.forEach((element) => {
|
||||
// data.push(element);
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// T_Products_RewardService.findList(state.page, state.size, state.search.vm, state.search.sort);
|
||||
// refForm.value?.resetFields();
|
||||
// //初始化表单数据
|
||||
// state.loading = true;
|
||||
// T_Products_RewardService.findForm(key).then((res) => {
|
||||
// state.loading = false;
|
||||
// if (res.code != 200) return;
|
||||
// state.vm = res.data;
|
||||
// });
|
||||
},
|
||||
});
|
||||
const addReward = () => {
|
||||
refInfoRawards?.value.open("0", _data);
|
||||
};
|
||||
const loadData = () => {
|
||||
data.splice(0, data.length);
|
||||
state.visible = true;
|
||||
T_Products_RewardService.getList(_key).then((res) => {
|
||||
console.log(res);
|
||||
if (res.data != null) {
|
||||
res.data.forEach((element) => {
|
||||
data.push(element);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param id
|
||||
*/
|
||||
async function deleteList(id?: string) {
|
||||
let ids: string[] = [];
|
||||
if (id) {
|
||||
ids.push(id);
|
||||
}
|
||||
|
||||
if (ids.length == 0) return Tools.message.error("请选择要删除的行!");
|
||||
|
||||
try{
|
||||
state.loading = true;
|
||||
const result = await T_Products_RewardService.deleteList(ids);
|
||||
state.loading = false;
|
||||
if (result.code != 200) return;
|
||||
Tools.message.success("删除成功!");
|
||||
loadData();
|
||||
} catch (error) {
|
||||
state.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-modal
|
||||
v-model:open="state.visible"
|
||||
:title="state.vm.id ? '编辑奖励' : '新建奖励'"
|
||||
centered
|
||||
@ok="state.visible = false"
|
||||
:width="800"
|
||||
:maskClosable="false"
|
||||
>
|
||||
<div>
|
||||
<a-button type="primary" @click="addReward">添加</a-button>
|
||||
</div>
|
||||
<a-spin :spinning="state.loading">
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
:bordered="true"
|
||||
:pagination="false"
|
||||
:scroll="{ x: 700, y: 300 }"
|
||||
>
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.key === 'operation'">
|
||||
<a
|
||||
href="javascript:;"
|
||||
@click="() => refInfoRawards?.open(record.id, _data)"
|
||||
>编辑</a
|
||||
>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="您确定要删除?"
|
||||
@confirm="deleteList(record.id)"
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
>
|
||||
<a class="text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-spin>
|
||||
<InfoRawards ref="refInfoRawards" :onSuccess="() => loadData()" />
|
||||
</a-modal>
|
||||
</template>
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
using FreeSql;
|
||||
|
||||
using MiaoYu.Repository.ChatAI.Admin.Entities;
|
||||
using MiaoYu.Repository.ChatAI.Admin.Entities.Apps;
|
||||
|
||||
using TencentCloud.Tsf.V20180326.Models;
|
||||
namespace MiaoYu.Api.Admin.ApplicationServices.Apps;
|
||||
|
||||
/// <summary>
|
||||
/// 商城表 服务 T_ProductsService
|
||||
/// </summary>
|
||||
public class T_ProductsService : ApplicationService<IRepository<T_Products>>
|
||||
{
|
||||
private IRepository<T_Image_Config> imageRepository;
|
||||
public T_ProductsService(IRepository<T_Products> defaultRepository,
|
||||
IRepository<T_Image_Config> imageRepository)
|
||||
: base(defaultRepository)
|
||||
{
|
||||
this.imageRepository = imageRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表数据
|
||||
/// </summary>
|
||||
/// <param name="pagingSearchInput"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PagingView> FindListAsync(PagingSearchInput<T_Products> pagingSearchInput)
|
||||
{
|
||||
|
||||
var query = this._defaultRepository.Select
|
||||
|
||||
//项目
|
||||
.WhereIf(pagingSearchInput.Search?.TenantId != null,
|
||||
w => w.TenantId == pagingSearchInput.Search.TenantId)
|
||||
|
||||
|
||||
|
||||
//道具名称
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(pagingSearchInput.Search?.ProductName),
|
||||
w => w.ProductName.Contains(pagingSearchInput.Search.ProductName ?? ""))
|
||||
|
||||
|
||||
//道具类型
|
||||
.WhereIf(pagingSearchInput.Search?.ProductType != null && pagingSearchInput.Search?.ProductType > 0,
|
||||
w => w.ProductType == pagingSearchInput.Search.ProductType)
|
||||
|
||||
|
||||
.OrderBy(w => w.OrderById)
|
||||
.Select(w => new
|
||||
{
|
||||
w.Id,
|
||||
w.TenantId,
|
||||
w.ProductId,
|
||||
w.ProductName,
|
||||
w.ProductType,
|
||||
w.ProductDesc,
|
||||
w.Price,
|
||||
w.ProductImgId,
|
||||
w.IsProductDelisting,
|
||||
w.IsFirstCharge,
|
||||
w.FirstChargeImgId,
|
||||
w.FirstChargePrice,
|
||||
w.CreateTime,
|
||||
w.UpdateTime,
|
||||
w.OrderById,
|
||||
ProductImg = w.ProductImgId == 0 ? "" : imageRepository.Select.FirstOrDefault(it => it.ImageId == w.ProductImgId).Url,
|
||||
FirstChargeImg = (w.FirstChargeImgId == null || w.FirstChargeImgId == 0) ? "" : imageRepository.Select.FirstOrDefault(it => it.ImageId == w.FirstChargeImgId).Url
|
||||
// w.LastModificationTime,
|
||||
// w.CreationTime
|
||||
})
|
||||
;
|
||||
|
||||
var result = await _defaultRepository.AsPagingViewAsync(query, pagingSearchInput);
|
||||
// result
|
||||
// .FormatValue(query, w => w.CreationTime, (oldValue) => oldValue.ToString("yyyy-MM-dd"))
|
||||
// .FormatValue(query, w => w.LastModificationTime, (oldValue) => oldValue?.ToString("yyyy-MM-dd"))
|
||||
// ;
|
||||
// 设置列
|
||||
//result.GetColumn(query, w => w.OperatorName).SetColumn("操作人");
|
||||
//result.GetColumn(query, w => w.OperatorName!).SetColumn<SysUser>(w => w.Name!);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id数组删除
|
||||
/// </summary>
|
||||
/// <param name="ids">ids</param>
|
||||
/// <returns></returns>
|
||||
public async Task DeleteListAsync(List<int> ids)
|
||||
{
|
||||
await this._defaultRepository.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询表单数据
|
||||
/// </summary>
|
||||
/// <param name="id">id</param>
|
||||
/// <returns></returns>
|
||||
public async Task<Dictionary<string, object>> FindFormAsync(int id)
|
||||
{
|
||||
var res = new Dictionary<string, object>();
|
||||
var form = await this._defaultRepository.FindByIdAsync(id);
|
||||
form = form.NullSafe();
|
||||
if (form.CreateTime == null || form.CreateTime == DateTime.MinValue)
|
||||
{
|
||||
form.CreateTime = DateTime.Now;
|
||||
}
|
||||
if (form.UpdateTime == null || form.UpdateTime == DateTime.MinValue)
|
||||
{
|
||||
form.UpdateTime = DateTime.Now;
|
||||
}
|
||||
res[nameof(id)] = id;
|
||||
res[nameof(form)] = form;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="form">form</param>
|
||||
/// <returns></returns>
|
||||
public Task SaveFormAsync(T_Products form)
|
||||
{
|
||||
return this._defaultRepository.InsertOrUpdateAsync(form);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出Excel
|
||||
/// </summary>
|
||||
/// <param name="pagingSearchInput"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<byte[]> ExportExcelAsync(PagingSearchInput<T_Products> pagingSearchInput)
|
||||
{
|
||||
pagingSearchInput.Page = -1;
|
||||
var tableViewModel = await this.FindListAsync(pagingSearchInput);
|
||||
return ExcelUtil.ExportExcelByPagingView(tableViewModel, null, "Id");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改首充状态
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<bool> UpdateFirstCharge(bool state, int id)
|
||||
{
|
||||
var form = await this._defaultRepository.FindByIdAsync(id);
|
||||
if (form == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
form.IsFirstCharge = state;
|
||||
await SaveFormAsync(form);
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改上架,下架状态
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<bool> UpdateFirstCharge(int state, int id)
|
||||
{
|
||||
var form = await this._defaultRepository.FindByIdAsync(id);
|
||||
if (form == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
form.IsProductDelisting = state;
|
||||
await SaveFormAsync(form);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
using MiaoYu.Repository.ChatAI.Admin.Entities.Apps;
|
||||
namespace MiaoYu.Api.Admin.ApplicationServices.Apps;
|
||||
|
||||
/// <summary>
|
||||
/// 产品表奖励 服务 T_Products_RewardService
|
||||
/// </summary>
|
||||
public class T_Products_RewardService : ApplicationService<IRepository<T_Products_Reward>>
|
||||
{
|
||||
public T_Products_RewardService(IRepository<T_Products_Reward> defaultRepository)
|
||||
: base(defaultRepository)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表数据
|
||||
/// </summary>
|
||||
/// <param name="pagingSearchInput"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<PagingView> FindListAsync(PagingSearchInput<T_Products_Reward> pagingSearchInput)
|
||||
{
|
||||
var query = this._defaultRepository.Select
|
||||
|
||||
//项目
|
||||
.WhereIf(pagingSearchInput.Search?.TenantId != null,
|
||||
w => w.TenantId == pagingSearchInput.Search.TenantId)
|
||||
|
||||
|
||||
|
||||
.OrderByDescending(w => w.Id)
|
||||
.Select(w => new
|
||||
{
|
||||
w.Id,
|
||||
w.CurrencyType,
|
||||
w.Money,
|
||||
w.T_ProductId,
|
||||
w.FirstChargeMoney,
|
||||
w.ProductId,
|
||||
w.TenantId,
|
||||
// w.LastModificationTime,
|
||||
// w.CreationTime
|
||||
})
|
||||
;
|
||||
|
||||
var result = await _defaultRepository.AsPagingViewAsync(query, pagingSearchInput);
|
||||
// result
|
||||
// .FormatValue(query, w => w.CreationTime, (oldValue) => oldValue.ToString("yyyy-MM-dd"))
|
||||
// .FormatValue(query, w => w.LastModificationTime, (oldValue) => oldValue?.ToString("yyyy-MM-dd"))
|
||||
// ;
|
||||
// 设置列
|
||||
//result.GetColumn(query, w => w.OperatorName).SetColumn("操作人");
|
||||
//result.GetColumn(query, w => w.OperatorName!).SetColumn<SysUser>(w => w.Name!);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表数据
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<T_Products_Reward>> FindListAsync(int productId)
|
||||
{
|
||||
var query = await this._defaultRepository.SelectNoTracking.Where(it => it.T_ProductId == productId).OrderByDescending(w => w.Id).ToListAsync();
|
||||
return query;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id数组删除
|
||||
/// </summary>
|
||||
/// <param name="ids">ids</param>
|
||||
/// <returns></returns>
|
||||
public async Task DeleteListAsync(List<int> ids)
|
||||
{
|
||||
await this._defaultRepository.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询表单数据
|
||||
/// </summary>
|
||||
/// <param name="id">id</param>
|
||||
/// <returns></returns>
|
||||
public async Task<Dictionary<string, object>> FindFormAsync(int id)
|
||||
{
|
||||
var res = new Dictionary<string, object>();
|
||||
var form = await this._defaultRepository.FindByIdAsync(id);
|
||||
form = form.NullSafe();
|
||||
//if (form.CreateTime == null || form.CreateTime == DateTime.MinValue)
|
||||
//{
|
||||
// form.CreateTime = DateTime.Now;
|
||||
//}
|
||||
//if (form.UpdateTime == null || form.UpdateTime == DateTime.MinValue)
|
||||
//{
|
||||
// form.UpdateTime = DateTime.Now;
|
||||
//}
|
||||
res[nameof(id)] = id;
|
||||
res[nameof(form)] = form;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="form">form</param>
|
||||
/// <returns></returns>
|
||||
public Task SaveFormAsync(T_Products_Reward form)
|
||||
{
|
||||
return this._defaultRepository.InsertOrUpdateAsync(form);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出Excel
|
||||
/// </summary>
|
||||
/// <param name="pagingSearchInput"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<byte[]> ExportExcelAsync(PagingSearchInput<T_Products_Reward> pagingSearchInput)
|
||||
{
|
||||
pagingSearchInput.Page = -1;
|
||||
var tableViewModel = await this.FindListAsync(pagingSearchInput);
|
||||
return ExcelUtil.ExportExcelByPagingView(tableViewModel, null, "Id");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
using MiaoYu.Api.Admin.ApplicationServices.Apps;
|
||||
using MiaoYu.Repository.ChatAI.Admin.Entities.Apps;
|
||||
namespace MiaoYu.Api.Admin.Controllers.Apps;
|
||||
|
||||
/// <summary>
|
||||
/// 商城表 控制器
|
||||
/// </summary>
|
||||
[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找,如果不设置不受权限保护!", DisplayName = "商城表")]
|
||||
public class T_ProductsController : AdminControllerBase<T_ProductsService>
|
||||
{
|
||||
public T_ProductsController(T_ProductsService defaultService)
|
||||
: base(defaultService)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <param name="pagingSearchInput"></param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Display, DisplayName = "查看数据")]
|
||||
[HttpPost]
|
||||
public Task<PagingView> FindListAsync([FromBody] PagingSearchInput<T_Products> pagingSearchInput)
|
||||
{
|
||||
return this._defaultService.FindListAsync(pagingSearchInput);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据id数组删除
|
||||
/// </summary>
|
||||
/// <param name="ids">ids</param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Delete, DisplayName = "删除数据")]
|
||||
[HttpPost]
|
||||
public async Task<bool> DeleteListAsync([FromBody] List<int> ids)
|
||||
{
|
||||
await this._defaultService.DeleteListAsync(ids);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询表单数据
|
||||
/// </summary>
|
||||
/// <param name="id">id</param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(DisplayName = "查看表单")]
|
||||
[HttpGet("{id?}")]
|
||||
public Task<Dictionary<string, object>> FindFormAsync([FromRoute] int id)
|
||||
{
|
||||
return this._defaultService.FindFormAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="form"></param>
|
||||
/// <returns></returns>
|
||||
[RequestLimitFilter(Duration = 1, LimitCount = 1)]
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Insert, DisplayName = "创建表单")]
|
||||
[HttpPost]
|
||||
[ApiCheckModel]
|
||||
public Task CreateAsync([FromBody] T_Products form)
|
||||
{
|
||||
return this._defaultService.SaveFormAsync(form);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑
|
||||
/// </summary>
|
||||
/// <param name="form"></param>
|
||||
/// <returns></returns>
|
||||
[RequestLimitFilter(Duration = 1, LimitCount = 1)]
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "编辑表单")]
|
||||
[HttpPost]
|
||||
[ApiCheckModel]
|
||||
public Task UpdateAsync([FromBody] T_Products form)
|
||||
{
|
||||
return this._defaultService.SaveFormAsync(form);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出Excel
|
||||
/// </summary>
|
||||
/// <param name="pagingSearchInput"></param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Export, DisplayName = "导出数据")]
|
||||
[ApiResourceCacheFilter(10)]
|
||||
[HttpPost]
|
||||
public async Task ExportExcelAsync([FromBody] PagingSearchInput<T_Products> pagingSearchInput)
|
||||
{
|
||||
var data = await this._defaultService.ExportExcelAsync(pagingSearchInput);
|
||||
var name = $"{PermissionUtil.GetControllerDisplayName(this.GetType())}列表数据 {DateTime.Now.ToString("yyyy-MM-dd")}.xls";
|
||||
base.HttpContext.DownLoadFile(data, Tools.GetFileContentType[".xls"].ToStr(), name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改角色状态
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="v"></param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "修改首充")]
|
||||
[HttpPost("{id?}/{v?}")]
|
||||
public async Task<bool> UpdateFirstCharge([FromRoute] int id, [FromRoute] int v)
|
||||
{
|
||||
return await this._defaultService.UpdateFirstCharge(v == 0 ? false : true, id);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改角色状态
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="v"></param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "修改上线,下线")]
|
||||
[HttpPost("{id?}/{v?}")]
|
||||
public async Task<bool> UpdateState([FromRoute] int id, [FromRoute] int v)
|
||||
{
|
||||
return await this._defaultService.UpdateFirstCharge(v, id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
using MiaoYu.Api.Admin.ApplicationServices.Apps;
|
||||
using MiaoYu.Repository.ChatAI.Admin.Entities.Apps;
|
||||
namespace MiaoYu.Api.Admin.Controllers.Apps;
|
||||
|
||||
/// <summary>
|
||||
/// 产品表奖励 控制器
|
||||
/// </summary>
|
||||
[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找,如果不设置不受权限保护!", DisplayName = "产品表奖励")]
|
||||
public class T_Products_RewardController : AdminControllerBase<T_Products_RewardService>
|
||||
{
|
||||
public T_Products_RewardController(T_Products_RewardService defaultService)
|
||||
: base(defaultService)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <param name="pagingSearchInput"></param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Display, DisplayName = "查看数据")]
|
||||
[HttpPost]
|
||||
public Task<PagingView> FindListAsync([FromBody] PagingSearchInput<T_Products_Reward> pagingSearchInput)
|
||||
{
|
||||
return this._defaultService.FindListAsync(pagingSearchInput);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取列表
|
||||
/// </summary>
|
||||
/// <param name="productId"></param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Display, DisplayName = "查看数据")]
|
||||
[HttpGet("{productId?}")]
|
||||
public async Task<List<T_Products_Reward>> FindListAsync([FromRoute] int productId)
|
||||
{
|
||||
return await this._defaultService.FindListAsync(productId);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据id数组删除
|
||||
/// </summary>
|
||||
/// <param name="ids">ids</param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Delete, DisplayName = "删除数据")]
|
||||
[HttpPost]
|
||||
public async Task<bool> DeleteListAsync([FromBody] List<int> ids)
|
||||
{
|
||||
await this._defaultService.DeleteListAsync(ids);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询表单数据
|
||||
/// </summary>
|
||||
/// <param name="id">id</param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(DisplayName = "查看表单")]
|
||||
[HttpGet("{id?}")]
|
||||
public Task<Dictionary<string, object>> FindFormAsync([FromRoute] int id)
|
||||
{
|
||||
return this._defaultService.FindFormAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="form"></param>
|
||||
/// <returns></returns>
|
||||
[RequestLimitFilter(Duration = 1, LimitCount = 1)]
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Insert, DisplayName = "创建表单")]
|
||||
[HttpPost]
|
||||
[ApiCheckModel]
|
||||
public Task CreateAsync([FromBody] T_Products_Reward form)
|
||||
{
|
||||
return this._defaultService.SaveFormAsync(form);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑
|
||||
/// </summary>
|
||||
/// <param name="form"></param>
|
||||
/// <returns></returns>
|
||||
[RequestLimitFilter(Duration = 1, LimitCount = 1)]
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "编辑表单")]
|
||||
[HttpPost]
|
||||
[ApiCheckModel]
|
||||
public Task UpdateAsync([FromBody] T_Products_Reward form)
|
||||
{
|
||||
return this._defaultService.SaveFormAsync(form);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出Excel
|
||||
/// </summary>
|
||||
/// <param name="pagingSearchInput"></param>
|
||||
/// <returns></returns>
|
||||
[ActionDescriptor(PermissionFunctionConsts.Function_Export, DisplayName = "导出数据")]
|
||||
[ApiResourceCacheFilter(10)]
|
||||
[HttpPost]
|
||||
public async Task ExportExcelAsync([FromBody] PagingSearchInput<T_Products_Reward> pagingSearchInput)
|
||||
{
|
||||
var data = await this._defaultService.ExportExcelAsync(pagingSearchInput);
|
||||
var name = $"{PermissionUtil.GetControllerDisplayName(this.GetType())}列表数据 {DateTime.Now.ToString("yyyy-MM-dd")}.xls";
|
||||
base.HttpContext.DownLoadFile(data, Tools.GetFileContentType[".xls"].ToStr(), name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -663,6 +663,109 @@
|
|||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Api.Admin.ApplicationServices.Apps.T_ProductsService">
|
||||
<summary>
|
||||
商城表 服务 T_ProductsService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_ProductsService.FindListAsync(MiaoYu.Shared.Admin.Models.PagingViews.PagingSearchInput{MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products})">
|
||||
<summary>
|
||||
获取列表数据
|
||||
</summary>
|
||||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_ProductsService.DeleteListAsync(System.Collections.Generic.List{System.Int32})">
|
||||
<summary>
|
||||
根据id数组删除
|
||||
</summary>
|
||||
<param name="ids">ids</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_ProductsService.FindFormAsync(System.Int32)">
|
||||
<summary>
|
||||
查询表单数据
|
||||
</summary>
|
||||
<param name="id">id</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_ProductsService.SaveFormAsync(MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products)">
|
||||
<summary>
|
||||
保存数据
|
||||
</summary>
|
||||
<param name="form">form</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_ProductsService.ExportExcelAsync(MiaoYu.Shared.Admin.Models.PagingViews.PagingSearchInput{MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products})">
|
||||
<summary>
|
||||
导出Excel
|
||||
</summary>
|
||||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_ProductsService.UpdateFirstCharge(System.Boolean,System.Int32)">
|
||||
<summary>
|
||||
修改首充状态
|
||||
</summary>
|
||||
<param name="state"></param>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_ProductsService.UpdateFirstCharge(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
修改上架,下架状态
|
||||
</summary>
|
||||
<param name="state"></param>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Api.Admin.ApplicationServices.Apps.T_Products_RewardService">
|
||||
<summary>
|
||||
产品表奖励 服务 T_Products_RewardService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_Products_RewardService.FindListAsync(MiaoYu.Shared.Admin.Models.PagingViews.PagingSearchInput{MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward})">
|
||||
<summary>
|
||||
获取列表数据
|
||||
</summary>
|
||||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_Products_RewardService.FindListAsync(System.Int32)">
|
||||
<summary>
|
||||
获取列表数据
|
||||
</summary>
|
||||
<param name="productId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_Products_RewardService.DeleteListAsync(System.Collections.Generic.List{System.Int32})">
|
||||
<summary>
|
||||
根据id数组删除
|
||||
</summary>
|
||||
<param name="ids">ids</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_Products_RewardService.FindFormAsync(System.Int32)">
|
||||
<summary>
|
||||
查询表单数据
|
||||
</summary>
|
||||
<param name="id">id</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_Products_RewardService.SaveFormAsync(MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward)">
|
||||
<summary>
|
||||
保存数据
|
||||
</summary>
|
||||
<param name="form">form</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.ApplicationServices.Apps.T_Products_RewardService.ExportExcelAsync(MiaoYu.Shared.Admin.Models.PagingViews.PagingSearchInput{MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward})">
|
||||
<summary>
|
||||
导出Excel
|
||||
</summary>
|
||||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Api.Admin.ApplicationServices.Apps.T_UserService">
|
||||
<summary>
|
||||
用户表 服务 T_UserService
|
||||
|
|
@ -2656,6 +2759,123 @@
|
|||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController">
|
||||
<summary>
|
||||
商城表 控制器
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController.FindListAsync(MiaoYu.Shared.Admin.Models.PagingViews.PagingSearchInput{MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products})">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController.DeleteListAsync(System.Collections.Generic.List{System.Int32})">
|
||||
<summary>
|
||||
根据id数组删除
|
||||
</summary>
|
||||
<param name="ids">ids</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController.FindFormAsync(System.Int32)">
|
||||
<summary>
|
||||
查询表单数据
|
||||
</summary>
|
||||
<param name="id">id</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController.CreateAsync(MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products)">
|
||||
<summary>
|
||||
添加
|
||||
</summary>
|
||||
<param name="form"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController.UpdateAsync(MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products)">
|
||||
<summary>
|
||||
编辑
|
||||
</summary>
|
||||
<param name="form"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController.ExportExcelAsync(MiaoYu.Shared.Admin.Models.PagingViews.PagingSearchInput{MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products})">
|
||||
<summary>
|
||||
导出Excel
|
||||
</summary>
|
||||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController.UpdateFirstCharge(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
修改角色状态
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="v"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_ProductsController.UpdateState(System.Int32,System.Int32)">
|
||||
<summary>
|
||||
修改角色状态
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="v"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Api.Admin.Controllers.Apps.T_Products_RewardController">
|
||||
<summary>
|
||||
产品表奖励 控制器
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_Products_RewardController.FindListAsync(MiaoYu.Shared.Admin.Models.PagingViews.PagingSearchInput{MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward})">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_Products_RewardController.FindListAsync(System.Int32)">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<param name="productId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_Products_RewardController.DeleteListAsync(System.Collections.Generic.List{System.Int32})">
|
||||
<summary>
|
||||
根据id数组删除
|
||||
</summary>
|
||||
<param name="ids">ids</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_Products_RewardController.FindFormAsync(System.Int32)">
|
||||
<summary>
|
||||
查询表单数据
|
||||
</summary>
|
||||
<param name="id">id</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_Products_RewardController.CreateAsync(MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward)">
|
||||
<summary>
|
||||
添加
|
||||
</summary>
|
||||
<param name="form"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_Products_RewardController.UpdateAsync(MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward)">
|
||||
<summary>
|
||||
编辑
|
||||
</summary>
|
||||
<param name="form"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:MiaoYu.Api.Admin.Controllers.Apps.T_Products_RewardController.ExportExcelAsync(MiaoYu.Shared.Admin.Models.PagingViews.PagingSearchInput{MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward})">
|
||||
<summary>
|
||||
导出Excel
|
||||
</summary>
|
||||
<param name="pagingSearchInput"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Api.Admin.Controllers.Apps.T_UserController">
|
||||
<summary>
|
||||
用户表 控制器
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
namespace MiaoYu.Repository.ChatAI.Admin.Entities.Apps;
|
||||
|
||||
/// <summary>
|
||||
/// 商城表
|
||||
/// </summary>
|
||||
[EntityDescription(FieldIgnored = true)]
|
||||
public class T_Products : DefaultEntityV4
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 道具Id => 备注: 道具Id
|
||||
/// </summary>
|
||||
public string? ProductId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 道具名称 => 备注: 道具名称
|
||||
/// </summary>
|
||||
public string? ProductName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 道具类型 => 备注: 道具类型,0商城,1商店
|
||||
/// </summary>
|
||||
public Int32 ProductType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 道具描述 => 备注: 道具描述
|
||||
/// </summary>
|
||||
public string? ProductDesc { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 价格 => 备注: 价格
|
||||
/// </summary>
|
||||
public Decimal Price { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 道具图片 => 备注: 道具图片配置 图片id
|
||||
/// </summary>
|
||||
public Int32 ProductImgId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品状态 => 备注: 商品是否下架 0否1是
|
||||
/// </summary>
|
||||
public Int32 IsProductDelisting { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 首充 => 备注: 是否有首充
|
||||
/// </summary>
|
||||
public Boolean IsFirstCharge { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 首充图片 => 备注: 首充图片
|
||||
/// </summary>
|
||||
public Int32? FirstChargeImgId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 首充价格 => 备注: 首充价格
|
||||
/// </summary>
|
||||
public Decimal? FirstChargePrice { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间 => 备注: 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间 => 备注: 更新时间
|
||||
/// </summary>
|
||||
public DateTime? UpdateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序 => 备注: 排序
|
||||
/// </summary>
|
||||
public Int32? OrderById { get; set; }
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
namespace MiaoYu.Repository.ChatAI.Admin.Entities.Apps;
|
||||
|
||||
/// <summary>
|
||||
/// 产品表奖励
|
||||
/// </summary>
|
||||
[EntityDescription(FieldIgnored = true)]
|
||||
public class T_Products_Reward : DefaultEntityV4
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 奖励类型 => 备注: 奖励类型
|
||||
/// </summary>
|
||||
public Int32 CurrencyType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 送多少奖励 => 备注: 送多少奖励
|
||||
/// </summary>
|
||||
public Int32 Money { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 所属商品 => 备注: 所属商品
|
||||
/// </summary>
|
||||
public Int32 T_ProductId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 首充送多少奖励 => 备注: 首充送多少奖励
|
||||
/// </summary>
|
||||
public Int32? FirstChargeMoney { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 所属商品 => 备注: 所属商品
|
||||
/// </summary>
|
||||
public string? ProductId { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -482,6 +482,106 @@
|
|||
其它的模板
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products">
|
||||
<summary>
|
||||
商城表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.ProductId">
|
||||
<summary>
|
||||
道具Id => 备注: 道具Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.ProductName">
|
||||
<summary>
|
||||
道具名称 => 备注: 道具名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.ProductType">
|
||||
<summary>
|
||||
道具类型 => 备注: 道具类型,0商城,1商店
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.ProductDesc">
|
||||
<summary>
|
||||
道具描述 => 备注: 道具描述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.Price">
|
||||
<summary>
|
||||
价格 => 备注: 价格
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.ProductImgId">
|
||||
<summary>
|
||||
道具图片 => 备注: 道具图片配置 图片id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.IsProductDelisting">
|
||||
<summary>
|
||||
商品状态 => 备注: 商品是否下架 0否1是
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.IsFirstCharge">
|
||||
<summary>
|
||||
首充 => 备注: 是否有首充
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.FirstChargeImgId">
|
||||
<summary>
|
||||
首充图片 => 备注: 首充图片
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.FirstChargePrice">
|
||||
<summary>
|
||||
首充价格 => 备注: 首充价格
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.CreateTime">
|
||||
<summary>
|
||||
创建时间 => 备注: 创建时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.UpdateTime">
|
||||
<summary>
|
||||
更新时间 => 备注: 更新时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products.OrderById">
|
||||
<summary>
|
||||
排序 => 备注: 排序
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward">
|
||||
<summary>
|
||||
产品表奖励
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward.CurrencyType">
|
||||
<summary>
|
||||
奖励类型 => 备注: 奖励类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward.Money">
|
||||
<summary>
|
||||
送多少奖励 => 备注: 送多少奖励
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward.T_ProductId">
|
||||
<summary>
|
||||
所属商品 => 备注: 所属商品
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward.FirstChargeMoney">
|
||||
<summary>
|
||||
首充送多少奖励 => 备注: 首充送多少奖励
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_Products_Reward.ProductId">
|
||||
<summary>
|
||||
所属商品 => 备注: 所属商品
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:MiaoYu.Repository.ChatAI.Admin.Entities.Apps.T_User">
|
||||
<summary>
|
||||
用户表
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user