liuxiaona il y a 10 mois
Parent
commit
9d9e5d2927

+ 6 - 0
src/api/ApiModel.ts

@@ -232,6 +232,12 @@ export interface radioFace{
232 232
     list?:any
233 233
 }
234 234
 
235
+export interface departParams{
236
+    name?:string,
237
+    pid?:string|number,
238
+    id?:string|number,
239
+}
240
+
235 241
 
236 242
 
237 243
 

+ 13 - 1
src/api/api.ts

@@ -117,7 +117,19 @@ export enum Api{
117 117
     advert_adsDetail = '/api/ad/adsDetail',
118 118
 
119 119
     //投放版位
120
-    siteSet_list = '/api/adcreatives/siteSet'
120
+    siteSet_list = '/api/adcreatives/siteSet',
121
+
122
+    //部门
123
+    depart_add = '/api/sys/departmentAdd',
124
+    depart_list = '/api/sys/departments',
125
+    depart_edit = '/api/sys/departmentEdit',
126
+    depart_dele = '/api/sys/departmentDel',
127
+
128
+    //项目
129
+    project_add = '/api/sys/projectsAdd',
130
+    project_list = '/api/sys/projectsList',
131
+    project_edit = '/api/sys/projectsEdit',
132
+    project_dele = '/api/sys/projectsDel',
121 133
 
122 134
 
123 135
 

+ 101 - 0
src/components/businessMoudle/limitManage/index.vue

@@ -0,0 +1,101 @@
1
+<template>
2
+  <div class="screenBox flex">
3
+    <el-button type="primary" class="lMarauto"  @click="limitsAdd()">新增权限</el-button>
4
+  </div>
5
+
6
+  <!--  列表-->
7
+  <TableList
8
+      ref="tableListRef"
9
+      :tableData="tableInfo.tableList"
10
+      :descol="tableInfo.descolList"
11
+      :total="total"
12
+      @init="init"
13
+  >
14
+    <template v-slot:operate="slotProps">
15
+      <div class="text-center">
16
+        <span class="operate_text lMar8 pointer" @click="editEvent(slotProps.row)">编辑</span>
17
+        <Popconfirm @confirm="deleEvent(slotProps.row)"/>
18
+      </div>
19
+    </template>
20
+  </TableList>
21
+</template>
22
+<script setup lang="ts">
23
+import {nextTick, onMounted, reactive, ref, getCurrentInstance} from 'vue'
24
+import Popconfirm from '@/components/capsulationMoudle/_popconfirm.vue'
25
+import TableList from '@/components/capsulationMoudle/tableList.vue'
26
+import { adqParam, reactiveTableAndAny} from "@/api/ApiModel";
27
+import {Api} from "@/api/api";
28
+import {ElMessage} from "element-plus";
29
+import { publicTableTs } from '@/components/businessMoudle/tableInfo'
30
+
31
+const { proxy } = getCurrentInstance() as any;
32
+
33
+
34
+// 表格数据公共ts
35
+const descolParams = reactive([
36
+  { name:'权限名称',column:'account_name',},
37
+  { name:'描述',column:'account_id',cancleForMat:true},
38
+  { name:'更新时间',column:'created_at'},
39
+  { name:'操作',column:'operate',slotFlag: true},
40
+])
41
+const { tableInfo,tableListRef,total } = publicTableTs(descolParams)
42
+
43
+const limitsAdd = () => {
44
+
45
+}
46
+
47
+const InputRef_text = ref<{value:string}>()
48
+
49
+//账号列表
50
+const init = async (page?:any,pageSize?:any) => {
51
+  tableListRef.value!.loading = true
52
+  const paramsModel = reactive<adqParam>({
53
+    page:page?page:1,
54
+    page_size:pageSize?pageSize:20,
55
+  })
56
+  let res:any = await proxy.$http.get(Api.adq_list,paramsModel)
57
+  tableListRef.value!.loading = false
58
+  if(res&&res.errNo=='0'){
59
+    tableInfo.tableList = res.rst.data
60
+    total.value = res.rst.pageInfo.total
61
+  }else{
62
+    ElMessage.error(res.errMsg)
63
+  }
64
+}
65
+
66
+const deleEvent = async (item:any) => {
67
+  tableListRef.value!.loading = true
68
+  const paramsModel = reactive<adqParam>({
69
+    account_id:item.id
70
+  })
71
+  let res:any = await proxy.$http.post(Api.adq_dele,paramsModel)
72
+  tableListRef.value!.loading = false
73
+  ElMessage.info(res.errMsg)
74
+  if(res&&res.errNo=='0'){
75
+    await init()
76
+  }
77
+}
78
+
79
+const editEvent = (item:any) => {
80
+
81
+}
82
+
83
+
84
+onMounted( async ()=>{
85
+  await init()
86
+})
87
+</script>
88
+<style lang="scss" scoped>
89
+.dialogBox{
90
+  :deep(.el-input__wrapper){
91
+    background: #F9F9F9;
92
+    border-radius: 5px;
93
+    border: 1px solid #F1F1F1;
94
+    height: 45px;
95
+    box-shadow:none;
96
+  }
97
+}
98
+.screenArea{
99
+  margin-bottom: 8px;
100
+}
101
+</style>

+ 127 - 0
src/components/businessMoudle/memberManage/dialog/addDepartment.vue

@@ -0,0 +1,127 @@
1
+<template>
2
+
3
+  <Dialog ref="DialogRef_editType"
4
+          :dialogVisible="dialogShow"
5
+          @confirm="confirmEvent"
6
+          @close="dialogShow = false"
7
+          width="500px"
8
+          :dialog-title="pageInfo.title">
9
+    <template v-slot:content>
10
+      <div class="dialogBox" v-loading="loading">
11
+        <Input ref="nameRef" spanTitleWidth="80px" title="部门" :haveTag="true" :haverMar15="false"/>
12
+        <div class="flex tMar20">
13
+          <span class="spanTitle f14" style="width: 80px;">上级部门</span>
14
+          <el-tree-select v-model="treeValue"
15
+                          filterable
16
+                          :highlight-current="true"
17
+                          style="width: 100%"
18
+                          :props="defaultProps"
19
+                          node-key="id"
20
+                          :data="pageInfo.treeList"
21
+                          :render-after-expand="false" />
22
+        </div>
23
+      </div>
24
+    </template>
25
+  </Dialog>
26
+
27
+</template>
28
+<script setup lang="ts">
29
+import Dialog from '@/components/capsulationMoudle/_dialog.vue'
30
+import Input from '@/components/capsulationMoudle/_input.vue'
31
+import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
32
+import {ElMessage} from "element-plus";
33
+import {departParams, fileParam, reactiveTableAndAny} from "@/api/ApiModel";
34
+import {Api} from "@/api/api";
35
+
36
+const { proxy } = getCurrentInstance() as any;
37
+// 全局方法定义
38
+const NumberHandle = proxy.$NumberHandle
39
+
40
+const emit = defineEmits<{
41
+  (event: "init"): void;
42
+}>();
43
+
44
+const defaultProps = {
45
+  children: 'childs',
46
+  label: 'name',
47
+}
48
+//页面数据
49
+const pageInfo = reactive<reactiveTableAndAny>({
50
+  treeList:[],
51
+  editId:'',
52
+  title:'添加部门'
53
+})
54
+
55
+const init = async () => {
56
+  let res:any = await proxy.$http.get(Api.depart_list)
57
+  if(res&&res.errNo=='0'){
58
+    let resNew:any = res.rst
59
+    pageInfo.treeList = resNew
60
+  }else{
61
+    ElMessage.error(res.errMsg)
62
+  }
63
+}
64
+
65
+
66
+const treeValue=ref('')
67
+const nameRef=ref<{value:string}>()
68
+const loading=ref<boolean>(false)
69
+const confirmEvent = async () => {
70
+  if(nameRef.value!.value==''){
71
+    ElMessage.error('名称为必填项')
72
+    return
73
+  }
74
+  loading.value = true
75
+  let api:string = Api.depart_add
76
+  const paramsModel = reactive<departParams>({
77
+    pid:treeValue.value,
78
+    name:nameRef.value!.value,
79
+  })
80
+  if(pageInfo.editId){ // 编辑
81
+    paramsModel.id = pageInfo.editId
82
+    api = Api.depart_edit
83
+  }
84
+  let res:any = await proxy.$http.post(api,paramsModel)
85
+  loading.value = false
86
+  if(res&&res.errNo=='0'){
87
+    let resNew:any = res.rst
88
+    dialogShow.value = false
89
+    emit('init')
90
+  }else{
91
+    ElMessage.error(res.errMsg)
92
+  }
93
+}
94
+
95
+
96
+// 切换显隐
97
+const dialogShow = ref<boolean>(false)
98
+const switchShow = (val:boolean,info?:any)=>{
99
+  dialogShow.value = val
100
+  if(val){
101
+    nextTick(async ()=>{
102
+      nameRef.value!.value = ''
103
+      treeValue.value = ''
104
+      pageInfo.editId = ''
105
+      await init()
106
+      if(info?.id){ // 编辑
107
+        pageInfo.editId = info?.id
108
+        nameRef.value!.value = info.name
109
+        treeValue.value = info.pid
110
+        pageInfo.title = '编辑部门'
111
+      }
112
+    })
113
+  }
114
+}
115
+// 父组件共享值
116
+defineExpose({
117
+  switchShow,
118
+});
119
+onMounted(()=>{
120
+  nextTick(()=>{
121
+
122
+  })
123
+})
124
+</script>
125
+<style lang="scss" scoped>
126
+
127
+</style>

+ 102 - 0
src/components/businessMoudle/memberManage/dialog/addMember.vue

@@ -0,0 +1,102 @@
1
+<template>
2
+
3
+  <Dialog ref="DialogRef_editType"
4
+          :dialogVisible="dialogShow"
5
+          @confirm="confirmEvent"
6
+          @close="dialogShow = false"
7
+          width="500px"
8
+          dialog-title="添加人员">
9
+    <template v-slot:content>
10
+      <div class="dialogBox" v-loading="loading">
11
+        <Input ref="nameRef" spanTitleWidth="50px" title="用户名" :haveTag="true"/>
12
+        <Input ref="nameRef" spanTitleWidth="50px" title="密码" :haveTag="true"/>
13
+        <div class="flex">
14
+          <Input ref="nameRef" spanTitleWidth="50px" title="部门" :haveTag="true"/>
15
+          <span>
16
+            <el-icon :size="20"><i-ep-Plus/></el-icon>
17
+            添加部门
18
+          </span>
19
+        </div>
20
+        <Select ref="ideaManRef"
21
+                :clearFlag="true"
22
+                title="权限"
23
+                :optObj="{k:'id',la:'username',val:'id'}"
24
+                @changeEvent="init()" @clearEvent="init()"
25
+                :options="pageInfo.limitList"/>
26
+
27
+      </div>
28
+    </template>
29
+  </Dialog>
30
+
31
+</template>
32
+<script setup lang="ts">
33
+import Select from '@/components/capsulationMoudle/_select.vue'
34
+import Dialog from '@/components/capsulationMoudle/_dialog.vue'
35
+import Input from '@/components/capsulationMoudle/_input.vue'
36
+import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
37
+import {ElMessage} from "element-plus";
38
+import {fileParam, reactiveTableAndAny} from "@/api/ApiModel";
39
+import {Api} from "@/api/api";
40
+
41
+const { proxy } = getCurrentInstance() as any;
42
+// 全局方法定义
43
+const NumberHandle = proxy.$NumberHandle
44
+
45
+const emit = defineEmits<{
46
+  (event: "init"): void;
47
+}>();
48
+
49
+
50
+const pageInfo = reactive<reactiveTableAndAny>({
51
+  limitList:[]
52
+})
53
+
54
+const nameRef=ref<{value:string}>()
55
+const markRef=ref<{value:string}>()
56
+const loading=ref<boolean>(false)
57
+const confirmEvent = async () => {
58
+  if(nameRef.value!.value==''){
59
+    ElMessage.error('名称为必填项')
60
+    return
61
+  }
62
+  loading.value = true
63
+  const paramsModel = reactive<fileParam>({
64
+    pid:0,
65
+    name:nameRef.value!.value,
66
+    remarks:markRef.value!.value,
67
+  })
68
+  let res:any = await proxy.$http.post(Api.file_add,paramsModel)
69
+  loading.value = false
70
+  if(res&&res.errNo=='0'){
71
+    let resNew:any = res.rst
72
+    dialogShow.value = false
73
+    emit('init')
74
+  }else{
75
+    ElMessage.error(res.errMsg)
76
+  }
77
+}
78
+
79
+
80
+// 切换显隐
81
+const dialogShow = ref<boolean>(false)
82
+const switchShow = (val:boolean)=>{
83
+  dialogShow.value = val
84
+  if(val){
85
+    nextTick(()=>{
86
+      nameRef.value!.value = ''
87
+    })
88
+  }
89
+}
90
+// 父组件共享值
91
+defineExpose({
92
+  switchShow,
93
+});
94
+onMounted(()=>{
95
+  nextTick(()=>{
96
+
97
+  })
98
+})
99
+</script>
100
+<style lang="scss" scoped>
101
+
102
+</style>

+ 243 - 0
src/components/businessMoudle/memberManage/index.vue

@@ -0,0 +1,243 @@
1
+<template>
2
+  <div class="screenBox_mini tMar0">
3
+    <Select ref="ideaManRef"
4
+            :clearFlag="true"
5
+            title="账号状态"
6
+            selectWidth="160px"
7
+            :optObj="{k:'id',la:'username',val:'id'}"
8
+            @changeEvent="init()" @clearEvent="init()"
9
+            :options="pageInfo.accStatusList"/>
10
+    <Input ref="InputRef_text" title="" placeholderTxt="用户名或邮箱" @changeEvent="init()" @clearEvent="init()"/>
11
+  </div>
12
+  <div class="albumBox flex">
13
+    <div class="albumTree">
14
+      <div class="title flex">
15
+        <el-button type="primary" plain @click="newAddEvent">添加部门</el-button>
16
+        <Input ref="InputRef_text" title="" placeholderTxt="搜索部门" @changeEvent="init()" @clearEvent="init()"/>
17
+      </div>
18
+      <div class="companyBox">北京酷炫网络技术股份有限公司</div>
19
+      <div class="treeBox" v-loading="treeLoading">
20
+        <el-tree ref="treeRef"
21
+                 :data="pageInfo.treeList"
22
+                 :props="defaultProps"
23
+                 node-key="id"
24
+                 :expand-on-click-node="false"
25
+                 :highlight-current="true">
26
+          <template #default="{ node }">
27
+            <span style="color: #161E46">{{ node.label }}</span>
28
+            <div class="lMarauto f14 rMar10" @click.stop>
29
+              <el-dropdown size="default">
30
+                <el-icon color="#96969D"><i-ep-MoreFilled /></el-icon>
31
+                <template #dropdown>
32
+                  <el-dropdown-menu>
33
+                    <el-dropdown-item  @click="handleCommand('edit',node)">编辑</el-dropdown-item>
34
+                    <el-dropdown-item @click="handleCommand('dele',node)">删除</el-dropdown-item>
35
+                  </el-dropdown-menu>
36
+                </template>
37
+              </el-dropdown>
38
+            </div>
39
+          </template>
40
+        </el-tree>
41
+      </div>
42
+    </div>
43
+    <div class="albumContent">
44
+      <div class="title flex">
45
+        <el-button type="primary" @click="newAddEvent_member">新增成员</el-button>
46
+        <el-button type="primary" plain @click="startEvent">启用</el-button>
47
+      </div>
48
+      <div class="contentBox tMar10" v-loading="fileLoading">
49
+        <!--  列表-->
50
+        <TableList
51
+            ref="tableListRef"
52
+            :tableData="tableInfo.tableList"
53
+            :descol="tableInfo.descolList"
54
+            :total="total"
55
+            @init="init"
56
+        >
57
+          <template v-slot:operate="slotProps">
58
+            <div class="text-center">
59
+              <span class="operate_text lMar8">编辑</span>
60
+              <Popconfirm key="psd" popTxt="重置密码" @confirm="resetPsd(slotProps.row)"/>
61
+              <Popconfirm key="ty" popTxt="停用" @confirm="outService(slotProps.row)"/>
62
+            </div>
63
+          </template>
64
+        </TableList>
65
+      </div>
66
+    </div>
67
+  </div>
68
+
69
+<!--  添加部门-->
70
+  <AddDepartment ref="AddDepartmentRef" @init="init"></AddDepartment>
71
+</template>
72
+<script setup lang="ts">
73
+import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
74
+import Select from '@/components/capsulationMoudle/_select.vue'
75
+import {departParams, fileParam, reactiveTableAndAny} from "@/api/ApiModel";
76
+import Input from '@/components/capsulationMoudle/_input.vue'
77
+import TableList from '@/components/capsulationMoudle/tableList.vue'
78
+import noData from '@/components/capsulationMoudle/noData.vue'
79
+import {Api} from "@/api/api";
80
+import {ElMessage} from "element-plus";
81
+import {publicTableTs} from "@/components/businessMoudle/tableInfo";
82
+import Popconfirm from '@/components/capsulationMoudle/_popconfirm.vue'
83
+import AddDepartment from '@/components/businessMoudle/memberManage/dialog/addDepartment.vue'
84
+
85
+const { proxy } = getCurrentInstance() as any;
86
+// 全局方法定义
87
+const NumberHandle = proxy.$NumberHandle
88
+
89
+//tree相关
90
+const defaultProps = {
91
+  children: 'childs',
92
+  label: 'name',
93
+}
94
+const treeRef = ref<any>()
95
+
96
+//页面数据
97
+const pageInfo = reactive<reactiveTableAndAny>({
98
+  hightLightFlag:true,
99
+  treeList:[],
100
+  treeId:0,
101
+  accStatusList:[]
102
+})
103
+const currentPage = ref<number>(1)
104
+const pageSize = ref<number>(20)
105
+const fileLoading = ref<boolean>(false)
106
+const treeLoading = ref<boolean>(false)
107
+
108
+
109
+// 表格数据公共ts
110
+const descolParams = reactive([
111
+  { name:'用户名',column:'account_name',},
112
+  { name:'部门',column:'account_id'},
113
+  { name:'权限',column:'type_name',},
114
+  { name:'状态',column:'username',},
115
+  { name:'操作',column:'operate',slotFlag: true},
116
+])
117
+const { tableInfo,tableListRef,total } = publicTableTs(descolParams)
118
+
119
+// 专辑树点击
120
+interface Tree {
121
+  label: string
122
+  children?: Tree[]
123
+}
124
+
125
+const AddDepartmentRef = ref<{switchShow:(val:boolean,info?:any)=>void}>()
126
+const newAddEvent = () => {
127
+  nextTick(()=>{
128
+    AddDepartmentRef.value!.switchShow(true)
129
+  })
130
+}
131
+const handleCommand = (type:string,node: any) => {
132
+  if(type == 'edit'){
133
+    nextTick(()=>{
134
+      AddDepartmentRef.value!.switchShow(true,node?.data?.id ? node?.data : node?.data?.childs[0])
135
+    })
136
+  }else if(type == 'dele'){
137
+    deleDepart(node?.data?.id || node?.data?.childs[0]?.id)
138
+  }
139
+}
140
+
141
+const deleDepart = async (id:any) => {
142
+  treeLoading.value = true
143
+  const paramsModel = reactive<departParams>({
144
+    id:id,
145
+  })
146
+  let res:any = await proxy.$http.post(Api.depart_dele,paramsModel)
147
+  if(res&&res.errNo=='0'){
148
+    let resNew:any = res.rst
149
+    init()
150
+  }else{
151
+    treeLoading.value = false
152
+    ElMessage.error(res.errMsg)
153
+  }
154
+}
155
+const newAddEvent_member = () => {
156
+
157
+}
158
+const startEvent = () => {
159
+
160
+}
161
+
162
+const init = async () => {
163
+  treeLoading.value = true
164
+  let res:any = await proxy.$http.get(Api.depart_list)
165
+  treeLoading.value = false
166
+  if(res&&res.errNo=='0'){
167
+    let resNew:any = res.rst
168
+    pageInfo.treeList = resNew
169
+    // if(pageInfo!.treeList!.length>0){
170
+    //   pageInfo.treeId = pageInfo.treeList[pageInfo.treeList.length-1].id
171
+    //   nextTick(()=>{treeRef.value!.setCurrentKey(pageInfo.treeId)})
172
+    // }
173
+  }else{
174
+    ElMessage.error(res.errMsg)
175
+  }
176
+}
177
+
178
+const resetPsd = (item:any) => {
179
+
180
+}
181
+
182
+const outService = (item:any)=>{
183
+
184
+}
185
+
186
+
187
+onMounted(()=>{
188
+  nextTick(async ()=>{
189
+    await init()
190
+  })
191
+})
192
+</script>
193
+<style lang="scss" scoped>
194
+.albumBox{
195
+  align-items: flex-start;
196
+  .albumTree{
197
+    background-color: #fff;
198
+    width: 20%;
199
+    padding: 0 10px;
200
+    margin-right: 10px;
201
+    flex-shrink: 0;
202
+    .title{
203
+      height: 46px;
204
+    }
205
+    .treeBox{
206
+      margin-top: 14px;
207
+      height: calc(100vh - 255px);
208
+      :deep(.el-tree-node__content){
209
+        --el-tree-node-content-height: 42px;
210
+      }
211
+      overflow-y: auto;
212
+      scrollbar-color: transparent transparent;
213
+      &::-webkit-scrollbar{
214
+        width: 2px;
215
+      }
216
+    }
217
+    .companyBox{
218
+      width: 100%;
219
+      height: 38px;
220
+      line-height: 38px;
221
+      background: rgba(49, 115, 255, 0.15);
222
+      border-radius: 4px;
223
+      color: #3173FF;
224
+      font-size: 14px;
225
+      text-align: center;
226
+    }
227
+  }
228
+  .albumContent{
229
+    background-color: #fff;
230
+    flex: 1;
231
+    padding: 10px 13px;
232
+    .contentBox{
233
+      width: 100%;
234
+      height: calc(100vh - 285px - 60px);
235
+      overflow-y: auto;
236
+      scrollbar-color: transparent transparent;
237
+      &::-webkit-scrollbar{
238
+        width: 2px;
239
+      }
240
+    }
241
+  }
242
+}
243
+</style>

+ 148 - 0
src/components/businessMoudle/projectManage/dialog/addProject.vue

@@ -0,0 +1,148 @@
1
+<template>
2
+
3
+  <Dialog ref="DialogRef_editType"
4
+          :dialogVisible="dialogShow"
5
+          @confirm="confirmEvent"
6
+          @close="dialogShow = false"
7
+          width="800px"
8
+          :dialog-title="pageInfo.title">
9
+    <template v-slot:content>
10
+      <div class="dialogBox" v-loading="loading">
11
+        <Input ref="nameRef" spanTitleWidth="80px" inputWidth="80%" title="项目名称" :haveTag="true" :haverMar15="false"/>
12
+        <Input ref="nameRef" class="tMar20" spanTitleWidth="80px" inputWidth="80%" title="备注" :haverMar15="false"/>
13
+        <Select ref="ideaManRef"
14
+                class="tMar20"
15
+                :clearFlag="true"
16
+                title="项目负责人"
17
+                selectWidth="190px"
18
+                :optObj="{k:'id',la:'username',val:'id'}"
19
+                @changeEvent="init()" @clearEvent="init()"
20
+                :options="pageInfo.chargeList"/>
21
+
22
+        <div class="flex tMar20" style="justify-content: flex-start">
23
+          <span class="spanTitle f14" style="width: 80px;">项目负责人</span>
24
+          <div>
25
+            <el-radio-group v-model="pageInfo.visibleVal">
26
+              <el-radio-button label="所有人可见" />
27
+              <el-radio-button label="指定成员可见" />
28
+            </el-radio-group>
29
+
30
+            <div class="treeBox">
31
+              <el-tree :data="pageInfo.treeList" :props="defaultProps" show-checkbox />
32
+            </div>
33
+
34
+          </div>
35
+        </div>
36
+
37
+      </div>
38
+    </template>
39
+  </Dialog>
40
+
41
+</template>
42
+<script setup lang="ts">
43
+import Select from '@/components/capsulationMoudle/_select.vue'
44
+import Dialog from '@/components/capsulationMoudle/_dialog.vue'
45
+import Input from '@/components/capsulationMoudle/_input.vue'
46
+import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
47
+import {ElMessage} from "element-plus";
48
+import {departParams, fileParam, reactiveTableAndAny} from "@/api/ApiModel";
49
+import {Api} from "@/api/api";
50
+
51
+const { proxy } = getCurrentInstance() as any;
52
+// 全局方法定义
53
+const NumberHandle = proxy.$NumberHandle
54
+
55
+const emit = defineEmits<{
56
+  (event: "init"): void;
57
+}>();
58
+
59
+const defaultProps = {
60
+  children: 'childs',
61
+  label: 'name',
62
+}
63
+
64
+//页面数据
65
+const pageInfo = reactive<reactiveTableAndAny>({
66
+  treeList:[],
67
+  editId:'',
68
+  title:'新增项目',
69
+  chargeList:[],
70
+  visibleVal:'',
71
+})
72
+
73
+const init = async () => {
74
+  let res:any = await proxy.$http.get(Api.depart_list)
75
+  if(res&&res.errNo=='0'){
76
+    let resNew:any = res.rst
77
+    pageInfo.treeList = resNew
78
+  }else{
79
+    ElMessage.error(res.errMsg)
80
+  }
81
+}
82
+
83
+const treeValue=ref('')
84
+const nameRef=ref<{value:string}>()
85
+const loading=ref<boolean>(false)
86
+const confirmEvent = async () => {
87
+  if(nameRef.value!.value==''){
88
+    ElMessage.error('名称为必填项')
89
+    return
90
+  }
91
+  loading.value = true
92
+  let api:string = Api.depart_add
93
+  const paramsModel = reactive<departParams>({
94
+    pid:treeValue.value,
95
+    name:nameRef.value!.value,
96
+  })
97
+  if(pageInfo.editId){ // 编辑
98
+    paramsModel.id = pageInfo.editId
99
+    api = Api.depart_edit
100
+  }
101
+  let res:any = await proxy.$http.post(api,paramsModel)
102
+  loading.value = false
103
+  if(res&&res.errNo=='0'){
104
+    let resNew:any = res.rst
105
+    dialogShow.value = false
106
+    emit('init')
107
+  }else{
108
+    ElMessage.error(res.errMsg)
109
+  }
110
+}
111
+
112
+
113
+// 切换显隐
114
+const dialogShow = ref<boolean>(false)
115
+const switchShow = (val:boolean,info?:any)=>{
116
+  dialogShow.value = val
117
+  if(val){
118
+    nextTick(async ()=>{
119
+      nameRef.value!.value = ''
120
+      treeValue.value = ''
121
+      pageInfo.editId = ''
122
+      await init()
123
+      if(info?.id){ // 编辑
124
+        pageInfo.editId = info?.id
125
+        nameRef.value!.value = info.name
126
+        treeValue.value = info.pid
127
+        pageInfo.title = '编辑项目'
128
+      }
129
+    })
130
+  }
131
+}
132
+// 父组件共享值
133
+defineExpose({
134
+  switchShow,
135
+});
136
+onMounted(()=>{
137
+  nextTick(()=>{
138
+
139
+  })
140
+})
141
+</script>
142
+<style lang="scss" scoped>
143
+.treeBox{
144
+  border-radius: 4px;
145
+  border: 1px solid #EDEDED;
146
+
147
+}
148
+</style>

+ 109 - 0
src/components/businessMoudle/projectManage/index.vue

@@ -0,0 +1,109 @@
1
+<template>
2
+  <div class="screenBox flex">
3
+    <el-button type="primary" class="lMarauto"  @click="addEvent()">新增项目</el-button>
4
+  </div>
5
+
6
+  <!--  列表-->
7
+  <TableList
8
+      ref="tableListRef"
9
+      :tableData="tableInfo.tableList"
10
+      :descol="tableInfo.descolList"
11
+      :total="total"
12
+      @init="init"
13
+  >
14
+    <template v-slot:operate="slotProps">
15
+      <div class="text-center">
16
+        <span class="operate_text lMar8 pointer" @click="editEvent(slotProps.row)">编辑</span>
17
+        <Popconfirm @confirm="deleEvent(slotProps.row)"/>
18
+      </div>
19
+    </template>
20
+  </TableList>
21
+
22
+  <!--  添加部门-->
23
+  <AddProject ref="AddProjectRef" @init="init"></AddProject>
24
+</template>
25
+<script setup lang="ts">
26
+import {nextTick, onMounted, reactive, ref, getCurrentInstance} from 'vue'
27
+import Popconfirm from '@/components/capsulationMoudle/_popconfirm.vue'
28
+import TableList from '@/components/capsulationMoudle/tableList.vue'
29
+import { adqParam, reactiveTableAndAny} from "@/api/ApiModel";
30
+import {Api} from "@/api/api";
31
+import {ElMessage} from "element-plus";
32
+import { publicTableTs } from '@/components/businessMoudle/tableInfo'
33
+import AddProject from '@/components/businessMoudle/projectManage/dialog/addProject.vue'
34
+
35
+const { proxy } = getCurrentInstance() as any;
36
+
37
+
38
+// 表格数据公共ts
39
+const descolParams = reactive([
40
+  { name:'权限名称',column:'account_name',},
41
+  { name:'描述',column:'account_id',cancleForMat:true},
42
+  { name:'更新时间',column:'created_at'},
43
+  { name:'操作',column:'operate',slotFlag: true},
44
+])
45
+const { tableInfo,tableListRef,total } = publicTableTs(descolParams)
46
+
47
+const addEvent = () => {
48
+  nextTick(()=>{
49
+    AddProjectRef.value!.switchShow(true)
50
+  })
51
+}
52
+
53
+const AddProjectRef = ref<{switchShow:(val:boolean,info?:any)=>void}>()
54
+
55
+const InputRef_text = ref<{value:string}>()
56
+
57
+//账号列表
58
+const init = async (page?:any,pageSize?:any) => {
59
+  tableListRef.value!.loading = true
60
+  const paramsModel = reactive<adqParam>({
61
+    page:page?page:1,
62
+    page_size:pageSize?pageSize:20,
63
+  })
64
+  let res:any = await proxy.$http.get(Api.adq_list,paramsModel)
65
+  tableListRef.value!.loading = false
66
+  if(res&&res.errNo=='0'){
67
+    tableInfo.tableList = res.rst.data
68
+    total.value = res.rst.pageInfo.total
69
+  }else{
70
+    ElMessage.error(res.errMsg)
71
+  }
72
+}
73
+
74
+const deleEvent = async (item:any) => {
75
+  tableListRef.value!.loading = true
76
+  const paramsModel = reactive<adqParam>({
77
+    account_id:item.id
78
+  })
79
+  let res:any = await proxy.$http.post(Api.adq_dele,paramsModel)
80
+  tableListRef.value!.loading = false
81
+  ElMessage.info(res.errMsg)
82
+  if(res&&res.errNo=='0'){
83
+    await init()
84
+  }
85
+}
86
+
87
+const editEvent = (item:any) => {
88
+
89
+}
90
+
91
+
92
+onMounted( async ()=>{
93
+  await init()
94
+})
95
+</script>
96
+<style lang="scss" scoped>
97
+.dialogBox{
98
+  :deep(.el-input__wrapper){
99
+    background: #F9F9F9;
100
+    border-radius: 5px;
101
+    border: 1px solid #F1F1F1;
102
+    height: 45px;
103
+    box-shadow:none;
104
+  }
105
+}
106
+.screenArea{
107
+  margin-bottom: 8px;
108
+}
109
+</style>

+ 27 - 0
src/router/index.ts

@@ -16,6 +16,9 @@ const materialLibrary = () => import('@/components/businessMoudle/materialLibrar
16 16
 const collectClip = () => import('@/components/businessMoudle/collectClip/index.vue')
17 17
 const taskList = () => import('@/components/businessMoudle/taskList/index.vue')
18 18
 const adqManage = () => import('@/components/businessMoudle/adqManage.vue')
19
+const limitManage = () => import('@/components/businessMoudle/limitManage/index.vue')
20
+const memberManage = () => import('@/components/businessMoudle/memberManage/index.vue')
21
+const projectManage = () => import('@/components/businessMoudle/projectManage/index.vue')
19 22
 const miniprogram = () => import('@/components/businessMoudle/miniprogram/index.vue')
20 23
 const batchGdt = () => import('@/components/businessMoudle/batchGdt/configArea/index.vue')
21 24
 const gdtList = () => import('@/components/businessMoudle/gdtList/index.vue')
@@ -120,6 +123,30 @@ const constantRoutes: Array<RouteRecordRaw> = [
120 123
         }
121 124
       },
122 125
       {
126
+        path: '/limitManage',
127
+        component: limitManage,
128
+        name: 'limitManage',
129
+        meta: {
130
+          title: '权限管理',
131
+        }
132
+      },
133
+      {
134
+        path: '/memberManage',
135
+        component: memberManage,
136
+        name: 'memberManage',
137
+        meta: {
138
+          title: '成员管理',
139
+        }
140
+      },
141
+      {
142
+        path: '/projectManage',
143
+        component: projectManage,
144
+        name: 'projectManage',
145
+        meta: {
146
+          title: '项目管理',
147
+        }
148
+      },
149
+      {
123 150
         path: '/miniprogram',
124 151
         component: miniprogram,
125 152
         name: 'miniprogram',

+ 3 - 0
src/store/menu.ts

@@ -54,6 +54,9 @@ export const menuStore = defineStore('menuStore', {
54 54
                 {"id":1,"title":"系统管理","route":null,"icon":"icon-a-xitongshezhi2x","level":1,
55 55
                       "sub":[
56 56
                           {"id":5,"title":"adq授权","route":"adqManage","icon":null,"level":2,"sub":[]},
57
+                          {"id":19,"title":"权限管理","route":"limitManage","icon":null,"level":2,"sub":[]},
58
+                          {"id":20,"title":"成员管理","route":"memberManage","icon":null,"level":2,"sub":[]},
59
+                          {"id":21,"title":"项目管理","route":"projectManage","icon":null,"level":2,"sub":[]},
57 60
                           {"id":9,"title":"微信小程序","route":"miniprogram","icon":null,"level":2,"sub":[]},
58 61
                           {"id":6,"title":"账号管理","route":"accountManage","icon":null,"level":2,"sub":[]},
59 62
                           {"id":7,"title":"任务列表","route":"taskList","icon":null,"level":2,"sub":[]},