Commit cb4f2da0 by 匡雅琴

Merge branch 'kuangyq_dev_2.1.0' of http://192.168.3.233:8090/saas/scrm-micro-se…

…ttings into kuangyq_dev_2.1.0
2 parents 009bb1cc 3c8063cc
......@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.3.6",
"glsx-components": "^1.3.9",
"lodash": "^4.17.21",
"qrcodejs2": "^0.0.2",
"vue": "^2.6.10",
......@@ -43,4 +43,4 @@
"> 1%",
"last 2 versions"
]
}
\ No newline at end of file
}
@import './demo.scss';
img {
width: 100%;
height: 100%;
......@@ -134,11 +136,12 @@ img {
height: 4px;
}
::-webkit-scrollbar-thumb {
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, .3);
}
.el-message--info {
height: 40px;
background: #e6e9ff;
......@@ -147,14 +150,16 @@ img {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: #5850ff;
font-size: 16px;
}
.el-cascader-menu {
max-height:500px;
max-height: 500px;
}
.footer-panel {
display: flex;
align-items: center;
......@@ -166,4 +171,4 @@ img {
background: #ffffff;
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
\ No newline at end of file
}
\ No newline at end of file
import GLCombiForm from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLCombiForm.install = function(Vue) {
Vue.component(GLCombiForm.name, GLCombiForm)
}
// 默认导出组件
export default GLCombiForm
\ No newline at end of file
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<!-- 搜索 -->
<template>
<div class="glsx-combi-formwrap">
<div class="glsx-combi-form">
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :style="{ ...item.style }" :prop="item.name">
<GLSearchItem>
<div slot="name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
<span class="tips-icon"></span>
</el-tooltip>
{{ item.label }}:
</span>
<span v-else-if="!item.isHide && item.label" slot="label">
<span class="combi-form-label" :style="{ width: '112px', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}:</span>
</span>
<!-- // select 组件 作为label -->
<div v-if="item.type === 'selectInput'" id="selectlabel">
<el-select v-model="searchSelectObj[item.selectName].attr" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
</div>
</div>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- 选择-输入框 -->
<el-input class="select-inp" v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false">
<!-- <el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select> -->
</el-input>
<!-- 选择-时间选择框 -->
<!-- <template v-else-if="item.type === 'selectDatePicker'">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-date-picker v-model="searchSelectObj[item.selectName].value" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
</template> -->
<!-- 双选择框 -->
<!-- <template v-else-if="item.type === 'selectDouble'">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || (labelWidth + 'px') }" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-select v-model="searchSelectObj[item.selectName].value" :placeholder="'请选择' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label">
<el-option label="全部" value=""></el-option>
<el-option v-for="subItem in item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]"></el-option>
</el-select>
</template> -->
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
<el-select v-model="formObj[item.name]" :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-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" v-bind="item.datePickerAttrs ? item.datePickerAttrs : {}" v-on="item.datePickerListeners ? item.datePickerListeners : {}" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
</GLSearchItem>
</el-form-item>
</template>
<slot name="footer"></slot>
</el-form>
</GLSearch>
</div>
</div>
</template>
<script>
import GLSearch from '../../GlSearch'
import GLSearchItem from '../../GlSearchItem'
import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
export default {
name: 'GLCombiForm',
data() {
return {
pickerOption: {
beforeRangePickerOptions: beforeRangePickerOptions,
afterRangePickerOptions: afterRangePickerOptions
},
isImgVisible: false,
dialogObj: {
url: '',
uploadType: 'img'
}
}
},
props: {
isBlock: {
type: Boolean,
default: false
},
// defaultWidth: {
// type: String,
// default: '215px'
// },
formRef: {
type: String,
default: 'formRef'
},
isEdit: {
type: Boolean,
default: false
},
// labelWidth: {
// type: Number,
// // 默认是四个字符长度
// default: 56
// },
labelPaddingRight: {
type: Number,
default: 0
},
formData: {
type: Array,
default: () => []
},
formObj: {
type: Object,
default: () => {}
},
hasTitle: {
type: Boolean,
default: true
},
formRules: {
type: Object,
default: () => {}
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: {
type: Object,
default: () => {}
}
},
mounted() {},
components: {
GLSearch,
GLSearchItem
},
methods: {
//gl-search 方法
handleOkFn() {
this.$emit('handleOk')
},
handleRestFn() {
this.$emit('handleRest')
},
// 选择框-添加其他属性
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
}
},
handleInputBlur(e, item) {
item.inputBlur && item.inputBlur(e, item)
}
}
}
</script>
<style lang="scss">
.glsx-combi-formwrap {
/* .glsx-combi-form {
min-width: 922px;
} */
.glsx-combi-form .glsx-combi-form-block {
width: 100%;
}
.glsx-combi-form .isBlock {
display: block !important;
}
/* .glsx-combi-form .el-form-item {
width: 65%;
} */
@media screen and (max-width: 1062px) {
.glsx-combi-form .el-form-item--small {
width: 100%;
}
.glsx-combi-form .el-form-item--small .el-form-item__content {
width: 100%;
}
.search-list {
width: 100%;
}
}
@media screen and (min-width: 1062px) and (max-width: 1440px) {
.glsx-combi-form .el-form-item--small {
width: 50%;
}
.glsx-combi-form .el-form-item--small .el-form-item__content {
width: 100%;
}
.search-list {
width: 100%;
}
}
@media screen and (min-width: 1440px) and (max-width: 1720px) {
.glsx-combi-form .el-form-item--small {
width: 33.33%;
}
.glsx-combi-form .el-form-item--small .el-form-item__content {
width: 100%;
}
.search-list {
width: 100%;
}
}
@media screen and (min-width: 1720px) {
.glsx-combi-form .el-form-item--small {
width: 25%;
}
.glsx-combi-form .el-form-item--small .el-form-item__content {
width: 100%;
}
.search-list {
width: 100%;
}
}
// .glsx-combi-form .el-form-item--small {
// width: 100%;
// }
// .glsx-combi-form .el-form-item--small .el-form-item__content {
// width: 100%;
// }
// .glsx-combi-form .el-form-item--small .el-form-item__content .search-item {
// width: 100%;
// }
// .glsx-combi-form .el-form-item--small .el-form-item__content .search-item .el-input {
// width: 100%;
// }
.glsx-combi-form .el-form-item--small.el-form-item {
margin: 0;
}
.glsx-combi-form .el-form-item--small .el-form-item__label {
padding: 0;
}
/* .glsx-combi-form .el-form-item--small .el-form-item__content {
width: calc(100% - 85px);
} */
.glsx-combi-form .el-col {
margin-bottom: 10px;
}
.glsx-combi-form .el-select {
width: 100%;
}
.glsx-combi-form .item-height {
height: 37px;
}
.glsx-combi-form input::-webkit-outer-spin-button,
.glsx-combi-form input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
.glsx-combi-form input[type='number'] {
-moz-appearance: textfield !important;
}
.glsx-combi-form .input-with-select .el-input-group__prepend {
background-color: #fff;
}
/* 提示图标 */
.glsx-combi-form .tips-block {
position: relative;
}
.glsx-combi-form .tips-label {
margin-right: 20px;
}
.glsx-combi-form .tips-icon {
position: absolute;
display: inline-block;
width: 12px;
height: 12px;
top: 3px;
right: 14px;
margin-right: 4px;
cursor: pointer;
border: 1px dotted #7f7f7f;
border-radius: 50%;
}
.glsx-combi-form .tips-icon::before {
content: '?';
position: absolute;
width: 8px;
height: 8px;
top: -8px;
left: 1px;
font-size: 10px;
}
/* .glsx-combi-form .tips {
margin: 0;
} */
.glsx-combi-form .combi-form-label {
display: inline-block;
box-sizing: border-box;
}
/* 图片上传 */
.glsx-combi-form .photo-top-tips {
/* height: 36px; */
margin: 0 0;
color: #999999;
}
.glsx-combi-form .img-w-h {
width: 80px;
height: 80px;
}
.glsx-combi-form .activity-img {
position: relative;
color: #999999;
background-color: #f7f7f7;
border: 1px dotted #d9d9d9;
cursor: pointer;
}
.glsx-combi-form .activity-Input {
position: absolute;
top: 0;
left: 0;
}
.glsx-combi-form .muti-imgs {
display: inline-block;
position: relative;
}
.activity-img .add {
position: absolute;
top: 40%;
font-size: 40px;
left: 50%;
transform: translate3d(-50%, -50%, 0);
}
.activity-img .number {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
}
#selectlabel {
.el-select {
width: 100% !important;
.el-input__inner {
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
}
}
}
.select-inp {
.el-input__inner {
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
}
.muti-imgs .img-btns {
display: none;
height: 100%;
position: absolute;
width: 80px;
height: 80px;
left: 0;
top: 0;
z-index: 2;
color: #fff;
background: rgba(0, 0, 0, 0.5);
}
.glsx-combi-form .el-icon-delete,
.glsx-combi-form .el-icon-zoom-in {
cursor: pointer;
}
.muti-imgs .img-btns .btn-item {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.muti-imgs .img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.muti-imgs:hover .img-btns {
display: block;
}
.glsx-combi-form .dialog-img {
width: 100%;
height: 100%;
}
.glsx-combi-form .dialog-look {
text-align: center;
}
.glsx-combi-form .dialog-video {
width: 50%;
height: 50%;
}
/* 图片上传 */
.glsx-combi-form .el-tag.el-tag--info .el-tag__close {
color: #e8e8ea;
background-color: #5850ff !important;
}
.glsx-combi-form .el-tag.el-tag--info {
border-color: #5850ff;
}
.glsx-combi-form .el-tag--plain.el-tag--info .el-tag__close:hover {
background-color: #e8e8ea;
}
.glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover {
background-color: #e8e8ea;
}
}
</style>
import GLSearch from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearch.install = function(Vue) {
Vue.component(GLSearch.name, GLSearch)
}
// 默认导出组件
export default GLSearch
\ No newline at end of file
<!-- <content> -->
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
<el-button type="warning" @click="toggleShow(1)">显示代码</el-button>
```js {mixin:true}
{
data() {
return {
demo1: true,
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods:{
toggleShow(num){
// console.log(123)
this['demo' + num] = !this['demo' + num]
},
//gl-search 方法
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
```
# 用来作为 markdown 代码的示例部分
<div v-if="demo1">
```vue
<template>
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
</template>
<script>
import {GLSearch, GLSearchItem} from 'glsx-components'
// 全局引入一次css即可
import 'glsx-components/dist/glsx-components.css'
export default {
data() {
return {
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods: {
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
</script>
```
</div>
<!-- </content> -->
<template>
<div class="gl-search" id="gl-search" :class="{ transTo: !expand }">
<div class="search-list">
<!-- 默认插槽 -->
<slot></slot>
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div>
<div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
</div>
<div class="gl-operate">
<div class="operate">
<el-button size="small" type="primary" @click="handleOk">查询</el-button>
<el-button size="small" @click="handleRest">重置</el-button>
<el-button type="text" size="small" @click="expandFn" v-if="hasExpand">
<span>{{ !expand ? '展开' : '收起' }}</span>
<i class="expand" :class="classIcon"></i>
</el-button>
<!-- <i class="el-icon-arrow-down expand"></i> -->
<!-- <i class="el-icon-arrow-up"></i> -->
</div>
</div>
</div>
</template>
<script>
export default {
name: 'GLSearch',
props: {},
data() {
return {
// input: '',
expand: false,
itemNum: 0,
time: null,
hasExpand: false
}
},
created() {},
mounted() {
this.getItemNum()
// 判断宽度按,是否显示展开收起
this.getClientWith()
window.addEventListener('resize', this.getClientWith, false)
},
computed: {
classIcon() {
return !this.expand ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
}
},
methods: {
// 展开收起
expandFn() {
this.expand = !this.expand
},
// 获取item 输入框 的个数
getItemNum() {
const items = document.getElementById('gl-search').getElementsByClassName('search-item').length
this.itemNum = items
},
// 判断是否有展开收起标志
ifHasExpand(nowCol) {
if (this.itemNum > nowCol) {
return true
}
return false
},
// 监听函数
getClientWith() {
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
const clientWidth = document.documentElement.clientWidth
// console.log('clientWidth: ', clientWidth)
if (clientWidth <= 800) {
// 1列
this.hasExpand = this.ifHasExpand(1)
} else if (clientWidth <= 1440 && clientWidth > 800) {
// 2列
this.hasExpand = this.ifHasExpand(2)
} else if (clientWidth <= 1720 && clientWidth > 1440) {
// 3列
this.hasExpand = this.ifHasExpand(3)
} else {
// 4列
this.hasExpand = this.ifHasExpand(4)
}
}, 300)
},
handleOk() {
// 点击确定的回调
this.$emit('onOk')
},
handleRest() {
// 点击重置的回调
this.$emit('onRest')
}
},
components: {},
watch: {},
beforeDestroy() {
window.removeEventListener('resize', this.getClientWith, false)
this.time = null
}
}
</script>
<style lang="scss">
.gl-search {
&.transTo {
height: 52px;
}
display: flex;
justify-content: space-between;
overflow: hidden;
// @media screen and (max-width: 1062px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1062px) and (max-width: 1440px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1440px) and (max-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
.search-list {
.search-item {
width: 100%;
}
}
.search-list {
flex: 1;
display: flex;
flex-wrap: wrap;
.search-item {
// flex: 1;
// padding-right: 12px;
margin-bottom: 20px;
min-width: 276px;
display: flex;
align-items: center;
box-sizing: border-box;
.name {
width: 112px;
text-align: right;
font-size: 14px;
font-weight: 400;
color: #666;
}
.input {
flex: 1;
// width:100%;
}
.el-input {
width: 100%;
}
.el-select {
width: 100%;
}
.el-date-editor {
width: 100%;
}
}
}
.gl-operate {
display: flex;
align-items: flex-end;
.operate {
text-align: left;
width: 190px;
margin-bottom: 20px;
.expand {
font-size: 14px;
}
.el-button + .el-button {
margin-left: 8px;
}
}
}
}
</style>
import GLSearchItem from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearchItem.install = function(Vue) {
Vue.component(GLSearchItem.name, GLSearchItem)
}
// 默认导出组件
export default GLSearchItem
\ No newline at end of file
<template>
<div :style="{ 'padding-right': spacer + 'px' }" class="search-item">
<div class="name">
<!-- {{ label }} -->
<!-- name 插槽 -->
<slot name="name"></slot>
</div>
<div class="input">
<!-- 默认插槽 -->
<slot></slot>
<!-- <el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input> -->
</div>
</div>
</template>
<script>
export default {
name: 'GLSearchItem',
props: {
// 每个项间隙
spacer: {
type: Number,
default: 12
}
},
data () {
return {}
},
created () {},
mounted () {},
computed: {},
methods: {},
components: {},
watch: {}
}
</script>
......@@ -3,22 +3,22 @@
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-03-15 10:07:01
* @LastEditors: huyue
* @LastEditTime: 2022-04-12 11:11:32
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
export const fetchConfig = function (isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
// return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
}
export const config = {
install(vue, cfg) {
......
/*
* @Author: your name
* @Date: 2022-03-02 15:56:07
* @LastEditTime: 2022-04-02 14:35:06
* @LastEditors: your name
* @LastEditTime: 2022-04-12 11:09:56
* @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\setup\qiankun.js
*/
......@@ -10,14 +10,13 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import ElementUI from 'element-ui'
import { GLButton, GLTable, GLFooter } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { GLButton, GLTable, GLFooter, GLCombiForm } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import GlCombiForm from '@/components/GlCombiForm'
import render from './render'
Vue.use(ElementUI)
Vue.use(GLTable)
Vue.use(GLFooter)
Vue.use(GlCombiForm)
Vue.use(GLCombiForm)
// import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
import 'glsx-components/dist/glsx-components.css'
......
......@@ -7,84 +7,7 @@
>-->
</div>
<div class="follow-form">
<el-form :inline="true" :model="searchForm" class="follow-form-item" label-width="90px">
<el-row>
<el-form-item size="small" label="关联企微">
<el-select v-model="searchForm.isRelevance" placeholder="请选择">
<el-option v-for="item in optionsContact" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item class="merchant-row" size="small">
<el-input size="small" v-model="searchForm.merchantLoginAccount" placeholder="请输入" v-if="searchForm.accountOrPhone == 1">
<el-select
class="merchant-row-input"
size="small"
v-model="searchForm.accountOrPhone"
@change="
searchForm.merchantLoginAccount = ''
searchForm.merchantLegalPersonPhone = ''
"
slot="prepend"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option>
<el-option label="手机号" :value="2"></el-option>
</el-select>
</el-input>
<el-input size="small" v-model="searchForm.merchantLegalPersonPhone" placeholder="请输入" v-if="searchForm.accountOrPhone == 2">
<el-select
class="merchant-row-input"
size="small"
v-model="searchForm.accountOrPhone"
slot="prepend"
@change="
searchForm.merchantLoginAccount = ''
searchForm.merchantLegalPersonPhone = ''
"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option>
<el-option label="手机号" :value="2"></el-option>
</el-select>
</el-input>
</el-form-item>
<el-form-item size="small" label="账户状态">
<el-select size="small" v-model="searchForm.status" placeholder="请选择">
<el-option v-for="item in merchantStatus" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="账户等级">
<el-select size="small" v-model="searchForm.merchantAccountLevel" placeholder="请选择">
<el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="商户号">
<el-input size="small" class="merchant-num" v-model="searchForm.merchantNo" onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入商户号,仅限11位" maxlength="11"></el-input>
</el-form-item>
<el-form-item size="small" label="上级商户号" v-if="$globalState.session.accountLevel != 4">
<el-input size="small" v-model="searchForm.parentMerchantNo" onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入上级商户号,仅限11位" maxlength="11"></el-input>
</el-form-item>
<el-form-item class="merchant-wx" size="small" v-if="$globalState.session.accountLevel == 4">
<el-input size="small" v-model="searchForm.merchantName" placeholder="请输入商户名称/关联的企业微信名"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right; margin-right: 0px" v-if="$globalState.session.accountLevel == 4">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
<el-row v-if="$globalState.session.accountLevel != 4">
<el-form-item class="merchant-wx" size="small">
<el-input size="small" v-model="searchForm.merchantName" placeholder="请输入商户名称/关联的企业微信名"></el-input>
</el-form-item>
<el-form-item :size="size" style="float: right; margin-right: 0px">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLCombiForm :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<div slot="accountTypeNames" slot-scope="scope">
<div class="accountType-row" v-for="(item, index) in scope.scope.accountTypeNames.split(',')" :key="index">{{ item }}</div>
......@@ -103,20 +26,7 @@
</template>
<script>
const optionsContact = [
{
value: '',
label: '全部'
},
{
value: '1',
label: '已关联'
},
{
value: '2',
label: '未关联'
}
]
import { utils } from 'glsx-common'
export default {
name: 'index',
data() {
......@@ -125,13 +35,11 @@ export default {
direction: 'rtl',
searchForm: {
isRelevance: '',
accountOrPhone: 1,
status: '',
merchantAccountLevel: '',
merchantLegalPersonPhone: '',
merchantLoginAccount: ''
},
optionsContact,
accountLevel: [],
accountType: [],
merchantStatus: [],
......@@ -204,7 +112,94 @@ export default {
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0
tableTotal: 0,
// 搜索参数
searchFormData: [
{
label: '关联企微',
name: 'isRelevance',
type: 'select',
optionList: [],
optionId: 'value',
optionLabel: 'label',
optionsName: 'relevanceList'
},
{
type: 'selectInput',
selectName: 'accountOrPhone',
isClear: true,
maxlength: 15,
inputWidth: '286px',
selectWidth: '120px',
selectOption: [
{
label: '登录账户名',
name: 'merchantLoginAccount'
},
{
label: '手机号',
name: 'merchantLegalPersonPhone'
}
],
handleSelectChange: value => {
this.searchSelectObj.accountOrPhone.value = ''
}
},
{
label: '账户状态',
name: 'status',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'merchantStatusList'
},
{
label: '账户等级',
name: 'merchantAccountLevel',
type: 'select',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'merchantAccountLevelList'
},
{
label: '商户号',
name: 'merchantNo',
type: 'input'
},
{
label: '上级商户号',
name: 'parentMerchantNo',
type: 'input'
},
{
label: '',
name: 'merchantName',
type: 'input',
placeholder: '请输入商户名称/关联的企业微信名'
}
],
baseData: {
relevanceList: [
{
value: '1',
label: '已关联'
},
{
value: '2',
label: '未关联'
}
],
merchantStatusList: [],
merchantAccountLevelList: []
},
searchSelectObj: {
accountOrPhone: {
attr: 'merchantLoginAccount',
value: ''
}
}
}
},
methods: {
......@@ -227,13 +222,17 @@ export default {
this.$apis.store.findAllDictData(params).then(res => {
if (res) {
if (dictType == 'account_level') {
this.accountLevel = [{ dictValue: '', dictLabel: '全部' }].concat(res)
// this.accountLevel = [{ dictValue: '', dictLabel: '全部' }].concat(res)
this.baseData.merchantAccountLevelList = res
this.getOptionsList('searchFormData', true, 'merchantAccountLevel')
}
if (dictType == 'account_type') {
this.accountType = res
}
if (dictType == 'merchant_status') {
this.merchantStatus = [{ dictValue: '', dictLabel: '全部' }].concat(res)
// this.merchantStatus = [{ dictValue: '', dictLabel: '全部' }].concat(res)
this.baseData.merchantStatusList = res
this.getOptionsList('searchFormData', true, 'status')
}
}
})
......@@ -244,21 +243,28 @@ export default {
resolve()
})
},
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
handleSearch() {
var params = {
...JSON.parse(JSON.stringify(this.searchForm)),
var params = utils.deepClone(this.searchForm)
const tempParams = this.getSelectInputParams()
params = {
...params,
...tempParams,
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum
}
this.$apis.store.findMerchantByPage(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
this.tableData.length ? (this.$refs.table.tableHeightValues = '') : this.$refs.table.setTableHeightFun()
// if (res.data && res.data.length == []) {
// this.$refs.table.setTableHeightFun()
// }
})
},
handleReset() {
......@@ -270,7 +276,40 @@ export default {
merchantLegalPersonPhone: '',
merchantLoginAccount: ''
}
this.searchSelectObj = {
accountOrPhone: {
attr: 'merchantLoginAccount',
value: ''
}
}
this.handleSearch()
},
// 下拉框list
getOptionsList(formName, hasAll = true, refreshSigle) {
console.log()
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
}
},
......@@ -279,6 +318,10 @@ export default {
this.findAllDictData('account_level')
this.findAllDictData('account_type')
this.findAllDictData('merchant_status')
this.getOptionsList('searchFormData', true, 'isRelevance')
// if (this.$globalState.session.accountLevel == 4) {
// this.searchFormData.find(item => item.name == 'parentMerchantNo').isHide = true
// }
}
}
</script>
......@@ -289,14 +332,6 @@ export default {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 10px;
/deep/ {
.el-input--small .el-input__inner {
width: 215px;
}
.el-form--inline .el-form-item {
margin-right: 10px;
}
}
}
.accountType-row {
text-align: left;
......
......@@ -7,28 +7,12 @@
</div>
<div class="container">
<div>
<template v-if="userInfo.accountLevel != 4">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData"></glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData2">
<span slot="footer" class="footer-btns">
<el-button size="small" @click="reSetFindData">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<GLButton @click="handleExport" fn="导出" :size="size" type="primary" mode="el-button">导出</GLButton>
<!-- <el-button :size="size" type="primary" @click="handleExport">导出</el-button> -->
</span>
</glsx-combi-form>
</template>
<template v-else>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData3">
<span slot="footer" class="footer-btns">
<el-button size="small" @click="reSetFindData">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<GLButton @click="handleExport" fn="导出" :size="size" type="primary" mode="el-button">导出</GLButton>
</span>
</glsx-combi-form>
</template>
<GLCombiForm :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" @handleOk="handleSearch" @handleRest="reSetFindData"></GLCombiForm>
</div>
<GLButton @click="handleExport" fn="导出" :size="size" type="primary" mode="el-button">导出</GLButton>
<div class="table-btn">
<el-button @click="handleExport" :size="size" type="primary" mode="el-button">导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
......@@ -65,7 +49,6 @@
<script>
import { utils } from 'glsx-common'
import glsxCombiForm from './glsx-combi-form'
// import selectPage from './components/selectPage'
export default {
name: 'index',
......@@ -120,10 +103,7 @@ export default {
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'staffStatusList'
}
],
// 搜索2
searchFormData2: [
},
{
type: 'selectInput',
selectName: 'staffNameOrPhone',
......@@ -146,7 +126,6 @@ export default {
}
}
],
searchFormData3: [],
// 表格
getListApi: this.$apis.employee.getListApi,
tableParams: {
......@@ -228,20 +207,14 @@ export default {
}
},
components: {
glsxCombiForm
// selectPage
// glsxTable
},
mounted() {
this.userInfo = this.$globalState.session
// 门店
if (this.userInfo.accountLevel == 4) {
this.searchFormData.splice(0, 1)
// this.searchFormData.splice(0, 1)
var idx = this.tableParams.tableColumns.findIndex(item => item.prop == 'merchantName')
this.tableParams.tableColumns.splice(idx, 1)
this.searchFormData3 = [...this.searchFormData, ...this.searchFormData2]
this.searchFormData[0].isHide = true
}
this.getAllMerchantList()
this.getStaffStatusList()
......@@ -381,13 +354,13 @@ export default {
roleId: '',
status: ''
}
this.searchSelectObj = {
;(this.searchSelectObj = {
staffNameOrPhone: {
attr: 'staffName',
value: ''
}
},
this.$refs.employeeRef.refreshTable()
}),
this.$refs.employeeRef.refreshTable()
this.$nextTick(() => {
this.distoryTable = true
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!