fix: 优化系统各页面样式,改中文为英文

This commit is contained in:
Xu Zhimeng 2023-05-25 19:43:05 +08:00
parent 2f8104d4c9
commit 5429deee74
30 changed files with 1017 additions and 869 deletions

View File

@ -7,9 +7,8 @@
<a-radio-button v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio-button>
</a-radio-group>
<a-select v-else-if="tagType=='select'" :getPopupContainer = "getPopupContainer" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" @change="handleInput">
<a-select v-else-if="tagType=='select'" :getPopupContainer = "getPopupContainer" :placeholder="placeholder" :disabled="disabled" :value="getValueSting" :allowClear="allowClear" @change="handleInput">
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
<a-select-option :value="undefined">请选择</a-select-option>
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
{{ item.text || item.label }}
@ -32,6 +31,10 @@
getPopupContainer:{
type: Function,
default: (node) => node.parentNode
},
allowClear: {
type: Boolean,
default: true
}
},
data() {

View File

@ -1,13 +1,14 @@
<template>
<j-modal
centered
:title="name + '选择'"
:title="name + 'Select'"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
@cancel="close"
cancelText="关闭">
:cancelButtonProps="{ props: { type: 'warn' } }"
cancelText="Cancel">
<a-row :gutter="18">
<a-col :span="16">
@ -15,15 +16,15 @@
<a-form layout="inline" class="j-inline-form">
<!-- 固定条件 -->
<a-form-item :label="(queryParamText||name)">
<a-input v-model="queryParam[queryParamCode||valueKey]" :placeholder="'请输入' + (queryParamText||name)" @pressEnter="searchQuery"/>
<a-input v-model="queryParam[queryParamCode||valueKey]" :placeholder="'Please Enter ' + (queryParamText||name)" @pressEnter="searchQuery"/>
</a-form-item>
<!-- 动态生成的查询条件 -->
<j-select-biz-query-item v-if="queryConfig.length>0" v-show="showMoreQueryItems" :queryParam="queryParam" :queryConfig="queryConfig" @pressEnter="searchQuery"/>
<!-- 按钮 -->
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a-button type="primary" @click="searchQuery" icon="search">Search</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">Reset</a-button>
<a v-if="queryConfig.length>0" @click="showMoreQueryItems=!showMoreQueryItems" style="margin-left: 8px">
{{ showMoreQueryItems ? '收起' : '展开' }}
{{ showMoreQueryItems ? 'Shrink' : 'Expand' }}
<a-icon :type="showMoreQueryItems ? 'up' : 'down'"/>
</a>
</a-form>
@ -44,11 +45,11 @@
</a-col>
<a-col :span="8">
<a-card :title="'已选' + name" :bordered="false" :head-style="{padding:0}" :body-style="{padding:0}">
<a-card :title="'Selected' + name" :bordered="false" :head-style="{padding:0}" :body-style="{padding:0}">
<a-table size="middle" :rowKey="rowKey" bordered v-bind="selectedTable">
<span slot="action" slot-scope="text, record, index">
<a @click="handleDeleteSelected(record, index)">删除</a>
<a @click="handleDeleteSelected(record, index)">Delete</a>
</span>
</a-table>
@ -152,7 +153,7 @@
...this.columns[0],
width: this.columns[0].widthRight || this.columns[0].width,
},
{ title: '操作', dataIndex: 'action', align: 'center', width: 60, scopedSlots: { customRender: 'action' }, }
{ title: 'Action', dataIndex: 'action', align: 'center', width: 60, scopedSlots: { customRender: 'action' }, }
],
dataSource: [],
},
@ -164,7 +165,8 @@
pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
const { current, pageSize } = this.ipagination
return `Total ${total} items Page ${current} / ${Math.ceil(total / pageSize)}`
},
showQuickJumper: true,
showSizeChanger: true,

View File

@ -48,7 +48,7 @@
},
placeholder: {
type: String,
default: '请选择'
default: 'Please Select'
},
disabled: {
type: Boolean,
@ -77,7 +77,7 @@
//
selectButtonText: {
type: String,
default: '选择'
default: 'Select'
},
},

View File

@ -1,9 +1,9 @@
<template>
<div class="components-input-demo-presuffix">
<!---->
<a-input @click="openModal" placeholder="请点击选择部门" v-model="textVals" readOnly :disabled="disabled">
<a-icon slot="prefix" type="cluster" title="部门选择控件"/>
<a-icon v-if="storeVals" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
<a-input @click="openModal" placeholder="Click To Select Department" v-model="textVals" readOnly :disabled="disabled">
<a-icon slot="prefix" type="cluster" />
<a-icon v-if="storeVals" slot="suffix" type="close-circle" @click="handleEmpty" />
</a-input>
<j-select-depart-modal

View File

@ -12,16 +12,16 @@
data() {
return {
settings: {
name: '职务',
name: ' Post ',
displayKey: 'name',
returnKeys: ['id', 'code'],
listUrl: '/sys/position/list',
queryParamCode: 'name',
queryParamText: '职务名称',
queryParamText: 'Post Name',
columns: [
{ title: '职务名称', dataIndex: 'name', align: 'center', width: '30%', widthRight: '70%' },
{ title: '职务编码', dataIndex: 'code', align: 'center', width: '35%' },
{ title: '职级', dataIndex: 'rank_dictText', align: 'center', width: '25%' }
{ title: 'Post Name', dataIndex: 'name', align: 'center', width: '30%', widthRight: '70%' },
{ title: 'Post Code', dataIndex: 'code', align: 'center', width: '35%' },
{ title: 'Post Level', dataIndex: 'rank_dictText', align: 'center', width: '25%' }
]
}
}

View File

@ -1,6 +1,6 @@
<template>
<j-modal
title="选择部门"
title="Select Department"
:width="modalWidth"
:visible="visible"
:confirmLoading="confirmLoading"
@ -8,10 +8,9 @@
@cancel="handleCancel"
@update:fullscreen="isFullscreen"
wrapClassName="j-depart-select-modal"
switchFullscreen
cancelText="关闭">
switchFullscreen>
<a-spin tip="Loading..." :spinning="false">
<a-input-search v-model="searchValue" style="margin-bottom: 1px" placeholder="请输入部门名称按回车进行搜索" />
<a-input-search v-model="searchValue" style="margin-bottom: 1px" placeholder="Enter Department Name To Search" />
<a-empty v-if="filterTreeData.length===0"></a-empty>
<a-tree
v-else
@ -33,15 +32,15 @@
<div class="drawer-bootom-button">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="1" @click="switchCheckStrictly(1)">Father And Son Link</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">Unlink</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
<a-button type="primary">
Tree Action <a-icon type="up" />
</a-button>
</a-dropdown>
<a-button @click="handleCancel" type="primary" style="margin-right: 0.8rem">关闭</a-button>
<a-button @click="handleSubmit" type="primary" >确认</a-button>
<a-button @click="handleCancel" type="warn" style="margin-right: 0.8rem">Close</a-button>
<a-button @click="handleSubmit" type="primary" >Ok</a-button>
</div>
</template>
</j-modal>
@ -290,11 +289,11 @@
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
border-top: 1px solid #0c6a66;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
background: #022024;
border-radius: 0 0 2px 2px;
}
</style>

View File

@ -135,8 +135,13 @@
const that = this
this.$confirm({
title: '提示',
content: '真的要注销登录吗 ?',
title: 'Prompt',
content: 'Ensure Log Out?',
cancelButtonProps: {
props: {
type: 'warn'
}
},
onOk() {
return that.Logout({}).then(() => {
// update-begin author:scott date:20211223 for:JTC-198退
@ -145,7 +150,7 @@
// update-end author:scott date:20211223 for:JTC-198退
}).catch(err => {
that.$message.error({
title: '错误',
title: 'Error',
description: err.message
})
})

View File

@ -1,4 +1,5 @@
import { UserLayout, TabLayout, RouteView, BlankLayout, PageView } from '@/components/layouts'
import { TabLayout, RouteView, BlankLayout, PageView } from '@/components/layouts'
import Login from '@/views/user/Login'
/**
* 走菜单走权限控制
@ -295,32 +296,8 @@ export const asyncRouterMap = [
*/
export const constantRouterMap = [
{
path: '/user',
component: UserLayout,
redirect: '/user/login',
hidden: true,
children: [
{
path: 'login',
name: 'login',
component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
},
{
path: 'register',
name: 'register',
component: () => import(/* webpackChunkName: "user" */ '@/views/user/register/Register')
},
{
path: 'register-result',
name: 'registerResult',
component: () => import(/* webpackChunkName: "user" */ '@/views/user/register/RegisterResult')
},
{
path: 'alteration',
name: 'alteration',
component: () => import(/* webpackChunkName: "user" */ '@/views/user/alteration/Alteration')
},
]
path: '/user/login',
component: Login
},
// {

View File

@ -79,6 +79,12 @@ body {
&-selected {
background-color: 0d4e5c;
}
&-row-expand-icon {
background-color: transparent;
border-color: @formInputBorderColor;
color: @formInputBorderColor;
}
}
// 表格下的分页器
@ -100,6 +106,9 @@ body {
display: inline-block;
width: 100%;
}
&-required::before {
display: none !important;
}
}
&-horizontal {
@{antFormSelector} {
@ -291,6 +300,16 @@ body {
&-clear-icon {
color: #00e9fe !important;
}
&:focus {
box-shadow: none !important;
}
&:disabled {
color: #fff;
}
&-search-icon {
color: #fff;
}
}
// 单选样式
@ -298,6 +317,15 @@ body {
&-wrapper {
color: #fff;
}
&-button-wrapper {
color: @primary-color;
}
}
.ant-upload {
&-select-picture-card {
background-color: transparent !important;
}
}
@checkboxSelector: .ant-checkbox;
@ -693,10 +721,11 @@ body {
.ant-drawer {
&-header {
background-color: @modalBg;
border-bottom-color: @formInputBorderColor;
}
&-title,
&-close {
color: #fff;
color: #fff !important;
}
&-content {
background-color: @modalBg;
@ -765,6 +794,19 @@ body {
background-color: @formInputBorderColor;
}
.ant-spin {
&-blur::after {
opacity: .1;
}
}
.ant-popover {
&-arrow {
border-right-color: @formInputBgColor !important;
border-bottom-color: @formInputBgColor !important;
}
}
#userLayout {
.container {
background-color: @modalBg !important;

View File

@ -7,7 +7,7 @@ import onlineCommons from '@jeecg/antd-online-mini'
export function timeFix() {
const time = new Date()
const hour = time.getHours()
return hour < 9 ? '早上好' : (hour <= 11 ? '上午好' : (hour <= 13 ? '中午好' : (hour < 20 ? '下午好' : '晚上好')))
return hour < 9 ? 'Good Morning' : (hour <= 11 ? 'Good Morning' : (hour <= 13 ? 'Good Noon' : (hour < 20 ? 'Good Afternoon' : 'Good Evening')))
}
export function welcome() {

View File

@ -33,111 +33,125 @@ import { getAction } from '../../api/manage'
const columns = [
{
title: 'NO',
align: 'center',
align: 'left',
width: 100,
scopedSlots: {
customRender: 'index'
},
customHeaderCell: () => {
return {
style: {
'padding-left': '26px !important'
}
}
},
customCell: () => {
return {
style: {
'padding-left': '26px !important'
}
}
}
},
{
title: 'SITE DET CODE',
align: 'center',
align: 'left',
dataIndex: 'siteDetCode',
width: 130
},
{
title: 'SAMPLE ID',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'sampleId'
},
{
title: 'STATION',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'stationName'
},
{
title: 'DETECTOR',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'detectorsName'
},
{
title: 'SAMPLE TYPE',
align: 'center',
align: 'left',
width: 120,
dataIndex: 'sampleType'
},
{
title: 'DATA TYPE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'dataType'
},
{
title: 'GEOMETRY',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'geometry'
},
{
title: 'QUALIFIE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'spectralQualifie'
},
{
title: 'TRANSMIT DTG',
align: 'center',
align: 'left',
width: 150,
dataIndex: 'transmitDtg'
},
{
title: 'COLLECT START',
align: 'center',
align: 'left',
width: 150,
dataIndex: 'collectStart'
},
{
title: 'COLLECT STOP',
align: 'center',
align: 'left',
width: 150,
dataIndex: 'collectStop'
},
{
title: 'ACQ.START',
align: 'center',
align: 'left',
width: 150,
dataIndex: 'acquisitionStart'
},
{
title: 'ACQ.STOP',
align: 'center',
align: 'left',
width: 150,
dataIndex: 'acquisitionStop'
},
{
title: 'ACQ.REAL(S)',
align: 'center',
align: 'left',
width: 120,
dataIndex: 'acquisitionRealSec'
},
{
title: 'ACQ.LIVE(S)',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'acquisitionLiveSec'
},
{
title: 'QUANTITY',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'quantity'
},
{
title: 'STATUS',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'status'
}
@ -223,11 +237,14 @@ export default {
label: 'SampleID',
type: 'a-input',
name: 'sampleId',
style: {
width: '19%'
},
props: {
allowClear: true
allowClear: true,
style: {
width: '261px'
}
},
style: {
width: 'auto'
}
},
{
@ -244,10 +261,13 @@ export default {
],
showSearch: true,
filterOption: this.filterOption,
allowClear: true
allowClear: true,
style: {
width: '261px'
}
},
style: {
width: '19%'
width: 'auto'
}
},
{
@ -264,10 +284,13 @@ export default {
],
showSearch: true,
filterOption: this.filterOption,
allowClear: true
allowClear: true,
style: {
width: '261px'
}
},
style: {
width: '19%'
width: 'auto'
}
},
{
@ -279,11 +302,12 @@ export default {
format: 'YYYY-MM-DD HH:mm',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
style: {
minWidth: 'auto'
minWidth: 'auto',
width: '350px'
}
},
style: {
width: '22%'
width: 'auto'
}
},
{
@ -295,12 +319,13 @@ export default {
format: 'YYYY-MM-DD HH:mm',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
style: {
minWidth: 'auto'
minWidth: 'auto',
width: '350px'
}
},
style: {
paddingRight: 0,
width: '21%'
width: 'auto'
}
},
{

View File

@ -105,74 +105,89 @@ import { getAction } from '../../api/manage'
const columns = [
{
title: 'NO',
align: 'center',
align: 'left',
width: 100,
scopedSlots: {
customRender: 'index'
},
customHeaderCell: () => {
return {
style: {
'padding-left': '60px !important'
}
}
},
customCell: () => {
return {
style: {
'padding-left': '60px !important'
}
}
}
},
{
title: 'DETECTOR ID',
align: 'center',
align: 'left',
dataIndex: 'detectorId',
width: 100
},
{
title: 'DETECTOR CODE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'detectorCode'
},
{
title: 'LON',
align: 'center',
width: 80,
align: 'left',
width: 50,
dataIndex: 'lon'
},
{
title: 'LAT',
align: 'center',
width: 80,
align: 'left',
width: 50,
dataIndex: 'lat'
},
{
title: 'TYPE',
align: 'center',
width: 100,
align: 'left',
width: 80,
dataIndex: 'type'
},
{
title: 'CHANNELS',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'channels'
},
{
title: 'RATED EFFICIENCY',
align: 'center',
align: 'left',
width: 120,
dataIndex: 'ratedEfficiency'
},
{
title: 'RATED RESOLUTION',
align: 'center',
align: 'left',
width: 120,
dataIndex: 'ratedResolution'
},
{
title: 'ECAL RANGE MAX',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'ecalRangeMax'
},
{
title: 'DESCRIPTION',
width: 100,
dataIndex: 'description'
width: 160,
dataIndex: 'description',
ellipsis: true
},
{
title: 'STATUS',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'status'
}
@ -269,10 +284,13 @@ export default {
type: 'a-input',
name: 'detectorCode',
props: {
allowClear: true
allowClear: true,
style: {
width: '261px'
}
},
style: {
width: '310px'
width: 'auto'
}
},
{
@ -283,10 +301,13 @@ export default {
options: this.typeList,
allowClear: true,
showSearch: true,
filterOption: this.filterOption
filterOption: this.filterOption,
style: {
width: '261px'
}
},
style: {
width: '310px'
width: 'auto'
}
},
{
@ -297,10 +318,13 @@ export default {
dictCode: 'STATION_STATUS',
getPopupContainer: () => {
return document.body
},
style: {
width: '261px'
}
},
style: {
width: '310px'
width: 'auto'
}
}
]

View File

@ -6,7 +6,7 @@
:maskClosable="false"
@cancel="handleCancel">
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button @click="handleCancel" type="warn">Cancel</a-button>
</template>
<a-table
ref="table"
@ -17,9 +17,9 @@
:dataSource="dataSource"
:pagination="false">
<span slot="action" slot-scope="text, record">
<a @click="handleBack(record.id)"><a-icon type="redo"/>字典取回</a>
<a @click="handleBack(record.id)"><a-icon type="redo"/>Handle Back</a>
<a-divider type="vertical"/>
<a @click="handleDelete(record.id)"><a-icon type="scissor"/>彻底删除</a>
<a @click="handleDelete(record.id)"><a-icon type="scissor"/>Delete Completly</a>
</span>
</a-table>
@ -36,7 +36,7 @@
return {
modalWidth: '90%',
modalStyle: { 'top': '20px'},
title: '操作',
title: 'Action',
visible: false,
loading: false,
dataSource:[],
@ -52,22 +52,22 @@
}
},
{
title: '字典名称',
title: 'Dict Name',
align: "left",
dataIndex: 'dictName'
},
{
title: '字典编号',
title: 'Dict Code',
align: "left",
dataIndex: 'dictCode'
},
{
title: '描述',
title: 'Description',
align: "left",
dataIndex: 'description'
},
{
title: '操作',
title: 'Action',
dataIndex: 'action',
align: "center",
scopedSlots: {customRender: 'action'}
@ -109,10 +109,10 @@
},
handleDelete(id){
this.$confirm({
title: '彻底删除字典',
title: 'Delete Completly',
content: (<div>
<p>您确定要彻底删除这个字典项吗</p>
<p style="color:red;">注意彻底删除后将无法恢复请谨慎操作</p>
<p>Want To Delete Dict Item Completly?</p>
<p style="color:red;">WarningDelete Completly Will Have No Way To RecoverPlease Be Patient</p>
</div>),
centered: false,
onOk: () => {

View File

@ -2,7 +2,7 @@
<a-card :bordered="false">
<!-- 抽屉 -->
<a-drawer
title="字典列表"
title="Dict List"
:width="screenWidth"
@close="onClose"
:visible="visible"
@ -19,31 +19,31 @@
<a-form layout="inline" :form="form" @keyup.enter.native="searchQuery">
<a-row :gutter="10">
<a-col :md="8" :sm="12">
<a-form-item label="名称">
<a-input style="width: 120px;" placeholder="请输入名称" v-model="queryParam.itemText"></a-input>
<a-form-item label="Name">
<a-input style="width: 120px;" placeholder="Please Enter Name" v-model="queryParam.itemText"></a-input>
</a-form-item>
</a-col>
<a-col :md="9" :sm="24">
<a-form-item label="状态" style="width: 170px" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form-item label="Status" style="width: 170px" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择"
placeholder="Please Select"
v-model="queryParam.status"
>
<a-select-option value="1">正常</a-select-option>
<a-select-option value="0">禁用</a-select-option>
<a-select-option value="1">Enable</a-select-option>
<a-select-option value="0">Disable</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="7" :sm="24">
<span style="float: left;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">搜索</a-button>
<a-button type="primary" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" @click="searchQuery">Search</a-button>
<a-button type="primary" @click="searchReset" style="margin-left: 8px">Reset</a-button>
</span>
</a-col>
</a-row>
<a-row>
<a-col :md="2" :sm="24">
<a-button style="margin-bottom: 10px" type="primary" @click="handleAdd">新增</a-button>
<a-button style="margin-bottom: 10px" type="primary" @click="handleAdd">Add</a-button>
</a-col>
</a-row>
</a-form>
@ -62,10 +62,10 @@
>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a @click="handleEdit(record)">Edit</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
<a-popconfirm title="Ensure Delete?" @confirm="() => handleDelete(record.id)" :cancelButtonProps="{ props: { type: 'warn' } }">
<a>Delete</a>
</a-popconfirm>
</span>
@ -91,17 +91,17 @@
return {
columns: [
{
title: '名称',
title: 'Item Name',
align: "center",
dataIndex: 'itemText',
},
{
title: '数据值',
title: 'Item Value',
align: "center",
dataIndex: 'itemValue',
},
{
title: '操作',
title: 'Action',
dataIndex: 'action',
align: "center",
scopedSlots: {customRender: 'action'},
@ -130,8 +130,8 @@
},
form: this.$form.createForm(this),
validatorRules: {
itemText: {rules: [{required: true, message: '请输入名称!'}]},
itemValue: {rules: [{required: true, message: '请输入数据值!'}]},
itemText: {rules: [{required: true, message: 'Please Enter Name'}]},
itemValue: {rules: [{required: true, message: 'Please Enter item Value'}]},
},
url: {
list: "/sys/dictItem/list",
@ -185,7 +185,7 @@
//
handleAdd() {
this.$refs.modalForm.add(this.dictId);
this.$refs.modalForm.title = "新增";
this.$refs.modalForm.title = "Add";
},
showDrawer() {
this.visible = true

View File

@ -43,6 +43,7 @@
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:scroll="{ y: 'calc(100vh - 400px)' }"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">
@ -52,7 +53,7 @@
<a-divider type="vertical"/>
<a @click="editDictItem(record)"><a-icon type="setting"/> EditDict</a>
<a-divider type="vertical"/>
<a-popconfirm title="Do You Want To Delete This Item?" @confirm="() =>handleDelete(record.id)">
<a-popconfirm title="Do You Want To Delete This Item?" @confirm="() =>handleDelete(record.id)" :cancelButtonProps="{ props: { type: 'warn' } }">
<a>Delete</a>
</a-popconfirm>
</span>

View File

@ -15,19 +15,13 @@
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i>To Select&nbsp;<a style="font-weight: 600">{{
selectedRowKeys.length }}</a> Item&nbsp;&nbsp;
<a style="margin-left: 24px" @click="onClearSelected">Clear</a>
</div>
<a-table
:columns="columns"
size="middle"
:pagination="false"
:dataSource="dataSource"
:loading="loading"
:scroll="{ y: 'calc(100vh - 285px)'}"
@expand="expandSubmenu"
:expandedRowKeys="expandedRowKeys"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"

View File

@ -89,51 +89,65 @@ import { getAction } from '../../api/manage'
const columns = [
{
title: 'NO',
align: 'center',
align: 'left',
width: 100,
scopedSlots: {
customRender: 'index'
},
customHeaderCell: () => {
return {
style: {
'padding-left': '60px !important'
}
}
},
customCell: () => {
return {
style: {
'padding-left': '60px !important'
}
}
}
},
{
title: 'FACILITY ID',
align: 'center',
align: 'left',
dataIndex: 'facilityId',
width: 100
},
{
title: 'FACILITY NAME',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'facilityName'
},
{
title: 'TYPE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'type'
},
{
title: 'LOCATION',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'location'
},
{
title: 'LONGITUDE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'longitude'
},
{
title: 'LATITUDE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'latitude'
},
{
title: 'STATUS',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'status'
}
@ -224,10 +238,13 @@ export default {
type: 'a-input',
name: 'facilityName',
props: {
allowClear: true
allowClear: true,
style: {
width: '261px'
}
},
style: {
width: '300px'
width: 'auto'
}
},
{
@ -238,10 +255,13 @@ export default {
options: this.typeList,
allowClear: true,
showSearch: true,
filterOption: this.filterOption
filterOption: this.filterOption,
style: {
width: '261px'
}
},
style: {
width: '300px'
width: 'auto'
}
},
{
@ -252,10 +272,13 @@ export default {
options: this.locationList,
allowClear: true,
showSearch: true,
filterOption: this.filterOption
filterOption: this.filterOption,
style: {
width: '261px'
}
},
style: {
width: '300px'
width: 'auto'
}
},
{
@ -266,10 +289,13 @@ export default {
getPopupContainer: () => {
return document.body
},
dictCode: 'NUCLEARFACILITY_STATUS'
dictCode: 'NUCLEARFACILITY_STATUS',
style: {
width: '261px'
}
},
style: {
width: '300px'
width: 'auto'
}
}
]

View File

@ -1,6 +1,6 @@
<template>
<a-drawer
title="数据权限规则"
title="Data Rules"
:width="drawerWidth"
@close="onClose"
:visible="visible">
@ -16,25 +16,25 @@
<a-form @keyup.enter.native="searchQuery">
<a-row :gutter="12">
<a-col :md="8" :sm="8">
<a-form-item label="规则名称" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
<a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"></a-input>
<a-form-item label="Rule Name" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
<a-input placeholder="Please Enter Rule Name" v-model="queryParam.ruleName"></a-input>
</a-form-item>
</a-col>
<a-col :md="8" :sm="8">
<a-form-item label="规则值" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
<a-input placeholder="请输入规则值" v-model="queryParam.ruleValue"></a-input>
<a-form-item label="Rule Value" :labelCol="{span: 8}" :wrapperCol="{span: 14, offset: 1}">
<a-input placeholder="Please Enter Rule Value" v-model="queryParam.ruleValue"></a-input>
</a-form-item>
</a-col>
<a-col :md="7" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a-button type="primary" @click="searchQuery" icon="search">Search</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">Reset</a-button>
</span>
</a-col>
</a-row>
<a-row>
<a-col :md="24" :sm="24">
<a-button style="margin-bottom: 10px" @click="addPermissionRule" type="primary" icon="plus">添加</a-button>
<a-button style="margin-bottom: 10px" @click="addPermissionRule" type="primary" icon="plus">Add</a-button>
</a-col>
</a-row>
</a-form>
@ -52,11 +52,11 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">
<a-icon type="edit"/>编辑
<a-icon type="edit"/>Edit
</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
<a-popconfirm title="Ensure Delete?" @confirm="() => handleDelete(record.id)">
<a>Delete</a>
</a-popconfirm>
</span>
</a-table>
@ -73,26 +73,26 @@
const columns = [
{
title: '规则名称',
title: 'Role Name',
dataIndex: 'ruleName',
key: 'ruleName',
width:150,
},
{
title: '规则字段',
title: 'Role Column',
dataIndex: 'ruleColumn',
key: 'ruleColumn',
width:150,
},
{
title: '规则值',
title: 'Rule Value',
dataIndex: 'ruleValue',
key: 'ruleValue',
width:150,
scopedSlots: {customRender: "ruleValueText"}
},
{
title: '操作',
title: 'Action',
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: 'center'
@ -150,7 +150,7 @@
},
addPermissionRule() {
this.$refs.modalForm.add(this.permId)
this.$refs.modalForm.title = '新增'
this.$refs.modalForm.title = 'Add'
},
searchQuery() {
var params = this.getQueryParams();

View File

@ -1,87 +1,68 @@
<template>
<a-row :gutter="10">
<a-col :md="leftColMd" :sm="24" style="margin-bottom: 20px">
<a-col :md="leftColMd" :sm="24">
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="12" :sm="8">
<a-form-item label="RoleName" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-input placeholder="" v-model="queryParam.roleName"></a-input>
</a-form-item>
</a-col>
<!--
<a-col :md="11" :sm="12">
<a-form-item label="创建时间" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<j-date v-model="queryParam.createTime_begin" :showTime="true" date-format="YYYY-MM-DD HH:mm:ss" style="width:45%" placeholder="请选择开始时间" ></j-date>
<span style="width: 10px;">~</span>
<j-date v-model="queryParam.createTime_end" :showTime="true" date-format="YYYY-MM-DD HH:mm:ss" style="width:45%" placeholder="请选择结束时间"></j-date>
</a-form-item>
</a-col>
-->
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">Search</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">Reload</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<search-form :items="formItems" v-model="queryParam" @search="searchQuery">
<a-space style="float: right" class="btn-group" slot="additional">
<a-button @click="handleAdd" type="primary">
<img src="@/assets/images/global/add.png" alt="" />
Add
</a-button>
<a-upload
name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
@change="handleImportExcel"
>
<a-button type="primary">
<img src="@/assets/images/global/import.png" alt="" />
Import
</a-button>
</a-upload>
<a-button type="primary" @click="handleExportXls('角色管理')">
<img src="@/assets/images/global/export.png" alt="" />
Export
</a-button>
</a-space>
</search-form>
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin: 5px 0 10px 2px">
<a-button @click="handleAdd" type="primary" icon="plus">ADD</a-button>
<!--<a-button @click="handleEdit(model1)" type="primary" icon="plus">角色编辑</a-button>-->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">Import</a-button>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('角色管理')">Export</a-button>
</div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon">
</i> To Select <a><b>{{ selectedRowKeys1.length }}</b></a> Item
<a style="margin-left: 24px" @click="onClearSelected1">Clear</a>
</div>
<div style="margin-top: 15px">
<a-table
style="height:500px"
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleOpen(record)">User</a>
<a-divider type="vertical"/>
:rowSelection="{ selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type: 'radio' }"
:scroll="{ y: 'calc(100vh - 365px)' }"
@change="handleTableChange"
>
<span slot="action" slot-scope="text, record">
<a @click="handleOpen(record)">User</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">
More <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handlePerssion(record.id)">Perssion</a>
</a-menu-item>
<a-menu-item>
<a @click="handleEdit(record)">Edit</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="Do You Want To Delete This Item?'" @confirm="() => handleDelete1(record.id)">
<a>Delete</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
<a-dropdown>
<a class="ant-dropdown-link"> More <a-icon type="down" /> </a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handlePerssion(record.id)">Authorize</a>
</a-menu-item>
<a-menu-item>
<a @click="handleEdit(record)">Edit</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="Do You Want To Delete This Item?" @confirm="() => handleDelete1(record.id)" :cancelButtonProps="{ props: { type: 'warn' } }">
<a>Delete</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- 右侧的角色权限配置 -->
@ -95,78 +76,61 @@
<a-icon type="close-circle" @click="hideUserList" />
</div>
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="12" :sm="12">
<a-form-item label="UserName">
<a-input placeholder="" v-model="queryParam2.username"></a-input>
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="9" :sm="24">
<a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">Search</a-button>
<a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">Reload</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<search-form :items="formItems2" v-model="queryParam2" @search="searchQuery2">
<a-space style="float: right" class="btn-group" slot="additional">
<a-button @click="handleAdd2" type="primary">
<img src="@/assets/images/global/add.png" alt="" />
Add
</a-button>
<a-button @click="handleAddUserRole" type="primary">
<img src="@/assets/images/global/add.png" alt="" />
Add From List
</a-button>
</a-space>
</search-form>
<!-- 操作按钮区域 -->
<div class="table-operator" :md="24" :sm="24">
<a-button @click="handleAdd2" type="primary" icon="plus" style="margin-top: 16px">Add</a-button>
<!--<a-button @click="handleEdit2" type="primary" icon="edit" style="margin-top: 16px">用户编辑</a-button>-->
<a-button @click="handleAddUserRole" type="primary" icon="plus" style="margin-top: 16px">Existing users</a-button>
<a-dropdown v-if="selectedRowKeys2.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel2">
<a-icon type="delete"/>
Unbind
<a-icon type="delete" />
UnLink
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> Batch operation
<a-icon type="down"/>
<a-button style="margin-left: 8px" type="primary">
Batch
<a-icon type="down" />
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> To Select <a style="font-weight: 600">{{
selectedRowKeys2.length }}</a> Item
<a style="margin-left: 24px" @click="onClearSelected2">Clear</a>
</div>
<a-table
style="height:500px"
ref="table2"
bordered
size="middle"
rowKey="id"
:columns="columns2"
:dataSource="dataSource2"
:pagination="ipagination2"
:loading="loading2"
:rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
@change="handleTableChange2">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit2(record)">Edit</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
More <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a-popconfirm title="Are you sure you want to unbind?" @confirm="() => handleDelete2(record.id)">
<a>Unbind</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
:rowSelection="{ selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2 }"
@change="handleTableChange2"
>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit2(record)">Edit</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link"> More <a-icon type="down" /> </a>
<a-menu slot="overlay">
<a-menu-item>
<a-popconfirm title="Ensure Unlink?" @confirm="() => handleDelete2(record.id)">
<a>Unlink</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- 表单区域 -->
@ -178,330 +142,362 @@
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { deleteAction, postAction, getAction } from '@/api/manage'
import SelectUserModal from './modules/SelectUserModal'
import RoleModal from './modules/RoleModal'
import UserModal from './modules/UserModal'
import { filterObj } from '@/utils/util'
import UserRoleModal from './modules/UserRoleModal'
import moment from 'moment'
export default {
name: 'RoleUserList',
mixins: [JeecgListMixin],
components: {
UserRoleModal,
SelectUserModal,
RoleModal,
UserModal,
moment
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { deleteAction, postAction, getAction } from '@/api/manage'
import SelectUserModal from './modules/SelectUserModal'
import RoleModal from './modules/RoleModal'
import UserModal from './modules/UserModal'
import { filterObj } from '@/utils/util'
import UserRoleModal from './modules/UserRoleModal'
import moment from 'moment'
const formItems = [
{
label: 'Role Name',
type: 'a-input',
name: 'roleName',
props: {
style: {
width: '261px'
}
},
data() {
return {
model1: {},
model2: {},
currentRoleId: '',
queryParam1: {},
queryParam2: {},
dataSource1: [],
dataSource2: [],
ipagination1: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
style: {
width: 'auto'
}
}
]
const formItems2 = [
{
label: 'User Name',
type: 'a-input',
name: 'username',
props: {
style: {
width: '261px'
}
},
style: {
width: 'auto'
}
}
]
export default {
name: 'RoleUserList',
mixins: [JeecgListMixin],
components: {
UserRoleModal,
SelectUserModal,
RoleModal,
UserModal,
moment
},
data() {
this.formItems = formItems
this.formItems2 = formItems2
return {
model1: {},
model2: {},
currentRoleId: '',
queryParam1: {},
queryParam2: {},
dataSource1: [],
dataSource2: [],
ipagination1: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
const { current, pageSize } = this.ipagination1
return `Total ${total} items Page ${current} / ${Math.ceil(total / pageSize)}`
},
ipagination2: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
ipagination2: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
const { current, pageSize } = this.ipagination2
return `Total ${total} items Page ${current} / ${Math.ceil(total / pageSize)}`
},
isorter1: {
column: 'createTime',
order: 'desc'
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isorter1: {
column: 'createTime',
order: 'desc'
},
isorter2: {
column: 'createTime',
order: 'desc'
},
filters1: {},
filters2: {},
loading1: false,
loading2: false,
selectedRowKeys1: [],
selectedRowKeys2: [],
selectionRows1: [],
selectionRows2: [],
test: {},
rightcolval: 0,
columns: [
{
title: 'ROLE CODE',
align: 'center',
dataIndex: 'roleCode'
},
isorter2: {
column: 'createTime',
order: 'desc'
{
title: 'ROLE NAME',
align: 'center',
dataIndex: 'roleName'
},
filters1: {},
filters2: {},
loading1: false,
loading2: false,
selectedRowKeys1: [],
selectedRowKeys2: [],
selectionRows1: [],
selectionRows2: [],
test:{},
rightcolval:0,
columns:
[
{
title: 'ROLECODE',
align: 'center',
dataIndex: 'roleCode'
},
{
title: 'ROLENAME',
align: 'center',
dataIndex: 'roleName'
},
{
title: 'CREATETIME',
dataIndex: 'createTime',
align:"center",
sorter: true,
customRender: (text) => {
return moment(text).format('YYYY-MM-DD')
}
},
{
title: 'ACTION',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
}
],
columns2: [{
title: 'USERNAME',
{
title: 'CREATE TIME',
dataIndex: 'createTime',
align: 'center',
sorter: true,
customRender: text => {
return moment(text).format('YYYY-MM-DD')
}
},
{
title: 'ACTION',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
}
],
columns2: [
{
title: 'USER NAME',
align: 'center',
dataIndex: 'username',
width: 120
},
{
title: 'REALNAME',
align: 'center',
width: 100,
dataIndex: 'realname'
},
{
title: 'STATUS',
align: 'center',
width: 80,
dataIndex: 'status_dictText'
},
{
title: 'REAL NAME',
align: 'center',
width: 100,
dataIndex: 'realname'
},
{
title: 'STATUS',
align: 'center',
width: 80,
dataIndex: 'status_dictText'
},
{
title: 'ACTION',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 120
}],
//
superQueryParams2: '',
//
superQueryMatchType2: 'and',
url: {
list: '/sys/role/list',
delete: '/sys/role/delete',
list2: '/sys/user/userRoleList',
addUserRole: '/sys/user/addSysUserRole',
delete2: '/sys/user/deleteUserRole',
deleteBatch2: '/sys/user/deleteUserRoleBatch',
exportXlsUrl: 'sys/role/exportXls',
importExcelUrl: 'sys/role/importExcel'
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 120
}
}
},
computed: {
importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
},
leftColMd() {
return this.selectedRowKeys1.length === 0 ? 24 : 12
},
rightColMd() {
return this.selectedRowKeys1.length === 0 ? 0 : 12
}
},
methods: {
onSelectChange2(selectedRowKeys, selectionRows) {
this.selectedRowKeys2 = selectedRowKeys
this.selectionRows2 = selectionRows
},
onClearSelected2() {
this.selectedRowKeys2 = []
this.selectionRows2 = []
},
onClearSelected1() {
this.selectedRowKeys1 = []
this.selectionRows1 = []
},
onSelectChange1(selectedRowKeys, selectionRows) {
this.rightcolval = 1
this.selectedRowKeys1 = selectedRowKeys
this.selectionRows1 = selectionRows
this.model1 = Object.assign({}, selectionRows[0])
console.log(this.model1)
this.currentRoleId = selectedRowKeys[0]
this.loadData2()
},
onClearSelected() {
},
],
getQueryParams2() {
//
let sqp = {}
if (this.superQueryParams2) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
sqp['superQueryMatchType'] = this.superQueryMatchType2
}
var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
param.field = this.getQueryField2()
param.pageNo = this.ipagination2.current
param.pageSize = this.ipagination2.pageSize
return filterObj(param)
},
getQueryField2() {
//TODO
var str = 'id,'
this.columns2.forEach(function(value) {
str += ',' + value.dataIndex
})
return str
},
handleEdit2: function(record) {
this.$refs.modalForm2.title = 'Edit'
//
superQueryParams2: '',
//
superQueryMatchType2: 'and',
url: {
list: '/sys/role/list',
delete: '/sys/role/delete',
list2: '/sys/user/userRoleList',
addUserRole: '/sys/user/addSysUserRole',
delete2: '/sys/user/deleteUserRole',
deleteBatch2: '/sys/user/deleteUserRoleBatch',
exportXlsUrl: 'sys/role/exportXls',
importExcelUrl: 'sys/role/importExcel'
}
}
},
computed: {
importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
},
leftColMd() {
return this.selectedRowKeys1.length === 0 ? 24 : 12
},
rightColMd() {
return this.selectedRowKeys1.length === 0 ? 0 : 12
}
},
methods: {
onSelectChange2(selectedRowKeys, selectionRows) {
this.selectedRowKeys2 = selectedRowKeys
this.selectionRows2 = selectionRows
},
onClearSelected2() {
this.selectedRowKeys2 = []
this.selectionRows2 = []
},
onClearSelected1() {
this.selectedRowKeys1 = []
this.selectionRows1 = []
},
onSelectChange1(selectedRowKeys, selectionRows) {
this.rightcolval = 1
this.selectedRowKeys1 = selectedRowKeys
this.selectionRows1 = selectionRows
this.model1 = Object.assign({}, selectionRows[0])
console.log(this.model1)
this.currentRoleId = selectedRowKeys[0]
this.loadData2()
},
onClearSelected() {},
getQueryParams2() {
//
let sqp = {}
if (this.superQueryParams2) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
sqp['superQueryMatchType'] = this.superQueryMatchType2
}
var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
param.field = this.getQueryField2()
param.pageNo = this.ipagination2.current
param.pageSize = this.ipagination2.pageSize
return filterObj(param)
},
getQueryField2() {
//TODO
var str = 'id,'
this.columns2.forEach(function(value) {
str += ',' + value.dataIndex
})
return str
},
handleEdit2: function(record) {
this.$refs.modalForm2.title = 'Edit'
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.edit(record)
},
handleAdd2: function() {
if (this.currentRoleId == '') {
this.$message.error('Please Select A Role')
} else {
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.edit(record)
},
handleAdd2: function() {
if (this.currentRoleId == '') {
this.$message.error('Please select a role!')
this.$refs.modalForm2.title = 'Add'
this.$refs.modalForm2.edit({ activitiSync: '1', userIdentity: 1, selectedroles: this.currentRoleId })
}
},
modalFormOk2() {
// /
this.loadData2()
},
loadData2(arg) {
if (!this.url.list2) {
this.$message.error('请设置url.list2属性!')
return
}
// 1
if (arg === 1) {
this.ipagination2.current = 1
}
if (this.currentRoleId === '') return
let params = this.getQueryParams2() //
params.roleId = this.currentRoleId
this.loading2 = true
getAction(this.url.list2, params).then(res => {
if (res.success) {
this.dataSource2 = res.result.records
this.ipagination2.total = res.result.total
}
this.loading2 = false
})
},
handleDelete1: function(id) {
this.handleDelete(id)
this.dataSource2 = []
this.currentRoleId = ''
},
handleDelete2: function(id) {
if (!this.url.delete2) {
this.$message.error('请设置url.delete2属性!')
return
}
var that = this
deleteAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then(res => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
} else {
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.title = 'Add'
this.$refs.modalForm2.edit({activitiSync:'1',userIdentity:1,selectedroles:this.currentRoleId})
that.$message.warning(res.message)
}
},
modalFormOk2() {
// /
this.loadData2()
},
loadData2(arg) {
if (!this.url.list2) {
this.$message.error('Please set url.list2 property!')
return
}
// 1
if (arg === 1) {
this.ipagination2.current = 1
}
if (this.currentRoleId === '') return
let params = this.getQueryParams2()//
params.roleId = this.currentRoleId
this.loading2 = true
getAction(this.url.list2, params).then((res) => {
if (res.success) {
this.dataSource2 = res.result.records
this.ipagination2.total = res.result.total
}
this.loading2 = false
})
},
handleDelete1: function(id) {
this.handleDelete(id)
this.dataSource2 = []
this.currentRoleId = ''
},
handleDelete2: function(id) {
if (!this.url.delete2) {
this.$message.error('Please set url.delete2 property!')
return
})
},
batchDel2: function() {
if (!this.url.deleteBatch2) {
this.$message.error('请设置url.deleteBatch2属性!')
return
}
if (this.selectedRowKeys2.length <= 0) {
this.$message.warning('Please Select An Item')
return
} else {
var ids = ''
for (var a = 0; a < this.selectedRowKeys2.length; a++) {
ids += this.selectedRowKeys2[a] + ','
}
var that = this
deleteAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
} else {
that.$message.warning(res.message)
console.log(this.currentDeptId)
this.$confirm({
title: 'Ensure Unlink',
content: 'Want To Delete Selected Item?',
onOk: function() {
deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then(res => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
})
}
})
},
batchDel2: function() {
if (!this.url.deleteBatch2) {
this.$message.error('Please set rl.deleteBatch2 property!')
return
}
if (this.selectedRowKeys2.length <= 0) {
this.$message.warning('Please select a record')
return
}
},
selectOK(data) {
let params = {}
params.roleId = this.currentRoleId
params.userIdList = []
for (var a = 0; a < data.length; a++) {
params.userIdList.push(data[a])
}
console.log(params)
postAction(this.url.addUserRole, params).then(res => {
if (res.success) {
this.loadData2()
this.$message.success(res.message)
} else {
var ids = ''
for (var a = 0; a < this.selectedRowKeys2.length; a++) {
ids += this.selectedRowKeys2[a] + ','
}
var that = this
console.log(this.currentDeptId)
this.$confirm({
title: 'Confirm unbinding',
content: 'Whether to delete the selected data?',
onOk: function() {
deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
})
}
})
this.$message.warning(res.message)
}
},
selectOK(data) {
let params = {}
params.roleId = this.currentRoleId
params.userIdList = []
for (var a = 0; a < data.length; a++) {
params.userIdList.push(data[a])
}
console.log(params)
postAction(this.url.addUserRole, params).then((res) => {
if (res.success) {
this.loadData2()
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
})
},
handleAddUserRole() {
if (this.currentRoleId == '') {
this.$message.error('Please select a role!')
} else {
this.$refs.selectUserModal.visible = true
}
},
handleOpen(record) {
this.rightcolval = 1
this.selectedRowKeys1 = [record.id]
this.model1 = Object.assign({}, record)
this.currentRoleId = record.id
this.onClearSelected2()
this.loadData2()
},
/*handleEdit: function(record) {
handleAddUserRole() {
if (this.currentRoleId == '') {
this.$message.error('Please Select A Role')
} else {
this.$refs.selectUserModal.visible = true
}
},
handleOpen(record) {
this.rightcolval = 1
this.selectedRowKeys1 = [record.id]
this.model1 = Object.assign({}, record)
this.currentRoleId = record.id
this.onClearSelected2()
this.loadData2()
},
/*handleEdit: function(record) {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
@ -509,37 +505,43 @@
this.$refs.modalForm.title = '编辑'
}
},*/
searchQuery2() {
this.loadData2(1)
},
searchReset2() {
this.queryParam2 = {}
this.loadData2(1)
},
handleTableChange2(pagination, filters, sorter) {
//
//TODO
if (Object.keys(sorter).length > 0) {
this.isorter2.column = sorter.field
this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
}
this.ipagination2 = pagination
this.loadData2()
},
hideUserList(){
//this.rightcolval = 0
this.selectedRowKeys1 = []
},
handlePerssion(roleId){
this.$refs.modalUserRole.show(roleId);
},
searchQuery2() {
this.loadData2(1)
},
searchReset2() {
this.queryParam2 = {}
this.loadData2(1)
},
handleTableChange2(pagination, filters, sorter) {
//
//TODO
if (Object.keys(sorter).length > 0) {
this.isorter2.column = sorter.field
this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
}
this.ipagination2 = pagination
this.loadData2()
},
hideUserList() {
//this.rightcolval = 0
this.selectedRowKeys1 = []
},
handlePerssion(roleId) {
this.$refs.modalUserRole.show(roleId)
}
}
}
</script>
<style scoped>
<style scoped lang="less">
@import '~@assets/less/common.less';
/** Button按钮间距 */
.ant-btn {
margin-left: 8px
/** Button按钮间距 */
.ant-btn {
margin-left: 8px;
}
.btn-group {
img {
margin-right: 12px;
height: 18px;
}
</style>
}
</style>

View File

@ -907,6 +907,7 @@ export default {
font-size: 16px;
flex-shrink: 0;
margin-right: 10px;
user-select: none;
}
}
}

View File

@ -96,28 +96,42 @@ export default {
columns: [
{
title: 'NO',
align: 'center',
width: 100,
align: 'left',
width: 170,
scopedSlots: {
customRender: 'index'
},
customHeaderCell: () => {
return {
style: {
'padding-left': '60px !important'
}
}
},
customCell: () => {
return {
style: {
'padding-left': '60px !important'
}
}
}
},
{
title: 'USER',
align: 'center',
align: 'left',
dataIndex: 'username',
width: 100
width: 170
},
{
title: 'NAME',
align: 'center',
width: 100,
align: 'left',
width: 240,
dataIndex: 'realname'
},
{
title: 'ROLE',
align: 'center',
width: 100,
align: 'left',
width: 190,
dataIndex: 'roles',
scopedSlots: {
customRender: 'roles'
@ -125,8 +139,8 @@ export default {
},
{
title: 'PHONE',
align: 'center',
width: 100,
align: 'left',
width: 95,
dataIndex: 'phone'
}
],
@ -140,7 +154,7 @@ export default {
accountModel: {},
rules: {
username: [{ required: true, message: 'Please Enter User' }],
selectedRoles: [{ required: true, message: 'Please Select Role' , trigger: 'change' }],
selectedRoles: [{ required: true, message: 'Please Select Role', trigger: 'change' }]
}
}
},
@ -253,21 +267,40 @@ export default {
type: 'a-input',
label: 'User',
name: 'username',
span: 4
props: {
style: {
width: '160px'
}
},
style: {
width: 'auto'
}
},
{
type: 'a-input',
label: 'Name',
name: 'realname',
span: 4
props: {
style: {
width: '160px'
}
},
style: {
width: 'auto'
}
},
{
type: 'custom-select',
label: 'Role',
name: 'roleId',
span: 4,
props: {
options: this.roleOptions
options: this.roleOptions,
style: {
width: '160px'
}
},
style: {
width: 'auto'
}
}
]

View File

@ -6,7 +6,7 @@
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
:cancelButtonProps="{ props: { type: 'warn' } }"
>
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
@ -15,39 +15,39 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="itemText"
label="名称">
<a-input placeholder="请输入名称" v-model="model.itemText"/>
label="Name">
<a-input placeholder="Please Enter Name" v-model="model.itemText"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="itemValue"
label="数据值">
<a-input placeholder="请输入数据值" v-model="model.itemValue" />
label="Item Value">
<a-input placeholder="Please Enter Item Value" v-model="model.itemValue" />
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="描述">
label="Description">
<a-input v-model="model.description" />
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="排序值">
label="Sort">
<a-input-number :min="1" v-model="model.sortOrder" />
值越小越靠前
The Smaller The Value, the More Advanced
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="是否启用"
label="Enable"
hasFeedback>
<a-switch checkedChildren="启用" unCheckedChildren="禁用" @change="onChose" v-model="visibleCheck"/>
<a-switch checkedChildren="Enable" unCheckedChildren="Disable" @change="onChose" v-model="visibleCheck"/>
</a-form-model-item>
</a-form-model>
@ -80,8 +80,8 @@
},
confirmLoading: false,
validatorRules: {
itemText: [{required: true, message: '请输入名称!'}],
itemValue: [{required: true, message: '请输入数据值!'},{validator: this.validateItemValue}],
itemText: [{required: true, message: 'Please Enter Name'}],
itemValue: [{required: true, message: 'Please Enter Item Value'},{validator: this.validateItemValue}],
},
}
},
@ -166,7 +166,7 @@
if(value){
let reg=new RegExp("[`~!@#$^&*()=|{}'.<>《》/?!¥()—【】‘;:”“。,、?]")
if(reg.test(value)){
callback("数据值不能包含特殊字符!")
callback("Cannot Have Special Charactors")
}else{
//update--begin--autor:lvdandan-----date:20201203------forJT-27 -
getAction("/sys/dictItem/dictItemCheck",param).then((res)=>{

View File

@ -6,7 +6,7 @@
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
:cancelButtonProps="{ props: { type: 'warn' } }"
>
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
@ -16,8 +16,8 @@
:wrapperCol="wrapperCol"
prop="dictName"
required
label="字典名称">
<a-input placeholder="请输入字典名称" v-model="model.dictName"/>
label="Dict Name">
<a-input placeholder="Please Enter Dict Name" v-model="model.dictName"/>
</a-form-model-item>
<a-form-model-item
@ -25,14 +25,14 @@
:wrapperCol="wrapperCol"
prop="dictCode"
required
label="字典编码">
<a-input placeholder="请输入字典编码" v-model="model.dictCode"/>
label="Dict Code">
<a-input placeholder="Please Enter Dict Code" v-model="model.dictCode"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="描述">
label="Description">
<a-input v-model="model.description"/>
</a-form-model-item>
@ -63,9 +63,9 @@
},
confirmLoading: false,
validatorRules: {
dictName: [{ required: true, message: '请输入字典名称!' }],
dictName: [{ required: true, message: 'Please Enter Dict Name' }],
dictCode: [
{ required: true, message: '请输入字典编码!' },
{ required: true, message: 'Please Enter Dict Code' },
{ validator: this.validateDictCode }]
}
}

View File

@ -6,7 +6,8 @@
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
:cancelButtonProps="{ props: { type: 'warn' } }"
cancelText="Cancel">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
@ -15,39 +16,39 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="ruleName"
label="规则名称">
<a-input placeholder="请输入规则名称" v-model="model.ruleName"/>
label="Rule Name">
<a-input placeholder="Please Enter Rule Name" v-model="model.ruleName"/>
</a-form-model-item>
<a-form-model-item
v-show="showRuleColumn"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="ruleColumn"
label="规则字段">
<a-input placeholder="请输入规则字段" v-model.trim="model.ruleColumn"/>
label="Rule Column">
<a-input placeholder="Please Enter Rule Column" v-model.trim="model.ruleColumn"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="ruleConditions"
label="条件规则">
<j-dict-select-tag @input="handleChangeRuleCondition" v-model="model.ruleConditions" placeholder="请输入条件规则" dictCode="rule_conditions"/>
label="Rule Conditions">
<j-dict-select-tag @input="handleChangeRuleCondition" v-model="model.ruleConditions" placeholder="Please Enter Rule Conditions" dictCode="rule_conditions"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="ruleValue"
label="规则值">
<a-input placeholder="请输入规则值" v-model="model.ruleValue"/>
label="Rule Value">
<a-input placeholder="Please Enter Rule Value" v-model="model.ruleValue"/>
</a-form-model-item>
<a-form-model-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="状态">
label="Status">
<a-radio-group buttonStyle="solid" v-model="model.status">
<a-radio-button value="1">有效</a-radio-button>
<a-radio-button value="0">无效</a-radio-button>
<a-radio-button value="1">Valid</a-radio-button>
<a-radio-button value="0">Invalid</a-radio-button>
</a-radio-group>
</a-form-model-item>

View File

@ -10,11 +10,11 @@
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item label="菜单类型" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<a-form-model-item label="Menu Type" :labelCol="labelCol" :wrapperCol="wrapperCol" >
<a-radio-group @change="onChangeMenuType" v-model="model.menuType">
<a-radio :value="0">一级菜单</a-radio>
<a-radio :value="1">子菜单</a-radio>
<a-radio :value="2">按钮/权限</a-radio>
<a-radio :value="0">First Level Menu</a-radio>
<a-radio :value="1">Child Menu</a-radio>
<a-radio :value="2">Button/Permission</a-radio>
</a-radio-group>
</a-form-model-item>
@ -24,25 +24,25 @@
:label="menuLabel"
prop="name"
hasFeedback >
<a-input placeholder="请输入菜单名称" v-model="model.name" :readOnly="disableSubmit"/>
<a-input v-model="model.name" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
v-show="model.menuType!=0"
label="上级菜单"
label="Parent Menu"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:validate-status="validateStatus"
:hasFeedback="true"
:required="true">
<span slot="help">{{ validateStatus=='error'?'请选择上级菜单':'&nbsp;&nbsp;' }}</span>
<span slot="help">{{ validateStatus=='error'?'Please Select Parent Menu':'&nbsp;&nbsp;' }}</span>
<a-tree-select
style="width:100%"
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
:treeData="treeData"
v-model="model.parentId"
placeholder="请选择父级菜单"
placeholder="Please Select Parent Menu"
:disabled="disableSubmit"
@change="handleParentIdChange">
</a-tree-select>
@ -52,8 +52,8 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="url"
label="菜单路径">
<a-input placeholder="请输入菜单路径" v-model="model.url" :readOnly="disableSubmit"/>
label="Menu Route">
<a-input v-model="model.url" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
@ -61,16 +61,16 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="component"
label="前端组件">
<a-input placeholder="请输入前端组件" v-model="model.component" :readOnly="disableSubmit"/>
label="Component">
<a-input v-model="model.component" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
v-show="model.menuType==0"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="默认跳转地址">
<a-input placeholder="请输入路由参数 redirect" v-model="model.redirect" :readOnly="disableSubmit"/>
label="Redirect Params">
<a-input v-model="model.redirect" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
@ -78,16 +78,16 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="perms"
label="授权标识">
<a-input placeholder="请输入授权标识, 如: user:list" v-model="model.perms" :readOnly="disableSubmit"/>
label="Perms">
<a-input placeholder="Enter Perms, like: user:list" v-model="model.perms" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
v-show="!show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="授权策略">
<j-dict-select-tag v-model="model.permsType" placeholder="请选择授权策略" :type="'radio'" dictCode="global_perms_type"/>
label="Auth Category">
<j-dict-select-tag v-model="model.permsType" :type="'radio'" dictCode="global_perms_type"/>
</a-form-model-item>
@ -95,8 +95,8 @@
v-show="!show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="状态">
<j-dict-select-tag v-model="model.status" placeholder="请选择状态" :type="'radio'" dictCode="valid_status"/>
label="Status">
<j-dict-select-tag v-model="model.status" :type="'radio'" dictCode="valid_status"/>
</a-form-model-item>
@ -104,8 +104,8 @@
v-show="show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="菜单图标">
<a-input placeholder="点击选择图标" v-model="model.icon" :readOnly="disableSubmit">
label="Icon">
<a-input placeholder="Click Select Icon" v-model="model.icon" :readOnly="disableSubmit">
<a-icon slot="addonAfter" type="setting" @click="selectIcons" />
</a-input>
</a-form-model-item>
@ -115,32 +115,32 @@
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="sortNo"
label="排序">
<a-input-number placeholder="请输入菜单排序" v-model="model.sortNo" style="width: 200px" :readOnly="disableSubmit"/>
label="Sort">
<a-input-number v-model="model.sortNo" style="width: 200px" :readOnly="disableSubmit"/>
</a-form-model-item>
<a-form-model-item
v-show="show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="是否路由菜单">
<a-switch checkedChildren="是" unCheckedChildren="否" v-model="model.route"/>
label="Is Route Menu">
<a-switch checkedChildren="Yes" unCheckedChildren="No" v-model="model.route"/>
</a-form-model-item>
<a-form-model-item
v-show="show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="隐藏路由">
<a-switch checkedChildren="是" unCheckedChildren="否" v-model="model.hidden"/>
label="Hidden">
<a-switch checkedChildren="Yes" unCheckedChildren="No" v-model="model.hidden"/>
</a-form-model-item>
<a-form-model-item
v-show="show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="是否缓存路由">
<a-switch checkedChildren="是" unCheckedChildren="否" v-model="model.keepAlive"/>
label="Keep Alive">
<a-switch checkedChildren="Yes" unCheckedChildren="No" v-model="model.keepAlive"/>
</a-form-model-item>
@ -148,16 +148,16 @@
v-show="show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="聚合路由">
<a-switch checkedChildren="是" unCheckedChildren="否" v-model="model.alwaysShow"/>
label="Combine Route">
<a-switch checkedChildren="Yes" unCheckedChildren="No" v-model="model.alwaysShow"/>
</a-form-model-item>
<a-form-model-item
v-show="show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="打开方式">
<a-switch checkedChildren="外部" unCheckedChildren="内部" v-model="model.internalOrExternal"/>
label="Open Type">
<a-switch checkedChildren="External" unCheckedChildren="Internal" v-model="model.internalOrExternal"/>
</a-form-model-item>
</a-form-model>
@ -166,10 +166,10 @@
<icons @choose="handleIconChoose" @close="handleIconCancel" :iconChooseVisible="iconChooseVisible"></icons>
</a-spin>
<a-row :style="{textAlign:'right'}">
<a-button :style="{marginRight: '8px'}" @click="handleCancel">
关闭
<a-button :style="{marginRight: '8px'}" @click="handleCancel" type="warn">
Cancel
</a-button>
<a-button :disabled="disableSubmit" @click="handleOk" type="primary">确定</a-button>
<a-button :disabled="disableSubmit" @click="handleOk" type="primary">Ok</a-button>
</a-row>
</div>
</a-drawer>
@ -191,7 +191,7 @@
disableSubmit:false,
model: {},
show:true,//
menuLabel:'菜单名称',
menuLabel:'Menu Name',
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
@ -208,11 +208,11 @@
computed:{
validatorRules:function() {
return {
name:[{ required: true, message: '请输入菜单标题!' }],
component:[{ required: this.show, message: '请输入前端组件!' }],
url: [{ required: this.show, message: '请输入菜单路径!' }],
permsType: [{ required: true, message: '请输入授权策略!' }],
perms:[{ required: false, message: '请输入授权标识!' },{validator: this.validatePerms }]
name:[{ required: true, message: 'Please Enter Menu Name' }],
component:[{ required: this.show, message: 'Please Enter Component' }],
url: [{ required: this.show, message: 'Plaase Enter Route Path' }],
permsType: [{ required: true, message: 'Please Enter Auth Category' }],
perms:[{ required: false, message: 'Please Enter Perms' },{validator: this.validatePerms }]
}
}
},
@ -245,7 +245,7 @@
//
console.log('record: ',record)
this.show = record.menuType==2?false:true;
this.menuLabel = record.menuType==2?'按钮/权限':'菜单名称';
this.menuLabel = record.menuType==2?'Button/Permission':'Menu Name';
this.visible = true;
this.loadTree();
@ -263,7 +263,7 @@
if (valid) {
if ((this.model.menuType == 1 || this.model.menuType == 2) && !this.model.parentId) {
that.validateStatus = 'error';
that.$message.error("请检查你填的类型以及信息是否正确!");
that.$message.error("Please Check The Form");
return;
} else {
that.validateStatus = 'success';
@ -298,7 +298,7 @@
if(!value || new RegExp(/^[0-9]*[1-9][0-9]*$/).test(value)){
callback();
}else{
callback("请输入正整数!");
callback("Please Enter Positive Integer");
}
},
validatePerms(rule, value, callback){
@ -314,7 +314,7 @@
if (res.success) {
callback()
} else {
callback("授权标识已存在!")
callback("Perms Already Exist")
}
})
}else{
@ -324,10 +324,10 @@
onChangeMenuType(e) {
if(this.model.menuType == 2){
this.show = false;
this.menuLabel = '按钮/权限';
this.menuLabel = 'Menu/Permission';
}else{
this.show = true;
this.menuLabel = '菜单名称';
this.menuLabel = 'Menu Name';
}
//update-begin---author:wangshuai ---date:20220729 for[VUEN-1834]------------

View File

@ -1,29 +1,27 @@
<template>
<a-modal
<custom-modal
:title="title"
:width="800"
:visible="visible"
v-model="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭"
:okHandler="handleOk"
wrapClassName="ant-modal-cust-warp"
style="top:5%;height: 85%;overflow-y: hidden">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" v-bind="layout" :model="model" :rules="validatorRules">
<a-form-model-item label="角色编码" required prop="roleCode">
<a-input v-model="model.roleCode" :disabled="roleDisabled" placeholder="请输入角色编码"/>
<a-form-model-item label="Role Code" required prop="roleCode">
<a-input v-model="model.roleCode" :disabled="roleDisabled" />
</a-form-model-item>
<a-form-model-item label="角色名称" required prop="roleName">
<a-input v-model="model.roleName" placeholder="请输入角色名称"/>
<a-form-model-item label="Role Name" required prop="roleName">
<a-input v-model="model.roleName" />
</a-form-model-item>
<a-form-model-item label="描述" prop="description">
<a-textarea :rows="5" v-model="model.description" placeholder="请输入角色描述"/>
<a-form-model-item label="Description" prop="description">
<a-textarea :rows="5" v-model="model.description" />
</a-form-model-item>
</a-form-model>
</a-spin>
</a-modal>
</custom-modal>
</template>
<script>
@ -43,16 +41,16 @@
confirmLoading: false,
validatorRules:{
roleName: [
{ required: true, message: '请输入角色名称!' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
{ required: true, message: 'Role Name Required' },
{ min: 2, max: 30, message: 'Length Between 2 And 30 Charactors', trigger: 'blur' }
],
roleCode: [
{ required: true, message: '请输入角色名称!'},
{ min: 0, max: 64, message: '长度不超过 64 个字符', trigger: 'blur' },
{ required: true, message: 'Role Code Required'},
{ min: 0, max: 64, message: 'Not More Than 64 Charactors', trigger: 'blur' },
{ validator: this.validateRoleCode}
],
description: [
{ min: 0, max: 126, message: '长度不超过 126 个字符', trigger: 'blur' }
{ min: 0, max: 126, message: 'Not More Than 126 Charactors', trigger: 'blur' }
]
},
}
@ -80,37 +78,30 @@
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let obj;
if(!this.model.id){
obj=addRole(this.model);
}else{
obj=editRole(this.model);
}
obj.then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}else{
return false;
async handleOk () {
await this.$refs.form.validate()
this.confirmLoading = true;
let obj;
if(!this.model.id){
obj = addRole(this.model);
} else {
obj = editRole(this.model);
}
try {
const res = await obj
if(res.success) {
this.$message.success(res.message);
this.$emit('ok');
} else{
this.$message.warning(res.message);
}
})
},
handleCancel () {
this.close()
} catch (error) {
return Promise.reject()
} finally {
this.confirmLoading = false;
}
},
validateRoleCode(rule, value, callback){
if(/[\u4E00-\u9FA5]/g.test(value)){
callback("角色编码不可输入汉字!");

View File

@ -7,7 +7,8 @@
:visible="visible"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
:cancelButtonProps="{ props: { type: 'warn' } }"
cancelText="Cancel">
<!-- 查询区域 -->
@ -16,14 +17,14 @@
<a-row :gutter="24">
<a-col :span="10">
<a-form-item label="用户账号">
<a-input placeholder="请输入用户账号" v-model="queryParam.username"></a-input>
<a-form-item label="User Name">
<a-input v-model="queryParam.username"></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a-button type="primary" @click="searchQuery" icon="search">Search</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">Reset</a-button>
</span>
</a-col>
@ -61,7 +62,7 @@
name: "SelectUserModal",
data() {
return {
title: "添加已有用户",
title: "Add From List",
names: [],
visible: false,
placement: 'right',
@ -81,31 +82,31 @@
}
},
{
title: '用户账号',
title: 'User Name',
align: "center",
width: 100,
dataIndex: 'username'
},
{
title: '用户名称',
title: 'Real Name',
align: "center",
width: 100,
dataIndex: 'realname'
},
{
title: '性别',
title: 'Gender',
align: "center",
width: 100,
dataIndex: 'sex_dictText'
},
{
title: '电话',
title: 'Phone',
align: "center",
width: 100,
dataIndex: 'phone'
},
{
title: '部门',
title: 'Org',
align: "center",
width: 150,
dataIndex: 'orgCode'
@ -113,18 +114,18 @@
],
columns2: [
{
title: '用户账号',
title: 'User Name',
align: "center",
dataIndex: 'username',
},
{
title: '用户名称',
title: 'Real Name',
align: "center",
dataIndex: 'realname',
},
{
title: '操作',
title: 'Action',
dataIndex: 'action',
align: "center",
width: 100,
@ -140,7 +141,8 @@
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条"
const { current, pageSize } = this.ipagination
return `Total ${total} items Page ${current} / ${Math.ceil(total / pageSize)}`
},
showQuickJumper: true,
showSizeChanger: true,

View File

@ -22,105 +22,101 @@
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="username">
<a-input placeholder="请输入用户账号" v-model="model.username" :readOnly="!!model.id"/>
<a-form-model-item label="User Name" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="username">
<a-input v-model="model.username" :readOnly="!!model.id"/>
</a-form-model-item>
<template v-if="!model.id">
<a-form-model-item label="登录密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="password" >
<a-input type="password" placeholder="请输入登录密码" v-model="model.password" />
<a-form-model-item label="Password" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="password" >
<a-input type="password" v-model="model.password" />
</a-form-model-item>
<a-form-model-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmpassword" >
<a-input type="password" @blur="handleConfirmBlur" placeholder="请重新输入登录密码" v-model="model.confirmpassword"/>
<a-form-model-item label="Confirm Password" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmpassword" >
<a-input type="password" @blur="handleConfirmBlur" v-model="model.confirmpassword"/>
</a-form-model-item>
</template>
<a-form-model-item label="用户姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realname">
<a-input placeholder="请输入用户姓名" v-model="model.realname" />
<a-form-model-item label="Real Name" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realname">
<a-input v-model="model.realname" />
</a-form-model-item>
<a-form-model-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workNo">
<a-input placeholder="请输入工号" v-model="model.workNo" />
<a-form-model-item label="Work No" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workNo">
<a-input v-model="model.workNo" />
</a-form-model-item>
<a-form-model-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
<a-input placeholder="请输入手机号码" v-model="model.phone" />
<a-form-model-item label="Phone" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
<a-input v-model="model.phone" />
</a-form-model-item>
<a-form-model-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-select-position placeholder="请选择职务" :multiple="false" v-model="model.post"/>
<a-form-model-item label="Post" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-select-position :multiple="false" v-model="model.post"/>
</a-form-model-item>
<a-form-model-item label="角色分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!roleDisabled" >
<a-form-model-item label="Role" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!roleDisabled" >
<j-multi-select-tag
:disabled="disableSubmit"
v-model="model.selectedroles"
:options="rolesOptions"
placeholder="请选择角色">
:options="rolesOptions">
</j-multi-select-tag>
</a-form-model-item>
<!--部门分配-->
<a-form-model-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
<a-form-model-item label="Department" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
<j-select-depart v-model="model.selecteddeparts" :multi="true" @back="backDepartInfo" :backDepart="true" :treeOpera="true">></j-select-depart>
</a-form-model-item>
<!--租户分配-->
<a-form-model-item label="租户分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
<a-form-model-item label="Tenant" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
<j-multi-select-tag
:disabled="disableSubmit"
v-model="model.relTenantIds"
:options="tenantsOptions"
placeholder="请选择租户">
:options="tenantsOptions">
</j-multi-select-tag>
</a-form-model-item>
<a-form-model-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form-model-item label="Identity" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-model="model.userIdentity" @change="identityChange">
<a-radio :value="1">普通用户</a-radio>
<a-radio :value="2">上级</a-radio>
<a-radio :value="1">Ordinary</a-radio>
<a-radio :value="2">High Level</a-radio>
</a-radio-group>
</a-form-model-item>
<a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="departIdShow==true">
<a-form-model-item label="InCharge Department" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="departIdShow==true">
<j-multi-select-tag
:disabled="disableSubmit"
v-model="model.departIds"
:options="nextDepartOptions"
placeholder="请选择负责部门">
:options="nextDepartOptions">
</j-multi-select-tag>
</a-form-model-item>
<a-form-model-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-image-upload class="avatar-uploader" text="上传" v-model="model.avatar" ></j-image-upload>
<a-form-model-item label="Avatar" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-image-upload class="avatar-uploader" text="Upload" v-model="model.avatar" ></j-image-upload>
</a-form-model-item>
<a-form-model-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form-model-item label="Birthday" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-date-picker
style="width: 100%"
placeholder="请选择生日"
v-model="model.birthday"
:format="dateFormat"
:getCalendarContainer="node => node.parentNode"/>
</a-form-model-item>
<a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="model.sex" placeholder="请选择性别" :getPopupContainer= "(target) => target.parentNode">
<a-select-option :value="1"></a-select-option>
<a-select-option :value="2"></a-select-option>
<a-form-model-item label="Gender" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="model.sex" :getPopupContainer= "(target) => target.parentNode">
<a-select-option :value="1">Man</a-select-option>
<a-select-option :value="2">Women</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="email">
<a-input placeholder="请输入邮箱" v-model="model.email" />
<a-form-model-item label="Email" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="email">
<a-input v-model="model.email" />
</a-form-model-item>
<a-form-model-item label="座机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="telephone">
<a-input placeholder="请输入座机" v-model="model.telephone" />
<a-form-model-item label="Telephone" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="telephone">
<a-input v-model="model.telephone" />
</a-form-model-item>
<a-form-model-item label="工作流引擎" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="model.activitiSync" placeholder="请选择是否同步工作流引擎" :type="'radio'" dictCode="activiti_sync"/>
<a-form-model-item label="Sync Work Flow" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="model.activitiSync" :type="'radio'" dictCode="activiti_sync"/>
</a-form-model-item>
</a-form-model>
@ -128,10 +124,10 @@
<div class="drawer-bootom-button" v-show="!disableSubmit">
<a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消">
<a-button style="margin-right: .8rem">取消</a-button>
<a-popconfirm title="Cancel Edit?" @confirm="handleCancel" :cancelButtonProps="{ props: { type: 'warn' } }">
<a-button style="margin-right: .8rem" type="warn">Cancel</a-button>
</a-popconfirm>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">提交</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">Submit</a-button>
</div>
</a-drawer>
</template>
@ -181,7 +177,7 @@
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },

View File

@ -10,7 +10,7 @@
style="overflow: auto;padding-bottom: 53px;">
<a-form>
<a-form-item label='所拥有的权限'>
<a-form-item label='Role Permissions'>
<a-tree
checkable
@check="onCheck"
@ -31,22 +31,22 @@
<div class="drawer-bootom-button">
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
<a-menu-item key="1" @click="switchCheckStrictly(1)">Father And Son Link</a-menu-item>
<a-menu-item key="2" @click="switchCheckStrictly(2)">Unlink</a-menu-item>
<a-menu-item key="3" @click="checkALL">Select All</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">Deselect All</a-menu-item>
<a-menu-item key="5" @click="expandAll">Expand All</a-menu-item>
<a-menu-item key="6" @click="closeAll">Merge All</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
<a-button type="primary">
Tree Action <a-icon type="up" />
</a-button>
</a-dropdown>
<a-popconfirm title="确定放弃编辑?" @confirm="close" okText="确定" cancelText="取消">
<a-button style="margin-right: .8rem">取消</a-button>
<a-popconfirm title="Cancel Edit" @confirm="close" okText="Ok" cancelText="Cancel" :cancelButtonProps="{ props: { type: 'warn' } }">
<a-button style="margin-right: .8rem" type="warn">Cancel</a-button>
</a-popconfirm>
<a-button @click="handleSubmit(false)" type="primary" :loading="loading" ghost style="margin-right: 0.8rem">仅保存</a-button>
<a-button @click="handleSubmit(true)" type="primary" :loading="loading">保存并关闭</a-button>
<a-button @click="handleSubmit(false)" type="primary" :loading="loading" ghost style="margin-right: 0.8rem">Save Only</a-button>
<a-button @click="handleSubmit(true)" type="primary" :loading="loading">Save And Close</a-button>
</div>
<role-datarule-modal ref="datarule"></role-datarule-modal>
@ -73,7 +73,7 @@
allTreeKeys:[],
autoExpandParent: true,
checkStrictly: true,
title:"角色权限配置",
title:"Role Permission Setting",
visible: false,
loading: false,
selectedKeys:[]

View File

@ -96,45 +96,59 @@ import { getAction } from '../../api/manage'
const columns = [
{
title: 'NO',
align: 'center',
align: 'left',
width: 100,
scopedSlots: {
customRender: 'index'
},
customHeaderCell: () => {
return {
style: {
'padding-left': '60px !important'
}
}
},
customCell: () => {
return {
style: {
'padding-left': '60px !important'
}
}
}
},
{
title: 'STATION ID',
align: 'center',
align: 'left',
dataIndex: 'stationId',
width: 100
},
{
title: 'STATION CODE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'stationCode'
},
{
title: 'COUNTRY CODE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'countryCode'
},
{
title: 'TYPE',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'type'
},
{
title: 'LON',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'lon'
},
{
title: 'LAT',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'lat'
},
@ -146,11 +160,12 @@ const columns = [
{
title: 'DESCRIPTION',
width: 100,
dataIndex: 'description'
dataIndex: 'description',
ellipsis: true
},
{
title: 'STATUS',
align: 'center',
align: 'left',
width: 100,
dataIndex: 'status'
}
@ -264,10 +279,13 @@ export default {
options: this.countryCodeList,
allowClear: true,
showSearch: true,
filterOption: this.filterOption
filterOption: this.filterOption,
style: {
width: '261px'
}
},
style: {
width: '310px'
width: 'auto'
}
},
{
@ -278,10 +296,13 @@ export default {
options: this.typeList,
allowClear: true,
showSearch: true,
filterOption: this.filterOption
filterOption: this.filterOption,
style: {
width: '261px'
}
},
style: {
width: '310px'
width: 'auto'
}
},
{
@ -292,10 +313,13 @@ export default {
dictCode: 'STATION_STATUS',
getPopupContainer: () => {
return document.body
},
style: {
width: '261px'
}
},
style: {
width: '310px'
width: 'auto'
}
}
]