12.31开源admin代码更新

This commit is contained in:
hejinfu1026
2021-12-31 15:58:40 +08:00
parent 21e0d0e136
commit 0616cde752
545 changed files with 9743 additions and 139371 deletions

View File

@@ -21,14 +21,16 @@
</el-form-item>
<el-form-item label="分类图标(180*180)" v-if="biztype.value === 1 || biztype.value === 3">
<div class="upLoadPicBox" @click="modalPicTap('1')">
<div v-if="editPram.extra" class="pictrue"><img :src="editPram.extra"></div>
<div v-if="editPram.extra" class="pictrue">
<img :src="editPram.extra">
</div>
<div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="editPram.sort"/>
<el-input-number v-model="editPram.sort" :min="0"/>
</el-form-item>
<el-form-item label="状态">
<el-switch v-model="editPram.status" active-text="显示"
@@ -38,7 +40,7 @@
<el-input v-model="editPram.extra" type="textarea" placeholder="扩展字段" />
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="loadingBtn" @click="handlerSubmit('editPram')">确定</el-button>
<el-button type="primary" :loading="loadingBtn" @click="handlerSubmit('editPram')" v-hasPermi="['admin:category:update']">确定</el-button>
<el-button @click="close">取消</el-button>
</el-form-item>
</el-form>

View File

@@ -5,7 +5,6 @@
ref="tree"
:data="treeList"
show-checkbox
check-strictly
node-key="id"
@check="getCurrentNode"
:default-checked-keys="selectModelKeysNew"
@@ -23,12 +22,6 @@
<el-option label="全部" :value="-1"></el-option>
<el-option label="显示" :value="1"></el-option>
<el-option label="不显示" :value="0"></el-option>
<!--<el-option-->
<!--v-for="item in constants.roleListStatus"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value"-->
<!--/>-->
</el-select>
</el-form-item>
<el-form-item label="名称:">
@@ -38,7 +31,7 @@
</el-form-item>
</el-form>
</div>
<el-button size="mini" type="primary" @click="handleAddMenu({id:0,name:'顶层目录'})">新增{{ biztype.name }}</el-button>
<el-button size="mini" type="primary" @click="handleAddMenu({id:0,name:'顶层目录'})" v-hasPermi="['admin:category:save']" >新增{{ biztype.name }}</el-button>
</div>
<el-table
ref="treeList"
@@ -49,7 +42,7 @@
row-key="id"
:tree-props="{children: 'child', hasChildren: 'hasChildren'}"
>
<el-table-column prop="name" label="名称" min-width="200">
<el-table-column prop="name" label="名称" min-width="240">
<template slot-scope="scope">
{{ scope.row.name }} | {{ scope.row.id }}
</template>
@@ -70,7 +63,9 @@
style="width: 36px; height: 36px"
:src="scope.row.extra"
:preview-src-list="[scope.row.extra]"
v-if="scope.row.extra"
/>
<img style="width: 36px; height: 36px" v-else :src="defaultImg" alt="">
</div>
</template>
</el-table-column>
@@ -84,7 +79,8 @@
label="状态"
min-width="150"
>
<template slot-scope="scope">
<!-- -->
<template slot-scope="scope" v-if="checkPermi(['admin:category:update:status'])">
<el-switch
v-model="scope.row.status"
:active-value="true"
@@ -95,11 +91,7 @@
/>
</template>
</el-table-column>
<!--<el-table-column label="启用状态" width="150">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.status | filterYesOrNo }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="操作" min-width="200" fixed="right">
<template slot-scope="scope">
<el-button
@@ -108,8 +100,8 @@
size="small"
@click="handleAddMenu(scope.row)"
>添加子目录</el-button>
<el-button type="text" size="small" @click="handleEditMenu(scope.row)">编辑</el-button>
<el-button type="text" size="small" @click="handleDelMenu(scope.row)">删除</el-button>
<el-button type="text" size="small" @click="handleEditMenu(scope.row)" v-hasPermi="['admin:category:info']">编辑</el-button>
<el-button type="text" size="small" @click="handleDelMenu(scope.row)" v-hasPermi="['admin:category:delete']">删除</el-button>
</template>
</el-table-column>
</template>
@@ -141,6 +133,7 @@ import * as categoryApi from '@/api/categoryApi.js'
import info from './info'
import edit from './edit'
import * as selfUtil from '@/utils/ZBKJIutil.js'
import { checkPermi, checkRole } from "@/utils/permission";
export default {
// name: "list"
components: { info, edit },
@@ -163,9 +156,6 @@ export default {
type: Boolean,
default: false
},
// selectModelKeys: {
// type: String
// },
selectModelKeys: {
type: Array
},
@@ -179,9 +169,9 @@ export default {
treeProps: {
label: 'name',
children: 'child',
expandTrigger: 'hover',
checkStrictly: true,
emitPath: false
// expandTrigger: 'hover',
// checkStrictly: false,
// emitPath: false
},
// treeCheckedKeys:[],// 选择模式下的属性结构默认选中
multipleSelection: [],
@@ -205,7 +195,8 @@ export default {
viewInfoConfig: {
data: null,
visible: false
}
},
defaultImg:require('@/assets/imgs/moren.jpg')
}
},
mounted() {
@@ -217,6 +208,7 @@ export default {
// }
},
methods: {
checkPermi, //权限控制
onchangeIsShow(row){
categoryApi.categroyUpdateStatus( row.id ).then(() => {
this.$message.success('修改成功')
@@ -241,7 +233,7 @@ export default {
getCurrentNode(data) {
let node = this.$refs.tree.getNode(data);
this.childNodes(node);
this.parentNodes(node);
// this.parentNodes(node);
//是否编辑的表示
// this.ruleForm.isEditorFlag = true;
//编辑时候使用
@@ -320,7 +312,7 @@ export default {
// this.multipleSelection = checkedKeys.concat(halfCheckedKeys)
this.multipleSelection = checkedKeys
this.$emit('rulesSelect', this.multipleSelection)
}
},
}
}
</script>

View File

@@ -28,6 +28,10 @@ export const inputComponents = [
tagIcon: 'input',
defaultValue: undefined,
required: true,
tips:false, //tooltip描述是否开启
tipsDesc:'', //tooltip描述内容
tipsIsLink:false,//是否开启描述链接
tipsLink:'', //描述链接
layout: 'colFormItem',
span: 24,
document: 'https://element.eleme.cn/#/zh-CN/component/input',
@@ -41,7 +45,7 @@ export const inputComponents = [
},
// 其余的为可直接写在组件标签上的属性
placeholder: '请输入',
style: { width: '100%' },
style: { width: '95%' },
clearable: true,
'prefix-icon': '',
'suffix-icon': '',
@@ -59,6 +63,10 @@ export const inputComponents = [
tagIcon: 'textarea',
defaultValue: undefined,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
layout: 'colFormItem',
span: 24,
regList: [],
@@ -71,7 +79,7 @@ export const inputComponents = [
minRows: 4,
maxRows: 4
},
style: { width: '100%' },
style: { width: '95%' },
maxlength: null,
'show-word-limit': false,
readonly: false,
@@ -89,6 +97,10 @@ export const inputComponents = [
layout: 'colFormItem',
span: 24,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
document: 'https://element.eleme.cn/#/zh-CN/component/input'
},
@@ -119,6 +131,10 @@ export const inputComponents = [
span: 24,
layout: 'colFormItem',
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
document: 'https://element.eleme.cn/#/zh-CN/component/input-number'
},
@@ -164,6 +180,10 @@ export const selectComponents = [
layout: 'colFormItem',
span: 24,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/select'
@@ -191,11 +211,15 @@ export const selectComponents = [
labelWidth: null,
tag: 'el-cascader',
tagIcon: 'cascader',
layout: 'colFormItem',
layout: 'colFormItem',
defaultValue: [],
dataType: 'dynamic',
span: 24,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/cascader'
@@ -240,7 +264,13 @@ export const selectComponents = [
optionType: 'default',
regList: [],
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
border: false,
// bindInput:false, //是否开启绑定输入
// bindValve:'', //绑定输入内容
document: 'https://element.eleme.cn/#/zh-CN/component/radio'
},
__slot__: {
@@ -268,6 +298,10 @@ export const selectComponents = [
layout: 'colFormItem',
optionType: 'default',
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
border: false,
@@ -299,6 +333,10 @@ export const selectComponents = [
labelWidth: null,
layout: 'colFormItem',
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/switch'
@@ -323,6 +361,10 @@ export const selectComponents = [
layout: 'colFormItem',
labelWidth: null,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/slider'
@@ -345,6 +387,10 @@ export const selectComponents = [
layout: 'colFormItem',
labelWidth: null,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/time-picker'
@@ -370,6 +416,10 @@ export const selectComponents = [
layout: 'colFormItem',
defaultValue: null,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/time-picker'
@@ -395,6 +445,10 @@ export const selectComponents = [
layout: 'colFormItem',
defaultValue: null,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/time-picker'
@@ -417,6 +471,10 @@ export const selectComponents = [
span: 24,
layout: 'colFormItem',
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/date-picker'
@@ -440,6 +498,10 @@ export const selectComponents = [
showLabel: true,
labelWidth: null,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
layout: 'colFormItem',
regList: [],
changeTag: true,
@@ -467,6 +529,10 @@ export const selectComponents = [
labelWidth: null,
layout: 'colFormItem',
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/rate'
@@ -489,6 +555,10 @@ export const selectComponents = [
labelWidth: null,
layout: 'colFormItem',
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
regList: [],
changeTag: true,
document: 'https://element.eleme.cn/#/zh-CN/component/color-picker'
@@ -502,12 +572,16 @@ export const selectComponents = [
__config__: {
label: '上传文件',
tag: 'upload-file',
tagIcon: 'uploadPicture',
tagIcon: 'uploadPicture',
layout: 'colFormItem',
defaultValue: null,
showLabel: true,
labelWidth: null,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
span: 24,
showTip: false,
buttonText: '点击上传',
@@ -515,7 +589,7 @@ export const selectComponents = [
changeTag: true,
// fileSize: 2,
// sizeUnit: 'MB',
document: 'https://element.eleme.cn/#/zh-CN/component/upload'
document: 'https://element.eleme.cn/#/zh-CN/component/upload'
},
__slot__: {
'list-type': true
@@ -541,6 +615,10 @@ export const selectComponents = [
showLabel: true,
labelWidth: null,
required: true,
tips:false,
tipsDesc:'',
tipsIsLink:false,
tipsLink:'',
span: 24,
showTip: false,
buttonText: '',
@@ -561,25 +639,31 @@ export const selectComponents = [
// 'list-type': 'text',
multiple: false
},
{
__config__: {
label: '富文本编辑器',
tag: 'ueditor-from',
tagIcon: 'ueditorFrom',
layout: 'colFormItem',
defaultValue: null,
showLabel: true,
labelWidth: null,
required: false,
span: 24,
showTip: false,
regList: [],
changeTag: true,
},
height: 300, // 编辑器高度
name: 'ueditor',
disabled: false
}
// {
// __config__: {
// label: '富文本编辑器',
// tag: 'tinymce',
// tagIcon: 'rich-text',
// layout: 'colFormItem',
// defaultValue: null,
// showLabel: true,
// labelWidth: null,
// required: false,
// tips:false,
// tipsDesc:'',
// tipsIsLink:false,
// tipsLink:'',
// span: 24,
// showTip: false,
// regList: [],
// document: "http://tinymce.ax-z.cn",
// renderKey: 1636077154813,
// changeTag: true,
// },
// height: 300, // 编辑器高度
// name: 'tinymce',
// disabled: false
// }
]
// 布局型组件 【左面板】

View File

@@ -15,7 +15,6 @@ const ruleTrigger = {
function renderFrom(h) {
const { formConfCopy } = this
return (
<el-row gutter={formConfCopy.gutter}>
<el-form
@@ -47,7 +46,6 @@ function renderFormItem(h, elementList) {
return elementList.map(scheme => {
const config = scheme.__config__
const layout = layouts[config.layout]
if (layout) {
return layout.call(this, h, scheme)
}
@@ -80,21 +78,51 @@ function buildListeners(scheme) {
return listeners
}
const layouts = {
colFormItem(h, scheme) {
const config = scheme.__config__
const listeners = buildListeners.call(this, scheme)
let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null
if (config.showLabel === false) labelWidth = '0'
return (
<el-col span={config.span}>
<el-form-item label-width={labelWidth} prop={scheme.__vModel__}
label={config.showLabel ? config.label : ''}>
<render conf={scheme} {...{ on: listeners }} />
</el-form-item>
</el-col>
)
if(config.tips && !config.tipsIsLink){
return (
<el-col span={config.span}>
<el-form-item label-width={labelWidth} prop={scheme.__vModel__}
label={config.showLabel ? config.label : ''}>
<el-tooltip effect="dark" placement="top-start" style="padding:10px 5px 0 0;">
            <i class="el-icon-warning-outline" />
            <div slot="content" style="max-width:400px;">{config.tipsDesc}</div>
         </el-tooltip>
<render conf={scheme} {...{ on: listeners }} />
</el-form-item>
</el-col>
)
}else if(config.tips && config.tipsIsLink){
return (
<el-col span={config.span}>
<el-form-item label-width={labelWidth} prop={scheme.__vModel__}
label={config.showLabel ? config.label : ''}>
<el-tooltip effect="dark" placement="top-start" style="padding:10px 5px 0 0;">
            <i class="el-icon-warning-outline" />
            <div slot="content" style="max-width:400px;">
<a href={config.tipsLink} target="_blank">{config.tipsDesc}</a>
</div>
         </el-tooltip>
<render conf={scheme} {...{ on: listeners }} />
</el-form-item>
</el-col>
)
}else{
return (
<el-col span={config.span}>
<el-form-item label-width={labelWidth} prop={scheme.__vModel__}
label={config.showLabel ? config.label : ''}>
<render conf={scheme} {...{ on: listeners }} />
</el-form-item>
</el-col>
)
}
},
rowFormItem(h, scheme) {
let child = renderChildren.apply(this, arguments)

View File

@@ -11,7 +11,7 @@ yarn add form-gen-parser
```
### 使用示例
> [查看在线示例](https://mrhj.gitee.io/form-generator/#/parser)
> [查看在线示例](https://mrhj.gitee.io/form-generator/#/parser)
示例代码:
> [src\components\parser\example\Index.vue](https://github.com/JakHuang/form-generator/blob/dev/src/components/parser/example/Index.vue)

View File

@@ -37,7 +37,7 @@ export default {
},
editData: {
type: Object
}
},
},
data() {
return {

View File

@@ -1,7 +1,7 @@
/* eslint-disable max-len */
export const plugins = [
'advlist anchor autolink autosave code codesample directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table wxTemplate textpattern visualblocks visualchars wordcount'
'advlist anchor autolink autosave code codesample directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textpattern visualblocks visualchars wordcount'
]
export const toolbar = [
'code searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote removeformat subscript superscript codesample hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'

View File

@@ -0,0 +1,3 @@
import Index from './index.vue'
export default Index

View File

@@ -27,18 +27,40 @@ const layouts = {
if (this.formConf.unFocusedComponentBorder) className += ' unfocus-bordered'
let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null
if (config.showLabel === false) labelWidth = '0'
return (
<el-col span={config.span} class={className}
nativeOnClick={event => { activeItem(element); event.stopPropagation() }}>
<el-form-item label-width={labelWidth}
label={config.showLabel ? config.label : ''} required={config.required}>
<render key={config.renderKey} conf={element} onInput={ event => {
this.$set(config, 'defaultValue', event)
}} />
</el-form-item>
{components.itemBtns.apply(this, arguments)}
</el-col>
)
if(config.tips == undefined){
this.$set(config,'tips',false);//如果以前的表单没有tooltip配置就赋值一个默认值用来读取
}
if(config.tips){
return (
<el-col span={config.span} class={className}
nativeOnClick={event => { activeItem(element); event.stopPropagation() }}>
<el-form-item label-width={labelWidth}
label={config.showLabel ? config.label : ''} required={config.required}>
<el-tooltip effect="dark" placement="top-start" style="padding:10px 5px 0 0;">
            <i class="el-icon-warning-outline" />
            <div slot="content" style="max-width:400px;">{config.tipsDesc}</div>
         </el-tooltip>
<render key={config.renderKey} conf={element} onInput={ event => {
this.$set(config, 'defaultValue', event)
}} />
</el-form-item>
{components.itemBtns.apply(this, arguments)}
</el-col>
)
}else{
return (
<el-col span={config.span} class={className}
nativeOnClick={event => { activeItem(element); event.stopPropagation() }}>
<el-form-item label-width={labelWidth}
label={config.showLabel ? config.label : ''} required={config.required}>
<render key={config.renderKey} conf={element} onInput={ event => {
this.$set(config, 'defaultValue', event)
}} />
</el-form-item>
{components.itemBtns.apply(this, arguments)}
</el-col>
)
}
},
rowFormItem(h, element, index, parent) {
const { activeItem } = this.$listeners
@@ -103,4 +125,4 @@ export default {
return layoutIsNotFound.call(this)
}
}
</script>
</script>

View File

@@ -52,9 +52,9 @@
<!-- <el-button icon="el-icon-view" type="text" @click="showJson">-->
<!-- 查看json-->
<!-- </el-button>-->
<!-- <el-button icon="el-icon-download" type="text" @click="download">-->
<!-- 导出vue文件-->
<!-- </el-button>-->
<!-- <el-button icon="el-icon-download" type="text" @click="download"> -->
<!-- 导出vue文件 -->
<!-- </el-button> -->
<!-- <el-button class="copy-btn-main" icon="el-icon-document-copy" type="text" @click="copy">-->
<!-- 复制代码-->
<!-- </el-button>-->
@@ -77,7 +77,7 @@
<el-input v-model="selfForm.info" placeholder="描述" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handlerSaveJSON('selfForm')">保存</el-button>
<el-button type="primary" @click="handlerSaveJSON('selfForm')" v-hasPermi="['admin:system:form:update']">保存</el-button>
</el-form-item>
</el-form>
</div>
@@ -168,7 +168,7 @@ import {
getDrawingList, saveDrawingList, getIdGlobal, saveIdGlobal, getFormConf, getFormConfSelf
} from '../utils/db'
import loadBeautifier from '../utils/loadBeautifier'
import {Debounce} from '@/utils/validate'
let beautifier
const emptyActiveData = { style: {}, autosize: {}}
let oldActiveId
@@ -416,7 +416,7 @@ export default {
this.AssembleFormData()
this.jsonDrawerVisible = true
},
handlerSaveJSON(form) {
handlerSaveJSON:Debounce(function(form) {
// this.AssembleFormData()
// loadBeautifier(btf => {
// beautifier = btf
@@ -434,7 +434,7 @@ export default {
this.selfForm.content = JSON.stringify(formConfig)
this.$emit('getFormConfigDataResult', this.selfForm)
})
},
}),
download() {
this.dialogVisible = true
this.showFileName = true

View File

@@ -508,8 +508,25 @@
<el-form-item v-if="activeData.__config__.required !== undefined" label="是否必填">
<el-switch v-model="activeData.__config__.required" />
</el-form-item>
<template v-if="activeData.__config__.layoutTree">
<el-form-item v-if="activeData.__config__.tips !== undefined" label="开启描述">
<el-switch v-model="activeData.__config__.tips" />
</el-form-item>
<el-form-item v-if="activeData.__config__.tips" label="描述内容">
<el-input v-model="activeData.__config__.tipsDesc" placeholder="请输入描述" />
</el-form-item>
<el-form-item v-if="activeData.__config__.tips" label="描述链接">
<el-switch v-model="activeData.__config__.tipsIsLink" />
</el-form-item>
<el-form-item v-if="activeData.__config__.tipsIsLink" label="链接地址">
<el-input v-model="activeData.__config__.tipsLink" placeholder="请输入链接地址" />
</el-form-item>
<!-- <el-form-item v-if="activeData.__config__.bindInput !== undefined" label="绑定输入">
<el-switch v-model="activeData.__config__.bindInput" />
</el-form-item>
<el-form-item v-if="activeData.__config__.bindInput" label="绑定内容">
<el-input v-model="activeData.__config__.bindValve" placeholder="请输入内容" />
</el-form-item> -->
<template v-if="activeData.__config__.layoutTree">
<el-divider>布局结构树</el-divider>
<el-tree
:data="[activeData.__config__]"

View File

@@ -1,101 +0,0 @@
<template>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import { scrollTo } from '@/utils/scroll-to'
export default {
name: 'Pagination',
props: {
total: {
required: true,
type: Number
},
page: {
type: Number,
default: 1
},
limit: {
type: Number,
default: 20
},
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
}
},
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
},
background: {
type: Boolean,
default: true
},
autoScroll: {
type: Boolean,
default: true
},
hidden: {
type: Boolean,
default: false
}
},
computed: {
currentPage: {
get() {
return this.page
},
set(val) {
this.$emit('update:page', val)
}
},
pageSize: {
get() {
return this.limit
},
set(val) {
this.$emit('update:limit', val)
}
}
},
methods: {
handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) {
scrollTo(0, 800)
}
},
handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize })
if (this.autoScroll) {
scrollTo(0, 800)
}
}
}
}
</script>
<style scoped>
.pagination-container {
background: #fff;
padding: 32px 16px;
}
.pagination-container.hidden {
display: none;
}
</style>

View File

@@ -0,0 +1,3 @@
<template >
<router-view />
</template>

View File

@@ -2,9 +2,6 @@
<div ref="rightPanel" :class="{show:show}" class="rightPanel-container">
<div class="rightPanel-background" />
<div class="rightPanel">
<div class="handle-button" :style="{'top':buttonTop+'px','background-color':theme}" @click="show=!show" v-if="!isPhone">
<i :class="show?'el-icon-close':'el-icon-setting'" />
</div>
<div class="rightPanel-items">
<slot />
</div>
@@ -27,16 +24,21 @@ export default {
type: Number
}
},
data() {
return {
isPhone: this.$wechat.isPhone(),
show: false
}
},
computed: {
show: {
get() {
return this.$store.state.settings.showSettings
},
set(val) {
this.$store.dispatch('settings/changeSetting', {
key: 'showSettings',
value: val
})
}
},
theme() {
return this.$store.state.settings.theme
}
},
},
watch: {
show(value) {
@@ -52,6 +54,7 @@ export default {
},
mounted() {
this.insertToBody()
this.addEventClick()
},
beforeDestroy() {
const elx = this.$refs.rightPanel
@@ -91,7 +94,7 @@ export default {
top: 0;
left: 0;
opacity: 0;
transition: opacity .3s cubic-bezier(.7, .3, .1, 1);
transition: opacity .3s cubic-bezier(0, 0, .25, 1);
background: rgba(0, 0, 0, .2);
z-index: -1;
}
@@ -104,14 +107,14 @@ export default {
top: 0;
right: 0;
box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .05);
transition: all .25s cubic-bezier(.7, .3, .1, 1);
transition: all .25s cubic-bezier(0, 0, .25, 1);
transform: translate(100%);
background: #fff;
z-index: 40000;
}
.show {
transition: all .3s cubic-bezier(.7, .3, .1, 1);
transition: all .3s cubic-bezier(0, 0, .25, 1);
.rightPanel-background {
z-index: 20000;

View File

@@ -1,37 +1,10 @@
<template>
<div class="upload-container">
<el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click=" dialogVisible=true">
upload
</el-button>
<el-dialog :visible.sync="dialogVisible">
<el-upload
:multiple="true"
:file-list="fileList"
:show-file-list="true"
:on-remove="handleRemove"
:on-success="handleSuccess"
:before-upload="beforeUpload"
class="editor-slide-upload"
action="https://httpbin.org/post"
list-type="picture-card"
>
<el-button size="small" type="primary">
Click upload
</el-button>
</el-upload>
<el-button @click="dialogVisible = false">
Cancel
</el-button>
<el-button type="primary" @click="handleSubmit">
Confirm
</el-button>
</el-dialog>
<el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click="modalPicTap('2')"> upload</el-button>
</div>
</template>
<script>
// import { getToken } from 'api/qiniu'
export default {
name: 'EditorSlideUpload',
props: {
@@ -48,55 +21,18 @@ export default {
}
},
methods: {
checkAllSuccess() {
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
modalPicTap(tit) {
const _this = this
this.$modalUpload(function(img) {
let arr = [];
if(img.length>10) return this.$message.warning("最多选择10张图片");
img.map((item) => {
arr.push(item.sattDir)
});
// console.log(arr);
_this.$emit('successCBK', arr)
}, tit, 'content')
},
handleSubmit() {
const arr = Object.keys(this.listObj).map(v => this.listObj[v])
if (!this.checkAllSuccess()) {
this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')
return
}
this.$emit('successCBK', arr)
this.listObj = {}
this.fileList = []
this.dialogVisible = false
},
handleSuccess(response, file) {
const uid = file.uid
const objKeyArr = Object.keys(this.listObj)
for (let i = 0, len = objKeyArr.length; i < len; i++) {
if (this.listObj[objKeyArr[i]].uid === uid) {
this.listObj[objKeyArr[i]].url = response.files.file
this.listObj[objKeyArr[i]].hasSuccess = true
return
}
}
},
handleRemove(file) {
const uid = file.uid
const objKeyArr = Object.keys(this.listObj)
for (let i = 0, len = objKeyArr.length; i < len; i++) {
if (this.listObj[objKeyArr[i]].uid === uid) {
delete this.listObj[objKeyArr[i]]
return
}
}
},
beforeUpload(file) {
const _self = this
const _URL = window.URL || window.webkitURL
const fileName = file.uid
this.listObj[fileName] = {}
return new Promise((resolve, reject) => {
const img = new Image()
img.src = _URL.createObjectURL(file)
img.onload = function() {
_self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }
}
resolve(true)
})
}
}
}
</script>

View File

@@ -1,8 +1,16 @@
<template>
<div :class="{fullscreen:fullscreen}" class="tinymce-container" :style="{width:containerWidth}">
<div
:class="{ fullscreen: fullscreen }"
class="tinymce-container"
:style="{ width: containerWidth }"
>
<textarea :id="tinymceId" class="tinymce-textarea" />
<div class="editor-custom-btn-container">
<editorImage color="#1890ff" class="editor-upload-btn" @successCBK="imageSuccessCBK" />
<editorImage
color="#1890ff"
class="editor-upload-btn"
@successCBK="imageSuccessCBK"
/>
</div>
</div>
</template>
@@ -12,49 +20,53 @@
* docs:
* https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html#tinymce
*/
import editorImage from './components/EditorImage'
import plugins from './plugins'
import toolbar from './toolbar'
import load from './dynamicLoadScript'
import editorImage from "./components/EditorImage";
import plugins from "./plugins";
import toolbar from "./toolbar";
import load from "./dynamicLoadScript";
// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one
const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'
// const tinymceCDN = "https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js";
const tinymceCDN = "https://cdn.bootcdn.net/ajax/libs/tinymce/4.9.3/tinymce.min.js";
export default {
name: 'Tinymce',
name: "Tinymce",
components: { editorImage },
props: {
id: {
type: String,
default: function() {
return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
}
default: function () {
return (
"vue-tinymce-" +
+new Date() +
((Math.random() * 1000).toFixed(0) + "")
);
},
},
value: {
type: String,
default: ''
default: "",
},
toolbar: {
type: Array,
required: false,
default() {
return []
}
return [];
},
},
menubar: {
type: String,
default: 'file edit insert view format table'
default: "file edit insert view format table",
},
height: {
type: [Number, String],
required: false,
default: 360
default: 400,
},
width: {
type: [Number, String],
required: false,
default: 'auto'
}
default: "auto",
},
},
data() {
return {
@@ -63,150 +75,159 @@ export default {
tinymceId: this.id,
fullscreen: false,
languageTypeList: {
'en': 'en',
'zh': 'zh_CN',
'es': 'es_MX',
'ja': 'ja'
}
}
en: "en",
zh: "zh_CN",
es: "es_MX",
ja: "ja",
},
};
},
computed: {
containerWidth() {
const width = this.width
if (/^[\d]+(\.[\d]+)?$/.test(width)) { // matches `100`, `'100'`
return `${width}px`
const width = this.width;
if (/^[\d]+(\.[\d]+)?$/.test(width)) {
// matches `100`, `'100'`
return `${width}px`;
}
return width
}
return width;
},
},
watch: {
value(val) {
if (!this.hasChange && this.hasInit) {
// if (!this.hasChange && this.hasInit) {
this.$nextTick(() =>
window.tinymce.get(this.tinymceId).setContent(val || ''))
}
}
window.tinymce.get(this.tinymceId).setContent(val || "")
);
// }
},
},
mounted() {
this.init()
this.init();
},
activated() {
if (window.tinymce) {
this.initTinymce()
this.initTinymce();
}
},
deactivated() {
this.destroyTinymce()
this.destroyTinymce();
},
destroyed() {
this.destroyTinymce()
this.destroyTinymce();
},
methods: {
init() {
// dynamic load tinymce from cdn
load(tinymceCDN, (err) => {
if (err) {
this.$message.error(err.message)
return
this.$message.error(err.message);
return;
}
this.initTinymce()
})
this.initTinymce();
});
},
initTinymce() {
const _this = this
const _this = this;
window.tinymce.init({
selector: `#${this.tinymceId}`,
language: this.languageTypeList['en'],
language: this.languageTypeList["en"],
height: this.height,
body_class: 'panel-body ',
body_class: "panel-body ",
object_resizing: false,
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
menubar: this.menubar,
plugins: plugins,
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 30pt 36pt", // 第二步
font_formats:
"微软雅黑='微软雅黑';宋体='宋体';黑体='黑体';仿宋='仿宋';楷体='楷体';隶书='隶书';幼圆='幼圆';Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings",
end_container_on_empty_block: true,
powerpaste_word_import: 'clean',
powerpaste_word_import: "clean",
code_dialog_height: 450,
code_dialog_width: 1000,
advlist_bullet_styles: 'square',
advlist_number_styles: 'default',
imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
default_link_target: '_blank',
advlist_bullet_styles: "square",
advlist_number_styles: "default",
imagetools_cors_hosts: ["www.tinymce.com", "codepen.io"],
default_link_target: "_blank",
link_title: false,
nonbreaking_force_tab: true, // inserting nonbreaking space &nbsp; need Nonbreaking Space Plugin
init_instance_callback: editor => {
init_instance_callback: (editor) => {
if (_this.value) {
editor.setContent(_this.value)
editor.setContent(_this.value);
}
_this.hasInit = true
editor.on('NodeChange Change KeyUp SetContent', () => {
this.hasChange = true
this.$emit('input', editor.getContent())
})
_this.hasInit = true;
editor.on("NodeChange Change KeyUp SetContent", () => {
this.hasChange = true;
this.$emit("input", editor.getContent());
});
},
setup(editor) {
editor.on('FullscreenStateChanged', (e) => {
_this.fullscreen = e.state
})
}
// 整合七牛上传
// images_dataimg_filter(img) {
// setTimeout(() => {
// const $image = $(img);
// $image.removeAttr('width');
// $image.removeAttr('height');
// if ($image[0].height && $image[0].width) {
// $image.attr('data-wscntype', 'image');
// $image.attr('data-wscnh', $image[0].height);
// $image.attr('data-wscnw', $image[0].width);
// $image.addClass('wscnph');
// }
// }, 0);
// return img
// },
// images_upload_handler(blobInfo, success, failure, progress) {
// progress(0);
// const token = _this.$store.getters.token;
// getToken(token).then(response => {
// const url = response.data.qiniu_url;
// const formData = new FormData();
// formData.append('token', response.data.qiniu_token);
// formData.append('key', response.data.qiniu_key);
// formData.append('file', blobInfo.blob(), url);
// upload(formData).then(() => {
// success(url);
// progress(100);
// })
// }).catch(err => {
// failure('出现未知问题,刷新页面,或者联系程序员')
// console.integralLog(err);
// });
// },
})
editor.on("FullscreenStateChanged", (e) => {
_this.fullscreen = e.state;
});
},
});
},
destroyTinymce() {
const tinymce = window.tinymce.get(this.tinymceId)
const tinymce = window.tinymce.get(this.tinymceId);
if (this.fullscreen) {
tinymce.execCommand('mceFullScreen')
tinymce.execCommand("mceFullScreen");
}
if (tinymce) {
tinymce.destroy()
tinymce.destroy();
}
},
setContent(value) {
window.tinymce.get(this.tinymceId).setContent(value)
window.tinymce.get(this.tinymceId).setContent(value);
},
getContent() {
window.tinymce.get(this.tinymceId).getContent()
window.tinymce.get(this.tinymceId).getContent();
},
imageSuccessCBK(arr) {
const _this = this
arr.forEach(v => {
window.tinymce.get(_this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`)
})
}
}
}
const _this = this;
arr.forEach((v) => {
if (this.getFileType(v) == "video") {
window.tinymce.get(_this.tinymceId).insertContent( `<video class="wscnph" src="${v}" controls muted></video>`);
} else {
window.tinymce.get(_this.tinymceId).insertContent(`<img class="wscnph" src="${v}" />`);
}
});
},
getFileType(fileName) {
// 后缀获取
let suffix = "";
// 获取类型结果
let result = "";
try {
const flieArr = fileName.split(".");
suffix = flieArr[flieArr.length - 1];
} catch (err) {
suffix = "";
}
// fileName无后缀返回 false
if (!suffix) {
return false;
}
suffix = suffix.toLocaleLowerCase();
// 图片格式
const imglist = ["png", "jpg", "jpeg", "bmp", "gif"];
// 进行图片匹配
result = imglist.find((item) => item === suffix);
if (result) {
return "image";
}
// 匹配 视频
const videolist = ["mp4","m2v","mkv", "rmvb", "wmv","avi","flv","mov","m4v",];
result = videolist.find((item) => item === suffix);
if (result) {
return "video";
}
// 其他 文件类型
return "other";
},
},
};
</script>
<style scoped>
@@ -214,7 +235,7 @@ export default {
position: relative;
line-height: normal;
}
.tinymce-container>>>.mce-fullscreen {
.tinymce-container >>> .mce-fullscreen {
z-index: 10000;
}
.tinymce-textarea {

View File

@@ -2,6 +2,6 @@
// Detail plugins list see https://www.tinymce.com/docs/plugins/
// Custom builds see https://www.tinymce.com/download/custom-builds/
const plugins = ['advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table wxTemplate textcolor textpattern visualblocks visualchars wordcount']
const plugins = ['advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount']
export default plugins

View File

@@ -1,6 +1,6 @@
// Here is a list of the toolbar
// Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen']
const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample fontsizeselect fontselect', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor ']
export default toolbar

View File

@@ -0,0 +1,5 @@
<template>
<div>
</div>
</template>

View File

@@ -13,7 +13,7 @@
<i class="el-icon-document-checked cameraIconfont" />
</div>
</div>
<el-button v-else size="mini" type="primary">点击上传</el-button>
<el-button v-else size="mini" type="primary" v-hasPermi="['admin:upload:file']">点击上传</el-button>
</el-upload>
</div>
</template>

View File

@@ -31,10 +31,8 @@
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
v-for="(item, index) in scope.row.imageInput"
:key="index"
style="width: 36px; height: 36px"
:src="item"
:src="scope.row.imageInput"
:preview-src-list="imgList"
/>
</div>
@@ -121,11 +119,11 @@
handlerGetListData(pram) {
articleApi.ListArticle(pram).then(data => {
this.listData = data
this.listData.list.map((item) => {
item.imageInput.map(i => {
this.imgList.push(i)
})
})
// this.listData.list.map((item) => {
// item.imageInput.map(i => {
// this.imgList.push(i)
// })
// })
})
},
handlerGetCategoryTreeData() {

View File

@@ -1,16 +1,15 @@
<template>
<el-row align="middle" :gutter="10" class="ivu-mt">
<el-col :xl="6" :lg="6" :md="12" :sm="24" :xs="24" class="ivu-mb mb10" v-for="(item, index) in cardLists"
<el-row align="middle" :gutter="20" class="ivu-mt">
<el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24" class="ivu-mb mb20" v-for="(item, index) in cardLists"
:key="index">
<div class="card_box">
<div class="card_box_cir" :class="{'one':index%5==0,'two':index%5==1,'three':index%5==2,'four':index%5==3,'five':index%5==4}">
<div class="card_box_cir1" :class="{'one1':index%5==0,'two1':index%5==1,'three1':index%5==2,'four1':index%5==3,'five1':index%5==4}">
<i class="el-icon-edit" style="color: #fff;"></i>
</div>
<div class="card_box_cir" :class="item.class">
<span class="iconfont" :class="item.icon" :style="{color:item.color}" v-if="item.icon"></span>
<i class="el-icon-edit" style="color: #fff;" v-else></i>
</div>
<div class="card_box_txt">
<span class="sp1" v-text="item.count || 0"></span>
<span class="sp2" v-text="item.name"></span>
<span class="sp1" v-text="item.count || 0"></span>
</div>
</div>
</el-col>
@@ -27,76 +26,81 @@
</script>
<style scoped lang="scss">
.one{
background: #E4ECFF;
}
.two{
background: #FFF3E0;
}
.three{
background: #EAF9E1;
}
.four{
background: #FFEAF4;
}
.five{
background: #F1E4FF;
}
.one {
background: rgba(24, 144, 255, .1);
}
.two {
background: rgba(162, 119, 255, .1);
}
.three {
background: rgba(232, 182, 0, .1);
}
.four {
background: rgba(27, 190, 107, .1);
}
.five {
background: rgba(75, 202, 213, .1);
}
.six {
background: rgba(239, 156, 32, .1);
}
.one1{
background: #4D7CFE;
background: #1890FF;
}
.two1{
background: #FFAB2B;
background: #A277FF;
}
.three1{
background: #6DD230;
background: #EF9C20;
}
.four1{
background: #FF85C0;
background: #1BBE6B;
}
.five1{
background: #B37FEB;
background: #4BCAD5;
}
.six1{
background: #EF9C20;
}
.card_box {
width: 100%;
height: 100%;
height: 110px;
display: flex;
align-items: center;
/*justify-content: center*/
padding: 25px;
box-sizing: border-box;
border-radius: 4px;
background: #f5f7f9;
background: #fff;
box-sizing: border-box;
.card_box_cir {
width: 60px;
height: 60px;
border-radius: 50%;
width: 50px;
height: 50px;
border-radius: 4px;
overflow: hidden;
margin-right: 20px;
display: flex;
justify-content: center;
align-items: center;
.card_box_cir1 {
width: 48px;
height: 48px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
}
.card_box_txt {
.sp1 {
display: block;
color: #252631;
font-size: 24px;
line-height: 37px;
color: #333333;
font-size: 28px;
padding-top: 3px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
}
.sp2 {
display: block;
color: #98A9BC;
font-size: 12px;
color: #606266;
font-size: 14px;
font-weight: 400;
}
}
}
.iconfont{
font-size: 23px;
}
</style>

View File

@@ -69,7 +69,7 @@
</el-table-column>
<el-table-column v-if="handle==='send'" label="操作" min-width="120" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" class="mr10" @click="sendGrant(scope.row.id)">发送</el-button>
<el-button type="text" size="small" class="mr10" @click="sendGrant(scope.row.id)" v-hasPermi="['admin:coupon:user:receive']">发送</el-button>
</template>
</el-table-column>
</el-table>

View File

@@ -60,7 +60,7 @@
min-Width="120"/>
<el-table-column label="身份" prop="realName" min-width="230">
<template slot-scope="scope">
<el-tag size="small" type="info" v-for="(item, index) in scope.row.roleNames.split(',')" class="mr5">{{ item }}</el-tag>
<el-tag size="small" type="info" v-for="(item, index) in scope.row.roleNames.split(',')" :key="index" class="mr5">{{ item }}</el-tag>
</template>
</el-table-column>
<el-table-column label="最后登录时间" prop="lastTime" min-width="180">

View File

@@ -0,0 +1,71 @@
<template>
<div>
<div :id="echarts" :style="styles" />
</div>
</template>
<script>
import echarts from 'echarts'
export default {
name: 'Index',
props: {
styles: {
type: Object,
default: null
},
optionData: {
type: Object,
default: null
}
},
data() {
return {
myChart: null
}
},
computed: {
echarts() {
return 'echarts' + Math.ceil(Math.random() * 100)
}
},
watch: {
optionData: {
handler(newVal, oldVal) {
this.handleSetVisitChart()
},
deep: true // 对象内部属性的监听,关键。
}
},
mounted: function() {
const vm = this
vm.$nextTick(() => {
vm.handleSetVisitChart()
window.addEventListener('resize', this.wsFunc)
})
},
beforeDestroy() {
window.removeEventListener('resize', this.wsFunc)
if (!this.myChart) {
return
}
this.myChart.dispose()
this.myChart = null
},
methods: {
wsFunc() {
this.myChart.resize()
},
handleSetVisitChart() {
this.myChart = echarts.init(document.getElementById(this.echarts))
let option = null
option = this.optionData
// 基于准备好的dom初始化echarts实例
this.myChart.setOption(option, true)
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,85 +0,0 @@
<template>
<div>
<vue-ueditor-wrap v-model="contents" :config="myConfig" style="width: 90%;" @beforeInit="addCustomDialog" />
</div>
</template>
<script>
export default {
name: 'Index',
// components: { VueUeditorWrap },
scrollerHeight: {
content: String,
default: ''
},
props: {
content: {
type: String,
default: ''
},
value: {}
},
beforeMount(){
// 接收 v-model 数据
if(this.value){
this.contents = this.value
}
},
data() {
return {
contents: this.content,
myConfig: {
autoHeightEnabled: false, // 编辑器不自动被内容撑高
initialFrameHeight: 500, // 初始容器高度
initialFrameWidth: '100%', // 初始容器宽度
UEDITOR_HOME_URL: '/UEditor/',
serverUrl: ''
}
}
},
watch: {
content: function(val) {
this.contents = this.content
},
contents: function(val) {
this.$emit('input', val)
}
},
methods: {
// 添加自定义弹窗
addCustomDialog(editorId) {
window.UE.registerUI('test-dialog', function(editor, uiName) {
// 创建 dialog
const dialog = new window.UE.ui.Dialog({
// 指定弹出层中页面的路径,这里只能支持页面,路径参考常见问题 2
iframeUrl: '/setting/uploadPicture?field=dialog&type=2',
// 需要指定当前的编辑器实例
editor: editor,
// 指定 dialog 的名字
name: uiName,
// dialog 的标题
title: '上传图片',
// 指定 dialog 的外围样式
cssRules: 'width:1000px;height:620px;padding:20px;'
})
this.dialog = dialog
var btn = new window.UE.ui.Button({
name: 'dialog-button',
title: '上传图片',
cssRules: `background-image: url(@/assets/images/icons.png);background-position: -726px -77px;`,
onclick: function() {
// 渲染dialog
dialog.render()
dialog.open()
}
})
return btn
}, 37)
}
}
}
</script>
<style scoped>
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,80 @@
(function () {
/* eslint-disable */
if (window.frameElement.id) {
let parent = window.parent,
dialog = parent.$EDITORUI[window.frameElement.id.replace(/_iframe$/, '')],
editor = dialog.editor,
UE = parent.UE,
domUtils = UE.dom.domUtils,
utils = UE.utils,
browser = UE.browser,
/* eslint-disable */
ajax = UE.ajax,
$G = function (id) {
return document.getElementById(id)
},
$focus = function (node) {
setTimeout(function () {
if (browser.ie) {
var r = node.createTextRange();
r.collapse(false);
r.select();
} else {
node.focus()
}
}, 0)
};
window.nowEditor = {editor: editor, dialog: dialog};
utils.loadFile(document, {
href: editor.options.themePath + editor.options.theme + '/dialogbase.css?cache=' + Math.random(),
tag: 'link',
type: 'text/css',
rel: 'stylesheet'
});
var lang = editor.getLang(dialog.className.split('-')[2]);
if (lang) {
domUtils.on(window, 'load', function () {
var langImgPath = editor.options.langPath + editor.options.lang + '/images/';
// 针对静态资源
for (var i in lang['static']) {
var dom = $G(i);
if (!dom) continue;
let tagName = dom.tagName,
content = lang['static'][i];
if (content.src) {
// clone
content = utils.extend({}, content, false);
content.src = langImgPath + content.src;
}
if (content.style) {
content = utils.extend({}, content, false);
content.style = content.style.replace(/url\s*\(/g, 'url(' + langImgPath)
}
switch (tagName.toLowerCase()) {
case 'var':
dom.parentNode.replaceChild(document.createTextNode(content), dom);
break;
case 'select':
var ops = dom.options;
for (var j = 0, oj; oj = ops[j];) {
oj.innerHTML = content.options[j++];
}
for (var p in content) {
p != 'options' && dom.setAttribute(p, content[p]);
}
break;
default :
domUtils.setAttributes(dom, content);
}
}
});
}
}
})();

View File

@@ -13,11 +13,12 @@ uploadFrom.install = function(Vue, options) {
const instance = new ToastConstructor()
instance.$mount(document.createElement('div'))
document.body.appendChild(instance.$el)
Vue.prototype.$modalUpload = function(callback, isMore, modelName) {
Vue.prototype.$modalUpload = function(callback, isMore, modelName, boolean) {
instance.visible = true
instance.callback = callback
instance.isMore = isMore
instance.modelName = modelName
instance.booleanVal = boolean
}
}
export default uploadFrom

View File

@@ -4,7 +4,7 @@
title="上传图片"
:visible.sync="visible"
width="950px"
:modal="false"
:modal="booleanVal"
append-to-body
:before-close="handleClose"
>
@@ -24,7 +24,8 @@ export default {
callback: function() {},
isMore: '',
modelName: '',
ISmodal: false
ISmodal: false,
booleanVal: false
}
},
watch: {

View File

@@ -5,7 +5,7 @@
<el-form inline>
<el-form-item>
<el-input v-model="tableFrom.keywords" placeholder="请输入用户名称" class="selWidth">
<el-button slot="append" icon="el-icon-search" @click="getList" />
<el-button slot="append" icon="el-icon-search" @click="search" />
</el-input>
</el-form-item>
</el-form>
@@ -17,7 +17,7 @@
size="small"
>
<el-table-column label="" width="40">
<template scope="scope">
<template slot-scope="scope">
<el-radio v-model="templateRadio" :label="scope.row.uid" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp</el-radio>
</template>
</el-table-column>
@@ -31,7 +31,7 @@
label="微信用户名称"
min-width="130"
/>
<el-table-column label="客服头像" min-width="80">
<el-table-column label="用户头像" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
@@ -129,6 +129,17 @@ export default {
this.loading = false
})
},
search(){
this.loading = true
userListApi({keywords:this.tableFrom.keywords}).then(res => {
this.tableData.data = res.list
this.tableData.total = res.total
this.loading = false
}).catch(res => {
this.$message.error(res.message)
this.loading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()