Merge remote-tracking branch 'origin/master'

main
liu.shiyi 2 years ago
commit c4967b40da

@ -1,11 +0,0 @@
const config = {
name: 'JS数据集',
datasetType: 'js',
className: 'com.gccloud.dataset.entity.config.JsDataSetConfig',
componentName: 'JsDataSet',
showOperate: true
}
export default {
config
}

@ -72,7 +72,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../packages/assets/style/bsTheme.scss'; @import '../../../assets/style/bsTheme.scss';
::v-deep .el-dialog__body { ::v-deep .el-dialog__body {
height: fit-content; height: fit-content;

@ -108,5 +108,5 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../packages/assets/style/bsTheme.scss'; @import '../../../assets/style/bsTheme.scss';
</style> </style>

@ -217,5 +217,5 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../packages/assets/style/bsTheme.scss'; @import '../../../assets/style/bsTheme.scss';
</style> </style>

@ -352,16 +352,16 @@
</template> </template>
<script> <script>
import ParamsSettingDialog from './ParamsSettingDialog.vue' import ParamsSettingDialog from './JsComponents/ParamsSettingDialog.vue'
import OutputFieldDialog from './OutputFieldDialog.vue' import OutputFieldDialog from './JsComponents/OutputFieldDialog.vue'
import FieldFillDialog from './FieldFillDialog.vue' import FieldFillDialog from './JsComponents/FieldFillDialog.vue'
import { nameCheckRepeat, datasetAdd, datasetUpdate, getDataset, getCategoryTree } from 'data-room-ui/js/utils/datasetConfigService' import { nameCheckRepeat, datasetAdd, datasetUpdate, getDataset, getCategoryTree } from 'data-room-ui/js/utils/datasetConfigService'
import { codemirror } from 'vue-codemirror' import { codemirror } from 'vue-codemirror'
import 'codemirror/mode/javascript/javascript' import 'codemirror/mode/javascript/javascript'
import 'codemirror/lib/codemirror.css' import 'codemirror/lib/codemirror.css'
import 'codemirror/theme/nord.css' import 'codemirror/theme/nord.css'
export default { export default {
name: 'JsDataSet', name: 'JsEditForm',
components: { components: {
codemirror, codemirror,
FieldFillDialog, FieldFillDialog,
@ -742,7 +742,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../packages/assets/style/bsTheme.scss'; @import '../../assets/style/bsTheme.scss';
.data-set-scrollbar { .data-set-scrollbar {
height: 100%; height: 100%;

@ -239,6 +239,7 @@
<script> <script>
import TypeTree from './TypeTree.vue' import TypeTree from './TypeTree.vue'
import JsEditForm from './JsEditForm.vue'
import JsonEditForm from './JsonEditForm.vue' import JsonEditForm from './JsonEditForm.vue'
import table from 'data-room-ui/js/utils/table.js' import table from 'data-room-ui/js/utils/table.js'
import ScriptEditForm from './ScriptEditForm.vue' import ScriptEditForm from './ScriptEditForm.vue'
@ -261,7 +262,8 @@ export default {
CustomEditForm, CustomEditForm,
JsonEditForm, JsonEditForm,
StoredProcedureEditForm, StoredProcedureEditForm,
ScriptEditForm ScriptEditForm,
JsEditForm
}, },
mixins: [pageMixins], mixins: [pageMixins],
props: { props: {
@ -456,6 +458,8 @@ export default {
}, },
// - // -
openAddForm (type, componentName) { openAddForm (type, componentName) {
console.log('type', type)
console.log('componentName', componentName)
this.datasetType = type this.datasetType = type
this.componentData = this.getComponents(componentName) this.componentData = this.getComponents(componentName)
this.typeId = this.queryForm.typeId this.typeId = this.queryForm.typeId
@ -465,17 +469,18 @@ export default {
return this.getComponents(this.datasetTypeList.find(type => type.datasetType === datasetType)?.componentName)?.config?.showOperate ?? true return this.getComponents(this.datasetTypeList.find(type => type.datasetType === datasetType)?.componentName)?.config?.showOperate ?? true
}, },
getComponents (componentName) { getComponents (componentName) {
if (window.BS_CONFIG?.customDatasetComponents && window.BS_CONFIG?.customDatasetComponents.length > 0) {
const components = Object.values(this.$options.components) const components = Object.values(this.$options.components)
let remoteComponentData = null let remoteComponentData = null
if (window.BS_CONFIG?.customDatasetComponents && window.BS_CONFIG?.customDatasetComponents.length > 0) {
// //
remoteComponentData = window.BS_CONFIG?.customDatasetComponents.find(item => item.config.componentName === componentName) remoteComponentData = window.BS_CONFIG?.customDatasetComponents.find(item => item.config.componentName === componentName)
}
return { return {
component: components.find(component => component.name === componentName) || remoteComponentData?.vueFile, component: components.find(component => component.name === componentName) || remoteComponentData?.vueFile,
config: remoteComponentData?.config || null, config: remoteComponentData?.config || null,
key: new Date().getTime() key: new Date().getTime()
} }
}
}, },
// //
init (temp = true) { init (temp = true) {
@ -496,7 +501,8 @@ export default {
{ name: '自助数据集', datasetType: 'custom', componentName: 'CustomEditForm' }, { name: '自助数据集', datasetType: 'custom', componentName: 'CustomEditForm' },
{ name: '存储过程数据集', datasetType: 'storedProcedure', componentName: 'StoredProcedureEditForm' }, { name: '存储过程数据集', datasetType: 'storedProcedure', componentName: 'StoredProcedureEditForm' },
{ name: 'JSON数据集', datasetType: 'json', componentName: 'JsonEditForm' }, { name: 'JSON数据集', datasetType: 'json', componentName: 'JsonEditForm' },
{ name: '脚本数据集', datasetType: 'script', componentName: 'ScriptEditForm' } { name: '脚本数据集', datasetType: 'script', componentName: 'ScriptEditForm' },
{ name: 'JS数据集', datasetType: 'js', componentName: 'JsEditForm' }
] ]
if (this.dataSetList.length !== 0) { if (this.dataSetList.length !== 0) {
this.datasetTypeList = [{ name: '全部', datasetType: '' }, ...list.filter(item => this.dataSetList.findIndex(x => x === item.datasetType) !== -1)] this.datasetTypeList = [{ name: '全部', datasetType: '' }, ...list.filter(item => this.dataSetList.findIndex(x => x === item.datasetType) !== -1)]

@ -50,7 +50,7 @@ module.exports = {
resolve: { resolve: {
alias: { alias: {
'@': resolve('example'), '@': resolve('example'),
packages: resolve('packages') 'data-room-ui': resolve('packages')
}, },
fallback: { fallback: {
path: false, path: false,

Loading…
Cancel
Save