Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
7bead4a4
Commit
7bead4a4
authored
Jul 19, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
双击 替换图
parent
d838a7d1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
362 additions
and
377 deletions
+362
-377
font.vue
src/views/TemplateCenter/font.vue
+361
-376
index.vue
src/views/components/element/ImageElement/index.vue
+1
-1
No files found.
src/views/TemplateCenter/font.vue
View file @
7bead4a4
...
...
@@ -53,17 +53,17 @@
</
template
>
<div
class=
"addTemplateBox q-mb-lg fz14"
>
<div
class=
"row flex-end q-mb-lg"
>
<!-- :limit="1" -->
<el-button
type=
"primary"
size=
"small"
style=
"color: #ffff;"
>
<el-upload
ref=
"upload"
:on-change=
"(uploadFile:any, uploadFiles:any)=> uploadFontHandler(uploadFile, uploadFiles,datas.params.fontFamily)"
action=
""
multiple
:limit=
"1"
:auto-upload=
"false"
accept=
".ttf, .woff, otf"
:show-file-list=
"false"
:on-exceed=
"handleExceed"
>
:on-exceed=
"handleExceed"
>
<
template
#
trigger
>
<span
class=
"text-white"
>
{{
datas
.
params
.
id
?
'替换'
:
'上传'
}}
字体
</span>
</
template
>
...
...
@@ -90,13 +90,13 @@
</div>
</div>
<div
class=
"text-center"
>
<el-button
class=
"MarketIndexButtom MarketRec"
type=
"primary"
@
click=
"ConfirmCreation(0)
"
<el-button
class=
"MarketIndexButtom MarketRec"
type=
"primary"
@
click=
"ConfirmCreation
"
:loading=
"requestLoading"
>
确认{{datas.params.id?'编辑':'新增'}}
</el-button>
</div>
</el-dialog>
</template>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
ref
,
inject
,
onMounted
,
watch
}
from
"vue"
;
...
...
@@ -149,7 +149,6 @@
const
fonts
=
ref
<
{
fontFamily
:
string
,
uploadType
:
number
,
selectedFont
?:
string
}[]
>
()
const
uploadingIndex
=
ref
(
-
1
)
const
upload
=
ref
<
UploadInstance
>
()
const
fliesNum
=
ref
(
0
as
number
)
const
close
=
()
=>
{
datas
.
params
=
{
...
...
@@ -169,7 +168,7 @@
upload
.
value
.
submit
()
}
const
ConfirmCreation
=
async
(
type
:
any
)
=>
{
const
ConfirmCreation
=
async
(
)
=>
{
//添加、编辑字体
if
(
!
datas
.
params
.
label
)
return
ElMessage
({
message
:
'请输入名称'
,
...
...
@@ -195,9 +194,7 @@
message
:
`操作
${
datas
.
params
.
label
}
成功`
,
type
:
'success'
,
})
if
(
fliesNum
.
value
)
fliesNum
.
value
--
if
(
!
type
||
(
type
&&!
fliesNum
.
value
))
datas
.
addEditVisible
=
false
console
.
log
(
fliesNum
.
value
,
'----4'
)
datas
.
addEditVisible
=
false
datas
.
requestLoading
=
false
querySearchHandler
()
}
else
{
...
...
@@ -205,8 +202,6 @@
message
:
'字体上传失败,请重试'
,
type
:
'error'
})
if
(
fliesNum
.
value
)
fliesNum
.
value
--
console
.
log
(
fliesNum
.
value
,
'----5'
)
datas
.
requestLoading
=
false
}
}
...
...
@@ -263,8 +258,6 @@
}
const
uploadFontHandler
=
async
(
uploadFile
:
any
,
uploadFiles
:
any
,
fontName
:
string
)
=>
{
fliesNum
.
value
=
uploadFiles
.
length
console
.
log
(
fliesNum
.
value
,
'----0'
)
const
ns
=
uploadFile
.
name
.
toLowerCase
().
split
(
'.'
)
const
n
=
ns
[
ns
.
length
-
1
]
const
acceptFile
=
[
'ttf'
,
'otf'
,
'woff'
]
...
...
@@ -272,8 +265,6 @@
ElMessage
.
error
({
message
:
`不支持此类文件上传,目前只支持
${
acceptFile
.
join
(
','
)}
等文件上传`
})
if
(
fliesNum
.
value
)
fliesNum
.
value
--
console
.
log
(
fliesNum
.
value
,
'----01'
)
return
;
}
uploadingIndex
.
value
=
dataList
.
value
?.
findIndex
(
x
=>
x
.
fontFamily
==
fontName
)??
-
1
...
...
@@ -284,8 +275,6 @@
}
catch
(
error
)
{
ElMessage
.
error
({
message
:
'字体无法识别,请更换'
})
uploadingIndex
.
value
=-
1
if
(
fliesNum
.
value
)
fliesNum
.
value
--
console
.
log
(
fliesNum
.
value
,
'----1'
)
return
}
...
...
@@ -293,8 +282,6 @@
if
(
flagIndex
>
0
){
ElMessage
.
error
({
message
:
`
${
info
.
name
}
字体已存在,请选择使用已有字体`
})
uploadingIndex
.
value
=-
1
if
(
fliesNum
.
value
)
fliesNum
.
value
--
console
.
log
(
fliesNum
.
value
,
'----2'
)
return
}
let
url
=
await
FileService
.
uploadToFontServerAsync
(
uploadFile
?.
raw
)
...
...
@@ -315,18 +302,16 @@
datas
.
params
.
fontUrl
=
url
datas
.
params
.
reduceName
=
reduceName
datas
.
params
.
reduceUrl
=
reduceUrl
await
ConfirmCreation
(
1
)
await
ConfirmCreation
(
)
}
else
{
ElMessage
({
message
:
'上传失败,请重试'
,
type
:
'error'
})
if
(
fliesNum
.
value
)
fliesNum
.
value
--
console
.
log
(
fliesNum
.
value
,
'----3'
)
}
}
catch
(
error
)
{
}
}
}
const
tableScrollHandler
=
()
=>
{
if
(
queryObj
.
pageCount
>
queryObj
.
pageIndex
){
queryObj
.
value
.
pageIndex
++
...
...
@@ -350,8 +335,8 @@
}
catch
(
error
)
{
loading
.
value
=
false
}
}
querySearchHandler
()
}
querySearchHandler
()
</
script
>
<
style
scoped
>
...
...
src/views/components/element/ImageElement/index.vue
View file @
7bead4a4
...
...
@@ -112,7 +112,7 @@ const { filter } = useFilter(filters)
const
{
imgReplaceVisible
}
=
storeToRefs
(
useScreenStore
())
const
openDataReplace
=
()
=>
{
imgReplaceVisible
.
value
=
true
i
f
(
!
props
.
elementInfo
.
lock
)
i
mgReplaceVisible
.
value
=
true
}
const
handleSelectElement
=
(
e
:
MouseEvent
|
TouchEvent
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment