refactor: UI调整,增加调试信息

This commit is contained in:
wangjiahao 2023-12-01 16:26:08 +08:00
parent 93a7b23180
commit c355e6a66e
5 changed files with 139 additions and 68 deletions

View File

@ -36,4 +36,7 @@ CREATE TABLE `visualization_template_extend_data` (
ALTER TABLE `core_opt_recent` ALTER TABLE `core_opt_recent`
MODIFY COLUMN `resource_id` bigint NULL COMMENT '资源ID' AFTER `id`, MODIFY COLUMN `resource_id` bigint NULL COMMENT '资源ID' AFTER `id`,
ADD COLUMN `resource_name` varchar(255) NULL COMMENT '资源名称' AFTER `resource_id`; ADD COLUMN `resource_name` varchar(255) NULL COMMENT '资源名称' AFTER `resource_id`;
INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (7, 'template.url', 'https://templates-de.fit2cloud.com', 'text', 0);
INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (8, 'template.accessKey', 'dataease', 'text', 1);

View File

@ -54,4 +54,6 @@ CREATE TABLE `core_area_custom`
BEGIN; BEGIN;
INSERT INTO `core_sys_setting` VALUES (1, 'basic.dsIntervalTime', '6', 'text', 2); INSERT INTO `core_sys_setting` VALUES (1, 'basic.dsIntervalTime', '6', 'text', 2);
INSERT INTO `core_sys_setting` VALUES (2, 'basic.dsExecuteTime', 'minute', 'text', 3); INSERT INTO `core_sys_setting` VALUES (2, 'basic.dsExecuteTime', 'minute', 'text', 3);
COMMIT; INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (7, 'template.url', 'https://templates-de.fit2cloud.com', 'text', 0);
INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (8, 'template.accessKey', 'dataease', 'text', 1);
COMMIT;

View File

@ -26,6 +26,6 @@ export default {
} }
} }
}, },
sourcemap: false sourcemap: true
} }
} }

View File

@ -0,0 +1,103 @@
<template>
<el-col class="main-head">
<div class="custom-split-line"></div>
<span v-show="!searchText" class="custom-category">{{ label }}</span>
<span v-show="searchText" class="custom-search">{{ label }}</span>
<span v-if="searchText" class="custom-search-result"
>的搜索结果是{{ fullTemplateShowList.length }}</span
>
</el-col>
<el-col
v-for="(templateItem, index) in fullTemplateShowList"
v-show="templateItem.showFlag"
:key="templateItem.id + label"
style="float: left; padding: 24px 12px 0; text-align: center; flex: 0"
:style="{ width: templateSpan }"
>
<template-market-v2-item
:key="index"
:template="templateItem"
:base-url="baseUrl"
:width="templateCurWidth"
:cur-position="curPosition"
@templateApply="templateApply"
@templatePreview="templatePreview"
/>
</el-col>
</template>
<script setup lang="ts">
import TemplateMarketV2Item from '@/views/template-market/component/TemplateMarketV2Item.vue'
const emits = defineEmits(['templateApply', 'templatePreview'])
const templateApply = params => {
emits('templateApply', params)
}
const templatePreview = params => {
emits('templatePreview', params)
}
const props = defineProps({
searchText: {
type: String
},
baseUrl: {
type: String
},
templateCurWidth: {
type: Number
},
curPosition: {
type: String
},
templateSpan: {
type: String
},
label: {
type: String
},
fullTemplateShowList: {
type: Array,
default: () => []
}
})
</script>
<style lang="less" scoped>
.main-head {
width: 100%;
float: left;
height: 24px;
margin-top: 16px;
display: inline;
.custom-split-line {
margin: 4px 8px 0 12px;
width: 2px;
height: 16px;
background: rgba(51, 112, 255, 1);
float: left;
}
.custom-category {
float: left;
font-weight: 500;
font-size: 16px;
color: rgba(31, 35, 41, 1);
}
.custom-search {
float: left;
font-weight: 500;
font-size: 16px;
color: rgba(51, 112, 255, 1);
margin-right: 8px;
}
.custom-search-result {
float: left;
font-weight: 500;
font-size: 16px;
color: rgba(31, 35, 41, 1);
margin-right: 8px;
}
}
</style>

View File

@ -102,75 +102,39 @@
id="template-show-area" id="template-show-area"
class="template-right" class="template-right"
> >
<template v-if="state.marketActiveTab !== '推荐'"> <el-row style="display: inline" v-show="state.marketActiveTab !== '推荐'">
<el-col class="main-head"> <category-template
<div class="custom-split-line"></div> :search-text="state.searchText"
<span v-show="!state.searchText" class="custom-category">{{ :label="state.marketActiveTab"
state.marketActiveTab :full-template-show-list="state.currentMarketTemplateShowList"
}}</span> :template-span="state.templateSpan"
<span v-show="state.searchText" class="custom-search">{{ :base-url="state.baseUrl"
state.marketActiveTab :template-cur-width="state.templateCurWidth"
}}</span> :cur-position="state.curPosition"
<span v-if="state.searchText" class="custom-search-result" @templateApply="templateApply"
>的搜索结果是{{ searchResultCount }}</span @templatePreview="templatePreview"
> ></category-template>
</el-col> </el-row>
<el-col
v-for="templateItem in state.currentMarketTemplateShowList"
v-show="templateItem.showFlag"
:key="templateItem.id"
style="float: left; padding: 24px 12px 0; text-align: center; flex: 0"
:style="{ width: state.templateSpan }"
>
<template-market-v2-item
:key="'outer-' + templateItem.id"
:template="templateItem"
:base-url="state.baseUrl"
:width="state.templateCurWidth"
:cur-position="state.curPosition"
@templateApply="templateApply"
@templatePreview="templatePreview"
/>
</el-col>
</template>
<template v-if="state.marketActiveTab === '推荐'"> <template v-if="state.marketActiveTab === '推荐'">
<el-row <el-row
:key="'full-' + categoryItem.label" :key="'full-' + categoryItem.label"
style="display: inline; margin-bottom: 16px" style="display: inline; margin-bottom: 16px"
v-for="categoryItem in categoriesComputed.filter( v-for="categoryItem in categoriesComputed.filter(
item => !['最近使用', '推荐'].includes(item.label) item => !['最近使用', '推荐'].includes(item['label'])
)" )"
> >
<el-col class="main-head"> <categoery-template
<div class="custom-split-line"></div> :search-text="state.searchText"
<span v-show="!state.searchText" class="custom-category">{{ :label="categoryItem.label"
categoryItem.label :full-template-show-list="fullTemplateShowList(categoryItem.label)"
}}</span> :template-span="state.templateSpan"
<span v-show="state.searchText" class="custom-search">{{ :base-url="state.baseUrl"
categoryItem.label :template-cur-width="state.templateCurWidth"
}}</span> :cur-position="state.curPosition"
<span v-if="state.searchText" class="custom-search-result" @templateApply="templateApply"
>的搜索结果是{{ fullTemplateShowList(categoryItem.label).length }}</span @templatePreview="templatePreview"
> ></categoery-template>
</el-col>
<el-col
v-for="templateItem in fullTemplateShowList(categoryItem.label)"
v-show="templateItem.showFlag"
:key="templateItem.id + categoryItem.label"
style="float: left; padding: 24px 12px 0; text-align: center; flex: 0"
:style="{ width: state.templateSpan }"
>
<template-market-v2-item
:key="'outer-' + templateItem.id"
:template="templateItem"
:base-url="state.baseUrl"
:width="state.templateCurWidth"
:cur-position="state.curPosition"
@templateApply="templateApply"
@templatePreview="templatePreview"
/>
</el-col>
</el-row> </el-row>
</template> </template>
</div> </div>
@ -198,13 +162,12 @@ import { useRoute } from 'vue-router'
import { ElMessage } from 'element-plus-secondary' import { ElMessage } from 'element-plus-secondary'
import { decompression } from '@/api/visualization/dataVisualization' import { decompression } from '@/api/visualization/dataVisualization'
import { useCache } from '@/hooks/web/useCache' import { useCache } from '@/hooks/web/useCache'
import TemplateMarketV2Item from '@/views/template-market/component/TemplateMarketV2Item.vue'
import MarketPreviewV2 from '@/views/template-market/component/MarketPreviewV2.vue' import MarketPreviewV2 from '@/views/template-market/component/MarketPreviewV2.vue'
import { propTypes } from '@/utils/propTypes'
import { imgUrlTrans } from '@/utils/imgUtils' import { imgUrlTrans } from '@/utils/imgUtils'
import CategoryTemplate from '@/views/template-market/component/CategoryTemplate.vue'
import { deepCopy } from '@/utils/utils'
const { t } = useI18n() const { t } = useI18n()
const { wsCache } = useCache() const { wsCache } = useCache()
const route = useRoute()
// full marketPreview createPreview // full marketPreview createPreview
const previewModel = ref('full') const previewModel = ref('full')
@ -482,7 +445,7 @@ const fullTemplateShowList = curTab => {
state.currentMarketTemplateShowList.forEach(template => { state.currentMarketTemplateShowList.forEach(template => {
template.showFlag = templateShow(template, curTab) template.showFlag = templateShow(template, curTab)
}) })
return state.currentMarketTemplateShowList.filter(ele => ele.showFlag) return deepCopy(state.currentMarketTemplateShowList.filter(ele => ele.showFlag))
} }
const templateShow = (templateItem, activeTab) => { const templateShow = (templateItem, activeTab) => {