1b95b632 by 任超

feat:打包分支代码提交

2 parents 856df1c5 eb85698e
Showing 144 changed files with 2721 additions and 513 deletions
......@@ -21,6 +21,4 @@ yarn-error.log*
*.njsproj
*.sln
*.sw?
/src/api/config.js
package-lock.json
......
......@@ -11,10 +11,11 @@
"@jiaminghi/data-view": "^2.10.0",
"axios": "^0.21.1",
"clipboard": "^2.0.11",
"jsoneditor": "^9.9.2",
"core-js": "^3.6.5",
"echarts": "^4.6.0",
"file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"jsoneditor": "^9.9.2",
"lodash": "^4.17.21",
"node-sass": "^4.14.1",
"normalize.css": "7.0.0",
......@@ -24,7 +25,9 @@
"vue-json-editor": "^1.4.3",
"vue-router": "3.0.2",
"vuex": "3.1.0",
"xe-utils": "^3.5.7"
"xe-utils": "^3.5.7",
"xlsx": "^0.17.0",
"xlsx-style": "^0.8.13"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.4",
......
import request from "@/utils/request";
import SERVER from "./config";
import { getParams } from './util'
import {
api,
getAction,
postAction,
deleteAction,
putAction
} from './manageApi'
/** 角色管理开始 */
// 获取角色列表 categoryId
// 获取角色列表 by categoryId
export const getRolesById = categoryId => {
const conditionGroup = {
conditions: [
{
property: 'category',
value:categoryId,
value: categoryId,
operator: 'EQ'
}
],
queryRelation: 'AND'
}
const params = getParams(conditionGroup);
const params = getParams(conditionGroup)
return getAction(api.roles, params)
}
// 人员列表
export const getUserRoles = (id) => {
return getAction(`${api.userRoles}/${id}/users`)
}
// 更新人员
export const updateUser = (id, data) => {
return putAction(`${api.userRoles}/${id}/users`, data)
}
// 根据条件获取用户
export const getUserList = (params) => {
return getAction(api.users, params)
}
// 导出用户列表
export const exportUserList = (params) => {
return getAction(api.users + '/export', params)
/** 角色管理结束 */
/** 授权管理开始 */
// 获取权限列表
export const getAuthorityListAction = (productId, subsystemCode) => {
const conditionGroup = {
conditions: [
{
property: 'productId',
value: productId,
operator: 'EQ'
},
{
property: 'code',
value: subsystemCode + '_MENU',
operator: 'EQ'
}
],
queryRelation: 'AND'
}
const params = getParams(conditionGroup)
return getAction(api.resourceCategory, params)
}
// 更新用户状态
export const updateStatus = (id, status) => {
return putAction(`${api.users}/${id}/${status}/status`)
/**
* 获取角色的权限 id operationCodes resourceCategoryCode
* id 授权id
* operationCodes 操作符集合
* resourceCategoryCode 菜单默认MENU
*/
export const getRoleAuthorityList = (
id,
operationCodes,
resourceCategoryCode
) => {
return getAction(`${api.rolePermissions}/${id}`, {
operationCodes: operationCodes,
resourceCategoryCode: resourceCategoryCode
})
}
// 更新用户解锁状态
export const updateLock = (id) => {
return putAction(`${api.users}/${id}/lock`)
// 角色授权
export const roleAuthority = (id, permissionDtos) => {
return putAction(`${api.rolePermissions}/${id}`, permissionDtos)
}
// 重置用户密码
// export const resetPassword = id => {
// return putAction(`${api.users}/${id}/reset-password`)
// }
// 重置用户密码
export const resetPassword = (ids) => {
return putAction(`${api.users}/reset-passwords?ids=${ids}`)
}
// 删除人员
export const delUser = (id, data) => {
return deleteAction(`${api.userRoles}/${id}/users`, data)
}
// 获取父级菜单
export const getParentMenuListAction = (id) => {
let conditionGroup = {}
......@@ -81,3 +86,4 @@ export const getParentMenuListAction = (id) => {
const params = getParams(conditionGroup)
return getAction(api.menus, params)
}
......
/*
* @Description: 统计率
* @Autor: renchao
* @LastEditTime: 2023-03-01 15:37:49
*/
/* 引入请求文件 */
import request from '@/utils/request'
/* 引入配置文件 */
import SERVER from './config'
class business {
/*
成功率统计
startDate:开始日期
endDate:结束日期
/**
* @description: 成功率统计
* @param {*} startDate
* @param {*} endDate
* @param {*} qxdm
* @author: renchao
*/
async getSuucessRate(startDate,endDate,qxdm) {
async getSuucessRate (startDate, endDate, qxdm) {
return request({
url: SERVER.SERVERAPI + '/rest/statistics/Business/sf',
method: 'get',
params: {
startDate:startDate,
endDate:endDate,
qxdm:qxdm
startDate: startDate,
endDate: endDate,
qxdm: qxdm
}
})
}
......
/*
* @Description: 这个是所有api的前缀配置文件
* @Autor: renchao
* @LastEditTime: 2023-03-01 15:35:44
*/
export default {
// SERVERAPI: '/service-bdcsjsb-th', //浩浩
// SERVERAPI: '/service-bdcsjsb-zz',
SERVERAPI: '/bdcsjsb', //赵千
MANAGEMENTAPI: 'http://192.168.2.236/management'
// SERVERAPI: '/bdcsjsb-service'
// SERVERAPI: '/bdcsjsb-jiao0'
}
// 汉中
// export default {
// // SERVERAPI: '/service-bdcsjsb-th', //线上
// SERVERAPI: '/bdcsjsb', //赵千
// MANAGEMENTAPI: 'http://172.16.56.32:8877/management'
// }
/*
* @Description: 数据上报模块api文件
* @Autor: renchao
* @LastEditTime: 2023-03-03 14:38:57
*/
/* 引入axios请求文件 */
import request from '@/utils/request'
/* 引入配置 */
import SERVER from './config'
const urlHeader = SERVER.SERVERAPI + '/rest/sjsb/DataReport/'
// 区县上报分页
/**
* @description: 区县上报根据业务id获取xml
* @param {*} bizMsgid
* @author: renchao
*/
export function getXml (bizMsgid) {
return request({
url: SERVER.SERVERAPI + '/rest/sjsb/DataReport/getXml',
url: urlHeader + 'getXml',
method: 'get',
params: {
businessId: bizMsgid
......@@ -12,58 +24,102 @@ export function getXml (bizMsgid) {
})
}
// 区县上报分页
/**
* @description: 区县上报分页
* @param {*} data
* @author: renchao
*/
export function getAreaReportPage (data) {
return request({
url: SERVER.SERVERAPI + '/rest/sjsb/DataReport/getAreaReportPage',
url: urlHeader + 'getAreaReportPage',
method: 'post',
data
})
}
// 接入数据上报分页
/**
* @description: 接入数据上报分页
* @author: renchao
*/
export function getReceiveDataReportPage (data) {
return request({
url: SERVER.SERVERAPI + '/rest/sjsb/DataReport/getReceiveDataReportPage',
url: urlHeader + 'getReceiveDataReportPage',
method: 'post',
data
})
}
// 数据上报分页
/**
* @description: 数据上报分页
* @author: renchao
*/
export function getDataReportPage (data) {
return request({
url: SERVER.SERVERAPI + '/rest/sjsb/DataReport/getDataReportPage',
url: urlHeader + 'getDataReportPage',
method: 'post',
data
})
}
// 查询数据上报详情tabs选项卡
/**
* @description: 查询数据上报详情tabs选项卡
* @author: renchao
*/
export function getTabsDetail (params) {
return request({
url: SERVER.SERVERAPI + '/rest/sjsb/DataReport/getTabsDetail',
url: urlHeader + 'getTabsDetail',
method: 'get',
params
})
}
// 查询数据上报详情
/**
* @description: 查询数据上报详情
* @author: renchao
*/
export function getReportDetail (params) {
return request({
url: SERVER.SERVERAPI + '/rest/sjsb/DataReport/getReportDetail',
url: urlHeader + 'getReportDetail',
method: 'get',
params
})
}
// 结果
/**
* @description: 获取数据上报结果
* @param {*} bsmReport
* @author: renchao
*/
export function getReceiveDataReportResult (bsmReport) {
return request({
url: SERVER.SERVERAPI + '/rest/sjsb/DataReport/getReceiveDataReportResult',
url: urlHeader + 'getReceiveDataReportResult',
method: 'get',
params: {
bsmReport: bsmReport
}
})
}
/**
* @description: 重新上报
* @param {*} bsmReport
* @author: renchao
*/
export function restartGenerateXml (bsmReport) {
return request({
url: urlHeader + 'restartGenerateXml?bsmReport=' + bsmReport,
method: 'post'
})
}
/**
* @description: 编辑报文头
* @param {*} data
* @author: renchao
*/
export function edit (data) {
return request({
url: urlHeader + 'edit',
method: 'post',
data
})
}
\ No newline at end of file
......
......@@ -78,12 +78,12 @@ export const api = {
crudPut: crud + '/rest/put', // crudPut
crudDel: crud + '/rest/delete', // crudDel
crudMetadata: crud + '/rest/metadata', //crudMetadata
crudBusiness : crud + '/rest/business', // crudBusiness
crudDatasources : crud + '/rest/datasources', // crudDatasources
crudBusiness: crud + '/rest/business', // crudBusiness
crudDatasources: crud + '/rest/datasources', // crudDatasources
}
// 根据code获取字典 params={isTree:true})
export function getDictItems(code, params = {}) {
export function getDictItems (code, params = {}) {
return request({
url: `${api.baseDataCategory}/${code}/base-datas`,
method: 'get',
......@@ -91,21 +91,21 @@ export function getDictItems(code, params = {}) {
})
}
// 获取一级字典值下级接口
export function getDictItemsChild(id) {
export function getDictItemsChild (id) {
return request({
url: `${api.baseData}/dict/${id}`,
method: 'get'
})
}
// 获取传入字段的所有级别字典值
export function getAllDictItems(name) {
export function getAllDictItems (name) {
return request({
url: `${api.baseDataCategory}/${name}/base-datas`,
method: 'get'
})
}
// get公共方法
export function getAction(url, params = {}) {
export function getAction (url, params = {}) {
return request({
url,
method: 'get',
......@@ -113,7 +113,7 @@ export function getAction(url, params = {}) {
})
}
// post公共方法
export function postAction(url, data = null) {
export function postAction (url, data = null) {
return request({
url,
method: 'post',
......@@ -121,7 +121,7 @@ export function postAction(url, data = null) {
})
}
// method= {post | put}
export function httpAction(url, data, method) {
export function httpAction (url, data, method) {
return request({
url,
method,
......@@ -129,7 +129,7 @@ export function httpAction(url, data, method) {
})
}
// put公共方法
export function putAction(url, data = null) {
export function putAction (url, data = null) {
return request({
url,
method: 'put',
......@@ -137,7 +137,7 @@ export function putAction(url, data = null) {
})
}
// delete
export function deleteAction(url, data = null) {
export function deleteAction (url, data = null) {
return request({
url,
method: 'delete',
......@@ -146,7 +146,7 @@ export function deleteAction(url, data = null) {
}
// 批量删除
export function deleteBranch(url, data) {
export function deleteBranch (url, data) {
return request({
url,
method: 'delete',
......
import {
api,
getAction,
deleteAction,
putAction
} from './manageApi'
export const updateUserPassword = (data) => {
return putAction(`${api.users}/update-password`, data)
}
// 根据条件获取用户
export const getUserList = (params) => {
return getAction(api.users, params)
}
// 重置用户密码
// export const resetPassword = id => {
// return putAction(`${api.users}/${id}/reset-password`)
// }
// 重置用户密码
export const resetPassword = (ids) => {
return putAction(`${api.users}/reset-passwords?ids=${ids}`)
}
// 人员列表
export const getUserRoles = (id) => {
return getAction(`${api.userRoles}/${id}/users`)
}
// 更新人员
export const updateUser = (id, data) => {
return putAction(`${api.userRoles}/${id}/users`, data)
}
/*
* @Description: 登薄日志
* @Autor: renchao
* @LastEditTime: 2023-03-02 13:45:53
*/
/* 引入请求文件 */
import request from '@/utils/request'
/* 引入配置文件 */
import SERVER from './config'
// 登簿日志分页
const urlHeader = SERVER.SERVERAPI + '/rest/sjsb/RecordLog/'
/**
* @description: 登簿日志分页
* @author: renchao
*/
export function getRecordLogPage (data) {
return request({
url: SERVER.SERVERAPI + '/rest/sjsb/RecordLog/getRecordLogPage',
url: urlHeader + 'getRecordLogPage',
method: 'post',
data
})
}
/**
* @description: 获取详情明细
* @param {*} dbBsm
* @author: renchao
*/
export function getDetail (dbBsm) {
return request({
url: urlHeader + 'getDetail',
method: 'get',
params: {
dbBsm: dbBsm
}
})
}
/**
* @description: 详情页面编辑
* @param {*} data
* @author: renchao
*/
export function edit (data) {
return request({
url: urlHeader + 'edit',
method: 'post',
data
})
}
/**
* @description: 登薄日志重新生成报文
* @param {*} dbBsm
* @author: renchao
*/
export function regenerateDbXml (dbBsm) {
return request({
url: urlHeader + 'regenerateDbXml',
method: 'get',
params: {
dbBsm: dbBsm
}
})
}
......
/*
* @Author: yangwei
* @Date: 2023-03-09 09:29:52
* @LastEditors: yangwei
* @LastEditTime: 2023-03-09 10:31:31
* @FilePath: \bdcjg-web\src\api\statistics.js
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
import request from '@/utils/request'
import SERVER from './config'
const url = SERVER.SERVERAPI + '/rest/statistics/Efficient/'
/**
* dataReceiveQuality
* @param startDate
* @param endDate
* @returns {AxiosPromise}
*/
export function dataReceiveQuality (startDate, endDate) {
return request({
url: url + 'dataReceiveQuality?startDate='+startDate+'&endDate='+endDate,
method: 'post'
})
}
/**
* 空项率统计
* @returns {AxiosPromise}
* @param startDate
* @param endDate
*/
export function nonNullSta (startDate, endDate) {
return request({
url: url + 'nonNullSta?startDate='+startDate+'&endDate='+endDate,
method: 'post'
})
}
/**
* 登簿质量统计
* @returns {AxiosPromise}
* @param startDate
* @param endDate
*/
export function registerBookQuality (startDate, endDate) {
return request({
url: url + 'registerBookQuality?startDate='+startDate+'&endDate='+endDate,
method: 'post'
})
}
......@@ -8,10 +8,21 @@ export function getUserInfo () {
})
}
// // 获取菜单信息
// export function getMenuInfo () {
// return request({
// url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus',
// method: 'get',
// })
// }
// 获取菜单信息
export function getMenuInfo () {
export function getMenuInfo (data) {
return request({
url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus',
method: 'get',
params: {
productCode: data,
},
})
}
......
......@@ -4,8 +4,7 @@
<script>
import tdTheme from "./theme.json"; // 引入默认主题
import "../map/hanzhong.js";
import { mapGetters } from "vuex";
export default {
name: "echart",
props: {
......@@ -30,14 +29,14 @@ export default {
default: () => ({}),
},
},
data() {
data () {
return {
chart: null,
};
},
watch: {
options: {
handler(options) {
handler (options) {
// 设置true清空echart缓存
this.chart.setOption(options, true);
window.addEventListener("resize", () => {
......@@ -46,22 +45,33 @@ export default {
}
});
},
deep: true,
deep: true
},
},
computed: {
...mapGetters(["dicData"]),
logoName () {
return (
this.dicData["sysCode"] &&
this.dicData["sysCode"].filter((item) => item.DCODE == "areaMap")
);
},
},
mounted() {
mounted () {
this.$echarts.registerTheme("tdTheme", tdTheme); // 覆盖默认主题
this.$nextTick(() => {
this.initChart();
})
},
beforeDestroy() {
this.chart.dispose();
beforeDestroy () {
// this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
initChart () {
// 初始化echart
this.chart = this.$echarts.init(this.$el, "tdTheme");
function nowSize(val, initWidth = 1920) {
function nowSize (val, initWidth = 1920) {
return val * (nowClientWidth / initWidth);
}
this.chart.setOption(this.options, true);
......
......@@ -2,7 +2,7 @@
<div class="naturalBuilding itemForm">
<el-form :model="naturalForm" :rules="rules" ref="formList" label-width="115px" :key="key">
<div v-for="(item, index) in naturalForm.naturalList" :key="index" class="naturalBuilding-item">
<p class="naturalBuilding-name">自然幢{{ index + 1 }}</p>
<p class="naturalBuilding-name obligee-item-name">自然幢{{ index + 1 }}</p>
<div class="naturalBuilding-list">
<el-row>
<el-col :span="8">
......@@ -330,7 +330,7 @@ export default {
default: "",
},
},
data() {
data () {
return {
naturalForm: {
naturalList: [
......@@ -366,7 +366,7 @@ export default {
};
},
methods: {
async featchData() {
async featchData () {
try {
let { result: res } = await kttFwZrz.getKttFwZrzById(this.bsmSjsb);
this.naturalForm.naturalList = res;
......@@ -375,7 +375,7 @@ export default {
this.$refs.msg.messageShow();
}
},
handleUpdateForm() {
handleUpdateForm () {
return new Promise(async (resolve) => {
try {
let res = await kttFwZrz.updateKttFwZrz(this.naturalForm.naturalList);
......
/*
* FileName: lb-column.vue
* Remark: element-column
* Project: lb-element-table
* Author: 任超
* File Created: Tuesday, 19th March 2019 9:58:23 am
* Last Modified: Tuesday, 19th March 2019 10:14:42 am
* Modified By: 任超
*/
<template>
<el-table-column v-bind="$attrs" v-on="$listeners" :prop="column.prop" :label="column.label" :type="column.type"
:index="column.index" :column-key="column.columnKey" :width="column.width" :min-width="column.minWidth"
:fixed="column.fixed" :scoped-slot="column.renderHeader" :sortable="column.sortable || false"
:sort-method="column.sortMethod" :sort-by="column.sortBy" :sort-orders="column.sortOrders"
:resizable="column.resizable || true" :formatter="column.formatter"
:show-overflow-tooltip="column.showOverflowTooltip || false" :align="column.align || align || 'center'"
:header-align="column.headerAlign || headerAlign || column.align || align || 'center'"
:class-name="column.className" :label-class-name="column.labelClassName" :selectable="column.selectable"
:reserve-selection="column.reserveSelection || false" :filters="column.filters"
:filter-placement="column.filterPlacement" :filter-multiple="column.filterMultiple"
:filter-method="column.filterMethod" :filtered-value="column.filteredValue">
<template slot="header" slot-scope="scope">
<lb-render v-if="column.renderHeader" :scope="scope" :render="column.renderHeader">
</lb-render>
<span v-else>{{ scope.column.label }}</span>
</template>
<template slot-scope="scope">
<lb-render :scope="scope" :render="column.render">
</lb-render>
</template>
<template v-if="column.children">
<lb-column v-for="(col, index) in column.children" :key="index" :column="col">
</lb-column>
</template>
</el-table-column>
</template>
<script>
import LbRender from './LbRender'
import forced from './forced.js'
export default {
name: 'LbColumn',
props: {
column: Object,
headerAlign: String,
align: String
},
components: {
LbRender
},
methods: {
setColumn () {
if (this.column.type) {
this.column.renderHeader = forced[this.column.type].renderHeader
this.column.render = this.column.render || forced[this.column.type].renderCell
}
if (this.column.formatter) {
this.column.render = (h, scope) => {
return <span>{scope.column.formatter(scope.row, scope.column, scope.row, scope.$index)}</span>
}
}
if (!this.column.render) {
this.column.render = (h, scope) => {
return <span>{scope.row[scope.column.property]}</span>
}
}
}
},
watch: {
column: {
handler () {
this.setColumn()
},
immediate: true
}
}
}
</script>
/*
* FileName: lb-render.vue
* Remark: 自定义render
* Project: lb-element-table
* Author: 任超
* File Created: Tuesday, 19th March 2019 10:15:30 am
* Last Modified: Tuesday, 19th March 2019 10:15:32 am
* Modified By: 任超
*/
<script>
export default {
name: 'LbRender',
functional: true,
props: {
scope: Object,
render: Function
},
render: (h, ctx) => {
return ctx.props.render ? ctx.props.render(h, ctx.props.scope) : ''
}
}
</script>
export default {
selection: {
renderHeader: (h, { store }) => {
return (
<el-checkbox
disabled={store.states.data && store.states.data.length === 0}
indeterminate={
store.states.selection.length > 0 && !store.states.isAllSelected
}
nativeOn-click={store.toggleAllSelection}
value={store.states.isAllSelected}
/>
)
},
renderCell: (h, { row, column, store, $index }) => {
return (
<el-checkbox
nativeOn-click={event => event.stopPropagation()}
value={store.isSelected(row)}
disabled={
column.selectable
? !column.selectable.call(null, row, $index)
: false
}
on-input={() => {
store.commit('rowSelectedChanged', row)
}}
/>
)
},
sortable: false,
resizable: false
},
index: {
renderHeader: (h, scope) => {
return <span>{scope.column.label || '#'}</span>
},
renderCell: (h, { $index, column }) => {
let i = $index + 1
const index = column.index
if (typeof index === 'number') {
i = $index + index
} else if (typeof index === 'function') {
i = index($index)
}
return <div>{i}</div>
},
sortable: false
},
expand: {
renderHeader: (h, scope) => {
return <span>{scope.column.label || ''}</span>
},
renderCell: (h, { row, store }, proxy) => {
const expanded = store.states.expandRows.indexOf(row) > -1
return (
<div
class={
'el-table__expand-icon ' +
(expanded ? 'el-table__expand-icon--expanded' : '')
}
on-click={e => proxy.handleExpandClick(row, e)}
>
<i class='el-icon el-icon-arrow-right' />
</div>
)
},
sortable: false,
resizable: false,
className: 'el-table__expand-column'
}
}
/*
* FileName: lb-table.vue
* Remark: element table
* Project: lb-element-table
* Author: 任超
* File Created: Tuesday, 19th March 2019 9:55:27 am
* Last Modified: Tuesday, 19th March 2019 9:55:34 am
* Modified By: 任超
*/
<template>
<div :class="['lb-table', customClass]">
<el-table v-if="!heightNumSetting" class="table-fixed" :row-style="{ height: '50px' }" ref="elTable" :border='border'
:row-class-name="tableRowClassName" :show-header='showHeader' @row-click="singleElection" v-bind="$attrs"
:height="tableHeight" v-on="$listeners" :data="data" style="width: 100%"
:span-method="this.merge ? this.mergeMethod : this.spanMethod">
<el-table-column width="45" align="center" v-if="isRadio">
<template slot-scope="scope">
<el-radio v-model="selected" :label="scope.$index"></el-radio>
</template>
</el-table-column>
<el-table-column :label="downTitle" align="center">
<lb-column v-bind="$attrs" v-for="(item, index) in column" :key="index" :column="item">
</lb-column>
</el-table-column>
</el-table>
<br>
<el-pagination class="lb-table-pagination" v-if="pagination" v-bind="$attrs" v-on="$listeners" background
layout="total, prev, pager, next" @current-change="paginationCurrentChange"
:style="{ 'margin-top': paginationTop, 'text-align': paginationAlign }">
</el-pagination>
</div>
</template>
<script>
import LbColumn from './LbColumn'
export default {
props: {
column: Array,
data: Array,
spanMethod: Function,
pagination: {
type: Boolean,
default: true,
},
downExcel: {
type: Boolean,
default: false,
},
downTitle: {
type: String,
default: '标题'
},
isRadio: {
type: Boolean,
default: false,
},
border: {
type: Boolean,
default: false,
},
showHeader: {
type: Boolean,
default: true,
},
paginationTop: {
type: String,
default: '0',
},
heightNum: {
type: Number,
default: 355,
},
maxHeight: {
type: Number,
default: 500
},
heightNumSetting: {
type: Boolean,
default: false,
},
customClass: {
type: String,
default: '',
},
paginationAlign: {
type: String,
default: 'left',
},
merge: Array,
},
components: {
LbColumn,
},
data () {
return {
tableHeight: 'auto',
mergeLine: {},
mergeIndex: {},
selected: ''
}
},
created () {
this.getMergeArr(this.data, this.merge)
this.getHeight()
},
computed: {
dataLength () {
return [] || this.data.length
},
},
methods: {
// 单选
singleElection (row) {
this.selected = this.data.indexOf(row);
},
tableRowClassName ({ row, rowIndex }) {
if (rowIndex % 2 === 1) {
return 'interlaced';
}
},
getHeight () {
if (!this.heightNumSetting) {
let _this = this
if (this.heightNum) {
_this.$nextTick(() => {
window.addEventListener('resize', () => {
_this.tableHeight = _this.calcHeightx(230)
});
_this.tableHeight = _this.calcHeightx(230)
})
} else {
_this.tableHeight = window.innerHeight - _this.heightNum
}
}
},
calcHeightx (value, wappered = true) {
//项目自定义的公共header部分的高度,可忽略
let header = document.querySelector(".from-clues-header").offsetHeight;
//value为动态计算table界面高度时,减去的其他空白部分,需自行在调试找到临界值,剩下的就是table表格的高度(包含header+body部分)
value = value == undefined ? 100 : value;
let res = window.innerHeight - parseInt(header) - value;
if (wappered) {
//通过原生方法,获取dom节点的高度------获取element-ui table表格body的元素
let wapper = window.document.getElementsByClassName('el-table__body-wrapper');
//通过原生方法,获取dom节点的高度------获取element-ui table表格header的元素
let header = window.document.getElementsByClassName('el-table__header-wrapper');
//必须加延时,要不然赋不上去值
setTimeout(() => {
//通过上边计算得到的table高度的value值,减去table表格的header高度,剩下的通过dom节点直接强行赋给table表格的body
wapper[0].style.height = (value - header[0].clientHeight)
}, 100)
}
return res;
},
clearSelection () {
this.$refs.elTable.clearSelection()
},
toggleRowSelection (row, selected) {
this.$refs.elTable.toggleRowSelection(row, selected)
},
toggleAllSelection () {
this.$refs.elTable.toggleAllSelection()
},
toggleRowExpansion (row, expanded) {
this.$refs.elTable.toggleRowExpansion(row, expanded)
},
setCurrentRow (row) {
this.$refs.elTable.setCurrentRow(row)
},
clearSort () {
this.$refs.elTable.clearSort()
},
clearFilter (columnKey) {
this.$refs.elTable.clearFilter(columnKey)
},
doLayout () {
this.$refs.elTable.doLayout()
},
sort (prop, order) {
this.$refs.elTable.sort(prop, order)
},
paginationCurrentChange (val) {
this.$emit('p-current-change', val)
},
getMergeArr (tableData, merge) {
if (!merge) return
this.mergeLine = {}
this.mergeIndex = {}
merge.forEach((item, k) => {
tableData.forEach((data, i) => {
if (i === 0) {
this.mergeIndex[item] = this.mergeIndex[item] || []
this.mergeIndex[item].push(1)
this.mergeLine[item] = 0
} else {
if (data[item] === tableData[i - 1][item]) {
this.mergeIndex[item][this.mergeLine[item]] += 1
this.mergeIndex[item].push(0)
} else {
this.mergeIndex[item].push(1)
this.mergeLine[item] = i
}
}
})
})
},
mergeMethod ({ row, column, rowIndex, columnIndex }) {
const index = this.merge.indexOf(column.property)
if (index > -1) {
const _row = this.mergeIndex[this.merge[index]][rowIndex]
const _col = _row > 0 ? 1 : 0
return {
rowspan: _row,
colspan: _col,
}
}
},
},
watch: {
merge () {
this.getMergeArr(this.data, this.merge)
},
dataLength () {
this.getMergeArr(this.data, this.merge)
}
},
}
</script>
<style rel="stylesheet/scss" scoped lang="scss">
.lb-table {
margin-top: 1px;
.interlaced {
background: #fafcff;
border: 1px solid #ebf2fa;
}
}
/deep/.el-table .cell {
padding-left: 3px;
padding-right: 3px;
}
/deep/.el-radio__label {
display: none;
}
</style>
## 这是对于element-table 进行的二次封装
### 文档地址
<!-- table 已经全局注册不需要每个页面单独注册 -->
[Windows/Mac/Linux 全平台客户端](https://github.liubing.me/lb-element-table/zh/guide/)
......@@ -4,14 +4,13 @@
:options="options"
id="bottomLeftChart"
height="100%"
width="100%"
></Echart>
width="100%"></Echart>
</template>
<script>
import Echart from "@/common/echart";
export default {
data() {
import Echart from "@/common/echart";
export default {
data () {
return {
options: {},
};
......@@ -27,7 +26,7 @@ export default {
},
watch: {
cdata: {
handler(newData) {
handler (newData) {
this.options = {
tooltip: {
trigger: "axis",
......@@ -124,5 +123,5 @@ export default {
deep: true,
},
},
};
};
</script>
......
......@@ -3,10 +3,10 @@
</template>
<script>
import Chart from "./Chart";
import work from "@/api/work";
export default {
data() {
import Chart from "./Chart";
import work from "@/api/work";
export default {
data () {
return {
cdata: {
category: [],
......@@ -18,14 +18,14 @@ export default {
components: {
Chart,
},
mounted() {
mounted () {
window.addEventListener("resize", () => {
this.submitViews();
});
this.submitViews();
},
methods: {
async submitViews() {
async submitViews () {
try {
let { result: res } = await work.submitViews("A20");
this.cdata.category = [];
......@@ -43,7 +43,7 @@ export default {
}
},
},
};
};
</script>
<style lang="scss" scoped></style>
......
<template>
<!--登记类型总量柱状图 -->
<Echart :options="options" id="bottomLeftChart" height="100%" width="100%" class="" ></Echart>
<Echart :options="options" id="bottomLeftChart" height="100%" width="100%" class=""></Echart>
</template>
<script>
import Echart from "@/common/echart";
export default {
import Echart from "@/common/echart";
export default {
data () {
return {
options: {},
......@@ -27,7 +27,7 @@ export default {
grid: {
// 让图表占满容器
top: "20%",
left: "10%",
left: "12%",
right: "5%",
bottom: "16%",
},
......@@ -127,5 +127,5 @@ export default {
deep: true,
},
},
};
};
</script>
......
<template>
<!-- 地图 -->
<Echart id="centreLeft2Chart" class="centreLeft2Chart":key="key" ref="centreLeft2ChartRef" width="100%" height="100%"
<Echart
id="centreLeft2Chart"
class="centreLeft2Chart"
:key="key"
ref="centreLeft2ChartRef"
width="100%"
height="100%"
:options="options"></Echart>
</template>
<script>
import Echart from '@/common/echart';
export default {
import Echart from "@/common/echart";
import { mapGetters } from "vuex";
export default {
data () {
return {
options: {},
max: "100", //最大value值
min: "1", // 最小value值
key: 0
key: 0,
mapjson: "",
};
},
components: {
Echart,
},
created () { },
props: {
cdata: {
type: Array,
default: () => [],
},
},
mounted() {
mounted () {
window.addEventListener("resize", () => {
this.key++
}); },
this.key++;
});
this.getDistrictcode();
},
watch: {
cdata: {
handler (newData) {
......@@ -46,115 +58,98 @@ export default {
宁强县: [106.25958, 32.82881, 20],
略阳县: [106.15399, 33.33009, 20],
};
let convertData = function (data) {
let scatterData = [];
for (var i = 0; i < data.length; i++) {
var geoCoord = geoCoordMap[data[i].name];
if (geoCoord) {
scatterData.push({
name: data[i].name,
value: geoCoord.concat(data[i].value),
});
}
}
return scatterData;
};
this.options = {
showLegendSymbol: true,
tooltip: {
trigger: 'item',
trigger: "item",
textStyle: {
fontSize: 14,
lineHeight: 22,
},
position: point => {
position: (point) => {
// 固定在顶部
return [point[0] + 50, point[1] - 20];
},
// 如果需要自定义 tooltip样式,需要使用formatter
formatter: params => {
return `<div style="">${params.name}:${params.value + "个"}</div>`
}
formatter: (params) => {
return `<div style="">${params.name}:${params.value + "个"
}</div>`;
},
},
visualMap: {
min: 0,
max: _this.max,
bottom: '13%',
bottom: "13%",
left: 50,
splitNumber: 6,
seriesIndex: [0],
itemWidth: 20, // 每个图元的宽度
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' },
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" },
],
textStyle: {
color: '#737373'
}
color: "#737373",
},
},
geo: {
aspectScale: 1, //长宽比
zoom: 1.1,
mapType: '汉中市', // 自定义扩展图表类型
top: '15%',
left: '10%',
map: '汉中市',
mapType: "", // 自定义扩展图表类型
top: "15%",
left: "10%",
map: "汉中市",
itemStyle: {
normal: {//阴影
areaColor: '#5689FD ',
shadowColor: '#21371d',
normal: {
//阴影
areaColor: "#5689FD ",
shadowColor: "#21371d",
borderWidth: 0,
shadowOffsetX: 2,
shadowOffsetY: 25
}
}
shadowOffsetY: 25,
},
},
},
series: [
{
type: 'map',
type: "map",
aspectScale: 1, //长宽比
zoom: 1.1,
mapType: '汉中市', // 自定义扩展图表类型
top: '15%',
left: '10%',
mapType: "汉中市", // 自定义扩展图表类型
top: "15%",
left: "10%",
itemStyle: {
normal: {
areaColor: 'rgba(19,54,162,.5)',
borderColor: 'rgba(0,242,252,.5)',
areaColor: "rgba(19,54,162,.5)",
borderColor: "rgba(0,242,252,.5)",
borderWidth: 2,
shadowBlur: 1,
borderColor: 'rgb(155, 200, 200)',
shadowColor: '#44f2fc',
borderColor: "rgb(155, 200, 200)",
shadowColor: "#44f2fc",
},
// emphasis: {
// areaColor: '#4f7fff',
// borderColor: 'rgba(0,242,252,.5)',
// borderWidth: 2,
// shadowBlur: 10,
// shadowColor: '#00f2fc',
// },
},
label: {
formatter: params => {
return `${params.name}\n${params.value+"个"}`;
formatter: (params) => {
return `${params.name}\n${params.value + "个"}`;
},
show: true,
position: 'insideRight',
position: "insideRight",
textStyle: {
fontSize: 14,
color: '#efefef',
color: "#efefef",
},
emphasis: {
textStyle: {
color: '#fff',
}
}
color: "#fff",
},
},
},
data: newData,
}
},
],
};
// 重新选择区域
......@@ -165,7 +160,23 @@ export default {
deep: true,
},
},
computed: {
...mapGetters(["sidebar", "dicData"]),
logoName () {
return (
this.dicData["sysCode"].filter((item) => { return item.DCODE == "areaMap" })
);
},
},
methods: {
// 根据行政区代码匹配行政区
getDistrictcode () {
this.mapjson = ""
if (this.logoName[0].DNAME) {
this.mapjson = this.logoName[0].DNAME;
require(`@/common/map/${this.mapjson}.js`);
}
},
// 开启定时器
startInterval () {
const _self = this;
......@@ -189,23 +200,23 @@ export default {
index = Math.floor(Math.random() * length);
}
map.dispatchAction({
type: 'mapUnSelect',
type: "mapUnSelect",
seriesIndex: 0,
dataIndex: this.preSelectMapIndex,
});
map.dispatchAction({
type: 'showTip',
type: "showTip",
seriesIndex: 0,
dataIndex: index,
});
map.dispatchAction({
type: 'mapSelect',
type: "mapSelect",
seriesIndex: 0,
dataIndex: index,
});
this.preSelectMapIndex = index;
} catch (error) {
console.log(error)
console.log(error);
}
});
},
......@@ -218,34 +229,32 @@ export default {
_self.reSelectMapRandomArea();
}, 0);
// 移入区域,清除定时器、取消之前选中并选中当前
map.on('mouseover', function (params) {
map.on("mouseover", function (params) {
clearInterval(_self.intervalId);
map.dispatchAction({
type: 'mapUnSelect',
type: "mapUnSelect",
seriesIndex: 0,
dataIndex: _self.preSelectMapIndex,
});
map.dispatchAction({
type: 'mapSelect',
type: "mapSelect",
seriesIndex: 0,
dataIndex: params.dataIndex,
});
_self.preSelectMapIndex = params.dataIndex;
});
// 移出区域重新随机选中地图区域,并开启定时器
map.on('globalout', function () {
map.on("globalout", function () {
_self.reSelectMapRandomArea();
_self.startInterval();
});
this.startInterval();
} catch (error) {
console.log(error)
console.log(error);
}
});
},
},
};
};
</script>
<style>
</style>
<style></style>
......
......@@ -4,16 +4,15 @@
id="centreLeft1Chart"
:key="key"
height="1.0417rem"
width="80%"
></Echart>
width="80%"></Echart>
</template>
<script>
import Echart from "@/common/echart";
export default {
import Echart from "@/common/echart";
export default {
components: {
Echart,
},
data() {
data () {
return {
key: 0,
};
......@@ -26,7 +25,7 @@ export default {
},
watch: {
cdata: {
handler(newData) {
handler (newData) {
this.options = {
color: [
......@@ -49,8 +48,11 @@ export default {
label: {
formatter: (params) => {
// console.log(params)
return `${params.name}(${params.value}`;
return `${params.name}\n(${params.value}`;
},
position: "outer",
alignTo: "edge",
margin: 5
},
labelLine: {
lineStyle: {
......@@ -67,12 +69,12 @@ export default {
deep: true,
},
},
};
};
</script>
<style lang="scss" scoped>
#centreLeft1Chart {
#centreLeft1Chart {
margin-bottom: 0.0521rem;
margin-left: .3125rem;
}
margin-left: 0.3125rem;
}
</style>
......
<!--
功能:结果
作者:calliope
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-13 11:09:01
-->
<template>
<div class='result'>
<div class="result-con" style="margin-bottom: 15px;">
<p>响应xml</p>
<el-input type="textarea" disabled :rows="6" class="resulttext" placeholder="响应xml" v-model="REPMSGXML">
</el-input>
</div>
<div class="result-con" style="margin-top: 15px;">
<p>错误信息</p>
<el-input type="textarea" disabled :rows="6" class="resulttext" placeholder="错误信息" v-model="ERRORINFO">
</el-input>
</div>
</div>
</template>
<script>
import { getReceiveDataReportResult } from "@/api/dataReport.js";
......@@ -40,21 +45,40 @@ export default {
<style scoped lang='scss'>
@import '~@/styles/public.scss';
.result {
padding: 15px;
p {
color: #ffffff;
line-height: 26px;
font-size: 18px;
}
height: 100%;
/deep/.el-textarea__inner {
min-height: 33vh !important;
background-color: #08346F !important;
height: 30vh !important;
color: #ffffff;
border: none !important;
color: #ffffff;
}
&-con {
background: #04275B;
border-radius: 2px;
padding: 10px;
box-sizing: border-box;
p {
color: #2997E8;
font-size: 14px;
position: relative;
padding-left: 10px;
}
p::before {
position: absolute;
content: '';
width: 3px;
height: 10px;
background-color: #2997E8;
left: 0;
top: 3px;
}
}
}
</style>
......
......@@ -10,26 +10,15 @@ export default {
type: String,
default: ''
}
},
data () {
return {
myValue: this.value,
}
},
methods: {
onJsonChange (value) {
},
onJsonSave (value) {
}
}
}
</script>
<style scoped lang="scss">
/* jsoneditor右上角默认有一个链接,加css去掉了 */
/deep/.el-textarea__inner {
min-height: 73vh !important;
height: 67vh !important;
border: none !important;
background-color: #08346F !important;
color: #ffffff;
border: none !important;
......
......@@ -2,6 +2,7 @@
<div>
<i class="el-icon-s-management icon" :title="title" @click="openDialog" />
<el-dialog
class="configuration"
:key="key"
:title="title"
:inner-dialog="true"
......@@ -9,8 +10,7 @@
width="600px"
:close-on-click-modal="false"
append-to-body
@cancel="cancel"
>
@cancel="cancel">
<vue-json-editor
id="minejson"
v-model="resultInfo"
......@@ -18,15 +18,13 @@
lang="zh"
@json-change="onJsonChange"
@json-save="onJsonSave"
@has-error="onError"
/>
@has-error="onError" />
<el-tooltip
content="全屏缩放"
effect="dark"
placement="bottom"
fullscreen
class="fullScreen"
>
class="fullScreen">
<i class="el-icon-full-screen" @click="enLarge" />
</el-tooltip>
<template slot="footer">
......@@ -34,21 +32,19 @@
<el-button
type="primary"
class="confirmBtn"
@click="onJsonSave"
>保存</el-button>
@click="onJsonSave">保存</el-button>
<el-button
type="primary"
class="cancelBtn"
@click="cancel"
>关闭</el-button>
@click="cancel">关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
import vueJsonEditor from 'vue-json-editor'
export default {
import vueJsonEditor from 'vue-json-editor'
export default {
components: {
vueJsonEditor
},
......@@ -62,7 +58,7 @@ export default {
default: ''
}
},
data() {
data () {
return {
activeNames: [],
resultInfo: {},
......@@ -75,7 +71,7 @@ export default {
},
watch: {
resultInfos: {
handler: function(val) {
handler: function (val) {
++this.key
this.resultInfo =
this.resultInfos === '' ? {} : JSON.parse(this.resultInfos)
......@@ -86,17 +82,17 @@ export default {
}
},
mounted() {
mounted () {
this.resultInfo =
this.resultInfos === '' ? {} : JSON.parse(this.resultInfos)
},
methods: {
onJsonChange(value) {
onJsonChange (value) {
// 只有在格式正确的时候进入此事件
this.hasJsonFlag = true
},
onJsonSave() {
onJsonSave () {
const value = this.resultInfo
console.log(this.resultInfo, 'resultInfo')
if (this.hasJsonFlag === false) {
......@@ -109,19 +105,19 @@ export default {
return true
}
},
onError(value) {
onError (value) {
this.hasJsonFlag = false
},
openDialog() {
openDialog () {
this.dialogVisible = true
},
cancel() {
cancel () {
console.log(this.tmpResultInfo, 'tmpResultInfo')
this.resultInfo = this.tmpResultInfo
this.dialogVisible = false
},
// 放大
enLarge() {
enLarge () {
const fullarea = document.getElementById('minejson')
if (fullarea.requestFullscreen) {
fullarea.requestFullscreen()
......@@ -135,41 +131,57 @@ export default {
this.isEnlarge = true
}
}
}
}
</script>
<style scoped lang="scss">
/* jsoneditor右上角默认有一个链接,加css去掉了 */
.icon {
/* jsoneditor右上角默认有一个链接,加css去掉了 */
.icon {
color: #349af3;
}
/deep/ .jsoneditor-vue {
}
/deep/ .jsoneditor-vue {
height: 100%;
}
.fullScreen {
}
.fullScreen {
position: absolute;
right: 5%;
top: 22%;
top: 20%;
cursor: pointer;
color: #fff;
}
/deep/ .jsoneditor-modes {
}
/deep/ .jsoneditor-modes {
display: none !important;
}
.jsoneditor-poweredBy {
}
/deep/.jsoneditor-poweredBy {
display: none !important;
}
.jsoneditor-menu {
}
.jsoneditor-menu {
background-color: #9c9e9f !important;
border-bottom: 1px solid #9c9e9f !important;
}
.jsoneditor {
}
.jsoneditor {
border: 1px solid #9c9e9f !important;
}
.el-collapse {
}
.el-collapse {
border: 0;
}
.el-collapse-item__header {
}
.el-collapse-item__header {
height: 44px;
}
}
.configuration {
color: white;
margin-top: 6vh;
/deep/.el-dialog {
background-color: #031a46 !important;
border: 1px solid #5f82c7;
.el-dialog__header {
.el-dialog__title {
color: white !important;
}
.el-dialog__headerbtn {
top: 20px;
}
}
}
}
</style>
......
......@@ -10,9 +10,9 @@
<template>
<div :class="['lb-table', customClass]">
<el-table v-if="!heightNumSetting" class="table-fixed" :row-style="{ height: '50px' }" ref="elTable"
:border='border' :row-class-name="tableRowClassName" :show-header='showHeader' @row-click="singleElection"
v-bind="$attrs" :height="tableHeight" v-on="$listeners" :data="data" style="width: 100%"
<el-table v-if="!heightNumSetting" class="table-fixed" :row-style="{ height: '50px' }" ref="elTable" :border='border'
:row-class-name="tableRowClassName" :show-header='showHeader' @row-click="singleElection" v-bind="$attrs"
:height="tableHeight" v-on="$listeners" :data="data" style="width: 100%"
:span-method="this.merge ? this.mergeMethod : this.spanMethod">
<el-table-column width="45" align="center" v-if="isRadio">
<template slot-scope="scope">
......@@ -24,9 +24,10 @@
</lb-column>
</el-table>
<el-table v-else ref="elTable" class="table-fixed" :row-style="{ height: '50px' }" :border='border'
:row-class-name="tableRowClassName" :show-header='showHeader' v-bind="$attrs" :max-height="maxHeight"
v-on="$listeners" :data="data" style="width: 100%" :span-method="this.merge ? this.mergeMethod : this.spanMethod">
<el-table v-else ref="elTable" id="heightNumSetting" class="table-fixed" :row-style="{ height: '50px' }"
:border='border' :row-class-name="tableRowClassName" :show-header='showHeader' v-bind="$attrs"
:max-height="maxHeight" :height="tableHeight" v-on="$listeners" :data="data" style="width: 100%"
:span-method="this.merge ? this.mergeMethod : this.spanMethod">
<el-table-column width="45" align="center" v-if="isRadio">
<template slot-scope="scope">
......@@ -80,6 +81,10 @@ export default {
type: Number,
default: 500
},
minHeight: {
type: Number,
default: undefined
},
heightNumSetting: {
type: Boolean,
default: false,
......@@ -139,6 +144,11 @@ export default {
} else {
_this.tableHeight = window.innerHeight - _this.heightNum
}
} else {
this.tableHeight = this.heightNum
this.$nextTick(() => {
this.minHeight && (document.getElementById('heightNumSetting').style.minHeight = this.minHeight + 'px')
})
}
},
calcHeightx (value, wappered = true) {
......
/*
* FileName: lb-column.vue
* Remark: element-column
* Project: lb-element-table
* Author: 任超
* File Created: Tuesday, 19th March 2019 9:58:23 am
* Last Modified: Tuesday, 19th March 2019 10:14:42 am
* Modified By: 任超
*/
<template>
<el-table-column v-bind="$attrs" v-on="$listeners" :prop="column.prop" :label="column.label" :type="column.type"
:index="column.index" :column-key="column.columnKey" :width="column.width" :min-width="column.minWidth"
:fixed="column.fixed" :scoped-slot="column.renderHeader" :sortable="column.sortable || false"
:sort-method="column.sortMethod" :sort-by="column.sortBy" :sort-orders="column.sortOrders"
:resizable="column.resizable || true" :formatter="column.formatter"
:show-overflow-tooltip="column.showOverflowTooltip || false" :align="column.align || align || 'center'"
:header-align="column.headerAlign || headerAlign || column.align || align || 'center'"
:class-name="column.className" :label-class-name="column.labelClassName" :selectable="column.selectable"
:reserve-selection="column.reserveSelection || false" :filters="column.filters"
:filter-placement="column.filterPlacement" :filter-multiple="column.filterMultiple"
:filter-method="column.filterMethod" :filtered-value="column.filteredValue">
<template slot="header" slot-scope="scope">
<lb-render v-if="column.renderHeader" :scope="scope" :render="column.renderHeader">
</lb-render>
<span v-else>{{ scope.column.label }}</span>
</template>
<template slot-scope="scope">
<lb-render :scope="scope" :render="column.render">
</lb-render>
</template>
<template v-if="column.children">
<lb-column v-for="(col, index) in column.children" :key="index" :column="col">
</lb-column>
</template>
</el-table-column>
</template>
<script>
import LbRender from './LbRender'
import forced from './forced.js'
export default {
name: 'LbColumn',
props: {
column: Object,
headerAlign: String,
align: String
},
components: {
LbRender
},
methods: {
setColumn () {
if (this.column.type) {
this.column.renderHeader = forced[this.column.type].renderHeader
this.column.render = this.column.render || forced[this.column.type].renderCell
}
if (this.column.formatter) {
this.column.render = (h, scope) => {
return <span>{scope.column.formatter(scope.row, scope.column, scope.row, scope.$index)}</span>
}
}
if (!this.column.render) {
this.column.render = (h, scope) => {
return <span>{scope.row[scope.column.property]}</span>
}
}
}
},
watch: {
column: {
handler () {
this.setColumn()
},
immediate: true
}
}
}
</script>
/*
* FileName: lb-render.vue
* Remark: 自定义render
* Project: lb-element-table
* Author: 任超
* File Created: Tuesday, 19th March 2019 10:15:30 am
* Last Modified: Tuesday, 19th March 2019 10:15:32 am
* Modified By: 任超
*/
<script>
export default {
name: 'LbRender',
functional: true,
props: {
scope: Object,
render: Function
},
render: (h, ctx) => {
return ctx.props.render ? ctx.props.render(h, ctx.props.scope) : ''
}
}
</script>
export default {
selection: {
renderHeader: (h, { store }) => {
return (
<el-checkbox
disabled={store.states.data && store.states.data.length === 0}
indeterminate={
store.states.selection.length > 0 && !store.states.isAllSelected
}
nativeOn-click={store.toggleAllSelection}
value={store.states.isAllSelected}
/>
)
},
renderCell: (h, { row, column, store, $index }) => {
return (
<el-checkbox
nativeOn-click={event => event.stopPropagation()}
value={store.isSelected(row)}
disabled={
column.selectable
? !column.selectable.call(null, row, $index)
: false
}
on-input={() => {
store.commit('rowSelectedChanged', row)
}}
/>
)
},
sortable: false,
resizable: false
},
index: {
renderHeader: (h, scope) => {
return <span>{scope.column.label || '#'}</span>
},
renderCell: (h, { $index, column }) => {
let i = $index + 1
const index = column.index
if (typeof index === 'number') {
i = $index + index
} else if (typeof index === 'function') {
i = index($index)
}
return <div>{i}</div>
},
sortable: false
},
expand: {
renderHeader: (h, scope) => {
return <span>{scope.column.label || ''}</span>
},
renderCell: (h, { row, store }, proxy) => {
const expanded = store.states.expandRows.indexOf(row) > -1
return (
<div
class={
'el-table__expand-icon ' +
(expanded ? 'el-table__expand-icon--expanded' : '')
}
on-click={e => proxy.handleExpandClick(row, e)}
>
<i class='el-icon el-icon-arrow-right' />
</div>
)
},
sortable: false,
resizable: false,
className: 'el-table__expand-column'
}
}
/*
* FileName: lb-table.vue
* Remark: element table
* Project: lb-element-table
* Author: 任超
* File Created: Tuesday, 19th March 2019 9:55:27 am
* Last Modified: Tuesday, 19th March 2019 9:55:34 am
* Modified By: 任超
*/
<template>
<div :class="['lb-table', customClass]">
<el-table v-if="!heightNumSetting" class="table-fixed" :row-style="{ height: '50px' }" ref="elTable" :border='border'
:row-class-name="tableRowClassName" :show-header='showHeader' @row-click="singleElection" v-bind="$attrs"
:height="tableHeight" v-on="$listeners" :data="data" style="width: 100%"
:span-method="this.merge ? this.mergeMethod : this.spanMethod">
<el-table-column width="45" align="center" v-if="isRadio">
<template slot-scope="scope">
<el-radio v-model="selected" :label="scope.$index"></el-radio>
</template>
</el-table-column>
<el-table-column :label="downTitle" align="center">
<lb-column v-bind="$attrs" v-for="(item, index) in column" :key="index" :column="item">
</lb-column>
</el-table-column>
</el-table>
<br>
<el-pagination class="lb-table-pagination" v-if="pagination" v-bind="$attrs" v-on="$listeners" background
layout="total, prev, pager, next" @current-change="paginationCurrentChange"
:style="{ 'margin-top': paginationTop, 'text-align': paginationAlign }">
</el-pagination>
</div>
</template>
<script>
import LbColumn from './LbColumn'
export default {
props: {
column: Array,
data: Array,
spanMethod: Function,
pagination: {
type: Boolean,
default: true,
},
downExcel: {
type: Boolean,
default: false,
},
downTitle: {
type: String,
default: '标题'
},
isRadio: {
type: Boolean,
default: false,
},
border: {
type: Boolean,
default: false,
},
showHeader: {
type: Boolean,
default: true,
},
paginationTop: {
type: String,
default: '0',
},
heightNum: {
type: Number,
default: 355,
},
maxHeight: {
type: Number,
default: 500
},
heightNumSetting: {
type: Boolean,
default: false,
},
customClass: {
type: String,
default: '',
},
paginationAlign: {
type: String,
default: 'left',
},
merge: Array,
},
components: {
LbColumn,
},
data () {
return {
tableHeight: 'auto',
mergeLine: {},
mergeIndex: {},
selected: ''
}
},
created () {
this.getMergeArr(this.data, this.merge)
this.getHeight()
},
computed: {
dataLength () {
return [] || this.data.length
},
},
methods: {
// 单选
singleElection (row) {
this.selected = this.data.indexOf(row);
},
tableRowClassName ({ row, rowIndex }) {
if (rowIndex % 2 === 1) {
return 'interlaced';
}
},
getHeight () {
if (!this.heightNumSetting) {
let _this = this
if (this.heightNum) {
_this.$nextTick(() => {
window.addEventListener('resize', () => {
_this.tableHeight = _this.calcHeightx(230)
});
_this.tableHeight = _this.calcHeightx(230)
})
} else {
_this.tableHeight = window.innerHeight - _this.heightNum
}
}
},
calcHeightx (value, wappered = true) {
//项目自定义的公共header部分的高度,可忽略
let header = document.querySelector(".from-clues-header").offsetHeight;
//value为动态计算table界面高度时,减去的其他空白部分,需自行在调试找到临界值,剩下的就是table表格的高度(包含header+body部分)
value = value == undefined ? 100 : value;
let res = window.innerHeight - parseInt(header) - value;
if (wappered) {
//通过原生方法,获取dom节点的高度------获取element-ui table表格body的元素
let wapper = window.document.getElementsByClassName('el-table__body-wrapper');
//通过原生方法,获取dom节点的高度------获取element-ui table表格header的元素
let header = window.document.getElementsByClassName('el-table__header-wrapper');
//必须加延时,要不然赋不上去值
setTimeout(() => {
//通过上边计算得到的table高度的value值,减去table表格的header高度,剩下的通过dom节点直接强行赋给table表格的body
wapper[0].style.height = (value - header[0].clientHeight)
}, 100)
}
return res;
},
clearSelection () {
this.$refs.elTable.clearSelection()
},
toggleRowSelection (row, selected) {
this.$refs.elTable.toggleRowSelection(row, selected)
},
toggleAllSelection () {
this.$refs.elTable.toggleAllSelection()
},
toggleRowExpansion (row, expanded) {
this.$refs.elTable.toggleRowExpansion(row, expanded)
},
setCurrentRow (row) {
this.$refs.elTable.setCurrentRow(row)
},
clearSort () {
this.$refs.elTable.clearSort()
},
clearFilter (columnKey) {
this.$refs.elTable.clearFilter(columnKey)
},
doLayout () {
this.$refs.elTable.doLayout()
},
sort (prop, order) {
this.$refs.elTable.sort(prop, order)
},
paginationCurrentChange (val) {
this.$emit('p-current-change', val)
},
getMergeArr (tableData, merge) {
if (!merge) return
this.mergeLine = {}
this.mergeIndex = {}
merge.forEach((item, k) => {
tableData.forEach((data, i) => {
if (i === 0) {
this.mergeIndex[item] = this.mergeIndex[item] || []
this.mergeIndex[item].push(1)
this.mergeLine[item] = 0
} else {
if (data[item] === tableData[i - 1][item]) {
this.mergeIndex[item][this.mergeLine[item]] += 1
this.mergeIndex[item].push(0)
} else {
this.mergeIndex[item].push(1)
this.mergeLine[item] = i
}
}
})
})
},
mergeMethod ({ row, column, rowIndex, columnIndex }) {
const index = this.merge.indexOf(column.property)
if (index > -1) {
const _row = this.mergeIndex[this.merge[index]][rowIndex]
const _col = _row > 0 ? 1 : 0
return {
rowspan: _row,
colspan: _col,
}
}
},
},
watch: {
merge () {
this.getMergeArr(this.data, this.merge)
},
dataLength () {
this.getMergeArr(this.data, this.merge)
}
},
}
</script>
<style rel="stylesheet/scss" scoped lang="scss">
.lb-table {
margin-top: 1px;
.interlaced {
background: #fafcff;
border: 1px solid #ebf2fa;
}
}
/deep/.el-table .cell {
padding-left: 3px;
padding-right: 3px;
}
/deep/.el-radio__label {
display: none;
}
</style>
## 这是对于element-table 进行的二次封装
### 文档地址
<!-- table 已经全局注册不需要每个页面单独注册 -->
[Windows/Mac/Linux 全平台客户端](https://github.liubing.me/lb-element-table/zh/guide/)

1.81 MB | W: | H:

1.74 MB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
......@@ -2,10 +2,10 @@
<div class="navbar-con">
<div class="navbar">
<div class="title">
{{ logoName[0].DNAME }}
{{ logoName[0] && logoName[0].DNAME }}
</div>
<div class="user">
欢迎进入系统 {{ userInfo.name }}
欢迎进入系统 {{ userName }}
<span @click="onCancel">
<svg-icon icon-class="close" class="closeStyle" />退出系统</span>
</div>
......@@ -16,24 +16,27 @@
<sidebarRight />
</div>
</div>
</div>
</div>
</template>
<script>
import sidebarLeft from "./Sidebar/sidebarLeft";
import sidebarRight from "./Sidebar/sidebarRight";
import { logout } from "@/api/login.js";
import { mapGetters } from "vuex";
export default {
import sidebarLeft from "./Sidebar/sidebarLeft";
import sidebarRight from "./Sidebar/sidebarRight";
import { logout } from "@/api/login.js";
import { mapGetters } from "vuex";
export default {
components: {
sidebarLeft,
sidebarRight,
},
computed: {
...mapGetters(["sidebar", "dicData", "userInfo"]),
logoName: function () {
logoName () {
return this.dicData['sysCode'] && this.dicData['sysCode'].filter(item =>
item.DCODE == "systemTitle"
)
},
userName () {
return this.userInfo ? this.userInfo.name : ""
}
},
methods: {
......@@ -43,7 +46,7 @@ export default {
sessionStorage.removeItem("token");
this.$store.dispatch("user/resetState");
this.$router.replace({
path: "/login",
path: "/jg",
query: {
redirect: this.$route.fullPath,
},
......@@ -54,15 +57,15 @@ export default {
});
},
},
};
};
</script>
<style lang="scss" scoped>
/deep/.el-menu--horizontal {
/deep/.el-menu--horizontal {
display: flex;
align-items: center;
}
}
.menubg {
.menubg {
height: 34px;
width: 130px;
text-align: center;
......@@ -70,73 +73,73 @@ export default {
margin-right: 20px;
background: url("~@/image/navbar.png") no-repeat;
background-size: 100% 100%;
}
}
/deep/.el-menu-item {
/deep/.el-menu-item {
@extend .menubg;
}
}
/deep/.el-submenu {
/deep/.el-submenu {
@extend .menubg;
}
}
/deep/.el-submenu__title {
/deep/.el-submenu__title {
height: 34px;
color: #ffffff;
}
}
/deep/.el-submenu__title span {
/deep/.el-submenu__title span {
font-size: 14px;
}
}
.sidebarLeft {
.sidebarLeft {
position: relative;
top: 13px;
width: 30%;
}
}
/deep/.el-menu {
/deep/.el-menu {
display: flex;
justify-content: space-between;
}
}
/deep/.el-menu-item {
/deep/.el-menu-item {
flex: 1;
width: 100%;
}
}
.sidebarRight {
.sidebarRight {
position: relative;
top: 13px;
width: 30%;
padding-left: 20px;
}
}
// 导航选中背景色
.xuanzhong {
// 导航选中背景色
.xuanzhong {
background: url("~@/image/selNavbar.png") no-repeat;
background-size: 100% 100%;
color: #ffffff !important;
font-weight: 700;
}
}
/deep/.el-menu-item:hover {
/deep/.el-menu-item:hover {
@extend .xuanzhong;
}
}
/deep/.el-submenu__title:hover {
/deep/.el-submenu__title:hover {
@extend .xuanzhong;
}
}
/deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus {
/deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus {
@extend .xuanzhong;
}
}
/deep/.el-menu-item.is-active {
/deep/.el-menu-item.is-active {
@extend .xuanzhong;
}
}
.navbar {
.navbar {
height: $headerHeight;
overflow: hidden;
position: relative;
......@@ -255,5 +258,5 @@ export default {
}
}
}
}
}
</style>
......
<template>
<el-menu router :default-active="activeMenu" mode="horizontal">
<!-- 权限菜单 -->
<sidebar-item v-for="route in permission_routes.slice(2, 5)" :key="route.path" :item="route"
<sidebar-item v-for="route in permission_routes.slice(3, 6)" :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" /> -->
......@@ -9,16 +9,18 @@
</template>
<script>
import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import { asyncRoutes } from '@/router'
export default {
import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import { asyncRoutes } from '@/router'
export default {
components: { SidebarItem, Logo },
computed: {
...mapGetters(['permission_routes', 'sidebar']),
activeMenu () {
const route = this.$route
const { meta, path } = route
if (meta.activeMenu) {
......@@ -32,12 +34,15 @@ export default {
asyncRoutes () {
return asyncRoutes.slice(0, 3)
}
},
mounted () {
console.log("permission_routes", this.permission_routes);
}
}
}
</script>
<style scoped lang="scss">
.el-menu--horizontal {
.el-menu--horizontal {
display: flex;
background: none !important;
}
}
</style>
......
<!--
* @Author: xiaomiao 1158771342@qq.com
* @Date: 2023-01-10 09:03:06
* @LastEditors: xiaomiao 1158771342@qq.com
* @LastEditTime: 2023-03-08 10:45:43
* @FilePath: \监管系统\js-web-jianguan\src\layout\components\Sidebar\sidebarRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<el-menu router :default-active="activeMenu" mode="horizontal">
<!-- 权限菜单 -->
<sidebar-item v-for="route in permission_routes.slice(5, 8)" :key="route.path" :item="route"
<sidebar-item v-for="route in permission_routes.slice(6, 9)" :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" /> -->
......@@ -9,12 +17,12 @@
</template>
<script>
import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import { asyncRoutes } from '@/router'
export default {
import { mapGetters } from 'vuex'
import Logo from './Logo'
import SidebarItem from './SidebarItem'
import variables from '@/styles/variables.scss'
import { asyncRoutes } from '@/router'
export default {
components: { SidebarItem, Logo },
computed: {
...mapGetters(['permission_routes', 'sidebar']),
......@@ -33,35 +41,35 @@ export default {
return asyncRoutes.slice(3, 6)
}
}
}
}
</script>
<style scoped lang="scss">
.el-menu--horizontal {
.el-menu--horizontal {
display: flex;
background: none !important;
}
}
/deep/.el-menu-item:hover {
/deep/.el-menu-item:hover {
background: none;
font-weight: 700;
color: #fff !important;
}
}
/deep/.el-submenu__title {
/deep/.el-submenu__title {
color: #fff;
font-size: 18px;
}
}
/deep/.el-submenu__title:hover {
/deep/.el-submenu__title:hover {
background: none;
font-weight: 700;
font-size: 20px;
}
}
/deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus {
/deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus {
background: none;
color: #fff;
font-size: 20px;
font-weight: 700 !important;
}
}
</style>
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-10 14:59:43
-->
<template>
<div class="app-wrapper">
<div class="app-wrapper jgWrapper">
<navbar />
<div class="appMain">
<app-main />
......@@ -7,10 +12,10 @@
</div>
</template>
<script>
import { AppMain, Navbar, Sidebar, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex'
export default {
import { AppMain, Navbar, Sidebar, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex'
export default {
name: 'Layout',
components: {
AppMain,
......@@ -18,6 +23,10 @@ export default {
Sidebar,
TagsView
},
created () {
this.$store.dispatch("products/setData", "BDCJGPT");
console.log("ZOULEJG");
},
mixins: [ResizeMixin],
computed: {
...mapState({
......@@ -26,18 +35,21 @@ export default {
fixedHeader: state => state.settings.fixedHeader
})
}
}
}
</script>
<style lang="scss">
@import "~@/styles/jgSidebar.scss";
</style>
<style lang="scss" scoped>
@import "~@/styles/mixin.scss";
@import "~@/styles/mixin.scss";
.app-wrapper {
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
min-width: 1280px;
background: url('~@/image/bg.png') no-repeat;
background: url("~@/image/bg.png") no-repeat;
background-size: 100% 100%;
padding: 12px;
box-sizing: border-box;
......@@ -46,15 +58,15 @@ export default {
position: fixed;
top: 0;
}
}
}
.appMain {
min-width: 1290px;
.appMain {
// min-width: 1280px;
height: calc(100vh - 101px) !important;
box-sizing: border-box;
.app-main {
height: 100%;
}
}
}
</style>
......
......@@ -22,6 +22,6 @@ export default {
box-sizing: border-box;
flex: 1;
width: 100%;
margin-right: 15px;
// background-color: #ffffff;
}
</style>
......
......@@ -4,11 +4,7 @@
<div class="logo">
<img :src="require('@/image/logo.png')" alt="" />
</div>
<div class="backdrop">
<Breadcrumb />
</div>
<div class="right-menu">
<div class="dataView d-center pointer" @click="handleDataView">大屏展示</div>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover" @command="handleCommand">
<div class="avatar-wrapper">
<span style="padding-right:10px">{{ name }}</span>
......@@ -67,15 +63,6 @@ export default {
}
}
.dataView {
color: #fff;
width: 120px;
height: 32px;
background: url('../../image/dp.png');
background-size: cover;
margin-right: 20px;
}
.NoticeBar {
position: absolute;
bottom: 0;
......@@ -83,7 +70,7 @@ export default {
.el-dropdown-menu {
padding: 0 !important;
border: 1px solid #EBEEF5;
border: 1px solid #ebeef5;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.12);
border-radius: 4px 0 0 4px 4px;
......@@ -93,14 +80,14 @@ export default {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #4A4A4A;
color: #4a4a4a;
width: 140px;
height: 36px;
line-height: 36px;
}
.el-dropdown-menu__item:nth-child(6) {
border-top: 1px solid #EBEEF5;
border-top: 1px solid #ebeef5;
}
.popper__arrow {
......@@ -111,8 +98,8 @@ export default {
.el-dropdown-menu__item:not(.is-disabled):hover,
.el-dropdown-menu__item:focus {
background: #F6F7F9;
color: #4A4A4A;
background: #f6f7f9;
color: #4a4a4a;
}
}
......@@ -120,15 +107,11 @@ export default {
height: $headerHeight;
overflow: hidden;
position: relative;
// background: linear-gradient(270deg, #148CEE 0%, #1870E3 100%); //默认颜色
// box-shadow: 0 1px 0px rgba(0, 21, 41, 0.08);
background: #0D1230;
background: #3D59C4;
display: flex;
align-items: center;
padding-right: 20px;
justify-content: space-between;
margin-bottom: 10px;
.header-logo {
width: 300px;
}
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-06 16:18:21
-->
<template>
<div>
<el-scrollbar wrap-class="scrollbar-wrapper">
<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">
:unique-opened="true" :active-text-color="variables.menuActiveText" :collapse-transition="false" mode="vertical">
<!-- 权限菜单 -->
<!-- <sidebar-item v-for="route in permission_routes" :key="route.path" :item="route" :base-path="route.path" /> -->
<sidebar-item v-for="route in permission_routes.slice(3)" :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" />
<!-- <sidebar-item v-for="route in asyncRoutes" :key="route.path" :item="route" :base-path="route.path" /> -->
</el-menu>
</el-scrollbar>
</div>
......@@ -27,6 +32,9 @@ export default {
title: defaultSettings.title
}
},
created () {
console.log(this.permission_routes);
},
computed: {
...mapGetters(['permission_routes', 'sidebar']),
activeMenu () {
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-10 15:00:56
-->
<template>
<div class="app-wrapper">
<div class="app-wrapper scWrapper">
<navbar />
<div class="main-container">
<sidebar class="sidebar-container" />
......@@ -8,10 +13,10 @@
</div>
</template>
<script>
import { AppMain, Navbar, Sidebar, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex'
export default {
import { AppMain, Navbar, Sidebar, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler'
import { mapState } from 'vuex'
export default {
name: 'Layout',
components: {
AppMain,
......@@ -20,6 +25,10 @@ export default {
TagsView
},
mixins: [ResizeMixin],
created () {
this.$store.dispatch("products/setData", "BDCSBPT");
console.log("ZOULEJG");
},
computed: {
...mapState({
sidebar: state => state.app.sidebar,
......@@ -27,25 +36,27 @@ export default {
fixedHeader: state => state.settings.fixedHeader
})
}
}
}
</script>
<style lang="scss" scoped>
@import "~@/styles/mixin.scss";
<style lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/sbSidebar.scss";
.app-wrapper {
.app-wrapper {
@include clearfix;
position: relative;
height: 100%;
width: 100%;
background-color: $containerbg;
// background-color: $containerbg;
padding: 0;
&.mobile.openSidebar {
position: fixed;
top: 0;
}
}
}
.drawer-bg {
.drawer-bg {
background: #000;
opacity: 0.3;
width: 100%;
......@@ -53,15 +64,15 @@ export default {
height: 100%;
position: absolute;
z-index: 999;
}
}
.fixed-header {
.fixed-header {
width: 100%;
transition: width 0.28s;
}
}
.el-dropdown-menu--small {
.el-dropdown-menu--small {
padding: 0;
width: 5px;
}
}
</style>
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-10 16:43:16
*/
import router from "./router";
import store from "./store";
import { getMenuInfo } from "@/api/user";
......@@ -6,33 +11,31 @@ import "nprogress/nprogress.css"; // progress bar style
import getPageTitle from "@/utils/get-page-title";
import Cookies from "js-cookie";
NProgress.configure({ showSpinner: false }); // NProgress Configuration
router.beforeEach(async (to, from, next) => {
NProgress.start();
document.title = getPageTitle(to.meta.title);
let hasAddDict = store.state.dict.addDict;
let hasUser = store.state.user.hasUser;
let hasAddRoute = store.state.permission.addRoutes;
if (to.path == "/login") {
if (to.path == "/sb" || to.path == "/jg") {
sessionStorage.removeItem("token");
sessionStorage.setItem("psth", to.path)
next();
} else {
let code = sessionStorage.getItem("psth") == "/sb" ? "BDCSBPT" : "BDCJGPT"
//判断token是否存在
const hasToken = sessionStorage.getItem("token");
if (hasToken) {
//请求用户信息
if (!hasUser) {
store.dispatch("user/getUserInfo");
}
//加载字典
if (!hasAddDict) {
store.dispatch("dict/generateDic");
import("@/styles/public.scss");
}
if (hasAddRoute) {
next();
} else {
//请求菜单
const { result: getMenuData } = (await getMenuInfo()) || [];
const { result: getMenuData } = (await getMenuInfo(code)) || [];
const accessRoutes = await store.dispatch(
"permission/generateRoutes",
getMenuData
......@@ -42,16 +45,22 @@ router.beforeEach(async (to, from, next) => {
{ path: "*", redirect: "/404", hidden: true },
]);
const routeTo = Cookies.get("routerTo");
if (!hasAddDict) {
await store.dispatch("dict/generateDic");
}
if (routeTo && routeTo !== "/") {
next({ ...to, replace: true });
} else {
next("/home");
}
}
} else if (sessionStorage.getItem("psth")) {
next(sessionStorage.getItem("psth"));
} else {
next("/login");
next("/jg");
}
}
NProgress.done();
});
router.afterEach((to) => {
......
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/* Router Modules */
// import componentsRouter from './modules/components'
export const constantRoutes = [
{
path: '/404',
......@@ -22,9 +20,14 @@ export const constantRoutes = [
},
//登录
{
path: "/login",
name: "login",
component: () => import("@/views/login/index.vue"),
path: "/jg",
name: "loginjg",
component: () => import("@/views/loginjg/index.vue"),
},
{
path: "/sb",
name: "loginsb",
component: () => import("@/views/loginsb/index.vue"),
},
// 监管首页
{
......
module.exports = {
title: '汉中市不动产综合监管',
title: '',
/**
* @type {boolean} true | false
* @description Whether show the settings right-panel
......
/*
* @Author: xiaomiao 1158771342@qq.com
* @Date: 2023-03-09 15:24:53
* @LastEditors: xiaomiao 1158771342@qq.com
* @LastEditTime: 2023-03-13 09:03:16
* @FilePath: \上报\bdcjg-web\src\store\modules\permission.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { constantRoutes } from '@/router'
import asyncRouter from '@/utils/asyncRouter.js'
const state = {
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-07 09:38:47
*/
import { getUserInfo } from "@/api/user";
const state = {
hasUser: false,
......@@ -15,14 +20,14 @@ const mutations = {
};
const actions = {
getUserInfo({ commit }) {
getUserInfo ({ commit }) {
return new Promise(async (resolve) => {
let { result: res } = await getUserInfo();
commit("SET_USERINFO", res);
resolve(true);
});
},
resetState({ commit }) {
resetState ({ commit }) {
commit("RESET_USER");
},
};
......
......@@ -2,11 +2,19 @@
overflow: hidden;
background: url("~@/image/dialogBg.png") no-repeat !important;
background-size: 100% 100% !important;
min-height: 90vh;
.dialog_title {
display: flex;
position: relative;
top: -2px;
font-size: 22px;
top: -10px;
width: 38%;
height: 40px;
margin-left: 28px;
justify-content: center;
white-space: nowrap;
b {
font-weight: 200;
display: inline-block;
......@@ -48,10 +56,88 @@
box-shadow: inset 0px 0px 12px 0px #02D9FD;
border-radius: 2px;
border: 1px solid #6BC1FC;
margin: 0 18px 15px 18px;
margin: 0 18px 10px 18px;
}
}
.item-content-input {
/deep/.el-input__inner {
border: none !important;
text-align: right;
}
}
.regularHeight {
display: flex;
flex: 1;
height: 100%;
flex-direction: column;
.editDialogBox-con,
.JsonEditor {
flex: 1;
height: 100%;
}
}
.dialog-from {
padding: 13px;
border-radius: 2px;
box-sizing: border-box;
.el-row {
display: flex;
flex-wrap: nowrap;
}
.el-col {
line-height: 18px;
display: flex;
align-items: center;
margin-bottom: 3px;
color: #B5D6DC;
border-radius: 2px;
border: 1px solid #224C7C;
span {
display: inline-block;
padding: 3px;
border-radius: 3px;
overflow: hidden;
white-space: nowrap;
text-align: left;
color: #02D9FD;
}
p {
flex: 1;
width: 100%;
padding-left: 5px;
line-height: 20px;
color: #c0c4cc;
cursor: not-allowed;
white-space: nowrap;
margin-right: 5px;
text-align: right;
}
}
}
/deep/.el-textarea__inner {
border: 1px solid #224C7C;
margin: 0 0 10px 0 !important;
width: 100% !important;
color: #dadde3 !important;
background: transparent !important;
}
/deep/.el-input__inner {
border: 1px solid #224C7C !important;
margin: 0 !important;
width: 100% !important;
color: #dadde3 !important;
background: transparent !important;
}
.dialog_title {
@include flex;
justify-content: space-between;
......@@ -60,7 +146,6 @@
.el-dialog__header {
color: #FFFFFF;
// background: #074487;
height: 46px !important;
width: 97%;
margin: 0 auto;
......@@ -70,6 +155,7 @@
.el-dialog__body {
padding-top: 0;
padding-bottom: 0;
height: 95vh;
}
.el-dialog__headerbtn {
......@@ -79,7 +165,8 @@
background-size: 100% 100%;
right: 40px;
top: 33px;
&:hover{
&:hover {
box-shadow: inset 0px 0px 12px 0px #02D9FD;
}
}
......
// cover some element-ui styles
.el-breadcrumb__inner,
.el-breadcrumb__inner a {
font-weight: 400 !important;
......@@ -16,6 +15,25 @@
padding: 0 7px !important;
}
// input 样式
// 全局css 加上以下代码,可以隐藏上下箭头
// 取消input的上下箭头
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
input::-webkit-outer-spin-button {
-webkit-appearance: none !important;
}
input[type="number"] {
-moz-appearance: textfield;
}
.el-upload {
input[type="file"] {
display: none !important;
......@@ -208,10 +226,29 @@ table td {
box-shadow: inset 0px 0px 20px 0px #03DBFF !important;
}
.el-table__body tr:hover>td {
.el-table__body tr:hover>td,
.el-table__body tr.hover-row>td.el-table__cell {
background: none !important;
}
// table 固定列样式
// tr:hover {
// background: #063160 !important;
// box-shadow: inset 0px 0px 20px 0px #03DBFF !important;
// }
// .el-table__fixed-right-patch {
// background-color: #073781
// }
.el-table__fixed-right {
background-color: #073781
}
.el-table__fixed::before,
.el-table__fixed-right::before {
display: none;
}
// 表格样式
.el-table th {
height: 48px !important;
......@@ -489,3 +526,49 @@ table td {
.el-select-dropdown__item:hover {
background-color: transparent !important;
}
// 提示框
.el-message-box {
background-color: #031a46;
border: 1px solid #5f82c7;
.el-message-box__title {
color: white;
}
.el-message-box__content {
color: white;
}
}
// 上级菜单
.el-cascader__dropdown {
background-color: #031a46;
border: 1px solid #5f82c7;
}
.el-cascader-menu {
color: white;
}
.el-radio {
.el-cascader-menu:hover {
color: white;
}
}
.el-cascader-node:not(.is-disabled):hover,
.el-cascader-node:not(.is-disabled):focus {
background: #F5F7FA;
background-image: initial;
background-position-x: initial;
background-position-y: initial;
background-size: initial;
background-repeat-x: initial;
background-repeat-y: initial;
background-attachment: initial;
background-origin: initial;
background-clip: initial;
background-color: rgb(80, 142, 235);
}
\ No newline at end of file
......
......@@ -2,7 +2,7 @@
@import './mixin.scss';
@import './transition.scss';
@import './element-ui.scss';
@import './sidebar.scss';
// @import './sidebar.scss';
/* CSS 初始化 */
html,
......@@ -336,6 +336,15 @@ aside {
color: $yellow;
}
// 操作按钮样式
.btnColor {
color: #8DEAF9;
}
.successColor {
color:#67C23A
}
// 通过 入库 样式
.adopt,
.success {
......@@ -409,3 +418,9 @@ aside {
background: #FF7962;
color: #FF7962;
}
// 引入字体
@font-face {
font-family: AliBold;
src: url('../image/font/Alibaba_PuHuiTi_2.0_55_Regular_85_Bold.ttf')
}
\ No newline at end of file
......
#app {
.jgWrapper {
.main-container {
width: 100%;
height: calc(100% - 74px);
......@@ -340,4 +340,5 @@
word-break: break-all;
line-height: 20px;
flex: 1;
}
\ No newline at end of file
......
.tableClass {
/deep/.el-table {
.el-table {
border: none !important;
border-radius: 0 !important;
background-color: rgba(0, 0, 0, 0);
......@@ -40,10 +40,15 @@
}
//*****start*通用表单查询条件,列表样式******//
.bgc {
box-shadow: inset 0px 0px 8px 0px rgba(255, 255, 255, 0.5);
background-color: rgba(0, 0, 0, 0);
}
.from-clues {
height: 100%;
width: 100%;
min-width: 1280px;
// min-width: 1280px;
box-sizing: border-box;
overflow-x: hidden;
padding: 2px;
......@@ -56,11 +61,11 @@
background-size: 100% 100%;
margin-top: 15px;
/deep/.el-form-item__label {
.el-form-item__label {
color: #E3F1FF;
}
/deep/.el-input__inner {
.el-input__inner {
background: #07388B;
border-radius: 2px;
color: #CEF8FF;
......@@ -114,16 +119,11 @@
//修改表头的背景颜色横向渐变色
@extend .tableClass;
/deep/.el-pagination__total {
.el-pagination__total {
color: #FFFFFF;
}
.bgc {
box-shadow: inset 0px 0px 8px 0px rgba(255, 255, 255, 0.5);
background-color: rgba(0, 0, 0, 0);
}
/deep/ .el-pagination {
.el-pagination {
.el-input__inner {
color: #FFFFFF;
border: none;
......@@ -142,14 +142,9 @@
color: #FFFFFF;
}
}
/deep/.btn-next,
/deep/.btn-prev {
@extend .bgc;
color: #FFFFFF;
}
}
.el-form--inline .el-form-item {
width: auto;
......@@ -167,10 +162,15 @@
}
}
.el-pagination.is-background .btn-prev,
.el-pagination.is-background .btn-next {
@extend .bgc;
color: #FFFFFF;
}
//*****end*通用表单查询条件,列表样式******//
/deep/.el-range-separator {
.el-range-separator {
line-height: 28px !important;
}
......@@ -199,3 +199,245 @@
box-sizing: border-box;
text-align: right;
}
// 修改弹框样式
.modifydialog {
.el-dialog__header {
text-align: center;
margin-bottom: 10px;
.el-dialog__title {
color: white;
}
}
.el-form-item__label {
color: white;
}
.el-input__inner {
background-color: #07388b;
}
.el-input__inner {
background: #07388b;
border-radius: 2px;
border: 1px solid #6bc1fc;
}
.el-textarea__inner {
background: #07388b;
color: #fff;
}
.el-form-item__label {
color: #fff;
}
.el-dialog__headerbtn {
position: absolute;
top: 22px;
right: 30px;
}
.el-dialog__header {
text-align: center;
margin-bottom: 10px;
.el-dialog__title {
color: white;
}
}
}
// 角色配置
.roleconfiguration {
.el-dialog__body {
display: flex;
flex-direction: column;
}
.el-tabs {
color: #cef8ff;
}
.sjmx {
.el-tabs__item {
height: 50px;
padding-top: 6px;
}
}
.el-tabs__item {
color: #cef8ff !important;
display: flex;
flex-direction: row;
justify-content: center;
background: url("~@/image/tabitem.png") no-repeat;
background-size: 100% 100%;
border: none !important;
}
.obligee-item-name {
background: #05275b;
color: #ffffff;
background: url("~@/image/itembg.png") no-repeat;
background-size: 100% 100%;
}
.el-tabs__nav-scroll {
background: none;
}
.el-tabs__nav {
display: flex;
border: none !important;
}
.el-tabs__item.is-top {
border: 1px solid #dfe4ed;
border-top: 1px solid #dfe4ed;
border-bottom: 1px solid transparent;
}
.el-tabs__header {
border: none;
margin-bottom: 0;
}
.el-tabs__item.is-top:not(:last-child) {
margin-right: 5px;
}
.el-tabs__item.is-top {
background-color: none !important;
}
.el-tabs__item.is-active {
background: url("~@/image/tabitemse.png") no-repeat;
background-size: 100% 100%;
}
.success-images {
width: 30px;
height: 30px;
position: relative;
top: 10px;
right: 3px;
}
.tab-pane-item {
line-height: 20px;
color: #02d9fd;
p {
text-align: center;
}
}
.edit-content {
overflow-y: auto;
overflow-x: hidden;
padding-right: 1px;
margin-bottom: 10px;
border-top: none;
}
.editDialogBox {
border-radius: 8px;
overflow: hidden;
min-width: 1228px;
height: 825px !important;
.dialog-from {
padding: 13px;
border-radius: 2px;
box-sizing: border-box;
.el-row {
display: flex;
flex-wrap: nowrap;
}
.el-col {
line-height: 18px;
display: flex;
align-items: center;
margin-bottom: 3px;
color: #b5d6dc;
border-radius: 2px;
border: 1px solid #224c7c;
margin: 5px;
span {
display: inline-block;
padding: 3px;
border-radius: 3px;
overflow: hidden;
white-space: nowrap;
text-align: left;
color: #02d9fd;
}
p {
flex: 1;
width: 100%;
padding-left: 5px;
line-height: 20px;
color: #c0c4cc;
cursor: not-allowed;
white-space: nowrap;
margin-right: 5px;
text-align: right;
}
}
}
.dialog_title {
display: flex;
position: relative;
font-size: 24px;
top: -8px;
width: 38%;
height: 40px;
margin-left: 28px;
justify-content: center;
}
.el-dialog__header {
display: flex;
margin-bottom: 10px;
}
.el-dialog__footer {
padding-right: 40px;
}
.divider {
width: 100%;
border-bottom: 1px solid #ccc;
}
}
.el-dialog__wrapper {
overflow: hidden;
}
.el-table {
background: none;
th.el-table__cell {
background-color: #073781;
color: #02d9fd;
}
tr {
background: none;
td {
color: white;
}
}
}
}
\ No newline at end of file
......
.scWrapper {
.main-container {
width: 100%;
height: calc(100% - 74px);
transition: margin-left 0.28s;
display: flex;
}
.sidebar-container {
transition: width 0.28s;
width: $sideBarWidth !important;
font-size: 0px;
margin-right: 15px;
background: #121F41;
.horizontal-collapse-transition {
transition: 0s width ease-in-out, 0s padding-left ease-in-out,
0s padding-right ease-in-out;
}
.scrollbar-wrapper {
overflow-x: hidden !important;
margin-right: 0 !important;
&::-webkit-scrollbar {
display: none;
}
}
a {
display: inline-block;
width: 100%;
overflow: hidden;
}
.svg-icon {
margin-right: 5px;
}
.sub-el-icon {
margin-right: 12px;
margin-left: -2px;
}
.el-menu {
background-color: transparent !important;
border: none;
height: 100%;
width: 100% !important;
}
// menu hover
.el-menu--collapse .el-submenu__title,
.el-menu--collapse .submenu-title-noDropdown {
margin-left: 0px !important;
}
// 有子级
.el-submenu__title {
padding-left: 10px !important;
color: $menuText;
height: 42px;
background: linear-gradient(90deg, #013874 0%, #081B56 100%);
margin-bottom: 8px;
&:hover {
color: $subMenuActiveText !important;
background: linear-gradient(90deg, #1D66DC 0%, #081B56 100%);
.svg-icon,
i,
span {
color: $subMenuActiveText !important;
}
}
}
// 没有子级
.submenu-title-noDropdown {
color: $menuText;
padding-left: 20px;
margin-bottom: 8px;
background: linear-gradient(90deg, #013874 0%, #081B56 100%);
&:hover {
color: $menuActiveText !important;
background: linear-gradient(90deg, #1D66DC 0%, #081B56 100%);
.svg-icon {
color: #1ea6f8 !important;
}
i {
color: #1ea6f8 !important;
}
}
}
.submenu-title-noDropdown.is-active,
.el-submenu__title.is-active {
color: $menuActiveText;
background: linear-gradient(90deg, #1D66DC 0%, #081B56 100%);
.svg-icon {
color: #1ea6f8 !important;
}
i {
color: #1ea6f8 !important;
}
}
.submenu-title-noDropdown,
.el-submenu__title {
font-weight: 600;
font-size: $sideBarFontSize;
// margin: 0 10px;
>i {
color: $subMenuActiveText !important;
transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
margin-right: 10px;
}
.svg-icon {
font-size: 18px;
margin-top: -5px;
}
}
.el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow {
transform: rotateZ(0deg) !important;
-webkit-transform: rotateZ(0deg) !important;
-moz-transform: rotateZ(0deg) !important;
-ms-transform: rotateZ(0deg) !important;
-o-transform: rotateZ(0deg) !important;
}
.is-active>.el-submenu__title {
color: #fff !important;
}
& .nest-menu .el-submenu>.el-submenu__title,
& .el-submenu .el-menu-item {
&.is-active {
background-color: $subMenuHover !important;
color: $menuActiveText !important;
}
&:hover {
background-color: $subMenuHover !important;
color: $menuActiveText !important;
}
min-width: 130px !important;
background-color: transparent !important;
font-weight: 600;
font-size: $sideBarFontSize;
margin: 0 10px;
// border-radius: 6px;
}
}
.hideSidebar {
.sidebar-container {
width: 54px !important;
}
.submenu-title-noDropdown {
padding: 0 !important;
position: relative;
.el-tooltip {
padding: 0 !important;
.svg-icon {
margin-left: 16px;
}
.sub-el-icon {
margin-left: 19px;
}
}
}
.el-submenu {
overflow: hidden;
&>.el-submenu__title {
padding: 0 !important;
.svg-icon {
margin-left: 16px;
}
.sub-el-icon {
margin-left: 19px;
}
.el-submenu__icon-arrow {
display: none;
}
}
}
.el-menu--collapse {
.el-submenu {
&>.el-submenu__title {
&>span {
height: 0;
width: 0;
overflow: hidden;
visibility: hidden;
display: inline-block;
}
}
}
}
}
.el-menu--collapse .el-menu .el-submenu {
min-width: $sideBarWidth !important;
}
// mobile responsive
.mobile {
.main-container {
margin-left: 0px;
}
.sidebar-container {
transition: transform 0.28s;
width: $sideBarWidth !important;
}
&.hideSidebar {
.sidebar-container {
pointer-events: none;
transition-duration: 0.3s;
transform: translate3d(-$sideBarWidth, 0, 0);
}
}
}
.withoutAnimation {
.main-container,
.sidebar-container {
transition: none;
}
}
}
// when menu collapsed
.el-menu--vertical {
&>.el-menu {
.svg-icon {
margin-right: 16px;
}
.sub-el-icon {
margin-right: 12px;
margin-left: -2px;
}
}
.nest-menu .el-submenu>.el-submenu__title,
.el-menu-item {
width: calc(100% - 12px);
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
font-weight: 600 !important;
font-size: 15px !important;
background-color: $menuHover !important;
color: $menuText !important;
&:hover {
background-color: $menuHover !important;
opacity: .9;
.svg-icon,
i,
span {
color: $menuText;
}
}
}
// the scroll bar appears when the subMenu is too long
>.el-menu--popup {
max-height: 100vh;
overflow-y: auto;
background-color: #32ACFE !important;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
min-width: 140px;
padding: 12px 0;
&::-webkit-scrollbar-track-piece {
background: #d3dce6;
}
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #99a9bf;
border-radius: 20px;
}
}
}
.el-submenu__title {
display: flex;
align-items: center;
}
.el-submenu__title span {
white-space: normal;
word-break: break-all;
line-height: 20px;
flex: 1;
padding-right: 20px;
}
.el-menu-item {
height: 42px;
display: flex;
align-items: center;
padding-right: 20px !important;
}
.el-menu-item span {
white-space: nowrap !important;
word-break: break-all;
line-height: 20px;
flex: 1;
}
\ No newline at end of file
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-07 09:35:10
*/
import Layout from '@/layout'
export default function filterAsyncRouter (routers) {
routers.forEach(item => {
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-13 14:11:50
*/
/**
* 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器
*/
......@@ -57,17 +62,17 @@ service.interceptors.response.use(
}
);
//对错误信息的处理函数
function handleErrorData(status) {
function handleErrorData (status) {
switch (status) {
case 401:
Message.error("由于长时间未操作,请重新登录!");
router.replace({
path: "/login",
query: {
redirect: router.history.current.fullPath,
},
});
break;
// case 401:
// Message.error("由于长时间未操作,请重新登录!");
// router.replace({
// path: "/login/jg",
// query: {
// redirect: router.history.current.fullPath,
// },
// });
// break;
case 403:
Message.error("拒绝访问");
break;
......
import Vue from 'vue'
// 下载,导出
Vue.prototype.$download = function(name, href) {
Vue.prototype.$download = function (name, href) {
var a = document.createElement('a') // 创建a标签
var e = document.createEvent('MouseEvents') // 创建鼠标事件对象
e.initEvent('click', false, false) // 初始化事件对象
......@@ -10,7 +10,7 @@ Vue.prototype.$download = function(name, href) {
a.dispatchEvent(e) // 给指定的元素,执行事件click事件
}
// 导出json文件
Vue.prototype.$downloadJson = function(data, name) {
Vue.prototype.$downloadJson = function (data, name) {
// 1 生成文件的 blob 对象
const blobData = new Blob([JSON.stringify(data)], {
type: 'application/octet-stream'
......@@ -84,7 +84,7 @@ const checkCode = (rule, value, callback) => {
// }
// }
// 日期格式转换 "yyyy-MM-dd HH:mm:ss"
Vue.prototype.$formdate = function(date) {
Vue.prototype.$formdate = function (date) {
if (!date) {
return ""
}
......@@ -95,22 +95,22 @@ Vue.prototype.$formdate = function(date) {
var hh = (d.getHours() < 10 ? '0' + d.getHours() : d.getHours()) + ':';
var mm = (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()) + ':';
var ss = (d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds());
return YY + MM + DD +" "+hh + mm + ss
return YY + MM + DD + " " + hh + mm + ss
}
// 时间格式过滤
Vue.filter('timeFilter', function(timeStr) {
Vue.filter('timeFilter', function (timeStr) {
if (timeStr) {
return timeStr.substring(0, 10)
}
})
export function getType(o) {
export function getType (o) {
return Object.prototype.toString.call(o).slice(8, -1)
}
export function isKeyType(o, type) {
export function isKeyType (o, type) {
return getType(o).toLowerCase() === type.toLowerCase()
}
// 深拷贝全局挂载
Vue.prototype.$deepCopy = function(sth) {
Vue.prototype.$deepCopy = function (sth) {
// 深度复制数组
// if (Object.prototype.toString.call(obj) === "[object Array]") {
// const object = [];
......@@ -196,7 +196,7 @@ Vue.prototype.$dealArrNotDisabled = arr => {
}
}
}
function nodeDeal(arr) {
function nodeDeal (arr) {
arr.forEach(item => {
delete item.disabled
if (item.children) {
......@@ -222,7 +222,7 @@ Vue.prototype.$dealArrDisabled = (arr, id) => {
}
}
}
function nodeDeal(arr) {
function nodeDeal (arr) {
arr.forEach(item => {
item['disabled'] = true
if (item.children) {
......@@ -249,10 +249,9 @@ Vue.prototype.$getNodeRoute = (val, id) => {
}
}
})
function nodefun(newVal, newId, newCid_list) {
function nodefun (newVal, newId, newCid_list) {
let flag = false
newVal.forEach(j => {
// console.log(j)
if (j.id === newId) {
newCid_list.push(j.id)
flag = true
......@@ -272,7 +271,7 @@ Vue.prototype.$getNodeRoute = (val, id) => {
return newCid_list
}
}
function result(cid_list) {
function result (cid_list) {
const arr = cid_list.concat()
arr.pop()
return arr
......@@ -325,7 +324,7 @@ Vue.prototype.$findParent = (list, id) => {
Vue.prototype.$findChildren = (list, nodeId) => {
let newArray = []
let flag = false
function dealList(list, nodeId) {
function dealList (list, nodeId) {
if (list.length !== 0) {
list.forEach(item => {
if (!flag) {
......
import XLSX2 from "xlsx";
import XLSX from "xlsx-style";
/**
* 获取数据类型
* @param {All} [o] 需要检测的数据
* @returns {String}
*/
export function getType(o) {
export function getType (o) {
return Object.prototype.toString.call(o).slice(8, -1);
}
/**
......@@ -13,10 +15,10 @@ export function getType(o) {
* @param {String} [type] 数据类型
* @returns {Boolean}
*/
export function isKeyType(o, type) {
export function isKeyType (o, type) {
return getType(o).toLowerCase() === type.toLowerCase();
}
export function deepCopy(sth) {
export function deepCopy (sth) {
let copy;
if (null == sth || "object" != typeof sth) return sth;
if (isKeyType(sth, 'date')) {
......@@ -47,7 +49,7 @@ export function deepCopy(sth) {
* @param endLen 字符串后面保留位数
* @returns {string}
*/
export function hideCode(str, frontLen, endLen = 0) {
export function hideCode (str, frontLen, endLen = 0) {
var len = str.length - frontLen - endLen;
var xing = '';
for (var i = 0; i < len; i++) {
......@@ -57,7 +59,7 @@ export function hideCode(str, frontLen, endLen = 0) {
};
// 数组去重
export function unique(arr) {
export function unique (arr) {
var obj = {};
return arr.filter(function (item, index, arr) {
return obj.hasOwnProperty(typeof item + item) ? false : (obj[typeof item + item] = true)
......@@ -65,7 +67,7 @@ export function unique(arr) {
}
// 创造id
export function getUuid(len, radix) {
export function getUuid (len, radix) {
var chars = "0123456789abcdefghijklmnopqrstuvwxyz".split(
""
);
......@@ -89,7 +91,7 @@ export function getUuid(len, radix) {
}
//js计算两个时间戳之间的时间差 (月)
export function intervalTime(startTime, endTime) {
export function intervalTime (startTime, endTime) {
// var timestamp=new Date().getTime(); //计算当前时间戳
var timestamp = (Date.parse(new Date())) / 1000;//计算当前时间戳 (毫秒级)
var date1 = ""; //开始时间
......@@ -107,16 +109,184 @@ export function intervalTime(startTime, endTime) {
return mon
}
// 日期转时间戳
export function js_strto_time(str_time) {
export function js_strto_time (str_time) {
var str = str_time.replace(/-/g, '/') // 将-替换成/,因为下面这个构造函数只支持/分隔的日期字符串
var date = new Date(str) // 构造一个日期型数据,值为传入的字符串
return date.getTime()
}
// 时间戳转日期
export function timestampToTime(timestamp) {
export function timestampToTime (timestamp) {
var date = new Date(timestamp)//时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear() + '-'
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
var D = date.getDate() > 10 ? date.getDate() : '0' + date.getDate()
return Y + M + D
}
function formatDate (value) {
var date = new Date(value);
var y = date.getFullYear(),
m = date.getMonth() + 1,
d = date.getDate()
if (m < 10) { m = '0' + m; }
if (d < 10) { d = '0' + d; }
var t = y + '-' + m + '-' + d
return t;
}
export function getCurrentDate (date = 'firstDay') {
var now = new Date() // 当前日期
var nowYear = now.getFullYear() //当前年
var nowMonth = now.getMonth() //当前月 (值为0~11)
var d = now.getDate() //当天
if (date == 'firstDay') {
return formatDate(new Date(nowYear, nowMonth, 1)) // 本月开始时间
} else {
return formatDate(new Date(nowYear, nowMonth + 1, 0)) // 本月结束时间
}
}
export function setExport2Excel (exportName) {
/* generate workbook object from table */
var wb = XLSX2.utils.table_to_sheet(document.querySelector("#mytable"));//mytable为表格的id名
if (!wb['!merges']) {
this.$message.warning('无法导出:报表无数据');
return
}
for (var i = 0; i < 11; i++) {
wb["!cols"][i] = { wpx: 150 }
}
// 样式的文档地址
// https://www.npmjs.com/package/xlsx-style
for (const key in wb) {
if (key == 'A1') {
wb[key].s = {
font: {//字体设置
sz: 24,
bold: true,
},
alignment: {//文字居中
horizontal: 'center',
vertical: 'center',
wrapText: 1,
indent: 0,
wrap_text: true
},
border: { // 设置边框
top: { style: 'thin' },
bottom: { style: 'thin' },
left: { style: 'thin' },
right: { style: 'thin' }
}
}
} else if (key.indexOf('!') === -1) {
wb[key].s = {
font: {//字体设置
sz: 13,
bold: false,
color: {
rgb: '000000'//十六进制,不带#
}
},
alignment: {//文字居中
horizontal: 'center',
vertical: 'center',
wrapText: 1,
indent: 0,
wrap_text: true
},
border: { // 设置边框
top: { style: 'thin' },
bottom: { style: 'thin' },
left: { style: 'thin' },
right: { style: 'thin' }
}
}
}
}
var data = addRangeBorder(wb['!merges'], wb) //合并项添加边框
var filedata = sheet2blob(data)
openDownloadDialog(filedata, exportName + ".xlsx")
}
//为合并项添加边框
function addRangeBorder (range, ws) {
let arr = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
range.forEach(item => {
let startColNumber = Number(item.s.r), endColNumber = Number(item.e.r);
let startRowNumber = Number(item.s.c), endRowNumber = Number(item.e.c);
console.log(startColNumber);
const test = ws[arr[startRowNumber] + (startColNumber + 1)];
for (let col = startColNumber; col <= endColNumber; col++) {
for (let row = startRowNumber; row <= endRowNumber; row++) {
ws[arr[row] + (col + 1)] = test;
}
}
})
return ws;
}
//将一个sheet转成最终的excel文件的blob对象,然后利用URL.createObjectURL下载
function sheet2blob (sheet, sheetName) {
sheetName = sheetName || 'sheet1';
var workbook = {
SheetNames: [sheetName],
Sheets: {}
};
workbook.Sheets[sheetName] = sheet; // 生成excel的配置项
var wopts = {
bookType: 'xlsx', // 要生成的文件类型
bookSST: false, // 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
type: 'binary'
};
var wbout = XLSX.write(workbook, wopts);
var blob = new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}); // 字符串转ArrayBuffer
function s2ab (s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
return blob;
}
function openDownloadDialog (url, saveName) {
if (typeof url == 'object' && url instanceof Blob) {
url = URL.createObjectURL(url); // 创建blob地址
}
var aLink = document.createElement('a');
aLink.href = url;
aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效
var event;
if (window.MouseEvent) event = new MouseEvent('click');
else {
event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
}
aLink.dispatchEvent(event);
}
export function judgeListComplete (list) {
function judgeObjectComplete (obj) {
let flag = false
for (const key in obj) {
if (obj[key] == '' && key != 'index') {
flag = true
}
}
return flag
}
let isNotComplete = list.findIndex(item => {
return judgeObjectComplete(item) === true
})
if (isNotComplete > -1) {
return false
} else {
return true
}
}
......
......@@ -29,11 +29,13 @@ class data extends filter {
},
{
label: "业务号",
prop: "ywh"
prop: "ywh",
minWidth: 150,
},
{
label: "不动产单元号",
prop: "bdcdyh"
prop: "bdcdyh",
minWidth: 150,
},
// {
// label: "不动产产权证号",
......
......@@ -120,11 +120,12 @@ export default {
return (
<div>
<el-button
type="primary"
size="mini"
type="text"
class='btnColor'
onClick={() => { this.handleEdit(scope.row) }}
>
详情
<i class="el-icon-d-arrow-right"></i>
</el-button>
</div>
)
......@@ -161,5 +162,5 @@ export default {
}
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
// @import "~@/styles/public.scss";
</style>
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-13 14:22:01
*/
import filter from '@/utils/filter.js'
class data extends filter {
constructor() {
......@@ -34,12 +39,12 @@ class data extends filter {
{
label: "不动产单元号",
prop: "bdcdyh",
width: 150,
minWidth: 150,
},
{
label: "不动产权证号",
prop: "bdcdjzmh",
width: 150,
minWidth: 160,
},
{
label: "抵押类型",
......
......@@ -113,11 +113,13 @@ export default {
return (
<div>
<el-button
type="primary"
type="text"
class='btnColor'
size="mini"
onClick={() => { this.handleEdit(scope.row) }}
>
详情
<i class="el-icon-d-arrow-right"></i>
</el-button>
</div>
)
......@@ -152,6 +154,6 @@ export default {
</script>
<style scoped lang="scss">
// 引入表单整体样式
@import "~@/styles/public.scss";
// @import "~@/styles/public.scss";
</style>
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-13 14:23:47
*/
import filter from '@/utils/filter.js'
class data extends filter {
constructor() {
......@@ -7,16 +12,18 @@ class data extends filter {
return [
{
label: "行政区",
width: 80,
render: (h, scope) => {
return (
<div>
<span>{this.dicStatus(scope.row.xzq, 'A20')}</span>
<span>{this.dicStatus(scope.row.qxdm, 'A20')}</span>
</div>
)
},
},
{
label: "权属状态",
width: 80,
render: (h, scope) => {
return (
<div>
......@@ -31,17 +38,18 @@ class data extends filter {
},
{
label: "供役地不动产单元号",
width: 150,
minWidth: 150,
prop: "GYDBDCDYH"
},
{
label: "需役地不动产单元号",
width: 150,
minWidth: 150,
prop: "XYDBDCDYH"
},
{
label: "不动产产权证号",
prop: "bdcqzh"
prop: "bdcqzh",
minWidth: 150,
},
{
label: "权利类型",
......@@ -59,11 +67,13 @@ class data extends filter {
},
{
label: "登记时间",
prop: "DJSJ"
prop: "DJSJ",
width: 140,
},
{
label: "登记机构",
prop: "DJJG"
prop: "DJJG",
minWidth: 150,
}
]
}
......
......@@ -116,16 +116,17 @@ export default {
}].concat(data.columns()).concat([
{
label: "操作",
width: 170,
width: 80,
render: (h, scope) => {
return (
<div>
<el-button
type="primary"
size="mini"
type="text"
class='btnColor'
onClick={() => { this.handleEdit(scope.row) }}
>
详情
<i class="el-icon-d-arrow-right"></i>
</el-button>
</div>
)
......@@ -160,5 +161,5 @@ export default {
}
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
// @import "~@/styles/public.scss";
</style>
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-13 14:25:09
*/
import filter from '@/utils/filter.js'
class data extends filter {
constructor() {
......@@ -33,11 +38,13 @@ class data extends filter {
},
{
label: "不动产单元号",
prop: "bdcdyh"
prop: "bdcdyh",
minWidth: 150,
},
{
label: "不动产权证号",
prop: "bdcqzh"
prop: "bdcqzh",
minWidth: 150,
},
{
label: "权利人",
......@@ -86,7 +93,8 @@ class data extends filter {
},
{
label: "登记机构",
prop: "djjg"
prop: "djjg",
minWidth: 150,
}
]
}
......
......@@ -104,17 +104,19 @@ export default {
}].concat(data.columns()).concat([
{
label: "操作",
width: 90,
width: 80,
render: (h, scope) => {
return (
<div>
<el-button
type="primary"
type="text"
class='btnColor'
onClick={() => {
this.handleEdit(scope.row);
}}
>
详情
<i class="el-icon-d-arrow-right"></i>
</el-button>
</div>
);
......@@ -169,5 +171,5 @@ export default {
}
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
// @import "~@/styles/public.scss";
</style>
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-13 14:25:56
*/
import filter from '@/utils/filter.js'
class data extends filter {
constructor() {
......@@ -8,7 +13,7 @@ class data extends filter {
{
label: "业务号",
prop: "ywh",
width: 150
minWidth: 150,
},
// {
// label: "权利类型",
......
......@@ -77,12 +77,14 @@ export default {
return (
<div>
<el-button
type="primary"
type="text"
class='btnColor'
onClick={() => {
this.handleEdit(scope.row);
}}
>
详情
<i class="el-icon-d-arrow-right"></i>
</el-button>
</div>
);
......@@ -135,5 +137,5 @@ export default {
}
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
// @import "~@/styles/public.scss";
</style>
......