Merge remote-tracking branch 'gitee/master' into gitee-master

Raod 3 years ago
commit 8441e895dc

@ -66,7 +66,7 @@
## 近期计划 ## 近期计划
- 完善地图插件 - 完善地图插件
- 完善表格插件 - 完善表格插件
- 丰富自定义框图、装饰 - 丰富自定义框图、挂件
- 丰富更多图表组件 - 丰富更多图表组件
## 技术支持 ## 技术支持

@ -55,6 +55,7 @@ public class UserServiceImpl implements UserService {
//将登录信息缓存,默认一小时 //将登录信息缓存,默认一小时
if (cacheHelper.exist(username)) { if (cacheHelper.exist(username)) {
map.put("token", cacheHelper.stringGet(username)); map.put("token", cacheHelper.stringGet(username));
map.put("username", username);
} else { } else {
String uuid = GaeaUtils.UUID(); String uuid = GaeaUtils.UUID();
String token = jwtBean.createToken(username, uuid); String token = jwtBean.createToken(username, uuid);

@ -10,6 +10,10 @@ server:
spring: spring:
application: application:
name: aj-report name: aj-report
#上传图片大小限制为10MB
servlet:
multipart:
max-file-size: 10MB
# cloud: # cloud:
# nacos: # nacos:
# server-addr: 10.108.26.121:8848,10.108.26.145:8848 # server-addr: 10.108.26.121:8848,10.108.26.145:8848

@ -1,7 +1,7 @@
/* /*
* @Author: zyk * @Author: qianlishi
* @Date: 2020-07-13 15:13:34 * @Date: 2020-07-13 15:13:34
* @Last Modified by: zyk * @Last Modified by: qianlishi
* @Last Modified time: 2021-03-15 13:28:28 * @Last Modified time: 2021-03-15 13:28:28
*/ */

@ -1,7 +1,7 @@
/* /*
* @Author: zyk * @Author: qianlishi
* @Date: 2020-07-13 15:13:17 * @Date: 2020-07-13 15:13:17
* @Last Modified by: zyk * @Last Modified by: qianlishi
* @Last Modified time: 2020-12-15 15:34:34 * @Last Modified time: 2020-12-15 15:34:34
*/ */
import request from '@/utils/request' import request from '@/utils/request'

@ -1,7 +1,7 @@
/* /*
* @Author: zyk * @Author: qianlishi
* @Date: 2020-07-13 15:13:37 * @Date: 2020-07-13 15:13:37
* @Last Modified by: zyk * @Last Modified by: qianlishi
* @Last Modified time: 2021-03-04 10:46:26 * @Last Modified time: 2021-03-04 10:46:26
*/ */
import request from '@/utils/request' import request from '@/utils/request'

@ -6,6 +6,10 @@ export default {
} }
}, },
computed: { computed: {
username: function(){
var username = getItem('username')
return username
},
getUser: function(){ getUser: function(){
// var user = getItem('user'); // var user = getItem('user');
var user =JSON.parse(localStorage.getItem('user')) var user =JSON.parse(localStorage.getItem('user'))

@ -1,16 +1,12 @@
<template> <template>
<div> <div>
<el-menu class="navbar" mode="horizontal"> <el-menu class="navbar" mode="horizontal">
<hamburger <hamburger :toggle-click="toggleSideBar" :is-active="sidebar.opened" class="hamburger-container" />
:toggle-click="toggleSideBar"
:is-active="sidebar.opened"
class="hamburger-container"
/>
<breadcrumb /> <breadcrumb />
<el-dropdown class="avatar-container" trigger="click"> <el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<i class="icon iconfont iconyonghu user" /> <i class="icon iconfont iconyonghu user" />
<span class="user-name">{{ userName }}</span> <span class="user-name">{{ username }}</span>
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown" class="user-dropdown"> <el-dropdown-menu slot="dropdown" class="user-dropdown">
@ -24,25 +20,25 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import { mapGetters } from 'vuex'
import Breadcrumb from "@/components/Breadcrumb"; import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from "@/components/Hamburger"; import Hamburger from '@/components/Hamburger'
import { getItem, delItem, getStorageItem } from "@/utils/storage"; import { getItem, delItem, getStorageItem } from '@/utils/storage'
import { aesEncrypt } from "@/utils/aes"; import { aesEncrypt } from '@/utils/aes'
import { reqUpdatePassword } from "@/api/login"; import { reqUpdatePassword } from '@/api/login'
export default { export default {
data() { data() {
// //
var validatePass3 = (rule, value, callback) => { var validatePass3 = (rule, value, callback) => {
if (value === "") { if (value === '') {
callback(new Error("请再次输入密码")); callback(new Error('请再次输入密码'))
} else if (value !== this.form.password) { } else if (value !== this.form.password) {
callback(new Error("两次输入密码不一致!")); callback(new Error('两次输入密码不一致!'))
} else { } else {
callback(); callback()
}
} }
};
// const validatePass = (rule, value, callback) => { // const validatePass = (rule, value, callback) => {
// if (!/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_]+$)(?![a-z0-9]+$)(?![a-z\W_]+$)(?![0-9\W_]+$)[a-zA-Z0-9\W_]{6,}$/.test(value)) { // if (!/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_]+$)(?![a-z0-9]+$)(?![a-z\W_]+$)(?![0-9\W_]+$)[a-zA-Z0-9\W_]{6,}$/.test(value)) {
// callback(new Error('')) // callback(new Error(''))
@ -52,103 +48,100 @@ export default {
// }; // };
const validateOldPass = (rule, value, callback) => { const validateOldPass = (rule, value, callback) => {
if (value.length < 6 || value.length > 30) { if (value.length < 6 || value.length > 30) {
callback(new Error("请输入原密码")); callback(new Error('请输入原密码'))
} else { } else {
callback(); callback()
}
} }
};
return { return {
userName: "",
wordVisible: false, // wordVisible: false, //
form: { form: {
oldPassword: "", oldPassword: '',
password: "", password: '',
confirmPassword: "" confirmPassword: '',
}, },
rules: { rules: {
oldPassword: [ oldPassword: [
{ required: true, validator: validateOldPass, trigger: "blur" } { required: true, validator: validateOldPass, trigger: 'blur' },
], ],
password: [ password: [
{ required: true, message: "请选择新密码", trigger: "blur" } { required: true, message: '请选择新密码', trigger: 'blur' },
], ],
confirmPassword: [ confirmPassword: [
{ required: true, validator: validatePass3, trigger: "blur" } { required: true, validator: validatePass3, trigger: 'blur' },
] ],
},
} }
};
}, },
components: { components: {
Breadcrumb, Breadcrumb,
Hamburger Hamburger,
}, },
computed: { computed: {
...mapGetters(["sidebar"]) ...mapGetters(['sidebar']),
},
created() {
this.userName = getItem("username");
}, },
created() {},
methods: { methods: {
toggleSideBar() { toggleSideBar() {
this.$store.dispatch("ToggleSideBar"); this.$store.dispatch('ToggleSideBar')
}, },
logout() { logout() {
this.$confirm("确定要退出吗", "温馨提示", { this.$confirm('确定要退出吗', '温馨提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning',
}).then(() => { }).then(() => {
delItem("token"); delItem('token')
sessionStorage.clear(); sessionStorage.clear()
localStorage.clear(); localStorage.clear()
this.$router.push("/login"); this.$router.push('/login')
}); })
}, },
// //
updatePassword() { updatePassword() {
this.wordVisible = true; this.wordVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form && this.$refs.form.resetFields(); this.$refs.form && this.$refs.form.resetFields()
}); })
}, },
// //
confrimUpdate() { confrimUpdate() {
this.$refs.form.validate(valid => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const { oldPassword, password, confirmPassword } = this.form; const { oldPassword, password, confirmPassword } = this.form
let data = { let data = {
oldPassword: aesEncrypt(oldPassword), oldPassword: aesEncrypt(oldPassword),
password: aesEncrypt(password), password: aesEncrypt(password),
confirmPassword: aesEncrypt(confirmPassword) confirmPassword: aesEncrypt(confirmPassword),
}; }
reqUpdatePassword(data).then(res => { reqUpdatePassword(data).then((res) => {
if (res.repCode == "0000") { if (res.repCode == '0000') {
this.wordVisible = false; this.wordVisible = false
this.$message.success("修改密码成功,请重新登录"); this.$message.success('修改密码成功,请重新登录')
sessionStorage.clear(); sessionStorage.clear()
localStorage.clear(); localStorage.clear()
delItem("token"); delItem('token')
this.$router.push("/login"); this.$router.push('/login')
} }
}); })
} else { } else {
return false; return false
} }
}); })
}, },
helpCenter() { helpCenter() {
let helpCategory = JSON.parse(localStorage.getItem("helpCategory")); let helpCategory = JSON.parse(localStorage.getItem('helpCategory'))
this.$router.push({ this.$router.push({
path: "/helpCenList/list", path: '/helpCenList/list',
query: { query: {
id: 0, id: 0,
val: helpCategory[0].value, val: helpCategory[0].value,
title: helpCategory[0].label title: helpCategory[0].label,
} },
}); })
} },
} },
}; }
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zyk * @Author: qianlishi
* @Date: 2020-07-13 11:04:24 * @Date: 2020-07-13 11:04:24
* @Last Modified by: zyk * @Last Modified by: qianlishi
* @Last Modified time: 2020-07-13 11:04:24 * @Last Modified time: 2020-07-13 11:04:24
!--> !-->
<template> <template>
@ -12,15 +12,7 @@
</div> </div>
<div class="login_contant"> <div class="login_contant">
<img src="@/assets/images/login.png" alt="image" class="login_img" /> <img src="@/assets/images/login.png" alt="image" class="login_img" />
<el-form <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login_form" autocomplete="on" label-position="left" @keyup.enter.native="handleLogin">
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login_form"
autocomplete="on"
label-position="left"
@keyup.enter.native="handleLogin"
>
<div class="title_container"> <div class="title_container">
<h3 class="title"> <h3 class="title">
HELLO, HELLO,
@ -36,47 +28,15 @@
<div> <div>
<p>用户名</p> <p>用户名</p>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input ref="username" v-model="loginForm.username" placeholder="用户名" name="username" type="text" tabindex="1" autocomplete="on" @focus="setTop('0')" @change="getPsw" />
ref="username"
v-model="loginForm.username"
placeholder="用户名"
name="username"
type="text"
tabindex="1"
autocomplete="on"
@focus="setTop('0')"
@change="getPsw"
/>
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
<p>密码</p> <p>密码</p>
<input <input name="password" type="password" autocomplete="off" class="take" />
name="password" <el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
type="password"
autocomplete="off"
class="take"
/>
<el-tooltip
v-model="capsTooltip"
content="Caps lock is On"
placement="right"
manual
>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType" placeholder="用户密码" name="password" tabindex="2" autocomplete="on" @blur="capsTooltip = false" @focus="setTop('50')" @keyup.native="checkCapslock" />
:key="passwordType"
ref="password"
v-model="loginForm.password"
:type="passwordType"
placeholder="用户密码"
name="password"
tabindex="2"
autocomplete="on"
@blur="capsTooltip = false"
@focus="setTop('50')"
@keyup.native="checkCapslock"
/>
<span class="show_pwd" @click="showPwd"> <span class="show_pwd" @click="showPwd">
<i class="el-icon-view" /> <i class="el-icon-view" />
</span> </span>
@ -90,178 +50,168 @@
<p>记住密码</p> <p>记住密码</p>
</div> </div>
</div> </div>
<el-button <el-button :loading="loading" type="primary" class="login_btn" @click.native.prevent="handleLogin">登录</el-button>
:loading="loading"
type="primary"
class="login_btn"
@click.native.prevent="handleLogin"
>登录</el-button
>
</el-form> </el-form>
</div> </div>
<!-- 验证码 --> <!-- 验证码 -->
<Verify <Verify v-if="needCaptcha" ref="verify" :captcha-type="'blockPuzzle'" :img-size="{ width: '400px', height: '200px' }" @success="verifylogin" />
v-if="needCaptcha"
ref="verify"
:captcha-type="'blockPuzzle'"
:img-size="{ width: '400px', height: '200px' }"
@success="verifylogin"
/>
</div> </div>
</template> </template>
<script> <script>
import Verify from "@/components/verifition/Verify"; import Verify from '@/components/verifition/Verify'
import cookies from "js-cookie"; import cookies from 'js-cookie'
import { Decrypt, Encrypt } from "@/utils/index"; import { Decrypt, Encrypt } from '@/utils/index'
import { login } from "@/api/login"; import { login } from '@/api/login'
import { transPsw } from "@/utils/encrypted"; import { transPsw } from '@/utils/encrypted'
import { setItem, getItem } from "@/utils/storage"; import { setItem, getItem } from '@/utils/storage'
export default { export default {
name: "Login", name: 'Login',
components: { components: {
Verify Verify,
}, },
data() { data() {
return { return {
activeTop: "-50%", // activeTop: '-50%', //
rememberPsw: false, // rememberPsw: false, //
loginForm: { loginForm: {
username: "admin", username: 'admin',
password: "123456", password: '123456',
verifyCode: "" verifyCode: '',
}, // }, //
loginRules: { loginRules: {
username: [{ required: true, message: "用户名必填", trigger: "blur" }], username: [{ required: true, message: '用户名必填', trigger: 'blur' }],
password: [{ required: true, message: "用户密码必填", trigger: "blur" }] password: [
{ required: true, message: '用户密码必填', trigger: 'blur' },
],
}, // }, //
passwordType: "password", // passwordType: 'password', //
capsTooltip: false, // capsTooltip: false, //
loading: false, // loding loading: false, // loding
redirect: undefined, // redirect: undefined, //
otherQuery: {}, // otherQuery: {}, //
needCaptcha: false needCaptcha: false,
}; }
}, },
watch: { watch: {
$route: { $route: {
// from // from
handler: function(route) { handler: function (route) {
const query = route.query; const query = route.query
if (query) { if (query) {
this.redirect = query.redirect; this.redirect = query.redirect
this.otherQuery = this.getOtherQuery(query); this.otherQuery = this.getOtherQuery(query)
} }
}, },
immediate: true immediate: true,
} },
}, },
mounted() { mounted() {
// //
if (this.loginForm.username === "") { if (this.loginForm.username === '') {
this.$refs.username.focus(); this.$refs.username.focus()
} else if (this.loginForm.password === "") { } else if (this.loginForm.password === '') {
this.$refs.password.focus(); this.$refs.password.focus()
} }
}, },
methods: { methods: {
// //
getPsw() { getPsw() {
const cookVal = cookies.get(`u_${this.loginForm.username}`); const cookVal = cookies.get(`u_${this.loginForm.username}`)
this.loginForm.password = cookVal && Decrypt(cookVal); this.loginForm.password = cookVal && Decrypt(cookVal)
}, },
// top // top
setTop(val) { setTop(val) {
this.activeTop = val; this.activeTop = val
}, },
// //
checkCapslock(e) { checkCapslock(e) {
const { key } = e; const { key } = e
this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z"; this.capsTooltip = key && key.length === 1 && key >= 'A' && key <= 'Z'
}, },
// //
showPwd() { showPwd() {
if (this.passwordType === "password") { if (this.passwordType === 'password') {
this.passwordType = ""; this.passwordType = ''
} else { } else {
this.passwordType = "password"; this.passwordType = 'password'
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.password.focus(); this.$refs.password.focus()
}); })
}, },
// //
useVerify() { useVerify() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
this.$refs.verify.show(); this.$refs.verify.show()
} else { } else {
return false; return false
} }
}); })
}, },
// //
verifylogin(params) { verifylogin(params) {
this.loginForm.verifyCode = params.captchaVerification; this.loginForm.verifyCode = params.captchaVerification
if (this.loginForm.verifyCode) { if (this.loginForm.verifyCode) {
this.loginApi(); this.loginApi()
} }
}, },
// //
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true
// //
if (this.needCaptcha) { if (this.needCaptcha) {
this.useVerify(); this.useVerify()
return; return
} }
this.loginApi(); this.loginApi()
} else { } else {
return false; return false
} }
}); })
}, },
async loginApi() { async loginApi() {
let obj = { let obj = {
username: this.loginForm.username, username: this.loginForm.username,
password: transPsw(this.loginForm.password), password: transPsw(this.loginForm.password),
verifyCode: "" verifyCode: '',
}; }
const { code, data } = await login(obj); const { code, data } = await login(obj)
console.log(data); console.log(data)
this.loading = false; this.loading = false
if (code != "200") return; if (code != '200') return
setItem("token", data.token); setItem('token', data.token)
setItem("username", data.username); setItem('username', data.username)
// cookie,15 // cookie,15
this.rememberPsw && this.rememberPsw &&
cookies.set( cookies.set(
`u_${this.loginForm.username}`, `u_${this.loginForm.username}`,
Encrypt(this.loginForm.password), Encrypt(this.loginForm.password),
{ expires: 15 } { expires: 15 }
); )
if (data && data.captcha) { if (data && data.captcha) {
this.needCaptcha = true; this.needCaptcha = true
} else { } else {
this.needCaptcha = false; this.needCaptcha = false
this.$router.push({ this.$router.push({
path: this.redirect || "/index", path: this.redirect || '/index',
query: this.otherQuery query: this.otherQuery,
}); })
} }
}, },
getOtherQuery(query) { getOtherQuery(query) {
return Object.keys(query).reduce((acc, cur) => { return Object.keys(query).reduce((acc, cur) => {
if (cur !== "redirect") { if (cur !== 'redirect') {
acc[cur] = query[cur]; acc[cur] = query[cur]
}
return acc;
}, {});
} }
} return acc
}; }, {})
},
},
}
</script> </script>
<style lang="scss"> <style lang="scss">
@ -431,7 +381,7 @@ export default {
height: 14px; height: 14px;
} }
& > input:checked::before { & > input:checked::before {
content: "\2713"; content: '\2713';
background-color: #f5ab1b; background-color: #f5ab1b;
position: absolute; position: absolute;
top: 0; top: 0;

@ -4922,7 +4922,7 @@ const widgetTools = [
name: 'layerName', name: 'layerName',
required: false, required: false,
placeholder: '', placeholder: '',
value: '图', value: '南丁格尔玫瑰图',
}, },
{ {
type: 'vue-color', type: 'vue-color',

@ -6,7 +6,6 @@
</template> </template>
<script> <script>
import echarts from "echarts";
export default { export default {
name: "WidgetPieNightingaleRoseArea", // https://echarts.apache.org/examples/zh/editor.html?c=pie-roseType-simple name: "WidgetPieNightingaleRoseArea", // https://echarts.apache.org/examples/zh/editor.html?c=pie-roseType-simple
components: {}, components: {},
@ -28,7 +27,7 @@ export default {
}, },
series: [ series: [
{ {
name: "面积模式", //name: "",
type: "pie", type: "pie",
radius: ["10%", "50%"], radius: ["10%", "50%"],
center: ["50%", "50%"], center: ["50%", "50%"],
@ -36,21 +35,13 @@ export default {
itemStyle: { itemStyle: {
borderRadius: 8 borderRadius: 8
}, },
data: [ data: []
{ value: 40, name: "rose 1" },
{ value: 38, name: "rose 2" },
{ value: 32, name: "rose 3" },
{ value: 30, name: "rose 4" },
{ value: 28, name: "rose 5" },
{ value: 26, name: "rose 6" },
{ value: 22, name: "rose 7" },
{ value: 18, name: "rose 8" }
]
} }
] ]
}, },
optionsStyle: {}, // optionsStyle: {}, //
optionsData: {}, // optionsData: {}, //
optionsCollapse: {}, //
optionsSetup: {} optionsSetup: {}
}; };
}, },
@ -90,13 +81,10 @@ export default {
// options // options
editorOptions () { editorOptions () {
this.setOptionsTitle(); this.setOptionsTitle();
// this.setOptionsX() this.setOptionsValue();
// this.setOptionsY() this.setOptionsTooltip();
// this.setOptionsTop() this.setOptionsLegend();
// this.setOptionsTooltip() this.setOptionsColor();
// this.setOptionsMargin()
// this.setOptionsLegend()
// this.setOptionsColor()
this.setOptionsData(); this.setOptionsData();
}, },
// //
@ -117,104 +105,35 @@ export default {
fontWeight: optionsCollapse.subTextFontWeight, fontWeight: optionsCollapse.subTextFontWeight,
fontSize: optionsCollapse.subTextFontSize fontSize: optionsCollapse.subTextFontSize
}; };
this.options.title = title; this.options.title = title;
}, },
// X //
setOptionsX () { setOptionsValue() {
const optionsCollapse = this.optionsSetup;
const xAxis = {
type: "category",
show: optionsCollapse.hideX, //
name: optionsCollapse.xName, //
nameTextStyle: {
color: optionsCollapse.xNameColor,
fontSize: optionsCollapse.xNameFontSize
},
nameRotate: optionsCollapse.textAngle, //
inverse: optionsCollapse.reversalX, //
axisLabel: {
show: true,
interval: optionsCollapse.textInterval, //
rotate: optionsCollapse.textAngle, //
textStyle: {
color: optionsCollapse.Xcolor, // x
fontSize: optionsCollapse.fontSizeX
}
},
axisLine: {
show: true,
lineStyle: {
color: optionsCollapse.lineColorX
}
},
splitLine: {
show: optionsCollapse.isShowSplitLineX,
lineStyle: {
color: optionsCollapse.splitLineColorX
},
},
};
this.options.xAxis = xAxis;
},
// Y
setOptionsY () {
const optionsCollapse = this.optionsSetup;
const yAxis = {
type: "value",
show: optionsCollapse.isShowY, //
name: optionsCollapse.textNameY, //
nameTextStyle: {
color: optionsCollapse.NameColorY,
fontSize: optionsCollapse.NameFontSizeY
},
inverse: optionsCollapse.reversalY, //
axisLabel: {
show: true,
textStyle: {
color: optionsCollapse.colorY, // x
fontSize: optionsCollapse.fontSizeY
}
},
splitLine: {
show: false
},
axisLine: {
show: true,
lineStyle: {
color: optionsCollapse.lineColorY
}
},
splitLine: {
show: optionsCollapse.isShowSplitLineY,
lineStyle: {
color: optionsCollapse.splitLineColorY
},
},
};
this.options.yAxis = yAxis;
},
// or
setOptionsTop () {
const optionsCollapse = this.optionsSetup; const optionsCollapse = this.optionsSetup;
const series = this.options.series; const series = this.options.series;
const numberValue = optionsCollapse.numberValue ? "{c}" : "";
for (const key in series) { const percentage = optionsCollapse.percentage ? "({d})%" : "";
if (series[key].type == "bar") { const label = {
series[key].label = {
show: optionsCollapse.isShow, show: optionsCollapse.isShow,
position: "top", formatter: `{a|{b}${numberValue} ${percentage}}`,
distance: 10, rich: {
fontSize: optionsCollapse.fontSize, a: {
padding: [-30, 15, -20, 15],
color: optionsCollapse.subTextColor, color: optionsCollapse.subTextColor,
fontSize: optionsCollapse.fontSize,
fontWeight: optionsCollapse.fontWeight fontWeight: optionsCollapse.fontWeight
}
},
fontSize: optionsCollapse.fontSize,
fontWeight: optionsCollapse.optionsCollapse
}; };
series[key].barWidth = optionsCollapse.maxWidth; for (const key in series) {
series[key].barMinHeight = optionsCollapse.minHeight; if (series[key].type == "pie") {
series[key].label = label;
series[key].labelLine = { show: optionsCollapse.isShow };
} }
} }
this.options.series = series;
}, },
// tooltip // tooltip
setOptionsTooltip () { setOptionsTooltip () {
@ -259,7 +178,7 @@ export default {
legend.itemWidth = optionsCollapse.lengedWidth; legend.itemWidth = optionsCollapse.lengedWidth;
}, },
// //
setOptionsColor () { setOptionsColor() {
const optionsCollapse = this.optionsSetup; const optionsCollapse = this.optionsSetup;
const customColor = optionsCollapse.customColor; const customColor = optionsCollapse.customColor;
if (!customColor) return; if (!customColor) return;
@ -267,76 +186,45 @@ export default {
for (let i = 0; i < customColor.length; i++) { for (let i = 0; i < customColor.length; i++) {
arrColor.push(customColor[i].color); arrColor.push(customColor[i].color);
} }
const itemStyle = { this.options.color = arrColor;
normal: {
color: params => {
return arrColor[params.dataIndex];
},
barBorderRadius: optionsCollapse.radius
}
};
for (const key in this.options.series) {
if (this.options.series[key].type == "bar") {
this.options.series[key].itemStyle = itemStyle;
}
}
this.options = Object.assign({}, this.options); this.options = Object.assign({}, this.options);
}, },
// //
setOptionsData () { setOptionsData() {
const optionsSetup = this.optionsSetup;
console.log(optionsSetup);
const optionsData = this.optionsData; // or const optionsData = this.optionsData; // or
console.log(optionsData);
optionsData.dataType == "staticData" optionsData.dataType == "staticData"
? this.staticDataFn(optionsData.staticData, optionsSetup) ? this.staticDataFn(optionsData.staticData)
: this.dynamicDataFn(optionsData.dynamicData, optionsSetup); : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);
}, },
// staticDataFn(val) {
staticDataFn (val, optionsSetup) {
const staticData = JSON.parse(val); const staticData = JSON.parse(val);
// x for (const key in this.options.series) {
if (optionsSetup.verticalShow) { if (this.options.series[key].type == "pie") {
this.options.xAxis.data = []; this.options.series[key].data = staticData;
this.options.yAxis.data = staticData.categories;
this.options.xAxis.type = "value";
this.options.yAxis.type = "category";
} else {
this.options.xAxis.data = staticData.categories;
this.options.yAxis.data = [];
this.options.xAxis.type = "category";
this.options.yAxis.type = "value";
}
// series
const series = this.options.series;
for (const i in series) {
if (series[i].type == "bar") {
series[i].data = staticData.series[0].data;
} }
} }
}, },
// dynamicDataFn(val, refreshTime) {
dynamicDataFn (val, optionsSetup) {
console.log(val);
if (!val) return; if (!val) return;
// x if (this.ispreview) {
if (optionsSetup.verticalShow) { this.getEchartData(val);
this.options.xAxis.data = []; this.flagInter = setInterval(() => {
this.options.yAxis.data = val.xAxis; this.getEchartData(val);
this.options.xAxis.type = "value"; }, refreshTime);
this.options.yAxis.type = "category";
} else { } else {
this.options.xAxis.data = val.xAxis; this.getEchartData(val);
this.options.yAxis.data = [];
this.options.xAxis.type = "category";
this.options.yAxis.type = "value";
} }
},
// series getEchartData(val) {
const series = this.options.series; const data = this.queryEchartsData(val);
for (const i in series) { data.then(res => {
if (series[i].type == "bar") { this.renderingFn(res);
series[i].data = val.series[i].data; });
},
renderingFn(val) {
for (const key in this.options.series) {
if (this.options.series[key].type == "pie") {
this.options.series[key].data = val;
} }
} }
} }

@ -11,142 +11,64 @@
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4"> <el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4">
<el-form-item label="数据源名称"> <el-form-item label="数据源名称">
<el-input <el-input v-model.trim="params.sourceName" size="mini" clearable placeholder="数据源名称" class="filter-item" @keyup.enter.native="crud.toQuery" />
v-model.trim="params.sourceName"
size="mini"
clearable
placeholder="数据源名称"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4"> <el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4">
<el-form-item label="数据源编码"> <el-form-item label="数据源编码">
<el-input <el-input v-model.trim="params.sourceCode" size="mini" clearable placeholder="数据源Code" class="filter-item" @keyup.enter.native="crud.toQuery" />
v-model.trim="params.sourceCode"
size="mini"
clearable
placeholder="数据源Code"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4" class="query"> <el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4" class="query">
<el-form-item label="数据源类型" size="mini"> <el-form-item label="数据源类型" size="mini">
<Dictionary <Dictionary v-model="params.sourceType" :updata-dict="params.sourceType" :dict-key="'SOURCE_TYPE'" />
v-model="params.sourceType"
:updata-dict="params.sourceType"
:dict-key="'SOURCE_TYPE'"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="20" :md="4" :lg="4" :xl="4" class="query"> <el-col :xs="24" :sm="20" :md="4" :lg="4" :xl="4" class="query">
<el-button type="primary" size="mini" @click="search('form')" <el-button type="primary" size="mini" @click="search('form')"></el-button>
>查询</el-button <el-button type="danger" size="mini" @click="reset('form')"></el-button>
>
<el-button type="danger" size="mini" @click="reset('form')"
>重置</el-button
>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-button <el-button type="primary" icon="el-icon-plus" size="mini" @click="showAddLogModel()"></el-button>
type="primary"
icon="el-icon-plus"
size="mini"
@click="showAddLogModel()"
>新增</el-button
>
<!--表格渲染--> <!--表格渲染-->
<el-table <el-table v-loading="listLoading" border :data="list" class="mt10" element-loading-text="Loading" style="width: 100%">
v-loading="listLoading" <el-table-column align="center" label="序号" type="index" min-width="60px" />
border <el-table-column prop="sourceType" label="数据源类型" min-width="140px" />
:data="list" <el-table-column prop="sourceNameCode" label="数据源名称[编码]" min-width="250px" />
class="mt10" <el-table-column prop="sourceDesc" label="数据源描述" min-width="250px" />
element-loading-text="Loading" <el-table-column prop="createBy" label="创建人" min-width="100px" />
style="width: 100%" <el-table-column prop="createTime" label="创建时间" min-width="150px" />
> <el-table-column prop="updateBy" label="修改人" min-width="100px" />
<el-table-column <el-table-column prop="updateTime" label="修改时间" min-width="150px" />
align="center" <el-table-column label="操作" align="center" min-width="120px">
label="序号"
type="index"
min-width="40"
/>
<el-table-column prop="sourceType" label="数据源类型" />
<el-table-column prop="sourceNameCode" label="数据源名称[编码]" />
<el-table-column prop="sourceDesc" label="数据源描述" />
<el-table-column prop="createBy" label="创建人" width="100" />
<el-table-column prop="createTime" label="创建时间" width="140" />
<el-table-column prop="updateBy" label="修改人" width="100" />
<el-table-column prop="updateTime" label="修改时间" width="140" />
<el-table-column label="操作" width="120px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="showAddLogModel(scope.row)" <el-button type="text" @click="showAddLogModel(scope.row)"></el-button>
>编辑</el-button
>
<!-- <el-popconfirm :title="'确定删除' + scope.row.sourceNameCode + '吗?'" <!-- <el-popconfirm :title="'确定删除' + scope.row.sourceNameCode + '吗?'"
@onConfirm="delData(scope.row)"> --> @onConfirm="delData(scope.row)"> -->
<el-button slot="reference" @click="delData(scope.row)" type="text" <el-button slot="reference" @click="delData(scope.row)" type="text">删除</el-button>
>删除</el-button
>
<!-- </el-popconfirm> --> <!-- </el-popconfirm> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="block"> <div class="block">
<el-pagination <el-pagination :total="totalCount" :page-sizes="[10, 20, 50, 100]" :page-size="params.pageSize" :current-page="params.pageNumber" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
:total="totalCount"
:page-sizes="[10, 20, 50, 100]"
:page-size="params.pageSize"
:current-page="params.pageNumber"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div> </div>
<!--表单组件--> <!--表单组件-->
<el-dialog <el-dialog title="项目基础配置" width="50%" :close-on-click-modal="false" center :visible.sync="basicDialog" @close="closeDialog">
title="项目基础配置" <el-form ref="userForm" :model="dialogForm" :rules="rules" size="small" label-width="100px">
width="50%"
:close-on-click-modal="false"
center
:visible.sync="basicDialog"
@close="closeDialog"
>
<el-form
ref="userForm"
:model="dialogForm"
:rules="rules"
size="small"
label-width="100px"
>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :xs="24" :sm="20" :md="6" :lg="6" :xl="6"> <el-col :xs="24" :sm="20" :md="6" :lg="6" :xl="6">
<el-form-item label="数据源类型" prop="sourceType"> <el-form-item label="数据源类型" prop="sourceType">
<el-select <el-select v-model.trim="dialogForm.sourceType" placeholder="请选择" clearable @change="selectChange">
v-model.trim="dialogForm.sourceType" <el-option v-for="item in dictionaryOptions" :key="item.id" :label="item.text" :value="item.id" />
placeholder="请选择"
clearable
@change="selectChange"
>
<el-option
v-for="item in dictionaryOptions"
:key="item.id"
:label="item.text"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="20" :md="7" :lg="7" :xl="7"> <el-col :xs="24" :sm="20" :md="7" :lg="7" :xl="7">
<el-form-item label="数据源编码" prop="sourceCode"> <el-form-item label="数据源编码" prop="sourceCode">
<el-input <el-input :disabled="updataDisabled" v-model.trim="dialogForm.sourceCode" />
:disabled="updataDisabled"
v-model.trim="dialogForm.sourceCode"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="20" :md="7" :lg="7" :xl="7"> <el-col :xs="24" :sm="20" :md="7" :lg="7" :xl="7">
@ -156,24 +78,12 @@
</el-col> </el-col>
<el-col :xs="24" :sm="20" :md="20" :lg="20" :xl="20"> <el-col :xs="24" :sm="20" :md="20" :lg="20" :xl="20">
<el-form-item label="数据源描述"> <el-form-item label="数据源描述">
<el-input <el-input v-model.trim="dialogForm.sourceDesc" type="textarea" :autosize="{ minRows: 2, maxRows: 4 }" />
v-model.trim="dialogForm.sourceDesc"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col <el-col v-for="(data, index) in dataLink" :key="index" :xs="24" :sm="20" :md="20" :lg="20" :xl="20">
v-for="(data, index) in dataLink"
:key="index"
:xs="24"
:sm="20"
:md="20"
:lg="20"
:xl="20"
>
<el-form-item :label="data.labelValue"> <el-form-item :label="data.labelValue">
<el-input v-model.trim="data.value" /> <el-input v-model.trim="data.value" />
</el-form-item> </el-form-item>
@ -183,9 +93,7 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button @click="closeDialog"></el-button>
<el-button type="warning" @click="test"></el-button> <el-button type="warning" @click="test"></el-button>
<el-button type="primary" @click="UserConfirm('userForm')" <el-button type="primary" @click="UserConfirm('userForm')"></el-button>
>确定</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -197,19 +105,19 @@ import {
testConnection, testConnection,
addDataSource, addDataSource,
editDataSource, editDataSource,
deleteDataSource deleteDataSource,
} from "@/api/report"; } from '@/api/report'
import { getDictList } from "@/api/dict-data"; // import { getDictList } from '@/api/dict-data' //
import Dictionary from "@/components/Dictionary/index"; import Dictionary from '@/components/Dictionary/index'
export default { export default {
name: "Support", name: 'Support',
components: { Dictionary }, components: { Dictionary },
data() { data() {
return { return {
dictionaryOptions: [], // dictionaryOptions: [], //
selectedList: [], selectedList: [],
clickType: "", clickType: '',
formData: {}, formData: {},
list: null, list: null,
totalCount: 0, totalCount: 0,
@ -219,206 +127,206 @@ export default {
dialogFormVisible: false, dialogFormVisible: false,
basicDialog: false, basicDialog: false,
params: { params: {
sourceName: "", sourceName: '',
sourceCode: "", sourceCode: '',
sourceType: "", sourceType: '',
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
order: "DESC", order: 'DESC',
sort: "update_time" sort: 'update_time',
}, },
dialogForm: { dialogForm: {
sourceName: "", sourceName: '',
sourceCode: "", sourceCode: '',
sourceType: "", sourceType: '',
sourceDesc: "", sourceDesc: '',
sourceConfig: "" sourceConfig: '',
}, },
dataLink: [], dataLink: [],
rules: { rules: {
sourceType: [ sourceType: [
{ required: true, message: "数据集名称必选", trigger: "change" } { required: true, message: '数据集名称必选', trigger: 'change' },
], ],
sourceCode: [ sourceCode: [
{ required: true, message: "数据集编码必填", trigger: "blur" } { required: true, message: '数据集编码必填', trigger: 'blur' },
], ],
sourceName: [ sourceName: [
{ required: true, message: "数据源名称必选", trigger: "blur" } { required: true, message: '数据源名称必选', trigger: 'blur' },
] ],
}, },
value: "", value: '',
updataDisabled: false, updataDisabled: false,
testReplyCode: null testReplyCode: null,
}; }
}, },
watch: {}, watch: {},
// beforeCreatethis // beforeCreatethis
beforeCreate: function() {}, beforeCreate: function () {},
mounted() {}, mounted() {},
created() { created() {
this.getSystem(); this.getSystem()
this.queryByPage(); this.queryByPage()
}, },
methods: { methods: {
// //
search() { search() {
this.params.pageNumber = 1; this.params.pageNumber = 1
this.queryByPage(); this.queryByPage()
}, },
// //
reset(formName) { reset(formName) {
// this.$refs[formName].resetFields() // this.$refs[formName].resetFields()
this.params.sourceName = ""; this.params.sourceName = ''
this.params.sourceCode = ""; this.params.sourceCode = ''
this.params.pageNumber = 1; this.params.pageNumber = 1
this.params.sourceType = ""; this.params.sourceType = ''
this.queryByPage(); this.queryByPage()
}, },
async queryByPage() { async queryByPage() {
const res = await pageList(this.params); const res = await pageList(this.params)
if (res.code != "200") return; if (res.code != '200') return
this.listLoading = true; this.listLoading = true
this.list = res.data.records; this.list = res.data.records
this.list.forEach(value => { this.list.forEach((value) => {
value["sourceNameCode"] = value['sourceNameCode'] =
value.sourceName + "[" + value.sourceCode + "]"; value.sourceName + '[' + value.sourceCode + ']'
}); })
this.totalCount = res.data.total; this.totalCount = res.data.total
this.totalPage = res.data.pages; this.totalPage = res.data.pages
this.listLoading = false; this.listLoading = false
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.params.pageSize = val; this.params.pageSize = val
this.queryByPage(); this.queryByPage()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.params.pageNumber = val; this.params.pageNumber = val
this.queryByPage(); this.queryByPage()
}, },
// //
closeDialog(bool) { closeDialog(bool) {
// bool && this.search('form') // // bool && this.search('form') //
// this.$refs['userForm'].resetFields() // this.$refs['userForm'].resetFields()
this.basicDialog = false; this.basicDialog = false
}, },
// //
showAddLogModel(val) { showAddLogModel(val) {
this.basicDialog = true; this.basicDialog = true
if (val == undefined) { if (val == undefined) {
this.updataDisabled = false; this.updataDisabled = false
this.getSystem(); this.getSystem()
this.dialogForm = { this.dialogForm = {
sourceName: "", sourceName: '',
sourceCode: "", sourceCode: '',
sourceType: "", sourceType: '',
sourceDesc: "", sourceDesc: '',
sourceConfig: "" sourceConfig: '',
}; }
} else { } else {
this.updataDisabled = true; this.updataDisabled = true
this.dialogForm = val; this.dialogForm = val
const newSourceType = this.dialogForm; const newSourceType = this.dialogForm
let newDataLink = []; let newDataLink = []
this.dictionaryOptions.map(item => { this.dictionaryOptions.map((item) => {
if (item.id == newSourceType.sourceType) { if (item.id == newSourceType.sourceType) {
newDataLink = JSON.parse(item.extend); newDataLink = JSON.parse(item.extend)
var sourceConfigJson = JSON.parse(newSourceType.sourceConfig); var sourceConfigJson = JSON.parse(newSourceType.sourceConfig)
for (var i = 0; i < newDataLink.length; i++) { for (var i = 0; i < newDataLink.length; i++) {
newDataLink[i].value = sourceConfigJson[newDataLink[i].label]; newDataLink[i].value = sourceConfigJson[newDataLink[i].label]
} }
} }
}); })
this.dataLink = newDataLink; this.dataLink = newDataLink
} }
}, },
// //
async getSystem() { async getSystem() {
const { code, data } = await getDictList("SOURCE_TYPE"); const { code, data } = await getDictList('SOURCE_TYPE')
if (code != "200") return; if (code != '200') return
this.dictionaryOptions = data; this.dictionaryOptions = data
this.dialogForm.sourceType = this.dictionaryOptions[0].text; this.dialogForm.sourceType = this.dictionaryOptions[0].text
this.dataLink = JSON.parse(this.dictionaryOptions[0].extend); this.dataLink = JSON.parse(this.dictionaryOptions[0].extend)
}, },
selectChange(val) { selectChange(val) {
this.dataLink = []; this.dataLink = []
const extendJSON = this.dictionaryOptions.find(function(obj) { const extendJSON = this.dictionaryOptions.find(function (obj) {
return obj.id == val; return obj.id == val
}); })
this.dataLink = JSON.parse(extendJSON.extend); this.dataLink = JSON.parse(extendJSON.extend)
}, },
// //
test() { test() {
const newList = {}; const newList = {}
this.dataLink.forEach(item => { this.dataLink.forEach((item) => {
newList[item.label] = item.value; newList[item.label] = item.value
}); })
this.dialogForm.sourceConfig = JSON.stringify(newList); this.dialogForm.sourceConfig = JSON.stringify(newList)
testConnection(this.dialogForm).then(data => { testConnection(this.dialogForm).then((data) => {
if (data.code == "200") { if (data.code == '200') {
this.testReplyCode = data.code; this.testReplyCode = data.code
this.$message({ this.$message({
message: "测试成功!", message: '测试成功!',
type: "success" type: 'success',
}); })
} else { } else {
this.testReplyCode = null; this.testReplyCode = null
} }
}); })
}, },
async delData(val) { async delData(val) {
this.$confirm("确定删除?", "提示", { this.$confirm('确定删除?', '提示', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning',
}) })
.then(async () => { .then(async () => {
this.$emit("deletelayer"); this.$emit('deletelayer')
this.visible = false; this.visible = false
const { code, data } = await deleteDataSource(val); const { code, data } = await deleteDataSource(val)
if (code != "200") return; if (code != '200') return
this.queryByPage(); this.queryByPage()
this.$message({ this.$message({
type: "success", type: 'success',
message: "删除成功!" message: '删除成功!',
}); })
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: 'info',
message: "已取消删除" message: '已取消删除',
}); })
}); })
}, },
// //
async UserConfirm(formName) { async UserConfirm(formName) {
const newList = {}; const newList = {}
this.dataLink.forEach(item => { this.dataLink.forEach((item) => {
newList[item.label] = item.value; newList[item.label] = item.value
}); })
this.dialogForm.sourceConfig = JSON.stringify(newList); this.dialogForm.sourceConfig = JSON.stringify(newList)
this.$refs[formName].validate(async (valid, obj) => { this.$refs[formName].validate(async (valid, obj) => {
if (valid) { if (valid) {
if (this.testReplyCode != "200") { if (this.testReplyCode != '200') {
this.$message.error("测试结果为成功后方可保存!"); this.$message.error('测试结果为成功后方可保存!')
return; return
} }
if (this.dialogForm.id == undefined) { if (this.dialogForm.id == undefined) {
const { code } = await addDataSource(this.dialogForm); const { code } = await addDataSource(this.dialogForm)
if (code != "200") return; if (code != '200') return
this.queryByPage(); this.queryByPage()
} else { } else {
const { code } = await editDataSource(this.dialogForm); const { code } = await editDataSource(this.dialogForm)
if (code != "200") return; if (code != '200') return
this.queryByPage(); this.queryByPage()
} }
this.closeDialog(false); this.closeDialog(false)
} else { } else {
return; return
}
});
}
} }
}; })
},
},
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.title { .title {

Loading…
Cancel
Save