Browse Source

支持最大化、最小化

master
Poised_flw 4 years ago
parent
commit
157ce3be9d
  1. 1
      src/tis_app_template_kt/package.json
  2. 50
      src/tis_app_template_kt/src/components/Dialog/DialogPc.vue
  3. 1
      src/tis_app_template_kt/src/tis/bus.js
  4. 3
      src/tis_app_template_kt/src/tis/index.js
  5. 34
      src/tis_app_template_kt/yarn.lock

1
src/tis_app_template_kt/package.json

@ -12,6 +12,7 @@
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-drag-resize": "^1.5.4",
"vuex": "^3.1.2" "vuex": "^3.1.2"
}, },
"devDependencies": { "devDependencies": {

50
src/tis_app_template_kt/src/components/Dialog/DialogPc.vue

@ -1,16 +1,20 @@
<template> <template>
<VueDragResize v-show="centerDialogVisible" :isDraggable="isDraggable" parentLimitation :isResizable="isResizable" <VueDragResize v-show="centerDialogVisible" :isDraggable="isDraggable" parentLimitation :isResizable="isResizable"
ref="dragEl"
:parentW="parentW" :parentW="parentW"
:parentH="parentH" :minh="minh" :minw="minw" :parentH="parentH" :minh="minh" :minw="minw"
:z="400" :z="400"
:x="left" :y="top" :w="width" :h="height"
:x="left"
:y="top"
:w="width"
:h="height"
v-on:resizing="resize" v-on:resizing="resize"
v-on:dragging="resize" class="drag-container"> v-on:dragging="resize" class="drag-container">
<div class="header"> <div class="header">
<span>{{DialogWidget && DialogWidget.name}}</span> <span>{{DialogWidget && DialogWidget.name}}</span>
<div class="action"> <div class="action">
<!--<div class="maxsize" @click='onMaxSize'>最大化</div>-->
<!--<div class="minisize" >最小化</div>-->
<div class="maxsize" @click='onMaxSize'>最大化</div>
<div class="minisize" @click="minisize">最小化</div>
<div class="close" @click="onClose">关闭</div> <div class="close" @click="onClose">关闭</div>
</div> </div>
</div> </div>
@ -19,12 +23,12 @@
@onShow="onShow" @onShow="onShow"
@onClose="onClose" @onClose="onClose"
:is="DialogWidget && actives"></component> :is="DialogWidget && actives"></component>
<br style="clear: both"/>
</VueDragResize> </VueDragResize>
</template> </template>
<script> <script>
import VueDragResize from "../vueDragResize/vue-drag-resize.vue";
//import VueDragResize from "../vueDragResize/vue-drag-resize.vue";
import VueDragResize from 'vue-drag-resize'
import {dialogMixins} from './dialogMixins' import {dialogMixins} from './dialogMixins'
export default { export default {
@ -55,8 +59,6 @@
minw() { minw() {
return 280; return 280;
}, },
}, },
data() { data() {
@ -64,12 +66,12 @@
isMax:false, isMax:false,
isDestory:false, isDestory:false,
showSizeChoice: false, showSizeChoice: false,
width: 700,
height: 600,
curWidth:600, curWidth:600,
curHeight:500, curHeight:500,
top: 80,
left: 40,
width: Math.round(window.innerWidth * .6),
height: Math.round(window.innerHeight * .6),
top: Math.round(window.innerHeight * .2),
left: Math.round(window.innerWidth * .2),
}; };
}, },
methods: { methods: {
@ -83,7 +85,22 @@
this.curHeight = newRect.height; this.curHeight = newRect.height;
}, },
onMaxSize(){ onMaxSize(){
this.$refs.dragEl.$el.style.left = 0
this.$refs.dragEl.$el.style.top = 0
const $contentEl = this.$refs.dragEl.$el.firstChild
$contentEl.style.width = window.innerWidth + 'px'
$contentEl.style.height = window.innerHeight + 'px'
return;
this.isMax = !this.isMax; this.isMax = !this.isMax;
this.left = 0
this.top = 0
this.$nextTick(() => {
this.width = window.innerWidth
this.height = window.innerHeight
})
},
minisize() {
this.centerDialogVisible = false;
}, },
onClose() { onClose() {
this.centerDialogVisible = false; this.centerDialogVisible = false;
@ -125,5 +142,16 @@
} }
.content{ .content{
flex: 1; flex: 1;
overflow-y: auto;
background: #fff;
::v-deep {
.footer:after {
content: '';
clear: both;
}
}
}
.drag-container {
border: 1px solid #ddd;
} }
</style> </style>

1
src/tis_app_template_kt/src/tis/bus.js

@ -166,6 +166,7 @@ const bus = new Vue({
//获取组件 //获取组件
getWidgetsByType(type) { getWidgetsByType(type) {
//以type 或 position 命中widget,背景板默认lazy=false //以type 或 position 命中widget,背景板默认lazy=false
console.log(type, this.layouts)
return this.layouts.filter(f => (f.type === type || f.position === type) && !f.lazy).map(f => { return this.layouts.filter(f => (f.type === type || f.position === type) && !f.lazy).map(f => {
//string类型,来自配置文件,需要下载资源才能使用,懒加载组件不加载但是需要加入到数组中、、 //string类型,来自配置文件,需要下载资源才能使用,懒加载组件不加载但是需要加入到数组中、、

3
src/tis_app_template_kt/src/tis/index.js

@ -10,7 +10,7 @@ import AsyncComputed from 'vue-async-computed'
import axios from 'axios' import axios from 'axios'
import Vuex from 'vuex' import Vuex from 'vuex'
import EventBusExample from '../components/EventBusExample' import EventBusExample from '../components/EventBusExample'
import bus, { onSetup, onMount } from 'tisbus'
import bus, { onSetup, onMount } from './bus'
Vue.component('EventBusExample', EventBusExample) Vue.component('EventBusExample', EventBusExample)
Vue.config.productionTip = false; Vue.config.productionTip = false;
@ -118,6 +118,7 @@ export async function mount(props = {}) {
// console.log("---", window.esapp) // console.log("---", window.esapp)
bus.openComponentByMenu(['kt_zzgl_datapackaging'])
} }
/** /**

34
src/tis_app_template_kt/yarn.lock

@ -1023,11 +1023,6 @@
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@types/estree@*":
version "0.0.50"
resolved "https://registry.nlark.com/@types/estree/download/@types/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83"
integrity sha1-Hgyqk2TT/M0pMcPtlv2+ql1MyoM=
"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18":
version "4.17.24" version "4.17.24"
resolved "https://registry.nlark.com/@types/express-serve-static-core/download/@types/express-serve-static-core-4.17.24.tgz?cache=0&sync_timestamp=1629707772598&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fexpress-serve-static-core%2Fdownload%2F%40types%2Fexpress-serve-static-core-4.17.24.tgz#ea41f93bf7e0d59cd5a76665068ed6aab6815c07" resolved "https://registry.nlark.com/@types/express-serve-static-core/download/@types/express-serve-static-core-4.17.24.tgz?cache=0&sync_timestamp=1629707772598&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fexpress-serve-static-core%2Fdownload%2F%40types%2Fexpress-serve-static-core-4.17.24.tgz#ea41f93bf7e0d59cd5a76665068ed6aab6815c07"
@ -5217,13 +5212,6 @@ is-promise@^2.1.0:
resolved "https://registry.npm.taobao.org/is-promise/download/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" resolved "https://registry.npm.taobao.org/is-promise/download/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1"
integrity sha1-OauVnMv5p3TPB597QMeib3YxNfE= integrity sha1-OauVnMv5p3TPB597QMeib3YxNfE=
is-reference@^1.1.2:
version "1.2.1"
resolved "https://registry.nlark.com/is-reference/download/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7"
integrity sha1-iy2sCzcfS8mU/eq6nrVC0DAC0Lc=
dependencies:
"@types/estree" "*"
is-regex@^1.0.4, is-regex@^1.1.4: is-regex@^1.0.4, is-regex@^1.1.4:
version "1.1.4" version "1.1.4"
resolved "https://registry.nlark.com/is-regex/download/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" resolved "https://registry.nlark.com/is-regex/download/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958"
@ -7500,7 +7488,7 @@ resolve-url@^0.2.1:
resolved "https://registry.npm.taobao.org/resolve-url/download/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" resolved "https://registry.npm.taobao.org/resolve-url/download/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.14.2:
resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2:
version "1.20.0" version "1.20.0"
resolved "https://registry.nlark.com/resolve/download/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" resolved "https://registry.nlark.com/resolve/download/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha1-YpoBP7P3B1XW8LeTXMHCxTeLGXU= integrity sha1-YpoBP7P3B1XW8LeTXMHCxTeLGXU=
@ -7578,17 +7566,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^3.0.0" hash-base "^3.0.0"
inherits "^2.0.1" inherits "^2.0.1"
rollup-plugin-commonjs@^10.1.0:
version "10.1.0"
resolved "https://registry.npm.taobao.org/rollup-plugin-commonjs/download/rollup-plugin-commonjs-10.1.0.tgz#417af3b54503878e084d127adf4d1caf8beb86fb"
integrity sha1-QXrztUUDh44ITRJ6300cr4vrhvs=
dependencies:
estree-walker "^0.6.1"
is-reference "^1.1.2"
magic-string "^0.25.2"
resolve "^1.11.0"
rollup-pluginutils "^2.8.1"
rollup-plugin-replace@^2.2.0: rollup-plugin-replace@^2.2.0:
version "2.2.0" version "2.2.0"
resolved "https://registry.npm.taobao.org/rollup-plugin-replace/download/rollup-plugin-replace-2.2.0.tgz?cache=0&sync_timestamp=1572273363490&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup-plugin-replace%2Fdownload%2Frollup-plugin-replace-2.2.0.tgz#f41ae5372e11e7a217cde349c8b5d5fd115e70e3" resolved "https://registry.npm.taobao.org/rollup-plugin-replace/download/rollup-plugin-replace-2.2.0.tgz?cache=0&sync_timestamp=1572273363490&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup-plugin-replace%2Fdownload%2Frollup-plugin-replace-2.2.0.tgz#f41ae5372e11e7a217cde349c8b5d5fd115e70e3"
@ -7607,7 +7584,7 @@ rollup-plugin-uglify@^6.0.4:
serialize-javascript "^2.1.2" serialize-javascript "^2.1.2"
uglify-js "^3.4.9" uglify-js "^3.4.9"
rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1:
rollup-pluginutils@^2.6.0:
version "2.8.2" version "2.8.2"
resolved "https://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" resolved "https://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
integrity sha1-cvKvB0i1kjZNvTOJ5gDlqURKNR4= integrity sha1-cvKvB0i1kjZNvTOJ5gDlqURKNR4=
@ -8860,6 +8837,13 @@ vue-async-computed@^3.9.0:
resolved "https://registry.nlark.com/vue-async-computed/download/vue-async-computed-3.9.0.tgz#af3181c25168bfe9d86d8ffbc7033bf9e484fe84" resolved "https://registry.nlark.com/vue-async-computed/download/vue-async-computed-3.9.0.tgz#af3181c25168bfe9d86d8ffbc7033bf9e484fe84"
integrity sha1-rzGBwlFov+nYbY/7xwM7+eSE/oQ= integrity sha1-rzGBwlFov+nYbY/7xwM7+eSE/oQ=
vue-drag-resize@^1.5.0-rc3, vue-drag-resize@^1.5.4:
version "1.5.4"
resolved "https://registry.nlark.com/vue-drag-resize/download/vue-drag-resize-1.5.4.tgz#f583f40f356e5792aa89109b3d13ba4407c25198"
integrity sha1-9YP0DzVuV5KqiRCbPRO6RAfCUZg=
dependencies:
vue-drag-resize "^1.5.0-rc3"
vue-eslint-parser@^7.0.0: vue-eslint-parser@^7.0.0:
version "7.11.0" version "7.11.0"
resolved "https://registry.npmmirror.com/vue-eslint-parser/download/vue-eslint-parser-7.11.0.tgz#214b5dea961007fcffb2ee65b8912307628d0daf" resolved "https://registry.npmmirror.com/vue-eslint-parser/download/vue-eslint-parser-7.11.0.tgz#214b5dea961007fcffb2ee65b8912307628d0daf"

Loading…
Cancel
Save