Commit b59fc6fc authored by 姬鋆屾's avatar 姬鋆屾

parents d7b90ff8 65558931
<template>
<div class="header-site">
<a-popover trigger="click" placement="bottomLeft" v-model="visible">
<a class="ant-dropdown-link" @click="visible = true">
<div :trigger="['click']" class="trigger" @click="ontrigger">
<slot>
<a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
{{ siteName }} <a-icon type="down" />
</a>
<template slot="content">
<div class="content" style="min-width: 50vw; min-height: 200px">
</slot>
<div
slot="overlay"
class="select-site"
:style="{ left: `${offsetLeft}px` }"
v-if="show"
>
<div class="flex_row flex_align_c primary-color name">
<a-icon type="environment" style="margin-right: 10px" />
<span style="">{{ siteName }}</span>
......@@ -22,6 +27,7 @@
<div class="check-site">
<span>您的选择是:</span>
<span
class="check-item"
v-for="(item, index) in checkarr"
:key="index"
@click="updataSite(item)"
......@@ -29,28 +35,26 @@
>
</div>
<div class="site-btn">
<a-button style="margin-right: 10px" @click="visible = false"
<a-button @click="show = false" style="margin-right: 10px"
>取消</a-button
>
<a-button type="primary" @click="onSucessSite" :disabled="isSite"
>确定</a-button
>
</div>
</div>
</template>
</a-popover>
</div>
</template>
<script>
import { getSiteTree } from "@/services/basicsetFun";
import { mapMutations } from "vuex";
import local from "@/utils/local";
// import Cookie from "js-cookie";
export default {
data() {
return {
sitelist: [],
visible: false,
show: false,
offsetLeft: 0,
checkarr: [], //选中站点
checkid: undefined, //最终选中站点
......@@ -62,13 +66,17 @@ export default {
created() {
this.getwaitedListdata();
},
mounted() {},
mounted() {
const { offsetLeft } = this.$el;
this.offsetLeft = offsetLeft;
},
methods: {
...mapMutations("site", ["SET_SITE_ID", "SET_siteName"]),
// 确认站点
onSucessSite() {
if (this.checkarr.length == 0) return;
let obj = this.checkarr[this.checkarr.length - 1];
this.clickSite(obj);
},
// 选中
......@@ -76,16 +84,22 @@ export default {
this.checkid = undefined;
// 为子节点不添加数据
let data = this.checkarr[this.checkarr.length - 1];
if (data && (data.isLeaf || data.children.length == 0)) {
// 如果为子节点更新最后一个数据
this.checkid = obj.id;
this.checkarr[this.checkarr.length - 1] = obj;
// 如果选中数据有子集更新站点列表
if (obj.children && obj.children.length > 0) {
this.sitelist = obj.children;
}
} else {
this.checkarr.push(obj);
if (obj.children && obj.children.length > 0) {
this.sitelist = obj.children;
}
}
if (obj && obj.type == "site") {
this.isSite = false;
} else {
......@@ -136,17 +150,13 @@ export default {
});
},
clickSite(obj) {
// Cookie.set("siteid", obj.id);
// let siteInfo = {
// siteName: obj.label,
// siteid: obj.id,
// };
local.setLocal("siteId", obj.id);
local.setLocal("siteName", obj.label);
this.SET_SITE_ID(obj.id);
this.SET_siteName(obj.label);
this.show = false;
if (location.href.search(/token/gi) >= 0) {
this.$router.push({ path: "/resource/advimg" });
setTimeout(() => {
location.reload();
});
......@@ -163,28 +173,43 @@ export default {
};
</script>
<style lang="less" scoped>
.trigger {
display: inline-block;
position: relative;
}
.ant-dropdown-link {
color: #fff;
padding: 0 20px;
font-size: 16px;
min-width: 200px;
display: inline-block;
color: #fff;
}
.content {
display: flex;
flex-direction: column;
justify-content: space-around;
.select-site {
position: fixed;
left: 0;
top: 65px;
background: #fff;
border-radius: 6px;
padding: 10px;
min-width: 60%;
max-width: 80%;
z-index: 9;
color: rgba(0, 0, 0, 0.8);
font-size: 14px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
.name {
font-size: 20px;
}
.site-list {
// padding: 10px 0;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
display: flex;
flex-wrap: wrap;
overflow: hidden;
span {
float: left;
line-height: 1.5;
padding: 10px 20px;
display: inline-block;
cursor: pointer;
&:hover {
color: #1890ff;
......@@ -195,7 +220,7 @@ export default {
.site-btn {
padding: 0 20px;
}
.check-site {
.check-item {
cursor: pointer;
}
}
......
......@@ -69,6 +69,10 @@
<template slot="sort" slot-scope="text">
{{ text.sort ? text.sort : "--" }}
</template>
<!-- 类型 -->
<template slot="type" slot-scope="text">
{{ text.type ? dict.type[text.type] : "--" }}
</template>
<!-- 创建时间 -->
<template slot="createTime" slot-scope="text">
{{ text.createTime | dateFormat }}
......@@ -148,6 +152,21 @@
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="类型" prop="type">
<a-select v-model="formData.type" placeholder="请选择类型">
<a-select-option
v-for="(v, key) in dict.type"
:key="key"
:value="Number(key)"
>
{{ v }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="排序" prop="sort">
<a-input-number
......@@ -180,27 +199,6 @@
<div class="ant-upload-text">点击上传</div>
</div>
</a-upload>
<!-- <a-upload
name="file"
list-type="picture-card"
:action="api + 'base/file/commonupload'"
@change="handleUpload"
:before-upload="beforeUpload"
:show-upload-list="false"
:accept="accept"
>
<div v-if="formData.modelIcon">
<div class="svg-box" v-if="isSvg(formData.modelIcon)">
<img :src="api + formData.modelIcon" />
</div>
<img v-else :src="api + formData.modelIcon" />
</div>
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">点击上传</div>
</div>
</a-upload> -->
</a-form-model-item>
</a-col>
</a-row>
......@@ -275,6 +273,10 @@ const columns = [
width: "5%",
scopedSlots: { customRender: "sort" },
},
{
title: "类型",
scopedSlots: { customRender: "type" },
},
{
title: "创建时间",
width: "12%",
......@@ -317,6 +319,7 @@ export default {
modelUrl: "", // 模块地址
remark: "", // 备注
sort: "", // 排序
type: undefined, // 类型
},
current: 1,
size: 10,
......@@ -336,9 +339,13 @@ export default {
modelIcon: [
{ required: true, message: "模块图标不能为空", trigger: "change" },
],
type: [
{ required: true, message: "模块类型不能为空", trigger: "change" },
],
},
StatementVisible: false,
modelInfo: {},
dict: {},
};
},
created() {
......@@ -354,13 +361,16 @@ export default {
modelName: `%${this.searchValue}%`,
...search,
});
let { pageInfo, data } = res.data.data;
if (res.data.code == 1) {
let { pageInfo, data, dict } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getmodelList();
}
this.dict = dict;
this.total = pageInfo.totalResult;
this.modelList = data;
}
this.loading = false;
},
// 新增按钮
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,6 +21,7 @@
"echarts": "^5.3.3",
"element-ui": "^2.15.8",
"font-awesome": "^4.7.0",
"gsap": "^3.12.2",
"heatmap.js": "^2.0.5",
"highlight.js": "^11.5.1",
"js-export-excel": "^1.1.4",
......@@ -29,11 +30,13 @@
"qs": "^6.10.3",
"secure-ls": "^1.2.6",
"swiper": "5",
"three": "^0.155.0",
"v-viewer": "^1.6.4",
"vue": "^2.6.14",
"vue-highlightjs": "^1.3.3",
"vue-lazyload": "1.3.3",
"vue-router": "^3.5.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"vuex-persistedstate": "^4.1.0"
},
......
......@@ -58,6 +58,9 @@ export default {
</script>
<style lang="less" scoped>
.app {
min-width: 1600px;
}
.export {
background-color: rgba(0, 0, 0, 0.3);
}
......
import http from "../request/http";
let baseURL = process.env.VUE_APP_API_BASE_URL
let baseURL = process.env.VUE_APP_API_BASE_URL;
// 1.16.1. 查询站点编排列表
export function appsListInterface(params) {
return http.post(`${baseURL}/zwfw/site/model/list`, params);
return http.post(`${baseURL}/zwfw/site/model/list/group`, params);
}
// 获取收藏
export function getCollect(params) {
return http.post(`${baseURL}/zwfw/user/model/collect/get`, params);
}
// 保存收藏
export function saveCollect(params) {
return http.post(`${baseURL}/zwfw/user/model/collect/save`, params);
}
......@@ -6,6 +6,11 @@ import store from "./store";
import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
import { message } from "ant-design-vue";
message.config({
duration: 2,
maxCount: 1,
});
Vue.use(Antd);
import GlobalComponents from "./utils/js/globalComponents";
......@@ -24,6 +29,10 @@ import "@/assets/fonts/iconfont.css";
import customComponents from "@/components";
Vue.use(customComponents);
// 拖动插件
import draggable from "vuedraggable";
Vue.component("draggable", draggable);
// 引入注册全局指令
import * as directives from "@/directive";
Object.keys(directives).forEach((name) =>
......
......@@ -16,7 +16,7 @@ export default {
showTotal: (total, range) => `共${total}条`,
pageSizeOptions: ["10", "20", "30"],
},
}
};
},
computed: {
menuRouterList() {
......@@ -34,29 +34,13 @@ export default {
MenuChildren() {
let routerPath = this.$route.path.substr(
this.$route.path.lastIndexOf("/") + 1
)
let result = getItemData(
this.menuTree_X,
'routerPath',
routerPath,
)
);
let result = getItemData(this.menuTree_X, "routerPath", routerPath);
return result ? result : { children: [] };
}
},
created() {
},
beforeDestroy() {
},
created() {},
beforeDestroy() {},
methods: {
...mapMutations("menu", ["SET_menuList_X", "SET_menuTree_X"]),
getMenuList(isFirst = false) {
......@@ -72,18 +56,17 @@ export default {
}
menuList(obj).then((res) => {
// console.log(res);
let { code, data, dict } = res;
let { code, data, dict } = res.data;
if (code == 1) {
data.data = data.data.map((item) => {
this.menuRouterList.forEach(v => {
if (v['title'] == item.name) {
item["routerPath"] = v['routerPath'];
this.menuRouterList.forEach((v) => {
if (v["title"] == item.name) {
item["routerPath"] = v["routerPath"];
}
})
});
item["value"] = item.id;
item["label"] = item.name;
return item;
});
// console.log(data.data);
......@@ -99,7 +82,6 @@ export default {
this.MenuDict = dict;
this.MenuDict["MenuTree"] = deepClone(this.menuTreeData);
// console.log(this.menuListData);
// console.log(this.menuTreeData);
// this.getMenuDict(); //弃用
......@@ -143,7 +125,5 @@ export default {
// console.log(err);
});
},
},
}
\ No newline at end of file
};
......@@ -39,6 +39,7 @@ axios.interceptors.response.use(
// 取出数据
let { code, msg } = response.data;
if (code === -1) {
console.log(response.data);
message.error({
content: msg,
maxCount: 1,
......
......@@ -21,19 +21,19 @@ const router = new VueRouter({
routes: routeConfig,
});
// router.beforeEach((to, from, next) => {
// let islogin = store.getters["user/token"];
// if (islogin) {
// next();
// } else {
// // 再次判断防止死循环
// if (to.path === "/") {
// next();
// } else {
// next({ path: "/" });
// }
// }
// });
router.beforeEach((to, from, next) => {
let islogin = store.getters["user/token"];
if (islogin) {
next();
} else {
// 再次判断防止死循环
if (to.path === "/") {
next();
} else {
next({ path: "/" });
}
}
});
router.afterEach((to, from, next) => {
window.scrollTo(0, 0);
......
......@@ -5,8 +5,8 @@ export default {
menuTree_X: [], //树型结构
},
getters: {
menuList_X: state => state.menuList_X,
menuTree_X: state => state.menuTree_X,
menuList_X: (state) => state.menuList_X,
menuTree_X: (state) => state.menuTree_X,
},
mutations: {
SET_menuList_X(state, data) {
......@@ -16,10 +16,7 @@ export default {
SET_menuTree_X(state, data) {
state.menuTree_X = data;
// console.log(state.menuTree_X);
}
},
actions: {
}
}
},
actions: {},
};
<template>
<div class="actuary w-full h-auto">
<Start class="start"/>
<div class="act_cont">
<div class="act_tit">
<h1>智慧政务数据精算</h1>
......@@ -7,29 +8,19 @@
运用以人工智能为代表的新技术,驱动政务服务模式创新,为人民提供更加智慧化、人性化的政务服务,实现互联网与政务服务深度融合,大幅提升政务服务智慧化水平,让政府服务更聪明,让企业和市民办事更方便、更快捷、更有效率。
</p>
</div>
<div class="act_mod">
<div
class="mod_max"
v-for="item of menuPermission"
<div class="over_act_mod">
<div class="act_mod" ref="mode">
<div class="act_mod_item" v-for="(item,index) of menuPermission"
:key="item.id"
@click="handleJump(item.url)"
>
<div class="flip">
<div class="mod_min">
<img
:src="
item.imgPath
? api + item.imgPath
: require('../../assets/images/qyhx.png')
"
alt
/>
<div class="mod_cont">
<p class="name">{{ item.name }}</p>
<p class="remark">
{{ item.remark }}
</p>
@mouseover="hoverItem(index)"
@mouseleave="hoverleave(index)"
:style="{background: `url(${require('@/assets/images/dataActuary/'+(index+1)+'.png')}) no-repeat`}">
<div class="actitem_tit">
{{item.name}}
</div>
<div class="actitem_p">
{{item.hover?item.remark:'Business data analysis'}}
</div>
</div>
</div>
......@@ -41,6 +32,7 @@
<script>
import menu from "@/mixins/menu";
import Storage from "@/utils/js/Storage";
import Start from "./demo2"
export default {
mixins: [menu],
data() {
......@@ -49,6 +41,9 @@ export default {
menuPermission: [],
};
},
components:{
Start
},
created() {
this.getMenuList(true);
......@@ -57,6 +52,23 @@ export default {
},
methods: {
hoverItem(index){
this.menuPermission[index].hover = true
this.$refs.mode.style.transition="all 1s ease 0s";
// 如果大于6就要往前移动
if(index>5){
let num = index-5
this.$refs.mode.style.transform="translateX(-"+num*190+"px)";
this.$forceUpdate()
}
},
hoverleave(index){
this.$refs.mode.style.transform="translate(0, 0)";
this.$refs.mode.style.transition="all .5s ease 0s";
this.menuPermission[index].hover = false
this.$forceUpdate()
},
// 跳转
handleJump(url) {
this.$router.push(url);
......@@ -66,7 +78,7 @@ export default {
let { menuList } = Storage.get(2, "userInfo");
let actuary = menuList.filter((v) => v.name === "数据精算");
if (actuary.length) {
this.menuPermission = actuary
let arr = actuary
.map((v) => {
if (v.childList.length) {
return v.childList;
......@@ -75,6 +87,10 @@ export default {
}
})
.flat();
arr.forEach(item=>{
item.hover = false
})
this.menuPermission = arr
}
},
},
......@@ -83,85 +99,144 @@ export default {
<style lang="less" scoped>
@headerH: 4.5rem;
@keyframes startopen{
0% {
width: 170px;
}
100% {
width: 551px;
}
}
@keyframes leaveopen{
0% {
width: 551px;
background-size: 100% 100%;
}
100% {
background-size: 100% 100%;
width: 170px;
}
}
.start{
position: absolute;
bottom: 0;
z-index: 0;
overflow: hidden;
}
.actuary {
background: url("~@/assets/images/jinsuanbg.png") center no-repeat;
background: url("~@/assets/images/dataActuary/bg.png") center no-repeat;
background-size: cover;
padding-top: @headerH;
.act_cont {
margin: 120px auto;
position: relative;
z-index: 3;
.act_tit {
text-align: center;
margin: auto;
max-width: 800px;
max-width: 1300px;
h1 {
font-weight: 700;
font-size: 44px;
color: #ffffff;
font-size: 53px;
font-family: FZZhengHeiS-EB-GB;
color: #FFFFFF;
line-height: 64px;
letter-spacing: 6px;
background: linear-gradient(0deg, #D2F8FF 0%, #FFFFFF 88.37890625%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
p {
font-weight: 400;
font-size: 14px;
color: #ffffff;
line-height: 20px;
padding-top: 20px;
text-align: left;
font-size: 22px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #FFFFFF;
line-height: 34px;
}
}
.over_act_mod{
width: 1520px;
overflow: hidden;
margin: 50px auto 0;
}
.act_mod {
margin: 30px 100px 0;
display: flex;
flex-wrap: wrap;
.mod_max {
width: 344px;
height: 200px;
padding: 18px;
justify-content: space-between;
transition: all 1s ease 0s;
cursor: pointer;
&:hover > .flip {
transform: translateY(-10px);
.act_mod_item:hover{
// animation: startopen 1s normal 1 forwards;
transition: all 1s ease 0s;
overflow: hidden;
flex-shrink: 0;
width: 551px;
height: 450px;
background: url('~@/assets/images/dataActuary/bg-open.png') center no-repeat !important;
background-size: 100% 100%;
border-radius: 12px;
box-sizing: border-box;
padding: 90px 50px;
.actitem_tit{
width: 350px;
font-size: 31px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #FFFFFF;
line-height: 59px;
margin-bottom: 20px;
}
.flip {
width: 100%;
height: 100%;
border-radius: 8px;
background-color: #ffffff;
transition: all linear 200ms;
.actitem_tit::before{
content: none;
}
.mod_min {
width: 285px;
height: 100%;
margin: auto;
display: flex;
align-items: center;
img {
width: 85px;
height: 72px;
.actitem_p{
width: 350px;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
line-height: 28px;
}
.mod_cont {
width: 100%;
.name {
font-size: 18px;
font-weight: bold;
padding-bottom: 10px;
text-align: center;
}
.remark {
font-size: 14px;
line-height: 18px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
overflow: hidden;
.act_mod_item{
// animation: leaveopen .5s normal 1 forwards;
transition: all .5s ease 0s;
flex-shrink: 0;
width: 170px;
height: 450px;
border-radius: 12px;
margin:0 10px;
.actitem_p{
padding: 0 10px;
font-size: 12px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #0857E8;
line-height: 38px;
opacity: 0.7;
}
.actitem_tit{
font-size: 20px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #0857E8;
line-height: 38px;
padding:40px 10px 8px;
position: relative;
}
.actitem_tit::before{
content: "";
position: absolute;
left: 10px;
bottom: 0;
width: 30px;
height: 2px;
background: linear-gradient(to bottom right, #0857E8, #fff);
}
}
}
......
<template>
<div id="indexLizi" class="demo"></div>
</template>
<script>
import * as THREE from "three";
export default {
name: "Pointwave",
props: {
amountX: {
type: Number,
default: 50,
},
amountY: {
type: Number,
default: 50,
},
color: {
type: String,
default: "#10cbff",
},
top: {
type: Number,
default: 350,
},
},
data() {
return {
count: 0,
// 用来跟踪鼠标水平位置
mouseX: 0,
windowHalfX: null,
// 相机
camera: null,
// 场景
scene: null,
// 批量管理粒子
particles: null,
// 渲染器
renderer: null,
};
},
mounted() {
this.init();
this.animate();
},
methods: {
init() {
const SEPARATION = 100;
const SCREEN_WIDTH = window.innerWidth;
const SCREEN_HEIGHT = window.innerHeight;
const container = document.createElement("div");
this.windowHalfX = window.innerWidth / 2;
container.style.position = "relative";
container.style.top = `${this.top}px`;
container.style.height = `${SCREEN_HEIGHT - this.top}px`;
document.getElementById("indexLizi").appendChild(container);
this.camera = new THREE.PerspectiveCamera(
75,
SCREEN_WIDTH / SCREEN_HEIGHT,
1,
10000
);
this.camera.position.z = 1000;
this.scene = new THREE.Scene();
const numParticles = this.amountX * this.amountY;
const positions = new Float32Array(numParticles * 3);
const scales = new Float32Array(numParticles);
// 初始化粒子位置和大小
let i = 0;
let j = 0;
for (let ix = 0; ix < this.amountX; ix++) {
for (let iy = 0; iy < this.amountY; iy++) {
positions[i] = ix * SEPARATION - (this.amountX * SEPARATION) / 2;
positions[i + 1] = 0;
positions[i + 2] = iy * SEPARATION - (this.amountY * SEPARATION) / 2;
scales[j] = 1;
i += 3;
j++;
}
}
const geometry = new THREE.BufferGeometry();
geometry.setAttribute(
"position",
new THREE.BufferAttribute(positions, 3)
);
geometry.setAttribute("scale", new THREE.BufferAttribute(scales, 1));
// 初始化粒子材质
const material = new THREE.ShaderMaterial({
uniforms: {
color: { value: new THREE.Color(this.color) },
},
vertexShader: `
attribute float scale;
void main() {
vec4 mvPosition = modelViewMatrix * vec4( position, 2.0 );
gl_PointSize = scale * ( 300.0 / - mvPosition.z );
gl_Position = projectionMatrix * mvPosition;
}
`,
fragmentShader: `
uniform vec3 color;
void main() {
if ( length( gl_PointCoord - vec2( 0.5, 0.5 ) ) > 0.475 ) discard;
gl_FragColor = vec4( color, 1.0 );
}
`,
});
this.particles = new THREE.Points(geometry, material);
this.scene.add(this.particles);
this.renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
this.renderer.setSize(container.clientWidth, container.clientHeight);
this.renderer.setPixelRatio(window.devicePixelRatio);
this.renderer.setClearAlpha(0);
container.appendChild(this.renderer.domElement);
window.addEventListener("resize", this.onWindowResize, {
passive: false,
});
document.addEventListener("mousemove", this.onDocumentMouseMove, {
passive: false,
});
document.addEventListener("touchstart", this.onDocumentTouchStart, {
passive: false,
});
document.addEventListener("touchmove", this.onDocumentTouchMove, {
passive: false,
});
},
render() {
this.camera.position.x += (this.mouseX - this.camera.position.x) * 0.05;
this.camera.position.y = 400;
this.camera.lookAt(this.scene.position);
const positions = this.particles.geometry.attributes.position.array;
const scales = this.particles.geometry.attributes.scale.array;
// 计算粒子位置及大小
let i = 0;
let j = 0;
for (let ix = 0; ix < this.amountX; ix++) {
for (let iy = 0; iy < this.amountY; iy++) {
positions[i + 1] =
Math.sin((ix + this.count) * 0.3) * 100 +
Math.sin((iy + this.count) * 0.5) * 100;
scales[j] =
(Math.sin((ix + this.count) * 0.3) + 1) * 8 +
(Math.sin((iy + this.count) * 0.5) + 1) * 8;
i += 3;
j++;
}
}
// 重新渲染粒子
this.particles.geometry.attributes.position.needsUpdate = true;
this.particles.geometry.attributes.scale.needsUpdate = true;
this.renderer.render(this.scene, this.camera);
this.count += 0.1;
},
animate() {
requestAnimationFrame(this.animate);
this.render();
// setInterval(() => {
// }, 50);
},
onDocumentMouseMove(event) {
this.mouseX = event.clientX - this.windowHalfX;
},
onDocumentTouchStart(event) {
if (event.touches.length === 1) {
this.mouseX = event.touches[0].pageX - this.windowHalfX;
}
},
onDocumentTouchMove(event) {
if (event.touches.length === 1) {
event.preventDefault();
this.mouseX = event.touches[0].pageX - this.windowHalfX;
}
},
onWindowResize() {
this.windowHalfX = window.innerWidth / 2;
this.camera.aspect = window.innerWidth / window.innerHeight;
this.camera.updateProjectionMatrix();
this.renderer.setSize(window.innerWidth, window.innerHeight);
},
},
};
</script>
<style lang="less" scoped>
.demo {
width: 100%;
height: 100%;
// background: url("@/assets/img/demo/bg.png") no-repeat center;
}
</style>
\ No newline at end of file
<template>
<div class="route-view min-h-full w-full flex">
<div class="header w-full flex justify-between items-center text-white">
<div
class="header w-full flex justify-between items-center text-white"
:class="{ inside: !isHomePage }"
>
<a-space>
<img
class="logo cursor-pointer"
......@@ -20,15 +23,29 @@
</div>
</a-space>
<!-- 菜单 -->
<a-menu :selectedKeys="current" @click="handelClick" mode="horizontal">
<a-menu
v-if="isHomePage"
:selectedKeys="current"
@click="handelClick"
mode="horizontal"
>
<a-menu-item v-for="v in homeMenus" :key="v.url">
{{ v.name }}
</a-menu-item>
</a-menu>
<!-- 时间、用户信息展示 -->
<div class="flex items-center">
<div class="show-time flex flex-col items-end">
<div class="time">{{ nowTime }}</div>
<!-- 返回门户 -->
<div
v-if="!isHomePage"
class="flex flex-col items-center cursor-pointer"
@click="backHome"
>
<a-icon type="desktop" class="desktop mb-1" />
<p class="text-[14px]">返回门户</p>
</div>
<div v-if="isHomePage" class="show-time flex flex-col items-end">
<div class="time mb-1">{{ nowTime }}</div>
<div class="date">{{ nowDay }} {{ nowWeek }}</div>
</div>
<div class="line"></div>
......@@ -36,7 +53,7 @@
<a-dropdown>
<div class="flex items-center">
<div class="userInfo flex flex-col items-center cursor-pointer">
<span>
<span class="mb-1">
{{ userData.loginName ? userData.loginName : "--" }}
</span>
<span>
......@@ -81,6 +98,12 @@ export default {
nowDay: "",
nowWeek: "",
visibleEditPwd: false,
homePage: [
"/home/dataManagement",
"/home/siteArrange",
"/home/dataActuary",
"/home/thePlatformIsSet/setPlatformes",
],
};
},
computed: {
......@@ -94,6 +117,11 @@ export default {
}
return [path];
},
isHomePage() {
let cur = this.$route.path;
let curParent = this.$route.matched[1]?.path;
return this.homePage.includes(cur) || this.homePage.includes(curParent);
},
},
created() {
this.setMoment();
......@@ -107,7 +135,12 @@ export default {
this.$router.go(0);
},
backHome() {
this.$router.push("/datamanage");
let path = storage.get(1, "routeInfo");
if (path) {
this.$router.push(path);
} else {
this.$router.push("/home");
}
},
setMoment() {
this.timer = setInterval(() => {
......@@ -144,6 +177,7 @@ export default {
});
},
handelClick(route) {
storage.set(1, "routeInfo", route.key);
this.$router.push(route.key);
},
},
......@@ -237,6 +271,7 @@ export default {
.date {
font-family: Source Han Sans CN;
font-weight: 500;
font-size: 14px;
}
.line {
width: 1px;
......@@ -245,4 +280,7 @@ export default {
background: #ffffff;
}
}
.inside {
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%) !important;
}
</style>
......@@ -67,7 +67,7 @@
<script>
import { LoginInterface } from "@/api/user.js";
import { mapMutations } from "vuex";
import { mapMutations, mapState } from "vuex";
import { changeAccount } from "@/utils/js/validate";
import { encrypt } from "@/utils";
import storage from "@/utils/js/Storage";
......@@ -97,7 +97,13 @@ export default {
},
};
},
computed: {
...mapState("user", ["token"]),
},
created() {
if (this.token) {
this.$router.push("/home");
}
this.createCode();
},
methods: {
......
This diff is collapsed.
......@@ -41,3 +41,16 @@ CREATE TABLE `mortals_xhx_user_pwd_record` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户密码修改记录';
UPDATE mortals_xhx_user SET lastUpdatePwdTime=NOW();
-- ----------------------------
2023-08-29
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_user_model_collect`;
CREATE TABLE `mortals_xhx_user_model_collect` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增长',
`userId` bigint(20) DEFAULT NULL COMMENT '用户ID,主键,自增长',
`realName` varchar(64) DEFAULT NULL COMMENT '登录名',
`modelIds` varchar(128) DEFAULT NULL COMMENT '收藏模块',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户模块收藏';
\ No newline at end of file
......@@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.common.code.ModelTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.ModelPdu;
import com.mortals.xhx.feign.model.IApiModelFeign;
......@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -113,6 +114,73 @@ public class ModelController extends BaseJsonBodyController {
return ret;
}
/**
* 根据站点id查询模块列表
* @param query
* @return
*/
@PostMapping({"list/group"})
public Rest<Object> getListGroup(@RequestBody ModelVO query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "查询站点编排" ;
int code=1;
try {
if(this.getCurUser()==null){
throw new AppException("未登录或者登录过期");
}
ModelPdu modelPdu = new ModelPdu();
modelPdu.setSiteId(query.getSiteId());
if(this.getCurUser().getId()==1 && StringUtils.isEmpty(this.getCurUser().getSiteIds())){
modelPdu.setIsAdmin(1);
}else {
modelPdu.setIsAdmin(0);
}
//ApiResp<List<ModelFeignVO>> apiResp = apiModelFeign.getModelBySiteId(modelPdu);
String resp = apiModelFeign.getModelBySiteId(modelPdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取站点列表信息失败:" + apiResp.getMsg());
}
Map<Long,Long> map = roleModelService.getModelIdsUserId(this.getCurUser().getId());
List<ModelFeignVO> modelFeignVOList = JSONObject.parseArray(apiResp.getData().get("data").toString(),ModelFeignVO.class);
List<ModelFeignVO> list = modelFeignVOList.stream().filter(item->map.containsKey(item.getId())).collect(Collectors.toList());
if(this.getCurUser().getId()==1){
model.put("data", doGroup(modelFeignVOList));
}else {
model.put("data", doGroup(list));
}
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
private List<Map<String,Object>> doGroup(List<ModelFeignVO> result){
Map<Integer,List<ModelFeignVO>> groupMap = result.stream().collect(Collectors.groupingBy(t -> t.getType()));
List<Map<String,Object>> mapList = new ArrayList<>();
Map<String,Object> jcMap = new HashMap<>();
jcMap.put("type",ModelTypeEnum.JC.getDesc());
jcMap.put("list",groupMap.get(ModelTypeEnum.JC.getValue()));
mapList.add(jcMap);
Map<String,Object> g2gMap = new HashMap<>();
jcMap.put("type",ModelTypeEnum.G2G.getDesc());
jcMap.put("list",groupMap.get(ModelTypeEnum.G2G.getValue()));
mapList.add(g2gMap);
Map<String,Object> g2cMap = new HashMap<>();
jcMap.put("type",ModelTypeEnum.G2C.getDesc());
jcMap.put("list",groupMap.get(ModelTypeEnum.G2C.getValue()));
mapList.add(g2cMap);
return mapList;
}
/**
* 根据站点id查询数据管理列表
* @param query
......
......@@ -13,5 +13,5 @@ import java.util.List;
public interface PageInfoDao extends ICRUDDao<PageInfoEntity,Long>{
List<PageInfoEntity> getProductList();
}
package com.mortals.xhx.module.page.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.page.dao.PageInfoDao;
import com.mortals.xhx.module.page.model.PageInfoEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 产品页面配置DaoImpl DAO接口
......@@ -17,5 +17,8 @@ import java.util.List;
public class PageInfoDaoImpl extends BaseCRUDDaoMybatis<PageInfoEntity,Long> implements PageInfoDao {
@Override
public List<PageInfoEntity> getProductList() {
return this.getSqlSession().selectList(this.getSqlId("getProductList"));
}
}
package com.mortals.xhx.module.page.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.page.model.PageInfoEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 产品页面配置视图对象
*
......
......@@ -3,6 +3,9 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.page.model.PageInfoEntity;
import java.util.List;
/**
* PageInfoService
*
......@@ -21,4 +24,6 @@ public interface PageInfoService extends ICRUDService<PageInfoEntity,Long>{
* @throws AppException
*/
PageInfoEntity saveScreen(PageInfoEntity entity, Context context) throws AppException;
List<PageInfoEntity> getProductList() throws AppException;
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import com.mortals.xhx.module.page.model.PageInfoEntity;
import com.mortals.xhx.module.page.service.PageInfoService;
import java.util.Date;
import java.util.List;
/**
* PageInfoService
......@@ -82,6 +83,11 @@ public class PageInfoServiceImpl extends AbstractCRUDServiceImpl<PageInfoDao, Pa
}
}
@Override
public List<PageInfoEntity> getProductList() throws AppException {
return dao.getProductList();
}
private void doSaveImageBase64(PageInfoEntity entity,String oldName){
String base64 = String.valueOf(entity.getScreenUrl());
base64 = base64.replaceAll("data:image/png;base64,","");
......
......@@ -57,13 +57,27 @@ public class PageInfoController extends BaseCRUDJsonBodyMappingController<PageIn
Context context = this.getContext();
String busiDesc = "查询产品列表";
int code;
int code=1;
try {
List<PageInfoEntity> list = service.getProductList();
Map<Long,Long> productMap = new HashMap<>();
for(PageInfoEntity infoEntity:list){
productMap.put(infoEntity.getProductId(),infoEntity.getProductId());
}
//
// model.put("data", result);
// model.put("message_info", busiDesc + "成功");
Rest<RespData<List<ProductPdu>>> result = productFeign.list(query);
code = result.getCode();
if(code > 0) {
model.put("data", result.getData().getData());
model.put("pageInfo", result.getData().getPageInfo());
List<ProductPdu> pduList = new ArrayList<>();
for(ProductPdu pdu:result.getData().getData()){
if(productMap.containsKey(pdu.getId())){
pduList.add(pdu);
}
}
model.put("data", pduList);
// model.put("pageInfo", result.getData().getPageInfo());
model.put("dict", result.getData().getDict());
model.put("message_info", busiDesc + "成功");
}else {
......
package com.mortals.xhx.module.user.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.user.model.UserModelCollectEntity;
import java.util.List;
/**
* 用户模块收藏Dao
* 用户模块收藏 DAO接口
*
* @author zxfei
* @date 2023-08-29
*/
public interface UserModelCollectDao extends ICRUDDao<UserModelCollectEntity,Long>{
}
package com.mortals.xhx.module.user.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.user.dao.UserModelCollectDao;
import com.mortals.xhx.module.user.model.UserModelCollectEntity;
import org.springframework.stereotype.Repository;
/**
* 用户模块收藏DaoImpl DAO接口
*
* @author zxfei
* @date 2023-08-29
*/
@Repository("userModelCollectDao")
public class UserModelCollectDaoImpl extends BaseCRUDDaoMybatis<UserModelCollectEntity,Long> implements UserModelCollectDao {
}
package com.mortals.xhx.module.user.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.user.model.vo.UserModelCollectVo;
import lombok.Data;
/**
* 用户模块收藏实体对象
*
* @author zxfei
* @date 2023-08-29
*/
@Data
public class UserModelCollectEntity extends UserModelCollectVo {
private static final long serialVersionUID = 1L;
/**
* 用户ID,主键,自增长
*/
private Long userId;
/**
* 登录名
*/
private String realName;
/**
* 收藏模块
*/
private String modelIds;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof UserModelCollectEntity) {
UserModelCollectEntity tmp = (UserModelCollectEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.userId = -1L;
this.realName = "";
this.modelIds = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.user.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.user.model.UserModelCollectEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 用户模块收藏视图对象
*
* @author zxfei
* @date 2023-08-29
*/
@Data
public class UserModelCollectVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.user.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.user.model.UserModelCollectEntity;
import com.mortals.xhx.module.user.dao.UserModelCollectDao;
/**
* UserModelCollectService
*
* 用户模块收藏 service接口
*
* @author zxfei
* @date 2023-08-29
*/
public interface UserModelCollectService extends ICRUDService<UserModelCollectEntity,Long>{
UserModelCollectDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.user.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.user.dao.UserModelCollectDao;
import com.mortals.xhx.module.user.model.UserModelCollectEntity;
import com.mortals.xhx.module.user.service.UserModelCollectService;
import lombok.extern.slf4j.Slf4j;
/**
* UserModelCollectService
* 用户模块收藏 service实现
*
* @author zxfei
* @date 2023-08-29
*/
@Service("userModelCollectService")
@Slf4j
public class UserModelCollectServiceImpl extends AbstractCRUDServiceImpl<UserModelCollectDao, UserModelCollectEntity, Long> implements UserModelCollectService {
}
\ No newline at end of file
package com.mortals.xhx.module.user.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.utils.BeanUtil;
import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.ModelPdu;
import com.mortals.xhx.feign.model.IApiModelFeign;
import com.mortals.xhx.feign.model.vo.ModelFeignVO;
import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.module.user.model.UserModelCollectEntity;
import com.mortals.xhx.module.user.service.UserModelCollectService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
/**
*
* 用户模块收藏
*
* @author zxfei
* @date 2023-08-29
*/
@RestController
@RequestMapping("user/model/collect")
public class UserModelCollectController extends BaseCRUDJsonBodyMappingController<UserModelCollectService,UserModelCollectEntity,Long> {
@Autowired
private IApiModelFeign apiModelFeign;
public UserModelCollectController(){
super.setModuleDesc( "用户模块收藏");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
@PostMapping({"get"})
public String getCollect() {
Map<String, Object> model = new HashMap();
JSONObject ret = new JSONObject();
String busiDesc = "查看" + this.getModuleDesc();
Context context = this.getContext();
model.put("data", Collections.emptyList());
try {
UserModelCollectEntity query = new UserModelCollectEntity();
query.setUserId(this.getCurUser().getId());
UserModelCollectEntity entity = this.service.selectOne(query);
if (entity == null) {
entity = new UserModelCollectEntity();
entity.setUserId(this.getCurUser().getId());
entity.setRealName(this.getCurUser().getRealName());
entity.setModelIds("");
}else {
if(StringUtils.isNotEmpty(entity.getModelIds())){
List<Long> idList = new ArrayList();
for(String id:entity.getModelIds().split(",")){
Long idL = DataUtil.converStr2Long(id,0l);
idList.add(idL);
}
ModelPdu pdu = new ModelPdu();
pdu.setIdList(idList);
String resp = apiModelFeign.getModelByQuery(pdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException("获取站点列表信息失败:" + apiResp.getMsg());
}
try {
List<ModelFeignVO> modelFeignVOList = JSONArray.parseArray(JSONObject.toJSONString(apiResp.getData().get("data")), ModelFeignVO.class);
Map<Long,ModelFeignVO> map = new HashMap<>();
for (ModelFeignVO vo:modelFeignVOList){
map.put(vo.getId(),vo);
}
List<ModelFeignVO> result = new ArrayList<>();
for(Long id:idList){
result.add(map.get(id));
}
model.put("data", result);
}catch (Exception e){
model.put("data", apiResp.getData().get("data"));
}
}
}
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var8) {
this.doException(this.request, busiDesc, model, var8);
Object msg = model.get("message_info");
return this.createFailJsonResp(msg == null ? "系统异常" : msg.toString());
}
ret.put("data", model.get("data"));
ret.put("code", 1);
ret.put("msg", model.remove("message_info"));
return ret.toJSONString();
}
@Override
@PostMapping({"save"})
@RepeatSubmit
public String save(@RequestBody UserModelCollectEntity entity) {
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "保存" + this.getModuleDesc();
if(StringUtils.isEmpty(entity.getModelIds())){
return this.createFailJsonResp("请选择要收藏的模块");
}
try {
UserModelCollectEntity query = new UserModelCollectEntity();
query.setUserId(this.getCurUser().getId());
UserModelCollectEntity temp = this.service.selectOne(query);
if (temp == null) {
Class<UserModelCollectEntity> tClass = ReflectUtils.getClassGenricType(this.getClass(), 1);
UserModelCollectEntity initEntity = (UserModelCollectEntity)tClass.newInstance();
initEntity.initAttrValue();
BeanUtils.copyProperties(entity, initEntity, BeanUtil.getNullPropertyNames(entity));
entity = initEntity;
busiDesc = "新增" + this.getModuleDesc();
initEntity.setCreateTime(new Date());
IUser user = this.getCurUser();
if (user != null) {
initEntity.setUserId(user.getId());
initEntity.setRealName(user.getRealName());
}
this.service.save(initEntity, context);
} else {
busiDesc = "修改" + this.getModuleDesc();
entity.setId(temp.getId());
this.service.update(entity, context);
}
model.put("id", entity.getId());
code = this.saveAfter(entity, model, context);
model.put("entity", entity);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + entity.getId() + "]");
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", entity);
this.init(model, context);
code = this.saveException(entity, model, context, var9);
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.page.dao.ibatis.PageInfoDaoImpl">
<select id="getProductList" resultMap="PageInfoEntity-Map">
SELECT DISTINCT t.productId,t.productName FROM mortals_xhx_page_info t ORDER BY t.productId;
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment