Browse Source

first commit

luobang 3 weeks ago
commit
c612ce9557

+ 1 - 0
.env.development

@@ -0,0 +1 @@
+VITE_API_PREFIX=/xgjl/

+ 1 - 0
.env.production

@@ -0,0 +1 @@
+VITE_API_PREFIX=/xgjl/

+ 1 - 0
.npmrc

@@ -0,0 +1 @@
+registry=https://registry.npmmirror.com/

+ 13 - 0
index.html

@@ -0,0 +1,13 @@
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>Vite + Vue</title>
+  </head>
+  <body>
+    <div id="app"></div>
+    <script type="module" src="/src/main.js"></script>
+  </body>
+</html>

+ 36 - 0
package.json

@@ -0,0 +1,36 @@
+{
+  "name": "my-vue-app8",
+  "private": true,
+  "version": "0.0.0",
+  "type": "module",
+  "scripts": {
+    "dev": "vite",
+    "build": "vite build --config node_modules/icore-frame/vite.config.js",
+    "preview": "vite preview"
+  },
+  "dependencies": {
+    "axios": "^1.7.9",
+    "css-color-function": "^1.3.3",
+    "element-plus": "^2.9.4",
+    "glob": "^11.0.1",
+    "icore-frame": "^0.0.1-ts.0.4",
+    "jssha": "^3.3.1",
+    "moment": "^2.30.1",
+    "object-assign": "^4.1.1",
+    "qrcode": "^1.3.2",
+    "vite-plugin-compression": "^0.5.1",
+    "vite-plugin-html": "^3.2.2",
+    "vue": "^3.5.13",
+    "vue-router": "^4.5.0",
+    "vue3-print-nb": "^0.1.4",
+    "vuex": "^4.1.0"
+  },
+  "devDependencies": {
+    "@element-plus/icons-vue": "^2.3.1",
+    "@vitejs/plugin-vue": "^5.2.1",
+    "less": "^4.2.2",
+    "query-string": "^9.1.1",
+    "unplugin-auto-import": "^19.1.0",
+    "vite": "^6.1.0"
+  }
+}

+ 1 - 0
public/vite.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

+ 43 - 0
src/assets/css/global.css

@@ -0,0 +1,43 @@
+/** 项目基础框架包中没有,但自己需要用到的全局样式 */
+.formitemwidth {width:130px}
+.formitemmiddlewidth {width:110px}
+
+.systemBase .el-table--striped .el-table__body tr.el-table__row--striped.current-row td,
+.systemBase .el-table__body tr.current-row > td {
+  background-color: rgb(0, 75, 92) !important;
+  color:  rgb(225, 235, 245) !important;
+  /* border-bottom: 1px solid rgb(0, 128, 255) !important; */
+ }
+
+ /** 不生效时的行显示 */
+ .el-table .error-row2 {
+  /**color: red;*/
+  background-color: red;
+ }
+
+ .common-title-div {
+  width: 100%;
+}
+
+ /**
+ *  author: lichao
+ *  date: 2025-01-08
+ *  description: 新增样式,当表格内容过长时的处理
+ */
+ .table-cell-content {
+  overflow-wrap: break-word;      /* 确保单词内换行 */
+  word-break: break-all;          /* 允许在任何字符间断 */
+  /**width: 200px; */              /* 设置最大宽度,根据需要调整 */
+  white-space: normal;            /* 允许换行 */
+}
+
+.searchForm .el-form-item {
+  margin-bottom: 0;
+}
+
+ /** 多个查询条件间距调整,覆盖elementplus中默认的32px */
+.el-form--inline .el-form-item {
+  margin-right: 20px;
+}
+
+

BIN
src/assets/img/icore-shown-all.png


BIN
src/assets/img/noImg.png


+ 1 - 0
src/assets/vue.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

+ 84 - 0
src/auto-imports.d.ts

@@ -0,0 +1,84 @@
+/* eslint-disable */
+/* prettier-ignore */
+// @ts-nocheck
+// noinspection JSUnusedGlobalSymbols
+// Generated by unplugin-auto-import
+// biome-ignore lint: disable
+export {}
+declare global {
+  const EffectScope: typeof import('vue')['EffectScope']
+  const computed: typeof import('vue')['computed']
+  const createApp: typeof import('vue')['createApp']
+  const createLogger: typeof import('vuex')['createLogger']
+  const createNamespacedHelpers: typeof import('vuex')['createNamespacedHelpers']
+  const createStore: typeof import('vuex')['createStore']
+  const customRef: typeof import('vue')['customRef']
+  const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
+  const defineComponent: typeof import('vue')['defineComponent']
+  const effectScope: typeof import('vue')['effectScope']
+  const getCurrentInstance: typeof import('vue')['getCurrentInstance']
+  const getCurrentScope: typeof import('vue')['getCurrentScope']
+  const h: typeof import('vue')['h']
+  const inject: typeof import('vue')['inject']
+  const isProxy: typeof import('vue')['isProxy']
+  const isReactive: typeof import('vue')['isReactive']
+  const isReadonly: typeof import('vue')['isReadonly']
+  const isRef: typeof import('vue')['isRef']
+  const mapActions: typeof import('vuex')['mapActions']
+  const mapGetters: typeof import('vuex')['mapGetters']
+  const mapMutations: typeof import('vuex')['mapMutations']
+  const mapState: typeof import('vuex')['mapState']
+  const markRaw: typeof import('vue')['markRaw']
+  const nextTick: typeof import('vue')['nextTick']
+  const onActivated: typeof import('vue')['onActivated']
+  const onBeforeMount: typeof import('vue')['onBeforeMount']
+  const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
+  const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
+  const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
+  const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
+  const onDeactivated: typeof import('vue')['onDeactivated']
+  const onErrorCaptured: typeof import('vue')['onErrorCaptured']
+  const onMounted: typeof import('vue')['onMounted']
+  const onRenderTracked: typeof import('vue')['onRenderTracked']
+  const onRenderTriggered: typeof import('vue')['onRenderTriggered']
+  const onScopeDispose: typeof import('vue')['onScopeDispose']
+  const onServerPrefetch: typeof import('vue')['onServerPrefetch']
+  const onUnmounted: typeof import('vue')['onUnmounted']
+  const onUpdated: typeof import('vue')['onUpdated']
+  const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
+  const provide: typeof import('vue')['provide']
+  const reactive: typeof import('vue')['reactive']
+  const readonly: typeof import('vue')['readonly']
+  const ref: typeof import('vue')['ref']
+  const resolveComponent: typeof import('vue')['resolveComponent']
+  const shallowReactive: typeof import('vue')['shallowReactive']
+  const shallowReadonly: typeof import('vue')['shallowReadonly']
+  const shallowRef: typeof import('vue')['shallowRef']
+  const toRaw: typeof import('vue')['toRaw']
+  const toRef: typeof import('vue')['toRef']
+  const toRefs: typeof import('vue')['toRefs']
+  const toValue: typeof import('vue')['toValue']
+  const triggerRef: typeof import('vue')['triggerRef']
+  const unref: typeof import('vue')['unref']
+  const useAttrs: typeof import('vue')['useAttrs']
+  const useCssModule: typeof import('vue')['useCssModule']
+  const useCssVars: typeof import('vue')['useCssVars']
+  const useId: typeof import('vue')['useId']
+  const useLink: typeof import('vue-router')['useLink']
+  const useModel: typeof import('vue')['useModel']
+  const useRoute: typeof import('vue-router')['useRoute']
+  const useRouter: typeof import('vue-router')['useRouter']
+  const useSlots: typeof import('vue')['useSlots']
+  const useStore: typeof import('vuex')['useStore']
+  const useTemplateRef: typeof import('vue')['useTemplateRef']
+  const watch: typeof import('vue')['watch']
+  const watchEffect: typeof import('vue')['watchEffect']
+  const watchPostEffect: typeof import('vue')['watchPostEffect']
+  const watchSyncEffect: typeof import('vue')['watchSyncEffect']
+}
+// for type re-export
+declare global {
+  // @ts-ignore
+  export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
+  import('vue')
+}

+ 43 - 0
src/components/HelloWorld.vue

@@ -0,0 +1,43 @@
+<script setup>
+import { ref } from 'vue'
+
+defineProps({
+  msg: String,
+})
+
+const count = ref(0)
+</script>
+
+<template>
+  <h1>{{ msg }}</h1>
+
+  <div class="card">
+    <button type="button" @click="count++">count is {{ count }}</button>
+    <p>
+      Edit
+      <code>components/HelloWorld.vue</code> to test HMR
+    </p>
+  </div>
+
+  <p>
+    Check out
+    <a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
+      >create-vue</a
+    >, the official Vue + Vite starter
+  </p>
+  <p>
+    Learn more about IDE Support for Vue in the
+    <a
+      href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
+      target="_blank"
+      >Vue Docs Scaling up Guide</a
+    >.
+  </p>
+  <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
+</template>
+
+<style scoped>
+.read-the-docs {
+  color: #888;
+}
+</style>

+ 42 - 0
vite.base.config.js

@@ -0,0 +1,42 @@
+import { defineConfig } from 'vite'
+import vue from '@vitejs/plugin-vue'
+import path from 'path';
+import { glob }  from 'glob';
+import { createHtmlPlugin } from 'vite-plugin-html';
+import AutoImport from 'unplugin-auto-import/vite';
+
+
+const pathSrc = path.resolve(__dirname, './src'); // F:\webui\multiple-pages\demo\src
+const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应用下
+
+// 模拟 utils.assetsPath 函数
+const assetsPath = (dir) => path.posix.join('static', dir);
+
+export default defineConfig({
+  /** 
+  plugins: [
+    vue(),
+    
+    AutoImport({
+      imports: ['vue','vuex','vue-router'],
+      dts: 'src/auto-imports.d.ts'
+    }),    
+    createHtmlPlugin({
+      minify: false,
+    })
+  ],*/
+  // 模块解析配置
+  resolve: {
+    // 配置路径别名
+    alias: {
+        '@': path.resolve(__dirname, './node_modules/icore-frame/src'),  // 指向基础包
+        '~': path.resolve(__dirname, './src') // 指向当前目录
+    },
+    // 导入时想要省略的扩展名列表
+    extensions: ['.js', '.json', '.vue']
+  },
+ // root:'./',
+  root: process.cwd(),
+  //root:path.resolve(__dirname + '/node_modules/my-vue-app'),
+  base: '/'
+})

+ 22 - 0
vite.config.js

@@ -0,0 +1,22 @@
+import { defineConfig } from "vite";
+import viteBaseConfig from "./vite.base.config";
+//import viteProdConfig from "./vite.prod.config";
+import viteDevConfig from "./vite.dev.config";
+
+// 通过策略模式返回对应的配置fsdfdsfdshttp://localhost:3001/views/index.htmlhttp://localhost:3001/views/index.html
+const envResolver = {
+    /** 
+    "build": () => {
+        return ({...viteBaseConfig, ...viteProdConfig});
+    }, */
+    "serve": () => {
+      var config = {...viteBaseConfig, ...viteDevConfig};
+      return ({...viteBaseConfig, ...viteDevConfig});
+    }
+    /*"test": () => Object.assign({}, viteBaseConfig, viteTestConfig)*/
+}
+
+export default defineConfig(({command}) => {
+    // command 的类型为 "build" | "server" | "test"
+    return envResolver[command]();
+})

+ 101 - 0
vite.dev.config.js

@@ -0,0 +1,101 @@
+import {defineConfig} from "vite";
+import path from 'path';
+import vue from '@vitejs/plugin-vue'
+import AutoImport from 'unplugin-auto-import/vite';
+import { createHtmlPlugin } from 'vite-plugin-html';
+
+export default defineConfig({
+   publicDir: path.resolve(__dirname + '/node_modules/icore-frame', './public'),  // 将my-vue-app目录下的public文件复制到dist目录下
+	 // 开发服务器配置
+   server: {
+    // 服务器主机名,如果允许外部访问,可设置为 '0.0.0.0'
+    host: '0.0.0.0',
+    // 开发环境服务器端口号
+    port: 3000,
+    proxy: {
+      '/xgjl/pass/auth': {
+        //target: 'http://sso.steerinfo.com/auth',
+        //target: 'http://sso.steerinfo.com/auth',
+        target:'http://192.168.3.33/xgjl/pass/auth',
+        changeOrigin: true,
+        /**
+        pathRewrite: {
+          '^/icore.icp.web/pass/auth': '/'
+        } */
+        rewrite: (path) => path.replace(/^\/xgjl\/pass\/auth/, '/')
+      },
+      '/xgjl/pass/v1': {
+        //target: 'http://sso.steerinfo.com/v1',
+        target:'http://192.168.3.33/xgjl/pass/v1',
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/xgjl\/pass\/v1/, '/')
+      },     
+      '/xgjl/pass/logout': {
+        //target: 'http://sso.steerinfo.com/logout',
+        target:'http://192.168.3.33/xgjl/pass/logout',
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/xgjl\/pass\/logout/, '/')
+      },
+      '/xgjl/pass/systemBase/v1': {
+        target: 'http://192.168.3.33/xgjl/pass/systemBase/v1',
+        //target: 'http://localhost:9004/v1',
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/xgjl\/pass\/systemBase\/v1/, '/')
+      },      
+      /** 
+      '/views/' : {
+        target: 'http://localhost:3000/node_modules/my-vue-app/views/',
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/views/, '/')
+      }  */
+      /** 
+      '/views/': {
+        target: 'http://127.0.0.1:3000', // 目标地址,这里设置为本地地址,因为是重定向到本地的不同路径
+        changeOrigin: true,
+        rewrite: (path) => {
+            const pattern = /^\/views\/(?!(index|systemConfig)\.html$).*\.html$/;
+            //const pattern = /^\/views\/(?!(index|systemConfig)\b).*$/;
+            if (pattern.test(path)) {
+              // 自己项目下的页面,统统走这里
+              return path.replace('/views/', '/pages/');
+            }
+            
+            // index,systemConfig模块走这里
+            return path.replace('/views/', '/node_modules/icore-frame/pages/');
+        } 
+      } */
+      '/views/index.html': {
+        target: 'http://127.0.0.1:3000',
+        rewrite: (path) => path.replace('/views/index.html', '/node_modules/icore-frame/pages/index.html'),
+        changeOrigin: true
+      },
+      '/views/systemConfig.html': {
+        target: 'http://127.0.0.1:3000',
+        rewrite: (path) => path.replace('/views/systemConfig.html', '/node_modules/icore-frame/pages/systemConfig.html'),
+        changeOrigin: true
+      }           
+    }    
+  },
+  build:{
+    rollupOptions:{
+      input: {
+         //'index' : '/views/index.html',
+         //'systemConfig' : '/views/systemConfig.html',
+        //'systemBase' : '/views/systemBase.html',
+       // 'index' : '/node_modules/my-vue-app/views/index.html'
+        //'index' : path.resolve(__dirname, '../../views/indexxx.html')
+      }
+    }
+  },
+  plugins: [
+    vue(),
+    
+    AutoImport({
+      imports: ['vue','vuex','vue-router'],
+      dts: 'src/auto-imports.d.ts'
+    }),    
+
+  ]
+});
+
+