7d70249c by 任超

Merge branch 'master' into dev

2 parents 1b95b632 7db3545c
......@@ -38,7 +38,7 @@
"babel-plugin-dynamic-import-node": "2.3.3",
"chalk": "2.4.2",
"connect": "3.6.6",
"element-ui": "^2.15.8",
"element-ui": "^2.15.13",
"html-webpack-plugin": "3.2.0",
"runjs": "4.3.2",
"sass-loader": "8.0.2",
......
/*
* @Author: yangwei
* @Date: 2023-02-24 15:12:45
* @LastEditors: yangwei
* @LastEditTime: 2023-03-14 10:45:11
* @FilePath: \bdcjg-web\src\api\authorityManage.js
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
import { getParams } from './util'
import {
......@@ -8,16 +18,16 @@ import {
} from './manageApi'
/** 角色管理开始 */
// 获取角色列表 by categoryId
export const getRolesById = categoryId => {
export const getRolesById = categoryIdList => {
const conditionGroup = {
conditions: [
{
property: 'category',
value: categoryId,
operator: 'EQ'
value: categoryIdList,
operator: 'IN'
}
],
queryRelation: 'AND'
queryRelation: 'AND',
}
const params = getParams(conditionGroup)
return getAction(api.roles, params)
......
import request from '@/utils/request'
import SERVER from './config'
/*
更新排序
record-排序整条数据
operate-BOTTOM(置底), DOWN(向下), TOP(置顶), UP(向上)
*/
export function updateOrder(url, record, operate, swapId) {
return request({
url: SERVER.MANAGEMENTAPI + url + "/" + record.id + "/orders",
method: "put",
params: {
operate: operate,
swapId: swapId,
},
});
}
......@@ -26,7 +26,8 @@ export default {
color: #ffffff;
margin: 0 5px;
cursor: pointer;
border: 0
border: 0;
font-size: 14px;
}
.cx {
......
......@@ -17,7 +17,7 @@
data () {
return {
options: {},
max: "100", //最大value值
max: "5000", //最大value值
min: "1", // 最小value值
key: 0,
mapjson: "",
......@@ -87,10 +87,10 @@
itemGap: 2, // 每两个图元之间的间隔距离,单位为px
pieces: [
// 自定义每一段的范围,以及每一段的文字
{ gte: 100, label: "100以上", color: "#035cf5" }, // 不指定 max,表示 max 为无限大(Infinity)。
{ gte: 50, lte: 6000, label: "20-100", color: "#3375e4" },
{ gte: 20, lte: 2000, label: "1-200", color: "#6797ef" },
{ gte: 1, lte: 1000, label: "1-20", color: "#96b5ef" },
{ gte: 100, label: "5000以上", color: "#035cf5" }, // 不指定 max,表示 max 为无限大(Infinity)。
{ gte: 50, lte: 6000, label: "1000-5000", color: "#3375e4" },
{ gte: 20, lte: 2000, label: "500-1000", color: "#6797ef" },
{ gte: 1, lte: 1000, label: "0-500", color: "#96b5ef" },
],
textStyle: {
color: "#737373",
......
......@@ -26,7 +26,7 @@
watch: {
cdata: {
handler (newData) {
console.log("newData", newData);
this.options = {
color: [
"#37a2da",
......@@ -34,31 +34,29 @@
"#9fe6b8",
"#ffdb5c",
"#ff9f7f",
"#8378ea",
"#fb7293",
"#e7bcf3",
"#8378ea"
],
tooltip: {
trigger: "item",
formatter: "<br/>{b} : {c} ({d}%)",
},
series: [
{
name: "Access From",
type: "pie",
radius: ["54%", "70%"],
avoidLabelOverlap: true,
label: {
formatter: (params) => {
// console.log(params)
return `${params.name}\n(${params.value})`;
return `${params.name}`;
},
position: "outer",
alignTo: "edge",
margin: 5
},
labelLine: {
lineStyle: {
width: 3,
},
},
data: newData.seriesData,
}
],
......
......@@ -5,57 +5,71 @@
</template>
<script>
import Chart from "./Chart";
import work from "@/api/work";
export default {
data() {
return {
cdata: {
seriesData: [],
},
};
},
components: {
Chart,
},
mounted() {
this.getdjywltotal();
window.addEventListener("resize", () => {
this.cdata.seriesData = [];
this.getdjywltotal();
});
},
methods: {
// 获取登记业务量玫瑰图数据
async getdjywltotal() {
if (this.cdata.seriesData.length == 0) {
try {
let p = {
DJLX: "",
QLLX: "",
XZQDM: "",
};
this.cdata.seriesData = [];
let res = await work.getdjywltotal(p);
if(this.cdata.seriesData.length == 0){
res.result.map((item) => {
return this.cdata.seriesData.push({
name: item.AREACODE,
value: item.ywtotal,
});
import Chart from "./Chart";
import work from "@/api/work";
export default {
data () {
return {
cdata: {
seriesData: [],
},
getdata: [],
};
},
components: {
Chart,
},
mounted () {
this.addhousetotal();
window.addEventListener("resize", () => {
this.getdata = [];
this.addhousetotal();
});
},
methods: {
async addhousetotal () {
if (this.getdata.length == 0) {
this.getdata = [];
try {
let { result: res } = await work.addhousetotal();
res.map((item) => {
return this.cdata.seriesData.push({
name: `${item.fwyt + '(' + item.fwxz})`,
value: item.mj,
});
});
}
// 遍历修改数组键,作为echars图表的参数
} catch (error) {
console.log(error);
} catch (error) {
console.log("error", error);
}
}
}
},
},
};
let delarr = this.cdata.seriesData.sort(this.up)
this.setadat(delarr)
},
// 处理数据方法
setadat (delarr) {
this.cdata.seriesData = delarr.splice(0, 6);
let sum = 0
for (var i = 0; i < delarr.length; i++) {
sum = sum + delarr[i].value
}
sum = sum.toFixed(2)
this.cdata.seriesData.push({
name: "其他(其他种类)",
values: "其他种类",
value: sum,
})
},
// 排序方法
up (x, y) { return y.value - x.value }
}
};
</script>
<style lang="scss" scoped></style>
......
......@@ -278,7 +278,7 @@ export default {
let _this = this
// 上报请求头修改
try {
var headRes = await axios.post(urlHeader + 'edit', this.dataReport,
var headRes = await axios.post('/api' + urlHeader + 'edit', this.dataReport,
{
headers: {
'Authorization': sessionStorage.getItem("token") || ""
......
......@@ -2,7 +2,8 @@
<div class="navbar-con">
<div class="navbar">
<div class="logo">
<img :src="require('@/image/logo.png')" alt="" />
<img :src="require('@/image/bdclogo.png')" alt="" />
<h4>不动产登记上报系统</h4>
</div>
<div class="right-menu">
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover" @command="handleCommand">
......@@ -20,214 +21,224 @@
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import Breadcrumb from './Breadcrumb'
import defaultSettings from '@/settings'
export default {
components: {
Breadcrumb
},
computed: {
...mapGetters(['sidebar', 'avatar', 'name'])
},
data () {
return {
title: defaultSettings.title
}
},
methods: {
handleDataView () {
const { href } = this.$router.resolve('/dataView');
window.open(href, '_blank');
import { mapGetters } from 'vuex'
import Breadcrumb from './Breadcrumb'
import defaultSettings from '@/settings'
export default {
components: {
Breadcrumb
},
computed: {
...mapGetters(['sidebar', 'avatar', 'name'])
},
themeChange (val) {
this.$store.dispatch('app/updateTheme', val)
data () {
return {
title: defaultSettings.title
}
},
handleCommand (command) {
if (command == 'a') {
} else {
methods: {
handleDataView () {
const { href } = this.$router.resolve('/dataView');
window.open(href, '_blank');
},
themeChange (val) {
this.$store.dispatch('app/updateTheme', val)
},
handleCommand (command) {
if (command == 'a') {
} else {
}
}
}
}
}
</script>
<style lang="scss" scoped>
.navbar-con {
position: relative;
.navbar-con {
position: relative;
.logo {
color: #fff;
font-size: 26px;
font-weight: 700;
}
}
.NoticeBar {
position: absolute;
bottom: 0;
}
.el-dropdown-menu {
padding: 0 !important;
border: 1px solid #ebeef5;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.12);
border-radius: 4px 0 0 4px 4px;
.el-dropdown-menu__item {
text-align: center;
margin-top: 0 !important;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #4a4a4a;
width: 140px;
height: 36px;
line-height: 36px;
}
.el-dropdown-menu__item:nth-child(6) {
border-top: 1px solid #ebeef5;
}
.popper__arrow {
top: -11px !important;
left: 110px !important;
transform: rotate(0deg) scale(2);
.logo {
color: #fff;
font-size: 26px;
font-weight: 700;
display: flex;
img {
width: 47px;
height: 47px;
}
h4 {
margin-left: 20px;
height: 50px;
line-height: 50px;
}
}
}
.el-dropdown-menu__item:not(.is-disabled):hover,
.el-dropdown-menu__item:focus {
background: #f6f7f9;
color: #4a4a4a;
}
}
.navbar {
height: $headerHeight;
overflow: hidden;
position: relative;
background: #3D59C4;
display: flex;
align-items: center;
padding-right: 20px;
justify-content: space-between;
.header-logo {
width: 300px;
.NoticeBar {
position: absolute;
bottom: 0;
}
.backdrop {
flex: 1;
width: 60%;
background-size: 100% 100%;
height: $headerHeight;
display: flex;
align-items: center;
}
.el-dropdown-menu {
padding: 0 !important;
border: 1px solid #ebeef5;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.12);
border-radius: 4px 0 0 4px 4px;
.el-dropdown-menu__item {
text-align: center;
margin-top: 0 !important;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #4a4a4a;
width: 140px;
height: 36px;
line-height: 36px;
}
.hamburger-container {
line-height: 43px;
height: 100%;
float: left;
cursor: pointer;
transition: background 0.3s;
-webkit-tap-highlight-color: transparent;
.el-dropdown-menu__item:nth-child(6) {
border-top: 1px solid #ebeef5;
}
&:hover {
background: rgba(0, 0, 0, 0.025);
.popper__arrow {
top: -11px !important;
left: 110px !important;
transform: rotate(0deg) scale(2);
}
}
.breadcrumb-container {
float: left;
.el-dropdown-menu__item:not(.is-disabled):hover,
.el-dropdown-menu__item:focus {
background: #f6f7f9;
color: #4a4a4a;
}
}
.right-menu {
float: right;
height: 100%;
line-height: 50px;
.navbar {
height: $headerHeight;
overflow: hidden;
position: relative;
background: linear-gradient(270deg, #ebf1ff 0%, #3d59c4 100%);
display: flex;
align-items: center;
.function {
margin: 0 15px;
cursor: pointer;
padding-right: 20px;
justify-content: space-between;
.header-logo {
width: 300px;
}
.shutdown {
font-size: 20px;
margin-left: 15px;
cursor: pointer;
}
.organization-item {
margin-right: 40px;
margin-top: -40px !important;
.backdrop {
flex: 1;
width: 60%;
background-size: 100% 100%;
height: $headerHeight;
display: flex;
align-items: center;
}
.item {
margin-right: 40px;
margin-top: -20px;
line-height: 18.4px;
.hamburger-container {
line-height: 43px;
height: 100%;
float: left;
cursor: pointer;
position: relative;
.item-box {
position: absolute;
top: -5px;
left: 3px;
width: 100%;
min-width: 25px;
height: 25px;
cursor: pointer;
z-index: 100;
transition: background 0.3s;
-webkit-tap-highlight-color: transparent;
&:hover {
background: rgba(0, 0, 0, 0.025);
}
}
&:focus {
outline: none;
.breadcrumb-container {
float: left;
}
.right-menu-item {
display: inline-block;
.right-menu {
float: right;
height: 100%;
font-size: 18px;
color: #fff;
vertical-align: text-bottom;
line-height: 50px;
display: flex;
align-items: center;
&.hover-effect {
.function {
margin: 0 15px;
cursor: pointer;
transition: background 0.3s;
display: flex;
align-items: center;
}
&:hover {
background: rgba(0, 0, 0, 0.025);
}
.shutdown {
font-size: 20px;
margin-left: 15px;
cursor: pointer;
}
}
.avatar-wrapper {
position: relative;
display: flex;
height: 40px;
align-items: center;
.organization-item {
margin-right: 40px;
margin-top: -40px !important;
}
.user-avatar {
.item {
margin-right: 40px;
margin-top: -20px;
line-height: 18.4px;
cursor: pointer;
width: 35px;
height: 35px;
border-radius: 50%;
position: relative;
.item-box {
position: absolute;
top: -5px;
left: 3px;
width: 100%;
min-width: 25px;
height: 25px;
cursor: pointer;
z-index: 100;
}
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -15px;
top: 17px;
font-size: 12px;
&:focus {
outline: none;
}
.right-menu-item {
display: inline-block;
height: 100%;
font-size: 18px;
color: #fff;
vertical-align: text-bottom;
&.hover-effect {
cursor: pointer;
transition: background 0.3s;
display: flex;
align-items: center;
&:hover {
background: rgba(0, 0, 0, 0.025);
}
}
}
.avatar-wrapper {
position: relative;
display: flex;
height: 40px;
align-items: center;
.user-avatar {
cursor: pointer;
width: 35px;
height: 35px;
border-radius: 50%;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -15px;
top: 17px;
font-size: 12px;
}
}
}
}
}
</style>
......
<!--
* @Description:
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-06 16:18:21
-->
......@@ -9,7 +9,7 @@
<el-menu router :default-active="activeMenu" :background-color="variables.menuBg" :text-color="variables.menuText"
:unique-opened="true" :active-text-color="variables.menuActiveText" :collapse-transition="false" mode="vertical">
<!-- 权限菜单 -->
<sidebar-item v-for="route in permission_routes.slice(3)" :key="route.path" :item="route"
<sidebar-item v-for="route in permission_routes.slice(4)" :key="route.path" :item="route"
:base-path="route.path" />
<!-- 菜单全部展示 -->
<!-- <sidebar-item v-for="route in asyncRoutes" :key="route.path" :item="route" :base-path="route.path" /> -->
......@@ -19,38 +19,42 @@
</template>
<script>
import { mapGetters } from 'vuex'
import Logo from './Logo'
import defaultSettings from '@/settings'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import { asyncRoutes } from '@/router'
export default {
components: { SidebarItem, Logo },
data () {
return {
title: defaultSettings.title
}
},
created () {
console.log(this.permission_routes);
},
computed: {
...mapGetters(['permission_routes', 'sidebar']),
activeMenu () {
const route = this.$route
const { meta, path } = route
if (meta.activeMenu) {
return meta.activeMenu
import { mapGetters } from 'vuex'
import Logo from './Logo'
import defaultSettings from '@/settings'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import { asyncRoutes } from '@/router'
export default {
components: { SidebarItem, Logo },
data () {
return {
title: defaultSettings.title
}
return path
},
variables () {
return variables
created () {
console.log(this.permission_routes);
},
computed: {
...mapGetters(['permission_routes', 'sidebar']),
activeMenu () {
const route = this.$route
const { meta, path } = route
if (meta.activeMenu) {
return meta.activeMenu
}
return path
},
variables () {
return variables
},
asyncRoutes () {
return asyncRoutes
}
},
asyncRoutes () {
return asyncRoutes
mounted () {
console.log("this. permission_routes", this.permission_routes);
}
}
}
</script>
\ No newline at end of file
</script>
......
......@@ -2,7 +2,7 @@
overflow: hidden;
background: url("~@/image/dialogBg.png") no-repeat !important;
background-size: 100% 100% !important;
min-height: 90vh;
// min-height: 90vh;
.dialog_title {
display: flex;
......@@ -98,6 +98,7 @@
color: #B5D6DC;
border-radius: 2px;
border: 1px solid #224C7C;
span {
display: inline-block;
padding: 3px;
......@@ -155,7 +156,7 @@
.el-dialog__body {
padding-top: 0;
padding-bottom: 0;
height: 95vh;
// height: 95vh;
}
.el-dialog__headerbtn {
......
......@@ -149,7 +149,7 @@ export function getCurrentDate (date = 'firstDay') {
export function setExport2Excel (exportName) {
/* generate workbook object from table */
var wb = XLSX2.utils.table_to_sheet(document.querySelector("#mytable"));//mytable为表格的id名
var wb = XLSX2.utils.table_to_sheet(document.querySelector("#mytable"), { raw: true });//mytable为表格的id名
if (!wb['!merges']) {
this.$message.warning('无法导出:报表无数据');
return
......
......@@ -43,19 +43,23 @@ class data extends filter {
// },
{
label: "查封机关",
prop: "cfjg"
prop: "cfjg",
minWidth: 150,
},
{
label: "查封文号",
prop: "cfwh"
prop: "cfwh",
minWidth: 130,
},
{
label: "解封机关",
prop: "jfjg"
prop: "jfjg",
width: 150,
},
{
label: "解封文号",
prop: "jfwh"
prop: "jfwh",
minWidth: 130,
},
{
......
<template>
<div class="rightcard">
<div class="card2 cardCon mt-10">
<div class="cardhead">登记业务量</div>
<Rose />
</div>
<div class="card1 cardCon d-center">
<div class="cardhead">新建国有房屋信息</div>
<div class="cardhead">登记业务量</div>
<div class="cardcontent" style="margin-top: .3646rem">
<dv-scroll-board v-if="config.data.length > 0" :config="config" class="board" />
<div v-else class="nodata">暂无数据</div>
</div>
</div>
<div class="card2 cardCon mt-10">
<div class="cardhead">新建国有房屋信息</div>
<Rose />
</div>
<div class="card3 cardCon mt-10">
<div class="cardhead">登记类型总量</div>
<columnarsmat />
......@@ -30,7 +29,8 @@
headerBGC: '#016AC5',
oddRowBGC: '#154295',
evenRowBGC: '#154295',
header: ['序号', '用途', '性质', '面积'],
header: ['序号', '业务名称', '登记业务量'],
columnWidth: [120, 270, 140],
data: [],
key: 0
}
......@@ -38,23 +38,38 @@
},
components: { columnarsmat, Rose },
mounted () {
this.addhousetotal();
this.getdjywltotal();
window.addEventListener("resize", () => {
this.cdata.seriesData = [];
this.getdjywltotal();
});
// scroll(tableref.value.$refs.bodyWrapper);//设置滚动
},
methods: {
async addhousetotal () {
// 获取登记业务量玫瑰图数据
async getdjywltotal () {
try {
let { result: res } = await work.addhousetotal();
res.map((item, index) => {
return (
this.config.data.push([index, item.fwyt, item.fwxz, item.mj])
)
let p = {
DJLX: "",
QLLX: "",
XZQDM: "",
};
let res = await work.getdjywltotal(p);
res.result.map((item, index) => {
this.config.data.push([index, item.AREACODE, item.ywtotal])
});
// 遍历修改数组键,作为echars图表的参数
} catch (error) {
console.log("error", error);
console.log(error);
}
}
}
},
},
}
</script>
<style lang="scss" scoped>
......@@ -134,6 +149,7 @@
background: url("~@/image/djywl.png") no-repeat;
background-size: 100% 100%;
padding: 0.3825rem 0 0 0;
overflow: hidden;
}
.card3 {
......
......@@ -78,6 +78,7 @@ export default {
endTime: timeFormat(new Date(), true),
qxdm: "",
},
interval: 50
};
},
mounted () {
......@@ -100,6 +101,10 @@ export default {
this.form.qxdm
);
this.chartData = res;
console.log(this.chartData);
let maxData = Math.max.apply(Math, this.chartData.map(item => { return item.failure }))
this.interval = Math.ceil(maxData / 10)
//行政区代码过滤
res.length > 0 &&
res.forEach((item) => {
......@@ -191,7 +196,7 @@ export default {
color: "#fff",
fontSize: "16",
},
interval: 50,
// interval: this.interval,
axisLabel: {
formatter: "{value}",
textStyle: {
......
......@@ -105,6 +105,7 @@ export default {
// 初始化图表
this.chartData.length && this.echartInit(this.chartData)
});
},
// 重置
resetForm () {
......@@ -131,6 +132,7 @@ export default {
},
grid: {
top: 120,
bottom: 100,
},
xAxis: [
{
......@@ -138,6 +140,7 @@ export default {
data: chartArr.map(item => item.recTypeName),
axisLabel: {
interval: 0,
rotate: 40,
formatter: function (val) {
let c = document.createElement("canvas");
const ctx = c.getContext("2d");
......@@ -185,6 +188,7 @@ export default {
},
},
],
series: [
{
type: "bar",
......
......@@ -60,7 +60,7 @@
getAction(api.subsystem, params).then((res) => {
if (res.status === 1) {
console.log(" res.contentJJJGGG", res.content);
// this.productName = res.content[0].name;
this.productName = res.content[0].name;
this.$store.dispatch("products/setData", res.content[0].code);
sessionStorage.setItem("products", res.content[0].code)
console.log("jjjggg的product");
......
......@@ -67,9 +67,8 @@
getAction(api.subsystem, params).then((res) => {
if (res.status === 1) {
this.productName = res.content[0].name;
// console.log(" res.contentSSSSSBBBBB", res.content);
this.$store.dispatch("products/setData", res.content[0].code);
sessionStorage.setItem("products", res.content[0].code)
} else {
this.$message.error({ message: res.message, showClose: true });
......
......@@ -17,4 +17,9 @@
.export-excel-wrapper {
display: inline-block;
}
/deep/.el-table--group,
.el-table--border {
border: 1px solid #458ACF !important;
}
\ No newline at end of file
......
......@@ -87,7 +87,10 @@ class data extends filter {
prop: 'failReportRatio24To48h',
render: (h, scope) => {
return (
<span>{(scope.row.failReportRatio24To48h * 100).toFixed(2)}%</span>
<div>
<span>{(scope.row.failReportRatio24To48h * 100).toFixed(2)}</span>
%
</div>
);
},
}
......
......@@ -173,5 +173,9 @@ export default {
// 引入表单整体样式
// @import "~@/styles/public.scss";
@import "../css/index.scss";
/deep/th.el-table__cell {
height: 0 !important;
}
</style>
......
......@@ -14,13 +14,11 @@ class data extends filter {
label: '分项',
children: [
{
width:1
},
{
label: '国有建设用地使用权登记得分及空项率',
children: [
{
prop: 'gyjsydsyqRate',
width: 150,
render: (h, scope) => {
return (
<span>{scope.row.gyjsydsyqRate.toFixed(2)}</span>
......@@ -29,6 +27,7 @@ class data extends filter {
},
{
prop: 'gyjsydsyqRadio',
width: 150,
render: (h, scope) => {
return (
<span>{(scope.row.gyjsydsyqRadio * 100).toFixed(2)}%</span>
......
<!--
* @Author: yangwei
* @Date: 2023-02-17 16:32:50
* @LastEditors: yangwei
* @LastEditTime: 2023-03-09 11:19:43
* @LastEditors: Please set LastEditors
* @LastEditTime: 2023-03-14 13:19:18
* @FilePath: \bdcjg-web\src\views\statistics\registerBookQuality\index.vue
* @Description:
*
......@@ -21,12 +21,12 @@
<el-col :span="6">
<el-form-item label="接收日期" prop="startTime">
<el-date-picker type="date" class="width100" placeholder="开始日期" :picker-options="pickerOptionsStart"
v-model="form.startTime" value-format="yyyy-MM-dd"></el-date-picker>
v-model="form.startTime" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="至" prop="endTime" label-width="35px">
<el-date-picker type="date" class="width100" placeholder="结束日期" :picker-options="pickerOptionsEnd"
<el-date-picker type="date" class="width100" placeholder="结束日期" :picker-options="pickerOptionsEnd"
v-model="form.endTime" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
......@@ -43,10 +43,11 @@
</div>
<!-- 列表区域 -->
<div class="from-clues-content">
<lb-table ref="table" :pagination="false" :header-cell-style="headerStyle" :column="tableData.columns" :data="tableData.data">
<lb-table ref="table" :pagination="false" :border="true" :header-cell-style="headerStyle"
:column="tableData.columns" :data="tableData.data">
</lb-table>
<down-lb-table ref="table" v-show="false" :id="'mytable'" :downExcel="true" :pagination="false"
:column="tableData.columns" :data="tableData.data" :downTitle="downTitle">
<down-lb-table ref="table" v-show="false" :id="'mytable'" :header-cell-style="headerStyle1" :downExcel="true"
:pagination="false" :column="tableData.columns" :data="tableData.data" :downTitle="downTitle">
</down-lb-table>
</div>
</div>
......@@ -138,6 +139,17 @@ export default {
this.handleResetForm()
this.generateFileName()
},
mounted () {
this.$nextTick(function () {
let c = document.getElementsByClassName("el-table__header")
let k = c[0].getElementsByClassName("is-group has-gutter");
let f = k[0].children
let d = f[1].getElementsByClassName("el-table__cell")
let p = d[0]
p.setAttribute("rowspan", 2)
})
},
methods: {
handleSearch () { },
// 生成文件名
......@@ -150,15 +162,16 @@ export default {
},
headerStyle ({ row, rowIndex }) {
if (rowIndex == 1) {
row[0].colSpan = 2
row.forEach(item=>{
row.forEach(item => {
item.rowSpan = 2
})
}
},
headerStyle1 ({ row, rowIndex }) {
if (rowIndex == 2) {
row.forEach(item => {
item.rowSpan = 2
})
// row[0].rowSpan = 2;
// row[1].rowSpan = 2;
// row[2].rowSpan = 2;
// row[3].rowSpan = 2;
// row[4].rowSpan = 2;
}
},
// 初始化数据
......@@ -181,5 +194,9 @@ export default {
// 引入表单整体样式
// @import "~@/styles/public.scss";
@import "../css/index.scss";
/deep/.el-table thead.is-group th.el-table__cell {
height: 14px !important;
}
</style>
......
......@@ -84,7 +84,7 @@
},
mounted () {
if (this.userInfo) {
this.getUserdata(this.userInfo)
this.getUserdata(this.userInfo.id)
}
this.sexList = [
{
......@@ -105,8 +105,8 @@
]
},
methods: {
getUserdata (p) {
getAction(`${api.users}/${p.id}`).then((res) => {
getUserdata (id) {
getAction(`${api.users}/${id}`).then((res) => {
if (res.status === 1) {
this.form = res.content
} else {
......@@ -135,7 +135,6 @@
<style scoped lang="scss">
.user-info {
margin: 0.1875rem 1.0417rem;
background: #ffffff;
overflow-y: auto;
.form-wrapper {
padding: 0px 120px 0px;
......@@ -156,7 +155,7 @@
}
.bottom-wrapper {
padding: 0px 120px 0px;
text-align: right;
text-align: center;
}
}
</style>
......
<!--
* @Author: xiaomiao 1158771342@qq.com
* @Date: 2023-03-08 15:30:43
* @LastEditors: xiaomiao 1158771342@qq.com
* @LastEditTime: 2023-03-08 16:33:50
* @FilePath: \监管系统\js-web-jianguan\src\views\system\information copy\index.vue
* @LastEditors: yangwei
* @LastEditTime: 2023-03-13 17:19:46
* @FilePath: \bdcjg-web\src\views\system\information\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
......@@ -15,8 +15,18 @@
</el-form-item>
<el-row class="mb-5">
<el-col :span="3" class="btnColRight">
<btn nativeType="cx" @click="information">基本信息</btn>
<btn nativeType="cx" @click="password">修改密码</btn>
<!-- <btn nativeType="cx" @click="information"
>基本信息</btn
>
<btn nativeType="cx" :class="isshow ? '' : ''" @click="password"
>修改密码</btn
> -->
<button @click="information" :class="isshow ? 'button choosed' : 'button'">
基本信息
</button>
<button @click="password" :class="isshow ? 'button' : 'button choosed'">
修改密码
</button>
</el-col>
</el-row>
</el-form>
......@@ -30,56 +40,69 @@
</div>
</template>
<script>
import "@/utils/flexible.js";
import BaseSet from "./base-set.vue";
import PasswordEdit from "./password-edit.vue";
export default {
components: {
BaseSet,
PasswordEdit,
import "@/utils/flexible.js";
import BaseSet from "./base-set.vue";
import PasswordEdit from "./password-edit.vue";
export default {
components: {
BaseSet,
PasswordEdit,
},
data() {
return {
isshow: true,
};
},
computed: {
userData() {
return this.$store.state.user.userInfo;
},
data () {
return {
isshow: true,
};
},
watch: {},
created() {},
mounted() {},
methods: {
information() {
this.isshow = true;
},
computed: {
userData () {
return this.$store.state.user.userInfo;
},
password() {
this.isshow = false;
},
watch: {},
created () { },
mounted () {
},
methods: {
information () {
this.isshow = true;
},
password () {
this.isshow = false;
},
},
};
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
.information {
/deep/.content {
.el-input__inner {
background: none;
}
.user-info {
background: none;
}
.boxin {
height: 79%;
}
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
.information {
display: flex;
flex-direction: column;
.btnColRight {
.button {
width: 76px;
height: 32px;
color: #ffffff;
margin: 0 5px;
cursor: pointer;
border: 0;
background: url('../../../image/btn.png') no-repeat 0 0;
background-size: cover;
}
.choosed{
background: url('../../../image/btn.png') no-repeat 0 -34px;
}
}
/deep/.content {
.el-input__inner {
background: none;
}
.user-info {
background: none;
}
}
.boxin {
flex: 1;
}
}
</style>
......
......@@ -6,27 +6,31 @@
label-width="100px"
:model="form"
class="form-wrapper"
:rules="rules">
:rules="rules"
>
<el-form-item label="旧密码:" prop="oldPassword">
<el-input
v-model="form.oldPassword"
clearable
type="password"
show-password />
show-password
/>
</el-form-item>
<el-form-item label="新密码:" prop="newPassword">
<el-input
v-model="form.newPassword"
clearable
type="password"
show-password />
show-password
/>
</el-form-item>
<el-form-item label="确认密码:" prop="confirmPassword">
<el-input
v-model="form.confirmPassword"
clearable
type="password"
show-password />
show-password
/>
</el-form-item>
</el-form>
<div class="bottom-wrapper">
......@@ -37,102 +41,100 @@
</template>
<script>
import { updateUserPassword } from "@/api/personnelManage";
export default {
props: {
userInfo: {
type: Object,
default: null
}
import { updateUserPassword } from "@/api/personnelManage";
export default {
props: {
userInfo: {
type: Object,
default: null,
},
data () {
return {
form: {},
sexList: [],
userId: '',
rules: {
oldPassword: [
{ required: true, message: '旧密码不能为空', trigger: 'blur' }
],
newPassword: [
{ required: true, message: '新密码不能为空', trigger: 'blur' }
],
confirmPassword: [
{ required: true, message: '确认密码不能为空', trigger: 'blur' },
{ validator: this.validatorConfirmPassword, trigger: 'blur' }
]
},
data() {
return {
form: {},
sexList: [],
userId: "",
rules: {
oldPassword: [
{ required: true, message: "旧密码不能为空", trigger: "blur" },
],
newPassword: [
{ required: true, message: "新密码不能为空", trigger: "blur" },
],
confirmPassword: [
{ required: true, message: "确认密码不能为空", trigger: "blur" },
{ validator: this.validatorConfirmPassword, trigger: "blur" },
],
},
};
},
computed: {},
watch: {
userInfo: {
handler: function (val) {
if (val) {
this.getid(val);
}
}
},
},
computed: {},
watch: {
userInfo: {
handler: function (val) {
if (val) {
this.getid(val)
}
}
}
},
mounted() {
if (this.userInfo) {
this.getid(this.userInfo);
}
},
methods: {
getid(val) {
this.userId = val.id;
},
mounted () {
if (this.userInfo) {
this.getid(this.userInfo)
validatorConfirmPassword(rule, value, callback) {
const { newPassword } = this.form;
if (value !== newPassword) {
callback("两次输入密码不一致");
} else {
callback();
}
},
methods: {
getid (val) {
this.userId = val.id
},
validatorConfirmPassword (rule, value, callback) {
const { newPassword } = this.form
if (value !== newPassword) {
callback('两次输入密码不一致')
} else {
callback()
updatePassword() {
this.$refs.form.validate((valid) => {
if (valid) {
const params = Object.assign({}, this.form, { id: this.userId });
updateUserPassword(params).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true });
} else {
this.$message.error({ message: res.message, showClose: true });
}
});
}
},
updatePassword () {
this.$refs.form.validate((valid) => {
if (valid) {
const params = Object.assign({}, this.form, { id: this.userId })
updateUserPassword(params).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
}
})
}
}
}
});
},
},
};
</script>
<style scoped lang="scss">
.user-info {
margin: 36px 200px;
background: #ffffff;
overflow-y: auto;
.form-wrapper {
padding: 24px 120px 0px;
/deep/.el-form-item {
margin-bottom: 24px;
.el-form-item__label {
color: #ffffff;
}
.el-input .el-input__inner {
padding: 0 8px;
height: 40px;
line-height: 40px;
border: 1px solid #6bc1fc;
}
.user-info {
margin: 36px 200px;
overflow-y: auto;
.form-wrapper {
padding: 24px 120px 0px;
/deep/.el-form-item {
margin-bottom: 24px;
.el-form-item__label {
color: #ffffff;
}
.el-input .el-input__inner {
padding: 0 8px;
height: 40px;
line-height: 40px;
border: 1px solid #6bc1fc;
}
}
.bottom-wrapper {
padding: 32px 120px 24px;
text-align: right;
}
}
.bottom-wrapper {
padding: 32px 120px 24px;
text-align: center;
}
}
</style>
......
<template>
<div>
<Dialog class="modifydialog" :title="title" :show.sync="visible" :width="'767px'" @close="close()">
<template slot="content">
<el-form ref="form" :model="form" :rules="rules">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="菜单名称:" prop="name" label-width="124px">
<el-input v-model="form.name" placeholder="请输入菜单名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="上级菜单:" label-width="124px">
<el-cascader :key="menuKey" v-model="form.parentId" :options="parentMenuList" :props="setProps"
placeholder="请选择上级菜单" clearable @change="handleChange" />
</el-form-item>
</el-col>
<dialogBox class="modifydialog" :isMain="true" :title="2222" @closeDialog="close" @submitForm="submitForm" v-model="myValue">
<div class="modifydialog-con">
<el-form ref="form" :model="form" :rules="rules">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="菜单名称:" prop="name" label-width="124px">
<el-input v-model="form.name" placeholder="请输入菜单名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="上级菜单:" label-width="124px">
<el-cascader :key="menuKey" v-model="form.parentId" :options="parentMenuList" :props="setProps"
placeholder="请选择上级菜单" clearable @change="handleChange" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="代码:" prop="code" label-width="124px">
<el-input v-model="codeComputed" placeholder="请输入菜单代码" :disabled="type === 1" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="链接路径:" label-width="124px">
<el-input v-model="form.uri" placeholder="请输入链接路径" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="浏览器跳转模式:" label-width="124px">
<el-select v-model="form.jumpMode" placeholder="请选择浏览器跳转模式">
<el-option v-for="item in jumpModeList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="配置参数:" label-width="124px" class="form-item-mb0">
<!-- 配置参数 -->
<JsonEditor :result-infos="form.metadata" @getJsonString="getJsonString" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<template slot="footer">
<el-button class="cancel-button" @click="close()">取消</el-button>
<el-button type="primary" @click="submitForm()">保存</el-button>
</template>
</Dialog>
<!-- 图标列表 -->
<IconList ref="iconList" @iconName="getIconName" />
</div>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="代码:" prop="code" label-width="124px">
<el-input v-model="codeComputed" placeholder="请输入菜单代码" :disabled="type === 1" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="链接路径:" label-width="124px">
<el-input v-model="form.uri" placeholder="请输入链接路径" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="浏览器跳转模式:" label-width="124px">
<el-select v-model="form.jumpMode" placeholder="请选择浏览器跳转模式">
<el-option v-for="item in jumpModeList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="配置参数:" label-width="124px" class="form-item-mb0">
<!-- 配置参数 -->
<JsonEditor :result-infos="form.metadata" @getJsonString="getJsonString" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</dialogBox>
</template>
<script>
import Dialog from "@/components/Dialog/";
import { getParentMenuListAction } from '@/api/authorityManage'
import JsonEditor from '@/components/JsonEditors'
import IconList from '@/components/IconList'
import { validateCode } from '@/utils/validate';
import { api, httpAction } from '@/api/manageApi'
export default {
name: 'MenuModal',
components: {
IconList,
JsonEditor,
Dialog
},
props: {
productId: {
type: String,
default: ''
import { getParentMenuListAction } from '@/api/authorityManage'
import JsonEditor from '@/components/JsonEditors'
import { validateCode } from '@/utils/validate';
import { api, httpAction } from '@/api/manageApi'
export default {
name: 'MenuModal',
components: {
JsonEditor,
},
props: {
value: { type: Boolean, default: false },
productId: {
type: String,
default: ''
}
},
data () {
return {
myValue: this.value,
form: {
icon: '',
code: ''
},
rules: {
name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
code: [
{ required: true, message: '必填', trigger: 'blur' },
{ validator: validateCode, trigger: 'blur' }
]
},
title: '',
type: '',
visible: false,
parentMenuList: [],
menuKey: 0,
jumpModeList: [
{ name: '在当前页面显示', value: 1 },
{ name: '跳转到新页面', value: 2 }
],
setProps: {
value: 'id',
label: 'name',
children: 'children',
expandTrigger: 'hover',
checkStrictly: true, // 可取消关联,选择任意一级选项
emitPath: false
},
dataUrl: api.menus
}
},
computed: {
codeComputed: {
get: function () {
return this.form.code
},
set: function (val) {
this.form.code = val.toUpperCase()
}
}
},
watch: {
value (val) {
this.myValue = val
}
},
methods: {
// 获取父级菜单
getParentMenuList (id) {
getParentMenuListAction(id).then((res) => {
if (res.status === 1) {
const list = this.$dealArrChildren(res.content)
if (id) {
this.parentMenuList = this.$dealArrDisabled(
this.$deepCopy(list),
id
)
this.menuKey++
} else {
this.parentMenuList = list
}
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
data () {
return {
form: {
icon: '',
code: ''
},
rules: {
name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
code: [
{ required: true, message: '必填', trigger: 'blur' },
{ validator: validateCode, trigger: 'blur' }
]
},
title: '',
type: '',
visible: false,
parentMenuList: [],
menuKey: 0,
jumpModeList: [
{ name: '在当前页面显示', value: 1 },
{ name: '跳转到新页面', value: 2 }
],
setProps: {
value: 'id',
label: 'name',
children: 'children',
expandTrigger: 'hover',
checkStrictly: true, // 可取消关联,选择任意一级选项
emitPath: false
},
dataUrl: api.menus
}
getIconList () {
this.$refs.iconList.show(true)
},
computed: {
codeComputed: {
get: function () {
return this.form.code
},
set: function (val) {
this.form.code = val.toUpperCase()
}
getIconName (data) {
this.form.icon = data
},
// 配置参数
getJsonString (data) {
this.form.metadata = data
},
// 新增菜单
add () {
this.getParentMenuList(this.productId)
this.type = 0
this.form.jumpMode = 1
},
// 编辑菜单
edit (record) {
this.type = 1
// 若有id为编辑
if (record.id) {
this.$nextTick(() => {
this.form = Object.assign({}, record)
this.getParentMenuList(this.productId)
})
}
},
created () { },
mounted () { },
methods: {
// 获取父级菜单
getParentMenuList (id) {
getParentMenuListAction(id).then((res) => {
if (res.status === 1) {
const list = this.$dealArrChildren(res.content)
if (id) {
this.parentMenuList = this.$dealArrDisabled(
this.$deepCopy(list),
id
)
this.menuKey++
} else {
this.parentMenuList = list
}
// 选择上级菜单
handleChange (value) {
this.form.parentId = value
},
// 保存
submitForm (submitType) {
this.$refs.form.validate((valid) => {
if (valid) {
let method = ''
let url = ''
const formData = this.form
formData.productId = this.productId
if (!formData.id) {
method = 'post'
url = this.dataUrl
} else {
this.$message.error({ message: res.message, showClose: true })
method = 'put'
url = `${this.dataUrl}/${formData.id}`
}
})
},
getIconList () {
this.$refs.iconList.show(true)
},
getIconName (data) {
this.form.icon = data
},
// 配置参数
getJsonString (data) {
this.form.metadata = data
},
// 新增菜单
add () {
this.getParentMenuList(this.productId)
this.visible = true
this.type = 0
this.form.jumpMode = 1
},
// 编辑菜单
edit (record) {
this.type = 1
// 若有id为编辑
if (record.id) {
this.$nextTick(() => {
this.form = Object.assign({}, record)
this.getParentMenuList(this.productId)
})
}
this.visible = true
},
// 选择上级菜单
handleChange (value) {
this.form.parentId = value
},
// 保存
submitForm (submitType) {
this.$refs.form.validate((valid) => {
if (valid) {
let method = ''
let url = ''
const formData = this.form
formData.productId = this.productId
if (!formData.id) {
method = 'post'
url = this.dataUrl
} else {
method = 'put'
url = `${this.dataUrl}/${formData.id}`
}
debugger
httpAction(url, formData, method)
.then((res) => {
if (res.status === 1) {
this.$message.success({
message: res.message,
showClose: true
})
debugger
httpAction(url, formData, method)
.then((res) => {
if (res.status === 1) {
this.$message.success({
message: res.message,
showClose: true
})
this.resetForm()
this.$emit('ok')
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
.catch((err) => {
console.log(err)
})
}
})
},
resetForm () {
this.$refs.form.resetFields()
this.form = {
icon: '',
code: ''
this.resetForm()
this.$emit('ok')
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
.catch((err) => {
console.log(err)
})
}
},
close () {
this.resetForm()
this.visible = false
})
},
resetForm () {
this.$refs.form.resetFields()
this.form = {
icon: '',
code: ''
}
},
close () {
this.resetForm()
this.visible = false
}
}
}
</script>
<style scoped lang="scss">
// @import "~@/styles/public.scss";
</style>
.modifydialog {
&-con {
background: #031A46;
}
}
</style>
\ No newline at end of file
......
......@@ -17,250 +17,160 @@
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
</lb-table>
</div>
<edit-dialog ref="dialogForm" :product-id="productId" :resource-category-id="resourceCategoryId"
<edit-dialog ref="dialogForm" v-model="isDialog" :product-id="productId" :resource-category-id="resourceCategoryId"
@ok="reloadTableData" />
<!-- <authorizationdiglog ref="rolesForm" /> -->
</div>
</template>
<script>
// 定时任务
import data from "./data";
import { deleteAction, getAction, api } from "@/api/manageApi";
import EditDialog from "./edit-dialog.vue";
import { mapGetters } from "vuex";
import { getMenuInfo } from "@/api/user";
import {
getUuid,
judgeSort,
realMove,
findParents,
removeTreeListItem,
} from "@/utils/operation";
// import authorizationdiglog from "./authorizationdiglog.vue";
export default {
name: "menus",
components: {
EditDialog,
// authorizationdiglog,
},
data () {
return {
tablelistData: [],
resourceCategoryId: "",
taskData: null,
form: {
job_name: "",
currentPage: 1,
},
title: "",
queryParam: {},
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
sexList: [],
// 定时任务
import data from "./data";
import { deleteAction, getAction, api } from "@/api/manageApi";
import EditDialog from "./edit-dialog.vue";
import { mapGetters } from "vuex";
import { getMenuInfo } from "@/api/user";
import {
getUuid,
judgeSort,
realMove,
findParents,
removeTreeListItem,
} from "@/utils/operation";
// import authorizationdiglog from "./authorizationdiglog.vue";
export default {
name: "menus",
components: {
EditDialog,
// authorizationdiglog,
},
data () {
return {
isDialog: false,
tablelistData: [],
resourceCategoryId: "",
taskData: null,
form: {
job_name: "",
currentPage: 1,
},
title: "",
queryParam: {},
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
sexList: [],
selectionList: [],
tableData: {
columns: [].concat(data.columns()).concat([
{
label: "操作",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => {
this.handleEdit(scope.row);
}}
>
修改
</el-button>
selectionList: [],
tableData: {
columns: [].concat(data.columns()).concat([
{
label: "操作",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
onClick={() => {
this.handleEdit(scope.row);
}}
>
修改
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
style="color:#F56C6C"
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</div>
);
},
<el-button
type="text"
size="mini"
icon="el-icon-delete"
style="color:#F56C6C"
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</div>
);
},
]),
data: [],
},
pageData: {
total: 5,
pageSize: 15,
current: 1,
},
]),
data: [],
},
pageData: {
total: 5,
pageSize: 15,
current: 1,
},
tableUrl: api.menus, // 菜单接口地址
meumurlid: api.subsystem,// 项目id接口地址
productId: ""//项目id
};
},
created () {
this.getTableList();
},
computed: {
...mapGetters(["products"])
},
methods: {
// 加载表格数据
getTableList () {
getMenuInfo(sessionStorage.getItem("products")).then((res) => {
if (res.code === 200) {
this.tablelistData = judgeSort(res.result)
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
const queryOptionsid = {
conditionGroup: {
queryRelation: "AND",
conditions: [
{
property: "code",
value: this.products,
operator: "EQ",
},
],
},
tableUrl: api.menus, // 菜单接口地址
meumurlid: api.subsystem,// 项目id接口地址
productId: ""//项目id
};
const params = {
queryOptions: queryOptionsid,
};
// 获取系统id
getAction(this.meumurlid, params)
.then((res) => {
this.productId = res.content[0].id;
this.getAuthorityList(res.content[0].id, res.content[0].code)
this.selectedSubsystemCode = res.content[0].code
})
.catch((error) => {
console.log("er", error);
})
},
created () {
this.getTableList();
},
computed: {
...mapGetters(["products"])
// 新增菜单
handleAdd () {
this.isDialog = true
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "添加";
},
methods: {
// 加载表格数据
getTableList () {
getMenuInfo(sessionStorage.getItem("products")).then((res) => {
if (res.code === 200) {
this.tablelistData = judgeSort(res.result)
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
const queryOptionsid = {
conditionGroup: {
queryRelation: "AND",
conditions: [
{
property: "code",
value: this.products,
operator: "EQ",
},
],
},
};
const params = {
queryOptions: queryOptionsid,
};
// 获取系统id
getAction(this.meumurlid, params)
.then((res) => {
this.productId = res.content[0].id;
this.getAuthorityList(res.content[0].id, res.content[0].code)
this.selectedSubsystemCode = res.content[0].code
// let queryOptions = {
// conditionGroup: {
// conditions: [
// {
// property: "productId",
// value: this.productId,
// operator: "EQ",
// },
// ],
// queryRelation: "AND",
// },
// orderBys: [{ property: "sort", direction: "desc" }],
// };
// if (!this.tableUrl) {
// console.log("请设置tableUrl属性为接口地址!");
// return;
// }
// if (this.queryOptions !== "") {
// this.queryParam.queryOptions = JSON.stringify(queryOptions);
// }
// 查询系统菜单
// getAction(this.tableUrl, this.queryParam)
// .then((res) => {
// if (res.status === 1) {
// this.loading = false;
// // this.menutablelistData = res.content;
// console.log("res.content菜单", res.content);
// } else {
// this.$message.error({ message: res.message, showClose: true });
// this.loading = false;
// }
// })
// .catch((error) => {
// console.log("er", error);
// this.loading = false;
// });
})
.catch((error) => {
console.log("er", error);
});
// const queryOptionsid = {
// conditionGroup: {
// queryRelation: "AND",
// conditions: [
// {
// property: "code",
// value: sessionStorage.getItem("products"),
// operator: "EQ",
// },
// ],
// },
// };
// const params = {
// queryOptions: queryOptionsid,
// };
// // 获取系统id
// getAction(this.meumurlid, params)
// .then((res) => {
// this.productId = res.content[0].id;
// let queryOptions = {
// conditionGroup: {
// conditions: [
// {
// property: "productId",
// value: this.productId,
// operator: "EQ",
// },
// ],
// queryRelation: "AND",
// },
// orderBys: [{ property: "sort", direction: "desc" }],
// };
// if (!this.tableUrl) {
// console.log("请设置tableUrl属性为接口地址!");
// return;
// }
// if (this.queryOptions !== "") {
// this.queryParam.queryOptions = JSON.stringify(queryOptions);
// }
// // 查询系统菜单
// getAction(this.tableUrl, this.queryParam)
// .then((res) => {
// if (res.status === 1) {
// this.loading = false;
// this.tablelistData = res.content;
// } else {
// this.$message.error({ message: res.message, showClose: true });
// this.loading = false;
// }
// })
// .catch((error) => {
// console.log("er", error);
// this.loading = false;
// });
// })
// .catch((error) => {
// console.log("er", error);
// });
},
// 新增菜单
handleAdd () {
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "添加";
},
// 修改
handleEdit (record) {
this.$refs.dialogForm.edit(record);
this.$refs.dialogForm.title = "修改";
},
// 删除
handleDelete (id, content) {
this.$confirm(
`<div class="customer-message-wrapper">
// 修改
handleEdit (record) {
this.isDialog = true
this.$refs.dialogForm.edit(record);
this.$refs.dialogForm.title = "修改";
},
// 删除
handleDelete (id, content) {
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">您确认要执行该操作用于以下信息:</h5>
<p class="content" aria-controls="${content}">${content}
</p>
......@@ -268,51 +178,51 @@
<span >无法恢复</span>
</p>
</div>`,
'执行确认',
{
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
'执行确认',
{
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.then(() => {
if (!this.tableUrl) {
this.$message.error({
message: '请设置tableUrl属性为接口地址!',
showClose: true
})
return
}
)
.then(() => {
if (!this.tableUrl) {
this.$message.error({
message: '请设置tableUrl属性为接口地址!',
showClose: true
})
return
const url = this.tableUrl + '/' + id
deleteAction(url).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.reloadTableData()
} else {
this.$message.error({ message: res.message, showClose: true })
}
const url = this.tableUrl + '/' + id
deleteAction(url).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.reloadTableData()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
})
.catch(() => { })
},
// 新增、编辑回显
reloadTableData () {
this.getTableList()
},
})
.catch(() => { })
},
// 新增、编辑回显
reloadTableData () {
this.getTableList()
},
};
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/mixin.scss";
// @import "~@/styles/public.scss";
.btnColRight {
margin-top: 20px;
}
// @import "~@/styles/public.scss";
.btnColRight {
margin-top: 20px;
}
/deep/.el-table__expand-icon {
color: #fff;
}
/deep/.el-table__expand-icon {
color: #fff;
}
</style>
......
......@@ -38,6 +38,7 @@
import EditDialog from "./edit-dialog.vue";
import Roleslistdiglog from "./roleslistdiglog.vue";
import { mapGetters } from "vuex";
import {updateOrder} from "@/api/orders"
export default {
name: "menus",
mixins: [tableMixin],
......@@ -107,7 +108,7 @@
.concat([
{
label: "排序",
width: 100,
width: 200,
render: (h, scope) => {
return (
<div>
......@@ -115,7 +116,16 @@
type="text"
disabled={scope.row.isTop}
onClick={() => {
this.moveUpward(scope.$index, scope.row);
this.updateOrder(scope.row,'TOP');
}}
>
置顶
</el-button>
<el-button
type="text"
disabled={scope.row.isTop}
onClick={() => {
this.updateOrder(scope.row,'UP');
}}
>
上移
......@@ -124,11 +134,20 @@
type="text"
disabled={scope.row.isBottom}
onClick={() => {
this.moveDown(scope.$index, scope.row);
this.updateOrder(scope.row,'DOWN');
}}
>
下移
</el-button>
<el-button
type="text"
disabled={scope.row.isBottom}
onClick={() => {
this.updateOrder(scope.row,'BOTTOM');
}}
>
置底
</el-button>
</div>
);
},
......@@ -225,20 +244,10 @@
methods: {
// 获取角色列表
getTableData () {
let Builtinrole = [];
let Publicrole = [];
getRolesById(1)
getRolesById([1,2])
.then((res) => {
Builtinrole = res.content;
getRolesById(2)
.then((res) => {
Publicrole = res.content;
this.listdata = Builtinrole.concat(Publicrole);
this.listdata = judgeSort(this.listdata);
})
.catch((e) => console.error(e));
this.listdata = res.content;
this.listdata = judgeSort(this.listdata);
})
.catch((e) => console.error(e));
},
......@@ -397,20 +406,24 @@
this.$refs.addEditDialog.showAddEditDialog = true;
this.$refs.addEditDialog.dialogTitle = value.id ? "修改" : "新增";
},
// 上移下移
moveUpward (index, row) {
realMove(row.dictid, "UP", this.listdata);
this.key++;
let id = findParents(this.listdata, row.dictid);
this.keyList = id;
},
moveDown (index, row) {
realMove(row.dictid, "DOWN", this.listdata);
this.key++;
let id = findParents(this.listdata, row.dictid);
this.keyList = id;
//排序
updateOrder(record, operate){
const findIndex = this.listdata.findIndex(item => item.id === record.id)
let swapId = ''
if (operate === 'UP') {
swapId = this.listdata[findIndex - 1].id
} else if (operate === 'DOWN') {
swapId = this.listdata[findIndex + 1].id
}
updateOrder('/rest/roles', record, operate, swapId).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getTableData();
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
// 删除
handleDelete: function (id, content = "") {
this.$confirm(
......
......@@ -46,6 +46,7 @@
import { deleteDomStr } from '@/utils/proDomStr'
import tableMixin from "@/mixins/tableMixin.js";
import EditDialog from "./edit-dialog.vue";
import {updateOrder} from "@/api/orders"
export default {
name: "menus",
mixins: [tableMixin],
......@@ -109,7 +110,7 @@
},
{
label: "排序",
width: 100,
width: 200,
render: (h, scope) => {
return (
<div>
......@@ -117,7 +118,16 @@
type="text"
disabled={scope.row.isTop}
onClick={() => {
this.moveUpward(scope.$index, scope.row);
this.updateOrder(scope.row,'TOP');
}}
>
置顶
</el-button>
<el-button
type="text"
disabled={scope.row.isTop}
onClick={() => {
this.updateOrder(scope.row,'UP');
}}
>
上移
......@@ -126,11 +136,20 @@
type="text"
disabled={scope.row.isBottom}
onClick={() => {
this.moveDown(scope.$index, scope.row);
this.updateOrder(scope.row,'DOWN');
}}
>
下移
</el-button>
<el-button
type="text"
disabled={scope.row.isBottom}
onClick={() => {
this.updateOrder(scope.row,'BOTTOM');
}}
>
置底
</el-button>
</div>
);
},
......@@ -257,18 +276,23 @@
})
.catch(() => { })
},
// 上移下移
moveUpward (index, row) {
realMove(row.dictid, "UP", this.tableData.data);
this.key++;
let id = findParents(this.tableData.data, row.dictid);
this.keyList = id;
},
moveDown (index, row) {
realMove(row.dictid, "DOWN", this.tableData.data);
this.key++;
let id = findParents(this.tableData.data, row.dictid);
this.keyList = id;
//排序
updateOrder(record, operate){
const findIndex = this.tableData.data.findIndex(item => item.id === record.id)
let swapId = ''
if (operate === 'UP') {
swapId = this.tableData.data[findIndex - 1].id
} else if (operate === 'DOWN') {
swapId = this.tableData.data[findIndex + 1].id
}
updateOrder('/rest/users', record, operate, swapId).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getTableList();
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
// 修改人员信息
handleEdit (row) {
......