@huangzongxin/elpis 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  model配置
2
2
  {
3
- mode: 'dashboard', // 模版类型,不同模版类型对应不一样的模版数据结构
3
+ model: 'dashboard', // 模版类型,不同模版类型对应不一样的模版数据结构
4
4
  name: '', // 名称
5
5
  desc: '', // 描述
6
6
  icon: '', // icon
@@ -178,6 +178,3 @@ schema-form 控件扩展
178
178
  schema-search-bar 控件扩展
179
179
  在 app/widgets/schema-search-bar/complex-view 下写控件
180
180
  配置到 app/widgets/schema-search-bar/search-item-config.js
181
-
182
-
183
-
@@ -0,0 +1,5 @@
1
+ module.exports = (app) => {
2
+ const { db: dbConfig } = app.config;
3
+ if (!dbConfig) return;
4
+ return require("knex")(dbConfig);
5
+ };
@@ -5,6 +5,10 @@ const md5 = require("md5");
5
5
 
6
6
  module.exports = (app) => {
7
7
  return async (ctx, next) => {
8
+ // 校验白名单
9
+ if (app.config?.aipSignVerify.whiteList.includes(ctx.path)) {
10
+ return await next();
11
+ }
8
12
  // 只对api请求进行校验
9
13
  if (ctx.path.indexOf("/api") < 0) {
10
14
  return await next();
package/app/middleware.js CHANGED
@@ -4,6 +4,8 @@ const koaNunjucks = require("koa-nunjucks-2");
4
4
  module.exports = (app) => {
5
5
  // 配置静态根目录
6
6
  const koaStatic = require("koa-static");
7
+
8
+ app.use(koaStatic(path.resolve(__dirname, "./public")));
7
9
  app.use(koaStatic(path.resolve(process.cwd(), "./app/public")));
8
10
 
9
11
  // 加载模板引擎
@@ -13,15 +13,9 @@
13
13
  <el-row type="flex" align="middle" justify="end" class="setting-panel">
14
14
  <!-- 插槽:设置区域 -->
15
15
  <slot name="setting-content"></slot>
16
- <img src="./asserts/avatar.png" alt="" class="avatar">
17
- <el-dropdown @command="handleUserCommand">
18
- <span class="username">
19
- {{ userName }}<i class="el-icon-arrow-down elicon--right"></i>
20
- </span>
21
- <template #dropdown>
22
- <el-dropdown-item command="logout">退出登录</el-dropdown-item>
23
- </template>
24
- </el-dropdown>
16
+ <!-- 插槽:用户面板 -->
17
+ <component v-if="BusinessHeaderConfig?.userPanel" :is="BusinessHeaderConfig.userPanel.component"></component>
18
+
25
19
  </el-row>
26
20
  </el-row>
27
21
  </el-header>
@@ -33,15 +27,11 @@
33
27
  </template>
34
28
 
35
29
  <script setup>
36
- import { ref } from "vue";
30
+ import BusinessHeaderConfig from '$businessHeaderConfig'
37
31
  defineProps({
38
32
  title: String
39
33
  })
40
- const userName = ref('Kris')
41
- const handleUserCommand = function (event) {
42
- console.log(event);
43
34
 
44
- }
45
35
  </script>
46
36
 
47
37
  <style lang="less" scoped>
@@ -52,7 +42,7 @@ const handleUserCommand = function (event) {
52
42
 
53
43
  .header {
54
44
  max-height: 120px;
55
- border-bottom: 1px solid #E8E8E8;
45
+ border-bottom: 1px solid #E8E8E8;
56
46
 
57
47
  .header-row {
58
48
  height: 60px;
@@ -79,21 +69,7 @@ const handleUserCommand = function (event) {
79
69
  margin-left: auto;
80
70
  min-width: 180px;
81
71
 
82
- .avatar {
83
- margin-right: 12px;
84
- width: 30px;
85
- height: 30px;
86
- border-radius: 50%;
87
- }
88
72
 
89
- .username {
90
- font-size: 16px;
91
- font-weight: 500;
92
- cursor: pointer;
93
- height: 60px;
94
- line-height: 60px;
95
- outline: none;
96
- }
97
73
 
98
74
  }
99
75
  }
@@ -2,7 +2,7 @@
2
2
  <el-form v-if="schema && schema.properties" :inline="true" class="schema-search-bar">
3
3
  <!-- 动态组件 -->
4
4
  <el-form-item v-for="(schemaItem, key) in schema.properties" :key="key" :label="schemaItem.label">
5
- <component :ref="searchComList" :is="SearchItemConfig[schemaItem.option?.comType]?.component" :schemaKey="key"
5
+ <component ref="searchComList" :is="SearchItemConfig[schemaItem.option?.comType]?.component" :schemaKey="key"
6
6
  :schema="schemaItem" @loaded="handleChildLoaded" @reset="reset" />
7
7
  </el-form-item>
8
8
  <!-- 操作区域 -->
@@ -176,6 +176,15 @@ module.exports = merge.smart(
176
176
  ? businessSearchItemConfig
177
177
  : blankModulePath;
178
178
 
179
+ // 业务拓展 header-container 配置
180
+ const businessHeaderConfig = path.resolve(
181
+ process.cwd(),
182
+ "./app/pages/widgets/header-container/header-config.js",
183
+ );
184
+ aliasMap["$businessHeaderConfig"] = fs.existsSync(businessHeaderConfig)
185
+ ? businessHeaderConfig
186
+ : blankModulePath;
187
+
179
188
  return {
180
189
  vue: require.resolve("vue"),
181
190
  $elpisPages: path.resolve(__dirname, "../../pages"),
@@ -18,7 +18,7 @@ module.exports = () => {
18
18
  const compiler = webpack(webpackConfig);
19
19
 
20
20
  // 指定静态文件目录
21
- app.use(express.static(path.join(__dirname, "../public/dist")));
21
+ app.use(express.static(path.join(process.cwd(), "./app/public/dist")));
22
22
  // 引用 devMiddleware 中间件(监控文件改动)
23
23
  app.use(
24
24
  devMiddleware(compiler, {
@@ -30,7 +30,7 @@ module.exports = (app) => {
30
30
  ...require(path.resolve(businessConfigPath, `.${sep}config.default.js`)),
31
31
  };
32
32
  } catch (error) {
33
- console.error(`default config not found: ${businessConfigPath}`);
33
+ console.error(`[exception] default.config file exception`);
34
34
  }
35
35
  //获取 env.config
36
36
  let envConfig = {};
@@ -52,7 +52,7 @@ module.exports = (app) => {
52
52
  );
53
53
  }
54
54
  } catch (error) {
55
- console.error(`env config not found: ${businessConfigPath}`);
55
+ console.error(`[exception] default.config file exception`);
56
56
  }
57
57
  //合并配置
58
58
  app.config = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huangzongxin/elpis",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "elpis 一个企业级应用框架,通过全栈实现",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -15,13 +15,26 @@
15
15
  "license": "ISC",
16
16
  "dependencies": {
17
17
  "@babel/core": "^7.24.0",
18
+ "@babel/plugin-transform-runtime": "^7.1.0",
19
+ "@babel/preset-env": "^7.4.5",
18
20
  "@element-plus/icons-vue": "^2.3.2",
19
21
  "ajv": "^6.10.2",
20
22
  "axios": "^0.19.2",
23
+ "babel-loader": "^8.0.4",
24
+ "clean-webpack-plugin": "^0.1.19",
25
+ "consoler": "^0.2.0",
26
+ "cross-env": "^10.1.0",
27
+ "css-loader": "^0.23.1",
28
+ "css-minimizer-webpack-plugin": "^5.0.1",
29
+ "directory-named-webpack-plugin": "^4.0.1",
21
30
  "echarts": "^5.5.0",
22
31
  "element-plus": "^2.3.7",
32
+ "express": "^4.18.2",
33
+ "file-loader": "^6.2.0",
23
34
  "generate-password": "^1.7.1",
24
35
  "glob": "^7.1.4",
36
+ "html-webpack-inject-attributes-plugin": "^1.0.1",
37
+ "html-webpack-plugin": "^5.5.3",
25
38
  "jsonwebtoken": "^9.0.2",
26
39
  "knex": "^0.19.0",
27
40
  "koa": "2.7.0",
@@ -32,40 +45,27 @@
32
45
  "koa-useragent": "2.0.0",
33
46
  "koa2-cors": "^2.0.6",
34
47
  "less": "^3.8.1",
48
+ "less-loader": "^11.1.3",
35
49
  "lodash": "^4.17.21",
36
50
  "log4js": "^6.9.1",
37
51
  "md5": "^2.2.1",
52
+ "mini-css-extract-plugin": "^2.7.6",
38
53
  "moment": "^2.29.4",
39
54
  "mysql": "^2.18.1",
40
55
  "node-schedule": "^2.1.1",
41
56
  "nodemon": "^1.19.2",
42
57
  "path": "^0.12.7",
43
58
  "pinia": "^2.1.6",
44
- "superagent": "^8.1.2",
45
- "vue": "^3.5.32",
46
- "vue-json-viewer": "^3.0.4",
47
- "vue-router": "^4.2.4",
48
- "vuex": "^4.1.0",
49
- "@babel/plugin-transform-runtime": "^7.1.0",
50
- "@babel/preset-env": "^7.4.5",
51
- "babel-loader": "^8.0.4",
52
- "clean-webpack-plugin": "^0.1.19",
53
- "consoler": "^0.2.0",
54
- "cross-env": "^10.1.0",
55
- "css-loader": "^0.23.1",
56
- "css-minimizer-webpack-plugin": "^5.0.1",
57
- "directory-named-webpack-plugin": "^4.0.1",
58
- "express": "^4.18.2",
59
- "file-loader": "^6.2.0",
60
- "html-webpack-inject-attributes-plugin": "^1.0.1",
61
- "html-webpack-plugin": "^5.5.3",
62
- "less-loader": "^11.1.3",
63
- "mini-css-extract-plugin": "^2.7.6",
64
59
  "style-loader": "^0.14.1",
60
+ "superagent": "^8.1.2",
65
61
  "terser-webpack-plugin": "^5.0.0",
66
62
  "url-loader": "^4.1.1",
63
+ "vue": "^3.5.32",
64
+ "vue-json-viewer": "^3.0.4",
67
65
  "vue-loader": "^17.2.2",
66
+ "vue-router": "^4.2.4",
68
67
  "vue-style-loader": "^4.1.2",
68
+ "vuex": "^4.1.0",
69
69
  "webpack": "^5.88.1",
70
70
  "webpack-dev-middleware": "^6.1.1",
71
71
  "webpack-hot-middleware": "^2.25.4",