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-button v-for="(item, key) in dictOptions" :key="key" :value="item.value">{{ item.text }}</a-radio-button>
</a-radio-group> </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="" /> <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"> <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 "> <span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
{{ item.text || item.label }} {{ item.text || item.label }}
@ -32,6 +31,10 @@
getPopupContainer:{ getPopupContainer:{
type: Function, type: Function,
default: (node) => node.parentNode default: (node) => node.parentNode
},
allowClear: {
type: Boolean,
default: true
} }
}, },
data() { data() {

View File

@ -1,13 +1,14 @@
<template> <template>
<j-modal <j-modal
centered centered
:title="name + '选择'" :title="name + 'Select'"
:width="width" :width="width"
:visible="visible" :visible="visible"
switchFullscreen switchFullscreen
@ok="handleOk" @ok="handleOk"
@cancel="close" @cancel="close"
cancelText="关闭"> :cancelButtonProps="{ props: { type: 'warn' } }"
cancelText="Cancel">
<a-row :gutter="18"> <a-row :gutter="18">
<a-col :span="16"> <a-col :span="16">
@ -15,15 +16,15 @@
<a-form layout="inline" class="j-inline-form"> <a-form layout="inline" class="j-inline-form">
<!-- 固定条件 --> <!-- 固定条件 -->
<a-form-item :label="(queryParamText||name)"> <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> </a-form-item>
<!-- 动态生成的查询条件 --> <!-- 动态生成的查询条件 -->
<j-select-biz-query-item v-if="queryConfig.length>0" v-show="showMoreQueryItems" :queryParam="queryParam" :queryConfig="queryConfig" @pressEnter="searchQuery"/> <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="searchQuery" icon="search">Search</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</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"> <a v-if="queryConfig.length>0" @click="showMoreQueryItems=!showMoreQueryItems" style="margin-left: 8px">
{{ showMoreQueryItems ? '收起' : '展开' }} {{ showMoreQueryItems ? 'Shrink' : 'Expand' }}
<a-icon :type="showMoreQueryItems ? 'up' : 'down'"/> <a-icon :type="showMoreQueryItems ? 'up' : 'down'"/>
</a> </a>
</a-form> </a-form>
@ -44,11 +45,11 @@
</a-col> </a-col>
<a-col :span="8"> <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"> <a-table size="middle" :rowKey="rowKey" bordered v-bind="selectedTable">
<span slot="action" slot-scope="text, record, index"> <span slot="action" slot-scope="text, record, index">
<a @click="handleDeleteSelected(record, index)">删除</a> <a @click="handleDeleteSelected(record, index)">Delete</a>
</span> </span>
</a-table> </a-table>
@ -152,7 +153,7 @@
...this.columns[0], ...this.columns[0],
width: this.columns[0].widthRight || this.columns[0].width, 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: [], dataSource: [],
}, },
@ -164,7 +165,8 @@
pageSize: 5, pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30'], pageSizeOptions: ['5', '10', '20', '30'],
showTotal: (total, range) => { 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, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@ import onlineCommons from '@jeecg/antd-online-mini'
export function timeFix() { export function timeFix() {
const time = new Date() const time = new Date()
const hour = time.getHours() 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() { export function welcome() {

View File

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

View File

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

View File

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

View File

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

View File

@ -43,6 +43,7 @@
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:scroll="{ y: 'calc(100vh - 400px)' }"
@change="handleTableChange"> @change="handleTableChange">
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)"> <a @click="handleEdit(record)">
@ -52,7 +53,7 @@
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a @click="editDictItem(record)"><a-icon type="setting"/> EditDict</a> <a @click="editDictItem(record)"><a-icon type="setting"/> EditDict</a>
<a-divider type="vertical"/> <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>Delete</a>
</a-popconfirm> </a-popconfirm>
</span> </span>

View File

@ -15,19 +15,13 @@
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <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 <a-table
:columns="columns" :columns="columns"
size="middle" size="middle"
:pagination="false" :pagination="false"
:dataSource="dataSource" :dataSource="dataSource"
:loading="loading" :loading="loading"
:scroll="{ y: 'calc(100vh - 285px)'}"
@expand="expandSubmenu" @expand="expandSubmenu"
:expandedRowKeys="expandedRowKeys" :expandedRowKeys="expandedRowKeys"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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