52f17473 by 任超

style:工作台

1 parent 4e6b0ef1
...@@ -39,13 +39,13 @@ service.interceptors.response.use( ...@@ -39,13 +39,13 @@ service.interceptors.response.use(
39 * 如果请求不成功,就在拦截器这里统一处理(组件的代码就不用关注错误的情况了) 39 * 如果请求不成功,就在拦截器这里统一处理(组件的代码就不用关注错误的情况了)
40 */ 40 */
41 if (response.status == 200) { 41 if (response.status == 200) {
42 if (response.data.code == 500) { 42 // if (response.data.code == 500) {
43 Message({ 43 // Message({
44 message: response.data.message, 44 // message: response.data.message,
45 type: 'error', 45 // type: 'error',
46 duration: 5 * 1000 46 // duration: 5 * 1000
47 }) 47 // })
48 } 48 // }
49 return response.data; 49 return response.data;
50 } else { 50 } else {
51 handleErrorData(response.data); 51 handleErrorData(response.data);
......
1 <template> 1 <template>
2 <dialogBox title="配置常办项目" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="50%" 2 <dialogBox title="配置常办项目" @submitForm="submitForm" saveButton="保存" :isFullscreen="false" width="50%"
3 @closeDialog="closeDialog" v-model="value"> 3 @closeDialog="closeDialog" v-model="myValue">
4 <el-form ref="ruleForm" :model="ruleForm" label-width="100px"> 4 <el-tree :data="projectList" show-checkbox node-key="id" :default-checked-keys="defaultCheckeds" ref="tree"
5 <el-tree :data="projectList" show-checkbox node-key="id" ref="tree" default-expand-all :props="defaultProps" 5 default-expand-all :props="defaultProps" @check-change="handleClick"></el-tree>
6 @check-change="handleClick"></el-tree>
7 </el-form>
8 </dialogBox> 6 </dialogBox>
9 </template> 7 </template>
10 <script> 8 <script>
11 import { getMenuInfo } from "@/api/user.js"; 9 import { getMenuInfo } from "@/api/user.js";
12 import { saveFrequentProjectsList } from "@/api/home.js"; 10 import { saveFrequentProjectsList, getHomeFrequentProjects } from "@/api/home.js";
13 export default { 11 export default {
14 props: { 12 props: {
15 value: { type: Boolean, default: false }, 13 value: { type: Boolean, default: false },
...@@ -17,10 +15,9 @@ export default { ...@@ -17,10 +15,9 @@ export default {
17 }, 15 },
18 data () { 16 data () {
19 return { 17 return {
18 myValue: false,
19 defaultCheckeds: [],
20 projectList: [], 20 projectList: [],
21 ruleForm: {
22
23 },
24 checkedItem: [], 21 checkedItem: [],
25 defaultProps: { 22 defaultProps: {
26 children: "children", 23 children: "children",
...@@ -36,8 +33,15 @@ export default { ...@@ -36,8 +33,15 @@ export default {
36 uniqueValue: ''//最后拿到的唯一选择的moduldCode值,相当于id 33 uniqueValue: ''//最后拿到的唯一选择的moduldCode值,相当于id
37 } 34 }
38 }, 35 },
39 mounted () { 36 watch: {
37 value (val) {
38 this.myValue = val
39 if (val) {
40 this.queryClick() 40 this.queryClick()
41 }
42 }
43 },
44 mounted () {
41 this.dealCheckedItem(); 45 this.dealCheckedItem();
42 }, 46 },
43 methods: { 47 methods: {
...@@ -58,9 +62,19 @@ export default { ...@@ -58,9 +62,19 @@ export default {
58 }) 62 })
59 }, 63 },
60 queryClick () { 64 queryClick () {
65 let that = this
61 getMenuInfo().then(res => { 66 getMenuInfo().then(res => {
62 this.projectList = res.result 67 this.projectList = res.result.slice(0, -2)
63 }) 68 })
69 function lookForAllId (arr = []) {
70 for (let item of that.bindItem) {
71 arr.push(item.id)
72 if (item.children && item.children.length) lookForAllId(item.children, arr)
73 }
74 return arr
75 }
76 that.defaultCheckeds = lookForAllId()
77 console.log(that.defaultCheckeds);
64 }, 78 },
65 dealCheckedItem () { 79 dealCheckedItem () {
66 }, 80 },
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <el-button type="primary" @click="setFrequencyProject()">配置常办</el-button> 9 <el-button type="primary" @click="setFrequencyProject()">配置常办</el-button>
10 </div> 10 </div>
11 <ul class="workbench flexst"> 11 <ul class="workbench flexst">
12 <li v-for="(item, index) in projectList" class="pointer" :key="index" 12 <li v-for="(item, index) in projectList" @click="handleProject(item)" class="pointer" :key="index"
13 :style="{ backgroundColor: newsListColor[index] }"> 13 :style="{ backgroundColor: newsListColor[index] }">
14 <i class="el-icon-s-claim"></i> 14 <i class="el-icon-s-claim"></i>
15 {{ item.name }} 15 {{ item.name }}
...@@ -188,6 +188,10 @@ export default { ...@@ -188,6 +188,10 @@ export default {
188 this.queryProjectList();//获取常办项目列表 188 this.queryProjectList();//获取常办项目列表
189 }, 189 },
190 methods: { 190 methods: {
191 handleProject (item) {
192 let url = item.uri.split('/').slice(0, 3).join('/')
193 this.$router.push(url)
194 },
191 handleView (pdfUrl) { 195 handleView (pdfUrl) {
192 const href = pdfUrl 196 const href = pdfUrl
193 window.open(href, '_blank'); 197 window.open(href, '_blank');
......