文件种子数据
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 181 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 320 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 460 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 181 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 320 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 460 KiB |
Binary file not shown.
27
Yi.Framework.Net6/Yi.Framework.Model/SeedData/FileSeed.cs
Normal file
27
Yi.Framework.Net6/Yi.Framework.Model/SeedData/FileSeed.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Models;
|
||||||
|
|
||||||
|
namespace Yi.Framework.Model.SeedData
|
||||||
|
{
|
||||||
|
public class FileSeed : AbstractSeed<FileEntity>
|
||||||
|
{
|
||||||
|
public override List<FileEntity> GetSeed()
|
||||||
|
{
|
||||||
|
FileEntity file1 = new FileEntity()
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
FilePath = "Image",
|
||||||
|
FileType = "",
|
||||||
|
IsDeleted = false,
|
||||||
|
FileName = "0.jpg"
|
||||||
|
};
|
||||||
|
Entitys.Add(file1);
|
||||||
|
return Entitys;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,6 +40,11 @@ namespace Yi.Framework.Model.SeedData
|
|||||||
{
|
{
|
||||||
return new DeptSeed().GetSeed();
|
return new DeptSeed().GetSeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<FileEntity> GetFileSeed()
|
||||||
|
{
|
||||||
|
return new FileSeed().GetSeed();
|
||||||
|
}
|
||||||
public static List<UserRoleEntity> GetUserRoleSeed(List<UserEntity> users, List<RoleEntity> roles)
|
public static List<UserRoleEntity> GetUserRoleSeed(List<UserEntity> users, List<RoleEntity> roles)
|
||||||
{
|
{
|
||||||
List<UserRoleEntity> userRoleEntities = new();
|
List<UserRoleEntity> userRoleEntities = new();
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace Yi.Framework.WebCore.DbExtend
|
|||||||
var posts = SeedFactory.GetPostSeed();
|
var posts = SeedFactory.GetPostSeed();
|
||||||
var dictinfos = SeedFactory.GetDictionaryInfoSeed();
|
var dictinfos = SeedFactory.GetDictionaryInfoSeed();
|
||||||
var depts = SeedFactory.GetDeptSeed();
|
var depts = SeedFactory.GetDeptSeed();
|
||||||
|
var files = SeedFactory.GetFileSeed();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_Db.AsTenant().BeginTran();
|
_Db.AsTenant().BeginTran();
|
||||||
@@ -68,6 +69,12 @@ namespace Yi.Framework.WebCore.DbExtend
|
|||||||
{
|
{
|
||||||
_Db.Insertable(SeedFactory.GetRoleMenuSeed(roles, menus)).ExecuteCommand();
|
_Db.Insertable(SeedFactory.GetRoleMenuSeed(roles, menus)).ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_Db.Queryable<FileEntity>().Any())
|
||||||
|
{
|
||||||
|
_Db.Insertable(files).ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
_Db.AsTenant().CommitTran();
|
_Db.AsTenant().CommitTran();
|
||||||
res = true;
|
res = true;
|
||||||
}
|
}
|
||||||
|
|||||||
1
Yi.Vue3.x.Vant/components.d.ts
vendored
1
Yi.Vue3.x.Vant/components.d.ts
vendored
@@ -9,6 +9,7 @@ declare module '@vue/runtime-core' {
|
|||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
AppCreateTime: typeof import('./src/components/AppCreateTime.vue')['default']
|
AppCreateTime: typeof import('./src/components/AppCreateTime.vue')['default']
|
||||||
AppGrid: typeof import('./src/components/AppGrid.vue')['default']
|
AppGrid: typeof import('./src/components/AppGrid.vue')['default']
|
||||||
|
AppUserIcon: typeof import('./src/components/AppUserIcon.vue')['default']
|
||||||
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
|
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
|
|||||||
34
Yi.Vue3.x.Vant/src/components/AppUserIcon.vue
Normal file
34
Yi.Vue3.x.Vant/src/components/AppUserIcon.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<van-image
|
||||||
|
round
|
||||||
|
:width="width"
|
||||||
|
:height="height"
|
||||||
|
:src="url+(src??'0')"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { type } from 'os';
|
||||||
|
import { ref } from 'vue'
|
||||||
|
defineProps<{ src: {type:string,default:'null',required:false},
|
||||||
|
width:{type:string,default:'3rem',required:false},
|
||||||
|
height:{type:string,default:'3rem',required:false},
|
||||||
|
|
||||||
|
}>()
|
||||||
|
const url = `${import.meta.env.VITE_APP_BASE_API}/file/`;
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.col-body
|
||||||
|
{
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
.col-body .van-icon
|
||||||
|
{
|
||||||
|
margin-bottom: 0.6rem;
|
||||||
|
}
|
||||||
|
p{
|
||||||
|
font-size: large;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -10,12 +10,7 @@
|
|||||||
>
|
>
|
||||||
<van-row v-for="(item, index) in articleList" :key="index" class="row">
|
<van-row v-for="(item, index) in articleList" :key="index" class="row">
|
||||||
<van-col span="4" class="leftCol">
|
<van-col span="4" class="leftCol">
|
||||||
<van-image
|
<AppUserIcon width="3rem" height="3rem" :src="item.user==null?null:(item.user.icon)"/>
|
||||||
round
|
|
||||||
width="3rem"
|
|
||||||
height="3rem"
|
|
||||||
src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
|
|
||||||
/>
|
|
||||||
</van-col>
|
</van-col>
|
||||||
|
|
||||||
<van-col span="14" class="centerTitle">
|
<van-col span="14" class="centerTitle">
|
||||||
@@ -77,6 +72,7 @@
|
|||||||
import { ref, onMounted, reactive, toRefs } from "vue";
|
import { ref, onMounted, reactive, toRefs } from "vue";
|
||||||
import { ImagePreview, Toast } from "vant";
|
import { ImagePreview, Toast } from "vant";
|
||||||
import AppCreateTime from "@/components/AppCreateTime.vue";
|
import AppCreateTime from "@/components/AppCreateTime.vue";
|
||||||
|
import AppUserIcon from "@/components/AppUserIcon.vue";
|
||||||
import articleApi from "@/api/articleApi.ts";
|
import articleApi from "@/api/articleApi.ts";
|
||||||
import { ArticleEntity } from "@/type/interface/ArticleEntity.ts";
|
import { ArticleEntity } from "@/type/interface/ArticleEntity.ts";
|
||||||
const VanImagePreview = ImagePreview.Component;
|
const VanImagePreview = ImagePreview.Component;
|
||||||
@@ -172,7 +168,7 @@ const getList = () => {
|
|||||||
.rowBody {
|
.rowBody {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
min-height: 2rem;
|
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
<van-row class="bodyRow">
|
<van-row class="bodyRow">
|
||||||
<van-col span="6" class="leftCol">
|
<van-col span="6" class="leftCol">
|
||||||
<van-image
|
<AppUserIcon width="4rem" height="4rem" :src="user.icon"></AppUserIcon>
|
||||||
round
|
|
||||||
width="4rem"
|
|
||||||
height="4rem"
|
|
||||||
src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
|
|
||||||
/>
|
|
||||||
</van-col>
|
</van-col>
|
||||||
<van-col span="12" class="title"><span>{{user.nick}}</span></van-col>
|
<van-col span="12" class="title"><span>{{user.nick}}</span></van-col>
|
||||||
<van-col span="6" class="subtitle"
|
<van-col span="6" class="subtitle"
|
||||||
@@ -100,6 +95,7 @@ import { ref } from "vue";
|
|||||||
import { Dialog } from "vant";
|
import { Dialog } from "vant";
|
||||||
import useUserStore from "@/store/modules/user";
|
import useUserStore from "@/store/modules/user";
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
import AppUserIcon from "@/components/AppUserIcon.vue";
|
||||||
const show = ref<boolean>(false);
|
const show = ref<boolean>(false);
|
||||||
let data1: AppGridData = {
|
let data1: AppGridData = {
|
||||||
head: "个人中心",
|
head: "个人中心",
|
||||||
|
|||||||
Reference in New Issue
Block a user