Răsfoiți Sursa

feat:数据集添加缓存选项

liu.shiyi 1 an în urmă
părinte
comite
26a69937fc

+ 18 - 0
data-room-ui/packages/DataSetManagement/src/CustomEditForm.vue

@@ -155,6 +155,21 @@
               </el-col>
             </el-row>
             <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-form-item
                   label="标签"
@@ -805,6 +820,7 @@ export default {
         labelIds: [],
         // 以下为config配置
         sourceId: '',
+        cache: 0,
         sqlProcess: 'select ',
         paramsList: [],
         fieldDesc: {},
@@ -910,6 +926,7 @@ export default {
         this.dataForm.moduleCode = res.moduleCode
         this.dataForm.editable = res.editable
         this.dataForm.sourceId = res.sourceId
+        this.dataForm.cache = res.cache
         // config 配置
         this.dataForm.sqlProcess = res.config.sqlProcess
         this.dataForm.paramsList = res.config.paramsList ? res.config.paramsList : []
@@ -1073,6 +1090,7 @@ export default {
           datasetType: 'custom',
           remark: this.dataForm.remark,
           sourceId: this.dataForm.sourceId,
+          cache: this.dataForm.cache,
           moduleCode: this.appCode,
           editable: this.appCode ? 1 : 0,
           labelIds: this.dataForm.labelIds,

+ 21 - 2
data-room-ui/packages/DataSetManagement/src/HttpEditForm.vue

@@ -195,6 +195,23 @@
                 </el-form-item>
               </el-col>
             </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
               v-model="activeName"
               class="bs-el-tabs tabs-box"
@@ -753,6 +770,7 @@ export default {
         name: '',
         typeId: '',
         remark: '',
+        cache: 0,
         labelIds: [],
         config: {
           className: 'com.gccloud.dataset.entity.config.HttpDataSetConfig',
@@ -835,9 +853,9 @@ export default {
       }
       if (this.datasetId) {
         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
-          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.outputFieldList = fieldList
           this.newParamsList = _.cloneDeep(paramsList)
@@ -869,6 +887,7 @@ export default {
             name: dataForm.name,
             typeId: dataForm.typeId,
             remark: dataForm.remark,
+            cache: dataForm.cache,
             datasetType: 'http',
             moduleCode: appCode,
             editable: appCode ? 1 : 0,

+ 1 - 1
data-room-ui/packages/DataSetManagement/src/JsEditForm.vue

@@ -507,7 +507,7 @@ export default {
         getDataset(this.datasetId).then(res => {
           const { id, name, typeId, remark, datasetType, moduleCode, editable, sourceId, config } = res
           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.outputFieldList = fieldList
           this.scriptExecute(true)

+ 20 - 0
data-room-ui/packages/DataSetManagement/src/OriginalEditForm.vue

@@ -257,6 +257,23 @@
                   />
                 </el-form-item>
               </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-form-item
                   label="标签"
@@ -526,6 +543,7 @@ export default {
         typeId: '',
         datasetType: 'original',
         remark: '',
+        cache: 0,
         labelIds: [],
         // 以下为config信息
         sourceId: '',
@@ -637,6 +655,7 @@ export default {
         this.dataForm.name = res.name
         this.dataForm.typeId = res.typeId
         this.dataForm.remark = res.remark
+        this.dataForm.cache = res.cache
         this.dataForm.datasetType = res.datasetType
         this.dataForm.moduleCode = res.moduleCode
         this.dataForm.editable = res.editable
@@ -731,6 +750,7 @@ export default {
           name: this.dataForm.name,
           typeId: this.dataForm.typeId,
           remark: this.dataForm.remark,
+          cache: this.dataForm.cache,
           datasetType: 'original',
           sourceId: this.dataForm.sourceId,
           labelIds: this.dataForm.labelIds,

+ 20 - 0
data-room-ui/packages/DataSetManagement/src/ScriptEditForm.vue

@@ -129,6 +129,23 @@
                   />
                 </el-form-item>
               </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-form-item
                   label="标签"
@@ -579,6 +596,7 @@ export default {
         typeId: '',
         datasetType: 'script',
         remark: '',
+        cache: 0,
         labelIds: [],
         // 以下为config配置
         script: '',
@@ -657,6 +675,7 @@ export default {
         this.dataForm.name = res.name
         this.dataForm.typeId = res.typeId
         this.dataForm.remark = res.remark
+        this.dataForm.cache = res.cache
         this.dataForm.datasetType = res.datasetType
         this.dataForm.moduleCode = res.moduleCode
         this.dataForm.editable = res.editable
@@ -724,6 +743,7 @@ export default {
           typeId: this.dataForm.typeId,
           datasetType: 'script',
           remark: this.dataForm.remark,
+          cache: this.dataForm.cache,
           sourceId: this.dataForm.sourceId,
           moduleCode: this.appCode,
           editable: this.appCode ? 1 : 0,

+ 18 - 0
data-room-ui/packages/DataSetManagement/src/StoredProcedureEditForm.vue

@@ -155,6 +155,21 @@
               </el-col>
             </el-row>
             <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-form-item
                   label="标签"
@@ -626,6 +641,7 @@ export default {
         labelIds: [],
         // 以下为config配置
         sourceId: '',
+        cache: 0,
         sqlProcess: 'call ',
         paramsList: [],
         fieldDesc: {},
@@ -727,6 +743,7 @@ export default {
         this.dataForm.moduleCode = res.moduleCode
         this.dataForm.editable = res.editable
         this.dataForm.sourceId = res.sourceId
+        this.dataForm.cache = res.cache
         // config 配置
         this.dataForm.sqlProcess = res.config.sqlProcess
         this.dataForm.paramsList = res.config.paramsList ? res.config.paramsList : []
@@ -860,6 +877,7 @@ export default {
           datasetType: 'storedProcedure',
           remark: this.dataForm.remark,
           sourceId: this.dataForm.sourceId,
+          cache: this.dataForm.cache,
           moduleCode: this.appCode,
           editable: this.appCode ? 1 : 0,
           labelIds: this.dataForm.labelIds,