|
@@ -0,0 +1,95 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="flex flex-col justify-between w-full sm:flex-row">
|
|
|
|
+ <!-- <Department v-model="query.department_id" @searchDepartmentUsers="search" v-if="hasRoles" class="dark:bg-regal-dark" /> -->
|
|
|
|
+ <div :class="hasRoles ? 'w-full ml-0 sm:ml-2 mt-2 sm:mt-0' : 'w-full'">
|
|
|
|
+ <Search :search="search" :reset="reset">
|
|
|
|
+ <template v-slot:body>
|
|
|
|
+ <el-form-item label="小程序名称">
|
|
|
|
+ <el-input v-model="query.email" clearable />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="所属公司">
|
|
|
|
+ <el-input v-model="query.username" clearable />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="对应剧场名称">
|
|
|
|
+ <el-input v-model="query.username" clearable />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </template>
|
|
|
|
+ </Search>
|
|
|
|
+ <div class="table-default">
|
|
|
|
+ <Operate :show="open" />
|
|
|
|
+ <el-table :data="tableData" class="mt-3" v-loading="loading">
|
|
|
|
+ <el-table-column prop="username" label="ID" />
|
|
|
|
+ <el-table-column prop="username" label="小程序名称" />
|
|
|
|
+ <el-table-column prop="username" label="所属公司" />
|
|
|
|
+ <el-table-column prop="username" label="对应剧场名称" />
|
|
|
|
+ <el-table-column prop="status" label="状态">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <Status v-model="scope.row.status" :id="scope.row.id" :api="api" />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="created_at" label="类型" />
|
|
|
|
+ <el-table-column label="操作" width="200">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-button link type="primary" size="small" @click="opendepots(scope.row)">分配</el-button>
|
|
|
|
+ <el-button link type="primary" size="small" @click="open(scope.row.id)">更新</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+
|
|
|
|
+ <Paginate />
|
|
|
|
+ </div>
|
|
|
|
+ <Dialog width="800px" v-model="depotsVisible" title="分配" destroy-on-close>
|
|
|
|
+ <depotsTransfer @close="closeDeptos()" :primary="depotsData"></depotsTransfer>
|
|
|
|
+ </Dialog>
|
|
|
|
+
|
|
|
|
+ <Dialog v-model="visible" :title="title" destroy-on-close>
|
|
|
|
+ <Create @close="close(reset)" :primary="id" :api="api" :has-roles="hasRoles" />
|
|
|
|
+ </Dialog>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
+import { computed, onMounted, ref } from 'vue';
|
|
|
|
+import Create from './form/create.vue';
|
|
|
|
+import depotsTransfer from './form/depotsTransfer.vue';
|
|
|
|
+import { useGetList } from '@/hook/curd/useGetList';
|
|
|
|
+import { useDestroy } from '@/hook/curd/useDestroy';
|
|
|
|
+import { useOpen } from '@/hook/curd/useOpen';
|
|
|
|
+import Department from './components/department.vue';
|
|
|
|
+import { useUserStore } from '@/stores/modules/user';
|
|
|
|
+import { isUndefined } from '@/support/helper';
|
|
|
|
+
|
|
|
|
+const userStore = useUserStore();
|
|
|
|
+const applet = ref([{ id: 1, name: '微信', value: 'wx' }, { id: 2, name: '抖音', value: 'dy' }])
|
|
|
|
+
|
|
|
|
+const api = 'users';
|
|
|
|
+const depotsVisible = ref(false)
|
|
|
|
+const depotsData = ref({})
|
|
|
|
+
|
|
|
|
+const { data, query, search, reset, loading } = useGetList(api);
|
|
|
|
+const { destroy, deleted } = useDestroy();
|
|
|
|
+const { open, close, title, visible, id } = useOpen();
|
|
|
|
+
|
|
|
|
+const tableData = computed(() => data.value?.data);
|
|
|
|
+
|
|
|
|
+const roles = ref<Array<Object>>();
|
|
|
|
+const hasRoles = ref<boolean>(false);
|
|
|
|
+
|
|
|
|
+const opendepots = (data) => {
|
|
|
|
+ depotsVisible.value = true
|
|
|
|
+ depotsData.value = data
|
|
|
|
+}
|
|
|
|
+const closeDeptos = () => {
|
|
|
|
+ depotsVisible.value = false
|
|
|
|
+ search()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ search();
|
|
|
|
+
|
|
|
|
+ deleted(reset);
|
|
|
|
+
|
|
|
|
+ hasRoles.value = !isUndefined(userStore.getRoles);
|
|
|
|
+});
|
|
|
|
+</script>
|