CustomModelDialog.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. <template>
  2. <el-dialog
  3. :title="modelTitle ? modelTitle : '自定义模型'"
  4. :visible.sync="outerDialogVisible"
  5. width="750px"
  6. center
  7. >
  8. <el-dialog
  9. title="请输入模型名称"
  10. width="20%"
  11. :visible="innerDialogVisible"
  12. append-to-body
  13. center
  14. ><div class="model-name">
  15. <div class="model-name-title">名称 :</div>
  16. <el-input v-model="inputName" placeholder="请输入模型名称"></el-input>
  17. </div>
  18. <span slot="footer" class="dialog-footer">
  19. <el-button @click="innerDialogVisible = false">取 消</el-button>
  20. <el-button type="primary" @click="confirm()">确认</el-button>
  21. </span>
  22. </el-dialog>
  23. <div class="transfer-container">
  24. <div class="transfer-container-left">
  25. <div class="search">
  26. <el-input
  27. v-model="filterText"
  28. placeholder="请输入搜索内容"
  29. ></el-input>
  30. </div>
  31. <div class="tree">
  32. <el-tree
  33. :default-expanded-keys="checkedList"
  34. :data="transferData"
  35. :props="defaultProps"
  36. @check-change="transferCheckChange"
  37. ref="transferTree"
  38. node-key="id"
  39. :filter-node-method="filterNode"
  40. >
  41. <span class="custom-tree-node" slot-scope="{ node }">
  42. <template
  43. v-if="
  44. node.data.mainType === '所有图层' ||
  45. node.data.mainType === '预设模型'
  46. "
  47. >
  48. <el-checkbox v-model="node.checked" style="position: relative"
  49. >{{ node.label }}
  50. </el-checkbox>
  51. </template>
  52. <template v-else>
  53. <div
  54. :class="{
  55. 'tree-arrow': !node.expanded,
  56. 'tree-arrow-expanded': node.expanded,
  57. }"
  58. ></div>
  59. <span>{{ node.label }}</span>
  60. </template>
  61. </span>
  62. </el-tree>
  63. </div>
  64. </div>
  65. <div class="transfer-container-center">
  66. <div class="inner">
  67. <el-tooltip
  68. effect="light"
  69. :content="
  70. isLeftTransferBtn ? '移除不需要的图层' : '不可进行移除操作'
  71. "
  72. placement="top-end"
  73. >
  74. <el-button
  75. size="normal"
  76. type="primary"
  77. icon="el-icon-arrow-left"
  78. @click="deleteCheckList"
  79. id="leftArrowBtn"
  80. class="inner-left"
  81. :class="{ 'allow-cursor': isLeftTransferBtn }"
  82. ></el-button>
  83. </el-tooltip>
  84. <el-tooltip
  85. effect="light"
  86. :content="isRightTransferBtn ? '添加选中图层' : '不可进行添加操作'"
  87. placement="top-end"
  88. >
  89. <el-button
  90. size="normal"
  91. type="primary"
  92. icon="el-icon-arrow-right"
  93. @click="addCheckList"
  94. class="inner-right"
  95. :class="{ 'allow-cursor': isRightTransferBtn }"
  96. ></el-button>
  97. </el-tooltip>
  98. </div>
  99. </div>
  100. <div class="transfer-container-right">
  101. <el-checkbox-group v-model="checkedList">
  102. <div class="inner-group" v-for="item in checkArr" :key="item">
  103. <el-checkbox :key="item" :label="item"></el-checkbox>
  104. </div>
  105. </el-checkbox-group>
  106. </div>
  107. </div>
  108. <div
  109. v-if="overlayBtnShow"
  110. class="overlay-container"
  111. :class="{ forbidden: forbidOverlayBtn }"
  112. @click="executeOverlay"
  113. >
  114. <div
  115. class="overlay-container-icon"
  116. :class="{ checked: overlayBtnChecked }"
  117. ></div>
  118. <div
  119. class="overlay-container-btn"
  120. :class="{ checked: overlayBtnChecked }"
  121. >
  122. 叠置分析
  123. </div>
  124. </div>
  125. <span slot="footer" class="dialog-footer">
  126. <el-button @click="clearDialogVisible()">取 消</el-button>
  127. <el-button type="primary" @click="saveModel()">保存模型</el-button>
  128. </span>
  129. </el-dialog>
  130. </template>
  131. <script>
  132. import publicFun from "@/utils/publicFunction.js";
  133. /**
  134. * 底部菜单(自定义模型)组件
  135. * @author: Gao Lu
  136. * @Date: 2022.11.22
  137. */
  138. export default {
  139. name: "CustomModelDialog",
  140. components: {},
  141. data() {
  142. return {
  143. uploadBaseUrl: "/dms",
  144. classTextToIndex: {},
  145. overlayBtnChecked: false,
  146. outerDialogVisible: false,
  147. innerDialogVisible: false,
  148. overlayBtnShow: false,
  149. modelTitle: null,
  150. inputName: "自定义模型1",
  151. checkArr: [],
  152. checkedList: [],
  153. defaultProps: {
  154. children: "children",
  155. label: "label",
  156. },
  157. transferData: [],
  158. filterText: "",
  159. createModelParams: {
  160. title: "",
  161. content: "",
  162. // 叠置分析geojson附件
  163. // c_dzfx_file: "",
  164. // 类型 -- 公开:1; 私人: 0
  165. c_level: "1",
  166. // 是否叠置分析
  167. c_isOverlay: false,
  168. // 绑定图层(json图层数组)
  169. c_bind_layer: "",
  170. // 用户id
  171. c_user_id: "",
  172. },
  173. checkedKeysArr: [],
  174. isLeftTransferBtn: false,
  175. isRightTransferBtn: false,
  176. allowStyle: {
  177. cursor: "not-allowed",
  178. },
  179. notAllowedStyle: {
  180. cursor: "pointer",
  181. },
  182. currentModifiedModelId: "",
  183. currentOverlayFile: "",
  184. forbidOverlayBtn: "",
  185. };
  186. },
  187. watch: {
  188. checkedKeysArr: {
  189. handler(val) {
  190. if (val.length === 0) {
  191. this.isRightTransferBtn = false;
  192. }
  193. if (val.length > 0) {
  194. this.isRightTransferBtn = true;
  195. }
  196. },
  197. immediate: true,
  198. },
  199. checkedList(val) {
  200. let btn = document.getElementById("leftArrowBtn");
  201. if (btn) {
  202. if (val.length === this.checkArr.length) {
  203. this.isLeftTransferBtn = false;
  204. }
  205. if (val.length < this.checkArr.length) {
  206. this.isLeftTransferBtn = true;
  207. }
  208. }
  209. // console.log(val, "checkedList");
  210. },
  211. },
  212. created() {
  213. this.checkedKeysArr = [];
  214. this.getColumnList();
  215. // DMS - 任务类型
  216. // 水资源审计 - 2;林地资源审计 - 3;生态资源审计 - 4; 土地资源审计 - 1
  217. this.classDictQuery("0", "c_task_type", "任务类型");
  218. // DMS - 浦东行政区划
  219. this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
  220. },
  221. mounted() {
  222. // 监听自定义模型
  223. this.$bus.$off("customModelEvent");
  224. this.$bus.$on("customModelEvent", () => {
  225. this.customModelEvent();
  226. });
  227. // 监听模型修改事件
  228. this.$bus.$off("updateModel");
  229. this.$bus.$on("updateModel", (node) => {
  230. // console.log("监听模型中");
  231. this.overlayBtnChecked = false;
  232. // console.log(node, "节点数据");
  233. if (node.data.c_dzfx_file) {
  234. // console.log("已有叠置分析结果");
  235. this.forbidOverlayBtn = true;
  236. }
  237. if (!node.data.c_dzfx_file) {
  238. // console.log("未进行叠置分析");
  239. this.forbidOverlayBtn = false;
  240. }
  241. this.currentModifiedModelId = node.data.id;
  242. this.currentOverlayFile = node.data.c_dzfx_file;
  243. // console.log(this.currentModifiedModelId, "currentModifiedModelId");
  244. // console.log(this.currentOverlayFile, "currentOverlayFile");
  245. this.$nextTick(() => {
  246. if (this.$refs.transferTree) {
  247. this.$refs.transferTree.setCheckedKeys([]);
  248. }
  249. });
  250. this.checkedKeysArr = [];
  251. this.checkArr = [];
  252. this.checkedList = [];
  253. this.outerDialogVisible = true;
  254. if (node.data.c_bind_layer) {
  255. let bindLayerArr = JSON.parse(node.data.c_bind_layer);
  256. // console.log(bindLayerArr, "c_bind_layer");
  257. if (bindLayerArr.length > 0) {
  258. this.checkArr = bindLayerArr;
  259. this.checkedList = bindLayerArr;
  260. this.checkedKeysArr = bindLayerArr;
  261. this.$nextTick(() => {
  262. if (this.$refs.transferTree) {
  263. this.$refs.transferTree.setCheckedKeys(this.checkedList);
  264. }
  265. });
  266. }
  267. }
  268. // this.checkedList = node.data.data;
  269. this.inputName = node.data.label;
  270. this.overlayBtnShow = true;
  271. this.modelTitle = node.data.label;
  272. this.$store.state.modelStatus = "modify";
  273. });
  274. },
  275. beforeDestroyed() {
  276. // 当容器销毁时,需要停止监听该事件
  277. this.$bus.$off("customModelEvent");
  278. this.$bus.$off("updateModel");
  279. this.overlayBtnShow = false;
  280. },
  281. methods: {
  282. classDictQuery(type, cName, keyName) {
  283. let params = new FormData();
  284. params = {
  285. type: type,
  286. cName: cName,
  287. };
  288. this.$Post(this.urlsCollection.selectByCNameAType, params).then((res) => {
  289. if (res.code === 200 && res.content.length > 0) {
  290. this.classTextToIndex[keyName] = new Map();
  291. res.content.forEach((v) => {
  292. this.classTextToIndex[keyName].set(v.name, v.index + "");
  293. });
  294. // console.log(this.classTextToIndex[keyName], keyName);
  295. }
  296. });
  297. },
  298. getColumnList() {
  299. this.transferData = [];
  300. this.$Post(this.urlsCollection.getColumnList).then((res) => {
  301. if (res.code === 200 && res.content.length > 0) {
  302. let data = res.content.map((item1) => {
  303. if (item1.title === "所有图层" && item1.columnList.length > 0) {
  304. return {
  305. id: `${item1.title}_${item1.id}`,
  306. label: item1.title,
  307. // 镇
  308. children:
  309. item1.columnList.length === 0
  310. ? []
  311. : item1.columnList.map((item2) => {
  312. return {
  313. id: `${item2.title}_${item2.id}`,
  314. label: item2.title,
  315. // 水资源,土地资源,林地资源
  316. children:
  317. item2.columnList.length === 0
  318. ? []
  319. : item2.columnList.map((item3) => {
  320. return {
  321. id: `${item3.title}_${item3.id}`,
  322. label: item3.title,
  323. tag: item3.tag,
  324. children:
  325. item3.columnList.length === 0
  326. ? []
  327. : item3.columnList.map((item4) => {
  328. return {
  329. id: `${item4.title}_${item4.id}`,
  330. label: item4.title,
  331. children: [],
  332. columnId: item4.id,
  333. modelName: item4.modelName,
  334. modelId: item4.modelId,
  335. tag: item4.tag,
  336. type: item3.title,
  337. town: item2.title,
  338. mainType: item1.title,
  339. };
  340. }),
  341. };
  342. }),
  343. };
  344. }),
  345. };
  346. }
  347. if (item1.title === "预设模型" && item1.columnList.length > 0) {
  348. return {
  349. id: `${item1.title}_${item1.id}`,
  350. label: item1.title,
  351. children:
  352. item1.columnList.length === 0
  353. ? []
  354. : item1.columnList.map((item2) => {
  355. return {
  356. id: `${item2.title}_${item2.id}`,
  357. label: item2.title,
  358. children:
  359. item2.columnList.length === 0
  360. ? []
  361. : item2.columnList.map((item3) => {
  362. return {
  363. id: `${item3.title}_${item3.id}`,
  364. label: item3.title,
  365. children: [],
  366. mainType: item1.title,
  367. columnId: item3.id,
  368. };
  369. }),
  370. };
  371. }),
  372. };
  373. }
  374. });
  375. data.forEach((c) => {
  376. if (c) {
  377. this.transferData.unshift(c);
  378. }
  379. });
  380. }
  381. });
  382. },
  383. transferCheckChange(data, checked) {
  384. if (data.mainType === "预设模型" || data.mainType === "所有图层") {
  385. if (checked) {
  386. if (!this.checkedKeysArr.includes(data.id)) {
  387. this.checkedKeysArr.push(data.id);
  388. }
  389. // 判断图层是否有权限
  390. if (data.mainType === "所有图层") {
  391. let searchParam = [];
  392. let targetTown = this.classTextToIndex["浦东新区行政区划"].get(
  393. data.town
  394. );
  395. let targetType = this.classTextToIndex["任务类型"].get(
  396. data.type + "审计"
  397. );
  398. let paramUser = {
  399. field: "c_user_id",
  400. searchType: "2",
  401. content: {
  402. value: localStorage.getItem("USER_ID"),
  403. },
  404. };
  405. searchParam.push(paramUser);
  406. let paramTown = {
  407. field: "c_area_code",
  408. searchType: "1",
  409. content: {
  410. value: targetTown,
  411. },
  412. };
  413. searchParam.push(paramTown);
  414. let paramType = {
  415. field: "c_task_type",
  416. searchType: "1",
  417. content: {
  418. value: targetType,
  419. },
  420. };
  421. searchParam.push(paramType);
  422. let params = new FormData();
  423. // dms - 我的任务
  424. params = {
  425. columnId: 48,
  426. states: "2,3",
  427. pageSize: 10,
  428. page: 0,
  429. search: JSON.stringify(searchParam),
  430. };
  431. this.$Post(this.urlsCollection.selectContentList, params)
  432. .then((res) => {
  433. if (res.code === 202 && res.content === "数据不存在") {
  434. this.$message.info("当前图层无权限!");
  435. layerAuthorityMap.set(data.id, "无权限");
  436. }
  437. if (res.code === 200 && res.content.data.length > 0) {
  438. layerAuthorityMap.set(data.id, "有权限");
  439. // console.log("有权限");
  440. }
  441. })
  442. .catch((err) => {
  443. console.log(err, "接口请求失败,我的任务 - selectContentList");
  444. });
  445. }
  446. if (data.mainType === "预设模型") {
  447. layerAuthorityMap.set(data.id, "有权限");
  448. }
  449. } else {
  450. if (this.checkedKeysArr.includes(data.id)) {
  451. this.checkedKeysArr = this.checkedKeysArr.filter((v) => {
  452. return v !== data.id;
  453. });
  454. }
  455. }
  456. }
  457. },
  458. // 添加模型
  459. addModel() {
  460. // 设置需要添加的参数
  461. this.createModelParams.title = this.inputName;
  462. this.createModelParams.content = this.inputName;
  463. this.createModelParams.c_user_id = localStorage.getItem("USER_ID") || 4;
  464. let newData = this.checkedList.filter((v) => {
  465. if (layerAuthorityMap.has(v) && layerAuthorityMap.get(v) === "有权限") {
  466. return v;
  467. }
  468. });
  469. // console.log(newData, "可以进行叠置分析的图层");
  470. this.createModelParams.c_bind_layer = JSON.stringify(newData);
  471. let params = new FormData();
  472. params = {
  473. columnId: 49,
  474. modelId: 53,
  475. content: JSON.stringify(this.createModelParams),
  476. };
  477. this.$Post(this.urlsCollection.addContent, params)
  478. .then((res) => {
  479. // console.log(res, "保存自定义模型的res");
  480. if (res.code === 200) {
  481. this.$message.success("模型已保存");
  482. this.$store.state.customModelsArr.push({
  483. name: this.inputName,
  484. data: this.checkedList,
  485. });
  486. this.clearDialogVisible();
  487. }
  488. })
  489. .catch(() => {
  490. this.$message.info("模型保存失败");
  491. });
  492. },
  493. // 修改模型 -- 直接调用修改模型接口
  494. modifyModel(type, bindData) {
  495. // console.log("这一步是修改模型");
  496. // console.log(this.currentModifiedModelId, "model id");
  497. let obj = {
  498. id: this.currentModifiedModelId,
  499. title: this.inputName,
  500. content: this.inputName,
  501. c_level: "1",
  502. c_bind_layer: JSON.stringify(bindData),
  503. c_user_id: localStorage.getItem("USER_ID"),
  504. };
  505. let modifyParams = new FormData();
  506. modifyParams = {
  507. columnId: 49,
  508. modelId: 53,
  509. content: JSON.stringify(obj),
  510. };
  511. this.$Post(this.urlsCollection.updateContent, modifyParams).then(
  512. (res) => {
  513. if (res.code === 200) {
  514. this.$store.state.customModelsArr.filter((v) => {
  515. return v.name !== this.inputName;
  516. });
  517. this.$store.state.customModelsArr.push({
  518. name: this.inputName,
  519. data: bindData,
  520. });
  521. this.clearDialogVisible();
  522. if (type === "alreadyOverlay") {
  523. this.$message.success("系统已完成叠置分析,数据已保存!");
  524. }
  525. if (type === "notOverlay") {
  526. this.$message.success("模型修改成功");
  527. }
  528. }
  529. }
  530. );
  531. },
  532. deleteCheckList() {
  533. if (
  534. this.checkedList.length < this.checkArr.length &&
  535. this.isLeftTransferBtn
  536. ) {
  537. this.checkArr = this.checkedList;
  538. this.isLeftTransferBtn = false;
  539. }
  540. },
  541. addCheckList() {
  542. this.$nextTick(() => {
  543. if (this.$refs.transferTree) {
  544. this.checkArr = [];
  545. this.checkedList = [];
  546. this.checkArr = this.checkedKeysArr;
  547. this.checkedList = this.checkedKeysArr;
  548. }
  549. });
  550. },
  551. // 节点过滤事件
  552. filterNode(value, data) {
  553. if (!value) return true;
  554. return data.label.indexOf(value) !== -1;
  555. },
  556. // 弹窗关闭时询问
  557. handleClose() {
  558. // if (this.outerDialogVisible) {
  559. // this.$confirm("").then(() => {
  560. // this.clearDialogVisible();
  561. // });
  562. // }
  563. },
  564. clearDialogVisible() {
  565. this.outerDialogVisible = false;
  566. this.innerDialogVisible = false;
  567. },
  568. // 底部按钮自定义模型事件
  569. customModelEvent() {
  570. this.$nextTick((e) => {
  571. if (this.$refs.transferTree) {
  572. this.$refs.transferTree.setCheckedKeys([]);
  573. }
  574. });
  575. this.modelTitle = null;
  576. this.overlayBtnShow = false;
  577. this.$store.state.modelStatus = "create";
  578. this.outerDialogVisible = true;
  579. // console.log(this.$store.state.treeDataCollection, "treeDataCollection");
  580. this.checkedList = [];
  581. this.checkArr = [];
  582. // this.transferCheckedKeys = [];
  583. if (this.$store.state.treeDataCollection.size > 0) {
  584. this.$store.state.treeDataCollection.forEach((v, i) => {
  585. this.checkArr.push(i);
  586. this.checkedList.push(i);
  587. });
  588. this.$nextTick((e) => {
  589. // console.log(this.$refs.transferTree, "this.$refs.transferTre");
  590. this.$refs.transferTree.setCheckedKeys(this.checkedList);
  591. });
  592. }
  593. this.inputName = "自定义模型1";
  594. },
  595. saveModel() {
  596. if (this.checkedList.length < 2) {
  597. this.$message.info("请至少选择两个类型!");
  598. } else {
  599. if (this.$store.state.modelStatus === "create") {
  600. this.innerDialogVisible = true;
  601. } else {
  602. this.confirm();
  603. }
  604. }
  605. },
  606. confirm() {
  607. this.$confirm("确认保存吗?").then(() => {
  608. // modify -- 改变数组类型
  609. if (this.$store.state.modelStatus === "modify") {
  610. let newData = this.checkedList.filter((v) => {
  611. if (
  612. layerAuthorityMap.has(v) &&
  613. layerAuthorityMap.get(v) === "有权限"
  614. ) {
  615. return v;
  616. }
  617. });
  618. this.modifyModel("notOverlay", newData);
  619. }
  620. // console.log(this.$store.state.customModelsArr, "先获取的模型数据");
  621. // create -- 创建新的数组
  622. if (this.$store.state.modelStatus === "create") {
  623. this.addModel();
  624. }
  625. });
  626. },
  627. // 呈现叠置分析的数据
  628. displayOverlayGeometry(url) {
  629. // console.log(url);
  630. this.$Get(url).then((res) => {
  631. // console.log(res, "叠置分析的结果数据");
  632. });
  633. },
  634. // 执行叠置分析
  635. executeOverlay() {
  636. this.overlayBtnChecked = !this.overlayBtnChecked;
  637. if (this.overlayBtnChecked && !this.forbidOverlayBtn) {
  638. // 进行叠置分析后,叠置分析结果会自动保存
  639. // 当前勾选的图层并未自动保存,需要重新调用一次保存接口
  640. let newData = this.checkedList.filter((v) => {
  641. if (
  642. layerAuthorityMap.has(v) &&
  643. layerAuthorityMap.get(v) === "有权限"
  644. ) {
  645. return v;
  646. }
  647. });
  648. let bindLayer = newData.join(",");
  649. let tagretUrl = `${this.urlsCollection.overlayAnalysis}?modelId=${this.currentModifiedModelId}&bindLayer=${bindLayer}`;
  650. this.$Get(tagretUrl).then((res) => {
  651. if (res.code === 200) {
  652. let address = this.uploadBaseUrl + res.content;
  653. this.displayOverlayGeometry(address);
  654. this.modifyModel("alreadyOverlay", newData);
  655. }
  656. });
  657. }
  658. },
  659. },
  660. };
  661. </script>
  662. <style lang="less" scoped>
  663. @commonBorderColor: rgb(0, 170, 255);
  664. .model-name {
  665. // pointer-events: auto;
  666. width: 100%;
  667. height: 100%;
  668. display: flex;
  669. &-title {
  670. width: 30%;
  671. height: 100%;
  672. color: #fff;
  673. font-size: 18px;
  674. line-height: 38px;
  675. display: flex;
  676. align-items: center;
  677. justify-content: center;
  678. }
  679. .el-input {
  680. width: 70%;
  681. }
  682. }
  683. .transfer-container {
  684. width: 700px;
  685. height: 330px;
  686. position: relative;
  687. margin: 0 auto;
  688. color: #fff;
  689. display: flex;
  690. align-items: center;
  691. justify-content: space-around;
  692. &-left {
  693. width: 270px;
  694. height: 320px;
  695. border: 1px solid @commonBorderColor;
  696. border-radius: 5px;
  697. .search {
  698. width: 240px;
  699. height: 40px;
  700. position: absolute;
  701. left: 17px;
  702. top: 10px;
  703. }
  704. .tree {
  705. width: 240px;
  706. height: calc(90% - 40px);
  707. position: absolute;
  708. top: 60px;
  709. left: 10px;
  710. // border: 1px solid peachpuff;
  711. overflow: auto;
  712. .tree-arrow {
  713. position: relative;
  714. top: 0;
  715. left: 0;
  716. display: inline-block;
  717. width: 0px;
  718. height: 0px;
  719. border: 7px solid transparent;
  720. border-left-color: #fff;
  721. }
  722. .tree-arrow-expanded {
  723. position: relative;
  724. top: 4px;
  725. left: -3px;
  726. display: inline-block;
  727. width: 0px;
  728. height: 0px;
  729. border: 7px solid transparent;
  730. border-top-color: #fff;
  731. }
  732. .custom-tree-node {
  733. position: relative;
  734. width: 250px;
  735. // .el-checkbox {
  736. // width: 50%;
  737. // }
  738. .el-checkbox {
  739. width: 50%;
  740. color: #fff;
  741. /deep/.el-checkbox__input.is-checked + .el-checkbox__label {
  742. color: rgba(116, 255, 255, 1);
  743. }
  744. /deep/.el-checkbox__input.is-checked .el-checkbox__inner::after {
  745. width: 70%;
  746. height: 70%;
  747. background: #74ffff;
  748. border-radius: 0;
  749. transform: rotate(0deg) scaleY(1);
  750. position: static;
  751. }
  752. /deep/.el-checkbox__inner {
  753. border: 1px solid #dcdfe6;
  754. background: rgba(0, 170, 255, 0);
  755. display: flex;
  756. align-items: center;
  757. justify-content: center;
  758. position: static;
  759. &::after {
  760. transition: 0ms;
  761. }
  762. }
  763. /deep/.el-checkbox__label {
  764. padding-left: 0;
  765. font-size: 15px;
  766. position: absolute;
  767. top: 1px;
  768. left: 25px;
  769. }
  770. }
  771. }
  772. }
  773. }
  774. &-center {
  775. width: 150px;
  776. height: 320px;
  777. // border: 1px solid yellow;
  778. display: flex;
  779. align-items: center;
  780. justify-content: center;
  781. .inner {
  782. // border: 1px solid black;
  783. width: 150px;
  784. height: 30%;
  785. display: flex;
  786. align-items: center;
  787. justify-content: space-around;
  788. .inner-left {
  789. cursor: not-allowed;
  790. &.allow-cursor {
  791. cursor: pointer;
  792. }
  793. }
  794. .inner-right {
  795. cursor: not-allowed;
  796. &.allow-cursor {
  797. cursor: pointer;
  798. }
  799. }
  800. }
  801. }
  802. &-right {
  803. width: 270px;
  804. height: 320px;
  805. border: 1px solid @commonBorderColor;
  806. border-radius: 5px;
  807. overflow: auto;
  808. }
  809. }
  810. .el-checkbox-group {
  811. width: 100%;
  812. display: flex;
  813. flex-direction: column;
  814. justify-content: flex-start;
  815. align-items: center;
  816. overflow: auto;
  817. height: 310px;
  818. .inner-group {
  819. width: 210px;
  820. height: 30px;
  821. position: relative;
  822. /deep/.el-checkbox {
  823. font-weight: 500;
  824. font-size: 15px;
  825. cursor: pointer;
  826. // width: 10px;
  827. height: 30px;
  828. line-height: 30px;
  829. color: #e6e6e6;
  830. overflow: hidden;
  831. text-overflow: ellipsis;
  832. white-space: nowrap;
  833. position: relative;
  834. left: 0;
  835. .el-checkbox__input.is-checked + .el-checkbox__label {
  836. color: #fff;
  837. }
  838. .el-checkbox__input.is-checked .el-checkbox__inner::after {
  839. width: 70%;
  840. height: 70%;
  841. background: #74ffff;
  842. border-radius: 0;
  843. transform: rotate(0deg) scaleY(1);
  844. position: static;
  845. }
  846. .el-checkbox__inner {
  847. border: 1px solid #dcdfe6;
  848. background: rgba(0, 170, 255, 0);
  849. display: flex;
  850. align-items: center;
  851. justify-content: center;
  852. position: static;
  853. &::after {
  854. transition: 0ms;
  855. }
  856. }
  857. }
  858. /deep/.el-checkbox_label {
  859. width: 200px;
  860. overflow: hidden;
  861. text-overflow: ellipsis;
  862. white-space: nowrap;
  863. }
  864. }
  865. }
  866. // /deep/.el-checkbox_label{
  867. // width: 200px !important;
  868. // }
  869. .overlay-container {
  870. width: 100%;
  871. height: 35px;
  872. border-radius: 4px;
  873. cursor: pointer;
  874. color: #e6e6e6;
  875. border: none;
  876. display: flex;
  877. align-items: center;
  878. justify-content: center;
  879. position: relative;
  880. top: 14px;
  881. &.forbidden {
  882. cursor: not-allowed;
  883. }
  884. &-icon {
  885. width: 25px;
  886. height: 25px;
  887. background: url("../../../assets/image/overlay_white.png") no-repeat center;
  888. &.checked {
  889. background: url("../../../assets/image/overlay.png") no-repeat center;
  890. }
  891. }
  892. &-btn {
  893. width: 80px;
  894. height: 25px;
  895. color: #fff;
  896. display: flex;
  897. align-items: center;
  898. justify-content: center;
  899. &.checked {
  900. color: rgb(0, 170, 255);
  901. }
  902. }
  903. }
  904. </style>