ruleManage.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. <template>
  2. <div class="container-box">
  3. <el-row :gutter="20" class="h-100">
  4. <el-col :span="6" class="h-100">
  5. <div class="h-100">
  6. <el-card class="box-card h-100">
  7. <div class="tree-container">
  8. <el-scrollbar>
  9. <el-tree
  10. lazy
  11. :load="loadNode"
  12. @node-click="handleNodeClick"
  13. :props="defaultProps"
  14. :expand-on-click-node="false"
  15. :default-expanded-keys="defaultExpandedKeys"
  16. :current-node-key="curreenttid"
  17. highlight-current
  18. node-key="id"
  19. ref="tree"
  20. ></el-tree>
  21. </el-scrollbar>
  22. </div>
  23. </el-card>
  24. </div>
  25. </el-col>
  26. <template v-if="!isShowDetail">
  27. <el-col :span="18" class="h-100" v-if="isShowList">
  28. <div class="h-100 rule-box-all">
  29. <el-card class="box-card h-100">
  30. <div slot="header" class="clearfix">
  31. <el-link type="primary" @click="goBackFirst">
  32. <i class="el-icon-arrow-left" style="margin-right: 5px; "></i>
  33. <span>退出</span>
  34. </el-link>
  35. <div style="float: right;">
  36. <el-button
  37. :disabled="!treeId"
  38. icon="el-icon-plus"
  39. size="small"
  40. style="background-color:#2550A2;color:white;font-weight:bold;"
  41. plain
  42. @click="addRule"
  43. >新增
  44. </el-button>
  45. <el-button
  46. :disabled="!treeId"
  47. icon="el-icon-document-copy"
  48. size="small"
  49. style="background-color:#FFA042;color:white;font-weight:bold;"
  50. plain
  51. @click="manageFolder"
  52. >管理
  53. </el-button>
  54. </div>
  55. </div>
  56. <div v-if="ruleItemOptions.length>0">
  57. <div class="rule-box" >
  58. <div class="rule-box-item" v-for="(item,index) in ruleItemOptions" :key="index" @click="ruleDetailClick" >
  59. <div class="rule-box-item-icon">
  60. <i class="el-icon-folder" style=" cursor: pointer; font-size: 48px;color:orange"></i>
  61. </div>
  62. <div class="rule-box-item-title">{{ item.name }}</div>
  63. </div>
  64. </div>
  65. <el-pagination
  66. style="margin-top: 30px;text-align: center;"
  67. @size-change="handleSizeChange"
  68. @current-change="handleCurrentChange"
  69. :current-page="currentPage"
  70. :page-size="pageSize"
  71. :total="ruleItemOptions.length"
  72. layout="prev, pager, next"
  73. class="pagination"
  74. >
  75. </el-pagination>
  76. </div>
  77. <el-empty description="暂无数据" v-else class="empty-container"></el-empty>
  78. </el-card>
  79. </div>
  80. </el-col>
  81. <el-col :span="18" class="h-100" v-if="!isShowList">
  82. <div class="h-100 rule-box-all">
  83. <el-card class="box-card h-100">
  84. <div slot="header" class="clearfix">
  85. <i class="el-icon-arrow-left" style="margin-right: 5px; cursor: pointer;" @click="goBack"></i>
  86. <span @click="goBack">返回上一级</span>
  87. <div style="float: right;">
  88. <el-button
  89. icon="el-icon-plus"
  90. size="small"
  91. style="background-color:#2550A2;color:white;font-weight:bold;"
  92. plain
  93. @click="addFile"
  94. >新增
  95. </el-button>
  96. <el-button
  97. icon="el-icon-document-copy"
  98. size="small"
  99. style="background-color:#FFA042;color:white;font-weight:bold;"
  100. plain
  101. @click="manageFolder"
  102. >管理
  103. </el-button>
  104. </div>
  105. </div>
  106. <div class="rule-box" v-loading="ruleLoading">
  107. <div class="rule-box-item" v-for="item in ruleItemOptions" :key="item.id" @click="ruleDetailClick1">
  108. <div class="rule-box-item-icon">
  109. <i class="el-icon-tickets" style=" cursor: pointer; font-size: 48px;color:#2550A2"></i>
  110. </div>
  111. <div class="rule-box-item-title">{{ item.name }}</div>
  112. </div>
  113. </div>
  114. <el-pagination
  115. style="margin-top: 30px;text-align: center;"
  116. @size-change="handleSizeChange"
  117. @current-change="handleCurrentChange"
  118. :current-page="currentPage"
  119. :page-size="pageSize"
  120. :total="total"
  121. layout="prev, pager, next"
  122. class="pagination"
  123. >
  124. </el-pagination>
  125. </el-card>
  126. </div>
  127. </el-col>
  128. </template>
  129. <el-col :span="18" class="h-100" v-if="isShowDetail">
  130. <el-card class="box-card h-100" v-if="isShowYpList">
  131. <div slot="header" class="clearfix">
  132. <i class="el-icon-arrow-left" style="margin-right: 5px; cursor: pointer;" @click="goBack1"></i>
  133. <span>返回上一级</span>
  134. </div>
  135. <div class="box-card-title">
  136. GB 175-2023
  137. </div>
  138. <div class="box-card-content1">
  139. <div class="box-card-content1-left">
  140. <div class="box-card-content1-left-item">
  141. 下达日期:2023-12-12
  142. </div>
  143. <div class="box-card-content1-left-item">
  144. 实施日期:2023-12-12
  145. </div>
  146. <div>
  147. <i class="el-icon-document"></i>文件名称.pdf
  148. </div>
  149. </div>
  150. <div class="box-card-content1-right">
  151. <el-button type="danger" size="small" @click="previewRes">效果预览</el-button>
  152. <el-button type="warning" size="small">规范更新</el-button>
  153. </div>
  154. </div>
  155. <div class="box-card-content2">
  156. <div class="box-card-content2-top">
  157. <div class="box-card-content2-title">
  158. <div class="title-container">
  159. <span>样品信息</span>
  160. <i class="el-icon-circle-plus" @click="addYp"></i>
  161. </div>
  162. </div>
  163. <div class="box-card-content2-list">
  164. <div class="box-card-content2-list-item" v-for="(item, index) in ypList" :key="index">
  165. <div class="box-card-content2-list-item-title">
  166. <span class="eg">if()</span>
  167. <span>{{ item.name }}</span>
  168. </div>
  169. <div class="box-card-content2-list-item-list">
  170. <span class="basic-info">基础信息</span>
  171. <div class="box-card-content2-list-item-list-basic">
  172. <div class="basic-item-info" v-for="(item1,index1) in item.basic":key="index1" >
  173. {{ item1.name }}
  174. </div>
  175. <div class="operation-icons">
  176. <i class="el-icon-edit" @click.stop="handleEdit(item, index)"></i>
  177. <i class="el-icon-delete" @click.stop="handleDelete(index)"></i>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <div class="box-card-content2-top">
  185. <div class="box-card-content2-title">
  186. <div class="title-container">
  187. <span>技术指标</span>
  188. <i class="el-icon-circle-plus" @click="addJs"></i>
  189. </div>
  190. </div>
  191. <div class="box-card-content2-list">
  192. <div class="box-card-content2-list-item" v-for="(item, index) in jsList" :key="index">
  193. <div class="box-card-content2-list-item-title">
  194. <span class="eg">else()</span>
  195. <span>{{ item.name }}</span>
  196. </div>
  197. <div class="box-card-content2-list-item-list">
  198. <span class="basic-info">内容</span>
  199. <div class="box-card-content2-list-item-list-basic">
  200. <div class="basic-item-info" v-for="(item1,index1) in item.basic":key="index1" >
  201. {{ item1.name }}
  202. </div>
  203. <div class="operation-icons">
  204. <i class="el-icon-edit" @click.stop="handleEdit(item, index)"></i>
  205. <i class="el-icon-delete" @click.stop="handleDelete(index)"></i>
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. </div>
  213. </el-card>
  214. <el-card class="box-card h-100" v-if="!isShowYpList&&!isShowJsList">
  215. <template >
  216. <div slot="header" class="clearfix" >
  217. <i class="el-icon-arrow-left" style="margin-right: 5px; cursor: pointer;" @click="showYpList"></i>
  218. <span @click="showYpList">退出</span>
  219. </div>
  220. <div class="add-yp-title">
  221. <span>新增</span>
  222. </div>
  223. <div class="add-yp-detail">
  224. <el-form label-position="left" label-width="80px" :model="ypDetail" :rules="ypRuleForm">
  225. <el-form-item label="样品信息" prop="name">
  226. <el-input v-model="ypDetail.name"></el-input>
  227. </el-form-item>
  228. <el-form-item label="基础信息">
  229. <div class="input-with-icon" v-for="(item, index) in ypDetail.basic" :key="index">
  230. <el-input v-model="item.name"></el-input>
  231. <i class="el-icon-circle-plus-outline" @click="addBasicInfo" v-if="index!==0"></i>
  232. <i class="el-icon-remove-outline" @click="removeBasicInfo(index)"></i>
  233. </div>
  234. </el-form-item>
  235. </el-form>
  236. </div>
  237. <div class="add-yp-footer">
  238. <el-button type="primary">保存</el-button>
  239. </div>
  240. </template>
  241. </el-card>
  242. <el-card v-if="isShowJsList&&!isShowYpList">
  243. <div slot="header" class="clearfix" >
  244. <i class="el-icon-arrow-left" style="margin-right: 5px; cursor: pointer;" @click="showYpList"></i>
  245. <span @click="showYpList">退出</span>
  246. </div>
  247. <div class="add-yp-title">
  248. <span>新增</span>
  249. <div>
  250. <el-button size="small" style="background: rgb(168, 86, 248);color: white;" icon="el-icon-office-building" @click="conditionsSet">条件设置</el-button>
  251. <el-button size="small" style="background:rgb(37, 80, 162);;color: white;" icon="el-icon-connection" @click="linkEle">关联元素</el-button>
  252. </div>
  253. </div>
  254. <div class="add-yp-detail">
  255. <el-form label-position="left" label-width="80px" :model="jsDetail" :rules="jsRuleForm">
  256. <el-form-item label="检测项" prop="name">
  257. <el-input v-model="jsDetail.name"></el-input>
  258. </el-form-item>
  259. <el-form-item label="技术指标">
  260. <div class="input-with-icon" v-for="(item, index) in jsDetail.basic" :key="index">
  261. <el-input placeholder="请输入内容" v-model="item.name" class="input-with-select">
  262. <el-select v-model="item.select" slot="prepend" placeholder="请选择符号" style="width: 150px;">
  263. <el-option v-for="(item1,index) in fqOptions" :key="index" :label="item1.label" :value="item1.value"></el-option>
  264. </el-select>
  265. </el-input>
  266. <i class="el-icon-circle-plus-outline" @click="addBasicInfo1" ></i>
  267. <i class="el-icon-remove-outline" @click="removeBasicInfo1(index)" v-if="index!==0"></i>
  268. </div>
  269. </el-form-item>
  270. </el-form>
  271. </div>
  272. <div class="add-yp-footer">
  273. <el-button type="primary">保存</el-button>
  274. </div>
  275. </el-card>
  276. </el-col>
  277. </el-row>
  278. <!-- 新增文件夹 -->
  279. <el-dialog
  280. title="新增"
  281. :visible.sync="addDialogVisible"
  282. width="30%"
  283. append-to-body
  284. >
  285. <div class="input-container">
  286. <span>规范文件夹名称</span>
  287. <el-input v-model="titleInput" placeholder="请输入内容" style="width: 300px;"></el-input>
  288. </div>
  289. <span slot="footer" class="dialog-footer">
  290. <el-button @click="addDialogVisible = false">取 消</el-button>
  291. <el-button type="primary" @click="addSaveFileClick" :loading="addSaveFileLoad">确 定</el-button>
  292. </span>
  293. </el-dialog>
  294. <!-- 管理规范 -->
  295. <el-dialog title="管理" :visible.sync="manageVisible" width="50%" append-to-body>
  296. <el-table :data="manageData" border height="550">
  297. <el-table-column property="name" label="规范名称" >
  298. <template slot-scope="scope">
  299. <el-input v-model="scope.row.name" placeholder="请输入内容"></el-input>
  300. </template>
  301. </el-table-column>
  302. <el-table-column label="操作" width="200">
  303. <template slot-scope="scope">
  304. <el-button type="text" size="small" style="color: rgb(219, 55, 55);" @click="delManange(scope.$index)">删除</el-button>
  305. </template>
  306. </el-table-column>
  307. </el-table>
  308. <div slot="footer" class="dialog-footer">
  309. <el-button @click="manageVisible = false">取 消</el-button>
  310. <el-button type="primary" @click="manageVisible = false">确 定</el-button>
  311. </div>
  312. </el-dialog>
  313. <!-- 新增规范文件 -->
  314. <el-dialog title="新增" :visible.sync="addFileDialogVisible" append-to-body width="30%">
  315. <el-form :model="fileForm" label-position="left" label-width="80px">
  316. <el-form-item label="规范名称" >
  317. <el-input v-model="fileForm.name" ></el-input>
  318. </el-form-item>
  319. <el-form-item label="下达日期" >
  320. <el-date-picker
  321. style="width: 100%;"
  322. v-model="fileForm.date1"
  323. type="date"
  324. placeholder="选择日期">
  325. </el-date-picker>
  326. </el-form-item>
  327. <el-form-item label="实施日期" >
  328. <el-date-picker
  329. style="width: 100%;"
  330. v-model="fileForm.date2"
  331. type="date"
  332. placeholder="选择日期">
  333. </el-date-picker>
  334. </el-form-item>
  335. <el-form-item label="规范文件" >
  336. <el-upload
  337. class="upload-demo"
  338. action="https://jsonplaceholder.typicode.com/posts/"
  339. :file-list="fileList">
  340. <el-button size="small" type="primary">点击上传</el-button>
  341. <div slot="tip" class="el-upload__tip">允许文件格式.pdf</div>
  342. </el-upload>
  343. </el-form-item>
  344. </el-form>
  345. <div slot="footer" class="dialog-footer">
  346. <el-button @click="dialogFormVisible = false">取 消</el-button>
  347. <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
  348. </div>
  349. </el-dialog>
  350. <!-- 条件设置 -->
  351. <ConditionsSet ref="conditionsSetRef" @confirm="handleConditionsConfirm" />
  352. <!-- 关联元素 -->
  353. <LinkEle ref="linkEleRef" @confirm="confirmLinkEle" />
  354. <!-- 效果预览 -->
  355. <PreviewResult ref="previewResultRef" />
  356. </div>
  357. </template>
  358. <script>
  359. import {getLazytree} from "@/api/manager/wbsprivate";
  360. import ConditionsSet from './ConditionsSet.vue'
  361. import LinkEle from "./LinkEle.vue";
  362. import PreviewResult from './PreviewResult.vue'
  363. import {getPage,getById,add} from "@/api/ruleManage/fileRule.js";
  364. import { getStore, setStore } from "@/util/store";
  365. export default {
  366. components: {
  367. ConditionsSet,
  368. LinkEle,
  369. PreviewResult
  370. },
  371. data() {
  372. return {
  373. id: '',
  374. parentId: '',
  375. tenant_id:'',
  376. projectid:'',
  377. treeId: '',
  378. defaultProps: {
  379. children: "children",
  380. label: "title",
  381. isLeaf: function (data) {
  382. return !data.hasChildren || (data.isExistForm==1);
  383. },
  384. },
  385. defaultExpandedKeys: [],
  386. curreenttid: '',
  387. expandName: this.$route.fullPath,
  388. ruleItemOptions:[
  389. ],
  390. total: 0,
  391. ruleLoading: false,
  392. addDialogVisible:false,
  393. addSaveFileLoad:false,
  394. titleInput:'',
  395. isShowList:true,
  396. currentPage: 1,
  397. pageSize: 40, // 8列 * 5行 = 40
  398. isShowYpList:true,
  399. isShowDetail:false,
  400. ypDetail: {
  401. name: '',
  402. basic: [{ name: '' }, { name: '' }, { name: '' }, { name: '' }]
  403. },
  404. ypRuleForm: {
  405. name: [
  406. { required: true, message: '请输入样品名称', trigger: 'blur' }
  407. ],
  408. },
  409. manageVisible: false,
  410. manageData: [
  411. { name: '规范1' },
  412. { name: '规范2' },
  413. { name: '规范3' },
  414. { name: '规范4' },
  415. { name: '规范5' }
  416. ],
  417. addFileDialogVisible:false,
  418. fileForm:{},
  419. fileList:[],
  420. ypList:[
  421. {id:1,name:'样品名称',
  422. basic:
  423. [{name:'基本信息1'} , {name:'基本信息2'} , {name:'基本信息3'} , {name:'基本信息4'}]
  424. },
  425. ],
  426. jsList:[
  427. {id:1,name:'技术指标名称',
  428. basic:
  429. [{name:'基本信息1'} , {name:'基本信息2'} , {name:'基本信息3'} , {name:'基本信息4'}]
  430. },
  431. ],
  432. isShowJsList:false,
  433. jsDetail: {
  434. name: '',
  435. basic: [{ name: '',select:[] }, ]
  436. },
  437. jsRuleForm: {
  438. name: [
  439. { required: true, message: '请输入技术指标名称', trigger: 'blur' }
  440. ],
  441. },
  442. fqOptions: [
  443. { label: '>', value: '>', },
  444. { label: '=', value: '=', },
  445. { label: '<', value: '<' },
  446. { label: '>=', value: '>=' },
  447. { label: '<=', value: '<=' },
  448. { label: '!=', value: '!=' },
  449. ],
  450. conditionsSetVisible:false//条件设置弹窗是否显示
  451. };
  452. },
  453. computed: {
  454. currentPageData() {
  455. const start = (this.currentPage - 1) * this.pageSize
  456. const end = start + this.pageSize
  457. return this.ruleItemOptions.slice(start, end)
  458. }
  459. },
  460. created(){
  461. console.log(this.$route.query,'this.$route.query;');
  462. const { id, tenant_id,projectid} = this.$route.query;
  463. this.id = id;
  464. this.parentId = 0;
  465. this.tenant_id = tenant_id;
  466. this.projectid = projectid;
  467. this.defaultExpandedKeys = getStore({ name: this.expandName });
  468. this.curreenttid= getStore({ name:'curreenttid' });
  469. if (this.curreenttid) {
  470. this.treeId = this.curreenttid;
  471. this.getRuleItemOptions();
  472. }
  473. },
  474. methods: {
  475. //获取规范文件夹数据
  476. getRuleItemOptions() {
  477. this.ruleLoading = true;
  478. getPage({
  479. privateId:this.treeId,
  480. current:this.currentPage,
  481. size:this.pageSize,
  482. type: 1,
  483. }).then((res) => {
  484. console.log(res,'res');
  485. this.ruleLoading = false;
  486. if (res.data.code === 200) {
  487. this.ruleItemOptions = res.data.data.records;
  488. this.total = res.data.data.total;
  489. } else {
  490. this.ruleItemOptions=[]
  491. this.$message.error(res.data.msg);
  492. }
  493. });
  494. },
  495. handleNodeClick(data,node) {
  496. this.treeId = data.id;
  497. this.getRuleItemOptions()
  498. //获取节点展开路径
  499. this.getExpandedKeys(node);
  500. setStore({
  501. name: 'curreenttid',
  502. content: data.id,
  503. type: true, //sessionStorage
  504. });
  505. },
  506. getExpandedKeys(node) {
  507. //console.log(node)
  508. let expandedKeys = [];
  509. while (node.parent) {
  510. expandedKeys.push(node.data.id);
  511. node = node.parent;
  512. }
  513. setStore({
  514. name: this.expandName,
  515. content: expandedKeys,
  516. type: true, //sessionStorage
  517. });
  518. //console.log(expandedKeys)
  519. },
  520. loadNode(node, resolve) {
  521. let pid = 0;
  522. if (node.level != 0) {
  523. pid = node.data.id;
  524. }
  525. getLazytree(this.id, pid, this.tenant_id, this.projectid, {
  526. wbsType: 2,
  527. }).then((res) => {
  528. let arr = [];
  529. if (Array.isArray(res.data.data)) {
  530. arr = res.data.data;
  531. }
  532. return resolve(arr);
  533. });
  534. },
  535. goBackFirst() {
  536. this.isShowList = true;
  537. this.$router.go(-1);
  538. },
  539. goBack() {
  540. this.isShowList = true;
  541. },
  542. goBack1() {
  543. this.isShowDetail = false;
  544. },
  545. addRule(){
  546. this.titleInput = '';
  547. this.addDialogVisible = true;
  548. },
  549. addSaveFileClick() {
  550. this.addSaveFileLoad = true;
  551. if (!this.titleInput) {
  552. this.$message.error('请输入规范文件夹名称');
  553. this.addSaveFileLoad = false;
  554. return;
  555. }
  556. add(
  557. {
  558. name: this.titleInput,
  559. type:1,
  560. privateId: this.treeId,
  561. }
  562. ).then((res) => {
  563. if(res.data.code==200){
  564. this.$message.success(res.data.msg)
  565. this.addDialogVisible=false
  566. this.getRuleItemOptions();
  567. }else{
  568. this.$message.error(res.data.msg)
  569. }
  570. }).finally(() => {
  571. this.saveBatchLoading = false;
  572. });
  573. },
  574. ruleDetailClick(){
  575. this.isShowList = false;
  576. },
  577. ruleDetailClick1(){
  578. this.isShowDetail = true;
  579. },
  580. addFile(){
  581. console.log(this.treeId,'this.treeId');
  582. //新增规范文件
  583. this.addFileDialogVisible = true;
  584. },
  585. handleCurrentChange(val) {
  586. this.currentPage = val
  587. },
  588. handleSizeChange(val) {
  589. this.pageSize = val
  590. this.currentPage = 1
  591. },
  592. addYp(){
  593. this.isShowYpList = false;
  594. this.isShowJsList = false;
  595. },
  596. showYpList() {
  597. this.isShowYpList = true;
  598. },
  599. // 添加基础信息行
  600. addBasicInfo() {
  601. this.ypDetail.basic.push({ name: '' });
  602. },
  603. // 删除基础信息行
  604. removeBasicInfo(index) {
  605. this.ypDetail.basic.splice(index, 1);
  606. },
  607. // 管理文件夹
  608. manageFolder(){
  609. this.manageVisible = true;
  610. },
  611. delManange(index){
  612. this.$confirm('删除后,数据将无法恢复,是否确认删除!', '提示', {
  613. confirmButtonText: '确定',
  614. cancelButtonText: '取消',
  615. type: 'warning'
  616. }).then(() => {
  617. this.manageData.splice(index, 1);
  618. })
  619. },
  620. handleEdit(item, index) {
  621. // 处理编辑逻辑
  622. console.log('编辑项目:', item, index);
  623. },
  624. handleDelete(index) {
  625. this.$confirm('删除后,数据无法恢复,是否确认删除?', '删除确认', {
  626. confirmButtonText: '确定',
  627. cancelButtonText: '取消',
  628. type: 'warning'
  629. }).then(() => {
  630. this.ypList.splice(index, 1);
  631. this.$message.success('删除成功');
  632. }).catch(() => {});
  633. },
  634. handleEdit1(item, index) {
  635. // 处理编辑逻辑
  636. console.log('编辑项目:', item, index);
  637. },
  638. handleDelete1(index) {
  639. this.$confirm('删除后,数据无法恢复,是否确认删除?', '删除确认', {
  640. confirmButtonText: '确定',
  641. cancelButtonText: '取消',
  642. type: 'warning'
  643. }).then(() => {
  644. this.jsList.splice(index, 1);
  645. this.$message.success('删除成功');
  646. }).catch(() => {});
  647. },
  648. //新增技术指标
  649. addJs(){
  650. this.isShowJsList = true;
  651. this.isShowYpList = false;
  652. },
  653. addBasicInfo1() {
  654. this.jsDetail.basic.push({ name: '' });
  655. },
  656. // 删除基础信息行
  657. removeBasicInfo1(index) {
  658. this.jsDetail.basic.splice(index, 1);
  659. },
  660. //条件设置
  661. conditionsSet(){
  662. if(this.jsDetail.basic[0].name === ''|| this.jsDetail.basic[0].select.length === 0) {
  663. this.$message.error('请先添加技术指标内容');
  664. return;
  665. }
  666. this.$refs.conditionsSetRef.show(this.jsDetail.basic)
  667. },
  668. // 添加确认取消处理方法
  669. handleConditionsConfirm() {
  670. console.log('确认条件设置')
  671. },
  672. handleConditionsCancel() {
  673. console.log('取消条件设置')
  674. },
  675. //关联元素
  676. linkEle() {
  677. if(this.jsDetail.basic[0].name === ''|| this.jsDetail.basic[0].select.length === 0) {
  678. this.$message.error('请先添加技术指标内容');
  679. return;
  680. }
  681. this.$refs.linkEleRef.show(this.jsDetail.basic, this.treeId,this.id, this.projectid);
  682. },
  683. confirmLinkEle() {
  684. console.log('确认关联元素')
  685. },
  686. //效果预览
  687. previewRes() {
  688. this.$refs.previewResultRef.show()
  689. }
  690. }
  691. }
  692. </script>
  693. <style scoped lang="scss">
  694. .container-box {
  695. height: calc(100vh - 120px);
  696. box-sizing: border-box;
  697. }
  698. .h-100 {
  699. height: 100%;
  700. }
  701. .tree-container {
  702. height: calc(100vh - 120px);
  703. overflow-y: auto;
  704. }
  705. .box-card {
  706. display: flex;
  707. flex-direction: column;
  708. height: 100%;
  709. // 内容区域
  710. .el-card__body {
  711. flex: 1;
  712. display: flex;
  713. flex-direction: column;
  714. overflow: hidden;
  715. }
  716. }
  717. .rule-box{
  718. width: 100%;
  719. display: grid;
  720. grid-template-columns: repeat(8, 1fr);
  721. grid-template-rows: repeat(4, 1fr);
  722. gap: 50px;
  723. padding: 20px;
  724. height: 600px;
  725. overflow-y:hidden;
  726. .rule-box-item{
  727. text-align: center;
  728. display: flex;
  729. flex-direction: column;
  730. align-items: center;
  731. }
  732. .rule-box-item-icon {
  733. margin-bottom: 8px;
  734. }
  735. .rule-box-item-title {
  736. font-size: 14px;
  737. width: 100%;
  738. overflow: hidden;
  739. text-overflow: ellipsis;
  740. white-space: nowrap;
  741. }
  742. }
  743. .input-container {
  744. display: flex;
  745. align-items: center;
  746. }
  747. .input-container span {
  748. margin-right: 10px; /* 根据需要调整间距 */
  749. }
  750. .box-card-title{
  751. font-weight: bolder;
  752. font-size: 24px;
  753. }
  754. .box-card-content1{
  755. margin-top: 10px;
  756. display: flex;
  757. justify-content: space-between;
  758. width: 100%;
  759. .box-card-content1-left{
  760. display: flex;
  761. .box-card-content1-left-item{
  762. margin-right: 25px;
  763. }
  764. }
  765. }
  766. .box-card-content2{
  767. margin-top: 10px;
  768. .box-card-content2-title{
  769. color: rgba(130, 130, 130, 1);
  770. font-size: 10px;;
  771. width: 98%;
  772. padding-left: 20px;
  773. font-size: 18px;
  774. line-height: 40px;
  775. background: rgb(240, 240, 240);
  776. .title-container {
  777. display: flex;
  778. justify-content: space-between;
  779. align-items: center;
  780. padding-right: 20px;
  781. i {
  782. cursor: pointer;
  783. font-size: 22px;
  784. color: #2550A2;
  785. // 添加过渡效果
  786. &:hover {
  787. color: #409EFF;
  788. }
  789. }
  790. }
  791. }
  792. }
  793. .box-card-content2-bottom{
  794. margin-top: 20px;
  795. }
  796. .add-yp-title{
  797. font-size: 20px;
  798. font-weight: bold;
  799. padding: 10px;
  800. display: flex;
  801. justify-content: space-between;
  802. }
  803. .input-with-icon {
  804. display: flex;
  805. align-items: center;
  806. margin-bottom: 15px;
  807. .el-input {
  808. flex: 1;
  809. }
  810. i {
  811. margin-left: 10px;
  812. font-size: 20px;
  813. cursor: pointer;
  814. &.el-icon-circle-plus-outline {
  815. color: #409EFF;
  816. &:hover {
  817. color: #66b1ff;
  818. }
  819. }
  820. &.el-icon-remove-outline {
  821. color: #F56C6C;
  822. &:hover {
  823. color: #f78989;
  824. }
  825. }
  826. }
  827. }
  828. .add-yp-detail{
  829. flex: 1;
  830. overflow-y: auto;
  831. padding: 20px;
  832. height: calc(100vh - 342px); /* 减去标题和底部按钮的高度 */
  833. }
  834. // 新增底部按钮容器样式
  835. .add-yp-footer {
  836. display: flex;
  837. justify-content: center;
  838. padding: 20px 0;
  839. // 可选: 添加上边框
  840. border-top: 1px solid #EBEEF5;
  841. }
  842. .box-card-content2-list{
  843. margin-top: 20px;
  844. max-height: 300px;
  845. overflow-y: auto;
  846. .eg{
  847. color:rgba(37, 80, 162, 1);
  848. margin-right: 10px;
  849. }
  850. .box-card-content2-list-item{
  851. height: 80px;
  852. padding: 10px;
  853. border: 2px solid #EBEEF5;
  854. margin-bottom: 10px;
  855. }
  856. .box-card-content2-list-item-list{
  857. display: flex;
  858. margin-top: 20px;
  859. align-items: center;
  860. position: relative;
  861. .operation-icons {
  862. position: absolute;
  863. right: 10px;
  864. top: 10px;
  865. display: flex;
  866. gap: 10px;
  867. i {
  868. cursor: pointer;
  869. font-size: 16px;
  870. &.el-icon-edit {
  871. color: #409EFF;
  872. &:hover {
  873. color: #66b1ff;
  874. }
  875. }
  876. &.el-icon-delete {
  877. color: #F56C6C;
  878. &:hover {
  879. color: #f78989;
  880. }
  881. }
  882. }
  883. }
  884. .basic-info{
  885. color: gray;
  886. font-size: 14px;
  887. }
  888. .box-card-content2-list-item-list-basic{
  889. display: flex;
  890. margin-left: 10px;
  891. width: 100%;
  892. overflow-x: auto;
  893. flex: 1;
  894. .basic-item-info{
  895. margin-right: 10px;
  896. margin-right: 20px;
  897. flex-shrink: 0; // 防止项目被压缩
  898. }
  899. }
  900. }
  901. }
  902. .empty-container{
  903. height: 600px;
  904. }
  905. </style>