浏览代码

Merge branch 'master' of github.com:gcpaas/DataRoom

wu.jian2 1 年之前
父节点
当前提交
be270c52c2

+ 1 - 1
DataRoom/pom.xml

@@ -60,7 +60,7 @@
         <clickhouse.version>0.3.2</clickhouse.version>
         <clickhouse.version>0.3.2</clickhouse.version>
         <commons-io.version>2.2</commons-io.version>
         <commons-io.version>2.2</commons-io.version>
         <okhttp3.version>4.9.1</okhttp3.version>
         <okhttp3.version>4.9.1</okhttp3.version>
-        <dataset.core.version>1.0.1.2023083001.Alpha</dataset.core.version>
+        <dataset.core.version>1.0.1.2023083101.Alpha</dataset.core.version>
     </properties>
     </properties>
 
 
     <dependencies>
     <dependencies>

+ 55 - 0
data-room-ui/packages/BigScreenDesign/CloseDialog/index.vue

@@ -0,0 +1,55 @@
+<template>
+  <el-dialog
+    title="提示"
+    :visible.sync="backDialog"
+    width="40%"
+    :modal="true"
+    :modal-append-to-body="false"
+    :appen-to-body="true"
+    class="bs-dialog-wrap bs-el-dialog"
+  >
+  <span style="color:#fff">确定返回主页面吗?未保存的配置将会丢失!</span>
+  <span slot="footer" class="dialog-footer">
+    <el-button @click="backDialog = false">留在页面</el-button>
+    <el-button @click="goBack">离开页面</el-button>
+    <el-button type="primary" @click="goBackSave">保存后离开页面</el-button>
+  </span>
+  </el-dialog>
+</template>
+<script>
+import { pageMixins } from 'data-room-ui/js/mixins/page'
+export default {
+  name: 'ComponentDialog',
+  mixins: [pageMixins],
+  props: {},
+  data () {
+    return {
+      backDialog: false
+    }
+  },
+  computed: {},
+  mounted () {},
+  methods: {
+    init () {
+      this.backDialog = true
+    },
+    // 点击确定
+    confirm () {
+      this.backDialog = false
+    },
+    goBack(){
+      this.$emit('back')
+    },
+    goBackSave(){
+     this.$emit('backSave')
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import '../../assets/style/bsTheme.scss';
+/deep/.el-dialog__body{
+  min-height: 100px !important;
+}
+</style>

+ 1 - 0
data-room-ui/packages/BigScreenDesign/LeftPanel.vue

@@ -563,6 +563,7 @@ export default {
           display: block;
           display: block;
           width: 100%;
           width: 100%;
           font-size: 12px;
           font-size: 12px;
+          text-align: center;
         }
         }
       }
       }
     }
     }

+ 33 - 6
data-room-ui/packages/BigScreenDesign/PageDesignTop.vue

@@ -5,11 +5,13 @@
         class="menu-img"
         class="menu-img"
         src="../BigScreenDesign/images/app.png"
         src="../BigScreenDesign/images/app.png"
         alt="返回"
         alt="返回"
-        @click="backManagement"
+        @click="goBackManage"
       >
       >
       <span class="logo-text name-span">{{ pageInfo.name }}</span>
       <span class="logo-text name-span">{{ pageInfo.name }}</span>
     </div>
     </div>
     <div class="head-btn-group">
     <div class="head-btn-group">
+      <span style="margin-right:8px;font-size:12px">缩放比例</span>
+      <el-input-number style="margin-right:20px" :value="zoom" @change="changeZoom" :min="1" :max="100" label="描述文字"></el-input-number>
       <el-dropdown
       <el-dropdown
         trigger="click"
         trigger="click"
         class="align-list-dropdown"
         class="align-list-dropdown"
@@ -17,7 +19,7 @@
         <CusBtn
         <CusBtn
           type="primary"
           type="primary"
         >
         >
-          对齐<i class="el-icon-arrow-down el-icon--right" />
+          对齐方式<i class="el-icon-arrow-down el-icon--right" />
         </CusBtn>
         </CusBtn>
         <el-dropdown-menu
         <el-dropdown-menu
           slot="dropdown"
           slot="dropdown"
@@ -29,9 +31,10 @@
             @click.native="setAlign(mode.value)"
             @click.native="setAlign(mode.value)"
           >
           >
             <icon-svg
             <icon-svg
-              style="padding:3px 20px"
+              style="padding:3px 8px"
               :name="iconList[index]"
               :name="iconList[index]"
             />
             />
+            <span style="color: #bcc9d4">{{ mode.label }}</span>
           </el-dropdown-item>
           </el-dropdown-item>
         </el-dropdown-menu>
         </el-dropdown-menu>
       </el-dropdown>
       </el-dropdown>
@@ -96,6 +99,7 @@
       :page-info="pageInfo"
       :page-info="pageInfo"
       @replaceItByTemplate="replaceItByTemplate"
       @replaceItByTemplate="replaceItByTemplate"
     />
     />
+    <CloseDialog ref="CloseDialog" @back="backManagement" @backSave="backSave" />
     <AssignDialog ref="AssignDialog" />
     <AssignDialog ref="AssignDialog" />
     <HistoryList ref="HistoryList" />
     <HistoryList ref="HistoryList" />
   </div>
   </div>
@@ -111,6 +115,7 @@ import cloneDeep from 'lodash/cloneDeep'
 import uniqBy from 'lodash/uniqBy'
 import uniqBy from 'lodash/uniqBy'
 import { stringifyObjectFunctions } from 'data-room-ui/js/utils/evalFunctions'
 import { stringifyObjectFunctions } from 'data-room-ui/js/utils/evalFunctions'
 import AssignDialog from 'data-room-ui/BigScreenDesign/AssignDialog/index.vue'
 import AssignDialog from 'data-room-ui/BigScreenDesign/AssignDialog/index.vue'
+import CloseDialog from 'data-room-ui/BigScreenDesign/CloseDialog/index.vue'
 import HistoryList from 'data-room-ui/BigScreenDesign/HistoryList/index.vue'
 import HistoryList from 'data-room-ui/BigScreenDesign/HistoryList/index.vue'
 import CusBtn from './BtnLoading'
 import CusBtn from './BtnLoading'
 import icons from 'data-room-ui/assets/images/alignIcon/export'
 import icons from 'data-room-ui/assets/images/alignIcon/export'
@@ -121,7 +126,6 @@ import {
   translateBlobToBase64
   translateBlobToBase64
 } from 'data-room-ui/js/utils/compressImg'
 } from 'data-room-ui/js/utils/compressImg'
 import * as imageConversion from 'image-conversion'
 import * as imageConversion from 'image-conversion'
-import { themeToSetting } from 'data-room-ui/js/utils/themeFormatting'
 export default {
 export default {
   name: 'PageTopSetting',
   name: 'PageTopSetting',
   components: {
   components: {
@@ -129,7 +133,8 @@ export default {
     ChooseTemplateDialog,
     ChooseTemplateDialog,
     AssignDialog,
     AssignDialog,
     CusBtn,
     CusBtn,
-    HistoryList
+    HistoryList,
+    CloseDialog
   },
   },
   props: {
   props: {
     code: {
     code: {
@@ -189,7 +194,8 @@ export default {
       pageInfo: (state) => state.bigScreen.pageInfo,
       pageInfo: (state) => state.bigScreen.pageInfo,
       timelineStore: (state) => state.bigScreen.timelineStore,
       timelineStore: (state) => state.bigScreen.timelineStore,
       currentTimeLine: (state) => state.bigScreen.currentTimeLine,
       currentTimeLine: (state) => state.bigScreen.currentTimeLine,
-      activeCodes: state => state.bigScreen.activeCodes
+      activeCodes: state => state.bigScreen.activeCodes,
+      zoom: (state) => state.bigScreen.zoom,
     }),
     }),
     pageCode () {
     pageCode () {
       return this.$route.query.code || this.code
       return this.$route.query.code || this.code
@@ -218,6 +224,10 @@ export default {
       undoTimeLine: 'bigScreen/undoTimeLine',
       undoTimeLine: 'bigScreen/undoTimeLine',
       saveTimeLine: 'bigScreen/saveTimeLine'
       saveTimeLine: 'bigScreen/saveTimeLine'
     }),
     }),
+    changeZoom(val){
+      this.$emit('changeZoom', val)
+      // console.log(val)
+    },
     // 切换主题
     // 切换主题
     changeTheme (val) {
     changeTheme (val) {
       // 调取每个组件内部切换主题的方法
       // 调取每个组件内部切换主题的方法
@@ -323,6 +333,13 @@ export default {
         return value1 - value2 // 升序
         return value1 - value2 // 升序
       }
       }
     },
     },
+    goBackManage(){
+      this.$refs.CloseDialog.init()
+    },
+    async backSave(){
+      await this.save()
+      this.backManagement()
+    },
     backManagement () {
     backManagement () {
       this.$router.push({ path: this.pageInfo.type === 'component' ? (window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components') : (window.BS_CONFIG?.routers?.pageManagementUrl || '/home') })
       this.$router.push({ path: this.pageInfo.type === 'component' ? (window.BS_CONFIG?.routers?.componentUrl || '/big-screen-components') : (window.BS_CONFIG?.routers?.pageManagementUrl || '/home') })
       const data = { componentsManagementType: 'component' }
       const data = { componentsManagementType: 'component' }
@@ -599,6 +616,7 @@ export default {
     }
     }
   }
   }
   .align-list-dropdown{
   .align-list-dropdown{
+    width: 100px !important;
     color: #ffffff!important;
     color: #ffffff!important;
   }
   }
 
 
@@ -616,4 +634,13 @@ export default {
   }
   }
 
 
 }
 }
+::v-deep .el-input__inner,
+::v-deep .el-color-picker__color-inner,
+::v-deep .el-input-number--mini,
+::v-deep .el-textarea__inner,
+::v-deep .el-input-group__append {
+  background: var(--bs-el-background-1);
+  color: var(--bs-el-text);
+  border: 0 !important;
+}
 </style>
 </style>

+ 1 - 1
data-room-ui/packages/BigScreenDesign/RulerTool/SketchRuler.vue

@@ -191,7 +191,7 @@ export default {
         }
         }
 
 
         // 30是grid-wrap-box的底部工具栏高度
         // 30是grid-wrap-box的底部工具栏高度
-        this.innerHeight = screensRect.height - 30
+        this.innerHeight = screensRect.height
         this.innerWidth = screensRect.width
         this.innerWidth = screensRect.width
         this.diffX = this.width - screensRect.width
         this.diffX = this.width - screensRect.width
         this.diffY = this.height - screensRect.height
         this.diffY = this.height - screensRect.height

+ 3 - 2
data-room-ui/packages/BigScreenDesign/index.vue

@@ -10,6 +10,7 @@
       @updateRightVisiable="updateRightVisiable"
       @updateRightVisiable="updateRightVisiable"
       @showPageInfo="showPageInfo"
       @showPageInfo="showPageInfo"
       @updateTheme="updateTheme"
       @updateTheme="updateTheme"
+      @changeZoom="changeScreenZoom"
       @empty="empty"
       @empty="empty"
     />
     />
     <div class="drag-wrap">
     <div class="drag-wrap">
@@ -54,7 +55,7 @@
             />
             />
           </MouseSelect>
           </MouseSelect>
         </SketchDesignRuler>
         </SketchDesignRuler>
-        <div class="footer-tools-bar">
+        <!-- <div class="footer-tools-bar">
           <el-slider
           <el-slider
             class="bs-slider-wrap"
             class="bs-slider-wrap"
             :value="zoom"
             :value="zoom"
@@ -76,7 +77,7 @@
               :value="zoom.value"
               :value="zoom.value"
             />
             />
           </el-select>
           </el-select>
-        </div>
+        </div> -->
       </div>
       </div>
       <!-- 右侧折叠设置面板   -->
       <!-- 右侧折叠设置面板   -->
       <SettingPanel
       <SettingPanel

+ 105 - 17
data-room-ui/packages/DataSetManagement/src/ScriptEditForm.vue

@@ -179,12 +179,17 @@
             class="sql-config"
             class="sql-config"
           >
           >
             <div>
             <div>
-              <codemirror
-                ref="targetInSql"
-                v-model="dataForm.script"
-                :options="cOptions"
-                style="margin-top: 2px"
-              />
+              <el-button-group>
+                <el-button plain type="primary" class="bs-el-button-default" @click="example('es')">ES案例</el-button>
+              </el-button-group>
+              <div class="code-out">
+                <codemirror
+                  ref="targetInSql"
+                  v-model="dataForm.script"
+                  :options="cOptions"
+                  style="margin-top: 2px"
+                />
+              </div>
             </div>
             </div>
             <div style="text-align: center; padding: 16px 0;">
             <div style="text-align: center; padding: 16px 0;">
               <el-button
               <el-button
@@ -563,6 +568,38 @@
           >确定</el-button>
           >确定</el-button>
         </span>
         </span>
       </el-dialog>
       </el-dialog>
+      <el-dialog
+        title="脚本案例"
+        :visible.sync="exampleVisible"
+        width="1000px"
+        height="1000px"
+        append-to-body
+        :close-on-click-modal="false"
+        class="bs-dialog-wrap bs-el-dialog"
+      >
+        <div class="code-inner">
+          <codemirror
+            ref="example"
+            v-model="currentExample"
+            :options="cOptions"
+            style="margin-top: 2px"
+          />
+        </div>
+
+        <span
+          slot="footer"
+          class="dialog-footer"
+        >
+          <el-button
+            class="bs-el-button-default"
+            @click="exampleVisible = false"
+          >关闭</el-button>
+          <el-button
+            type="primary"
+            @click="useExample"
+          >使用该案例</el-button>
+        </span>
+      </el-dialog>
     </el-scrollbar>
     </el-scrollbar>
   </div>
   </div>
 </template>
 </template>
@@ -642,7 +679,38 @@ export default {
       paramsListCopy: [],
       paramsListCopy: [],
       isSet: false, // 参数是否配置状态
       isSet: false, // 参数是否配置状态
       passTest: false,
       passTest: false,
-      fieldDesc: null // 字段描述
+      fieldDesc: null, // 字段描述
+      exampleVisible: false,
+      currentExample: '',
+      exampleList: {
+        es: `import com.gccloud.dataset.utils.ElasticsearchDsService;
+
+def dsl = '''
+{
+    "query":{
+       "match_all":{}
+    }
+}
+'''
+def host = "127.0.0.1"
+int port = 9200
+def username = "elastic"
+def password = "pwd"
+def path = "/_search"
+
+/**
+ * query方法的参数说明:
+ * host es的ip
+ * port es的端口
+ * username es的用户名,如果没有可以不填
+ * password es的密码,如果没有可以不填
+ * path es的查询路径
+ * dsl 查询的dsl,示例见上面
+ * return 查询结果,List<Map>格式
+ */
+return ElasticsearchDsService.query(host, port, username, password, path, dsl);
+`
+      }
     }
     }
   },
   },
   computed: {
   computed: {
@@ -906,7 +974,18 @@ export default {
     treeFilter (value, data) {
     treeFilter (value, data) {
       if (!value) return true
       if (!value) return true
       return data.name.indexOf(value) !== -1
       return data.name.indexOf(value) !== -1
-    }
+    },
+    /**
+     * 获取脚本案例
+     */
+    example(type) {
+      this.exampleVisible = true
+      this.currentExample = this.exampleList[type]
+    },
+    useExample() {
+      this.dataForm.script = this.currentExample
+      this.exampleVisible = false
+    },
   }
   }
 }
 }
 </script>
 </script>
@@ -954,15 +1033,24 @@ export default {
 // .codeStyle {
 // .codeStyle {
 //   border: 1px solid #EBEEF5;
 //   border: 1px solid #EBEEF5;
 // }
 // }
-::v-deep .CodeMirror {
-  height: 180px !important;
-  font-family: Helvetica, Tahoma;
-  // .CodeMirror-scroll {
-  //   background: #fff;
-  //   .CodeMirror-gutters {
-  //     background: #f6f7fb;
-  //   }
-  // }
+.code-out {
+  ::v-deep .CodeMirror {
+    height: 180px ;
+    font-family: Helvetica, Tahoma;
+    // .CodeMirror-scroll {
+    //   background: #fff;
+    //   .CodeMirror-gutters {
+    //     background: #f6f7fb;
+    //   }
+    // }
+  }
+}
+
+.code-inner {
+  ::v-deep .CodeMirror {
+    height: 400px ;
+    font-family: Helvetica, Tahoma;
+  }
 }
 }
 
 
 .no-border {
 .no-border {