detailItem.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="system-add-user-container">
  3. <el-dialog
  4. title="平台健康度"
  5. v-model="isShowDialog"
  6. width="790px"
  7. >
  8. <div class="table-wrap">
  9. <div class="table-item-wrap">
  10. <div class="label">详细介绍</div>
  11. <div class="value">{{ruleForm.explain}}</div>
  12. </div>
  13. <div class="table-item-wrap">
  14. <div class="label">SecretKey</div>
  15. <div class="value">调用API的安全密码,请联系管理员获取</div>
  16. </div>
  17. <div class="table-item-wrap">
  18. <div class="label" style="display: flex;flex-direction: column;justify-content: center;">
  19. <p>入口URL</p>
  20. <p>请求方式</p>
  21. <p>请求Body参数</p>
  22. </div>
  23. <div class="value">
  24. <section>
  25. <div class="inner-label">入口URL</div>
  26. <div class="inner-value url">{{baseUrl}}/data</div>
  27. </section>
  28. <section>
  29. <div class="inner-label">请求方式</div>
  30. <div class="inner-value">POST</div>
  31. </section>
  32. <section>
  33. <div class="inner-label">请求Body参数</div>
  34. <div class="inner-value">
  35. <div>itemcode:{{ruleForm.item_code}}</div>
  36. <div>name:
  37. <span
  38. v-for="(item, index) in ruleForm.targets"
  39. :key="index"
  40. >{{`${item.name} `}} </span>
  41. </div>
  42. <div>value:当前值</div>
  43. <div>form_info:平台数据</div>
  44. </div>
  45. </section>
  46. </div>
  47. </div>
  48. <div class="table-item-wrap">
  49. <div class="label" style="display: flex;flex-direction: column;justify-content: center;">
  50. <p>出口URL</p>
  51. <p>请求方式</p>
  52. <p>请求Query参数</p>
  53. </div>
  54. <div class="value">
  55. <section>
  56. <div class="inner-label">出口URL</div>
  57. <div class="inner-value url">{{baseUrl}}/index</div>
  58. </section>
  59. <section>
  60. <div class="inner-label">请求方式</div>
  61. <div class="vinner-value">GET</div>
  62. </section>
  63. <section>
  64. <div class="inner-label">请求Query参数</div>
  65. <div class="inner-value">
  66. <div>itemcode:{{ruleForm.item_code}}</div>
  67. </div>
  68. </section>
  69. </div>
  70. </div>
  71. </div>
  72. </el-dialog>
  73. </div>
  74. </template>
  75. <script lang="ts">
  76. import { reactive, toRefs, onMounted, defineComponent } from 'vue';
  77. import api from '/@/api/modules';
  78. // 定义接口来定义对象的类型
  79. interface RuleFormRow {
  80. title: string;
  81. explain: string;
  82. config: string;
  83. item_code: string;
  84. targets: Array<any>
  85. }
  86. interface ItemState {
  87. isShowDialog: boolean;
  88. ruleForm: RuleFormRow;
  89. baseUrl: string
  90. }
  91. export default defineComponent({
  92. name: 'systemAddUser',
  93. setup() {
  94. const state = reactive<ItemState>({
  95. isShowDialog: false,
  96. ruleForm: {
  97. title: '', // 评价名称
  98. explain: '', // 描述
  99. config: '',
  100. item_code: '',
  101. targets: []
  102. },
  103. baseUrl: import.meta.env.VITE_ASSESS_URL
  104. });
  105. // 打开弹窗
  106. const openDialog = (row: any) => {
  107. api.assess.getList({ itemcode: row.item_code }).then((res: any) => {
  108. state.ruleForm = res
  109. state.isShowDialog = true;
  110. });
  111. };
  112. // 关闭弹窗
  113. const closeDialog = () => {
  114. state.isShowDialog = false;
  115. };
  116. // 取消
  117. const onCancel = () => {
  118. closeDialog();
  119. };
  120. // 新增
  121. const onSubmit = () => {
  122. closeDialog();
  123. };
  124. // 初始化组织数据
  125. const initTableData = () => {
  126. };
  127. // 页面加载时
  128. onMounted(() => {
  129. initTableData();
  130. });
  131. return {
  132. openDialog,
  133. closeDialog,
  134. onCancel,
  135. onSubmit,
  136. ...toRefs(state),
  137. };
  138. },
  139. });
  140. </script>
  141. <style lang="scss" scoped>
  142. :deep(.el-dialog__body) {
  143. border-top: 1px var(--el-border-color) var(--el-border-style);
  144. }
  145. .table-wrap {
  146. .table-item-wrap:nth-child(1) {
  147. border-top: 1px var(--el-border-color) var(--el-border-style);
  148. }
  149. .table-item-wrap {
  150. display: flex;
  151. border-bottom: 1px var(--el-border-color) var(--el-border-style);
  152. border-left: 1px var(--el-border-color) var(--el-border-style);
  153. border-right: 1px var(--el-border-color) var(--el-border-style);
  154. .value,
  155. .label {
  156. padding: 16px;
  157. section {
  158. display: flex;
  159. }
  160. // .inner-value {
  161. // display: flex;
  162. // }
  163. }
  164. .label {
  165. display: flex;
  166. // justify-content: center;
  167. align-items: center;
  168. width: 330px;
  169. border-right: 1px var(--el-border-color) var(--el-border-style);
  170. background-color: #f3f3f3;
  171. }
  172. .value {
  173. width: 410px;
  174. .inner-label {
  175. width: 80px;
  176. }
  177. .url {
  178. color: var(--el-color-primary);
  179. }
  180. }
  181. }
  182. }
  183. </style>