Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2022-11-28 17:00:20 +08:00
commit 6b5bc5fedd
17 changed files with 201 additions and 146 deletions

View File

@ -121,6 +121,8 @@ public class ChartViewService {
private static final Logger logger = LoggerFactory.getLogger(ChartViewService.class); private static final Logger logger = LoggerFactory.getLogger(ChartViewService.class);
private static final String START_END_SEPARATOR = "_START_END_SPLIT";
//默认使用非公平 //默认使用非公平
private ReentrantLock lock = new ReentrantLock(); private ReentrantLock lock = new ReentrantLock();
@ -705,6 +707,9 @@ public class ChartViewService {
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() { List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {
}.getType()); }.getType());
for (String parameter : Optional.ofNullable(request.getParameters()).orElse(new ArrayList<>())) { for (String parameter : Optional.ofNullable(request.getParameters()).orElse(new ArrayList<>())) {
if (StringUtils.endsWith(parameter, START_END_SEPARATOR)) {
parameter = parameter.split(START_END_SEPARATOR)[0];
}
if (sqlVariables.stream().map(SqlVariableDetails::getVariableName).collect(Collectors.toList()).contains(parameter)) { if (sqlVariables.stream().map(SqlVariableDetails::getVariableName).collect(Collectors.toList()).contains(parameter)) {
hasParameters = true; hasParameters = true;
} }
@ -1707,8 +1712,8 @@ public class ChartViewService {
String paramName = null; String paramName = null;
if (parameterArray.length > 1) { if (parameterArray.length > 1) {
paramName = parameterArray[1]; paramName = parameterArray[1];
if (paramName.contains("_START_END_SPLIT")) { if (paramName.contains(START_END_SEPARATOR)) {
String[] paramNameArray = paramName.split("_START_END_SPLIT"); String[] paramNameArray = paramName.split(START_END_SEPARATOR);
paramName = paramNameArray[0]; paramName = paramNameArray[0];
isEndParam = true; isEndParam = true;
} }

View File

@ -1012,7 +1012,7 @@ public class ChartDataBuild {
switch (columnPermissionItem.getDesensitizationRule().getCustomBuiltInRule()) { switch (columnPermissionItem.getDesensitizationRule().getCustomBuiltInRule()) {
case RetainBeforeMAndAfterN: case RetainBeforeMAndAfterN:
if (StringUtils.isEmpty(originStr) || originStr.length() < columnPermissionItem.getDesensitizationRule().getM() + columnPermissionItem.getDesensitizationRule().getN() + 1) { if (StringUtils.isEmpty(originStr) || originStr.length() < columnPermissionItem.getDesensitizationRule().getM() + columnPermissionItem.getDesensitizationRule().getN() + 1) {
desensitizationStr = String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getM(), "X")) + "***" + Collections.nCopies(columnPermissionItem.getDesensitizationRule().getN(), "X"); desensitizationStr = String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getM(), "X")) + "***" + String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getN(), "X"));
} else { } else {
desensitizationStr = StringUtils.substring(originStr, 0, columnPermissionItem.getDesensitizationRule().getM() - 1) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN(), originStr.length() - 1); desensitizationStr = StringUtils.substring(originStr, 0, columnPermissionItem.getDesensitizationRule().getM() - 1) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN(), originStr.length() - 1);
} }
@ -1030,7 +1030,7 @@ public class ChartDataBuild {
desensitizationStr = "***" + StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, columnPermissionItem.getDesensitizationRule().getN()) + "***"; desensitizationStr = "***" + StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, columnPermissionItem.getDesensitizationRule().getN()) + "***";
break; break;
} }
if (originStr.length() >= columnPermissionItem.getDesensitizationRule().getN() && originStr.length() < columnPermissionItem.getDesensitizationRule().getN()) { if (originStr.length() >= columnPermissionItem.getDesensitizationRule().getM() && originStr.length() < columnPermissionItem.getDesensitizationRule().getN()) {
desensitizationStr = "***" + StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, originStr.length()); desensitizationStr = "***" + StringUtils.substring(originStr, columnPermissionItem.getDesensitizationRule().getM() - 1, originStr.length());
} }
break; break;

View File

@ -41,7 +41,14 @@ ALTER TABLE `panel_group`
ADD COLUMN `panel_sort` bigint(13) NULL COMMENT '排序' AFTER `watermark_open`; ADD COLUMN `panel_sort` bigint(13) NULL COMMENT '排序' AFTER `watermark_open`;
ALTER TABLE `sys_task_email` ALTER TABLE `sys_task_email`
CHANGE COLUMN `content` `content` MEDIUMBLOB NULL DEFAULT NULL COMMENT '内容' ; CHANGE COLUMN `content` `content` MEDIUMBLOB NULL DEFAULT NULL COMMENT '内容';
ALTER TABLE `dataset_table_field` ALTER TABLE `dataset_table_field`
ADD COLUMN `date_format_type` VARCHAR(255) NULL COMMENT '时间格式类型' AFTER `date_format`; ADD COLUMN `date_format_type` VARCHAR(255) NULL COMMENT '时间格式类型' AFTER `date_format`;
update panel_app_template
set name ='JumpServer 运维安全审计大屏'
where id = '3986ba4c-5a8e-11ed-bc5b-cf4a43b3b40c';
update `my_plugin` set `name` = '气泡地图插件' where `plugin_id` = 2;

View File

@ -653,7 +653,12 @@ export default {
}, },
clearPanelLinkage(param) { clearPanelLinkage(param) {
if (param.viewId === 'all' || param.viewId === this.element.propValue.viewId) { if (param.viewId === 'all' || param.viewId === this.element.propValue.viewId) {
this.$refs[this.element.propValue.id].reDrawView() try {
this.$refs[this.element.propValue.id].reDrawView()
} catch (e) {
console.error('reDrawView-error', this.element.propValue.id)
}
} }
}, },
bindPluginEvent() { bindPluginEvent() {

View File

@ -651,6 +651,7 @@ export default {
input_password: 'Please input a password', input_password: 'Please input a password',
input_phone: 'Please enter the phone number', input_phone: 'Please enter the phone number',
input_roles: 'Please select role', input_roles: 'Please select role',
user_name_pattern_error: 'IDs can only contain alphanumeric and ._- and start with a letter!',
special_characters_are_not_supported: 'Special characters are not supported', special_characters_are_not_supported: 'Special characters are not supported',
mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number', mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number',
email_format_is_incorrect: 'The mailbox format is incorrect', email_format_is_incorrect: 'The mailbox format is incorrect',
@ -806,6 +807,7 @@ export default {
edite_organization: 'Edit organization' edite_organization: 'Edit organization'
}, },
system_parameter_setting: { system_parameter_setting: {
edit_success: 'Edit success',
mailbox_service_settings: 'Mail Setting', mailbox_service_settings: 'Mail Setting',
test_connection: 'Test connection', test_connection: 'Test connection',
SMTP_host: 'SMTP Host', SMTP_host: 'SMTP Host',

View File

@ -652,6 +652,7 @@ export default {
input_roles: '請選擇角色', input_roles: '請選擇角色',
select_users: '請選擇用戶', select_users: '請選擇用戶',
select_gender: '請選擇性別', select_gender: '請選擇性別',
user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母开头!',
special_characters_are_not_supported: '不支持特殊字符', special_characters_are_not_supported: '不支持特殊字符',
mobile_number_format_is_incorrect: '手機號碼格式不正確', mobile_number_format_is_incorrect: '手機號碼格式不正確',
email_format_is_incorrect: '郵箱格式不正確', email_format_is_incorrect: '郵箱格式不正確',
@ -806,6 +807,7 @@ export default {
edite_organization: '編輯組織' edite_organization: '編輯組織'
}, },
system_parameter_setting: { system_parameter_setting: {
edit_success: '編輯成功',
mailbox_service_settings: '郵件設置', mailbox_service_settings: '郵件設置',
test_connection: '測試連接', test_connection: '測試連接',
SMTP_host: 'SMTP主機', SMTP_host: 'SMTP主機',

View File

@ -651,6 +651,7 @@ export default {
input_roles: '请选择角色', input_roles: '请选择角色',
select_users: '请选择用户', select_users: '请选择用户',
select_gender: '请选择性别', select_gender: '请选择性别',
user_name_pattern_error: 'ID只能包含字母数字以及._-并以字母开头!',
special_characters_are_not_supported: '不支持特殊字符', special_characters_are_not_supported: '不支持特殊字符',
mobile_number_format_is_incorrect: '手机号码格式不正确', mobile_number_format_is_incorrect: '手机号码格式不正确',
email_format_is_incorrect: '邮箱格式不正确', email_format_is_incorrect: '邮箱格式不正确',
@ -805,6 +806,7 @@ export default {
edite_organization: '编辑组织' edite_organization: '编辑组织'
}, },
system_parameter_setting: { system_parameter_setting: {
edit_success: '编辑成功',
mailbox_service_settings: '邮件设置', mailbox_service_settings: '邮件设置',
test_connection: '测试连接', test_connection: '测试连接',
SMTP_host: 'SMTP主机', SMTP_host: 'SMTP主机',

View File

@ -57,6 +57,7 @@ import { reverseColor } from '../chart/common/common'
import MapController from './map/MapController.vue' import MapController from './map/MapController.vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import bus from '@/utils/bus' import bus from '@/utils/bus'
export default { export default {
name: 'ChartComponent', name: 'ChartComponent',
components: { components: {
@ -180,16 +181,18 @@ export default {
this.currentSeriesId = seriesId this.currentSeriesId = seriesId
}, },
reDrawView() { reDrawView() {
this.myChart.dispatchAction({ if (this.linkageActiveParam) {
type: 'unselect', this.myChart.dispatchAction({
seriesIndex: this.linkageActiveParam.seriesIndex, type: 'unselect',
name: this.linkageActiveParam.name seriesIndex: this.linkageActiveParam.seriesIndex,
}) name: this.linkageActiveParam.name
this.myChart.dispatchAction({ })
type: 'downplay', this.myChart.dispatchAction({
seriesIndex: this.linkageActiveParam.seriesIndex, type: 'downplay',
name: this.linkageActiveParam.name seriesIndex: this.linkageActiveParam.seriesIndex,
}) name: this.linkageActiveParam.name
})
}
this.linkageActiveParam = null this.linkageActiveParam = null
}, },
linkageActive() { linkageActive() {

View File

@ -13,7 +13,10 @@
style="margin-left: 4px;cursor: pointer;font-size: 14px;" style="margin-left: 4px;cursor: pointer;font-size: 14px;"
/> />
<div> <div>
<ul class="de-ul"> <ul
class="de-ul"
style="padding: 0px !important;"
>
<li <li
v-for="(node, i) in layerOption" v-for="(node, i) in layerOption"
:key="node.id" :key="node.id"

View File

@ -830,8 +830,9 @@ export default {
this.quotaChange() this.quotaChange()
}) })
dateformats(this.param.id).then((response) => { dateformats(this.param.id).then((response) => {
const children = (response?.data || []).map(ele => ({ label: ele.dateformat, value: ele.dateformat }))
children.push({ label: '自定义', value: 'custom' }) const children = (response?.data || []).map(ele => ({ label: ele.dateformat + ( ele.desc !== null ? ('(' + ele.desc) + ')' : ""), value: ele.dateformat }))
children.push({ label: this.$t('commons.custom'), value: 'custom' })
this.dateformats = children this.dateformats = children
}) })
}, },

View File

@ -77,7 +77,7 @@
:label="dialogTitleLabel" :label="dialogTitleLabel"
prop="name" prop="name"
> >
<el-input v-model="templateEditForm.name" /> <el-input v-model="templateEditForm.name"/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('app_template.app_group_icon')" :label="$t('app_template.app_group_icon')"
@ -95,7 +95,7 @@
:http-request="upload" :http-request="upload"
:file-list="fileList" :file-list="fileList"
> >
<i class="el-icon-plus" /> <i class="el-icon-plus"/>
</el-upload> </el-upload>
<el-dialog <el-dialog
top="25vh" top="25vh"
@ -154,7 +154,7 @@
import TemplateList from './component/TemplateList' import TemplateList from './component/TemplateList'
import TemplateItem from './component/TemplateItem' import TemplateItem from './component/TemplateItem'
import TemplateImport from './component/TemplateImport' import TemplateImport from './component/TemplateImport'
import { save, update, templateDelete, find } from '@/api/system/appTemplate' import { find, save, templateDelete, update } from '@/api/system/appTemplate'
import elementResizeDetectorMaker from 'element-resize-detector' import elementResizeDetectorMaker from 'element-resize-detector'
import msgCfm from '@/components/msgCfm/index' import msgCfm from '@/components/msgCfm/index'
import { uploadFileResult } from '@/api/staticResource/staticResource' import { uploadFileResult } from '@/api/staticResource/staticResource'
@ -364,7 +364,7 @@ export default {
: 'edit_template' : 'edit_template'
}` }`
) )
this.originName = this.templateEditForm.label this.originName = this.templateEditForm.name
} else { } else {
this.fileList = [] this.fileList = []
this.dialogTitle = this.$t('panel.add_app_category') this.dialogTitle = this.$t('panel.add_app_category')
@ -398,7 +398,7 @@ export default {
this.openMessageSuccess( this.openMessageSuccess(
`system_parameter_setting.${ `system_parameter_setting.${
this.templateEditForm.id this.templateEditForm.id
? 'rename_succeeded' ? 'edit_success'
: 'added_successfully' : 'added_successfully'
}` }`
) )

View File

@ -43,7 +43,7 @@
v-if="marketActiveTab==='apply_logs'" v-if="marketActiveTab==='apply_logs'"
class="main-log-area template-main" class="main-log-area template-main"
> >
<app-template-log class="log-area" /> <app-template-log class="log-area"/>
</el-row> </el-row>
</el-row> </el-row>
@ -186,13 +186,15 @@ export default {
const erd = elementResizeDetectorMaker() const erd = elementResizeDetectorMaker()
const templateMainDom = document.getElementById('template-main') const templateMainDom = document.getElementById('template-main')
// div // div
erd.listenTo(templateMainDom, element => { if (templateMainDom) {
_this.$nextTick(() => { erd.listenTo(templateMainDom, element => {
const curSeparator = Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth) _this.$nextTick(() => {
_this.templateSpan = (100 / Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)) + '%' const curSeparator = Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)
_this.templateCurWidth = Math.trunc(templateMainDom.offsetWidth / curSeparator) - 33 _this.templateSpan = (100 / Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)) + '%'
_this.templateCurWidth = Math.trunc(templateMainDom.offsetWidth / curSeparator) - 33
})
}) })
}) }
}, },
methods: { methods: {
applyNew(item) { applyNew(item) {

View File

@ -284,11 +284,16 @@
@click="changeRightDrawOpen(false)" @click="changeRightDrawOpen(false)"
/> />
</el-tooltip> </el-tooltip>
<span style="font-weight: bold;font-size: 14px;margin-left: 40px;line-height:40px" <span v-if="curComponent&&!curComponent.auxiliaryMatrix"
style="font-weight: bold;font-size: 14px;margin-left: 40px;line-height:40px"
>{{ $t('panel.position_adjust') }}</span> >{{ $t('panel.position_adjust') }}</span>
</el-row> </el-row>
<el-row> <el-row>
<position-adjust v-if="curComponent&&!curComponent.auxiliaryMatrix"/> <position-adjust v-if="curComponent&&!curComponent.auxiliaryMatrix"/>
<div v-else class="view-selected-message-class">
<span style="font-size: 14px;margin-left: 10px;font-weight: bold;line-height: 20px"
>{{ $t('panel.select_view') }}</span>
</div>
</el-row> </el-row>
</div> </div>
</div> </div>

View File

@ -174,7 +174,7 @@
/> />
</span> </span>
<span v-if="data.nodeType === 'folder'"> <span v-if="data.nodeType === 'folder'">
<svg-icon icon-class="scene" /> <svg-icon icon-class="scene"/>
</span> </span>
<span <span
:class="data.status" :class="data.status"
@ -211,7 +211,7 @@
<el-dropdown-item <el-dropdown-item
:command="beforeClickEdit('folder', 'new', data, node)" :command="beforeClickEdit('folder', 'new', data, node)"
> >
<svg-icon icon-class="scene" /> <svg-icon icon-class="scene"/>
<span style="margin-left: 5px">{{ $t('panel.groupAdd') }}</span> <span style="margin-left: 5px">{{ $t('panel.groupAdd') }}</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item <el-dropdown-item
@ -334,7 +334,7 @@
:label="$t('commons.name')" :label="$t('commons.name')"
prop="name" prop="name"
> >
<el-input v-model="groupForm.name" /> <el-input v-model="groupForm.name"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div <div
@ -345,8 +345,8 @@
size="mini" size="mini"
@click="close()" @click="close()"
>{{ >{{
$t('panel.cancel') $t('panel.cancel')
}} }}
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
@ -422,8 +422,8 @@
size="mini" size="mini"
@click="closeMoveGroup()" @click="closeMoveGroup()"
>{{ >{{
$t('dataset.cancel') $t('dataset.cancel')
}} }}
</el-button> </el-button>
<el-button <el-button
:disabled="groupMoveConfirmDisabled" :disabled="groupMoveConfirmDisabled"
@ -729,6 +729,7 @@ export default {
optType: 'rename', optType: 'rename',
titlePre: this.$t('commons.edit'), titlePre: this.$t('commons.edit'),
panelInfo: { panelInfo: {
pid: param.data.pid,
id: param.data.id, id: param.data.id,
name: param.data.name, name: param.data.name,
nodeType: param.type nodeType: param.type

View File

@ -130,20 +130,22 @@
<el-button <el-button
size="mini" size="mini"
@click="folderSelectShow=false" @click="folderSelectShow=false"
>{{ $t('commons.cancel') }}</el-button> >{{ $t('commons.cancel') }}
</el-button>
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
:disabled="!panelForm.name || !panelForm.pid" :disabled="!panelForm.name || !panelForm.pid"
@click="apply" @click="apply"
>{{ $t('commons.confirm') }}</el-button> >{{ $t('commons.confirm') }}
</el-button>
</div> </div>
</el-dialog> </el-dialog>
</el-row> </el-row>
</template> </template>
<script> <script>
import { searchMarket, getCategories } from '@/api/templateMarket' import { getCategories, searchMarket } from '@/api/templateMarket'
import TemplateMarketItem from '@/views/panel/templateMarket/component/TemplateMarketItem' import TemplateMarketItem from '@/views/panel/templateMarket/component/TemplateMarketItem'
import { groupTree, panelSave } from '@/api/panel/panel' import { groupTree, panelSave } from '@/api/panel/panel'
import { DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel' import { DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel'
@ -199,9 +201,7 @@ export default {
} }
} }
}, },
computed: { computed: {},
},
watch: { watch: {
marketActiveTab() { marketActiveTab() {
this.initTemplateShow() this.initTemplateShow()
@ -217,13 +217,15 @@ export default {
const erd = elementResizeDetectorMaker() const erd = elementResizeDetectorMaker()
const templateMainDom = document.getElementById('template-main') const templateMainDom = document.getElementById('template-main')
// div // div
erd.listenTo(templateMainDom, element => { if (templateMainDom) {
_this.$nextTick(() => { erd.listenTo(templateMainDom, element => {
const curSeparator = Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth) _this.$nextTick(() => {
_this.templateSpan = (100 / Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)) + '%' const curSeparator = Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)
_this.templateCurWidth = Math.trunc(templateMainDom.offsetWidth / curSeparator) - 33 _this.templateSpan = (100 / Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)) + '%'
_this.templateCurWidth = Math.trunc(templateMainDom.offsetWidth / curSeparator) - 33
})
}) })
}) }
}, },
methods: { methods: {
initMarketTemplate() { initMarketTemplate() {
@ -322,100 +324,107 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.template-main{ .template-main {
text-align: center; text-align: center;
border-radius: 4px; border-radius: 4px;
padding: 0 12px 24px 12px; padding: 0 12px 24px 12px;
height: calc(100vh - 190px)!important; height: calc(100vh - 190px) !important;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
background-color: var(--ContentBG,#ffffff); background-color: var(--ContentBG, #ffffff);
} }
.market-main{
padding:24px
}
.title-left{
float: left;
font-size: 20px;
font-weight: 500;
line-height: 28px;
color: var(--TextPrimary, #1F2329);
}
.title-right{
float: right;
width: 320px;
}
.dialog-footer-self{
text-align: right;
}
.search-button-self{
text-align: left;
padding-left: 10px;
}
.topbar-icon-active { .market-main {
cursor: pointer; padding: 24px
transition: .1s; }
border-radius: 3px;
font-size: 22px; .title-left {
background-color: rgb(245, 245, 245); float: left;
font-size: 20px;
font-weight: 500;
line-height: 28px;
color: var(--TextPrimary, #1F2329);
}
.title-right {
float: right;
width: 320px;
}
.dialog-footer-self {
text-align: right;
}
.search-button-self {
text-align: left;
padding-left: 10px;
}
.topbar-icon-active {
cursor: pointer;
transition: .1s;
border-radius: 3px;
font-size: 22px;
background-color: rgb(245, 245, 245);
&:active { &:active {
color: #000; color: #000;
border-color: #3a8ee6; border-color: #3a8ee6;
background-color: red; background-color: red;
outline: 0; outline: 0;
} }
&:hover { &:hover {
background-color: rgba(31, 35, 41, 0.1); background-color: rgba(31, 35, 41, 0.1);
color: #3a8ee6; color: #3a8ee6;
}
} }
.custom-position { }
height: 80vh;
flex: 1; .custom-position {
display: flex; height: 80vh;
align-items: center; flex: 1;
justify-content: space-between; display: flex;
font-size: 14px; align-items: center;
flex-flow: row nowrap; justify-content: space-between;
color: #646A73; font-size: 14px;
font-weight: 400; flex-flow: row nowrap;
} color: #646A73;
.outer-body{ font-weight: 400;
width: 100%; }
height: calc(100vh - 56px);
background-color: var(--MainBG,#f5f6f7); .outer-body {
width: 100%;
height: calc(100vh - 56px);
background-color: var(--MainBG, #f5f6f7);
}
.market-dialog-css {
::v-deep .el-form-item__label {
width: 100% !important;
text-align: left;
} }
.market-dialog-css{ ::v-deep
::v-deep .el-form-item__label { .el-form-item.is-required:not(.is-no-asterisk)
width: 100% !important; > .el-form-item__label:before {
text-align: left; display: none;
}
::v-deep
.el-form-item.is-required:not(.is-no-asterisk)
> .el-form-item__label:before {
display: none;
}
::v-deep
.el-form-item.is-required:not(.is-no-asterisk)
> .el-form-item__label::after {
content: "*";
color: #f54a45;
margin-left: 2px;
}
::v-deep .el-form-item__content {
margin-left: 0 !important;
}
::v-deep .vue-treeselect__input{
vertical-align:middle;
}
} }
::v-deep
.el-form-item.is-required:not(.is-no-asterisk)
> .el-form-item__label::after {
content: "*";
color: #f54a45;
margin-left: 2px;
}
::v-deep .el-form-item__content {
margin-left: 0 !important;
}
::v-deep .vue-treeselect__input {
vertical-align: middle;
}
}
</style> </style>

View File

@ -63,14 +63,14 @@
<img :src="imgDefault"> <img :src="imgDefault">
</div> </div>
</el-image> </el-image>
<p class="title">{{ ele.descript }}</p> <p class="title">{{ ele.name }}</p>
<el-tooltip <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
:content="ele.descript" :content="ele.descript"
placement="top" placement="top"
> >
<p class="tips">{{ ele.name }}</p> <p class="tips">{{ ele.descript }}</p>
</el-tooltip> </el-tooltip>
</div> </div>
<div class="info-left"> <div class="info-left">

View File

@ -264,8 +264,8 @@ export default {
}, },
{ {
required: true, required: true,
pattern: '^[^\u4e00-\u9fa5]+$', pattern: '^[a-zA-Z][a-zA-Z0-9\._-]*$',
message: this.$t('user.special_characters_are_not_supported'), message: this.$t('user.user_name_pattern_error'),
trigger: 'blur' trigger: 'blur'
} }
], ],
@ -281,11 +281,8 @@ export default {
message: this.$t('commons.input_limit', [2, 50]), message: this.$t('commons.input_limit', [2, 50]),
trigger: 'blur' trigger: 'blur'
}, },
{ { required: true, validator: this.validateNickname, trigger: 'blur' }
required: true,
message: this.$t('user.special_characters_are_not_supported'),
trigger: 'blur'
}
], ],
phone: [ phone: [
{ {
@ -411,6 +408,17 @@ export default {
callback() callback()
} }
}, },
validateNickname(rule, value, callback) {
const pattern = "[\\u00A0\\s\"`~!@#$%^&*()+=|{}':;',\\[\\]<>/?~@#¥%……&*()——+|{}【】‘;:”“'。,、?]"
const regep = new RegExp(pattern)
if (regep.test(value)) {
const msg = this.$t('user.special_characters_are_not_supported')
callback(new Error(msg))
} else {
callback()
}
},
create() { create() {
this.formType = 'add' this.formType = 'add'
this.form = Object.assign({}, JSON.parse(JSON.stringify(this.defaultForm))) this.form = Object.assign({}, JSON.parse(JSON.stringify(this.defaultForm)))