Pre Merge pull request !191 from yangxu52/feat/use-defineOptions-macro

This commit is contained in:
yangxu52 2025-03-07 03:04:45 +00:00 committed by Gitee
commit 19adf53631
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
38 changed files with 120 additions and 100 deletions

View File

@ -72,7 +72,6 @@
"unplugin-auto-import": "0.17.5", "unplugin-auto-import": "0.17.5",
"unplugin-icons": "0.18.5", "unplugin-icons": "0.18.5",
"unplugin-vue-components": "28.0.0", "unplugin-vue-components": "28.0.0",
"unplugin-vue-setup-extend-plus": "1.0.1",
"vite": "5.4.11", "vite": "5.4.11",
"vite-plugin-compression": "0.5.1", "vite-plugin-compression": "0.5.1",
"vite-plugin-svg-icons-ng": "1.0.2", "vite-plugin-svg-icons-ng": "1.0.2",

View File

@ -5,7 +5,8 @@
</template> </template>
<!-- 动态表单渲染 --> <!-- 动态表单渲染 -->
<script setup name="Render" lang="ts"> <script setup lang="ts">
defineOptions({ name: 'Render' });
interface Props { interface Props {
formJson: string | object; formJson: string | object;
formData: string | object; formData: string | object;

View File

@ -14,7 +14,8 @@
</div> </div>
</template> </template>
<script setup name="Pagination" lang="ts"> <script setup lang="ts">
defineOptions({ name: 'Pagination' });
import { scrollTo } from '@/utils/scroll-to'; import { scrollTo } from '@/utils/scroll-to';
import { propTypes } from '@/utils/propTypes'; import { propTypes } from '@/utils/propTypes';

View File

@ -14,11 +14,11 @@
</section> </section>
</template> </template>
<script setup name="AppMain" lang="ts"> <script setup lang="ts">
import useSettingsStore from '@/store/modules/settings'; import useSettingsStore from '@/store/modules/settings';
import useTagsViewStore from '@/store/modules/tagsView'; import useTagsViewStore from '@/store/modules/tagsView';
import IframeToggle from './IframeToggle/index.vue'; import IframeToggle from './IframeToggle/index.vue';
defineOptions({ name: 'AppMain' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute(); const route = useRoute();
const tagsViewStore = useTagsViewStore(); const tagsViewStore = useTagsViewStore();
@ -40,16 +40,16 @@ watch(
); );
onMounted(() => { onMounted(() => {
addIframe() addIframe();
}) });
watchEffect((route) => { watchEffect((route) => {
addIframe() addIframe();
}) });
function addIframe() { function addIframe() {
if (route.meta.link) { if (route.meta.link) {
useTagsViewStore().addIframeView(route) useTagsViewStore().addIframeView(route);
} }
} }
</script> </script>

View File

@ -100,9 +100,10 @@
</div> </div>
</template> </template>
<script setup name="Demo" lang="ts"> <script setup lang="ts">
import { listDemo, getDemo, delDemo, addDemo, updateDemo } from '@/api/demo/demo'; import { listDemo, getDemo, delDemo, addDemo, updateDemo } from '@/api/demo/demo';
import { DemoVO, DemoQuery, DemoForm } from '@/api/demo/demo/types'; import { DemoVO, DemoQuery, DemoForm } from '@/api/demo/demo/types';
defineOptions({ name: 'Demo' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -88,9 +88,10 @@
</div> </div>
</template> </template>
<script setup name="Tree" lang="ts"> <script setup lang="ts">
import { listTree, getTree, delTree, addTree, updateTree } from '@/api/demo/tree'; import { listTree, getTree, delTree, addTree, updateTree } from '@/api/demo/tree';
import { TreeVO, TreeQuery, TreeForm } from '@/api/demo/tree/types'; import { TreeVO, TreeQuery, TreeForm } from '@/api/demo/tree/types';
defineOptions({ name: 'Tree' });
type TreeOption = { type TreeOption = {
id: number; id: number;

View File

@ -94,7 +94,8 @@
</div> </div>
</template> </template>
<script setup name="Index" lang="ts"> <script setup lang="ts">
defineOptions({ name: 'Index' });
const goTarget = (url: string) => { const goTarget = (url: string) => {
window.open(url, '__blank'); window.open(url, '__blank');
}; };

View File

@ -123,10 +123,11 @@
</div> </div>
</template> </template>
<script setup name="Cache" lang="ts"> <script setup lang="ts">
import { getCache } from '@/api/monitor/cache'; import { getCache } from '@/api/monitor/cache';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { CacheVO } from '@/api/monitor/cache/types'; import { CacheVO } from '@/api/monitor/cache/types';
defineOptions({ name: 'Cache' });
const cache = ref<Partial<CacheVO>>({}); const cache = ref<Partial<CacheVO>>({});
const commandstats = ref(); const commandstats = ref();

View File

@ -104,9 +104,10 @@
</div> </div>
</template> </template>
<script setup name="Logininfor" lang="ts"> <script setup lang="ts">
import { list, delLoginInfo, cleanLoginInfo, unlockLoginInfo } from '@/api/monitor/loginInfo'; import { list, delLoginInfo, cleanLoginInfo, unlockLoginInfo } from '@/api/monitor/loginInfo';
import { LoginInfoQuery, LoginInfoVO } from '@/api/monitor/loginInfo/types'; import { LoginInfoQuery, LoginInfoVO } from '@/api/monitor/loginInfo/types';
defineOptions({ name: 'Logininfor' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type')); const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type'));

View File

@ -60,11 +60,12 @@
</div> </div>
</template> </template>
<script setup name="Online" lang="ts"> <script setup lang="ts">
import { forceLogout, list as initData } from '@/api/monitor/online'; import { forceLogout, list as initData } from '@/api/monitor/online';
import { OnlineQuery, OnlineVO } from '@/api/monitor/online/types'; import { OnlineQuery, OnlineVO } from '@/api/monitor/online/types';
import api from '@/api/system/user'; import api from '@/api/system/user';
import { to } from 'await-to-js'; import { to } from 'await-to-js';
defineOptions({ name: 'Online' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type')); const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type'));

View File

@ -127,10 +127,11 @@
</div> </div>
</template> </template>
<script setup name="Operlog" lang="ts"> <script setup lang="ts">
import { list, delOperlog, cleanOperlog } from '@/api/monitor/operlog'; import { list, delOperlog, cleanOperlog } from '@/api/monitor/operlog';
import { OperLogForm, OperLogQuery, OperLogVO } from '@/api/monitor/operlog/types'; import { OperLogForm, OperLogQuery, OperLogVO } from '@/api/monitor/operlog/types';
import OperInfoDialog from './oper-info-dialog.vue'; import OperInfoDialog from './oper-info-dialog.vue';
defineOptions({ name: 'Operlog' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_oper_type, sys_common_status } = toRefs<any>(proxy?.useDict('sys_oper_type', 'sys_common_status')); const { sys_oper_type, sys_common_status } = toRefs<any>(proxy?.useDict('sys_oper_type', 'sys_common_status'));

View File

@ -141,9 +141,10 @@
</div> </div>
</template> </template>
<script setup name="Client" lang="ts"> <script setup lang="ts">
import { listClient, getClient, delClient, addClient, updateClient, changeStatus } from '@/api/system/client'; import { listClient, getClient, delClient, addClient, updateClient, changeStatus } from '@/api/system/client';
import { ClientVO, ClientQuery, ClientForm } from '@/api/system/client/types'; import { ClientVO, ClientQuery, ClientForm } from '@/api/system/client/types';
defineOptions({ name: 'Client' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable')); const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));

View File

@ -122,9 +122,10 @@
</div> </div>
</template> </template>
<script setup name="Config" lang="ts"> <script setup lang="ts">
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from '@/api/system/config'; import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from '@/api/system/config';
import { ConfigForm, ConfigQuery, ConfigVO } from '@/api/system/config/types'; import { ConfigForm, ConfigQuery, ConfigVO } from '@/api/system/config/types';
defineOptions({ name: 'Config' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_yes_no } = toRefs<any>(proxy?.useDict('sys_yes_no')); const { sys_yes_no } = toRefs<any>(proxy?.useDict('sys_yes_no'));

View File

@ -140,11 +140,12 @@
</div> </div>
</template> </template>
<script setup name="Dept" lang="ts"> <script setup lang="ts">
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from '@/api/system/dept'; import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from '@/api/system/dept';
import { DeptForm, DeptQuery, DeptVO } from '@/api/system/dept/types'; import { DeptForm, DeptQuery, DeptVO } from '@/api/system/dept/types';
import { UserVO } from '@/api/system/user/types'; import { UserVO } from '@/api/system/user/types';
import { listUserByDeptId } from '@/api/system/user'; import { listUserByDeptId } from '@/api/system/user';
defineOptions({ name: 'Dept' });
interface DeptOptionsType { interface DeptOptionsType {
deptId: number | string; deptId: number | string;

View File

@ -125,13 +125,15 @@
</div> </div>
</template> </template>
<script setup name="Data" lang="ts"> <script setup lang="ts">
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import { optionselect as getDictOptionselect, getType } from '@/api/system/dict/type'; import { optionselect as getDictOptionselect, getType } from '@/api/system/dict/type';
import { listData, getData, delData, addData, updateData } from '@/api/system/dict/data'; import { listData, getData, delData, addData, updateData } from '@/api/system/dict/data';
import { DictTypeVO } from '@/api/system/dict/type/types'; import { DictTypeVO } from '@/api/system/dict/type/types';
import { DictDataForm, DictDataQuery, DictDataVO } from '@/api/system/dict/data/types'; import { DictDataForm, DictDataQuery, DictDataVO } from '@/api/system/dict/data/types';
import { RouteLocationNormalized } from 'vue-router'; import { RouteLocationNormalized } from 'vue-router';
//TODO namehtml;
defineOptions({ name: 'Data' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute(); const route = useRoute();

View File

@ -107,10 +107,11 @@
</div> </div>
</template> </template>
<script setup name="Dict" lang="ts"> <script setup lang="ts">
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type'; import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type';
import { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types'; import { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types';
defineOptions({ name: 'Dict' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -260,10 +260,12 @@
</div> </div>
</template> </template>
<script setup name="Menu" lang="ts"> <script setup lang="ts">
import { addMenu, delMenu, getMenu, listMenu, updateMenu } from '@/api/system/menu'; import { addMenu, delMenu, getMenu, listMenu, updateMenu } from '@/api/system/menu';
import { MenuForm, MenuQuery, MenuVO } from '@/api/system/menu/types'; import { MenuForm, MenuQuery, MenuVO } from '@/api/system/menu/types';
import { MenuTypeEnum } from '@/enums/MenuTypeEnum'; import { MenuTypeEnum } from '@/enums/MenuTypeEnum';
// TODO namehtml
defineOptions({ name: 'Menu' });
interface MenuOptionsType { interface MenuOptionsType {
menuId: number; menuId: number;

View File

@ -118,9 +118,10 @@
</div> </div>
</template> </template>
<script setup name="Notice" lang="ts"> <script setup lang="ts">
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from '@/api/system/notice'; import { listNotice, getNotice, delNotice, addNotice, updateNotice } from '@/api/system/notice';
import { NoticeForm, NoticeQuery, NoticeVO } from '@/api/system/notice/types'; import { NoticeForm, NoticeQuery, NoticeVO } from '@/api/system/notice/types';
defineOptions({ name: 'Notice' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_notice_status, sys_notice_type } = toRefs<any>(proxy?.useDict('sys_notice_status', 'sys_notice_type')); const { sys_notice_status, sys_notice_type } = toRefs<any>(proxy?.useDict('sys_notice_status', 'sys_notice_type'));

View File

@ -133,9 +133,10 @@
</div> </div>
</template> </template>
<script setup name="OssConfig" lang="ts"> <script setup lang="ts">
import { listOssConfig, getOssConfig, delOssConfig, addOssConfig, updateOssConfig, changeOssConfigStatus } from '@/api/system/ossConfig'; import { listOssConfig, getOssConfig, delOssConfig, addOssConfig, updateOssConfig, changeOssConfigStatus } from '@/api/system/ossConfig';
import { OssConfigForm, OssConfigQuery, OssConfigVO } from '@/api/system/ossConfig/types'; import { OssConfigForm, OssConfigQuery, OssConfigVO } from '@/api/system/ossConfig/types';
defineOptions({ name: 'OssConfig' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_yes_no } = toRefs<any>(proxy?.useDict('sys_yes_no')); const { sys_yes_no } = toRefs<any>(proxy?.useDict('sys_yes_no'));

View File

@ -130,10 +130,11 @@
</div> </div>
</template> </template>
<script setup name="Oss" lang="ts"> <script setup lang="ts">
import { listOss, delOss } from '@/api/system/oss'; import { listOss, delOss } from '@/api/system/oss';
import ImagePreview from '@/components/ImagePreview/index.vue'; import ImagePreview from '@/components/ImagePreview/index.vue';
import { OssForm, OssQuery, OssVO } from '@/api/system/oss/types'; import { OssForm, OssQuery, OssVO } from '@/api/system/oss/types';
defineOptions({ name: 'Oss' });
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -169,11 +169,12 @@
</div> </div>
</template> </template>
<script setup name="Post" lang="ts"> <script setup lang="ts">
import { listPost, addPost, delPost, getPost, updatePost } from '@/api/system/post'; import { listPost, addPost, delPost, getPost, updatePost } from '@/api/system/post';
import { PostForm, PostQuery, PostVO } from '@/api/system/post/types'; import { PostForm, PostQuery, PostVO } from '@/api/system/post/types';
import { DeptVO } from '@/api/system/dept/types'; import { DeptVO } from '@/api/system/dept/types';
import api from '@/api/system/user'; import api from '@/api/system/user';
defineOptions({ name: 'Post' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable')); const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));

View File

@ -64,12 +64,13 @@
</div> </div>
</template> </template>
<script setup name="AuthUser" lang="ts"> <script setup lang="ts">
import { allocatedUserList, authUserCancel, authUserCancelAll } from '@/api/system/role'; import { allocatedUserList, authUserCancel, authUserCancelAll } from '@/api/system/role';
import { UserQuery } from '@/api/system/user/types'; import { UserQuery } from '@/api/system/user/types';
import { UserVO } from '@/api/system/user/types'; import { UserVO } from '@/api/system/user/types';
import SelectUser from './selectUser.vue'; import SelectUser from './selectUser.vue';
import { RouteLocationNormalized } from 'vue-router'; import { RouteLocationNormalized } from 'vue-router';
defineOptions({ name: 'AuthUser' });
const route = useRoute(); const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -191,11 +191,12 @@
</div> </div>
</template> </template>
<script setup name="Role" lang="ts"> <script setup lang="ts">
import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updateRole, deptTreeSelect } from '@/api/system/role'; import { addRole, changeRoleStatus, dataScope, delRole, getRole, listRole, updateRole, deptTreeSelect } from '@/api/system/role';
import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu/index'; import { roleMenuTreeselect, treeselect as menuTreeselect } from '@/api/system/menu/index';
import { RoleVO, RoleForm, RoleQuery, DeptTreeOption } from '@/api/system/role/types'; import { RoleVO, RoleForm, RoleQuery, DeptTreeOption } from '@/api/system/role/types';
import { MenuTreeOption, RoleMenuTree } from '@/api/system/menu/types'; import { MenuTreeOption, RoleMenuTree } from '@/api/system/menu/types';
defineOptions({ name: 'Role' });
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -43,10 +43,11 @@
</el-row> </el-row>
</template> </template>
<script setup name="SelectUser" lang="ts"> <script setup lang="ts">
import { authUserSelectAll, unallocatedUserList } from '@/api/system/role'; import { authUserSelectAll, unallocatedUserList } from '@/api/system/role';
import { UserVO } from '@/api/system/user/types'; import { UserVO } from '@/api/system/user/types';
import { UserQuery } from '@/api/system/user/types'; import { UserQuery } from '@/api/system/user/types';
defineOptions({ name: 'SelectUser' });
const props = defineProps({ const props = defineProps({
roleId: { roleId: {

View File

@ -143,7 +143,7 @@
</div> </div>
</template> </template>
<script setup name="Tenant" lang="ts"> <script setup lang="ts">
import { import {
listTenant, listTenant,
getTenant, getTenant,
@ -158,6 +158,7 @@ import { selectTenantPackage } from '@/api/system/tenantPackage';
import useUserStore from '@/store/modules/user'; import useUserStore from '@/store/modules/user';
import { TenantForm, TenantQuery, TenantVO } from '@/api/system/tenant/types'; import { TenantForm, TenantQuery, TenantVO } from '@/api/system/tenant/types';
import { TenantPkgVO } from '@/api/system/tenantPackage/types'; import { TenantPkgVO } from '@/api/system/tenantPackage/types';
defineOptions({ name: 'Tenant' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -99,7 +99,7 @@
</div> </div>
</template> </template>
<script setup name="TenantPackage" lang="ts"> <script setup lang="ts">
import { import {
listTenantPackage, listTenantPackage,
getTenantPackage, getTenantPackage,
@ -112,6 +112,7 @@ import { treeselect as menuTreeselect, tenantPackageMenuTreeselect } from '@/api
import { TenantPkgForm, TenantPkgQuery, TenantPkgVO } from '@/api/system/tenantPackage/types'; import { TenantPkgForm, TenantPkgQuery, TenantPkgVO } from '@/api/system/tenantPackage/types';
import { MenuTreeOption } from '@/api/system/menu/types'; import { MenuTreeOption } from '@/api/system/menu/types';
import to from 'await-to-js'; import to from 'await-to-js';
defineOptions({ name: 'TenantPackage' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -54,13 +54,13 @@
</div> </div>
</template> </template>
<script setup name="AuthRole" lang="ts"> <script setup lang="ts">
import { RoleVO } from '@/api/system/role/types'; import { RoleVO } from '@/api/system/role/types';
import { getAuthRole, updateAuthRole } from '@/api/system/user'; import { getAuthRole, updateAuthRole } from '@/api/system/user';
import { UserForm } from '@/api/system/user/types'; import { UserForm } from '@/api/system/user/types';
import { RouteLocationNormalized } from 'vue-router'; import { RouteLocationNormalized } from 'vue-router';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
defineOptions({ name: 'AuthRole' });
const route = useRoute(); const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -285,7 +285,7 @@
</div> </div>
</template> </template>
<script setup name="User" lang="ts"> <script setup lang="ts">
import api from '@/api/system/user'; import api from '@/api/system/user';
import { UserForm, UserQuery, UserVO } from '@/api/system/user/types'; import { UserForm, UserQuery, UserVO } from '@/api/system/user/types';
import { DeptTreeVO, DeptVO } from '@/api/system/dept/types'; import { DeptTreeVO, DeptVO } from '@/api/system/dept/types';
@ -297,7 +297,7 @@ import { to } from 'await-to-js';
import { optionselect } from '@/api/system/post'; import { optionselect } from '@/api/system/post';
import { hasPermi } from '@/directive/permission'; import { hasPermi } from '@/directive/permission';
import { checkPermi } from '@/utils/permission'; import { checkPermi } from '@/utils/permission';
defineOptions({ name: 'User' });
const router = useRouter(); const router = useRouter();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable, sys_user_sex } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'sys_user_sex')); const { sys_normal_disable, sys_user_sex } = toRefs<any>(proxy?.useDict('sys_normal_disable', 'sys_user_sex'));

View File

@ -68,7 +68,7 @@
</div> </div>
</template> </template>
<script setup name="Profile" lang="ts"> <script setup lang="ts">
import UserAvatar from './userAvatar.vue'; import UserAvatar from './userAvatar.vue';
import UserInfo from './userInfo.vue'; import UserInfo from './userInfo.vue';
import ResetPwd from './resetPwd.vue'; import ResetPwd from './resetPwd.vue';
@ -78,6 +78,7 @@ import { getAuthList } from '@/api/system/social/auth';
import { getUserProfile } from '@/api/system/user'; import { getUserProfile } from '@/api/system/user';
import { getOnline } from '@/api/monitor/online'; import { getOnline } from '@/api/monitor/online';
import { UserVO } from '@/api/system/user/types'; import { UserVO } from '@/api/system/user/types';
defineOptions({ name: 'Profile' });
const activeTab = ref('userinfo'); const activeTab = ref('userinfo');
interface State { interface State {

View File

@ -26,9 +26,10 @@
</div> </div>
</template> </template>
<script setup name="Online" lang="ts"> <script setup lang="ts">
import { delOnline } from '@/api/monitor/online'; import { delOnline } from '@/api/monitor/online';
import { propTypes } from '@/utils/propTypes'; import { propTypes } from '@/utils/propTypes';
defineOptions({ name: 'Online' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type')); const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type'));

View File

@ -112,7 +112,7 @@
</el-card> </el-card>
</template> </template>
<script setup name="GenEdit" lang="ts"> <script setup lang="ts">
import { getGenTable, updateGenTable } from '@/api/tool/gen'; import { getGenTable, updateGenTable } from '@/api/tool/gen';
import { DbColumnVO, DbTableVO } from '@/api/tool/gen/types'; import { DbColumnVO, DbTableVO } from '@/api/tool/gen/types';
import { optionselect as getDictOptionselect } from '@/api/system/dict/type'; import { optionselect as getDictOptionselect } from '@/api/system/dict/type';
@ -120,6 +120,7 @@ import { DictTypeVO } from '@/api/system/dict/type/types';
import BasicInfoForm from './basicInfoForm.vue'; import BasicInfoForm from './basicInfoForm.vue';
import GenInfoForm from './genInfoForm.vue'; import GenInfoForm from './genInfoForm.vue';
import { RouteLocationNormalized } from 'vue-router'; import { RouteLocationNormalized } from 'vue-router';
defineOptions({ name: 'GenEdit' });
const route = useRoute(); const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -112,11 +112,12 @@
</div> </div>
</template> </template>
<script setup name="Gen" lang="ts"> <script setup lang="ts">
import {delTable, genCode, getDataNames, listTable, previewTable, synchDb} from '@/api/tool/gen'; import { delTable, genCode, getDataNames, listTable, previewTable, synchDb } from '@/api/tool/gen';
import {TableQuery, TableVO} from '@/api/tool/gen/types'; import { TableQuery, TableVO } from '@/api/tool/gen/types';
import router from '@/router'; import router from '@/router';
import ImportTable from './importTable.vue'; import ImportTable from './importTable.vue';
defineOptions({ name: 'Gen' });
const route = useRoute(); const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;

View File

@ -34,7 +34,7 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
> >
<el-table-column label="分类名称" prop="categoryName" width="260"/> <el-table-column label="分类名称" prop="categoryName" width="260" />
<el-table-column label="显示顺序" align="center" prop="orderNum" width="200" /> <el-table-column label="显示顺序" align="center" prop="orderNum" width="200" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180" /> <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
<el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
@ -77,7 +77,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button> <el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
@ -87,18 +87,18 @@
</div> </div>
</template> </template>
<script setup name="Category" lang="ts"> <script setup lang="ts">
import { listCategory, getCategory, delCategory, addCategory, updateCategory } from "@/api/workflow/category"; import { listCategory, getCategory, delCategory, addCategory, updateCategory } from '@/api/workflow/category';
import { CategoryVO, CategoryQuery, CategoryForm } from '@/api/workflow/category/types'; import { CategoryVO, CategoryQuery, CategoryForm } from '@/api/workflow/category/types';
defineOptions({ name: 'Category' });
type CategoryOption = { type CategoryOption = {
categoryId: number; categoryId: number;
categoryName: string; categoryName: string;
children?: CategoryOption[]; children?: CategoryOption[];
} };
const { proxy } = getCurrentInstance() as ComponentInternalInstance;;
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const categoryList = ref<CategoryVO[]>([]); const categoryList = ref<CategoryVO[]>([]);
const categoryOptions = ref<CategoryOption[]>([]); const categoryOptions = ref<CategoryOption[]>([]);
@ -109,32 +109,29 @@ const loading = ref(false);
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const categoryFormRef = ref<ElFormInstance>(); const categoryFormRef = ref<ElFormInstance>();
const categoryTableRef = ref<ElTableInstance>() const categoryTableRef = ref<ElTableInstance>();
const dialog = reactive<DialogOption>({ const dialog = reactive<DialogOption>({
visible: false, visible: false,
title: '' title: ''
}); });
const initFormData: CategoryForm = { const initFormData: CategoryForm = {
categoryId: undefined, categoryId: undefined,
categoryName: "", categoryName: '',
parentId: undefined, parentId: undefined,
orderNum: 0, orderNum: 0
} };
const data = reactive<PageData<CategoryForm, CategoryQuery>>({ const data = reactive<PageData<CategoryForm, CategoryQuery>>({
form: {...initFormData}, form: { ...initFormData },
queryParams: { queryParams: {
categoryName: undefined, categoryName: undefined
}, },
rules: { rules: {
categoryId: [ categoryId: [{ required: true, message: '流程分类ID不能为空', trigger: 'blur' }],
{ required: true, message: "流程分类ID不能为空", trigger: "blur" } parentId: [{ required: true, message: '请选择上级分类', trigger: 'change' }],
], categoryName: [{ required: true, message: '请输入分类名称', trigger: 'blur' }]
parentId: [{ required: true, message: "请选择上级分类", trigger: "change" }],
categoryName: [{ required: true, message: "请输入分类名称", trigger: "blur" }]
} }
}); });
@ -144,19 +141,19 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listCategory(queryParams.value); const res = await listCategory(queryParams.value);
const data = proxy?.handleTree<CategoryVO>(res.data, "categoryId", "parentId"); const data = proxy?.handleTree<CategoryVO>(res.data, 'categoryId', 'parentId');
if (data) { if (data) {
categoryList.value = data; categoryList.value = data;
loading.value = false; loading.value = false;
} }
} };
/** 查询流程分类下拉树结构 */ /** 查询流程分类下拉树结构 */
const getTreeselect = async () => { const getTreeselect = async () => {
const res = await listCategory(); const res = await listCategory();
categoryOptions.value = []; categoryOptions.value = [];
// //
const data = proxy?.handleTree<CategoryOption>(res.data, "categoryId", "parentId"); const data = proxy?.handleTree<CategoryOption>(res.data, 'categoryId', 'parentId');
if (data) { if (data) {
categoryOptions.value = data; // categoryOptions.value = data; //
} }
@ -166,24 +163,24 @@ const getTreeselect = async () => {
const cancel = () => { const cancel = () => {
reset(); reset();
dialog.visible = false; dialog.visible = false;
} };
// //
const reset = () => { const reset = () => {
form.value = {...initFormData} form.value = { ...initFormData };
categoryFormRef.value?.resetFields(); categoryFormRef.value?.resetFields();
} };
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
getList(); getList();
} };
/** 重置按钮操作 */ /** 重置按钮操作 */
const resetQuery = () => { const resetQuery = () => {
queryFormRef.value?.resetFields(); queryFormRef.value?.resetFields();
handleQuery(); handleQuery();
} };
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleAdd = (row?: CategoryVO) => { const handleAdd = (row?: CategoryVO) => {
@ -195,22 +192,22 @@ const handleAdd = (row?: CategoryVO) => {
form.value.parentId = undefined; form.value.parentId = undefined;
} }
dialog.visible = true; dialog.visible = true;
dialog.title = "添加流程分类"; dialog.title = '添加流程分类';
} };
/** 展开/折叠操作 */ /** 展开/折叠操作 */
const handleToggleExpandAll = () => { const handleToggleExpandAll = () => {
isExpandAll.value = !isExpandAll.value; isExpandAll.value = !isExpandAll.value;
toggleExpandAll(categoryList.value, isExpandAll.value) toggleExpandAll(categoryList.value, isExpandAll.value);
} };
/** 展开/折叠操作 */ /** 展开/折叠操作 */
const toggleExpandAll = (data: CategoryVO[], status: boolean) => { const toggleExpandAll = (data: CategoryVO[], status: boolean) => {
data.forEach((item) => { data.forEach((item) => {
categoryTableRef.value?.toggleRowExpansion(item, status) categoryTableRef.value?.toggleRowExpansion(item, status);
if (item.children && item.children.length > 0) toggleExpandAll(item.children, status) if (item.children && item.children.length > 0) toggleExpandAll(item.children, status);
}) });
} };
/** 修改按钮操作 */ /** 修改按钮操作 */
const handleUpdate = async (row: CategoryVO) => { const handleUpdate = async (row: CategoryVO) => {
@ -222,8 +219,8 @@ const handleUpdate = async (row: CategoryVO) => {
const res = await getCategory(row.categoryId); const res = await getCategory(row.categoryId);
Object.assign(form.value, res.data); Object.assign(form.value, res.data);
dialog.visible = true; dialog.visible = true;
dialog.title = "修改流程分类"; dialog.title = '修改流程分类';
} };
/** 提交按钮 */ /** 提交按钮 */
const submitForm = () => { const submitForm = () => {
@ -231,25 +228,25 @@ const submitForm = () => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
if (form.value.categoryId) { if (form.value.categoryId) {
await updateCategory(form.value).finally(() => buttonLoading.value = false); await updateCategory(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
await addCategory(form.value).finally(() => buttonLoading.value = false); await addCategory(form.value).finally(() => (buttonLoading.value = false));
} }
proxy?.$modal.msgSuccess("操作成功"); proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false; dialog.visible = false;
getList(); getList();
} }
}); });
} };
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (row: CategoryVO) => { const handleDelete = async (row: CategoryVO) => {
await proxy?.$modal.confirm('是否确认删除"' + row.categoryName + '"的分类?'); await proxy?.$modal.confirm('是否确认删除"' + row.categoryName + '"的分类?');
loading.value = true; loading.value = true;
await delCategory(row.categoryId).finally(() => loading.value = false); await delCategory(row.categoryId).finally(() => (loading.value = false));
await getList(); await getList();
proxy?.$modal.msgSuccess("删除成功"); proxy?.$modal.msgSuccess('删除成功');
} };
onMounted(() => { onMounted(() => {
getList(); getList();

View File

@ -87,11 +87,11 @@
</div> </div>
</template> </template>
<script setup name="Leave" lang="ts"> <script setup lang="ts">
import { delLeave, listLeave } from '@/api/workflow/leave'; import { delLeave, listLeave } from '@/api/workflow/leave';
import { cancelProcessApply } from '@/api/workflow/instance'; import { cancelProcessApply } from '@/api/workflow/instance';
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types'; import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
defineOptions({ name: 'Leave' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status')); const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
const leaveList = ref<LeaveVO[]>([]); const leaveList = ref<LeaveVO[]>([]);

View File

@ -58,7 +58,7 @@
</div> </div>
</template> </template>
<script setup name="Leave" lang="ts"> <script setup lang="ts">
import { addLeave, getLeave, updateLeave } from '@/api/workflow/leave'; import { addLeave, getLeave, updateLeave } from '@/api/workflow/leave';
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types'; import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
import { startWorkFlow } from '@/api/workflow/task'; import { startWorkFlow } from '@/api/workflow/task';
@ -66,6 +66,7 @@ import SubmitVerify from '@/components/Process/submitVerify.vue';
import ApprovalRecord from '@/components/Process/approvalRecord.vue'; import ApprovalRecord from '@/components/Process/approvalRecord.vue';
import { AxiosResponse } from 'axios'; import { AxiosResponse } from 'axios';
import { StartProcessBo } from '@/api/workflow/workflowCommon/types'; import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
defineOptions({ name: 'Leave' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const buttonLoading = ref(false); const buttonLoading = ref(false);

View File

@ -190,14 +190,14 @@
</div> </div>
</template> </template>
<script setup name="processDefinition" lang="ts"> <script setup lang="ts">
import { listDefinition, deleteDefinition, active, importDef, unPublishList, publish, add, edit, getInfo, copy } from '@/api/workflow/definition'; import { listDefinition, deleteDefinition, active, importDef, unPublishList, publish, add, edit, getInfo, copy } from '@/api/workflow/definition';
import { categoryTree } from '@/api/workflow/category'; import { categoryTree } from '@/api/workflow/category';
import { CategoryTreeVO } from '@/api/workflow/category/types'; import { CategoryTreeVO } from '@/api/workflow/category/types';
import { FlowDefinitionQuery, FlowDefinitionVo, FlowDefinitionForm } from '@/api/workflow/definition/types'; import { FlowDefinitionQuery, FlowDefinitionVo, FlowDefinitionForm } from '@/api/workflow/definition/types';
import { UploadRequestOptions, TabsPaneContext } from 'element-plus'; import { UploadRequestOptions, TabsPaneContext } from 'element-plus';
import { ElMessageBoxOptions } from "element-plus/es/components/message-box/src/message-box.type"; import { ElMessageBoxOptions } from 'element-plus/es/components/message-box/src/message-box.type';
defineOptions({ name: 'processDefinition' });
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();

View File

@ -7,7 +7,6 @@ import createComponents from './components';
import createIcons from './icons'; import createIcons from './icons';
import createSvgIconsPlugin from './svg-icon'; import createSvgIconsPlugin from './svg-icon';
import createCompression from './compression'; import createCompression from './compression';
import createSetupExtend from './setup-extend';
import path from 'path'; import path from 'path';
export default (viteEnv: any, isBuild = false): [] => { export default (viteEnv: any, isBuild = false): [] => {
@ -19,7 +18,6 @@ export default (viteEnv: any, isBuild = false): [] => {
vitePlugins.push(createComponents(path)); vitePlugins.push(createComponents(path));
vitePlugins.push(createCompression(viteEnv)); vitePlugins.push(createCompression(viteEnv));
vitePlugins.push(createIcons()); vitePlugins.push(createIcons());
vitePlugins.push(createSvgIconsPlugin(path, isBuild)); vitePlugins.push(createSvgIconsPlugin(path));
vitePlugins.push(createSetupExtend());
return vitePlugins; return vitePlugins;
}; };

View File

@ -1,5 +0,0 @@
import setupExtend from 'unplugin-vue-setup-extend-plus/vite';
export default () => {
return setupExtend({});
};