feat: 示例中心、代码生成模块改造
parent
04a94ad941
commit
6fad701f69
2
.env
2
.env
|
|
@ -1,5 +1,5 @@
|
||||||
# 标题
|
# 标题
|
||||||
VITE_APP_TITLE=芋道管理系统
|
VITE_APP_TITLE=国通管理系统
|
||||||
|
|
||||||
# 项目本地运行端口号
|
# 项目本地运行端口号
|
||||||
VITE_PORT=80
|
VITE_PORT=80
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
## 🐯 平台简介
|
## 🐯 平台简介
|
||||||
|
|
||||||
**芋道**,以开发者为中心,打造中国第一流的快速开发平台,全部开源,个人与企业可 100% 免费使用。
|
**国通**,以开发者为中心,打造中国第一流的快速开发平台,全部开源,个人与企业可 100% 免费使用。
|
||||||
|
|
||||||
* 采用 [vue-element-plus-admin](https://gitee.com/kailong110120130/vue-element-plus-admin) 实现
|
* 采用 [vue-element-plus-admin](https://gitee.com/kailong110120130/vue-element-plus-admin) 实现
|
||||||
* 改换 saas,自动引入等功能
|
* 改换 saas,自动引入等功能
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta
|
<meta
|
||||||
name="keywords"
|
name="keywords"
|
||||||
content="芋道管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
|
content="国通管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content="芋道管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
|
content="国通管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
|
||||||
/>
|
/>
|
||||||
<title>%VITE_APP_TITLE%</title>
|
<title>%VITE_APP_TITLE%</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface BrandVO {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
brandSn: string
|
||||||
|
productType: string
|
||||||
|
startState: number
|
||||||
|
brandState: number
|
||||||
|
updator: string
|
||||||
|
remark: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询品牌列表
|
||||||
|
export const getBrandPage = async (params) => {
|
||||||
|
return await request.get({ url: `/demo/brand/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询品牌详情
|
||||||
|
export const getBrand = async (id: number) => {
|
||||||
|
return await request.get({ url: `/demo/brand/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增品牌
|
||||||
|
export const createBrand = async (data: BrandVO) => {
|
||||||
|
return await request.post({ url: `/demo/brand/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改品牌
|
||||||
|
export const updateBrand = async (data: BrandVO) => {
|
||||||
|
return await request.put({ url: `/demo/brand/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除品牌
|
||||||
|
export const deleteBrand = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/demo/brand/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出品牌 Excel
|
||||||
|
export const exportBrand = async (params) => {
|
||||||
|
return await request.download({ url: `/demo/brand/export-excel`, params })
|
||||||
|
}
|
||||||
|
|
@ -40,6 +40,12 @@ export type CodegenColumnVO = {
|
||||||
listOperationCondition: string
|
listOperationCondition: string
|
||||||
listOperationResult: number
|
listOperationResult: number
|
||||||
htmlType: string
|
htmlType: string
|
||||||
|
colLen: number
|
||||||
|
validateType: string
|
||||||
|
validateParams: string
|
||||||
|
crypt: string
|
||||||
|
sensitived: string
|
||||||
|
sensitivedType: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DatabaseTableVO = {
|
export type DatabaseTableVO = {
|
||||||
|
|
@ -119,5 +125,5 @@ export const createCodegenList = (data) => {
|
||||||
|
|
||||||
// 删除代码生成表定义
|
// 删除代码生成表定义
|
||||||
export const deleteCodegenTable = (id: number) => {
|
export const deleteCodegenTable = (id: number) => {
|
||||||
return request.delete({ url: '/infra/codegen/delete?tableId=' + id })
|
return request.delete({ url: '/infra/codegen/delete?tableIds=' + id })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -664,7 +664,7 @@ const previewProcessJson = () => {
|
||||||
previewModelVisible.value = true
|
previewModelVisible.value = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/* ------------------------------------------------ 芋道源码 methods ------------------------------------------------------ */
|
/* ------------------------------------------------ 国通源码 methods ------------------------------------------------------ */
|
||||||
const processSave = async () => {
|
const processSave = async () => {
|
||||||
console.log(bpmnModeler, 'bpmnModelerbpmnModelerbpmnModelerbpmnModeler')
|
console.log(bpmnModeler, 'bpmnModelerbpmnModelerbpmnModelerbpmnModeler')
|
||||||
const { err, xml } = await bpmnModeler.saveXML()
|
const { err, xml } = await bpmnModeler.saveXML()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Created by 芋道源码
|
* Created by 国通源码
|
||||||
*
|
*
|
||||||
* 枚举类
|
* 枚举类
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@
|
||||||
<el-divider content-position="center">萌新必读</el-divider>
|
<el-divider content-position="center">萌新必读</el-divider>
|
||||||
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
<el-col :span="24" style="padding-right: 10px; padding-left: 10px">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div class="w-[100%] flex justify-between">
|
<div class="flex justify-between w-[100%]">
|
||||||
<el-link href="https://doc.iocoder.cn/" target="_blank">📚开发指南</el-link>
|
<el-link href="https://doc.iocoder.cn/" target="_blank">📚开发指南</el-link>
|
||||||
<el-link href="https://doc.iocoder.cn/video/" target="_blank">🔥视频教程</el-link>
|
<el-link href="https://doc.iocoder.cn/video/" target="_blank">🔥视频教程</el-link>
|
||||||
<el-link href="https://www.iocoder.cn/Interview/good-collection/" target="_blank">
|
<el-link href="https://www.iocoder.cn/Interview/good-collection/" target="_blank">
|
||||||
|
|
@ -184,7 +184,7 @@ const loginData = reactive({
|
||||||
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
|
captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
|
||||||
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
|
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
|
||||||
loginForm: {
|
loginForm: {
|
||||||
tenantName: '芋道源码',
|
tenantName: '国通源码',
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: 'admin123',
|
password: 'admin123',
|
||||||
captchaVerification: '',
|
captchaVerification: '',
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ const loginData = reactive({
|
||||||
},
|
},
|
||||||
loginForm: {
|
loginForm: {
|
||||||
uuid: '',
|
uuid: '',
|
||||||
tenantName: '芋道源码',
|
tenantName: '国通源码',
|
||||||
mobileNumber: '',
|
mobileNumber: '',
|
||||||
code: ''
|
code: ''
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,136 @@
|
||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="品牌名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入品牌名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品牌编码" prop="brandSn">
|
||||||
|
<el-input v-model="formData.brandSn" placeholder="请输入品牌编码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="基础产品类型" prop="productType">
|
||||||
|
<el-select v-model="formData.productType" placeholder="请选择基础产品类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="启用类型" prop="startState">
|
||||||
|
<el-select v-model="formData.startState" placeholder="请选择启用类型(0启用 1停用)">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品牌状态" prop="brandState">
|
||||||
|
<el-select v-model="formData.brandState" placeholder="请选择品牌状态(0未锁定 1锁定)">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import * as BrandApi from '@/api/demo/brand'
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
brandSn: undefined,
|
||||||
|
productType: undefined,
|
||||||
|
startState: undefined,
|
||||||
|
brandState: undefined,
|
||||||
|
remark: undefined
|
||||||
|
})
|
||||||
|
const formRules = reactive({})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await BrandApi.getBrand(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
if (!formRef) return
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as BrandApi.BrandVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await BrandApi.createBrand(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await BrandApi.updateBrand(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
brandSn: undefined,
|
||||||
|
productType: undefined,
|
||||||
|
startState: undefined,
|
||||||
|
brandState: undefined,
|
||||||
|
remark: undefined
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,257 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="品牌名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入品牌名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品牌编码" prop="brandSn">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.brandSn"
|
||||||
|
placeholder="请输入品牌编码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="基础产品类型" prop="productType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.productType"
|
||||||
|
placeholder="请选择基础产品类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="启用类型" prop="startState">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.startState"
|
||||||
|
placeholder="请选择启用类型(0启用 1停用)"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="品牌状态" prop="brandState">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.brandState"
|
||||||
|
placeholder="请选择品牌状态(0未锁定 1锁定)"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.createTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button type="primary" @click="openForm('create')" v-hasPermi="['demo:brand:create']">
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['demo:brand:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="序号" type="index" width="70px" />
|
||||||
|
<el-table-column label="主键" align="center" prop="id" width="150px" />
|
||||||
|
<el-table-column label="品牌名称" align="center" prop="name" width="150px" />
|
||||||
|
<el-table-column label="品牌编码" align="center" prop="brandSn" width="150px" />
|
||||||
|
<el-table-column label="基础产品类型" align="center" prop="productType" width="150px">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.SYSTEM_NOTICE_TYPE" :value="scope.row.productType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="启用类型" align="center" prop="startState" width="150px">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.startState" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="品牌状态" align="center" prop="brandState" width="150px">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.brandState" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="150px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" width="150px" />
|
||||||
|
<el-table-column label="操作" align="center" width="150px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['demo:brand:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['demo:brand:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<BrandForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="Brand">
|
||||||
|
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as BrandApi from '@/api/demo/brand'
|
||||||
|
import BrandForm from './BrandForm.vue'
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: null,
|
||||||
|
brandSn: null,
|
||||||
|
productType: null,
|
||||||
|
startState: null,
|
||||||
|
brandState: null,
|
||||||
|
createTime: []
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await BrandApi.getBrandPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await BrandApi.deleteBrand(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await BrandApi.exportBrand(queryParams)
|
||||||
|
download.excel(data, '品牌.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onMounted) {
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<generate-info-form ref="generateInfoRef" :table="formData.table" />
|
<generate-info-form ref="generateInfoRef" :table="formData.table" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-form>
|
<el-form style="text-align: center; position: relative">
|
||||||
<el-form-item style="float: right">
|
<el-form-item style="float: right">
|
||||||
<el-button :loading="formLoading" type="primary" @click="submitForm">保存</el-button>
|
<el-button :loading="formLoading" type="primary" @click="submitForm">保存</el-button>
|
||||||
<el-button @click="close">返回</el-button>
|
<el-button @click="close">返回</el-button>
|
||||||
|
|
@ -51,6 +51,13 @@ const getDetail = async () => {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await CodegenApi.getCodegenTable(id)
|
formData.value = await CodegenApi.getCodegenTable(id)
|
||||||
|
let columns = formData.value.columns
|
||||||
|
// 级联回显处理:字符串转数组
|
||||||
|
columns.forEach((e) => {
|
||||||
|
if (e.validateType && e.validateType.indexOf(',') != -1) {
|
||||||
|
e.validateType = JSON.parse('[' + e.validateType + ']')
|
||||||
|
}
|
||||||
|
})
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
@ -63,6 +70,12 @@ const submitForm = async () => {
|
||||||
await unref(basicInfoRef)?.validate()
|
await unref(basicInfoRef)?.validate()
|
||||||
await unref(generateInfoRef)?.validate()
|
await unref(generateInfoRef)?.validate()
|
||||||
try {
|
try {
|
||||||
|
// 级联字段转字符串
|
||||||
|
formData.value.columns.forEach((e) => {
|
||||||
|
if (e.validateType && e.validateType instanceof Array) {
|
||||||
|
e.validateType = e.validateType.join(',')
|
||||||
|
}
|
||||||
|
})
|
||||||
// 提交请求
|
// 提交请求
|
||||||
await CodegenApi.updateCodegenTable(formData.value)
|
await CodegenApi.updateCodegenTable(formData.value)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(t('common.updateSuccess'))
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,27 @@
|
||||||
<template>
|
<template>
|
||||||
<el-table ref="dragTable" :data="formData" :max-height="tableHeight" row-key="columnId">
|
<el-table
|
||||||
|
ref="dragTable"
|
||||||
|
:data="formData"
|
||||||
|
:max-height="tableHeight"
|
||||||
|
row-key="columnId"
|
||||||
|
style="margin-bottom: 10px"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
type="index"
|
||||||
|
min-width="60px"
|
||||||
|
class-name="allowDrag"
|
||||||
|
align="center"
|
||||||
|
fixed
|
||||||
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
label="字段列名"
|
label="字段列名"
|
||||||
min-width="10%"
|
min-width="150px"
|
||||||
prop="columnName"
|
prop="columnName"
|
||||||
|
fixed
|
||||||
/>
|
/>
|
||||||
<el-table-column label="字段描述" min-width="10%">
|
<el-table-column label="字段描述" min-width="150px" fixed>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input v-model="scope.row.columnComment" />
|
<el-input v-model="scope.row.columnComment" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -14,10 +29,10 @@
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
label="物理类型"
|
label="物理类型"
|
||||||
min-width="10%"
|
min-width="130px"
|
||||||
prop="dataType"
|
prop="dataType"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="Java类型" min-width="11%">
|
<el-table-column label="Java类型" min-width="150px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.javaType">
|
<el-select v-model="scope.row.javaType">
|
||||||
<el-option label="Long" value="Long" />
|
<el-option label="Long" value="Long" />
|
||||||
|
|
@ -30,22 +45,22 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="java属性" min-width="10%">
|
<el-table-column label="java属性" min-width="150px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input v-model="scope.row.javaField" />
|
<el-input v-model="scope.row.javaField" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="插入" min-width="4%">
|
<el-table-column label="插入" min-width="60px" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-checkbox v-model="scope.row.createOperation" false-label="false" true-label="true" />
|
<el-checkbox v-model="scope.row.createOperation" false-label="false" true-label="true" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="编辑" min-width="4%">
|
<el-table-column label="编辑" min-width="60px" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-checkbox v-model="scope.row.updateOperation" false-label="false" true-label="true" />
|
<el-checkbox v-model="scope.row.updateOperation" false-label="false" true-label="true" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="列表" min-width="4%">
|
<el-table-column label="列表" min-width="60px" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-model="scope.row.listOperationResult"
|
v-model="scope.row.listOperationResult"
|
||||||
|
|
@ -54,12 +69,12 @@
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="查询" min-width="4%">
|
<el-table-column label="查询" min-width="60px" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-checkbox v-model="scope.row.listOperation" false-label="false" true-label="true" />
|
<el-checkbox v-model="scope.row.listOperation" false-label="false" true-label="true" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="查询方式" min-width="10%">
|
<el-table-column label="查询方式" min-width="140px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.listOperationCondition">
|
<el-select v-model="scope.row.listOperationCondition">
|
||||||
<el-option label="=" value="=" />
|
<el-option label="=" value="=" />
|
||||||
|
|
@ -73,12 +88,12 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="允许空" min-width="5%">
|
<el-table-column label="允许空" min-width="70px" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-checkbox v-model="scope.row.nullable" false-label="false" true-label="true" />
|
<el-checkbox v-model="scope.row.nullable" false-label="false" true-label="true" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="显示类型" min-width="12%">
|
<el-table-column label="显示类型" min-width="130px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.htmlType">
|
<el-select v-model="scope.row.htmlType">
|
||||||
<el-option label="文本框" value="input" />
|
<el-option label="文本框" value="input" />
|
||||||
|
|
@ -93,9 +108,15 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="字典类型" min-width="12%">
|
<el-table-column label="字典类型" min-width="150px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择">
|
<el-select
|
||||||
|
v-model="scope.row.dictType"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择"
|
||||||
|
:disabled="isDisabled(scope.row.columnName)"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dictOptions"
|
v-for="dict in dictOptions"
|
||||||
:key="dict.id"
|
:key="dict.id"
|
||||||
|
|
@ -105,7 +126,81 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="示例" min-width="10%">
|
<el-table-column label="长度" min-width="90px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input
|
||||||
|
v-model="scope.row.colLen"
|
||||||
|
:disabled="
|
||||||
|
(scope.row.dictType != null && scope.row.dictType != '') ||
|
||||||
|
isDisabled(scope.row.columnName)
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="校验规则" min-width="180px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-cascader
|
||||||
|
v-model="scope.row.validateType"
|
||||||
|
:options="validateTypeOptions"
|
||||||
|
:props="validateTypeProps"
|
||||||
|
:style="{ width: '100%' }"
|
||||||
|
:show-all-levels="false"
|
||||||
|
clearable
|
||||||
|
:disabled="isDisabled(scope.row.columnName)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="校验参数" title="校验参数(多个以逗号间隔)" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.validateParams" :disabled="isDisabled(scope.row.columnName)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否加密" min-width="80px" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-checkbox
|
||||||
|
v-model="scope.row.crypt"
|
||||||
|
false-label="false"
|
||||||
|
true-label="true"
|
||||||
|
:disabled="isDisabled(scope.row.columnName)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否脱敏" min-width="80px" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-checkbox
|
||||||
|
v-model="scope.row.sensitived"
|
||||||
|
false-label="false"
|
||||||
|
true-label="true"
|
||||||
|
:disabled="isDisabled(scope.row.columnName)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="脱敏类型" min-width="150px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-select
|
||||||
|
v-model="scope.row.sensitivedType"
|
||||||
|
:disabled="isDisabled(scope.row.columnName)"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option label="电子邮件" value="1" />
|
||||||
|
<el-option
|
||||||
|
label="银行卡号; 比如:9988002866797031 脱敏之后为 998800********31"
|
||||||
|
value="2"
|
||||||
|
/>
|
||||||
|
<el-option label="车牌号;比如:粤A66666 脱敏之后为粤A6***6" value="3" />
|
||||||
|
<el-option label="中文名;比如:刘子豪脱敏之后为刘**" value="4" />
|
||||||
|
<el-option label="固定电话;比如:01086551122 脱敏之后为 0108*****22" value="5" />
|
||||||
|
<el-option
|
||||||
|
label="身份证号码;比如:530321199204074611 脱敏之后为 530321**********11"
|
||||||
|
value="6"
|
||||||
|
/>
|
||||||
|
<el-option label="手机号;比如:13248765917 脱敏之后为 132****5917" value="7" />
|
||||||
|
<el-option label="密码;比如:123456 脱敏之后为 ******" value="8" />
|
||||||
|
<!-- <el-option label="滑块;例如:prefixKeep = 1; suffixKeep = 2; replacer = '*'; 原始字符串123456 脱敏后 1***56" value="EMAIL" />-->
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="示例" min-width="150px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input v-model="scope.row.example" />
|
<el-input v-model="scope.row.example" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -135,6 +230,166 @@ const getDictOptions = async () => {
|
||||||
dictOptions.value = await DictDataApi.getSimpleDictTypeList()
|
dictOptions.value = await DictDataApi.getSimpleDictTypeList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const validateTypeOptions = [
|
||||||
|
{
|
||||||
|
label: '身份证',
|
||||||
|
value: 1,
|
||||||
|
id: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '邮件',
|
||||||
|
value: 2,
|
||||||
|
id: 102
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '手机',
|
||||||
|
value: 3,
|
||||||
|
id: 103
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '电话',
|
||||||
|
value: 4,
|
||||||
|
id: 104
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '等值',
|
||||||
|
value: 5,
|
||||||
|
id: 105,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
label: '大于等于',
|
||||||
|
value: 1,
|
||||||
|
id: 106
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '小于等于',
|
||||||
|
value: 2,
|
||||||
|
id: 107
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '大于',
|
||||||
|
value: 3,
|
||||||
|
id: 108
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '小于',
|
||||||
|
value: 4,
|
||||||
|
id: 109
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '大于等于小于',
|
||||||
|
value: 5,
|
||||||
|
id: 110
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '大于小于等于',
|
||||||
|
value: 6,
|
||||||
|
id: 111
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '大于小于',
|
||||||
|
value: 7,
|
||||||
|
id: 112
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '大于等于小于等于',
|
||||||
|
value: 8,
|
||||||
|
id: 113
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '数值',
|
||||||
|
value: 6,
|
||||||
|
id: 115,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
label: '位数(整数位,小数位)',
|
||||||
|
value: 1,
|
||||||
|
id: 116
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '正数',
|
||||||
|
value: 2,
|
||||||
|
id: 117
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '非负数',
|
||||||
|
value: 3,
|
||||||
|
id: 118
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '负数',
|
||||||
|
value: 4,
|
||||||
|
id: 119
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '非正数',
|
||||||
|
value: 5,
|
||||||
|
id: 120
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '日期',
|
||||||
|
value: 7,
|
||||||
|
id: 121,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
label: '过去的日期',
|
||||||
|
value: 1,
|
||||||
|
id: 122
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '过去或现在的日期',
|
||||||
|
value: 2,
|
||||||
|
id: 123
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '未来的日期',
|
||||||
|
value: 3,
|
||||||
|
id: 124
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '现在或未来的日期',
|
||||||
|
value: 4,
|
||||||
|
id: 125
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '正则',
|
||||||
|
value: 8,
|
||||||
|
id: 114
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'URL',
|
||||||
|
value: 9,
|
||||||
|
id: 126
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '函数',
|
||||||
|
value: 10,
|
||||||
|
id: 127
|
||||||
|
}
|
||||||
|
]
|
||||||
|
const validateTypeProps = {
|
||||||
|
multiple: false
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 关闭按钮 */
|
||||||
|
const isDisabled = (columnName) => {
|
||||||
|
return (
|
||||||
|
columnName == 'id' ||
|
||||||
|
columnName == 'deleted' ||
|
||||||
|
columnName == 'create_time' ||
|
||||||
|
columnName == 'creator' ||
|
||||||
|
columnName == 'update_time' ||
|
||||||
|
columnName == 'updater' ||
|
||||||
|
columnName == 'tenant_id'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.columns,
|
() => props.columns,
|
||||||
(columns) => {
|
(columns) => {
|
||||||
|
|
|
||||||
|
|
@ -49,17 +49,52 @@
|
||||||
<Icon class="mr-5px" icon="ep:refresh" />
|
<Icon class="mr-5px" icon="ep:refresh" />
|
||||||
重置
|
重置
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-hasPermi="['infra:codegen:create']" type="primary" @click="openImportTable()">
|
<el-button
|
||||||
<Icon class="mr-5px" icon="ep:zoom-in" />
|
v-hasPermi="['infra:codegen:download']"
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
@click="handleGenTable()"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" />
|
||||||
|
生成
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['infra:codegen:create']"
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openImportTable()"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:zoom-in" />
|
||||||
导入
|
导入
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['infra:codegen:update']"
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleUpdate()"
|
||||||
|
:disabled="single"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:edit" />
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['infra:codegen:delete']"
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
@click="handleDelete()"
|
||||||
|
:disabled="multiple"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:delete" />
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column align="center" label="数据源">
|
<el-table-column align="center" label="数据源">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{
|
{{
|
||||||
|
|
@ -163,6 +198,11 @@ const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const { push } = useRouter() // 路由跳转
|
const { push } = useRouter() // 路由跳转
|
||||||
|
|
||||||
|
let ids = ref([]) // 选中数组
|
||||||
|
let tableNames = ref([]) // 选中表数组
|
||||||
|
let single = ref(true) // 非单个禁用
|
||||||
|
let multiple = ref(true) // 非多个禁用
|
||||||
|
|
||||||
const loading = ref(true) // 列表的加载中
|
const loading = ref(true) // 列表的加载中
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
const list = ref([]) // 列表的数据
|
const list = ref([]) // 列表的数据
|
||||||
|
|
@ -208,7 +248,8 @@ const openImportTable = () => {
|
||||||
|
|
||||||
/** 编辑操作 */
|
/** 编辑操作 */
|
||||||
const handleUpdate = (id: number) => {
|
const handleUpdate = (id: number) => {
|
||||||
push('/codegen/edit?id=' + id)
|
const tableId = id || ids[0]
|
||||||
|
push('/codegen/edit?id=' + tableId)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 预览操作 */
|
/** 预览操作 */
|
||||||
|
|
@ -220,10 +261,12 @@ const handlePreview = (row: CodegenApi.CodegenTableVO) => {
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (id: number) => {
|
const handleDelete = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
|
const tableId = id || ids
|
||||||
|
console.log(tableId)
|
||||||
// 删除的二次确认
|
// 删除的二次确认
|
||||||
await message.delConfirm()
|
await message.delConfirm()
|
||||||
// 发起删除
|
// 发起删除
|
||||||
await CodegenApi.deleteCodegenTable(id)
|
await CodegenApi.deleteCodegenTable(tableId)
|
||||||
message.success(t('common.delSuccess'))
|
message.success(t('common.delSuccess'))
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
|
|
@ -247,6 +290,16 @@ const handleGenTable = async (row: CodegenApi.CodegenTableVO) => {
|
||||||
download.zip(res, 'codegen-' + row.className + '.zip')
|
download.zip(res, 'codegen-' + row.className + '.zip')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 多选框选中数据
|
||||||
|
const handleSelectionChange = (selection) => {
|
||||||
|
ids = selection.map((item) => {
|
||||||
|
return item.id
|
||||||
|
})
|
||||||
|
tableNames = selection.map((item) => item.tableName)
|
||||||
|
single.value = selection.length != 1
|
||||||
|
multiple.value = !selection.length
|
||||||
|
}
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getList()
|
await getList()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<!--
|
<!--
|
||||||
- Copyright (C) 2018-2019
|
- Copyright (C) 2018-2019
|
||||||
- All rights reserved, Designed By www.joolun.com
|
- All rights reserved, Designed By www.joolun.com
|
||||||
芋道源码:
|
国通源码:
|
||||||
① 移除 avue 组件,使用 ElementUI 原生组件
|
① 移除 avue 组件,使用 ElementUI 原生组件
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<!--
|
<!--
|
||||||
- Copyright (C) 2018-2019
|
- Copyright (C) 2018-2019
|
||||||
- All rights reserved, Designed By www.joolun.com
|
- All rights reserved, Designed By www.joolun.com
|
||||||
芋道源码:
|
国通源码:
|
||||||
① 移除暂时用不到的 websocket
|
① 移除暂时用不到的 websocket
|
||||||
② 代码优化,补充注释,提升阅读性
|
② 代码优化,补充注释,提升阅读性
|
||||||
-->
|
-->
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
- Copyright (C) 2018-2019
|
- Copyright (C) 2018-2019
|
||||||
- All rights reserved, Designed By www.joolun.com
|
- All rights reserved, Designed By www.joolun.com
|
||||||
【微信消息 - 图文】
|
【微信消息 - 图文】
|
||||||
芋道源码:
|
国通源码:
|
||||||
① 代码优化,补充注释,提升阅读性
|
① 代码优化,补充注释,提升阅读性
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<!--
|
<!--
|
||||||
- Copyright (C) 2018-2019
|
- Copyright (C) 2018-2019
|
||||||
- All rights reserved, Designed By www.joolun.com
|
- All rights reserved, Designed By www.joolun.com
|
||||||
芋道源码:
|
国通源码:
|
||||||
① 移除多余的 rep 为前缀的变量,让 message 消息更简单
|
① 移除多余的 rep 为前缀的变量,让 message 消息更简单
|
||||||
② 代码优化,补充注释,提升阅读性
|
② 代码优化,补充注释,提升阅读性
|
||||||
③ 优化消息的临时缓存策略,发送消息时,只清理被发送消息的 tab,不会强制切回到 text 输入
|
③ 优化消息的临时缓存策略,发送消息时,只清理被发送消息的 tab,不会强制切回到 text 输入
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
- Copyright (C) 2018-2019
|
- Copyright (C) 2018-2019
|
||||||
- All rights reserved, Designed By www.joolun.com
|
- All rights reserved, Designed By www.joolun.com
|
||||||
【微信消息 - 视频】
|
【微信消息 - 视频】
|
||||||
芋道源码:
|
国通源码:
|
||||||
① bug 修复:
|
① bug 修复:
|
||||||
1)joolun 的做法:使用 mediaId 从微信公众号,下载对应的 mp4 素材,从而播放内容;
|
1)joolun 的做法:使用 mediaId 从微信公众号,下载对应的 mp4 素材,从而播放内容;
|
||||||
存在的问题:mediaId 有效期是 3 天,超过时间后无法播放
|
存在的问题:mediaId 有效期是 3 天,超过时间后无法播放
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
- Copyright (C) 2018-2019
|
- Copyright (C) 2018-2019
|
||||||
- All rights reserved, Designed By www.joolun.com
|
- All rights reserved, Designed By www.joolun.com
|
||||||
【微信消息 - 语音】
|
【微信消息 - 语音】
|
||||||
芋道源码:
|
国通源码:
|
||||||
① bug 修复:
|
① bug 修复:
|
||||||
1)joolun 的做法:使用 mediaId 从微信公众号,下载对应的 mp4 素材,从而播放内容;
|
1)joolun 的做法:使用 mediaId 从微信公众号,下载对应的 mp4 素材,从而播放内容;
|
||||||
存在的问题:mediaId 有效期是 3 天,超过时间后无法播放
|
存在的问题:mediaId 有效期是 3 天,超过时间后无法播放
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ const emit = defineEmits<{
|
||||||
column-count: 5;
|
column-count: 5;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
|
||||||
/* 芋道源码:增加 10px,避免顶着上面 */
|
/* 国通源码:增加 10px,避免顶着上面 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.waterfall-item {
|
.waterfall-item {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue