feat: 前后端联调代码生成接口
This commit is contained in:
@@ -2,14 +2,14 @@ import request from '@/utils/request'
|
||||
// code to web
|
||||
export function codeToWeb() {
|
||||
return request({
|
||||
url: 'web-first/code-build-web',
|
||||
url: 'code-gun/code-build-web',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
// code to web
|
||||
export function webToCode(ids) {
|
||||
return request({
|
||||
url: 'web-first/web-build-code',
|
||||
url: 'code-gun/web-build-code',
|
||||
method: 'post',
|
||||
data:ids
|
||||
})
|
||||
@@ -18,7 +18,7 @@ export function webToCode(ids) {
|
||||
// open zhe path
|
||||
export function openPath(path) {
|
||||
return request({
|
||||
url: `web-first/dir/${encodeURIComponent(path)}`,
|
||||
url: `code-gun/dir/${encodeURIComponent(path)}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -50,5 +50,6 @@ export function delData(ids) {
|
||||
return request({
|
||||
url: `/field/${ids}`,
|
||||
method: 'delete',
|
||||
params:{id:ids}
|
||||
})
|
||||
}
|
||||
@@ -224,7 +224,7 @@ import {
|
||||
updateData,
|
||||
delData,
|
||||
getType
|
||||
} from "@/api/webfirst/fieldApi";
|
||||
} from "@/api/code/fieldApi";
|
||||
import { computed, onMounted, defineProps, ref } from "vue";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
@@ -267,7 +267,8 @@ const data = reactive({
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const getFieldTypeEnum=(field)=>{
|
||||
return fieldList.value.filter(x=>x.value==field)[0].lable;
|
||||
return field;
|
||||
// return fieldList.value.filter(x=>x.value==field)[0]?.lable??'未知';
|
||||
}
|
||||
|
||||
watch(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {listData} from "@/api/webfirst/tableApi.js"
|
||||
import {listData} from "@/api/code/tableApi.js"
|
||||
|
||||
const useTable=()=>{
|
||||
const dataList=ref([]);
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['webfirst:table:add']"
|
||||
v-hasPermi="['codeGun:table:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -72,7 +72,7 @@
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['webfirst:table:edit']"
|
||||
v-hasPermi="['codeGun:table:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -83,7 +83,7 @@
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['webfirst:table:remove']"
|
||||
v-hasPermi="['codeGun:table:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -93,7 +93,7 @@
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['webfirst:table:export']"
|
||||
v-hasPermi="['codeGun:table:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -104,7 +104,7 @@
|
||||
plain
|
||||
icon="Switch"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['webfirst:table:export']"
|
||||
v-hasPermi="['codeGun:table:export']"
|
||||
>同步数据库WebToDb</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
@@ -115,7 +115,7 @@
|
||||
icon="Switch"
|
||||
@click="handleWebToCode"
|
||||
:disabled="ids.length==0"
|
||||
v-hasPermi="['webfirst:table:export']"
|
||||
v-hasPermi="['codeGun:table:export']"
|
||||
>代码生成WebToCode</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -126,7 +126,7 @@
|
||||
plain
|
||||
icon="Switch"
|
||||
@click="handleCodeToWeb"
|
||||
v-hasPermi="['webfirst:table:export']"
|
||||
v-hasPermi="['codeGun:table:export']"
|
||||
>实体同步CodeToWeb</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -242,8 +242,8 @@ import {
|
||||
delData,
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/webfirst/tableApi";
|
||||
import { codeToWeb,webToCode } from "@/api/webfirst/webfirstApi";
|
||||
} from "@/api/code/tableApi";
|
||||
import { codeToWeb,webToCode } from "@/api/code/codeGunApi";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['webfirst:template:add']"
|
||||
v-hasPermi="['codeGun:template:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -57,7 +57,7 @@
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['webfirst:template:edit']"
|
||||
v-hasPermi="['codeGun:template:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -68,7 +68,7 @@
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['webfirst:template:remove']"
|
||||
v-hasPermi="['codeGun:template:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -78,7 +78,7 @@
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['webfirst:template:export']"
|
||||
v-hasPermi="['codeGun:template:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -145,14 +145,14 @@
|
||||
type="text"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['webfirst:template:edit']"
|
||||
v-hasPermi="['codeGun:template:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['webfirst:template:remove']"
|
||||
v-hasPermi="['codeGun:template:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
@@ -231,8 +231,8 @@ import {
|
||||
delData,
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/webfirst/templateApi";
|
||||
import {openPath} from "@/api/webfirst/webfirstApi";
|
||||
} from "@/api/code/templateApi";
|
||||
import {openPath} from "@/api/code/codeGunApi";
|
||||
import { ref } from "@vue/reactivity";
|
||||
import ReplaceText from './components/ReplaceText'
|
||||
import TempalteTip from './components/TempalteTip.vue'
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<h4>后端技术</h4>
|
||||
<ul>
|
||||
<li>.Net6</li>
|
||||
<li>WebFirst</li>
|
||||
<li>CodeFirst</li>
|
||||
<li>JWT</li>
|
||||
<li>Sqlsugar</li>
|
||||
<li>Redis</li>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
该文件为通用Crud模板文件,按照规范只需要 替换以下变量即可,
|
||||
租户 : 实体中文名称
|
||||
system:tenant :crud权限编码
|
||||
system/tenant : api文件路径,例如:webfirst/tableApi
|
||||
system/tenant : api文件路径,例如:codeGun/tableApi
|
||||
</div> -->
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="租户名称" prop="name">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
该文件为通用Crud模板文件,按照规范只需要 替换以下变量即可,
|
||||
@Name@ : 实体中文名称
|
||||
@per:per@ :crud权限编码
|
||||
@api@ : api文件路径,例如:webfirst/tableApi
|
||||
@api@ : api文件路径,code/tableApi
|
||||
</div> -->
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="@Name@名称" prop="name">
|
||||
|
||||
Reference in New Issue
Block a user