forked from github/dataease
fix: 删除前端定义未使用变量
This commit is contained in:
parent
3b12c751f1
commit
e9b1b25939
@ -5,13 +5,12 @@ import { layerStoreWithOut } from '@/store/modules/data-visualization/layer'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElIcon, ElRow } from 'element-plus-secondary'
|
||||
import Icon from '../icon-custom/src/Icon.vue'
|
||||
import { computed, nextTick, ref, toRefs } from 'vue'
|
||||
import { nextTick, ref, toRefs } from 'vue'
|
||||
import draggable from 'vuedraggable'
|
||||
import { lockStoreWithOut } from '@/store/modules/data-visualization/lock'
|
||||
import ContextMenuAsideDetails from '@/components/data-visualization/canvas/ContextMenuAsideDetails.vue'
|
||||
import ComposeShow from '@/components/data-visualization/canvas/ComposeShow.vue'
|
||||
import { composeStoreWithOut } from '@/store/modules/data-visualization/compose'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
const dropdownMore = ref(null)
|
||||
const lockStore = lockStoreWithOut()
|
||||
|
||||
@ -20,7 +19,7 @@ const snapshotStore = snapshotStoreWithOut()
|
||||
const layerStore = layerStoreWithOut()
|
||||
const composeStore = composeStoreWithOut()
|
||||
|
||||
const { areaData, isCtrlOrCmdDown, isShiftDown, laterIndex } = storeToRefs(composeStore)
|
||||
const { areaData } = storeToRefs(composeStore)
|
||||
|
||||
const { curComponent, canvasViewInfo } = storeToRefs(dvMainStore)
|
||||
|
||||
@ -36,69 +35,13 @@ const getComponent = index => {
|
||||
const transformIndex = index => {
|
||||
return componentData.value.length - 1 - index
|
||||
}
|
||||
const areaDataPush = component => {
|
||||
if (component && !component.isLock && component.isShow && component.canvasId === 'canvas-main') {
|
||||
areaData.value.components.push(component)
|
||||
}
|
||||
}
|
||||
// shift 选择算法逻辑
|
||||
// 1.记录上次点击的laterIndex(初始状态laterIndex=0);
|
||||
// 2.获取当前index curClickIndex;
|
||||
// 3.比较laterIndex 和 curClickIndex之间的大小;
|
||||
// 4.将[laterIndex,curClickIndex] 或者 [curClickIndex,laterIndex]区域的图层加入areaData.value.components(已包含的不再重复加入);
|
||||
const shiftDataPush = curClickIndex => {
|
||||
const areaDataIdArray = areaData.value.components.map(com => com.id)
|
||||
let indexBegin, indexEnd
|
||||
const laterIndexTrans = laterIndex.value === null ? componentData.value.length : laterIndex.value
|
||||
if (laterIndexTrans < curClickIndex) {
|
||||
indexBegin = laterIndexTrans
|
||||
indexEnd = curClickIndex
|
||||
} else {
|
||||
indexBegin = curClickIndex
|
||||
indexEnd = laterIndexTrans
|
||||
}
|
||||
const shiftAreaComponents = componentData.value
|
||||
.slice(indexBegin, indexEnd + 1)
|
||||
.filter(
|
||||
component => !areaDataIdArray.includes(component.id) && !component.isLock && component.isShow
|
||||
)
|
||||
areaData.value.components.push(...shiftAreaComponents)
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
}
|
||||
|
||||
const onClick = (e, index) => {
|
||||
const onClick = index => {
|
||||
setCurComponent(index)
|
||||
//其他情况点击清理选择区域
|
||||
areaData.value.components.splice(0, areaData.value.components.length)
|
||||
}
|
||||
|
||||
const onClickBack = (e, index) => {
|
||||
// 初始化点击是 laterIndex=0
|
||||
if (!curComponent.value) {
|
||||
composeStore.setLaterIndex(null)
|
||||
}
|
||||
// ctrl or command 按下时 鼠标点击为选择需要组合的组件(取消需要组合的组件在ComposeShow组件中)
|
||||
if (isCtrlOrCmdDown.value && !areaData.value.components.includes(componentData.value[index])) {
|
||||
areaDataPush(componentData.value[index])
|
||||
if (curComponent.value && curComponent.value.id !== componentData.value[index].id) {
|
||||
areaDataPush(curComponent.value)
|
||||
}
|
||||
dvMainStore.setCurComponent({ component: null, index: null })
|
||||
e.stopPropagation()
|
||||
composeStore.setLaterIndex(index)
|
||||
return
|
||||
}
|
||||
//shift操作逻辑
|
||||
if (isShiftDown.value) {
|
||||
shiftDataPush(index)
|
||||
return
|
||||
}
|
||||
|
||||
//其他情况点击清理选择区域
|
||||
areaData.value.components.splice(0, areaData.value.components.length)
|
||||
setCurComponent(index)
|
||||
composeStore.setLaterIndex(index)
|
||||
}
|
||||
const setCurComponent = index => {
|
||||
dvMainStore.setCurComponent({ component: componentData.value[index], index })
|
||||
}
|
||||
@ -237,7 +180,7 @@ const handleContextMenu = e => {
|
||||
(curComponent && curComponent?.id === getComponent(index)?.id) ||
|
||||
areaData.components.includes(getComponent(index))
|
||||
}"
|
||||
@click="onClick($event, transformIndex(index))"
|
||||
@click="onClick(transformIndex(index))"
|
||||
>
|
||||
<el-icon class="component-icon">
|
||||
<Icon :name="getIconName(getComponent(index))"></Icon>
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
syncShapeItemStyle
|
||||
} from '@/utils/style'
|
||||
import $ from 'jquery'
|
||||
import { _$, deepCopy, isPreventDrop } from '@/utils/utils'
|
||||
import { _$, isPreventDrop } from '@/utils/utils'
|
||||
import ContextMenu from './ContextMenu.vue'
|
||||
import MarkLine from './MarkLine.vue'
|
||||
import Area from './Area.vue'
|
||||
@ -639,7 +639,7 @@ function findPositionX(item) {
|
||||
let pb = positionBox.value
|
||||
if (width <= 0) return
|
||||
// 查找组件最高位置索引 component 规则 y最新为1
|
||||
componentData.value.forEach((component, index) => {
|
||||
componentData.value.forEach(component => {
|
||||
const componentYIndex = component.y + component.sizeY - 2
|
||||
if (checkPointYIndex < componentYIndex) {
|
||||
checkPointYIndex = componentYIndex
|
||||
|
@ -70,8 +70,7 @@ const {
|
||||
showPosition,
|
||||
previewActive,
|
||||
downloadStatus,
|
||||
outerScale,
|
||||
userId
|
||||
outerScale
|
||||
} = toRefs(props)
|
||||
const domId = 'preview-' + canvasId.value
|
||||
const scaleWidth = ref(100)
|
||||
|
@ -157,7 +157,6 @@ const state = reactive({
|
||||
collisionGap: 10 // 碰撞深度有效区域,
|
||||
})
|
||||
|
||||
const minGap = 15
|
||||
const contentDisplay = ref(true)
|
||||
|
||||
const shapeLock = computed(() => {
|
||||
@ -404,7 +403,7 @@ const areaDataPush = component => {
|
||||
areaData.value.components.push(component)
|
||||
}
|
||||
}
|
||||
const handleDbClick = e => {
|
||||
const handleDbClick = () => {
|
||||
if (element.value.canvasId !== 'canvas-main') {
|
||||
dvMainStore.setCurComponent({ component: element.value, index: index.value })
|
||||
}
|
||||
@ -674,8 +673,6 @@ const handleMouseDownOnPoint = (point, e) => {
|
||||
const widthOffset = style.width - defaultStyle.value.width
|
||||
// 保持宽高比例是相对宽度偏移量
|
||||
const adaptorWidthOffset = heightOffset * originRadio
|
||||
// 保持宽高比例是相对高度偏移量
|
||||
const adaptorHeightOffset = widthOffset / originRadio
|
||||
if (pointCorner.includes(point)) {
|
||||
style.height = defaultStyle.value.width / originRadio
|
||||
} else if (Math.abs(widthOffset) > Math.abs(adaptorWidthOffset)) {
|
||||
|
@ -45,7 +45,7 @@
|
||||
<el-input
|
||||
v-if="curEditDataId === data.paramsInfoId"
|
||||
v-model="data.paramName"
|
||||
size="mini"
|
||||
size="small"
|
||||
:placeholder="$t('visualization.input_param_name')"
|
||||
@blur="closeEdit"
|
||||
/>
|
||||
@ -91,7 +91,7 @@
|
||||
v-model="targetViewInfo.targetViewId"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
size="small"
|
||||
:placeholder="t('visualization.please_select')"
|
||||
@change="viewInfoOnChange(targetViewInfo)"
|
||||
>
|
||||
@ -125,7 +125,7 @@
|
||||
filterable
|
||||
:disabled="fieldIdDisabledCheck(targetViewInfo)"
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
size="small"
|
||||
:placeholder="t('visualization.please_select')"
|
||||
>
|
||||
<el-option
|
||||
@ -166,8 +166,8 @@
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-row class="root-class">
|
||||
<el-button size="mini" @click="cancel()">{{ t('commons.cancel') }} </el-button>
|
||||
<el-button type="primary" size="mini" @click="save()"
|
||||
<el-button size="small" @click="cancel()">{{ t('commons.cancel') }} </el-button>
|
||||
<el-button type="primary" size="small" @click="save()"
|
||||
>{{ t('commons.confirm') }}
|
||||
</el-button>
|
||||
</el-row>
|
||||
@ -190,9 +190,8 @@ import HandleMore from '@/components/handle-more/src/HandleMore.vue'
|
||||
import { fieldType } from '@/utils/attr'
|
||||
import EmptyBackground from '@/components/empty-background/src/EmptyBackground.vue'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { dvInfo, componentData, canvasStyleData } = storeToRefs(dvMainStore)
|
||||
const { dvInfo, componentData } = storeToRefs(dvMainStore)
|
||||
const outerParamsInfoTree = ref(null)
|
||||
const emits = defineEmits(['outerParamsSetVisibleChange'])
|
||||
const { t } = useI18n()
|
||||
const curEditDataId = ref(null)
|
||||
|
||||
@ -294,7 +293,6 @@ const initParams = () => {
|
||||
state.outerParamsInfoArray.forEach(outerParamsInfo => {
|
||||
state.mapOuterParamsInfoArray[outerParamsInfo.paramsInfoId] = outerParamsInfo
|
||||
})
|
||||
const firstNode = state.outerParamsInfoArray[0]
|
||||
state.curNodeId = null
|
||||
nextTick(() => {
|
||||
// outerParamsInfoTree.value.setCurrentKey(firstNode.paramsInfoId)
|
||||
@ -317,7 +315,7 @@ const save = () => {
|
||||
})
|
||||
return
|
||||
}
|
||||
updateOuterParamsSet(state.outerParams).then(rsp => {
|
||||
updateOuterParamsSet(state.outerParams).then(() => {
|
||||
ElMessage({
|
||||
message: t('commons.save_success'),
|
||||
type: 'success',
|
||||
@ -360,18 +358,6 @@ const getPanelViewList = dvId => {
|
||||
})
|
||||
}
|
||||
|
||||
const panelNodeClick = (data, node) => {
|
||||
state.outerParamsInfo.targetViewInfoList = []
|
||||
getPanelViewList(data.id)
|
||||
}
|
||||
|
||||
const inputVal = value => {
|
||||
if (!value) {
|
||||
state.outerParamsInfo.targetViewInfoList = []
|
||||
state.viewIdFieldArrayMap = {}
|
||||
state.currentLinkPanelViewArray = []
|
||||
}
|
||||
}
|
||||
const addOuterParamsField = () => {
|
||||
state.outerParamsInfo.targetViewInfoList.push({
|
||||
targetViewId: '',
|
||||
@ -382,13 +368,6 @@ const deleteOuterParamsField = index => {
|
||||
state.outerParamsInfo.targetViewInfoList.splice(index, 1)
|
||||
}
|
||||
|
||||
const normalizer = node => {
|
||||
// 去掉children=null的属性
|
||||
if (node.children === null || node.children === 'null') {
|
||||
delete node.children
|
||||
}
|
||||
}
|
||||
|
||||
const viewInfoOnChange = targetViewInfo => {
|
||||
if (
|
||||
state.viewIdFieldArrayMap[targetViewInfo.targetViewId] &&
|
||||
@ -589,7 +568,7 @@ defineExpose({
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
v-deep(.ed-popover) {
|
||||
:deep(.ed-popover) {
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
}
|
||||
@ -610,11 +589,11 @@ v-deep(.ed-popover) {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
v-deep(.vue-treeselect__control) {
|
||||
:deep(.vue-treeselect__control) {
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
v-deep(.vue-treeselect__single-value) {
|
||||
:deep(.vue-treeselect__single-value) {
|
||||
color: #606266;
|
||||
line-height: 28px !important;
|
||||
}
|
||||
@ -635,32 +614,32 @@ v-deep(.vue-treeselect__single-value) {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
v-deep(.vue-treeselect__placeholder) {
|
||||
:deep(.vue-treeselect__placeholder) {
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
v-deep(.ed-tree--highlight-current .ed-tree-node.is-current > .ed-tree-node__content) {
|
||||
:deep(.ed-tree--highlight-current .ed-tree-node.is-current > .ed-tree-node__content) {
|
||||
background-color: #8dbbef !important;
|
||||
}
|
||||
|
||||
.tree-content ::v-deep(.ed-input__inner) {
|
||||
.tree-content ::deep(.ed-input__inner) {
|
||||
background: transparent;
|
||||
border: 0px !important;
|
||||
}
|
||||
|
||||
.params-class ::v-deep(.ed-dialog__title) {
|
||||
.params-class ::deep(.ed-dialog__title) {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.params-class ::v-deep(.ed-dialog__headerbtn) {
|
||||
.params-class ::deep(.ed-dialog__headerbtn) {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.params-class ::v-deep(.ed-dialog__header) {
|
||||
.params-class ::deep(.ed-dialog__header) {
|
||||
padding: 20px 20px 0;
|
||||
}
|
||||
|
||||
.params-class ::v-deep(.ed-dialog__body) {
|
||||
.params-class ::deep(.ed-dialog__body) {
|
||||
padding: 10px 20px 20px;
|
||||
}
|
||||
</style>
|
||||
|
@ -58,7 +58,6 @@ import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
import ChartComponentS2 from '@/views/chart/components/views/components/ChartComponentS2.vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { VIEW_DETAILS_BASH_STYLE } from '@/views/chart/components/editor/util/dataVisualiztion'
|
||||
import { exportExcelDownload } from '@/views/chart/components/js/util'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { assign } from 'lodash-es'
|
||||
|
@ -107,7 +107,6 @@ const onPositionChange = key => {
|
||||
|
||||
if (curComponent.value.component === 'Group') {
|
||||
//如果当前组件是Group分组 则要进行内部组件深度计算
|
||||
const parentNode = document.querySelector('#editor-canvas-main')
|
||||
groupSizeStyleAdaptor(curComponent.value)
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
propValue: {
|
||||
type: String,
|
||||
required: true,
|
||||
|
@ -1,15 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import CommonAttr from '@/custom-component/common/CommonAttr.vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElIcon, ElMessage } from 'element-plus-secondary'
|
||||
import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
|
||||
import { beforeUploadCheck, uploadFileResult } from '@/api/staticResource'
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import ImgViewDialog from '@/custom-component/ImgViewDialog.vue'
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
@ -21,54 +17,17 @@ withDefaults(
|
||||
)
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const { curComponent } = storeToRefs(dvMainStore)
|
||||
|
||||
const fileList = ref([])
|
||||
const dialogImageUrl = ref('')
|
||||
const dialogVisible = ref(false)
|
||||
const uploadDisabled = ref(false)
|
||||
|
||||
const files = ref(null)
|
||||
const maxImageSize = 15000000
|
||||
|
||||
const handlePictureCardPreview = file => {
|
||||
dialogImageUrl.value = file.url
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleRemove = (_, fileList) => {
|
||||
uploadDisabled.value = false
|
||||
curComponent.value.propValue.url = null
|
||||
fileList.value = []
|
||||
snapshotStore.recordSnapshotCache()
|
||||
}
|
||||
async function upload(file) {
|
||||
uploadFileResult(file.file, fileUrl => {
|
||||
snapshotStore.recordSnapshotCache()
|
||||
curComponent.value.propValue.url = fileUrl
|
||||
})
|
||||
}
|
||||
|
||||
const goFile = () => {
|
||||
files.value.click()
|
||||
}
|
||||
|
||||
const reUpload = e => {
|
||||
const file = e.target.files[0]
|
||||
if (file.size > maxImageSize) {
|
||||
sizeMessage()
|
||||
}
|
||||
uploadFileResult(file, fileUrl => {
|
||||
snapshotStore.recordSnapshotCache()
|
||||
curComponent.value.propValue.url = fileUrl
|
||||
fileList.value = [{ url: imgUrlTrans(curComponent.value.propValue.url) }]
|
||||
})
|
||||
}
|
||||
|
||||
const sizeMessage = () => {
|
||||
ElMessage.success('图片大小不符合')
|
||||
}
|
||||
const init = () => {
|
||||
if (curComponent.value.propValue.url) {
|
||||
fileList.value = [{ url: imgUrlTrans(curComponent.value.propValue.url) }]
|
||||
|
@ -3,8 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, toRefs } from 'vue'
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
element: {
|
||||
type: Object,
|
||||
default() {
|
||||
@ -14,10 +13,6 @@ const props = defineProps({
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const { element } = toRefs(props)
|
||||
|
||||
const style = computed(() => element.value.style)
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
@ -291,10 +291,6 @@ const moveActive = computed(() => {
|
||||
return tabMoveInActiveId.value && tabMoveInActiveId.value === element.value.id
|
||||
})
|
||||
|
||||
const dropdownShow = computed(() => {
|
||||
return isEdit.value
|
||||
})
|
||||
|
||||
const headClass = computed(() => {
|
||||
if (tabsAreaScroll.value) {
|
||||
return 'tab-head-left'
|
||||
|
@ -1,15 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import CommonAttr from '@/custom-component/common/CommonAttr.vue'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElIcon, ElMessage } from 'element-plus-secondary'
|
||||
import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
|
||||
import { beforeUploadCheck, uploadFileResult } from '@/api/staticResource'
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import ImgViewDialog from '@/custom-component/ImgViewDialog.vue'
|
||||
import TimeClockFormat from '@/custom-component/de-time-clock/TimeClockFormat.vue'
|
||||
|
||||
withDefaults(
|
||||
@ -22,54 +17,17 @@ withDefaults(
|
||||
)
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const { curComponent } = storeToRefs(dvMainStore)
|
||||
|
||||
const fileList = ref([])
|
||||
const dialogImageUrl = ref('')
|
||||
const dialogVisible = ref(false)
|
||||
const uploadDisabled = ref(false)
|
||||
|
||||
const files = ref(null)
|
||||
const maxImageSize = 15000000
|
||||
|
||||
const handlePictureCardPreview = file => {
|
||||
dialogImageUrl.value = file.url
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleRemove = (_, fileList) => {
|
||||
uploadDisabled.value = false
|
||||
curComponent.value.propValue.url = null
|
||||
fileList.value = []
|
||||
snapshotStore.recordSnapshotCache()
|
||||
}
|
||||
async function upload(file) {
|
||||
uploadFileResult(file.file, fileUrl => {
|
||||
snapshotStore.recordSnapshotCache()
|
||||
curComponent.value.propValue.url = fileUrl
|
||||
})
|
||||
}
|
||||
|
||||
const goFile = () => {
|
||||
files.value.click()
|
||||
}
|
||||
|
||||
const reUpload = e => {
|
||||
const file = e.target.files[0]
|
||||
if (file.size > maxImageSize) {
|
||||
sizeMessage()
|
||||
}
|
||||
uploadFileResult(file, fileUrl => {
|
||||
snapshotStore.recordSnapshotCache()
|
||||
curComponent.value.propValue.url = fileUrl
|
||||
fileList.value = [{ url: imgUrlTrans(curComponent.value.propValue.url) }]
|
||||
})
|
||||
}
|
||||
|
||||
const sizeMessage = () => {
|
||||
ElMessage.success('图片大小不符合')
|
||||
}
|
||||
const init = () => {
|
||||
if (curComponent.value.propValue.url) {
|
||||
fileList.value = [{ url: imgUrlTrans(curComponent.value.propValue.url) }]
|
||||
|
@ -5,30 +5,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, toRefs, getCurrentInstance, onMounted } from 'vue'
|
||||
import TimeDefault from '@/custom-component/de-time-clock/TimeDefault.vue'
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
element: {
|
||||
type: Object
|
||||
}
|
||||
})
|
||||
const { element } = toRefs(props)
|
||||
|
||||
let currentInstance
|
||||
const timeMargin = computed(() => {
|
||||
return element.value.style.time_margin
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
currentInstance = getCurrentInstance()
|
||||
})
|
||||
|
||||
const chartResize = () => {
|
||||
const dataRefs = currentInstance.proxy
|
||||
nextTick(() => {
|
||||
dataRefs.$refs[element.value.id] &&
|
||||
dataRefs.$refs[element.value.id].resize &&
|
||||
dataRefs.$refs[element.value.id].resize()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, getCurrentInstance, onMounted, onUnmounted, reactive, toRefs } from 'vue'
|
||||
import { onMounted, onUnmounted, reactive, toRefs } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
element: {
|
||||
|
@ -53,7 +53,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const { propValue, dvInfo, searchCount, element, scale } = toRefs(props)
|
||||
const { propValue, dvInfo, element, scale } = toRefs(props)
|
||||
const customCanvasStyle = computed(() => {
|
||||
const result = sourceCanvasStyle
|
||||
result.scale = canvasStyleData.value.scale
|
||||
|
@ -39,7 +39,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const { view, showPosition, scale, terminal } = toRefs(props)
|
||||
const { view, scale, terminal } = toRefs(props)
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
propValue: {
|
||||
type: String,
|
||||
required: true,
|
||||
|
@ -96,7 +96,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const { scale, element, editMode, active, disabled, showPosition } = toRefs(props)
|
||||
const { element, editMode, active, disabled, showPosition } = toRefs(props)
|
||||
|
||||
const state = reactive({
|
||||
data: null,
|
||||
|
@ -30,19 +30,19 @@ const props = defineProps({
|
||||
}
|
||||
}
|
||||
})
|
||||
const { propValue, element } = toRefs(props)
|
||||
const { element } = toRefs(props)
|
||||
const points = ref('')
|
||||
|
||||
watch(
|
||||
() => element.value.style.width,
|
||||
val => {
|
||||
() => {
|
||||
draw()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => element.value.style.height,
|
||||
val => {
|
||||
() => {
|
||||
draw()
|
||||
}
|
||||
)
|
||||
|
@ -163,7 +163,7 @@ const isRange = computed(() => {
|
||||
})
|
||||
|
||||
const showPopupRight = () => {
|
||||
const [_, end] = selectValue.value || []
|
||||
const end = selectValue.value?.length > 1 ? selectValue.value[1] : null
|
||||
if (!!end) {
|
||||
const time = new Date(end)
|
||||
currentDate.value = [
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { defineStore, storeToRefs } from 'pinia'
|
||||
import { store } from '../../index'
|
||||
import { dvMainStoreWithOut } from './dvMain'
|
||||
import { _$, swap } from '@/utils/utils'
|
||||
import { swap } from '@/utils/utils'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { getCurInfo } from '@/store/modules/data-visualization/common'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { sin, cos, toPercent } from '@/utils/translate'
|
||||
import { sin, cos } from '@/utils/translate'
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import { hexColorToRGBA } from '@/views/chart/components/js/util'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
|
@ -42,11 +42,10 @@ const domId = ref('de-canvas-' + canvasId.value)
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
const { pcMatrixCount, curOriginThemes, dvInfo } = storeToRefs(dvMainStore)
|
||||
const { pcMatrixCount, curOriginThemes } = storeToRefs(dvMainStore)
|
||||
const canvasOut = ref(null)
|
||||
const canvasInner = ref(null)
|
||||
const canvasInitStatus = ref(false)
|
||||
const userInfo = ref(null)
|
||||
|
||||
const state = reactive({
|
||||
screenWidth: 1920,
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { PropType, computed, onMounted, reactive, toRefs, watch, nextTick, ref } from 'vue'
|
||||
import { PropType, computed, onMounted, reactive, watch, nextTick } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import {
|
||||
COLOR_PANEL,
|
||||
@ -8,14 +8,10 @@ import {
|
||||
DEFAULT_INDICATOR_NAME_STYLE,
|
||||
DEFAULT_BASIC_STYLE
|
||||
} from '@/views/chart/components/editor/util/chart'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { cloneDeep, defaultsDeep } from 'lodash-es'
|
||||
import { ElButton, ElIcon } from 'element-plus-secondary'
|
||||
import { ElIcon } from 'element-plus-secondary'
|
||||
import Icon from '@/components/icon-custom/src/Icon.vue'
|
||||
import { hexColorToRGBA } from '@/views/chart/components/js/util'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { batchOptStatus } = storeToRefs(dvMainStore)
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@ -46,8 +42,6 @@ const state = reactive({
|
||||
basicStyleForm: {} as ChartBasicStyle
|
||||
})
|
||||
|
||||
const { chart } = toRefs(props)
|
||||
|
||||
const fontSizeList = computed(() => {
|
||||
const arr = []
|
||||
for (let i = 10; i <= 60; i = i + 2) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { PropType, computed, onMounted, reactive, toRefs, watch, nextTick, ref } from 'vue'
|
||||
import { PropType, computed, onMounted, reactive, watch, nextTick } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import {
|
||||
COLOR_PANEL,
|
||||
@ -8,14 +8,10 @@ import {
|
||||
DEFAULT_INDICATOR_STYLE,
|
||||
DEFAULT_BASIC_STYLE
|
||||
} from '@/views/chart/components/editor/util/chart'
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { cloneDeep, defaultsDeep } from 'lodash-es'
|
||||
import { ElButton, ElIcon, ElInput } from 'element-plus-secondary'
|
||||
import { ElIcon, ElInput } from 'element-plus-secondary'
|
||||
import Icon from '@/components/icon-custom/src/Icon.vue'
|
||||
import { hexColorToRGBA } from '@/views/chart/components/js/util'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { batchOptStatus } = storeToRefs(dvMainStore)
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@ -46,8 +42,6 @@ const state = reactive({
|
||||
basicStyleForm: {} as ChartBasicStyle
|
||||
})
|
||||
|
||||
const { chart } = toRefs(props)
|
||||
|
||||
const fontSizeList = computed(() => {
|
||||
const arr = []
|
||||
for (let i = 10; i <= 60; i = i + 2) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, PropType, reactive, watch } from 'vue'
|
||||
import { onMounted, PropType, reactive, watch } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { DEFAULT_TABLE_TOTAL } from '@/views/chart/components/editor/util/chart'
|
||||
import { cloneDeep, defaultsDeep } from 'lodash-es'
|
||||
@ -27,16 +27,6 @@ watch(
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
const fontSizeList = computed(() => {
|
||||
const arr = []
|
||||
for (let i = 10; i <= 40; i = i + 2) {
|
||||
arr.push({
|
||||
name: i + '',
|
||||
value: i
|
||||
})
|
||||
}
|
||||
return arr
|
||||
})
|
||||
const aggregations = [
|
||||
{ name: t('chart.sum'), value: 'SUM' },
|
||||
{ name: t('chart.avg'), value: 'AVG' },
|
||||
|
@ -10,8 +10,7 @@ import {
|
||||
shallowRef,
|
||||
ShallowRef,
|
||||
toRaw,
|
||||
toRefs,
|
||||
watch
|
||||
toRefs
|
||||
} from 'vue'
|
||||
import { getData } from '@/api/chart'
|
||||
import chartViewManager from '@/views/chart/components/js/panel'
|
||||
|
@ -34,7 +34,7 @@
|
||||
<el-row style="margin-top: 5px">
|
||||
<el-col :span="4" class="name-area">名称</el-col>
|
||||
<el-col :span="20">
|
||||
<el-input v-model="state.dvCreateInfo.name" clearable size="mini" />
|
||||
<el-input v-model="state.dvCreateInfo.name" clearable size="small" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="state.inputType === 'new_inner_template'" class="preview">
|
||||
@ -52,8 +52,8 @@
|
||||
:style="classBackground"
|
||||
/>
|
||||
<el-row class="root-class">
|
||||
<el-button size="mini" @click="cancel()">{{ t('commons.cancel') }} </el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!saveStatus" @click="save()"
|
||||
<el-button size="small" @click="cancel()">{{ t('commons.cancel') }} </el-button>
|
||||
<el-button type="primary" size="small" :disabled="!saveStatus" @click="save()"
|
||||
>{{ t('commons.confirm') }}
|
||||
</el-button>
|
||||
</el-row>
|
||||
@ -119,7 +119,7 @@ const classBackground = computed(() => {
|
||||
|
||||
watch(
|
||||
() => state.inputType,
|
||||
val => {
|
||||
() => {
|
||||
createInit()
|
||||
}
|
||||
)
|
||||
@ -211,7 +211,7 @@ const goFile = () => {
|
||||
const close = () => {
|
||||
state.dialogShow = false
|
||||
}
|
||||
const optInit = param => {
|
||||
const optInit = () => {
|
||||
state.dialogShow = true
|
||||
createInit()
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import TemplateMarket from '@/views/template-market/index.vue'
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import { nextTick, reactive, ref } from 'vue'
|
||||
const templateMarketCreateRef = ref(null)
|
||||
|
||||
const state = reactive({
|
||||
|
@ -5,7 +5,7 @@
|
||||
<el-input
|
||||
v-model="state.templateFilterText"
|
||||
:placeholder="t('visualization.filter_keywords')"
|
||||
size="mini"
|
||||
size="small"
|
||||
clearable
|
||||
prefix-icon="el-icon-search"
|
||||
/>
|
||||
@ -50,7 +50,7 @@ import { reactive } from 'vue'
|
||||
const { t } = useI18n()
|
||||
const emits = defineEmits(['showCurrentTemplateInfo'])
|
||||
|
||||
const props = defineProps({
|
||||
defineProps({
|
||||
curCanvasType: {
|
||||
type: String,
|
||||
required: true
|
||||
@ -74,7 +74,7 @@ const filterNode = (value, data) => {
|
||||
return data.label.indexOf(value) !== -1
|
||||
}
|
||||
|
||||
const nodeClick = (data, node) => {
|
||||
const nodeClick = data => {
|
||||
if (data.nodeType === 'template') {
|
||||
findOne(data.id).then(res => {
|
||||
emits('showCurrentTemplateInfo', res.data)
|
||||
|
@ -62,7 +62,6 @@ const handleLoad = () => {
|
||||
const componentDataNotInMobile = computed(() => {
|
||||
return componentData.value.filter(ele => !ele.inMobile)
|
||||
})
|
||||
const openMobile = ref(false)
|
||||
|
||||
const hanedleMessage = event => {
|
||||
if (event.data.type === 'panelInit') {
|
||||
|
@ -124,14 +124,14 @@ const state = reactive({
|
||||
|
||||
watch(
|
||||
() => state.marketActiveTab,
|
||||
value => {
|
||||
() => {
|
||||
initTemplateShow()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => state.searchText,
|
||||
value => {
|
||||
() => {
|
||||
initTemplateShow()
|
||||
}
|
||||
)
|
||||
@ -174,25 +174,10 @@ const initMarketTemplate = async () => {
|
||||
})
|
||||
}
|
||||
|
||||
const normalizer = node => {
|
||||
// 去掉children=null的属性
|
||||
if (node.children === null || node.children === 'null') {
|
||||
delete node.children
|
||||
}
|
||||
}
|
||||
|
||||
const templateApply = template => {
|
||||
emits('templateApply', template)
|
||||
}
|
||||
|
||||
const closeDialog = () => {
|
||||
emits('closeDialog')
|
||||
}
|
||||
|
||||
const handleClick = item => {
|
||||
//handleClick
|
||||
}
|
||||
|
||||
const initTemplateShow = () => {
|
||||
state.hasResult = false
|
||||
state.currentMarketTemplateShowList.forEach(template => {
|
||||
|
@ -205,21 +205,21 @@ const state = reactive({
|
||||
|
||||
watch(
|
||||
() => state.templateType,
|
||||
value => {
|
||||
() => {
|
||||
initTemplateShow()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => state.searchText,
|
||||
value => {
|
||||
() => {
|
||||
initTemplateShow()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.previewId,
|
||||
value => {
|
||||
() => {
|
||||
state.marketTemplatePreviewShowList.forEach(categoryTemplates => {
|
||||
categoryTemplates.contents.forEach(template => {
|
||||
if (props.previewId === template.id) {
|
||||
@ -232,7 +232,7 @@ watch(
|
||||
|
||||
watch(
|
||||
() => state.templateSourceType,
|
||||
value => {
|
||||
() => {
|
||||
initTemplateShow()
|
||||
}
|
||||
)
|
||||
@ -260,29 +260,10 @@ const initMarketTemplate = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const getGroupTree = () => {
|
||||
// do getGroupTree
|
||||
}
|
||||
|
||||
const normalizer = node => {
|
||||
// 去掉children=null的属性
|
||||
if (node.children === null || node.children === 'null') {
|
||||
delete node.children
|
||||
}
|
||||
}
|
||||
|
||||
const templateApply = template => {
|
||||
emits('templateApply', template)
|
||||
}
|
||||
|
||||
const closeDialog = () => {
|
||||
emits('closeDialog')
|
||||
}
|
||||
|
||||
const handleClick = item => {
|
||||
//handleClick
|
||||
}
|
||||
|
||||
const initTemplateShow = () => {
|
||||
state.hasResult = false
|
||||
state.marketTemplatePreviewShowList.forEach(categoryTemplates => {
|
||||
|
@ -7,10 +7,10 @@
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-row class="template-button">
|
||||
<el-button size="mini" style="width: 141px" @click="templateInnerPreview">{{
|
||||
<el-button size="small" style="width: 141px" @click="templateInnerPreview">{{
|
||||
t('visualization.preview')
|
||||
}}</el-button>
|
||||
<el-button size="mini" style="width: 141px" type="primary" @click="apply">{{
|
||||
<el-button size="small" style="width: 141px" type="primary" @click="apply">{{
|
||||
t('visualization.apply')
|
||||
}}</el-button>
|
||||
</el-row>
|
||||
@ -61,7 +61,7 @@ const apply = () => {
|
||||
emits('templateApply', props.template)
|
||||
}
|
||||
|
||||
const templateInnerPreview = e => {
|
||||
const templateInnerPreview = () => {
|
||||
emits('templatePreview', props.template.id)
|
||||
}
|
||||
</script>
|
||||
|
@ -80,7 +80,7 @@ const apply = () => {
|
||||
emits('templateApply', props.template)
|
||||
}
|
||||
|
||||
const templateInnerPreview = e => {
|
||||
const templateInnerPreview = () => {
|
||||
emits('templatePreview', props.template.id)
|
||||
}
|
||||
</script>
|
||||
|
@ -169,7 +169,6 @@ import { decompression } from '@/api/visualization/dataVisualization'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import MarketPreviewV2 from '@/views/template-market/component/MarketPreviewV2.vue'
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
import CategoryTemplateV2 from '@/views/template-market/component/CategoryTemplateV2.vue'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
const { t } = useI18n()
|
||||
@ -322,21 +321,21 @@ const optInit = params => {
|
||||
}
|
||||
watch(
|
||||
() => state.searchText,
|
||||
value => {
|
||||
() => {
|
||||
initTemplateShow()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => state.templateType,
|
||||
value => {
|
||||
() => {
|
||||
initTemplateShow()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => state.templateSourceType,
|
||||
value => {
|
||||
() => {
|
||||
state.treeShow = false
|
||||
initTemplateShow()
|
||||
nextTick(() => {
|
||||
@ -380,12 +379,6 @@ const initStyle = () => {
|
||||
tree.firstElementChild.appendChild(line)
|
||||
})
|
||||
}
|
||||
const normalizer = node => {
|
||||
// 去掉children=null的属性
|
||||
if (node.children === null || node.children === 'null') {
|
||||
delete node.children
|
||||
}
|
||||
}
|
||||
|
||||
const preOne = () => {
|
||||
if (state.curTemplateIndex > 0) {
|
||||
@ -443,9 +436,7 @@ const apply = () => {
|
||||
state.loading = false
|
||||
})
|
||||
}
|
||||
const handleClick = item => {
|
||||
// do handleClick
|
||||
}
|
||||
|
||||
const initTemplateShow = () => {
|
||||
let tempHasResult = false
|
||||
state.currentMarketTemplateShowList.forEach(template => {
|
||||
@ -502,7 +493,7 @@ onMounted(() => {
|
||||
const templateMainDom = document.getElementById('template-show-area')
|
||||
// 监听div变动事件
|
||||
if (templateMainDom) {
|
||||
erd.listenTo(templateMainDom, element => {
|
||||
erd.listenTo(templateMainDom, () => {
|
||||
nextTick(() => {
|
||||
const offsetWidth = templateMainDom.offsetWidth - 26
|
||||
const curSeparator = Math.trunc(offsetWidth / state.templateMiniWidth)
|
||||
|
@ -32,7 +32,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { onMounted, reactive } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { batchUpdate, findCategoriesByTemplateIds } from '@/api/template'
|
||||
import { ElMessage } from 'element-plus-secondary'
|
||||
@ -89,7 +89,7 @@ const saveChange = () => {
|
||||
ElMessage.warning('请选择分类')
|
||||
return false
|
||||
}
|
||||
batchUpdate(params).then(rsp => {
|
||||
batchUpdate(params).then(() => {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
|
@ -65,8 +65,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { save, nameCheck, find, findOne, categoryTemplateNameCheck } from '@/api/template'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { save, nameCheck, findOne, categoryTemplateNameCheck } from '@/api/template'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
@ -145,12 +145,6 @@ const classBackground = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const showCurrentTemplate = pid => {
|
||||
find({ pid }).then(response => {
|
||||
state.nameList = response.data
|
||||
})
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
emits('closeEditTemplateDialog')
|
||||
}
|
||||
@ -189,8 +183,8 @@ const editTemplate = () => {
|
||||
optType: props.optType
|
||||
}
|
||||
// 全局名称校验
|
||||
nameCheck(nameCheckRequest).then(response => {
|
||||
save(state.templateInfo).then(response => {
|
||||
nameCheck(nameCheckRequest).then(() => {
|
||||
save(state.templateInfo).then(() => {
|
||||
ElMessage.success(t('编辑成功'))
|
||||
emits('refresh', getRefreshPInfo())
|
||||
emits('closeEditTemplateDialog')
|
||||
@ -229,7 +223,7 @@ const importTemplate = () => {
|
||||
autofocus: false,
|
||||
showClose: false
|
||||
}).then(() => {
|
||||
save(state.templateInfo).then(response => {
|
||||
save(state.templateInfo).then(() => {
|
||||
ElMessage.success(t('覆盖成功'))
|
||||
emits('refresh', getRefreshPInfo())
|
||||
emits('closeEditTemplateDialog')
|
||||
@ -237,8 +231,8 @@ const importTemplate = () => {
|
||||
})
|
||||
} else {
|
||||
// 全局名称校验
|
||||
nameCheck(nameCheckRequest).then(response => {
|
||||
save(state.templateInfo).then(response => {
|
||||
nameCheck(nameCheckRequest).then(() => {
|
||||
save(state.templateInfo).then(() => {
|
||||
ElMessage.success(t('导入成功'))
|
||||
emits('refresh', getRefreshPInfo())
|
||||
emits('closeEditTemplateDialog')
|
||||
@ -273,10 +267,6 @@ const doAddCategory = () => {
|
||||
emits('refresh', { optType: 'addCategory' })
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// showCurrentTemplate(props.pid)
|
||||
})
|
||||
|
||||
if (props.templateId) {
|
||||
findOne(props.templateId).then(rsp => {
|
||||
state.templateInfo = rsp.data
|
||||
|
@ -39,8 +39,6 @@
|
||||
<script setup lang="ts">
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import { computed, toRefs } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const { t } = useI18n()
|
||||
const emits = defineEmits(['command'])
|
||||
|
||||
const props = defineProps({
|
||||
@ -55,11 +53,7 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const { model, width, batchState } = toRefs(props)
|
||||
|
||||
const dvTypeName = computed(() => {
|
||||
return props.model.dvType === 'dashboard' ? '仪表板' : '数据大屏'
|
||||
})
|
||||
const { model, batchState } = toRefs(props)
|
||||
|
||||
const classBackground = computed(() => {
|
||||
return {
|
||||
|
@ -97,9 +97,7 @@ const nodeClick = ({ id, name }) => {
|
||||
state.activeTemplate = id
|
||||
emits('showCurrentTemplate', id, name)
|
||||
}
|
||||
const add = () => {
|
||||
emits('showTemplateEditDialog', 'new')
|
||||
}
|
||||
|
||||
const categoryDelete = template => {
|
||||
ElMessageBox.confirm('确定删除该分类吗?', {
|
||||
tip: '删除后不可恢复,是否继续?',
|
||||
@ -119,10 +117,6 @@ const templateImport = template => {
|
||||
emits('templateImport', template.id)
|
||||
}
|
||||
|
||||
const handlerConfirm = options => {
|
||||
// do handlerConfirm
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
nodeClick
|
||||
})
|
||||
|
@ -199,8 +199,6 @@ import DeTemplateList from '@/views/template/component/DeTemplateList.vue'
|
||||
const { t } = useI18n()
|
||||
const templateEditFormRef = ref(null)
|
||||
const templateListRef = ref(null)
|
||||
import NoneTemplate from '@/assets/svg/dv-empty.svg'
|
||||
import NoneImage from '@/assets/none.png'
|
||||
import DeTemplateImport from '@/views/template/component/DeTemplateImport.vue'
|
||||
import DeTemplateItem from '@/views/template/component/DeTemplateItem.vue'
|
||||
import DeCategoryChange from '@/views/template/component/DeCategoryChange.vue'
|
||||
@ -282,7 +280,7 @@ const batchPreDelete = () => {
|
||||
templateIds: batchTemplateIds.value,
|
||||
categories: [state.currentTemplateId]
|
||||
}
|
||||
batchDelete(params).then(rsp => {
|
||||
batchDelete(params).then(() => {
|
||||
ElMessage({
|
||||
message: t('commons.delete_success'),
|
||||
type: 'success',
|
||||
@ -356,18 +354,10 @@ const handleCommand = (key, data) => {
|
||||
}
|
||||
}
|
||||
|
||||
const handlerConfirm = option => {
|
||||
//do handlerConfirm
|
||||
}
|
||||
|
||||
const templateDeleteConfirm = template => {
|
||||
templateDeleteInfo(template.id)
|
||||
}
|
||||
|
||||
const handleClick = (tab, event) => {
|
||||
getTree()
|
||||
}
|
||||
|
||||
const importRefresh = params => {
|
||||
if (params.optType === 'refresh') {
|
||||
templateListRef.value.nodeClick({ id: params.refreshPid, name: params.refreshPid })
|
||||
@ -420,7 +410,7 @@ const templateDeleteInfo = id => {
|
||||
autofocus: false,
|
||||
showClose: false
|
||||
}).then(() => {
|
||||
templateDelete(id, state.currentTemplateId).then(response => {
|
||||
templateDelete(id, state.currentTemplateId).then(() => {
|
||||
ElMessage({
|
||||
message: t('commons.delete_success'),
|
||||
type: 'success',
|
||||
@ -463,10 +453,6 @@ const templateEdit = templateInfo => {
|
||||
state.templateDialog.templateId = templateInfo.id
|
||||
}
|
||||
|
||||
const categoryClick = params => {
|
||||
// do
|
||||
}
|
||||
|
||||
const saveTemplateEdit = templateEditForm => {
|
||||
if (templateEditForm.name === '最近使用') {
|
||||
ElMessage({
|
||||
@ -478,7 +464,7 @@ const saveTemplateEdit = templateEditForm => {
|
||||
}
|
||||
templateEditFormRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
save({ ...templateEditForm }).then(response => {
|
||||
save({ ...templateEditForm }).then(() => {
|
||||
ElMessage({
|
||||
message: '添加成功',
|
||||
type: 'success',
|
||||
@ -551,7 +537,7 @@ onMounted(() => {
|
||||
const erd = elementResizeDetectorMaker()
|
||||
const templateMainDom = document.getElementById('template-box')
|
||||
// 监听div变动事件
|
||||
erd.listenTo(templateMainDom, element => {
|
||||
erd.listenTo(templateMainDom, () => {
|
||||
nextTick(() => {
|
||||
const offsetWidth = templateMainDom.offsetWidth - 24
|
||||
const curSeparator = Math.trunc(offsetWidth / state.templateMiniWidth)
|
||||
|
@ -107,7 +107,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { onMounted, reactive } from 'vue'
|
||||
import { watermarkFind, watermarkSave } from '@/api/watermark'
|
||||
import { ElMessage } from 'element-plus-secondary/es'
|
||||
import { personInfoApi } from '@/api/user'
|
||||
@ -159,7 +159,7 @@ const state = reactive({
|
||||
}
|
||||
})
|
||||
|
||||
const enableChange = val => {
|
||||
const enableChange = () => {
|
||||
initWatermark()
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ const cancel = () => {
|
||||
const params = {
|
||||
settingContent: JSON.stringify(state.watermarkForm)
|
||||
}
|
||||
watermarkSave(params).then(rsp => {
|
||||
watermarkSave(params).then(() => {
|
||||
//ignore
|
||||
})
|
||||
initWatermark()
|
||||
@ -182,7 +182,7 @@ const save = () => {
|
||||
const params = {
|
||||
settingContent: JSON.stringify(state.watermarkForm)
|
||||
}
|
||||
watermarkSave(params).then(rsp => {
|
||||
watermarkSave(params).then(() => {
|
||||
ElMessage.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ const apply = () => {
|
||||
emits('templateApply', props.template)
|
||||
}
|
||||
|
||||
const templateInnerPreview = e => {
|
||||
const templateInnerPreview = () => {
|
||||
emits('templatePreview', props.template.id)
|
||||
}
|
||||
</script>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { ref, shallowRef, computed, reactive, watch, nextTick } from 'vue'
|
||||
import { ref, shallowRef, computed, reactive, watch } from 'vue'
|
||||
|
||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
import { useRequestStoreWithOut } from '@/store/modules/request'
|
||||
@ -54,10 +54,6 @@ const handleExpandFold = () => {
|
||||
expandFold.value = expandFold.value === 'expand' ? 'fold' : 'expand'
|
||||
}
|
||||
|
||||
const showTemplate = computed(() => {
|
||||
return state.networkStatus && state.hasResult
|
||||
})
|
||||
|
||||
const createAuth = computed(() => {
|
||||
return {
|
||||
PANEL: havePanelAuth.value,
|
||||
|
Loading…
Reference in New Issue
Block a user