JsonEditForm.vue 24 KB

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