Commit df7991a6 authored by liaozan's avatar liaozan 🏀

Change groupId component from input to select to limit the groupId

parent 6f93b455
......@@ -6,16 +6,16 @@
"build": "vite build --mode production"
},
"dependencies": {
"vue": "^3.2.44",
"axios": "^1.1.3",
"vue": "^3.2.45",
"axios": "^1.2.0",
"ant-design-vue": "^3.2.15",
"highlight.js": "^11.6.0",
"@highlightjs/vue-plugin": "^2.1.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^3.2.0",
"typescript": "^4.8.4",
"vite": "^3.2.3",
"typescript": "^4.9.3",
"vite": "^3.2.4",
"vue-tsc": "^1.0.9"
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
<h3 style="margin-bottom: 20px">项目初始代码生成</h3>
<a-form ref="downloadForm" :labelCol="{span: 6}" :model="formState" :rules="formRules" :wrapperCol="{span: 18}" autocomplete="off" class="form-wrapper">
<a-form-item has-feedback label="GroupId" name="groupId">
<a-input v-model:value="formState.groupId"/>
<a-select v-model:value="formState.groupId" :options="groupOptions"/>
</a-form-item>
<a-form-item has-feedback label="ArtifactId" name="artifactId">
<a-input v-model:value="formState.artifactId"/>
......@@ -49,6 +49,7 @@
<script lang="ts" setup>
import {computed, reactive, ref} from 'vue'
import {SelectProps} from 'ant-design-vue/es/select';
import type {TreeProps} from 'ant-design-vue';
import {FormInstance, message} from "ant-design-vue";
import request, {isLoading} from "../utils/request";
......@@ -91,6 +92,22 @@ const fileExtension = ref<string | null>()
const loading = computed(() => isLoading.value)
const downloadForm = ref<FormInstance>();
const groupOptions = ref<SelectProps['options']>([
{
"value": "com.schbrain.dg",
"label": "com.schbrain.dg"
},
{
"value": "com.schbrain.kp",
"label": "com.schbrain.kp"
},
{
"value": "com.schbrain.xb",
"label": "com.schbrain.xb"
},
])
const formState = reactive<FormState>({
groupId: '',
artifactId: '',
......@@ -148,7 +165,7 @@ const onPreview = async () => {
const onDownload = async (id: number) => {
let res = await request.get(`/archetype/download/${id}`, {responseType: 'blob'})
const {headers, data} = res
const fileName = headers['content-disposition'].replace(/\w+;\sfilename="(.*)"/, '$1')
const fileName = headers?.['content-disposition']?.replace(/\w+;\sfilename="(.*)"/, '$1') || ''
downloadGeneratedProject(data, fileName)
}
......@@ -230,6 +247,7 @@ const createGroupTreeData = (groupNodeList: GroupNode[]): any => {
}
</script>
<!--suppress CssUnusedSymbol -->
<style scoped>
.start-wrapper {
width: 500px;
......@@ -250,8 +268,15 @@ const createGroupTreeData = (groupNodeList: GroupNode[]): any => {
margin-left: 10px;
}
/*noinspection CssUnusedSymbol*/
.ant-input, .ant-btn {
border-radius: 6px;
}
:deep(.ant-select:not(.ant-select-customize-input) .ant-select-selector) {
border-radius: 6px;
}
.ant-select {
text-align: left;
}
</style>
\ No newline at end of file
......@@ -5,7 +5,6 @@ import {ref} from 'vue'
export const isLoading = ref(false)
// @ts-ignore
axios.defaults.baseURL = import.meta.env.VITE_APP_BASE_URL
axios.interceptors.request.use((config: AxiosRequestConfig) => {
isLoading.value = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment