提交 0a707241 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

Merge branch 'dev-eduadmin-20190222' into dev-followUp-20190312

# Conflicts:
#	src/utils/env-config.js
#	src/views/home.vue
...@@ -7,4 +7,3 @@ dist/ ...@@ -7,4 +7,3 @@ dist/
node_modules/ node_modules/
.DS_Store .DS_Store
.vscode .vscode
src/utils/envConfig.js
\ No newline at end of file
...@@ -47,6 +47,7 @@ var webpackConfig = merge(baseWebpackConfig, { ...@@ -47,6 +47,7 @@ var webpackConfig = merge(baseWebpackConfig, {
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: config.build.index, filename: config.build.index,
template: 'index.html', template: 'index.html',
favicon: 'favicon.ico',
inject: true, inject: true,
// minify: { // minify: {
// removeComments: true, // removeComments: true,
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta content="云鹊医,云鹊健康,工作站,项目管理,教培项目,学情报告,随访管理,预约随访" name="keywords">
<meta content="云鹊医工作站用于管理人员的日常操作,支持提交内容审核、管理项目、管理随访计划等功能。" name="description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
<meta name="screen-orientation" content="portrait"/> <meta name="screen-orientation" content="portrait"/>
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
......
...@@ -67,12 +67,14 @@ export default { ...@@ -67,12 +67,14 @@ export default {
localStorage.setItem('storageToken', vm.token) localStorage.setItem('storageToken', vm.token)
vm.$router.push({ path: 'home' }) vm.$router.push({ path: 'home' })
} else { } else {
window.location.href = getLoginUrl() // 没有token返回登录页面 if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl('?from=work&type=logout') // 没有token返回登录页面
return return
} }
}
}else { }else {
if(!localStorage.getItem('storageToken')) { if(!localStorage.getItem('storageToken')) {
window.location.href = getLoginUrl() // 没有token返回登录页面 window.location.href = getLoginUrl('?from=work&type=logout') // 没有token返回登录页面
return return
} }
} }
...@@ -82,7 +84,8 @@ export default { ...@@ -82,7 +84,8 @@ export default {
// 修改token // 修改token
...mapActions([ ...mapActions([
'changeToken', 'changeToken',
'changeIdType' 'changeIdType',
'changeMaster'
]), ]),
// 获取用户权限 // 获取用户权限
getUserAuth(token) { getUserAuth(token) {
...@@ -90,13 +93,18 @@ export default { ...@@ -90,13 +93,18 @@ export default {
req = { req = {
token: token token: token
} }
vm.GET('common/v1/role',req).then((res) => { vm.GET('portal/common/v1/role',req).then((res) => {
if(res.code == '000000') { if(res.code == '000000') {
vm.changeIdType(res.data.idType) vm.changeIdType(res.data.idType)
vm.changeMaster(res.data.masterAdministratorFlag)
localStorage.setItem('storageIdType', res.data.idType)
localStorage.setItem('storageMaster', res.data.masterAdministratorFlag)
vm.idType = res.data.idType vm.idType = res.data.idType
vm.userName = res.data.name vm.userName = res.data.name
vm.portrait = res.data.imageUrl vm.portrait = res.data.imageUrl
vm.authList = res.data.auth vm.authList = res.data.auth
} else {
vm.$message.info(res.message)
} }
}) })
} }
......
// import "@babel/polyfill"; import "@babel/polyfill";
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import routes from './router/router' import routes from './router/router'
......
const common = { const common = {
state: { state: {
_token: '', _token: '',
idType: '' idType: '',
masterAdministratorFlag: false
}, },
mutations: { mutations: {
CHANGE_TOKEN: (state, data) => { CHANGE_TOKEN: (state, data) => {
...@@ -9,6 +10,9 @@ const common = { ...@@ -9,6 +10,9 @@ const common = {
}, },
CHANGE_IDTYPE: (state, data) => { CHANGE_IDTYPE: (state, data) => {
state.idType = data state.idType = data
},
CHANGE_MASTER: (state, data) => {
state.masterAdministratorFlag = data
} }
}, },
actions: { actions: {
...@@ -17,6 +21,9 @@ const common = { ...@@ -17,6 +21,9 @@ const common = {
}, },
changeIdType({ commit }, idTypeData) { changeIdType({ commit }, idTypeData) {
commit('CHANGE_IDTYPE', idTypeData) commit('CHANGE_IDTYPE', idTypeData)
},
changeMaster({ commit }, masterData) {
commit('CHANGE_MASTER', masterData)
} }
} }
} }
......
const getters = { const getters = {
_token: state => state.common._token, _token: state => state.common._token,
idType: state => state.common.idType idType: state => state.common.idType,
masterAdministratorFlag: state => state.common.masterAdministratorFlag
} }
export default getters export default getters
...@@ -125,7 +125,7 @@ html,body{ ...@@ -125,7 +125,7 @@ html,body{
.screenSet{ .screenSet{
// width: 163vh !important; // width: 163vh !important;
// height: 66vh !important; // height: 66vh !important;
height: 430px !important; // height: 430px !important;
margin: 88px 30px 0px; margin: 88px 30px 0px;
overflow: auto; overflow: auto;
} }
...@@ -134,7 +134,7 @@ html,body{ ...@@ -134,7 +134,7 @@ html,body{
.screenSet{ .screenSet{
// width: 166vh !important; // width: 166vh !important;
// height: 78vh !important; // height: 78vh !important;
height: 800px !important; // height: 800px !important;
overflow: auto; overflow: auto;
margin: 88px 30px 0px; margin: 88px 30px 0px;
} }
......
...@@ -9,8 +9,8 @@ export const envConfig = { ...@@ -9,8 +9,8 @@ export const envConfig = {
// baseUrl: 'https://test1-sc.yunqueyi.com/', // baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/', //baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'http://dev-sc.yunqueyi.com/portal/', baseUrl: 'https://dev-sc.yunqueyi.com/',
qiniuFileUrl: "http://localhost:10201/contents/admin/qiniu/token1", qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com", qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html', loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
...@@ -20,7 +20,7 @@ export const envConfig = { ...@@ -20,7 +20,7 @@ export const envConfig = {
followUpSC: 'https://dev-sc.yunqueyi.com' followUpSC: 'https://dev-sc.yunqueyi.com'
}, },
dev: { dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/portal/', baseUrl: 'https://dev-sc.yunqueyi.com/',
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1", qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com", qiniuImgUrl: "https://test1-file.yunqueyi.com",
...@@ -30,33 +30,33 @@ export const envConfig = { ...@@ -30,33 +30,33 @@ export const envConfig = {
followUpSC: 'https://dev-sc.yunqueyi.com' followUpSC: 'https://dev-sc.yunqueyi.com'
}, },
test: { test: {
baseUrl: 'https://test1-sc.yunqueyi.com/portal/', baseUrl: 'https://test1-sc.yunqueyi.com/',
qiniuFileUrl: "https://test1-sc.yunqueyi.com/contents/admin/qiniu/token1", qiniuFileUrl: "https://test1-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com", qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://test1-saas.yunqueyi.com/pica-login/work_station.html', loginUrl: 'https://test1.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html', innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://test-saas.yunqueyi.com/pica_index.html', followUpSC: 'https://test1-sc.yunqueyi.com',
followUpSC: 'https://test1-sc.yunqueyi.com' yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html'
}, },
uat: { uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/portal/', baseUrl: 'https://uat-sc.yunqueyi.com/',
qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1", qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://videos.yunqueyi.com", // 视频 qiniuResourceUrl: "https://video.yunqueyi.com", // 视频
qiniuImgUrl: "https://file.yunqueyi.com", qiniuImgUrl: "https://files.yunqueyi.com",
loginUrl: 'https://uat-saas.yunqueyi.com/pica-login/work_station.html', loginUrl: 'https://uat.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html', innerLoginUrl: 'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://uat-saas.yunqueyi.com/pica_index.html', followUpSC: 'https://uat-sc.yunqueyi.com',
followUpSC: 'https://uat-sc.yunqueyi.com' yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html'
}, },
pro: { pro: {
baseUrl: 'https://sc.yunqueyi.com/portal/', baseUrl: 'https://sc.yunqueyi.com/',
qiniuFileUrl: "https://sc.yunqueyi.com/contents/admin/qiniu/token1", qiniuFileUrl: "https://sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://videos.yunqueyi.com", qiniuResourceUrl: "https://video.yunqueyi.com",
qiniuImgUrl: "https://file.yunqueyi.com", qiniuImgUrl: "https://files.yunqueyi.com",
loginUrl: 'https://saas.yunqueyi.com/pica-login/work_station.html', loginUrl: 'https://yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html', innerLoginUrl: 'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://saas.yunqueyi.com/pica_index.html', followUpSC: 'https://sc.yunqueyi.com',
followUpSC: 'https://sc.yunqueyi.com' yuequeyiIndexUrl: 'https://www.yunqueyi.com/pica_index.html'
} }
} }
...@@ -59,16 +59,14 @@ export default async(url = '', data = {}, type = 'POST', method = 'fetch',server ...@@ -59,16 +59,14 @@ export default async(url = '', data = {}, type = 'POST', method = 'fetch',server
} else { } else {
requestObj = new ActiveXObject; requestObj = new ActiveXObject;
} }
let sendData = ''; let sendData = '';
if (type == 'POST' || type == 'DELETE' || type == 'PUT') { if (type == 'POST' || type == 'DELETE' || type == 'PUT') {
sendData = JSON.stringify(data); sendData = JSON.stringify(data);
} }
requestObj.open(type, url, true); requestObj.open(type, url, true);
requestObj.setRequestHeader("Content-Type", "application/json"); requestObj.setRequestHeader("Content-Type", "application/json");
requestObj.setRequestHeader("sysCode", "3");
requestObj.send(sendData); requestObj.send(sendData);
requestObj.onreadystatechange = () => { requestObj.onreadystatechange = () => {
if (requestObj.readyState == 4) { if (requestObj.readyState == 4) {
if (requestObj.status == 200) { if (requestObj.status == 200) {
......
...@@ -39,11 +39,11 @@ service.interceptors.response.use( ...@@ -39,11 +39,11 @@ service.interceptors.response.use(
baseUrl时,返回000000为成功 baseUrl时,返回000000为成功
apiUrl时,返回200为成功 apiUrl时,返回200为成功
*/ */
if (res.code !== '000000' && response.respCode === 200) { // if (res.code !== '000000') {
return Promise.reject('error') // return Promise.reject('error')
} else { // } else {
return response.data return response.data
} // }
}, },
error => { error => {
// logger.error('err' + error) // logger.error('err' + error)
......
...@@ -127,17 +127,22 @@ const vueFilter = { ...@@ -127,17 +127,22 @@ const vueFilter = {
}, },
//项目管理 //项目管理
statusProject: (value) => { statusProject: (value) => {
if(value == 1) { //console.log(value)
if(value[0] == 1) {
return '草稿' return '草稿'
}else if(value == 2) { }else if(value[0] == 2) {
return '未上架' return '未上架'
}else if(value == 3) { }else if(value[0] == 3) {
return '审批中' if(value[1] == 1) {
}else if(value == 4) { return '待审核'
} else {
return '审核中'
}
}else if(value[0] == 4) {
return '已上架' return '已上架'
}else if(value == 5) { }else if(value[0] == 5) {
return '已下架' return '已下架'
}else { }else if(value[0] == 6) {
return '已拒绝' return '已拒绝'
} }
}, },
...@@ -148,7 +153,7 @@ const vueFilter = { ...@@ -148,7 +153,7 @@ const vueFilter = {
return '项目负责人' return '项目负责人'
}else if(value == "L3") { }else if(value == "L3") {
return '次级负责人' return '次级负责人'
} else if(value == "L4") { } else if(value == "L0") {
return '普通用户' return '普通用户'
} }
}, },
......
/** /**
* Created by Anndy Yang on 18/09/18. * Created by Anndy Yang on 18/09/18.
*/ */
import { envConfig } from '@/utils/envConfig' import { envConfig } from '@/utils/env-config'
export function setEventByModuleCode(itemData){ export function setEventByModuleCode(itemData){
let modeCode = itemData.appModuleInfo.code || ''; let modeCode = itemData.appModuleInfo.code || '';
...@@ -152,8 +152,8 @@ export function getQiniuToken1() { ...@@ -152,8 +152,8 @@ export function getQiniuToken1() {
} }
// 登录URL // 登录URL
export function getLoginUrl() { export function getLoginUrl(param) {
return getConfigByEnvType('loginUrl') return getConfigByEnvType('loginUrl') + param
} }
export function getInnerLoginUrl() { export function getInnerLoginUrl() {
return getConfigByEnvType('innerLoginUrl') return getConfigByEnvType('innerLoginUrl')
......
...@@ -12,7 +12,7 @@ module.exports = { ...@@ -12,7 +12,7 @@ module.exports = {
// this.token = this.getUrlSearch(location.href, 'token') || (query && query.token) || null // this.token = this.getUrlSearch(location.href, 'token') || (query && query.token) || null
// this.token = this.getUrlKey('token') || (query && query.token) || null // this.token = this.getUrlKey('token') || (query && query.token) || null
}, },
mounted() { mounted: function() {
}, },
methods: { methods: {
......
...@@ -111,19 +111,34 @@ let treeData = [ ...@@ -111,19 +111,34 @@ let treeData = [
]; ];
// 按钮type类型: 0-编辑 // 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝 // 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(5)-取消审核 9-删除 // 7- 提醒审核 8(2)-取消审核 9-删除
let buttonStatus = [ let buttonStatusIn = [
//L1 内部管理员 L2项目负责人 L3次级负责人 //L1 内部管理员 L2项目负责人 L3次级负责人
//草稿 //草稿
{ L1: "09", L2: "09", L3: "" }, { L1: "09", L2: "", L3: "" },
//未上架
{ L1: "039", L2: "039", L3: "0" },
//待审核、审批中
{ L1: "46", L2: "78", L3: "" },
//已上架
{ L1: "05", L2: "05", L3: "0" },
//已下架
{ L1: "039", L2: "039", L3: "0" },
//已拒绝/未上架
{ L1: "039", L2: "039", L3: "0" },
];
let buttonStatusOut = [
//L1 内部管理员 L2项目负责人 L3次级负责人
//草稿
{ L1: "", L2: "09", L3: "" },
//未上架 //未上架
{ L1: "09", L2: "039", L3: "0" }, { L1: "09", L2: "039", L3: "0" },
//待审、审批中 //待审、审批中
{ L1: "46", L2: "78", L3: "" }, { L1: "46", L2: "78", L3: "" },
//已上架 //已上架
{ L1: "05", L2: "05", L3: "5" }, { L1: "05", L2: "05", L3: "0" },
//已下架 //已下架
{ L1: "03", L2: "03", L3: "0" }, { L1: "039", L2: "039", L3: "0" },
//已拒绝/未上架 //已拒绝/未上架
{ L1: "09", L2: "039", L3: "0" }, { L1: "09", L2: "039", L3: "0" },
]; ];
...@@ -132,6 +147,7 @@ export function returnData() { ...@@ -132,6 +147,7 @@ export function returnData() {
data.tableOrganization = tableOrganization; data.tableOrganization = tableOrganization;
data.tablePerson = tablePerson; data.tablePerson = tablePerson;
data.treeData = treeData; data.treeData = treeData;
data.buttonStatus = buttonStatus; data.buttonStatusIn = buttonStatusIn;
data.buttonStatusOut = buttonStatusOut;
return data; return data;
} }
\ No newline at end of file
//求并集
export function getUnion(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1, ...set2]));
}
return null;
}
//求差集
export function getDifference(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1].filter(x => !set2.has(x))));
}
return null;
}
//求交集
export function getIntersect(a, b) {
if (a.constructor === Array && b.constructor === Array) {
let set1 = new Set(a);
let set2 = new Set(b);
return Array.from(new Set([...set1].filter(x => set2.has(x))));
}
return null;
}
//获取id的list
export function getIdList(data) {
let list = [];
if(typeof data === 'undefined') {
return list;
}
if (data.constructor === Array) {
for (let i = 0; i < data.length; i++) {
list.push(data[i].id);
}
}
return list;
}
//区域
export function getDivision(data) {
if (data === null || data == 'NaN') {
let empty = [];
return empty;
}
let list = data.split('|');
let num = [];
for (let i = 0; i < list.length; i++) {
num[i] = parseInt(list[i]);
}
//console.log(list);
return num;
}
export function getLevelList(data) {
let level = [];
level[0] = {
id: '-1',
label: '全部医院等级',
}
for (let i = 0; i < data.length; i++) {
let obj = {
id: data[i].no,
label: data[i].value,
}
level.push(obj);
}
//console.log(level);
return level;
}
function inTags(id, tags) {
let flag = false;
for (let i = 0; i < tags.length; i++) {
if (tags[i].key == id) {
flag = true;
}
}
return flag;
}
export function inOrganization(list, id) {
let flag = false;
if (list.length == 0) {
flag = true;
}
for (let i = 0; i < list.length; i++) {
if (list[i].id != id) {
flag = true;
}
}
return flag;
}
export function initTags(value) {
let tags = [];
for (let j = 0; j < value.length; j++) {
let tagsComponent = {};
tagsComponent.value = value.value;
tagsComponent[j].name = this.optionsComponent[j].label;
}
return tags;
}
//机构列表
export function getOrganizationList(data) {
let list = [];
list[0] = {
value: '0',
label: '全部机构',
};
for (let i = 0; i < data.length; i++) {
let obj = {
value: data[i].key,
label: data[i].name,
}
list.push(obj);
}
return list;
}
//机构列表
export function getHospitalList(data) {
let list = [];
list[0] = {
value: 0,
label: '全部医院',
};
for (let i = 0; i < data.length; i++) {
let obj = {
value: data[i].id,
label: data[i].name,
}
list.push(obj);
}
//console.log(list);
return list;
}
//拼树
export function changeTags(option) {
let list = [];
// for(let i=0;i<option.length;i++) {
// console.log(option[i].label);
// let obj = {
// name: option[i].name,
// key: option[i].key,
// }
// list.push(obj);
// }
console.log(option);
return option;
}
// 递归删除多余的节点
function handlerAction(treeData, selData) {
treeData.forEach((elem, index) => {
if (!isValuable(elem.value, selData)) {
treeData.splice(index, 1)
handlerAction(treeData, selData)
} else {
if (elem.children) {
handlerAction(elem.children, selData)
}
}
})
return treeData;
}
function isValuable(val, selData) {
for (let i = 0; i < selData.length; i++) {
if (selData[i]['value'].indexOf(val) >= 0) {
return true
}
}
return false
}
function changeTreeKey(oData, orgKey, targetKey) {
oData = [...oData]
oData.forEach(elem => {
elem[targetKey] = elem[orgKey]
delete elem[orgKey]
if (elem.children) {
changeTreeKey(elem.children, orgKey, targetKey)
}
})
return oData
}
function deleteTreeKey(oData, delKeys) {
oData = [...oData]
oData.forEach(elem => {
delKeys.forEach(key => {
delete elem[key]
})
if (elem.children) {
deleteTreeKey(elem.children, delKeys)
}
})
return oData
}
function deleteEmptyChild(oData) {
oData = [...oData]
oData.forEach(elem => {
if (elem.children && elem.children.length == 0) {
delete elem.children
} else if (elem.children) {
deleteEmptyChild(elem.children)
}
})
return oData
}
function addEmpty(data) {
let after = [];
after[0] = {
label: "全部地区",
value: "0",
}
for(let i=0;i<data.length;i++) {
after.push(data[i]);
}
return after;
}
export function treeHandler(treeData, selData) {
//console.log('treeData',treeData,'selData',selData);
treeData = deleteTreeKey(treeData, ['status', 'disabled'])
treeData = changeTreeKey(treeData, 'id', 'value')
selData = changeTreeKey(selData, 'name', 'label')
selData = changeTreeKey(selData, 'key', 'value')
let endData = deleteEmptyChild(handlerAction(treeData, selData));
// console.log(treeData, selData)
//return handlerAction(treeData, selData);
let returnData = addEmpty(endData);
return returnData;
}
\ No newline at end of file
import {isEmptyUtils, isNotEmptyUtils, subString} from "./utils"; import {isEmptyUtils, isNotEmptyUtils, subString} from "./utils";
import fetchQiniu from './fetchQiniu.js'; import fetchQiniu from './fetch-qiniu.js';
import { getQiniuToken1, uploadVideo, uploadImg } from './index' import { getQiniuToken1, uploadVideo, uploadImg } from './index'
let fileApiUrl = getQiniuToken1() let fileApiUrl = getQiniuToken1()
......
...@@ -4,6 +4,20 @@ export const containObject = function(...obj1) { ...@@ -4,6 +4,20 @@ export const containObject = function(...obj1) {
let obj = Object.assign(...obj1) let obj = Object.assign(...obj1)
return obj return obj
} }
// 获取页面自适应高度
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'slidebar-container',
containerHeightId = 'screenSet'){
let containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 15
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
window.onresize = function() {
containerHeight = p_getElm(refHeightId).getBoundingClientRect().height - 15
p_getElm(containerHeightId).style.height = containerHeight - cMinusHeight + 'px'
}
}
function p_getElm(elmId){
return document.getElementById(elmId)
}
//共通函数 //共通函数
Array.prototype.contains = function (obj) { Array.prototype.contains = function (obj) {
if (this.length > 0) { if (this.length > 0) {
......
<template> <template>
<div class="blank-wrap screenSet"> <div id="screenSet" class="blank-wrap screenSet">
<div class="blank-content"> <div class="blank-content">
<img src="../assets/image/no-content.png"/> <img src="../assets/image/no-content.png"/>
<p>很抱歉,您暂时还没开通工作站功能</p> <p>很抱歉,您暂时还没开通工作站功能</p>
...@@ -7,8 +7,17 @@ ...@@ -7,8 +7,17 @@
</div> </div>
</template> </template>
<script> <script>
import * as commonUtil from '../utils/utils'
export default { export default {
data() {
return {
}
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight(100)
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
......
<template> <template>
<div class="add-manager-wrap"> <div class="add-manager-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb> <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="add-content screenSet"> <div class="add-content screenSet" id="screenSet">
<el-row class="step-content"> <el-row class="step-content">
<el-col :span="14"> <el-col :span="14">
<el-steps :active="active" simple class> <el-steps :active="active" simple class>
...@@ -14,40 +14,59 @@ ...@@ -14,40 +14,59 @@
</el-steps> </el-steps>
</el-col> </el-col>
<el-col :span="5" :offset="5"> <el-col :span="5" :offset="5">
<el-button size="small" @click="storage">暂存</el-button> <el-button v-if="showStorage" size="small" @click="storage">暂存</el-button>
<el-button v-if="active<2" size="small" class="button-green" @click="nextStep">下一步</el-button> <el-button v-if="active<2" size="small" type="primary" @click="nextStep">下一步</el-button>
<el-button v-if="active>=2" size="small" class="button-white" @click="complete">完成</el-button> <el-button v-if="active>=2" size="small" type="primary" @click="complete">完成</el-button>
</el-col> </el-col>
</el-row> </el-row>
<div class="first-step" v-if="active === 0"> <div class="first-step" v-if="active === 0">
<el-form ref="formData" :model="formData" :rules="rules" label-width="150px"> <el-form
ref="formData"
:model="formData"
:rules="rules"
label-width="150px"
class="basic-form"
>
<el-form-item label="项目名称:" prop="projectName"> <el-form-item label="项目名称:" prop="projectName">
<el-col :span="13"> <el-col :span="13">
<el-input size="mini" v-model="formData.projectName" placeholder="请输入项目名称"></el-input> <el-input
size="small"
v-model="formData.projectName"
placeholder="请输入项目名称"
style="width:83%;"
:disabled="peopleLevel == 'L3'"
></el-input>
<span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/20</span>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="项目时间:" required> <el-form-item label="项目时间:" required>
<el-col :span="3"> <el-col :span="5">
<el-form-item label> <el-form-item prop="projectBegintime">
<el-date-picker <el-date-picker
v-model="formData.projectBegintime" v-model="formData.projectBegintime"
size="mini" size="small"
type="date" type="datetime"
placeholder="请选择开始时间" placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0" :picker-options="pickerOptions0"
style="width: 100%;"
:disabled="peopleLevel == 'L3'"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col class="line" :span="1">~</el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="~"> <el-form-item label prop="projectEndtime">
<el-date-picker <el-date-picker
v-model="formData.projectEndtime" v-model="formData.projectEndtime"
size="mini" size="small"
type="date" type="datetime"
placeholder="请选择结束时间" placeholder="请选择结束时间"
value-format="yyyy-MM-dd 23:59:59" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1" :picker-options="pickerOptions1"
default-time="23:59:59"
style="width: 100%;"
:disabled="peopleLevel == 'L3'"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -55,53 +74,70 @@ ...@@ -55,53 +74,70 @@
<el-form-item label="项目简介:" prop="projectIntro"> <el-form-item label="项目简介:" prop="projectIntro">
<el-col :span="13"> <el-col :span="13">
<el-input <el-input
size="mini" size="small"
type="textarea" type="textarea"
:autosize="{ minRows: 5}" :autosize="{ minRows: 5}"
placeholder="请输入项目简介" placeholder="请输入项目简介"
v-model="formData.projectIntro" v-model="formData.projectIntro"
style="width:83%;"
:disabled="peopleLevel == 'L3'"
></el-input> ></el-input>
<span class="word-num">{{(formData.projectIntro).replace(/\s+/g,"").length}}/150</span>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="列表图片:" prop="attachmentUrl1"> <div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="列表图片:">
<el-upload <el-upload
v-model="formData.attachmentUrl1" v-model="formData.attachmentUrl1"
class="bg-uploader" class="bg-uploader"
action="#" action="#"
:show-file-list="false" :show-file-list="false"
:before-upload="beforeUploadListPic" :before-upload="beforeUploadListPic"
:disabled="peopleLevel == 'L3'"
> >
<img v-if="formData.attachmentUrl1" :src="formData.attachmentUrl1" class="bg-img"> <img v-if="formData.attachmentUrl1" @mouseover.stop="imgMouseOver=true && peopleLevel != 'L3'" :src="formData.attachmentUrl1" class="bg-img">
<img <img
v-if="!formData.attachmentUrl1" v-if="!formData.attachmentUrl1"
class="bg-img" class="bg-img"
src="../../assets/image/small.png" src="../../assets/image/small.png"
> >
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> --> <div class="img-delete" v-show="imgMouseOver" @click.stop="deleteImg(1)" @mouseout.stop="imgMouseOver=false"><i class="el-icon-delete"></i></div>
<div class="limit-text"> <div class="limit-text">
<p>尺寸:48*48</p> <p>尺寸:230*172</p>
<p>限制大小: 500Kb</p> <p>限制大小: 500Kb</p>
<p>支持.jpg,.png格式</p> <p>支持.jpg,.png格式</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<p class="upload-message" v-if="uploadImgMessage">请选择列表图片</p>
</div>
<el-form-item label="封面类型:"> <el-form-item label="封面类型:">
<el-radio-group size="mini" v-model="formData.type" @change="changeCover"> <el-radio-group
size="small"
v-model="formData.type"
@change="changeCover"
:disabled="peopleLevel == 'L3'"
>
<el-radio :label="1">图片</el-radio> <el-radio :label="1">图片</el-radio>
<el-radio :label="2">视频</el-radio> <el-radio :label="2">视频</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="封面图片(视频):" prop="attachmentUrl2"> <div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="封面文件:">
<el-upload <el-upload
v-model="formData.attachmentUrl2" v-model="formData.attachmentUrl2"
class="bg-uploader" class="bg-uploader"
action="#" action="#"
:show-file-list="false" :show-file-list="false"
:before-upload="beforeUploadCoverPic" :before-upload="beforeUploadCoverPic"
:disabled="peopleLevel == 'L3'"
> >
<img <img
v-if="formData.type == 1 && formData.attachmentUrl2" v-if="formData.type == 1 && formData.attachmentUrl2"
:src="formData.attachmentUrl2" :src="formData.attachmentUrl2"
@mouseover.stop="imgMouseOver2=true && peopleLevel != 'L3'"
class="bg-img" class="bg-img"
> >
<video <video
...@@ -109,6 +145,7 @@ ...@@ -109,6 +145,7 @@
width="100" width="100"
controls controls
class="bg-video" class="bg-video"
@mouseover.stop="imgMouseOver2=true && peopleLevel != 'L3'"
> >
<source :src="formData.attachmentUrl2" type="video/mp4">浏览器不支持mp4 <source :src="formData.attachmentUrl2" type="video/mp4">浏览器不支持mp4
</video> </video>
...@@ -117,7 +154,7 @@ ...@@ -117,7 +154,7 @@
class="bg-img" class="bg-img"
src="../../assets/image/small.png" src="../../assets/image/small.png"
> >
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> --> <div class="img-delete" v-show="imgMouseOver2" @click.stop="deleteImg(2)" @mouseout.stop="imgMouseOver2=false"><i class="el-icon-delete"></i></div>
<div v-show="formData.type == 1" class="limit-text"> <div v-show="formData.type == 1" class="limit-text">
<p>尺寸:750*420</p> <p>尺寸:750*420</p>
<p>限制大小: 2.0 Mb</p> <p>限制大小: 2.0 Mb</p>
...@@ -130,7 +167,9 @@ ...@@ -130,7 +167,9 @@
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="可下载附件:"> <p class="upload-message" v-if="uploadImgMessage2">请选择封面</p>
</div>
<el-form-item label="添加下载文件:">
<el-col :span="10"> <el-col :span="10">
<el-upload <el-upload
v-model="formData.attachmentUrl3" v-model="formData.attachmentUrl3"
...@@ -144,6 +183,7 @@ ...@@ -144,6 +183,7 @@
multiple multiple
:on-exceed="handleExceed" :on-exceed="handleExceed"
:file-list="fileList" :file-list="fileList"
:disabled="peopleLevel == 'L3'"
> >
<el-button class="choose-button" plain icon="el-icon-document">选择文件</el-button> <el-button class="choose-button" plain icon="el-icon-document">选择文件</el-button>
<div slot="tip" class="el-upload__tip">支持文件类型:pdf</div> <div slot="tip" class="el-upload__tip">支持文件类型:pdf</div>
...@@ -154,7 +194,7 @@ ...@@ -154,7 +194,7 @@
</div> </div>
<div class="second-step" v-else-if="active === 1"> <div class="second-step" v-else-if="active === 1">
<el-tabs v-model="activeName" @tab-click="handleClickTabs"> <el-tabs v-model="activeName" @tab-click="handleClickTabs">
<el-tab-pane v-if="idTypeValue == 1" label="设定行政范围" name="first"> <el-tab-pane v-if="idType != 2" label="设定行政范围" name="first">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col class="rim" :span="12"> <el-col class="rim" :span="12">
<!-- <!--
...@@ -178,7 +218,7 @@ ...@@ -178,7 +218,7 @@
<el-button <el-button
type="text" type="text"
icon="el-icon-caret-bottom" icon="el-icon-caret-bottom"
size="mini" size="small"
@click="() => append(data,node)" @click="() => append(data,node)"
></el-button> ></el-button>
</span> </span>
...@@ -199,20 +239,29 @@ ...@@ -199,20 +239,29 @@
<el-tab-pane label="设定机构" name="second"> <el-tab-pane label="设定机构" name="second">
<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>
<el-input size="mini" v-model="formOrganization.name" placeholder="请输入机构名称"></el-input> <!-- <el-select
</el-form-item> size="small"
<el-form-item label> v-model="formOrganization.administrativeId"
<el-select size="mini" v-model="formOrganization.region" placeholder="全部地区"> placeholder="全部地区"
v-if="idType != 2"
>
<el-option <el-option
v-for="(item, index) in organizationRegion" v-for="item in organizationRegion"
:key="index" :key="item.id"
:label="item.label" :label="item.label"
:value="item.id" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select> -->
<el-cascader
v-if="idType != 2"
size="small"
expand-trigger="hover"
:options="organizationRegion"
v-model="formOrganization.administrativeIdList"
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select size="mini" v-model="formOrganization.grade" placeholder="全部医院级别"> <el-select size="small" v-model="formOrganization.level" placeholder="全部医院级别">
<el-option <el-option
v-for="(item, index) in organizationRank" v-for="(item, index) in organizationRank"
:key="index" :key="index"
...@@ -221,8 +270,11 @@ ...@@ -221,8 +270,11 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label>
<el-input size="small" v-model="formOrganization.name" placeholder="请输入机构名称"></el-input>
</el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="primary" @click="getOrganization()">搜索</el-button> <el-button size="small" type="primary" @click="searchOrganization()">搜索</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float:right;"> <el-form-item style="float:right;">
<el-button-group> <el-button-group>
...@@ -246,14 +298,26 @@ ...@@ -246,14 +298,26 @@
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="selectionChangeOrganization" @selection-change="selectionChangeOrganization"
:row-key="getRowKeys"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column
type="selection"
width="55"
:selectable="selectableTableList"
:reserve-selection="true"
></el-table-column>
<el-table-column prop="name" label="医院名称" min-width="100" align="center"></el-table-column> <el-table-column prop="name" label="医院名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="hospitalLevel" label="医院级别" align="center"></el-table-column> <el-table-column prop="hospitalLevelName" label="医院级别" align="center"></el-table-column>
<el-table-column prop="provinceName" label="所属省份" align="center"></el-table-column> <el-table-column prop="provinceName" label="所属省份" align="center"></el-table-column>
<el-table-column prop="cityName" label="所属城市" align="center"></el-table-column> <el-table-column prop="cityName" label="所属城市" align="center"></el-table-column>
<el-table-column prop="countyName" label="所属区县" align="center"></el-table-column> <el-table-column prop="countyName" label="所属区县" align="center"></el-table-column>
<el-table-column prop="townName" label="所属街道" align="center"></el-table-column> <el-table-column prop="townName" label="所属街道" align="center"></el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有机构信息</p>
</div>
</div>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
...@@ -278,35 +342,48 @@ ...@@ -278,35 +342,48 @@
style="width: 100%" style="width: 100%"
@selection-change="selectionChangeDepartment" @selection-change="selectionChangeDepartment"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column
type="selection"
width="55"
:selectable="selectableTableList"
></el-table-column>
<el-table-column prop="name" label="科室名称" align="center"></el-table-column> <el-table-column prop="name" label="科室名称" align="center"></el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有科室信息</p>
</div>
</div>
</el-table> </el-table>
</el-col> </el-col>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="设定人员" name="fourth"> <el-tab-pane label="设定人员" name="fourth">
<el-form :inline="true" :model="formPerson" class="demo-form-inline"> <el-form :inline="true" :model="formPerson" class="demo-form-inline">
<el-form-item label> <el-form-item label>
<el-select size="mini" v-model="formPerson.hospital" placeholder="全部医院"> <el-select size="small" v-model="formPerson.hospitalId" placeholder="全部医院">
<el-option <el-option
v-for="(item, index) in organizationRank" v-for="(item, index) in hospitalList"
:key="index" :key="index"
:label="item.label" :label="item.label"
:value="item.id" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select size="mini" v-model="formPerson.department" placeholder="全部部门"> <el-select size="small" v-model="formPerson.departmentId" placeholder="全部科室">
<el-option <el-option
v-for="(item, index) in organizationRank" v-for="item in departmentList"
:key="index" :key="item.value"
:label="item.label" :label="item.label"
:value="item.id" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label>
<el-input size="small" v-model="formPerson.name" placeholder="请输入人员名称"></el-input>
</el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="primary" @click="getPeople">搜索</el-button> <el-button size="small" type="primary" @click="searchPeople">搜索</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float:right;"> <el-form-item style="float:right;">
<el-button-group> <el-button-group>
...@@ -330,14 +407,26 @@ ...@@ -330,14 +407,26 @@
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="selectionChangePerson" @selection-change="selectionChangePerson"
:row-key="getRowKeysPerson"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column
type="selection"
width="55"
:reserve-selection="true"
:selectable="selectableTableList"
></el-table-column>
<el-table-column prop="name" label="人员名称" align="center"></el-table-column> <el-table-column prop="name" label="人员名称" align="center"></el-table-column>
<el-table-column prop="hospitalName" label="所属医院" align="center"></el-table-column> <el-table-column prop="hospitalName" label="所属医院" align="center"></el-table-column>
<el-table-column prop="departmentName" label="所属部门" align="center"></el-table-column> <el-table-column prop="departmentName" label="所属科室" align="center"></el-table-column>
<el-table-column prop="provinceName" label="所属省份" align="center"></el-table-column> <el-table-column prop="provinceName" label="所属省份" align="center"></el-table-column>
<el-table-column prop="cityName" label="所属城市" align="center"></el-table-column> <el-table-column prop="cityName" label="所属城市" align="center"></el-table-column>
<el-table-column prop="countyName" label="所属区县" align="center"></el-table-column> <el-table-column prop="countyName" label="所属区县" align="center"></el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有人员信息</p>
</div>
</div>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
...@@ -353,6 +442,14 @@ ...@@ -353,6 +442,14 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog title :visible.sync="dialogShow" width="40%" center>
<p class="dialog-p">设定范围数据已经被其他管理员修改,是否强制提交进行覆盖</p>
<span slot="footer" class="dialog-footer">
<el-button type="default" size="small" @click="dialogShow = false">取消</el-button>
<el-button type="primary" size="small" @click="coverData()">确定</el-button>
</span>
</el-dialog>
</div> </div>
<div class="third-step" v-else-if="active === 2"> <div class="third-step" v-else-if="active === 2">
<el-form <el-form
...@@ -370,6 +467,7 @@ ...@@ -370,6 +467,7 @@
style="width: 350px" style="width: 350px"
placeholder="请选择组件" placeholder="请选择组件"
@change="changeValue" @change="changeValue"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
<el-option <el-option
v-for="item in optionsComponent" v-for="item in optionsComponent"
...@@ -393,7 +491,7 @@ ...@@ -393,7 +491,7 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="配置证书:"> <el-form-item label="配置证书:">
<el-radio-group v-model="formComponent.configure"> <el-radio-group v-model="formComponent.configure" :disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6">
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>
<el-radio :label="2"></el-radio> <el-radio :label="2"></el-radio>
</el-radio-group> </el-radio-group>
...@@ -404,6 +502,7 @@ ...@@ -404,6 +502,7 @@
v-model="formComponent.certificate" v-model="formComponent.certificate"
placeholder="请选择证书" placeholder="请选择证书"
style="width: 350px" style="width: 350px"
:disabled="projectStatus == 3 || projectStatus == 4 || projectStatus == 5 || projectStatus == 6"
> >
<el-option <el-option
v-for="item in optionsCertificate" v-for="item in optionsCertificate"
...@@ -421,37 +520,40 @@ ...@@ -421,37 +520,40 @@
</template> </template>
<script> <script>
import BreadCrumb from "../../components/breadcrumb.vue"; import BreadCrumb from "../../components/breadcrumb.vue";
import { doUpload, getFilePath } from "../../utils/qiniuUtil"; import { doUpload, getFilePath } from "../../utils/qiniu-util";
import { returnData } from "../mock";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
let vm = null; let vm = null;
export default { export default {
components: { components: {
BreadCrumb BreadCrumb
}, },
data() { data() {
const itemOrganization = { // const itemOrganization = {
name: "上海市第一人民医院", // name: "上海市第一人民医院",
grade: "二甲医院", // grade: "二甲医院",
province: "上海市", // province: "上海市",
city: "上海市", // city: "上海市",
district: "浦东新区", // district: "浦东新区",
street: "张江街道" // street: "张江街道"
}; // };
const itemPerson = { // const itemPerson = {
name: "云小鹊", // name: "云小鹊",
hospital: "上海市第一人民医院", // hospital: "上海市第一人民医院",
department: "全科", // department: "全科",
province: "上海市", // province: "上海市",
city: "上海市", // city: "上海市",
district: "长宁区" // district: "长宁区"
}; // };
return { return {
idTypeValue: "", idTypeValue: 1,
itemOrganization: itemOrganization, idTypeProject: '',
itemPerson: itemPerson, // itemOrganization: itemOrganization,
// itemPerson: itemPerson,
projectId: null, projectId: null,
peopleLevel: null,
//面包屑 //面包屑
curmbFirst: "教培项目", curmbFirst: "教培项目",
curmbSecond: "新建项目", curmbSecond: "新建项目",
...@@ -460,6 +562,10 @@ export default { ...@@ -460,6 +562,10 @@ export default {
active: 0, active: 0,
activeName: "first", activeName: "first",
//基层信息 数据 //基层信息 数据
uploadImgMessage: false,
uploadImgMessage2: false,
imgMouseOver: false,
imgMouseOver2: false,
imageUrl: "", imageUrl: "",
formData: { formData: {
projectName: "", projectName: "",
...@@ -469,11 +575,16 @@ export default { ...@@ -469,11 +575,16 @@ export default {
type: 1, type: 1,
attachmentUrl1: "", attachmentUrl1: "",
attachmentUrl2: "", attachmentUrl2: "",
attachmentUrl3: "" attachmentUrl3: "",
attachmentMore1: {},
attachmentMore2: {}
}, },
pickerOptions0: { pickerOptions0: {
disabledDate: time => { disabledDate: time => {
if (this.formData.projectEndtime != "") { if (
this.formData.projectEndtime != "" &&
this.formData.projectEndtime != null
) {
return ( return (
time.getTime() > new Date(this.formData.projectEndtime).getTime() time.getTime() > new Date(this.formData.projectEndtime).getTime()
); );
...@@ -489,6 +600,7 @@ export default { ...@@ -489,6 +600,7 @@ export default {
}, },
fileList: [], fileList: [],
//设定行政范围 数据 //设定行政范围 数据
scopeReq: {},
allSelectedKeys: [], allSelectedKeys: [],
updatedTree: false, updatedTree: false,
defaultProps: { defaultProps: {
...@@ -499,47 +611,35 @@ export default { ...@@ -499,47 +611,35 @@ export default {
treeData: [], treeData: [],
tagsRegion: [], tagsRegion: [],
//设定机构 数据 //设定机构 数据
getRowKeys(row) {
return row.id;
},
checkTableState: { checkTableState: {
multipleOrganization: true, multipleOrganization: "",
multipleDepartment: true, multipleDepartment: "",
multiplePerson: true multiplePerson: ""
}, },
updatedOrganization: false, updatedOrganization: false,
formOrganization: { formOrganization: {
name: "", name: "",
region: "", administrativeId: "0",
grade: "", administrativeIdList: ['0'],
level: "-1",
chechAll: true, chechAll: true,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
organizationRegion: [ organizationRegion: [],
{ organizationRank: [],
id: "100",
label: "上海"
},
{
id: "101",
label: "北京"
}
],
organizationRank: [
{
id: "1",
label: "一甲"
},
{
id: "2",
label: "二甲"
}
],
hasOrganizationInit: false, hasOrganizationInit: false,
tableOrganization: new Array(), tableOrganization: new Array(),
multipleSelectionOrganization: [], multipleSelectionOrganization: [],
currentOrganization: 1, currentOrganization: 1,
totalOrganization: 10, totalOrganization: 10,
pageSizeOrganization: 2, pageSizeOrganization: 2,
changedOrganization: {}, lookedOrganization: [],
changedOrganization: [],
changedOrganization2: [],
//设定科室 数据 //设定科室 数据
firstDepartment: true, firstDepartment: true,
formDepartment: { formDepartment: {
...@@ -550,19 +650,38 @@ export default { ...@@ -550,19 +650,38 @@ export default {
updatedDepartment: false, updatedDepartment: false,
changedDepartment: {}, changedDepartment: {},
//设定人员 数据 //设定人员 数据
getRowKeysPerson(row) {
return row.id;
},
formPerson: { formPerson: {
hospital: "", hospitalId: 0,
department: "", departmentId: -1,
name: "",
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
hospitalList: [],
departmentList: [],
tablePerson: new Array(), tablePerson: new Array(),
multipleSelectionPerson: [], multipleSelectionPerson: [],
currentPerson: 1, currentPerson: 1,
pageSizePerson: 2, pageSizePerson: 2,
totalPerson: 10, totalPerson: 10,
updatedPerson: false, updatedPerson: false,
changedPerson: {}, lookedPerson: [],
changedPerson: [],
changedPerson2: [],
//dialog
dialogShow: false,
flagCover: 0,
//记录上次
scopeOfOrganizationLast: [],
scopeOfPeopleLast: [],
setKindOfOrganizationLast: '',
setKindOfPeopleLast: '',
//搜索类型
searchOrganizationType: '',
searchPeopleType: '',
//选择项目组件 数据 //选择项目组件 数据
optionsComponent: [], optionsComponent: [],
optionsCertificate: [], optionsCertificate: [],
...@@ -573,6 +692,7 @@ export default { ...@@ -573,6 +692,7 @@ export default {
}, },
tagsComponent: [], tagsComponent: [],
projectStatus: "", projectStatus: "",
showStorage: false,
//校验工具 数据 //校验工具 数据
rulesComponent: { rulesComponent: {
component: [ component: [
...@@ -584,7 +704,7 @@ export default { ...@@ -584,7 +704,7 @@ export default {
}, },
rules: { rules: {
projectName: [ projectName: [
{ required: true, message: "请输入活动名称", trigger: "blur" }, { required: true, message: "请输入项目名称", trigger: "blur" },
{ {
min: 2, min: 2,
max: 20, max: 20,
...@@ -601,7 +721,6 @@ export default { ...@@ -601,7 +721,6 @@ export default {
], ],
projectBegintime: [ projectBegintime: [
{ {
type: "date",
required: true, required: true,
message: "请选择时间", message: "请选择时间",
trigger: "change" trigger: "change"
...@@ -609,7 +728,6 @@ export default { ...@@ -609,7 +728,6 @@ export default {
], ],
projectEndtime: [ projectEndtime: [
{ {
type: "date",
required: true, required: true,
message: "请选择时间", message: "请选择时间",
trigger: "change" trigger: "change"
...@@ -627,7 +745,8 @@ export default { ...@@ -627,7 +745,8 @@ export default {
{ required: true, message: "请选择活动资源", trigger: "change" } { required: true, message: "请选择活动资源", trigger: "change" }
], ],
projectIntro: [ projectIntro: [
{ required: true, message: "请填写活动形式", trigger: "blur" } { required: true, message: "请填写项目简介", trigger: "blur" },
{ min: 1, max: 150, message: "超出可输入的最大长度", trigger: "blur" }
], ],
attachmentUrl1: [ attachmentUrl1: [
{ required: true, message: "请选择列表图片", trigger: "blur" } { required: true, message: "请选择列表图片", trigger: "blur" }
...@@ -639,26 +758,31 @@ export default { ...@@ -639,26 +758,31 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(["_token", "idType"]) ...mapGetters(["_token"])
}, },
created() { created() {
vm = this; vm = this;
(this.projectId = vm.getUrlSearch(window.location.href, "projectId")), (this.projectId = vm.getUrlSearch(window.location.href, "projectId")),
this.editManager(); (this.peopleLevel = vm.getUrlSearch(window.location.href, "level"));
this.changeOnStep(this.active); this.changeOnStep(this.active);
this.getComponentInfo(); this.getComponentInfo();
//this.editManager();
this.$nextTick(function() { vm.idType = localStorage.getItem('storageIdType');
//this.getDepartment(); console.log('this.idType:'+ vm.idType);
this.idTypeValue = vm.idType; if (vm.idType == 2) {
//this.idTypeValue = 2;
if (this.idTypeValue == 2) {
console.log("idType:", vm.idType, " idTypeValue:", this.idTypeValue);
this.activeName = "second"; this.activeName = "second";
} }
this.$nextTick(function() {
//this.getDepartment();
}); });
}, },
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: { methods: {
//表单校验 //表单校验
submitForm(formName) { submitForm(formName) {
let flag = null; let flag = null;
...@@ -677,6 +801,16 @@ export default { ...@@ -677,6 +801,16 @@ export default {
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
}, },
// 删除图片
deleteImg(type) {
if(type == 1) {
vm.formData.attachmentUrl1 = '';
vm.imgMouseOver = false;
} else {
vm.formData.attachmentUrl2 = '';
vm.imgMouseOver2 = false;
}
},
//改变封面类型 //改变封面类型
changeCover(radio) { changeCover(radio) {
this.formData.attachmentUrl2 = ""; this.formData.attachmentUrl2 = "";
...@@ -695,13 +829,25 @@ export default { ...@@ -695,13 +829,25 @@ export default {
type: editData.attachmentData[1].attachmentType, type: editData.attachmentData[1].attachmentType,
attachmentUrl1: editData.attachmentData[0].attachmentUrl, attachmentUrl1: editData.attachmentData[0].attachmentUrl,
attachmentUrl2: editData.attachmentData[1].attachmentUrl, attachmentUrl2: editData.attachmentData[1].attachmentUrl,
attachmentUrl3: "" attachmentUrl3: "",
attachmentMore1: {
attachmentName: editData.attachmentData[0].attachmentName,
attachmentExt: editData.attachmentData[0].attachmentExt,
attachmentSize: editData.attachmentData[0].attachmentSize
},
attachmentMore2: {
attachmentName: editData.attachmentData[1].attachmentName,
attachmentExt: editData.attachmentData[1].attachmentExt,
attachmentSize: editData.attachmentData[1].attachmentSize
}
}; };
if (editData.attachmentData.length > 2) { if (editData.attachmentData.length > 2) {
for (let i = 2; i < editData.attachmentData.length; i++) { for (let i = 2; i < editData.attachmentData.length; i++) {
let pdfItem = { let pdfItem = {
name: editData.attachmentData[i].attachmentName, name: editData.attachmentData[i].attachmentName,
url: editData.attachmentData[i].attachmentUrl url: editData.attachmentData[i].attachmentUrl,
attachmentExt: editData.attachmentData[i].attachmentExt,
attachmentSize: editData.attachmentData[i].attachmentSize
}; };
vm.fileList.push(pdfItem); vm.fileList.push(pdfItem);
} }
...@@ -713,10 +859,11 @@ export default { ...@@ -713,10 +859,11 @@ export default {
componentEdit.push(editData.componentData[i].relevanceId); componentEdit.push(editData.componentData[i].relevanceId);
} }
this.formComponent.component = componentEdit; this.formComponent.component = componentEdit;
this.changeValue(componentEdit); this.initTags(componentEdit);
if (editData.certificateData.length > 0) { if (editData.certificateData.length > 0) {
this.formComponent.configure = 1; this.formComponent.configure = 1;
this.formComponent.certificate = editData.componentData[0].relevanceId; this.formComponent.certificate =
editData.certificateData[0].relevanceId;
} }
}, },
//编辑管理 //编辑管理
...@@ -724,17 +871,29 @@ export default { ...@@ -724,17 +871,29 @@ export default {
let req = {}; let req = {};
let projectId = vm.getUrlSearch(window.location.href, "projectId"); let projectId = vm.getUrlSearch(window.location.href, "projectId");
if (projectId != null && projectId != "") { if (projectId != null && projectId != "") {
vm.GET("portalInfo/getProjectInfo/" + projectId, req).then(res => { openLoading(vm);
vm.GET("portal/portalInfo/getProjectInfo/" + projectId, req).then(
res => {
closeLoading(vm);
if (res.code == "000000" && res.data.projectData != null) { if (res.code == "000000" && res.data.projectData != null) {
let editData = res.data; let editData = res.data;
this.setEditData(editData); this.setEditData(editData);
this.idTypeProject = res.data.projectData.idType;
this.projectStatus = res.data.projectData.projectStatus; this.projectStatus = res.data.projectData.projectStatus;
if (this.projectStatus == 1) {
this.showStorage = true;
}
//console.log('projectStatus:',this.projectStatus);
} else { } else {
console.log(res); console.log(res);
} }
}); }
);
} else {
this.showStorage = true;
} }
}, },
//编辑/更新 基础信息 //编辑/更新 基础信息
insertOrUpdate(option) { insertOrUpdate(option) {
//console.log(this.formData); //console.log(this.formData);
...@@ -748,12 +907,18 @@ export default { ...@@ -748,12 +907,18 @@ export default {
{ {
attachmentType: 1, attachmentType: 1,
attachmentUrl: this.formData.attachmentUrl1, attachmentUrl: this.formData.attachmentUrl1,
attachmentName: this.formData.attachmentMore1.attachmentName,
attachmentExt: this.formData.attachmentMore1.attachmentExt,
attachmentSize: this.formData.attachmentMore1.attachmentSize,
kind: 1, kind: 1,
seqNo: 1 seqNo: 1
}, },
{ {
attachmentType: this.formData.type, attachmentType: this.formData.type,
attachmentUrl: this.formData.attachmentUrl2, attachmentUrl: this.formData.attachmentUrl2,
attachmentName: this.formData.attachmentMore2.attachmentName,
attachmentExt: this.formData.attachmentMore2.attachmentExt,
attachmentSize: this.formData.attachmentMore2.attachmentSize,
kind: 2, kind: 2,
seqNo: 1 seqNo: 1
} }
...@@ -765,20 +930,24 @@ export default { ...@@ -765,20 +930,24 @@ export default {
attachmentType: 3, attachmentType: 3,
attachmentName: vm.fileList[i].name, attachmentName: vm.fileList[i].name,
attachmentUrl: vm.fileList[i].url, attachmentUrl: vm.fileList[i].url,
attachmentExt: vm.fileList[i].attachmentExt,
attachmentSize: vm.fileList[i].attachmentSize,
kind: 3 kind: 3
}; };
attachmentPDFModel.push(PDFModel); attachmentPDFModel.push(PDFModel);
} }
//} //}
if (option == "edit") { if (option == "edit" || option == "storageEdit") {
//编辑 //编辑
projectModel.id = this.formData.id; projectModel.id = this.formData.id;
projectModel.projectStatus = this.projectStatus;
for (let i = 0; i < attachmentModel.length; i++) { for (let i = 0; i < attachmentModel.length; i++) {
attachmentModel[i].portalProjectId = this.formData.id; attachmentModel[i].portalProjectId = this.formData.id;
} }
for (let i = 0; i < attachmentPDFModel.length; i++) { for (let i = 0; i < attachmentPDFModel.length; i++) {
attachmentPDFModel[i].portalProjectId = this.formData.id; attachmentPDFModel[i].portalProjectId = this.formData.id;
} }
//idTypeProject
} }
let postData = { let postData = {
projectModel: JSON.stringify(projectModel), projectModel: JSON.stringify(projectModel),
...@@ -786,22 +955,51 @@ export default { ...@@ -786,22 +955,51 @@ export default {
attachmentPDFModel: JSON.stringify(attachmentPDFModel) attachmentPDFModel: JSON.stringify(attachmentPDFModel)
}; };
//console.log(postData); //console.log(postData);
vm.POST("portalInfo/insertOrUpdate", postData).then(res => { openLoading(vm);
vm.POST("portal/portalInfo/insertOrUpdate", postData).then(res => {
closeLoading(vm);
if(option == "storage" || option == "storageEdit") {
vm.$message.info(res.message);
}
if (res.code == "000000") { if (res.code == "000000") {
console.log(res); //console.log(res);
this.active++;
this.stepData = [false, true, false];
this.projectId = res.data.id; this.projectId = res.data.id;
this.projectStatus = res.data.projectStatus; this.projectStatus = res.data.projectStatus;
this.idTypeProject = res.data.idType;
this.operationLast();
if (option != "storage" && option != "storageEdit") {
this.active++;
this.stepData = [false, true, false];
// this.projectId = res.data.id;
this.initRange(); this.initRange();
this.getDepartment(); this.getDepartment();
} }
}
}); });
}, },
//查询上次设定范围
operationLast() {
let req = {};
vm.GET("portal/scope/v1/" + this.projectId + "/operation/last", req).then(
res => {
if (res.code == "000000") {
this.scopeReq = res.data.scopeReq;
//console.log(this.scopeReq);
//operationData.getDivision(res.data.scopeReq.scopeOfAdministrative);
this.setKindOfOrganizationLast = this.scopeReq.setKindOfOrganization;
this.setKindOfPeopleLast = this.scopeReq.setKindOfPeople;
this.scopeOfOrganizationLast = operationData.getDivision(this.scopeReq.scopeOfOrganization);
this.scopeOfPeopleLast = operationData.getDivision(this.scopeReq.scopeOfPeople);
//this.changedOrganization = list;
}
}
);
},
//查询组件证书信息 //查询组件证书信息
getComponentInfo() { getComponentInfo() {
let param = {}; let param = {};
vm.GET("portalInfo/getComponentInfo", param).then(res => { vm.GET("portal/portalInfo/getComponentInfo", param).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
//console.log(res); //console.log(res);
let componentList = res.data.componentList; let componentList = res.data.componentList;
...@@ -823,6 +1021,7 @@ export default { ...@@ -823,6 +1021,7 @@ export default {
this.optionsComponent = optionsComponent; this.optionsComponent = optionsComponent;
this.optionsCertificate = optionsCertificate; this.optionsCertificate = optionsCertificate;
} }
this.editManager();
}); });
}, },
//项目组件信息 暂存/完成 //项目组件信息 暂存/完成
...@@ -834,19 +1033,17 @@ export default { ...@@ -834,19 +1033,17 @@ export default {
type: type, type: type,
status: this.projectStatus status: this.projectStatus
}; };
vm.POST("portalInfo/componentDraft", param).then(res => { vm.POST("portal/portalInfo/componentDraft", param).then(res => {
console.log(res); console.log(res);
if (res.code == "000000") { vm.$message({
this.$notify({ message: res.message,
title: "成功", type: "info"
message: "项目创建成功"
}); });
if (res.code == "000000") {
//notify
if (type == 2) {
this.$router.push("item-manager"); this.$router.push("item-manager");
} else { }
this.$notify({
title: "",
message: res.message
});
} }
}); });
}, },
...@@ -856,37 +1053,63 @@ export default { ...@@ -856,37 +1053,63 @@ export default {
this.stepData = [true, false, false]; this.stepData = [true, false, false];
} else if (active == 1) { } else if (active == 1) {
this.stepData = [false, true, false]; this.stepData = [false, true, false];
this.operationLast();
this.initRange(); this.initRange();
this.getDepartment();
} else if (active == 2) { } else if (active == 2) {
this.stepData = [false, false, true]; this.stepData = [false, false, true];
} }
}, },
//选择范围选中所有table被选中
checkAllTable() {
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleAllSelection();
this.$refs.multipleDepartment.toggleAllSelection();
this.$refs.multiplePerson.toggleAllSelection();
});
},
//点击暂存 //点击暂存
storage() { storage() {
console.log("暂存步骤" + (this.active + 1)); console.log("暂存步骤" + (this.active + 1));
if (this.active == 0) { if (this.active == 0) {
//暂存步骤1 if (this.formData.projectName != "") {
let formName = "formData"; if (
let state = this.submitForm(formName); this.formData.projectName.length < 2 ||
if (state === true) { this.formData.projectName.length > 20
this.insertOrUpdate(); ) {
this.$message.error("输入长度为2-20的内容");
return;
}
let urlProjectId = vm.getUrlSearch(window.location.href, "projectId");
if (urlProjectId == null) {
let param = {
projectName: this.formData.projectName
};
vm.GET("portal/portalInfo/checkProjectName", param).then(res => {
//console.log(res);
if (res.code == "000000") {
//移动到第二页 选择范围
this.insertOrUpdate("storage");
} else {
this.$message.info(res.message);
}
});
} else {
//console.log('urlProjectId'+urlProjectId);
this.insertOrUpdate("storageEdit");
}
} else {
this.$message.error("请输入项目名称");
} }
} else if (this.active == 1) { } else if (this.active == 1) {
//暂存步骤2 //暂存步骤2
if(this.tagsRegion.length == 0) {
vm.$message({
type: "info",
message: '成功',
});
return;
}
let req = { let req = {
projectId: this.projectId, projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"), setKindOfAdministrative: this.getKind("administrativeScope"),
setKindOfOrganization: this.getKind("organization"), setKindOfOrganization: this.getKind("organization"),
setKindOfDepartment: this.getKind("department"), setKindOfDepartment: this.getKind("department"),
setKindOfPeople: this.getKind("person") setKindOfPeople: this.getKind("person"),
flag: this.flagCover,
}; };
if (req.setKindOfAdministrative == 3) { if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrativeUpdate"); req.scopeOfAdministrative = this.getScope("administrativeUpdate");
...@@ -902,39 +1125,63 @@ export default { ...@@ -902,39 +1125,63 @@ export default {
if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) { if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) {
req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople); req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople);
} }
vm.POST("scope", req).then(res => { openLoading(vm);
//移动到选择项目组件 vm.POST("portal/scope", req).then(res => {
//暂存范围
closeLoading(vm);
console.log(res); console.log(res);
this.$notify({ vm.$message({
title: "", type: "info",
message: res.message message: res.message
}); });
}); });
} else if (this.active == 2) { } else if (this.active == 2) {
//暂存步骤3 //暂存步骤3
let formName = "formComponent";
let completeState = this.submitForm(formName);
if (completeState === true) {
this.componentDraft(1); this.componentDraft(1);
} // let formName = "formComponent";
// let completeState = this.submitForm(formName);
// if (completeState === true) {
// this.componentDraft(1);
// }
} }
}, },
//点击完成 //点击完成
complete() { complete() {
//type 1:暂存 2:完成 //type 1:暂存 2:完成
if (this.projectStatus == 4) {
vm.$message.info("完成");
vm.$router.push({ path: "item-manager" });
return;
}
let formName = "formComponent"; let formName = "formComponent";
let completeState = this.submitForm(formName); let completeState = this.submitForm(formName);
if (completeState === true) { if (completeState === true) {
this.componentDraft(2); this.componentDraft(2);
} }
}, },
//覆盖数据
coverData() {
this.dialogShow = false;
this.flagCover = 1;
this.nextStep();
},
//点击下一步 //点击下一步
nextStep() { nextStep() {
if (this.active == 0) { if (this.active == 0) {
let formName = "formData"; let formName = "formData";
let removeState = this.submitForm(formName); let removeState = this.submitForm(formName);
console.log("判断移动" + removeState); if (!vm.formData.attachmentUrl1) {
if (removeState === true) { vm.uploadImgMessage = true;
} else {
vm.uploadImgMessage = false;
}
if (!vm.formData.attachmentUrl2) {
vm.uploadImgMessage2 = true;
} else {
vm.uploadImgMessage2 = false;
}
//console.log("判断移动" + removeState);
if (removeState === true && vm.formData.attachmentUrl1!='' && vm.formData.attachmentUrl2!='') {
//校验名字 //校验名字
let projectId = vm.getUrlSearch(window.location.href, "projectId"); let projectId = vm.getUrlSearch(window.location.href, "projectId");
if (projectId == null) { if (projectId == null) {
...@@ -942,41 +1189,41 @@ export default { ...@@ -942,41 +1189,41 @@ export default {
let param = { let param = {
projectName: this.formData.projectName projectName: this.formData.projectName
}; };
vm.GET("portalInfo/checkProjectName", param).then(res => { vm.GET("portal/portalInfo/checkProjectName", param).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
//移动到第二页 选择范围 //移动到第二页 选择范围
// this.operationLast();
this.insertOrUpdate("add"); this.insertOrUpdate("add");
// this.active++; // this.active++;
// this.stepData = [false, true, false]; // this.stepData = [false, true, false];
//this.initRange(); //this.initRange();
//this.checkAllTable();
} else { } else {
this.$message.error("项目名称" + res.message); this.$message.info(res.message);
} }
}); });
} else { } else {
//编辑 //编辑
// this.operationLast();
this.insertOrUpdate("edit"); this.insertOrUpdate("edit");
// this.active++;
// this.stepData = [false, true, false];
//this.initRange();
} }
} }
} else if (this.active == 1) { } else if (this.active == 1) {
if (this.idTypeValue == 1) { //进入第三步
if (this.idType == 1) {
//内部管理员 //内部管理员
if (this.tagsRegion.length > 0) { if (this.tagsRegion.length > 0 || this.idTypeProject == 2) {
//选择了范围 //选择了范围
let req = { let req = {
projectId: this.projectId, projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"), setKindOfAdministrative: this.getKind("administrativeScope"),
//scopeOfAdministrative: "000:2|000_110:1", //scopeOfAdministrative: "000:2|000_110:1",
setKindOfOrganization: this.getKind("organization"), setKindOfOrganization: this.getKind("organization"),
//scopeOfOrganization: "2|3|4|5|6|7", //scopeOfOrganization: "2|3|4|5|6|7",
setKindOfDepartment: this.getKind("department"), setKindOfDepartment: this.getKind("department"),
//scopeOfDepartment: "54", //scopeOfDepartment: "54",
setKindOfPeople: this.getKind("person") setKindOfPeople: this.getKind("person"),
//scopeOfPeople: "" //scopeOfPeople: ""
flag: this.flagCover,
}; };
if (req.setKindOfAdministrative == 3) { if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrativeUpdate"); req.scopeOfAdministrative = this.getScope("administrativeUpdate");
...@@ -995,15 +1242,23 @@ export default { ...@@ -995,15 +1242,23 @@ export default {
if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) { if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) {
req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople); req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople);
} }
vm.POST("scope", req).then(res => {
openLoading(vm);
vm.POST("portal/scope", req).then(res => {
closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
//移动到选择项目组件 //移动到选择项目组件
console.log(res); //console.log(res);
let statusMove = this.scopeStatus(res.data.status);
if(statusMove === 0) {
this.active++; this.active++;
this.stepData = [false, false, true]; this.stepData = [false, false, true];
} else { } else {
this.$notify({ console.log('不能改变范围status:'+res.data.status)
title: "", }
} else {
vm.$message({
type: "info",
message: res.message message: res.message
}); });
} }
...@@ -1012,10 +1267,51 @@ export default { ...@@ -1012,10 +1267,51 @@ export default {
//没有选择范围 //没有选择范围
vm.$message({ vm.$message({
showClose: true, showClose: true,
message: "选择项目范围后才能进行下一步操作", message: "项目范围不能为空",
type: "error" type: "error"
}); });
} }
} else {
//外部人员
let req = {
projectId: this.projectId,
setKindOfAdministrative: 0,
setKindOfOrganization: this.getKind("organization"),
setKindOfDepartment: this.getKind("department"),
setKindOfPeople: this.getKind("person"),
flag: this.flagCover,
};
if (
req.setKindOfOrganization == 2 ||
req.setKindOfOrganization == 3
) {
req.scopeOfOrganization = this.getScopeOrganization(
req.setKindOfOrganization
);
}
if (req.setKindOfDepartment == 3) {
req.scopeOfDepartment = this.getScopeDepartment();
}
if (req.setKindOfPeople == 2 || req.setKindOfPeople == 3) {
req.scopeOfPeople = this.getScopePeople(req.setKindOfPeople);
}
vm.POST("portal/scope", req).then(res => {
if (res.code == "000000") {
//移动到选择项目组件
let statusMove = this.scopeStatus(res.data.status);
if(statusMove === 0) {
this.active++;
this.stepData = [false, false, true];
} else {
console.log('不能改变范围status:'+res.data.status)
}
} else {
vm.$message({
type: "info",
message: res.message
});
}
});
} }
} }
}, },
...@@ -1026,11 +1322,13 @@ export default { ...@@ -1026,11 +1322,13 @@ export default {
//上传列表图片 //上传列表图片
beforeUploadListPic(file) { beforeUploadListPic(file) {
let fileLimit = { let fileLimit = {
width: 48, width: 230,
height: 48, height: 172,
size: 0.5, size: 0.5,
sizeText: "500Kb", sizeText: "500K",
key: "attachmentUrl1" key: "attachmentUrl1",
more: "attachmentMore1",
show: "uploadImgMessage"
}; };
this.beforeAvatarUpload(file, fileLimit); this.beforeAvatarUpload(file, fileLimit);
}, },
...@@ -1040,8 +1338,10 @@ export default { ...@@ -1040,8 +1338,10 @@ export default {
width: 750, width: 750,
height: 420, height: 420,
size: 2, size: 2,
sizeText: "2.0Mb", sizeText: "2.0M",
key: "attachmentUrl2" key: "attachmentUrl2",
more: "attachmentMore2",
show: "uploadImgMessage2"
}; };
if (this.formData.type == 1) { if (this.formData.type == 1) {
this.beforeAvatarUpload(file, fileLimit); this.beforeAvatarUpload(file, fileLimit);
...@@ -1070,7 +1370,9 @@ export default { ...@@ -1070,7 +1370,9 @@ export default {
console.log(path); console.log(path);
let fileItem = { let fileItem = {
name: path.name, name: path.name,
url: path.fullPath url: path.fullPath,
attachmentExt: path.ext,
attachmentSize: path.size
}; };
vm.fileList.push(fileItem); vm.fileList.push(fileItem);
vm.$message.success("上传成功"); vm.$message.success("上传成功");
...@@ -1086,10 +1388,11 @@ export default { ...@@ -1086,10 +1388,11 @@ export default {
const isMP4 = file.type === "video/mp4"; const isMP4 = file.type === "video/mp4";
const isLt = file.size / 1024 / 1024 < 500; const isLt = file.size / 1024 / 1024 < 500;
if (!isLt) { if (!isLt) {
this.$message.error("上传视频大小不能超过500M !"); this.$message.error("视频不符合规范,请根据规范上传视频");
return;
} }
if (!isMP4) { if (!isMP4) {
this.$message.error("请上传MP4格式文件!"); this.$message.error("视频不符合规范,请根据规范上传视频");
} else { } else {
openLoading(vm); openLoading(vm);
doUpload( doUpload(
...@@ -1098,10 +1401,11 @@ export default { ...@@ -1098,10 +1401,11 @@ export default {
getFilePath(file, null), getFilePath(file, null),
"preview4", "preview4",
"progress1", "progress1",
1 ''
).then(function(path) { ).then(function(path) {
closeLoading(vm); closeLoading(vm);
console.log(path); console.log(path);
vm.uploadImgMessage2 = false;
vm.formData.attachmentUrl2 = path.fullPath; vm.formData.attachmentUrl2 = path.fullPath;
vm.$message.success("上传成功"); vm.$message.success("上传成功");
}); });
...@@ -1113,12 +1417,12 @@ export default { ...@@ -1113,12 +1417,12 @@ export default {
const isPNG = file.type === "image/png"; const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size; const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) { if (!isJPG && !isPNG) {
this.$message.error("上传头像图片只能是 JPG 格式!"); this.$message.error("图片不符合规范,请根据规范上传图片");
return;
} }
if (!isLt2M) { if (!isLt2M) {
this.$message.error( this.$message.error("图片不符合规范,请根据规范上传图片 ");
"上传头像图片大小不能超过 " + fileLimit.sizeText + "!" return;
);
} }
let _img = new FileReader(); let _img = new FileReader();
_img.readAsDataURL(file); _img.readAsDataURL(file);
...@@ -1131,7 +1435,7 @@ export default { ...@@ -1131,7 +1435,7 @@ export default {
_this.width != fileLimit.width || _this.width != fileLimit.width ||
_this.height != fileLimit.height _this.height != fileLimit.height
) { ) {
vm.$message.info("上传图片长宽不合适,请重新上传"); vm.$message.error("图片不符合规范,请根据规范上传图片");
} else { } else {
openLoading(vm); openLoading(vm);
doUpload( doUpload(
...@@ -1144,7 +1448,17 @@ export default { ...@@ -1144,7 +1448,17 @@ export default {
).then(function(path) { ).then(function(path) {
closeLoading(vm); closeLoading(vm);
console.log(path); console.log(path);
if (fileLimit.show == "uploadImgMessage") {
vm.uploadImgMessage = false;
} else if (fileLimit.show == "uploadImgMessage2") {
vm.uploadImgMessage2 = false;
}
vm.formData[fileLimit.key] = path.fullPath; vm.formData[fileLimit.key] = path.fullPath;
vm.formData[fileLimit.more] = {
attachmentName: path.name,
attachmentExt: path.ext,
attachmentSize: path.size
};
vm.$message.success("上传成功"); vm.$message.success("上传成功");
}); });
} }
...@@ -1164,11 +1478,11 @@ export default { ...@@ -1164,11 +1478,11 @@ export default {
//console.log(file); //console.log(file);
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.warning( // this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${ // `当前限制选择 3 个文件,本次选择了 ${
files.length // files.length
} 个文件,共选择了 ${files.length + fileList.length} 个文件` // } 个文件,共选择了 ${files.length + fileList.length} 个文件`
); // );
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`); return this.$confirm(`确定移除 ${file.name}?`);
...@@ -1180,8 +1494,13 @@ export default { ...@@ -1180,8 +1494,13 @@ export default {
//新建 //新建
} else { } else {
//编辑 //编辑
if(this.idTypeValue == 1) { this.listLevels();
if (this.idType != 2) {
this.getAdministrative(); this.getAdministrative();
} else {
this.activeName = "second";
this.getOrganization();
this.getCheckedTree();
} }
} }
}, },
...@@ -1190,7 +1509,13 @@ export default { ...@@ -1190,7 +1509,13 @@ export default {
let tabName = tab.name; let tabName = tab.name;
if (tabName == "second") { if (tabName == "second") {
//设定机构 //设定机构
this.formOrganization.pageNum = 1;
this.formOrganization.name ="";
this.formOrganization.administrativeIdList = ['0'];
this.formOrganization.level ="-1";
this.getCheckedTree();
this.getOrganization(); this.getOrganization();
// this.listLevels();
} else if (tabName == "third") { } else if (tabName == "third") {
//设定科室 //设定科室
// if (this.checkTableState.multipleDepartment && this.firstDepartment) { // if (this.checkTableState.multipleDepartment && this.firstDepartment) {
...@@ -1199,9 +1524,31 @@ export default { ...@@ -1199,9 +1524,31 @@ export default {
// } // }
} else if (tabName == "fourth") { } else if (tabName == "fourth") {
//设定人员 //设定人员
this.formPerson.pageNum = 1;
this.formPerson.name ="";
this.formPerson.departmentId = -1;
this.formPerson.hospitalId = 0;
this.getHospital();
this.departmentList = this.getDepartmentList();
//console.log('departmentList',this.departmentList);
this.getPeople(); this.getPeople();
} }
}, },
//获取勾选树
getCheckedTree() {
if(this.idType != 2) {
let allTree = JSON.parse(JSON.stringify(this.treeData[0].children));
let changedTags = JSON.parse(JSON.stringify(this.tagsRegion));
let organizationArea = operationData.treeHandler(allTree,changedTags);
console.log('多级树:',organizationArea);
this.organizationRegion = organizationArea;
//改
// this.organizationRegion = operationData.getOrganizationList(
// this.tagsRegion
// );
//console.log(this.organizationRegion);
}
},
//初始化范围树 //初始化范围树
setTreeData(administrative) { setTreeData(administrative) {
let treeIdList = []; let treeIdList = [];
...@@ -1222,7 +1569,7 @@ export default { ...@@ -1222,7 +1569,7 @@ export default {
projectId: this.projectId projectId: this.projectId
}; };
openLoading(vm); openLoading(vm);
vm.GET("scope/v1/administrative", req).then(res => { vm.GET("portal/scope/v1/administrative", req).then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
//console.log(res.data); //console.log(res.data);
...@@ -1231,11 +1578,11 @@ export default { ...@@ -1231,11 +1578,11 @@ export default {
this.treeData = []; this.treeData = [];
this.treeData[0] = administrativeAll; this.treeData[0] = administrativeAll;
this.setTreeData(administrative); this.setTreeData(administrative);
this.getCheckedTree();
//console.log("treeData", this.treeData); //console.log("treeData", this.treeData);
} }
}); });
}, },
//列举选中地区 //列举选中地区
initCheckList(allSelectedKeys) { initCheckList(allSelectedKeys) {
this.tagsRegion = []; this.tagsRegion = [];
...@@ -1256,63 +1603,45 @@ export default { ...@@ -1256,63 +1603,45 @@ export default {
} }
} }
}, },
//子节点选中
appendCheck(administrative, checked) {
//console.log(checked,administrative)
let checkList = [];
checkList = this.$refs.tree.getCheckedKeys();
if (checked) {
for (let i = 0; i < administrative.length; i++) {
checkList.push(administrative[i].id);
// console.log(checkList);
}
}
this.$nextTick(function() {
this.$refs.tree.setCheckedKeys(checkList);
});
},
//添加子节点 //添加子节点
append(data, node) { append(data, node) {
console.log("data:", data); console.log("data:", data);
console.log("node:", node); console.log("node:", node);
if (data.children.length == 0) { if (data.children.length == 0) {
let id = data.id + "add"; //let id = data.id + "add";
const newChild = [ let statusValue = 0;
{ id: id, label: "testtest", children: [] }, if (node.checked == true) {
{ id: id, label: "22", children: [] } statusValue = 1;
];
//data.children.push(newChild);
let req = {
id: data.id
};
vm.GET("scope/v1/administrative/children", req).then(res => {
if (res.code == "000000") {
let administrative = res.data.administrative;
console.log(administrative);
data.children = administrative;
//data.children.push(newChild);
}
});
}
},
//树结构
loadNode(node, resolve) {
if (node.level === 0) {
return resolve([{ label: "全国", id: "000", status: 0 }]);
}
if (node.level === 1) {
let req = {
//projectId: vm.getUrlSearch(window.location.href, "projectId"),
projectId: 54
};
vm.GET("scope/v1/administrative", req).then(res => {
if (res.code == "000000") {
let administrativeAll = res.data.administrativeAll;
let administrative = res.data.administrative;
let children = administrativeAll.children;
//console.log(administrativeAll);
return resolve(children);
}
});
} }
if (node.level === 2 || node.level === 3 || node.level === 4) {
let req = { let req = {
id: node.data.id id: data.id,
status: statusValue,
disabled: data.disabled
}; };
vm.GET("scope/v1/administrative/children", req).then(res => { vm.GET("portal/scope/v1/administrative/children", req).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
let administrative = res.data.administrative; let administrative = res.data.administrative;
return resolve(administrative); //console.log(administrative);
data.children = administrative;
this.appendCheck(administrative, node.checked);
} }
}); });
} }
if (node.level === 5) return resolve([]);
}, },
getCheckedKeys() { getCheckedKeys() {
console.log(this.$refs.tree.getCheckedKeys()); console.log(this.$refs.tree.getCheckedKeys());
...@@ -1339,6 +1668,22 @@ export default { ...@@ -1339,6 +1668,22 @@ export default {
this.updateOrganizationAndPerson(allSelectedKeys); this.updateOrganizationAndPerson(allSelectedKeys);
this.updatedTree = true; this.updatedTree = true;
}, },
getTreeCheck() {
let cData = [],
oldData = (this.treeData.length && this.treeData.slice()) || [],
checkedKeys = this.$refs.tree.getCheckedKeys(),
halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(),
savedCheckedKeys = this.handlerCheckedData(oldData, checkedKeys).map(
key => {
return { type: 1, key: key };
}
),
savedHalfCheckedKeys = halfCheckedKeys.map(key => {
return { type: 2, key: key };
}),
allSelectedKeys = savedCheckedKeys.concat(savedHalfCheckedKeys);
return allSelectedKeys;
},
// 递归删除列表中所有子节点 // 递归删除列表中所有子节点
delSubKeysByNode(node, checkedKeys) { delSubKeysByNode(node, checkedKeys) {
let idIndex; let idIndex;
...@@ -1387,8 +1732,10 @@ export default { ...@@ -1387,8 +1732,10 @@ export default {
//删除label节点 同步树结构 //删除label节点 同步树结构
handleCloseTree(tag) { handleCloseTree(tag) {
if (this.projectStatus != 4) {
this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1); this.tagsRegion.splice(this.tagsRegion.indexOf(tag), 1);
this.setCheckedKeys(this.tagsRegion); this.setCheckedKeys(this.tagsRegion);
}
}, },
//获取反选数据 //获取反选数据
getDifference(a, b) { getDifference(a, b) {
...@@ -1399,42 +1746,54 @@ export default { ...@@ -1399,42 +1746,54 @@ export default {
} }
return null; return null;
}, },
getReverseData(data, check) { //获取医院等级
let reverse = []; listLevels() {
//console.log('data',data,'check',check); let req = {};
for (let i = 0; i < data.length; i++) { vm.GET("contents/courseDoctor/listLevels?sysCode=10", req).then(res => {
for (let j = 0; j < check.length; j++) { if (res.code == "000000") {
if (data[i].id !== check[j].id) { // console.log(res);
reverse.push(data[i]); this.organizationRank = operationData.getLevelList(res.data.list);
} } else {
} this.organizationRank = [{
id: '0',
label: '全部医院等级',
}];
} }
return reverse; });
},
selectableTableList(row, index) {
if (this.projectStatus == 4) {
if (row.status == 1) {
//console.log("scopeReq",this.scopeReq);
return false;
}
return true;
}
return true;
}, },
//改变 设定机构选项 //改变 设定机构选项
selectionChangeOrganization(val) { selectionChangeOrganization(rows) {
this.multipleSelectionOrganization = val; this.changedOrganization = [];
//console.log(val.length , this.formOrganization.pageSize , this.updatedOrganization) this.changedOrganization2 = [];
if ( if (rows) {
val.length != 0 && rows.forEach(row => {
val.length != this.formOrganization.pageSize && if (row) {
this.updatedOrganization == false this.changedOrganization.push(row.id);
) { }
this.updatedOrganization = true; });
console.log("机构被更新", this.updatedOrganization);
}
if (this.updatedOrganization == true) {
this.changedOrganization[this.formOrganization.pageNum] = [];
this.changedOrganization[
this.formOrganization.pageNum
][0] = this.multipleSelectionOrganization;
let reverse = this.getDifference(
this.tableOrganization,
this.multipleSelectionOrganization
);
this.changedOrganization[this.formOrganization.pageNum][1] = reverse;
console.log("check机构:", this.changedOrganization);
} }
this.changedOrganization2 = operationData.getDifference(
this.lookedOrganization,
this.changedOrganization
);
console.log(
"选",
this.changedOrganization,
"没",
this.changedOrganization2
);
this.updatePerson();
this.$refs.multiplePerson.clearSelection();
}, },
//改变机构 table 的check状态 //改变机构 table 的check状态
selectionChangeDepartment(val) { selectionChangeDepartment(val) {
...@@ -1442,94 +1801,175 @@ export default { ...@@ -1442,94 +1801,175 @@ export default {
//console.log(this.multipleSelectionDepartment); //console.log(this.multipleSelectionDepartment);
}, },
//改变人员 table的check状态 //改变人员 table的check状态
selectionChangePerson(val) { selectionChangePerson(rows) {
this.multipleSelectionPerson = val; this.changedPerson = [];
//console.log(this.multipleSelectionPerson); this.changedPerson2 = [];
if ( if (rows) {
val.length != 0 && rows.forEach(row => {
val.length != this.formPerson.pageSize && if (row) {
this.updatedPerson == false this.changedPerson.push(row.id);
) {
this.updatedPerson = true;
console.log("人员被更新", this.updatedPerson);
}
if (this.updatedPerson == true) {
this.changedPerson[this.formPerson.pageNum] = [];
this.changedPerson[
this.formPerson.pageNum
][0] = this.multipleSelectionPerson;
let reverse = this.getDifference(
this.tablePerson,
this.multipleSelectionPerson
);
this.changedPerson[this.formPerson.pageNum][1] = reverse;
console.log("check人员:", this.changedPerson);
} }
});
}
this.changedPerson2 = operationData.getDifference(
this.lookedPerson,
this.changedPerson
);
console.log(
"选",
this.changedPerson,
"没",
this.changedPerson2
);
}, },
//设定机构table全选 //设定机构table全选
checkAll(flag, name) { checkAll(flag, name) {
//console.log(flag + " " + name);
if (name == "multipleOrganization") { if (name == "multipleOrganization") {
this.changedOrganization = {}; //机构全选
} else if (name == "multiplePerson") { let checkItem = this.checkTableState[name];
this.changedPerson = {};
}
if (flag === true) { if (flag === true) {
if (this.checkTableState[name] === false) { let idList = operationData.getIdList(this.tableOrganization);
//console.log('idList',idList,'changedOrganization',this.changedOrganization);
let difference = operationData.getDifference(
idList,
this.changedOrganization
);
//console.log('difference',difference);
if (difference.length > 0) {
this.$refs[name].toggleAllSelection(); this.$refs[name].toggleAllSelection();
}
this.checkTableState[name] = true; this.checkTableState[name] = true;
this.changedOrganization2 = [];
this.changedOrganization = operationData.getDifference(
this.lookedOrganization,
this.changedOrganization2
);
} else {
this.$refs[name].clearSelection();
this.checkTableState[name] = false;
this.changedOrganization = [];
this.changedOrganization2 = operationData.getDifference(
this.lookedOrganization,
this.changedOrganization
);
} }
//置空
} else if (name == "multiplePerson") {
//人员全选
if (flag === true) {
let idList = operationData.getIdList(this.tablePerson);
//console.log('idList',idList,'changedPerson',this.changedPerson);
let difference = operationData.getDifference(
idList,
this.changedPerson
);
//console.log('difference',difference);
if (difference.length > 0) {
this.$refs[name].toggleAllSelection();
}
this.checkTableState[name] = true;
this.changedPerson2 = [];
this.changedPerson = operationData.getDifference(
this.lookedPerson,
this.changedPerson2
);
} else { } else {
this.$refs[name].clearSelection(); this.$refs[name].clearSelection();
this.checkTableState[name] = false; this.checkTableState[name] = false;
this.changedPerson = [];
this.changedPerson2 = operationData.getDifference(
this.lookedPerson,
this.changedPerson
);
}
} }
}, },
//获取用户类型 //获取用户类型
getKind(type) { getKind(type) {
let kind = 0; let kind = 3;
if (type == "administrative") { if (type == "administrative") {
//console.log('this.tagsRegion',this.tagsRegion); kind = 3;
if (this.updatedTree == true) {
kind = 3;
}
//console.log('this.idTypeProject',this.idTypeProject);
if(this.idTypeProject == 2 && this.tagsRegion.length == 0) {
kind = 0;
}
if(this.idType == 2) {
kind = 0;
}
} else if (type == "administrativeScope") {
kind = 3;
if (this.tagsRegion.length > 0) { if (this.tagsRegion.length > 0) {
kind = 3; kind = 3;
} }
if(this.idTypeProject == 2 && this.tagsRegion.length == 0) {
kind = 0;
}
if(this.idType == 2) {
kind = 0;
}
} else if (type == "organization") { } else if (type == "organization") {
if (this.checkTableState.multipleOrganization == true) { //设置机构类别0:无 1:全选 2:去掉 3:选中
if (this.checkTableState.multipleOrganization === false) {
//全部不选
kind = 0;
if (this.changedOrganization.length > 0) {
kind = 3;
}
} else if (this.checkTableState.multipleOrganization === true) {
//设置机构类别0:无 1:全选 2:去掉 3:选中 //设置机构类别0:无 1:全选 2:去掉 3:选中
kind = 1; kind = 1;
for (let key in this.changedOrganization) { if (this.changedOrganization2.length > 0) {
if (this.changedOrganization[key][1].length > 0) {
kind = 2; kind = 2;
} }
} else if(this.checkTableState.multipleOrganization === '') {
kind = this.setKindOfOrganizationLast;
if(this.setKindOfOrganizationLast === -1) {
kind = 1;
} }
} else { //初始化0或1
//全部不选 if(kind == 0 && this.changedOrganization.length > 0) {
kind = 0;
for (let key in this.changedOrganization) {
if (this.changedOrganization[key][0].length > 0) {
kind = 3; kind = 3;
} }
if(kind == 1 && this.changedOrganization2.length > 0) {
kind = 2;
} }
} }
} else if (type == "department") { } else if (type == "department") {
kind = 3;
if (this.multipleSelectionDepartment.length > 0) { if (this.multipleSelectionDepartment.length > 0) {
kind = 3; kind = 3;
} }
} else if (type == "person") { } else if (type == "person") {
if (this.checkTableState.multiplePerson == true) { //设置人员类别0:无 1:全选 2:去掉 3:选中
//设置机构类别0:无 1:全选 2:去掉 3:选中 if (this.checkTableState.multiplePerson === false) {
//全部不选
kind = 0;
if (this.changedPerson.length > 0) {
kind = 3;
}
} else if (this.checkTableState.multiplePerson === true) {
kind = 1; kind = 1;
for (let key in this.changedPerson) { if (this.changedPerson2.length > 0) {
if (this.changedPerson[key][1].length > 0) {
kind = 2; kind = 2;
} }
} else if(this.checkTableState.multiplePerson === '') {
kind = this.setKindOfPeopleLast;
if(this.setKindOfPeopleLast === -1) {
kind = 1;
} }
} else { //初始化0或1
//全部不选 if(kind == 0 && this.changedPerson.length > 0) {
kind = 0;
for (let key in this.changedPerson) {
if (this.changedPerson[key][0].length > 0) {
kind = 3; kind = 3;
} }
if(kind == 1 && this.changedPerson2.length > 0) {
kind = 2;
} }
} }
} }
...@@ -1546,7 +1986,8 @@ export default { ...@@ -1546,7 +1986,8 @@ export default {
} }
} }
} else if (type == "administrativeUpdate") { } else if (type == "administrativeUpdate") {
//console.log("allSelectedKeys", this.allSelectedKeys); //console.log(this.allSelectedKeys.length);
if (this.allSelectedKeys.length > 0) {
for (let i = 0; i < this.allSelectedKeys.length; i++) { for (let i = 0; i < this.allSelectedKeys.length; i++) {
scope += scope +=
this.allSelectedKeys[i].key + ":" + this.allSelectedKeys[i].type; this.allSelectedKeys[i].key + ":" + this.allSelectedKeys[i].type;
...@@ -1554,16 +1995,88 @@ export default { ...@@ -1554,16 +1995,88 @@ export default {
scope += "|"; scope += "|";
} }
} }
} else {
let noChangeTree = this.getTreeCheck();
console.log(noChangeTree);
for (let i = 0; i < noChangeTree.length; i++) {
scope += noChangeTree[i].key + ":" + noChangeTree[i].type;
if (i < noChangeTree.length - 1) {
scope += "|";
}
}
}
} }
//console.log(scope); //console.log(scope);
return scope; return scope;
}, },
//查询机构列表 initOrganizationStatus() {
getOrganization() { let tableStatus = this.tableOrganization;
tableStatus.forEach(row => {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(row);
});
}
});
},
//选择搜索机构方式
searchOrganization() {
this.formOrganization.pageNum = 1;
let searchForm = this.formOrganization;
if (
searchForm.administrativeId == "0" &&
searchForm.administrativeIdList[searchForm.administrativeIdList.length-1] == "0" &&
searchForm.level == "-1" &&
searchForm.name == ""
) {
this.searchOrganizationType = '';
this.getOrganization();
} else {
this.searchOrganizationType = 'choose';
this.getOrganizationChoose();
}
},
//初始化搜索机构状态
initOrganizationChoose() {
let tableStatus = this.tableOrganization;
if(typeof tableStatus === 'undefined') {
return;
}
tableStatus.forEach(row => {
let idList = [];
idList[0] = row.id;
//console.log('this.changedOrganization2',this.changedOrganization2);
let intersect = operationData.getIntersect(idList,this.changedOrganization);
let intersect2 = operationData.getIntersect(idList,this.changedOrganization2);
//debugger;
if(intersect.length > 0) {
//选中
this.$refs.multipleOrganization.toggleRowSelection(row);
} else if (intersect2.length > 0) {
//不选
} else {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(row);
});
}
}
});
},
//机构搜索
getOrganizationChoose() {
// console.log('formOrganization',this.formOrganization);
let lastNum = this.formOrganization.administrativeIdList.length - 1
let administrativeIdItem = this.formOrganization.administrativeIdList[lastNum];
console.log('多级选中administrativeIdItem:',administrativeIdItem)
let req = { let req = {
projectId: this.projectId, projectId: this.projectId,
setKind: this.getKind("administrative"), setKind: this.getKind("administrative"),
// scope: "000_110", // scope: "000_110",
//administrativeId: this.formOrganization.administrativeId,
administrativeId: administrativeIdItem,
departmentLevel: this.formOrganization.level,
organizationName: this.formOrganization.name,
pageNum: this.formOrganization.pageNum, pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize pageSize: this.formOrganization.pageSize
}; };
...@@ -1571,66 +2084,98 @@ export default { ...@@ -1571,66 +2084,98 @@ export default {
req.scope = this.getScope("administrative"); req.scope = this.getScope("administrative");
} }
openLoading(vm); openLoading(vm);
vm.POST("scope/v1/organization", req).then(res => { vm.POST("portal/scope/v1/organization/choose", req).then(res => {
closeLoading(vm); closeLoading(vm);
console.log(res);
if (res.code == "000000") { if (res.code == "000000") {
//console.log(res.data);
this.tableOrganization = res.data.organizationList; this.tableOrganization = res.data.organizationList;
this.totalOrganization = res.data.total; this.totalOrganization = res.data.total;
console.log("changedOrganization", this.changedOrganization);
//console.log('机构状态:'+this.checkTableState.multipleOrganization); let idList = operationData.getIdList(this.tableOrganization);
if (this.checkTableState.multipleOrganization == true) { let intersect = operationData.getIntersect(
//全选 idList,
if ( this.changedOrganization
this.updatedOrganization == true && );
this.changedOrganization[this.formOrganization.pageNum] != this.lookedOrganization = operationData.getUnion(
undefined this.lookedOrganization,
) { idList
//机构table 勾选被更新过 );
let rowCheck = this.changedOrganization[
this.formOrganization.pageNum //console.log('全部看过的:',this.lookedOrganization);
][0]; if (vm.checkTableState.multipleOrganization === "") {
//console.log("rowCheck:",rowCheck); this.initOrganizationChoose();
rowCheck.forEach(row => { } else if (vm.checkTableState.multipleOrganization === true) {
// console.log("row", row); let intersect2 = operationData.getIntersect(
let rowItem = {}; idList,
for (let i = 0; i < this.tableOrganization.length; i++) { this.changedOrganization
if (this.tableOrganization[i].id == row.id) { );
rowItem = this.tableOrganization[i]; // console.log('intersect2',intersect2);
} if (intersect2.length == 0) {
}
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(rowItem);
});
});
} else {
this.$refs.multipleOrganization.toggleAllSelection(); this.$refs.multipleOrganization.toggleAllSelection();
} }
} else {
//全不选
if (
this.updatedOrganization == true &&
this.changedOrganization[this.formOrganization.pageNum] !=
undefined
) {
let rowCheck = this.changedOrganization[
this.formOrganization.pageNum
][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tableOrganization.length; i++) {
if (this.tableOrganization[i].id == row.id) {
rowItem = this.tableOrganization[i];
} }
} }
this.$nextTick(function() {
this.$refs.multipleOrganization.toggleRowSelection(rowItem);
});
}); });
},
//查询机构列表
getOrganization() {
let req = {
projectId: this.projectId,
setKind: this.getKind("administrative"),
// scope: "000_110",
pageNum: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize
};
if (req.setKind == 3) {
req.scope = this.getScope("administrative");
}
openLoading(vm);
vm.POST("portal/scope/v1/organization", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
//console.log(res.data);
this.tableOrganization = res.data.organizationList;
this.totalOrganization = res.data.total;
//console.log("changedOrganization", this.changedOrganization);
let idList = operationData.getIdList(this.tableOrganization);
let intersect = operationData.getIntersect(
idList,
this.changedOrganization
);
this.lookedOrganization = operationData.getUnion(
this.lookedOrganization,
idList
);
// this.changedOrganization2 = operationData.getDifference(
// this.lookedOrganization,
// this.changedOrganization
// );
let difference = operationData.getDifference(
idList,
this.changedOrganization2
);
//debugger;
//console.log('全部看过的:',this.lookedOrganization);
if (vm.checkTableState.multipleOrganization === "") {
if (intersect.length == 0 && difference.length > 0) {
this.initOrganizationStatus();
}
} else if (vm.checkTableState.multipleOrganization === true) {
let intersect2 = operationData.getIntersect(
idList,
this.changedOrganization
);
// console.log('intersect2',intersect2);
if (intersect2.length == 0) {
this.$refs.multipleOrganization.toggleAllSelection();
} }
} }
// this.changedOrganization2 = operationData.getDifference(
// this.lookedOrganization,
// this.changedOrganization
// );
} }
}); });
}, },
...@@ -1639,7 +2184,7 @@ export default { ...@@ -1639,7 +2184,7 @@ export default {
let req = { let req = {
projectId: this.projectId projectId: this.projectId
}; };
vm.GET("scope/v1/department", req).then(res => { vm.GET("portal/scope/v1/department", req).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
this.tableDepartment = res.data.department; this.tableDepartment = res.data.department;
...@@ -1657,20 +2202,22 @@ export default { ...@@ -1657,20 +2202,22 @@ export default {
//获取机构id列表 //获取机构id列表
getScopeOrganization(type) { getScopeOrganization(type) {
let scope = ""; let scope = "";
//2:去掉 3:选中
if (type == 2) { if (type == 2) {
for (let key in this.changedOrganization) { // console.log(this.scopeOfOrganizationLast,this.changedOrganization);
let organizationItem = this.changedOrganization[key][1]; let differenceScope = operationData.getDifference(this.scopeOfOrganizationLast,this.changedOrganization);
console.log("organizationItem:", organizationItem); //console.log('differenceScope',differenceScope);
for (let i = 0; i < organizationItem.length; i++) { let unionScope = operationData.getUnion(this.changedOrganization2,differenceScope);
scope += organizationItem[i].id + "|"; //console.log('unionScope',unionScope);
} for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
} }
} else if (type == 3) { } else if (type == 3) {
for (let key in this.changedOrganization) { console.log(this.scopeOfOrganizationLast,this.changedOrganization2);
let organizationItem = this.changedOrganization[key][0]; let differenceScope = operationData.getDifference(this.scopeOfOrganizationLast,this.changedOrganization2);
for (let i = 0; i < organizationItem.length; i++) { let unionScope = operationData.getUnion(this.changedOrganization,differenceScope);
scope += organizationItem[i].id + "|"; for (let i = 0; i < unionScope.length; i++) {
} scope += unionScope[i] + "|";
} }
} }
scope = scope.substring(0, scope.length - 1); scope = scope.substring(0, scope.length - 1);
...@@ -1680,22 +2227,24 @@ export default { ...@@ -1680,22 +2227,24 @@ export default {
//获取人员id列表 //获取人员id列表
getScopePeople(type) { getScopePeople(type) {
let scope = ""; let scope = "";
//2:去掉 3:选中
if (type == 2) { if (type == 2) {
for (let key in this.changedPerson) { let differenceScope = operationData.getDifference(this.scopeOfPeopleLast,this.changedPerson);
let peopleItem = this.changedPerson[key][1]; //console.log('differenceScope',differenceScope);
//console.log("peopleItem:", peopleItem); let unionScope = operationData.getUnion(this.changedPerson2,differenceScope);
for (let i = 0; i < peopleItem.length; i++) { for (let i = 0; i < unionScope.length; i++) {
scope += peopleItem[i].id + "|"; scope += unionScope[i] + "|";
}
} }
} else if (type == 3) { } else if (type == 3) {
for (let key in this.changedPerson) { //console.log(this.changedPerson2,this.scopeOfPeople);
let peopleItem = this.changedPerson[key][0]; let differenceScope = operationData.getDifference(this.scopeOfPeopleLast,this.changedPerson2);
for (let i = 0; i < peopleItem.length; i++) { let unionScope = operationData.getUnion(this.changedPerson,differenceScope);
scope += peopleItem[i].id + "|"; // debugger;
} for (let i = 0; i < unionScope.length; i++) {
scope += unionScope[i] + "|";
} }
} }
scope = scope.substring(0, scope.length - 1); scope = scope.substring(0, scope.length - 1);
console.log("scope people", scope); console.log("scope people", scope);
return scope; return scope;
...@@ -1709,8 +2258,78 @@ export default { ...@@ -1709,8 +2258,78 @@ export default {
scope = scope.substring(0, scope.length - 1); scope = scope.substring(0, scope.length - 1);
return scope; return scope;
}, },
//查询人员列表 //获取医院
getPeople() { getHospital() {
let req = {
projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"),
//scopeOfAdministrative: "000_110",
setKindOfOrganization: this.getKind("organization"),
//scopeOfOrganization: "2|3|4|5|6|7",
pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrative");
}
if (req.setKindOfOrganization == 2 || req.setKindOfOrganization == 3) {
req.scopeOfOrganization = this.getScopeOrganization(
req.setKindOfOrganization
);
}
vm.POST("portal/scope/v1/hospital", req).then(res => {
if (res.code == "000000") {
console.log(res);
this.hospitalList = operationData.getHospitalList(res.data.organizationList);
}
})
},
//选择搜索机构方式
searchPeople() {
this.formPerson.pageNum = 1;
let searchForm = this.formPerson;
if (
searchForm.hospitalId === 0 &&
searchForm.departmentId === -1 &&
searchForm.name == ""
) {
this.searchPeopleType = '';
this.getPeople();
} else {
this.searchPeopleType = 'choose';
this.getPeopleChoose();
}
},
//初始化搜索人员状态
initPeopleChoose() {
let tableStatus = this.tablePerson;
if(typeof tableStatus === 'undefined') {
return;
}
tableStatus.forEach(row => {
let idList = [];
idList[0] = row.id;
let intersect = operationData.getIntersect(idList,this.changedPerson);
let intersect2 = operationData.getIntersect(idList,this.changedPerson2);
// debugger;
if(intersect.length > 0) {
//选中
this.$refs.multiplePerson.toggleRowSelection(row);
} else if (intersect2.length > 0) {
//不选
} else {
if (row.status == 1) {
this.$nextTick(function() {
this.$refs.multiplePerson.toggleRowSelection(row);
});
}
}
});
},
//人员搜索
getPeopleChoose() {
// console.log('formOrganization',this.formOrganization);
let req = { let req = {
projectId: this.projectId, projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"), setKindOfAdministrative: this.getKind("administrative"),
...@@ -1720,7 +2339,10 @@ export default { ...@@ -1720,7 +2339,10 @@ export default {
setKindOfDepartment: this.getKind("department"), setKindOfDepartment: this.getKind("department"),
//scopeOfDepartment: 54, //scopeOfDepartment: 54,
pageNum: this.formPerson.pageNum, pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize pageSize: this.formPerson.pageSize,
hospitalId: this.formPerson.hospitalId,
departmentId: this.formPerson.departmentId,
name: this.formPerson.name,
}; };
if (req.setKindOfAdministrative == 3) { if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrative"); req.scopeOfAdministrative = this.getScope("administrative");
...@@ -1734,63 +2356,138 @@ export default { ...@@ -1734,63 +2356,138 @@ export default {
req.scopeOfDepartment = this.getScopeDepartment(); req.scopeOfDepartment = this.getScopeDepartment();
} }
openLoading(vm); openLoading(vm);
vm.POST("scope/v1/people", req).then(res => { vm.POST("portal/scope/v1/people/choose", req).then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") {
console.log(res); console.log(res);
if (res.code == "000000") {
this.tablePerson = res.data.people; this.tablePerson = res.data.people;
this.totalPerson = res.data.total; this.totalPerson = res.data.total;
if (this.checkTableState.multiplePerson == true) { let idList = operationData.getIdList(this.tablePerson);
//全选 let intersect = operationData.getIntersect(
if ( idList,
this.updatedPerson == true && this.changedPerson
this.changedPerson[this.formPerson.pageNum] != undefined );
) { this.lookedPerson = operationData.getUnion(
//机构table 勾选被更新过 this.lookedPerson,
let rowCheck = this.changedPerson[this.formPerson.pageNum][0]; idList
//console.log("rowCheck:",rowCheck); );
rowCheck.forEach(row => { // this.changedPerson2 = operationData.getDifference(
// console.log("row", row); // this.lookedPerson,
let rowItem = {}; // this.changedPerson
for (let i = 0; i < this.tablePerson.length; i++) { // );
if (this.tablePerson[i].id == row.id) { //console.log('全部看过的:',this.lookedPerson);
rowItem = this.tablePerson[i]; if (vm.checkTableState.multiplePerson === "") {
this.initPeopleChoose();
} else if (vm.checkTableState.multiplePerson === true) {
let intersect2 = operationData.getIntersect(
idList,
this.changedPerson
);
if (intersect2.length == 0) {
this.$refs.multiplePerson.toggleAllSelection();
}
} }
} }
});
},
initPeopleStatus() {
let tableStatus = this.tablePerson;
tableStatus.forEach(row => {
if (row.status == 1) {
this.$nextTick(function() { this.$nextTick(function() {
this.$refs.multiplePerson.toggleRowSelection(rowItem); this.$refs.multiplePerson.toggleRowSelection(row);
}); });
}
}); });
} else { },
this.$refs.multiplePerson.toggleAllSelection(); //查询人员列表
getPeople() {
let req = {
projectId: this.projectId,
setKindOfAdministrative: this.getKind("administrative"),
//scopeOfAdministrative: "000_110",
setKindOfOrganization: this.getKind("organization"),
//scopeOfOrganization: "2|3|4|5|6|7",
setKindOfDepartment: this.getKind("department"),
//scopeOfDepartment: 54,
pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize
};
if (req.setKindOfAdministrative == 3) {
req.scopeOfAdministrative = this.getScope("administrative");
} }
} else { if (req.setKindOfOrganization == 2 || req.setKindOfOrganization == 3) {
//person 全不选 req.scopeOfOrganization = this.getScopeOrganization(
if ( req.setKindOfOrganization
this.updatedPerson == true && );
this.changedPerson[this.formPerson.pageNum] != undefined
) {
let rowCheck = this.changedPerson[this.formPerson.pageNum][0];
//console.log("rowCheck:",rowCheck);
rowCheck.forEach(row => {
// console.log("row", row);
let rowItem = {};
for (let i = 0; i < this.tablePerson.length; i++) {
if (this.tablePerson[i].id == row.id) {
rowItem = this.tablePerson[i];
} }
if (req.setKindOfDepartment == 3) {
req.scopeOfDepartment = this.getScopeDepartment();
} }
this.$nextTick(function() { openLoading(vm);
this.$refs.multiplePerson.toggleRowSelection(rowItem); vm.POST("portal/scope/v1/people", req).then(res => {
}); closeLoading(vm);
}); if (res.code == "000000") {
console.log(res);
this.tablePerson = res.data.people;
this.totalPerson = res.data.total;
let idList = operationData.getIdList(this.tablePerson);
let intersect = operationData.getIntersect(
idList,
this.changedPerson
);
this.lookedPerson = operationData.getUnion(
this.lookedPerson,
idList
);
// this.changedPerson2 = operationData.getDifference(
// this.lookedPerson,
// this.changedPerson
// );
let difference = operationData.getDifference(
idList,
this.changedPerson2
);
//console.log('全部看过的:',this.lookedPerson);
if (vm.checkTableState.multiplePerson === "") {
// console.log('intersect',intersect);
if (intersect.length == 0 && difference.length > 0) {
this.initPeopleStatus();
}
} else if (vm.checkTableState.multiplePerson === true) {
let intersect2 = operationData.getIntersect(
idList,
this.changedPerson
);
// console.log('intersect2',intersect2);
if (intersect2.length == 0) {
this.$refs.multiplePerson.toggleAllSelection();
} }
} }
} }
}); });
}, },
//设定人员中科室列表
getDepartmentList() {
let list = [];
list[0] = {
value: -1,
label: '全部科室',
};
for (let i = 0; i < this.tableDepartment.length; i++) {
if (this.tableDepartment[i].status == 1) {
let obj = {
value: this.tableDepartment[i].id,
label: this.tableDepartment[i].name
};
list.push(obj);
}
}
return list;
},
//机构table修改 //机构table修改
handleSizeOrganization(val) { handleSizeOrganization(val) {
console.log(`每页 ${val} 条`); console.log(`每页 ${val} 条`);
...@@ -1799,7 +2496,11 @@ export default { ...@@ -1799,7 +2496,11 @@ export default {
handleCurrentOrganization(val) { handleCurrentOrganization(val) {
//console.log(`当前页: ${val}`); //console.log(`当前页: ${val}`);
this.formOrganization.pageNum = val; this.formOrganization.pageNum = val;
if(this.searchOrganizationType == 'choose') {
this.getOrganizationChoose();
} else {
this.getOrganization(); this.getOrganization();
}
}, },
//角色table修改 //角色table修改
handleSizePerson(val) { handleSizePerson(val) {
...@@ -1809,19 +2510,49 @@ export default { ...@@ -1809,19 +2510,49 @@ export default {
handleCurrentPerson(val) { handleCurrentPerson(val) {
console.log(`当前页: ${val}`); console.log(`当前页: ${val}`);
this.formPerson.pageNum = val; this.formPerson.pageNum = val;
if(this.searchPeopleType == 'choose') {
this.getPeopleChoose();
} else {
this.getPeople(); this.getPeople();
}
}, },
//行政范围改变更新设定机构和设定人员 //行政范围改变更新设定机构和设定人员
updateOrganizationAndPerson(allSelectedKeys) { updateOrganizationAndPerson(allSelectedKeys) {
this.tableOrganization = []; this.tableOrganization = [];
this.tablePerson = []; this.tablePerson = [];
this.$refs.multipleOrganization.clearSelection();
this.lookedOrganization = [];
this.changedOrganization = [];
this.changedOrganization2 = [];
// this.lookedPerson = [];
// this.changedPerson = [];
// this.changedPerson2 = [];
}, },
//设定机构改变更新设定人员 //设定机构改变更新设定人员
updatePerson(organization) { updatePerson() {
if (this.hasOrganizationInit === true) { this.lookedPerson = [];
this.tablePerson = []; this.changedPerson = [];
this.changedPerson2 = [];
},
//scope的不同status操作
scopeStatus(data) {
//console.log('范围提交status:'+data);
let status = data;
//console.log('范围提交status:'+status);
if(status === 0) {
this.flagCover = 0;
} else if(status === 1) {
vm.$message({
type: "info",
message: "您已被上级管理员移除项目,暂无权限操作",
});
this.$router.push("item-manager");
} else if(status === 2) {
console.log('弹框');
this.flagCover = 1;
this.dialogShow = true;
} }
this.hasOrganizationInit = true; return status;
}, },
//选择项目组件 //选择项目组件
//改变组件选择情况 //改变组件选择情况
...@@ -1841,8 +2572,25 @@ export default { ...@@ -1841,8 +2572,25 @@ export default {
} }
//console.log('this.tagsComponent',this.tagsComponent); //console.log('this.tagsComponent',this.tagsComponent);
}, },
initTags(value) {
//console.log('value',value,'optionsComponent',this.optionsComponent);
this.tagsComponent = [];
let len = 0;
for (let i = 0; i < value.length; i++) {
for (let j = 0; j < this.optionsComponent.length; j++) {
if (value[i] == this.optionsComponent[j].value) {
this.tagsComponent[len] = {};
this.tagsComponent[len].value = this.optionsComponent[j].value;
this.tagsComponent[len].name = this.optionsComponent[j].label;
len++;
}
}
}
//console.log('this.tagsComponent',this.tagsComponent);
},
//选择组件数据绑定 //选择组件数据绑定
handleCloseComponent(tag) { handleCloseComponent(tag) {
if (this.projectStatus == 1 || this.projectStatus == 2) {
this.tagsComponent.splice(this.tagsComponent.indexOf(tag), 1); this.tagsComponent.splice(this.tagsComponent.indexOf(tag), 1);
this.formComponent.component = []; this.formComponent.component = [];
for (let j = 0; j < this.tagsComponent.length; j++) { for (let j = 0; j < this.tagsComponent.length; j++) {
...@@ -1850,6 +2598,7 @@ export default { ...@@ -1850,6 +2598,7 @@ export default {
} }
} }
} }
}
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
...@@ -1863,9 +2612,9 @@ export default { ...@@ -1863,9 +2612,9 @@ export default {
.step-content { .step-content {
overflow: hidden; overflow: hidden;
height: 60px; height: 60px;
margin-top: 66px; // margin-top: 66px;
padding-top: 15px; padding: 15px 0 50px 0;
border-bottom: 1px solid #fff; border-bottom: 1px solid #efefef;
.is-text { .is-text {
display: none; display: none;
} }
...@@ -1886,25 +2635,72 @@ export default { ...@@ -1886,25 +2635,72 @@ export default {
} }
.step-num { .step-num {
display: block; display: block;
margin-top: 1.5px;
font-size: 12px; font-size: 12px;
border: 2px solid #b8babe; border: 1px solid #999 !important;
border-radius: 50%; border-radius: 50%;
width: 25px; width: 25px;
height: 20px; height: 18px;
line-height: 15px; line-height: 15px;
text-align: center; text-align: center;
color: #b8babe; color: #999;
}
.el-step__title.is-wait {
color: #999;
}
.el-step__title.is-process {
color: #449284;
} }
.is-finish { .is-finish {
color: #c0c4cc; color: #999 !important;
} }
.on-step { .on-step {
color: #747476; color: #449284;
border-color: #747476; border: 1px solid #449284 !important;
} }
} }
.first-step { .first-step {
margin-top: 20px; margin-top: 20px;
.basic-item-icon {
position: relative;
.require {
position: absolute;
left: 67px;
top: 11px;
color: #f56c6c;
}
.upload-message {
position: absolute;
left: 160px;
top: 105px;
font-size: 12px;
color: #f56c6c;
}
.img-delete {
position: absolute;
left: 0px;
top: 0px;
width: 84px;
height: 100px;
background: #000;
opacity: 0.7;
z-index: 999;
i {
color: #fff;
margin-top: 39px;
margin-left: 0px;
}
}
}
.word-num {
font-size: 12px;
color: #999;
padding-top: 5px;
}
.line {
margin-left: 10px;
width: 20px;
}
.bg-uploader { .bg-uploader {
img { img {
float: left; float: left;
...@@ -1915,7 +2711,7 @@ export default { ...@@ -1915,7 +2711,7 @@ export default {
} }
.bg-video { .bg-video {
float: left; float: left;
width: 100px; width: 84px;
height: 100px; height: 100px;
} }
.limit-text { .limit-text {
...@@ -1941,7 +2737,21 @@ export default { ...@@ -1941,7 +2737,21 @@ export default {
} }
.second-step { .second-step {
margin: 10px 0 0 20px; margin: 10px 0 0 20px;
.dialog-p {
text-align: center;
span {
color: #449284;
}
}
//隐藏树展开 //隐藏树展开
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
.el-tree-node__expand-icon { .el-tree-node__expand-icon {
display: none; display: none;
} }
...@@ -1973,6 +2783,9 @@ export default { ...@@ -1973,6 +2783,9 @@ export default {
margin-left: 20px; margin-left: 20px;
content: "•"; content: "•";
} }
.el-tabs__item.is-active {
color: #fff;
}
.el-tag { .el-tag {
margin: 0 10px 10px 0; margin: 0 10px 10px 0;
border: 1.3px solid #48a8fe; border: 1.3px solid #48a8fe;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
:curmbThird="curmbThird" :curmbThird="curmbThird"
:jumPathThird="jumPathThird"> :jumPathThird="jumPathThird">
</bread-crumb> </bread-crumb>
<div class="create-content screenSet"> <div class="create-content screenSet" id="screenSet">
<div class="step-content"> <div class="step-content">
<el-steps :active="stepNum" simple> <el-steps :active="stepNum" simple>
<span class="step-one" :class="stepNum == 1 ? 'class-1' : 'class-2'">1</span> <span class="step-one" :class="stepNum == 1 ? 'class-1' : 'class-2'">1</span>
...@@ -22,16 +22,18 @@ ...@@ -22,16 +22,18 @@
</div> </div>
</div> </div>
<div class="first-step" v-if="stepNum == 1"> <div class="first-step" v-if="stepNum == 1">
<el-form ref="basicInfoForm" class="basic-form" :model="portalComponent" :rules="rules" label-width="125px" label-suffix=":" size="mini" style="margin-bottom:30px;"> <el-form ref="basicInfoForm" class="basic-form" :model="portalComponent" :rules="rules" label-width="125px" label-suffix=":" size="small" style="margin-bottom:30px;">
<el-form-item label="组件名称" prop="name"> <el-form-item label="组件名称" prop="name">
<el-input type="text" v-model="portalComponent.name" @blur="componentName" size="mini" placeholder="请输入组件名称" style="width:30%;"></el-input> <el-input type="text" v-model="portalComponent.name" @blur="componentName" size="small" placeholder="请输入组件名称" style="width:30%;"></el-input>
<span class="word-num">0/20</span> <span class="word-num">{{(portalComponent.name).replace(/\s+/g,"").length}}/20</span>
<p class="component-name" v-if="isStorage">输入组件名称</p> <p class="component-name" v-if="isStorage">输入组件名称</p>
</el-form-item> </el-form-item>
<el-form-item label="组件简介" prop="introduce"> <el-form-item label="组件简介" prop="introduce">
<el-input type="textarea" rows="4" cols="10" v-model="portalComponent.introduce" size="mini" placeholder="请输入组件简介" style="width:37%;"></el-input> <el-input type="textarea" rows="4" cols="10" v-model="portalComponent.introduce" size="small" placeholder="请输入组件简介" style="width:37%;"></el-input>
<span class="word-num">0/150</span> <span class="word-num">{{(portalComponent.introduce).replace(/\s+/g,"").length}}/150</span>
</el-form-item> </el-form-item>
<div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="组件图片" prop="imageUrl"> <el-form-item label="组件图片" prop="imageUrl">
<el-upload <el-upload
v-model="portalComponent.imageUrl" v-model="portalComponent.imageUrl"
...@@ -39,8 +41,9 @@ ...@@ -39,8 +41,9 @@
action="#" action="#"
:show-file-list="false" :show-file-list="false"
:before-upload="beforeAvatarUpload"> :before-upload="beforeAvatarUpload">
<img v-if="portalComponent.imageUrl" :src="portalComponent.imageUrl" class="bg-img"> <img v-if="portalComponent.imageUrl" @mouseover.stop="imgMouseOver=true" :src="portalComponent.imageUrl" class="bg-img">
<img v-if="!portalComponent.imageUrl" class="bg-img" src="../../assets/image/small.png"> <img v-if="!portalComponent.imageUrl" class="bg-img" src="../../assets/image/small.png">
<div class="img-delete" v-show="imgMouseOver" @click.stop="deleteImg" @mouseout.stop="imgMouseOver=false"><i class="el-icon-delete"></i></div>
<div class="limit-text"> <div class="limit-text">
<p>尺寸大小:750*420</p> <p>尺寸大小:750*420</p>
<p>限制大小: 2.0 Mb</p> <p>限制大小: 2.0 Mb</p>
...@@ -48,18 +51,23 @@ ...@@ -48,18 +51,23 @@
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<p class="upload-message" v-if="uploadImgMessage">请上传组件图片</p>
</div>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<div class="basic-item-icon">
<span class="require">*</span>
<el-form-item label="配置证书"> <el-form-item label="配置证书">
<el-radio-group v-model="certificateLable" @change="selectCertificate"> <el-radio-group v-model="certificateLable" @change="selectCertificate" :disabled="componentStatus == 3 || componentStatus == 4">
<el-radio label="是"></el-radio> <el-radio label="是"></el-radio>
<el-radio label="否"></el-radio> <el-radio label="否"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</div>
</el-col> </el-col>
<el-col :span="10" v-if="hasCertificate"> <el-col :span="10" v-if="hasCertificate">
<el-form-item label="选择证书" prop="certificateId"> <el-form-item label="选择证书" prop="certificateId">
<el-select v-model="portalComponent.certificateId" @change="selectChange" placeholder="请选择资源包" style="width: 352px;"> <el-select v-model="portalComponent.certificateId" @change="selectChange" :disabled="componentStatus == 3 || componentStatus == 4" placeholder="请选择证书" style="width: 352px;">
<el-option <el-option
v-for="(item,index) in certificateIdSelect" v-for="(item,index) in certificateIdSelect"
:key="index" :key="index"
...@@ -70,11 +78,12 @@ ...@@ -70,11 +78,12 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item v-if="hasCertificate" label="获得证书完成率" prop="certificateCondition"> <el-form-item v-if="hasCertificate" label="组件完成(%)" prop="certificateCondition">
<el-input-number <el-input-number
v-model="portalComponent.certificateCondition" v-model="portalComponent.certificateCondition"
controls-position="right" controls-position="right"
@change="handleChange" @change="handleChange"
:disabled="componentStatus == 3 || componentStatus == 4"
:step="10" :step="10"
:min="10" :min="10"
:max="100"> :max="100">
...@@ -95,14 +104,14 @@ ...@@ -95,14 +104,14 @@
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="模块名称" prop="name"> <el-form-item label="模块名称" prop="name">
<el-input v-model="item.name" :disabled="conditionSelect || idType == 2 || item.moduleType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" placeholder="请选择模块名称" style="width:288px;"></el-input> <el-input v-model="item.name" @blur="moduleNameValidate(index)" :disabled="conditionSelect || idType == 2 || item.moduleType == 2 || (item.id != '' && item.openFlag == 2)" size="small" placeholder="请选择模块名称" style="width:288px;"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10" v-if="idType == 1"> <el-col :span="10" v-if="idType == 1">
<el-form-item label="是否对外开放" prop="openFlag"> <el-form-item label="是否对外开放" prop="openFlag">
<el-radio-group v-model="item.openFlag" @change="selectIsOpen(index)" :disabled="conditionSelect || item.moduleType == 2 || (item.id != '' && item.openFlag == 2)"> <el-radio-group v-model="item.openFlag" @change="selectIsOpen(index)" :disabled="conditionSelect || item.moduleType == 2 || (item.id != '' && item.openFlag == 2)">
<el-radio :label="2" @change="moduleOpenChange"></el-radio> <el-radio :label="2"></el-radio>
<el-radio :label="1" @change="moduleOpenChange"></el-radio> <el-radio :label="1"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -141,7 +150,7 @@ ...@@ -141,7 +150,7 @@
<el-col :span="10" class="item-icon"> <el-col :span="10" class="item-icon">
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="考试名称"> <el-form-item label="考试名称">
<el-input v-model="item3.content1" :disabled="conditionSelect || item.moduleType == 2 || (item.id != '' && item.openFlag == 2) || idType == 2" size="mini" maxlength='30' placeholder="请输入考试名称" style="width:288px;"></el-input> <el-input v-model="item3.content1" :disabled="conditionSelect || item.moduleType == 2 || (item.id != '' && item.openFlag == 2) || idType == 2" size="small" maxlength='30' placeholder="请输入考试名称" style="width:288px;"></el-input>
<span v-if="conditionAnd && item2.numFlag == 2 && index3 == 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-circle-plus" @click="addMatterCourse(index,index1,index2)" style="color:#449284;"></i></span> <span v-if="conditionAnd && item2.numFlag == 2 && index3 == 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-circle-plus" @click="addMatterCourse(index,index1,index2)" style="color:#449284;"></i></span>
<span v-if="conditionAnd && item2.numFlag == 2 && index3 > 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-delete" @click="deleteMatterCourse(index,index1,index2,index3)" style="color:red;"></i></span> <span v-if="conditionAnd && item2.numFlag == 2 && index3 > 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-delete" @click="deleteMatterCourse(index,index1,index2,index3)" style="color:red;"></i></span>
</el-form-item> </el-form-item>
...@@ -149,7 +158,7 @@ ...@@ -149,7 +158,7 @@
<el-col :span="10" class="item-icon"> <el-col :span="10" class="item-icon">
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="关联考试"> <el-form-item label="关联考试">
<el-select v-model="item3.content2" @focus="examIDfocus(index,index1,index2,index3)" @change="changeExamID" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" placeholder="请选择考试ID" style="width:288px;"> <el-select v-model="item3.content2" @focus="examIDfocus(index,index1,index2,index3)" @change="changeExamID" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="small" placeholder="请选择考试ID" style="width:288px;">
<el-option <el-option
v-for="(itemTest,indexTest) in testIdSelect" v-for="(itemTest,indexTest) in testIdSelect"
:key="indexTest" :key="indexTest"
...@@ -173,7 +182,7 @@ ...@@ -173,7 +182,7 @@
<el-col :span="10" v-if="item3.certificateFlag == 2" class="item-icon"> <el-col :span="10" v-if="item3.certificateFlag == 2" class="item-icon">
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="选择证书"> <el-form-item label="选择证书">
<el-select v-model="item3.content3" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" placeholder="请选择证书" style="width:288px;"> <el-select v-model="item3.content4" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="small" placeholder="请选择证书" style="width:288px;">
<el-option <el-option
v-for="(itemCertificate,indexCertificate) in certificateIdSelect" v-for="(itemCertificate,indexCertificate) in certificateIdSelect"
:key="indexCertificate" :key="indexCertificate"
...@@ -193,7 +202,7 @@ ...@@ -193,7 +202,7 @@
<el-col :span="10" class="item-icon"> <el-col :span="10" class="item-icon">
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="课程名称"> <el-form-item label="课程名称">
<el-input v-model="item3.content1" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" maxlength='30' placeholder="请输入课程名称" style="width:288px;"></el-input> <el-input v-model="item3.content1" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="small" maxlength='30' placeholder="请输入课程名称" style="width:288px;"></el-input>
<span v-if="conditionAnd && item2.numFlag == 2 && index3 == 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-circle-plus" @click="addMatterCourse(index,index1,index2)" style="color:#449284;"></i></span> <span v-if="conditionAnd && item2.numFlag == 2 && index3 == 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-circle-plus" @click="addMatterCourse(index,index1,index2)" style="color:#449284;"></i></span>
<span v-if="conditionAnd && item2.numFlag == 2 && index3 > 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-delete" @click="deleteMatterCourse(index,index1,index2,index3)" style="color:red;"></i></span> <span v-if="conditionAnd && item2.numFlag == 2 && index3 > 0 && item.moduleType == 1 && idType == 1 && (item.id == '' || (item.id != '' && item.openFlag == 1))"><i class="el-icon-delete" @click="deleteMatterCourse(index,index1,index2,index3)" style="color:red;"></i></span>
</el-form-item> </el-form-item>
...@@ -201,7 +210,7 @@ ...@@ -201,7 +210,7 @@
<el-col :span="10" class="item-icon"> <el-col :span="10" class="item-icon">
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="关联课程"> <el-form-item label="关联课程">
<el-select v-model="item3.content2" @focus="courseIDfocus(index,index1,index2,index3)" @change="changeCourseID" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="mini" placeholder="请选择课程ID" style="width:288px;"> <el-select v-model="item3.content2" @focus="courseIDfocus(index,index1,index2,index3)" @change="changeCourseID" :disabled="conditionSelect || item.moduleType == 2 || idType == 2 || (item.id != '' && item.openFlag == 2)" size="small" placeholder="请选择课程ID" style="width:288px;">
<el-option <el-option
v-for="(itemCourse,indexCourse) in courseIdSelect" v-for="(itemCourse,indexCourse) in courseIdSelect"
:key="indexCourse" :key="indexCourse"
...@@ -225,7 +234,7 @@ ...@@ -225,7 +234,7 @@
</div> </div>
</div> </div>
<el-dialog :title="dialogTitle" :visible.sync="columnFormVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false"> <el-dialog :title="dialogTitle" :visible.sync="columnFormVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form ref="resourceForm" class="creat-form" :model="selectResource" label-width="145px" label-suffix=":" size="mini"> <el-form ref="resourceForm" class="creat-form" :model="selectResource" label-width="145px" label-suffix=":" size="small">
<el-form-item label="请选择一个模块" prop=""> <el-form-item label="请选择一个模块" prop="">
<el-select v-model="selectResource.resourceModuleSelect" @change="selectChange" placeholder="请选择资源包" style="width:60%;"> <el-select v-model="selectResource.resourceModuleSelect" @change="selectChange" placeholder="请选择资源包" style="width:60%;">
<el-option <el-option
...@@ -254,7 +263,7 @@ ...@@ -254,7 +263,7 @@
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="配置证书"> <el-form-item label="配置证书">
<span v-if="item1.content2"></span> <span v-if="item2.certificateFlag == 2"></span>
<span v-else></span> <span v-else></span>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -284,29 +293,25 @@ ...@@ -284,29 +293,25 @@
</template> </template>
<script> <script>
import BreadCrumb from '../../components/breadcrumb.vue' import BreadCrumb from '../../components/breadcrumb.vue'
import { doUpload, getFilePath } from "../../utils/qiniuUtil" import { doUpload, getFilePath } from "../../utils/qiniu-util"
import { validateWord150 } from "../../utils/validate.js" // import { validateWord150 } from "../../utils/validate.js"
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { openLoading, closeLoading, isNotEmptyUtils, isEmptyList } from '../../utils/utils'; import { openLoading, closeLoading, isNotEmptyUtils, isEmptyList, isNotEmptyList } from '../../utils/utils'
import * as commonUtil from '../../utils/utils'
let vm = null let vm = null
// 判断组件是否重名 // 判断组件是否重名
let validateRepeatWord = function(rule, value, callback, message) { let validateRepeatWord = function(rule, value, callback, message) {
const reg = /^[\u4e00-\u9fa5]{2,20}$/
if(!reg.test(value)) {
callback(new Error(message))
return
}
let req = { let req = {
token: vm._token, token: vm._token,
name: value, name: value,
idType: vm.idType // 1内部 2外部 idType: vm.idType, // 1内部 2外部
id: null || vm.componentId
} }
if(vm.itemName != value) { if(vm.itemName != value) {
vm.GET('portalComponent/checkComponentName',req).then((res) => { vm.GET('portal/portalComponent/checkComponentName',req).then((res) => {
if(res.code == '000000') { if(res.code == '000000') {
if(res.data.resultFlag == 2) { if(res.data.resultFlag == 2) {
callback(new Error('该组件名称已存在,请使用一个新的组件名称')) callback(new Error(message))
return
}else { }else {
callback() callback()
} }
...@@ -318,16 +323,12 @@ let validateRepeatWord = function(rule, value, callback, message) { ...@@ -318,16 +323,12 @@ let validateRepeatWord = function(rule, value, callback, message) {
} }
// 判断模块是否重名(对外开放时候验证) // 判断模块是否重名(对外开放时候验证)
let validateModuleName = function(rule, value, callback, message) { let validateModuleName = function(rule, value, callback, message) {
const reg = /^[\u4e00-\u9fa5]{2,20}$/
if(!reg.test(value)) {
callback(new Error('输入长度为2-20个字符'))
return
}
for(let i = 0;i<vm.componentList.moduleModelList.length;i++) { for(let i = 0;i<vm.componentList.moduleModelList.length;i++) {
if(vm.componentList.moduleModelList[i].openFlag == 2) { if(vm.firstTab == parseInt(i + 1)) {
vm.GET('portalComponent/checkModuleName',{name: value}).then((res) => { vm.GET('portal/portalComponent/checkModuleName',{name: value,openFlag: vm.componentList.moduleModelList[i].openFlag}).then((res) => {
if(res.code == '000000') { if(res.code == '000000') {
if(res.data.resultFlag > 0) { if(res.data > 0) {
vm.componentList.moduleModelList[i].name = ''
callback(new Error(message)) callback(new Error(message))
return return
}else { }else {
...@@ -335,8 +336,7 @@ let validateModuleName = function(rule, value, callback, message) { ...@@ -335,8 +336,7 @@ let validateModuleName = function(rule, value, callback, message) {
} }
} }
}) })
}else { break
callback()
} }
} }
} }
...@@ -347,6 +347,8 @@ export default { ...@@ -347,6 +347,8 @@ export default {
data() { data() {
return { return {
columnFormVisible: false, columnFormVisible: false,
uploadImgMessage: false,
imgMouseOver: false,
itemName: '', itemName: '',
examName: '', examName: '',
examIndex: '', examIndex: '',
...@@ -363,7 +365,7 @@ export default { ...@@ -363,7 +365,7 @@ export default {
componentStatus: '', componentStatus: '',
resultFlag: '', resultFlag: '',
conditionSelect: false, conditionSelect: false,
conditionAnd: false, conditionAnd: true,
isStorage: false, isStorage: false,
dialogTitle: '选择模板', dialogTitle: '选择模板',
curmbFirst: '教培项目', curmbFirst: '教培项目',
...@@ -401,7 +403,7 @@ export default { ...@@ -401,7 +403,7 @@ export default {
moduleModelList: [{ moduleModelList: [{
id: '', id: '',
name: '', name: '',
openFlag: '', // 1不开放 2开放 openFlag: '', // 1 否 不开放 2 是 开放
templetModelList: [] templetModelList: []
}] }]
}, },
...@@ -412,20 +414,15 @@ export default { ...@@ -412,20 +414,15 @@ export default {
rules: { rules: {
"name": [ "name": [
{ required: true, message: '输入组件名称', trigger: 'blur' }, { required: true, message: '输入组件名称', trigger: 'blur' },
{ min: 2, max: 20, message: '输入长度为2-20个字符', trigger: 'blur' },
{ validator: function(rule, value, callback) { { validator: function(rule, value, callback) {
validateRepeatWord(rule, value, callback, '输入长度为2-20个字符') validateRepeatWord(rule, value, callback, '该组件名称已存在,请使用一个新的组件名称')
}, },
trigger: 'blur' } trigger: 'blur' }
], ],
"introduce": [ "introduce": [
{ required: true, message: '请输入组件简介', trigger: 'blur' }, { required: true, message: '请输入组件简介', trigger: 'blur' },
{ validator: function(rule, value, callback) { { min: 1, max: 150, message: '超出可输入的最大长度', trigger: 'blur' }
validateWord150(rule, value, callback, '超出可输入的最大长度')
},
trigger: 'blur' }
],
"imageUrl": [
{ required: true, message: '请上传组件图片', trigger: 'blur' },
], ],
"certificateId": [ "certificateId": [
{ required: true, message: '请选择证书', trigger: 'blur' }, { required: true, message: '请选择证书', trigger: 'blur' },
...@@ -437,6 +434,7 @@ export default { ...@@ -437,6 +434,7 @@ export default {
moduleRules: { moduleRules: {
"name": [ "name": [
{ required: true, message: '请输入模块名称', trigger: 'blur' }, { required: true, message: '请输入模块名称', trigger: 'blur' },
{ min: 2, max: 20, message: '输入长度为2-20个字符', trigger: 'blur' },
{ validator: function(rule, value, callback) { { validator: function(rule, value, callback) {
validateModuleName(rule, value, callback, '模块名称已存在,请修改名称后保存') validateModuleName(rule, value, callback, '模块名称已存在,请修改名称后保存')
}, },
...@@ -462,14 +460,20 @@ export default { ...@@ -462,14 +460,20 @@ export default {
vm.getCertificateList() // 获取证书列表 vm.getCertificateList() // 获取证书列表
vm.componentBasicInfo() // 根据ID查询组件基本信息 vm.componentBasicInfo() // 根据ID查询组件基本信息
vm.conditionSelect = vm.resultFlag == 2 || vm.componentStatus == 3 || vm.componentStatus == 4 vm.conditionSelect = vm.resultFlag == 2 || vm.componentStatus == 3 || vm.componentStatus == 4
if(vm.componentStatus && vm.resultFlag) {
vm.conditionAnd = vm.resultFlag == 1 && vm.componentStatus != 3 && vm.componentStatus != 4 vm.conditionAnd = vm.resultFlag == 1 && vm.componentStatus != 3 && vm.componentStatus != 4
}
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight()
}, },
methods: { methods: {
// 根据ID查询组件基本信息 // 根据ID查询组件基本信息
componentBasicInfo() { componentBasicInfo() {
if(vm.componentId) { if(vm.componentId) {
openLoading(vm) openLoading(vm)
vm.GET('portalComponent/queryPortalComponentById',{id: vm.componentId}).then((res) => { vm.GET('portal/portalComponent/queryPortalComponentById',{id: vm.componentId}).then((res) => {
closeLoading(vm) closeLoading(vm)
if( res.code == '000000') { if( res.code == '000000') {
vm.portalComponent = res.data.portalComponent vm.portalComponent = res.data.portalComponent
...@@ -485,14 +489,18 @@ export default { ...@@ -485,14 +489,18 @@ export default {
}) })
} }
}, },
// 删除图片
deleteImg() {
vm.portalComponent.imageUrl = ''
vm.imgMouseOver = false
},
// 是否配置证书 // 是否配置证书
selectCertificate(val) { selectCertificate(val) {
vm.portalComponent.certificateId = ''
if(val == '否') { if(val == '否') {
vm.portalComponent.certificateId = 0
vm.hasCertificate = false vm.hasCertificate = false
vm.portalComponent.certificateCondition = 0 vm.portalComponent.certificateCondition = 0
}else{ }else{
vm.portalComponent.certificateId = 1
vm.hasCertificate = true vm.hasCertificate = true
vm.portalComponent.certificateCondition = 60 vm.portalComponent.certificateCondition = 60
} }
...@@ -503,19 +511,20 @@ export default { ...@@ -503,19 +511,20 @@ export default {
}, },
// 获取证书下拉列表 // 获取证书下拉列表
getCertificateList() { getCertificateList() {
vm.GET('portalComponent/CertificateList').then((res) => { vm.GET('portal/portalComponent/CertificateList').then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.certificateIdSelect = res.data.certificateList vm.certificateIdSelect = res.data.certificateList
}else {
vm.$message.info(res.message)
} }
}) })
}, },
// 暂存(下一步) // 暂存(下一步)
storageAndNext(flag) { storageAndNext(flag) {
vm.itemName = vm.portalComponent.name
if(vm.componentId) { // 编辑 if(vm.componentId) { // 编辑
vm.submitBasicData(flag,'portalComponent/updatePortalComponent') vm.submitBasicData(flag,'portal/portalComponent/updatePortalComponent')
}else{ // 新增 }else{ // 新增
vm.submitBasicData(flag,'portalComponent/insertPortalComponent') vm.submitBasicData(flag,'portal/portalComponent/insertPortalComponent')
} }
}, },
submitBasicData(flag,url) { submitBasicData(flag,url) {
...@@ -533,11 +542,17 @@ export default { ...@@ -533,11 +542,17 @@ export default {
if(!vm.componentId) { if(!vm.componentId) {
vm.portalComponent.status = 1 vm.portalComponent.status = 1
} }
if(!vm.portalComponent.imageUrl) {
vm.uploadImgMessage = true
return
} else {
vm.uploadImgMessage = false
}
vm.$refs.basicInfoForm.validate((valid) => { vm.$refs.basicInfoForm.validate((valid) => {
if (valid) { if (valid) {
vm.submitBasic(flag,url) vm.submitBasic(flag,url)
} else { } else {
return false; return false
} }
}) })
} }
...@@ -546,6 +561,19 @@ export default { ...@@ -546,6 +561,19 @@ export default {
vm.isStorage = false vm.isStorage = false
}, },
submitBasic(flag,url) { submitBasic(flag,url) {
let req = {
token: vm._token,
name: vm.portalComponent.name,
idType: vm.idType, // 1内部 2外部
id: null || vm.componentId
}
if(vm.portalComponent.name != vm.itemName) {
vm.GET('portal/portalComponent/checkComponentName',req).then((res) => {
if(res.code == '000000') {
if(res.data.resultFlag == 2) {
vm.$message.info("该组件名称已存在,请使用一个新的组件名称")
return
}else {
vm.portalComponent.idType = vm.idType vm.portalComponent.idType = vm.idType
vm.portalComponent.id = vm.componentId vm.portalComponent.id = vm.componentId
vm.POST(url,{ model: vm.portalComponent }).then((res) => { vm.POST(url,{ model: vm.portalComponent }).then((res) => {
...@@ -564,6 +592,31 @@ export default { ...@@ -564,6 +592,31 @@ export default {
} }
} }
}) })
}
} else {
vm.$message.info(res.message)
}
})
}else {
vm.portalComponent.idType = vm.idType
vm.portalComponent.id = vm.componentId
vm.POST(url,{ model: vm.portalComponent }).then((res) => {
if( res.code == '000000') {
if(!vm.componentId) {
vm.componentId = res.data
}
if(flag == 2) {
vm.stepNum = 2
vm.getTemplateData()
vm.getModuleData()
vm.getTestListData()
vm.getCourseData()
} else {
vm.$message.info("暂存成功!")
}
}
})
}
}, },
// 上传组件图片 // 上传组件图片
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
...@@ -588,6 +641,7 @@ export default { ...@@ -588,6 +641,7 @@ export default {
doUpload(vm,file, getFilePath(file,null), 'preview4', 'progress1', 1).then(function (path) { doUpload(vm,file, getFilePath(file,null), 'preview4', 'progress1', 1).then(function (path) {
closeLoading(vm) closeLoading(vm)
vm.portalComponent.imageUrl = path.fullPath vm.portalComponent.imageUrl = path.fullPath
vm.uploadImgMessage = false
}); });
} }
} }
...@@ -595,9 +649,11 @@ export default { ...@@ -595,9 +649,11 @@ export default {
}, },
// 获取考试下拉列表 // 获取考试下拉列表
getTestListData() { getTestListData() {
vm.GET('portalComponent/OnlineExamList').then((res) => { vm.GET('portal/portalComponent/OnlineExamList').then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.testIdSelect = res.data.onlineExamList vm.testIdSelect = res.data.onlineExamList
}else {
vm.$message.info(res.message)
} }
}) })
}, },
...@@ -621,9 +677,11 @@ export default { ...@@ -621,9 +677,11 @@ export default {
}, },
// 获取课程下拉列表 // 获取课程下拉列表
getCourseData() { getCourseData() {
vm.GET('portalComponent/CourseList').then((res) => { vm.GET('portal/portalComponent/CourseList').then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.courseIdSelect = res.data.courseList vm.courseIdSelect = res.data.courseList
}else {
vm.$message.info(res.message)
} }
}) })
}, },
...@@ -647,32 +705,37 @@ export default { ...@@ -647,32 +705,37 @@ export default {
}, },
// 获取默认模板 // 获取默认模板
getTemplateData() { getTemplateData() {
vm.GET('portalComponent/TempletConfigList').then((res) => { vm.GET('portal/portalComponent/TempletConfigList').then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.templateDataList = res.data.templetConfigModelList vm.templateDataList = res.data.templetConfigModelList
}else {
vm.$message.info(res.message)
} }
}) })
}, },
// 通过编辑获取模块信息 // 通过编辑获取模块信息
getModuleData() { getModuleData() {
vm.GET('portalComponent/ModuleList',{componentId: vm.componentId}).then((res) => { vm.GET('portal/portalComponent/ModuleList',{componentId: vm.componentId}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.componentList.moduleModelList = res.data.moduleModelList vm.componentList.moduleModelList = res.data.moduleModelList
}else {
vm.$message.info(res.message)
} }
}) })
}, },
// 模块是否对外开放 // 模块是否对外开放
selectIsOpen(index) { selectIsOpen(index) {
vm.moduleIndex = index
vm.componentList.moduleModelList[index].openFlag = vm.componentList.moduleModelList[index].openFlag == 1 ? 2 : 1
},
moduleOpenChange(value) {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(vm.moduleIndex == i) { if(index == i) {
if(value == '1') { if(vm.componentList.moduleModelList[i].name) {
vm.componentList.moduleModelList[i].openFlag = 2 vm.GET('portal/portalComponent/checkModuleName',{name: vm.componentList.moduleModelList[i].name,openFlag: vm.componentList.moduleModelList[i].openFlag}).then((res) => {
}else{ if(res.code == '000000') {
vm.componentList.moduleModelList[i].openFlag = 1 if(res.data > 0) {
vm.componentList.moduleModelList[i].name = ''
vm.$message.info("模块名称已存在,请修改名称后保存")
}
}
})
} }
break break
} }
...@@ -682,20 +745,24 @@ export default { ...@@ -682,20 +745,24 @@ export default {
removeTab(targetName) { removeTab(targetName) {
for(let i = 0;i<vm.componentList.moduleModelList.length;i++) { for(let i = 0;i<vm.componentList.moduleModelList.length;i++) {
if((targetName - 1) == i) { if((targetName - 1) == i) {
if(vm.componentList.moduleModelList[i].id) { if(isNotEmptyUtils(vm.componentList.moduleModelList[i].templetModelList)) { // 模板不为空
if(vm.componentList.moduleModelList[i].templetModelList) {
vm.$confirm('删除模块会将改模块下已有模板同时删除,确认需要删除吗?', '提示', { vm.$confirm('删除模块会将改模块下已有模板同时删除,确认需要删除吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
vm.GET('portalComponent/deletePortalModuleById',{id:vm.componentList.moduleModelList[i].id}).then((res) => { if(vm.componentList.moduleModelList[i].id != '' && vm.componentList.moduleModelList[i].moduleType == 1) {
vm.GET('portal/portalComponent/deletePortalModuleById',{id:vm.componentList.moduleModelList[i].id}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.$message.info('成功删除模块!') vm.$message.info('成功删除模块!')
} }
vm.getModuleData() vm.getModuleData()
vm.firstTab = i + '' vm.firstTab = i + ''
}) })
}else {
vm.componentList.moduleModelList.splice(i,1)
vm.firstTab = i + ''
}
}).catch(() => { }).catch(() => {
vm.$message({ vm.$message({
type: 'info', type: 'info',
...@@ -703,18 +770,19 @@ export default { ...@@ -703,18 +770,19 @@ export default {
}) })
}) })
}else { }else {
vm.GET('portalComponent/deletePortalModuleById',{id:vm.componentList.moduleModelList[i].id}).then((res) => { if(vm.componentList.moduleModelList[i].id) {
vm.GET('portal/portalComponent/deletePortalModuleById',{id:vm.componentList.moduleModelList[i].id}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.$message.info('成功删除模块!') vm.$message.info('成功删除模块!')
} }
vm.getModuleData() vm.getModuleData()
vm.firstTab = i + '' vm.firstTab = i + ''
}) })
}
}else { }else {
vm.componentList.moduleModelList.splice(i,1) vm.componentList.moduleModelList.splice(i,1)
vm.firstTab = i + '' vm.firstTab = i + ''
} }
}
break break
} }
} }
...@@ -755,7 +823,8 @@ export default { ...@@ -755,7 +823,8 @@ export default {
seqNo: '', seqNo: '',
content1: '', content1: '',
content2: '', content2: '',
content3: '' content3: '',
content4: ''
}] }]
}) })
}else if(item.partConfigModelList[i].type == 2) { // 课程 }else if(item.partConfigModelList[i].type == 2) { // 课程
...@@ -785,7 +854,7 @@ export default { ...@@ -785,7 +854,7 @@ export default {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index == i) { if(index == i) {
if(vm.componentList.moduleModelList[i].templetModelList[index1].id) { if(vm.componentList.moduleModelList[i].templetModelList[index1].id) {
vm.GET('portalComponent/deletePortalTemplateById',{id: vm.componentList.moduleModelList[i].templetModelList[index1].id}).then((res) => { vm.GET('portal/portalComponent/deletePortalTemplateById',{id: vm.componentList.moduleModelList[i].templetModelList[index1].id}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.$message.info('成功删除模板!') vm.$message.info('成功删除模板!')
vm.getModuleData() vm.getModuleData()
...@@ -831,7 +900,7 @@ export default { ...@@ -831,7 +900,7 @@ export default {
for(let q = 0; q < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;q++){ for(let q = 0; q < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;q++){
if(index2 == q) { if(index2 == q) {
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id) { if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id) {
vm.GET('portalComponent/deletePortalPartById',{id: vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id}).then((res) => { vm.GET('portal/portalComponent/deletePortalPartById',{id: vm.componentList.moduleModelList[i].templetModelList[j].partModelList[q].partContentModelList[index3].id}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.$message.info('成功删除模板元件内容!') vm.$message.info('成功删除模板元件内容!')
vm.getModuleData() vm.getModuleData()
...@@ -876,16 +945,35 @@ export default { ...@@ -876,16 +945,35 @@ export default {
} }
} }
}, },
// 模块名称失去焦点校验
moduleNameValidate(index) {
let moduleValue = vm.componentList.moduleModelList[index].name
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(index != i && vm.componentList.moduleModelList[i].name != '') {
if(moduleValue == vm.componentList.moduleModelList[i].name) {
vm.componentList.moduleModelList[index].name = ''
vm.$message.info('模块名称已存在,请修改名称后保存')
}
}
}
},
// 完成(暂存) // 完成(暂存)
finishConponent(flag) { finishConponent(flag) {
let req = null let req = null
if(vm.componentList.moduleModelList && vm.componentList.moduleModelList.length > 0) { if(flag == 2) {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(flag == 2) { // 完成
req = { req = {
id: vm.componentId, id: vm.componentId,
status: 2 status: 2
} }
}else {
req = {
id: vm.componentId,
status: 1
}
}
if(vm.componentList.moduleModelList && vm.componentList.moduleModelList.length > 0) {
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
if(flag == 2) { // 完成
if(!vm.componentList.moduleModelList[i].name) { if(!vm.componentList.moduleModelList[i].name) {
vm.$message.info("请输入模块名称") vm.$message.info("请输入模块名称")
return return
...@@ -894,38 +982,76 @@ export default { ...@@ -894,38 +982,76 @@ export default {
vm.$message.info("模块内容不能为空") vm.$message.info("模块内容不能为空")
return return
} }
for(let j = 0; j < vm.componentList.moduleModelList[i].templetModelList.length; j++) { for(let j = 0; j < vm.componentList.moduleModelList[i].templetModelList.length; j++) {
for(let k = 0; k < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length; k++) { for(let k = 0; k < vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length; k++) {
if(!vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content1) { // 考试
vm.$message.info( vm.componentList.moduleModelList[i].templetModelList[j].name + "中名称为空,请添加内容后保存") if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].type == 1) {
if(!vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content1 || !vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content2) {
vm.$message.info( vm.componentList.moduleModelList[i].templetModelList[j].name + "中考试为空,请添加考试保存")
return
}
} else {
if(!vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content1 || !vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content2) {
vm.$message.info( vm.componentList.moduleModelList[i].templetModelList[j].name + "中课程为空,请添加课程保存")
return return
} }
} }
} }
}else{ // 暂存
req = {
id: vm.componentId,
status: 1
} }
} }
vm.componentList.moduleModelList[i].componentId = vm.componentId vm.componentList.moduleModelList[i].componentId = vm.componentId
} }
vm.finishModule(req,flag) vm.finishModule(req,flag)
}else { }else {
vm.$message.info("请添加有效模块后再保存") if(flag == 2) {
vm.$message.info("模块内容不能为空")
return return
}else {
vm.finishModule(req,flag)
}
} }
}, },
finishModule(req, flag) { finishModule(req, flag) {
vm.POST('portalComponent/insertOrUpdatePortalModule',{model: vm.componentList.moduleModelList,status: flag}).then((res) => { if(isNotEmptyList(vm.componentList.moduleModelList)) {
for(let i=0;i<vm.componentList.moduleModelList.length;i++) {
if(isNotEmptyList(vm.componentList.moduleModelList[i].templetModelList)) {
for(let j = 0;j<vm.componentList.moduleModelList[i].templetModelList.length;j++) {
for(let k=0;k<vm.componentList.moduleModelList[i].templetModelList[j].partModelList.length;k++) {
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].type == 1) { // 考试
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content4) {
for(let q = 0; q < vm.certificateIdSelect.length;q++) {
if(vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content4 == vm.certificateIdSelect[q].id) {
vm.componentList.moduleModelList[i].templetModelList[j].partModelList[k].partContentModelList[0].content3 = vm.certificateIdSelect[q].name
}
}
}
}
}
}
}
}
}
vm.$nextTick(() => {
for(let i=0;i<vm.componentList.moduleModelList.length;i++) {
if(!vm.componentList.moduleModelList[i].name) {
return
}else {
vm.POST('portal/portalComponent/insertOrUpdatePortalModule',{model: vm.componentList.moduleModelList,status: flag}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.enableComponent(req, flag) vm.enableComponent(req, flag)
} }
}) })
}
}
})
}, },
// 启用 // 启用
enableComponent(req, flag) { enableComponent(req, flag) {
vm.GET('portalComponent/disableOrStart',req).then((res) => { vm.GET('portal/portalComponent/disableOrStart',req).then((res) => {
if(res.code == "000000") { if(res.code == "000000") {
if(flag == 2) { if(flag == 2) {
vm.$router.push({ path: 'item-component' }) vm.$router.push({ path: 'item-component' })
...@@ -943,7 +1069,7 @@ export default { ...@@ -943,7 +1069,7 @@ export default {
// 从资源包中添加模块 // 从资源包中添加模块
addFromModule() { addFromModule() {
vm.columnFormVisible = true vm.columnFormVisible = true
vm.GET('portalComponent/ModuleList',{openFlag: 2}).then((res) => { vm.GET('portal/portalComponent/ModuleList',{openFlag: 2}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.resourceArray = res.data.moduleModelList vm.resourceArray = res.data.moduleModelList
for(let i = 0; i < vm.componentList.moduleModelList.length; i++) { for(let i = 0; i < vm.componentList.moduleModelList.length; i++) {
...@@ -1027,6 +1153,37 @@ export default { ...@@ -1027,6 +1153,37 @@ export default {
top: 100%; top: 100%;
left: 0; left: 0;
} }
.basic-item-icon {
position: relative;
.require {
position: absolute;
left: 51px;
top: 4px;
color: #F56C6C;
}
.upload-message {
position: absolute;
left: 128px;
top: 105px;
font-size: 12px;
color: #F56C6C;
}
.img-delete {
position: absolute;
left: 0px;
top: 0px;
width: 84px;
height: 100px;
background: #000;
opacity: 0.7;
z-index: 999;
i {
color: #fff;
margin-top: 39px;
margin-left: 0px;
}
}
}
} }
.step-content { .step-content {
overflow: hidden; overflow: hidden;
...@@ -1068,12 +1225,11 @@ export default { ...@@ -1068,12 +1225,11 @@ export default {
font-size: 12px; font-size: 12px;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 50%; border-radius: 50%;
width: 22px; width: 34px;
height: 16px; height: 18px;
line-height: 13px;
padding-left: 3px;
margin-top: 3px; margin-top: 3px;
margin-right: 10px; margin-right: 10px;
text-align: center;
} }
} }
.btn-container { .btn-container {
......
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
:curmbFirst="curmbFirst" :curmbFirst="curmbFirst"
:curmbSecond="curmbSecond"> :curmbSecond="curmbSecond">
</bread-crumb> </bread-crumb>
<div class="component-content screenSet"> <div class="component-content screenSet" id="screenSet">
<div class="search-title">查询条件</div> <div class="search-title">查询条件</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;"> <el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form ref="serchForm" :model="searchParam" label-width="75px" style="width:100%;"> <el-form ref="serchForm" :model="searchParam" label-width="75px" style="width:100%;">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="组件名称:"> <el-form-item label="组件名称:">
<el-input v-model="searchParam.name" size="mini" placeholder="请输入组件名称"></el-input> <el-input v-model="searchParam.name" size="small" placeholder="请输入组件名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="6">
<el-form-item label="发布状态:"> <el-form-item label="发布状态:">
<el-select v-model="searchParam.status" size="mini" placeholder="请选择发布状态"> <el-select v-model="searchParam.status" size="small" style="width: 100%;" placeholder="请选择发布状态">
<el-option <el-option
v-for="(item,index) in statuSelect" v-for="(item,index) in statuSelect"
:key="index" :key="index"
...@@ -25,16 +25,18 @@ ...@@ -25,16 +25,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="13" style="padding:0;text-align:right;padding-right:15px;"> <el-col :span="12" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search(1)">查询</el-button>
<el-button type="default" size="small" @click="reseat" style="margin-left:0;">重置</el-button> <el-button type="default" size="small" @click="reseat" style="margin-left:0;">重置</el-button>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<el-row :gutter="10" class="row create-button" style="margin-right:0;"> <el-row :gutter="10" class="row create-button" style="margin-right:0;">
<el-button type="primary" size="small" @click="createComponent">新建项目组件</el-button> <el-button type="primary" size="small" :disabled="idType == 2 && masterAdministratorFlag == 'false'" @click="createComponent">新建项目组件</el-button>
</el-row> </el-row>
<el-table :data="tableData" style="width: 100%"> <el-table
:data="tableData"
style="width: 100%">
<el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column> <el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="name" label="组件名称" min-width="200" align="center"></el-table-column> <el-table-column prop="name" label="组件名称" min-width="200" align="center"></el-table-column>
<el-table-column prop="createdName" label="发起人" min-width="100" align="center"></el-table-column> <el-table-column prop="createdName" label="发起人" min-width="100" align="center"></el-table-column>
...@@ -46,11 +48,17 @@ ...@@ -46,11 +48,17 @@
<el-table-column label="操作" fixed="right" align="center" min-width="200"> <el-table-column label="操作" fixed="right" align="center" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="small" @click="editComponentList(scope.row)">编辑</el-button> <el-button type="primary" size="small" @click="editComponentList(scope.row)">编辑</el-button>
<el-button type="primary" v-if="scope.row.status == 1 || scope.row.status == 2 || scope.row.status == 4" size="small" @click="enableAndDisable(scope.row,1)">启用</el-button> <el-button type="primary" v-if="scope.row.status == 2 || scope.row.status == 4" size="small" @click="enableAndDisable(scope.row,1)">启用</el-button>
<el-button type="primary" v-if="scope.row.status == 3" size="small" @click="enableAndDisable(scope.row,2)">禁用</el-button> <el-button type="primary" v-if="scope.row.status == 3" size="small" @click="enableAndDisable(scope.row,2)">禁用</el-button>
<el-button type="primary" v-if="scope.row.status == 1 || scope.row.status == 2" size="small" @click="deleteComponent(scope.row)">删除</el-button> <el-button type="primary" v-if="scope.row.status == 1 || scope.row.status == 2" size="small" @click="deleteComponent(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png" />
<p>没有查询到相关结果</p>
</div>
</div>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<div class="pagination"> <div class="pagination">
...@@ -70,10 +78,11 @@ ...@@ -70,10 +78,11 @@
</template> </template>
<script> <script>
import BreadCrumb from '../../components/breadcrumb.vue' import BreadCrumb from '../../components/breadcrumb.vue'
import { doUpload, getFilePath } from "../../utils/qiniuUtil" import { doUpload, getFilePath } from "../../utils/qiniu-util"
import { validateWord } from "../../utils/validate.js" import { validateWord } from "../../utils/validate.js"
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { openLoading, closeLoading } from '../../utils/utils'; import { openLoading, closeLoading } from '../../utils/utils'
import * as commonUtil from '../../utils/utils'
let vm = null let vm = null
export default { export default {
components: { components: {
...@@ -83,7 +92,10 @@ export default { ...@@ -83,7 +92,10 @@ export default {
return { return {
curmbFirst: '教培项目', curmbFirst: '教培项目',
curmbSecond: '项目组件', curmbSecond: '项目组件',
idType:'',
masterAdministratorFlag: false,
searchParam: { searchParam: {
idType: '',
name: '', name: '',
status: '', status: '',
pageNo: 1, pageNo: 1,
...@@ -124,28 +136,41 @@ export default { ...@@ -124,28 +136,41 @@ export default {
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'_token' '_token',
// 'idType',
// 'masterAdministratorFlag'
]) ])
}, },
created() { created() {
vm = this vm = this
vm.search() vm.search()
vm.idType = localStorage.getItem('storageIdType')
vm.masterAdministratorFlag = localStorage.getItem('storageMaster')
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight()
}, },
methods: { methods: {
// 列表查询 // 列表查询
search() { search(flag) {
if(flag) vm.searchParam.pageNo = 1
vm.searchParam.idType = vm.idType
openLoading(vm) openLoading(vm)
vm.GET('portalComponent/queryPortalComponent',vm.searchParam).then((res) => { vm.GET('portal/portalComponent/queryPortalComponent',vm.searchParam).then((res) => {
closeLoading(vm) closeLoading(vm)
if( res.code == '000000' ) { if( res.code == '000000' ) {
vm.tableData = res.data.queryList vm.tableData = res.data.queryList
vm.totalRows = res.data.total vm.totalRows = res.data.total
}else {
vm.$message.info(res.message)
} }
}) })
}, },
// 重置 // 重置
reseat() { reseat() {
vm.searchParam = Object.assign({},{ vm.searchParam = Object.assign({},{
idType: '',
name: '', name: '',
status: '', status: '',
pageNo: 1, pageNo: 1,
...@@ -163,9 +188,11 @@ export default { ...@@ -163,9 +188,11 @@ export default {
token: vm._token, token: vm._token,
componentId: row.id componentId: row.id
} }
vm.GET('portalComponent/componentEditRange',req).then((res) => { vm.GET('portal/portalComponent/componentEditRange',req).then((res) => {
if(res.code == "000000") { if(res.code == "000000") {
vm.$router.push({path: 'create-component',query: {id:row.id,status: row.status,resultFlag: res.data.resultFlag}}) vm.$router.push({path: 'create-component',query: {id:row.id,status: row.status,resultFlag: res.data.resultFlag}})
}else {
vm.$message.info(res.message)
} }
}) })
}, },
...@@ -191,18 +218,21 @@ export default { ...@@ -191,18 +218,21 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
vm.GET('portalComponent/disableOrStart',req).then((res) => { vm.GET('portal/portalComponent/disableOrStart',req).then((res) => {
if(res.code == "000000") { if(res.code == "000000") {
vm.$message({ vm.$message({
type: 'success', type: 'success',
message: '操作成功!' message: '操作成功!'
}); });
vm.search() vm.search()
} else { if(res.message != 'success') {
vm.$message({ vm.$message({
message: res.message, message: res.message,
type: 'warning' type: 'warning'
}); })
}
}else {
vm.$message.info(res.message)
} }
}).catch(function (error) { }).catch(function (error) {
vm.$message.error(error); vm.$message.error(error);
...@@ -221,13 +251,15 @@ export default { ...@@ -221,13 +251,15 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
vm.GET('portalComponent/deleteComponentById',{id: row.id}).then((res) => { vm.GET('portal/portalComponent/deleteComponentById',{id: row.id}).then((res) => {
if(res.code == "000000") { if(res.code == "000000") {
vm.$message({ vm.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
}); });
vm.search() vm.search()
} else {
vm.$message.info(res.message)
} }
}).catch(function (error) { }).catch(function (error) {
vm.$message.error(error); vm.$message.error(error);
...@@ -267,6 +299,14 @@ export default { ...@@ -267,6 +299,14 @@ export default {
margin-top: 0 !important; margin-top: 0 !important;
text-align: right; text-align: right;
} }
.table-empty {
img{
width: 100px;
}
p {
margin-top: -50px;
}
}
} }
} }
</style> </style>
......
<template> <template>
<div class="item-manager-wrap"> <div class="item-manager-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb> <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet"> <div class="component-content screenSet" id="screenSet">
<div class="header-title">项目管理</div> <div class="header-title">项目管理</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;"> <el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;"> <el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-col :span="5"> <el-col :span="5">
<el-form-item label="项目名称:"> <el-form-item label="项目名称:">
<el-input v-model="formInline.projectName" size="mini" placeholder="请输入项目名称"></el-input> <el-input v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8"> <!-- <el-col :span="8">
<el-form-item label="项目时间:"> <el-form-item label="项目时间:">
<el-date-picker <el-date-picker
v-model="formInline.duringTime" v-model="formInline.duringTime"
size="mini" size="small"
type="daterange" type="daterange"
start-placeholder="请选择开始时间" start-placeholder="请选择开始时间"
end-placeholder="请选择结束时间" end-placeholder="请选择结束时间"
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
<el-form-item label="项目时间:"> <el-form-item label="项目时间:">
<el-date-picker <el-date-picker
v-model="formInline.projectBegintime" v-model="formInline.projectBegintime"
size="mini" size="small"
type="date" type="datetime"
placeholder="请选择开始时间" placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0" :picker-options="pickerOptions0"
...@@ -38,16 +38,17 @@ ...@@ -38,16 +38,17 @@
<el-form-item label="~"> <el-form-item label="~">
<el-date-picker <el-date-picker
v-model="formInline.projectEndtime" v-model="formInline.projectEndtime"
size="mini" size="small"
type="date" type="datetime"
placeholder="请选择结束时间" placeholder="请选择结束时间"
value-format="yyyy-MM-dd 23:59:59" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1" :picker-options="pickerOptions1"
default-time="23:59:59"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="9" style="padding:0;text-align:right;padding-right:15px;"> <el-col :span="8" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="getProjectList">查询</el-button> <el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button> <el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
</el-col> </el-col>
</el-form> </el-form>
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,7 @@
<el-col :span="5"> <el-col :span="5">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;"> <el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-form-item label="发布状态:"> <el-form-item label="发布状态:">
<el-select size="mini" v-model="formInline.projectStatus" placeholder="请选择发布状态"> <el-select size="small" v-model="formInline.projectStatus" placeholder="请选择发布状态">
<el-option <el-option
v-for="item in optionStatus" v-for="item in optionStatus"
:key="item.value" :key="item.value"
...@@ -70,19 +71,25 @@ ...@@ -70,19 +71,25 @@
</el-row> </el-row>
<el-form :model="formInline" class="demo-form-inline"> <el-form :model="formInline" class="demo-form-inline">
<el-form-item> <el-form-item>
<el-button class="add-button" size="small" type="primary" @click="toPage()">新建项目</el-button> <el-button class="add-button" :disabled="idType == 2 && masterAdministratorFlag == 'false'" size="small" type="primary" @click="toPage()">新建项目</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column> <el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="创建人" align="center"></el-table-column> <el-table-column prop="createdName" label="创建人" align="center"></el-table-column>
<el-table-column prop="projectIntro" label="项目简介" align="center"></el-table-column> <el-table-column
<el-table-column prop="projectBegintime" label="项目开始时间" align="center"></el-table-column> prop="projectIntro"
<el-table-column prop="projectEndtime" label="项目结束时间" align="center"></el-table-column> label="项目简介"
align="center"
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectStatus" label="状态" align="center"> <el-table-column prop="projectStatus" label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.projectStatus | statusProject }}</span> <span>{{ [scope.row.projectStatus , idType] | statusProject }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" min-width="200" align="center"> <el-table-column fixed="right" label="操作" min-width="200" align="center">
...@@ -128,6 +135,7 @@ ...@@ -128,6 +135,7 @@
v-show="showButton(scope.row,7)" v-show="showButton(scope.row,7)"
type="primary" type="primary"
size="small" size="small"
:disabled="scope.row.checkStatus==1"
>提醒审核</el-button> >提醒审核</el-button>
<el-button <el-button
@click="changeStatus(scope.row,8)" @click="changeStatus(scope.row,8)"
...@@ -149,6 +157,12 @@ ...@@ -149,6 +157,12 @@
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有查询到相关结果</p>
</div>
</div>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
...@@ -168,8 +182,11 @@ ...@@ -168,8 +182,11 @@
<script> <script>
import BreadCrumb from "../../components/breadcrumb.vue"; import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain"; import { create } from "domain";
import { returnData } from "../mock"; import { mapGetters } from 'vuex'
import { returnData } from "../../utils/mock";
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import { setTimeout } from 'timers';
let vm = null; let vm = null;
export default { export default {
components: { components: {
...@@ -177,6 +194,7 @@ export default { ...@@ -177,6 +194,7 @@ export default {
}, },
data() { data() {
return { return {
idValue: '',
curmbFirst: "教培项目", curmbFirst: "教培项目",
curmbSecond: "项目管理", curmbSecond: "项目管理",
searchParam: { searchParam: {
...@@ -226,7 +244,7 @@ export default { ...@@ -226,7 +244,7 @@ export default {
}, },
pickerOptions0: { pickerOptions0: {
disabledDate: time => { disabledDate: time => {
if (this.formInline.projectEndtime != "") { if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) {
return ( return (
time.getTime() > time.getTime() >
new Date(this.formInline.projectEndtime).getTime() new Date(this.formInline.projectEndtime).getTime()
...@@ -241,26 +259,49 @@ export default { ...@@ -241,26 +259,49 @@ export default {
new Date(this.formInline.projectBegintime).getTime() new Date(this.formInline.projectBegintime).getTime()
); //减去一天的时间代表可以选择同一天; ); //减去一天的时间代表可以选择同一天;
} }
} },
idType: '',
masterAdministratorFlag: false
}; };
}, },
computed: {
...mapGetters([
"_token",
// "idType",
// "masterAdministratorFlag"
])
},
created() { created() {
vm = this; vm = this;
vm.idType = localStorage.getItem('storageIdType');
vm.masterAdministratorFlag = localStorage.getItem('storageMaster');
console.log('idType:',vm.idType);
this.$nextTick(function() {;
this.getProjectList(); this.getProjectList();
});
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
}, },
methods: { methods: {
toPage() { toPage() {
this.$router.push("add-manager"); this.$router.push("add-manager");
}, },
searchList() {
this.formInline.pageNo = 1;
this.getProjectList();
},
//查询项目列表 //查询项目列表
getProjectList() { getProjectList() {
let req = {}; let req = {};
req = this.formInline; req = this.formInline;
openLoading(vm); openLoading(vm);
vm.GET("portalInfo/getProjectList", req).then(res => { vm.GET("portal/portalInfo/getProjectList", req).then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
vm.tableData = res.data.data; vm.tableData = res.data.data;
//console.log(vm.tableData);
vm.totalRows = res.data.totalRows; vm.totalRows = res.data.totalRows;
} }
}); });
...@@ -269,13 +310,22 @@ export default { ...@@ -269,13 +310,22 @@ export default {
showButton(row, type) { showButton(row, type) {
// 按钮type类型: 0-编辑 // 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝 // 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(5)-取消审核 9-删除 // 7- 提醒审核 8(2)-取消审核 9-删除
let projectStatus = row.projectStatus; let projectStatus = row.projectStatus;
let idType = row.idType;
let level = row.level; let level = row.level;
let flag = false; let flag = false;
let typeStr = parseInt(type); let typeStr = parseInt(type);
//console.log("状态:"+projectStatus+ "等级:" + level + " 按钮类型:" + type); //console.log("状态:"+projectStatus+ "等级:" + level + " 按钮类型:" + type);
let buttonStatus = returnData().buttonStatus; //console.log('idType',idType);
let buttonStatus = "";
if (idType == 1) {
//内部项目
buttonStatus = returnData().buttonStatusIn;
} else {
//外部项目
buttonStatus = returnData().buttonStatusOut;
}
if (level != null) { if (level != null) {
let statusSet = buttonStatus[projectStatus - 1][level]; let statusSet = buttonStatus[projectStatus - 1][level];
let flagValue = statusSet.indexOf(typeStr); let flagValue = statusSet.indexOf(typeStr);
...@@ -291,24 +341,69 @@ export default { ...@@ -291,24 +341,69 @@ export default {
//改变状态 //改变状态
changeStatus(row, type) { changeStatus(row, type) {
let projectId = row.id; let projectId = row.id;
let level = row.level;
if (type === 0) { if (type === 0) {
//编辑 //编辑
this.$router.push("add-manager?projectId=" + projectId); this.$router.push("add-manager?projectId=" + projectId +"&level="+level);
} else if (type === 7) { } else if (type === 7) {
//提醒审核 //提醒审核
let req = {
portalProjectId: projectId,
warnType: 1
};
vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
vm.$message.info(res.message);
vm.getProjectList();
if (res.code == "000000") {
console.log(res);
//vm.getProjectList();
}
});
} else { } else {
if (type === 8) { if (type === 8) {
//取消审批值对应5 //取消审批值对应2
type = 5; type = 2;
let req = {
portalProjectId: projectId,
warnType: 5
};
vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
console.log(res);
vm.getProjectList();
}
});
}
if (type == 4 || type == 6) {
//发送消息
let warnType = "";
if (type == 4) {
warnType = 3;
} else if (type == 6) {
warnType = 4;
}
let req = {
portalProjectId: projectId,
warnType: warnType
};
vm.GET("portal/portalCheck/remindPortalCheck", req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") {
console.log(res);
vm.getProjectList();
}
});
} }
let req = { let req = {
projectId: projectId, projectId: projectId,
changeStatus: type changeStatus: type
}; };
let that = this; vm.POST("portal/portalInfo/changeStatus", req).then(res => {
vm.POST("portalInfo/changeStatus", req).then(res => { vm.$message.info(res.message);
if (res.code == "000000") { if (res.code == "000000") {
console.log(res); console.log(res);
vm.getProjectList();
} }
}); });
} }
...@@ -316,16 +411,11 @@ export default { ...@@ -316,16 +411,11 @@ export default {
//删除项目 //删除项目
delItem(row) { delItem(row) {
let req = {}; let req = {};
let that = this;
console.log(row); console.log(row);
vm.DELETE("portalInfo/delete/" + row.id, req).then(res => { vm.DELETE("portal/portalInfo/delete/" + row.id, req).then(res => {
vm.$message.info(res.message);
if (res.code == "000000") { if (res.code == "000000") {
console.log(res); console.log(res);
this.$notify({
title: "删除项目",
message: "ID为:" + row.id + "的项目删除成功"
});
this.loading = true;
vm.getProjectList(); vm.getProjectList();
} }
}); });
...@@ -393,6 +483,14 @@ export default { ...@@ -393,6 +483,14 @@ export default {
.add-button { .add-button {
float: right; float: right;
} }
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
} }
} }
</style> </style>
\ No newline at end of file
let data = {
"projectModel":
{
"projectBegintime": 1551948983468,
"projectEndtime": 1551948983468,
"projectIntro": "测试用例",
"projectName": "testProjectName"
},
"attachmentModel": [
{
"attachmentType": 1,
"attachmentUrl": "www.baidu.com",
"kind": 1, "seqNo": 1
},
{
"attachmentType": 2,
"attachmentUrl": "www.qq.com",
"kind": 2, "seqNo": 1
}
],
"attachmentPDFModel": [
{
"attachmentType": 3,
"attachmentUrl": "www.pdf.com",
"kind": 3
}
]
};
let req = {
projectModel:
'{"id":6,"projectBegintime":1551853576789,"projectEndtime":1551853576789,"projectIntro":"测试用例","projectName":"testProjectName"}',
attachmentModel:
'[{"attachmentType":1,"attachmentUrl":"www.baidu.com","kind":1,"portalProjectId":6,"seqNo":1},{"attachmentType":2,"attachmentUrl":"www.qq.com","kind":2,"portalProjectId":6,"seqNo":1}]',
attachmentPDFModel:
'[{"attachmentType":3,"attachmentUrl":"www.pdf.com","kind":3,"portalProjectId":6},{"attachmentType":3,"attachmentUrl":"www.pdf.com","kind":3,"portalProjectId":6}]'
};
/**
projectModel
ProjectBegintime ProjectEndtime 开始结束时间
projectIntro 项目简介 test
ProjectName 项目名称
attachmentModel 附件信息
attachmentType 1:项目列表 2:封面信息(图片和视频) 3:PDF
attachmenturl 链接
kind 1:图片 2:视频 3:PDF
attachmentName 附件名称
attachment_ext 附件格式
attachment_size 附件大小
*/
\ No newline at end of file
<template>
<div>
<el-tree
:data="data2"
show-checkbox
default-expand-all
node-key="id"
ref="tree"
highlight-current
:props="defaultProps"
@check="onChecked"
></el-tree>
<!-- <base1
:data="data2"
show-checkbox
default-expand-all
node-key="id"
ref="tree"
highlight-current
:props="defaultProps"
></base1>-->
<span></span>
<div class="buttons">
<el-button @click="getCheckedNodes">通过 node 获取</el-button>
<el-button @click="getCheckedKeys">通过 key 获取</el-button>
<el-button @click="setCheckedNodes">通过 node 设置</el-button>
<el-button @click="setCheckedKeys">通过 key 设置</el-button>
<el-button @click="resetChecked">清空</el-button>
</div>
</div>
</template>
<script>
import { ELTree1 } from "element-ui/lib/checkbox";
// import Vue from 'vue'
// require("element-ui/lib/checkbox"
export default {
// components: {
// base1
// },
mounted() {
// const base1 = Vue.extend(ELTree)
// Vue.component('base1', base1)
},
data() {
return {
data2: [
{
id: 11,
label: "一级 1",
children: [
{
id: 1,
label: "一级 1",
children: [
{
id: 4,
label: "二级 1-1",
children: [
{
id: 9,
label: "三级 1-1-1"
},
{
id: 10,
label: "三级 1-1-2"
}
]
}
]
},
{
id: 2,
label: "一级 2",
children: [
{
id: 5,
label: "二级 2-1"
},
{
id: 6,
label: "二级 2-2"
}
]
},
{
id: 3,
label: "一级 3",
children: [
{
id: 7,
label: "二级 3-1"
},
{
id: 8,
label: "二级 3-2"
}
]
}
]
}
],
defaultProps: {
children: "children",
label: "label"
}
};
},
methods: {
getCheckedNodes() {
console.log(this.$refs.tree.getCheckedNodes());
},
getCheckedKeys() {
console.log(this.$refs.tree.getCheckedKeys());
},
setCheckedNodes() {
this.$refs.tree.setCheckedNodes([
{
id: 5,
label: "二级 2-1"
},
{
id: 9,
label: "三级 1-1-1"
}
]);
},
setCheckedKeys() {
this.$refs.tree.setCheckedKeys([3]);
},
resetChecked() {
this.$refs.tree.setCheckedKeys([]);
},
onChecked() {
let cData = [],
oldData = (this.data2.length && this.data2.slice()) || [],
checkedKeys = this.$refs.tree.getCheckedKeys(),
halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys(),
savedCheckedKeys = this.handlerCheckedData(oldData, checkedKeys).map(
key => {
return { type: 2, key: key };
}
),
savedHalfCheckedKeys = halfCheckedKeys.map(key => {
return { type: 1, key: key };
}),
allSelectedKeys = savedCheckedKeys.concat(savedHalfCheckedKeys);
console.log("treeData", this.data2);
console.log(allSelectedKeys);
},
// 递归删除列表中所有子节点
delSubKeysByNode(node, checkedKeys) {
let idIndex;
if (node.children && node.children.length) {
if (node.children && node.children.length) {
node.children.forEach(elm => {
idIndex = checkedKeys.findIndex(id => {
return id === elm.id;
});
if (idIndex > -1) {
checkedKeys.splice(idIndex, 1);
}
if (elm.children && elm.children.length) {
this.delSubKeysByNode(elm, checkedKeys);
}
});
}
}
},
// 去除子节点
handlerCheckedData(oldData, checkedKeys) {
oldData.forEach(element => {
for (let i = 0; i < checkedKeys.length; i++) {
// 如果此节点被选中,则删除所有子节点
if (element.id === checkedKeys[i]) {
this.delSubKeysByNode(element, checkedKeys);
} else {
if (element.children && element.children.length) {
this.handlerCheckedData(element.children, checkedKeys);
}
}
}
});
return checkedKeys;
}
}
};
</script>
\ No newline at end of file
...@@ -51,14 +51,12 @@ ...@@ -51,14 +51,12 @@
</el-table> </el-table>
</div> </div>
</el-col> </el-col>
<el-col class="message screenSet" :span="24"> <el-col class="message screenSet" :span="24" id="screenSet">
<div class="message-title">系统消息 <span>今日消息:{{count}}条</span></div> <div class="message-title">系统消息 <span>今日消息:{{count}}条</span></div>
<div class="message-info" v-if="messageList.length > 0"> <div class="message-info" v-if="messageList.length > 0">
<div class="message-item" v-for="(item,index) in messageList" :key="index"> <div class="message-item" v-for="(item,index) in messageList" :key="index">
<div class="text-top"> <div class="text-top">
<i class="el-icon-error" v-if="item.type == 2" style="color:#FA5555"></i> <img :src="item.url"/>
<i class="el-icon-success" v-if="item.type == 3" style="color:#67C23A"></i>
<i class="el-icon-warning" v-if="item.type == 1" style="color:#FAAD14"></i>
<span>{{item.menuName}}</span> <span>{{item.menuName}}</span>
<span>{{item.portalTime}}</span> <span>{{item.portalTime}}</span>
</div> </div>
...@@ -83,7 +81,7 @@ import { setTimeout, setInterval } from 'timers' ...@@ -83,7 +81,7 @@ import { setTimeout, setInterval } from 'timers'
import ChangeFollowupStatus from "./followup/record-manage/dialog/change-followup-status"; import ChangeFollowupStatus from "./followup/record-manage/dialog/change-followup-status";
import { mapGetters, mapState, mapActions } from 'vuex' import { mapGetters, mapState, mapActions } from 'vuex'
import * as commonUtil from '../utils/utils'
let vm = null let vm = null
export default { export default {
components: { components: {
...@@ -127,6 +125,10 @@ export default { ...@@ -127,6 +125,10 @@ export default {
todayOverview: state => state.todayOverview, todayOverview: state => state.todayOverview,
}) })
}, },
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight()
},
methods: { methods: {
...mapActions('workbench', ['getTodayPlansList', 'getTodayAppointsList', 'getTodayOverview']), ...mapActions('workbench', ['getTodayPlansList', 'getTodayAppointsList', 'getTodayOverview']),
// 查看更多 // 查看更多
...@@ -139,10 +141,12 @@ export default { ...@@ -139,10 +141,12 @@ export default {
}, },
// 获取系统消息数据 // 获取系统消息数据
getSystemData() { getSystemData() {
vm.GET('portalMessage/queryPortalMessageInfo',{token: vm._token, pageNo: 1, pageSize: 15}).then((res) => { vm.GET('portal/portalMessage/queryPortalMessageInfo',{token: vm._token, pageNo: 1, pageSize: 15}).then((res) => {
if( res.code == '000000') { if( res.code == '000000') {
vm.messageList = res.data.portalMessageModels vm.messageList = res.data.portalMessageModels
vm.count = res.data.count vm.count = res.data.count
} else {
vm.$message.info(res.message)
} }
}) })
}, },
...@@ -265,6 +269,11 @@ export default { ...@@ -265,6 +269,11 @@ export default {
padding: 10px 10px 15px; padding: 10px 10px 15px;
border-bottom: 1px solid #EBEEF5; border-bottom: 1px solid #EBEEF5;
.text-top { .text-top {
img {
float: left;
width: 16px;
margin-top: 3px;
}
span:nth-child(2) { span:nth-child(2) {
padding: 10px; padding: 10px;
} }
......
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
if(vm.idType == 1) { // 内部 if(vm.idType == 1) { // 内部
window.location.href = getInnerLoginUrl() window.location.href = getInnerLoginUrl()
} else { } else {
window.location.href = getLoginUrl() window.location.href = getLoginUrl('?from=work&type=logout')
} }
} }
if(command === 'forward') { if(command === 'forward') {
......
<template> <template>
<div class="slidebar-container"> <div id="slidebar-container" class="slidebar-container">
<el-menu :default-active="onRoutes" class="el-menu-vertical-demo" theme="dark" unique-opened router> <el-menu :default-active="onRoutes" class="el-menu-vertical-demo" theme="dark" unique-opened router>
<template v-for="(item,_index) in items"> <template v-for="(item,_index) in items">
<template v-if="item.subs"> <template v-if="item.subs">
...@@ -150,9 +150,9 @@ export default { ...@@ -150,9 +150,9 @@ export default {
color: #fff; color: #fff;
background: #06232C; background: #06232C;
} }
.el-menu-item:focus, .el-menu-item:hover { // .el-menu-item:focus, .el-menu-item:hover {
background: #06232C !important; // background: #06232C !important;
} // }
} }
} }
</style> </style>
......
<template> <template>
<div class="item-role-wrap"> <div class="item-role-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird"></bread-crumb> <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird"></bread-crumb>
<div class="component-content screenSet"> <div class="component-content screenSet" id="screenSet">
<div class="header-title">查询条件</div> <div class="header-title">查询条件</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;"> <el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form :model="formInline" ref="formInline" label-width="75px" class="form-inline"> <el-form :model="formInline" ref="formInline" label-width="75px" class="form-inline">
<el-col :span="5"> <el-col :span="5">
<el-form-item label="姓名:"> <el-form-item label="姓名:">
<el-input size="mini" v-model="formInline.name" placeholder="请输入名称"></el-input> <el-input size="small" v-model="formInline.userName" placeholder="请输入名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="角色:"> <el-form-item label="角色:">
<el-select size="mini" v-model="formInline.projeceRole" placeholder="请选择角色"> <el-select size="small" v-model="formInline.projeceRole" placeholder="请选择角色">
<el-option <el-option
v-for="(item, index) in roleList" v-for="(item, index) in roleList"
:key="index" :key="index"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="所属机构:"> <el-form-item label="所属机构:">
<el-select size="mini" v-model="formInline.organizationName" placeholder="请选择所属机构"> <el-select size="small" v-model="formInline.organizationName" placeholder="请选择所属机构">
<el-option <el-option
v-for="(item, index) in organizationList" v-for="(item, index) in organizationList"
:key="index" :key="index"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="所属科室:"> <el-form-item label="所属科室:">
<el-select size="mini" v-model="formInline.departmentsName" placeholder="请选择所属科室"> <el-select size="small" v-model="formInline.departmentsName" placeholder="请选择所属科室">
<el-option <el-option
v-for="(item, index) in departmentsList" v-for="(item, index) in departmentsList"
:key="index" :key="index"
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" style="padding:0;text-align:right;padding-right:10px;"> <el-col :span="4" style="padding:0;text-align:right;padding-right:10px;">
<el-button type="primary" size="small" @click="queryRoleList()">查询</el-button> <el-button type="primary" size="small" @click="searchList()">查询</el-button>
<el-button <el-button
type="default" type="default"
size="small" size="small"
...@@ -57,10 +57,7 @@ ...@@ -57,10 +57,7 @@
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<el-table <el-table :data="tableData" style="width: 100%">
:data="tableData"
style="width: 100%"
>
<el-table-column prop="userId" label="用户ID" align="center"></el-table-column> <el-table-column prop="userId" label="用户ID" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column> <el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="projeceRole" label="角色" align="center"> <el-table-column prop="projeceRole" label="角色" align="center">
...@@ -92,6 +89,12 @@ ...@@ -92,6 +89,12 @@
>降为普通用户</el-button> >降为普通用户</el-button>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有查询到相关结果</p>
</div>
</div>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
...@@ -106,11 +109,12 @@ ...@@ -106,11 +109,12 @@
></el-pagination> ></el-pagination>
</div> </div>
<el-dialog title :visible.sync="dialog.show" width="30%" center> <el-dialog title :visible.sync="dialog.show" width="30%" center>
<p class="dialog-p"> <p v-if="numL3 > 1" class="dialog-p">
确认将{{ dialog.role }} 确认将{{ dialog.role }}
<span class="user-name">"{{ dialog.name }}"</span> <span class="user-name">"{{ dialog.name }}"</span>
{{ dialog.option }}吗?" {{ dialog.option }}吗?"
</p> </p>
<p v-else >该用户为此机构仅有的次级负责人,确认需要降级吗?</p>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="default" size="small" @click="dialog.show = false">取消</el-button> <el-button type="default" size="small" @click="dialog.show = false">取消</el-button>
<el-button type="primary" size="small" @click="changeRole()">确定</el-button> <el-button type="primary" size="small" @click="changeRole()">确定</el-button>
...@@ -133,6 +137,7 @@ ...@@ -133,6 +137,7 @@
import BreadCrumb from "../../components/breadcrumb.vue"; import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain"; import { create } from "domain";
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from '../../utils/utils'
let vm = null; let vm = null;
export default { export default {
components: { components: {
...@@ -172,7 +177,7 @@ export default { ...@@ -172,7 +177,7 @@ export default {
value: "L1" value: "L1"
}, },
{ {
label: "项目管理员", label: "项目负责人",
value: "L2" value: "L2"
}, },
{ {
...@@ -185,6 +190,7 @@ export default { ...@@ -185,6 +190,7 @@ export default {
} }
], ],
numL2: 0, numL2: 0,
numL3: 0,
dialog: { dialog: {
show: false, show: false,
role: "项目负责人", role: "项目负责人",
...@@ -193,14 +199,23 @@ export default { ...@@ -193,14 +199,23 @@ export default {
full: false full: false
}, },
dialogFull: false, dialogFull: false,
scopeRow: {} scopeRow: {},
activeUser: '',
}; };
}, },
created() { created() {
vm = this; vm = this;
this.queryRoleList(); this.queryRoleList();
}, },
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: { methods: {
searchList() {
this.formInline.pageNo = 1;
this.queryRoleList();
},
//查询用户列表 //查询用户列表
queryRoleList() { queryRoleList() {
this.formInline.portalProjectId = vm.getUrlSearch( this.formInline.portalProjectId = vm.getUrlSearch(
...@@ -213,16 +228,18 @@ export default { ...@@ -213,16 +228,18 @@ export default {
let req = {}; let req = {};
req = this.formInline; req = this.formInline;
openLoading(vm); openLoading(vm);
vm.GET("portalProjectOrRole/queryRoleList", req).then(res => { vm.GET("portal/portalProjectOrRole/queryRoleList", req).then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
vm.tableData = res.data.projectRoleInfoModels; vm.tableData = res.data.projectRoleInfoModels;
vm.totalRows = res.data.total; vm.totalRows = res.data.total;
vm.activeUser = res.data.activeUser;
console.log('activeUser',vm.activeUser);
//this.roleList = setRoleList(res.data.roleList); //this.roleList = setRoleList(res.data.roleList);
this.organizationList = res.data.organizationList; this.organizationList = res.data.organizationList;
this.departmentsList = res.data.departmentsList; this.departmentsList = res.data.departmentsList;
this.numL2 = res.data.numL2; this.numL2 = res.data.numL2;
this.numL3 = res.data.numL3;
} }
}); });
}, },
...@@ -235,12 +252,16 @@ export default { ...@@ -235,12 +252,16 @@ export default {
numL2: this.numL2, numL2: this.numL2,
nowL: this.scopeRow.projeceRole nowL: this.scopeRow.projeceRole
}; };
vm.GET("portalProjectOrRole/roleLevelUpdate", req).then(res => { vm.GET("portal/portalProjectOrRole/roleLevelUpdate", req).then(res => {
this.dialog.show = false; this.dialog.show = false;
if (res.code == "000000") { if (res.code == "000000") {
console.log(res); console.log(res);
this.queryRoleList(); this.queryRoleList();
} }
vm.$message({
type: 'info',
message: res.message,
})
}); });
}, },
handleSizeChange(val) { handleSizeChange(val) {
...@@ -271,7 +292,8 @@ export default { ...@@ -271,7 +292,8 @@ export default {
//按钮展示情况 //按钮展示情况
showButton(row, projeceRole) { showButton(row, projeceRole) {
let flag = false; let flag = false;
//console.log("当前等级 " + row.projeceRole + " 改变成等级 " + projeceRole); if(vm.activeUser == "L1") {
//当前内部管理员
if (row.projeceRole == "L2") { if (row.projeceRole == "L2") {
if (projeceRole == "L0") { if (projeceRole == "L0") {
flag = true; flag = true;
...@@ -285,6 +307,25 @@ export default { ...@@ -285,6 +307,25 @@ export default {
flag = true; flag = true;
} }
} }
} else if (vm.activeUser == "L2") {
//当前项目负责人
if (row.projeceRole == "L3") {
if (projeceRole == "L2" || projeceRole == "L0") {
flag = true;
}
} else if (row.projeceRole == "L0") {
if (projeceRole == "L2" || projeceRole == "L3") {
flag = true;
}
}
} else if (vm.activeUser == "L3") {
//当前次级负责人
if (row.projeceRole == "L0") {
if (projeceRole == "L3") {
flag = true;
}
}
}
return flag; return flag;
}, },
//打开弹出框 //打开弹出框
...@@ -342,6 +383,14 @@ export default { ...@@ -342,6 +383,14 @@ export default {
color: #449284; color: #449284;
} }
} }
.table-empty {
img {
width: 100px;
}
p {
margin-top: -50px;
}
}
} }
} }
</style> </style>
\ No newline at end of file
<template> <template>
<div class="role-wrap"> <div class="role-wrap">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb> <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet"> <div class="component-content screenSet" id="screenSet">
<div class="header-title">查询条件</div> <div class="header-title">查询条件</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;"> <el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;"> <el-form ref="formInline" :model="formInline" label-width="75px" style="width:100%;">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="项目名称:"> <el-form-item label="项目名称:">
<el-input v-model="formInline.projectName" size="mini" placeholder="请输入项目名称"></el-input> <el-input v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="项目时间:"> <el-form-item label="项目时间:">
<el-date-picker <el-date-picker
v-model="formInline.projectBegintime" v-model="formInline.projectBegintime"
size="mini" size="small"
type="date" type="datetime"
placeholder="请选择开始时间" placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0" :picker-options="pickerOptions0"
...@@ -26,32 +26,31 @@ ...@@ -26,32 +26,31 @@
<el-form-item label="~"> <el-form-item label="~">
<el-date-picker <el-date-picker
v-model="formInline.projectEndtime" v-model="formInline.projectEndtime"
size="mini" size="small"
type="date" type="datetime"
placeholder="请选择结束时间" placeholder="请选择结束时间"
value-format="yyyy-MM-dd 23:59:59" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1" :picker-options="pickerOptions1"
default-time="23:59:59"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" style="padding:0;text-align:right;padding-right:15px;"> <el-col :span="8" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button> <el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<el-table <el-table :data="tableData" style="width: 100%">
:data="tableData" style="width: 100%"
>
<el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column> <el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="创建人" align="center"></el-table-column> <el-table-column prop="createdName" label="创建人" align="center"></el-table-column>
<el-table-column prop="projectIntro" label="项目简介" align="center"></el-table-column> <el-table-column prop="projectIntro" label="项目简介" align="center" min-width="100" show-overflow-tooltip></el-table-column>
<el-table-column prop="projectBegintime" label="项目开始时间" align="center"></el-table-column> <el-table-column prop="projectBegintime" label="项目开始时间" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" align="center"></el-table-column> <el-table-column prop="projectEndtime" label="项目结束时间" align="center"></el-table-column>
<el-table-column prop="projectStatus" label="状态" align="center"> <el-table-column prop="projectStatus" label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.projectStatus | statusProject }}</span> <span>{{ [scope.row.projectStatus , idType] | statusProject }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="200" align="center"> <el-table-column fixed="right" label="操作" width="200" align="center">
...@@ -59,6 +58,12 @@ ...@@ -59,6 +58,12 @@
<el-button type="primary" size="small" @click="toPage(scope.row)">查看项目人员</el-button> <el-button type="primary" size="small" @click="toPage(scope.row)">查看项目人员</el-button>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<p>没有查询到相关结果</p>
</div>
</div>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
...@@ -78,7 +83,9 @@ ...@@ -78,7 +83,9 @@
<script> <script>
import BreadCrumb from "../../components/breadcrumb.vue"; import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain"; import { create } from "domain";
import { mapGetters } from 'vuex'
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
let vm = null; let vm = null;
export default { export default {
components: { components: {
...@@ -100,12 +107,15 @@ export default { ...@@ -100,12 +107,15 @@ export default {
projectEndtime: "", projectEndtime: "",
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
type: 2, type: 2
}, },
pickerOptions0: { pickerOptions0: {
disabledDate: time => { disabledDate: time => {
if (this.formInline.projectEndtime != "") { if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) {
return time.getTime() > new Date(this.formInline.projectEndtime).getTime(); return (
time.getTime() >
new Date(this.formInline.projectEndtime).getTime()
);
} }
} }
}, },
...@@ -119,17 +129,30 @@ export default { ...@@ -119,17 +129,30 @@ export default {
} }
}; };
}, },
computed: {
...mapGetters(["_token"])
},
created() { created() {
vm = this; vm = this;
vm.idType = localStorage.getItem('storageIdType');
console.log('idType:',vm.idType);
this.search(); this.search();
}, },
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: { methods: {
searchList() {
this.formInline.pageNo = 1;
this.search();
},
search() { search() {
let req = {}; let req = {};
//console.log(this.formInline); //console.log(this.formInline);
req = this.formInline; req = this.formInline;
openLoading(vm); openLoading(vm);
vm.GET("portalInfo/getProjectList", req).then(res => { vm.GET("portal/portalInfo/getProjectList", req).then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
vm.tableData = res.data.data; vm.tableData = res.data.data;
...@@ -155,9 +178,13 @@ export default { ...@@ -155,9 +178,13 @@ export default {
this.$router.push("item-role?portalProjectId=" + row.id); this.$router.push("item-role?portalProjectId=" + row.id);
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.formInline.pageSize = val;
this.search();
console.log(`每页 ${val} 条`); console.log(`每页 ${val} 条`);
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.formInline.pageNo = val;
this.search();
console.log(`当前页: ${val}`); console.log(`当前页: ${val}`);
} }
} }
...@@ -180,13 +207,14 @@ export default { ...@@ -180,13 +207,14 @@ export default {
.add-button { .add-button {
float: right; float: right;
} }
// .el-table .cell { .table-empty {
// color: #929292; img {
// } width: 100px;
// .el-table th > .cell { }
// font-weight: bold; p {
// color: #000; margin-top: -50px;
// } }
}
} }
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册