Files
Yi.Admin/Yi.Bbs.Vue3/src/views/start/Index.vue

255 lines
7.1 KiB
Vue
Raw Normal View History

2024-06-05 23:23:33 +08:00
<script setup>
2024-06-08 00:13:29 +08:00
import { computed, onMounted, onUnmounted, reactive, ref } from "vue";
2024-06-05 23:23:33 +08:00
import CodeBox from "./components/CodeBox.vue"
import LableInput from "./components/LableInput.vue"
2024-06-08 00:13:29 +08:00
import SlectBox from "./components/SlectBox.vue"
import LableCheck from "./components/LableCheck.vue"
2024-06-09 00:39:57 +08:00
import {GetResult} from '@/apis/nugetApi'
2024-06-08 00:13:29 +08:00
const isFixed = ref(false);
2024-06-05 23:23:33 +08:00
const form = reactive({
2024-06-08 00:13:29 +08:00
name: "Acme.BookStore",
isCsf: true,
2024-06-08 21:51:45 +08:00
dbType: 'sqlite',
type:"module"
2024-06-05 23:23:33 +08:00
});
2024-06-08 00:13:29 +08:00
const installText = "> dotnet tool install -g Yi.Abp.Tool";
2024-06-08 21:51:45 +08:00
const cloneText = "> yi-abp clone ";
2024-11-08 13:41:03 +08:00
const listText="> yi-abp new list ";
const helpText="> yi-abp -h ";
2024-06-09 00:46:42 +08:00
const nugetData=reactive({
versions:"0.0.0",
downloadNumber:0
2024-06-09 00:39:57 +08:00
2024-06-09 00:46:42 +08:00
});
2024-06-09 00:39:57 +08:00
2024-06-08 00:13:29 +08:00
const onDbTypeSelected = (data) => {
form.dbType = data.value;
2024-06-08 21:51:45 +08:00
}
const onProjectSelected=(data)=>{
2024-06-08 00:13:29 +08:00
}
const dbData = [
{ name: 'Sqlite', key: 'sqlite', value: 'sqlite' },
{ name: 'Mysql', key: 'mysql', value: 'mysql' },
{ name: 'SqlServer', key: 'sqlserver', value: 'sqlserver' },
{ name: 'Oracle', key: 'oracle', value: 'oracle' },
{ name: 'PostgreSql', key: 'postgresql', value: 'postgresql' },
];
const typeData = [{ name: '模块', key: 'module', value: 'module' },
2024-11-08 13:41:03 +08:00
{ name: '模块', key: 'module', value: 'module' },
{ name: '模块', key: 'module', value: 'module' },
{ name: '模块', key: 'module', value: 'module' }]
2024-06-08 21:51:45 +08:00
const addModuleComputed=computed(()=>{
return `> yi-abp add-module ${form.name}`;
2024-06-08 21:51:45 +08:00
})
2024-06-08 00:13:29 +08:00
const commandComputed=computed(()=>{
2024-06-08 21:51:45 +08:00
let dbType=form.dbType;
if(dbType=="sqlite")
{
dbType=""
}
return `> yi-abp new ${form.name} -t module ${dbType!=''?'-dbms '+form.dbType:''} ${form.isCsf==true?'-csf':''}`
2024-06-08 00:13:29 +08:00
});
2024-06-09 00:39:57 +08:00
onMounted(async() => {
const {data}= await GetResult();
2024-06-09 00:46:42 +08:00
nugetData.downloadNumber=data.downloadNumber;
nugetData.versions=data.versions[0];
2024-07-21 13:37:56 +08:00
//console.log(data,"data");
2024-06-08 00:13:29 +08:00
// 监听页面滚动事件
window.addEventListener("scroll", scrolling, true);
})
const scrolling = () => {
// 滚动条距文档顶部的距离
let scrollTop = document.getElementById('main-box').scrollTop;
// 滚动条滚动的距离
let commandBoxTop = document.getElementById('command').offsetTop;
var width = document.getElementById('command').getBoundingClientRect().width;
document.getElementById('command').style.width = width + 'px';
if (scrollTop > commandBoxTop) {
isFixed.value = true;
}
else {
isFixed.value = false;
}
}
2024-06-05 23:23:33 +08:00
2024-06-08 00:13:29 +08:00
onUnmounted(() => {
window.removeEventListener("scroll", scrolling, true);
})
2024-06-05 23:23:33 +08:00
</script>
2024-06-03 22:21:02 +08:00
<template>
<div class="start-body">
<div class="content">
2024-06-09 00:29:53 +08:00
<div class="content-title"><span>开始</span>
2024-06-09 00:46:42 +08:00
<div class="version">Yi.Abp.Tool工具集最新版本号 {{ nugetData.versions }}当前总下载次数 {{nugetData.downloadNumber}}</div>
2024-06-09 00:29:53 +08:00
</div>
2024-06-03 22:21:02 +08:00
<div class="content-body">
<div class="content-body-left">
<h4>安装 Yi.Abp.Tool</h4>
2024-06-05 23:23:33 +08:00
<p>如果之前未安装 Yi.Abp.Tool请在命令行终端中安装</p>
2024-06-08 00:13:29 +08:00
<CodeBox v-model="installText" />
<h4>克隆源代码yi框架非打包便于大家调试二开</h4>
2024-06-08 21:51:45 +08:00
<p>需安装git及Yi.Abp.Tool执行命令</p>
2024-06-08 00:13:29 +08:00
<CodeBox v-model="cloneText" />
<h4>创建你的模块</h4>
<p>在module文件夹内命令行终端运行以下命令</p>
<CodeBox id="command" :class="{ command: isFixed }" v-model="commandComputed" />
2024-06-05 23:23:33 +08:00
2024-06-08 21:51:45 +08:00
<h4>将你创建的模块添加到当前解决方案中</h4>
<p>在module文件夹内命令行终端运行以下命令</p>
<CodeBox v-model="addModuleComputed" />
2024-06-09 00:29:53 +08:00
<p>模块创建后可选择任意host主机进行模块依赖即可</p>
2024-06-08 21:51:45 +08:00
2024-06-05 23:23:33 +08:00
<h4>配置</h4>
<p>您可以更改下面的解决方案配置</p>
2024-06-08 00:13:29 +08:00
2024-06-05 23:23:33 +08:00
<h5>为项目命名</h5>
<LableInput v-model="form.name" />
<p>您可以使用不同级别的命名空间例如BookStoreAcme.BookStore Acme.Retail.BookStore</p>
2024-06-08 00:13:29 +08:00
<h5>选择创建类型</h5>
2024-06-08 21:51:45 +08:00
<SlectBox :data="typeData" width="25%" @onSelected="onProjectSelected" />
2024-06-08 00:13:29 +08:00
<h5>选择数据库管理系统</h5>
<SlectBox :data="dbData" width="20%" @onSelected="onDbTypeSelected" />
<LableCheck v-model="form.isCsf" title="创建解决方案文件夹" text="指定项目是放在输出文件夹中的新文件夹中,还是直接放在输出文件夹中。" />
2024-11-08 13:56:43 +08:00
<p>默认勾选</p>
2024-11-08 13:41:03 +08:00
<h4>模板库</h4>
<p>现在已经支持公开模板库地址https://gitee.com/ccnetcore/yi-template</p>
<p>每个分支代表一个模板你可以通过提交pr或联系管理员上传你自定义的模板</p>
<CodeBox v-model="listText" />
<p>通过以上命令可查询当前可用模板</p>
<h4>帮助</h4>
<p>更详细的实时帮助可执行帮助命令</p>
<CodeBox v-model="helpText" />
<p>如还有疑惑或错误可在社区对应板块发布问题</p>
2024-06-03 22:21:02 +08:00
</div>
2024-06-05 23:23:33 +08:00
<div class="content-body-right">
2024-06-03 22:21:02 +08:00
2024-06-05 23:23:33 +08:00
</div>
2024-06-03 22:21:02 +08:00
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
2024-06-08 00:13:29 +08:00
.command {
position: fixed !important;
z-index: 99;
top: 100px;
2024-06-08 21:51:45 +08:00
width: 1000px;
2024-06-08 00:13:29 +08:00
}
2024-06-03 22:21:02 +08:00
.start-body {
height: 100%;
width: 100%;
background-color: #FCFCFC;
2024-06-08 00:13:29 +08:00
2024-06-03 22:21:02 +08:00
}
.content {
width: 80%;
2024-06-08 00:13:29 +08:00
margin: 0 auto 50px auto;
2024-06-03 22:21:02 +08:00
&-title {
background-color: #FCFCFC;
height: 100px;
display: flex;
align-items: center;
2024-06-09 00:29:53 +08:00
.version{
height: 100%;
display: flex;
align-items: flex-end;
padding: 30px 10px;
color: darkgrey;
}
2024-06-03 22:21:02 +08:00
span {
color: #292d33;
font-size: 48px;
font-weight: 700;
}
}
&-body {
2024-11-08 13:56:43 +08:00
height: 1800px;
2024-06-03 22:21:02 +08:00
padding: 48px;
background-color: #fff;
border-radius: 12px;
border: 0;
box-shadow: 0 0 1rem rgba(0, 0, 0, .08);
display: flex;
2024-06-05 23:23:33 +08:00
&-left {
width: 100%;
2024-06-03 22:21:02 +08:00
}
2024-06-05 23:23:33 +08:00
&-right {
width: 0%;
background-color: #409EFF;
}
p {
margin-top: 0;
margin-bottom: 1rem;
font-family: "Poppins";
font-size: 14px;
font-weight: 300;
2024-06-08 00:13:29 +08:00
color: rgba(11, 22, 33, .6) !important;
2024-06-03 22:21:02 +08:00
}
2024-06-08 00:13:29 +08:00
2024-06-03 22:21:02 +08:00
h4 {
font-size: 20px;
font-weight: 500;
2024-06-05 23:23:33 +08:00
color: #409EFF;
2024-06-03 22:21:02 +08:00
margin-bottom: .25rem;
margin-top: 0;
2024-06-05 23:23:33 +08:00
}
2024-06-08 00:13:29 +08:00
2024-06-05 23:23:33 +08:00
h5 {
color: #292d33;
font-size: 16px !important;
font-weight: 500 !important;
2024-06-08 00:13:29 +08:00
margin: 20px 0 10px 0;
2024-06-03 22:21:02 +08:00
}
}
}
</style>