真实进度条+手机号校验

This commit is contained in:
2024-03-14 13:04:07 +08:00
parent e9e5edb52f
commit d38bb5f604
5 changed files with 2244 additions and 286 deletions

View File

@@ -1,10 +1,12 @@
<script type="text/javascript"> <script type="text/javascript">
const baseUrl = 'http://59.110.212.44:9100/pb' const baseUrl = "http://192.168.110.100:9200/pb"//张川川后端
// function commonFun() { // const baseUrl = 'http://59.110.212.44:9100/pb'
// console.log("公共方法") // const baseUrl = 'https://testapi.nuttyreading.com'
// } // function commonFun() {
export default { // console.log("公共方法")
baseUrl // }
//commonFun export default {
} baseUrl,
//commonFun
};
</script> </script>

View File

@@ -1,9 +1,23 @@
<template> <template>
<div class="mod-config-wmzg"> <div class="mod-config-wmzg">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<el-form-item label="分类"> <el-form-item label="分类">
<el-select v-model="dataForm.dictType" placeholder="请选择分类" clearable @clear="clearValue"> <el-select
<el-option v-for="(item,index) in typeList" :key="index" :label="item.dictValue" :value="item.dictType"> v-model="dataForm.dictType"
placeholder="请选择分类"
clearable
@clear="clearValue"
>
<el-option
v-for="(item, index) in typeList"
:key="index"
:label="item.dictValue"
:value="item.dictType"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -11,11 +25,27 @@
<el-input v-model="dataForm.ligthname" placeholder="请输入名称" clearable></el-input> <el-input v-model="dataForm.ligthname" placeholder="请输入名称" clearable></el-input>
</el-form-item> --> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button @click="pageIndex = 1;getDataList()">查询</el-button> <el-button
<el-button v-if="isAuth('book:shopproduct:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> @click="
pageIndex = 1;
getDataList();
"
>查询</el-button
>
<el-button
v-if="isAuth('book:shopproduct:save')"
type="primary"
@click="addOrUpdateHandle()"
>新增</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="dataList" border v-loading="dataListLoading" style="width: 100%;"> <el-table
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%"
>
<el-table-column header-align="center" align="center" label="分类"> <el-table-column header-align="center" align="center" label="分类">
<template slot-scope="scope"> <template slot-scope="scope">
{{ filterAA(scope.row.type) }} {{ filterAA(scope.row.type) }}
@@ -23,16 +53,24 @@
</el-table-column> </el-table-column>
<el-table-column label="名称" align="center"> <el-table-column label="名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.type == 1 || scope.row.type == 2">{{ scope.row.name }}</div> <div v-if="scope.row.type == 1 || scope.row.type == 2">
{{ scope.row.name }}
</div>
<div v-if="scope.row.type == 3">{{ scope.row.name }}</div> <div v-if="scope.row.type == 3">{{ scope.row.name }}</div>
<!-- <img v-if="scope.row.type == 3" :src="scope.row.url" alt="" style="width:70px;height:100px" /> --> <!-- <img v-if="scope.row.type == 3" :src="scope.row.url" alt="" style="width:70px;height:100px" /> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="资源url" align="center"> <el-table-column label="资源url" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<a v-if="scope.row.type == 1 || scope.row.type == 2" :href="scope.row.url" <a
target="_blank">{{ scope.row.url }}</a> v-if="scope.row.type == 1 || scope.row.type == 2"
<a v-if="scope.row.type == 3" :href="scope.row.url" target="_blank">{{ scope.row.url }}</a> :href="scope.row.url"
target="_blank"
>{{ scope.row.url }}</a
>
<a v-if="scope.row.type == 3" :href="scope.row.url" target="_blank">{{
scope.row.url
}}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="排序" align="center" width="50"> <el-table-column label="排序" align="center" width="50">
@@ -40,32 +78,75 @@
{{ scope.row.sort }} {{ scope.row.sort }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作"> <el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="editOrUpdateHandle(scope.row)">修改</el-button> <el-button
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> type="text"
size="small"
@click="editOrUpdateHandle(scope.row)"
>修改</el-button
>
<el-button
type="text"
size="small"
@click="deleteHandle(scope.row.id)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage" @size-change="sizeChangeHandle"
layout="total, sizes, prev, pager, next, jumper"> @current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<el-dialog :visible.sync="addOrUpdateVisible" :close-on-click-modal="false" :append-to-body="true" :title="titlesub" <el-dialog
width="50%" @close="cancleClose"> :visible.sync="addOrUpdateVisible"
<el-form :inline="true" :model="addForm" ref="addFormRef" :rules="addFormRule" class="dialog-wmzg"> :close-on-click-modal="false"
:append-to-body="true"
:title="titlesub"
width="50%"
@close="cancleClose"
>
<el-form
:inline="true"
:model="addForm"
ref="addFormRef"
:rules="addFormRule"
class="dialog-wmzg"
>
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-form-item label="分类" prop="type" label-width="100px"> <el-form-item label="分类" prop="type" label-width="100px">
<el-select v-model="addForm.type" placeholder="请选择分类" style="width: 500px;"> <el-select
<el-option v-for="(item,index) in typeList" :key="index" :label="item.dictValue" :value="item.dictType"> v-model="addForm.type"
placeholder="请选择分类"
style="width: 500px"
>
<el-option
v-for="(item, index) in typeList"
:key="index"
:label="item.dictValue"
:value="item.dictType"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-form-item label="名称" prop="name" label-width="100px"> <el-form-item label="名称" prop="name" label-width="100px">
<el-input style="width:500px" v-model="addForm.name"></el-input> <el-input style="width: 500px" v-model="addForm.name"></el-input>
</el-form-item> </el-form-item>
</el-row> </el-row>
<!-- <el-row type="flex" justify="center"> <!-- <el-row type="flex" justify="center">
@@ -75,11 +156,35 @@
</el-row> --> </el-row> -->
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-form-item label="资源文件" label-width="100px"> <el-form-item label="资源文件" label-width="100px">
<el-upload :limit="1" class="el-uploadfeng " ref="files" :action="baseUrl + '/oss/fileoss'" <el-upload
:on-preview="handlePictureCardPreview" :file-list="fileList" :on-success="handlePicSuccess" :limit="1"
accept=".mp3,.mp4,.gif,.png,.jpg,.mpeg,.mpg" :on-remove="handleRemove"> :on-preview="handlePictureCardPreview"
<i class="el-icon-plus"></i> class="el-uploadfeng"
ref="files"
action="#"
:file-list="fileList"
:before-upload="beforeAvatarUpload"
:on-change="changeData"
accept=".mp3,.mp4,.gif,.png,.jpg,.mpeg,.mpg"
:http-request="handleRequest"
:before-remove="handleBeforeRemove"
:on-remove="handleRemove"
>
<!-- <el-button class="btn upload-btn">上传附件</el-button> -->
<i
class="el-icon-plus"
v-if="fileList.length == 0 && !isUpload"
></i>
</el-upload> </el-upload>
<div class="newpro">
<el-progress
v-if="isUpload"
:stroke-width="10"
:percentage="progressPercent"
style="width: 100%"
></el-progress>
</div>
<!-- <el-dialog :visible.sync="dialogVisible" :append-to-body="true"> <!-- <el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<video width="100%" :src="addForm.url" alt=""> <video width="100%" :src="addForm.url" alt="">
<video controls width="250" v-if="dataForm.video != ''"> <video controls width="250" v-if="dataForm.video != ''">
@@ -88,9 +193,45 @@
</el-dialog> --> </el-dialog> -->
</el-form-item> </el-form-item>
</el-row> </el-row>
<!-- <el-row type="flex" justify="center">
<el-form-item label="资源文件" label-width="100px">
<el-upload
:limit="1"
class="el-uploadfeng"
ref="files"
:action="baseUrl + '/oss/fileoss'"
:on-preview="handlePictureCardPreview"
:file-list="fileList"
:on-success="handlePicSuccess"
accept=".mp3,.mp4,.gif,.png,.jpg,.mpeg,.mpg"
:on-remove="handleRemove"
:on-progress="onProgress"
>
<i class="el-icon-plus"></i>
</el-upload>
<div v-if="isShowJinDuTiao" class="bacc">
<div class="jindutiao">
<el-progress
type="circle"
:percentage="curPercentage"
:width="80"
class="progressCircle"
></el-progress>
</div>
</div>
</el-form-item>
</el-row> -->
<!-- <el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<video width="100%" :src="addForm.url" alt="">
<video controls width="250" v-if="dataForm.video != ''">
<source :src="dataForm.video" type="video/mp4" />
</video>
</el-dialog> -->
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-form-item label="排序" label-width="48px"> <el-form-item label="排序" label-width="48px">
<el-input style="width:500px" v-model="addForm.sort"></el-input> <el-input style="width: 500px" v-model="addForm.sort"></el-input>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
@@ -105,270 +246,447 @@
</div> </div>
</template> </template>
<script> <script>
import global from '../../common/common.vue' //引入共用组间 import global from "../../common/common.vue"; //引入共用组间
export default { import axios from "axios";
data() { export default {
return { data() {
baseUrl: global.baseUrl, return {
typeList: [{ uploadTimer: null,
dictValue: '吴门之歌', isUpload: false,
dictType: '1', isShowJinDuTiao: false,
}, { progressPercent: 0,
dictValue: '巴山夜语', curPercentage: 0,
dictType: '2', baseUrl: global.baseUrl,
}, { typeList: [
dictValue: '吴门之徽', {
dictType: '3', dictValue: "吴门之歌",
}], //类型列表 dictType: "1",
booknameList: [],
dataForm: {
dictType: '', //分类
// ligthname: '',//书名
}, },
addForm: { {
"id": '', //新增不传 dictValue: "巴山夜语",
"name": '', dictType: "2",
"type": '',
"url": '',
"sort": 0
}, },
editId: '', {
addFormRule: { dictValue: "吴门之徽",
typeId: [{ dictType: "3",
},
], //类型列表
booknameList: [],
dataForm: {
dictType: "", //分类
// ligthname: '',//书名
},
addForm: {
id: "", //新增不传
name: "",
type: "",
url: "",
sort: 0,
},
editId: "",
addFormRule: {
typeId: [
{
required: true, required: true,
message: "请选择分类" message: "请选择分类",
}], },
bookId: [{ ],
bookId: [
{
required: true, required: true,
message: "请选择书名" message: "请选择书名",
}] },
}, ],
dataList: [], },
// publishStatus: false, dataList: [],
pageIndex: 1, // publishStatus: false,
pageSize: 10, pageIndex: 1,
totalPage: 0, pageSize: 10,
dataListLoading: false, totalPage: 0,
dataListSelections: [], dataListLoading: false,
addOrUpdateVisible: false, dataListSelections: [],
bookIds: [], addOrUpdateVisible: false,
titlesub: '新增', bookIds: [],
fileList: [], titlesub: "新增",
fileList: [],
requestCancelQueue: [], // 请求方法队列(调用取消上传
currentFile: {},
};
},
watch: {
isUpload: {
handler(val, oldVal) {
if (this.isUpload) {
this.uploadTimer = setInterval(async () => {
//需要定时执行的代码
this.progressPercent = await this.getProgress(this.currentFile);
}, 1000);
} else {
//this.uploadTimer = null;
clearInterval(this.uploadTimer);
this.currentFile = {};
}
// this.getGoodsTypeList()
},
deep: true,
},
},
components: {
// AddOrUpdate,
// chooseBook
},
activated() {
// this.gettypeList()
this.getDataList();
},
methods: {
beforeAvatarUpload(file, fileList) {
console.log(file, 99999999999999);
// this.fileList = fileList;
},
changeData(file, fileList) {
// 数据小于0.1M的时候按KB显示
const size =
file.size / 1024 / 1024 > 0.1
? `(${(file.size / 1024 / 1024).toFixed(1)}M)`
: `(${(file.size / 1024).toFixed(1)}KB)`;
file.name.indexOf("M") > -1 || file.name.indexOf("KB") > -1
? file.name
: (file.name += size);
},
async getProgress(file) {
var that = this;
console.log("🚀 ~ handleRequest ~ data222:", file.uid);
var progress = 0;
// const config = {
// onUploadProgress: (progressEvent) => {
// // progressEvent.loaded:已上传文件大小
// // progressEvent.total:被上传文件的总大小
// this.progressPercent = Number(
// ((progressEvent.loaded / progressEvent.total) * 100).toFixed(2)
// );
// },
// };
await axios
.get(this.$http.adornUrl(`/oss/fileoss/getSchedule?uid=${file.uid}`))
.then(async (res) => {
console.log("🚀 ~ this.$axios.post ~ res999:", res.data.percent);
progress = Number(res.data.percent);
if (progress == 100) {
this.isUpload = false;
clearInterval(this.uploadTimer);
that.uploadTimer = null;
await that.handlePicSuccess(res.data, file);
this.currentFile = {};
this.$forceUpdate();
}
});
console.log("🚀 ~ .then ~ progress888:", progress);
return progress;
},
handleRequest(option) {
var that = this;
const { onProgress, onSuccess, onError } = option;
this.progressPercent = 0;
this.currentFile = option.file;
let formdata = new FormData();
formdata.append("file", option.file);
formdata.append("fileName", option.file.fileNamee);
formdata.append("uid", option.file.uid);
console.log("🚀 ~ handleRequest ~ formdata:", formdata);
this.isUpload = true;
axios
.post(this.baseUrl + "/oss/fileoss/uploadFileSchedule", formdata)
.then((res) => {
console.log("🚀 ~ this.$axios.post ~ res111:", res);
if (res.data.code == 0) {
that.fileList[that.fileList.length - 1].status = "done";
// clearInterval(that.uploadTimer);
// that.isUpload = false;
// that.currentFile = {};
// await that.handlePicSuccess(res.data, data.file);
onSuccess();
} else {
that.fileList[that.fileList.length - 1].ststus = "error";
onError();
}
});
// var prom = new Promise((resolve, reject) => {});
// prom.abort = () => {};
// return prom;
},
// 文件上传时的钩子函数,获取上传进度
onProgress(event, file, fileList) {
console.log("🚀 ~ onProgress ~ event:", event);
let num = ((event.loaded / event.total) * 100) | 0; //百分比
this.curPercentage = num;
if (this.curPercentage == 100) {
//当文件上传完成后,关闭进度条
this.isShowJinDuTiao = false;
this.curPercentage = 0;
} }
}, },
components: { clearValue(val) {
// AddOrUpdate, this.dataForm.dictType = "";
// chooseBook
}, },
activated() { // 获取数据列表
// this.gettypeList() getDataList() {
this.getDataList() this.dataListLoading = true;
this.$http({
url: this.$http.adornUrl("/book/medicaldes/lightListByPage"),
method: "post",
data: this.$http.adornData({
type: this.dataForm.dictType,
name: this.dataForm.ligthname,
current: this.pageIndex,
limit: this.pageSize,
}),
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.result.records;
this.totalPage = data.result.total;
} else {
this.dataList = [];
this.totalPage = 0;
}
this.dataListLoading = false;
});
}, },
methods: { getbookname() {
clearValue(val) {
this.dataForm.dictType = '';
},
// 获取数据列表 // 获取数据列表
getDataList() { this.$http({
this.dataListLoading = true url: this.$http.adornUrl("/book/book/list"),
this.$http({ method: "get",
url: this.$http.adornUrl('/book/medicaldes/lightListByPage'), params: this.$http.adornParams({
method: 'post', page: 1,
data: this.$http.adornData({ limit: 1000000,
"type": this.dataForm.dictType, bookName: "",
"name": this.dataForm.ligthname, publisherName: "",
"current": this.pageIndex, authorName: "",
"limit": this.pageSize }),
}) }).then(({ data }) => {
}).then(({ if (data && data.code === 0) {
data this.booknameList = data.page.list;
}) => {
if (data && data.code === 0) {
this.dataList = data.result.records
this.totalPage = data.result.total
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
getbookname() {
// 获取数据列表
this.$http({
url: this.$http.adornUrl('/book/book/list'),
method: 'get',
params: this.$http.adornParams({
'page': 1,
'limit': 1000000,
'bookName': '',
'publisherName': '',
'authorName': ''
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.booknameList = data.page.list
} else {
this.booknameList = []
}
})
},
filterAA(val) {
if (val == 1) {
return '吴门之歌'
} else if (val == 2) {
return '巴山夜语'
} else { } else {
return '吴门之徽' this.booknameList = [];
}
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val
},
// 新增 / 修改
editOrUpdateHandle(row) {
console.log(row)
this.titlesub = '修改'
// this.getbookname()
this.editId = row.id
this.addForm.name = row.name
this.addForm.type = row.type.toString()
this.addForm.url = row.url
this.addForm.sort = row.sort
this.fileList = []
var img = {
name: row.url,
url: row.url
}
var attr = []
attr.push(img)
if (attr[0].url != '') {
this.fileList = attr
} }
});
},
filterAA(val) {
if (val == 1) {
return "吴门之歌";
} else if (val == 2) {
return "巴山夜语";
} else {
return "吴门之徽";
}
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val;
},
// 新增 / 修改
editOrUpdateHandle(row) {
console.log(row);
this.titlesub = "修改";
// this.getbookname()
this.editId = row.id;
this.addForm.name = row.name;
this.addForm.type = row.type.toString();
this.addForm.url = row.url;
this.addForm.sort = row.sort;
this.fileList = [];
var img = {
name: row.url,
url: row.url,
};
var attr = [];
attr.push(img);
if (attr[0].url != "") {
this.fileList = attr;
}
console.log('this.fileList', this.fileList); console.log("this.fileList", this.fileList);
this.addOrUpdateVisible = true this.addOrUpdateVisible = true;
},
addOrUpdateHandle() {
// this.getbookname()
this.editId = "";
this.titlesub = "新增";
this.addOrUpdateVisible = true;
},
cancleClose() {
this.addOrUpdateVisible = false;
this.isUpload = false;
this.currentFile = {};
//this.uploadTimer = null;
clearInterval(this.uploadTimer);
this.$forceUpdate();
this.$refs["addFormRef"].resetFields();
this.addForm = {
id: "", //新增不传
name: "",
type: "",
url: "",
sort: 0,
};
}, this.fileList = [];
addOrUpdateHandle() { },
// this.getbookname() // 删除
this.editId = '' deleteHandle(id) {
this.titlesub = '新增' this.$confirm("请确认是否删除?", "提示", {
this.addOrUpdateVisible = true confirmButtonText: "确定",
}, cancelButtonText: "取消",
cancleClose() { type: "warning",
this.addOrUpdateVisible = false }).then(() => {
this.$refs["addFormRef"].resetFields(); this.$http({
this.addForm = { url: this.$http.adornUrl(`/book/medicaldes/delLight?id=${id}`),
"id": '', //新增不传 method: "post",
"name": '', }).then(({ data }) => {
"type": '', if (data && data.code === 0) {
"url": '', this.$message({
"sort": 0 message: "操作成功",
} type: "success",
duration: 1500,
this.fileList = [] onClose: () => {
}, this.getDataList();
// 删除 },
deleteHandle(id) { });
this.$confirm('请确认是否删除?', '提示', { } else {
confirmButtonText: '确定', this.$message.error(data.msg);
cancelButtonText: '取消', }
type: 'warning' });
}).then(() => { });
},
addOreEditCate() {
this.$refs["addFormRef"].validate((valid) => {
if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/book/medicaldes/delLight?id=${id}`), url: this.$http.adornUrl("/book/medicaldes/saveOrUpdateLight"),
method: 'post', method: "post",
}).then(({ data: this.$http.adornData({
data id: this.editId, //新增不传
}) => { name: this.addForm.name,
type: this.addForm.type,
url: this.addForm.url,
sort: this.addForm.sort,
}),
}).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message.success("成功");
message: '操作成功', this.addOrUpdateVisible = false;
type: 'success', this.getDataList();
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else { } else {
this.$message.error(data.msg) this.$message.error("失败");
} }
}) });
})
},
addOreEditCate() {
this.$refs["addFormRef"].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/book/medicaldes/saveOrUpdateLight'),
method: 'post',
data: this.$http.adornData({
"id": this.editId, //新增不传
"name": this.addForm.name,
"type": this.addForm.type,
"url": this.addForm.url,
"sort": this.addForm.sort
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message.success("成功");
this.addOrUpdateVisible = false
this.getDataList()
} else {
this.$message.error("失败");
}
})
}
})
},
handlePictureCardPreview(file) {
this.addForm.url = file.url;
this.dialogVisible = true;
},
handlePicSuccess(res, file) {
if (res.msg == "success") {
this.addForm.url = res.url;
this.fileList.push({
name: file.name,
url: res.url
})
this.$message.success("上传成功");
} else {
this.$message.error("上传失败");
} }
}, });
handleRemove(file, fileList) { },
this.addForm.url = ''; handlePictureCardPreview(file) {
this.fileList = fileList this.addForm.url = file.url;
// this.addForm.noneBtnImg = fileList.length >= this.addForm.limitCountImg; this.dialogVisible = true;
}, },
} handlePicSuccess(res, file) {
} console.log(res, file, "999999999");
if (res.msg == "success") {
this.addForm.url = res.url;
this.fileList.push({
name: file.name,
url: res.url,
});
this.$message.success("上传成功");
this.isUpload = false;
} else {
this.$message.error("上传失败");
}
},
handleBeforeRemove(file, fileList) {
console.log(file, fileList, "file, fileListfile, fileListfile, fileList");
this.$refs.files.clearFiles();
clearInterval(this.uploadTimer);
this.isUpload = false;
this.currentFile = {};
this.$forceUpdate();
},
handleRemove(file, fileList) {
this.addForm.url = "";
this.fileList = fileList;
//this.uploadTimer = null;
clearInterval(this.uploadTimer);
this.isUpload = false;
this.currentFile = {};
this.$forceUpdate();
// this.addForm.noneBtnImg = fileList.length >= this.addForm.limitCountImg;
},
},
beforeDestroy() {
clearInterval(this.uploadTimer);
},
};
</script> </script>
<style lang="less"> <style lang="less">
.dialog-wmzg { .dialog-wmzg {
.el-upload-list__item-name { .el-upload-list__item-name {
max-width: 450px; max-width: 450px;
}
} }
}
.newpro .el-progress-bar__inner:before {
content: "";
width: 100%;
height: 100%;
display: block;
background-image: repeating-linear-gradient(
-45deg,
hsla(0, 0%, 100%, 0.15) 25%,
transparent 0,
transparent 50%,
hsla(0, 0%, 100%, 0.15) 0,
hsla(0, 0%, 100%, 0.15) 75%,
transparent 0,
transparent
);
background-size: 40px 40px;
animation: mymove 2s linear infinite;
}
@keyframes mymove {
0% {
background-position: 0;
}
25% {
background-position: 50px;
}
50% {
background-position: 100px;
}
75% {
background-position: 150px;
}
100% {
background-position: 200px;
}
}
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@@ -251,7 +251,7 @@
} }
if (this.dataForm.tel) { if (this.dataForm.tel) {
if (/^1[34578]\d{9}$/.test(this.dataForm.tel) == false) { if (/^1[3456789]\d{9}$/.test(this.dataForm.tel) == false) {
this.$message.error("手机格式错误!") this.$message.error("手机格式错误!")
return return
} }

View File

@@ -1,20 +1,20 @@
/** /**
* 开发环境 * 开发环境
*/ */
;(function () { ; (function () {
window.SITE_CONFIG = {}; window.SITE_CONFIG = {};
// api接口请求地址 // api接口请求地址
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';//张川川
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb'; // window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境 // window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境11
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境 // window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb'; // window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb'; // window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; // window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';
// cdn地址 = 域名 + 版本号 // cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名 window.SITE_CONFIG['domain'] = './'; // 域名
window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分) window.SITE_CONFIG['version'] = ''; // 版本号(年月日时分)
window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version; window.SITE_CONFIG['cdnUrl'] = window.SITE_CONFIG.domain + window.SITE_CONFIG.version;
})(); })();