yujialong 5 months ago
parent 06290c8e02
commit 4318f73bd3
  1. 163
      src/components/img-upload/Cropper.vue
  2. 130
      src/components/modules/content.vue
  3. 287
      src/components/modules/module.vue
  4. 969
      src/pages/article/add/index.vue
  5. 2
      src/pages/column/add/index.vue
  6. 91
      src/setting.js

@ -3,31 +3,18 @@
<div class="cropper-content"> <div class="cropper-content">
<!-- 剪裁框 --> <!-- 剪裁框 -->
<div class="cropper"> <div class="cropper">
<vueCropper ref="cropper" <vueCropper ref="cropper" :img="option.img" :output-size="option.size" :output-type="option.outputType"
:img="option.img" :info="true" :full="option.full" :can-move="option.canMove" :can-move-box="option.canMoveBox"
:output-size="option.size" :original="option.original" :auto-crop="option.autoCrop" :auto-crop-width="autoCropWidth"
:output-type="option.outputType" :auto-crop-height="autoCropHeight" :fixed-box="option.fixedBox" :fixed="fixed" :fixed-number="fixedNumber"
:info="true" @realTime="realTime" />
:full="option.full"
:can-move="option.canMove"
:can-move-box="option.canMoveBox"
:original="option.original"
:auto-crop="option.autoCrop"
:auto-crop-width="autoCropWidth"
:auto-crop-height="autoCropHeight"
:fixed-box="option.fixedBox"
:fixed="fixed"
:fixed-number="fixedNumber"
@realTime="realTime" />
<!-- <vueCropper ref="cropper" :img="option.img" :outputSize="option.size" :outputType="option.outputType"></vueCropper> --> <!-- <vueCropper ref="cropper" :img="option.img" :outputSize="option.size" :outputType="option.outputType"></vueCropper> -->
</div> </div>
<!-- 预览框 --> <!-- 预览框 -->
<div class="show-preview" <div class="show-preview"
:style="{'width': '500px', 'height': '400px', 'overflow': 'hidden', 'margin': '0 25px', 'display':'flex', 'align-items' : 'center'}"> :style="{ 'width': '500px', 'height': '400px', 'overflow': 'hidden', 'margin': '0 25px', 'display': 'flex', 'align-items': 'center' }">
<div :style="previews.div" <div :style="previews.div" class="preview">
class="preview"> <img :src="previews.url" :style="previews.img" />
<img :src="previews.url"
:style="previews.img" />
</div> </div>
</div> </div>
</div> </div>
@ -41,10 +28,7 @@
</div>--> </div>-->
<!-- 确认上传按钮 --> <!-- 确认上传按钮 -->
<div class="upload-btn"> <div class="upload-btn">
<el-button type="primary" <el-button type="primary" :loading="isUpload" :disabled="isDisabled" @click.prevent="uploadImg('blob')">
:loading="isUpload"
:disabled="isDisabled"
@click.prevent="uploadImg('blob')">
上传 上传
</el-button> </el-button>
</div> </div>
@ -56,7 +40,7 @@
import { import {
VueCropper VueCropper
} from 'vue-cropper' } from 'vue-cropper'
import { compress, compressAccurately } from 'image-conversion' import { compress, compressAccurately, canvastoDataURL } from 'image-conversion'
export default { export default {
components: { components: {
VueCropper VueCropper
@ -95,7 +79,11 @@ export default {
autoCropHeight: { autoCropHeight: {
type: Number, type: Number,
default: 124 default: 124
} },
dataType: {
type: String,
default: 'form'
},
}, },
data () { data () {
return { return {
@ -114,6 +102,7 @@ export default {
fixedNumber: [1, 0.26], // (:[1:1]) fixedNumber: [1, 0.26], // (:[1:1])
enlarge: 1 enlarge: 1
}, },
imgType: this.dataType === 'form' ? 'image/png' : 'image/jpeg',
isDisabled: false isDisabled: false
} }
}, },
@ -147,9 +136,13 @@ export default {
const that = this const that = this
if (type === 'blob') { if (type === 'blob') {
this.$refs.cropper.getCropBlob(data => { this.$refs.cropper.getCropBlob(data => {
// compress(data, 1).then(res => { compress(data, {
that.$emit('upload', data) size: 100,
// }) quality: 0.9,
type: this.imgType
}).then(res => {
that.$emit('upload', res)
})
}) })
} else { } else {
this.$refs.cropper.getCropData(data => { this.$refs.cropper.getCropData(data => {
@ -162,81 +155,81 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cropper-content { .cropper-content {
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: flex-end; justify-content: flex-end;
-webkit-justify-content: flex-end; -webkit-justify-content: flex-end;
} }
.cropper-content .cropper { .cropper-content .cropper {
width: 500px; width: 500px;
height: 400px; height: 400px;
} }
.cropper-content .show-preview { .cropper-content .show-preview {
flex: 1; flex: 1;
-webkit-flex: 1; -webkit-flex: 1;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: center; justify-content: center;
-webkit-justify-content: center; -webkit-justify-content: center;
overflow: hidden; overflow: hidden;
border: 1px solid #cccccc; border: 1px solid #cccccc;
background: #cccccc; background: #cccccc;
margin-left: 40px; margin-left: 40px;
} }
.preview { .preview {
overflow: hidden; overflow: hidden;
border: 1px solid #cccccc; border: 1px solid #cccccc;
background: #cccccc; background: #cccccc;
} }
.footer-btn { .footer-btn {
margin-top: 30px; margin-top: 30px;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: flex-end; justify-content: flex-end;
-webkit-justify-content: flex-end; -webkit-justify-content: flex-end;
} }
.footer-btn .scope-btn { .footer-btn .scope-btn {
width: 500px; width: 500px;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: space-between; justify-content: space-between;
-webkit-justify-content: space-between; -webkit-justify-content: space-between;
} }
.footer-btn .upload-btn { .footer-btn .upload-btn {
flex: 1; flex: 1;
-webkit-flex: 1; -webkit-flex: 1;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: center; justify-content: center;
-webkit-justify-content: center; -webkit-justify-content: center;
} }
.footer-btn .btn { .footer-btn .btn {
outline: none; outline: none;
display: inline-block; display: inline-block;
line-height: 1; line-height: 1;
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
-webkit-appearance: none; -webkit-appearance: none;
text-align: center; text-align: center;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
outline: 0; outline: 0;
margin: 0; margin: 0;
-webkit-transition: 0.1s; -webkit-transition: 0.1s;
transition: 0.1s; transition: 0.1s;
font-weight: 500; font-weight: 500;
padding: 8px 15px; padding: 8px 15px;
font-size: 12px; font-size: 12px;
border-radius: 3px; border-radius: 3px;
color: #fff; color: #fff;
background-color: #67c23a; background-color: #67c23a;
border-color: #67c23a; border-color: #67c23a;
} }
</style> </style>

@ -1,117 +1,64 @@
<template> <template>
<!-- 内容 --> <!-- 内容 -->
<div> <div>
<el-dialog title="编辑内容" <el-dialog title="编辑内容" :visible.sync="visible" width="700px" custom-class="module" :close-on-click-modal="false"
:visible.sync="visible" :before-close="close">
width="700px" <el-form ref="form" :model="data.form" :rules="rules" :label-width="data.labelWidth">
custom-class="module" <el-form-item v-for="(item, i) in data.forms" :key="i" :prop="item.prop" :label="item.label">
:close-on-click-modal="false" <el-input v-if="item.type === 'input'" v-model="data.form[item.prop]" placeholder="请输入"
:before-close="close"> maxlength="100"></el-input>
<el-form ref="form" <el-input v-if="item.type === 'textarea'" v-model="data.form[item.prop]" type="textarea" placeholder="请输入"
:model="data.form" maxlength="300"></el-input>
:rules="rules" <Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
:label-width="data.labelWidth"> v-model="data.form[item.prop]" :init="editorConfig" />
<el-form-item v-for="(item, i) in data.forms" <el-upload v-if="item.type === 'upload' && item.width" class="uploader" accept=".jpg,.png,.jpeg,.gif"
:key="i" :on-change="res => changeFile(res, data.form)" :show-file-list="false" :action="api.upload"
:prop="item.prop" :auto-upload="false">
:label="item.label"> <img v-if="data.form[item.prop]" :src="data.form[item.prop]" class="avatar">
<el-input v-if="item.type === 'input'" <div class="uploader-default" v-else>
v-model="data.form[item.prop]"
placeholder="请输入"
maxlength="100"></el-input>
<el-input v-if="item.type === 'textarea'"
v-model="data.form[item.prop]"
type="textarea"
placeholder="请输入"
maxlength="300"></el-input>
<Editor v-if="item.type === 'editor'"
api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
v-model="data.form[item.prop]"
:init="editorConfig" />
<el-upload v-if="item.type === 'upload' && item.width"
class="uploader"
accept=".jpg,.png,.jpeg,.gif"
:on-change="res => changeFile(res, data.form)"
:show-file-list="false"
:action="api.upload"
:auto-upload="false">
<img v-if="data.form[item.prop]"
:src="data.form[item.prop]"
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传图片</p> <p>上传图片</p>
</div> </div>
<div slot="tip" <div slot="tip" class="el-upload__tip">
class="el-upload__tip">
<p>只支持.jpg,.png格式</p> <p>只支持.jpg,.png格式</p>
</div> </div>
</el-upload> </el-upload>
<el-upload v-if="item.type === 'upload' && !item.width" <el-upload v-if="item.type === 'upload' && !item.width" class="uploader" accept=".jpg,.png,.jpeg"
class="uploader" :on-success="res => uploadSuccess(res, data.form)" :show-file-list="false" :headers="headers"
accept=".jpg,.png,.jpeg" :action="api.upload">
:on-success="res => uploadSuccess(res, data.form)" <img v-if="data.form[item.prop]" :src="data.form[item.prop]" class="avatar">
:show-file-list="false" <div class="uploader-default" v-else>
:headers="headers"
:action="api.upload">
<img v-if="data.form[item.prop]"
:src="data.form[item.prop]"
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传图片</p> <p>上传图片</p>
</div> </div>
<div slot="tip" <div slot="tip" class="el-upload__tip">
class="el-upload__tip">
<p>只支持.jpg,.png格式</p> <p>只支持.jpg,.png格式</p>
</div> </div>
</el-upload> </el-upload>
<template v-if="item.type === 'pic'"> <template v-if="item.type === 'pic'">
<img v-if="data.form[item.prop]" <img v-if="data.form[item.prop]" :src="data.form[item.prop]" class="avatar">
:src="data.form[item.prop]" <div class="uploader-default" v-else>
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-picture-outline"></i> <i class="el-icon-picture-outline"></i>
</div> </div>
</template> </template>
<div v-if="item.type === 'link'" <div v-if="item.type === 'link'" class="flex">
class="flex"> <el-input class="m-r-10" v-model="data.form.link.linkName"></el-input>
<el-input class="m-r-10"
v-model="data.form.link.linkName"></el-input>
<el-button @click="toLink(data.form)">设置链接</el-button> <el-button @click="toLink(data.form)">设置链接</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="$emit('update:visible', false)">取消</el-button> <el-button @click="$emit('update:visible', false)">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="contentSubmit">确定</el-button>
@click="contentSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<Link ref="link" <Link ref="link" :visible.sync="linkVisible" :data.sync="linkForm" @linkSubmit="linkSubmit" />
:visible.sync="linkVisible"
:data.sync="linkForm"
@linkSubmit="linkSubmit" />
<!-- 剪裁组件弹窗 --> <!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" <el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
append-to-body <Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="fixed" :fixedNumber.sync="fixedNumber"
:visible.sync="cropperModel" :autoCropWidth="autoCropWidth" :autoCropHeight="autoCropHeight" :dataType="data.type" @upload="customUpload" />
width="1100px"
:close-on-click-modal="false">
<Cropper ref="cropper"
:img-file.sync="file"
:is-upload="isUpload"
:fixed="fixed"
:fixedNumber.sync="fixedNumber"
:autoCropWidth="autoCropWidth"
:autoCropHeight="autoCropHeight"
@upload="customUpload" />
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -292,11 +239,12 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.radio-wrap { .radio-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
.el-input {
width: 200px; .el-input {
margin-left: -40px; width: 200px;
} margin-left: -40px;
}
} }
</style> </style>

@ -3,40 +3,22 @@
<!-- <!--
模块type: introduce | form | forms | column | columns | history 模块type: introduce | form | forms | column | columns | history
--> -->
<el-dialog title="模块管理" <el-dialog title="模块管理" :visible.sync="visible" :width="dialogWidth" custom-class="module"
:visible.sync="visible" :close-on-click-modal="false" :before-close="close">
:width="dialogWidth"
custom-class="module"
:close-on-click-modal="false"
:before-close="close">
<template v-if="data.type === 'introduce'"> <template v-if="data.type === 'introduce'">
<el-table class="module-table" <el-table class="module-table" :data="data.list" header-align="center" row-key="id">
:data="data.list" <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
header-align="center"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column v-for="(item, i) in data.forms" <el-table-column v-for="(item, i) in data.forms" :key="i" :prop="item.prop" :label="item.label"
:key="i" min-width="130" align="center">
:prop="item.prop"
:label="item.label"
min-width="130"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.type === 'link' && scope.row.link" <div v-if="item.type === 'link' && scope.row.link" class="link-wrap">
class="link-wrap">
<span>{{ scope.row.link.linkName }}</span> <span>{{ scope.row.link.linkName }}</span>
</div> </div>
<template v-else-if="item.type === 'upload'"> <template v-else-if="item.type === 'upload'">
<img v-if="scope.row.pic" <img v-if="scope.row.pic" :src="scope.row.pic" class="upload-pic">
:src="scope.row.pic" <div class="upload-none" v-else>
class="upload-pic">
<div class="upload-none"
v-else>
<i class="el-icon-picture-outline"></i> <i class="el-icon-picture-outline"></i>
</div> </div>
</template> </template>
@ -44,241 +26,137 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" :width="data.sort ? 150 : 100" align="center">
:width="data.sort ? 150 : 100"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex a-center"> <div class="flex a-center">
<el-switch v-model="scope.row.isEnable" <el-switch v-model="scope.row.isEnable" :active-value="1" :inactive-value="0">
:active-value="1"
:inactive-value="0">
</el-switch> </el-switch>
<i class="el-icon-edit-outline del" <i class="el-icon-edit-outline del" @click="editIntro(scope.row, scope.$index)"></i>
@click="editIntro(scope.row, scope.$index)"></i>
<template v-if="data.sort"> <template v-if="data.sort">
<i v-if="scope.$index != data.list.length - 1" <i v-if="scope.$index != data.list.length - 1" class="el-icon-bottom del"
class="el-icon-bottom del" @click="sort(1, scope.$index)"></i>
@click="sort(1, scope.$index)"></i> <i v-if="scope.$index" class="el-icon-top del" @click="sort(0, scope.$index)"></i>
<i v-if="scope.$index"
class="el-icon-top del"
@click="sort(0, scope.$index)"></i>
</template> </template>
<i class="el-icon-delete del" <i class="el-icon-delete del" @click="delRow(data.list, scope.$index)"></i>
@click="delRow(data.list, scope.$index)"></i>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="plus"> <div class="plus">
<i class="el-icon-circle-plus-outline" <i class="el-icon-circle-plus-outline" @click="addRow"></i>
@click="addRow"></i>
</div> </div>
</template> </template>
<el-form v-else-if="data.type === 'form' || data.type === 'forms'" <el-form v-else-if="data.type === 'form' || data.type === 'forms'" ref="form" :model="data.form" :rules="rules"
ref="form" label-width="70px">
:model="data.form" <el-form-item v-for="(item, i) in data.forms" :key="i" :prop="item.prop" :label="item.label">
:rules="rules" <el-input v-if="item.type === 'input'" v-model="data.form[item.prop]" placeholder="请输入"
label-width="70px"> maxlength="100"></el-input>
<el-form-item v-for="(item, i) in data.forms" <el-input v-if="item.type === 'textarea'" v-model="data.form[item.prop]" type="textarea" placeholder="请输入"
:key="i" maxlength="300"></el-input>
:prop="item.prop" <div v-if="item.type === 'upload' || item.type === 'video' || item.type === 'media'" class="uploader-wrap">
:label="item.label"> <el-upload v-if="item.type === 'upload'" class="uploader" accept=".jpg,.png,.jpeg,.gif"
<el-input v-if="item.type === 'input'" :on-change="res => changeFile(res, data.form)" :show-file-list="false" :headers="headers"
v-model="data.form[item.prop]" :action="api.upload">
placeholder="请输入" <img v-if="data.form.pic && !isVideo(data.form.mediaType)" :src="data.form.pic" class="avatar">
maxlength="100"></el-input> <div class="uploader-default" v-else>
<el-input v-if="item.type === 'textarea'"
v-model="data.form[item.prop]"
type="textarea"
placeholder="请输入"
maxlength="300"></el-input>
<div v-if="item.type === 'upload' || item.type === 'video' || item.type === 'media'"
class="uploader-wrap">
<el-upload v-if="item.type === 'upload'"
class="uploader"
accept=".jpg,.png,.jpeg,.gif"
:on-change="res => changeFile(res, data.form)"
:show-file-list="false"
:headers="headers"
:action="api.upload">
<img v-if="data.form.pic && !isVideo(data.form.mediaType)"
:src="data.form.pic"
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传图片</p> <p>上传图片</p>
</div> </div>
<div slot="tip" <div slot="tip" class="el-upload__tip">
class="el-upload__tip">
<p>只支持.jpg,.png格式</p> <p>只支持.jpg,.png格式</p>
</div> </div>
</el-upload> </el-upload>
<el-upload v-if="item.type === 'video'" <el-upload v-if="item.type === 'video'" accept=".mp4,.mov,.avi"
accept=".mp4,.mov,.avi" :on-success="res => uploadSuccess(res, data.form, item)" :before-remove="beforeRemove"
:on-success="res => uploadSuccess(res, data.form, item)" :on-remove="(file, fileList) => handleRemove(file, fileList, data.form, item.prop)" :file-list="fileList"
:before-remove="beforeRemove" :headers="headers" :action="api.upload">
:on-remove="(file, fileList) => handleRemove(file, fileList, data.form, item.prop)"
:file-list="fileList"
:headers="headers"
:action="api.upload">
<el-button>上传视频</el-button> <el-button>上传视频</el-button>
<div slot="tip" <div slot="tip" class="el-upload__tip">
class="el-upload__tip">
<p>请上传大小1G以内的视频</p> <p>请上传大小1G以内的视频</p>
</div> </div>
</el-upload> </el-upload>
<!-- 图片视频都可上传 --> <!-- 图片视频都可上传 -->
<el-upload v-if="item.type === 'media'" <el-upload v-if="item.type === 'media'" :on-success="res => uploadSuccess(res, data.form, item)"
:on-success="res => uploadSuccess(res, data.form, item)" :before-remove="beforeRemove"
:before-remove="beforeRemove" :on-remove="(file, fileList) => handleRemove(file, fileList, data.form, item.prop)" :file-list="fileList"
:on-remove="(file, fileList) => handleRemove(file, fileList, data.form, item.prop)" :headers="headers" :action="api.upload">
:file-list="fileList"
:headers="headers"
:action="api.upload">
<el-button>上传资源</el-button> <el-button>上传资源</el-button>
</el-upload> </el-upload>
<i v-if="!item.required" <i v-if="!item.required" class="el-icon-delete del" @click="data.form[item.prop] = ''"></i>
class="el-icon-delete del"
@click="data.form[item.prop] = ''"></i>
</div> </div>
<div v-if="item.type === 'link'" <div v-if="item.type === 'link'" class="flex">
class="flex"> <el-input class="m-r-10" v-model="data.form.link.linkName"></el-input>
<el-input class="m-r-10"
v-model="data.form.link.linkName"></el-input>
<el-button @click="toLink(data.form)">设置链接</el-button> <el-button @click="toLink(data.form)">设置链接</el-button>
</div> </div>
<Editor v-if="item.type === 'editor'" <Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="data.form[item.prop]" :init="editorConfig" />
v-model="data.form[item.prop]"
:init="editorConfig" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form v-else-if="data.type === 'column' || data.type === 'columns'" <el-form v-else-if="data.type === 'column' || data.type === 'columns'" ref="form" :model="data.form"
ref="form" :rules="columnRules" label-width="100px">
:model="data.form" <el-form-item prop="site" label="站点选择">
:rules="columnRules" <el-select v-model="data.form.site" @change="siteChange">
label-width="100px"> <el-option v-for="item in $refs.link.sites" :key="item.id" :label="item.siteName" :value="item.id">
<el-form-item prop="site"
label="站点选择">
<el-select v-model="data.form.site"
@change="siteChange">
<el-option v-for="item in $refs.link.sites"
:key="item.id"
:label="item.siteName"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="column" <el-form-item prop="column" label="关联栏目">
label="关联栏目"> <el-cascader ref="links" v-model="data.form.column" :options="columns" :props="columnProps" clearable
<el-cascader ref="links" @change="columnChange"></el-cascader>
v-model="data.form.column"
:options="columns"
:props="columnProps"
clearable
@change="columnChange"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="文章展示数量"> <el-form-item label="文章展示数量">
<el-select v-model="data.form.articleNum"> <el-select v-model="data.form.articleNum">
<el-option v-for="item in articleNums" <el-option v-for="item in articleNums" :key="item.id" :label="item.name" :value="item.id">
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="栏目标题"> <el-form-item label="栏目标题">
<el-radio v-model="data.form.columnTitle" <el-radio v-model="data.form.columnTitle" :label="1" @change="columnTitleChange">默认读取关联栏目</el-radio>
:label="1"
@change="columnTitleChange">默认读取关联栏目</el-radio>
<div class="radio-wrap"> <div class="radio-wrap">
<el-radio v-model="data.form.columnTitle" <el-radio v-model="data.form.columnTitle" :label="2" @change="columnTitleChange"></el-radio>
:label="2" <el-input v-model="data.form.columnTitleCustom" :disabled="data.form.columnTitle == 1" size="small"
@change="columnTitleChange"></el-radio> maxlength="100"></el-input>
<el-input v-model="data.form.columnTitleCustom"
:disabled="data.form.columnTitle == 1"
size="small"
maxlength="100"></el-input>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template v-else-if="data.type === 'history'"> <template v-else-if="data.type === 'history'">
<el-table class="module-table" <el-table class="module-table" :data="data.list" header-align="center" row-key="id">
:data="data.list" <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
header-align="center" <el-table-column prop="title" label="标题" min-width="140" align="center">
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column prop="title"
label="标题"
min-width="140"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.title" <el-input v-model="scope.row.title" placeholder="请输入" maxlength="100"></el-input>
placeholder="请输入"
maxlength="100"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" width="100" align="center">
width="100"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex a-center"> <div class="flex a-center">
<el-switch v-model="scope.row.isEnable" <el-switch v-model="scope.row.isEnable" :active-value="1" :inactive-value="0">
:active-value="1"
:inactive-value="0">
</el-switch> </el-switch>
<i class="el-icon-edit-outline del" <i class="el-icon-edit-outline del" @click="editHistory(scope.row, scope.$index)"></i>
@click="editHistory(scope.row, scope.$index)"></i> <i class="el-icon-delete del" @click="delRow(data.list, scope.$index)"></i>
<i class="el-icon-delete del"
@click="delRow(data.list, scope.$index)"></i>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="plus"> <div class="plus">
<i class="el-icon-circle-plus-outline" <i class="el-icon-circle-plus-outline" @click="addRow"></i>
@click="addRow"></i>
</div> </div>
</template> </template>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="$emit('update:visible', false)">取消</el-button> <el-button @click="$emit('update:visible', false)">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="moduleSubmit">确定</el-button>
@click="moduleSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<Link ref="link" <Link ref="link" :data.sync="linkForm" :visible.sync="linkVisible" @linkSubmit="linkSubmit" />
:data.sync="linkForm" <Content :data.sync="data" :visible.sync="contentVisible" @contentSubmit="contentSubmit" />
:visible.sync="linkVisible" <History :data.sync="data" :list.sync="historyData" :form.sync="data.form" :visible.sync="historyVisible"
@linkSubmit="linkSubmit" /> @historySubmit="historySubmit" />
<Content :data.sync="data"
:visible.sync="contentVisible"
@contentSubmit="contentSubmit" />
<History :data.sync="data"
:list.sync="historyData"
:form.sync="data.form"
:visible.sync="historyVisible"
@historySubmit="historySubmit" />
<!-- 剪裁组件弹窗 --> <!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" <el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
append-to-body <Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="fixed" :fixedNumber.sync="fixedNumber"
:visible.sync="cropperModel" :autoCropWidth="autoCropWidth" :autoCropHeight="autoCropHeight" :dataType="data.type" @upload="customUpload" />
width="1100px"
:close-on-click-modal="false">
<Cropper ref="cropper"
:img-file.sync="file"
:is-upload="isUpload"
:fixed="fixed"
:fixedNumber.sync="fixedNumber"
:autoCropWidth="autoCropWidth"
:autoCropHeight="autoCropHeight"
@upload="customUpload" />
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -650,11 +528,12 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.radio-wrap { .radio-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
.el-input {
width: 200px; .el-input {
margin-left: -40px; width: 200px;
} margin-left: -40px;
}
} }
</style> </style>

File diff suppressed because it is too large Load Diff

@ -666,7 +666,7 @@ export default {
} }
let url = this.form.columnBanner let url = this.form.columnBanner
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => { }).catch(e => { }) // // url && this.$del(this.api.delFile, Util.rsa([url.split('/').pop()])).then(res => { }).catch(e => { }) //
this.form.columnBanner = data.url this.form.columnBanner = data.url
this.fileId = data.id this.fileId = data.id
}).catch(res => { }) }).catch(res => { })

@ -4,53 +4,52 @@
const isDev = process.env.NODE_ENV === 'development' // 开发环境 const isDev = process.env.NODE_ENV === 'development' // 开发环境
let host = `${location.origin}/` let host = `${location.origin}/`
const Setting = { const Setting = {
/** /**
* 基础配置 * 基础配置
* */ * */
titleSuffix: '粒子研究院', // 网页标题的后缀 titleSuffix: '粒子研究院', // 网页标题的后缀
routerMode: "hash", // 路由模式,可选值为 history 或 hash routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址 apiBaseURL: host, // 接口请求地址
autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间 autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒
errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
tokenExpires: 1296000000, // token在localStorage的时间(毫秒) tokenExpires: 1296000000, // token在localStorage的时间(毫秒)
isDev, isDev,
/** /**
* 路由白名单 * 路由白名单
* */ * */
whiteList: ['/login', '/redirect'], whiteList: ['/login', '/redirect'],
/** /**
* localStorage里保存的token的key * localStorage里保存的token的key
*/ */
tokenKey: "IASF_server_token", tokenKey: "IASF_server_token",
/** /**
* localStorage里保存的vuex的key * localStorage里保存的vuex的key
*/ */
storeKey: "IASF_server_store", storeKey: "IASF_server_store",
/** /**
* 多语言配置 * 多语言配置
* */ * */
i18n: { i18n: {
// 默认语言 // 默认语言
default: "zh", default: "zh",
// 是否根据用户电脑配置自动设置语言(仅第一次有效) // 是否根据用户电脑配置自动设置语言(仅第一次有效)
auto: false auto: false
}, },
/** /**
* 布局配置 * 布局配置
* */ * */
layout: {}, layout: {},
/** /**
* 功能配置 * 功能配置
* */ * */
// 相同路由,不同参数间进行切换,是否强力更新 // 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false, sameRouteForceUpdate: false,
// 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮) // 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮)
dynamicRoute: true, dynamicRoute: true,
publicKey: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA08Nz0zscnWtddmaNylIPt9v5ZO6U6pYyGochRrbpI+ocwoyV4E1uUu3J9/mmR8pyMBcYzE5KkBytlaiLnd6dMqo4R60aihN/TqfuI/03LzgAS/egT/Q4VB9yZSyZCmJhrgTtSX5kxotAbewp0gqsWpi+6BUYDuiwJ0WNlhDVV4FOQIppmvHh0RqYDhjiPNAuy7fEtytT+IY4rxm6LggvmNtIq5k2oLbDxEeI1GOyFHT6sLGMkmBLmHu7JYcrlyUGyGWsxh8hVame1zQsScivrZu757BTGhN4xObTivIdAbR7uFeeX4lp0X1JNtIe9TwB/aZzKJjZMPXeV7BJ01g3MQIDAQAB', publicKey: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA08Nz0zscnWtddmaNylIPt9v5ZO6U6pYyGochRrbpI+ocwoyV4E1uUu3J9/mmR8pyMBcYzE5KkBytlaiLnd6dMqo4R60aihN/TqfuI/03LzgAS/egT/Q4VB9yZSyZCmJhrgTtSX5kxotAbewp0gqsWpi+6BUYDuiwJ0WNlhDVV4FOQIppmvHh0RqYDhjiPNAuy7fEtytT+IY4rxm6LggvmNtIq5k2oLbDxEeI1GOyFHT6sLGMkmBLmHu7JYcrlyUGyGWsxh8hVame1zQsScivrZu757BTGhN4xObTivIdAbR7uFeeX4lp0X1JNtIe9TwB/aZzKJjZMPXeV7BJ01g3MQIDAQAB',
}; };
export default Setting; export default Setting;

Loading…
Cancel
Save