提交 c9c14ef6 编写于 作者: bo.dang's avatar bo.dang

新增圈子类型和审核管理

上级 dc72255e
...@@ -90,11 +90,11 @@ ...@@ -90,11 +90,11 @@
</el-form-item> </el-form-item>
<el-form-item label="圈子类型" prop="scope"> <el-form-item label="圈子类型" prop="type">
<el-radio-group v-model="formData.type" size="small" @change="changeType"> <el-radio-group v-model="formData.type" size="small" @change="changeType">
<el-radio label="1" class="label-type">封闭 - 只对圈子成员可见,成员只能由管理员添加、删除</el-radio> <el-radio :label="0" class="label-type">封闭 - 只对圈子成员可见,成员只能由管理员添加、删除</el-radio>
<el-radio label="2" class="label-type">半开放 - 对任何人可见,用户请求加入后需管理员同意,成员可自行退出</el-radio> <el-radio :label="1" class="label-type">半开放 - 对任何人可见,用户请求加入后需管理员同意,成员可自行退出</el-radio>
<el-radio label="3" class="label-type">开放 - 对任何人可见,用户请求加入后无需管理员同意,成员可自行退出</el-radio> <el-radio :label="2" class="label-type">开放 - 对任何人可见,用户请求加入后无需管理员同意,成员可自行退出</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
...@@ -199,6 +199,9 @@ ...@@ -199,6 +199,9 @@
], ],
dynamicFlag: [ dynamicFlag: [
{ required: true, message: "请选择内容发布权限", trigger: "blur" }, { required: true, message: "请选择内容发布权限", trigger: "blur" },
],
type: [
{ required: true, message: "请选择圈子类型", trigger: "blur" },
] ]
}, },
imgMouseOver1: false, imgMouseOver1: false,
......
...@@ -5,6 +5,16 @@ ...@@ -5,6 +5,16 @@
<i class="el-icon-circle-plus-outline" @click="dialogOrgFn()"></i> <i class="el-icon-circle-plus-outline" @click="dialogOrgFn()"></i>
<i class="text" @click="dialogOrgFn()">添加机构</i> <i class="text" @click="dialogOrgFn()">添加机构</i>
</el-col> </el-col>
<el-col class="add-organization" >
<el-upload
class="bg-uploader"
action="#"
:show-file-list="false"
:before-upload="beforeUploadOrg">
<i class="el-icon-document-add"></i>
<i class="text">批量导入</i>
</el-upload>
</el-col>
<el-col class="organization-search"> <el-col class="organization-search">
<el-form :inline="true" :model="formOrganization" class="demo-form-inline" > <el-form :inline="true" :model="formOrganization" class="demo-form-inline" >
<el-form-item label> <el-form-item label>
...@@ -96,6 +106,7 @@ import { doUpload, getFilePath } from "@/utils/qiniu-util"; ...@@ -96,6 +106,7 @@ import { doUpload, getFilePath } from "@/utils/qiniu-util";
import * as operationData from "@/utils/operation"; import * as operationData from "@/utils/operation";
import { moRelSearch, morDeleteOrg } from '@/utils/yqrange/memberApi'; import { moRelSearch, morDeleteOrg } from '@/utils/yqrange/memberApi';
import { getOrgProvincesReq } from '@/utils/yqrange/rangeApi'; import { getOrgProvincesReq } from '@/utils/yqrange/rangeApi';
import { uploadOrg } from '@/utils/yqrange/yqrangeApi';
import checkOrg from './checkOrg' import checkOrg from './checkOrg'
let vm = null; let vm = null;
export default { export default {
...@@ -408,7 +419,76 @@ export default { ...@@ -408,7 +419,76 @@ export default {
this.dialogOrg = false this.dialogOrg = false
this.searchOrganization() this.searchOrganization()
this.$emit('refreshRenYuan') this.$emit('refreshRenYuan')
},
// 批量导入
beforeUploadOrg(file) {
//
// console.log(file);
// let arr = file.type.split("/");
// let ext = "." + arr[1];
// let name = file.name;
//
//
// let reader = new FileReader();
// reader.onload = function(e) {
// let fileJson = {
// fileName: file.name,
// file: e.target.result.substr(e.target.result.indexOf("base64,") + 7),
// ext: ext
// };
// let fileArray = [
// {
// type: "",
// base64: fileJson
// }
// ];
// let req = {
// fileArray: fileArray,
// // scopeOfAdministrative: vm.getScope("administrative")
// scopeOfAdministrative: vm.regio
// };
// console.log("req", req);
openLoading(vm);
// let params = {
// // id: vm.circleId,
// id: 50,
// file: fileArray
// };
let formData = new FormData();
formData.append("circleId", 50);
formData.append("file", file);
// let files = new window.File();
uploadOrg(formData).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.$message({
type: 'success',
message: '导入成功!'
});
} }
else {
this.$message({
type: 'error',
message: '导入失败!'
});
}
// vm.setDialog(res);
});
// };
// reader.readAsDataURL(file);
},
} }
} }
</script> </script>
......
...@@ -5,6 +5,16 @@ ...@@ -5,6 +5,16 @@
<i class="el-icon-circle-plus-outline" @click="dialogMemberFn()"></i> <i class="el-icon-circle-plus-outline" @click="dialogMemberFn()"></i>
<i class="text" @click="dialogMemberFn()">添加人员</i> <i class="text" @click="dialogMemberFn()">添加人员</i>
</el-col> </el-col>
<el-col class="add-organization" >
<el-upload
class="bg-uploader"
action="#"
:show-file-list="false"
:before-upload="beforeUploadDoc">
<i class="el-icon-document-add"></i>
<i class="text">批量导入</i>
</el-upload>
</el-col>
<el-col class="organization-search"> <el-col class="organization-search">
<el-form :inline="true" :model="formOrganization" class="demo-form-inline" > <el-form :inline="true" :model="formOrganization" class="demo-form-inline" >
<el-form-item label="机构:"> <el-form-item label="机构:">
...@@ -96,6 +106,7 @@ import * as operationData from "@/utils/operation"; ...@@ -96,6 +106,7 @@ import * as operationData from "@/utils/operation";
import { openLoading, closeLoading } from "@/utils/utils"; import { openLoading, closeLoading } from "@/utils/utils";
import { doUpload, getFilePath } from "@/utils/qiniu-util"; import { doUpload, getFilePath } from "@/utils/qiniu-util";
import { mpRelSearch, mprDeleteOrg } from '@/utils/yqrange/memberApi'; import { mpRelSearch, mprDeleteOrg } from '@/utils/yqrange/memberApi';
import { uploadDoc } from '@/utils/yqrange/yqrangeApi';
import addMember from './addMember.vue' import addMember from './addMember.vue'
let vm = null; let vm = null;
export default { export default {
...@@ -297,7 +308,61 @@ export default { ...@@ -297,7 +308,61 @@ export default {
addPeople() { addPeople() {
this.dialogOrg = false this.dialogOrg = false
this.initRange() this.initRange()
},
// 批量导入
beforeUploadDoc(file) {
console.log(file);
let arr = file.type.split("/");
let ext = "." + arr[1];
let name = file.name;
let reader = new FileReader();
reader.onload = function(e) {
let fileJson = {
fileName: file.name,
file: e.target.result.substr(e.target.result.indexOf("base64,") + 7),
ext: ext
};
let fileArray = [
{
type: "",
base64: fileJson
}
];
// let req = {
// fileArray: fileArray,
// // scopeOfAdministrative: vm.getScope("administrative")
// scopeOfAdministrative: vm.regio
// };
console.log("req", req);
openLoading(vm);
let params = {
id: vm.circleId,
file: fileJson
};
uploadDoc(params).then(res => {
closeLoading(vm);
if (res.code == "000000") {
this.$message({
type: 'success',
message: '导入成功!'
});
} }
else {
this.$message({
type: 'error',
message: '导入失败!'
});
}
// vm.setDialog(res);
});
};
reader.readAsDataURL(file);
},
} }
} }
</script> </script>
......
...@@ -63,6 +63,7 @@ const editRange = r => require.ensure([], () => r(require('../views/yqrange/edit ...@@ -63,6 +63,7 @@ const editRange = r => require.ensure([], () => r(require('../views/yqrange/edit
const createLive = r => require.ensure([], () => r(require('../views/yqrange/create-live.vue')), 'create-live') const createLive = r => require.ensure([], () => r(require('../views/yqrange/create-live.vue')), 'create-live')
const blackListManage = r => require.ensure([], () => r(require('../views/yqrange/blacklist-manage.vue')), 'blacklist-manage') const blackListManage = r => require.ensure([], () => r(require('../views/yqrange/blacklist-manage.vue')), 'blacklist-manage')
const adminManage = r => require.ensure([], () => r(require('../views/yqrange/admin-manage.vue')), 'admin-manage') const adminManage = r => require.ensure([], () => r(require('../views/yqrange/admin-manage.vue')), 'admin-manage')
const rangeNotice = r => require.ensure([], () => r(require('../views/yqrange/range-notice.vue')), 'rangeNotice')
const shopList = r => require.ensure([], () => r(require('../views/shop/shop-list.vue')), 'shop-list') const shopList = r => require.ensure([], () => r(require('../views/shop/shop-list.vue')), 'shop-list')
const createShop = r => require.ensure([], () => r(require('../views/shop/create-shop.vue')), 'create-shop') const createShop = r => require.ensure([], () => r(require('../views/shop/create-shop.vue')), 'create-shop')
...@@ -249,6 +250,10 @@ export default [{ ...@@ -249,6 +250,10 @@ export default [{
path: '/range-manage', path: '/range-manage',
component: rangeManage component: rangeManage
}, },
{
path: '/range-notice',
component: rangeNotice
},
{ {
path: '/create-live', path: '/create-live',
component: createLive component: createLive
......
import {isEmptyUtils, isNotEmptyUtils, subString} from "./utils";
import fetchQiniu from './fetch-qiniu.js';
import { getQiniuToken1, uploadVideo, uploadImg } from './index'
import fetch from "./fetch";
let fileApiUrl = getQiniuToken1()
//该对象有一个 unsubscribe 方法取消订阅,同时终止上传行为。
let subscription = null;
//上传返回结果
let result = {
key: null,//文件保存在空间中的资源名
path: null,//保存到db的路径(不带域名)
fullPath: null,//文件网络路径(文件url)
size: null,//资源尺寸,单位为字节
name: null,//原始文件名
ext: null//上传资源的后缀名,通过自动检测的mimeType 或者原文件的后缀来获取
};
//上传状态
// var status = false;
//FIXME 请注意vue里面不要使用全局变量
let domain = uploadVideo() // 视频
let domain1 = uploadImg() // 图片
let errorCode = new Map([
[298,'部分操作执行成功'],
[400,'请求报文格式错误'],
[401,'认证授权失败'],
[403,'权限不足,拒绝访问。'],
[404,'资源不存在'],
[405,'请求方式错误'],
[406,'上传的数据 CRC32 校验错误'],
[413,'请求资源大小大于指定的最大值'],
[419,'用户账号被冻结'],
[478,'镜像回源失败'],
[502,'错误网关'],
[503,'服务端不可用'],
[504,'服务端操作超时'],
[573,'单个资源访问频率过高'],
[579,'上传成功但是回调失败'],
[599,'服务端操作失败'],
[608,'资源内容被修改'],
[612,'指定资源不存在或已被删除'],
[614,'目标资源已存在'],
[630,'已创建的空间数量达到上限,无法创建新空间。'],
[631,'指定空间不存在'],
[640,'调用列举资源(list)接口时,指定非法的marker参数。'],
[701,'在断点续上传过程中,后续上传接收地址不正确或ctx信息已过期。']
]);
let qiniuErrorCheck = function (code) {
errorCode.forEach(function (value, key, map) {
if (code === key){
console.error(key+':'+value)
}
})
}
//用来限制上传文件类型,为 null 时表示不对文件类型限制;限制类型放到数组里: ["image/png", "image/jpeg", "image/gif"]
let mimeTypeArray = null;
export const createFilePath = (file, fileName) => {
if (isEmptyUtils(file)) {
return null;
}
let arr = fileName.split('_');
if(arr.length != 4){
alert('上传视频文件名格式不正确');
return null;
}
let arr4 = arr[3].split('.');
//文件全路径(文件路径 + 文件名) 扩展名​/年/月/日/
let filePath = arr[0] + "/" + arr[1] + "/" + arr[2] + "_" + arr4[0] + '.'+arr4[1];
console.log(filePath);
return filePath;
};
/**
* 获取七牛上传凭证
*
* @return {Promise} token 七牛上传凭证
* */
const doQiniuAction1 = (fileType) => {
console.log('send---'+fileApiUrl);
return new Promise(function (resolve, reject) {
// if(isEmptyUtils(localStorage.getItem('qiniuToken'))){
fetchQiniu(fileApiUrl, {"fileType": fileType}, 'GET').then(function (result) {
let token = null;
if (isNotEmptyUtils(result) && result.code == "000000") {
token = result.data.qiniuToken;
resolve(token);
console.log('七牛临时授权成功');
localStorage.setItem('qiniuToken',token);
} else {
reject(result);
console.error('七牛临时授权失败:', result);
}
}).catch(function (error) {
reject();
console.error('七牛临时授权失败:', error);
});
// }else{
// console.log('从localStorage获取token:'+localStorage.getItem('qiniuToken'))
// resolve(localStorage.getItem('qiniuToken'));
// }
});
};
/**
*
* @param self
* @param file
* @param filePath
* @param previewId
* @param progressId
* @returns {Promise}
*/
export const qiniuUpload = (self, file, filePath, previewId, progressId) => {
// var deferred = $q.defer();
return new Promise(function (resolve, reject) {
if (isEmptyUtils(file) || isEmptyUtils(filePath)) {
console.error('七牛上传失败:非法参数');
reject();
}
let key = filePath ? filePath : getFilePath(file);
//修改状态为上传
self.qiniuUploadStatus = true;
// let token = "BRVB4TpxVFA5Wo6lIpfltmWKOltzGar46tvC3BlR:UHn0LDElwjP4jEZTXdq_1qV6_hw=:eyJzY29wZSI6InBpY2EtdGVzdCIsInJldHVybkJvZHkiOiJ7XCJrZXlcIjpcIiQoa2V5KVwiLFwiaGFzaFwiOlwiJChldGFnKVwiLFwiYnVja2V0XCI6XCIkKGJ1Y2tldClcIixcImZzaXplXCI6JChmc2l6ZSksXCJmbmFtZVwiOiQoZm5hbWUpLFwiZXh0XCI6JChleHQpfSIsImRlYWRsaW5lIjoxNTI5NDk0MTc1fQ==";
doQiniuAction().then(function (token) {
let putExtra = {
fname: file.name, //原文件名
params: {}, //用来放置自定义变量
mimeType: mimeTypeArray || null //null || array,用来限制上传文件类型,为 null 时表示不对文件类型限制;限制类型放到数组里: ["image/png", "image/jpeg", "image/gif"]
};
let config = {
useCdnDomain: true, //表示是否使用 cdn 加速域名,为布尔值,true 表示使用,默认为 false。
region: null //选择上传域名区域;当为 null 或 undefined 时,自动分析上传域名区域
};
/*
* qiniu.upload 返回一个 observable 对象用来控制上传行为,observable 对像通过 subscribe 方法可以被 observer 所订阅,
* 订阅同时会开始触发上传,同时返回一个 subscription 对象,该对象有一个 unsubscribe 方法取消订阅,同时终止上传行为。
* */
let observable = qiniu.upload(file, key, token, putExtra, config);
/**
* 接收上传进度信息,res 参数是一个带有 total 字段的 object,包含loaded、total、percent三个属性,提供上传进
* total.loaded: number,已上传大小,单位为字节。
* total.total: number,本次上传的总量控制信息,单位为字节,注意这里的 total 跟文件大小并不一致。
* total.percent: number,当前上传进度,范围:0~100
* */
let next = function (res) {
//res值{"total":{"loaded":18184,"size":18185,"percent":99.99450096233159}}
//获取百分比进度
let progress = res.total.percent.toFixed(2);
self.uploadProgress = Number(progress);
console.log('Progress1: ' + progress);
//如果有进度条
/*if (isNotEmptyUtils(progressId)) {
let obj = $("#" + progressId);
//开始上传时,显示进度条
if (isNotEmptyUtils(obj.parent())) {
//修改状态为上传
// status = true;
self.qiniuUploadStatus = true;
obj.parent().removeClass("hidden");
obj.fadeIn("fast");
}
obj.css("width", progress + '%');
obj.text(progress + '%');
//上传完成,2秒后淡出进度条
if (progress === "100.00") {
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = true;
obj.fadeOut(2000);
}
}*/
};
/**
* 接收上传完成后的后端返回信息,res 参数为一个 object, 为上传成功后后端返回的信息
* ,具体返回结构取决于后端sdk的配置,可参考上传策略(https://developer.qiniu.com/kodo/manual/1206/put-policy)
* */
let complete = function (res) {
console.log("七牛上传完成");
setTimeout(function(){
result.key = res.key;
result.path = '/' + res.key;
result.fullPath = domain + '/' + res.key + '?v=' + new Date().getTime();
result.size = res.fsize;
result.name = res.fname ;
result.ext = res.ext;
// deferred.resolve(result);
resolve(result);
// self.model.qCloudUrl = result.fullPath;
// $("#introVideoLecture").attr("src", self.model.qCloudUrl);
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = false;
if (isNotEmptyUtils(previewId)) {
let address = domain + result.path;
console.log('文件路径: ' + address);
//显示图片
let $img = $('<img>').attr("src", address);
let obj = $("#" + previewId);
obj.empty().append($img);
obj.css('max-width', '100%');
}
},2000);
};
/**
* 上传错误后触发,当不是 xhr 请求错误时,会把当前错误产生原因直接抛出,诸如 JSON 解析异常等;当产生 xhr 请求错误时,参数 err 为一个包含 code、message、isRequestError 三个属性的 object:
* err.isRequestError: 用于区分是否 xhr 请求错误;当 xhr 请求出现错误并且后端通过 HTTP 状态码返回了错误信息时,该参数为 true;否则为 undefined 。
* err.reqId: string,xhr请求错误的 X-Reqid。
* err.code: number,请求错误状态码,只有在 err.isRequestError 为 true 的时候才有效,可查阅码值对应说明。
* err.message: string,错误信息,包含错误码,当后端返回提示信息时也会有相应的错误信息。
* */
let error = function (err) {
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = false
localStorage.removeItem('qiniuToken');
console.log("七牛上传失败,详细信息请参考:https://developer.qiniu.com/kodo/api/3928/error-responses");
//输出简略错误信息
if (err.isRequestError){
qiniuErrorCheck(err.code)
}else {
console.error(err);
}
/*modalClick("提示", "上传失败!", "确定", function () {
$('#model-modify').modal('hide');
}, "", null);*/
// deferred.reject(new Error('七牛上传失败'));
// return deferred.promise;
return reject(new Error('七牛上传失败'));
};
// 上传开始
subscription = observable.subscribe(next, error, complete);
});
// return deferred.promise;
});
};
/**
* 获取时间戳
* @param {Date} [date]日期对象,为空时,返回当前时间戳
* @return {String} timeStamp时间戳 格式:yyyyMMddhhmmssS
*/
const timeStamp = (date) => {
if (isEmptyUtils(date)) {
return new Date().format('yyyyMMddhhmmssS');
}
return date.format('yyyyMMddhhmmssS');
}
/**
* 获取全局唯一标识符(GUID,Globally Unique Identifier)
* @return {String} guid
*/
const guid = () => {
/**
* @return {String}
*/
function S4() {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
};
/**
* 文件重命名--七牛图片 2018 11
* @param {File} [file] 上传文件对象
* @param {String} [fileName] 指定文件名
* @param {String} [folder] 指定文件夹
* @return {String} fileName
*/
export const getFilePath = (file,fileName,folder) => {
if (isEmptyUtils(file)) {
return null;
}
//文件类型
var ext = file.type;
//后缀名
var suffix = file.name.substring(file.name.lastIndexOf(".") + 1);
//若为空则从name中获取---对wps格式的文件获取不到file.type
if (isEmptyUtils(ext)) {
ext = suffix;
}
//获取当前日期对象
var date = new Date();
if (isEmptyUtils(fileName)) {
//重命名后的文件名
fileName = timeStamp(date) + "-" + subString(guid(), 8) + "." + suffix;
}
//文件全路径(文件路径 + 文件名) 扩展名​/年/月/日/
// var filePath = ext + "/" + date.format('yyyy/MM/dd') + "/" + (isEmptyUtils(folder) ? "" : (folder + "/")) + fileName;
//var filePath = ext + "/" + "common/" + file.name.split('.')[0] + '-' + timeStamp(date) + "." + suffix;
var filePath = ext + "/" + "protal/project/" + timeStamp(date) + "." + suffix;
console.log('filePath==============',filePath);
return filePath;
}
/**
*七牛上传图片、视频、文件 2018 11 hws
* @param self
* @param file
* @param filePath
* @param previewId
* @param progressId
* @param fileType 1--图片和文件 空为视频
* @returns {Promise}
*/
export const doUpload = (self, file, filePath, previewId, progressId, fileType) => {
return new Promise(function (resolve, reject) {
if (isEmptyUtils(file) || isEmptyUtils(filePath)) {
console.error('七牛上传失败:非法参数');
reject();
}
let key = filePath ? filePath : getFilePath(file);
//修改状态为上传
self.qiniuUploadStatus = true;
doQiniuAction1(fileType).then(function (token) {
let putExtra = {
fname: file.name, //原文件名
params: {}, //用来放置自定义变量
mimeType: mimeTypeArray || null //null || array,用来限制上传文件类型,为 null 时表示不对文件类型限制;限制类型放到数组里: ["image/png", "image/jpeg", "image/gif"]
};
let config = {
useCdnDomain: true, //表示是否使用 cdn 加速域名,为布尔值,true 表示使用,默认为 false。
region: null, //选择上传域名区域;当为 null 或 undefined 时,自动分析上传域名区域
chunkSize: 600
};
/*
* qiniu.upload 返回一个 observable 对象用来控制上传行为,observable 对像通过 subscribe 方法可以被 observer 所订阅,
* 订阅同时会开始触发上传,同时返回一个 subscription 对象,该对象有一个 unsubscribe 方法取消订阅,同时终止上传行为。
* */
let observable = qiniu.upload(file, key, token, putExtra, config);
/**
* 接收上传进度信息,res 参数是一个带有 total 字段的 object,包含loaded、total、percent三个属性,提供上传进
* total.loaded: number,已上传大小,单位为字节。
* total.total: number,本次上传的总量控制信息,单位为字节,注意这里的 total 跟文件大小并不一致。
* total.percent: number,当前上传进度,范围:0~100
* */
let next = function (res) {
//res值{"total":{"loaded":18184,"size":18185,"percent":99.99450096233159}}
//获取百分比进度
let progress = res.total.percent.toFixed(2);
self.uploadProgress = Number(progress);
if(progressId == 'uploadProgress1') {
self.uploadProgress1 = Number(progress);
}
if(progressId == 'uploadProgress2') {
self.uploadProgress2 = Number(progress);
}
console.log('Progress2: ' + progress);
};
/**
* 接收上传完成后的后端返回信息,res 参数为一个 object, 为上传成功后后端返回的信息
* ,具体返回结构取决于后端sdk的配置,可参考上传策略(https://developer.qiniu.com/kodo/manual/1206/put-policy)
* */
let complete = function (res) {
console.log("七牛上传完成");
setTimeout(function(){
result.key = res.key;
result.path = '/' + res.key;
if(!fileType) { // 图片 文件
console.log('---domain-------',domain)
result.fullPath = domain + '/' + res.key;
}else{ // 视频
console.log('----domain1------',domain1)
result.fullPath = domain1 + '/' + res.key;
}
result.size = res.fsize;
result.name = res.fname ;
result.ext = res.ext;
resolve(result);
self.qiniuUploadStatus = false;
},500);
};
/**
* 上传错误后触发,当不是 xhr 请求错误时,会把当前错误产生原因直接抛出,诸如 JSON 解析异常等;当产生 xhr 请求错误时,参数 err 为一个包含 code、message、isRequestError 三个属性的 object:
* err.isRequestError: 用于区分是否 xhr 请求错误;当 xhr 请求出现错误并且后端通过 HTTP 状态码返回了错误信息时,该参数为 true;否则为 undefined 。
* err.reqId: string,xhr请求错误的 X-Reqid。
* err.code: number,请求错误状态码,只有在 err.isRequestError 为 true 的时候才有效,可查阅码值对应说明。
* err.message: string,错误信息,包含错误码,当后端返回提示信息时也会有相应的错误信息。
* */
let error = function (err) {
//修改状态为非上传
// status = false;
self.qiniuUploadStatus = false
localStorage.removeItem('qiniuToken');
console.log("七牛上传失败,详细信息请参考:https://developer.qiniu.com/kodo/api/3928/error-responses");
//输出简略错误信息
if (err.isRequestError){
qiniuErrorCheck(err.code)
}else {
console.error(err);
}
return reject(new Error('七牛上传失败'));
};
// 上传开始
subscription = observable.subscribe(next, error, complete);
});
// 保存到全局对象
window.QNSubscription = subscription;
});
};
// 取消上传
export const unsubscribe = () => {
subscription.unsubscribe();
}
...@@ -111,3 +111,33 @@ export const getImages = (params) => { ...@@ -111,3 +111,33 @@ export const getImages = (params) => {
}) })
}; };
export const uploadOrg = (params) => {
return fetch({
headers,
url: getBaseUrl(`circle/import/hospitals`),
method: 'post',
data: params,
description: '批量导入机构',
})
};
export const uploadDoc = (params) => {
return fetch({
headers,
url: getBaseUrl(`circle/circle/import/${params.id}/doctors`),
method: 'post',
data: params,
description: '批量导入人员',
})
};
export const searchDoc = (params) => {
return fetch({
headers,
url: getBaseUrl(`circle/circle/doctor/search?circleId=${params.id}&name=${params.name}`),
method: 'get',
description: '直播搜索主播或者嘉宾',
})
};
...@@ -416,6 +416,8 @@ ...@@ -416,6 +416,8 @@
placeholder="请输入姓名" placeholder="请输入姓名"
style="width:85%;" style="width:85%;"
:disabled="liveEditFlag" :disabled="liveEditFlag"
@input="handleInputSearch(formData.lecturesUserName)"
@blur="handleSearchListBlur"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -448,6 +450,8 @@ ...@@ -448,6 +450,8 @@
placeholder="请输入姓名" placeholder="请输入姓名"
style="width:85%;" style="width:85%;"
:disabled="guestEditFlag" :disabled="guestEditFlag"
@input="handleInputSearch(item.username)"
@blur="handleSearchListBlur"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -489,6 +493,39 @@ ...@@ -489,6 +493,39 @@
</div> </div>
</div> </div>
<div class="main-content">
<div class="left-box left">
<!-- 搜索列表 有搜索结果时-->
<div
v-if="searchList && searchList.length > 0"
class="search-list-wrap"
v-infinite-scroll="loadMore"
:infinite-scroll-disabled="busy"
infinite-scroll-distance="5"
infinite-scroll-immediate-check="false"
>
<ul class="search-list">
<li v-for="(searchLi, index) in searchList" @mousedown="handleSearchLiClick(searchLi)">
<div class="left">
<p class="disease-name" v-html="searchLi.diseaseName"></p>
<div class="one-line">
<p class="alias" v-html="searchLi.alias"></p>
<p class="sign" v-if="searchLi.alias">|</p>
<p class="code">{{searchLi.icdCode}}</p>
</div>
</div>
<div class="right" v-if="isSearchLiSelected(searchLi)"><i class="el-icon-check"></i></div>
</li>
<p v-if="busy" class="loading">加载中...</p>
<p v-if="noMore" class="loading">没有更多了...</p>
</ul>
</div>
</div>
</div>
<el-dialog <el-dialog
class="dialog-title-border-old" class="dialog-title-border-old"
title="图片裁剪" title="图片裁剪"
...@@ -564,7 +601,7 @@ ...@@ -564,7 +601,7 @@
import { isEmptyUtils, openLoading, closeLoading } from "../../utils/utils"; import { isEmptyUtils, openLoading, closeLoading } from "../../utils/utils";
import { doUpload, getFilePath, unsubscribe} from "../../utils/qiniu-util"; import { doUpload, getFilePath, unsubscribe} from "../../utils/qiniu-util";
import { checkMobile } from '../../utils/patients/checkValid'; import { checkMobile } from '../../utils/patients/checkValid';
import { getRtcInfo, getImages } from "../../utils/yqrange/yqrangeApi"; import { getRtcInfo, getImages, searchDoc} from "../../utils/yqrange/yqrangeApi";
import Cropper from '@/components/common/cropper.vue' import Cropper from '@/components/common/cropper.vue'
// import { ossUpload, getFilePathForOSS } from "@/utils/oss/ossUtil"; // import { ossUpload, getFilePathForOSS } from "@/utils/oss/ossUtil";
// import { checkPhone } from "../login.vue"; // import { checkPhone } from "../login.vue";
...@@ -709,7 +746,8 @@ ...@@ -709,7 +746,8 @@
// 一天是24*60*60*1000 = 86400000 = 8.64e7 // 一天是24*60*60*1000 = 86400000 = 8.64e7
// console.log('this.maxDate',this.maxDate) // console.log('this.maxDate',this.maxDate)
return time.getTime() < Date.now() - 8.64e7 return time.getTime() < Date.now() - 8.64e7
} },
searchList: null
}, },
rules: { rules: {
name: [ name: [
...@@ -1914,7 +1952,58 @@ ...@@ -1914,7 +1952,58 @@
else if(this.formData.signMinute > 1000){ else if(this.formData.signMinute > 1000){
this.formData.signMinute = 1000; this.formData.signMinute = 1000;
} }
},
// 搜索框中输入文字 时 page=1 pageSize=30
handleInputSearch(name) {
// debugger;
clearTimeout(this.searchFlagTimer);
let that = this;
that.page = 1;
that.isInputResponse = false;
if( that.searchInput == ''){
that.searchList = [];
return;
}
that.searchList = [];
let params = {
id: this.circleId,
name: name
};
this.searchFlagTimer = setTimeout(() => {
searchDoc(params).then(res => {
// console.log('>>>>>>*********** search: ', res)
if(res.code == '000000'){
that.isInputResponse = true;
that.totalPageNum = Math.ceil(res.data.total/that.pageSize); // 总页数
let list = res.data.icdContentsList || [];
if(list.length > 0){
if(that.searchInput == ''){
that.searchList = [];
return;
}
that.searchList = list;
that.hasNoResult = false;
}else{
that.searchList = [];
that.hasNoResult = true;
}
}else{
that.isInputResponse = false;
that.searchList = [];
that.$message({
message: data.message,
type: 'warning'
});
} }
})
}, 300)
},
handleSearchListBlur() {
this.searchList = [];
clearTimeout(this.searchFlagTimer);
// console.log('blur.....')
},
}, },
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
dynamicFlag: '', dynamicFlag: '',
idType: localStorage.getItem("storageIdType"), idType: localStorage.getItem("storageIdType"),
roleType: null, roleType: null,
type: null type: 0
} }
} }
}, },
......
...@@ -1003,9 +1003,6 @@ export default { ...@@ -1003,9 +1003,6 @@ export default {
}) })
.then(() => { .then(() => {
// confirm // confirm
let req = {
rtcId: row.id
};
vm.DELETE("rtc/liveAdmin/" + row.id, {}).then(res => { vm.DELETE("rtc/liveAdmin/" + row.id, {}).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
vm.$message({ vm.$message({
......
<template>
<div class="yqrange-index-wrapper">
<bread-crumb :curmbFirst="curmbFirst"></bread-crumb>
<div class="yqrange-index-content">
<el-form ref="searchForm" :model="searchForm" label-width="75px" label-suffix=":" :inline="true">
<el-row :gutter="30" type="flex" style="margin-top: 10px">
<el-col :span="8">
<el-form-item label="姓名">
<el-input v-model="searchForm.name" size="small" placeholder="请输入圈子名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="创建时间">
<el-date-picker
v-model="searchForm.createdTime"
size="small"
type="date"
placeholder="请选择创建时间"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="7" style="text-align: right">
<el-button type="primary" size="small" @click="search">搜索</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">取消搜索</el-button>
</el-col>
</el-row>
</el-form>
<el-table :data="tableData" class="item-table" style="width: 100%;margin-top: 10px;">
<el-table-column prop="id" label="姓名" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" min-width="100" align="center">
<template slot-scope="scope">
<span>{{ scope.row.createdTime | liveDateFilter }}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="请求加入圈子名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="numberOfPeople" label="机构姓名" min-width="100" align="center"></el-table-column>
<el-table-column prop="dynamicFlag" label="职位" min-width="100" align="center">
</el-table-column>
<el-table-column prop="status" label="地区" min-width="100" align="center">
</el-table-column>
<el-table-column label="操作" min-width="370" align="center">
<template slot-scope="scope">
<div v-if="scope.row.status != 50">
<el-button @click="deleteRange(scope.row)" type="text" size="small" v-if="showAllFlag && scope.row.status != 0">通过</el-button>
<el-button @click="rangeManage(scope.row)" type="text" size="small" v-if="scope.row.status != 0">拒绝</el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleNumChange"
:current-page="searchForm.pageNo"
:page-sizes="[10, 30, 50, 100]"
:page-size="searchForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalRows"
></el-pagination>
</div>
<el-dialog
title="应用配置"
:visible.sync="dialogSettingVisible"
width="500px"
:close-on-click-modal="false"
@close="handleSettingClose"
center>
<el-form ref="settingForm" :model="settingForm"
label-width="150px"
label-suffix=":"
class="basic-form">
<div v-for="(item, index) in settingForm.settingData" :key="index">
<el-form-item :label="item.appTagName">
<el-radio-group size="small" v-model="item.showOff">
<el-radio :label="1">开启</el-radio>
<el-radio :label="0">关闭</el-radio>
</el-radio-group>
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: right;">
<el-button type="primary" @click="save" center>保存</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue";
import { getRangeList,updateRangeStatus, getCircleSettingList, saveCircleSetting} from "../../utils/yqrange/yqrangeApi";
export default {
components: {
BreadCrumb
},
data(){
return{
curmbFirst: '云鹊小圈',
showAllFlag: false,
showNewFlag: false,
searchForm: {
name: '',
createdTime: '',
// endTime: '',
userType: "", // 用户标识 1:内部用户 2:外部用户,
status: "",
pageNo: 1,
pageSize: 10,
},
totalRows: 0,
tableData: [],
dialogSettingVisible: false,
settingForm:{
circleId: null,
settingData: []
}
}
},
created() {
this.initPrivilege();
this.search();
},
methods: {
initPrivilege(){
let idType = localStorage.getItem('storageIdType');
// if(idType == null || idType == ""){
// idType = 2;
// localStorage.setItem('storageIdType', idType);
// }
this.searchForm.userType = idType;
// 内部用户:运营人员
if(idType == "1"){
this.showAllFlag = true;
this.showNewFlag = true;
}
// 外部用户
else if(idType == "2"){
this.showAllFlag = false;
setTimeout(() => {
this.getUserAuth();
},1500)
}
},
// 外部用户权限
getUserAuth(){
let highMainManager = localStorage.getItem('highMainManager');
let mainManager = localStorage.getItem('mainManager');
let manager = localStorage.getItem('manager');
if(highMainManager == "1" || mainManager == "1"){
this.showNewFlag = true;
}
else if(manager == "1"){
this.showNewFlag = false;
}
// localStorage.setItem('ordinary', vm.setStoreData(ordinary))
},
// 搜索
search(){
this.searchForm.pageNo = 1;
this.searchList();
},
searchList() {
openLoading(this);
let params = this.searchForm;
console.log('查询圈子')
getRangeList(params).then((res) => {
closeLoading(this);
if(res.code == "000000") {
this.tableData = res.data.circleList;
this.totalRows = res.data.count;
} else {
this.tableData = [];
}
}).catch((error) => {
// this.$message({
// message: error,
// type: 'error'
// });
this.$message.error("请重试");
})
},
resetForm() {
this.searchForm.name = "";
this.searchForm.createdTime = "";
console.log('重置')
this.search();
},
//新建小圈
createRange() {
let enterType = 1;//1:add 2 edit
this.$router.push({
path: `/create-range?enterType=${enterType}`
})
},
//上线
publishRange(row) {
this.$confirm(`上线后圈子成员将收到入圈消息提醒(每天最多提醒一次),确定上线“${row.name}”吗?`, '', {
confirmButtonText: '上线',
cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
// confirm
this.updateStatus(row.id, "30");
}).catch(() => {
// cancel
// this.$message.error("上线失败");
});
},
//下线
unPublishRange(row) {
this.$confirm(`确定下线“${row.name}”吗?`, '', {
confirmButtonText: '下线',
cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
this.updateStatus(row.id, "40");
// confirm
}).catch(() => {
// cancel
});
},
// 更新圈子状态(上线,下线)
updateStatus(id, status){
let params = {"id": id, "status": status};
updateRangeStatus(params).then((res) => {
closeLoading(this);
if(res.code == "000000") {
if(status == "40"){
this.$message.success("下线成功");
} else if(status == "30") {
this.$message.success("上线成功");
}else if(status == "50") {
this.$message.success("解散成功");
}
this.searchList();
} else {
if(status == "40"){
this.$message.error("下线失败,请重试");
} else if(status == "30") {
this.$message.error("上线失败,请重试");
}else if(status == "50") {
this.$message.error("解散失败,请重试");
}
}
}).catch((error) => {
// this.$message({
// message: error,
// type: 'error'
// });
if(status == "40"){
this.$message.error("下线失败,请重试");
} else if(status == "30") {
this.$message.error("上线失败,请重试");
}else if(status == "50") {
this.$message.error("解散失败,请重试");
}
})
},
rangeManage(row) {
this.$router.push({
path: '/range-manage',
query: {
id: row.id,
name: row.name,
activeName: 'first',
roleType: row.roleId
}
})
},
//直播管理
liveManage(row) {
this.$router.push({
path: '/live-manage?id=' + row.id,
})
},
//成员管理
roleManage(row) {
this.$router.push({
path: '/role-manage?id=' + row.id,
})
},
//编辑
editRange(row) {
let enterType = 2;//1:add 2 edit
this.$router.push({
path: `/create-range?enterType`,
query:{
id:row.id,
enterType:enterType,
roleType: row.roleId
}
})
},
//解散圈子
deleteRange(row) {
this.$confirm(`解散后圈子内的动态/直播等内容将不会保存`, `确定解散“${row.name}”吗?`, {
confirmButtonText: '解散',
cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
this.updateStatus(row.id, "50");
// confirm
}).catch(() => {
// cancel
});
},
// 应用配置
setting(row){
this.dialogSettingVisible = true;
this.settingForm.circleId = row.id;
let params = {
circleId: this.settingForm.circleId
// circleId: 22
}
getCircleSettingList(params).then((res) => {
closeLoading(this);
if(res.code == "000000") {
this.settingForm.settingData = res.data;
} else {
this.settingForm.settingData = [];
}
if(this.settingForm.settingData == [] || this.settingForm.settingData.length == 0){
this.settingForm.settingData = [{
appTag: 1,
showOff: 1
},
{
appTag: 2,
showOff: 1
},
{
appTag: 3,
showOff: 1
},
{
appTag: 4,
showOff: 1
}];
}
for(let i = 0; i < this.settingForm.settingData.length; i++){
if(this.settingForm.settingData[i].appTag == 1){
this.settingForm.settingData[i].appTagName = "教培"
}
else if(this.settingForm.settingData[i].appTag == 2){
this.settingForm.settingData[i].appTagName = "直播"
}
else if(this.settingForm.settingData[i].appTag == 3){
this.settingForm.settingData[i].appTagName = "继教课程"
}
else if(this.settingForm.settingData[i].appTag == 4){
this.settingForm.settingData[i].appTagName = "职称培训"
}
}
}).catch((error) => {
this.$message.error("请重试");
})
},
// 关闭
handleSettingClose(){
this.dialogSettingVisible = false;
},
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.search();
},
handleNumChange(val) {
this.searchForm.pageNo = val;
this.searchList();
},
// 保存
save(){
let params = {
apps: this.settingForm.settingData,
circleId: this.settingForm.circleId
}
saveCircleSetting(params).then((res) => {
closeLoading(this);
if(res.code == "000000") {
this.$message.success("保存成功!");
this.dialogSettingVisible = false;
}
}).catch((error) => {
this.$message.error("请重试");
})
}
},
}
</script>
<style lang="scss">
.yqrange-index-wrapper{
.yqrange-index-content{
background: #fff;
padding: 10px;
.header-title{
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
}
.el-button--text{
color: #449284;
font-size: 14px;
&::after{
content: '';
position: relative;
height: 14px;
/*border-right: 1px solid #EBEEF5;*/
border-right: 1px solid #aaaaaa;
padding-right: 10px;
}
&:last-of-type{
&::after{
content: '';
position: relative;
width: 1px;
height: 14px;
border-right: none;
}
}
}
}
/*.range-make-box{*/
/*.el-message-box__btns{*/
/*margin-top: 30px;*/
/*}*/
/*}*/
</style>
<template> <template>
<div class="yqrange-index-wrapper"> <div class="yqrange-index-wrapper">
<bread-crumb :curmbFirst="curmbFirst"></bread-crumb> <bread-crumb :curmbFirst="curmbFirst"></bread-crumb>
<div class="yqrange-index-content screenSet" id="screenSet"> <div class="yqrange-index-content screenSet">
<div class="header-title">云鹊小圈</div> <el-tabs v-model="activeName" @tab-click="tabChangeHandler">
<el-tab-pane label="云鹊小圈" name="first">
<el-form ref="searchForm" :model="searchForm" label-width="75px" label-suffix=":" :inline="true"> <el-form ref="searchForm" :model="searchForm" label-width="75px" label-suffix=":" :inline="true">
<el-row :gutter="30" type="flex" style="margin-top: 10px"> <el-row :gutter="30" type="flex" style="margin-top: 10px">
<el-col :span="8"> <el-col :span="8">
...@@ -114,8 +115,17 @@ ...@@ -114,8 +115,17 @@
</el-dialog> </el-dialog>
</el-tab-pane>
<el-tab-pane label="审核管理" name="second">
<range-notice></range-notice>
</el-tab-pane>
</el-tabs>
</div> </div>
</div> </div>
...@@ -124,13 +134,18 @@ ...@@ -124,13 +134,18 @@
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue"; import BreadCrumb from "@/components/breadcrumb.vue";
import { getRangeList,updateRangeStatus, getCircleSettingList, saveCircleSetting} from "../../utils/yqrange/yqrangeApi"; import { getRangeList,updateRangeStatus, getCircleSettingList, saveCircleSetting} from "../../utils/yqrange/yqrangeApi";
import ElTabPane from "element-ui/packages/tabs/src/tab-pane";
import RangeNotice from "./range-notice";
export default { export default {
components: { components: {
RangeNotice,
ElTabPane,
BreadCrumb BreadCrumb
}, },
data(){ data(){
return{ return{
curmbFirst: '云鹊小圈', curmbFirst: '云鹊小圈',
activeName: 'first',
showAllFlag: false, showAllFlag: false,
showNewFlag: false, showNewFlag: false,
searchForm: { searchForm: {
...@@ -455,9 +470,13 @@ export default { ...@@ -455,9 +470,13 @@ export default {
this.$message.error("请重试"); this.$message.error("请重试");
}) })
},
getRangeNotice(){
this.$router.push({
path: '/range-notice'
})
} }
}, },
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册