Commit 5461329a by 无尘

fix: 修改到期通知接口

parent 0b3a5407
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>好办管理平台</title><link rel=stylesheet type=text/css href=//web-1251519181.file.myqcloud.com/custom-element/custom-element.1.0.28.css><link href=./static/css/app.66c37f4659681302c899c7963d2983ea.css rel=stylesheet></head><body style="min-width: 1400px;" class=damolish><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.f08a59776706f3d592d9.js></script><script type=text/javascript src=./static/js/vendor.ec5b5af1da21f97836b5.js></script><script type=text/javascript src=./static/js/app.9050cc7bce600b440a35.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./favicon.ico><title>好办管理平台</title><link rel=stylesheet type=text/css href=//web-1251519181.file.myqcloud.com/custom-element/custom-element.1.0.28.css><link href=./static/css/app.da76693280c4bde39f3cefb473f0439a.css rel=stylesheet></head><body style="min-width: 1400px;" class=damolish><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.6.6/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script>// Raven.config('https://3715a345910d4c768e7a1ec14619c2d5@sentry.io/1413672').install();</script><script type=text/javascript src=./static/js/manifest.873a5b7227e72fee73bb.js></script><script type=text/javascript src=./static/js/vendor.ec5b5af1da21f97836b5.js></script><script type=text/javascript src=./static/js/app.9050cc7bce600b440a35.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var a=window.webpackJsonp;window.webpackJsonp=function(c,d,n){for(var r,t,o,i=0,u=[];i<c.length;i++)t=c[i],f[t]&&u.push(f[t][0]),f[t]=0;for(r in d)Object.prototype.hasOwnProperty.call(d,r)&&(e[r]=d[r]);for(a&&a(c,d,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=b(b.s=n[i]);return o};var c={},f={76:0};function b(a){if(c[a])return c[a].exports;var f=c[a]={i:a,l:!1,exports:{}};return e[a].call(f.exports,f,f.exports,b),f.l=!0,f.exports}b.e=function(e){var a=f[e];if(0===a)return new Promise(function(e){e()});if(a)return a[2];var c=new Promise(function(c,b){a=f[e]=[c,b]});a[2]=c;var d=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,b.nc&&n.setAttribute("nonce",b.nc),n.src=b.p+"static/js/"+e+"."+{0:"b34ffb148c94a0864421",1:"06c4e42e62c1f75191f0",2:"95860c596ce8eeb79301",3:"2a63ebede4a53ae4d5be",4:"ea860f9a8ab9be4f35fa",5:"bf21cfa1832c94ed8d4c",6:"1ee20592ac6e728657a7",7:"ece0a2d210892b176e55",8:"7d0a8e6532c58d0c2415",9:"ea31d337331fea67d62b",10:"62eecd9e2e85ea911ebd",11:"59c87174f09911b8256b",12:"e8cd784bf481f550c766",13:"2ccd52bd6e1150f23c90",14:"0225e369d82f24077aba",15:"300b3fb9e6b3afc5f862",16:"d6f21b5db0ef31d13e0f",17:"ebf1847c50132c6f96a7",18:"7fa0be27d3ea523f8826",19:"63ca1f785b71646ef739",20:"96ae1c7fff93072fa000",21:"b9552ac568217b38c707",22:"a3681c6a337ad49aeb4b",23:"e507c496e766217ec178",24:"a89c78a7ed5ce6306ba7",25:"d9ee9041561602fa561c",26:"0e68f81c2d32fec5abdb",27:"01b66b3d0ab23d2341c2",28:"8606cc4adb654d067bac",29:"485d7c81ce188c3fa687",30:"6e3dad3ed142df770d0e",31:"963d650c22609bb350cc",32:"648e00249c751be0ef72",33:"3b19f619921aacfda1e4",34:"b57b41292517a536addb",35:"8a132ad30fce01f4deb7",36:"ae95aada03220eb5550d",37:"5dc35c4db0da65b72ba3",38:"67c2ba02c8cb8e2aeae7",39:"cffc9df02e23624f15f7",40:"f72c24c69c3d22cb365f",41:"3e80f7c7164f36ab833d",42:"9cfba776561a2683e1ce",43:"491cbc97f03e6a9416fd",44:"9a001dcb0b20412481a9",45:"7d07ad63ee1aebc77c05",46:"64a15dd24ae8e3144031",47:"46097b0db930f8998e25",48:"bf0f43e67bca163a8825",49:"db237966421b9efea688",50:"f22cbf7598ba1005cbcc",51:"6a01d92850fef1ae9c8d",52:"6e6e1e27f98a4fa5c52d",53:"76cc13b40c7878ec1850",54:"44d3c12a2724e5586b88",55:"62d7e11a79d40049fabc",56:"24e726ce5fe347c611e6",57:"faf962e39bfd0f4ffda9",58:"d3ebf67ef88c937fdaab",59:"db51a7f4c51421d4f9bc",60:"ff78f7652091a35782ec",61:"e84c616b76d09228b6fe",62:"cd195beac77b18e065fb",63:"2983ad835122fb0d5ae5",64:"2e546d02be42fac0c64d",65:"11f52cad03275c8aba4f",66:"9fa3ca5124aa2b5a85ec",67:"fe28b5cd6347bad40117",68:"7c8716b3ed26ffda11fb",69:"18f0e63b47a729fc63d0",70:"b999d4bf8b805f03bd2b",71:"d19b0a20ea22d410b91d",72:"ae171a4233296a9ac4b4",73:"0c069b06ad167faadfc6"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var a=f[e];0!==a&&(a&&a[1](new Error("Loading chunk "+e+" failed.")),f[e]=void 0)}return n.onerror=n.onload=t,d.appendChild(n),c},b.m=e,b.c=c,b.d=function(e,a,c){b.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:c})},b.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(a,"a",a),a},b.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},b.p="./",b.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var a=window.webpackJsonp;window.webpackJsonp=function(c,d,n){for(var r,t,o,i=0,u=[];i<c.length;i++)t=c[i],f[t]&&u.push(f[t][0]),f[t]=0;for(r in d)Object.prototype.hasOwnProperty.call(d,r)&&(e[r]=d[r]);for(a&&a(c,d,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=b(b.s=n[i]);return o};var c={},f={76:0};function b(a){if(c[a])return c[a].exports;var f=c[a]={i:a,l:!1,exports:{}};return e[a].call(f.exports,f,f.exports,b),f.l=!0,f.exports}b.e=function(e){var a=f[e];if(0===a)return new Promise(function(e){e()});if(a)return a[2];var c=new Promise(function(c,b){a=f[e]=[c,b]});a[2]=c;var d=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,b.nc&&n.setAttribute("nonce",b.nc),n.src=b.p+"static/js/"+e+"."+{0:"b34ffb148c94a0864421",1:"06c4e42e62c1f75191f0",2:"95860c596ce8eeb79301",3:"2a63ebede4a53ae4d5be",4:"ea860f9a8ab9be4f35fa",5:"bf21cfa1832c94ed8d4c",6:"61bb6b185343606aa180",7:"ece0a2d210892b176e55",8:"7d0a8e6532c58d0c2415",9:"ea31d337331fea67d62b",10:"62eecd9e2e85ea911ebd",11:"59c87174f09911b8256b",12:"e8cd784bf481f550c766",13:"2ccd52bd6e1150f23c90",14:"0225e369d82f24077aba",15:"300b3fb9e6b3afc5f862",16:"d6f21b5db0ef31d13e0f",17:"ebf1847c50132c6f96a7",18:"7fa0be27d3ea523f8826",19:"63ca1f785b71646ef739",20:"96ae1c7fff93072fa000",21:"b9552ac568217b38c707",22:"a3681c6a337ad49aeb4b",23:"e507c496e766217ec178",24:"a89c78a7ed5ce6306ba7",25:"d9ee9041561602fa561c",26:"0e68f81c2d32fec5abdb",27:"01b66b3d0ab23d2341c2",28:"8606cc4adb654d067bac",29:"485d7c81ce188c3fa687",30:"6e3dad3ed142df770d0e",31:"963d650c22609bb350cc",32:"648e00249c751be0ef72",33:"3b19f619921aacfda1e4",34:"b57b41292517a536addb",35:"8a132ad30fce01f4deb7",36:"ae95aada03220eb5550d",37:"5dc35c4db0da65b72ba3",38:"67c2ba02c8cb8e2aeae7",39:"cffc9df02e23624f15f7",40:"f72c24c69c3d22cb365f",41:"3e80f7c7164f36ab833d",42:"9cfba776561a2683e1ce",43:"491cbc97f03e6a9416fd",44:"9a001dcb0b20412481a9",45:"7d07ad63ee1aebc77c05",46:"64a15dd24ae8e3144031",47:"46097b0db930f8998e25",48:"bf0f43e67bca163a8825",49:"db237966421b9efea688",50:"f22cbf7598ba1005cbcc",51:"6a01d92850fef1ae9c8d",52:"6e6e1e27f98a4fa5c52d",53:"76cc13b40c7878ec1850",54:"44d3c12a2724e5586b88",55:"62d7e11a79d40049fabc",56:"24e726ce5fe347c611e6",57:"faf962e39bfd0f4ffda9",58:"d3ebf67ef88c937fdaab",59:"db51a7f4c51421d4f9bc",60:"ff78f7652091a35782ec",61:"e84c616b76d09228b6fe",62:"cd195beac77b18e065fb",63:"2983ad835122fb0d5ae5",64:"2e546d02be42fac0c64d",65:"11f52cad03275c8aba4f",66:"9fa3ca5124aa2b5a85ec",67:"fe28b5cd6347bad40117",68:"7c8716b3ed26ffda11fb",69:"18f0e63b47a729fc63d0",70:"b999d4bf8b805f03bd2b",71:"d19b0a20ea22d410b91d",72:"ae171a4233296a9ac4b4",73:"0c069b06ad167faadfc6"}[e]+".js";var r=setTimeout(t,12e4);function t(){n.onerror=n.onload=null,clearTimeout(r);var a=f[e];0!==a&&(a&&a[1](new Error("Loading chunk "+e+" failed.")),f[e]=void 0)}return n.onerror=n.onload=t,d.appendChild(n),c},b.m=e,b.c=c,b.d=function(e,a,c){b.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:c})},b.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(a,"a",a),a},b.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},b.p="./",b.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -4,21 +4,21 @@
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-05-13 09:43:53
* @LastEditTime: 2020-05-13 11:00:21
-->
<!--
<image-edit :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></image-edit>
import imageEdit from '@/components/set/image-edit.vue';
-->
<template>
<el-dialog :title="!!editRow.materialId ? '编辑文本' : '新建文本'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
<el-dialog :title="!!editRow.materialId ? '编辑图片' : '新建图片'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
<div class="">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="图片标题" prop="materialTitle">
<limitInput :inputWidth="440" :inputValue.sync="ruleForm.materialTitle" :holder="'请输入文本标题'" :getByType="'word'" :maxLength="20"> </limitInput>
<limitInput :inputWidth="440" :inputValue.sync="ruleForm.materialTitle" :holder="'请输入图片标题'" :getByType="'word'" :maxLength="20"> </limitInput>
</el-form-item>
<el-form-item label="图片" prop="imgUrl">
<single-upload :imgSrc.sync="ruleForm.imgUrl"> </single-upload>
<single-upload uploadType="1" :imgSrc.sync="ruleForm.imgUrl"> </single-upload>
</el-form-item>
</el-form>
</div>
......@@ -67,8 +67,8 @@ export default {
imgUrl: ''
},
rules: {
materialTitle: [{ required: true, message: '请输入文本标题', trigger: 'blur' }],
imgUrl: [{ required: true, message: '请输入文本内容', trigger: 'blur' }]
materialTitle: [{ required: true, message: '请输入图片标题', trigger: 'blur' }],
imgUrl: [{ required: true, message: '请上传图片', trigger: 'blur' }]
},
emojiList: emojiArr
};
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-05-13 11:03:28
-->
<!--
<image-edit :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></image-edit>
import imageEdit from '@/components/set/image-edit.vue';
-->
<template>
<el-dialog :title="!!editRow.materialId ? '编辑视频' : '新建视频'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
<div class="">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="视频标题" prop="materialTitle">
<limitInput :inputWidth="440" :inputValue.sync="ruleForm.materialTitle" :holder="'请输入视频标题'" :getByType="'word'" :maxLength="20"> </limitInput>
</el-form-item>
<el-form-item label="视频" prop="link">
<single-upload uploadType="3" :videoSrc.sync="ruleForm.link"> </single-upload>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="toCancel">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import singleUpload from '@/components/single-upload.vue';
import limitInput from '@/components/limit-input.vue';
import limitTextarea from '@/components/limit-textarea.vue';
import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { emojiArr } from '@/utils/emoji';
export default {
props: {
editRow: {
type: Object,
default() {
return {};
}
},
categoryId: {
type: Object,
default() {
return '';
}
}
},
components: {
limitInput,
limitTextarea,
singleUpload
},
data() {
return {
editPersion: localStorage.getItem('userName'),
dialogVisible: true,
ruleForm: {
materialId: '',
materialTitle: '',
link: ''
},
rules: {
materialTitle: [{ required: true, message: '请输入视频标题', trigger: 'blur' }],
link: [{ required: true, message: '请上传视频', trigger: 'blur' }]
},
emojiList: emojiArr
};
},
methods: {
toCancel() {
const that = this;
that.$emit('closeText');
that.$refs['ruleForm'].resetFields();
},
handleClose(done) {
const that = this;
that.$emit('closeText');
that.$refs['ruleForm'].resetFields();
},
submitForm: _debounce(function(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
that.postSave();
}
});
}, 300),
postSave() {
const that = this;
const data = {
categoryId: that.categoryId,
materialType: 2,
materialId: that.ruleForm.materialId,
materialTitle: that.ruleForm.materialTitle,
link: that.ruleForm.link
};
postRequest(that.ruleForm.materialId ? '/haoban-manage3-web/material-edit' : '/haoban-manage3-web/material-add', data)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('操作成功', 'success');
that.$refs['ruleForm'].resetFields();
that.$emit('submitText');
} else {
errMsg.errorMsg(resData);
}
})
.catch(error => {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
editRow(newData) {
const that = this;
if (Object.keys(newData).length) {
that.ruleForm = JSON.parse(JSON.stringify(newData));
}
}
},
mounted() {
const that = this;
if (Object.keys(that.editRow).length) {
that.ruleForm = JSON.parse(JSON.stringify(that.editRow));
}
}
};
</script>
<style lang="less" scoped>
.m-b-20 {
margin-bottom: 20px;
}
.p-l-18 {
padding-left: 18px;
}
.material-content {
position: relative;
.material-body {
/* resize: none;
width: 440px;
height: 273px;
border-radius: 2px;
border: 1px solid rgba(196, 198, 207, 1); */
.el-textarea {
/deep/ .el-textarea__inner {
height: 273px;
}
}
}
.emoji-img {
position: absolute;
left: 10px;
bottom: 10px;
}
}
.el-textarea {
/deep/ .el-textarea__inner {
height: 273px;
}
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-05-13 11:33:39
-->
<!--
<image-table :categoryId="currentCategoryId" :textTableData="tableData" @handleSelectionChange="handleSelectionChange" @refreshTable="refreshTable" @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"></image-table>
import imageTable from '@/components/set/image-table.vue';
-->
<template>
<div class="text-table-body">
<el-table class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="35"> </el-table-column>
<el-table-column width="25">
<template slot="header" slot-scope="scope">
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" @command="handleCommand" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="0"><span :style="{ color: selectRadio == 0 ? '#2f54eb' : '#606266' }">选择当页</span></el-dropdown-item>
<el-dropdown-item command="1"><span :style="{ color: selectRadio == 1 ? '#2f54eb' : '#606266' }">选择全部</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope"> </template>
</el-table-column>
<el-table-column label="标题" width="120" show-overflow-tooltip>
<template slot-scope="scope"
>{{ scope.row.materialTitle }}
</template>
</el-table-column>
<el-table-column prop="" label="内容">
<template slot-scope="scope"
><video :src="scope.row.link" class="avatar" controls="controls" style="width: 40px;height:40px;">您的浏览器不支持视频播放</video></template
>
</el-table-column>
<el-table-column prop="" label="编辑人" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.staffName }}</template>
</el-table-column>
<el-table-column prop="" label="最近编辑时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="color-606266 line-18">{{ scope.row.updateTime | timeStampToYmd }}</div>
<div class="color-606266 line-18">{{ scope.row.updateTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block common-wrap__page text-right m-t-24" v-if="tableData.length != 0">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination>
</div>
<text-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></text-edit>
</div>
</template>
<script>
import imageEdit from '@/components/set/image-edit.vue';
import { postRequest } from '@/api/api';
// import { _debounce } from '@/common/js/public';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
export default {
props: {
brandId: {
type: String,
default() {
return '';
}
},
categoryId: {
type: String,
default() {
return '';
}
},
textTableData: {
type: [Array, Object],
default() {
return [];
}
},
currentPage: {
type: [String, Number],
default() {
return 1;
}
},
pageSize: {
type: [String, Number],
default() {
return 20;
}
},
total: {
type: [String, Number],
default() {
return 0;
}
}
},
data() {
return {
tableData: [],
multipleSelection: [],
textShow: false,
editRow: {}
};
},
computed: {},
methods: {
/**
* 文本弹窗关闭
*/
closeText() {
const that = this;
that.textShow = false;
that.editRow = {};
},
submitText() {
const that = this;
that.textShow = false;
that.editRow = {};
that.$emit('refreshTable');
},
/**
* 编辑
*/
toEdit(index, row) {
const that = this;
that.textShow = true;
that.editRow = row;
},
/**
* 删除
*/
toDel(index, row) {
const that = this;
that
.$confirm('确定删除当前素材?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.postDel(index, row);
})
.catch(() => {});
},
postDel(index, row) {
const that = this;
let para = {
materialIds: row.materialId
};
postRequest('/haoban-manage3-web/material-del', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('删除成功', 'success');
that.$emit('refreshTable');
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 表格选择
*/
handleSelectionChange(val) {
const that = this;
that.multipleSelection = val;
that.$emit('handleSelectionChange', val);
},
/**
* 批量删除
*/
multDel() {
const that = this;
if (!that.multipleSelection.length) {
that.$message.error({
duration: 1000,
message: '请选择删除项'
});
return false;
}
that.showDialog = true;
},
/* *
* 批量删除---弹窗关闭
*/
hideDialog(obj) {
const that = this;
that.showDialog = false;
if (!Object.keys(obj).length) {
return false;
}
that.postMultDel(obj);
},
/**
* 分页---页码变化
*/
handleSizeChange(val) {
const that = this;
that.$emit('handleSizeChange', val);
},
/**
* 分页---当前页变化
*/
handleCurrentChange(val) {
const that = this;
that.$emit('handleCurrentChange', val);
}
},
watch: {
textTableData: function(newData, oldData) {
let that = this;
if (!!newData.length) {
that.tableData = JSON.parse(JSON.stringify(newData));
} else {
that.tableData = [];
}
}
},
mounted() {
const that = this;
that.activeBrand = that.brandId;
if (!!that.textTableData.length) {
that.tableData = JSON.parse(JSON.stringify(that.textTableData));
} else {
that.tableData = [];
}
},
components: {
imageEdit
}
};
</script>
<style type="text/scss" lang="scss" scoped>
.color-c0c4cc {
display: inline-block;
line-height: 34px;
padding-left: 10px;
color: #c0c4cc;
}
.condition-tips {
display: inline-block;
vertical-align: middle;
line-height: 32px;
}
.table-condition {
// min-width: 1200px;
}
.daily-set-wrap {
height: 100%;
.daily-set-content {
padding: 20px;
.table-condition-left {
font-size: 0;
}
}
.depart-item-content {
width: 213px;
height: 32px;
overflow: hidden;
white-space: nowrap;
border-radius: 4px;
border: 1px solid #dcdfe6;
cursor: pointer;
}
.item-cell-select {
/deep/ .el-select__tags {
white-space: nowrap;
overflow: hidden;
}
}
.depart-cell {
position: relative;
margin: 0 24px 24px 0;
.el-icon-circle-close {
position: absolute;
top: -10px;
right: -10px;
font-size: 16px;
color: #808995;
cursor: pointer;
}
}
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-05-13 11:28:26
-->
<!--
<image-edit :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></image-edit>
import imageEdit from '@/components/set/image-edit.vue';
-->
<template>
<el-dialog :title="!!editRow.materialId ? '编辑网页' : '新建网页'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
<div class="">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="网页标题" prop="materialTitle">
<limitInput :inputWidth="440" :inputValue.sync="ruleForm.materialTitle" :holder="'请输入网页标题'" :getByType="'word'" :maxLength="20"> </limitInput>
</el-form-item>
<el-form-item label="链接" prop="link">
<limitInput :inputWidth="440" :inputValue.sync="ruleForm.link" :holder="'请输入链接,格式需带https://www,或http://www'" :getByType="'word'" :maxLength="200"> </limitInput>
</el-form-item>
<el-form-item label="摘要" prop="materialDesc">
<limitInput :inputWidth="440" :inputValue.sync="ruleForm.materialDesc" :holder="'请输入网页摘要'" :getByType="'word'" :maxLength="200"> </limitInput>
</el-form-item>
<el-form-item label="封面" prop="imgUrl">
<single-upload uploadType="2" :imgSrc.sync="ruleForm.imgUrl"> </single-upload>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="toCancel">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import singleUpload from '@/components/single-upload.vue';
import limitInput from '@/components/limit-input.vue';
import limitTextarea from '@/components/limit-textarea.vue';
import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { emojiArr } from '@/utils/emoji';
export default {
props: {
editRow: {
type: Object,
default() {
return {};
}
},
categoryId: {
type: Object,
default() {
return '';
}
}
},
components: {
limitInput,
limitTextarea,
singleUpload
},
data() {
const validateUrl = (rule, value, callback) => {
let reg = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/;
if (value === '') {
callback(new Error('请输入链接'));
} else if (!reg.test(value)) {
callback(new Error('请输入链接,正确格式:https://www.XXX.com!'));
} else {
callback();
}
};
return {
editPersion: localStorage.getItem('userName'),
dialogVisible: true,
ruleForm: {
materialId: '',
link: '',
materialTitle: '',
materialDesc: '',
imgUrl: ''
},
rules: {
materialTitle: [{ required: true, message: '请输入网页标题', trigger: 'blur' }],
link: [{ required: true, validator: validateUrl, trigger: 'blur' }],
materialDesc: [{ required: true, message: '请输入摘要', trigger: 'blur' }],
imgUrl: [{ required: true, message: '请上传网页封面', trigger: 'blur' }]
},
emojiList: emojiArr
};
},
methods: {
toCancel() {
const that = this;
that.$emit('closeText');
that.$refs['ruleForm'].resetFields();
},
handleClose(done) {
const that = this;
that.$emit('closeText');
that.$refs['ruleForm'].resetFields();
},
submitForm: _debounce(function(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
that.postSave();
}
});
}, 300),
postSave() {
const that = this;
const data = {
categoryId: that.categoryId,
materialType: 2,
materialId: that.ruleForm.materialId,
materialTitle: that.ruleForm.materialTitle,
imgUrl: that.ruleForm.imgUrl
};
postRequest(that.ruleForm.materialId ? '/haoban-manage3-web/material-edit' : '/haoban-manage3-web/material-add', data)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('操作成功', 'success');
that.$refs['ruleForm'].resetFields();
that.$emit('submitText');
} else {
errMsg.errorMsg(resData);
}
})
.catch(error => {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
editRow(newData) {
const that = this;
if (Object.keys(newData).length) {
that.ruleForm = JSON.parse(JSON.stringify(newData));
}
}
},
mounted() {
const that = this;
if (Object.keys(that.editRow).length) {
that.ruleForm = JSON.parse(JSON.stringify(that.editRow));
}
}
};
</script>
<style lang="less" scoped>
.m-b-20 {
margin-bottom: 20px;
}
.p-l-18 {
padding-left: 18px;
}
.material-content {
position: relative;
.material-body {
/* resize: none;
width: 440px;
height: 273px;
border-radius: 2px;
border: 1px solid rgba(196, 198, 207, 1); */
.el-textarea {
/deep/ .el-textarea__inner {
height: 273px;
}
}
}
.emoji-img {
position: absolute;
left: 10px;
bottom: 10px;
}
}
.el-textarea {
/deep/ .el-textarea__inner {
height: 273px;
}
}
</style>
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-05-13 11:36:08
-->
<!--
<image-table :categoryId="currentCategoryId" :textTableData="tableData" @handleSelectionChange="handleSelectionChange" @refreshTable="refreshTable" @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"></image-table>
import imageTable from '@/components/set/image-table.vue';
-->
<template>
<div class="text-table-body">
<el-table class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%', minHeight: tableH }" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="35"> </el-table-column>
<el-table-column width="25">
<template slot="header" slot-scope="scope">
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" @command="handleCommand" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="0"><span :style="{ color: selectRadio == 0 ? '#2f54eb' : '#606266' }">选择当页</span></el-dropdown-item>
<el-dropdown-item command="1"><span :style="{ color: selectRadio == 1 ? '#2f54eb' : '#606266' }">选择全部</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope"> </template>
</el-table-column>
<el-table-column label="标题" width="120" show-overflow-tooltip>
<template slot-scope="scope"
>{{ scope.row.materialTitle }}
</template>
</el-table-column>
<el-table-column prop="" label="封面">
<template slot-scope="scope"
><img :src="scope.row.imgUrl" alt="" style="width: 40px;height:40px;"
/></template>
</el-table-column>
<el-table-column prop="" label="链接" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.link }}</template>
</el-table-column>
<el-table-column prop="" label="编辑人" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.staffName }}</template>
</el-table-column>
<el-table-column prop="" label="最近编辑时间" show-overflow-tooltip>
<template slot-scope="scope">
<div class="color-606266 line-18">{{ scope.row.updateTime | timeStampToYmd }}</div>
<div class="color-606266 line-18">{{ scope.row.updateTime | timeStampToHms }}</div>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="toEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="text" @click="toDel(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block common-wrap__page text-right m-t-24" v-if="tableData.length != 0">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination>
</div>
<text-edit v-if="textShow" :editRow="editRow" :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></text-edit>
</div>
</template>
<script>
import imageEdit from '@/components/set/image-edit.vue';
import { postRequest } from '@/api/api';
// import { _debounce } from '@/common/js/public';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
export default {
props: {
brandId: {
type: String,
default() {
return '';
}
},
categoryId: {
type: String,
default() {
return '';
}
},
textTableData: {
type: [Array, Object],
default() {
return [];
}
},
currentPage: {
type: [String, Number],
default() {
return 1;
}
},
pageSize: {
type: [String, Number],
default() {
return 20;
}
},
total: {
type: [String, Number],
default() {
return 0;
}
}
},
data() {
return {
tableData: [],
multipleSelection: [],
textShow: false,
editRow: {}
};
},
computed: {},
methods: {
/**
* 文本弹窗关闭
*/
closeText() {
const that = this;
that.textShow = false;
that.editRow = {};
},
submitText() {
const that = this;
that.textShow = false;
that.editRow = {};
that.$emit('refreshTable');
},
/**
* 编辑
*/
toEdit(index, row) {
const that = this;
that.textShow = true;
that.editRow = row;
},
/**
* 删除
*/
toDel(index, row) {
const that = this;
that
.$confirm('确定删除当前素材?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.postDel(index, row);
})
.catch(() => {});
},
postDel(index, row) {
const that = this;
let para = {
materialIds: row.materialId
};
postRequest('/haoban-manage3-web/material-del', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('删除成功', 'success');
that.$emit('refreshTable');
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 表格选择
*/
handleSelectionChange(val) {
const that = this;
that.multipleSelection = val;
that.$emit('handleSelectionChange', val);
},
/**
* 批量删除
*/
multDel() {
const that = this;
if (!that.multipleSelection.length) {
that.$message.error({
duration: 1000,
message: '请选择删除项'
});
return false;
}
that.showDialog = true;
},
/* *
* 批量删除---弹窗关闭
*/
hideDialog(obj) {
const that = this;
that.showDialog = false;
if (!Object.keys(obj).length) {
return false;
}
that.postMultDel(obj);
},
/**
* 分页---页码变化
*/
handleSizeChange(val) {
const that = this;
that.$emit('handleSizeChange', val);
},
/**
* 分页---当前页变化
*/
handleCurrentChange(val) {
const that = this;
that.$emit('handleCurrentChange', val);
}
},
watch: {
textTableData: function(newData, oldData) {
let that = this;
if (!!newData.length) {
that.tableData = JSON.parse(JSON.stringify(newData));
} else {
that.tableData = [];
}
}
},
mounted() {
const that = this;
that.activeBrand = that.brandId;
if (!!that.textTableData.length) {
that.tableData = JSON.parse(JSON.stringify(that.textTableData));
} else {
that.tableData = [];
}
},
components: {
imageEdit
}
};
</script>
<style type="text/scss" lang="scss" scoped>
.color-c0c4cc {
display: inline-block;
line-height: 34px;
padding-left: 10px;
color: #c0c4cc;
}
.condition-tips {
display: inline-block;
vertical-align: middle;
line-height: 32px;
}
.table-condition {
// min-width: 1200px;
}
.daily-set-wrap {
height: 100%;
.daily-set-content {
padding: 20px;
.table-condition-left {
font-size: 0;
}
}
.depart-item-content {
width: 213px;
height: 32px;
overflow: hidden;
white-space: nowrap;
border-radius: 4px;
border: 1px solid #dcdfe6;
cursor: pointer;
}
.item-cell-select {
/deep/ .el-select__tags {
white-space: nowrap;
overflow: hidden;
}
}
.depart-cell {
position: relative;
margin: 0 24px 24px 0;
.el-icon-circle-close {
position: absolute;
top: -10px;
right: -10px;
font-size: 16px;
color: #808995;
cursor: pointer;
}
}
}
</style>
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2018-12-06 13:44:22
* @LastEditors: 无尘
* @LastEditTime: 2020-05-13 10:27:25
* @LastEditTime: 2020-05-13 10:58:45
-->
<!--
单个上传组件
......@@ -47,6 +47,11 @@ import errMsg from '@/common/js/error';
export default {
name: 'single-upload',
props: {
videoSrc: {
// 传入 input value
type: String,
default: ''
},
imgSrc: {
// 传入 input value
type: String,
......@@ -81,12 +86,11 @@ export default {
} else {
that.baseUrl = host;
}
// that.upUrl = that.baseUrl + '/api-plug/upload-img?wxFlag=1'
},
methods: {
/**
* 上传图片
* 上传图片/视频
*/
uploadUrl() {
const that = this;
......@@ -108,21 +112,37 @@ export default {
const that = this;
if (res.errorCode == 1) {
console.log(res);
that.$emit('update:imgSrc', res.result.url);
that.videoFlag = false;
if (that.uploadType == 3) {
that.$emit('update:videoSrc', res.result.url);
} else {
that.$emit('update:imgSrc', res.result.url);
}
} else {
errMsg.errorMsg(res);
}
},
beforeAvatarUpload(file) {
const that = this;
console.log(file);
const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png';
const isMP4 = file.type == 'video/mp4';
const isLt2M = file.size / 1024 / 1024 < that.uploadLimit;
if ((that.uploadType == 1 || that.uploadType == 2) && !isJPG) {
that.$message.error('上传图片支持png、jpg、jpeg格式!');
}
if (that.uploadType == 1 && !isLt2M) {
if ((that.uploadType == 1 || that.uploadType == 2) && !isLt2M) {
that.$message.error(`上传图片大小不能超过 ${that.uploadLimit}MB!`);
}
if (that.uploadType == 3 && !isMP4) {
that.$message.error('上传视频支持MP4格式!');
}
if (that.uploadType == 3 && !isLt2M) {
that.$message.error(`上传视频大小不能超过 ${that.uploadLimit}MB!`);
}
if (that.uploadType == 3) {
return isMP4 && isLt2M;
}
return (
isJPG &&
isLt2M &&
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-03-16 09:59:39
* @LastEditors: 无尘
* @LastEditTime: 2020-05-13 09:57:04
* @LastEditTime: 2020-05-13 11:31:35
-->
<template>
<div class="daily-set-wrap ">
......@@ -92,9 +92,11 @@
</el-tab-pane>
<el-tab-pane label="网页" name="3">
<span slot="label"><i class="iconfont icondaima p-r-5 color-606266"></i>网页</span>
<web-table :currentPage="currentPage" :pageSize="pageSize" :total="total" :categoryId="currentCategoryId" :textTableData="tableData" @handleSelectionChange="handleSelectionChange" @refreshTable="refreshTable" @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"></web-table>
</el-tab-pane>
<el-tab-pane label="视频" name="4">
<span slot="label"><i class="iconfont iconshipin p-r-5 color-606266"></i>视频</span>
<video-table :currentPage="currentPage" :pageSize="pageSize" :total="total" :categoryId="currentCategoryId" :textTableData="tableData" @handleSelectionChange="handleSelectionChange" @refreshTable="refreshTable" @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"></video-table>
</el-tab-pane>
<el-tab-pane label="文件" name="5">
<span slot="label"><i class="iconfont iconwenjian p-r-5 color-606266"></i>文件</span>
......@@ -114,6 +116,8 @@ import textEdit from '@/components/set/text-edit.vue';
import imageEdit from '@/components/set/image-edit.vue';
import textTable from '@/components/set/text-table.vue';
import imageTable from '@/components/set/image-table.vue';
import webTable from '@/components/set/web-table.vue';
import videoTable from '@/components/set/video-table.vue';
import groupDialog from '@/components/set/group-dialog.vue';
import { getRequest, postRequest } from '@/api/api';
import { _debounce } from '@/common/js/public';
......@@ -474,7 +478,7 @@ export default {
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
components: { groupDialog, textTable, imageTable, textEdit, imageEdit }
components: { groupDialog, textTable, imageTable, webTable, videoTable, textEdit, imageEdit }
};
</script>
<style type="text/less" lang="less" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment