independent.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. <template>
  2. <div style="height: 100%" class="flexStar">
  3. <div class="boxswai" style="width: 26%; padding-left: 0px">
  4. <div class="boxnei" style="display: flex; flex-direction: column">
  5. <h3>引用元素表</h3>
  6. <div style="overflow: auto; flex: 1;height:500px">
  7. <el-tree
  8. style="display: inline-block;min-width: 100%;"
  9. ref="trees"
  10. :loading="loading"
  11. :load="loadNode"
  12. lazy
  13. :data="data"
  14. :props="defaultProps"
  15. @node-click="nodeClick"
  16. node-key="id"
  17. :expand-on-click-node="false"
  18. v-show="!allTreeShow"
  19. :default-expanded-keys="defaultExpandKey"
  20. :current-node-key="defaultCheckedKey"
  21. >
  22. <span
  23. class="custom-tree-node"
  24. slot-scope="{ data ,node }"
  25. style="box-sizing: border-box;padding-right:70px!important;;"
  26. >
  27. <div style="width:100%;">
  28. <span style="text-overflow: ellipsis;"> {{ data.title }} </span>
  29. <!-- 调整排序 -->
  30. <el-link :underline="false">
  31. <i
  32. class="el-icon-sort"
  33. @click.stop="sortpai(data, node)"
  34. v-if="node.level == 2"
  35. title="调整排序"
  36. ></i>
  37. </el-link>
  38. </div>
  39. </span>
  40. </el-tree>
  41. </div>
  42. </div>
  43. </div>
  44. <div
  45. class="boxswai"
  46. style="width: 74%; padding-left: 0px; padding-right: 0px"
  47. >
  48. <div class="boxnei">
  49. <div
  50. class="marleft10"
  51. style="height: 100%; display: flex; flex-direction: column"
  52. >
  53. <div class="martop20" v-if="true" style="flex: 1">
  54. <avue-crud
  55. :data="loadData"
  56. :option="loadOption"
  57. v-model="obj"
  58. ref="crud"
  59. @selection-change="selectionChange"
  60. :page.sync="page"
  61. :table-loading="tabloading"
  62. @on-load="onLoad"
  63. @current-change="currentChange"
  64. @size-change="sizeChange"
  65. @refresh-change="refreshChange"
  66. >
  67. <template slot="menuRight">
  68. <el-button
  69. type="primary"
  70. size="small"
  71. plain
  72. @click="quteEle"
  73. >引用元素表单库
  74. </el-button>
  75. <el-button
  76. size="small"
  77. type="danger"
  78. plain
  79. @click="handleDelete"
  80. >删除表单
  81. </el-button>
  82. </template>
  83. <template slot="menuLeft" slot-scope="{size}">
  84. <div style="display:flex">
  85. <el-input placeholder="请输入你想搜索的表单名称" v-model="input3" :size="size" clearable @clear="clearinput" > </el-input>
  86. <el-button type="primary" icon="el-icon-search" size="small" @click="searchChange">搜索</el-button>
  87. </div>
  88. <!-- <i class="el-icon-search" slot="append" @click="searchChange" style=" cursor:pointer;font-size: 16px;"></i> -->
  89. </template>
  90. <template slot-scope="{type,size,row}" slot="menu">
  91. <el-button :size="size" :type="type" @click="Associationlist(row)">关联清表</el-button>
  92. <el-button :size="size" :type="type" :disabled="row.excelIds == -1" @click="rightClick(row)">编辑元素</el-button>
  93. <el-button :size="size" :type="type" :disabled="row.excelIds == -1" @click="adjustExcel(row.id,row.primaryKeyId)">调整表单</el-button>
  94. <el-button :size="size" :type="type" @click="handleEditFormula(row)">编辑公式</el-button>
  95. </template>
  96. </avue-crud>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <Qute ref="Qute" :projectid="projectid" :wbsid="wbsid" :onLoad1="onLoad1" :refreshTree="refreshTree"> </Qute>
  102. <Relation ref="Relation" :GLExcelFrom="GLExcelFrom" :wbsid="wbsid" :onLoad1="onLoad1" :refreshTree="refreshTree"></Relation>
  103. <!-- 编辑元素 -->
  104. <!-- 编辑元素 -->
  105. <el-dialog
  106. title=" "
  107. :visible.sync="editElementVisible"
  108. fullscreen
  109. append-to-body
  110. class="full-dialog"
  111. >
  112. <EditElement
  113. :curEleTable="curEleTable"
  114. :pkeyId="editElementQuery.pkeyId"
  115. :id="editElementQuery.id"
  116. :initTableName="editElementQuery.initTableName"
  117. :pid="editElementQuery.pid"
  118. :wbsid="editElementQuery.wbsid"
  119. :nodeid="editElementQuery.nodeid"
  120. :initTableId="editElementQuery.initTableId"
  121. @hideDialog="editElementVisible = false"
  122. v-if="editElementVisible"
  123. :elementType="true"
  124. :globaltype='1'
  125. ></EditElement>
  126. </el-dialog>
  127. <!-- 调整表单模板 -->
  128. <div v-if="excelHtml" class="excelHtml">
  129. <dynamicExcel
  130. @remove="removeExcel"
  131. v-if="excelHtml"
  132. :pkeyId="GLExcelFrom.id"
  133. />
  134. </div>
  135. <!-- 元素公式 -->
  136. <el-dialog
  137. title="元素公式"
  138. :visible.sync="editEleFormulaVisible"
  139. width="800px"
  140. append-to-body
  141. :close-on-click-modal="false"
  142. >
  143. <div class="flex mg-b-10">
  144. <el-input
  145. v-model="formulaInput"
  146. placeholder="请输入名称"
  147. size="samll"
  148. clearable
  149. @clear="searchFormulaName"
  150. ></el-input>
  151. <el-button type="info" class="mg-l-10" @click="searchFormulaName"
  152. >搜索</el-button
  153. >
  154. </div>
  155. <el-table
  156. :data="editEleListFilter"
  157. border
  158. style="width: 100%"
  159. height="400px"
  160. >
  161. <el-table-column align="center" prop="eName" label="字段信息">
  162. </el-table-column>
  163. <el-table-column align="center" label="操作" width="200">
  164. <template slot-scope="scope">
  165. <el-link
  166. :type="scope.row.globalFormula == 1 ? 'warning' : 'primary'"
  167. @click="toFormulaEdit(scope.row,1)"
  168. >全局公式</el-link
  169. >
  170. <!-- <el-link
  171. class="mg-l-10"
  172. :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
  173. @click="toFormulaEdit(scope.row,10)"
  174. >节点公式</el-link
  175. > -->
  176. <!-- <el-link
  177. class="mg-l-10"
  178. type="danger"
  179. @click="delEleRowHandle(scope.$index,editEleListFilter)"
  180. >删除</el-link> -->
  181. </template>
  182. </el-table-column>
  183. </el-table>
  184. </el-dialog>
  185. <!-- 公式 -->
  186. <el-dialog
  187. title="元素公式"
  188. :visible.sync="formulaCompVisible"
  189. fullscreen
  190. append-to-body
  191. class="full-dialog"
  192. @close="closeformulaComp"
  193. >
  194. <FormulaEdit
  195. :fromcurNode="curEleTable"
  196. :initTableId='curTreeData.id'
  197. :wbsid="id"
  198. :nodeid="curTreeData.id"
  199. :eleid="formulaCurRow.id"
  200. :projectid="projectid"
  201. :globaltype="formulaCurRow.globaltype"
  202. :elementType="formulaCurRow.elementType"
  203. @hideDialog="formulaCompVisible = false"
  204. v-if="formulaCompVisible"
  205. ></FormulaEdit>
  206. </el-dialog>
  207. <!-- 排序弹框 -->
  208. <el-dialog
  209. title="调整排序"
  210. :visible.sync="sortTag"
  211. width="50%"
  212. append-to-body
  213. >
  214. <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
  215. <span slot="footer" class="dialog-footer">
  216. <el-button @click="(sortTag = false), (sortTag2 = false)"
  217. >取 消</el-button
  218. >
  219. <el-button type="primary" @click="editSort()">确 定</el-button>
  220. </span>
  221. </el-dialog>
  222. </div>
  223. </template>
  224. <script>
  225. import {tabTypeLazyTree,delAprojectTab} from "@/api/manager/wbsprivate";
  226. import {selectPrivateFormElements} from "@/api/manager/wbstree";
  227. import {getTableElments} from "@/api/manager/wbstree";
  228. import {wbsInfotabSort} from "@/api/manager/wbsinfo";
  229. import {getExcelHtml} from "@/api/exctab/excelmodel"
  230. import Qute from "./qutediaolog/qute1.vue";//引入元素库
  231. import Relation from './qutediaolog/relation.vue'//关联清表
  232. import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";//编辑元素
  233. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  234. import FormulaEdit from "@/views/formula/edit1.vue";
  235. import ManualSorting from '@/components/WbsTree/ManualSorting'
  236. export default {
  237. components: { dynamicExcel, EditElement, Qute,Relation,FormulaEdit,ManualSorting },
  238. computed:{
  239. ids () {
  240. let ids = [];
  241. this.selectionList.forEach(ele => {
  242. ids.push(ele.primaryKeyId);
  243. });
  244. return ids.join(",");
  245. }
  246. },
  247. data() {
  248. return {
  249. input3:'',
  250. page:{
  251. current:1,
  252. size:10,
  253. total:0
  254. },
  255. search:{},
  256. loading:false,
  257. tabloading:false,
  258. dialogVisible: false,
  259. obj: {},
  260. data: [],
  261. defaultProps: {
  262. children: "children",
  263. isLeaf: function (data) {
  264. return !data.hasChildren;
  265. },
  266. },
  267. allTreeShow:false,//是否显示整棵树
  268. loadData: [],
  269. loadData1: [
  270. {
  271. tableName: "张三",
  272. formatTableType: "男",
  273. },
  274. ],
  275. loadData2: [
  276. {
  277. tableName: "李四2",
  278. formatTableType: "女",
  279. },
  280. ],
  281. loadOption: {
  282. height: "auto",
  283. calcHeight: 30,
  284. tip: false,
  285. searchShow: true,
  286. searchMenuSpan: 6,
  287. border: true,
  288. index: true,
  289. viewBtn: false,
  290. selection: true,
  291. editBtn: false,
  292. delBtn: false,
  293. addBtn: false,
  294. menu: true,
  295. menuWidth:300,
  296. searchShowBtn:true,
  297. dialogClickModal: false,
  298. column: [
  299. {
  300. label: "元素表名称",
  301. prop: "title",
  302. editDisplay: false,
  303. addDisplay: false,
  304. },
  305. {
  306. label: "元素表类型",
  307. prop: "tabType",
  308. // search: true,
  309. rules: [
  310. {
  311. required: true,
  312. message: "请输入名称",
  313. trigger: "blur",
  314. },
  315. ],
  316. },
  317. {
  318. label: "元素总量",
  319. prop: "elementTotal",
  320. editDisplay: false,
  321. addDisplay: false,
  322. rules: [
  323. {
  324. message: "请输入表数量",
  325. trigger: "blur",
  326. },
  327. ],
  328. },
  329. {
  330. label: "所属方",
  331. prop: "tabOwner",
  332. editDisplay: false,
  333. addDisplay: false,
  334. rules: [
  335. {
  336. message: "请输入表数量",
  337. trigger: "blur",
  338. },
  339. ],
  340. },
  341. {
  342. label: "填报率",
  343. prop: "fillRate",
  344. editDisplay: false,
  345. addDisplay: false,
  346. rules: [
  347. {
  348. message: "请输入表数量",
  349. trigger: "blur",
  350. },
  351. ],
  352. },
  353. ],
  354. },
  355. defaultExpandKey:[],//默认展开的节点
  356. defaultCheckedKey:'',
  357. selectionList:[],
  358. GLExcelFrom: {
  359. id: "",
  360. name: "",
  361. search: "", //搜素框舒服的值
  362. ids: "",
  363. excelId: "",
  364. initTableName: "",
  365. initTableId:'',
  366. },
  367. //编辑元素弹窗
  368. editElementVisible: false, //编辑元素弹框
  369. editElementQuery: {
  370. pkeyId: "",
  371. excelId: "",
  372. id: "",
  373. initTableName: "",
  374. pid: "",
  375. wbsid: "",
  376. nodeid: "",
  377. }, //
  378. excelHtml:false,//调整表单
  379. //#region 调整表单
  380. adjustmentExcel: "",
  381. curEleTable: {},//编辑元素公式
  382. editEleFormulaVisible: false,//元素公式
  383. formulaInput: "",
  384. editEleListFilter: [],
  385. editEleListAll: [],
  386. formulaCurRow: {}, //当前元素
  387. formulaCompVisible:false,
  388. //#region公式
  389. id: "",
  390. curTreeData: {},
  391. projectid:'',
  392. treeId:"",
  393. curNode:{},
  394. sortTag: false,
  395. sortTag2: false,
  396. sort:[]
  397. };
  398. },
  399. created() {
  400. this.projectid = this.$route.query.pid;
  401. this.wbsid=this.$route.query.wbsid;
  402. },
  403. methods: {
  404. //关闭公式弹窗
  405. closeformulaComp(){
  406. console.log('关闭');
  407. getTableElments(this.curEleTable.initTableId).then((res) => {
  408. this.editEleListFilter = res.data.data;
  409. this.editEleListAll = [].concat(this.editEleListFilter);
  410. })
  411. },
  412. async sortpai(data,node) {
  413. this.curNode=node;
  414. this.curTreeData=data;
  415. await this.findWbsTreePrivateSameLevel(node,data)
  416. this.sortTag = true;
  417. this.sortTag2 = true;
  418. },
  419. editSort() {
  420. this.wbsInfotabSort();
  421. },
  422. bianhua() {
  423. this.sortTag2 = false;
  424. this.$nextTick(() => {
  425. this.sortTag2 = true;
  426. });
  427. },
  428. async wbsInfotabSort() {
  429. //元素库、独立库节点排序
  430. console.log(this.sort,'this.sort');
  431. var newArr=this.sort.map((v)=>{return v.id})
  432. newArr=newArr.join(',')
  433. const { data: res } = await wbsInfotabSort(newArr);
  434. if (res.code == 200) {
  435. this.$message.success('操作成功')
  436. this.sortTag = false;
  437. this.sortTag2 = false;
  438. this. refreshTree();
  439. }
  440. },
  441. async findWbsTreePrivateSameLevel(node,data) {
  442. const { data: res } =await tabTypeLazyTree({parentId:node.data.parentId,projectId:this.projectid,current:1,size:1000})
  443. if (res.code == 200) {
  444. console.log(res.data,'res1111111');
  445. let tabArr=res.data.records
  446. tabArr.forEach((item)=>{
  447. item.tableName=item.title
  448. })
  449. console.log(tabArr,'tabArr');
  450. this.sort =tabArr
  451. }
  452. },
  453. //#region 接口
  454. async tabTypeLazyTree (parentId, projectId,current,size,titleName) {//清表树
  455. console.log(parentId, projectId);
  456. this.loading=true;
  457. const { data: res } = await tabTypeLazyTree({ parentId, projectId,current,size,titleName })
  458. this.loading=false;
  459. if (res.code === 200) {
  460. return res.data;
  461. }
  462. },
  463. loadNode(node, resolve) {
  464. const parentId = (node.level === 0) ? 12345678910 : node.data.id;
  465. this.tabTypeLazyTree(parentId,this.projectid,this.page.current,1000).then(res=>{
  466. resolve(res.records.map(item=>{
  467. return{
  468. ...item,
  469. leaf: !item.hasChildren
  470. }
  471. }))
  472. })
  473. },
  474. searchChange(){
  475. if(this.treeId){
  476. this.page.current=1;
  477. this.page.currentPage=1
  478. this.page.size=10;
  479. this.onLoad2()
  480. }else{
  481. if(this.input3){
  482. this.tabloading=true;
  483. this.page.current=1;
  484. this.page.currentPage=1
  485. this.page.size=10;
  486. this.tabTypeLazyTree(this.curTreeData.id, this.projectid, this.page.current,this.page.size,this.input3).then((res)=>{
  487. console.log(res.records);
  488. this.loadData=res.records;
  489. this.page.total=res.total;
  490. this.tabloading=false;
  491. })
  492. }else{
  493. this.$message.warning('请输入你想搜索的表单名称')
  494. }
  495. }
  496. },
  497. currentChange (currentPage) {
  498. this.page.current = currentPage;
  499. // this.searchChange();
  500. },
  501. sizeChange (pageSize) {
  502. this.page.size = pageSize;
  503. },
  504. refreshChange () {
  505. this.searchChange();
  506. },
  507. clearinput(){
  508. this.searchChange()
  509. },
  510. onLoad2(){
  511. if(this.curTreeData.hasChildren){
  512. this.tabloading=true;
  513. this.tabTypeLazyTree(this.curTreeData.id, this.projectid, this.page.current,this.page.size,this.input3).then((res)=>{
  514. console.log(res.records);
  515. this.loadData=res.records;
  516. this.page.total=res.total;
  517. this.tabloading=false;
  518. })
  519. }
  520. if(this.curTreeData.hasChildren===false&&this.curNode.level==2){
  521. this.tabloading=true;
  522. let arr=[]
  523. arr.push(this.curTreeData)
  524. this.loadData=arr
  525. this.page.total=1
  526. setTimeout(() => {
  527. this.tabloading=false
  528. }, 1000);
  529. }else{
  530. this.tabloading=true;
  531. this.loadData=[]
  532. this.page.total=0;
  533. setTimeout(() => {
  534. this.tabloading=false
  535. }, 1000);
  536. }
  537. },
  538. onLoad1(){
  539. if(this.curNode.level===1){
  540. this.tabloading=true;
  541. this.tabTypeLazyTree(this.curTreeData.id, this.projectid, this.page.current,this.page.size,this.input3).then((res)=>{
  542. this.loadData=res.records
  543. this.page.total=res.total
  544. this.tabloading=false
  545. })
  546. }else{
  547. this.tabTypeLazyTree(this.curTreeData.parentId, this.projectid, this.page.current,1000,this.input3).then((res)=>{
  548. let faArr=res.records;
  549. this.loadData=faArr.filter((item)=>{
  550. if(item.id===this.treeId){
  551. return item
  552. }
  553. })
  554. })
  555. }
  556. },
  557. onLoad(page){
  558. if(this.input3||this.treeId){
  559. this.tabloading=true;
  560. this.tabTypeLazyTree(this.treeId,this.projectid, page.currentPage,page.pageSize,this.input3).then((res)=>{
  561. this.loadData=res.records
  562. this.page.total=res.total
  563. this.tabloading=false
  564. })
  565. }
  566. },
  567. nodeClick (data,node) {//外层树结构
  568. console.log(data,node,'treedata');
  569. this.curNode=node
  570. this.treeId=data.id
  571. this.curTreeData=data;
  572. this.page.current=1;
  573. this.page.currentPage=1
  574. console.log(this.page,'this.page111111');
  575. if(data.hasChildren){
  576. this.onLoad(this.page)
  577. }
  578. if(data.hasChildren===false&&node.level==2){
  579. this.tabloading=true;
  580. let arr=[]
  581. arr.push(data)
  582. this.loadData=arr
  583. this.page.total=1
  584. setTimeout(() => {
  585. this.tabloading=false
  586. }, 1000);
  587. }else{
  588. this.loadData=[]
  589. this.page.total=0
  590. }
  591. },
  592. handleClose(done) {
  593. this.$confirm("确认关闭?")
  594. .then((_) => {
  595. done();
  596. })
  597. .catch((_) => {});
  598. },
  599. //引用元素表单库
  600. quteEle(){
  601. this.$refs.Qute.show();
  602. },
  603. handleDelete () {
  604. if (this.selectionList.length === 0) {
  605. this.$message.warning("请选择至少一条数据");
  606. return;
  607. }
  608. this.$confirm("确定将选择数据删除?", {
  609. confirmButtonText: "确定",
  610. cancelButtonText: "取消",
  611. type: "warning"
  612. })
  613. .then(() => {
  614. return delAprojectTab(this.ids,this.projectid);
  615. })
  616. .then(() => {
  617. this.onLoad1()
  618. this.refreshTree()
  619. this.$message({
  620. type: "success",
  621. message: "操作成功!"
  622. });
  623. this.$refs.crud.toggleSelection();
  624. });
  625. },
  626. selectionChange (list) {
  627. this.selectionList = list;
  628. },
  629. selectionClear () {
  630. this.selectionList = [];
  631. this.$refs.crud.toggleSelection();
  632. },
  633. //关联清表
  634. Associationlist(row) {
  635. console.log('关联清表',row);
  636. this.$refs.Relation.show()
  637. // this.GLExcelFrom.name = row.title;
  638. this.GLExcelFrom.id = row.primaryKeyId;
  639. this.GLExcelFrom.excelId =row.excelIds;
  640. this.GLExcelFrom.ids = row.id;
  641. this.GLExcelFrom.initTableName =row.initTableName;
  642. this.GLExcelFrom.initTableId =row.initTableId;
  643. this.GLExcelFrom.nodeid =this.curTreeData.id
  644. },
  645. //#region 编辑元素
  646. async rightClick(row) {
  647. console.log(row,'编辑元素');
  648. await this.getExcelHtml2(row.primaryKeyId);
  649. // console.log('编辑元素');
  650. this.editElementQuery.pkeyId = row.primaryKeyId;
  651. this.editElementQuery.excelId = row.excelIds;
  652. this.editElementQuery.id = row.id;
  653. this.editElementQuery.initTableName =row. initTableName;
  654. this.editElementQuery.pid = this.$route.query.pid;
  655. this.editElementQuery.wbsid = this.$route.query.wbsid;
  656. this.editElementQuery.initTableId = row.initTableId;
  657. this.editElementQuery.nodeid = this.curTreeData.id;
  658. this.curEleTable=row;
  659. this.editElementVisible = true;
  660. },
  661. async getExcelHtml2(pkeyId) {
  662. const { data: res } = await getExcelHtml({ pkeyId });
  663. console.log(res);
  664. if (res.code === 200) {
  665. localStorage.setItem("editElement", res.data);
  666. }
  667. },
  668. //#region 调整表单
  669. adjustExcel(id,pkeyId) {
  670. this.excelHtml=false;
  671. // //调整表单
  672. this.GLExcelFrom.id = pkeyId;
  673. this.getExcelHtml(pkeyId);
  674. },
  675. handleEditFormula(row) {
  676. console.log(row,'公式');
  677. this.curEleTable = row;
  678. getTableElments(this.curEleTable.initTableId).then((res) => {
  679. // selectFormElements(this.curEleTable.id).then((res) => {
  680. this.editEleListFilter = res.data.data;
  681. this.editEleListAll = [].concat(this.editEleListFilter);
  682. });
  683. this.editEleFormulaVisible = true;
  684. },
  685. //搜索 筛选
  686. searchFormulaName() {
  687. this.editEleListFilter = this.editEleListAll.filter((ele) => {
  688. return ele.eName.indexOf(this.formulaInput) > -1;
  689. });
  690. },
  691. async getExcelHtml(pkeyId) {
  692. const { data: res } = await getExcelHtml({ pkeyId });
  693. console.log(res);
  694. if (res.code === 200) {
  695. localStorage.setItem("excelHtml", res.data);
  696. this.adjustmentExcel = res.data;
  697. this.excelHtml = true;
  698. }
  699. },
  700. removeExcel() {
  701. this.excelHtml = false;
  702. },
  703. //跳转到公式配置页面
  704. toFormulaEdit(row,type) {
  705. this.formulaCurRow = row;
  706. this.formulaCompVisible = true;
  707. this.formulaCurRow.globaltype = type;
  708. this.formulaCurRow.elementType = true;
  709. },
  710. //刷新左边树形数据
  711. refreshTree(){
  712. //刷新左边树形数据
  713. if(this.curNode.level===1){
  714. const parentId =12345678910
  715. tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
  716. this.data=res.data.data.records;
  717. this.$nextTick(()=>{
  718. this.defaultExpandKey.push(this.curNode.data.id);
  719. this.$refs.trees.setCurrentKey(this.curNode.data.id);
  720. })
  721. });
  722. }else{
  723. this.updateTreeNewNode()
  724. }
  725. },
  726. updateTreeNewNode() {
  727. tabTypeLazyTree(
  728. {parentId:this.curTreeData.parentId,projectId:this.projectid,current:1,size:1000}
  729. ).then((res) => {
  730. this.$refs.trees.updateKeyChildren(
  731. this.curTreeData.parentId,
  732. res.data.data.records
  733. );
  734. this.$refs.trees.setCurrentKey(this.curNode.data.id);
  735. });
  736. },
  737. },
  738. mounted() {
  739. // this.heightss = this.$refs.rulesss.clientHeight
  740. },
  741. };
  742. </script>
  743. <style scoped lang="scss">
  744. //调整表单样式
  745. .excelHtml {
  746. position: absolute;
  747. z-index: 999999;
  748. top: 50px;
  749. left: 0px;
  750. width: 100%;
  751. height: 100%;
  752. }
  753. .marleft10 {
  754. margin-left: 10px;
  755. }
  756. /deep/.el-tree-node__expand-icon {
  757. font-size: 16px;
  758. }
  759. .colorblue {
  760. color: rgb(0, 82, 217);
  761. }
  762. .treecontent /deep/.el-scrollbar {
  763. height: 100%;
  764. }
  765. .el-scrollbar {
  766. height: 100%;
  767. }
  768. .rightHeader {
  769. display: flex;
  770. justify-content: flex-start;
  771. align-items: top;
  772. font-size: 14px;
  773. background-color: #fff;
  774. .excelname {
  775. box-sizing: border-box;
  776. min-width: 200px;
  777. height: 28px;
  778. border: 1px solid rgb(220, 220, 220);
  779. padding: 0 10px;
  780. border-radius: 3px;
  781. display: flex;
  782. justify-content: space-between;
  783. align-items: center;
  784. }
  785. }
  786. .dialogModel {
  787. .dialogBox {
  788. .middle {
  789. display: flex;
  790. .left {
  791. border: 1px solid rgb(220, 220, 220);
  792. border-radius: 3px;
  793. height: 500px;
  794. width: 49%;
  795. .select {
  796. box-sizing: border-box;
  797. display: flex;
  798. justify-content: center;
  799. padding: 5px 0;
  800. border-bottom: 1px solid #e0e0e0;
  801. }
  802. .leftscroll {
  803. height: 450px;
  804. overflow-y: scroll;
  805. }
  806. }
  807. .right {
  808. height: auto;
  809. height: 60px;
  810. max-height: 500px;
  811. margin-left: 2%;
  812. // height: 500px;
  813. border-radius: 3px;
  814. td {
  815. box-sizing: border-box;
  816. padding: 5px 10px;
  817. height: 30px;
  818. line-height: 30px;
  819. }
  820. }
  821. }
  822. }
  823. .btbox {
  824. margin-top: 20px;
  825. display: flex;
  826. justify-content: center;
  827. }
  828. }
  829. .rightBox {
  830. flex: 1;
  831. }
  832. .boxswai {
  833. height: 100%;
  834. box-sizing: border-box;
  835. padding-bottom: 10px;
  836. }
  837. /deep/.avue-crud__left{
  838. width: 65%;
  839. }
  840. /deep/.el-input-group__append{
  841. background-color: #ecf5ff;
  842. color: #409EFF;
  843. }
  844. /deep/.el-input-group__append:hover{
  845. background-color: #409EFF;
  846. color: white;
  847. }
  848. /deep/.el-input-group__prepend:hover{
  849. background-color: #409EFF;
  850. color: white;
  851. }
  852. /deep/.el-input-group__append:active{
  853. background-color: #9dc5ee;
  854. color: white;
  855. }
  856. /deep/.el-input-group__prepend:active{
  857. background-color: #9dc5ee;
  858. color: white;
  859. }
  860. </style>