|
@@ -0,0 +1,125 @@
|
|
|
|
|
+<route lang="yaml">
|
|
|
|
|
+meta:
|
|
|
|
|
+ enabled: false
|
|
|
|
|
+</route>
|
|
|
|
|
+
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import type { FormInstance, FormRules } from 'element-plus'
|
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
+import { createApp } from '@/api/apps/appApi'
|
|
|
|
|
+
|
|
|
|
|
+const formRef = ref<FormInstance>()
|
|
|
|
|
+const formRules = ref<FormRules>({
|
|
|
|
|
+ appTitle: [{ required: true, message: '请输入appTitle', trigger: 'blur' }],
|
|
|
|
|
+ appCatTitle: [{ required: true, message: '请输入appCatTitle', trigger: 'blur' }],
|
|
|
|
|
+ appUrl: [{ required: true, message: '请输入appUrl', trigger: 'blur' }],
|
|
|
|
|
+ appCode: [{ required: true, message: '请输入app编码', trigger: 'blur' }],
|
|
|
|
|
+ appDesc: [{ required: true, message: '请输入描述', trigger: 'blur' }],
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const state = reactive({
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ dialogVisible: false,
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ appId: 0,
|
|
|
|
|
+ appCode: '',
|
|
|
|
|
+ appTitle: '',
|
|
|
|
|
+ appCatTitle: '',
|
|
|
|
|
+ appCatId: 0,
|
|
|
|
|
+ appParam: '',
|
|
|
|
|
+ appUrl: '',
|
|
|
|
|
+ appDesc: '',
|
|
|
|
|
+ appLogo: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ actionType: 1,
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+onMounted(() => {})
|
|
|
|
|
+
|
|
|
|
|
+function onCancel() {
|
|
|
|
|
+ resetFormData()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function resetFormData() {
|
|
|
|
|
+ state.formData = {
|
|
|
|
|
+ appId: 0,
|
|
|
|
|
+ appCode: '',
|
|
|
|
|
+ appTitle: '',
|
|
|
|
|
+ appCatTitle: '',
|
|
|
|
|
+ appCatId: 0,
|
|
|
|
|
+ appUrl: '',
|
|
|
|
|
+ appParam: '',
|
|
|
|
|
+ appDesc: '',
|
|
|
|
|
+ appLogo: '',
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function onSubmit() {
|
|
|
|
|
+ formRef.value && formRef.value.validate(async (valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ if (state.actionType === 1) {
|
|
|
|
|
+ await createApp(state.formData)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ElMessage.success({
|
|
|
|
|
+ message: '保存成功',
|
|
|
|
|
+ center: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <page-header title="应用发布" content="上线发布应用软件或应用服务" />
|
|
|
|
|
+ <page-main>
|
|
|
|
|
+ <el-row type="flex" justify="center">
|
|
|
|
|
+ <el-col :md="12" :sm="18">
|
|
|
|
|
+ <el-form ref="formRef" :model="state.formData" :rules="formRules" label-width="120px" label-suffix=":">
|
|
|
|
|
+ <el-form-item label="标题" prop="appTitle">
|
|
|
|
|
+ <el-input v-model="state.formData.appTitle" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="分类" prop="appCatTitle">
|
|
|
|
|
+ <app-cat-selector v-model="state.formData.appCatId" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="编码" prop="appCode">
|
|
|
|
|
+ <el-input v-model="state.formData.appCode" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="地址" prop="appUrl">
|
|
|
|
|
+ <el-input v-model="state.formData.appUrl" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="LOGO">
|
|
|
|
|
+ <el-image
|
|
|
|
|
+ style="width: 50px; height: 50px;border-radius:50%;"
|
|
|
|
|
+ :src="state.formData.appLogo"
|
|
|
|
|
+ :preview-src-list="[state.formData.appLogo]"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="参数" prop="appParam">
|
|
|
|
|
+ <el-input v-model="state.formData.appParam" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="描述">
|
|
|
|
|
+ <el-input v-model="state.formData.appDesc" type="textarea" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" @click="onSubmit">
|
|
|
|
|
+ 立即发布
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button size="large" @click="onCancel">
|
|
|
|
|
+ 重新填写
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </page-main>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|