Pre Merge pull request !753 from huppygo/master
commit
96c6367d99
|
|
@ -4,7 +4,7 @@ NODE_ENV=development
|
|||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
|
@ -31,4 +31,5 @@ VITE_MALL_H5_DOMAIN='http://localhost:3000'
|
|||
VITE_APP_CAPTCHA_ENABLE=false
|
||||
|
||||
# GoView域名
|
||||
VITE_GOVIEW_URL='http://127.0.0.1:3000'
|
||||
VITE_GOVIEW_URL='http://127.0.0.1:3000'
|
||||
|
||||
|
|
|
|||
|
|
@ -7,3 +7,4 @@ pnpm-debug
|
|||
auto-*.d.ts
|
||||
.idea
|
||||
.history
|
||||
.vtj/histories
|
||||
|
|
|
|||
|
|
@ -0,0 +1,313 @@
|
|||
{
|
||||
"name": "Users",
|
||||
"locked": false,
|
||||
"inject": [],
|
||||
"state": {
|
||||
"keyword": {
|
||||
"type": "JSExpression",
|
||||
"value": "''"
|
||||
}
|
||||
},
|
||||
"lifeCycles": {},
|
||||
"methods": {
|
||||
"loader": {
|
||||
"type": "JSFunction",
|
||||
"value": "(data) => {\n return this.getData(data)\n}"
|
||||
},
|
||||
"search": {
|
||||
"type": "JSFunction",
|
||||
"value": "() => {\n this.$refs.gridRef.search()\n}"
|
||||
},
|
||||
"rowAction": {
|
||||
"type": "JSFunction",
|
||||
"value": "(row) => {\n this.$message.info('click row id: ' + row.id)\n}"
|
||||
}
|
||||
},
|
||||
"computed": {
|
||||
"columns": {
|
||||
"type": "JSFunction",
|
||||
"value": "() => {\n return [\n {\n type: 'checkbox',\n width: 40\n },\n {\n type: 'seq',\n width: 60,\n title: '序号'\n },\n {\n field: 'name',\n title: '名称',\n minWidth: 100\n },\n {\n field: 'label',\n title: '描述',\n minWidth: 100\n },\n {\n field: 'isDefault',\n title: '默认角色',\n minWidth: 100,\n slots: {\n default: 'isDefault'\n }\n },\n {\n field: 'order',\n title: '排序',\n minWidth: 100,\n sortable: true\n },\n {\n field: 'desc',\n title: '备注',\n minWidth: 100\n },\n {\n field: 'createdAt',\n title: '创建时间',\n minWidth: 140\n },\n {\n field: 'actions',\n title: '操作',\n width: 160,\n slots: {\n default: 'actions'\n }\n }\n ]\n}"
|
||||
}
|
||||
},
|
||||
"watch": [],
|
||||
"css": "",
|
||||
"props": [],
|
||||
"emits": [],
|
||||
"slots": [],
|
||||
"dataSources": {
|
||||
"getData": {
|
||||
"name": "getData",
|
||||
"test": {
|
||||
"type": "JSFunction",
|
||||
"value": "() => this.runApi({\n /* 在这里可输入接口参数 */\n})"
|
||||
},
|
||||
"type": "mock",
|
||||
"label": "模拟数据",
|
||||
"mockTemplate": {
|
||||
"type": "JSFunction",
|
||||
"value": "(params) => {\n const { page = 1, pageSize = 50 } = params || {};\n const total = 1000;\n return {\n [`list|${pageSize}`]: [{\n id: '@guid',\n name: '@cname',\n label: '@ctitle',\n 'isDefault|1': '@boolean',\n 'order|+1': 1,\n desc: '@cparagraph',\n createdAt: '@date(yyyy-MM-dd hh:mm:ss)'\n }],\n total,\n page,\n limit: pageSize\n };\n}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"__VTJ_BLOCK__": true,
|
||||
"__VERSION__": "1736401534792",
|
||||
"id": "7pdk4mxyf",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "1kqd4haeckr",
|
||||
"name": "XGrid",
|
||||
"from": "@vtj/ui",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"children": [
|
||||
{
|
||||
"id": "1mp9b7mk9wj",
|
||||
"name": "ElInput",
|
||||
"from": "element-plus",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"slot": {
|
||||
"name": "toolbar__buttons",
|
||||
"params": []
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"id": "2ax97lz9cox",
|
||||
"name": "ElButton",
|
||||
"from": "element-plus",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"slot": {
|
||||
"name": "append",
|
||||
"params": []
|
||||
},
|
||||
"children": "查询",
|
||||
"props": {
|
||||
"type": "primary"
|
||||
},
|
||||
"directives": [],
|
||||
"events": {
|
||||
"click": {
|
||||
"name": "click",
|
||||
"handler": {
|
||||
"type": "JSFunction",
|
||||
"value": "this.search"
|
||||
},
|
||||
"modifiers": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"style": {
|
||||
"width": "300px",
|
||||
"margin-right": "10px"
|
||||
},
|
||||
"placeholder": "请输入查询关键字"
|
||||
},
|
||||
"directives": [
|
||||
{
|
||||
"id": "l36jhkywal",
|
||||
"name": "vModel",
|
||||
"arg": "modelValue",
|
||||
"value": {
|
||||
"type": "JSExpression",
|
||||
"value": "this.state.keyword"
|
||||
}
|
||||
}
|
||||
],
|
||||
"events": {}
|
||||
},
|
||||
{
|
||||
"id": "2ammdsu07o6",
|
||||
"name": "ElButton",
|
||||
"from": "element-plus",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"slot": {
|
||||
"name": "toolbar__buttons",
|
||||
"params": []
|
||||
},
|
||||
"children": "新增",
|
||||
"props": {
|
||||
"icon": "Plus",
|
||||
"type": "primary"
|
||||
},
|
||||
"directives": [],
|
||||
"events": {
|
||||
"click": {
|
||||
"name": "click",
|
||||
"handler": {
|
||||
"type": "JSFunction",
|
||||
"value": "() => {\n this.$message.info('click add button')\n}"
|
||||
},
|
||||
"modifiers": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "257nvaelda4",
|
||||
"name": "ElButton",
|
||||
"from": "element-plus",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"slot": {
|
||||
"name": "toolbar__buttons",
|
||||
"params": []
|
||||
},
|
||||
"children": "批量删除",
|
||||
"props": {
|
||||
"icon": "Delete",
|
||||
"type": "danger"
|
||||
},
|
||||
"directives": [],
|
||||
"events": {
|
||||
"click": {
|
||||
"name": "click",
|
||||
"handler": {
|
||||
"type": "JSFunction",
|
||||
"value": "() => {\n const rows = this.$refs.gridRef.getSelected();\n if (rows.length) {\n this.$message.info('delete data rows: ' + rows.length);\n } else {\n this.$message.warning('请选择需要删除的数据项');\n }\n}"
|
||||
},
|
||||
"modifiers": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "o52fisb3kt",
|
||||
"name": "ElTag",
|
||||
"from": "element-plus",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"slot": {
|
||||
"name": "isDefault",
|
||||
"params": []
|
||||
},
|
||||
"children": {
|
||||
"type": "JSExpression",
|
||||
"value": "this.context.scope_1kqd4haeckr.row.isDefault ? '是' : '否'"
|
||||
},
|
||||
"props": {
|
||||
"type": {
|
||||
"type": "JSExpression",
|
||||
"value": "this.context.scope_1kqd4haeckr.row.isDefault ? 'success' : 'info'"
|
||||
}
|
||||
},
|
||||
"directives": [],
|
||||
"events": {}
|
||||
},
|
||||
{
|
||||
"id": "1ft4np8i6i1",
|
||||
"name": "XAction",
|
||||
"from": "@vtj/ui",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"slot": {
|
||||
"name": "actions",
|
||||
"params": []
|
||||
},
|
||||
"children": [],
|
||||
"props": {
|
||||
"mode": "icon",
|
||||
"size": "default",
|
||||
"type": "primary",
|
||||
"label": "编辑"
|
||||
},
|
||||
"directives": [],
|
||||
"events": {
|
||||
"click": {
|
||||
"name": "click",
|
||||
"handler": {
|
||||
"type": "JSFunction",
|
||||
"value": "() => {\n this.rowAction(this.context.scope_1kqd4haeckr.row)\n}"
|
||||
},
|
||||
"modifiers": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "1e8ewprm6ts",
|
||||
"name": "XAction",
|
||||
"from": "@vtj/ui",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"slot": {
|
||||
"name": "actions",
|
||||
"params": []
|
||||
},
|
||||
"children": [],
|
||||
"props": {
|
||||
"mode": "icon",
|
||||
"size": "default",
|
||||
"type": "primary",
|
||||
"label": "设置"
|
||||
},
|
||||
"directives": [],
|
||||
"events": {
|
||||
"click": {
|
||||
"name": "click",
|
||||
"handler": {
|
||||
"type": "JSFunction",
|
||||
"value": "() => {\n this.rowAction(this.context.scope_1kqd4haeckr.row)\n}"
|
||||
},
|
||||
"modifiers": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "2a1cq8bhwej",
|
||||
"name": "XAction",
|
||||
"from": "@vtj/ui",
|
||||
"invisible": false,
|
||||
"locked": false,
|
||||
"slot": {
|
||||
"name": "actions",
|
||||
"params": []
|
||||
},
|
||||
"children": [],
|
||||
"props": {
|
||||
"mode": "icon",
|
||||
"size": "default",
|
||||
"type": "danger",
|
||||
"label": "删除"
|
||||
},
|
||||
"directives": [],
|
||||
"events": {
|
||||
"click": {
|
||||
"name": "click",
|
||||
"handler": {
|
||||
"type": "JSFunction",
|
||||
"value": "async () => {\n const ret = await this.$confirm('确定删除?', '提示', { type: 'warning' }).catch(() => false);\n if (ret) {\n this.rowAction(this.context.scope_1kqd4haeckr.row)\n }\n}"
|
||||
},
|
||||
"modifiers": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"ref": "gridRef",
|
||||
"pager": true,
|
||||
"height": "auto",
|
||||
"loader": {
|
||||
"type": "JSExpression",
|
||||
"value": "this.loader"
|
||||
},
|
||||
"columns": {
|
||||
"type": "JSExpression",
|
||||
"value": "this.columns.value"
|
||||
},
|
||||
"resizable": true,
|
||||
"customable": true,
|
||||
"style": {
|
||||
"background-color": "#FFFFFF",
|
||||
"padding-top": "10px",
|
||||
"padding-left": "10px",
|
||||
"padding-right": "10px",
|
||||
"padding-bottom": "10px",
|
||||
"border-radius": "4px 4px 4px 4px"
|
||||
}
|
||||
},
|
||||
"directives": [],
|
||||
"events": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,179 @@
|
|||
{
|
||||
"__VTJ_PROJECT__": true,
|
||||
"id": "vue-element-plus-admin",
|
||||
"name": "ElementAdmin",
|
||||
"homepage": "",
|
||||
"description": "一套基于vue3、element-plus、typesScript、vite4的后台集成方案。",
|
||||
"dependencies": [
|
||||
{
|
||||
"package": "vue",
|
||||
"version": "latest",
|
||||
"library": "Vue",
|
||||
"urls": ["@vtj/materials/deps/vue/vue.global.prod.js"],
|
||||
"assetsLibrary": "VueMaterial",
|
||||
"required": true,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "vue-router",
|
||||
"version": "latest",
|
||||
"library": "VueRouter",
|
||||
"urls": ["@vtj/materials/deps/vue-router/vue-router.global.prod.js"],
|
||||
"assetsLibrary": "VueRouterMaterial",
|
||||
"required": true,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "@vtj/utils",
|
||||
"version": "latest",
|
||||
"library": "VtjUtils",
|
||||
"urls": ["@vtj/materials/deps/@vtj/utils/index.umd.js"],
|
||||
"required": true,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "@vtj/icons",
|
||||
"version": "latest",
|
||||
"library": "VtjIcons",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/@vtj/icons/style.css",
|
||||
"@vtj/materials/deps/@vtj/icons/index.umd.js"
|
||||
],
|
||||
"required": true,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "@vueuse/core",
|
||||
"version": "latest",
|
||||
"library": "VueUse",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/@vueuse/shared/index.iife.min.js",
|
||||
"@vtj/materials/deps/@vueuse/core/index.iife.min.js"
|
||||
],
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "element-plus",
|
||||
"version": "latest",
|
||||
"library": "ElementPlus",
|
||||
"localeLibrary": "ElementPlusLocaleZhCn",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/element-plus/dark/css-vars.css",
|
||||
"@vtj/materials/deps/element-plus/index.css",
|
||||
"@vtj/materials/deps/element-plus/zh-cn.js",
|
||||
"@vtj/materials/deps/element-plus/index.full.min.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/element/index.umd.js",
|
||||
"assetsLibrary": "ElementPlusMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "@vtj/ui",
|
||||
"version": "latest",
|
||||
"library": "VtjUI",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/vxe-table/style.min.css",
|
||||
"@vtj/materials/deps/@vtj/ui/style.css",
|
||||
"@vtj/materials/deps/xe-utils/xe-utils.umd.min.js",
|
||||
"@vtj/materials/deps/vxe-table/index.umd.min.js",
|
||||
"@vtj/materials/deps/@vtj/ui/index.umd.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/ui/index.umd.js",
|
||||
"assetsLibrary": "VtjUIMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "@vtj/charts",
|
||||
"version": "latest",
|
||||
"library": "VtjCharts",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/echarts/echarts.min.js",
|
||||
"@vtj/materials/deps/@vtj/charts/index.umd.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/charts/index.umd.js",
|
||||
"assetsLibrary": "VtjChartsMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "ant-design-vue",
|
||||
"version": "latest",
|
||||
"library": "antd",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/ant-design-vue/reset.css",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/dayjs.min.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/customParseFormat.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/weekday.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/localeData.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/weekOfYear.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/weekYear.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/advancedFormat.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/quarterOfYear.js",
|
||||
"@vtj/materials/deps/ant-design-vue/antd.min.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/antdv/index.umd.js",
|
||||
"assetsLibrary": "AntdvMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"package": "vant",
|
||||
"version": "latest",
|
||||
"library": "vant",
|
||||
"urls": ["@vtj/materials/deps/vant/index.css", "@vtj/materials/deps/vant/vant.min.js"],
|
||||
"assetsUrl": "@vtj/materials/assets/vant/index.umd.js",
|
||||
"assetsLibrary": "VantMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": false
|
||||
}
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"dir": true,
|
||||
"name": "System",
|
||||
"title": "系统管理",
|
||||
"icon": "ChromeFilled",
|
||||
"hidden": false,
|
||||
"prue": false,
|
||||
"id": "45rmet3ni",
|
||||
"type": "page",
|
||||
"children": [
|
||||
{
|
||||
"dir": false,
|
||||
"name": "Users",
|
||||
"title": "用户管理",
|
||||
"icon": "",
|
||||
"mask": true,
|
||||
"hidden": false,
|
||||
"raw": false,
|
||||
"prue": false,
|
||||
"meta": "",
|
||||
"cache": false,
|
||||
"id": "7pdk4mxyf",
|
||||
"type": "page",
|
||||
"market": {
|
||||
"id": "0290db4d-f64e-4119-b62d-1e0b56193d6f"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"blocks": [],
|
||||
"apis": [],
|
||||
"meta": [],
|
||||
"config": {},
|
||||
"__BASE_PATH__": "/"
|
||||
}
|
||||
|
|
@ -0,0 +1,224 @@
|
|||
{
|
||||
"__VTJ_PROJECT__": true,
|
||||
"id": "yudao-ui-admin-vue3",
|
||||
"platform": "web",
|
||||
"name": "YudaoAdmin",
|
||||
"homepage": "",
|
||||
"description": "基于vue3、vite4、element-plus、typesScript",
|
||||
"dependencies": [
|
||||
{
|
||||
"package": "vue",
|
||||
"version": "latest",
|
||||
"library": "Vue",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/vue/vue.global.prod.js"
|
||||
],
|
||||
"assetsLibrary": "VueMaterial",
|
||||
"required": true,
|
||||
"official": true,
|
||||
"enabled": true,
|
||||
"platform": [
|
||||
"web",
|
||||
"h5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"package": "vue-router",
|
||||
"version": "latest",
|
||||
"library": "VueRouter",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/vue-router/vue-router.global.prod.js"
|
||||
],
|
||||
"assetsLibrary": "VueRouterMaterial",
|
||||
"required": true,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "@vtj/utils",
|
||||
"version": "latest",
|
||||
"library": "VtjUtils",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/@vtj/utils/index.umd.js"
|
||||
],
|
||||
"required": true,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "@vtj/icons",
|
||||
"version": "latest",
|
||||
"library": "VtjIcons",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/@vtj/icons/style.css",
|
||||
"@vtj/materials/deps/@vtj/icons/index.umd.js"
|
||||
],
|
||||
"required": true,
|
||||
"official": true,
|
||||
"enabled": true,
|
||||
"platform": [
|
||||
"web",
|
||||
"h5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"package": "@vueuse/core",
|
||||
"version": "latest",
|
||||
"library": "VueUse",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/@vueuse/shared/index.iife.min.js",
|
||||
"@vtj/materials/deps/@vueuse/core/index.iife.min.js"
|
||||
],
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true,
|
||||
"platform": [
|
||||
"web",
|
||||
"h5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"package": "element-plus",
|
||||
"version": "latest",
|
||||
"library": "ElementPlus",
|
||||
"localeLibrary": "ElementPlusLocaleZhCn",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/element-plus/dark/css-vars.css",
|
||||
"@vtj/materials/deps/element-plus/index.css",
|
||||
"@vtj/materials/deps/element-plus/zh-cn.js",
|
||||
"@vtj/materials/deps/element-plus/index.full.min.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/element/index.umd.js",
|
||||
"assetsLibrary": "ElementPlusMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true,
|
||||
"platform": "web"
|
||||
},
|
||||
{
|
||||
"package": "@vtj/ui",
|
||||
"version": "latest",
|
||||
"library": "VtjUI",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/vxe-table/style.min.css",
|
||||
"@vtj/materials/deps/@vtj/ui/style.css",
|
||||
"@vtj/materials/deps/xe-utils/xe-utils.umd.min.js",
|
||||
"@vtj/materials/deps/vxe-table/index.umd.min.js",
|
||||
"@vtj/materials/deps/@vtj/ui/index.umd.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/ui/index.umd.js",
|
||||
"assetsLibrary": "VtjUIMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true,
|
||||
"platform": "web"
|
||||
},
|
||||
{
|
||||
"package": "ant-design-vue",
|
||||
"version": "latest",
|
||||
"library": "antd",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/ant-design-vue/reset.css",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/dayjs.min.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/customParseFormat.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/weekday.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/localeData.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/weekOfYear.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/weekYear.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/advancedFormat.js",
|
||||
"@vtj/materials/deps/ant-design-vue/dayjs/plugin/quarterOfYear.js",
|
||||
"@vtj/materials/deps/ant-design-vue/antd.min.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/antdv/index.umd.js",
|
||||
"assetsLibrary": "AntdvMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": false,
|
||||
"platform": [
|
||||
"web"
|
||||
]
|
||||
},
|
||||
{
|
||||
"package": "@vtj/charts",
|
||||
"version": "latest",
|
||||
"library": "VtjCharts",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/echarts/echarts.min.js",
|
||||
"@vtj/materials/deps/@vtj/charts/index.umd.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/charts/index.umd.js",
|
||||
"assetsLibrary": "VtjChartsMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true,
|
||||
"platform": [
|
||||
"web",
|
||||
"h5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"package": "mockjs",
|
||||
"version": "latest",
|
||||
"library": "Mock",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/mockjs/mock-min.js"
|
||||
],
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"package": "vant",
|
||||
"version": "latest",
|
||||
"library": "vant",
|
||||
"urls": [
|
||||
"@vtj/materials/deps/vant/index.css",
|
||||
"@vtj/materials/deps/vant/vant.min.js"
|
||||
],
|
||||
"assetsUrl": "@vtj/materials/assets/vant/index.umd.js",
|
||||
"assetsLibrary": "VantMaterial",
|
||||
"required": false,
|
||||
"official": true,
|
||||
"enabled": false
|
||||
}
|
||||
],
|
||||
"pages": [
|
||||
{
|
||||
"dir": true,
|
||||
"name": "System",
|
||||
"title": "系统管理",
|
||||
"icon": "ChromeFilled",
|
||||
"hidden": false,
|
||||
"prue": false,
|
||||
"id": "45rmet3ni",
|
||||
"type": "page",
|
||||
"children": [
|
||||
{
|
||||
"dir": false,
|
||||
"name": "Users",
|
||||
"title": "用户管理",
|
||||
"icon": "",
|
||||
"mask": true,
|
||||
"hidden": false,
|
||||
"raw": false,
|
||||
"prue": false,
|
||||
"meta": "",
|
||||
"cache": false,
|
||||
"id": "7pdk4mxyf",
|
||||
"type": "page",
|
||||
"market": {
|
||||
"id": "0290db4d-f64e-4119-b62d-1e0b56193d6f"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"blocks": [],
|
||||
"apis": [],
|
||||
"meta": [],
|
||||
"config": {
|
||||
"title": ""
|
||||
},
|
||||
"uniConfig": {},
|
||||
"__BASE_PATH__": "/index"
|
||||
}
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
<template>
|
||||
<XGrid
|
||||
ref="gridRef"
|
||||
:pager="true"
|
||||
height="auto"
|
||||
:loader="loader"
|
||||
:columns="columns"
|
||||
:resizable="true"
|
||||
:customable="true"
|
||||
class="XGrid_1kqd4haeckr">
|
||||
<template #toolbar__buttons="scope_1kqd4haeckr">
|
||||
<ElInput
|
||||
v-model:modelValue="state.keyword"
|
||||
placeholder="请输入查询关键字"
|
||||
class="ElInput_1mp9b7mk9wj">
|
||||
<template #append="scope_1mp9b7mk9wj">
|
||||
<ElButton type="primary" @click="search"> 查询</ElButton>
|
||||
</template></ElInput
|
||||
>
|
||||
<ElButton
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@click="
|
||||
(...args: any[]) => click_2ammdsu07o6({ scope_1kqd4haeckr }, args)
|
||||
">
|
||||
新增</ElButton
|
||||
>
|
||||
<ElButton
|
||||
icon="Delete"
|
||||
type="danger"
|
||||
@click="
|
||||
(...args: any[]) => click_257nvaelda4({ scope_1kqd4haeckr }, args)
|
||||
">
|
||||
批量删除</ElButton
|
||||
>
|
||||
</template>
|
||||
<template #isDefault="scope_1kqd4haeckr">
|
||||
<ElTag :type="scope_1kqd4haeckr.row.isDefault ? 'success' : 'info'">
|
||||
{{ scope_1kqd4haeckr.row.isDefault ? '是' : '否' }}</ElTag
|
||||
>
|
||||
</template>
|
||||
<template #actions="scope_1kqd4haeckr">
|
||||
<XAction
|
||||
mode="icon"
|
||||
size="default"
|
||||
type="primary"
|
||||
label="编辑"
|
||||
@click="
|
||||
(...args: any[]) => click_1ft4np8i6i1({ scope_1kqd4haeckr }, args)
|
||||
"></XAction>
|
||||
<XAction
|
||||
mode="icon"
|
||||
size="default"
|
||||
type="primary"
|
||||
label="设置"
|
||||
@click="
|
||||
(...args: any[]) => click_1e8ewprm6ts({ scope_1kqd4haeckr }, args)
|
||||
"></XAction>
|
||||
<XAction
|
||||
mode="icon"
|
||||
size="default"
|
||||
type="danger"
|
||||
label="删除"
|
||||
@click="
|
||||
(...args: any[]) => click_2a1cq8bhwej({ scope_1kqd4haeckr }, args)
|
||||
"></XAction> </template
|
||||
></XGrid>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
// @ts-nocheck
|
||||
import { defineComponent, reactive } from 'vue';
|
||||
import { XGrid, XAction } from '@vtj/ui';
|
||||
import { ElInput, ElButton, ElTag } from 'element-plus';
|
||||
import { useProvider } from '@vtj/renderer';
|
||||
export default defineComponent({
|
||||
name: 'Users',
|
||||
components: { XGrid, ElInput, ElButton, ElTag, XAction },
|
||||
setup(props) {
|
||||
const provider = useProvider({ id: '7pdk4mxyf', version: '1736401534792' });
|
||||
const state = reactive<Record<string, any>>({ keyword: '' });
|
||||
return { state, props, provider };
|
||||
},
|
||||
computed: {
|
||||
columns() {
|
||||
return [
|
||||
{
|
||||
type: 'checkbox',
|
||||
width: 40
|
||||
},
|
||||
{
|
||||
type: 'seq',
|
||||
width: 60,
|
||||
title: '序号'
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '名称',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
field: 'label',
|
||||
title: '描述',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
field: 'isDefault',
|
||||
title: '默认角色',
|
||||
minWidth: 100,
|
||||
slots: {
|
||||
default: 'isDefault'
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'order',
|
||||
title: '排序',
|
||||
minWidth: 100,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'desc',
|
||||
title: '备注',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
field: 'createdAt',
|
||||
title: '创建时间',
|
||||
minWidth: 140
|
||||
},
|
||||
{
|
||||
field: 'actions',
|
||||
title: '操作',
|
||||
width: 160,
|
||||
slots: {
|
||||
default: 'actions'
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getData(...args: any[]) {
|
||||
const mock = this.provider.createMock((params) => {
|
||||
const { page = 1, pageSize = 50 } = params || {};
|
||||
const total = 1000;
|
||||
return {
|
||||
[`list|${pageSize}`]: [
|
||||
{
|
||||
id: '@guid',
|
||||
name: '@cname',
|
||||
label: '@ctitle',
|
||||
'isDefault|1': '@boolean',
|
||||
'order|+1': 1,
|
||||
desc: '@cparagraph',
|
||||
createdAt: '@date(yyyy-MM-dd hh:mm:ss)'
|
||||
}
|
||||
],
|
||||
total,
|
||||
page,
|
||||
limit: pageSize
|
||||
};
|
||||
});
|
||||
return await mock.apply(this, args);
|
||||
},
|
||||
click_2ammdsu07o6({ scope_1kqd4haeckr }, args) {
|
||||
return (() => {
|
||||
this.$message.info('click add button');
|
||||
}).apply(this, args);
|
||||
},
|
||||
click_257nvaelda4({ scope_1kqd4haeckr }, args) {
|
||||
return (() => {
|
||||
const rows = this.$refs.gridRef.getSelected();
|
||||
if (rows.length) {
|
||||
this.$message.info('delete data rows: ' + rows.length);
|
||||
} else {
|
||||
this.$message.warning('请选择需要删除的数据项');
|
||||
}
|
||||
}).apply(this, args);
|
||||
},
|
||||
click_1ft4np8i6i1({ scope_1kqd4haeckr }, args) {
|
||||
return (() => {
|
||||
this.rowAction(scope_1kqd4haeckr.row);
|
||||
}).apply(this, args);
|
||||
},
|
||||
click_1e8ewprm6ts({ scope_1kqd4haeckr }, args) {
|
||||
return (() => {
|
||||
this.rowAction(scope_1kqd4haeckr.row);
|
||||
}).apply(this, args);
|
||||
},
|
||||
click_2a1cq8bhwej({ scope_1kqd4haeckr }, args) {
|
||||
return (async () => {
|
||||
const ret = await this.$confirm('确定删除?', '提示', {
|
||||
type: 'warning'
|
||||
}).catch(() => false);
|
||||
if (ret) {
|
||||
this.rowAction(scope_1kqd4haeckr.row);
|
||||
}
|
||||
}).apply(this, args);
|
||||
},
|
||||
loader(data) {
|
||||
return this.getData(data);
|
||||
},
|
||||
search() {
|
||||
this.$refs.gridRef.search();
|
||||
},
|
||||
rowAction(row) {
|
||||
this.$message.info('click row id: ' + row.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.XGrid_1kqd4haeckr {
|
||||
background-color: #ffffff;
|
||||
padding-top: 10px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
}
|
||||
|
||||
.ElInput_1mp9b7mk9wj {
|
||||
width: 300px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
import { resolve } from 'path';
|
||||
import Vue from '@vitejs/plugin-vue';
|
||||
import VueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import progress from 'vite-plugin-progress';
|
||||
import EslintPlugin from 'vite-plugin-eslint';
|
||||
// import PurgeIcons from 'vite-plugin-purge-icons';
|
||||
import { ViteEjsPlugin } from 'vite-plugin-ejs';
|
||||
// @ts-ignore
|
||||
import ElementPlus from 'unplugin-element-plus/vite';
|
||||
import AutoImport from 'unplugin-auto-import/vite';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
||||
import viteCompression from 'vite-plugin-compression';
|
||||
import topLevelAwait from 'vite-plugin-top-level-await';
|
||||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
|
||||
import UnoCSS from 'unocss/vite';
|
||||
|
||||
export function createVitePlugins() {
|
||||
const root = process.cwd();
|
||||
|
||||
// 路径查找
|
||||
function pathResolve(dir) {
|
||||
return resolve(root, '.', dir);
|
||||
}
|
||||
|
||||
return [
|
||||
Vue(),
|
||||
VueJsx(),
|
||||
UnoCSS(),
|
||||
progress(),
|
||||
// PurgeIcons(),
|
||||
ElementPlus({}),
|
||||
AutoImport({
|
||||
include: [
|
||||
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
|
||||
/\.vue$/,
|
||||
/\.vue\?vue/, // .vue
|
||||
/\.md$/ // .md
|
||||
],
|
||||
imports: [
|
||||
'vue',
|
||||
'vue-router',
|
||||
// 可额外添加需要 autoImport 的组件
|
||||
{
|
||||
'@/hooks/web/useI18n': ['useI18n'],
|
||||
'@/hooks/web/useMessage': ['useMessage'],
|
||||
'@/hooks/web/useTable': ['useTable'],
|
||||
'@/hooks/web/useCrudSchemas': ['useCrudSchemas'],
|
||||
'@/utils/formRules': ['required'],
|
||||
'@/utils/dict': ['DICT_TYPE']
|
||||
}
|
||||
],
|
||||
dts: 'src/types/auto-imports.d.ts',
|
||||
resolvers: [ElementPlusResolver()],
|
||||
eslintrc: {
|
||||
enabled: false, // Default `false`
|
||||
filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
|
||||
globalsPropValue: true // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable')
|
||||
}
|
||||
}),
|
||||
Components({
|
||||
// 生成自定义 `auto-components.d.ts` 全局声明
|
||||
dts: 'src/types/auto-components.d.ts',
|
||||
// 自定义组件的解析器
|
||||
resolvers: [ElementPlusResolver()],
|
||||
globs: ["src/components/**/**.{vue, md}", '!src/components/DiyEditor/components/mobile/**']
|
||||
}),
|
||||
EslintPlugin({
|
||||
cache: false,
|
||||
include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件
|
||||
}),
|
||||
VueI18nPlugin({
|
||||
runtimeOnly: true,
|
||||
compositionOnly: true,
|
||||
include: [resolve(__dirname, 'src/locales/**')]
|
||||
}),
|
||||
createSvgIconsPlugin({
|
||||
iconDirs: [pathResolve('src/assets/svgs')],
|
||||
symbolId: 'icon-[dir]-[name]',
|
||||
svgoOptions: true
|
||||
}),
|
||||
viteCompression({
|
||||
verbose: true, // 是否在控制台输出压缩结果
|
||||
disable: false, // 是否禁用
|
||||
threshold: 10240, // 体积大于 threshold 才会被压缩,单位 b
|
||||
algorithm: 'gzip', // 压缩算法,可选 [ 'gzip' , 'brotliCompress' ,'deflate' , 'deflateRaw']
|
||||
ext: '.gz', // 生成的压缩包后缀
|
||||
deleteOriginFile: false //压缩后是否删除源文件
|
||||
}),
|
||||
ViteEjsPlugin(),
|
||||
topLevelAwait({
|
||||
// https://juejin.cn/post/7152191742513512485
|
||||
// The export name of top-level await promise for each chunk module
|
||||
promiseExportName: '__tla',
|
||||
// The function to generate import names of top-level await promise in each chunk module
|
||||
promiseImportName: (i) => `__tla_${i}`
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
const include = [
|
||||
'qs',
|
||||
'url',
|
||||
'vue',
|
||||
'sass',
|
||||
'mitt',
|
||||
'axios',
|
||||
'pinia',
|
||||
'dayjs',
|
||||
'qrcode',
|
||||
'unocss',
|
||||
'vue-router',
|
||||
'vue-types',
|
||||
'vue-i18n',
|
||||
'crypto-js',
|
||||
'cropperjs',
|
||||
'lodash-es',
|
||||
'nprogress',
|
||||
'web-storage-cache',
|
||||
// '@iconify/iconify',
|
||||
'@vueuse/core',
|
||||
'@zxcvbn-ts/core',
|
||||
'echarts/core',
|
||||
'echarts/charts',
|
||||
'echarts/components',
|
||||
'echarts/renderers',
|
||||
'echarts-wordcloud',
|
||||
'@wangeditor/editor',
|
||||
'@wangeditor/editor-for-vue',
|
||||
'@microsoft/fetch-event-source',
|
||||
'markdown-it',
|
||||
'markmap-view',
|
||||
'markmap-lib',
|
||||
'markmap-toolbar',
|
||||
'highlight.js',
|
||||
'element-plus',
|
||||
'element-plus/es',
|
||||
'element-plus/es/locale/lang/zh-cn',
|
||||
'element-plus/es/locale/lang/en',
|
||||
'element-plus/es/components/avatar/style/css',
|
||||
'element-plus/es/components/space/style/css',
|
||||
'element-plus/es/components/backtop/style/css',
|
||||
'element-plus/es/components/form/style/css',
|
||||
'element-plus/es/components/radio-group/style/css',
|
||||
'element-plus/es/components/radio/style/css',
|
||||
'element-plus/es/components/checkbox/style/css',
|
||||
'element-plus/es/components/checkbox-group/style/css',
|
||||
'element-plus/es/components/switch/style/css',
|
||||
'element-plus/es/components/time-picker/style/css',
|
||||
'element-plus/es/components/date-picker/style/css',
|
||||
'element-plus/es/components/descriptions/style/css',
|
||||
'element-plus/es/components/descriptions-item/style/css',
|
||||
'element-plus/es/components/link/style/css',
|
||||
'element-plus/es/components/tooltip/style/css',
|
||||
'element-plus/es/components/drawer/style/css',
|
||||
'element-plus/es/components/dialog/style/css',
|
||||
'element-plus/es/components/checkbox-button/style/css',
|
||||
'element-plus/es/components/option-group/style/css',
|
||||
'element-plus/es/components/radio-button/style/css',
|
||||
'element-plus/es/components/cascader/style/css',
|
||||
'element-plus/es/components/color-picker/style/css',
|
||||
'element-plus/es/components/input-number/style/css',
|
||||
'element-plus/es/components/rate/style/css',
|
||||
'element-plus/es/components/select-v2/style/css',
|
||||
'element-plus/es/components/tree-select/style/css',
|
||||
'element-plus/es/components/slider/style/css',
|
||||
'element-plus/es/components/time-select/style/css',
|
||||
'element-plus/es/components/autocomplete/style/css',
|
||||
'element-plus/es/components/image-viewer/style/css',
|
||||
'element-plus/es/components/upload/style/css',
|
||||
'element-plus/es/components/col/style/css',
|
||||
'element-plus/es/components/form-item/style/css',
|
||||
'element-plus/es/components/alert/style/css',
|
||||
'element-plus/es/components/breadcrumb/style/css',
|
||||
'element-plus/es/components/select/style/css',
|
||||
'element-plus/es/components/input/style/css',
|
||||
'element-plus/es/components/breadcrumb-item/style/css',
|
||||
'element-plus/es/components/tag/style/css',
|
||||
'element-plus/es/components/pagination/style/css',
|
||||
'element-plus/es/components/table/style/css',
|
||||
'element-plus/es/components/table-v2/style/css',
|
||||
'element-plus/es/components/table-column/style/css',
|
||||
'element-plus/es/components/card/style/css',
|
||||
'element-plus/es/components/row/style/css',
|
||||
'element-plus/es/components/button/style/css',
|
||||
'element-plus/es/components/menu/style/css',
|
||||
'element-plus/es/components/sub-menu/style/css',
|
||||
'element-plus/es/components/menu-item/style/css',
|
||||
'element-plus/es/components/option/style/css',
|
||||
'element-plus/es/components/dropdown/style/css',
|
||||
'element-plus/es/components/dropdown-menu/style/css',
|
||||
'element-plus/es/components/dropdown-item/style/css',
|
||||
'element-plus/es/components/skeleton/style/css',
|
||||
'element-plus/es/components/skeleton/style/css',
|
||||
'element-plus/es/components/backtop/style/css',
|
||||
'element-plus/es/components/menu/style/css',
|
||||
'element-plus/es/components/sub-menu/style/css',
|
||||
'element-plus/es/components/menu-item/style/css',
|
||||
'element-plus/es/components/dropdown/style/css',
|
||||
'element-plus/es/components/tree/style/css',
|
||||
'element-plus/es/components/dropdown-menu/style/css',
|
||||
'element-plus/es/components/dropdown-item/style/css',
|
||||
'element-plus/es/components/badge/style/css',
|
||||
'element-plus/es/components/breadcrumb/style/css',
|
||||
'element-plus/es/components/breadcrumb-item/style/css',
|
||||
'element-plus/es/components/image/style/css',
|
||||
'element-plus/es/components/collapse-transition/style/css',
|
||||
'element-plus/es/components/timeline/style/css',
|
||||
'element-plus/es/components/timeline-item/style/css',
|
||||
'element-plus/es/components/collapse/style/css',
|
||||
'element-plus/es/components/collapse-item/style/css',
|
||||
'element-plus/es/components/button-group/style/css',
|
||||
'element-plus/es/components/text/style/css',
|
||||
'element-plus/es/components/segmented/style/css',
|
||||
'@element-plus/icons-vue',
|
||||
'element-plus/es/components/footer/style/css',
|
||||
'element-plus/es/components/empty/style/css',
|
||||
'element-plus/es/components/mention/style/css'
|
||||
];
|
||||
|
||||
// 排除 iconify 相关依赖,避免访问 githubusercontent.com
|
||||
const exclude = ['@iconify/json', '@iconify/iconify', '@purge-icons/generated'];
|
||||
|
||||
export { include, exclude };
|
||||
File diff suppressed because it is too large
Load Diff
30
package.json
30
package.json
|
|
@ -4,19 +4,23 @@
|
|||
"description": "基于vue3、vite4、element-plus、typesScript",
|
||||
"author": "xingyu",
|
||||
"private": false,
|
||||
"vtj": {
|
||||
"id": "yudao-ui-admin-vue3",
|
||||
"name": "YudaoAdmin"
|
||||
},
|
||||
"scripts": {
|
||||
"i": "pnpm install",
|
||||
"dev": "vite --mode env.local",
|
||||
"dev-server": "vite --mode dev",
|
||||
"dev": "pnpm vite --mode env.local --config vite.config.mjs",
|
||||
"dev-server": "pnpm vite --mode dev --config vite.config.mjs",
|
||||
"ts:check": "vue-tsc --noEmit",
|
||||
"build:local": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build",
|
||||
"build:dev": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode dev",
|
||||
"build:test": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode test",
|
||||
"build:stage": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode stage",
|
||||
"build:prod": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode prod",
|
||||
"serve:dev": "vite preview --mode dev",
|
||||
"serve:prod": "vite preview --mode prod",
|
||||
"preview": "pnpm build:local && vite preview",
|
||||
"build:local": "pnpm vite build --config vite.config.mjs",
|
||||
"build:dev": "pnpm vite build --mode dev --config vite.config.mjs",
|
||||
"build:test": "pnpm vite build --mode test --config vite.config.mjs",
|
||||
"build:stage": "pnpm vite build --mode stage --config vite.config.mjs",
|
||||
"build:prod": "pnpm vite build --mode prod --config vite.config.mjs",
|
||||
"serve:dev": "pnpm vite preview --mode dev --config vite.config.mjs",
|
||||
"serve:prod": "pnpm vite preview --mode prod --config vite.config.mjs",
|
||||
"preview": "pnpm build:local && pnpm vite preview --config vite.config.mjs",
|
||||
"clean": "npx rimraf node_modules",
|
||||
"clean:cache": "npx rimraf node_modules/.cache",
|
||||
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
|
||||
|
|
@ -31,6 +35,8 @@
|
|||
"@iconify/iconify": "^3.1.1",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@videojs-player/vue": "^1.0.0",
|
||||
"@vtj/icons": "^0.11.6",
|
||||
"@vtj/web": "^0.11.7",
|
||||
"@vueuse/core": "^10.9.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.10",
|
||||
|
|
@ -98,6 +104,8 @@
|
|||
"@vitejs/plugin-legacy": "^5.3.1",
|
||||
"@vitejs/plugin-vue": "^5.0.4",
|
||||
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
||||
"@vtj/cli": "^0.11.2",
|
||||
"@vtj/pro": "^0.11.7",
|
||||
"autoprefixer": "^10.4.17",
|
||||
"bpmn-js": "^17.9.2",
|
||||
"bpmn-js-properties-panel": "5.23.0",
|
||||
|
|
@ -122,7 +130,7 @@
|
|||
"stylelint-config-standard": "^36.0.0",
|
||||
"stylelint-order": "^6.0.4",
|
||||
"terser": "^5.28.1",
|
||||
"typescript": "5.3.3",
|
||||
"typescript": "5.8.2",
|
||||
"unocss": "^0.58.5",
|
||||
"unplugin-auto-import": "^0.16.7",
|
||||
"unplugin-element-plus": "^0.8.0",
|
||||
|
|
|
|||
8823
pnpm-lock.yaml
8823
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
20
src/main.ts
20
src/main.ts
|
|
@ -42,6 +42,12 @@ import Logger from '@/utils/Logger'
|
|||
|
||||
import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患
|
||||
|
||||
// 新增以下引用
|
||||
import { vtj } from '../package.json'
|
||||
import { setupElementAdmin } from '@vtj/web'
|
||||
import { IconsPlugin } from '@vtj/icons'
|
||||
import '@vtj/web/src/index.scss'
|
||||
|
||||
// 创建实例
|
||||
const setupAll = async () => {
|
||||
const app = createApp(App)
|
||||
|
|
@ -62,11 +68,19 @@ const setupAll = async () => {
|
|||
setupAuth(app)
|
||||
setupMountedFocus(app)
|
||||
|
||||
await router.isReady()
|
||||
|
||||
app.use(VueDOMPurifyHTML)
|
||||
|
||||
app.mount('#app')
|
||||
//注册图标
|
||||
app.use(IconsPlugin)
|
||||
|
||||
// 初始化vtj
|
||||
setupElementAdmin({
|
||||
id: vtj.id,
|
||||
app,
|
||||
ready: () => {
|
||||
app.mount('#app');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setupAll()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import type { App } from 'vue'
|
|||
import type { RouteRecordRaw } from 'vue-router'
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import remainingRouter from './modules/remaining'
|
||||
import { vtj } from '../../package.json'
|
||||
import { setupElementAdminRoutes } from '@vtj/web'
|
||||
|
||||
// 创建路由实例
|
||||
const router = createRouter({
|
||||
|
|
@ -21,7 +23,14 @@ export const resetRouter = (): void => {
|
|||
})
|
||||
}
|
||||
|
||||
export const setupRouter = (app: App<Element>) => {
|
||||
export const setupRouter = async (app: App<Element>) => {
|
||||
// 初始化路由
|
||||
await setupElementAdminRoutes({
|
||||
id: vtj.id,
|
||||
router,
|
||||
routes: remainingRouter,
|
||||
layout: null // 这里需要根据实际情况设置布局组件,如果没有可以设置为null
|
||||
});
|
||||
app.use(router)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,5 +39,5 @@
|
|||
"src/types/auto-imports.d.ts",
|
||||
"src/types/auto-components.d.ts"
|
||||
],
|
||||
"exclude": ["dist", "target", "node_modules"]
|
||||
"exclude": ["dist", "target", "node_modules", ".vtj"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
import { resolve } from 'path';
|
||||
import { loadEnv } from 'vite';
|
||||
import { createVitePlugins } from './build/vite/index.js';
|
||||
import { exclude, include } from "./build/vite/optimize.js";
|
||||
import { createDevTools } from '@vtj/pro/vite';
|
||||
|
||||
// 当前执行node命令时文件夹的地址(工作目录)
|
||||
const root = process.cwd();
|
||||
|
||||
// 路径查找
|
||||
function pathResolve(dir) {
|
||||
return resolve(root, '.', dir);
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default ({ command, mode }) => {
|
||||
let env = {};
|
||||
const isBuild = command === 'build';
|
||||
if (!isBuild) {
|
||||
env = loadEnv((process.argv[3] === '--mode' ? process.argv[4] : process.argv[3]), root);
|
||||
} else {
|
||||
env = loadEnv(mode, root);
|
||||
}
|
||||
return {
|
||||
base: env.VITE_BASE_PATH,
|
||||
root: root,
|
||||
// 服务端渲染
|
||||
server: {
|
||||
port: env.VITE_PORT, // 端口号
|
||||
host: "0.0.0.0",
|
||||
open: env.VITE_OPEN === 'true',
|
||||
// 本地跨域代理. 目前注释的原因:暂时没有用途,server 端已经支持跨域
|
||||
// proxy: {
|
||||
// ['/admin-api']: {
|
||||
// target: env.VITE_BASE_URL,
|
||||
// ws: false,
|
||||
// changeOrigin: true,
|
||||
// rewrite: (path) => path.replace(new RegExp(`^/admin-api`), ''),
|
||||
// },
|
||||
// },
|
||||
},
|
||||
// 项目使用的vite插件。 单独提取到build/vite/plugin中管理
|
||||
plugins: [createDevTools(), ...createVitePlugins()],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: '@use "@/styles/variables.scss" as *;',
|
||||
javascriptEnabled: true,
|
||||
silenceDeprecations: ["legacy-js-api"], // 参考自 https://stackoverflow.com/questions/78997907/the-legacy-js-api-is-deprecated-and-will-be-removed-in-dart-sass-2-0-0
|
||||
}
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.scss', '.css'],
|
||||
alias: [
|
||||
{
|
||||
find: 'vue-i18n',
|
||||
replacement: 'vue-i18n/dist/vue-i18n.cjs.js'
|
||||
},
|
||||
{
|
||||
find: /\@\//,
|
||||
replacement: `${pathResolve('src')}/`
|
||||
}
|
||||
]
|
||||
},
|
||||
build: {
|
||||
minify: 'terser',
|
||||
outDir: env.VITE_OUT_DIR || 'dist',
|
||||
sourcemap: env.VITE_SOURCEMAP === 'true' ? 'inline' : false,
|
||||
// brotliSize: false,
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_debugger: env.VITE_DROP_DEBUGGER === 'true',
|
||||
drop_console: env.VITE_DROP_CONSOLE === 'true'
|
||||
}
|
||||
},
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
echarts: ['echarts'] // 将 echarts 单独打包,参考 https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues/IAB1SX 讨论
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
optimizeDeps: {include, exclude}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ import type {ConfigEnv, UserConfig} from 'vite'
|
|||
import {loadEnv} from 'vite'
|
||||
import {createVitePlugins} from './build/vite'
|
||||
import {exclude, include} from "./build/vite/optimize"
|
||||
import { createDevTools } from '@vtj/pro/vite'
|
||||
// 当前执行node命令时文件夹的地址(工作目录)
|
||||
const root = process.cwd()
|
||||
|
||||
|
|
@ -39,7 +40,7 @@ export default ({command, mode}: ConfigEnv): UserConfig => {
|
|||
// },
|
||||
},
|
||||
// 项目使用的vite插件。 单独提取到build/vite/plugin中管理
|
||||
plugins: createVitePlugins(),
|
||||
plugins: [createDevTools(), ...createVitePlugins()],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
|
|
@ -84,3 +85,4 @@ export default ({command, mode}: ConfigEnv): UserConfig => {
|
|||
optimizeDeps: {include, exclude}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
vue-element-plus-admin
|
||||
vue-element-plus-admin 是一个基于 element-plus 免费开源的中后台模版。使用了最新的vue3,vite,TypeScript等主流技术开发,开箱即用的中后台前端解决方案,可以用来作为项目的启动模版,也可用于学习参考。并且时刻关注着最新技术动向,尽可能的第一时间更新。
|
||||
|
||||
介绍
|
||||
VTJ内置了集成方法, 集成示例代码:https://gitee.com/newgateway/vue-element-plus-admin
|
||||
|
||||
分支:dev-vtj
|
||||
|
||||
集成步骤
|
||||
一、添加依赖
|
||||
|
||||
npm i @vtj/cli @vtj/pro -D
|
||||
|
||||
npm i @vtj/web -S
|
||||
二、package.json
|
||||
在 package.json 文件添加vtj描述信息
|
||||
|
||||
|
||||
{
|
||||
"vtj": {
|
||||
"id": "vue-element-plus-admin",
|
||||
"name": "ElementAdmin"
|
||||
}
|
||||
}
|
||||
三、vite.config.ts
|
||||
在 vite.config.ts 文件引入vtj开发插件
|
||||
|
||||
|
||||
import { createDevTools } from '@vtj/pro/vite';
|
||||
|
||||
export default {
|
||||
plugins: [createDevTools()]
|
||||
};
|
||||
四、tsconfig.json
|
||||
在 tsconfig.json 添加 exclude .vtj 目录
|
||||
|
||||
|
||||
{
|
||||
"exclude": ["dist", "node_modules", ".vtj"]
|
||||
}
|
||||
五、.gitignore
|
||||
添加排除 .vtj/histories
|
||||
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
/dist*
|
||||
*-lock.*
|
||||
pnpm-debug
|
||||
stats.html
|
||||
.idea
|
||||
.vtj/histories
|
||||
五、src/main.ts
|
||||
程序入口文件改造
|
||||
|
||||
|
||||
// 新增以下引用
|
||||
import { vtj } from '../package.json';
|
||||
import { setupElementAdmin } from '@vtj/web';
|
||||
import { IconsPlugin } from '@vtj/icons';
|
||||
import '@vtj/web/src/index.scss';
|
||||
|
||||
// 改造setupAll函数
|
||||
const setupAll = async () => {
|
||||
const app = createApp(App);
|
||||
await setupI18n(app);
|
||||
setupStore(app);
|
||||
setupGlobCom(app);
|
||||
setupElementPlus(app);
|
||||
setupRouter(app);
|
||||
setupPermission(app);
|
||||
//注册图标
|
||||
app.use(IconsPlugin);
|
||||
// 初始化vtj
|
||||
setupElementAdmin({
|
||||
id: vtj.id,
|
||||
app,
|
||||
ready: () => {
|
||||
app.mount('#app');
|
||||
}
|
||||
});
|
||||
};
|
||||
六、src/router/index.ts
|
||||
改造静态路由文件
|
||||
|
||||
|
||||
// 引用
|
||||
import { vtj } from '../../package.json';
|
||||
import { setupElementAdminRoutes } from '@vtj/web';
|
||||
|
||||
// 改造 setupRouter
|
||||
export const setupRouter = async (app: App<Element>) => {
|
||||
// 初始化路由
|
||||
await setupElementAdminRoutes({
|
||||
id: vtj.id,
|
||||
router,
|
||||
routes: constantRouterMap,
|
||||
layout: Layout
|
||||
});
|
||||
app.use(router);
|
||||
};
|
||||
总结
|
||||
经过上述改造,项目在开发环境就内置了VTJ设计器。可以通过设计器完成页面的开发。
|
||||
|
||||
Loading…
Reference in New Issue