Commit c975406a by 无尘

fix: 修改接口

parent 2390eb59
<!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.8c83e3a275ed299f10e548b0d19bfa17.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.4db7643f101c4bb85146.js></script><script type=text/javascript src=./static/js/vendor.ec5b5af1da21f97836b5.js></script><script type=text/javascript src=./static/js/app.245b1a4a751d654a362d.js></script></body></html> <!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.bda4d737d3ec98cce491219667f7bbd8.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.e7e6c055618c3fe7e73b.js></script><script type=text/javascript src=./static/js/vendor.ec5b5af1da21f97836b5.js></script><script type=text/javascript src=./static/js/app.245b1a4a751d654a362d.js></script></body></html>
\ No newline at end of file \ 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 c=window.webpackJsonp;window.webpackJsonp=function(a,d,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[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(c&&c(a,d,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=b(b.s=n[i]);return o};var a={},f={76:0};function b(c){if(a[c])return a[c].exports;var f=a[c]={i:c,l:!1,exports:{}};return e[c].call(f.exports,f,f.exports,b),f.l=!0,f.exports}b.e=function(e){var c=f[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,b){c=f[e]=[a,b]});c[2]=a;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:"985967f4496609803ce1",5:"bf21cfa1832c94ed8d4c",6:"bf0bd72259e971cb5c5d",7:"6d129ebb69dd65574768",8:"5cbeb9fde8d49bf97a09",9:"cb3390436b50a54ea620",10:"62eecd9e2e85ea911ebd",11:"59c87174f09911b8256b",12:"e8cd784bf481f550c766",13:"2ccd52bd6e1150f23c90",14:"d7cec3ec28f71d81a442",15:"eb4a33b11e1bcfc10d01",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:"bba03bcee8ebece514c9",49:"a6f7a2dce27db52104e5",50:"909c9e85ea51f2841902",51:"3d768cd09b88e9fc1dfe",52:"21378cae9a2a9603ea77",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 c=f[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),f[e]=void 0)}return n.onerror=n.onload=t,d.appendChild(n),a},b.m=e,b.c=a,b.d=function(e,c,a){b.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},b.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(c,"a",c),c},b.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},b.p="./",b.oe=function(e){throw console.error(e),e}}([]); !function(e){var c=window.webpackJsonp;window.webpackJsonp=function(a,b,n){for(var r,t,o,i=0,u=[];i<a.length;i++)t=a[i],f[t]&&u.push(f[t][0]),f[t]=0;for(r in b)Object.prototype.hasOwnProperty.call(b,r)&&(e[r]=b[r]);for(c&&c(a,b,n);u.length;)u.shift()();if(n)for(i=0;i<n.length;i++)o=d(d.s=n[i]);return o};var a={},f={76:0};function d(c){if(a[c])return a[c].exports;var f=a[c]={i:c,l:!1,exports:{}};return e[c].call(f.exports,f,f.exports,d),f.l=!0,f.exports}d.e=function(e){var c=f[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,d){c=f[e]=[a,d]});c[2]=a;var b=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.async=!0,n.timeout=12e4,d.nc&&n.setAttribute("nonce",d.nc),n.src=d.p+"static/js/"+e+"."+{0:"b34ffb148c94a0864421",1:"06c4e42e62c1f75191f0",2:"95860c596ce8eeb79301",3:"2a63ebede4a53ae4d5be",4:"985967f4496609803ce1",5:"bf21cfa1832c94ed8d4c",6:"bf0bd72259e971cb5c5d",7:"6d129ebb69dd65574768",8:"5cbeb9fde8d49bf97a09",9:"f3437998f22b26bddf0b",10:"62eecd9e2e85ea911ebd",11:"59c87174f09911b8256b",12:"e8cd784bf481f550c766",13:"2ccd52bd6e1150f23c90",14:"d7cec3ec28f71d81a442",15:"eb4a33b11e1bcfc10d01",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:"bba03bcee8ebece514c9",49:"a6f7a2dce27db52104e5",50:"909c9e85ea51f2841902",51:"3d768cd09b88e9fc1dfe",52:"21378cae9a2a9603ea77",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 c=f[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),f[e]=void 0)}return n.onerror=n.onload=t,b.appendChild(n),a},d.m=e,d.c=a,d.d=function(e,c,a){d.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},d.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(c,"a",c),c},d.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},d.p="./",d.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file \ No newline at end of file
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-05-13 09:37:57
-->
<!--
<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="imgUrl">
<single-upload :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 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
},
data() {
return {
editPersion: localStorage.getItem('userName'),
dialogVisible: true,
ruleForm: {
materialId: '',
materialTitle: '',
imgUrl: ''
},
rules: {
materialTitle: [{ 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 09:41:56
-->
<!--
<text-table :categoryId="categoryId" :textTableData="textTableData" @handleSelectionChange="handleSelectionChange" @refreshTable="refreshTable" @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"></text-table>
import textTable from '@/components/set/text-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.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));
}
}
},
mounted() {
const that = this;
that.activeBrand = that.brandId;
if (!!that.textTableData.length) {
that.tableData = JSON.parse(JSON.stringify(that.textTableData));
}
},
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-12 18:23:41
-->
<!--
<group-dialog @closeGroup="closeGroup" @submitGroup="submitGroup"></group-dialog>
import groupDialog from '@/components/set/group-dialog.vue';
-->
<template>
<el-dialog title="批量操作-移至分组" :visible.sync="dialogVisible" width="485px" :before-close="handleClose">
<div class="">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
<el-form-item label="分组" prop="categoryId">
<el-select v-model="ruleForm.categoryId" placeholder="请选择">
<el-option label="未分组" value="-1"></el-option>
<el-option
v-for="item in options"
:key="item.categoryId"
:label="item.categoryName"
:value="item.categoryId">
</el-option>
</el-select>
</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 limitInput from '@/components/limit-input.vue';
import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
export default {
props: {
},
components: {
limitInput
},
data() {
return {
editPersion: localStorage.getItem('userName'),
dialogVisible: true,
options: [],
ruleForm: {
categoryId: '',
},
rules: {
categoryId: [{ required: true, message: '请选择分组名称', trigger: 'change' }]
}
};
},
methods: {
toCancel() {
const that = this;
that.$emit('closeGroup');
that.$refs['ruleForm'].resetFields();
},
handleClose(done) {
const that = this;
that.$emit('closeGroup');
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.ruleForm.categoryId,
materialIds: that.materialIds
};
postRequest('/haoban-manage3-web/material-batch', data)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('操作成功', 'success');
that.$refs['ruleForm'].resetFields();
that.$emit('submitGroup');
} else {
errMsg.errorMsg(resData);
}
})
.catch(error => {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
/**
* 获取数据
*/
getGroupData(val) {
const that = this;
let para = {
wxEnterpriseId: that.wxEnterpriseId
};
getRequest('/haoban-manage3-web/category-list', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
that.groupData = resData.result || [];
return;
}
errMsg.errorMsg(resData);
})
.catch(function(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;
}
</style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2018-12-06 13:44:22 * @Date: 2018-12-06 13:44:22
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2019-09-25 17:11:08 * @LastEditTime: 2020-05-13 09:34:31
--> -->
<!-- <!--
单个上传组件 单个上传组件
...@@ -19,13 +19,10 @@ ...@@ -19,13 +19,10 @@
<img v-if="imgSrc" :src="imgSrc" class="avatar" @mouseover="showImage(imgSrc)" /> <img v-if="imgSrc" :src="imgSrc" class="avatar" @mouseover="showImage(imgSrc)" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
<p class="upload-tip w-500" v-if="field == 'businessCard'">
上传营业执照复印件加盖公章,手写“仅用于好办认证”字样;照片搜索信息要求清晰可见,内容真实有效,不得做任何修改;支持jpp、jpeg、bmg、gif、png格式,大小不超过8M。 <p class="upload-tip color-909399 font-12">
</p> 图片支持png、jpg、jpeg格式,大小不超过2M,可上传1张
<p class="upload-tip w-500" v-if="field == 'cardUrl'">
支持jpg、jpeg、pdf、bmg、gif格式照片,大小不超过2M,只能上传一张,再次上传覆盖前一张
</p> </p>
<p class="upload-tip w-500" v-if="field == 'authUrl'">点击可以<a class="color-1890ff" href="https://other-1251519181.cos.ap-shanghai.myqcloud.com/doc/20190529092413/好办认证授权书.docx" download="好办认证授权书.docx">下载授权书</a>模板,支持jpg、jpeg、pdf、bmg、gif格式照片,大小不超过2M,只能上传一张,再次上传覆盖前一张</p>
<!-- 图片预览 --> <!-- 图片预览 -->
<vue-gic-img-preview :imgUrl="imgUrl" :imgShowFlag="imgShowFlag" @hideImage="hideImage"></vue-gic-img-preview> <vue-gic-img-preview :imgUrl="imgUrl" :imgShowFlag="imgShowFlag" @hideImage="hideImage"></vue-gic-img-preview>
</div> </div>
...@@ -84,8 +81,7 @@ export default { ...@@ -84,8 +81,7 @@ export default {
} else { } else {
baseUrl = host; baseUrl = host;
} }
that.upUrl = baseUrl + '/haoban-manage3-web/upload-file';
that.upUrl = baseUrl + '/haoban-manage-web/upload-img';
return that.upUrl; return that.upUrl;
}, },
...@@ -95,18 +91,19 @@ export default { ...@@ -95,18 +91,19 @@ export default {
handleAvatarSuccess(res, file, type) { handleAvatarSuccess(res, file, type) {
const that = this; const that = this;
if (res.errorCode == 1) { if (res.errorCode == 1) {
that.$emit('update:imgSrc', res.result[0].qcloudImageUrl); console.log(res)
that.$emit('update:imgSrc', res.result[0].url);
} else { } else {
errMsg.errorMsg(res); errMsg.errorMsg(res);
} }
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
const that = this; const that = this;
const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/bmp'; const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png' ;
const isLt2M = file.size / 1024 / 1024 < that.uploadLimit; const isLt2M = file.size / 1024 / 1024 < that.uploadLimit;
// if (!isJPG) { if (!isJPG) {
// that.$message.error('上传头像图片只能是 JPG 格式!'); that.$message.error('上传图片支持png、jpg、jpeg格式!');
// } }
if (!isLt2M) { if (!isLt2M) {
that.$message.error(`上传头像图片大小不能超过 ${that.uploadLimit}MB!`); that.$message.error(`上传头像图片大小不能超过 ${that.uploadLimit}MB!`);
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-03-16 09:59:39 * @Date: 2020-03-16 09:59:39
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-05-12 18:11:39 * @LastEditTime: 2020-05-13 09:39:33
--> -->
<template> <template>
<div class="daily-set-wrap "> <div class="daily-set-wrap ">
...@@ -75,8 +75,8 @@ ...@@ -75,8 +75,8 @@
<div class="material-right"> <div class="material-right">
<div class="material-table"> <div class="material-table">
<div class="add-btn-wrap"> <div class="add-btn-wrap">
<el-button type="primary" @click="addText">新建文本</el-button <el-button v-if="activeName == 1" type="primary" @click="addText">新建文本</el-button><el-button v-if="activeName == 2" type="primary" @click="addImage">新建图片</el-button><el-button v-if="activeName == 3" type="primary" @click="addWeb">新建网页</el-button><el-button v-if="activeName == 4" type="primary" @click="addVideo">新建视频</el-button><el-button v-if="activeName == 5" type="primary" @click="addFile">新建文件</el-button
><el-select v-model="multOpt" placeholder="批量操作" @change="changeOpt"> ><el-select class="m-l-10" v-model="multOpt" placeholder="批量操作" @change="changeOpt">
<el-option label="批量删除" value="1"></el-option> <el-option label="批量删除" value="1"></el-option>
<el-option label="批量转移" value="2"></el-option> <el-option label="批量转移" value="2"></el-option>
</el-select> </el-select>
...@@ -105,10 +105,12 @@ ...@@ -105,10 +105,12 @@
</div> </div>
<group-dialog v-if="addShow" :categoryParentId="categoryParentId" :editRow="editGroupRow" @closeGroup="closeGroup" @submitGroup="submitGroup"></group-dialog> <group-dialog v-if="addShow" :categoryParentId="categoryParentId" :editRow="editGroupRow" @closeGroup="closeGroup" @submitGroup="submitGroup"></group-dialog>
<text-edit v-if="textShow" :categoryId="currentCategoryId" @closeText="closeText" @submitText="submitText"></text-edit> <text-edit v-if="textShow" :categoryId="currentCategoryId" @closeText="closeText" @submitText="submitText"></text-edit>
<image-edit v-if="imageShow" :categoryId="currentCategoryId" @closeText="closeText" @submitText="submitText"></image-edit>
</div> </div>
</template> </template>
<script> <script>
import textEdit from '@/components/set/text-edit.vue'; 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 textTable from '@/components/set/text-table.vue';
import groupDialog from '@/components/set/group-dialog.vue'; import groupDialog from '@/components/set/group-dialog.vue';
import { getRequest, postRequest } from '@/api/api'; import { getRequest, postRequest } from '@/api/api';
...@@ -138,7 +140,11 @@ export default { ...@@ -138,7 +140,11 @@ export default {
multOpt: '', multOpt: '',
multData: [], multData: [],
// 文本 // 文本
textShow: false textShow: false,
imageShow: false,
webShow: false,
videoShow: false,
fileShow: false
}; };
}, },
methods: { methods: {
...@@ -154,6 +160,8 @@ export default { ...@@ -154,6 +160,8 @@ export default {
} }
if (e == 1) { if (e == 1) {
that.postMultDel(); that.postMultDel();
} else {
that.multTrans = true;
} }
}, },
postMultDel() { postMultDel() {
...@@ -166,7 +174,7 @@ export default { ...@@ -166,7 +174,7 @@ export default {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
showMsg.showmsg('删除成功', 'success'); showMsg.showmsg('删除成功', 'success');
that.$emit('refreshTable'); that.refreshTable();
return; return;
} }
errMsg.errorMsg(resData); errMsg.errorMsg(resData);
...@@ -195,13 +203,49 @@ export default { ...@@ -195,13 +203,49 @@ export default {
closeText() { closeText() {
const that = this; const that = this;
that.textShow = false; that.textShow = false;
that.imageShow = false;
that.webShow = false;
that.videoShow = false;
that.fileShow = false;
}, },
submitText() { submitText() {
const that = this; const that = this;
that.textShow = false; that.textShow = false;
that.imageShow = false;
that.webShow = false;
that.videoShow = false;
that.fileShow = false;
that.refreshTable(); that.refreshTable();
}, },
/** /**
* 图片
*/
addImage() {
const that = this;
that.imageShow = true;
},
/**
* 网页
*/
addWeb() {
const that = this;
that.webShow = true;
},
/**
* 视频
*/
addVideo() {
const that = this;
that.videoShow = true;
},
/**
* 文件
*/
addFile() {
const that = this;
that.fileShow = true;
},
/**
* 刷新列表 * 刷新列表
*/ */
refreshTable() { refreshTable() {
...@@ -428,7 +472,7 @@ export default { ...@@ -428,7 +472,7 @@ export default {
destroyed() { destroyed() {
document.documentElement.style.backgroundColor = '#fff'; document.documentElement.style.backgroundColor = '#fff';
}, },
components: { groupDialog, textTable, textEdit } components: { groupDialog, textTable, textEdit, imageEdit }
}; };
</script> </script>
<style type="text/less" lang="less" scoped> <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