GitBucket
4.6.0
Toggle navigation
Sign in
Files
Branches
1
Tags
Issues
Pull Requests
Labels
Milestones
Wiki
08335
/
hivui-platform-template
hivui平台项目模板
Browse code
@中文描述: 统计分析参数地址修改
@升级登记:1 @同步后端:0 @同步数据库:0 @同步配置:0 @向下兼容:1
master
1 parent
4b89b31
commit
ceb9ef2fdfc3ef9aee6e75a176c6dc273b1b31f4
hhb
authored
on 7 Jan
Showing
3 changed files
project/hivuiMain/views/personalCenter/components/UserCard.vue
project/hivuiSam/App.vue
vite.config.js
Ignore Space
Show notes
View
project/hivuiMain/views/personalCenter/components/UserCard.vue
<template> <el-card style="margin-bottom:20px;"> <div class="user-profile"> <div class="account-center-avatarHolder"> <div class="avatar"> <img :src="avatar || userPic"/> </div> <div class="username">{{ user.fusername }}</div> <div class="bio">{{ user.fuserid }}</div> </div> <div class="account-center-detail"> <p> <i class="el-icon-s-custom"></i>{{ user.fbzname }} </p> <p> <i class="iconfont icon-tree"></i>{{ `${user.forgname} - ${user.fdeptname} - ${user.frolename}` }} </p> <p> <i class="el-icon-phone-outline"></i><span>{{ user.FMBPHONE || user.fmbphone}}</span><span></span> </p> </div> <el-divider /> </div> <div class="user-bio"> <div class="user-bio-section-header"><svg-icon icon-class="education" /><span>{{ $t("hivuiMain_app_orgbz")}}</span></div> <div class="user-education user-bio-section"> <div class="user-bio-section-body" v-for="item in bzList"> <p style="display: inline-flex;"> <i class="el-icon-s-custom"></i><span>{{ item.forgnamepath || item.fbzname }}</span><i class="el-icon-star-on" title="主岗" v-if="item.fdefaultbz"></i><span class="bzid">{{ item.fbzid}}</span><span></span> </p> </div> </div> </div> </el-card> </template> <script> import userPic from "@main/assets/user.png" export default { props: { user: { type: Object, default: () => { return { name: '', email: '', avatar: '', role: '' } } }, avatar:{ type: String, default: "" } }, data(){ return{ userPic: userPic, bzList:[] } }, mounted(){ }, methods:{ } } </script> <style lang="scss" scoped> .box-center { margin: 0 auto; display: table; } .text-muted { color: #777; } .user-profile { .user-name { font-weight: bold; } .box-center { padding-top: 10px; } .user-role { padding-top: 10px; font-weight: 400; font-size: 14px; } .box-social { padding-top: 30px; .el-table { border-top: 1px solid #dfe6ec; } } .user-follow { padding-top: 20px; } } .account-center-avatarHolder { text-align: center; margin-bottom: 24px; & > .avatar { margin: 0 auto; width: 104px; height: 104px; margin-bottom: 20px; border-radius: 50%; overflow: hidden; img { height: 100%; width: 100%; } } .username { color: rgba(0, 0, 0, 0.85); font-size: 20px; line-height: 28px; font-weight: 500; margin-bottom: 4px; } } .account-center-detail { p { margin-bottom: 8px; padding-left: 26px; position: relative; } i { position: absolute; height: 14px; width: 14px; left: 0; top: 4px; // background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg) } .title { background-position: 0 0; } .group { background-position: 0 -22px; } .address { background-position: 0 -44px; } } .user-bio { margin-top: 20px; color: #606266; span { padding-left: 4px; } .user-bio-section-body{ .bzid{ float: right; color: #000; } .el-icon-star-on{ color: #06c; } } .user-bio-section-header { border-bottom: 1px solid #dfe6ec; padding-bottom: 10px; margin-bottom: 10px; font-weight: bold; } .user-bio-section { height: calc(100vh - 427px); min-height: 336px; overflow: auto; font-size: 14px; line-height: 14px; // padding: 15px 0; } } </style>
<template> <el-card style="margin-bottom:20px;"> <div class="user-profile"> <div class="account-center-avatarHolder"> <div class="avatar"> <img :src="avatar || userPic"/> </div> <div class="username">{{ user.fusername }}</div> <div class="bio">{{ user.fuserid }}</div> </div> <div class="account-center-detail"> <p> <i class="el-icon-s-custom"></i>{{ user.fbzname }} </p> <p> <i class="iconfont icon-tree"></i>{{ `${user.forgname} - ${user.fdeptname} - ${user.frolename}` }} </p> <p> <i class="el-icon-phone-outline"></i><span>{{ user.FMBPHONE || user.fmbphone}}</span><span></span> </p> </div> <el-divider /> </div> <div class="user-bio"> <div class="user-bio-section-header"><svg-icon icon-class="education" /><span>{{ $t("hivuiMain_app_orgbz")}}</span></div> <div class="user-education user-bio-section"> <div class="user-bio-section-body" v-for="item in bzList"> <p style="display: inline-flex;"> <i class="el-icon-s-custom"></i><span>{{ item.forgnamepath || item.fbzname }}</span><i class="el-icon-star-on" title="主岗" v-if="item.fdefaultbz"></i><span class="bzid">{{ item.fbzid}}</span><span></span> </p> </div> </div> </div> </el-card> </template> <script> import userPic from "@main/assets/user.png" export default { props: { user: { type: Object, default: () => { return { name: '', email: '', avatar: '', role: '' } } }, avatar:{ type: String, default: "" } }, data(){ return{ userPic: userPic, bzList:[] } }, mounted(){ debugger; console.log('多语言', this.$t("hivuiMain_app_orgbz")) }, methods:{ } } </script> <style lang="scss" scoped> .box-center { margin: 0 auto; display: table; } .text-muted { color: #777; } .user-profile { .user-name { font-weight: bold; } .box-center { padding-top: 10px; } .user-role { padding-top: 10px; font-weight: 400; font-size: 14px; } .box-social { padding-top: 30px; .el-table { border-top: 1px solid #dfe6ec; } } .user-follow { padding-top: 20px; } } .account-center-avatarHolder { text-align: center; margin-bottom: 24px; & > .avatar { margin: 0 auto; width: 104px; height: 104px; margin-bottom: 20px; border-radius: 50%; overflow: hidden; img { height: 100%; width: 100%; } } .username { color: rgba(0, 0, 0, 0.85); font-size: 20px; line-height: 28px; font-weight: 500; margin-bottom: 4px; } } .account-center-detail { p { margin-bottom: 8px; padding-left: 26px; position: relative; } i { position: absolute; height: 14px; width: 14px; left: 0; top: 4px; // background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg) } .title { background-position: 0 0; } .group { background-position: 0 -22px; } .address { background-position: 0 -44px; } } .user-bio { margin-top: 20px; color: #606266; span { padding-left: 4px; } .user-bio-section-body{ .bzid{ float: right; color: #000; } .el-icon-star-on{ color: #06c; } } .user-bio-section-header { border-bottom: 1px solid #dfe6ec; padding-bottom: 10px; margin-bottom: 10px; font-weight: bold; } .user-bio-section { height: calc(100vh - 427px); min-height: 336px; overflow: auto; font-size: 14px; line-height: 14px; // padding: 15px 0; } } </style>
Ignore Space
Show notes
View
project/hivuiSam/App.vue
<template> <analysis-sam ref="sam" style="height: 100%;" :conf="conf"></analysis-sam> </template> <script> import { LoadUtil } from "./funclib/LoadUtil"; import { getToken } from "./utils/auth"; import { projectName, requestUrl } from "@sam/config"; import cmps from 'zhc-birt-cmps' import AnalysisSam from './components/analysisSam/Index.vue' export default { data() { return { birtModel: {}, VUE_APP_BASE_API: requestUrl, pn: projectName || "birt", conf:{} }; }, components:{AnalysisSam}, methods: { // 动态加载报表模型方法 birtModelMethod(routePath, birtModelMethod, scope) { return new Promise((resolve, reject) => { let me = this; let token = getToken(); let vId = window.scpRequestData && window.scpRequestData.__viewItemId LoadUtil.loadJsBirtModel({ loadModelUrl: this.$HI.birtModel, routePath: routePath, token: token, pn: this.pn, vId: vId, }) .then((res) => { debugger try { let birtModel = getBirtModel(scope || me, cmps.Tool) resolve(birtModel); } catch (e) { console.error(e); } }) .catch((e) => { reject(e); }); }); }, // 获取地址栏参数 getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } return false; }, }, created() { var path = window.location.pathname; // 编译后多e5 // if (window.HIVUI_SETTING) { // var serverName = window.HIVUI_SETTING.serverName; // if (serverName && path.startsWith(serverName)) { // path = path.substring(serverName.length); // } // } let me = this; let token = getToken(); let vId = window.scpRequestData && window.scpRequestData.__viewItemId LoadUtil.loadJsBirtModel({ loadModelUrl: this.$HI.birtModel, routePath: path, token: token, pn: this.pn, vId: vId, }) .then((res) => { try { let birtModel = getBirtModel(me, cmps.Tool) me.conf = birtModel; if(me.conf.analyseFields && me.conf.analyseFields.length){ let havingForm = {} me.conf.analyseFields.forEach(item => { havingForm[item.prop] = { value: undefined, value2: undefined, label: item.label, sign: 'inRange' } }); me.conf.havingForm = JSON.parse(JSON.stringify(havingForm)) this.$refs['sam'].havingForm = havingForm this.$refs['sam'].pageSizes = me.conf.pageSizes || [10,20,50,100] this.$refs['sam'].pageSize = me.conf.pageSize || 100 } } catch (e) { console.error(e); } }) .catch((e) => { console.error(e); }); }, }; </script> <style> html,body{ height: 100%; } </style>
<template> <analysis-sam ref="sam" style="height: 100%;" :conf="conf"></analysis-sam> </template> <script> import { LoadUtil } from "./funclib/LoadUtil"; import { getToken } from "./utils/auth"; import { projectName, requestUrl } from "@birt/config"; import cmps from 'zhc-birt-cmps' import AnalysisSam from './components/analysisSam/Index.vue' export default { data() { return { birtModel: {}, VUE_APP_BASE_API: requestUrl, pn: projectName || "birt", conf:{} }; }, components:{AnalysisSam}, methods: { // 动态加载报表模型方法 birtModelMethod(routePath, birtModelMethod, scope) { return new Promise((resolve, reject) => { let me = this; let token = getToken(); let vId = window.scpRequestData && window.scpRequestData.__viewItemId LoadUtil.loadJsBirtModel({ loadModelUrl: this.$HI.birtModel, routePath: routePath, token: token, pn: this.pn, vId: vId, }) .then((res) => { debugger try { let birtModel = getBirtModel(scope || me, cmps.Tool) resolve(birtModel); } catch (e) { console.error(e); } }) .catch((e) => { reject(e); }); }); }, // 获取地址栏参数 getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } return false; }, }, created() { var path = window.location.pathname; // 编译后多e5 // if (window.HIVUI_SETTING) { // var serverName = window.HIVUI_SETTING.serverName; // if (serverName && path.startsWith(serverName)) { // path = path.substring(serverName.length); // } // } let me = this; let token = getToken(); let vId = window.scpRequestData && window.scpRequestData.__viewItemId LoadUtil.loadJsBirtModel({ loadModelUrl: this.$HI.birtModel, routePath: path, token: token, pn: this.pn, vId: vId, }) .then((res) => { try { let birtModel = getBirtModel(me, cmps.Tool) me.conf = birtModel; if(me.conf.analyseFields && me.conf.analyseFields.length){ let havingForm = {} me.conf.analyseFields.forEach(item => { havingForm[item.prop] = { value: undefined, value2: undefined, label: item.label, sign: 'inRange' } }); me.conf.havingForm = JSON.parse(JSON.stringify(havingForm)) this.$refs['sam'].havingForm = havingForm this.$refs['sam'].pageSizes = me.conf.pageSizes || [10,20,50,100] this.$refs['sam'].pageSize = me.conf.pageSize || 100 } } catch (e) { console.error(e); } }) .catch((e) => { console.error(e); }); }, }; </script> <style> html,body{ height: 100%; } </style>
Ignore Space
Show notes
View
vite.config.js
const { resolve } = require('path'); import { defineConfig, loadEnv } from 'vite' import { createVuePlugin } from "vite-plugin-vue2"; import vueJsx from '@vitejs/plugin-vue-jsx' import pageData from "vite-plugin-pagedata" import vitefunc from './vite-plugin/vite-plugin-func' import autoPausePlugin from './vite-plugin/vite-plugin-auto-pause' import { injectHtml } from 'vite-plugin-html'; const pkg = require("./package.json"); // let dependencies = []; // for(let key in pkg.dependencies){ // if(['font-awesome'].indexOf(key)==-1) // dependencies.push(key) // } // console.log('------dependencies------',dependencies) const projectName = pkg.name == 'hi-vui-template' ? 'project' : pkg.name; // https://vitejs.dev/config/ export default ({ mode }) => { process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }; let aliases = {} let build = { sourcemap: false, //编译 //指定 多个 .html 文件作为入口点 rollupOptions: { // 请确保外部化那些你的库中不需要的依赖 // external: ['vue'], input: { main: resolve(__dirname, 'index.html'), nested: resolve(__dirname, 'nested/index.html') }, output: { format: 'umd', } } } if (mode == 'development') { aliases = { '@project': resolve(`${projectName}`), '@main': resolve(`${projectName}/hivuiMain`), '@birt': resolve(`${projectName}/hivuiBirt`), '@sam': resolve(`${projectName}/hivuiSam`), 'pinyin': 'js-pinyin', //预览使用全局的vue 'vue':resolve(__dirname,`./build/vite_preview/vue.js`), //预览引用指定目录下的element //开启本地调试时,禁用掉下面这行 'element-ui':resolve(__dirname,`./build/vite_preview/element_ui.js`), //开启本地调试时,启用scp5.0本地调式指定 //'@':resolve(__dirname, './hi-ui/src'), } } const postDataName = "scpRequestData"; return defineConfig({ // 被监听的包必须被排除在优化之外, // 预览时,预编译这些包,以防vite 启动后,浏览器通过自动模块加载导致刷新页面 optimizeDeps:{ //预编译加载这些,提升速度 include: [ 'axios', 'babel-polyfill', 'classnames', 'echarts', 'enquire.js', 'js-cookie', 'js-md5', 'js-pinyin', 'lodash','lodash/findIndex','lodash/cloneDeep','lodash/isPlainObject','lodash/defaultsDeep','lodash/bind', 'screenfull', 'sortablejs', 'vue', 'vue-draggable-resizable', 'vue-gemini-scrollbar', 'vue-jstree', //以下第一次预览时启动不了 // 'hi-ui','hi-taskcenter','zhc-flowchart','zhc-birt-cmps ], // 排除 // exclude: [] }, build: build, define: { 'process.env': { /** * 启用时在入口页中,有一段以下代码,因为ELEMENT有全局、import、两次,所以在调试hiui时,在初始化一次才行 if(process.env.hiui_debug){ //这样多次引用element //hiui调试时用 Vue.use(ELEMENT) } * */ //开启本地调试时,启用 hiui_debug:false //配合 webpack 环境,在vite 下定义一个空的 } }, css: { preprocessorOptions: { less: { javascriptEnabled: true, } }, }, resolve: { extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue', '.dtvevt', '.dtv','.dvue','.es6'], alias: aliases, }, plugins: [ pkg.preview&&pkg.preview.autoStopTime>0?autoPausePlugin():null, vitefunc({ varName: postDataName, global: { env: 'dev' }, htmlWebpackPlugin: { vite: true, project: projectName, mode: mode } }), injectHtml({ // 向预览时注入变量,这个变量跟打包时 html-webpack-plugin 注入的一致,用户判断是否是编译状态 injectData: { htmlWebpackPlugin: { vite: true, project: projectName, mode: mode } } }), pageData({ varName: postDataName, global: { env: 'dev' }, }), createVuePlugin({ include:/\.(dvue|vue)$/ }), vueJsx({ // options are passed on to @vue/babel-plugin-jsx }), //影响到eap.umd.min.js 里的require ELEMENT 全局 // requireTransform({ // fileRegex:/.ts$|.tsx$|.vue$|.js$|.jsx$/ // }) ], server: { hmr:{ overlay:false,//不遮罩输出错误信息,但输出控制台 } }, }) };
const { resolve } = require('path'); import { defineConfig, loadEnv } from 'vite' import { createVuePlugin } from "vite-plugin-vue2"; import vueJsx from '@vitejs/plugin-vue-jsx' import pageData from "vite-plugin-pagedata" import vitefunc from './vite-plugin/vite-plugin-func' import autoPausePlugin from './vite-plugin/vite-plugin-auto-pause' import { injectHtml } from 'vite-plugin-html'; const pkg = require("./package.json"); // let dependencies = []; // for(let key in pkg.dependencies){ // if(['font-awesome'].indexOf(key)==-1) // dependencies.push(key) // } // console.log('------dependencies------',dependencies) const projectName = pkg.name == 'hi-vui-template' ? 'project' : pkg.name; // https://vitejs.dev/config/ export default ({ mode }) => { process.env = { ...process.env, ...loadEnv(mode, process.cwd()) }; let aliases = {} let build = { sourcemap: false, //编译 //指定 多个 .html 文件作为入口点 rollupOptions: { // 请确保外部化那些你的库中不需要的依赖 // external: ['vue'], input: { main: resolve(__dirname, 'index.html'), nested: resolve(__dirname, 'nested/index.html') }, output: { format: 'umd', } } } if (mode == 'development') { aliases = { '@project': resolve(`${projectName}`), '@main': resolve(`${projectName}/hivuiMain`), '@birt': resolve(`${projectName}/hivuiBirt`), 'pinyin': 'js-pinyin', //预览使用全局的vue 'vue':resolve(__dirname,`./build/vite_preview/vue.js`), //预览引用指定目录下的element //开启本地调试时,禁用掉下面这行 'element-ui':resolve(__dirname,`./build/vite_preview/element_ui.js`), //开启本地调试时,启用scp5.0本地调式指定 //'@':resolve(__dirname, './hi-ui/src'), } } const postDataName = "scpRequestData"; return defineConfig({ // 被监听的包必须被排除在优化之外, // 预览时,预编译这些包,以防vite 启动后,浏览器通过自动模块加载导致刷新页面 optimizeDeps:{ //预编译加载这些,提升速度 include: [ 'axios', 'babel-polyfill', 'classnames', 'echarts', 'enquire.js', 'js-cookie', 'js-md5', 'js-pinyin', 'lodash','lodash/findIndex','lodash/cloneDeep','lodash/isPlainObject','lodash/defaultsDeep','lodash/bind', 'screenfull', 'sortablejs', 'vue', 'vue-draggable-resizable', 'vue-gemini-scrollbar', 'vue-jstree', //以下第一次预览时启动不了 // 'hi-ui','hi-taskcenter','zhc-flowchart','zhc-birt-cmps ], // 排除 // exclude: [] }, build: build, define: { 'process.env': { /** * 启用时在入口页中,有一段以下代码,因为ELEMENT有全局、import、两次,所以在调试hiui时,在初始化一次才行 if(process.env.hiui_debug){ //这样多次引用element //hiui调试时用 Vue.use(ELEMENT) } * */ //开启本地调试时,启用 hiui_debug:false //配合 webpack 环境,在vite 下定义一个空的 } }, css: { preprocessorOptions: { less: { javascriptEnabled: true, } }, }, resolve: { extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue', '.dtvevt', '.dtv','.dvue','.es6'], alias: aliases, }, plugins: [ pkg.preview&&pkg.preview.autoStopTime>0?autoPausePlugin():null, vitefunc({ varName: postDataName, global: { env: 'dev' }, htmlWebpackPlugin: { vite: true, project: projectName, mode: mode } }), injectHtml({ // 向预览时注入变量,这个变量跟打包时 html-webpack-plugin 注入的一致,用户判断是否是编译状态 injectData: { htmlWebpackPlugin: { vite: true, project: projectName, mode: mode } } }), pageData({ varName: postDataName, global: { env: 'dev' }, }), createVuePlugin({ include:/\.(dvue|vue)$/ }), vueJsx({ // options are passed on to @vue/babel-plugin-jsx }), //影响到eap.umd.min.js 里的require ELEMENT 全局 // requireTransform({ // fileRegex:/.ts$|.tsx$|.vue$|.js$|.jsx$/ // }) ], server: { hmr:{ overlay:false,//不遮罩输出错误信息,但输出控制台 } }, }) };
Show line notes below