LayerDetail.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <Dialog title="预案名称" custom-show hide-footer @close="handleClose1">
  3. <div class="btn-box1">
  4. <div class="btn1" @click="handleShowCooperate">
  5. <i class="icon1" />
  6. 邀请协同
  7. </div>
  8. <div class="btn1" style="margin-left: 10px" @click="handleShowUser">
  9. <i class="icon2" />
  10. 协同用户
  11. </div>
  12. </div>
  13. <div class="btn-box2">
  14. <div class="box-left">
  15. <div class="text1">分类</div>
  16. <el-select v-model="type" :teleported="false" class="custom-select" popper-class="custom-select-popper" style="width: 140px">
  17. <el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
  18. </el-select>
  19. </div>
  20. <div class="box-right">
  21. <div class="btn1">
  22. <i class="icon3" />
  23. 显示标注
  24. </div>
  25. <div class="btn1" style="margin-left: 10px" @click="handleShowImportLayer">
  26. <i class="icon4" />
  27. 导入图层
  28. </div>
  29. <div class="btn1" style="margin-left: 10px" @click="handleShowGroup">
  30. <i class="icon5" />
  31. 添加分组
  32. </div>
  33. </div>
  34. </div>
  35. <div class="common-table">
  36. <div class="table-header">
  37. <div class="td" style="width: 40px"></div>
  38. <div class="td">标注名称</div>
  39. <div class="td">用户</div>
  40. <div class="td">单位</div>
  41. <div class="td">时间</div>
  42. <div class="td">操作</div>
  43. </div>
  44. <div v-for="(item, index) in dataList" :key="index" class="tr">
  45. <div class="td" :title="item.name">{{ item.name }}</div>
  46. <div class="td" :title="item.nickName">{{ item.nick_name }}</div>
  47. <div class="td" :title="item.dept_name">{{ item.dept_name }}</div>
  48. <div class="td" :title="item.create_time">{{ item.create_time }}</div>
  49. <div class="td">
  50. <div class="btn-text">{{ item.visible === 'false' ? '显示' : '隐藏' }}</div>
  51. </div>
  52. </div>
  53. </div>
  54. </Dialog>
  55. <Dialog v-model="showGroup" :title="groupForm.groupId ? '编辑分组' : '添加分组'" type="xs" hide-footer>
  56. <div class="form-item">
  57. <div class="text1">分组名称</div>
  58. <el-input v-model="groupForm.name" class="custom-input" placeholder="请输入" />
  59. </div>
  60. <div class="form-action">
  61. <div class="common-btn-primary" @click="handleAddGroup">保存</div>
  62. <div v-if="groupForm.groupId" class="common-btn-primary" @click="handleDeleteGroup">删除</div>
  63. <div class="common-btn" @click="handleClose2">取消</div>
  64. </div>
  65. </Dialog>
  66. <Contact v-if="showCooperate" v-model="showCooperate" @close="handleClose3" @confirm="handleConfirm" />
  67. <CollaborativeUser v-if="showUser" v-model="showUser" />
  68. <ImportLayer v-if="showImportLayer" v-model="showImportLayer" />
  69. </template>
  70. <script lang="ts" setup name="LayerDetail">
  71. import { addGroup, addWsUser, getBzList } from '@/api/globalMap/onlinePlotting';
  72. import ImportLayer from './ImportLayer.vue';
  73. import CollaborativeUser from './CollaborativeUser.vue';
  74. const props = defineProps({
  75. modelValue: Boolean,
  76. patternId: String
  77. });
  78. const emits = defineEmits(['update:modelValue']);
  79. let type = ref('');
  80. let typeOptions = ref([
  81. { label: '全部', value: '' },
  82. { label: '点', value: '1' },
  83. { label: '线', value: '2' },
  84. { label: '面', value: '3' },
  85. { label: '其他', value: '4' }
  86. ]);
  87. let queryParams = reactive({
  88. pattern_id: props.patternId
  89. });
  90. let dataList = ref([]);
  91. let showGroup = ref(false);
  92. let groupForm = ref({
  93. groupId: '',
  94. name: ''
  95. });
  96. const handleShowGroup = () => {
  97. showGroup.value = true;
  98. };
  99. const handleAddGroup = () => {
  100. const obj = {
  101. group_name: groupForm.value.name,
  102. pattern_id: props.patternId
  103. };
  104. addGroup(obj).then((res) => {
  105. emits('update:modelValue', false);
  106. });
  107. };
  108. const handleClose1 = () => {
  109. emits('update:modelValue', false);
  110. };
  111. const handleDeleteGroup = () => {
  112. showGroup.value = false;
  113. };
  114. const handleClose2 = () => {
  115. showGroup.value = false;
  116. };
  117. let showCooperate = ref(false);
  118. const handleShowCooperate = () => {
  119. showCooperate.value = true;
  120. };
  121. const handleClose3 = () => {
  122. showCooperate.value = false;
  123. };
  124. const handleConfirm = (data) => {
  125. let arr = [];
  126. data.forEach((item) => {
  127. arr.push(item.userId);
  128. });
  129. addWsUser({
  130. user_id_list: arr,
  131. pattern_id: props.patternId
  132. });
  133. };
  134. let showUser = ref(false);
  135. const handleShowUser = () => {
  136. showUser.value = true;
  137. };
  138. let showImportLayer = ref(false);
  139. const handleShowImportLayer = () => {
  140. showImportLayer.value = true;
  141. };
  142. onMounted(() => {
  143. getBzList(queryParams).then((res) => {
  144. dataList.value = res.data;
  145. });
  146. });
  147. </script>
  148. <style lang="scss" scoped>
  149. .btn-box1 {
  150. display: flex;
  151. justify-content: flex-end;
  152. align-items: center;
  153. position: absolute;
  154. top: 30px;
  155. right: 22px;
  156. }
  157. .btn-box2 {
  158. display: flex;
  159. justify-content: space-between;
  160. align-items: center;
  161. margin-top: 15px;
  162. margin-bottom: 10px;
  163. .box-left {
  164. display: flex;
  165. align-items: center;
  166. .text1 {
  167. font-size: 14px;
  168. margin-right: 5px;
  169. }
  170. }
  171. .box-right {
  172. display: flex;
  173. align-items: center;
  174. }
  175. }
  176. .btn1 {
  177. width: 104px;
  178. height: 29px;
  179. background: url('@/assets/images/map/rightMenu/btn.png') no-repeat;
  180. background-size: 100% 100%;
  181. padding: 0 5px;
  182. display: flex;
  183. align-items: center;
  184. cursor: pointer;
  185. .icon1 {
  186. width: 28px;
  187. height: 25px;
  188. background: url('@/assets/images/map/rightMenu/layerDetail/icon1.png') no-repeat;
  189. background-size: 100% 100%;
  190. }
  191. .icon2 {
  192. width: 23px;
  193. height: 24px;
  194. background: url('@/assets/images/map/rightMenu/layerDetail/icon2.png') no-repeat;
  195. background-size: 100% 100%;
  196. }
  197. .icon3 {
  198. width: 22px;
  199. height: 22px;
  200. background: url('@/assets/images/map/rightMenu/layerDetail/icon3.png') no-repeat;
  201. background-size: 100% 100%;
  202. }
  203. .icon4 {
  204. width: 26px;
  205. height: 26px;
  206. background: url('@/assets/images/map/rightMenu/layerDetail/icon4.png') no-repeat;
  207. background-size: 100% 100%;
  208. }
  209. .icon5 {
  210. width: 23px;
  211. height: 23px;
  212. background: url('@/assets/images/map/rightMenu/layerDetail/icon5.png') no-repeat;
  213. background-size: 100% 100%;
  214. }
  215. }
  216. .form-item {
  217. display: flex;
  218. align-items: center;
  219. .text1 {
  220. flex-shrink: 0;
  221. margin-right: 10px;
  222. }
  223. .custom-input {
  224. flex: 1;
  225. }
  226. }
  227. .form-action {
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. }
  232. </style>