lrf 7 tháng trước cách đây
mục cha
commit
17746eb017

+ 0 - 1
src/components/Breadcrumb/index.vue

@@ -47,7 +47,6 @@ function getBreadcrumb() {
 
 const getMenu = (route) => {
   const menu = menus.value.find((f) => f.path === route.path)
-  console.log(menu)
   if (menu) route.meta.title = get(menu, 'name')
   return route
 }

+ 2 - 1
src/views/exam/index.vue

@@ -20,7 +20,8 @@ import { get } from 'lodash-es'
 import { defineAsyncComponent } from 'vue'
 const componentList = ref({
   contact: defineAsyncComponent(() => import('./parts/contact.vue')),
-  company: defineAsyncComponent(() => import('./parts/company.vue'))
+  company: defineAsyncComponent(() => import('./parts/company.vue')),
+  setting: defineAsyncComponent(() => import('./parts/setting.vue')),
 })
 const value = ref()
 const viewComponent = ref()

+ 95 - 0
src/views/exam/parts/setting.vue

@@ -0,0 +1,95 @@
+<template>
+  <div id="setting">
+    <el-card header="联系申请审核设置">
+      <custom-form v-model="form" :fields="fields" @save="toSave">
+        <template #demand>
+          <el-option v-for="i in deptList" :key="i.id" :label="i.name" :value="i.id"></el-option>
+        </template>
+        <template #supply>
+          <el-option v-for="i in deptList" :key="i.id" :label="i.name" :value="i.id"></el-option>
+        </template>
+        <template #project>
+          <el-option v-for="i in deptList" :key="i.id" :label="i.name" :value="i.id"></el-option>
+        </template>
+        <template #achievement>
+          <el-option v-for="i in deptList" :key="i.id" :label="i.name" :value="i.id"></el-option>
+        </template>
+        <template #incubator>
+          <el-option v-for="i in deptList" :key="i.id" :label="i.name" :value="i.id"></el-option>
+        </template>
+      </custom-form>
+    </el-card>
+  </div>
+</template>
+
+<script setup>
+import { DeptStore } from '@/store/api/system/dept'
+import { DesignStore } from '@/store/api/platform/design'
+import { onMounted } from 'vue'
+import { get, omit } from 'lodash-es'
+const store = DesignStore()
+const deptStore = DeptStore()
+const $checkRes = inject('$checkRes')
+const form = ref({})
+const dataId = ref()
+/**
+ * 需求数据:投资部
+ * 供给数据:投资部
+ * 项目数据:投资部
+ * 成果数据:创合部
+ * 孵化基地:创合部
+ */
+const fields = ref([
+  { label: '需求数据', selectplaceholder: '请选择负责审核的部门', model: 'demand', type: 'select' },
+  { label: '供给数据', selectplaceholder: '请选择负责审核的部门', model: 'supply', type: 'select' },
+  { label: '项目数据', selectplaceholder: '请选择负责审核的部门', model: 'project', type: 'select' },
+  { label: '成果数据', selectplaceholder: '请选择负责审核的部门', model: 'achievement', type: 'select' },
+  { label: '孵化基地', selectplaceholder: '请选择负责审核的部门', model: 'incubator', type: 'select' }
+])
+
+const toSave = async () => {
+  if (!dataId) return
+  const contactApplyConfig = form.value
+  const res = await store.update({ id: dataId.value, contactApplyConfig })
+  $checkRes(res, true, res.errmsg)
+}
+
+onMounted(() => {
+  getOtherList()
+  search()
+})
+const search = async () => {
+  const res = await store.query()
+  if ($checkRes(res)) {
+    const contactApplyConfig = get(res, 'data.0.contactApplyConfig', {})
+    form.value = contactApplyConfig
+    dataId.value = get(res, 'data.0.id')
+  }
+}
+
+const deptList = ref([])
+const getOtherList = async () => {
+  const result = await deptStore.query()
+  if ($checkRes(result)) {
+    const originData = get(result, 'data', [])
+    const odList = flattenDept(originData)
+    deptList.value = odList
+  }
+}
+
+const flattenDept = (list) => {
+  const returnData = []
+  for (const i of list) {
+    const od = omit(i, ['children'])
+    returnData.push(od)
+    const children = get(i, 'children', [])
+    if (children.length > 0) {
+      const childrenList = flattenDept(children)
+      returnData.push(...childrenList)
+    }
+  }
+
+  return returnData
+}
+</script>
+<style scoped></style>