12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <template>
- <Dialog draggable custom-show title="协同用户" type="sm" hide-footer @close="handleClose">
- <div class="common-table">
- <div class="table-header">
- <!-- <div class="td">-->
- <!-- <el-checkbox v-model="allChecked" @change="allCheckedChange" />-->
- <!-- </div>-->
- <div class="td">协同用户</div>
- <div class="td">单位</div>
- <div class="td">操作</div>
- </div>
- <div v-for="(item, index) in dataList" :key="index" class="tr">
- <!-- <div class="td">-->
- <!-- <el-checkbox v-model="item.checked" />-->
- <!-- </div>-->
- <div class="td">{{ item.nick_name }}</div>
- <div class="td">{{ item.dept_name }}</div>
- <div class="td">
- <div v-if="!!item.ws_flag" class="btn1" @click="handleCloseUser(item.id)">关闭协同</div>
- <div v-else class="btn1" @click="handleStartUser(item.id)">开启协同</div>
- </div>
- </div>
- </div>
- </Dialog>
- </template>
- <script lang="ts" setup name="ImportLayer">
- import { endCollaboration, getPatternUserList, startCollaboration } from '@/api/globalMap/onlinePlotting';
- import { showSuccessMsg } from '@/utils/notification';
- const props = defineProps({
- modelValue: Boolean,
- patternId: String
- });
- const emits = defineEmits(['update:modelValue']);
- let allChecked = ref(false);
- let dataList = ref([]);
- const allCheckedChange = () => {
- dataList.value.forEach((item) => {
- item.checked = allChecked.value;
- });
- };
- const getList = () => {
- getPatternUserList({ pattern_id: props.patternId }).then((res) => {
- dataList.value = res.data;
- });
- };
- const handleCloseUser = (id) => {
- endCollaboration({
- pattern_id: props.patternId,
- user_id: id
- }).then(() => {
- showSuccessMsg('关闭成功');
- getList();
- });
- };
- const handleStartUser = (id) => {
- startCollaboration({
- pattern_id: props.patternId,
- user_id: id
- }).then(() => {
- getList();
- });
- };
- const handleClose = () => {
- emits('update:modelValue', false);
- };
- onMounted(() => {
- getList();
- });
- </script>
- <style lang="scss" scoped>
- .btn1 {
- color: #5983df;
- cursor: pointer;
- }
- </style>
|