| <link rel="icon" type="image/svg+xml" href="/logo_1.jpg" /> | <link rel="icon" type="image/svg+xml" href="/logo_1.jpg" /> | ||||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||
| <title>菊城人才市场后台管理</title> | <title>菊城人才市场后台管理</title> | ||||
| <script type="module" crossorigin src="/assets/index-DFiphGzz.js"></script> | |||||
| <link rel="stylesheet" crossorigin href="/assets/index-cIDG0BDa.css"> | |||||
| <script type="module" crossorigin src="/assets/index-DI_9j32K.js"></script> | |||||
| <link rel="stylesheet" crossorigin href="/assets/index-DUAyzA4g.css"> | |||||
| </head> | </head> | ||||
| <body> | <body> | ||||
| <div id="app"></div> | <div id="app"></div> |
| export const GetFeeOrderList = getModel(url.FeeOrderList); | export const GetFeeOrderList = getModel(url.FeeOrderList); | ||||
| export const GetFeeOrderDetail = getModel(url.FeeOrderDetail); | export const GetFeeOrderDetail = getModel(url.FeeOrderDetail); | ||||
| // 字典管理 | |||||
| export const PostDictAdd = postModel(url.DictAdd); | |||||
| export const PostDictDel = postModel(url.DictDel); | |||||
| export const PostDictUpdate = postModel(url.DictUpdate); | |||||
| export const GetDictList = getModel(url.DictList); | |||||
| export const GetDictDetail = getModel(url.DictDetail); |
| FeeOrderList : String, | FeeOrderList : String, | ||||
| FeeOrderDetail : String, | FeeOrderDetail : String, | ||||
| DictAdd: String, // 添加 | |||||
| DictDel: String, // 删除 | |||||
| DictUpdate: String, // 编辑 | |||||
| DictList: String, // 列表 | |||||
| DictDetail: String, // 详情 | |||||
| } | } | ||||
| } | } |
| FeeOrderList: admin + '/fee/order_list', // 列表 | FeeOrderList: admin + '/fee/order_list', // 列表 | ||||
| FeeOrderDetail: admin + '/fee/order_info', // 详情 | FeeOrderDetail: admin + '/fee/order_info', // 详情 | ||||
| // 字典管理 | |||||
| DictAdd: common + '/dict/add', // 添加 | |||||
| DictDel: common + '/dict/del', // 删除 | |||||
| DictUpdate: common + '/dict/update', // 编辑 | |||||
| DictList: common + '/dict/list', // 列表 | |||||
| DictDetail: common + '/dict/detail', // 详情 | |||||
| } | } |
| <template> | <template> | ||||
| <a-table :data-source="data" :columns="columns" scrollToFirstRowOnChange :pagination="pagination" | <a-table :data-source="data" :columns="columns" scrollToFirstRowOnChange :pagination="pagination" | ||||
| @change="pageChange" bordered class="ant-table-striped" childrenColumnName="childs" rowKey="id" :indentSize="30" | |||||
| @change="pageChange" bordered class="ant-table-striped" :childrenColumnName="childrenName" rowKey="id" :indentSize="30" | |||||
| :expanded-row-keys="state.expandRowKeys" | :expanded-row-keys="state.expandRowKeys" | ||||
| :rowClassName="(record, index) => (index % 2 === 1 ? 'table-striped' : null)" :loading="loading" | :rowClassName="(record, index) => (index % 2 === 1 ? 'table-striped' : null)" :loading="loading" | ||||
| :scroll="{ y: 600 }"> | :scroll="{ y: 600 }"> | ||||
| <script lang="ts" setup> | <script lang="ts" setup> | ||||
| import { ref, onMounted, defineEmits, defineProps, watch } from 'vue'; | import { ref, onMounted, defineEmits, defineProps, watch } from 'vue'; | ||||
| let props = defineProps(['data', 'columns', 'pagination', 'loading']); | |||||
| let props = defineProps(['data', 'columns', 'pagination', 'loading', 'childrenName']); | |||||
| const emit = defineEmits(); | const emit = defineEmits(); | ||||
| let data = ref<Object[]>([]) | let data = ref<Object[]>([]) | ||||
| let columns = ref<Object[]>([]) | let columns = ref<Object[]>([]) | ||||
| let loading = ref<Boolean>(props.loading); | let loading = ref<Boolean>(props.loading); | ||||
| let childrenName = ref<String>('childs'); | |||||
| let pagination = ref<CommonType.PageType>({ | let pagination = ref<CommonType.PageType>({ | ||||
| current: 1, | current: 1, | ||||
| pageSize: 10, | pageSize: 10, | ||||
| hideOnSinglePage: false, | hideOnSinglePage: false, | ||||
| showSizeChanger: true | showSizeChanger: true | ||||
| }) | }) | ||||
| watch(() => [props.data, props.columns, props.pagination, props.loading], | |||||
| watch(() => [props.data, props.columns, props.pagination, props.loading,props.childrenName], | |||||
| (newVal, oldVal) => { | (newVal, oldVal) => { | ||||
| data.value = newVal[0]; | data.value = newVal[0]; | ||||
| columns.value = newVal[1]; | columns.value = newVal[1]; | ||||
| pagination.value = newVal[2]; | pagination.value = newVal[2]; | ||||
| loading.value = newVal[3] | |||||
| loading.value = newVal[3]; | |||||
| childrenName.value = newVal[4] | |||||
| }) | }) | ||||
| const pageChange = (val) => { | const pageChange = (val) => { |
| ], | ], | ||||
| }; | }; | ||||
| // 字典管理 | |||||
| const DictionaryRoute : AppRouteRecordRaw = { | |||||
| path: '/dictionary', | |||||
| name: 'dictionary', | |||||
| component: routerList.Dictionary, | |||||
| meta: { | |||||
| title: '字典管理', | |||||
| icon: SettingOutlined | |||||
| }, | |||||
| children: [ | |||||
| // { | |||||
| // path: '/activity/list', | |||||
| // name: 'activityList', | |||||
| // component: routerList.ActivityList, | |||||
| // meta: { | |||||
| // title: '活动列表', | |||||
| // icon: HomeOutlined | |||||
| // }, | |||||
| // }, | |||||
| { | |||||
| path: '/dictionary/list', | |||||
| name: 'dictionaryList', | |||||
| component: routerList.DictionaryList, | |||||
| meta: { | |||||
| title: '字典列表', | |||||
| icon: HomeOutlined | |||||
| }, | |||||
| } | |||||
| ], | |||||
| }; | |||||
| // 求职企业账号管理 | // 求职企业账号管理 | ||||
| // const CustomerRoute : AppRouteRecordRaw = { | // const CustomerRoute : AppRouteRecordRaw = { | ||||
| // path: '/customer', | // path: '/customer', | ||||
| }; | }; | ||||
| export const routesModuleList : AppRouteModule[] = [CompanyRoute,BuyRoute, JokSeekerRoute, JokFairRoute, InformationRoute, AdvertisementRoute, ActivityRoute, StatisticsRoute,PermissionRoute, SettingRoute, OtherRoute, FeedbackRoute]; | |||||
| export const routesModuleList : AppRouteModule[] = [CompanyRoute,BuyRoute, JokSeekerRoute, JokFairRoute, InformationRoute, AdvertisementRoute, ActivityRoute, StatisticsRoute,PermissionRoute, SettingRoute, DictionaryRoute,OtherRoute, FeedbackRoute]; |
| import BuyPackage from '@/views/buy/package/index.vue'; | import BuyPackage from '@/views/buy/package/index.vue'; | ||||
| import BuyOrder from '@/views/buy/order/index.vue'; | import BuyOrder from '@/views/buy/order/index.vue'; | ||||
| // 字典 | |||||
| import Dictionary from '@/views/dictionary/index.vue'; | |||||
| import DictionaryList from '@/views/dictionary/list/index.vue'; | |||||
| export const routerList = { | export const routerList = { | ||||
| Permission, | Permission, | ||||
| ROLE, | ROLE, | ||||
| CustomerList, | CustomerList, | ||||
| Buy, | Buy, | ||||
| BuyPackage, | BuyPackage, | ||||
| BuyOrder | |||||
| BuyOrder, | |||||
| Dictionary, | |||||
| DictionaryList | |||||
| } | } |
| <template> | |||||
| <router-view></router-view> | |||||
| </template> | |||||
| <script> | |||||
| </script> | |||||
| <style> | |||||
| </style> |
| declare namespace DictionaryListType { | |||||
| type addFormType = { | |||||
| code?: String, | |||||
| parent_id?: Number, | |||||
| name?: String, | |||||
| sort_number?: String, | |||||
| display?: String, | |||||
| childs?: Object, | |||||
| } | |||||
| type addOtherFormType = { | |||||
| } | |||||
| } |
| <template> | |||||
| <a-modal v-model:visible="openAddModel" :title="title" ok-text="提交" cancel-text="取消" @ok="sumbitForm" | |||||
| @cancel="cancelModal" width="50%"> | |||||
| <a-form :model="createForm" :label-col="{span: 4}" labelAlign="right"> | |||||
| <a-row gutter="20"> | |||||
| <a-col span="24"> | |||||
| <a-form-item required label="代码名称" name="name"> | |||||
| <a-input v-model:value="createForm.name" placeholder="请输入代码名称" /> | |||||
| </a-form-item> | |||||
| </a-col> | |||||
| <a-col span="24"> | |||||
| <a-form-item required label="代码code" name="code"> | |||||
| <a-input v-model:value="createForm.code" placeholder="请输入代码code" /> | |||||
| </a-form-item> | |||||
| </a-col> | |||||
| <a-col span="24"> | |||||
| <a-form-item required label="代码值" name="value"> | |||||
| <a-input v-model:value="createForm.value" placeholder="请输入代码值" /> | |||||
| </a-form-item> | |||||
| </a-col> | |||||
| <a-col span="24"> | |||||
| <a-form-item required label="是否显示" name="display"> | |||||
| <a-radio-group v-model:value="createForm.display" @change="displayChange"> | |||||
| <a-radio value="S">是</a-radio> | |||||
| <a-radio value="H">否</a-radio> | |||||
| </a-radio-group> | |||||
| </a-form-item> | |||||
| </a-col> | |||||
| </a-row> | |||||
| </a-form> | |||||
| </a-modal> | |||||
| </template> | |||||
| <script setup lang="ts"> | |||||
| import { ref, onMounted, computed, defineProps, watch, defineEmits } from 'vue'; | |||||
| import { PostDictAdd, PostDictUpdate } from '@/apis/models'; | |||||
| import { dataForm, otherDataForm, reset } from '@/views/dictionary/list/add/data.js'; | |||||
| import { useCommon } from '@/hooks/useCommon'; | |||||
| let { store, openAddModel, hideModal, message, richOption } = useCommon(); | |||||
| const emit = defineEmits(); | |||||
| let props = defineProps(['edit_record', 'level_record']); | |||||
| let title = ref<String>('新增字典'); | |||||
| let createForm = ref<DictionaryListType.addFormType>(dataForm) | |||||
| const sumbitForm = () => { | |||||
| console.log(createForm.value) | |||||
| if (!createForm.value.id) { | |||||
| PostDictAdd(createForm.value).then(res => { | |||||
| message.success('创建字典成功'); | |||||
| hideModal(); | |||||
| resetForm(); | |||||
| emit('successAdd'); | |||||
| }).catch(err => { | |||||
| }) | |||||
| } else { | |||||
| PostDictUpdate(createForm.value).then(res => { | |||||
| message.success('修改字典成功'); | |||||
| hideModal(); | |||||
| resetForm(); | |||||
| emit('successAdd'); | |||||
| }).catch(err => { | |||||
| }) | |||||
| } | |||||
| } | |||||
| const resetForm = () => { | |||||
| createForm.value = reset().dataForm; | |||||
| } | |||||
| const cancelModal = () => { | |||||
| emit('closeAdd'); | |||||
| resetForm(); | |||||
| hideModal(); | |||||
| } | |||||
| openAddModel = computed(() => { | |||||
| return store.state.openAddModel; | |||||
| }) | |||||
| watch(() => [props.edit_record, props.level_record], (newVal) => { | |||||
| if (newVal[0]) { | |||||
| console.log(newVal[0]) | |||||
| title.value = '编辑字典'; | |||||
| createForm.value = { | |||||
| id: newVal[0].id, | |||||
| code: newVal[0].code, | |||||
| name: newVal[0].name, | |||||
| display: newVal[0].display, | |||||
| childs: newVal[0].childs, | |||||
| parent_id: newVal[0].ParentId, | |||||
| value: newVal[0].value, | |||||
| } | |||||
| } else if (newVal[1]) { | |||||
| title.value = "添加子级"; | |||||
| if (newVal[1].parent_id == -1) { | |||||
| createForm.value.parent_id = newVal[1].id | |||||
| } else { | |||||
| createForm.value.parent_id = newVal[1].id | |||||
| } | |||||
| } else { | |||||
| title.value = '编辑字典'; | |||||
| } | |||||
| }) | |||||
| </script> | |||||
| <style> | |||||
| </style> |
| export let dataForm = { | |||||
| code: '', | |||||
| parent_id: -1, | |||||
| name: '', | |||||
| value: '', | |||||
| display: '', | |||||
| childs: null, | |||||
| } | |||||
| export let otherDataForm = { | |||||
| } | |||||
| export const reset = () => { | |||||
| dataForm = { | |||||
| code: '', | |||||
| parent_id: -1, | |||||
| name: '', | |||||
| value: '', | |||||
| display: '', | |||||
| childs: null, | |||||
| }; | |||||
| otherDataForm = { | |||||
| } | |||||
| return { dataForm, otherDataForm } | |||||
| } |
| export const cols = <ColType.type[]>[ | |||||
| { | |||||
| title: '代码名称', | |||||
| dataIndex: 'name' | |||||
| }, | |||||
| { | |||||
| title: '代码code', | |||||
| dataIndex: 'code' | |||||
| }, | |||||
| { | |||||
| title: '代码值', | |||||
| dataIndex: 'value' | |||||
| }, | |||||
| { | |||||
| title: '操作', | |||||
| dataIndex: 'operation', | |||||
| slots: { | |||||
| customRender: 'operation' | |||||
| } | |||||
| } | |||||
| ]; |
| <template> | |||||
| <list-search @searchData="searchData" @clearData="clearData" :search_params="commomParams.search"></list-search> | |||||
| <a-c-operation @refresh="clearData"> | |||||
| </a-c-operation> | |||||
| <a-c-table :data="commomParams.table.data" :columns="commomParams.table.columns" :pagination="commomParams.page" | |||||
| @page="getPage" :loading="loading" childrenName="children"> | |||||
| <template #default="{ record }"> | |||||
| <a-row :gutter="10"> | |||||
| <a-col><a-button type="primary" size="small" primary @click="edit(record)">编辑</a-button></a-col> | |||||
| <a-col><a-button type="primary" size="small" primary | |||||
| @click="addLevel(record)">添加子级</a-button></a-col> | |||||
| <a-popconfirm title="是否删除该子级?" @confirm="del(record.id)"> | |||||
| <a-col><a-button v-if="record.parent_id != -1" type="primary" size="small" danger>删除</a-button></a-col> | |||||
| </a-popconfirm> | |||||
| </a-row> | |||||
| </template> | |||||
| </a-c-table> | |||||
| <list-add :edit_record="edit_record" :level_record="level_record" @successAdd="successAdd" | |||||
| @closeAdd="closeAdd"></list-add> | |||||
| </template> | |||||
| <script lang="ts" setup> | |||||
| import { ref, onMounted, watch, computed } from 'vue'; | |||||
| import ListSearch from '@/views/dictionary/list/search/index.vue'; | |||||
| import ListAdd from '@/views/dictionary/list/add/add.vue'; | |||||
| import { GetDictList, GetDictDetail, PostDictDel } from '@/apis/models'; | |||||
| import { useCommon } from '@/hooks/useCommon'; | |||||
| import { cols } from '@/views/dictionary/list/columns'; | |||||
| let { store, commomParams, showModal, showOtherModal1, message } = useCommon(); | |||||
| let loading = ref<Boolean>(true); | |||||
| onMounted(() => { | |||||
| commomParams.value.search.show_childs = true; | |||||
| commomParams.value.search.parent_id = -1; | |||||
| getData(commomParams.value.search); | |||||
| }) | |||||
| const searchData = (data : object) => { | |||||
| commomParams.value.search = data | |||||
| getData(); | |||||
| } | |||||
| const clearData = (data : object) => { | |||||
| if (data) { | |||||
| commomParams.value.search = data | |||||
| } else { | |||||
| commomParams.value.search = { | |||||
| page: 1, | |||||
| pagesize: 10, | |||||
| sort: 'id', | |||||
| sortby: 'asc', | |||||
| keyword: '', | |||||
| parent_id: -1, | |||||
| show_childs: true | |||||
| } | |||||
| } | |||||
| getData(); | |||||
| } | |||||
| const getPage = (data : object) => { | |||||
| commomParams.value.search.page = data.current; | |||||
| commomParams.value.search.pagesize = data.pageSize; | |||||
| getData(); | |||||
| } | |||||
| const getData = async () => { | |||||
| try { | |||||
| loading.value = true; | |||||
| let res = await GetDictList(commomParams.value.search); | |||||
| loading.value = false; | |||||
| commomParams.value.table.data = res.data.dicts; | |||||
| commomParams.value.table.columns = cols; | |||||
| commomParams.value.page = { | |||||
| current: commomParams.value.search.page, | |||||
| pageSize: commomParams.value.search.pagesize, | |||||
| total: res.data.total, | |||||
| pageSizeOptions: ['10', '20', '30', '40'], | |||||
| hideOnSinglePage: false, | |||||
| showSizeChanger: true | |||||
| }; | |||||
| } catch { | |||||
| loading.value = false; | |||||
| } | |||||
| } | |||||
| // 编辑 | |||||
| let edit_record = ref<Object>(null) | |||||
| const edit = (record : object) => { | |||||
| edit_record.value = record; | |||||
| showModal() | |||||
| } | |||||
| // 添加下级 | |||||
| let level_record = ref<Object>(null) | |||||
| const addLevel = (record) => { | |||||
| level_record.value = record; | |||||
| showModal() | |||||
| } | |||||
| const successAdd = () => { | |||||
| getData(); | |||||
| } | |||||
| const closeAdd = () => { | |||||
| edit_record.value = null; | |||||
| } | |||||
| // 删除 | |||||
| const del = (id : number) => { | |||||
| commomParams.value.delRecord = { id: id }; | |||||
| PostDictDel(commomParams.value.delRecord).then(res => { | |||||
| message.success('删除成功'); | |||||
| getData(); | |||||
| }) | |||||
| } | |||||
| </script> | |||||
| <style lang="less" scoped> | |||||
| </style> |
| <template> | |||||
| <a-drawer :width="500" title="搜索" placement="right" :open="openSearchModel" @close="onClose"> | |||||
| <template #extra> | |||||
| <a-button style="margin-right: 8px" @click="clearSearch">清空搜索</a-button> | |||||
| <a-button type="primary" @click="getData">搜索</a-button> | |||||
| </template> | |||||
| <a-form :model="commomParams.search"> | |||||
| <a-row :gutter="[10]"> | |||||
| <a-col span="24"> | |||||
| <a-form-item> | |||||
| <a-input addon-before="关键字" v-model:value="commomParams.search.keyword" | |||||
| placeholder="请输入关键字" @keyup.enter="getData"/> | |||||
| </a-form-item> | |||||
| </a-col> | |||||
| </a-row> | |||||
| </a-form> | |||||
| </a-drawer> | |||||
| </template> | |||||
| <script lang="ts" setup> | |||||
| import { ref, onMounted, watch, computed } from 'vue'; | |||||
| import { useCommon } from '@/hooks/useCommon'; | |||||
| let { store, commomParams, openSearchModel, hideSearch } = useCommon(); | |||||
| let props = defineProps(['search_params']); | |||||
| const emit = defineEmits(); | |||||
| openSearchModel = computed(() => { | |||||
| return store.state.openSearchModel; | |||||
| }) | |||||
| // watch(() => props.search_params, (newVal) => { | |||||
| // emit('searchData', commomParams.value.search) | |||||
| // }) | |||||
| interface listType { | |||||
| parent_id ?: Number | |||||
| } | |||||
| commomParams.value.search = commomParams.value.search as listType; | |||||
| commomParams.value.search.parent_id = -1; | |||||
| commomParams.value.search.show_childs = true; | |||||
| const getData = () => { | |||||
| emit('searchData', commomParams.value.search); | |||||
| hideSearch() | |||||
| } | |||||
| // 清空搜索 | |||||
| const clearSearch = () => { | |||||
| commomParams.value.search = { | |||||
| page: 1, | |||||
| pagesize: 10, | |||||
| sort: 'id', | |||||
| sortby: 'asc', | |||||
| keyword: '' | |||||
| } | |||||
| emit('clearData', commomParams.value.search); | |||||
| hideSearch() | |||||
| } | |||||
| const onClose = () => { | |||||
| clearSearch() | |||||
| hideSearch() | |||||
| } | |||||
| </script> | |||||
| <style> | |||||
| </style> |
| let cascaderParentId = ref([]); | let cascaderParentId = ref([]); | ||||
| const listFieldNames = ref({ label: 'name', value: 'id', children: 'childs' }); | const listFieldNames = ref({ label: 'name', value: 'id', children: 'childs' }); | ||||
| let createForm = ref<companyDepartmentType.addFormType>(dataForm) | |||||
| let addOtherForm = ref<companyDepartmentType.addOtherFormType>(otherDataForm) | |||||
| let createForm = ref<accountType.addAccountType>(dataForm) | |||||
| let addOtherForm = ref<accountType.addAccountType>(otherDataForm) | |||||
| onMounted(() => { | onMounted(() => { | ||||
| getPermissionListWithchilds({ page: 1, pagesize: 999 }).then(res => { | getPermissionListWithchilds({ page: 1, pagesize: 999 }).then(res => { |