Compare commits
2 Commits
2cfd3db67a
...
4d2689377b
| Author | SHA1 | Date |
|---|---|---|
|
|
4d2689377b | |
|
|
fb4e1f3fe1 |
|
|
@ -357,7 +357,7 @@ const queryUseLabel = (label) => {
|
|||
FileApi.getDomain().then(domain => {
|
||||
ProductCareItemApi.getProductCareItemPage({
|
||||
pageNo: 1,
|
||||
pageSize: 30,
|
||||
pageSize: 100,
|
||||
value: label,
|
||||
locale: currentLocale.value.lang,
|
||||
isCombo: false,
|
||||
|
|
@ -375,7 +375,7 @@ const queryUseLabel = (label) => {
|
|||
})
|
||||
ProductCareItemApi.getProductCareItemPage({
|
||||
pageNo: 1,
|
||||
pageSize: 30,
|
||||
pageSize: 100,
|
||||
value: label,
|
||||
locale: currentLocale.value.lang,
|
||||
isCombo: true,
|
||||
|
|
@ -433,7 +433,6 @@ onMounted(() => {
|
|||
})
|
||||
defineExpose({
|
||||
previewByDraftDesignId,
|
||||
|
||||
previewByProductId,
|
||||
loadConfig,
|
||||
getPropInfo
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
// 获取设备像素比
|
||||
import * as FileApi from "@/api/infra/file";
|
||||
import {replaceDomain} from "@/utils";
|
||||
|
||||
const dppx = window.devicePixelRatio ||
|
||||
(window.matchMedia && window.matchMedia("(min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 1.5),(-moz-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5)").matches ? 2 : 1) ||
|
||||
1;
|
||||
|
|
@ -36,20 +39,24 @@ export function calcDpiFromSize( screenSize=16,opt = 'd'){
|
|||
const tmpImage = {}
|
||||
export function convertImageToBase64(url) {
|
||||
return new Promise(async (resolve, reject)=>{
|
||||
if(tmpImage[url]){
|
||||
resolve(tmpImage[url]);
|
||||
console.log('缓存')
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const blob = await response.blob();
|
||||
const base = `data:${response.headers.get('content-type')};base64,${btoa(String.fromCharCode(...new Uint8Array(await blob.arrayBuffer())))}`
|
||||
tmpImage[url] = base
|
||||
resolve(base)
|
||||
}catch (e) {
|
||||
resolve(url);
|
||||
}
|
||||
FileApi.getDomain().then(async (domain) => {
|
||||
url = replaceDomain(domain, url)
|
||||
if(tmpImage[url]){
|
||||
resolve(tmpImage[url]);
|
||||
console.log('缓存')
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const blob = await response.blob();
|
||||
const base = `data:${response.headers.get('content-type')};base64,${btoa(String.fromCharCode(...new Uint8Array(await blob.arrayBuffer())))}`
|
||||
tmpImage[url] = base
|
||||
resolve(base)
|
||||
}catch (e) {
|
||||
resolve(url);
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ export function copyToClip(content: string, calback = () => {
|
|||
*/
|
||||
export function replaceDomain(domain, url) {
|
||||
if (domain && url) {
|
||||
return url.replace(`http://127.0.0.1:48080`, domain)
|
||||
return url.replace(`http://127.0.0.1:48080`, domain).replace("http://localhost:48080",domain)
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
<el-row :gutter="16" justify="space-between">
|
||||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
||||
<div class="flex items-center">
|
||||
<el-avatar :src="avatar" :size="70" class="mr-16px">
|
||||
<img src="@/assets/imgs/avatar.gif" alt="" />
|
||||
</el-avatar>
|
||||
<div>
|
||||
<div class="text-20px">
|
||||
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
|
||||
|
|
@ -18,158 +15,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
|
||||
<div class="h-70px flex items-center justify-end lt-sm:mt-10px">
|
||||
<div class="px-8px text-right">
|
||||
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.project') }}</div>
|
||||
<CountTo
|
||||
class="text-20px"
|
||||
:start-val="0"
|
||||
:end-val="totalSate.project"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
<el-divider direction="vertical" />
|
||||
<div class="px-8px text-right">
|
||||
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
|
||||
<CountTo
|
||||
class="text-20px"
|
||||
:start-val="0"
|
||||
:end-val="totalSate.todo"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
<el-divider direction="vertical" border-style="dashed" />
|
||||
<div class="px-8px text-right">
|
||||
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.access') }}</div>
|
||||
<CountTo
|
||||
class="text-20px"
|
||||
:start-val="0"
|
||||
:end-val="totalSate.access"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<el-row class="mt-8px" :gutter="8" justify="space-between">
|
||||
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-8px">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="h-3 flex justify-between">
|
||||
<span>{{ t('workplace.project') }}</span>
|
||||
<el-link
|
||||
type="primary"
|
||||
:underline="false"
|
||||
href="https://github.com/yudaocode"
|
||||
target="_blank"
|
||||
>
|
||||
{{ t('action.more') }}
|
||||
</el-link>
|
||||
</div>
|
||||
</template>
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-row>
|
||||
<el-col
|
||||
v-for="(item, index) in projects"
|
||||
:key="`card-${index}`"
|
||||
:xl="8"
|
||||
:lg="8"
|
||||
:md="8"
|
||||
:sm="24"
|
||||
:xs="24"
|
||||
>
|
||||
<el-card shadow="hover" class="mr-5px mt-5px">
|
||||
<div class="flex items-center">
|
||||
<Icon :icon="item.icon" :size="25" class="mr-8px" />
|
||||
<span class="text-16px">{{ item.name }}</span>
|
||||
</div>
|
||||
<div class="mt-12px text-9px text-gray-400">{{ t(item.message) }}</div>
|
||||
<div class="mt-12px flex justify-between text-12px text-gray-400">
|
||||
<span>{{ item.personal }}</span>
|
||||
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt-8px">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-row :gutter="20" justify="space-between">
|
||||
<el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24">
|
||||
<el-card shadow="hover" class="mb-8px">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<Echart :options="pieOptionsData" :height="280" />
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
|
||||
<el-card shadow="hover" class="mb-8px">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<Echart :options="barOptionsData" :height="280" />
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-8px">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<div class="h-3 flex justify-between">
|
||||
<span>{{ t('workplace.shortcutOperation') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-row>
|
||||
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
|
||||
<div class="flex items-center">
|
||||
<Icon :icon="item.icon" class="mr-8px" />
|
||||
<el-link type="default" :underline="false" @click="setWatermark(item.name)">
|
||||
{{ item.name }}
|
||||
</el-link>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt-8px">
|
||||
<template #header>
|
||||
<div class="h-3 flex justify-between">
|
||||
<span>{{ t('workplace.notice') }}</span>
|
||||
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
|
||||
</div>
|
||||
</template>
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<div v-for="(item, index) in notice" :key="`dynamics-${index}`">
|
||||
<div class="flex items-center">
|
||||
<el-avatar :src="avatar" :size="35" class="mr-16px">
|
||||
<img src="@/assets/imgs/avatar.gif" alt="" />
|
||||
</el-avatar>
|
||||
<div>
|
||||
<div class="text-14px">
|
||||
<Highlight :keys="item.keys.map((v) => t(v))">
|
||||
{{ item.type }} : {{ item.title }}
|
||||
</Highlight>
|
||||
</div>
|
||||
<div class="mt-16px text-12px text-gray-400">
|
||||
{{ formatTime(item.date, 'yyyy-MM-dd') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider />
|
||||
</div>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { set } from 'lodash-es'
|
||||
|
|
|
|||
|
|
@ -27,6 +27,37 @@
|
|||
<el-checkbox v-model="formData.isCombo">是否只作用于组合(洗涤说明icon和文本)</el-checkbox>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="多语言" prop="lang_mapping">
|
||||
<el-button @click="addLangMapping">添加</el-button>
|
||||
<el-table :data="that.langList" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column prop="locale" label="地区语言" width="150" >
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.locale" placeholder="地区语言">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.LANGUAGE_LOCALE)"
|
||||
:key="`${dict.value}`"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="value" label="多语言内容" >
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.value" placeholder="请输入多语言内容" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="value" label="操作" >
|
||||
<template #default="{$index}">
|
||||
<el-button type="danger" @click="removeRow($index) " >删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="语言标识" prop="locale">
|
||||
<el-select v-model="formData.locale" placeholder="请选择语言标识">
|
||||
<el-option
|
||||
|
|
@ -82,7 +113,19 @@ const formRules = reactive({
|
|||
value: [{ required: true, message: '说明不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const that = reactive({
|
||||
langList: [],
|
||||
})
|
||||
|
||||
const addLangMapping = () => {
|
||||
that.langList.push({
|
||||
locale: '',
|
||||
value: '',
|
||||
})
|
||||
}
|
||||
const removeRow = (index) => {
|
||||
|
||||
}
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
DROP TABLE IF EXISTS oms_product_info;
|
||||
CREATE TABLE oms_product_info(
|
||||
id BIGINT(19) NOT NULL AUTO_INCREMENT COMMENT 'id' ,
|
||||
code VARCHAR(64) COMMENT '产品编码' ,
|
||||
name VARCHAR(512) NOT NULL COMMENT '产品名称' ,
|
||||
cover VARCHAR(512) COMMENT '封面' ,
|
||||
brand_id BIGINT(19) COMMENT '品牌' ,
|
||||
product_type_id BIGINT(19) COMMENT '产品类型id' ,
|
||||
draft_design_data_id VARCHAR(32) COMMENT '设计稿id' ,
|
||||
enabled BIT(1) DEFAULT 1 COMMENT '启用状态' ,
|
||||
remark VARCHAR(512) COMMENT '备注' ,
|
||||
details longtext COMMENT '详情介绍' ,
|
||||
creator VARCHAR(64) COMMENT '创建者' ,
|
||||
create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,
|
||||
updater VARCHAR(64) COMMENT '更新者' ,
|
||||
update_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间' ,
|
||||
deleted BIT(1) NOT NULL DEFAULT 0 COMMENT '是否删除' ,
|
||||
tenant_id BIGINT(19) NOT NULL COMMENT '租户编号' ,
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '产品资料 ';
|
||||
Loading…
Reference in New Issue