Commit 2f131b14 by 胡悦

引用地图组件的提交

1 parent 5251e82f
...@@ -5,9 +5,31 @@ import GlsxVueComponents from 'glsx-vue-components' ...@@ -5,9 +5,31 @@ import GlsxVueComponents from 'glsx-vue-components'
import 'glsx-vue-components/dist/glsx-vue-components.css' import 'glsx-vue-components/dist/glsx-vue-components.css'
import './styles/index.scss' import './styles/index.scss'
// import axios from 'axios' // import axios from 'axios'
import VeeValidate from 'vee-validate'
Vue.use(GlsxVueComponents) Vue.use(GlsxVueComponents)
Vue.use(VeeValidate, {
// i18n,
// i18nRootKey: 'validation',
dictionary: {
en: {
messages: {
required: (field) => `${field}不能为空`,
between: (field, data) => `${field}必须在${data[0]}~${data[1]}之间`,
confirmed: (field, data) => `${field}必须与${data[0]}相匹配`,
max: (field, data) => `${field}最大长度不能超过${data[0]}`,
min: (field, data) => `${field}最小长度不能小于${data[0]}`,
digits: (field, data) => `${field}必须为数字,且长度必须等于${data[0]}`,
min_value: (field, data) => `${field}数值不能小于${data[0]}`,
max_value: (field, data) => `${field}数值不能大于${data[0]}`,
not_in: (field, data) => `${field}不能为${data.join(',')}`
}
}
},
errorBagName: 'errorBags',
fieldsBagName: 'fieldBags',
events: 'blur|input'
})
var mixin = { var mixin = {
mounted() { mounted() {
const _this = this const _this = this
...@@ -32,7 +54,7 @@ var mixin = { ...@@ -32,7 +54,7 @@ var mixin = {
} }
} }
const URL = ' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config' const URL = ' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/authority_common') => { const getConfig = (url = URL + '/business_data_config') => {
return new Promise(resolve => { return new Promise(resolve => {
const xhr = new XMLHttpRequest() const xhr = new XMLHttpRequest()
xhr.onreadystatechange = () => { xhr.onreadystatechange = () => {
......
...@@ -73,3 +73,13 @@ a:hover { ...@@ -73,3 +73,13 @@ a:hover {
.app-container { .app-container {
padding: 20px; padding: 20px;
} }
.error {
color: #f56c6c;
font-size: 12px;
line-height: 1;
padding-top: 4px;
// position: absolute;
// top: 100%;
// left: 0;
float: left;
}
\ No newline at end of file \ No newline at end of file
import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => {
const { vue, config } = data
vue.use(GlsxVueCommon, config)
base.render(App)
})
<template>
<div>
<gl-button type="text" @click="back">商户列表</gl-button>
<span>\商户详情\{{name}}</span>
<gl-tabs v-model="activeName" @tab-click="handleClick">
<gl-tab-pane label="基本信息" name="first">
<gl-col :span="12"><span>商户名称:</span><span>深圳市安卓讯航科技有限公司</span></gl-col>
<gl-col :span="12"><span>商户名称:</span><span>深圳市安卓讯航科技有限公司</span></gl-col>
<gl-col :span="12"><span>商户名称:</span><span>深圳市安卓讯航科技有限公司</span></gl-col>
<gl-col :span="12"><span>商户名称:</span><span>深圳市安卓讯航科技有限公司</span></gl-col>
<gl-col :span="12"><span>商户名称:</span><span>深圳市安卓讯航科技有限公司</span></gl-col>
<gl-col :span="12"><span>商户名称:</span><span>深圳市安卓讯航科技有限公司</span></gl-col>
</gl-tab-pane>
<gl-tab-pane label="员工信息" name="second">配置管理
</gl-tab-pane>
<gl-tab-pane label="分组信息" name="third">角色管理
</gl-tab-pane>
</gl-tabs>
</div>
</template>
<script>
export default {
name: 'BusinessDetails',
data() {
return {
name: '',
activeName: 'first',
}
},
mounted() {
// 接受参数
var url = location.search
var theRequest = {}
if (url.indexOf('?') != -1) {
// substr()方法返回从参数值开始到结束的字符串
var str = url.substr(1)
var strs = str.split('&')
const text = []
for (var i = 0; i < strs.length; i++) {
// 处理乱码
text[i] = decodeURI(strs[i])
theRequest[text[i].split('=')[0]] = (text[ i ].split('=')[1])
}
this.name = theRequest.name
}
},
methods: {
back() {
history.back()
},
handleClick(tab, event) {
console.log(tab, event)
}
}
}
</script>
<style lang="sass" scoped>
</style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'businessGroup' name: 'BusinessGroup'
} }
</script> </script>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'businessList' name: 'BusinessList'
} }
</script> </script>
......
<template> <template>
<div> <div>
<h1>业务管理</h1> <gl-button type="primary" @click="showDialog">新增业务</gl-button>
<gl-table :table="tableData"></gl-table>
<gl-dialog title="新增业务"
:visible.sync="dialogFormVisible"
:close-on-click-modal="false">
<gl-form :model="form"
label-width="100px"
:rules="rules">
<gl-form-item label="业务名称" prop="businessName">
<gl-input v-model="form.businessName"
name="businessName"
placeholder="请输入业务名称"
data-vv-as="业务名称"
v-validate="'required'"></gl-input>
<span v-show="errorBags.has('businessName')" class="error">{{ errorBags.first('businessName') }}</span>
</gl-form-item>
<gl-form-item label="业务描述" prop="businessDescription">
<gl-input
v-model="form.businessDescription"
type="textarea"
:rows="4"
placeholder="请输入业务描述"
name="businessDescription"
data-vv-as="业务描述"
v-validate="'required'"
></gl-input>
<span v-show="errorBags.has('businessDescription')" class="error">{{ errorBags.first('businessDescription') }}</span>
</gl-form-item>
</gl-form>
<div slot="footer" class="dialog-footer">
<gl-button @click="showDialog">取 消</gl-button>
<gl-button type="primary" @click="submit">确 定</gl-button>
</div>
</gl-dialog>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'businessManagement' name: 'BusinessManagement',
data() {
return {
tableData: {
border: true,
align: 'center',
data: [
{
businessId: 1,
businessName: '爱车保镖',
businessCode: '11',
businessDescription: ' 基于车联网智能终端大数据为汽车金融提供资产保全的服务',
createdTime: '2018-03-16'
}, {
businessId: 2,
businessName: '爱车保镖',
businessCode: '11',
businessDescription: ' 基于车联网智能终端大数据为汽车金融提供资产保全的服务',
createdTime: '2018-03-16'
}, {
businessId: 3,
businessName: '爱车保镖',
businessCode: '11',
businessDescription: ' 基于车联网智能终端大数据为汽车金融提供资产保全的服务',
createdTime: '2018-03-16'
}, {
businessId: 4,
businessName: '爱车保镖',
businessCode: '11',
businessDescription: ' 基于车联网智能终端大数据为汽车金融提供资产保全的服务',
createdTime: '2018-03-16'
}, {
businessId: 5,
businessName: '爱车保镖',
businessCode: '11',
businessDescription: ' 基于车联网智能终端大数据为汽车金融提供资产保全的服务',
createdTime: '2018-03-16'
}, {
businessId: 6,
businessName: '爱车保镖',
businessCode: '11',
businessDescription: ' 基于车联网智能终端大数据为汽车金融提供资产保全的服务',
createdTime: '2018-03-16'
}
],
column: [
{
label: '业务ID',
prop: 'businessId'
}, {
label: '业务名称',
prop: 'businessName'
}, {
label: '业务编号',
prop: 'businessCode'
}, {
label: '业务描述',
prop: 'businessDescription'
}, {
label: '创建时间',
prop: 'createdTime'
}
],
// 详情
console: {
show: true,
label: '操作',
width: '150',
fixed: 'right',
button: [
{
type: 'text',
label: '详情',
callback: (index, rows) => {
const url = encodeURI(`../../customer/businessDetails.html?id=${rows[index].businessId}&name=${rows[index].businessName}`)
location.href = url
}
}
]
}
},
form: {
businessName: '',
businessDescription: ''
},
dialogFormVisible: false,
rules: {
businessName: [{ required: true }],
businessDescription: [{ required: true }]
}
}
},
watch: {
dialogFormVisible(val) {
this.$validator.errors.clear()
}
},
methods: {
// 显示隐藏弹窗
showDialog() {
this.dialogFormVisible = !this.dialogFormVisible
},
// 提交表单
submit() {
this.$validator.validateAll().then((result) => {
if (result) {
console.log('提交成功')
console.log(this.form)
this.showDialog()
}
})
}
}
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!