Merge remote-tracking branch 'origin/lei_dev' into mp

This commit is contained in:
aeizzz 2023-02-24 10:39:01 +08:00
commit 374ba6795f
13 changed files with 67 additions and 46 deletions

View File

@ -138,8 +138,10 @@ export function useTable(options?: BasicTableProps) {
query();
}
const getDataList = () => {
state.pagination!.current = 1
const getDataList = (refresh: boolean = true) => {
if(refresh){
state.pagination!.current = 1
}
query()
}

View File

@ -2,7 +2,7 @@
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('client.clientId')" prop="clientId">
<el-input :placeholder="$t('client.clientId')" v-model="state.queryForm.clientId" style="max-width: 180px" />
</el-form-item>

View File

@ -7,8 +7,7 @@
<el-form-item :label="$t('sysdept.parentId')" prop="parentId">
<el-tree-select v-model="dataForm.parentId" :data="parentData"
:props="{ value: 'id', label: 'name', children: 'children' }" class="w100" clearable check-strictly
default-expand-all
:placeholder="$t('sysdept.inputparentIdTip')"/>
:render-after-expand="false" :placeholder="$t('sysdept.inputparentIdTip')"/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">

View File

@ -2,21 +2,27 @@
<div class="layout-padding">
<el-card shadow="hover" class="layout-padding-auto">
<div class="mb15">
<el-input :placeholder="$t('sysdept.inputdeptNameTip')" style="max-width: 180px"
v-model="state.queryForm.deptName"> </el-input>
<el-button icon="search" type="primary" class="ml10" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="deptDialogRef.openDialog('add');"
v-auth="'sys_dept_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button icon="upload-filled" type="primary" class="ml10" @click="excelUploadRef.show()">
{{ $t('common.importBtn') }}
</el-button>
<el-button icon="Download" type="primary" class="ml10" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item prop="deptName">
<el-input :placeholder="$t('sysdept.inputdeptNameTip')" style="max-width: 180px"
v-model="state.queryForm.deptName"> </el-input>
</el-form-item>
<el-form-item class="ml2">
<el-button icon="search" type="primary" class="ml10" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="deptDialogRef.openDialog('add');"
v-auth="'sys_dept_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button icon="upload-filled" type="primary" class="ml10" @click="excelUploadRef.show()">
{{ $t('common.importBtn') }}
</el-button>
<el-button icon="Download" type="primary" class="ml10" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%" row-key="id"
default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">

View File

@ -2,7 +2,7 @@
<div class="layout-padding">
<el-card shadow="hover" class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysdict.dictType')" prop="dictType">
<el-input :placeholder="$t('sysdict.inputDictTypeTip')" v-model="state.queryForm.dictType" style="max-width: 180px" />
</el-form-item>

View File

@ -2,7 +2,7 @@
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('file.fileName')" prop="original">
<el-input v-model="state.queryForm.original" :placeholder="$t('file.inputoriginalTip')" clearable
style="width: 240px" @keyup.enter="getDataList" />

View File

@ -16,7 +16,7 @@
:end-placeholder="$t('syslog.inputEndPlaceholderTip')"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="getDataList">{{ $t('common.queryBtn') }}</el-button>
<el-button type="primary" icon="Search" @click="getDataList(true)">{{ $t('common.queryBtn') }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>

View File

@ -13,7 +13,7 @@
</el-col>
<el-col :span="12" class="mb20">
<el-form-item :label="$t('sysmenu.parentId')" prop="parentId">
<el-tree-select v-model="state.ruleForm.parentId" :data="state.parentData" default-expand-all
<el-tree-select v-model="state.ruleForm.parentId" :data="state.parentData" :render-after-expand="false"
:props="{ value: 'id', label: 'name', children: 'children' }" class="w100" clearable check-strictly
:placeholder="$t('sysmenu.inputParentIdTip')">
</el-tree-select>
@ -115,7 +115,9 @@ const state = reactive({
//
const getMenuData = () => {
state.parentData = []
pageList().then(res => {
pageList({
type: '0'
}).then(res => {
let menu = {
createBy: "",
createTime: "",

View File

@ -2,14 +2,20 @@
<div class="layout-padding">
<el-card shadow="hover">
<div class="mb15">
<el-input :placeholder="$t('sysmenu.inputNameTip')" style="max-width: 180px"
v-model="state.queryForm.menuName"> </el-input>
<el-button icon="search" type="primary" class="ml10" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="onOpenAddMenu" v-auth="'sys_menu_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysmenu.name')" prop="menuName" >
<el-input :placeholder="$t('sysmenu.inputNameTip')" style="max-width: 180px"
clearable v-model="state.queryForm.menuName"/>
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" class="ml10" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="onOpenAddMenu" v-auth="'sys_menu_add'">
{{ $t('common.addBtn') }}
</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%" row-key="path"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">

View File

@ -2,7 +2,7 @@
<div class="layout-padding">
<el-card shadow="hover" class="layout-padding-auto">
<el-row shadow="hover" v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysrole.roleName')" prop="roleName">
<el-input :placeholder="$t('sysrole.inputRoleNameTip')" v-model="state.queryForm.roleName"
style="max-width: 180px" />
@ -173,4 +173,4 @@ const handleDelete = (ids: string[]) => {
})
};
</script>
</script>

View File

@ -10,14 +10,14 @@
<el-col :span="20" :xs="24">
<el-card shadow="hover" class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('sysuser.username')" prop="username">
<el-input v-model="state.queryForm.username" :placeholder="$t('sysuser.inputUsernameTip')" clearable
style="width: 240px" @keyup.enter="getDataList" />
style="width: 240px" />
</el-form-item>
<el-form-item :label="$t('sysuser.phone')" prop="phone">
<el-input v-model="state.queryForm.phone" :placeholder="$t('sysuser.inputPhoneTip')" clearable
style="width: 240px" @keyup.enter="getDataList" />
style="width: 240px" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="getDataList">{{ $t('common.queryBtn') }}</el-button>
@ -100,7 +100,7 @@
</el-col>
</el-row>
<user-form ref="userDialogRef" @refresh="getDataList()" />
<user-form ref="userDialogRef" @refresh="getDataList(false)" />
<upload-excel ref="excelUploadRef" :title="$t('sysuser.importUserTip')" url="/admin/user/import"
temp-url="/admin/sys-file/local/file/user.xlsx" @refreshDataList="getDataList" />
@ -196,11 +196,11 @@ const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids).then(() => {
getDataList();
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
</script>
</script>

View File

@ -2,7 +2,7 @@
<el-dialog title="代码预览" v-model="visible" width="90%" top="3vh" append-to-body :close-on-click-modal="false">
<el-row :gutter="20">
<el-col :span="6">
<el-card :gutter="12" shadow="hover">
<el-card :gutter="12" shadow="hover" v-loading="loading">
<el-scrollbar height="calc(100vh - 300px)">
<el-tree ref="treeRef" node-key="id" :data="preview.fileTree" :expand-on-click-node="false"
highlight-current @node-click="handleNodeClick" />
@ -24,6 +24,7 @@
<script setup lang="ts" name="preview">
import { useGeneratorPreviewApi } from '/@/api/gen/table';
import { handleTree } from '/@/utils/other';
import {validatePhone} from "/@/api/admin/user";
const visible = ref(false)
// ======== ========
@ -42,17 +43,22 @@ const openDialog = async (id: string) => {
visible.value = true
}
const loading = ref(false)
const getGenCodeFile = (id: string) => {
loading.value = true
fileTreeOriginal.value = []
useGeneratorPreviewApi(id).then((res: any) => {
previewCodegen.value = res
for (let index in res) {
fileTreeOriginal.value.push(res[index].codePath)
}
//
preview.activeName = res[0].codePath
const files = handleFiles(fileTreeOriginal)
preview.fileTree = handleTree(files, 'id', 'parentId', 'children', '/')
}).finally(() => {
loading.value = false
})
}

View File

@ -2,7 +2,7 @@
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" ref="queryRef">
<el-form :inline="true" :model="state.queryForm" ref="queryRef" @keyup.enter="getDataList">
<el-form-item :label="$t('template.id')" prop="id">
<el-input :placeholder="t('template.inputIdTip')" style="max-width: 180px"
v-model="state.queryForm.id"/>
@ -66,7 +66,7 @@
</el-card>
<!-- 编辑新增 -->
<form-dialog @refresh="getDataList()" ref="formDialogRef"/>
<form-dialog @refresh="getDataList(false)" ref="formDialogRef"/>
</div>
</template>
@ -131,7 +131,7 @@
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObjs(ids).then(() => {
getDataList();
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)