提交 3dc00cb6 编写于 作者: chendeli's avatar chendeli

add

上级 31f2a170
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<meta name="full-screen" content="yes"> <meta name="full-screen" content="yes">
<meta name="x5-fullscreen" content="true"> <meta name="x5-fullscreen" content="true">
<title>云鹊医工作站</title> <title>云鹊医</title>
</head> </head>
<body id="appBody"> <body id="appBody">
<div id="app"> <div id="app">
......
...@@ -2800,7 +2800,8 @@ ...@@ -2800,7 +2800,8 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
...@@ -3215,7 +3216,8 @@ ...@@ -3215,7 +3216,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -3271,6 +3273,7 @@ ...@@ -3271,6 +3273,7 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
...@@ -3314,12 +3317,14 @@ ...@@ -3314,12 +3317,14 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
} }
} }
}, },
......
...@@ -2,12 +2,7 @@ import App from '../App' ...@@ -2,12 +2,7 @@ import App from '../App'
const home = r => require.ensure([], () => r(require('../views/home')), 'home') const home = r => require.ensure([], () => r(require('../views/home')), 'home')
const blank = r => require.ensure([], () => r(require('../views/blank')), 'blank') const blank = r => require.ensure([], () => r(require('../views/blank')), 'blank')
const itemManager = r => require.ensure([], () => r(require('../views/education/item-manager.vue')), 'item-manager')
const itemComponent = r => require.ensure([], () => r(require('../views/education/item-component.vue')), 'item-component')
const createComponent = r => require.ensure([], () => r(require('../views/education/create-component.vue')),'create-component')
const roleManager = r => require.ensure([], () => r(require('../views/system/role.vue')),'role')
const addManager = r => require.ensure([], () => r(require('../views/education/add-manager.vue')), 'add-manager')
const itemRole = r => require.ensure([], () => r(require('../views/system/item-role.vue')), 'item-role')
const discuss = r => require.ensure([], () => r(require('../views/discuss/index.vue')), 'index') const discuss = r => require.ensure([], () => r(require('../views/discuss/index.vue')), 'index')
const creatDiscuss = r => require.ensure([], () => r(require('../views/discuss/add-edit.vue')), 'creatDiscuss') const creatDiscuss = r => require.ensure([], () => r(require('../views/discuss/add-edit.vue')), 'creatDiscuss')
...@@ -25,27 +20,6 @@ export default [{ ...@@ -25,27 +20,6 @@ export default [{
},{ },{
path: '/home', path: '/home',
component: home component: home
},{
path: '/blank',
component: blank
},{
path: '/item-manager',
component: itemManager
},{
path: '/add-manager',
component: addManager
},{
path: '/item-component',
component: itemComponent
},{
path: '/role',
component: roleManager
},{
path: '/create-component',
component: createComponent
},{
path: '/item-role',
component: itemRole
}, },
{ {
......
...@@ -18,7 +18,7 @@ export const envConfig = { ...@@ -18,7 +18,7 @@ export const envConfig = {
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html' yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html'
}, },
dev: { dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/', 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",
...@@ -27,7 +27,7 @@ export const envConfig = { ...@@ -27,7 +27,7 @@ export const envConfig = {
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html' yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html'
}, },
test: { test: {
baseUrl: 'https://test1-sc.yunqueyi.com/', 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",
...@@ -36,7 +36,7 @@ export const envConfig = { ...@@ -36,7 +36,7 @@ export const envConfig = {
yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html' yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html'
}, },
uat: { uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/', 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://videos.yunqueyi.com", // 视频
qiniuImgUrl: "https://file.yunqueyi.com", qiniuImgUrl: "https://file.yunqueyi.com",
...@@ -45,7 +45,7 @@ export const envConfig = { ...@@ -45,7 +45,7 @@ export const envConfig = {
yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html' yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html'
}, },
pro: { pro: {
baseUrl: 'https://sc.yunqueyi.com/', 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://videos.yunqueyi.com",
qiniuImgUrl: "https://file.yunqueyi.com", qiniuImgUrl: "https://file.yunqueyi.com",
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
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
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册