Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
wangjiahao 2021-05-18 18:39:32 +08:00
commit 8a88c0bca9
26 changed files with 146 additions and 77 deletions

View File

@ -10,7 +10,7 @@
<select id="search" resultMap="BaseResultMapDTO">
select
id, `name`, scene_id, data_source_id, `type`, `mode`, create_by, create_time,
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
get_auths(id,'dataset',#{userId}) as `privileges`
from dataset_table
<where>

View File

@ -21,7 +21,7 @@ public class DefaultLicenseService {
private static final String LICENSE_ID = "fit2cloud_license";
private static final String validatorUtil = "/usr/bin/validator";
private static final String product = "dataease";
private static final String product = "DataEase";
/*private static final String[] NO_PLU_LIMIT_MODULES = new String[]{"dashboard", "gateway"};*/
public F2CLicenseResponse validateLicense(String product, String licenseKey){

View File

@ -31,6 +31,6 @@ public interface StoreApi {
@ApiOperation("移除收藏")
@PostMapping("/remove/{storeId}")
void remove(@PathVariable("storeId") Long storeId);
void remove(@PathVariable("storeId") String storeId);
}

View File

@ -16,7 +16,7 @@ public class StoreServer implements StoreApi {
private StoreService storeService;
@Override
public void store( String id) {
public void store(String id) {
storeService.save(id);
}
@ -26,7 +26,12 @@ public class StoreServer implements StoreApi {
}
@Override
public void remove( Long storeId) {
storeService.remove(storeId);
public void remove(String storeId) {
try {
Long id = Long.parseLong(storeId);
storeService.remove(id);
} catch (Exception e) {
storeService.removeByPanelId(storeId);
}
}
}

View File

@ -382,9 +382,10 @@ public class JdbcProvider extends DatasourceProvider {
case doris:
return "show tables;";
case sqlServer:
return "SELECT TABLE_NAME FROM fit2cloud2.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';";
SqlServerConfigration sqlServerConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), SqlServerConfigration.class);
return "SELECT TABLE_NAME FROM DATABASE.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';".replace("DATABASE", sqlServerConfigration.getDataBase());
default:
return "show tables;";
}
}
}
}

View File

@ -15,8 +15,8 @@ import java.util.Optional;
@Service
public class AboutService {
private static final String BUILD_VERSION = "/opt/fit2cloud/conf/version";
private static final String product = "dataease";
private static final String BUILD_VERSION = "/opt/dataease/conf/version";
private static final String product = "DataEase";
@Resource
private DefaultLicenseService defaultLicenseService;

View File

@ -661,12 +661,15 @@ public class DataSetTableService {
for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) {
if (i == 0) {
TableFiled tableFiled = new TableFiled();
tableFiled.setFieldName(readCell(row.getCell(j)));
tableFiled.setRemarks(readCell(row.getCell(j)));
tableFiled.setFieldType("TEXT");
if(StringUtils.isEmpty(tableFiled.getFieldName())){
continue;
tableFiled.setFieldSize(1024);
String columnName = readCell(row.getCell(j));
if(StringUtils.isEmpty(columnName)){
columnName = "NONE_" + String.valueOf(j);
}
tableFiled.setFieldName(columnName);
tableFiled.setRemarks(columnName);
fields.add(tableFiled);
} else {
r[j] = readCell(row.getCell(j));
@ -694,10 +697,14 @@ public class DataSetTableService {
for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) {
if (i == 0) {
TableFiled tableFiled = new TableFiled();
tableFiled.setFieldName(readCell(row.getCell(j)));
tableFiled.setRemarks(readCell(row.getCell(j)));
tableFiled.setFieldType("TEXT");
tableFiled.setFieldSize(1024);
String columnName = readCell(row.getCell(j));
if(StringUtils.isEmpty(columnName)){
columnName = "NONE_" + String.valueOf(j);
}
tableFiled.setFieldName(columnName);
tableFiled.setRemarks(columnName);
fields.add(tableFiled);
} else {
r[j] = readCell(row.getCell(j));

View File

@ -497,8 +497,14 @@ public class ExtractDataService {
}
private StepMeta excelInputStep(String filePath, List<DatasetTableField> datasetTableFields) {
String suffix = filePath.substring(filePath.lastIndexOf(".") + 1);
ExcelInputMeta excelInputMeta = new ExcelInputMeta();
excelInputMeta.setSpreadSheetType(SpreadSheetType.SAX_POI);
if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {
excelInputMeta.setSpreadSheetType(SpreadSheetType.SAX_POI);
}
if (StringUtils.equalsIgnoreCase(suffix, "xls")) {
excelInputMeta.setSpreadSheetType(SpreadSheetType.JXL);
}
excelInputMeta.setPassword("Encrypted");
excelInputMeta.setFileName(new String[]{filePath});
excelInputMeta.setStartsWithHeader(true);

View File

@ -1,6 +1,7 @@
package io.dataease.service.panel;
import io.dataease.base.domain.PanelStore;
import io.dataease.base.domain.PanelStoreExample;
import io.dataease.base.mapper.PanelStoreMapper;
import io.dataease.base.mapper.ext.ExtPanelStoreMapper;
import io.dataease.base.mapper.ext.query.GridExample;
@ -9,6 +10,7 @@ import io.dataease.controller.sys.base.BaseGridRequest;
import io.dataease.controller.sys.base.ConditionEntity;
import io.dataease.dto.panel.PanelStoreDto;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@ -22,7 +24,7 @@ public class StoreService {
@Resource
private ExtPanelStoreMapper extPanelStoreMapper;
public void save(String panelGroupId){
public void save(String panelGroupId) {
Long userId = AuthUtils.getUser().getUserId();
PanelStore panelStore = new PanelStore();
panelStore.setCreateTime(System.currentTimeMillis());
@ -31,24 +33,31 @@ public class StoreService {
panelStoreMapper.insert(panelStore);
}
public void removeByPanelId(String panelId) {
PanelStoreExample panelStoreExample = new PanelStoreExample();
panelStoreExample.createCriteria().andPanelGroupIdEqualTo(panelId);
panelStoreMapper.deleteByExample(panelStoreExample);
}
public void remove(Long storeId){
public void remove(Long storeId) {
panelStoreMapper.deleteByPrimaryKey(storeId);
}
/**
* 按照当前用户ID查询收藏仪表板
*
* @param request
* @return
*/
public List<PanelStoreDto> query(BaseGridRequest request){
public List<PanelStoreDto> query(BaseGridRequest request) {
Long userId = AuthUtils.getUser().getUserId();
ConditionEntity condition = new ConditionEntity();
condition.setField("s.user_id");
condition.setOperator("eq");
condition.setValue(userId);
request.setConditions(new ArrayList<ConditionEntity>(){{add(condition);}});
request.setConditions(new ArrayList<ConditionEntity>() {{
add(condition);
}});
GridExample example = request.convertExample();
List<PanelStoreDto> stores = extPanelStoreMapper.query(example);
return stores;

View File

@ -44,6 +44,7 @@ CREATE TABLE `datasource` (
`configuration` longtext NOT NULL COMMENT '详细信息',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
`create_by` varchar(50) COMMENT '创建人ID',
PRIMARY KEY (`id`)
)ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;

View File

@ -50,8 +50,8 @@ INSERT INTO `sys_menu` VALUES (52, 1, 0, 1, '关于', '关于', 'system/about/in
COMMIT;
BEGIN;
INSERT INTO `sys_user` VALUES (4, 0, 'admin', '管理员', '', NULL, 'admin@fit2cloud.com', 'e10adc3949ba59abbe56e057f20f883e', b'1', 1, NULL, NULL, NULL, NULL, 1615184951534,NULL);
INSERT INTO `sys_user` VALUES (19, 25, 'demo', 'demo', '', NULL, 'demo@fit2cloud.com', 'e10adc3949ba59abbe56e057f20f883e', b'0', 0, NULL, NULL, NULL, 1619086036234, 1619086036234,NULL);
INSERT INTO `sys_user` VALUES (4, 0, 'admin', '管理员', '', NULL, 'admin@fit2cloud.com', '40b8893ea9ebc2d631c4bb42bb1e8996', b'1', 1, NULL, NULL, NULL, NULL, 1615184951534,NULL);
INSERT INTO `sys_user` VALUES (19, 25, 'demo', 'demo', '', NULL, 'demo@fit2cloud.com', '40b8893ea9ebc2d631c4bb42bb1e8996', b'0', 0, NULL, NULL, NULL, 1619086036234, 1619086036234,NULL);
COMMIT;

View File

@ -4,13 +4,13 @@
<svg-icon class-name="international-icon" icon-class="language" />
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :disabled="language==='zh'" command="zh">
<el-dropdown-item :disabled="language==='zh_CN'" command="zh_CN">
简体
</el-dropdown-item>
<el-dropdown-item :disabled="language==='tw'" command="tw">
<el-dropdown-item :disabled="language==='zh_TW'" command="zh_TW">
繁体
</el-dropdown-item>
<el-dropdown-item :disabled="language==='en'" command="en">
<el-dropdown-item :disabled="language==='en_US'" command="en_US">
English
</el-dropdown-item>
<!-- <el-dropdown-item :disabled="language==='es'" command="es">

View File

@ -6,8 +6,9 @@
{{ message }}
</div>
</div>
<chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table')" :ref="element.propValue.id" class="chart-class" :chart="chart" />
<table-normal v-if="requestStatus==='success'&&chart.type && chart.type.includes('table')" :chart="chart" class="table-class" />
<chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" />
<table-normal v-if="requestStatus==='success'&&chart.type && chart.type.includes('table')" :ref="element.propValue.id" :chart="chart" class="table-class" />
<label-normal v-if="requestStatus==='success'&&chart.type && chart.type.includes('text')" :ref="element.propValue.id" :chart="chart" class="table-class" />
</div>
</template>
@ -16,6 +17,7 @@
import { viewData } from '@/api/panel/panel'
import ChartComponent from '@/views/chart/components/ChartComponent.vue'
import TableNormal from '@/views/chart/components/table/TableNormal'
import LabelNormal from '../../../views/chart/components/normal/LabelNormal'
import { mapState } from 'vuex'
@ -33,7 +35,7 @@ import {
export default {
name: 'UserView',
components: { ChartComponent, TableNormal },
components: { ChartComponent, TableNormal, LabelNormal },
props: {
element: {
type: Object

View File

@ -4,13 +4,11 @@ import Cookies from 'js-cookie'
import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
import elementTWLocale from 'element-ui/lib/locale/lang/zh-TW'// element-ui lang
import elementEsLocale from 'element-ui/lib/locale/lang/es'// element-ui lang
import elementJaLocale from 'element-ui/lib/locale/lang/ja'// element-ui lang
import enLocale from './en'
import zhLocale from './zh'
import twLocale from './tw'
import esLocale from './es'
import jaLocale from './ja'
import fuZh from 'fit2cloud-ui/src/locale/lang/zh-CN' // 加载fit2cloud的内容
import fuEn from 'fit2cloud-ui/src/locale/lang/en_US' // 加载fit2cloud的内容
@ -18,27 +16,19 @@ import fuEn from 'fit2cloud-ui/src/locale/lang/en_US' // 加载fit2cloud的内
Vue.use(VueI18n)
const messages = {
en: {
en_US: {
...enLocale,
...elementEnLocale,
...fuEn
},
zh: {
zh_CN: {
...zhLocale,
...elementZhLocale,
...fuZh
},
tw: {
zh_TW: {
...twLocale,
...elementTWLocale
},
es: {
...esLocale,
...elementEsLocale
},
ja: {
...jaLocale,
...elementJaLocale
}
}
export function getLanguage() {
@ -53,7 +43,7 @@ export function getLanguage() {
return locale
}
}
return 'zh'
return 'zh_CN'
}
const i18n = new VueI18n({
// set locale

View File

@ -87,6 +87,7 @@ export default {
password_error: '密码不小于6位'
},
commons: {
close: '关闭',
icon: '图标',
all: '全部',
enable: '启用',

View File

@ -67,7 +67,6 @@ Vue.use(message)
Vue.config.productionTip = false
Vue.prototype.hasDataPermission = function(pTarget, pSource) {
debugger
if (pSource && pTarget) {
return pSource.indexOf(pTarget) > -1
}

View File

@ -4,6 +4,7 @@ import { resetRouter } from '@/router'
import { format } from '@/utils/formatUi'
import { getLanguage } from '@/lang/index'
import Cookies from 'js-cookie'
import router from '@/router'
const getDefaultState = () => {
return {
token: getToken(),
@ -101,6 +102,9 @@ const actions = {
commit('SET_PERMISSIONS', permissions)
commit('SET_LANGUAGE', language)
// axios.defaults.headers.common['Accept-Language'] = language || 'zh_CN'
// document.querySelector('html').setAttribute('lang', language || 'zh_CN')
resolve(data)
}).catch(error => {
reject(error)
@ -155,6 +159,7 @@ const actions = {
setLanguage({ commit }, language) {
languageApi(language).then(() => {
commit('SET_LANGUAGE', language)
router.go(0)
})
}
}

View File

@ -34,6 +34,10 @@ service.interceptors.request.use(
if ((linkToken = getLinkToken()) !== null) {
config.headers[LinkTokenKey] = linkToken
}
if (i18n.locale) {
config.headers['Accept-Language'] = i18n.locale
}
// 增加loading
config.loading && tryShowLoading(store.getters.currentPath)

View File

@ -20,6 +20,7 @@
<script>
import { hexColorToRGBA } from '../../chart/util'
import eventBus from '@/components/canvas/utils/eventBus'
export default {
name: 'LabelNormal',
@ -83,6 +84,10 @@ export default {
mounted() {
this.init()
this.calcHeight()
//
eventBus.$on('resizing', (componentId) => {
this.chartResize()
})
},
methods: {
init() {
@ -94,14 +99,14 @@ export default {
},
calcHeight() {
const that = this
setTimeout(function() {
// const currentHeight = document.documentElement.clientHeight
// const tableMaxHeight = currentHeight - 56 - 40 - 84 - that.$refs.title.offsetHeight - 20
const currentHeight = that.$refs.tableContainer.offsetHeight
const contentHeight = currentHeight - that.$refs.title.offsetHeight
that.height = contentHeight + 'px'
that.content_class.height = that.height
}, 10)
this.$nextTick(function() {
if (that.$refs.tableContainer) {
const currentHeight = that.$refs.tableContainer.offsetHeight
const contentHeight = currentHeight - that.$refs.title.offsetHeight
that.height = contentHeight + 'px'
that.content_class.height = that.height
}
})
},
initStyle() {
if (this.chart.customAttr) {
@ -135,6 +140,10 @@ export default {
this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
}
}
},
chartResize() {
//
this.calcHeight()
}
}
}

View File

@ -33,6 +33,7 @@
<script>
import { hexColorToRGBA } from '../../chart/util'
import eventBus from '@/components/canvas/utils/eventBus'
export default {
name: 'TableNormal',
@ -91,6 +92,10 @@ export default {
mounted() {
this.init()
this.calcHeight()
//
eventBus.$on('resizing', (componentId) => {
this.chartResize()
})
},
methods: {
init() {
@ -111,23 +116,23 @@ export default {
},
calcHeight() {
const that = this
setTimeout(function() {
// const currentHeight = document.documentElement.clientHeight
// const tableMaxHeight = currentHeight - 56 - 40 - 84 - that.$refs.title.offsetHeight - 20
const currentHeight = that.$refs.tableContainer.offsetHeight
const tableMaxHeight = currentHeight - that.$refs.title.offsetHeight
let tableHeight
if (that.chart.data) {
tableHeight = (that.chart.data.tableRow.length + 2) * 36
} else {
tableHeight = 0
this.$nextTick(function() {
if (that.$refs.tableContainer) {
const currentHeight = that.$refs.tableContainer.offsetHeight
const tableMaxHeight = currentHeight - that.$refs.title.offsetHeight
let tableHeight
if (that.chart.data) {
tableHeight = (that.chart.data.tableRow.length + 2) * 36
} else {
tableHeight = 0
}
if (tableHeight > tableMaxHeight) {
that.height = tableMaxHeight + 'px'
} else {
that.height = 'auto'
}
}
if (tableHeight > tableMaxHeight) {
that.height = tableMaxHeight + 'px'
} else {
that.height = 'auto'
}
}, 10)
})
},
initStyle() {
if (this.chart.customAttr) {
@ -207,6 +212,11 @@ export default {
})
// ()
return [means]
},
chartResize() {
//
this.calcHeight()
}
}
}

View File

@ -32,8 +32,8 @@
<div v-if="valid" class="auth-root-class">
<span slot="footer">
<el-button v-if="!form.enablePwd" v-clipboard:copy="form.uri" v-clipboard:success="onCopy" v-clipboard:error="onError" type="primary">复制链接</el-button>
<el-button v-if="form.enablePwd" v-clipboard:copy="form.uri + ' 密码: '+ form.pwd" v-clipboard:success="onCopy" v-clipboard:error="onError" type="primary">复制链接及密码</el-button>
<el-button v-if="!form.enablePwd" v-clipboard:copy="form.uri" v-clipboard:success="onCopy" v-clipboard:error="onError" size="mini" type="primary">复制链接</el-button>
<el-button v-if="form.enablePwd" v-clipboard:copy="form.uri + ' 密码: '+ form.pwd" v-clipboard:success="onCopy" v-clipboard:error="onError" size="mini" type="primary">复制链接及密码</el-button>
</span>
</div>

View File

@ -14,8 +14,8 @@
</el-tabs>
<div class="auth-root-class">
<span slot="footer">
<el-button @click="cancel">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" @click="save">{{ $t('commons.confirm') }}</el-button>
<el-button size="mini" @click="cancel">{{ $t('commons.cancel') }}</el-button>
<el-button type="primary" size="mini" @click="save">{{ $t('commons.confirm') }}</el-button>
</span>
</div>
</div>

View File

@ -362,6 +362,10 @@ export default {
border: none;
}
.ms-main-container {
height: calc(100vh - 91px);
}
.de-header {
height: 35px !important;
border-bottom: 1px solid #E6E6E6;

View File

@ -30,7 +30,10 @@
<el-row>
<span class="header-title">
{{ $t('panel.panel') }}
<el-button style="float: right;padding-right: 7px;" type="text" icon="el-icon-circle-plus" @click="showEditPanel(newFolder)" />
<!-- <el-button style="float: right;padding-right: 7px;" type="text" @click="showEditPanel(newFolder)" />-->
<el-button style="float: right;" type="primary" size="mini" @click="showEditPanel(newFolder)">
{{ $t('panel.groupAdd') }}
</el-button>
</span>
</el-row>
<el-col class="custom-tree-container">
@ -331,12 +334,14 @@ export default {
this.editPanel.panelInfo.name = this.$t('panel.panelAdd')
this.editPanel.panelInfo.pid = param.data.id
this.editPanel.panelInfo.level = param.data.level + 1
this.editPanel.panelInfo.panelType = 'self'
break
case 'newFirstFolder':
this.editPanel.titlePre = this.$t('commons.create')
this.editPanel.panelInfo.name = ''
this.editPanel.panelInfo.pid = null
this.editPanel.panelInfo.level = 0
this.editPanel.panelInfo.panelType = 'self'
break
case 'edit':
case 'rename':

View File

@ -28,11 +28,13 @@
</el-form-item>
<el-form-item :label="$t('commons.organization')" prop="dept">
<treeselect
ref="deptTreeSelect"
v-model="form.deptId"
:options="depts"
:load-options="loadDepts"
:auto-load-root-options="false"
:placeholder="$t('user.choose_org')"
@open="filterData"
/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
@ -257,6 +259,15 @@ export default {
},
backToList() {
this.$router.push({ name: '用户管理' })
},
filterData(instanceId) {
const results = this.depts.map(node => {
if (node.hasChildren) {
node.children = null
}
return node
})
this.depts = results
}
}
}

View File

@ -175,7 +175,7 @@ export default {
}
],
searchConfig: {
useQuickSearch: false,
useQuickSearch: true,
quickPlaceholder: '按姓名搜索',
components: [
{ field: 'nick_name', label: '姓名', component: 'FuComplexInput' },