Commit 204aee9e by 李伟康

提交群接龙

1 parent 534476a6
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
"env": { "env": {
"node": true "node": true
}, },
"globals": {
"AMap": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"], "extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": { "rules": {
"no-console": "off", "no-console": "off",
......
...@@ -1129,11 +1129,26 @@ ...@@ -1129,11 +1129,26 @@
"version": "7.18.9", "version": "7.18.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz",
"integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==", "integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==",
"dev": true,
"requires": { "requires": {
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
} }
}, },
"@babel/runtime-corejs3": {
"version": "7.23.7",
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.23.7.tgz",
"integrity": "sha512-ER55qzLREVA5YxeyQ3Qu48tgsF2ZrFjFjUS6V6wF0cikSw+goBJgB9PBRM1T6+Ah4iiM+sxmfS/Sy/jdzFfhiQ==",
"requires": {
"core-js-pure": "^3.30.2",
"regenerator-runtime": "^0.14.0"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
}
}
},
"@babel/template": { "@babel/template": {
"version": "7.18.10", "version": "7.18.10",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
...@@ -4004,6 +4019,11 @@ ...@@ -4004,6 +4019,11 @@
} }
} }
}, },
"core-js-pure": {
"version": "3.35.0",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.35.0.tgz",
"integrity": "sha512-f+eRYmkou59uh7BPcyJ8MC76DiGhspj1KMxVIcF24tzP8NA9HVa1uC7BTW2tgx7E1QVCzDzsgp7kArrzhlz8Ew=="
},
"core-util-is": { "core-util-is": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
...@@ -10092,8 +10112,7 @@ ...@@ -10092,8 +10112,7 @@
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.9", "version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
"dev": true
}, },
"regenerator-transform": { "regenerator-transform": {
"version": "0.15.0", "version": "0.15.0",
...@@ -12815,6 +12834,23 @@ ...@@ -12815,6 +12834,23 @@
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==" "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
}, },
"wangeditor": {
"version": "4.7.15",
"resolved": "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.15.tgz",
"integrity": "sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==",
"requires": {
"@babel/runtime": "^7.11.2",
"@babel/runtime-corejs3": "^7.11.2",
"tslib": "^2.1.0"
},
"dependencies": {
"tslib": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
}
}
},
"watchpack": { "watchpack": {
"version": "1.7.5", "version": "1.7.5",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz",
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
"wangeditor": "^4.7.15",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -3,14 +3,10 @@ ...@@ -3,14 +3,10 @@
<div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']"> <div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block"> <el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData"> <template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="[{ 'no-label': !item.label, isBlock: isBlock }, { textBox: item.type == 'textBox' }]" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name"> <el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="[{ 'no-label': !item.label, isBlock: isBlock },{'textBox':item.type=='textBox'}]" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label"> <span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span> <span class="tips-label">{{ item.label }}</span>
<el-popover placement="top" :width="item.tipsWidth || 200" trigger="hover"> <el-popover placement="top" width="200" trigger="hover" :content="item.tips">
<div>
{{ item.tips }}
<span class="tips-jump" v-if="item.jumpLabel" @click="item.handleJump">{{ item.jumpLabel }}</span>
</div>
<img slot="reference" class="tips-icon" src="./images/icon-tip.png" /> <img slot="reference" class="tips-icon" src="./images/icon-tip.png" />
</el-popover> </el-popover>
: :
...@@ -27,10 +23,6 @@ ...@@ -27,10 +23,6 @@
</el-input> </el-input>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</div> </div>
<!-- 选择-时间选择框 -->
<template v-else-if="item.type === 'selectTimePicker'">
<el-time-picker is-range v-model="formObj[item.name]" :value-format="item.format || ''" :style="{ width: item.width || defaultWidth }" :picker-options="item.pickerOptions || ''" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</template>
<!-- 选择框 --> <!-- 选择框 -->
<div v-else-if="item.type === 'select'"> <div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)"> <el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
...@@ -89,6 +81,14 @@ ...@@ -89,6 +81,14 @@
</template> </template>
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</template> </template>
<!-- 图文编辑器 -->
<textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" :excludeMenus="item.excludeMenus || ['code']" @change="e => handleTextBoxChange(e, item)" @focus="handleTextBoxFocus(item)" :boxHeight="item.boxHeight"></textBox>
<!-- 地图 -->
<div v-else-if="item.type === 'map'" class="flex">
<Province ref="provinceForm" :subdistrict="subdistrict" :isDisabled="item.isDisabled" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)" :provinceView="item.provinceView"></Province>
<el-input style="flex: 1;" v-model="formObj[item.name]" placeholder="请选择商户地址" :readonly="item.isReadonly"></el-input>
<el-button class="m-l-10" v-show="!item.isDisabled" @click="handleSelectMap(item)" type="primary">选择地址</el-button>
</div>
</el-form-item> </el-form-item>
</template> </template>
<slot name="footer"></slot> <slot name="footer"></slot>
...@@ -101,9 +101,20 @@ ...@@ -101,9 +101,20 @@
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" /> <img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</div> </div>
</GLDialog> </GLDialog>
<GLDialog bigTitle="选择地址" mode="big" :visible.sync="dialogMapVisible" @onOk="getAddress" @onCancel="dialogMapVisible = false">
<map-view v-if="dialogMapVisible" ref="mapForm"></map-view>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="">取 消</el-button>
<el-button type="primary" @click="getAddress">确 定</el-button>
</span> -->
</GLDialog>
</div> </div>
</template> </template>
<script> <script>
import textBox from './textBox'
import Province from './provinceCity.vue'
import mapView from './mapView.vue'
import { beforeRangePickerOptions, afterRangePickerOptions } from './common' import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
export default { export default {
name: 'glsx-combi-form', name: 'glsx-combi-form',
...@@ -123,6 +134,7 @@ export default { ...@@ -123,6 +134,7 @@ export default {
} }
} }
}, },
props: { props: {
isBlock: { isBlock: {
type: Boolean, type: Boolean,
...@@ -151,7 +163,7 @@ export default { ...@@ -151,7 +163,7 @@ export default {
}, },
formObj: { formObj: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
hasTitle: { hasTitle: {
type: Boolean, type: Boolean,
...@@ -159,15 +171,23 @@ export default { ...@@ -159,15 +171,23 @@ export default {
}, },
formRules: { formRules: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
// 搜索+输入框/搜索组合组件,搜索栏绑值 // 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: { searchSelectObj: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
mounted() {},
components: {
textBox,
Province,
mapView
},
mounted() { },
methods: { methods: {
// 选择框-添加其他属性 // 选择框-添加其他属性
selectAddAttr(value, targetItem) { selectAddAttr(value, targetItem) {
...@@ -238,7 +258,6 @@ export default { ...@@ -238,7 +258,6 @@ export default {
}, },
// 图片查看 // 图片查看
handleImgLook(src, targetItem) { handleImgLook(src, targetItem) {
console.log(src, targetItem)
this.isImgVisible = true this.isImgVisible = true
this.dialogObj = { this.dialogObj = {
url: src, url: src,
...@@ -254,9 +273,7 @@ export default { ...@@ -254,9 +273,7 @@ export default {
}, },
// 禁用富文本 // 禁用富文本
forbidEdit() { forbidEdit() {
setTimeout(() => {
this.$refs.textBox.forbidEdit() this.$refs.textBox.forbidEdit()
}, 2000)
}, },
// 地图 // 地图
handleSelectMap(targetItem) { handleSelectMap(targetItem) {
...@@ -360,12 +377,15 @@ export default { ...@@ -360,12 +377,15 @@ export default {
.glsx-combi-form .no-label.el-form-item--small .el-form-item__content { .glsx-combi-form .no-label.el-form-item--small .el-form-item__content {
width: 100%; width: 100%;
} }
.glsx-combi-form .el-form-item--small.el-form-item { .glsx-combi-form .el-form-item--small.el-form-item {
margin: 0 30px 20px 0; margin: 0 30px 20px 0;
} }
.glsx-combi-form .el-form-item--small .el-form-item__label { .glsx-combi-form .el-form-item--small .el-form-item__label {
padding: 0; padding: 0;
} }
/* .glsx-combi-form .el-form-item--small .el-form-item__content { /* .glsx-combi-form .el-form-item--small .el-form-item__content {
width: calc(100% - 85px); width: calc(100% - 85px);
} */ } */
...@@ -378,6 +398,7 @@ export default { ...@@ -378,6 +398,7 @@ export default {
.glsx-combi-form .item-height { .glsx-combi-form .item-height {
height: 37px; height: 37px;
} }
.glsx-combi-form input::-webkit-outer-spin-button, .glsx-combi-form input::-webkit-outer-spin-button,
.glsx-combi-form input::-webkit-inner-spin-button { .glsx-combi-form input::-webkit-inner-spin-button {
-webkit-appearance: none !important; -webkit-appearance: none !important;
...@@ -385,6 +406,7 @@ export default { ...@@ -385,6 +406,7 @@ export default {
.glsx-combi-form input[type='number'] { .glsx-combi-form input[type='number'] {
-moz-appearance: textfield !important; -moz-appearance: textfield !important;
} }
.glsx-combi-form .input-with-select .el-input-group__prepend { .glsx-combi-form .input-with-select .el-input-group__prepend {
background-color: #fff; background-color: #fff;
} }
...@@ -425,16 +447,19 @@ export default { ...@@ -425,16 +447,19 @@ export default {
cursor: pointer; cursor: pointer;
margin-top: 10px; margin-top: 10px;
} }
.glsx-combi-form .activity-Input { .glsx-combi-form .activity-Input {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
} }
.glsx-combi-form .muti-imgs { .glsx-combi-form .muti-imgs {
display: inline-block; display: inline-block;
position: relative; position: relative;
margin: 10px 8px 0 0; margin: 10px 8px 0 0;
} }
.activity-img .add { .activity-img .add {
position: absolute; position: absolute;
top: 40%; top: 40%;
...@@ -442,6 +467,7 @@ export default { ...@@ -442,6 +467,7 @@ export default {
left: 50%; left: 50%;
transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0);
} }
.activity-img .number { .activity-img .number {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
...@@ -451,6 +477,7 @@ export default { ...@@ -451,6 +477,7 @@ export default {
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.muti-imgs .img-btns { .muti-imgs .img-btns {
display: none; display: none;
height: 100%; height: 100%;
...@@ -473,26 +500,32 @@ export default { ...@@ -473,26 +500,32 @@ export default {
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
.muti-imgs .img-btns .btn-item { .muti-imgs .img-btns .btn-item {
display: flex; display: flex;
width: 70%; width: 70%;
justify-content: space-around; justify-content: space-around;
} }
.muti-imgs:hover .img-btns { .muti-imgs:hover .img-btns {
display: block; display: block;
} }
.glsx-combi-form .dialog-img { .glsx-combi-form .dialog-img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.glsx-combi-form .dialog-look { .glsx-combi-form .dialog-look {
text-align: center; text-align: center;
} }
.glsx-combi-form .dialog-video { .glsx-combi-form .dialog-video {
width: 50%; width: 50%;
height: 50%; height: 50%;
} }
/* 图片上传 */ /* 图片上传 */
.glsx-combi-form .el-tag.el-tag--info .el-tag__close { .glsx-combi-form .el-tag.el-tag--info .el-tag__close {
color: #e8e8ea; color: #e8e8ea;
background-color: #5850ff !important; background-color: #5850ff !important;
...@@ -510,8 +543,4 @@ export default { ...@@ -510,8 +543,4 @@ export default {
width: 62%; width: 62%;
/* background: #096; */ /* background: #096; */
} }
.tips-jump {
color: #5850ff;
cursor: pointer;
}
</style> </style>
<template>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() {
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
cursor: 'move'
})
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
},
remoteMethod(query) {
if (query == '') {
return true
}
let _this = this
placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
_this.adrList = result.poiList.pois
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
let self = this
let position
if (e.type == 'click') {
position = e.lnglat
} else {
let { lng, lat } = e
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
}
}
</script>
<style scoped lang="scss">
.map-box {
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" inline="true" class="province" style="padding-left: 0;">
<el-select size="small" v-model="provinceForm.provinceName" clearable :disabled="isDisabled" placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select size="small" v-model="provinceForm.cityName" clearable :disabled="isDisabled" placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
</el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable :disabled="isDisabled" placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select>
</el-form>
</div>
</template>
<script>
export default {
name: 'GLProvince',
props: {
// 省市级别,2--只显示省市,3--显示省市区,默认只显示省市
subdistrict: {
type: Number,
default: 2
},
// 省市下拉组件宽度
defaultWidth: {
type: String,
default: '150px'
},
// 组件是否展示,默认展示
provinceView: {
type: Boolean,
default: true
},
isDisabled: {
type: Boolean,
default: false
}
},
data() {
return {
// 所有数据
AllData: [],
// 城市列表
cityList: [],
// 地区列表
townList: [],
provinceForm: {
// 省份名称
provinceName: '',
// 城市名称
cityName: '',
// 地区名称
townName: '',
// 省份代码
provinceCode: '',
// 城市代码
cityCode: '',
// 地区代码
townCode: ''
}
}
},
mounted() {
this.provinceList()
},
methods: {
/*
* @params:传入的为一个key-value的对象
1、keywords --查询关键字,只支持单个关键词语搜索关键词支持:行政区名称、citycode、adcode
列如:this.provinceList({keywords: '山东省'}),这样就可以筛选出山东省下的市、区信息
2、subdistrict --设置显示下级行政区级数,0:不返回下级行政区;1:返回下一级行政区;2:返回下两级行政区;3:返回下三级行政区;
不传的话默认为2,可以在组件中穿,也可以在调用方法的时候传,如果需要展示省市组件,传值最小为2
3、page --最外层的districts最多会返回20个数据,若超过限制,请用page请求下一页数据。
例如page=2;page=3。默认page=1
4、extensions --控制行政区信息中返回行政区边界坐标点; 可选值:base、all;
base:不返回行政区边界坐标点;(默认)
all:只返回当前查询district的边界值,不返回子节点的边界值;目前不能返回乡镇/街道级别的边界值
5、filter -- 按照指定行政区划进行过滤,填入后则只返回该省/直辖市信息,需填入adcode,为了保证数据的正确,强烈建议填入此参数
6、callback -- callback值是用户定义的函数名称,此参数只在output=JSON时有效
7、output --返回数据格式类型,可选值:JSON,XML(默认JSON)
* @return:返回的是一个promise对象,如果不需要展示组件,只需要获取值,可以直接调用方法,异步获取返回值
列如:
const p = this.$refs.provinceForm.provinceList({xxxx(可传值,传值可参考上文params描述) })
p.then(r => {
// r 为返回结果
console.log(r)
})
**/
// 获取省市信息
provinceList(params = {}) {
params ? (params.subdistrict ? '' : (params.subdistrict = this.subdistrict)) : (params.subdistrict = this.subdistrict)
let data = ''
for (let key in params) {
data += '&' + key + '=' + params[key]
}
let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a`
path = path + data
const pro = fetch(path).then(res => {
return res.json()
})
if (this.provinceView) {
pro.then(r => {
this.AllData = r.districts[0].districts
})
}
return pro
},
// 省市回显
init(province, city, town) {
this.provinceForm = {
provinceName: province,
cityName: city,
townName: town
}
if (province) {
this.AllData.map(item => {
if (item.name.indexOf(province) != -1) {
this.provinceForm.provinceName = item.name
this.cityList = item.districts
this.provinceForm.provinceCode = item.adcode
if (city) {
this.cityList.map(itm => {
if (itm.name.indexOf(city) != -1) {
this.provinceForm.cityCode = itm.adcode
this.provinceForm.cityName = itm.name
this.townList = itm.districts
if (town) {
this.townList.map(itmx => {
if (itmx.name.indexOf(town) != -1) {
this.provinceForm.townCode = itmx.adcode
this.provinceForm.townName = itmx.name
}
})
}
}
})
}
}
})
}
},
// 选择省
selectProvince(val) {
this.provinceForm.cityName = ''
this.provinceForm.townName = ''
this.cityList = val.districts
this.$emit('selectProvince', { provinceName: val.name, provinceCode: val.adcode })
},
// 选择市
selectCity(val) {
this.provinceForm.townName = ''
this.townList = val.districts
this.$emit('selectCity', { cityName: val.name, cityCode: val.adcode })
},
// 选择区
selectTown(val) {
this.$emit('selectTown', { townName: val.name, townCode: val.adcode })
}
}
}
</script>
<style lang="scss">
.province {
display: inline-flex;
.el-select .el-input {
width: auto !important;
}
}
.select-padding {
margin-right: 10px;
}
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
editor: '',
content: '',
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight: {
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E('#div-demo')
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
...@@ -8,18 +8,25 @@ ...@@ -8,18 +8,25 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
title: 'scrm-sub-marketing',
response: { response: {
data_key: 'data', data_key: 'data',
message_key: 'message', message_key: 'message',
code_key: 'code', code_key: ['code', 'returnCode'],
code_success_value: '0', code_success_value: '0',
errId_logout_value: '21', errId_logout_value: '21',
code_message_map: {} code_message_map: {}
}, },
request: { request: {
// baseURL: 'http://scrm.test.glsx.com.cn/', baseURL: "https://scrm.dev.glsx.com.cn",
baseURL: 'http://192.168.2.42:8064/', // 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
request_common: {
baseURL: "//didicb.glsx.com.cn",
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -31,9 +38,13 @@ module.exports = { ...@@ -31,9 +38,13 @@ module.exports = {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0', v: '1.0.0',
format: 'json', format: 'json',
source: '' source: 'scrm-home'
},
sign_common: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: 'glsx'
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b",
cdn: 'https://www.xxx.cn/static'
} }
<template>
<div class="box">
<div class="title">{{title}}</div>
<glsx-combi-form
ref="formRef"
:isEdit="true"
:isBlock="true"
:formObj="configForm"
:formData="formData"
:formRules="rule"
>
</glsx-combi-form>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
title: this.$route.query.$title,
configForm: {
filtration: 1,
activityDetail: ''
},
rule: {
name: [{ required: true, message: '请输入问卷名称', trigger: 'change' }],
merchantId: [{ required: true, message: '请选择所属渠道', trigger: 'change' }],
cardTitle: [{ required: true, message: '请输入卡片标题', trigger: 'change' }],
cardCover: [{ required: true, message: '请上传卡片封面', trigger: 'change' }],
},
formData: [
{
label: '群接龙种类',
type: 'radio',
name: 'filtration',
optionList: [
{
text: '猜数字',
id: 1
},
],
optionId: 'id',
optionLabel: 'text',
},
{
label: '群接龙说明',
name: 'activityDetail',
type: 'textBox',
excludeMenus: ['video', 'code'],
boxHeight: 240
},
{
label: '群接龙种类',
type: 'radio',
name: 'filtration',
optionList: [
{
text: '猜数字',
id: 1
},
],
optionId: 'id',
optionLabel: 'text',
},
],
}
},
mounted () {
console.log()
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.box{
background-color: #fff;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<el-button
type="primary"
size="small"
@click="editForm"
>新建接龙</el-button>
<div class="container">
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="2"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="sticky-btns">
<div class="btns">
<el-button
type="default"
@click="handleExport"
>导出</el-button>
</div>
</div>
</div>
<div class="tabelList">
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="searchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<template
slot="qrcode"
slot-scope="scope"
>
<el-popover
placement="top"
trigger="click"
>
<img
class="img-plus"
:src="scope.scope.qrcode"
/>
<div
class="download-img "
@click="download(scope.scope.qrcode)"
>下载二维码</div>
<div
slot="reference"
class="qr"
>
<img :src="scope.scope.qrcode" />
</div>
</el-popover>
</template>
<template
slot="status"
slot-scope="scope"
>
<div :class="`status status-${scope.scope.status}`">
{{{
'-1':'已结束',
'0':'已结束',
'1':'已开始'
}[scope.scope.status]}}
</div>
</template>
<span
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</span>
</GLTable>
</div>
<GLDialog
:title="updateParams.title"
@onOk="updateQiestionStatus"
@onCancel="updateParams.show = false"
:visible.sync="updateParams.show"
mode="small"
>
<template #default>
<div class="over-box">
<div class="el-icon-warning"></div>
{{updateParams.text}}
</div>
</template>
</GLDialog>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
import util from '@/utils/util'
export default {
name: 'Questionnaire',
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
searchForm: {
merchantName: '',
name: '',
statuses: '0,1'
},
searchFormData: [
{
label: '卡片标题',
name: 'name',
type: 'input',
maxlength: 100
},
{
label: '状态',
name: 'statuses',
type: 'select',
maxlength: 100,
optionList: [
{ text: '全部', id: '0,1' },
{ text: '已开始', id: '0' },
{ text: '已结束', id: '1' },
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '所属渠道',
name: 'merchantNames',
type: 'select',
width: '215px',
multiple: true,
attrs: {
multipleLimit: 10
},
noFilter: false,
optionList: [],
optionId: 'confId',
optionLabel: 'confName'
},
{
label: '创建时间',
name: 'activityTime',
type: 'datePicker',
isClear: true,
valueFormat: 'yyyy-MM-dd',
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
return date > yesterday
}
}
},
],
getListApi: this.$apis.questionnaire.getQuestionnaireList,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '群接龙种类',
prop: 'name',
minWidth: 120
},
{
label: '所属渠道',
minWidth: 100,
formatter: cell => `${cell.merchantId}/${cell.merchantName}`
},
{
label: '卡片标题',
prop: 'cardTitle',
minWidth: 100
},
{
label: '关联奖品',
prop: 'cardTitle',
minWidth: 100
},
{
label: '状态',
minWidth: 100,
addHtml: 'status'
},
{
label: '中奖数字',
prop: 'cardTitle',
minWidth: 100
},
{
label: '创建时间',
prop: 'cardTitle',
minWidth: 100
},
{
label: '开奖时间',
prop: 'cardTitle',
minWidth: 100
},
{
label: '二维码',
minWidth: 100,
addHtml: 'qrcode'
},
]
},
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '结束',
attrs: {
type: 'text',
},
condition: row => row.status == 1,
listeners: {
click: row => this.updateParams = {
show: true,
id: row.id,
title: '结束群接龙',
status: -1,
text: '请确认是否结束此群接龙活动?',
}
}
},
{
type: 'el-button',
name: '查看',
attrs: {
type: 'text',
},
listeners: {
click: row => this.editForm(row)
}
},
{
type: 'el-button',
name: '接龙明细',
attrs: {
type: 'text',
},
listeners: {
// click: row =>
}
},
{
type: 'el-button',
name: '中奖明细',
attrs: {
type: 'text',
},
condition: row => row.status == 0,
listeners: {
// click: row =>
}
},
],
dataObj: {},
updateParams: {
show: false
},
rules: [{ required: true, message: '请输入问卷名称' }]
}
},
mounted () {
},
methods: {
handleSearch () {
this.$refs.listRef.refreshTable()
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
updateQiestionStatus () {
const { id, status } = this.updateParams
this.Interceptor(async () => await this.$apis.questionnaire.updateQuestionnaireStatus({ id, status }), {
target: 'updateParams',
successText: '操作成功!',
errorText: '操作失败,请重试。'
})
},
async Interceptor (fun, params) {
let loading = this.$loading()
try {
const res = await fun()
if (res) {
this.$message({
message: params.successText,
type: 'success'
})
this[params.target] = this.$options.data.call(this)[params.target]
loading.close()
this.handleSearch()
} else throw params.errorText
} catch (error) {
loading.close()
if (error) this.$message.error(error)
}
},
handleExport () {
this.$apis.questionnaire.exportQuestionnaireList({ ...this.searchForm, ...this.$refs.listRef.page }).then(res => {
exportFn(res)
})
},
download (url) {
util.downloadIamge(url)
},
editForm (row, type = '') {
this.$router.push({
path: '/solitaire/add',
query: {
$title: row.id ? type == 'edit' ? '编辑' : '查看' : '新建',
id: row.id,
type
}
})
}
}
}
</script>
<style scoped lang='scss'>
.container {
height: calc(100% - 64px);
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
margin-top: 16px;
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: 10px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
.el-button {
padding: 8px 15px;
min-width: 60px;
}
}
}
}
.qr {
width: 36px;
height: 36px;
img {
width: 100%;
height: 100%;
vertical-align: top;
}
}
}
.img-plus {
width: 200px;
height: 200px;
}
.download-img {
cursor: pointer;
margin-top: 10px;
font-size: 14px;
font-weight: 600;
color: #5850ff;
line-height: 20px;
text-align: center;
}
.status {
display: flex;
align-items: center;
&::before {
content: '';
width: 8px;
height: 8px;
border-radius: 100%;
margin-right: 8px;
background: #999999;
}
}
.status-0 {
&::before {
background: #f8b757;
}
}
.status-1 {
&::before {
background: #4aca74;
}
}
/deep/.copy-box {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
font-size: 16px;
color: #333333;
.input {
transform: translateY(-4px);
margin: 0 auto;
}
.tips {
font-size: 12px;
color: #5850ff;
margin-left: 148px;
width: fit-content;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -14,7 +14,7 @@ const resolve = dir => path.join(__dirname, dir) ...@@ -14,7 +14,7 @@ const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/' const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = { const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`], css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`] js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, 'https://webapi.amap.com/loader.js']
} }
module.exports = { module.exports = {
outputDir: `dist`, outputDir: `dist`,
...@@ -41,7 +41,8 @@ module.exports = { ...@@ -41,7 +41,8 @@ module.exports = {
'vue-router': 'VueRouter', 'vue-router': 'VueRouter',
vuex: 'Vuex', vuex: 'Vuex',
axios: 'axios', axios: 'axios',
echarts: 'echarts' echarts: 'echarts',
AMap: 'AMap'
} }
}, },
devServer: { devServer: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!