index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. <template>
  2. <div
  3. class="inner-container"
  4. :element-loading-text="saveText"
  5. >
  6. <el-scrollbar class="data-set-scrollbar">
  7. <div class="header">
  8. <el-page-header class="bs-el-page-header">
  9. <template slot="content">
  10. <div class="page-header">
  11. <div class="page-header-left">
  12. {{ !isEdit ? 'JS数据集详情' : dataForm.id ? 'JS数据集编辑' : 'JS数据集新增' }}
  13. </div>
  14. <div class="page-header-right">
  15. <el-button
  16. class="bs-el-button-default"
  17. @click="openNewWindow('https://www.yuque.com/chuinixiongkou/bigscreen/groovy_dataset')"
  18. >
  19. 帮助
  20. </el-button>
  21. <el-button
  22. v-if="isEdit"
  23. type="primary"
  24. @click="save('form')"
  25. >
  26. 保存
  27. </el-button>
  28. <el-button
  29. class="bs-el-button-default"
  30. @click="goBack"
  31. >
  32. 返回
  33. </el-button>
  34. </div>
  35. </div>
  36. </template>
  37. </el-page-header>
  38. </div>
  39. <el-row style="margin: 16px 16px 0;">
  40. <el-col :span="isEdit ? 16 : 24">
  41. <el-form
  42. ref="form"
  43. :model="dataForm"
  44. :rules="rules"
  45. label-width="120px"
  46. style="padding: 16px 16px 0;"
  47. class="bs-el-form"
  48. >
  49. <el-row :gutter="20">
  50. <el-col :span="12">
  51. <el-form-item
  52. label="名称"
  53. prop="name"
  54. >
  55. <el-input
  56. v-model="dataForm.name"
  57. class="bs-el-input"
  58. clearable
  59. :disabled="!isEdit"
  60. />
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="12">
  64. <el-form-item
  65. label="分组"
  66. prop="typeId"
  67. >
  68. <el-select
  69. ref="selectParentName"
  70. v-model="dataForm.typeId"
  71. class="bs-el-select"
  72. popper-class="bs-el-select"
  73. clearable
  74. :disabled="!isEdit"
  75. @clear="clearType"
  76. @visible-change="setCurrentNode"
  77. >
  78. <el-option
  79. style="height: auto;padding: 0;"
  80. :label="typeName"
  81. :value="dataForm.typeId"
  82. >
  83. <div class="tree-box">
  84. <el-tree
  85. ref="categorySelectTree"
  86. :data="categoryData"
  87. node-key="id"
  88. :indent="0"
  89. :props="{ label: 'name', children: 'children' }"
  90. :default-expand-all="true"
  91. :highlight-current="true"
  92. :expand-on-click-node="false"
  93. class="bs-el-tree"
  94. @node-click="selectParentCategory"
  95. >
  96. <span
  97. slot-scope="{ data }"
  98. class="custom-tree-node"
  99. >
  100. <span>
  101. <i
  102. :class="data.children && data.children.length ? 'el-icon el-icon-folder' : 'el-icon el-icon-document'"
  103. />
  104. {{ data.name }}
  105. </span>
  106. </span>
  107. </el-tree>
  108. </div>
  109. </el-option>
  110. </el-select>
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. <el-row :gutter="20">
  115. <el-col :span="12">
  116. <el-form-item
  117. label="描述"
  118. prop="remark"
  119. >
  120. <el-input
  121. v-model="dataForm.remark"
  122. class="bs-el-input"
  123. :disabled="!isEdit"
  124. />
  125. </el-form-item>
  126. </el-col>
  127. </el-row>
  128. </el-form>
  129. <div
  130. v-if="isEdit"
  131. class="sql-config"
  132. >
  133. <div>
  134. <codemirror
  135. ref="targetInSql"
  136. v-model="dataForm.config.script"
  137. :options="codemirrorOption"
  138. style="margin-top: 2px"
  139. />
  140. </div>
  141. <div style="text-align: center; padding: 16px 0;">
  142. <el-button
  143. type="primary"
  144. @click="scriptExecute()"
  145. >
  146. 执行
  147. </el-button>
  148. </div>
  149. </div>
  150. </el-col>
  151. <el-col
  152. v-if="isEdit"
  153. :span="8"
  154. >
  155. <div class="right-setting">
  156. <div class="paramConfig">
  157. <div class="title-style bs-title-style">
  158. 动态参数
  159. <el-button
  160. type="text"
  161. style="float: right;border: none;margin-top: -4px;"
  162. @click="$refs.paramsSettingDialog.open()"
  163. >
  164. 配置
  165. </el-button>
  166. </div>
  167. <div class="field-wrap bs-field-wrap bs-scrollbar">
  168. <div
  169. v-for="param in dataForm.config.paramsList"
  170. :key="param.name"
  171. class="field-item"
  172. @click="$refs.paramsSettingDialog.open()"
  173. >
  174. <span>{{ param.name }}</span>&nbsp;<span
  175. v-show="param.remark"
  176. style="color: #909399;"
  177. >
  178. ({{ param.remark }})
  179. </span>
  180. <el-button
  181. class="edit_field"
  182. type="text"
  183. style="float: right;border: none;margin-top: 2px;"
  184. @click="$refs.paramsSettingDialog.open()"
  185. >
  186. 配置
  187. </el-button>
  188. </div>
  189. </div>
  190. </div>
  191. <div class="structure">
  192. <div class="title-style bs-title-style">
  193. 输出字段
  194. <el-button
  195. type="text"
  196. style="float: right;border: none;margin-top: -4px;"
  197. @click="$refs.outputFieldDialog.open()"
  198. >
  199. 配置
  200. </el-button>
  201. </div>
  202. <div class="field-wrap bs-field-wrap bs-scrollbar">
  203. <div
  204. v-for="(field, key) in outputFieldList"
  205. :key="key"
  206. class="field-item"
  207. @click="$refs.outputFieldDialog.open()"
  208. >
  209. <span>{{ field.fieldName }}</span>&nbsp;
  210. <span
  211. v-show="field.fieldDesc"
  212. style="color: #909399;"
  213. >
  214. ({{ field.fieldDesc }})</span>
  215. <el-button
  216. class="edit_field"
  217. type="text"
  218. style="float: right;border: none;margin-top: 2px;"
  219. @click="$refs.outputFieldDialog.open()"
  220. >
  221. 配置
  222. </el-button>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </el-col>
  228. </el-row>
  229. <div
  230. v-if="isEdit"
  231. class="dataPreView"
  232. style="margin-top: 12px;"
  233. >
  234. <div class="result-view">
  235. 数据预览
  236. </div>
  237. <div
  238. v-loading="tableLoading"
  239. class="bs-table-box is-Edit bs-scrollbar"
  240. >
  241. <el-table
  242. align="center"
  243. :data="dataPreviewList"
  244. max-height="400"
  245. :border="true"
  246. class="bs-el-table bs-scrollbar"
  247. >
  248. <el-table-column
  249. v-for="(value, key) in dataPreviewList[0]"
  250. :key="key"
  251. :label="key"
  252. align="center"
  253. show-overflow-tooltip
  254. :render-header="renderHeader"
  255. >
  256. <template slot-scope="scope">
  257. <span>{{ scope.row[key] }}</span>
  258. </template>
  259. </el-table-column>
  260. </el-table>
  261. </div>
  262. </div>
  263. <div
  264. v-if="!isEdit"
  265. class="dataPreView"
  266. >
  267. <el-tabs v-model="activeName">
  268. <el-tab-pane
  269. v-loading="tableLoading"
  270. label="数据预览"
  271. name="data"
  272. >
  273. <div class="bs-table-box">
  274. <el-table
  275. align="center"
  276. :data="dataPreviewList"
  277. max-height="400"
  278. :border="true"
  279. class="bs-el-table"
  280. >
  281. <el-table-column
  282. v-for="(value, key) in dataPreviewList[0]"
  283. :key="key"
  284. :label="key"
  285. align="center"
  286. show-overflow-tooltip
  287. :render-header="renderHeader"
  288. >
  289. <template slot-scope="scope">
  290. <span>{{ scope.row[key] }}</span>
  291. </template>
  292. </el-table-column>
  293. </el-table>
  294. </div>
  295. </el-tab-pane>
  296. <el-tab-pane
  297. v-loading="tableLoading"
  298. label="数据集结构"
  299. name="structure"
  300. >
  301. <div class="bs-table-box">
  302. <el-table
  303. max-height="400"
  304. :data="outputFieldList"
  305. :border="true"
  306. align="center"
  307. >
  308. <el-table-column
  309. align="center"
  310. show-overflow-tooltip
  311. prop="fieldName"
  312. label="字段值"
  313. />
  314. <el-table-column
  315. align="center"
  316. prop="fieldDesc"
  317. label="字段描述"
  318. >
  319. <template slot-scope="scope">
  320. <el-input
  321. v-if="isEdit"
  322. v-model="scope.row.fieldDesc"
  323. size="small"
  324. class="labeldsc bs-el-input"
  325. />
  326. <span v-else>{{ scope.row.fieldDesc }}</span>
  327. </template>
  328. </el-table-column>
  329. </el-table>
  330. </div>
  331. </el-tab-pane>
  332. </el-tabs>
  333. </div>
  334. <ParamsSettingDialog
  335. ref="paramsSettingDialog"
  336. :params-list="dataForm.config.paramsList"
  337. @saveParams="saveParams"
  338. />
  339. <OutputFieldDialog
  340. ref="outputFieldDialog"
  341. :output-field-list="outputFieldList"
  342. @setFieldList="(list) => { outputFieldList = list }"
  343. />
  344. </el-scrollbar>
  345. <FieldFillDialog
  346. ref="fieldFillDialog"
  347. @fieldDescFill="fieldDescFill"
  348. @fieldDescEdit="fieldDescEdit"
  349. @toSave="toSave"
  350. />
  351. </div>
  352. </template>
  353. <script>
  354. import ParamsSettingDialog from './ParamsSettingDialog.vue'
  355. import OutputFieldDialog from './OutputFieldDialog.vue'
  356. import FieldFillDialog from './FieldFillDialog.vue'
  357. import { nameCheckRepeat, datasetAdd, datasetUpdate, getDataset, getCategoryTree } from 'packages/js/utils/datasetConfigService'
  358. import { codemirror } from 'vue-codemirror'
  359. import 'codemirror/mode/javascript/javascript'
  360. import 'codemirror/lib/codemirror.css'
  361. import 'codemirror/theme/nord.css'
  362. export default {
  363. name: 'JsDataSet',
  364. components: {
  365. codemirror,
  366. FieldFillDialog,
  367. ParamsSettingDialog,
  368. OutputFieldDialog
  369. },
  370. props: {
  371. config: {
  372. type: Object,
  373. default: () => { }
  374. },
  375. isEdit: {
  376. type: Boolean,
  377. default: false
  378. },
  379. datasetId: {
  380. type: String,
  381. default: null
  382. },
  383. typeId: {
  384. type: String,
  385. default: ''
  386. },
  387. appCode: {
  388. type: String,
  389. default: ''
  390. }
  391. },
  392. data () {
  393. const validateName = (rule, value, callback) => {
  394. nameCheckRepeat({
  395. id: this.datasetId,
  396. name: value,
  397. moduleCode: this.appCode
  398. }).then((r) => {
  399. if (r) {
  400. callback(new Error('数据集名称已存在'))
  401. } else {
  402. callback()
  403. }
  404. })
  405. }
  406. return {
  407. dataForm: {
  408. id: '',
  409. name: '',
  410. typeId: '',
  411. remark: '',
  412. config: {
  413. script: '',
  414. paramsList: []
  415. }
  416. },
  417. rules: {
  418. name: [
  419. { required: true, message: '请输入数据集名称', trigger: 'blur' },
  420. { validator: validateName, trigger: 'blur' }
  421. ]
  422. },
  423. codemirrorOption: {
  424. mode: 'text/javascript',
  425. lineNumbers: true,
  426. lineWrapping: true,
  427. theme: 'nord',
  428. extraKey: { Ctrl: 'autocomplete' },
  429. hintOptions: {
  430. completeSingle: true
  431. }
  432. },
  433. activeName: 'data',
  434. dataPreviewList: [],
  435. outputFieldList: [],
  436. structurePreviewListCopy: [],
  437. typeName: '',
  438. categoryData: [],
  439. // fieldDescVisible: false,
  440. fieldsetVisible: false,
  441. paramsVisible: false,
  442. tableLoading: false,
  443. saveloading: false,
  444. saveText: '',
  445. // paramsListCopy: [],
  446. isSet: false, // 参数是否配置状态
  447. passTest: false,
  448. fieldDesc: null // 字段描述
  449. }
  450. },
  451. watch: {
  452. 'dataForm.config.script' (val) {
  453. if (!val) {
  454. this.passTest = false
  455. }
  456. }
  457. },
  458. mounted () {
  459. this.init()
  460. },
  461. methods: {
  462. async init () {
  463. this.categoryData = await getCategoryTree({ tableName: 'dataset', moduleCode: this.appCode })
  464. if (this.typeId) {
  465. this.dataForm.typeId = this.typeId
  466. this.$nextTick(() => {
  467. try {
  468. this.typeName = this.$refs.categorySelectTree.getNode(this.dataForm.typeId).data.name
  469. } catch (error) {
  470. console.error(error)
  471. }
  472. })
  473. }
  474. if (this.datasetId) {
  475. getDataset(this.datasetId).then(res => {
  476. const { id, name, typeId, remark, config } = res
  477. const { script, paramsList, fieldDesc, fieldList } = config
  478. this.dataForm = { id, name, typeId, remark, config: { script, paramsList } }
  479. this.fieldDesc = fieldDesc
  480. this.outputFieldList = fieldList
  481. this.scriptExecute(true)
  482. })
  483. }
  484. },
  485. // 保存数据集
  486. save (formName, nochecktosave = false) {
  487. if (this.passTest === false) {
  488. this.$message.error('请确保脚本不为空且执行通过')
  489. return
  490. }
  491. if (!this.outputFieldList.length) {
  492. this.$message.warning('该执行脚本未生成输出字段,请重新检查')
  493. return
  494. }
  495. if (!nochecktosave) {
  496. const temp = this.outputFieldList.some(item => {
  497. return item.fieldDesc === '' || !item.hasOwnProperty('fieldDesc')
  498. }) // true-存在为空
  499. if (temp) {
  500. this.$refs.fieldFillDialog.open()
  501. // this.fieldDescVisible = true
  502. return
  503. }
  504. }
  505. this.$refs[formName].validate((valid) => {
  506. if (valid) {
  507. this.saveloading = true
  508. this.saveText = '正在保存...'
  509. const { datasetId, dataForm, config, appCode, fieldDesc, outputFieldList } = this
  510. const form = {
  511. id: datasetId,
  512. name: dataForm.name,
  513. typeId: dataForm.typeId,
  514. remark: dataForm.remark,
  515. datasetType: config.datasetType,
  516. moduleCode: appCode,
  517. editable: appCode ? 1 : 0,
  518. config: {
  519. className: config.className,
  520. script: dataForm.config.script,
  521. fieldDesc,
  522. paramsList: dataForm.config.paramsList,
  523. fieldList: outputFieldList
  524. }
  525. }
  526. const datasetSave = this.dataForm.id === '' ? datasetAdd : datasetUpdate
  527. datasetSave(form).then(() => {
  528. this.$message.success('操作成功')
  529. this.$parent.init(false)
  530. this.$parent.setType = null
  531. this.saveloading = false
  532. this.saveText = ''
  533. }).catch(() => {
  534. this.saveloading = false
  535. this.saveText = ''
  536. })
  537. }
  538. })
  539. },
  540. saveParams (val) {
  541. this.dataForm.config.paramsList = val
  542. },
  543. // 取消操作
  544. // cancelField () {
  545. // this.structurePreviewListCopy = cloneDeep(this.outputFieldList)
  546. // this.fieldsetVisible = false
  547. // },
  548. // 设置输出字段
  549. setField () {
  550. // this.outputFieldList = cloneDeep(this.structurePreviewListCopy)
  551. // if (this.outputFieldList.length) {
  552. // this.fieldDesc = {}
  553. // this.outputFieldList.forEach(key => {
  554. // this.fieldDesc[key.fieldName] = key.fieldDesc
  555. // })
  556. // } else {
  557. // this.fieldDesc = null
  558. // }
  559. // this.fieldsetVisible = false
  560. },
  561. // 字段值填充
  562. fieldDescFill () {
  563. this.fieldDesc = {}
  564. this.outputFieldList.forEach(field => {
  565. if (field.fieldDesc === '' || !field.hasOwnProperty('fieldDesc')) {
  566. field.fieldDesc = field.fieldName
  567. this.fieldDesc[field.fieldName] = field.fieldName
  568. } else {
  569. this.fieldDesc[field.fieldName] = field.fieldDesc
  570. }
  571. })
  572. this.save('form')
  573. this.$refs.fieldFillDialog.close()
  574. // this.fieldDescVisible = false
  575. },
  576. // 进入编辑
  577. fieldDescEdit () {
  578. this.$refs.fieldFillDialog.close()
  579. // this.fieldDescVisible = false
  580. this.fieldsetVisible = true
  581. },
  582. // 继续保存
  583. toSave () {
  584. this.fieldDesc = {}
  585. this.outputFieldList.forEach(field => {
  586. this.fieldDesc[field.fieldName] = field.fieldDesc
  587. })
  588. this.save('form', true)
  589. this.$refs.fieldFillDialog.close()
  590. // this.fieldDescVisible = false
  591. },
  592. // 字段描述构建及同步
  593. buildFieldDesc () {
  594. const fieldDesc = {}
  595. this.outputFieldList.forEach(field => {
  596. if (this.fieldDesc.hasOwnProperty(field.fieldName)) {
  597. field.fieldDesc = this.fieldDesc[field.fieldName]
  598. }
  599. fieldDesc[field.fieldName] = field.fieldDesc
  600. })
  601. this.fieldDesc = fieldDesc
  602. },
  603. // 脚本执行
  604. scriptExecute (isInit = false) {
  605. if (this.dataForm.config.script) {
  606. const javascript = this.dataForm.config.script
  607. let scriptMethod = null
  608. try {
  609. const scriptAfterReplacement = javascript.replace(/\${(.*?)}/g, (match, p) => {
  610. return `'${this.dataForm.config.paramsList.find(param => param.name === p).value}'`
  611. })
  612. // eslint-disable-next-line no-new-func
  613. scriptMethod = new Function(scriptAfterReplacement)
  614. } catch (error) {
  615. this.passTest = false
  616. this.$message.error(`脚本执行错误,请检查脚本,具体错误:${error}`)
  617. return
  618. }
  619. // 调用方法生成随机数据
  620. const returnResult = scriptMethod()
  621. // 检查数据是否为数组
  622. if (!Array.isArray(returnResult)) {
  623. this.passTest = false
  624. this.$message.error('脚本执行结果不是数组,请检查脚本')
  625. return
  626. }
  627. const keys = []
  628. returnResult.forEach(item => {
  629. Object.keys(item).forEach(key => {
  630. if (!keys.includes(key)) {
  631. keys.push(key)
  632. }
  633. })
  634. })
  635. if (this.outputFieldList.length === 0) {
  636. this.outputFieldList = keys.map(item => {
  637. return {
  638. fieldName: item,
  639. fieldDesc: ''
  640. }
  641. })
  642. }
  643. // 如果脚本有变化,生成的keys和outputFieldList的长度不一致,就重新生成outputFieldList,仅添加变化的那个字段,其余的不变化
  644. if (this.outputFieldList.length !== keys.length) {
  645. const newKeys = keys.filter(item => {
  646. return !this.outputFieldList.some(key => {
  647. return key.fieldName === item
  648. })
  649. })
  650. newKeys.forEach(item => {
  651. this.outputFieldList.push({
  652. fieldName: item,
  653. fieldDesc: ''
  654. })
  655. })
  656. }
  657. if (this.outputFieldList.length && this.fieldDesc && !isInit) {
  658. this.buildFieldDesc()
  659. }
  660. // 如果有数据,就通过测试
  661. if (this.outputFieldList.length > 0) {
  662. // this.structurePreviewListCopy = cloneDeep(this.outputFieldList)
  663. this.dataPreviewList = returnResult
  664. this.passTest = true
  665. if (!isInit) {
  666. this.$message.success('脚本执行通过')
  667. }
  668. } else {
  669. this.passTest = false
  670. }
  671. } else {
  672. this.passTest = false
  673. this.$message.error('请填写脚本')
  674. }
  675. },
  676. // 执行事件
  677. // toExecute () {
  678. // if (this.dataForm.config.paramsList.length) {
  679. // this.isSet = false
  680. // this.paramsVisible = true
  681. // } else {
  682. // 无参数,直接执行脚本
  683. // this.scriptExecute()
  684. // }
  685. // },
  686. // 清空分类
  687. clearType () {
  688. this.typeName = ''
  689. this.dataForm.typeId = ''
  690. },
  691. // 分类展开高亮
  692. setCurrentNode ($event) {
  693. if ($event) {
  694. const key = this.dataForm.typeId || null
  695. this.$refs.categorySelectTree.setCurrentKey(key)
  696. }
  697. },
  698. // openParamsSetting () {
  699. // this.$refs.paramsSettingDialog.open()
  700. // },
  701. // 分类选择
  702. selectParentCategory (value) {
  703. this.dataForm.typeId = value.id
  704. this.typeName = value.name
  705. this.$refs.selectParentName.blur()
  706. },
  707. goBack () {
  708. this.$emit('back')
  709. },
  710. renderHeader (h, { column, index }) {
  711. const labelLong = column.label.length // 表头label长度
  712. const size = 14 // 根据需要定义标尺,直接使用字体大小确定就行,也可以根据需要定义
  713. column.minWidth = labelLong * size < 120 ? 120 : labelLong * size // 根据label长度计算该表头最终宽度
  714. return h('span', { class: 'cell-content', style: { width: '100%' } }, [column.label])
  715. },
  716. openNewWindow (url) {
  717. window.open(url, '_blank')
  718. }
  719. }
  720. }
  721. </script>
  722. <style lang="scss" scoped>
  723. @import '../../../packages/assets/style/bsTheme.scss';
  724. .data-set-scrollbar {
  725. height: 100%;
  726. overflow-y: auto;
  727. overflow-x: none;
  728. .el-scrollbar__view {
  729. height: 100%;
  730. }
  731. }
  732. /deep/ .el-input__inner {
  733. width: 100% !important;
  734. }
  735. .page-header {
  736. display: flex;
  737. position: relative;
  738. .page-header-right {
  739. position: absolute;
  740. right: 16px;
  741. }
  742. }
  743. .sql-config {
  744. padding: 0 16px;
  745. }
  746. .operation {
  747. /deep/ .el-select {
  748. width: 200px !important;
  749. margin-right: 16px;
  750. }
  751. display: flex;
  752. }
  753. /deep/ .CodeMirror {
  754. height: 180px !important;
  755. font-family: Helvetica, Tahoma;
  756. }
  757. .no-border {
  758. border: 0;
  759. }
  760. /deep/ .fieldDescCheck {
  761. .el-dialog__body {
  762. height: fit-content !important;
  763. min-height: unset !important;
  764. }
  765. }
  766. .title-style {
  767. padding: 8px 12px;
  768. background-color: #f6f7fb;
  769. border-left: 5px solid var(--bs-el-color-primary);
  770. margin: 16px 16px 0 0;
  771. }
  772. .field-wrap {
  773. // max-height: 110px;
  774. overflow: auto;
  775. margin-right: 16px;
  776. cursor: pointer;
  777. .field-item {
  778. line-height: 32px;
  779. padding: 0 12px 0 16px;
  780. .edit_field {
  781. display: none;
  782. }
  783. &:hover {
  784. background-color: #f2f7fe;
  785. .edit_field {
  786. display: block;
  787. }
  788. }
  789. }
  790. }
  791. .right-setting {
  792. height: 358px;
  793. overflow: hidden;
  794. display: flex;
  795. flex-direction: column;
  796. .paramConfig {
  797. max-height: 179px;
  798. .field-wrap {
  799. max-height: 127px;
  800. }
  801. }
  802. .structure {
  803. flex: 1;
  804. overflow: hidden;
  805. .field-wrap {
  806. height: calc(100% - 40px);
  807. }
  808. }
  809. }
  810. .result-view {
  811. font-size: 14px;
  812. font-weight: 600;
  813. color: var(--bs-el-text);
  814. position: relative;
  815. padding: 16px 0;
  816. padding-left: 12px;
  817. border-bottom: 1px solid var(--bs-background-1);
  818. &::before {
  819. content: "";
  820. height: 14px;
  821. position: absolute;
  822. left: 0;
  823. top: 50%;
  824. transform: translateY(-50%);
  825. border-left: 4px solid var(--bs-el-color-primary);
  826. }
  827. }
  828. /deep/ .bs-table-box.is-Edit .el-table {
  829. max-height: unset !important;
  830. .el-table__body-wrapper {
  831. max-height: unset !important;
  832. }
  833. }
  834. .bs-table-box {
  835. padding: 0;
  836. height: 100% !important;
  837. margin-bottom: 0 !important;
  838. }
  839. .tree-box {
  840. padding: 0;
  841. }
  842. </style>