123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428 |
- <template>
- <div style="height: 100%" class="flexStar">
- <div class="boxswai" style="width: 15%;">
- <div class="boxnei" style="display: flex; flex-direction: column">
- <el-menu :default-active="activeIndex" class="el-menu-vertical-demo" @select="selectMajorDataType">
- <el-menu-item :index="item.dictKey" v-for="(item, index) in majorDataTypeList">
- <i class="el-icon-s-opportunity"></i>
- <span>{{ item.dictValue }}</span>
- </el-menu-item>
- </el-menu>
- </div>
- </div>
- <div class="boxswai" style="width: 30%; padding-left: 0px">
- <div class="boxnei" style="display: flex; flex-direction: column">
- <h3>引用元素表</h3>
- <div style="overflow: auto; flex: 1;height:500px">
- <div class="flex">
- <el-input placeholder="请输入表单名称" clearable @clear="clearfiltertext"
- v-model="filterText">
- </el-input>
- <el-button class="mg-l-10" @click="treeFilter">搜索</el-button>
- </div>
- <el-tree style="display: inline-block;min-width: 100%;" class="filter-tree" :data="treeData" v-loading="treeloading"
- :default-expanded-keys="defaultExpanded" @node-click="getNodeDetail" :props="defaultProps"
- :expand-on-click-node="false" highlight-current node-key="id" ref="tree" lazy :load="treeLoadNode"
- v-show="!allTreeShow">
- </el-tree>
- <el-tree style="width: 100%" ref="treeall" v-loading="treeloading" :data="allTreeData"
- :props="defaultProps" @node-click="getNodeDetail" node-key="id" :expand-on-click-node="false"
- :filter-node-method="filterNode" v-show="allTreeShow">
- </el-tree>
- </div>
- </div>
- </div>
- <div class="boxswai" style="width: 55%; padding-left: 0px; padding-right: 0px">
- <div class="boxnei">
- <div class="marleft10" style="height: 100%; display: flex; flex-direction: column">
- <div class="martop20" v-if="true" style="flex: 1">
- <div class="flex mg-b-10">
- <el-input
- v-model="formulaInput"
- placeholder="请输入元素名称"
-
- clearable
- @clear="searchFormulaName">
- </el-input>
- <el-button type="primary" class="mg-l-10" @click="searchFormulaName">搜索</el-button>
- </div>
-
- <el-table
- :data="editEleListFilter"
- border
- style="width: 100%"
- >
- <el-table-column align="center" prop="eName" label="字段信息">
- </el-table-column>
- <el-table-column align="center" label="操作" width="200">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.isBussTime!==2"
- type="primary"
- size="small"
- plain
- @click="setFiledate(scope.row)"
- >设置为文件日期
- </el-button>
- <el-button
- v-else
- type="danger"
- size="small"
- plain
- @click="quitFiledate(scope.row)"
- >取消
- </el-button>
- </template>
- </el-table-column>
- </el-table>
-
-
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- import { dictionary } from "@/api/manager/archivetree";
- import {tabTypeLazyTree,saveTabusstime,removeTabusstime} from "@/api/manager/wbsprivate";
- import {getTableElments} from "@/api/manager/wbstree";
- export default {
- data() {
- return {
- majorDataTypeList: [], //内业资料类型
- activeIndex:'1',
- projectid: '',
- wbsid: '',
- treeData: [],
- allTreeData:[],
- filterText: '',
- defaultExpanded: '',
- allTreeShow: false,
- defaultProps: {
- children: "children",
- label: "title",
- isLeaf: function (data) {
- return !data.hasChildren;
- },
- },
- curData:{
- },
- majorDataType:{
- },
- formulaInput:'',//搜索元素字段
- editEleListFilter:[],
- editEleListAll:[]
- };
- },
- created() {
- this.projectid = this.$route.query.pid;
- this.wbsid = this.$route.query.wbsid;
- this.major_data_type()//内业资料类型
- },
- methods: {
- async major_data_type() {//内业资料类型
- const { data: res } = await dictionary({ code: 'major_data_type' })
- console.log(res);
- if (res.code == 200) {
- this.majorDataTypeList = res.data
- }
- },
- selectMajorDataType(item){
- console.log(item,'item');
- this.treeloading = true;
- this.allTreeShow = false;
- this.activeIndex=item
- this.curData={}
- this.treeData=[]
- this.editEleListFilter=[]
- this.editEleListAll=[]
- let parentId=''
- if (this.$refs.tree) {
- this.$refs.tree.setCurrentKey(null);
- }
- if(this.curData.hasChildren){
- parentId=this.curData.id
- }else{
- // parentId=this.curData.parentId
- parentId='12345678910'
- }
- tabTypeLazyTree({parentId:parentId,projectId:this.projectid,current:1,size:1000,titleName:this.filterText,majorDataType:this.activeIndex}).then((res) => {
- this.treeloading = false;
- this.treeData = res.data.data.records;
- });
- },
- clearfiltertext() {
- this.allTreeShow = false;
- },
- getNodeDetail(data,node) {
- this.curData=data;
- console.log(data,'data');
- this.getTableElmentsData()
-
- },
-
- treeLoadNode(node, resolve) {
- let parentId = 12345678910;
- if (node.level != 0) {
- parentId = node.data.id;
- }
- // 开启 “加载中” 动画
- if (node.level == 0) this.loading = true
- tabTypeLazyTree({
- parentId, projectId: this.projectid, pcurrent: 1, size: 1000,majorDataType:this.activeIndex
- }).then(res => {
- // 请求接口,返回数据
- let data = res.data.data.records;
- this.loading = false
- resolve(data);
- })
-
- },
- filterNode(value, data) {
- if (!value) return true;
- return data.title.indexOf(value) !== -1;
- },
- //搜索树
- treeFilter() {
- console.log('搜索');
- if (this.filterText) {
- this.allTreeShow = true;
- this.allTreeData=[]
- if (!this.allTreeData.length) {
- this.treeloading = true;
-
- let parentId=''
- if(this.curData.hasChildren){
- parentId=this.curData.id
- }else{
- // parentId=this.curData.parentId
- parentId=''
- }
- console.log(parentId,'parentId');
- tabTypeLazyTree({parentId:parentId,projectId:this.projectid,pcurrent:1,size:1000,titleName:this.filterText,majorDataType:this.activeIndex}).then((res) => {
- this.treeloading = false;
- this.allTreeData = res.data.data.records;
- });
- this.$nextTick(() => {
- console.log("过滤");
- this.treeloading = false;
- this.$refs.treeall.filter(this.filterText);
- });
-
- } else {
- this.treeloading = false;
- this.$refs.treeall.filter(this.filterText);
- }
- } else {
- this.$message.warning('请先输入文字')
- this.allTreeShow = false;
- }
- },
- //搜索 筛选
- searchFormulaName() {
- this.editEleListFilter = this.editEleListAll.filter((ele) => {
- return ele.eName.indexOf(this.formulaInput) > -1;
- });
- },
- //获取元素列表
-
- getTableElmentsData(){
- getTableElments(this.curData.initTableId).then((res) => {
- this.editEleListFilter = res.data.data;
- this.editEleListAll = [].concat(this.editEleListFilter);
- });
-
- },
- //设置为文件日期
- async setFiledate(row){
- if(row.isBussTime!==2){
- this.$set(row, "isBussTime", 2);
- }
- let colId=row.id
- let colKey=row.tableElementKey
- let tableId=this.curData.initTableId
- const { data: res } = await saveTabusstime(colId,colKey,tableId)
- console.log(res);
- if (res.code == 200) {
- this.$message.success(res.msg)
- }
-
- },
- //取消设置
- async quitFiledate(row){
- let ids=row.tableElementKey
- const { data: res } = await removeTabusstime(ids)
- console.log(res);
- if (res.code == 200) {
- this.$message.success(res.msg)
- }
- if(row.isBussTime==2){
- this.$set(row, "isBussTime", 1);
- }
-
- }
- },
- mounted() {
- // this.heightss = this.$refs.rulesss.clientHeight
- },
- };
- </script>
-
- <style scoped lang="scss">
- //调整表单样式
- .excelHtml {
- position: absolute;
- z-index: 999999;
- top: 50px;
- left: 0px;
- width: 100%;
- height: 100%;
- }
- .marleft10 {
- margin-left: 10px;
- }
- /deep/.el-tree-node__expand-icon {
- font-size: 16px;
- }
- .colorblue {
- color: rgb(0, 82, 217);
- }
- .treecontent /deep/.el-scrollbar {
- height: 100%;
- }
- .el-scrollbar {
- height: 100%;
- }
- .rightHeader {
- display: flex;
- justify-content: flex-start;
- align-items: top;
- font-size: 14px;
- background-color: #fff;
- .excelname {
- box-sizing: border-box;
- min-width: 200px;
- height: 28px;
- border: 1px solid rgb(220, 220, 220);
- padding: 0 10px;
- border-radius: 3px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- }
- .dialogModel {
- .dialogBox {
- .middle {
- display: flex;
- .left {
- border: 1px solid rgb(220, 220, 220);
- border-radius: 3px;
- height: 500px;
- width: 49%;
- .select {
- box-sizing: border-box;
- display: flex;
- justify-content: center;
- padding: 5px 0;
- border-bottom: 1px solid #e0e0e0;
- }
- .leftscroll {
- height: 450px;
- overflow-y: scroll;
- }
- }
- .right {
- height: auto;
- height: 60px;
- max-height: 500px;
- margin-left: 2%;
- // height: 500px;
- border-radius: 3px;
- td {
- box-sizing: border-box;
- padding: 5px 10px;
- height: 30px;
- line-height: 30px;
- }
- }
- }
- }
- .btbox {
- margin-top: 20px;
- display: flex;
- justify-content: center;
- }
- }
- .rightBox {
- flex: 1;
- }
- .boxswai {
- height: 100%;
- box-sizing: border-box;
- padding-bottom: 10px;
- }
- /deep/.avue-crud__left {
- width: 65%;
- }
- /deep/.el-input-group__append {
- background-color: #ecf5ff;
- color: #409EFF;
- }
- /deep/.el-input-group__append:hover {
- background-color: #409EFF;
- color: white;
- }
- /deep/.el-input-group__prepend:hover {
- background-color: #409EFF;
- color: white;
- }
- /deep/.el-input-group__append:active {
- background-color: #9dc5ee;
- color: white;
- }
- /deep/.el-input-group__prepend:active {
- background-color: #9dc5ee;
- color: white;
- }
- </style>
-
|