addWorkspace.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <el-drawer class="test" v-model="tableCom" with-header="true" size="35%">
  3. <template #header="{ titleId }">
  4. <p :id="titleId">{{ companyAddTitle }}</p>
  5. </template>
  6. <el-form
  7. ref="ruleFormRef"
  8. :model="ruleForm"
  9. :rules="rules"
  10. label-width="90px"
  11. class="demo-ruleForm"
  12. size="default"
  13. status-icon
  14. >
  15. <el-form-item label="公司名称" prop="name">
  16. <el-input v-model="ruleForm.name" style="width: 200px" />
  17. </el-form-item>
  18. <el-form-item label="上级场景" prop="seniorScene">
  19. <el-input v-model="ruleForm.seniorScene" style="width: 200px" disabled />
  20. </el-form-item>
  21. <el-form-item label="公司代码" prop="code">
  22. <el-input v-model="ruleForm.code" style="width: 200px" />
  23. </el-form-item>
  24. <el-form-item label="标签&模板" prop="sceneCode">
  25. <div style="width: 200px; height: 30px"></div>
  26. <div
  27. v-for="(item, index) in selectItems"
  28. :key="index"
  29. style="margin-bottom: 16px; display: flex"
  30. >
  31. <el-select v-model="item.tag" placeholder="请选择标签" style="width: 126px">
  32. <el-option
  33. v-for="item1 in options"
  34. :key="item1.value"
  35. :label="item1.label"
  36. :value="item1.value"
  37. />
  38. </el-select>
  39. <img
  40. src="@/assets/icons/link.png"
  41. alt=""
  42. style="width: 16px; margin-left: 2px; margin-right: 2px" />
  43. <el-select v-model="item.template" placeholder="请选择模板" style="width: 126px">
  44. <el-option
  45. v-for="item2 in options"
  46. :key="item2.value"
  47. :label="item2.label"
  48. :value="item2.value"
  49. />
  50. </el-select>
  51. <img
  52. src="../../../assets/icons/close.png"
  53. @click="deleScene(index)"
  54. alt=""
  55. style="width: 13px; height: 13px; margin-top: 10px; margin-left: 3px; cursor: pointer"
  56. /></div>
  57. <div style="width: 200px">
  58. <el-icon size="28px" @click="addChange" style="cursor: pointer"><CirclePlus /></el-icon
  59. ></div>
  60. </el-form-item>
  61. <el-form-item label="状态">
  62. <el-switch v-model="addEnable" active-value="1" inactive-value="0" class="switchUse" />
  63. </el-form-item>
  64. </el-form>
  65. <div style="position: absolute; left: 108px; bottom: 67px">
  66. <el-button v-if="companyAddTitle === '添加公司'" type="warning" @click="resetDraw"
  67. >重置</el-button
  68. >
  69. <el-button type="primary" v-if="companyAddTitle === '添加公司'" @click="addNewTypeCom">
  70. 提交
  71. </el-button>
  72. <el-button type="primary" v-if="companyAddTitle !== '添加公司'" @click="editedSub">
  73. 提交
  74. </el-button>
  75. </div>
  76. </el-drawer>
  77. </template>
  78. <script setup lang="ts">
  79. import { computed } from 'vue';
  80. // import { SubscribeItem } from '@/api/subscribe/subscribe';
  81. interface User {
  82. name?: string;
  83. tag?: string;
  84. code?: string;
  85. hasChildren?: boolean;
  86. children?: User[];
  87. }
  88. const props = defineProps<{
  89. subItem: User;
  90. handleConig: (row) => unknown;
  91. handleAdd: (row) => unknown;
  92. handleEdit: (row) => unknown;
  93. handleDelete: (row) => unknown;
  94. handleUp: (row) => unknown;
  95. handleDown: (row) => unknown;
  96. }>();
  97. const isBook = computed(() => (props.subscribeItem.booking === '0' ? true : false));
  98. const changeConig = () => {
  99. props.handleConig(props.subItem);
  100. };
  101. const changeAdd = () => {
  102. props.handleAdd(props.subItem);
  103. };
  104. const changeEdit = () => {
  105. props.handleEdit(props.subItem);
  106. };
  107. const changeDelete = () => {
  108. props.handleDelete(props.subItem);
  109. };
  110. const changeUp = () => {
  111. props.handleUp(props.subItem);
  112. };
  113. const changeDown = () => {
  114. props.handleDown(props.subItem);
  115. };
  116. </script>
  117. <style scoped>
  118. .wordStyle {
  119. height: 22px;
  120. font-size: 14px;
  121. color: #1890ff;
  122. line-height: 22px;
  123. cursor: pointer;
  124. }
  125. .otp-btn {
  126. width: 52px;
  127. height: 26px;
  128. }
  129. :deep(.el-button--primary) {
  130. --el-button-bg-color: #3f9eff;
  131. --el-button-hover-bg-color: #64b0fe;
  132. --el-button-active-bg-color: #2f8ae7;
  133. }
  134. :deep(.el-button--danger) {
  135. --el-button-bg-color: #f56c6c;
  136. --el-button-hover-bg-color: #f68888;
  137. --el-button-active-bg-color: #c35353;
  138. }
  139. </style>