Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
fe38ec24
Commit
fe38ec24
authored
Dec 04, 2024
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加站点风采
parent
c1a916f0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
537 additions
and
138 deletions
+537
-138
base-manager-ui/admin/src/components/YTable.vue
base-manager-ui/admin/src/components/YTable.vue
+156
-0
base-manager-ui/admin/src/components/YUpload.vue
base-manager-ui/admin/src/components/YUpload.vue
+299
-0
base-manager-ui/admin/src/components/ycheckbox/YCheckbox.vue
base-manager-ui/admin/src/components/ycheckbox/YCheckbox.vue
+3
-8
base-manager-ui/admin/src/pages/basicset/site/components/addsite.vue
...r-ui/admin/src/pages/basicset/site/components/addsite.vue
+79
-130
No files found.
base-manager-ui/admin/src/components/YTable.vue
0 → 100644
View file @
fe38ec24
<
template
>
<a-table
:columns=
"columns"
:data-source=
"data"
:bordered=
"bordered"
:defaultExpandAllRows=
"DefaultExpandAllRows"
:expandRowByClick=
"ExpandRowByClick"
:showHeader=
"ShowHeader"
:pagination=
"Pagination"
:rowKey=
"rowKey"
@
change=
"handleTableChange"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<template
slot-scope=
"text, record, index"
:slot=
"slot"
v-for=
"slot in Object.keys($scopedSlots).filter(
(key) => key !== 'expandedRowRender'
)"
>
<slot
:name=
"slot"
v-bind=
"
{ text, record, index }">
</slot>
</
template
>
<
template
:slot=
"slot"
v-for=
"slot in Object.keys($slots)"
>
<slot
:name=
"slot"
></slot>
</
template
>
<
template
slot-scope=
"record, index, indent, expanded"
:slot=
"$scopedSlots.expandedRowRender ? 'expandedRowRender' : ''"
>
<slot
v-bind=
"
{ record, index, indent, expanded }"
:name="$scopedSlots.expandedRowRender ? 'expandedRowRender' : ''"
>
</slot>
</
template
>
</a-table>
</template>
<
script
>
import
{
pageSizeOptions
}
from
"
@/config/pageConfig.js
"
;
export
default
{
props
:
{
columns
:
{
required
:
true
,
type
:
Array
,
default
:
()
=>
[],
},
data
:
{
required
:
true
,
type
:
Array
,
default
:
()
=>
[],
},
pageSize
:
{
required
:
true
,
type
:
Number
,
default
:
10
,
},
page
:
{
required
:
true
,
type
:
Number
,
default
:
1
,
},
total
:
{
required
:
true
,
type
:
Number
,
default
:
0
,
},
bordered
:
{
type
:
Boolean
,
default
:
true
,
},
defaultExpandAllRows
:
{
type
:
Boolean
,
default
:
false
,
},
expandRowByClick
:
{
type
:
Boolean
,
default
:
false
,
},
showHeader
:
{
type
:
Boolean
,
default
:
true
,
},
rowKey
:
{
type
:
[
String
,
Function
],
default
:
"
id
"
,
},
pagination
:
{
type
:
Object
,
default
:
()
=>
{},
},
pageSizeOptions
:
{
type
:
Array
,
default
:
()
=>
pageSizeOptions
,
},
},
data
()
{
return
{};
},
computed
:
{
Bordered
()
{
return
!!
this
.
bordered
;
},
DefaultExpandAllRows
()
{
return
!!
this
.
defaultExpandAllRows
;
},
ExpandRowByClick
()
{
return
!!
this
.
expandRowByClick
;
},
ShowHeader
()
{
return
!!
this
.
showHeader
;
},
PageSize
:
{
get
()
{
return
this
.
pageSize
;
},
set
(
value
)
{
this
.
$emit
(
"
update:pageSize
"
,
value
);
},
},
Current
:
{
get
()
{
return
this
.
page
;
},
set
(
value
)
{
this
.
$emit
(
"
update:page
"
,
value
);
},
},
Pagination
()
{
return
{
showTotal
:
(
total
)
=>
`共
${
total
}
条`
,
total
:
this
.
total
,
current
:
this
.
Current
,
pageSize
:
this
.
pageSize
,
showSizeChanger
:
true
,
showQuickJumper
:
true
,
pageSizeOptions
:
this
.
pageSizeOptions
,
...
this
.
pagination
,
};
},
},
methods
:
{
handleTableChange
(
pagination
,
filters
,
sorter
,
{
currentDataSource
})
{
let
{
current
,
pageSize
}
=
pagination
;
this
.
Current
=
current
;
this
.
PageSize
=
pageSize
;
if
(
this
.
$listeners
.
changePagination
)
{
this
.
$listeners
.
changePagination
();
}
this
.
$emit
(
"
change
"
,
pagination
,
filters
,
sorter
,
{
currentDataSource
});
},
},
};
</
script
>
<
style
lang=
"less"
scoped
></
style
>
base-manager-ui/admin/src/components/YUpload.vue
0 → 100644
View file @
fe38ec24
<
template
>
<div
class=
"y-upload"
>
<a-upload
v-if=
"listType == 'text' || listType == 'picture'"
:name=
"name"
:listType=
"listType"
:multiple=
"multiple"
:action=
"action"
:accept=
"accept"
:beforeUpload=
"beforeUpload"
:file-list=
"FileList"
v-bind=
"$attrs"
v-on=
"$listeners"
@
change=
"handleChange"
@
preview=
"handlePreview"
>
<slot>
<a-button
type=
"primary"
>
<a-icon
type=
"upload"
/>
点击上传
</a-button>
</slot>
</a-upload>
<a-upload
v-else-if=
"listType == 'picture-card'"
:name=
"name"
:listType=
"listType"
:multiple=
"multiple"
:action=
"action"
:accept=
"accept"
:beforeUpload=
"beforeUpload"
:file-list=
"FileList"
v-bind=
"$attrs"
v-on=
"$listeners"
@
change=
"handleChange"
@
preview=
"handlePreview"
>
<slot>
<div>
<a-icon
type=
"plus"
/>
<div
class=
"ant-upload-text"
>
点击上传
</div>
</div>
</slot>
</a-upload>
<!-- 视频、音频预览 -->
<div
class=
"modal"
v-if=
"previewVisible"
>
<video
v-if=
"previewData.type == 'video'"
:src=
"previewData.url"
autoplay
muted
controls
></video>
<audio
v-if=
"previewData.type == 'audio'"
:src=
"previewData.url"
autoplay
controls
></audio>
<a-icon
type=
"close-circle"
@
click=
"previewVisible = false"
/>
</div>
</div>
</
template
>
<
script
>
// import { uploadFile } from "@/services/user";
export
default
{
model
:
{
prop
:
"
value
"
,
event
:
"
onChange
"
,
},
components
:
{},
props
:
{
name
:
{
type
:
String
,
default
:
"
file
"
,
},
listType
:
{
type
:
String
,
default
:
"
text
"
,
},
multiple
:
{
type
:
Boolean
,
default
:
false
,
},
value
:
{
type
:
[
String
,
Array
],
default
:
""
,
},
// 文件限制
accept
:
{
type
:
String
,
default
:
""
,
},
// 上传数量
limit
:
{
type
:
Number
,
validator
:
(
value
)
=>
{
return
value
>=
0
;
},
default
:
1
,
// 0为不限制
},
// 上传文件大小限制mb 0为不限制
MB
:
{
type
:
Number
,
validator
:
(
value
)
=>
{
return
value
>=
0
;
},
default
:
10
,
},
action
:
{
type
:
String
,
default
:
"
/base/file/commonupload
"
,
},
},
data
()
{
return
{
FileList
:
[],
imageType
:
[
"
png
"
,
"
jpg
"
,
"
jpeg
"
,
"
gif
"
,
"
svg
"
],
videoType
:
[
"
mp4
"
,
"
avi
"
,
"
wmv
"
,
"
rmvb
"
,
"
flv
"
,
"
mkv
"
],
audioType
:
[
"
mp3
"
,
"
wav
"
,
"
amr
"
,
"
aac
"
,
"
ogg
"
,
"
wma
"
,
"
flac
"
,
"
ape
"
,
"
mid
"
,
"
m4a
"
,
"
m4r
"
,
"
m4p
"
,
"
m4b
"
,
],
previewData
:
{
type
:
""
,
url
:
""
,
},
previewVisible
:
false
,
};
},
watch
:
{
value
:
{
handler
(
newValue
)
{
if
(
newValue
)
{
if
(
Array
.
isArray
(
newValue
))
{
this
.
FileList
=
newValue
.
map
((
v
)
=>
{
let
index
=
v
.
lastIndexOf
(
"
/
"
);
let
name
=
v
.
slice
(
index
+
1
);
return
{
uid
:
v
,
name
,
status
:
"
done
"
,
url
:
v
,
};
});
}
else
{
this
.
FileList
=
newValue
.
split
(
"
,
"
).
map
((
v
)
=>
{
let
index
=
v
.
lastIndexOf
(
"
/
"
);
let
name
=
v
.
slice
(
index
+
1
);
return
{
uid
:
v
,
name
,
status
:
"
done
"
,
url
:
v
,
};
});
}
}
else
{
this
.
FileList
=
[];
}
},
deep
:
true
,
immediate
:
true
,
},
},
computed
:
{},
created
()
{},
methods
:
{
customRequest
()
{
console
.
log
(
arguments
);
},
handleChange
({
file
,
fileList
})
{
this
.
FileList
=
[...
fileList
];
if
(
file
.
status
==
"
done
"
||
file
.
status
==
"
removed
"
)
{
if
(
file
.
response
&&
file
.
response
.
code
==
-
1
)
{
this
.
$message
.
error
(
file
.
response
.
msg
);
fileList
=
fileList
.
filter
((
file
)
=>
file
.
response
.
code
!=
-
1
);
}
if
(
this
.
limit
)
{
this
.
FileList
=
[...
fileList
].
slice
(
-
this
.
limit
);
}
this
.
FileList
=
this
.
FileList
.
map
((
v
)
=>
{
if
(
v
.
response
)
{
v
.
url
=
v
.
response
.
url
;
}
return
v
;
});
let
value
;
if
(
Array
.
isArray
(
this
.
value
))
{
value
=
this
.
FileList
.
map
((
v
)
=>
v
.
url
);
}
else
{
value
=
this
.
FileList
.
map
((
v
)
=>
v
.
url
).
join
(
"
,
"
);
}
this
.
$emit
(
"
onChange
"
,
value
);
this
.
$emit
(
"
onSuccess
"
,
{
file
,
fileList
});
}
},
beforeUpload
(
file
)
{
let
isType
=
true
;
let
isExceed
=
true
;
return
new
Promise
((
resolve
)
=>
{
if
(
this
.
accept
)
{
const
fileType
=
this
.
accept
.
split
(
"
,
"
);
// 限制文件类型
let
index
=
file
.
name
.
lastIndexOf
(
"
.
"
);
let
type
=
file
.
name
.
slice
(
index
);
isType
=
fileType
.
includes
(
type
);
}
if
(
!
isType
)
{
let
msg
=
this
.
accept
.
replaceAll
(
"
,
"
,
"
或者
"
);
this
.
$message
.
error
(
`请上传
${
msg
}
文件!`
);
}
if
(
this
.
MB
)
{
isExceed
=
file
.
size
/
1024
/
1024
<=
this
.
MB
;
}
if
(
!
isExceed
)
{
this
.
$message
.
error
(
`文件大小不能超过
${
this
.
MB
}
MB!`
);
}
if
(
isType
&&
isExceed
)
{
resolve
(
file
);
}
});
},
// 预览
handlePreview
(
file
)
{
let
{
url
}
=
file
;
if
(
!
url
)
return
;
let
index
=
url
.
lastIndexOf
(
"
.
"
);
let
type
=
url
.
slice
(
index
+
1
);
if
(
this
.
imageType
.
includes
(
type
))
{
this
.
$viewerApi
({
images
:
[
url
],
});
}
else
if
(
this
.
videoType
.
includes
(
type
))
{
this
.
previewData
.
type
=
"
video
"
;
this
.
previewData
.
url
=
url
;
this
.
previewVisible
=
true
;
}
else
if
(
this
.
audioType
.
includes
(
type
))
{
this
.
previewData
.
type
=
"
audio
"
;
this
.
previewData
.
url
=
url
;
this
.
previewVisible
=
true
;
}
else
{
let
a
=
document
.
createElement
(
"
a
"
);
a
.
href
=
url
;
a
.
download
=
file
.
name
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
document
.
body
.
removeChild
(
a
);
}
},
handleDownload
(
file
)
{
console
.
log
(
file
);
},
},
};
</
script
>
<
style
lang=
"less"
scoped
>
/deep/.ant-upload-picture-card-wrapper {
display: flex;
flex-wrap: wrap;
}
.modal {
width: 100%;
height: 100%;
position: fixed;
left: 0px;
top: 0px;
background: rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
z-index: 999;
video {
height: 400px;
}
.anticon-close-circle {
font-size: 36px;
color: #fff;
cursor: pointer;
}
}
</
style
>
base-manager-ui/admin/src/components/ycheckbox/YCheckbox.vue
View file @
fe38ec24
<
template
>
<
template
>
<div>
<div>
<a-checkbox
:checked=
"value"
@
change=
"onChange"
>
<a-checkbox
:checked=
"value"
@
change=
"onChange"
>
{{
checkText
}}
</a-checkbox
<slot></slot>
>
</a-checkbox
>
</div>
</div>
</
template
>
</
template
>
...
@@ -16,10 +16,6 @@ export default {
...
@@ -16,10 +16,6 @@ export default {
checked
:
{
checked
:
{
required
:
true
,
required
:
true
,
},
},
checkText
:
{
required
:
true
,
default
:
""
,
},
},
},
computed
:
{
computed
:
{
value
()
{
value
()
{
...
@@ -34,5 +30,4 @@ export default {
...
@@ -34,5 +30,4 @@ export default {
};
};
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
></
style
>
</
style
>
\ No newline at end of file
base-manager-ui/admin/src/pages/basicset/site/components/addsite.vue
View file @
fe38ec24
...
@@ -181,19 +181,22 @@
...
@@ -181,19 +181,22 @@
</a-col>
</a-col>
<a-col
:span=
"24"
>
<a-col
:span=
"24"
>
<a-form-model-item
label=
"中心Logo"
prop=
"logoPath"
>
<a-form-model-item
label=
"中心Logo"
prop=
"logoPath"
>
<a-upload
<YUpload
:action=
"api + 'base/file/commonupload'"
accept=
".png,.jpg,.jpeg,.svg"
list-type=
"picture-card"
:limit=
"1"
:file-list=
"fileList"
v-model=
"formInfo.logoPath"
@
preview=
"handlePreview"
listType=
"picture-card"
@
change=
"handleChange"
></YUpload>
:accept=
"accept"
</a-form-model-item>
>
</a-col>
<div
v-if=
"fileList.length
<
1
"
>
<a-col
:span=
"24"
>
<a-icon
type=
"plus"
/>
<a-form-model-item
class=
"site-style"
label=
"站点风貌"
prop=
"govAffairStyle"
>
<div
class=
"ant-upload-text"
>
上传图片
</div>
<YUpload
</div>
accept=
".png,.jpg,.jpeg,.svg"
</a-upload>
:limit=
"0"
v-model=
"formInfo.govAffairStyle"
listType=
"picture-card"
></YUpload>
</a-form-model-item>
</a-form-model-item>
</a-col>
</a-col>
</a-row>
</a-row>
...
@@ -237,33 +240,12 @@
...
@@ -237,33 +240,12 @@
</a-row>
</a-row>
<a-form-model-item
label=
"工作日"
>
<a-form-model-item
label=
"工作日"
>
<y-checkbox
<y-checkbox
v-model=
"formInfo.workday1"
v-model=
"formInfo[key]"
checkText=
"星期一"
v-for=
"(v, key) in workday"
></y-checkbox>
:key=
"key"
<y-checkbox
>
v-model=
"formInfo.workday2"
{{
v
}}
checkText=
"星期二"
</y-checkbox>
></y-checkbox>
<y-checkbox
v-model=
"formInfo.workday3"
checkText=
"星期三"
></y-checkbox>
<y-checkbox
v-model=
"formInfo.workday4"
checkText=
"星期四"
></y-checkbox>
<y-checkbox
v-model=
"formInfo.workday5"
checkText=
"星期五"
></y-checkbox>
<y-checkbox
v-model=
"formInfo.workday6"
checkText=
"星期六"
></y-checkbox>
<y-checkbox
v-model=
"formInfo.workday7"
checkText=
"星期天"
></y-checkbox>
</a-form-model-item>
</a-form-model-item>
<a-row>
<a-row>
<a-col
:span=
"4"
>
<a-col
:span=
"4"
>
...
@@ -306,9 +288,19 @@
...
@@ -306,9 +288,19 @@
import
{
modelList
,
siteSave
}
from
"
@/services/basicsetFun
"
;
import
{
modelList
,
siteSave
}
from
"
@/services/basicsetFun
"
;
import
YCheckbox
from
"
@/components/ycheckbox/YCheckbox.vue
"
;
import
YCheckbox
from
"
@/components/ycheckbox/YCheckbox.vue
"
;
import
YSwitch
from
"
@/components/yswitch/YSwitch.vue
"
;
import
YSwitch
from
"
@/components/yswitch/YSwitch.vue
"
;
import
YUpload
from
"
@/components/YUpload.vue
"
;
// import options from "@/utils/city";
// import options from "@/utils/city";
import
{
regionData
}
from
"
element-china-area-data
"
;
import
{
regionData
}
from
"
element-china-area-data
"
;
import
{
checkPort
,
checkIp
}
from
"
@/utils/validate
"
;
import
{
checkPort
,
checkIp
}
from
"
@/utils/validate
"
;
const
workday
=
{
workday1
:
"
星期一
"
,
workday2
:
"
星期二
"
,
workday3
:
"
星期三
"
,
workday4
:
"
星期四
"
,
workday5
:
"
星期五
"
,
workday6
:
"
星期六
"
,
workday7
:
"
星期天
"
,
};
export
default
{
export
default
{
props
:
{
props
:
{
formVisible
:
{
formVisible
:
{
...
@@ -323,6 +315,7 @@ export default {
...
@@ -323,6 +315,7 @@ export default {
components
:
{
components
:
{
YCheckbox
,
YCheckbox
,
YSwitch
,
YSwitch
,
YUpload
,
},
},
data
()
{
data
()
{
// 验证手机号码
// 验证手机号码
...
@@ -336,17 +329,8 @@ export default {
...
@@ -336,17 +329,8 @@ export default {
callback
();
callback
();
}
}
};
};
// const changeLandline = (rule, value, callback) => {
// if (!value) {
// callback(new Error("请输入中心座机号"));
// callback();
// } else if (!/^[0][1-9]{2,3}-[0-9]{5,10}$/.test(value)) {
// callback(new Error("格式:区号-电话号码"));
// } else {
// callback();
// }
// };
return
{
return
{
workday
,
api
:
process
.
env
.
VUE_APP_API_BASE_URL
+
"
/
"
,
api
:
process
.
env
.
VUE_APP_API_BASE_URL
+
"
/
"
,
accept
:
"
image/jpeg,image/png
"
,
// 上传类型
accept
:
"
image/jpeg,image/png
"
,
// 上传类型
loading
:
false
,
loading
:
false
,
...
@@ -396,10 +380,10 @@ export default {
...
@@ -396,10 +380,10 @@ export default {
onlineTake
:
0
,
// 在线取号
onlineTake
:
0
,
// 在线取号
appointment
:
0
,
// 微预约
appointment
:
0
,
// 微预约
gowMap
:
0
,
// 政务地图
gowMap
:
0
,
// 政务地图
govAffairStyle
:
''
,
// 站点风貌
},
//表单提交数据
},
//表单提交数据
indeterminate
:
true
,
indeterminate
:
true
,
checkAll
:
false
,
checkAll
:
false
,
fileList
:
[],
formRules
:
{
formRules
:
{
siteName
:
[
siteName
:
[
{
{
...
@@ -595,14 +579,12 @@ export default {
...
@@ -595,14 +579,12 @@ export default {
},
},
//重置
//重置
resetForm
()
{
resetForm
()
{
this
.
fileList
=
[];
this
.
cityData
=
[];
this
.
cityData
=
[];
this
.
$refs
.
ruleForm
.
resetFields
();
this
.
$refs
.
ruleForm
.
resetFields
();
},
},
// 关闭对话框
// 关闭对话框
closeModal
()
{
closeModal
()
{
this
.
fileList
=
[];
this
.
resetForm
();
this
.
$refs
.
ruleForm
.
resetFields
();
this
.
Visible
=
false
;
this
.
Visible
=
false
;
},
},
// 新增
// 新增
...
@@ -614,30 +596,43 @@ export default {
...
@@ -614,30 +596,43 @@ export default {
// 编辑
// 编辑
onEdit
(
data
)
{
onEdit
(
data
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
formInfo
=
{
...
data
};
let
{
this
.
areaInfo
.
areaID
=
this
.
formInfo
.
areaID
;
areaID
,
this
.
areaInfo
.
areaCode
=
this
.
formInfo
.
areaCode
;
areaCode
,
this
.
areaInfo
.
areaName
=
this
.
formInfo
.
areaName
;
areaName
,
this
.
cityData
=
[
proCode
,
this
.
formInfo
.
proCode
,
cityCode
,
this
.
formInfo
.
cityCode
,
districtCode
,
this
.
formInfo
.
districtCode
,
modelIds
,
];
amWorkStartTime
,
this
.
formInfo
.
modelIds
=
this
.
formInfo
.
modelIds
.
map
(
Number
);
amWorkEndTime
,
this
.
formInfo
.
amWorkStartTime
=
String
(
this
.
formInfo
.
amWorkStartTime
);
pmWorkStartTime
,
this
.
formInfo
.
amWorkEndTime
=
String
(
this
.
formInfo
.
amWorkEndTime
);
pmWorkEndTime
,
this
.
formInfo
.
pmWorkStartTime
=
String
(
this
.
formInfo
.
pmWorkStartTime
);
}
=
(
this
.
formInfo
=
data
);
this
.
formInfo
.
pmWorkEndTime
=
String
(
this
.
formInfo
.
pmWorkEndTime
);
this
.
areaInfo
.
areaID
=
areaID
;
if
(
this
.
formInfo
.
logoPath
)
{
this
.
areaInfo
.
areaCode
=
areaCode
;
this
.
fileList
=
[
this
.
areaInfo
.
areaName
=
areaName
;
{
this
.
cityData
=
[
proCode
,
cityCode
,
districtCode
];
uid
:
-
1
,
if
(
modelIds
)
{
status
:
"
done
"
,
this
.
formInfo
.
modelIds
=
modelIds
&&
modelIds
.
map
(
Number
);
name
:
this
.
formInfo
.
logoPath
,
url
:
this
.
formInfo
.
logoPath
,
},
];
}
}
[
this
.
formInfo
.
amWorkStartTime
,
this
.
formInfo
.
amWorkEndTime
,
this
.
formInfo
.
pmWorkStartTime
,
this
.
formInfo
.
pmWorkEndTime
,
]
=
[
amWorkStartTime
,
amWorkEndTime
,
pmWorkStartTime
,
pmWorkEndTime
,
].
map
((
v
)
=>
{
if
(
v
)
{
return
String
(
v
);
}
else
{
return
""
;
}
});
});
});
},
},
// 保存
// 保存
...
@@ -658,68 +653,20 @@ export default {
...
@@ -658,68 +653,20 @@ export default {
this
.
loading
=
false
;
this
.
loading
=
false
;
if
(
code
===
1
)
{
if
(
code
===
1
)
{
this
.
$message
.
success
(
msg
);
this
.
$message
.
success
(
msg
);
this
.
fileList
=
[];
this
.
closeModal
();
this
.
Visible
=
false
;
this
.
$parent
.
getSiteList
({
areaID
:
this
.
areaInfo
.
areaID
});
this
.
$parent
.
getSiteList
({
areaID
:
this
.
areaInfo
.
areaID
});
}
}
}
}
});
});
},
},
// 上传限制
beforeUpload
(
file
)
{
const
isJpgOrPng
=
file
.
type
===
"
image/jpeg
"
||
file
.
type
===
"
image/png
"
;
if
(
!
isJpgOrPng
)
{
this
.
$message
.
error
(
"
请上传jpeg或者png图片!
"
);
}
const
isLt10M
=
file
.
size
/
1024
/
1024
<
10
;
if
(
!
isLt10M
)
{
this
.
$message
.
error
(
"
图片大小不能超过10MB!
"
);
}
return
isJpgOrPng
&&
isLt10M
;
},
// 上传图片
handleChange
({
file
,
fileList
})
{
if
(
file
.
status
&&
file
.
status
!=
"
removed
"
&&
file
.
response
&&
file
.
response
.
code
==
-
1
)
{
this
.
$message
.
error
(
file
.
response
.
msg
);
fileList
=
fileList
.
filter
((
file
)
=>
file
.
response
.
code
!=
-
1
);
}
this
.
fileList
=
[...
fileList
].
slice
(
-
1
);
this
.
fileList
=
this
.
fileList
.
map
((
v
)
=>
{
if
(
v
.
response
)
{
v
.
url
=
v
.
response
.
url
;
}
return
v
;
});
if
(
this
.
fileList
[
0
])
{
this
.
formInfo
.
logoPath
=
this
.
fileList
[
0
].
url
;
}
else
{
this
.
formInfo
.
logoPath
=
""
;
}
// if (info.file.status === "uploading") {
// this.loading = true;
// return;
// }
// if (info.file.status === "done") {
// this.formInfo.logoPath = info.file.response.url;
// this.loading = false;
// }
},
// 预览logo
// 预览logo
handlePreview
(
info
)
{
handlePreview
(
info
)
{
this
.
$viewerApi
({
this
.
$viewerApi
({
images
:
[
info
.
url
],
images
:
[
info
.
url
],
});
});
},
},
// 删除logo
// handleRemove() {
// this.formInfo.logoPath = "";
// },
// 地址
// 地址
oncityChange
(
val
)
{
oncityChange
(
val
)
{
[
[
...
@@ -728,6 +675,7 @@ export default {
...
@@ -728,6 +675,7 @@ export default {
this
.
formInfo
.
districtCode
,
this
.
formInfo
.
districtCode
,
]
=
val
;
]
=
val
;
},
},
// 获取详细地址经纬度
getAddress
(
address
)
{
getAddress
(
address
)
{
this
.
$refs
.
ruleForm
.
validateField
(
"
detailAddress
"
,
(
errVal
)
=>
{
this
.
$refs
.
ruleForm
.
validateField
(
"
detailAddress
"
,
(
errVal
)
=>
{
if
(
errVal
!==
"
中心详细地址不能为空
"
)
{
if
(
errVal
!==
"
中心详细地址不能为空
"
)
{
...
@@ -833,4 +781,5 @@ export default {
...
@@ -833,4 +781,5 @@ export default {
margin-bottom: 6px;
margin-bottom: 6px;
}
}
}
}
</
style
>
</
style
>
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