52f17473 by 任超

style:工作台

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