Commit 9b3f384b authored by 王晓旭's avatar 王晓旭

修改数据精算门户样式

parents 38f5bf62 e6f7a8c0
<template> <template>
<div class="header-site"> <div :trigger="['click']" class="trigger" @click="ontrigger">
<a-popover trigger="click" placement="bottomLeft" v-model="visible"> <slot>
<a class="ant-dropdown-link" @click="visible = true"> <a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
{{ siteName }} <a-icon type="down" /> {{ siteName }} <a-icon type="down" />
</a> </a>
<template slot="content"> </slot>
<div class="content" style="min-width: 50vw; min-height: 200px"> <div
slot="overlay"
class="select-site"
:style="{ left: `${offsetLeft}px` }"
v-if="show"
>
<div class="flex_row flex_align_c primary-color name"> <div class="flex_row flex_align_c primary-color name">
<a-icon type="environment" style="margin-right: 10px" /> <a-icon type="environment" style="margin-right: 10px" />
<span style="">{{ siteName }}</span> <span style="">{{ siteName }}</span>
...@@ -22,6 +27,7 @@ ...@@ -22,6 +27,7 @@
<div class="check-site"> <div class="check-site">
<span>您的选择是:</span> <span>您的选择是:</span>
<span <span
class="check-item"
v-for="(item, index) in checkarr" v-for="(item, index) in checkarr"
:key="index" :key="index"
@click="updataSite(item)" @click="updataSite(item)"
...@@ -29,28 +35,26 @@ ...@@ -29,28 +35,26 @@
> >
</div> </div>
<div class="site-btn"> <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
> >
<a-button type="primary" @click="onSucessSite" :disabled="isSite" <a-button type="primary" @click="onSucessSite" :disabled="isSite"
>确定</a-button >确定</a-button
> >
</div> </div>
</div> </div>
</template>
</a-popover>
</div> </div>
</template> </template>
<script> <script>
import { getSiteTree } from "@/services/basicsetFun"; import { getSiteTree } from "@/services/basicsetFun";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import local from "@/utils/local"; import local from "@/utils/local";
// import Cookie from "js-cookie";
export default { export default {
data() { data() {
return { return {
sitelist: [], sitelist: [],
visible: false, show: false,
offsetLeft: 0, offsetLeft: 0,
checkarr: [], //选中站点 checkarr: [], //选中站点
checkid: undefined, //最终选中站点 checkid: undefined, //最终选中站点
...@@ -62,13 +66,17 @@ export default { ...@@ -62,13 +66,17 @@ export default {
created() { created() {
this.getwaitedListdata(); this.getwaitedListdata();
}, },
mounted() {}, mounted() {
const { offsetLeft } = this.$el;
this.offsetLeft = offsetLeft;
},
methods: { methods: {
...mapMutations("site", ["SET_SITE_ID", "SET_siteName"]), ...mapMutations("site", ["SET_SITE_ID", "SET_siteName"]),
// 确认站点 // 确认站点
onSucessSite() { onSucessSite() {
if (this.checkarr.length == 0) return; if (this.checkarr.length == 0) return;
let obj = this.checkarr[this.checkarr.length - 1]; let obj = this.checkarr[this.checkarr.length - 1];
this.clickSite(obj); this.clickSite(obj);
}, },
// 选中 // 选中
...@@ -76,16 +84,22 @@ export default { ...@@ -76,16 +84,22 @@ export default {
this.checkid = undefined; this.checkid = undefined;
// 为子节点不添加数据 // 为子节点不添加数据
let data = this.checkarr[this.checkarr.length - 1]; let data = this.checkarr[this.checkarr.length - 1];
if (data && (data.isLeaf || data.children.length == 0)) { if (data && (data.isLeaf || data.children.length == 0)) {
// 如果为子节点更新最后一个数据 // 如果为子节点更新最后一个数据
this.checkid = obj.id; this.checkid = obj.id;
this.checkarr[this.checkarr.length - 1] = obj; this.checkarr[this.checkarr.length - 1] = obj;
// 如果选中数据有子集更新站点列表
if (obj.children && obj.children.length > 0) {
this.sitelist = obj.children;
}
} else { } else {
this.checkarr.push(obj); this.checkarr.push(obj);
if (obj.children && obj.children.length > 0) { if (obj.children && obj.children.length > 0) {
this.sitelist = obj.children; this.sitelist = obj.children;
} }
} }
if (obj && obj.type == "site") { if (obj && obj.type == "site") {
this.isSite = false; this.isSite = false;
} else { } else {
...@@ -136,17 +150,13 @@ export default { ...@@ -136,17 +150,13 @@ export default {
}); });
}, },
clickSite(obj) { clickSite(obj) {
// Cookie.set("siteid", obj.id);
// let siteInfo = {
// siteName: obj.label,
// siteid: obj.id,
// };
local.setLocal("siteId", obj.id); local.setLocal("siteId", obj.id);
local.setLocal("siteName", obj.label); local.setLocal("siteName", obj.label);
this.SET_SITE_ID(obj.id); this.SET_SITE_ID(obj.id);
this.SET_siteName(obj.label); this.SET_siteName(obj.label);
this.show = false; this.show = false;
if (location.href.search(/token/gi) >= 0) { if (location.href.search(/token/gi) >= 0) {
this.$router.push({ path: "/resource/advimg" });
setTimeout(() => { setTimeout(() => {
location.reload(); location.reload();
}); });
...@@ -163,28 +173,43 @@ export default { ...@@ -163,28 +173,43 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.trigger {
display: inline-block;
position: relative;
}
.ant-dropdown-link { .ant-dropdown-link {
color: #fff;
padding: 0 20px; padding: 0 20px;
font-size: 16px; font-size: 16px;
min-width: 200px; min-width: 200px;
display: inline-block; display: inline-block;
color: #fff;
} }
.content { .select-site {
display: flex; position: fixed;
flex-direction: column; left: 0;
justify-content: space-around; 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 { .name {
font-size: 20px; font-size: 20px;
} }
.site-list { .site-list {
// padding: 10px 0;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
display: flex; overflow: hidden;
flex-wrap: wrap;
span { span {
float: left;
line-height: 1.5; line-height: 1.5;
padding: 10px 20px; padding: 10px 20px;
display: inline-block;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: #1890ff; color: #1890ff;
...@@ -195,7 +220,7 @@ export default { ...@@ -195,7 +220,7 @@ export default {
.site-btn { .site-btn {
padding: 0 20px; padding: 0 20px;
} }
.check-site { .check-item {
cursor: pointer; cursor: pointer;
} }
} }
......
...@@ -69,6 +69,10 @@ ...@@ -69,6 +69,10 @@
<template slot="sort" slot-scope="text"> <template slot="sort" slot-scope="text">
{{ text.sort ? text.sort : "--" }} {{ text.sort ? text.sort : "--" }}
</template> </template>
<!-- 类型 -->
<template slot="type" slot-scope="text">
{{ text.type ? dict.type[text.type] : "--" }}
</template>
<!-- 创建时间 --> <!-- 创建时间 -->
<template slot="createTime" slot-scope="text"> <template slot="createTime" slot-scope="text">
{{ text.createTime | dateFormat }} {{ text.createTime | dateFormat }}
...@@ -148,6 +152,21 @@ ...@@ -148,6 +152,21 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </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-col :span="12">
<a-form-model-item label="排序" prop="sort"> <a-form-model-item label="排序" prop="sort">
<a-input-number <a-input-number
...@@ -180,27 +199,6 @@ ...@@ -180,27 +199,6 @@
<div class="ant-upload-text">点击上传</div> <div class="ant-upload-text">点击上传</div>
</div> </div>
</a-upload> </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-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -275,6 +273,10 @@ const columns = [ ...@@ -275,6 +273,10 @@ const columns = [
width: "5%", width: "5%",
scopedSlots: { customRender: "sort" }, scopedSlots: { customRender: "sort" },
}, },
{
title: "类型",
scopedSlots: { customRender: "type" },
},
{ {
title: "创建时间", title: "创建时间",
width: "12%", width: "12%",
...@@ -317,6 +319,7 @@ export default { ...@@ -317,6 +319,7 @@ export default {
modelUrl: "", // 模块地址 modelUrl: "", // 模块地址
remark: "", // 备注 remark: "", // 备注
sort: "", // 排序 sort: "", // 排序
type: undefined, // 类型
}, },
current: 1, current: 1,
size: 10, size: 10,
...@@ -336,9 +339,13 @@ export default { ...@@ -336,9 +339,13 @@ export default {
modelIcon: [ modelIcon: [
{ required: true, message: "模块图标不能为空", trigger: "change" }, { required: true, message: "模块图标不能为空", trigger: "change" },
], ],
type: [
{ required: true, message: "模块类型不能为空", trigger: "change" },
],
}, },
StatementVisible: false, StatementVisible: false,
modelInfo: {}, modelInfo: {},
dict: {},
}; };
}, },
created() { created() {
...@@ -354,13 +361,16 @@ export default { ...@@ -354,13 +361,16 @@ export default {
modelName: `%${this.searchValue}%`, modelName: `%${this.searchValue}%`,
...search, ...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) { if (!data.length && this.current > 1) {
this.current -= 1; this.current -= 1;
this.getmodelList(); this.getmodelList();
} }
this.dict = dict;
this.total = pageInfo.totalResult; this.total = pageInfo.totalResult;
this.modelList = data; this.modelList = data;
}
this.loading = false; this.loading = false;
}, },
// 新增按钮 // 新增按钮
......
...@@ -22,7 +22,6 @@ import java.util.ArrayList; ...@@ -22,7 +22,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 模块 * 模块
...@@ -135,18 +134,7 @@ public class ModelController extends BaseCRUDJsonBodyMappingController<ModelServ ...@@ -135,18 +134,7 @@ public class ModelController extends BaseCRUDJsonBodyMappingController<ModelServ
int code=1; int code=1;
try { try {
List<ModelEntity> result = this.getService().getListBySiteId(query.getSiteId(),query.getIsAdmin()); List<ModelEntity> result = this.getService().getListBySiteId(query.getSiteId(),query.getIsAdmin());
Map<Integer,List<ModelEntity>> groupMap = result.stream().collect(Collectors.groupingBy(t -> t.getType())); model.put("data", result);
List<Map<String,List<ModelEntity>>> mapList = new ArrayList<>();
Map<String,List<ModelEntity>> jcMap = new HashMap<>();
jcMap.put(ModelTypeEnum.JC.getDesc(),groupMap.get(ModelTypeEnum.JC.getValue()));
mapList.add(jcMap);
Map<String,List<ModelEntity>> g2gMap = new HashMap<>();
g2gMap.put(ModelTypeEnum.G2G.getDesc(),groupMap.get(ModelTypeEnum.G2G.getValue()));
mapList.add(g2gMap);
Map<String,List<ModelEntity>> g2cMap = new HashMap<>();
g2cMap.put(ModelTypeEnum.G2C.getDesc(),groupMap.get(ModelTypeEnum.G2C.getValue()));
mapList.add(g2cMap);
model.put("data", mapList);
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】"); this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) { } catch (Exception var9) {
......
...@@ -38,6 +38,11 @@ public class ModelFeignVO implements Serializable { ...@@ -38,6 +38,11 @@ public class ModelFeignVO implements Serializable {
@JSONField(serialize = false) @JSONField(serialize = false)
private Integer sort; private Integer sort;
/**
* 模块分类
*/
private Integer type;
/** 模块下包含的数据统计 */ /** 模块下包含的数据统计 */
private List<ModelCensusFeignVO> censusList; private List<ModelCensusFeignVO> censusList;
} }
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"echarts": "^5.3.3", "echarts": "^5.3.3",
"element-ui": "^2.15.8", "element-ui": "^2.15.8",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"gsap": "^3.12.2",
"heatmap.js": "^2.0.5", "heatmap.js": "^2.0.5",
"highlight.js": "^11.5.1", "highlight.js": "^11.5.1",
"js-export-excel": "^1.1.4", "js-export-excel": "^1.1.4",
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
"vue-highlightjs": "^1.3.3", "vue-highlightjs": "^1.3.3",
"vue-lazyload": "1.3.3", "vue-lazyload": "1.3.3",
"vue-router": "^3.5.1", "vue-router": "^3.5.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2", "vuex": "^3.6.2",
"vuex-persistedstate": "^4.1.0" "vuex-persistedstate": "^4.1.0"
}, },
......
...@@ -24,6 +24,10 @@ import "@/assets/fonts/iconfont.css"; ...@@ -24,6 +24,10 @@ import "@/assets/fonts/iconfont.css";
import customComponents from "@/components"; import customComponents from "@/components";
Vue.use(customComponents); Vue.use(customComponents);
// 拖动插件
import draggable from "vuedraggable";
Vue.component("draggable", draggable);
// 引入注册全局指令 // 引入注册全局指令
import * as directives from "@/directive"; import * as directives from "@/directive";
Object.keys(directives).forEach((name) => Object.keys(directives).forEach((name) =>
......
...@@ -16,7 +16,7 @@ export default { ...@@ -16,7 +16,7 @@ export default {
showTotal: (total, range) => `共${total}条`, showTotal: (total, range) => `共${total}条`,
pageSizeOptions: ["10", "20", "30"], pageSizeOptions: ["10", "20", "30"],
}, },
} };
}, },
computed: { computed: {
menuRouterList() { menuRouterList() {
...@@ -34,29 +34,13 @@ export default { ...@@ -34,29 +34,13 @@ export default {
MenuChildren() { MenuChildren() {
let routerPath = this.$route.path.substr( let routerPath = this.$route.path.substr(
this.$route.path.lastIndexOf("/") + 1 this.$route.path.lastIndexOf("/") + 1
) );
let result = getItemData( let result = getItemData(this.menuTree_X, "routerPath", routerPath);
this.menuTree_X,
'routerPath',
routerPath,
)
return result ? result : { children: [] }; return result ? result : { children: [] };
}
},
created() {
}, },
beforeDestroy() {
}, },
created() {},
beforeDestroy() {},
methods: { methods: {
...mapMutations("menu", ["SET_menuList_X", "SET_menuTree_X"]), ...mapMutations("menu", ["SET_menuList_X", "SET_menuTree_X"]),
getMenuList(isFirst = false) { getMenuList(isFirst = false) {
...@@ -72,18 +56,17 @@ export default { ...@@ -72,18 +56,17 @@ export default {
} }
menuList(obj).then((res) => { menuList(obj).then((res) => {
// console.log(res); // console.log(res);
let { code, data, dict } = res; let { code, data, dict } = res.data;
if (code == 1) { if (code == 1) {
data.data = data.data.map((item) => { data.data = data.data.map((item) => {
this.menuRouterList.forEach(v => { this.menuRouterList.forEach((v) => {
if (v['title'] == item.name) { if (v["title"] == item.name) {
item["routerPath"] = v['routerPath']; item["routerPath"] = v["routerPath"];
} }
}) });
item["value"] = item.id; item["value"] = item.id;
item["label"] = item.name; item["label"] = item.name;
return item; return item;
}); });
// console.log(data.data); // console.log(data.data);
...@@ -99,7 +82,6 @@ export default { ...@@ -99,7 +82,6 @@ export default {
this.MenuDict = dict; this.MenuDict = dict;
this.MenuDict["MenuTree"] = deepClone(this.menuTreeData); this.MenuDict["MenuTree"] = deepClone(this.menuTreeData);
// console.log(this.menuListData); // console.log(this.menuListData);
// console.log(this.menuTreeData); // console.log(this.menuTreeData);
// this.getMenuDict(); //弃用 // this.getMenuDict(); //弃用
...@@ -143,7 +125,5 @@ export default { ...@@ -143,7 +125,5 @@ export default {
// console.log(err); // console.log(err);
}); });
}, },
}, },
} };
\ No newline at end of file
...@@ -39,6 +39,7 @@ axios.interceptors.response.use( ...@@ -39,6 +39,7 @@ axios.interceptors.response.use(
// 取出数据 // 取出数据
let { code, msg } = response.data; let { code, msg } = response.data;
if (code === -1) { if (code === -1) {
console.log(response.data);
message.error({ message.error({
content: msg, content: msg,
maxCount: 1, maxCount: 1,
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 时间、用户信息展示 --> <!-- 时间、用户信息展示 -->
<div class="flex items-center"> <div class="flex items-center">
<div class="show-time flex flex-col items-end"> <div class="show-time flex flex-col items-end">
<div class="time">{{ nowTime }}</div> <div class="time mb-1">{{ nowTime }}</div>
<div class="date">{{ nowDay }} {{ nowWeek }}</div> <div class="date">{{ nowDay }} {{ nowWeek }}</div>
</div> </div>
<div class="line"></div> <div class="line"></div>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<a-dropdown> <a-dropdown>
<div class="flex items-center"> <div class="flex items-center">
<div class="userInfo flex flex-col items-center cursor-pointer"> <div class="userInfo flex flex-col items-center cursor-pointer">
<span> <span class="mb-1">
{{ userData.loginName ? userData.loginName : "--" }} {{ userData.loginName ? userData.loginName : "--" }}
</span> </span>
<span> <span>
...@@ -236,6 +236,7 @@ export default { ...@@ -236,6 +236,7 @@ export default {
.date { .date {
font-family: Source Han Sans CN; font-family: Source Han Sans CN;
font-weight: 500; font-weight: 500;
font-size: 14px;
} }
.line { .line {
width: 1px; width: 1px;
......
<template> <template>
<div class="station w-full h-auto"> <div class="station w-full h-auto">
<a-carousel <div class="title flex flex-col items-center">
effect="fade" <img
autoplay class="img-title mb-[42px] mt-[230px]"
:autoplaySpeed="2000" src="@/assets/images/siteArrange/title.png"
:dots="false" />
style="width: 100%; height: 100%; overflow: hidden" <div class="slogan">建设高效便民、智慧泛在的智慧政务大厅</div>
>
<div class="img_box img1"></div>
<!-- style="
height: 100vh;
width: 100%;
background: url('@/assets/images/bg.jpg') center no-repeat;
overflow: hidden;
background-size: cover;
" -->
<div class="img_box img2"></div>
<div class="img_box img3"></div>
</a-carousel>
<div class="title">
<h3 style="text-align: center; font-size: 50px">宜人·宜宾·宜办事</h3>
<!-- <p>“互联网+政务服务”整体解决方案提供商和服务商</p> -->
</div> </div>
<div class="classification"> <!-- 站点列表 -->
<div class="modules"> <div class="">
<!-- 常用 -->
<div class="common flex items-center justify-between">
<draggable
v-model="siteModelList"
:group="{
name: 'itxst',
pull: true,
put: changeCommon,
}"
animation="500"
delay="50"
draggable=".common-item"
class="common-list"
dragClass="dragClass"
@remove="handleRemove"
>
<div <div
class="mod_max" class="common-item w-[160px] flex flex-col items-center cursor-pointer"
v-for="item of siteModelList" v-for="v in siteModelList"
:key="item.id" :key="v.id"
@click="openWindow(item)"
> >
<div class="picture" :style="{ background: item.color }"> <div class="item-logo">
<img <img
width="40" class="w-full h-full object-cover"
height="35" :src="api + v.modelIcon"
:src="
item.modelIcon
? api + item.modelIcon
: require('../../assets/images/u222.svg')
"
alt
/> />
<img
class="bottom-img"
src="@/assets/images/siteArrange/pic-bottom.png"
/>
</div>
<div class="text-white mt-[10px] leading-[20px]">
{{ v.modelName }}
</div> </div>
<div class="name" style="margin-top: 10px">{{ item.modelName }}</div>
</div> </div>
</draggable>
<div class="w-[160px] flex justify-center items-center">
<img
class="cursor-pointer"
src="@/assets/images/siteArrange/extension.png"
/>
</div> </div>
</div> </div>
<!-- 站点列表 -->
<div class="site-box"></div>
</div>
</div> </div>
</template> </template>
<script> <script>
import menu from "@/mixins/menu";
import { appsListInterface } from "@/api/siteArrange"; import { appsListInterface } from "@/api/siteArrange";
import Storage from "@/utils/js/Storage"; import Storage from "@/utils/js/Storage";
export default { export default {
mixins: [menu],
data() { data() {
return { return {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
siteId: "", siteId: Storage.get(2, "siteId"),
commonList: [],
siteModelList: [], // 站点编排列表 siteModelList: [], // 站点编排列表
}; };
}, },
created() { created() {
this.getMenuList(true);
this.appsListInterface();
this.$bus.$on("changeSite", () => {
this.appsListInterface(); this.appsListInterface();
});
}, },
methods: { methods: {
async appsListInterface() { async appsListInterface() {
this.siteId = Storage.get(2, "siteId");
let res = await appsListInterface({ siteId: this.siteId }); let res = await appsListInterface({ siteId: this.siteId });
let { data } = res.data; if (res.data.code == 1) {
let color = []; let { data } = res.data.data;
let colorArr = ["#546DFF", "#1E6FFF", "#3CBFFF", "#00AA5B", "#FFAB00"]; this.siteModelList = data.slice(0, 10);
color = colorArr.concat( console.log(this.siteModelList);
colorArr, }
colorArr,
colorArr,
colorArr,
colorArr,
colorArr
);
this.siteModelList = data.map((v, i) => {
v["color"] = color[i];
return v;
});
}, },
openWindow(row) { openWindow(row) {
let token = Storage.get(2, "Authorization"); let token = Storage.get(2, "Authorization");
...@@ -110,102 +103,46 @@ export default { ...@@ -110,102 +103,46 @@ export default {
"_blank" "_blank"
); );
}, },
handleRemove(e) {
console.log(e);
},
changeCommon() {},
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@headerH: 4.5rem;
.ant-carousel :deep(.slick-slide) {
width: 100%;
height: 100%;
overflow: hidden;
.img_box {
width: 100%;
height: 92.1vh;
overflow: hidden;
background-size: cover;
}
.img1 {
background: url("~@/assets/images/bg.jpg") center no-repeat;
}
.img2 {
background: url("~@/assets/images/bgg1.jpg") center no-repeat;
}
.img3 {
background: url("~@/assets/images/bgg2.jpg") center no-repeat;
}
}
.station { .station {
width: 100%; background: url("@/assets/images/siteArrange/bg.png") no-repeat;
height: 100%; background-size: 100% 100%;
// background: url("~@/assets/images/bg.jpg") center no-repeat;
background-size: cover;
position: relative;
padding-top: @headerH;
overflow: hidden;
.title { .title {
width: 650px; .slogan {
height: 100px; font-size: 39px;
position: absolute; font-family: Source Han Sans CN;
top: 30%; font-weight: 500;
left: 50%;
transform: translate(-50%, -50%);
h3 {
font-weight: 400;
font-size: 28px;
color: #ffffff; color: #ffffff;
} }
p {
font-weight: 700;
font-size: 28px;
color: #ffffff;
padding-top: 20px;
padding-left: 25px;
} }
.common {
padding: 0px 40px;
.common-list {
display: grid;
grid-template-columns: repeat(10, 1fr);
align-items: center;
justify-items: center;
} }
.item-logo {
.classification { width: 80px;
width: 100%; height: 80px;
height: 410px; padding: 10px;
background: linear-gradient(180deg, #daefff 0%, #ffffff 100%);
box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.1);
border-radius: 20px;
position: relative;
.bottom-img {
position: absolute; position: absolute;
bottom: 0; left: 0px;
background-color: rgba(3, 23, 24, 0.452); bottom: -10px;
overflow-y: auto;
.modules {
margin: 0 100px;
padding-top: 20px;
display: flex;
flex-wrap: wrap;
.mod_max {
width: 96px;
height: 115px;
margin-left: 39px;
margin-top: 5px;
text-align: center;
cursor: pointer;
.picture {
width: 72px;
height: 72px;
line-height: 72px;
margin: auto;
border-radius: 24px;
background-color: rgba(84, 120, 140, 1);
}
.name {
width: 100%;
font-weight: 700;
font-size: 16px;
color: #ffffff;
padding-top: 5px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
} }
} }
} }
......
This diff is collapsed.
...@@ -41,3 +41,16 @@ CREATE TABLE `mortals_xhx_user_pwd_record` ( ...@@ -41,3 +41,16 @@ CREATE TABLE `mortals_xhx_user_pwd_record` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户密码修改记录'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户密码修改记录';
UPDATE mortals_xhx_user SET lastUpdatePwdTime=NOW(); 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; ...@@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseJsonBodyController; 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.code.YesNoEnum;
import com.mortals.xhx.common.pdu.ModelPdu; import com.mortals.xhx.common.pdu.ModelPdu;
import com.mortals.xhx.feign.model.IApiModelFeign; import com.mortals.xhx.feign.model.IApiModelFeign;
...@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -113,6 +114,73 @@ public class ModelController extends BaseJsonBodyController { ...@@ -113,6 +114,73 @@ public class ModelController extends BaseJsonBodyController {
return ret; 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查询数据管理列表 * 根据站点id查询数据管理列表
* @param query * @param query
......
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.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.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());
}
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
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