init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
228
Application/Admin/View/Resource/add.html
可执行文件
228
Application/Admin/View/Resource/add.html
可执行文件
@@ -0,0 +1,228 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<!--[1.6.48]-->
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.css">
|
||||
<link rel="stylesheet" href="__PUBLIC__/css/system-gallery.css?v=1.0.3">
|
||||
<script src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/element-ui.js"></script>
|
||||
<script charset="utf-8" src="__PUBLIC__/js/system-gallery.js?v=1.0.3"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/ueditor.config.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/ueditor.all.js"></script>
|
||||
<title>资料添加</title>
|
||||
<style>
|
||||
html, body {
|
||||
background-color: rgb(246, 248, 249);
|
||||
font-size: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.box {
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 5px;
|
||||
background-color: white;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.list > .el-button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
background-color: #f5f5f5;
|
||||
color: black;
|
||||
font-size: 18px;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
line-height: 60px;
|
||||
border-radius: 5px 5px 0 0;
|
||||
text-indent: 15px;
|
||||
}
|
||||
|
||||
.left_name {
|
||||
width: 120px;
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
line-height: 56px;
|
||||
color: #666;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.list > .input_div {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.tips {
|
||||
margin-left: 140px;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="padding: 30px;background-color: white;" id="app" v-cloak>
|
||||
<form id="form">
|
||||
<div class="list">
|
||||
<label class="left_name">资料名称</label>
|
||||
<div class="input_div">
|
||||
<div class="el-input">
|
||||
<input type="text"
|
||||
autocomplete="off"
|
||||
v-model="title"
|
||||
required="required"
|
||||
placeholder="请输入资料名称" class="el-input__inner">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<label class="left_name">资料简介</label>
|
||||
<div class="input_div">
|
||||
<div class="el-input">
|
||||
<input type="text"
|
||||
autocomplete="off"
|
||||
v-model="docuat"
|
||||
required="required"
|
||||
placeholder="请输入资料简介" class="el-input__inner">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list" style="align-items: flex-start;">
|
||||
<label class="left_name">资料图片</label>
|
||||
<div class="el-upload el-upload--picture-card el-upload-list--picture-card upload-img-small-auto"
|
||||
@click="selectImage()">
|
||||
<i v-if="!image" class="el-icon-plus"></i>
|
||||
<img v-else class="el-upload-list__item-thumbnail img-auto" :src="image">
|
||||
</div>
|
||||
<el-button plain size="small" @click="selectImage()">选择图片</el-button>
|
||||
</div>
|
||||
<p class="tips">建议大小(200*200)</p>
|
||||
<div class="list" style="align-items: flex-start;">
|
||||
<label class="left_name">内容</label>
|
||||
<div>
|
||||
<div id="editor" type="text/plain" style="width:600px;height: 400px;" name="content"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center">
|
||||
<el-button type="primary" size="medium" @click="save">保存</el-button>
|
||||
</div>
|
||||
</form>
|
||||
<el-dialog title="选择图片" :modal-append-to-body="false" :visible.sync="showSelectImage" custom-class="select-image-el-dialog"
|
||||
:top="'10px'">
|
||||
<template-select-image :can-select-num="1" @selectfile="selectFile"></template-select-image>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: function () {
|
||||
return {
|
||||
showSelectImage: false,
|
||||
image_id: "{$list['image_id']}",
|
||||
image: "{$list['image']}",
|
||||
title: `{$list['title']}`,
|
||||
docuat: `{$list['docuat']}`,
|
||||
id: "{$list['id']}",
|
||||
content: `{$list['content']}`,
|
||||
ue: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectFile: function (item) {
|
||||
this.showSelectImage = false;
|
||||
if (item.length) {
|
||||
this.image_id = item[0].id;
|
||||
this.image = item[0].path;
|
||||
}
|
||||
},
|
||||
selectImage: function () {
|
||||
this.showSelectImage = true;
|
||||
},
|
||||
save: function () {
|
||||
if (this.title == '' || this.docuat == '' || !this.image_id) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请完善信息',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.$loading({
|
||||
lock: true,
|
||||
text: '保存中,请等待',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(255, 255, 255, 0.7)'
|
||||
});
|
||||
var content = this.ue.getContent();
|
||||
$.ajax({
|
||||
url: "{:U('addResource')}",
|
||||
type: "POST",
|
||||
data: {
|
||||
title: this.title,
|
||||
docuat: this.docuat,
|
||||
image: this.image,
|
||||
image_id: this.image_id,
|
||||
content: content,
|
||||
id: this.id,
|
||||
},
|
||||
success: (res) => {
|
||||
this.$loading().close();
|
||||
if (res.status == 1) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
duration: 1000,
|
||||
onClose: function () {
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
|
||||
parent.layer.close(index); //再执行关闭
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: res.msg,
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
},
|
||||
error: () => {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '出错了!',
|
||||
duration: 1000
|
||||
});
|
||||
this.$loading().close();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
this.ue = UE.getEditor('editor');
|
||||
this.ue.ready(() => {
|
||||
this.ue.setContent(this.content);
|
||||
})
|
||||
},
|
||||
created: function () {
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
<!--[1.5.84]-->
|
||||
<style>
|
||||
table {
|
||||
border: 1px solid #f1f1f1;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.layui-table-cell {
|
||||
height: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em {
|
||||
background-color: #409EFF;
|
||||
}
|
||||
|
||||
.layui-table-page .layui-laypage a:hover, .layui-table-page .layui-laypage span:hover {
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.layui-btn {
|
||||
background-color: transparent;
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.layui-btn-danger {
|
||||
color: #999;
|
||||
}
|
||||
.layui-form-onswitch {
|
||||
border-color: #409EFF;
|
||||
background-color: #409EFF;
|
||||
}
|
||||
</style>
|
||||
<div id="commodity" class="goodsBox" v-cloak>
|
||||
<if condition="$authArr['add'] eq true">
|
||||
<el-button type="primary" size="small" id="add">添加资料</el-button>
|
||||
</if>
|
||||
<table class="layui-hide" id="test" lay-filter="demo"></table>
|
||||
</div>
|
||||
<script type="text/html" id="switchTpl">
|
||||
<if condition="$authArr['upstatus'] eq true">
|
||||
<input type="checkbox" name="status" date-value="{{d.status}}" data-id="{{d.id}}" value="{{d.status}}"
|
||||
lay-skin="switch" lay-text="上架|下架" lay-filter="sexDemo" {{ d.status== 1 ? 'checked' : '' }}>
|
||||
</if>
|
||||
</script>
|
||||
<script type="text/html" id="barDemo">
|
||||
<if condition="$authArr['update'] eq true">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
</if>
|
||||
<if condition="$authArr['delUser'] eq true">
|
||||
<button class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</button>
|
||||
</if>
|
||||
</script>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#commodity',
|
||||
methods: {}
|
||||
})
|
||||
layui.use(['table'], function () {
|
||||
// 日期
|
||||
var form = layui.form;
|
||||
var table = layui.table;
|
||||
//展示已知数据
|
||||
table.render({
|
||||
elem: '#test',
|
||||
url: "{:U('getData')}",
|
||||
method: 'post',
|
||||
cols: [
|
||||
[{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
align: 'center',
|
||||
width: 60
|
||||
}, {
|
||||
field: 'title',
|
||||
title: '资料名称',
|
||||
align: 'center',
|
||||
width: 200
|
||||
}, {
|
||||
field: 'docuat',
|
||||
title: '资料简介',
|
||||
align: 'center',
|
||||
width: 250
|
||||
}, {
|
||||
field: 'image',
|
||||
title: '资料图片',
|
||||
style: 'height:100%;',
|
||||
align: 'center',
|
||||
templet: '<div><img src="{{ d.image}}" style="width: 80px;"></div>',
|
||||
width: 110
|
||||
}, {
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
templet: '#switchTpl',
|
||||
align: 'center',
|
||||
width: 100
|
||||
}, {
|
||||
field: 'content',
|
||||
title: '资料详情',
|
||||
align: 'center',
|
||||
}, {
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
toolbar: '#barDemo',
|
||||
width: 120
|
||||
}]
|
||||
],
|
||||
page: {
|
||||
layout: ['count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
|
||||
}, //是否开启分页
|
||||
});
|
||||
$('#Preservation').click(function () {
|
||||
table.reload('test', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
, where: {
|
||||
keyword: $('#keyword').val()
|
||||
}
|
||||
});
|
||||
});
|
||||
form.on('switch(sexDemo)', function (obj) {
|
||||
console.log($(this).attr('date-value'));
|
||||
this.value = this.value == 1 ? 2 : 1;
|
||||
var status = this.value;
|
||||
var id = $(obj.elem).attr('data-id');
|
||||
// console.log(status);
|
||||
// console.log(id);
|
||||
$.ajax({
|
||||
url: "{:U('upstatus')}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
status: status,
|
||||
id: id
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.status == 1) {
|
||||
top.layer.msg('修改成功', {icon: 1, time: 500})
|
||||
} else {
|
||||
top.layer.msg('修改失败', {icon: 4, time: 500})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
// 删除
|
||||
table.on('tool(demo)', function (obj) {
|
||||
var data = obj.data;
|
||||
var layEvent = obj.event;
|
||||
var tr = obj.tr;
|
||||
|
||||
if (layEvent === 'detail') { //查看
|
||||
//do somehing
|
||||
window.location.href = "{:U('shiftingdetail')}?id=" + data.id;
|
||||
} else if (layEvent === 'del') { //删除
|
||||
layer.confirm('确定删除这个资料吗?', function (index) {
|
||||
layer.close(index);
|
||||
//向服务端发送删除指令
|
||||
$.ajax({
|
||||
url: "{:U('delUser')}",
|
||||
data: {id: data.id},
|
||||
type: 'post',
|
||||
success: function (res) {
|
||||
if (res.status == 1) {
|
||||
obj.del();
|
||||
} else {
|
||||
top.layer.msg(res.msg, {icon: 4, time: 1000})
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
} else if (layEvent === 'edit') { //编辑
|
||||
console.log(data.id);
|
||||
layer.open({
|
||||
type: 2,
|
||||
content: "{:U('add')}?id=" + data.id,
|
||||
title: "编辑资料",
|
||||
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
|
||||
offset: 'rb',
|
||||
shade: 0,
|
||||
btnAlign: 'c',
|
||||
end: function () {
|
||||
table.reload('test', {});
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
$('#add').click(function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
content: "{:U('add')}",
|
||||
title: "添加资料",
|
||||
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
|
||||
offset: 'rb',
|
||||
btnAlign: 'c',
|
||||
shade: 0,
|
||||
end: function () {
|
||||
table.reload('test', {});
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,251 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<!--[1.5.25]-->
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.css">
|
||||
<link rel="stylesheet" href="__PUBLIC__/css/system-gallery.css">
|
||||
<script src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/element-ui.js"></script>
|
||||
<script charset="utf-8" src="__PUBLIC__/js/system-gallery.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/ueditor.config.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/UEditor/ueditor.all.js"></script>
|
||||
<title>资料修改</title>
|
||||
<style>
|
||||
html, body {
|
||||
background-color: rgb(246, 248, 249);
|
||||
font-size: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.box {
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 5px;
|
||||
background-color: white;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.list > .el-button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
background-color: #f5f5f5;
|
||||
color: black;
|
||||
font-size: 18px;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
line-height: 60px;
|
||||
border-radius: 5px 5px 0 0;
|
||||
text-indent: 15px;
|
||||
}
|
||||
|
||||
.left_name {
|
||||
width: 120px;
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
line-height: 56px;
|
||||
color: #666;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.list > .input_div {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.tips {
|
||||
margin-left: 140px;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="padding: 30px;background-color: white" id="app" v-cloak>
|
||||
<form class="layui-form" id="form">
|
||||
<input type="hidden" name="id" value="{$list['id']}">
|
||||
<div class="list">
|
||||
<label class="left_name">资料名称</label>
|
||||
<div class="input_div">
|
||||
<div class="el-input">
|
||||
<input type="text"
|
||||
name="title"
|
||||
value="{$list['title']}"
|
||||
required="required"
|
||||
placeholder="请输入资料名称" class="el-input__inner">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<label class="left_name">资料简介</label>
|
||||
<div class="input_div">
|
||||
<div class="el-input">
|
||||
<input type="text"
|
||||
name="docuat"
|
||||
value="{$list['docuat']}"
|
||||
required="required"
|
||||
placeholder="请输入资料简介" class="el-input__inner">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list" style="align-items: flex-start;">
|
||||
<label class="left_name">资料图片</label>
|
||||
<label class="file_label">
|
||||
<input type="hidden" name="image_id" value="{$list['image_id']}"/>
|
||||
<input type="file" name="image"
|
||||
placeholder="选择图片" accept="image/png,image/jpeg"/>
|
||||
<img src="{$list['image']}"
|
||||
onerror="this.onerror=null;this.src='__PUBLIC__/paper/images/wx_add.png'">
|
||||
</label>
|
||||
<el-button plain size="small" @click="selectImage('image')"
|
||||
>图库图片
|
||||
<el-tooltip class="item" effect="dark" content="点击图片选择本地图片,点击按钮选择图库图片" placement="top-start">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</el-button>
|
||||
</div>
|
||||
<p class="tips">建议大小(200*200)</p>
|
||||
|
||||
<div class="list" style="align-items: flex-start">
|
||||
<label class="left_name">内容</label>
|
||||
<div>
|
||||
<div id="editor" type="text/plain" style="width:600px;height: 400px;" name="content">
|
||||
{$list['content']}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center">
|
||||
<el-button type="primary" size="medium" @click="save">保存</el-button>
|
||||
</div>
|
||||
</form>
|
||||
<el-dialog title="选择图片" :visible.sync="showSelectImage" custom-class="select-image-el-dialog"
|
||||
:top="'10px'">
|
||||
<template-select-image :can-select-num="1" @selectfile="selectFile"></template-select-image>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: function () {
|
||||
return {
|
||||
showSelectImage: false,
|
||||
actFileName: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectFile: function (item) {
|
||||
//console.log(item[0]['id']);
|
||||
this.showSelectImage = false;
|
||||
if (item.length) {
|
||||
$("input[name='" + this.actFileName + "']").val('');
|
||||
$("input[name='" + this.actFileName + "_id']").val(item[0].id);
|
||||
$("input[name='" + this.actFileName + "']").next('img').attr('src', item[0].path);
|
||||
}
|
||||
},
|
||||
selectImage: function (actName) {
|
||||
this.actFileName = actName;
|
||||
this.showSelectImage = true;
|
||||
},
|
||||
save: function () {
|
||||
var name = $("input[name='title']").val();
|
||||
var docuat = $("input[name='docuat']").val();
|
||||
var image_id = $("input[name='image_id']").val();
|
||||
var image = $("input[name='image']").val() || $("input[name='image']").attr('d-value');
|
||||
|
||||
if (name == '' || docuat == '' || (!image_id && !image)) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请完善信息',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var fd = new FormData(document.getElementById('form'));
|
||||
var that = this;
|
||||
this.$loading({
|
||||
lock: true,
|
||||
text: '保存中,请等待',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(255, 255, 255, 0.7)'
|
||||
});
|
||||
$.ajax({
|
||||
url: "{:U('editResource')}",
|
||||
type: "POST",
|
||||
data: fd,
|
||||
processData: false, // jQuery不要去处理发送的数据
|
||||
contentType: false, // jQuery不要去设置Content-Type请求头
|
||||
success: function (res) {
|
||||
that.$loading().close();
|
||||
if (res.status == 1) {
|
||||
that.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
duration: 1000,
|
||||
onClose: function () {
|
||||
$("input[name='file']").val('');
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.$message({
|
||||
type: 'error',
|
||||
message: res.msg,
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
that.$message({
|
||||
type: 'error',
|
||||
message: '出错了!',
|
||||
duration: 1000
|
||||
});
|
||||
that.$loading().close();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
$("input[type='file']").on('change', function () {
|
||||
if (this.files.length) {
|
||||
var that = this;
|
||||
var imgObj = this.files[0];
|
||||
var imgType = ['image/jpeg', 'image/jpg', 'image/png'];
|
||||
if (jQuery.inArray(imgObj.type, imgType) != -1) {
|
||||
//是图片
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(imgObj);
|
||||
reader.onload = function () {
|
||||
$(that).next('img').attr('src', this.result);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
created: function () {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var ue = UE.getEditor('editor');
|
||||
// var html = ue.getContent();
|
||||
</script>
|
||||
</html>
|
||||
在新工单中引用
屏蔽一个用户