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