Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopFront
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
newshop
newShopFront
Commits
6f8e5c76
Commit
6f8e5c76
authored
Dec 18, 2019
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
冲突调整
parent
b7158808
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
178 additions
and
186 deletions
+178
-186
router.config.js
src/config/router.config.js
+7
-8
main.js
src/main.js
+1
-4
index.less
src/views/index.less
+6
-0
branchService_editor.vue
src/views/storedc/details/branchService_editor.vue
+99
-40
branchservice_add.vue
src/views/storedc/details/branchservice_add.vue
+65
-134
No files found.
src/config/router.config.js
View file @
6f8e5c76
...
@@ -137,14 +137,13 @@ export const asyncRouterMap = [
...
@@ -137,14 +137,13 @@ export const asyncRouterMap = [
component
:
()
=>
import
(
'@/views/storedc/details/branchService_editor'
),
component
:
()
=>
import
(
'@/views/storedc/details/branchService_editor'
),
meta
:
{
title
:
'编辑服务类目'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
meta
:
{
title
:
'编辑服务类目'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
},
},
// {
{
// path: '/storedc/details/branchservice_add',
path
:
'/storedc/details/branchservice_add'
,
// name: 'branchservice_add',
name
:
'branchservice_add'
,
// hidden: true,
component
:
()
=>
import
(
'@/views/storedc/details/branchservice_add'
),
// component: () => import('@/views/storedc/details/branchservice_add'),
// component:addbranchservice,
// // component:addbranchservice,
meta
:
{
title
:
'添加服务类目'
,
keepAlive
:
true
,
permission
:
[
'table'
]
}
// meta: { title: '添加服务类目', keepAlive: true, permission: [ 'table' ] }
},
// },
{
{
path
:
'/storedc/cerfmg'
,
path
:
'/storedc/cerfmg'
,
name
:
'Cerfmg'
,
name
:
'Cerfmg'
,
...
...
src/main.js
View file @
6f8e5c76
...
@@ -16,19 +16,16 @@ import 'quill/dist/quill.bubble.css'
...
@@ -16,19 +16,16 @@ import 'quill/dist/quill.bubble.css'
import
VueAMap
from
'vue-amap'
;
import
VueAMap
from
'vue-amap'
;
// mock
// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
//
import './mock'
import
'./mock'
import
bootstrap
from
'./core/bootstrap'
import
bootstrap
from
'./core/bootstrap'
import
'./core/lazy_use'
import
'./core/lazy_use'
import
'./permission'
// permission control
import
'./permission'
// permission control
import
'./utils/filter'
// global filter
import
'./utils/filter'
// global filter
import
'./components/global.less'
import
'./components/global.less'
import
common
from
'@/static/js/common.js'
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
Vue
.
prototype
.
common
=
common
// mount axios Vue.$http and this.$http
// mount axios Vue.$http and this.$http
Vue
.
use
(
VueAxios
)
Vue
.
use
(
VueAxios
)
Vue
.
use
(
VueQuillEditor
)
Vue
.
use
(
VueQuillEditor
)
...
...
src/views/index.less
0 → 100644
View file @
6f8e5c76
@import "~ant-design-vue/lib/style/index";
// The prefix to use on all css classes from ant-pro.
@ant-pro-prefix : ant-pro;
@ant-global-sider-zindex : 106;
@ant-global-header-zindex : 105;
\ No newline at end of file
src/views/storedc/details/branchService_editor.vue
View file @
6f8e5c76
<
template
>
<
template
>
<a-card
:body-style=
"
{
padding: '24px 32px'
}" :bordered="false">
<a-card
:body-style=
"
{
padding: '24px 32px'
}" :bordered="false">
<a-form
:form=
"form"
>
<a-form
:form=
"form"
>
<a-form-item
<a-form-item
label=
"服务类目名称"
label=
"服务类目名称"
:labelCol=
"
{
lg: {span: 7}, sm: {span: 7}
}"
:labelCol=
"
{
lg: { span: 7 }, sm: { span: 7 }
}"
:wrapperCol="{
lg: {span: 10}, sm: {span: 17
} }"
:wrapperCol="{
lg: { span: 10 }, sm: { span: 17
} }"
>
>
<a-input
<a-input
placeholder=
"请输入服务类目名称"
placeholder=
"请输入服务类目名称"
v-decorator=
"['NAME',
{rules: [{ required: true, message: '请输入服务类目名称' }]
}]"
v-decorator=
"['NAME',
{ rules: [{ required: true, message: '请输入服务类目名称' }]
}]"
name="NAME"
name="NAME"
/>
/>
</a-form-item>
</a-form-item>
<a-form-item
<a-form-item
label=
"服务类目编号"
label=
"服务类目编号"
:labelCol=
"
{
lg: {span: 7}, sm: {span: 7}
}"
:labelCol=
"
{
lg: { span: 7 }, sm: { span: 7 }
}"
:wrapperCol="{
lg: {span: 10}, sm: {span: 17
} }"
:wrapperCol="{
lg: { span: 10 }, sm: { span: 17
} }"
>
>
<a-input
<a-input
placeholder=
"服务类目编号"
placeholder=
"服务类目编号"
v-decorator=
"[
v-decorator=
"['CODE',
{ rules: [{ required: true, message: '服务类目编号' }] }]"
'CODE',
{rules: [{ required: true, message: '服务类目编号' }]}
]"
name="CODE"
name="CODE"
/>
/>
</a-form-item>
</a-form-item>
<a-form-item
<a-form-item
label=
"主题颜色"
label=
"主题颜色"
:labelCol=
"
{
lg: {span: 7}, sm: {span: 7}
}"
:labelCol=
"
{
lg: { span: 7 }, sm: { span: 7 }
}"
:wrapperCol="{
lg: {span: 10}, sm: {span: 17
} }"
:wrapperCol="{
lg: { span: 10 }, sm: { span: 17
} }"
:required="false"
:required="false"
>
>
<a-input
<a-input
placeholder=
"请输入主题颜色"
placeholder=
"请输入主题颜色"
v-decorator=
"[
v-decorator=
"['THEME_COLOR',
{ rules: [{ required: true, message: '请输入主题颜色' }] }]"
'THEME_COLOR',
{rules: [{ required: true, message: '请输入主题颜色' }]}
]"
name="THEME_COLOR"
name="THEME_COLOR"
/>
/>
</a-form-item>
</a-form-item>
<a-form-item
<a-form-item
label=
"
服务类目描述
"
label=
"
创建时间
"
:labelCol=
"
{
lg: {span: 7}, sm: {span: 7}
}"
:labelCol=
"
{
lg: { span: 7 }, sm: { span: 7 }
}"
:wrapperCol="{
lg: {span: 10}, sm: {span: 17
} }"
:wrapperCol="{
lg: { span: 10 }, sm: { span: 17
} }"
:required="false"
:required="false"
>
>
<a-input
<a-date-picker
showTime
v-decorator=
"['CREATE_TIME',
{ normalize: DateCheck }]" />
placeholder=
"请输入服务类目描述"
v-decorator=
"[
'DESCRIPTION',
{rules: [{ required: true, message: '请输入服务类目描述' }]}
]"
name="DESCRIPTION"
/>
</a-form-item>
</a-form-item>
<a-form-item
<a-form-item
label=
"
创建时间
"
label=
"
服务类目描述
"
:labelCol=
"
{
lg: {span: 7}, sm: {span: 7}
}"
:labelCol=
"
{
lg: { span: 7 }, sm: { span: 7 }
}"
:wrapperCol="{
lg: {span: 10}, sm: {span: 17
} }"
:wrapperCol="{
lg: { span: 10 }, sm: { span: 17
} }"
:required="false"
:required="false"
>
>
<a-date-picker
showTime
v-decorator=
"['CREATE_TIME',
{normalize:DateCheck}]" />
<div
:class=
"prefixCls"
>
<quill-editor
v-model=
"content"
ref=
"myQuillEditor"
:options=
"editorOption"
@
blur=
"onEditorBlur($event)"
@
focus=
"onEditorFocus($event)"
@
ready=
"onEditorReady($event)"
@
change=
"onEditorChange($event)"
>
</quill-editor>
</div>
<!--
<a-input
placeholder=
"请输入服务类目描述"
v-decorator=
"['DESCRIPTION',
{ rules: [{ required: true, message: '请输入服务类目描述' }] }]"
name="DESCRIPTION"
/> -->
</a-form-item>
</a-form-item>
<a-form-item
:wrapperCol=
"
{ span: 24 }" style="text-align: center">
<a-form-item
:wrapperCol=
"
{ span: 24 }" style="text-align: center">
<a-button
v-if=
"goId == 1"
@
click
.
stop
.
prevent=
"handleSubmit"
htmlType=
"submit"
type=
"primary"
>
提交1
</a-button>
<a-button
v-if=
"goId == 1"
@
click
.
stop
.
prevent=
"handleSubmit"
htmlType=
"submit"
type=
"primary"
>
提交1
</a-button>
<a-button
v-else
@
click
.
stop
.
prevent=
"handleSubmit1()"
htmlType=
"submit"
type=
"primary"
>
提交
</a-button>
<a-button
v-else
@
click
.
stop
.
prevent=
"handleSubmit1()"
htmlType=
"submit"
type=
"primary"
>
提交
</a-button>
...
@@ -75,19 +78,44 @@
...
@@ -75,19 +78,44 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
moment
from
'moment'
import
moment
from
'moment'
import
{
getScategorymgDetails
,
addScategorymg
,
modifyScategorymgDetails
,
deleteScategorymg
}
from
'@/api/store'
import
{
getScategorymgDetails
,
addScategorymg
,
modifyScategorymgDetails
,
deleteScategorymg
}
from
'@/api/store'
import
'quill/dist/quill.core.css'
import
'quill/dist/quill.snow.css'
import
'quill/dist/quill.bubble.css'
import
{
quillEditor
}
from
'vue-quill-editor'
export
default
{
export
default
{
name
:
'BaseForm'
,
name
:
'BaseForm'
,
// name: 'QuillEditor',
components
:
{
quillEditor
},
props
:
{
prefixCls
:
{
type
:
String
,
default
:
'ant-editor-quill'
},
// 表单校验用字段
// eslint-disable-next-line
value
:
{
type
:
String
}
},
data
()
{
data
()
{
return
{
return
{
description
:
'表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。'
,
description
:
'表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。'
,
goId
:
1
,
goId
:
1
,
GUID
:
''
,
GUID
:
''
,
value
:
Object
,
//
value: Object,
// form
// form
form
:
this
.
$form
.
createForm
(
this
)
form
:
this
.
$form
.
createForm
(
this
),
content
:
null
,
editorOption
:
{
// some quill options
}
}
}
},
},
// props: {
// props: {
...
@@ -112,10 +140,23 @@ export default {
...
@@ -112,10 +140,23 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
onEditorBlur
(
quill
)
{
console
.
log
(
'editor blur!'
,
quill
)
},
onEditorFocus
(
quill
)
{
console
.
log
(
'editor focus!'
,
quill
)
},
onEditorReady
(
quill
)
{
console
.
log
(
'editor ready!'
,
quill
)
},
onEditorChange
({
quill
,
html
,
text
})
{
console
.
log
(
'editor change!'
,
quill
,
html
,
text
)
this
.
$emit
(
'change'
,
html
)
},
// 时间处理
// 时间处理
DateCheck
(
value
){
DateCheck
(
value
)
{
if
(
value
&&
value
!=
null
&&
value
!=
""
&&
value
!=
"undefined"
){
if
(
value
&&
value
!=
null
&&
value
!=
""
&&
value
!=
"undefined"
){
return
moment
(
value
,
'YYYY-MM-DD HH:mm:ss'
)
return
moment
(
value
,
'YYYY-MM-DD HH:mm:ss'
)
}
}
},
},
checkRadio
(
value
)
{
checkRadio
(
value
)
{
...
@@ -143,7 +184,7 @@ export default {
...
@@ -143,7 +184,7 @@ export default {
validateFields
({
force
:
true
},
(
err
,
values
)
=>
{
validateFields
({
force
:
true
},
(
err
,
values
)
=>
{
if
(
!
err
)
{
if
(
!
err
)
{
const
ScategorymgModify
=
Object
.
assign
({
...
values
},
{
GUID
:
GUID
})
const
ScategorymgModify
=
Object
.
assign
({
...
values
},
{
GUID
:
GUID
})
ScategorymgModify
.
CREATE_TIME
=
ScategorymgModify
.
CREATE_TIME
.
format
(
"YYYY-MM-DD HH:mm:ss"
);
ScategorymgModify
.
CREATE_TIME
=
ScategorymgModify
.
CREATE_TIME
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
modifyScategorymgDetails
(
ScategorymgModify
)
modifyScategorymgDetails
(
ScategorymgModify
)
this
.
$router
.
push
({
path
:
'/storedc/scategorymg'
})
this
.
$router
.
push
({
path
:
'/storedc/scategorymg'
})
}
}
...
@@ -152,6 +193,24 @@ export default {
...
@@ -152,6 +193,24 @@ export default {
goBack
()
{
goBack
()
{
this
.
$router
.
push
({
path
:
'/storedc/scategorymg'
})
this
.
$router
.
push
({
path
:
'/storedc/scategorymg'
})
}
}
},
watch
:
{
value
(
val
)
{
this
.
content
=
val
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
@import url('../../index.less');
/* 覆盖 quill 默认边框圆角为 ant 默认圆角,用于统一 ant 组件风格 */
.ant-editor-quill {
/deep/ .ql-toolbar.ql-snow {
border-radius: @border-radius-base @border-radius-base 0 0;
}
/deep/ .ql-container.ql-snow {
border-radius: 0 0 @border-radius-base @border-radius-base;
}
}
</
style
>
\ No newline at end of file
src/views/storedc/details/branchservice_add.vue
View file @
6f8e5c76
<
template
>
<
template
>
<a-card
:body-style=
"
{padding: '24px 32px'}" :bordered="false">
<div
:class=
"prefixCls"
>
<a-form
:form=
"form"
>
<quill-editor
<a-form-item
v-model=
"content"
label=
"服务类目名称"
ref=
"myQuillEditor"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:options=
"editorOption"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }"
@
blur=
"onEditorBlur($event)"
>
@
focus=
"onEditorFocus($event)"
<a-input
@
ready=
"onEditorReady($event)"
placeholder=
"请输入服务类目名称"
@
change=
"onEditorChange($event)"
>
v-decorator=
"['NAME',
{rules: [{ required: true, message: '请输入服务类目名称' }]}]"
</quill-editor>
name="NAME"
/>
</div>
</a-form-item>
<a-form-item
label=
"服务类目编号"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }"
>
<a-input
placeholder=
"服务类目编号"
v-decorator=
"[
'CODE',
{rules: [{ required: true, message: '服务类目编号' }]}
]"
name="CODE"
/>
</a-form-item>
<a-form-item
label=
"主题颜色"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }"
:required="false"
>
<a-input
placeholder=
"请输入主题颜色"
v-decorator=
"[
'THEME_COLOR',
{rules: [{ required: true, message: '请输入主题颜色' }]}
]"
name="THEME_COLOR"
/>
</a-form-item>
<a-form-item
label=
"服务类目描述"
:labelCol=
"
{lg: {span: 7}, sm: {span: 7}}"
:wrapperCol="{lg: {span: 10}, sm: {span: 17} }"
:required="false"
>
<a-input
placeholder=
"请输入服务类目描述"
v-decorator=
"[
'DESCRIPTION',
{rules: [{ required: true, message: '请输入服务类目描述' }]}
]"
name="DESCRIPTION"
/>
</a-form-item>
<a-form-item
:wrapperCol=
"
{ span: 24 }" style="text-align: center">
<a-button
@
click=
"handleSubmit()"
htmlType=
"submit"
type=
"primary"
>
提交
</a-button>
<a-button
@
click=
"goBack"
style=
"margin-left: 8px"
>
返回
</a-button>
</a-form-item>
</a-form>
</a-card>
</
template
>
</
template
>
<
script
>
<
script
>
import
moment
from
'moment'
import
'quill/dist/quill.core.css'
// 新增门店服务类目
import
'quill/dist/quill.snow.css'
import
{
addScategorymg
}
from
'@/api/store'
import
'quill/dist/quill.bubble.css'
import
{
quillEditor
}
from
'vue-quill-editor'
export
default
{
export
default
{
name
:
'BaseForm'
,
name
:
'QuillEditor'
,
data
()
{
components
:
{
return
{
quillEditor
description
:
'表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。'
,
},
coDe
:
1
,
props
:
{
scateId
:
''
,
prefixCls
:
{
value
:
Object
,
type
:
String
,
// form
default
:
'ant-editor-quill'
form
:
this
.
$form
.
createForm
(
this
)
},
// 表单校验用字段
// eslint-disable-next-line
value
:
{
type
:
String
}
}
},
},
// props: {
data
()
{
return
{
// },
content
:
null
,
mounted
()
{
editorOption
:
{
// console.log(this.$route.query)
// some quill options
// var id = this.$route.query.scateId
}
// var coDe = this.$route.query.code
}
// this.coDe = coDe
// this.scateId = id
// if (coDe == 0) {
// getScategorymgDetails(id)
// .then(res => {
// console.log(res)
// this.$nextTick(() => {
// this.GUID = res.data[0].GUID
// this.form.setFieldsValue(res.data[0])
// })
// // this.form.initialValue(res)
// // this.form.setFieldsValue(res)
// })
// .catch(err => {})
// }
},
},
methods
:
{
methods
:
{
// 时间处理
onEditorBlur
(
quill
)
{
DateCheck
(
value
){
console
.
log
(
'editor blur!'
,
quill
)
if
(
value
||
value
!=
null
||
value
!=
""
){
return
moment
(
value
,
'YYYY-MM-DD HH:mm:ss'
)
}
},
},
checkRadio
(
value
)
{
onEditorFocus
(
quill
)
{
return
value
.
toString
(
)
console
.
log
(
'editor focus!'
,
quill
)
},
},
handleSubmit
()
{
onEditorReady
(
quill
)
{
// alert(111)
console
.
log
(
'editor ready!'
,
quill
)
const
{
},
form
:
{
validateFields
}
onEditorChange
({
quill
,
html
,
text
})
{
}
=
this
console
.
log
(
'editor change!'
,
quill
,
html
,
text
)
validateFields
({
force
:
true
},
(
err
,
values
)
=>
{
this
.
$emit
(
'change'
,
html
)
if
(
!
err
)
{
const
ScategorymgParams
=
{
...
values
}
addScategorymg
(
ScategorymgParams
)
this
.
$router
.
push
({
path
:
'/storedc/scategorymg'
})
}
}
})
},
},
// handleSubmit1() {
watch
:
{
// alert(121)
value
(
val
)
{
// let GUID = this.GUID
this
.
content
=
val
// //
// const {
// form: { validateFields }
// } = this
// validateFields({ force: true }, (err, values) => {
// if (!err) {
// const ScategorymgModify = Object.assign({ ...values }, { GUID: GUID })
// ScategorymgModify.CREATE_TIME=ScategorymgModify.CREATE_TIME.format("YYYY-MM-DD HH:mm:ss");
// modifyScategorymgDetails(ScategorymgModify)
// this.$router.push({ path: '/storedc/scategorymg' })
// }
// })
// },
goBack
()
{
this
.
$router
.
push
({
path
:
'/storedc/scategorymg'
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
@import url('../../index.less');
/* 覆盖 quill 默认边框圆角为 ant 默认圆角,用于统一 ant 组件风格 */
.ant-editor-quill {
/deep/ .ql-toolbar.ql-snow {
border-radius: @border-radius-base @border-radius-base 0 0;
}
/deep/ .ql-container.ql-snow {
border-radius: 0 0 @border-radius-base @border-radius-base;
}
}
</
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