e 3 years ago
commit 7a8bbb71e8
  1. 1
      src/components/Header.vue
  2. 79
      src/views/data/Framework.vue
  3. 16
      src/views/data/Product.vue
  4. 4
      src/views/user/User.vue

@ -28,7 +28,6 @@ export default {
methods: {
getUserInfo(){
this.$get(this.api.queryUserInfoDetails).then(res => {
console.log(res,'头像处理');
let userInfo = res.result.hrUserInfo
if(userInfo.userAvatars) this.$store.commit('userAvatar',{avatar: userInfo.userAvatars})
this.userName = userInfo.userName

@ -5,9 +5,9 @@
<div class="plus">
<i class="el-icon-circle-plus-outline" @click.stop="addType(0)"></i>
</div>
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" highlight-current @current-change="typeClick">
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<span :title="node.label">{{ node.label }}</span>
<span class="actions">
<i v-if="!data.isThird" class="el-icon-circle-plus-outline" @click.stop="addType(node)"></i>
<i class="el-icon-edit" @click.stop="editType(node)"></i>
@ -21,7 +21,7 @@
<el-card shadow="hover">
<el-form label-width="80px" class="flex-between mgb20">
<div class="flex-center">
<el-form-item label="创建日期" style="margin: 0 20px 0 0">
<el-form-item label="更新时间" style="margin: 0 20px 0 0">
<el-date-picker v-model="updateTime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initData"></el-date-picker>
</el-form-item>
<el-input placeholder="请输入数据表名称" v-model="keyword" prefix-icon="el-icon-search" clearable></el-input>
@ -41,7 +41,7 @@
{{scope.row.dataSize}}M
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column>
<el-table-column prop="createTime" label="更新时间" align="center"></el-table-column>
<el-table-column label="操作" width="220" align="center">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)">预览</el-button>
@ -60,11 +60,15 @@
<el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<div style="overflow:auto;height: 558px;width:330px;padding:15px;background:#fff">
<el-tree ref="typeTree" :data="importTypeList" node-key="id" accordion :default-expanded-keys="defaultTypeActive" :current-node-key="curId" show-checkbox :props="defaultProps" highlight-current @node-click="importTypeClick"></el-tree>
<el-tree ref="typeTree" :data="importTypeList" node-key="id" accordion :default-expanded-keys="defaultTypeActive" :default-checked-keys="defaultTypeChecked" :current-node-key="curId" show-checkbox :props="defaultProps" highlight-current @node-click="importTypeClick"></el-tree>
</div>
<el-main style="padding-top: 0;padding-bottom: 0;">
<el-card shadow="hover">
<el-table :data="fieldData" stripe header-align="center">
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>预览</span>
</div>
<el-table :data="fieldData" stripe header-align="center" v-if="fieldHead.length">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column v-for="(item,index) in fieldHead" :prop="item.field" :key="index" :label="item.comment" align="center"></el-table-column>
</el-table>
@ -112,6 +116,7 @@ export default {
updateTime: '',
importVisible: false,
defaultTypeActive: [],
defaultTypeChecked: [],
listData: [],
keyword: '',
page: 1,
@ -119,6 +124,7 @@ export default {
total: 0,
multipleSelection: [],
importTypeList: [],
importTypeIndex: 10000,
fieldData: [],
fieldHead: [],
tableName: '',
@ -126,7 +132,8 @@ export default {
categoryIndex: 0,
previewVisible: false,
previewHead: [],
previewData: []
previewData: [],
submited: false,
};
},
watch: {
@ -164,7 +171,9 @@ export default {
this.categoryId = res[0].id
this.defaultActive = [res[0].id]
}
this.$nextTick(() => {
this.$refs.type.setCurrentKey(res[0].children[0].id)
})
this.getData()
}).catch(res => {})
},
@ -285,34 +294,46 @@ export default {
}
},
getTable(n,i){
this.$post(`${this.api.originalListById}?categoryId=${n.id}&showName=&pageNum=1&pageSize=10000`).then(res => {
this.$post(`${this.api.originalListById}?categoryId=${n.realId}&showName=&pageNum=1&pageSize=10000`).then(res => {
res.list.map(n => {
n.label = n.showName
n.id = String(n.id)
if(this.defaultTypeChecked.includes(n.id)){
n.disabled = true
}
})
n.children = res.list
if(!i && !this.tableName){
this.defaultTypeActive = [res.list[0].id]
this.tableName = res.list[0].name
this.curId = res.list[0].id
}
// if(!i && !this.tableName){
// this.tableName = res.list[0].name
// this.curId = res.list[0].id
// }
}).catch(res => {})
},
batchImport(){
this.$post(this.api.originalList).then(res => {
res.map(n => {
n.id = String(n.id)
this.importTypeIndex++
n.realId = n.id
n.id = String(this.importTypeIndex + n.id)
n.label = n.categoryName
n.children.map(n => {
n.id = String(n.id)
n.realId = n.id
this.importTypeIndex++
n.id = String(this.importTypeIndex + n.id)
n.label = n.categoryName
n.children.map(n => {
n.id = String(n.id)
this.importTypeIndex++
n.realId = n.id
n.id = String(this.importTypeIndex + n.id)
n.label = n.categoryName
n.isThird = true
})
})
})
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=1&pageSize=10000&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res1 => {
this.defaultTypeChecked = res1.list.map(n => n.copyId)
res.map((n,i) => {
if(n.children.length){
n.children.map(n => {
@ -328,8 +349,12 @@ export default {
})
setTimeout(() => {
this.importTypeList = res
this.getFields()
// this.defaultTypeActive = [res[0].id]
// if(res[0].children.length) this.defaultTypeActive.push(res[0].children[0].id)
// this.getFields()
},500)
}).catch(res => {})
this.importVisible = true
}).catch(res => {})
},
@ -349,7 +374,6 @@ export default {
}
})
this.fieldData = data
console.log(data,'data');
}).catch(res => {})
this.importVisible = true
},
@ -361,19 +385,23 @@ export default {
}
},
closeImport(){
this.$refs.typeTree.setCheckedKeys([])
},
confirmImport(){
if(this.submited) return false
let list = this.$refs.typeTree.getCheckedNodes()
let names = []
let showNames = []
list.map(n => {
if(n.name){
if(n.name && !n.disabled){
names.push(n.name)
showNames.push(n.showName)
}
})
console.log(11,names,showNames)
if(!names.length) return this.$message.warning('请选择数据')
this.submited = true
let data = []
let categoryId = Number(this.categoryId)
names.map((n,i) => {
@ -385,9 +413,14 @@ export default {
})
this.$post(this.api.saveTable,data).then(res => {
this.$message.success('导入成功')
this.getType()
this.getData()
this.importVisible = false
}).catch(res => {})
setTimeout(() => {
this.submited = false
},1000)
}).catch(res => {
this.submited = false
})
},
}
};

@ -71,7 +71,7 @@
</el-row>
<el-dialog :title="isDetail ? '查看产品' : (id ? '编辑产品' : '新增产品')" :visible.sync="productVisible" width="30%" center @close="closeProduct" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="120px" :disabled="isDetail">
<el-form ref="form" label-width="98px" :disabled="isDetail">
<el-form-item label="数据产品名称">
<el-input v-model="productName" placeholder="请输入数据产品名称"></el-input>
</el-form-item>
@ -82,7 +82,11 @@
</el-form-item>
<el-form-item label="已选数据">
<el-button type="primary" size="small" @click="configData">配置数据权限</el-button>
<el-tree ref="type" :data="typeList" show-checkbox node-key="id" :default-expanded-keys="checkedIds" :default-checked-keys="checkedIds" :props="defaultProps"></el-tree>
<el-tree ref="type" :data="typeList" show-checkbox node-key="id" :default-expanded-keys="checkedIds" :default-checked-keys="checkedIds" :props="defaultProps">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :title="node.label">{{ node.label }}</span>
</span>
</el-tree>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
@ -94,7 +98,11 @@
<el-dialog title="数据配置" :visible.sync="configVisible" width="70%" center @close="closeConfig" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<el-aside width="300px">
<el-tree style="margin: 10px;" ref="typeConfig" :data="typeConfigList" show-checkbox node-key="id" accordion :default-expanded-keys="configIds" :default-checked-keys="configIds" :current-node-key="categoryId" :props="defaultProps" highlight-current @current-change="typeConfigClick"></el-tree>
<el-tree style="margin: 10px;" ref="typeConfig" :data="typeConfigList" show-checkbox node-key="id" accordion :default-expanded-keys="configIds" :default-checked-keys="configIds" :current-node-key="categoryId" :props="defaultProps" highlight-current @current-change="typeConfigClick">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :title="node.label">{{ node.label }}</span>
</span>
</el-tree>
</el-aside>
<el-main style="padding-top: 0;padding-bottom: 0;">
@ -166,7 +174,7 @@ export default {
}],
page: 1,
pageSize: 10,
totals: 1,
totals: 0,
productVisible: false,
id: '',
userId: '',

@ -104,7 +104,7 @@
</el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column label="操作" width="270" align="center">
<el-table-column label="操作" width="300" align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
@ -209,7 +209,7 @@ export default {
}
},
'form.date': function(val){
if(val.length){
if(val && val.length){
this.form.startTime = val[0]
this.form.endTime = val[1]
}else{

Loading…
Cancel
Save