Merge branch 'dev' into pr@dev@fix_import_user_error_tip

This commit is contained in:
fit2cloud-chenyw 2022-08-31 18:14:12 +08:00 committed by GitHub
commit 6c8e3594c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 420 additions and 742 deletions

View File

@ -374,7 +374,7 @@ public class ApiProvider extends Provider {
for (int i = 0; i < jsonPaths.size(); i++) { for (int i = 0; i < jsonPaths.size(); i++) {
List<String> datas = new ArrayList<>(); List<String> datas = new ArrayList<>();
Object object = JsonPath.read(result, jsonPaths.get(i)); Object object = JsonPath.read(result, jsonPaths.get(i));
if (object instanceof List) { if (object instanceof List && jsonPaths.get(i).contains("[*]")) {
datas = (List<String>) object; datas = (List<String>) object;
} else { } else {
if (object != null) { if (object != null) {
@ -390,7 +390,7 @@ public class ApiProvider extends Provider {
} }
for (int i = 0; i < columnDataList.size(); i++) { for (int i = 0; i < columnDataList.size(); i++) {
for (int j = 0; j < columnDataList.get(i).size(); j++) { for (int j = 0; j < columnDataList.get(i).size(); j++) {
dataList.get(j)[i] = String.valueOf(columnDataList.get(i).get(j)); dataList.get(j)[i] = Optional.ofNullable(columnDataList.get(i).get(j)).orElse("").replaceAll("\n", " ").replaceAll("\r", " ");
} }
} }
} }

View File

@ -1032,7 +1032,7 @@ public class DataSetTableService {
} }
Expression expr = plainSelect.getWhere(); Expression expr = plainSelect.getWhere();
if (expr == null) { if (expr == null) {
return plainSelect.toString(); return handleWith(plainSelect, select);
} }
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
BinaryExpression binaryExpression = null; BinaryExpression binaryExpression = null;
@ -1046,7 +1046,10 @@ public class DataSetTableService {
expr.accept(getExpressionDeParser(stringBuilder)); expr.accept(getExpressionDeParser(stringBuilder));
} }
plainSelect.setWhere(CCJSqlParserUtil.parseCondExpression(stringBuilder.toString())); plainSelect.setWhere(CCJSqlParserUtil.parseCondExpression(stringBuilder.toString()));
return handleWith(plainSelect, select);
}
private String handleWith(PlainSelect plainSelect, Select select)throws Exception{
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
if (CollectionUtils.isNotEmpty(select.getWithItemsList())) { if (CollectionUtils.isNotEmpty(select.getWithItemsList())) {
builder.append("WITH"); builder.append("WITH");
@ -1063,7 +1066,6 @@ public class DataSetTableService {
builder.append(" " + plainSelect); builder.append(" " + plainSelect);
return builder.toString(); return builder.toString();
} }
public Map<String, Object> getSQLPreview(DataSetTableRequest dataSetTableRequest) throws Exception { public Map<String, Object> getSQLPreview(DataSetTableRequest dataSetTableRequest) throws Exception {
Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId()); Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId());
if (ds == null) { if (ds == null) {

View File

@ -85,7 +85,7 @@ i18n_no_all_delete_privilege_folder=This folder have sources which have no manag
i18n_excel_field_repeat=Duplicate fields exist, please modify and try again. i18n_excel_field_repeat=Duplicate fields exist, please modify and try again.
i18n_schema_is_empty=Database schema is empty i18n_schema_is_empty=Database schema is empty
\u7AD9\u5185\u6D88\u606F=Internal Messages \u7AD9\u5185\u6D88\u606F=Internal Messages
\u6240\u6709\u6D88\u606F==All Messages \u6240\u6709\u6D88\u606F=All Messages
\u672A\u8BFB\u6D88\u606F=Unread Messages \u672A\u8BFB\u6D88\u606F=Unread Messages
\u5DF2\u8BFB\u6D88\u606F==Read Messages \u5DF2\u8BFB\u6D88\u606F==Read Messages
\u63A5\u6536\u7BA1\u7406=Receive Manage \u63A5\u6536\u7BA1\u7406=Receive Manage

View File

@ -48,7 +48,7 @@ export default {
padding-left: 3px; padding-left: 3px;
padding-right: 0px; padding-right: 0px;
cursor:pointer!important; cursor:pointer!important;
background-color: #3370ff; background-color: var(--primary,#3370ff);
} }
.bar-main i{ .bar-main i{
color: white; color: white;

View File

@ -372,7 +372,7 @@ export default {
padding-left: 3px; padding-left: 3px;
padding-right: 0px; padding-right: 0px;
cursor:pointer!important; cursor:pointer!important;
background-color: #3370ff; background-color: var(--primary,#3370ff);
} }
.bar-main i{ .bar-main i{
color: white; color: white;

View File

@ -4,10 +4,10 @@
<span v-if="isEdit" :title="$t('panel.edit')"> <span v-if="isEdit" :title="$t('panel.edit')">
<i class="icon iconfont icon-edit" @click.stop="edit" /> <i class="icon iconfont icon-edit" @click.stop="edit" />
</span> </span>
<span :title="$t('panel.details')"> <span v-show="detailsShow" :title="$t('panel.details')">
<i class="icon iconfont icon-chakan" @click.stop="showViewDetails('details')" /> <i class="icon iconfont icon-chakan" @click.stop="showViewDetails('details')" />
</span> </span>
<span :title="$t('panel.enlarge')"> <span v-show="enlargeShow" :title="$t('panel.enlarge')">
<i class="icon iconfont icon-fangda" @click.stop="showViewDetails('enlarge')" /> <i class="icon iconfont icon-fangda" @click.stop="showViewDetails('enlarge')" />
</span> </span>
</div> </div>
@ -63,6 +63,12 @@ export default {
} }
}, },
computed: { computed: {
detailsShow(){
return this.element.propValue.innerType !== 'richTextView'
},
enlargeShow(){
return this.element.propValue.innerType !== 'richTextView'
},
// gapStyle() { // gapStyle() {
// return { // return {
// 'right': this.curGap + 'px!important' // 'right': this.curGap + 'px!important'
@ -149,7 +155,7 @@ export default {
padding-left: 3px!important; padding-left: 3px!important;
padding-right: 0px!important; padding-right: 0px!important;
cursor:pointer!important; cursor:pointer!important;
background-color: #3370ff; background-color: var(--primary,#3370ff);
} }
.bar-main i{ .bar-main i{
color: white; color: white;

View File

@ -76,7 +76,7 @@ export default {
padding-right: 1px; padding-right: 1px;
cursor:pointer!important; cursor:pointer!important;
text-align: center; text-align: center;
background-color: #3370ff; background-color: var(--primary,#3370ff);
} }
.bar-main i{ .bar-main i{
color: white; color: white;

View File

@ -74,7 +74,7 @@
<el-dropdown-item> <el-dropdown-item>
<span class="icon iconfont icon-icon_dialpad_outlined icon16" /> <span class="icon iconfont icon-icon_dialpad_outlined icon16" />
<span class="text14 margin-left8">{{ $t('panel.aided_grid') }}</span> <span class="text14 margin-left8">{{ $t('panel.aided_grid') }}</span>
<el-switch v-model="showGridSwitch" class="margin-left8" size="mini" @change="showGridChange" /> <el-switch v-model="showGridSwitch" :class="[{['grid-active']: showGridSwitch},'margin-left8']" size="mini" @change="showGridChange" />
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.native="openOuterParamsSet"> <el-dropdown-item @click.native="openOuterParamsSet">
<span class="icon iconfont icon-icon-quicksetting icon16" /> <span class="icon iconfont icon-icon-quicksetting icon16" />
@ -600,10 +600,14 @@ export default {
::v-deep .el-switch__core::after { ::v-deep .el-switch__core::after {
width: 14px; width: 14px;
height: 14px; height: 14px;
margin-top: -1px; margin-top: -1.3px;
margin-bottom: 2px; margin-bottom: 2px;
} }
.grid-active ::v-deep .el-switch__core::after {
margin-left: -14.5px;
}
.iconfont-tb { .iconfont-tb {
font-family: "iconfont" !important; font-family: "iconfont" !important;
font-size: 12px; font-size: 12px;

View File

@ -133,12 +133,12 @@ export default {
commons: { commons: {
no_result: 'No Result', no_result: 'No Result',
manage_member: 'Managing members', manage_member: 'Managing members',
user_confirm_remove_cancel: 'Are you sure you want to remove the user from the role?',
confirm_remove_cancel: 'Are you sure to delete the role?', confirm_remove_cancel: 'Are you sure to delete the role?',
user_confirm_remove_cancel: 'Are you sure you want to remove the user from the role?',
default_value: 'Default Value', default_value: 'Default Value',
params_value: 'Param Value', params_value: 'Param Value',
publish: 'publish',
input_role_name: 'Enter a role name', input_role_name: 'Enter a role name',
publish: 'publish',
unpublished: 'unpublished', unpublished: 'unpublished',
default_pwd: 'Default Pwd', default_pwd: 'Default Pwd',
stop: 'Stop', stop: 'Stop',
@ -159,9 +159,9 @@ export default {
yes: 'Yes', yes: 'Yes',
no: 'No', no: 'No',
reset: 'Reset', reset: 'Reset',
gender: 'Gender',
catalogue: 'Catalogue', catalogue: 'Catalogue',
button: 'Button', button: 'Button',
gender: 'Gender',
man: 'Man', man: 'Man',
woman: 'Woman', woman: 'Woman',
keep_secret: 'keep secret', keep_secret: 'keep secret',
@ -192,6 +192,7 @@ export default {
annotation: 'Annotation', annotation: 'Annotation',
clear: 'Clean', clear: 'Clean',
save: 'Save', save: 'Save',
otherSave: 'Save as',
update: 'Update', update: 'Update',
save_success: 'Saved successfully', save_success: 'Saved successfully',
delete_success: 'deleted successfully', delete_success: 'deleted successfully',
@ -400,6 +401,7 @@ export default {
continue: 'continue', continue: 'continue',
hour: 'hour', hour: 'hour',
minute: 'minute', minute: 'minute',
day: 'day',
by_task_name: 'Search by task name', by_task_name: 'Search by task name',
message_receiving_management: 'Message receiving management', message_receiving_management: 'Message receiving management',
upload_failed: 'Upload failed', upload_failed: 'Upload failed',
@ -423,7 +425,6 @@ export default {
uninstall: 'uninstall', uninstall: 'uninstall',
relevant_content_found: 'No relevant content found', relevant_content_found: 'No relevant content found',
view_tasks: 'View tasks', view_tasks: 'View tasks',
day: 'day',
no_classification: 'No classification', no_classification: 'No classification',
no_template: 'No template', no_template: 'No template',
data_set_required: 'Data set (required)', data_set_required: 'Data set (required)',
@ -602,6 +603,7 @@ export default {
confirm_passwd: 'Confirm Password', confirm_passwd: 'Confirm Password',
change_password: 'Change Password', change_password: 'Change Password',
search_by_name: 'Search by name', search_by_name: 'Search by name',
import_ldap: 'Import LDAP users',
result_one: 'Results', result_one: 'Results',
clear_filter: 'Empty condition', clear_filter: 'Empty condition',
recover_pwd: 'Restore to the original password?', recover_pwd: 'Restore to the original password?',
@ -1541,8 +1543,9 @@ export default {
column_permission: { column_permission: {
add: 'Add', add: 'Add',
edit: 'Edit', edit: 'Edit',
please_select_field: 'Please select field',
please_select_auth_type: 'Please select the authorization type', please_select_auth_type: 'Please select the authorization type',
please_select_auth_id: '请选择授权目标', please_select_auth_id: 'Please select authorization obj',
column_permission_not_empty: 'Please select authorization target', column_permission_not_empty: 'Please select authorization target',
auth_type: 'Authorization type', auth_type: 'Authorization type',
auth_obj: 'Authorized object', auth_obj: 'Authorized object',
@ -1594,14 +1597,19 @@ export default {
create: 'Create Data Source', create: 'Create Data Source',
type: 'Type', type: 'Type',
please_choose_type: 'Please select data source type', please_choose_type: 'Please select data source type',
please_choose_data_type: 'Please select the calculation mode',
data_base: 'Database name', data_base: 'Database name',
user_name: 'User Name', user_name: 'User Name',
password: 'Password', password: 'Password',
host: 'Host name / IP address', host: 'Host name / IP address',
doris_host: 'Doris Addr',
query_port: 'Query Port',
http_port: 'Http Port',
port: 'Port', port: 'Port',
datasource_url: 'URL address', datasource_url: 'URL address',
please_input_datasource_url: 'Please enter Elasticsearch 地址e.g: http://es_host:es_port', please_input_datasource_url: 'Please enter Elasticsearch 地址e.g: http://es_host:es_port',
please_input_data_base: 'Please enter the database name', please_input_data_base: 'Please enter the database name',
please_select_oracle_type: 'Select connection type',
please_input_user_name: 'Please enter user name', please_input_user_name: 'Please enter user name',
please_input_password: 'Please enter Password', please_input_password: 'Please enter Password',
please_input_host: 'Please enter host', please_input_host: 'Please enter host',
@ -1633,9 +1641,6 @@ export default {
min_pool_size: 'Minimum of connections', min_pool_size: 'Minimum of connections',
max_pool_size: 'Maximum connection', max_pool_size: 'Maximum connection',
max_idle_time: 'Maximum idle (seconds)', max_idle_time: 'Maximum idle (seconds)',
doris_host: 'Doris Address',
query_port: 'Query Port',
http_port: 'Http Port',
bucket_num: 'Bucket number', bucket_num: 'Bucket number',
replication_num: 'Replication number', replication_num: 'Replication number',
please_input_bucket_num: 'Please enter Bucket number', please_input_bucket_num: 'Please enter Bucket number',
@ -1648,10 +1653,15 @@ export default {
please_input_max_pool_size: 'Please enter the maximum number of connections', please_input_max_pool_size: 'Please enter the maximum number of connections',
please_input_max_idle_time: 'Please enter the maximum idle (seconds)', please_input_max_idle_time: 'Please enter the maximum idle (seconds)',
please_input_acquire_increment: 'Please enter the growth number', please_input_acquire_increment: 'Please enter the growth number',
please_input_query_timeout: 'Please enter query timeout',
please_input_connect_timeout: 'Please enter the connection timeout (seconds)', please_input_connect_timeout: 'Please enter the connection timeout (seconds)',
no_less_then_0: 'Parameters in advanced settings cannot be less than zero', no_less_then_0: 'Parameters in advanced settings cannot be less than zero',
port_no_less_then_0: 'Port cannot be less than zero', port_no_less_then_0: 'Port cannot be less than zero',
priority: 'Advanced setting', priority: 'Advanced setting',
data_mode: 'Data mode',
direct: 'Direct Mode',
extract: 'Extraction mode',
all_compute_mode: 'Direct connection and extraction mode',
extra_params: 'Extra JDBC connection string', extra_params: 'Extra JDBC connection string',
please_input_dataPath: 'Please enter the JsonPath data path', please_input_dataPath: 'Please enter the JsonPath data path',
warning: 'Contains invalid table', warning: 'Contains invalid table',
@ -1909,6 +1919,8 @@ export default {
fontWeight: 'FontWeight', fontWeight: 'FontWeight',
lineHeight: 'LineHeight', lineHeight: 'LineHeight',
letterSpacing: 'LetterSpacing', letterSpacing: 'LetterSpacing',
padding: 'Internal spacing',
margin: 'Outer space',
textAlign: 'TextAlign', textAlign: 'TextAlign',
opacity: 'Opacity', opacity: 'Opacity',
verticalAlign: 'Vertical Align', verticalAlign: 'Vertical Align',
@ -1997,6 +2009,9 @@ export default {
default_settings: 'Default Settings', default_settings: 'Default Settings',
choose_background: 'Choose Component Background', choose_background: 'Choose Component Background',
choose_background_tips: 'The component`s own background settings will overwrite the current settings', choose_background_tips: 'The component`s own background settings will overwrite the current settings',
setting_background: 'Set background',
setting_jump: 'Jump settings',
select_view: 'Please select a view...',
visual: 'Visual', visual: 'Visual',
prohibit_multiple: 'Prohibit multiple fields in the same dataset', prohibit_multiple: 'Prohibit multiple fields in the same dataset',
be_empty_dir: 'is empty dir' be_empty_dir: 'is empty dir'
@ -2015,9 +2030,6 @@ export default {
un_install: 'Uninstall', un_install: 'Uninstall',
uninstall_confirm: 'Comfirm to uninstall the plugin?', uninstall_confirm: 'Comfirm to uninstall the plugin?',
uninstall_cancel: 'Cancel uninstall plugin', uninstall_cancel: 'Cancel uninstall plugin',
setting_background: 'BackGround',
setting_jump: 'Jump Setting',
select_view: 'Select View',
un_install_success: 'Uninstall is successful and restart takes effect', un_install_success: 'Uninstall is successful and restart takes effect',
un_install_error: 'Uninstall failed, please contact the administrator' un_install_error: 'Uninstall failed, please contact the administrator'
}, },
@ -2029,6 +2041,11 @@ export default {
loginTitle: 'Login page title', loginTitle: 'Login page title',
title: 'System name', title: 'System name',
advice_size: 'Advice picture size', advice_size: 'Advice picture size',
theme: 'Theme color',
topMenuColor: 'Head background',
topMenuActiveColor: 'Head selection background',
topMenuTextColor: 'Head font color',
topMenuTextActiveColor: 'Head font selected color',
themeLight: 'Light', themeLight: 'Light',
themeDark: 'Dark', themeDark: 'Dark',
themeCustom: 'Custom', themeCustom: 'Custom',
@ -2040,7 +2057,6 @@ export default {
defaultHomeLink: 'Default is the system built-in home page', defaultHomeLink: 'Default is the system built-in home page',
showFoot: 'Show login page footer', showFoot: 'Show login page footer',
footContent: 'Foot content' footContent: 'Foot content'
}, },
auth: { auth: {
no_item_selected: 'Please select organization、user or role on the left', no_item_selected: 'Please select organization、user or role on the left',
@ -2056,6 +2072,7 @@ export default {
role: 'Role', role: 'Role',
user: 'User', user: 'User',
set_rules: 'Set rules', set_rules: 'Set rules',
sysParams: 'System variable',
sysParams_type: { sysParams_type: {
user_id: 'User ID', user_id: 'User ID',
user_name: 'User Name', user_name: 'User Name',
@ -2076,6 +2093,7 @@ export default {
datasetAuthHead: 'All Dataset', datasetAuthHead: 'All Dataset',
chartAuthHead: 'All Chart', chartAuthHead: 'All Chart',
panelAuthHead: 'All Chart', panelAuthHead: 'All Chart',
menuAuthHead: 'All menus and actions',
view: 'View', view: 'View',
use: 'Use', use: 'Use',
export: 'Export', export: 'Export',
@ -2083,14 +2101,14 @@ export default {
row_column: 'Row and column permission settings', row_column: 'Row and column permission settings',
row_permission: 'Row permission rules', row_permission: 'Row permission rules',
enable_row: 'Enable row permissions', enable_row: 'Enable row permissions',
add_condition: 'Add condition',
add_relationship: 'Add relationship',
white_list: 'White list', white_list: 'White list',
white_user_not: 'The above permission rules do not take effect for white list users', white_user_not: 'The above permission rules do not take effect for white list users',
organization_or_role: 'Please select an organization or role', organization_or_role: 'Please select an organization or role',
column_permission: 'Column permission rule', column_permission: 'Column permission rule',
enable_column: 'Enable column permissions', enable_column: 'Enable column permissions',
search_by_field: 'Search by field name', search_by_field: 'Search by field name',
add_condition: 'Add condition',
add_relationship: 'Add relationship',
filter_fields: 'Filter fields', filter_fields: 'Filter fields',
selct_filter_fields: 'Please select a filter field', selct_filter_fields: 'Please select a filter field',
enter_keywords: 'Please enter keywords', enter_keywords: 'Please enter keywords',
@ -2200,7 +2218,8 @@ export default {
i18n_msg_type_dataset_sync_faild: 'Dataset synchronization failed', i18n_msg_type_dataset_sync_faild: 'Dataset synchronization failed',
i18n_msg_type_all: 'All type', i18n_msg_type_all: 'All type',
i18n_msg_type_ds_invalid: 'Datasource invalid', i18n_msg_type_ds_invalid: 'Datasource invalid',
channel_inner_msg: 'On site news' channel_inner_msg: 'On site news',
channel_email_msg: 'Mail notification'
}, },
denumberrange: { denumberrange: {
label: 'Number range', label: 'Number range',
@ -2356,8 +2375,7 @@ export default {
cmonth: 'This Month', cmonth: 'This Month',
cquarter: 'This Quarter', cquarter: 'This Quarter',
lquarter: 'Last Quarter', lquarter: 'Last Quarter',
cyear: 'This Year', cyear: 'This Year'
openHomePage: 'Show Home Page'
}, },
dynamic_year: { dynamic_year: {
fix: 'Fixed Year', fix: 'Fixed Year',
@ -2370,7 +2388,8 @@ export default {
dynamic: 'Dynamic Month', dynamic: 'Dynamic Month',
current: 'This Month', current: 'This Month',
last: 'Last Month', last: 'Last Month',
firstOfYear: 'First month of this year' firstOfYear: 'First month of this year',
sameMonthLastYear: 'Same month last year'
}, },
wizard: { wizard: {
welcome_title: 'Welcome To Use DataEase', welcome_title: 'Welcome To Use DataEase',
@ -2419,7 +2438,9 @@ export default {
plugin_style: { plugin_style: {
border: 'Border' border: 'Border'
}, },
sql_variable: {
variable_mgm: 'Parameter setting'
},
map_setting: { map_setting: {
area_level: 'Area Level', area_level: 'Area Level',
area_code: 'Area Code', area_code: 'Area Code',

View File

@ -1148,6 +1148,9 @@ div:focus {
.el-input__prefix { .el-input__prefix {
display: none; display: none;
} }
.el-icon-circle-close {
margin-right: 20px;
}
} }
.icon-calendar-outlined { .icon-calendar-outlined {
@ -1172,12 +1175,55 @@ div:focus {
} }
} }
.user-drawer,
.user-drawer-task { .user-drawer-task {
.el-drawer__body-cont {
height: 100%;
box-sizing: border-box;
overflow: auto;
width: 100%;
padding-bottom: 80px;
}
.el-drawer__header {
padding: 16px 24px;
margin: 0;
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: var(--deTextPrimary, #1f2329);
position: relative;
box-sizing: border-box;
height: 57px;
mix-blend-mode: normal;
border-bottom: 1px solid var(--deComBorderColor50, rgba(187, 191, 196, 0.5));
.el-drawer__close-btn {
position: absolute;
right: 24px;
top: 16px;
padding: 4px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center
}
.el-drawer__close-btn:hover {
background: #e9e9ea;
}
}
.el-drawer__body {
padding: 12px 24px 24px 24px;
position: relative;
}
.filter { .filter {
display: flex; display: flex;
min-height: 46px; min-height: 46px;
> :nth-child(1) { > :nth-child(1) {
color: #1f2329; color: var(--deTextSecondary, #1f2329);
font-family: "PingFang SC"; font-family: "PingFang SC";
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
@ -1187,23 +1233,87 @@ div:focus {
width: 116px; width: 116px;
} }
.filter-item { .filter-item {
flex: 1;
.item, .item,
.more { .more {
background: #f5f6f7; font-family: PingFang SC;
white-space: nowrap;
font-size: 14px;
font-weight: 400;
line-height: 24px;
margin-right: 12px;
text-align: center;
padding: 1px 6px;
background: var(--deTextPrimary5, #f5f6f7);
color: var(--deTextPrimary, #1f2329);
border-radius: 2px;
cursor: pointer;
display: inline-block;
margin-bottom: 12px;
} }
.active, .active,
.more:hover { .more:hover{
background: rgba(51, 112, 255, 0.1); background: var(--primary10, rgba(51, 112, 255, 0.1));
color: #0c296e; color: var(--primaryselect, #0c296e);
} }
.more { .more {
white-space: nowrap; white-space: nowrap;
} }
} }
} }
.btn {
border-radius: 4px;
padding: 5px 26px 5px 26px;
font-family: PingFang SC;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: center;
border: none;
box-sizing: border-box;
}
.normal {
color: #1f2329;
border: 1px solid #bbbfc4;
margin-left: 12px;
}
.foot {
position: absolute;
height: 80px;
width: 100%;
padding: 24px;
right: 0;
bottom: 0;
text-align: right;
background-color: #fff;
box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05);
}
}
.user-popper {
padding: 0;
background: #fff;
.popper__arrow {
display: none;
}
}
.tree-select {
.el-select-dropdown__empty,
.el-scrollbar__wrap,
.popper__arrow {
display: none !important;
}
} }
.user-popper.dept {
height: 400px;
overflow: auto;
}
.upload-user{ .upload-user{
margin-bottom: 5px; margin-bottom: 5px;
.el-upload{ .el-upload{

View File

@ -132,7 +132,7 @@
import { queryBackground } from '@/api/background/background' import { queryBackground } from '@/api/background/background'
import BackgroundItem from '@/views/background/BackgroundItem' import BackgroundItem from '@/views/background/BackgroundItem'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { deepCopy } from '@/components/canvas/utils/utils' import {deepCopy, imgUrlTrans} from '@/components/canvas/utils/utils'
import { COLOR_PANEL } from '@/views/chart/chart/chart' import { COLOR_PANEL } from '@/views/chart/chart/chart'
import { uploadFileResult } from '@/api/staticResource/staticResource' import { uploadFileResult } from '@/api/staticResource/staticResource'
import { COMMON_BACKGROUND_NONE } from '@/components/canvas/custom-component/component-list' import { COMMON_BACKGROUND_NONE } from '@/components/canvas/custom-component/component-list'
@ -171,7 +171,7 @@ export default {
methods: { methods: {
init() { init() {
if (this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') { if (this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') {
this.fileList.push({ url: this.curComponent.commonBackground.outerImage }) this.fileList.push({ url: imgUrlTrans(this.curComponent.commonBackground.outerImage) })
} }
this.backgroundOrigin = deepCopy(this.curComponent.commonBackground ? this.curComponent.commonBackground : COMMON_BACKGROUND_NONE) this.backgroundOrigin = deepCopy(this.curComponent.commonBackground ? this.curComponent.commonBackground : COMMON_BACKGROUND_NONE)
this.queryBackground() this.queryBackground()

View File

@ -52,6 +52,8 @@ import { mapState } from 'vuex'
import { deepCopy } from '@/components/canvas/utils/utils' import { deepCopy } from '@/components/canvas/utils/utils'
import { COLOR_PANEL } from '@/views/chart/chart/chart' import { COLOR_PANEL } from '@/views/chart/chart/chart'
import { uploadFileResult } from '@/api/staticResource/staticResource' import { uploadFileResult } from '@/api/staticResource/staticResource'
import {imgUrlTrans} from "@/components/canvas/utils/utils";
export default { export default {
name: 'BackgroundSelector', name: 'BackgroundSelector',
@ -77,7 +79,7 @@ export default {
// //
this.panel = this.canvasStyleData.panel this.panel = this.canvasStyleData.panel
if (this.panel.imageUrl && typeof (this.panel.imageUrl) === 'string') { if (this.panel.imageUrl && typeof (this.panel.imageUrl) === 'string') {
this.fileList.push({ url: this.panel.imageUrl }) this.fileList.push({ url: imgUrlTrans(this.panel.imageUrl) })
} }
}, },
methods: { methods: {
@ -111,7 +113,7 @@ export default {
uploadFileResult(file.file, (fileUrl) => { uploadFileResult(file.file, (fileUrl) => {
_this.$store.commit('canvasChange') _this.$store.commit('canvasChange')
_this.panel.imageUrl = fileUrl _this.panel.imageUrl = fileUrl
_this.fileList = [{ url: this.panel.imageUrl }] _this.fileList = [{ url: imgUrlTrans(this.panel.imageUrl) }]
_this.commitStyle() _this.commitStyle()
}) })
}, },

View File

@ -15,10 +15,9 @@
<!--基础配置表单--> <!--基础配置表单-->
<el-form ref="formInline" v-loading="loading" :model="formInline" :rules="rules" <el-form ref="formInline" v-loading="loading" :model="formInline" :rules="rules"
class="demo-form-inline de-form-item" :disabled="show" label-width="80px" label-position="right" size="small"> class="demo-form-inline de-form-item" :disabled="show" label-width="80px" label-position="right" size="small">
<el-form-item prop="frontTimeOut" class="de-i118"> <el-form-item prop="frontTimeOut">
<template slot="label"> <template slot="label">
{{ $t('system_parameter_setting.request_timeout')}} {{ $t('system_parameter_setting.request_timeout')}}
<i class="is-require"></i>
<el-tooltip class="item" effect="dark" :content="$t('system_parameter_setting.front_time_out')" <el-tooltip class="item" effect="dark" :content="$t('system_parameter_setting.front_time_out')"
placement="top"> placement="top">
<i class="el-icon-warning-outline tips"></i> <i class="el-icon-warning-outline tips"></i>
@ -96,7 +95,6 @@ export default {
pattern: "^([0-9]|\\b[1-9]\\d\\b|\\b[1-2]\\d\\d\\b|\\b300\\b)$", // 0-300 pattern: "^([0-9]|\\b[1-9]\\d\\b|\\b[1-2]\\d\\d\\b|\\b300\\b)$", // 0-300
message: this.$t("system_parameter_setting.front_error"), message: this.$t("system_parameter_setting.front_error"),
trigger: "blur", trigger: "blur",
required: true,
}, },
], ],
msgTimeOut: [ msgTimeOut: [
@ -104,7 +102,6 @@ export default {
pattern: "^([1-9]|[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", pattern: "^([1-9]|[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$",
message: this.$t("system_parameter_setting.msg_error"), message: this.$t("system_parameter_setting.msg_error"),
trigger: "blur", trigger: "blur",
required: true,
}, },
], ],
}, },

View File

@ -505,7 +505,7 @@
row-key="jsonPath" row-key="jsonPath"
ref="apiItemTable" ref="apiItemTable"
> >
<el-table-column prop="originName" :label="$t('dataset.parse_filed')" :show-overflow-tooltip="true" <el-table-column class-name="checkbox-table" prop="originName" :label="$t('dataset.parse_filed')" :show-overflow-tooltip="true"
width="255"> width="255">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox <el-checkbox
@ -1365,4 +1365,15 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
.checkbox-table {
.el-checkbox {
display: flex;
align-items: center;
.el-checkbox__input {
margin-top: 4px;
}
}
}
</style> </style>

View File

@ -7,6 +7,7 @@
v-closePress v-closePress
direction="rtl" direction="rtl"
> >
<div class="el-drawer__body-cont">
<div class="filter"> <div class="filter">
<span>{{ $t("log.optype") }}</span> <span>{{ $t("log.optype") }}</span>
<div class="filter-item"> <div class="filter-item">
@ -20,7 +21,6 @@
> >
</div> </div>
</div> </div>
<div class="el-drawer__body-cont">
<div class="filter"> <div class="filter">
<span>{{ $t("log.user") }}</span> <span>{{ $t("log.user") }}</span>
<div class="filter-item"> <div class="filter-item">
@ -243,8 +243,11 @@ export default {
}); });
} }
}); });
const [min, max] = this.dataRange; let [min, max] = this.dataRange;
if (min && max) { if (min && max) {
if (+min === +max) {
max = +max + 24 * 3600 * 1000;
}
conditions.push({ conditions.push({
field: "time", field: "time",
operator: "between", operator: "between",
@ -263,141 +266,3 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss">
.user-drawer-task {
.el-drawer__body-cont {
height: 100%;
box-sizing: border-box;
overflow: hidden;
width: 100%;
padding-bottom: 80px;
}
.el-drawer__header {
padding: 16px 24px;
margin: 0;
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: #1f2329;
position: relative;
box-sizing: border-box;
height: 57px;
mix-blend-mode: normal;
border-bottom: 1px solid rgba(187, 191, 196, 0.5);
.el-drawer__close-btn {
position: absolute;
right: 24px;
top: 16px;
padding: 4px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.el-drawer__close-btn:hover {
background: #e9e9ea;
}
}
.el-drawer__body {
padding: 12px 24px 24px 24px;
position: relative;
}
.filter {
display: flex;
min-height: 46px;
> :nth-child(1) {
color: #1f2329;
font-family: "PingFang SC";
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 24px;
white-space: nowrap;
width: 116px;
}
.filter-item {
flex: 1;
.item,
.more {
font-family: PingFang SC;
white-space: nowrap;
font-size: 14px;
font-weight: 400;
line-height: 24px;
margin-right: 12px;
text-align: center;
padding: 1px 6px;
background: #f5f6f7;
border-radius: 2px;
cursor: pointer;
display: inline-block;
margin-bottom: 12px;
}
.active,
.more:hover {
background: rgba(51, 112, 255, 0.1);
color: #0c296e;
}
.more {
white-space: nowrap;
}
}
}
.btn {
border-radius: 4px;
padding: 5px 26px 5px 26px;
font-family: PingFang SC;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: center;
border: none;
box-sizing: border-box;
}
.normal {
color: #1f2329;
border: 1px solid #bbbfc4;
margin-left: 12px;
}
.foot {
position: absolute;
height: 80px;
width: 100%;
padding: 24px;
right: 0;
bottom: 0;
text-align: right;
background-color: var(--MainBG, #fff);
box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05);
}
}
.user-popper {
padding: 0;
background: #fff;
.popper__arrow {
display: none;
}
}
.tree-select {
.el-select-dropdown__empty,
.el-scrollbar__wrap,
.popper__arrow {
display: none !important;
}
}
.user-popper.dept {
height: 400px;
overflow: auto;
}
</style>

View File

@ -124,6 +124,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
min-width="178" min-width="178"
class-name="f14"
key="datasetName" key="datasetName"
prop="datasetName" prop="datasetName"
:label="$t('dataset.task.dataset')" :label="$t('dataset.task.dataset')"
@ -917,4 +918,9 @@ span {
cursor: pointer; cursor: pointer;
} }
} }
.f14 {
.cell {
font-size: 12px !important;
}
}
</style> </style>

View File

@ -320,8 +320,11 @@ export default {
}); });
} }
}); });
const [min, max] = this.dataRange; let [min, max] = this.dataRange;
if (min && max) { if (min && max) {
if (+min === +max) {
max = +max + 24 * 3600 * 1000;
}
conditions.push({ conditions.push({
field: "dataset_table_task.last_exec_time", field: "dataset_table_task.last_exec_time",
operator: "between", operator: "between",
@ -340,142 +343,3 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss">
.user-drawer-task {
.el-drawer__body-cont {
height: 100%;
box-sizing: border-box;
overflow: hidden;
width: 100%;
padding-bottom: 80px;
}
.el-drawer__header {
padding: 16px 24px;
margin: 0;
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: #1f2329;
position: relative;
box-sizing: border-box;
height: 57px;
mix-blend-mode: normal;
border-bottom: 1px solid rgba(187, 191, 196, 0.5);
.el-drawer__close-btn {
position: absolute;
right: 24px;
top: 16px;
padding: 4px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.el-drawer__close-btn:hover {
background: #e9e9ea;
}
}
.el-drawer__body {
padding: 12px 24px 24px 24px;
position: relative;
}
.filter {
display: flex;
min-height: 46px;
> :nth-child(1) {
color: #1f2329;
font-family: "PingFang SC";
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 24px;
white-space: nowrap;
width: 116px;
}
.filter-item {
flex: 1;
.item,
.more {
font-family: PingFang SC;
white-space: nowrap;
font-size: 14px;
font-weight: 400;
line-height: 24px;
margin-right: 12px;
text-align: center;
padding: 1px 6px;
background: #f5f6f7;
border-radius: 2px;
cursor: pointer;
display: inline-block;
margin-bottom: 12px;
}
.active,
.more:hover {
background: rgba(51, 112, 255, 0.1);
color: #0c296e;
}
.more {
white-space: nowrap;
}
}
}
.btn {
border-radius: 4px;
padding: 5px 26px 5px 26px;
font-family: PingFang SC;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: center;
border: none;
box-sizing: border-box;
}
.normal {
color: #1f2329;
border: 1px solid #bbbfc4;
margin-left: 12px;
}
.foot {
position: absolute;
height: 80px;
width: 100%;
padding: 24px;
right: 0;
bottom: 0;
text-align: right;
background-color: var(--MainBG, #fff);
box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05);
}
}
.user-popper {
padding: 0;
background: #fff;
.popper__arrow {
display: none;
}
}
.tree-select {
.el-select-dropdown__empty,
.el-scrollbar__wrap,
.popper__arrow {
display: none !important;
}
}
.user-popper.dept {
height: 400px;
overflow: auto;
}
</style>

View File

@ -308,8 +308,11 @@ export default {
}); });
} }
}); });
const [min, max] = this.dataRange; let [min, max] = this.dataRange;
if (min && max) { if (min && max) {
if (+min === +max) {
max = +max + 24 * 3600 * 1000;
}
conditions.push({ conditions.push({
field: "dataset_table_task.last_exec_time", field: "dataset_table_task.last_exec_time",
operator: "between", operator: "between",
@ -328,142 +331,3 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss">
.user-drawer-task {
.el-drawer__body-cont {
height: 100%;
box-sizing: border-box;
overflow: hidden;
width: 100%;
padding-bottom: 80px;
}
.el-drawer__header {
padding: 16px 24px;
margin: 0;
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: #1f2329;
position: relative;
box-sizing: border-box;
height: 57px;
mix-blend-mode: normal;
border-bottom: 1px solid rgba(187, 191, 196, 0.5);
.el-drawer__close-btn {
position: absolute;
right: 24px;
top: 16px;
padding: 4px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
}
.el-drawer__close-btn:hover {
background: #e9e9ea;
}
}
.el-drawer__body {
padding: 12px 24px 24px 24px;
position: relative;
}
.filter {
display: flex;
min-height: 46px;
> :nth-child(1) {
color: #1f2329;
font-family: "PingFang SC";
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 24px;
white-space: nowrap;
width: 116px;
}
.filter-item {
flex: 1;
.item,
.more {
font-family: PingFang SC;
white-space: nowrap;
font-size: 14px;
font-weight: 400;
line-height: 24px;
margin-right: 12px;
text-align: center;
padding: 1px 6px;
background: #f5f6f7;
border-radius: 2px;
cursor: pointer;
display: inline-block;
margin-bottom: 12px;
}
.active,
.more:hover {
background: rgba(51, 112, 255, 0.1);
color: #0c296e;
}
.more {
white-space: nowrap;
}
}
}
.btn {
border-radius: 4px;
padding: 5px 26px 5px 26px;
font-family: PingFang SC;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: center;
border: none;
box-sizing: border-box;
}
.normal {
color: #1f2329;
border: 1px solid #bbbfc4;
margin-left: 12px;
}
.foot {
position: absolute;
height: 80px;
width: 100%;
padding: 24px;
right: 0;
bottom: 0;
text-align: right;
background-color: var(--MainBG, #fff);
box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05);
}
}
.user-popper {
padding: 0;
background: #fff;
.popper__arrow {
display: none;
}
}
.tree-select {
.el-select-dropdown__empty,
.el-scrollbar__wrap,
.popper__arrow {
display: none !important;
}
}
.user-popper.dept {
height: 400px;
overflow: auto;
}
</style>

View File

@ -7,114 +7,118 @@
v-closePress v-closePress
direction="rtl" direction="rtl"
> >
<div class="filter"> <div class="el-drawer__body-cont">
<span>{{ $t('commons.status')}}</span> <div class="filter">
<div class="filter-item"> <span>{{ $t("commons.status") }}</span>
<span <div class="filter-item">
class="item" <span
@click="statusChange(ele.id)" class="item"
:class="[activeStatus.includes(ele.id) ? 'active' : '']" @click="statusChange(ele.id)"
:key="ele.id" :class="[activeStatus.includes(ele.id) ? 'active' : '']"
v-for="ele in status" :key="ele.id"
>{{ $t(ele.label) }}</span> v-for="ele in status"
>{{ $t(ele.label) }}</span
>
</div>
</div> </div>
</div> <div class="filter">
<div class="filter"> <span>{{ $t("commons.organization") }}</span>
<span>{{ $t('commons.organization')}}</span> <div class="filter-item">
<div class="filter-item"> <span
<span class="item"
class="item" @click="activeDeptChange(ele.id)"
@click="activeDeptChange(ele.id)" :class="[activeDept.includes(ele.id) ? 'active' : '']"
:class="[activeDept.includes(ele.id) ? 'active' : '']" :key="ele.id"
:key="ele.id" v-for="ele in selectDeptsCahe"
v-for="ele in selectDeptsCahe" >{{ ele.label }}</span
>{{ ele.label }}</span> >
<el-popover
placement="bottom"
popper-class="user-popper"
width="200"
trigger="click"
>
<el-popover <el-popover
placement="bottom" placement="bottom"
popper-class="user-popper dept" popper-class="user-popper"
width="200" width="200"
trigger="click" trigger="click"
> >
<el-tree <el-popover
:load="loadNode" placement="bottom"
:lazy="true" popper-class="user-popper dept"
:expand-on-click-node="false" width="200"
:data="deptsComputed" trigger="click"
:props="defaultProps" >
@node-click="handleNodeClick" <el-tree
></el-tree> :load="loadNode"
:lazy="true"
:expand-on-click-node="false"
:data="deptsComputed"
:props="defaultProps"
@node-click="handleNodeClick"
></el-tree>
<el-select
ref="roleSelect"
v-model="selectDepts"
slot="reference"
popper-class="tree-select"
multiple
:placeholder="$t('commons.please_select')"
value-key="id"
>
<el-option
v-for="item in selectDepts"
:key="item.label"
:label="item.label"
:value="item"
/>
</el-select>
</el-popover>
<span class="more" slot="reference">+ {{ $t("panel.more") }}</span>
</el-popover>
</div>
</div>
<div class="filter">
<span>{{ $t("panel.role") }}</span>
<div class="filter-item">
<span
@click="activeRoleChange(ele.id)"
class="item"
:class="[activeRole.includes(ele.id) ? 'active' : '']"
:key="ele.id"
v-for="ele in rolesValueCopy"
>{{ ele.name }}</span
>
<el-popover
placement="bottom"
popper-class="user-popper"
width="200"
trigger="click"
>
<el-select <el-select
ref="roleSelect" ref="roleSelect"
v-model="selectDepts" v-model="rolesValue"
slot="reference"
popper-class="tree-select"
multiple multiple
:placeholder="$t('commons.please_select')" :placeholder="$t('commons.please_select')"
@change="changeRole"
@remove-tag="changeRole"
value-key="id" value-key="id"
> >
<el-option <el-option
v-for="item in selectDepts" v-for="item in rolesComputed"
:key="item.label" :key="item.name"
:label="item.label" :label="item.name"
:value="item" :value="item"
/> />
</el-select> </el-select>
<span class="more" slot="reference">+ {{ $t("panel.more") }}</span>
</el-popover> </el-popover>
<span class="more" slot="reference">+ {{ $t('panel.more')}}</span> </div>
</el-popover>
</div>
</div>
<div class="filter">
<span>{{ $t('panel.role')}}</span>
<div class="filter-item">
<span
@click="activeRoleChange(ele.id)"
class="item"
:class="[activeRole.includes(ele.id) ? 'active' : '']"
:key="ele.id"
v-for="ele in rolesValueCopy"
>{{ ele.name }}</span
>
<el-popover
placement="bottom"
popper-class="user-popper"
width="200"
trigger="click"
>
<el-select
ref="roleSelect"
v-model="rolesValue"
multiple
:placeholder="$t('commons.please_select')"
@change="changeRole"
@remove-tag="changeRole"
value-key="id"
>
<el-option
v-for="item in rolesComputed"
:key="item.name"
:label="item.name"
:value="item"
/>
</el-select>
<span class="more" slot="reference">+ {{ $t('panel.more')}}</span>
</el-popover>
</div> </div>
</div> </div>
<div class="foot"> <div class="foot">
<el-button class="btn normal" @click="reset">{{ <el-button class="btn normal" @click="reset">{{
$t("commons.reset") $t("commons.reset")
}}</el-button> }}</el-button>
<el-button type="primary" class="btn" @click="search">{{ <el-button type="primary" class="btn" @click="search">{{
$t("commons.adv_search.search") $t("commons.adv_search.search")
}}</el-button> }}</el-button>
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
@ -131,13 +135,16 @@ export default {
deptCahe: [], deptCahe: [],
roles: [], roles: [],
filterTextMap: [], filterTextMap: [],
status: [{ status: [
id: 1, {
label: 'commons.enable' id: 1,
},{ label: "commons.enable",
id: 0, },
label: 'commons.disable' {
}], id: 0,
label: "commons.disable",
},
],
activeStatus: [], activeStatus: [],
rolesValue: [], rolesValue: [],
activeRole: [], activeRole: [],
@ -150,56 +157,72 @@ export default {
label: "label", label: "label",
isLeaf: "leaf", isLeaf: "leaf",
}, },
userDrawer: false userDrawer: false,
}; };
}, },
computed: { computed: {
rolesComputed() { rolesComputed() {
return this.roles.filter(ele => !this.activeRole.includes(ele.id)) return this.roles.filter((ele) => !this.activeRole.includes(ele.id));
}, },
rolesValueCopy() { rolesValueCopy() {
return this.roleCahe.filter(ele => this.activeRole.includes(ele.id)) return this.roleCahe.filter((ele) => this.activeRole.includes(ele.id));
}, },
deptsComputed() { deptsComputed() {
return this.depts.filter(ele => !this.activeDept.includes(ele.id)) return this.depts.filter((ele) => !this.activeDept.includes(ele.id));
} },
}, },
mounted() { mounted() {
this.initRoles(); this.initRoles();
}, },
methods: { methods: {
clearFilter() { clearFilter() {
Array(3).fill(1).forEach((_, index) => { Array(3)
this.clearOneFilter(index) .fill(1)
}) .forEach((_, index) => {
this.$emit('search', [], []) this.clearOneFilter(index);
});
this.$emit("search", [], []);
}, },
clearOneFilter(index) { clearOneFilter(index) {
(this.filterTextMap[index] || []).forEach(ele => { (this.filterTextMap[index] || []).forEach((ele) => {
this[ele] = [] this[ele] = [];
}) });
}, },
// //
treeByDeptId() { treeByDeptId() {
treeByDeptId(0).then((res) => { treeByDeptId(0).then((res) => {
this.depts = (res.data || []).map(ele => { this.depts = (res.data || []).map((ele) => {
return { return {
...ele, ...ele,
leaf: !ele.hasChildren, leaf: !ele.hasChildren,
} };
}) });
}); });
}, },
changeRole() { changeRole() {
if (this.roleCahe.length > this.rolesValue.length + this.activeRole.length) { if (
this.roleCahe = this.roleCahe.filter(ele => this.rolesValue.map(ele => ele.id).concat(this.activeRole).includes(ele.id)); this.roleCahe.length >
this.rolesValue.length + this.activeRole.length
) {
this.roleCahe = this.roleCahe.filter((ele) =>
this.rolesValue
.map((ele) => ele.id)
.concat(this.activeRole)
.includes(ele.id)
);
return; return;
} }
const roleIdx = this.rolesValue.findIndex(ele => !this.roleCahe.map(ele => ele.id).concat(this.activeRole).includes(ele.id)); const roleIdx = this.rolesValue.findIndex(
if (roleIdx === -1) return (ele) =>
this.activeRole.push(this.rolesValue[roleIdx].id) !this.roleCahe
.map((ele) => ele.id)
.concat(this.activeRole)
.includes(ele.id)
);
if (roleIdx === -1) return;
this.activeRole.push(this.rolesValue[roleIdx].id);
this.roleCahe.push(this.rolesValue[roleIdx]); this.roleCahe.push(this.rolesValue[roleIdx]);
this.rolesValue.splice(roleIdx, 1) this.rolesValue.splice(roleIdx, 1);
}, },
activeRoleChange(id) { activeRoleChange(id) {
const roleIndex = this.activeRole.findIndex((ele) => ele === id); const roleIndex = this.activeRole.findIndex((ele) => ele === id);
@ -216,22 +239,26 @@ export default {
const deptIdx = this.selectDepts.findIndex((ele) => ele.id === id); const deptIdx = this.selectDepts.findIndex((ele) => ele.id === id);
if (deptIdx !== -1) { if (deptIdx !== -1) {
this.selectDepts.splice(deptIdx, 1); this.selectDepts.splice(deptIdx, 1);
this.selectDeptsCahe = this.selectDeptsCahe.filter(ele => ele.id !== id) this.selectDeptsCahe = this.selectDeptsCahe.filter(
this.deptCahe = this.deptCahe.filter(ele => ele.id !== id) (ele) => ele.id !== id
);
this.deptCahe = this.deptCahe.filter((ele) => ele.id !== id);
return; return;
} }
this.activeDept.push(id) this.activeDept.push(id);
this.selectDeptsCahe.push({ id, label }); this.selectDeptsCahe.push({ id, label });
this.deptCahe.push({ id, label }); this.deptCahe.push({ id, label });
}, },
activeDeptChange(id) { activeDeptChange(id) {
const dept = this.deptCahe.find((ele) => ele.id === id) const dept = this.deptCahe.find((ele) => ele.id === id);
this.selectDepts.push(dept); this.selectDepts.push(dept);
this.activeDept = this.activeDept.filter(ele => ele !== id) this.activeDept = this.activeDept.filter((ele) => ele !== id);
this.selectDeptsCahe = this.selectDeptsCahe.filter(ele => ele.id !== id) this.selectDeptsCahe = this.selectDeptsCahe.filter(
(ele) => ele.id !== id
);
}, },
statusChange(id) { statusChange(id) {
const statusIndex = this.activeStatus.findIndex((ele) => ele === id); const statusIndex = this.activeStatus.findIndex((ele) => ele === id);
if (statusIndex === -1) { if (statusIndex === -1) {
this.activeStatus.push(id); this.activeStatus.push(id);
} else { } else {
@ -239,8 +266,8 @@ export default {
} }
}, },
changeDepts() { changeDepts() {
const depts = this.selectDepts.map((item) => item.id); const depts = this.selectDepts.map((item) => item.id);
this.activeDept = this.activeDept.filter((ele) => depts.includes(ele)); this.activeDept = this.activeDept.filter((ele) => depts.includes(ele));
}, },
loadNode(node, resolve) { loadNode(node, resolve) {
if (!this.depts.length) { if (!this.depts.length) {
@ -248,7 +275,9 @@ export default {
return; return;
} }
getDeptTree(node.data.id).then((res) => { getDeptTree(node.data.id).then((res) => {
const filterDept = (res.data || []).filter(ele => !this.activeDept.includes(ele.deptId)) const filterDept = (res.data || []).filter(
(ele) => !this.activeDept.includes(ele.deptId)
);
resolve( resolve(
filterDept.map((dept) => { filterDept.map((dept) => {
return this.normalizer(dept); return this.normalizer(dept);
@ -270,38 +299,61 @@ export default {
}, },
search() { search() {
this.userDrawer = false; this.userDrawer = false;
this.$emit('search', this.formatCondition(), this.formatText()) this.$emit("search", this.formatCondition(), this.formatText());
}, },
formatText() { formatText() {
this.filterTextMap = []; this.filterTextMap = [];
const params = []; const params = [];
if (this.activeStatus.length) { if (this.activeStatus.length) {
let str = `${this.$t('kettle.status')}:${this.activeStatus.reduce((pre,next) => (this.status.find(ele => ele.id === next) || {}).label + '、' + pre, '')}`; let str = `${this.$t("kettle.status")}:${this.activeStatus.reduce(
params.push(str.slice(0, str.length - 1 )) (pre, next) =>
this.filterTextMap.push(['activeStatus']) (this.status.find((ele) => ele.id === next) || {}).label +
"、" +
pre,
""
)}`;
params.push(str.slice(0, str.length - 1));
this.filterTextMap.push(["activeStatus"]);
} }
if (this.activeDept.length) { if (this.activeDept.length) {
params.push(`${this.$t('panel.org')}:${this.selectDeptsCahe.map(ele => ele.label).join('、')}`) params.push(
this.filterTextMap.push(['activeDept', 'selectDepts', 'selectDeptsCahe', 'deptCahe']) `${this.$t("panel.org")}:${this.selectDeptsCahe
.map((ele) => ele.label)
.join("、")}`
);
this.filterTextMap.push([
"activeDept",
"selectDepts",
"selectDeptsCahe",
"deptCahe",
]);
} }
if (this.activeRole.length) { if (this.activeRole.length) {
params.push(`${this.$t('panel.role')}:${this.rolesValueCopy.map(ele => ele.name).join('、')}`) params.push(
this.filterTextMap.push(['rolesValue', 'activeRole', 'roleCahe']) `${this.$t("panel.role")}:${this.rolesValueCopy
.map((ele) => ele.name)
.join("、")}`
);
this.filterTextMap.push(["rolesValue", "activeRole", "roleCahe"]);
} }
return params; return params;
}, },
formatCondition() { formatCondition() {
const fildMap = {'r.role_id': this.activeRole, 'd.dept_id': this.activeDept, 'u.enabled': this.activeStatus} const fildMap = {
const conditions = [] "r.role_id": this.activeRole,
Object.keys(fildMap).forEach(ele => { "d.dept_id": this.activeDept,
"u.enabled": this.activeStatus,
};
const conditions = [];
Object.keys(fildMap).forEach((ele) => {
if (fildMap[ele].length) { if (fildMap[ele].length) {
conditions.push({ conditions.push({
field: ele, field: ele,
operator: 'in', operator: "in",
value: fildMap[ele] value: fildMap[ele],
}) });
} }
}) });
return conditions; return conditions;
}, },
init() { init() {
@ -309,134 +361,8 @@ export default {
}, },
reset() { reset() {
this.userDrawer = false; this.userDrawer = false;
this.clearFilter() this.clearFilter();
}, },
}, },
}; };
</script> </script>
<style lang="scss">
.user-drawer {
.el-drawer__header {
padding: 16px 24px;
margin: 0;
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: #1f2329;
position: relative;
box-sizing: border-box;
height: 57px;
mix-blend-mode: normal;
border-bottom: 1px solid rgba(187, 191, 196, 0.5);
.el-drawer__close-btn {
position: absolute;
right: 24px;
top: 16px;
padding: 4px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center
}
.el-drawer__close-btn:hover {
background: #e9e9ea;
}
}
.el-drawer__body {
padding: 12px 24px 24px 24px;
position: relative;
}
.filter {
display: flex;
min-height: 46px;
> :nth-child(1) {
color: #1f2329;
font-family: "PingFang SC";
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 24px;
white-space: nowrap;
width: 116px;
}
.filter-item {
flex: 1;
.item,
.more {
font-family: PingFang SC;
white-space: nowrap;
font-size: 14px;
font-weight: 400;
line-height: 24px;
margin-right: 12px;
text-align: center;
padding: 1px 6px;
background: #f5f6f7;
border-radius: 2px;
cursor: pointer;
display: inline-block;
margin-bottom: 12px;
}
.active,
.more:hover{
background: rgba(51, 112, 255, 0.1);
color: #0c296e;
}
.more {
white-space: nowrap;
}
}
}
.btn {
border-radius: 4px;
padding: 5px 26px 5px 26px;
font-family: PingFang SC;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: center;
border: none;
box-sizing: border-box;
}
.normal {
color: #1f2329;
border: 1px solid #bbbfc4;
margin-left: 12px;
}
.foot {
position: absolute;
right: 24px;
bottom: 24px;
text-align: right;
}
}
.user-popper {
padding: 0;
background: #fff;
.popper__arrow {
display: none;
}
}
.tree-select {
.el-select-dropdown__empty,
.el-scrollbar__wrap,
.popper__arrow {
display: none !important;
}
}
.user-popper.dept {
height: 400px;
overflow: auto;
}
</style>