Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
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
fulixin
dsk-operate-sys-cscec
Commits
61b8125f
Commit
61b8125f
authored
Jan 22, 2024
by
tianhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a3b5c1bc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
22 deletions
+140
-22
index.vue
dsk-operate-ui/src/components/DskFileInput/index.vue
+55
-4
index.vue
dsk-operate-ui/src/components/DskPhotoInput/index.vue
+55
-3
index.js
dsk-operate-ui/src/utils/index.js
+10
-0
SubfieldItem.vue
...agement/components/CustomForm/components/SubfieldItem.vue
+2
-2
consultingAgency.vue
...ent/components/EnterpriseList/detail/consultingAgency.vue
+18
-13
No files found.
dsk-operate-ui/src/components/DskFileInput/index.vue
View file @
61b8125f
...
...
@@ -50,6 +50,11 @@ export default {
fileList
:
{
type
:
Array
,
default
:
()
=>
[]
},
// 是否是演示模式
presentationModel
:
{
type
:
Boolean
,
default
:
false
}
},
model
:
{
...
...
@@ -70,6 +75,15 @@ export default {
//可访问data属性
created
()
{
},
beforeDestroy
()
{
if
(
this
.
presentationModel
)
{
this
.
comFileList
.
forEach
(
item
=>
{
if
(
item
?.
url
?.
indexOf
(
"localhost"
)
>
-
1
)
{
URL
.
revokeObjectURL
(
item
.
url
);
}
});
}
},
//计算集
computed
:
{
...
...
@@ -92,9 +106,14 @@ export default {
if
(
!
this
.
allowTypes
.
includes
(
fileType
.
toLowerCase
()))
{
return
this
.
$message
.
warning
(
`只支持上传
${
this
.
allowTypes
.
join
(
" , "
)}
类型文件`
);
}
// 验证通过进行上传
await
this
.
uploadHandle
(
new
File
([
file
.
raw
],
encodeURIComponent
(
fileName
)),
fileType
);
this
.
$message
.
success
(
"上传成功"
);
// 是否是演示模式
if
(
this
.
presentationModel
)
{
await
this
.
uploadHandleLocal
(
file
,
fileType
);
}
else
{
// 验证通过进行上传
await
this
.
uploadHandle
(
new
File
([
file
.
raw
],
encodeURIComponent
(
fileName
)),
fileType
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
finally
{
...
...
@@ -121,9 +140,25 @@ export default {
fileName
:
result
.
data
.
fileName
});
this
.
$emit
(
"update:fileList"
,
this
.
comFileList
);
this
.
$message
.
success
(
"上传成功"
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
async
uploadHandleLocal
(
file
,
fileType
)
{
try
{
const
localUrl
=
URL
.
createObjectURL
(
file
.
raw
);
this
.
comFileList
.
push
({
url
:
localUrl
,
type
:
fileType
,
id
:
`
${
new
Date
().
getTime
()}${
generateRandomLowerCaseLetter
()}
`
,
fileName
:
file
.
name
});
this
.
$emit
(
"update:fileList"
,
this
.
comFileList
);
this
.
$message
.
success
(
"上传成功"
);
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
showFileListDialog
()
{
...
...
@@ -140,6 +175,9 @@ export default {
},
removeImg
(
row
)
{
if
(
row
.
id
)
{
if
(
this
.
presentationModel
)
{
return
this
.
removeLocalImg
(
row
.
id
);
}
this
.
$confirm
(
'此操作将永久删除该文件, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
...
...
@@ -159,6 +197,19 @@ export default {
}
}).
catch
(()
=>
{
});
}
},
removeLocalImg
(
id
)
{
const
index
=
this
.
comFileList
.
findIndex
(
item
=>
item
.
id
==
id
);
if
(
index
>
-
1
)
{
const
url
=
this
.
comFileList
[
index
].
url
;
URL
.
revokeObjectURL
(
url
);
this
.
comFileList
.
splice
(
index
,
1
);
this
.
$emit
(
"update:fileList"
,
this
.
comFileList
);
this
.
$message
({
type
:
'success'
,
message
:
'删除成功!'
});
}
}
},
}
...
...
dsk-operate-ui/src/components/DskPhotoInput/index.vue
View file @
61b8125f
...
...
@@ -43,6 +43,7 @@
<
script
>
import
{
uploadFileToOssApi
,
removeFileFromOssApi
}
from
"@/api/consultingOrgManagement"
;
import
{
elementMessageSingleton
}
from
"@/utils"
;
import
{
generateRandomLowerCaseLetter
}
from
"@/utils/"
;
export
default
{
name
:
"dskPhotoInput"
,
props
:
{
...
...
@@ -56,6 +57,11 @@ export default {
fileList
:
{
type
:
Array
,
default
:
()
=>
[]
},
// 是否是演示模式
presentationModel
:
{
type
:
Boolean
,
default
:
false
}
},
model
:
{
...
...
@@ -78,6 +84,15 @@ export default {
//可访问data属性
created
()
{
},
beforeDestroy
()
{
if
(
this
.
presentationModel
)
{
this
.
comFileList
.
forEach
(
item
=>
{
if
(
item
?.
url
?.
indexOf
(
"localhost"
)
>
-
1
)
{
URL
.
revokeObjectURL
(
item
.
url
);
}
});
}
},
//计算集
computed
:
{
...
...
@@ -100,9 +115,14 @@ export default {
if
(
!
this
.
allowTypes
.
includes
(
fileType
.
toLowerCase
()))
{
return
this
.
$message
.
warning
(
`只支持上传
${
this
.
allowTypes
.
join
(
" , "
)}
类型图片`
);
}
// 验证通过进行上传
await
this
.
uploadHandle
(
new
File
([
file
.
raw
],
encodeURIComponent
(
fileName
)),
fileType
);
this
.
$message
.
success
(
"上传成功"
);
// 是否是演示模式
if
(
this
.
presentationModel
)
{
await
this
.
uploadHandleLocal
(
file
,
fileType
);
}
else
{
// 验证通过进行上传
await
this
.
uploadHandle
(
new
File
([
file
.
raw
],
encodeURIComponent
(
fileName
)),
fileType
);
}
}
catch
(
error
)
{
console
.
log
(
error
);
}
finally
{
...
...
@@ -129,11 +149,27 @@ export default {
fileName
:
result
.
data
.
fileName
});
this
.
$emit
(
"update:fileList"
,
this
.
comFileList
);
this
.
$message
.
success
(
"上传成功"
);
}
}
catch
(
error
)
{
}
},
async
uploadHandleLocal
(
file
,
fileType
)
{
try
{
const
localUrl
=
URL
.
createObjectURL
(
file
.
raw
);
this
.
comFileList
.
push
({
url
:
localUrl
,
type
:
fileType
,
id
:
`
${
new
Date
().
getTime
()}${
generateRandomLowerCaseLetter
()}
`
,
fileName
:
file
.
name
});
this
.
$emit
(
"update:fileList"
,
this
.
comFileList
);
this
.
$message
.
success
(
"上传成功"
);
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
showFileListDialog
()
{
this
.
fileListDialog
=
true
;
},
...
...
@@ -152,6 +188,9 @@ export default {
},
removeImg
(
row
)
{
if
(
row
.
id
)
{
if
(
this
.
presentationModel
)
{
return
this
.
removeLocalImg
(
row
.
id
);
}
this
.
$confirm
(
'此操作将永久删除该图片, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
...
...
@@ -171,6 +210,19 @@ export default {
}
}).
catch
(()
=>
{
});
}
},
removeLocalImg
(
id
)
{
const
index
=
this
.
comFileList
.
findIndex
(
item
=>
item
.
id
==
id
);
if
(
index
>
-
1
)
{
const
url
=
this
.
comFileList
[
index
].
url
;
URL
.
revokeObjectURL
(
url
);
this
.
comFileList
.
splice
(
index
,
1
);
this
.
$emit
(
"update:fileList"
,
this
.
comFileList
);
this
.
$message
({
type
:
'success'
,
message
:
'删除成功!'
});
}
}
},
}
...
...
dsk-operate-ui/src/utils/index.js
View file @
61b8125f
...
...
@@ -1020,3 +1020,13 @@ export function replaceDomTags(str) {
const
reg
=
/<
[^
>
]
*>/gmi
;
return
str
.
replace
(
reg
,
""
);
}
/**
* 生成随机字母
* @returns
*/
export
function
generateRandomLowerCaseLetter
()
{
const
alphabet
=
'abcdefghijklmnopqrstuvwxyz'
;
const
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
alphabet
.
length
);
return
alphabet
[
randomIndex
];
}
dsk-operate-ui/src/views/consultingOrgManagement/components/CustomForm/components/SubfieldItem.vue
View file @
61b8125f
...
...
@@ -29,10 +29,10 @@
:clearable=
"true"
:disabled=
"isDisabled"
v-if=
"comChildModuleInfo.comType == 'email'"
></dsk-email-input>
<!-- 图片类型 -->
<dsk-photo-input
v-model=
"comChildModuleInfo.componentAttribute.value"
:disabled=
"isDisabled"
v-if=
"comChildModuleInfo.comType == 'photo'"
:limit=
"comChildModuleInfo.formAttribute.limit"
></dsk-photo-input>
:limit=
"comChildModuleInfo.formAttribute.limit"
:presentationModel=
"true"
></dsk-photo-input>
<!-- 文件类型 -->
<dsk-file-input
v-model=
"comChildModuleInfo.componentAttribute.value"
:disabled=
"isDisabled"
v-if=
"comChildModuleInfo.comType == 'file'"
:limit=
"comChildModuleInfo.formAttribute.limit"
></dsk-file-input>
:limit=
"comChildModuleInfo.formAttribute.limit"
:presentationModel=
"true"
></dsk-file-input>
</el-form-item>
<img
src=
"@/assets/images/consultingAgencyManagement/customForm/icon_delete@2x.png"
alt=
""
class=
"remove-subfield-item-icon"
...
...
dsk-operate-ui/src/views/consultingOrgManagement/components/EnterpriseList/detail/consultingAgency.vue
View file @
61b8125f
...
...
@@ -314,23 +314,25 @@ export default {
}
},
hasCustomFormDataHandle
(
formTemplate
,
formData
)
{
// console.log(formTemplate);
// console.log(formData);
formTemplate
.
forEach
(
item
=>
{
this
.
interComTemplateParent
(
formData
,
item
);
const
_template
=
cloneDeep
(
formTemplate
);
const
_result
=
_template
.
map
(
moduleItem
=>
{
return
this
.
interComTemplateParent
(
formData
,
moduleItem
);
});
return
cloneDeep
(
formTemplate
);
return
cloneDeep
(
_result
);
},
interComTemplateParent
(
formData
,
module
)
{
const
hasTemplateModule
=
formData
.
find
(
item
=>
item
.
pid
===
module
.
uid
);
// 数据能找到关联模块
if
(
hasTemplateModule
)
{
const
index
=
module
.
children
.
findIndex
(
child
=>
child
.
uid
===
hasTemplateModule
.
uid
);
// 找到模板 插入数据
if
(
index
>
-
1
)
{
module
.
children
[
index
].
componentAttribute
.
value
=
hasTemplateModule
.
componentAttribute
.
value
;
}
const
hasTemplateModuleArray
=
formData
.
filter
(
item
=>
item
.
pid
===
module
.
uid
);
// 找到当前模板下 关联的数据
if
(
hasTemplateModuleArray
?.
length
)
{
hasTemplateModuleArray
.
forEach
(
dataItem
=>
{
const
index
=
module
.
children
.
findIndex
(
child
=>
child
.
uid
===
dataItem
.
uid
);
// 找到模板 插入数据
if
(
index
>
-
1
)
{
module
.
children
[
index
].
componentAttribute
.
value
=
dataItem
.
componentAttribute
.
value
;
}
});
}
return
module
;
},
renderTemplate
(
template
)
{
const
table
=
this
.
createTemplateTable
(
template
);
...
...
@@ -678,6 +680,9 @@ export default {
border-radius
:
unset
;
border-color
:
transparent
;
color
:
#232323
;
font-size
:
12px
;
font-weight
:
400
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
&
:focus
{
border
:
1px
solid
#0081ff
;
...
...
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