feat:数据集添加缓存选项

main
liu.shiyi 2 years ago
parent 539f3d3f55
commit 26a69937fc

@ -155,6 +155,21 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="缓存"
prop="cache"
>
<el-switch
v-model="dataForm.cache"
class="bs-el-switch"
active-color="#007aff"
:active-value="1"
:inactive-value="0"
:disabled="!isEdit"
/>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="标签" label="标签"
@ -805,6 +820,7 @@ export default {
labelIds: [], labelIds: [],
// config // config
sourceId: '', sourceId: '',
cache: 0,
sqlProcess: 'select ', sqlProcess: 'select ',
paramsList: [], paramsList: [],
fieldDesc: {}, fieldDesc: {},
@ -910,6 +926,7 @@ export default {
this.dataForm.moduleCode = res.moduleCode this.dataForm.moduleCode = res.moduleCode
this.dataForm.editable = res.editable this.dataForm.editable = res.editable
this.dataForm.sourceId = res.sourceId this.dataForm.sourceId = res.sourceId
this.dataForm.cache = res.cache
// config // config
this.dataForm.sqlProcess = res.config.sqlProcess this.dataForm.sqlProcess = res.config.sqlProcess
this.dataForm.paramsList = res.config.paramsList ? res.config.paramsList : [] this.dataForm.paramsList = res.config.paramsList ? res.config.paramsList : []
@ -1073,6 +1090,7 @@ export default {
datasetType: 'custom', datasetType: 'custom',
remark: this.dataForm.remark, remark: this.dataForm.remark,
sourceId: this.dataForm.sourceId, sourceId: this.dataForm.sourceId,
cache: this.dataForm.cache,
moduleCode: this.appCode, moduleCode: this.appCode,
editable: this.appCode ? 1 : 0, editable: this.appCode ? 1 : 0,
labelIds: this.dataForm.labelIds, labelIds: this.dataForm.labelIds,

@ -195,6 +195,23 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="dataForm.config.requestType === 'backend'">
<el-col :span="12">
<el-form-item
label="缓存"
prop="cache"
>
<el-switch
v-model="dataForm.cache"
class="bs-el-switch"
active-color="#007aff"
:active-value="1"
:inactive-value="0"
:disabled="!isEdit"
/>
</el-form-item>
</el-col>
</el-row>
<el-tabs <el-tabs
v-model="activeName" v-model="activeName"
class="bs-el-tabs tabs-box" class="bs-el-tabs tabs-box"
@ -753,6 +770,7 @@ export default {
name: '', name: '',
typeId: '', typeId: '',
remark: '', remark: '',
cache: 0,
labelIds: [], labelIds: [],
config: { config: {
className: 'com.gccloud.dataset.entity.config.HttpDataSetConfig', className: 'com.gccloud.dataset.entity.config.HttpDataSetConfig',
@ -835,9 +853,9 @@ export default {
} }
if (this.datasetId) { if (this.datasetId) {
getDataset(this.datasetId).then(res => { getDataset(this.datasetId).then(res => {
const { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config } = res const { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, cache, config } = res
const { script, paramsList, fieldDesc, fieldList } = config const { script, paramsList, fieldDesc, fieldList } = config
this.dataForm = { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config: { ...config }, labelIds: this.dataForm.labelIds } this.dataForm = { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, cache, config: { ...config }, labelIds: this.dataForm.labelIds }
this.fieldDesc = fieldDesc this.fieldDesc = fieldDesc
this.outputFieldList = fieldList this.outputFieldList = fieldList
this.newParamsList = _.cloneDeep(paramsList) this.newParamsList = _.cloneDeep(paramsList)
@ -869,6 +887,7 @@ export default {
name: dataForm.name, name: dataForm.name,
typeId: dataForm.typeId, typeId: dataForm.typeId,
remark: dataForm.remark, remark: dataForm.remark,
cache: dataForm.cache,
datasetType: 'http', datasetType: 'http',
moduleCode: appCode, moduleCode: appCode,
editable: appCode ? 1 : 0, editable: appCode ? 1 : 0,

@ -507,7 +507,7 @@ export default {
getDataset(this.datasetId).then(res => { getDataset(this.datasetId).then(res => {
const { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config } = res const { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config } = res
const { script, paramsList, fieldDesc, fieldList } = config const { script, paramsList, fieldDesc, fieldList } = config
this.dataForm = { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config: { script, paramsList } } this.dataForm = { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config: { script, paramsList }, labelIds: this.dataForm.labelIds }
this.fieldDesc = fieldDesc this.fieldDesc = fieldDesc
this.outputFieldList = fieldList this.outputFieldList = fieldList
this.scriptExecute(true) this.scriptExecute(true)

@ -257,6 +257,23 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item
label="缓存"
prop="cache"
>
<el-switch
v-model="dataForm.cache"
class="bs-el-switch"
active-color="#007aff"
:active-value="1"
:inactive-value="0"
:disabled="!isEdit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="标签" label="标签"
@ -526,6 +543,7 @@ export default {
typeId: '', typeId: '',
datasetType: 'original', datasetType: 'original',
remark: '', remark: '',
cache: 0,
labelIds: [], labelIds: [],
// config // config
sourceId: '', sourceId: '',
@ -637,6 +655,7 @@ export default {
this.dataForm.name = res.name this.dataForm.name = res.name
this.dataForm.typeId = res.typeId this.dataForm.typeId = res.typeId
this.dataForm.remark = res.remark this.dataForm.remark = res.remark
this.dataForm.cache = res.cache
this.dataForm.datasetType = res.datasetType this.dataForm.datasetType = res.datasetType
this.dataForm.moduleCode = res.moduleCode this.dataForm.moduleCode = res.moduleCode
this.dataForm.editable = res.editable this.dataForm.editable = res.editable
@ -731,6 +750,7 @@ export default {
name: this.dataForm.name, name: this.dataForm.name,
typeId: this.dataForm.typeId, typeId: this.dataForm.typeId,
remark: this.dataForm.remark, remark: this.dataForm.remark,
cache: this.dataForm.cache,
datasetType: 'original', datasetType: 'original',
sourceId: this.dataForm.sourceId, sourceId: this.dataForm.sourceId,
labelIds: this.dataForm.labelIds, labelIds: this.dataForm.labelIds,

@ -129,6 +129,23 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item
label="缓存"
prop="cache"
>
<el-switch
v-model="dataForm.cache"
class="bs-el-switch"
active-color="#007aff"
:active-value="1"
:inactive-value="0"
:disabled="!isEdit"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="标签" label="标签"
@ -579,6 +596,7 @@ export default {
typeId: '', typeId: '',
datasetType: 'script', datasetType: 'script',
remark: '', remark: '',
cache: 0,
labelIds: [], labelIds: [],
// config // config
script: '', script: '',
@ -657,6 +675,7 @@ export default {
this.dataForm.name = res.name this.dataForm.name = res.name
this.dataForm.typeId = res.typeId this.dataForm.typeId = res.typeId
this.dataForm.remark = res.remark this.dataForm.remark = res.remark
this.dataForm.cache = res.cache
this.dataForm.datasetType = res.datasetType this.dataForm.datasetType = res.datasetType
this.dataForm.moduleCode = res.moduleCode this.dataForm.moduleCode = res.moduleCode
this.dataForm.editable = res.editable this.dataForm.editable = res.editable
@ -724,6 +743,7 @@ export default {
typeId: this.dataForm.typeId, typeId: this.dataForm.typeId,
datasetType: 'script', datasetType: 'script',
remark: this.dataForm.remark, remark: this.dataForm.remark,
cache: this.dataForm.cache,
sourceId: this.dataForm.sourceId, sourceId: this.dataForm.sourceId,
moduleCode: this.appCode, moduleCode: this.appCode,
editable: this.appCode ? 1 : 0, editable: this.appCode ? 1 : 0,

@ -155,6 +155,21 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="缓存"
prop="cache"
>
<el-switch
v-model="dataForm.cache"
class="bs-el-switch"
active-color="#007aff"
:active-value="1"
:inactive-value="0"
:disabled="!isEdit"
/>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="标签" label="标签"
@ -626,6 +641,7 @@ export default {
labelIds: [], labelIds: [],
// config // config
sourceId: '', sourceId: '',
cache: 0,
sqlProcess: 'call ', sqlProcess: 'call ',
paramsList: [], paramsList: [],
fieldDesc: {}, fieldDesc: {},
@ -727,6 +743,7 @@ export default {
this.dataForm.moduleCode = res.moduleCode this.dataForm.moduleCode = res.moduleCode
this.dataForm.editable = res.editable this.dataForm.editable = res.editable
this.dataForm.sourceId = res.sourceId this.dataForm.sourceId = res.sourceId
this.dataForm.cache = res.cache
// config // config
this.dataForm.sqlProcess = res.config.sqlProcess this.dataForm.sqlProcess = res.config.sqlProcess
this.dataForm.paramsList = res.config.paramsList ? res.config.paramsList : [] this.dataForm.paramsList = res.config.paramsList ? res.config.paramsList : []
@ -860,6 +877,7 @@ export default {
datasetType: 'storedProcedure', datasetType: 'storedProcedure',
remark: this.dataForm.remark, remark: this.dataForm.remark,
sourceId: this.dataForm.sourceId, sourceId: this.dataForm.sourceId,
cache: this.dataForm.cache,
moduleCode: this.appCode, moduleCode: this.appCode,
editable: this.appCode ? 1 : 0, editable: this.appCode ? 1 : 0,
labelIds: this.dataForm.labelIds, labelIds: this.dataForm.labelIds,

Loading…
Cancel
Save