| | |
| | | VITE_PUBLIC_PATH = / |
| | | |
| | | # è·¨å代çï¼æ¨å¯ä»¥é
ç½®å¤ä¸ª ,请注æï¼æ²¡ææ¢è¡ç¬¦ |
| | | VITE_PROXY = [["/jeecgboot","http://192.168.21.70:9999"],["/upload","http://localhost:3300/upload"]] |
| | | VITE_PROXY = [["/herb","http://192.168.21.70:9999"],["/upload","http://localhost:3300/upload"]] |
| | | |
| | | # æ§å¶å°ä¸è¾åº |
| | | VITE_DROP_CONSOLE = false |
| | | |
| | | #åå°æ¥å£ç¶å°å(å¿
å¡«) |
| | | VITE_GLOB_API_URL=/jeecgboot |
| | | VITE_GLOB_API_URL=/herb |
| | | |
| | | #åå°æ¥å£å
¨è·¯å¾å°å(å¿
å¡«) |
| | | VITE_GLOB_DOMAIN_URL=http://192.168.21.70:9999 |
| | |
| | | VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false |
| | | |
| | | #åå°æ¥å£ç¶å°å(å¿
å¡«) |
| | | VITE_GLOB_API_URL=/jeecgboot |
| | | VITE_GLOB_API_URL=/herb |
| | | |
| | | #åå°æ¥å£å
¨è·¯å¾å°å(å¿
å¡«) |
| | | VITE_GLOB_DOMAIN_URL=http://jeecg-boot-system:8080/jeecg-boot |
| | | VITE_GLOB_DOMAIN_URL=http://jeecg-boot-gateway:9999 |
| | | |
| | | # æ¥å£ç¶è·¯å¾åç¼ |
| | | VITE_GLOB_API_URL_PREFIX= |
| | |
| | | VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false |
| | | |
| | | #åå°æ¥å£ç¶å°å(å¿
å¡«) |
| | | VITE_GLOB_API_URL=/jeecgboot |
| | | VITE_GLOB_API_URL=/herb |
| | | |
| | | #åå°æ¥å£å
¨è·¯å¾å°å(å¿
å¡«) |
| | | VITE_GLOB_DOMAIN_URL=http://localhost:8080/jeecg-boot |
| | |
| | | FROM nginx |
| | | MAINTAINER jeecgos@163.com |
| | | MAINTAINER bsw |
| | | VOLUME /tmp |
| | | ENV LANG en_US.UTF-8 |
| | | RUN echo "server { \ |
| | | listen 80; \ |
| | | location /jeecgboot/ { \ |
| | | proxy_pass http://jeecg-boot-system:8080/jeecg-boot/; \ |
| | | location /herb/ { \ |
| | | proxy_pass http://jeecg-boot-gateway:9999/; \ |
| | | proxy_redirect off; \ |
| | | proxy_set_header Host jeecg-boot-system; \ |
| | | proxy_set_header Host jeecg-boot-gateway; \ |
| | | proxy_set_header X-Real-IP \$remote_addr; \ |
| | | proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \ |
| | | } \ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <!--å¼ç¨è¡¨æ ¼--> |
| | | <BasicTable @register="registerTable" :rowSelection="rowSelection"> |
| | | <!--ææ§½:tableæ é¢--> |
| | | <template #tableTitle> |
| | | <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> æ°å¢</a-button> |
| | | <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导åº</a-button> |
| | | <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导å
¥</j-upload-button> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <template #overlay> |
| | | <a-menu> |
| | | <a-menu-item key="1" @click="batchHandleDelete"> |
| | | <Icon icon="ant-design:delete-outlined"></Icon> |
| | | å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </template> |
| | | <a-button>æ¹éæä½ |
| | | <Icon icon="mdi:chevron-down"></Icon> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </template> |
| | | <!--æä½æ --> |
| | | <template #action="{ record }"> |
| | | <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> |
| | | </template> |
| | | <!--åæ®µåæ¾ææ§½--> |
| | | <template #htmlSlot="{text}"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <!--çå¸åºåæ®µåæ¾ææ§½--> |
| | | <template #pcaSlot="{text}"> |
| | | {{ getAreaTextByCode(text) }} |
| | | </template> |
| | | <template #fileSlot="{text}"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">ä¸è½½</a-button> |
| | | </template> |
| | | </BasicTable> |
| | | <!-- 表ååºå --> |
| | | <DryResultModal @register="registerModal" @success="handleSuccess"></DryResultModal> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts" name="dry-dryResult" setup> |
| | | import {ref, computed, unref} from 'vue'; |
| | | import {BasicTable, useTable, TableAction} from '/@/components/Table'; |
| | | import {useModal} from '/@/components/Modal'; |
| | | import { useListPage } from '/@/hooks/system/useListPage' |
| | | import DryResultModal from './components/DryResultModal.vue' |
| | | import {columns, searchFormSchema} from './dataDefine/DryResult.data'; |
| | | import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './api/DryResult.api'; |
| | | import { downloadFile } from '/@/utils/common/renderUtils'; |
| | | const checkedKeys = ref<Array<string | number>>([]); |
| | | //注åmodel |
| | | const [registerModal, {openModal}] = useModal(); |
| | | //注åtableæ°æ® |
| | | const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ |
| | | tableProps:{ |
| | | title: 'æµè¯ç»æ', |
| | | api: list, |
| | | columns, |
| | | canResize:false, |
| | | formConfig: { |
| | | //labelWidth: 120, |
| | | schemas: searchFormSchema, |
| | | autoSubmitOnEnter:true, |
| | | showAdvancedButton:true, |
| | | fieldMapToNumber: [ |
| | | ], |
| | | fieldMapToTime: [ |
| | | ], |
| | | }, |
| | | actionColumn: { |
| | | width: 120, |
| | | fixed:'right' |
| | | }, |
| | | }, |
| | | exportConfig: { |
| | | name:"æµè¯ç»æ", |
| | | url: getExportUrl, |
| | | }, |
| | | importConfig: { |
| | | url: getImportUrl, |
| | | success: handleSuccess |
| | | }, |
| | | }) |
| | | |
| | | const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext |
| | | |
| | | /** |
| | | * æ°å¢äºä»¶ |
| | | */ |
| | | function handleAdd() { |
| | | openModal(true, { |
| | | isUpdate: false, |
| | | showFooter: true, |
| | | }); |
| | | } |
| | | /** |
| | | * ç¼è¾äºä»¶ |
| | | */ |
| | | function handleEdit(record: Recordable) { |
| | | openModal(true, { |
| | | record, |
| | | isUpdate: true, |
| | | showFooter: true, |
| | | }); |
| | | } |
| | | /** |
| | | * 详æ
|
| | | */ |
| | | function handleDetail(record: Recordable) { |
| | | openModal(true, { |
| | | record, |
| | | isUpdate: true, |
| | | showFooter: false, |
| | | }); |
| | | } |
| | | /** |
| | | * å é¤äºä»¶ |
| | | */ |
| | | async function handleDelete(record) { |
| | | await deleteOne({id: record.id}, handleSuccess); |
| | | } |
| | | /** |
| | | * æ¹éå é¤äºä»¶ |
| | | */ |
| | | async function batchHandleDelete() { |
| | | await batchDelete({ids: selectedRowKeys.value}, handleSuccess); |
| | | } |
| | | /** |
| | | * æååè° |
| | | */ |
| | | function handleSuccess() { |
| | | (selectedRowKeys.value = []) && reload(); |
| | | } |
| | | /** |
| | | * æä½æ |
| | | */ |
| | | function getTableAction(record){ |
| | | return [ |
| | | { |
| | | label: 'ç¼è¾', |
| | | onClick: handleEdit.bind(null, record), |
| | | } |
| | | ] |
| | | } |
| | | /** |
| | | * 䏿æä½æ |
| | | */ |
| | | function getDropDownAction(record){ |
| | | return [ |
| | | { |
| | | label: '详æ
', |
| | | onClick: handleDetail.bind(null, record), |
| | | }, { |
| | | label: 'å é¤', |
| | | popConfirm: { |
| | | title: 'æ¯å¦ç¡®è®¤å é¤', |
| | | confirm: handleDelete.bind(null, record), |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import {defHttp} from '/@/utils/http/axios'; |
| | | import { useMessage } from "/@/hooks/web/useMessage"; |
| | | |
| | | const { createConfirm } = useMessage(); |
| | | |
| | | enum Api { |
| | | list = '/dry/dryResult/list', |
| | | save='/dry/dryResult/add', |
| | | edit='/dry/dryResult/edit', |
| | | deleteOne = '/dry/dryResult/delete', |
| | | deleteBatch = '/dry/dryResult/deleteBatch', |
| | | importExcel = '/dry/dryResult/importExcel', |
| | | exportXls = '/dry/dryResult/exportXls', |
| | | } |
| | | /** |
| | | * 导åºapi |
| | | * @param params |
| | | */ |
| | | export const getExportUrl = Api.exportXls; |
| | | /** |
| | | * 导å
¥api |
| | | */ |
| | | export const getImportUrl = Api.importExcel; |
| | | /** |
| | | * å表æ¥å£ |
| | | * @param params |
| | | */ |
| | | export const list = (params) => |
| | | defHttp.get({url: Api.list, params}); |
| | | |
| | | /** |
| | | * å é¤å个 |
| | | */ |
| | | export const deleteOne = (params,handleSuccess) => { |
| | | return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { |
| | | handleSuccess(); |
| | | }); |
| | | } |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param params |
| | | */ |
| | | export const batchDelete = (params, handleSuccess) => { |
| | | createConfirm({ |
| | | iconType: 'warning', |
| | | title: '确认å é¤', |
| | | content: 'æ¯å¦å é¤é䏿°æ®', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { |
| | | handleSuccess(); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | /** |
| | | * ä¿åæè
æ´æ° |
| | | * @param params |
| | | */ |
| | | export const saveOrUpdate = (params, isUpdate) => { |
| | | let url = isUpdate ? Api.edit : Api.save; |
| | | return defHttp.post({url: url, params}); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="min-height: 400px"> |
| | | <BasicForm @register="registerForm"></BasicForm> |
| | | <div style="width: 100%;text-align: center" v-if="!formDisabled"> |
| | | <a-button @click="submitForm" pre-icon="ant-design:check" type="primary">æ 交</a-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import {BasicForm, useForm} from '/@/components/Form/index'; |
| | | import {computed, defineComponent} from 'vue'; |
| | | import {defHttp} from '/@/utils/http/axios'; |
| | | import { propTypes } from '/@/utils/propTypes'; |
| | | import {getBpmFormSchema} from '../dataDefine/DryResult.data'; |
| | | import {saveOrUpdate} from '../api/DryResult.api'; |
| | | |
| | | export default defineComponent({ |
| | | name: "DryResultForm", |
| | | components:{ |
| | | BasicForm |
| | | }, |
| | | props:{ |
| | | formData: propTypes.object.def({}), |
| | | formBpm: propTypes.bool.def(true), |
| | | }, |
| | | setup(props){ |
| | | const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({ |
| | | labelWidth: 150, |
| | | schemas: getBpmFormSchema(props.formData), |
| | | showActionButtonGroup: false, |
| | | baseColProps: {span: 24} |
| | | }); |
| | | |
| | | const formDisabled = computed(()=>{ |
| | | if(props.formData.disabled === false){ |
| | | return false; |
| | | } |
| | | return true; |
| | | }); |
| | | |
| | | let formData = {}; |
| | | const queryByIdUrl = '/dry/dryResult/queryById'; |
| | | async function initFormData(){ |
| | | let params = {id: props.formData.dataId}; |
| | | const data = await defHttp.get({url: queryByIdUrl, params}); |
| | | formData = {...data} |
| | | //设置表åçå¼ |
| | | await setFieldsValue(formData); |
| | | //é»è®¤æ¯ç¦ç¨ |
| | | await setProps({disabled: formDisabled.value}) |
| | | } |
| | | |
| | | async function submitForm() { |
| | | let data = getFieldsValue(); |
| | | let params = Object.assign({}, formData, data); |
| | | console.log('è¡¨åæ°æ®', params) |
| | | await saveOrUpdate(params, true) |
| | | } |
| | | |
| | | initFormData(); |
| | | |
| | | return { |
| | | registerForm, |
| | | formDisabled, |
| | | submitForm, |
| | | } |
| | | } |
| | | }); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit"> |
| | | <BasicForm @register="registerForm" /> |
| | | </BasicModal> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { computed, ref, unref } from 'vue' |
| | | import { saveOrUpdate } from '../api/DryResult.api' |
| | | import { formSchema } from '../dataDefine/DryResult.data' |
| | | import { BasicForm, useForm } from '/@/components/Form/index' |
| | | import { BasicModal, useModalInner } from '/@/components/Modal' |
| | | // Emits声æ |
| | | const emit = defineEmits(['register', 'success']) |
| | | const isUpdate = ref(true) |
| | | //表åé
ç½® |
| | | const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({ |
| | | //labelWidth: 150, |
| | | schemas: formSchema, |
| | | showActionButtonGroup: false, |
| | | baseColProps: { span: 24 }, |
| | | }) |
| | | //表åèµå¼ |
| | | const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { |
| | | //é置表å |
| | | await resetFields() |
| | | setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter }) |
| | | isUpdate.value = !!data?.isUpdate |
| | | if (unref(isUpdate)) { |
| | | //表åèµå¼ |
| | | await setFieldsValue({ |
| | | ...data.record, |
| | | }) |
| | | } |
| | | // éèåºé¨æ¶ç¦ç¨æ´ä¸ªè¡¨å |
| | | setProps({ disabled: !data?.showFooter }) |
| | | }) |
| | | //设置æ é¢ |
| | | const title = computed(() => (!unref(isUpdate) ? 'æ°å¢' : 'ç¼è¾')) |
| | | //表åæäº¤äºä»¶ |
| | | async function handleSubmit(v) { |
| | | try { |
| | | let values = await validate() |
| | | setModalProps({ confirmLoading: true }) |
| | | //æäº¤è¡¨å |
| | | await saveOrUpdate(values, isUpdate.value) |
| | | //å
³éå¼¹çª |
| | | closeModal() |
| | | //å·æ°å表 |
| | | emit('success') |
| | | } finally { |
| | | setModalProps({ confirmLoading: false }) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | /** æ¶é´åæ°åè¾å
¥æ¡æ ·å¼ */ |
| | | :deep(.ant-input-number) { |
| | | width: 100%; |
| | | } |
| | | |
| | | :deep(.ant-calendar-picker) { |
| | | width: 100%; |
| | | } |
| | | </style> |
| | |
| | | }, |
| | | ] |
| | | //æ¥è¯¢æ°æ® |
| | | export const searchFormSchema: FormSchema[] = [] |
| | | export const searchFormSchema: FormSchema[] = [ |
| | | { |
| | | label: '工忶é´', |
| | | field: 'orderTime', |
| | | component: 'RangePicker', |
| | | componentProps: { |
| | | valueType: 'Date', |
| | | }, |
| | | colProps: { span: 6 }, |
| | | }, |
| | | { |
| | | label: 'è¯æåç§°', |
| | | field: 'herbName', |
| | | component: 'Input', |
| | | colProps: { span: 6 }, |
| | | }, |
| | | ] |
| | | //è¡¨åæ°æ® |
| | | export const formSchema: FormSchema[] = [ |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import {BasicColumn} from '/@/components/Table'; |
| | | import {FormSchema} from '/@/components/Table'; |
| | | import { rules} from '/@/utils/helper/validator'; |
| | | import { render } from '/@/utils/common/renderUtils'; |
| | | //åè¡¨æ°æ® |
| | | export const columns: BasicColumn[] = [ |
| | | { |
| | | title: 'è¯æåç§°', |
| | | align:"center", |
| | | dataIndex: 'herbName' |
| | | }, |
| | | { |
| | | title: 'è£
æé', |
| | | align:"center", |
| | | dataIndex: 'feed' |
| | | }, |
| | | { |
| | | title: 'åå§éé', |
| | | align:"center", |
| | | dataIndex: 'weight' |
| | | }, |
| | | { |
| | | title: 'ç®æ æ°´å', |
| | | align:"center", |
| | | dataIndex: 'target' |
| | | }, |
| | | { |
| | | title: 'å·¥åå·', |
| | | align:"center", |
| | | dataIndex: 'orderNo' |
| | | }, |
| | | { |
| | | title: 'å·¥åid', |
| | | align:"center", |
| | | dataIndex: 'orderId' |
| | | }, |
| | | { |
| | | title: 'åå·¦', |
| | | align:"center", |
| | | dataIndex: 'frontLeft' |
| | | }, |
| | | { |
| | | title: 'åå·¦', |
| | | align:"center", |
| | | dataIndex: 'frontRight' |
| | | }, |
| | | { |
| | | title: 'ä¸å·¦', |
| | | align:"center", |
| | | dataIndex: 'middleLeft' |
| | | }, |
| | | { |
| | | title: 'ä¸å³', |
| | | align:"center", |
| | | dataIndex: 'middleRight' |
| | | }, |
| | | { |
| | | title: 'åå·¦', |
| | | align:"center", |
| | | dataIndex: 'backLeft' |
| | | }, |
| | | { |
| | | title: 'åå³', |
| | | align:"center", |
| | | dataIndex: 'backRight' |
| | | }, |
| | | { |
| | | title: 'å¹³å', |
| | | align:"center", |
| | | dataIndex: 'avg' |
| | | }, |
| | | { |
| | | title: 'æ¶é¿', |
| | | align:"center", |
| | | dataIndex: 'dryTime' |
| | | }, |
| | | { |
| | | title: 'è¸æ±½ï¼ç«æ¹ï¼', |
| | | align:"center", |
| | | dataIndex: 'steam' |
| | | }, |
| | | ]; |
| | | //æ¥è¯¢æ°æ® |
| | | export const searchFormSchema: FormSchema[] = [ |
| | | ]; |
| | | //è¡¨åæ°æ® |
| | | export const formSchema: FormSchema[] = [ |
| | | { |
| | | label: 'è¯æåç§°', |
| | | field: 'herbName', |
| | | component: 'Input', |
| | | }, |
| | | { |
| | | label: 'è£
æé', |
| | | field: 'feed', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'åå§éé', |
| | | field: 'weight', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'ç®æ æ°´å', |
| | | field: 'target', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'å·¥åå·', |
| | | field: 'orderNo', |
| | | component: 'Input', |
| | | }, |
| | | { |
| | | label: 'å·¥åid', |
| | | field: 'orderId', |
| | | component: 'Input', |
| | | }, |
| | | { |
| | | label: 'åå·¦', |
| | | field: 'frontLeft', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'åå·¦', |
| | | field: 'frontRight', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'ä¸å·¦', |
| | | field: 'middleLeft', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'ä¸å³', |
| | | field: 'middleRight', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'åå·¦', |
| | | field: 'backLeft', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'åå³', |
| | | field: 'backRight', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'å¹³å', |
| | | field: 'avg', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'æ¶é¿', |
| | | field: 'dryTime', |
| | | component: 'InputNumber', |
| | | }, |
| | | { |
| | | label: 'è¸æ±½ï¼ç«æ¹ï¼', |
| | | field: 'steam', |
| | | component: 'InputNumber', |
| | | }, |
| | | // TODO 主é®éèåæ®µï¼ç®ååæ»ä¸ºID |
| | | { |
| | | label: '', |
| | | field: 'id', |
| | | component: 'Input', |
| | | show: false |
| | | }, |
| | | ]; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æµç¨è¡¨åè°ç¨è¿ä¸ªæ¹æ³è·åformSchema |
| | | * @param param |
| | | */ |
| | | export function getBpmFormSchema(_formData): FormSchema[]{ |
| | | // é»è®¤ååå§è¡¨åä¿æä¸è´ 妿æµç¨ä¸é
ç½®äºæéæ°æ®ï¼è¿ééè¦åç¬å¤çformSchema |
| | | return formSchema; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | -- 注æï¼è¯¥é¡µé¢å¯¹åºçåå°ç®å½ä¸ºviews/dryæä»¶å¤¹ä¸ |
| | | -- å¦æä½ æ³æ´æ¹å°å
¶ä»ç®å½ï¼è¯·ä¿®æ¹sqlä¸componentåæ®µå¯¹åºçå¼ |
| | | |
| | | |
| | | INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) |
| | | VALUES ('2023031902327130210', NULL, 'æµè¯ç»æ', '/dry/dryResultList', 'dry/DryResultList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2023-03-19 14:32:21', NULL, NULL, 0); |
| | | |
| | | -- æéæ§å¶sql |
| | | -- æ°å¢ |
| | | INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
| | | VALUES ('2023031902327140211', '2023031902327130210', 'æ·»å æµè¯ç»æ', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_result:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-03-19 14:32:21', NULL, NULL, 0, 0, '1', 0); |
| | | -- ç¼è¾ |
| | | INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
| | | VALUES ('2023031902327140212', '2023031902327130210', 'ç¼è¾æµè¯ç»æ', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_result:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-03-19 14:32:21', NULL, NULL, 0, 0, '1', 0); |
| | | -- å é¤ |
| | | INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
| | | VALUES ('2023031902327140213', '2023031902327130210', 'å 餿µè¯ç»æ', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_result:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-03-19 14:32:21', NULL, NULL, 0, 0, '1', 0); |
| | | -- æ¹éå é¤ |
| | | INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
| | | VALUES ('2023031902327140214', '2023031902327130210', 'æ¹éå 餿µè¯ç»æ', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_result:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-03-19 14:32:21', NULL, NULL, 0, 0, '1', 0); |
| | | -- 导åºexcel |
| | | INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
| | | VALUES ('2023031902327140215', '2023031902327130210', '导åºexcel_æµè¯ç»æ', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_result:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-03-19 14:32:21', NULL, NULL, 0, 0, '1', 0); |
| | | -- 导å
¥excel |
| | | INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) |
| | | VALUES ('2023031902327140216', '2023031902327130210', '导å
¥excel_æµè¯ç»æ', NULL, NULL, 0, NULL, NULL, 2, 'dry:dry_result:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2023-03-19 14:32:21', NULL, NULL, 0, 0, '1', 0); |
| | |
| | | <template> |
| | | <a-spin :spinning="loading"> |
| | | <template v-if="treeData.length > 0"> |
| | | <BasicTree |
| | | ref="basicTree" |
| | | class="depart-rule-tree" |
| | | checkable |
| | | :treeData="treeData" |
| | | :checkedKeys="checkedKeys" |
| | | :selectedKeys="selectedKeys" |
| | | :expandedKeys="expandedKeys" |
| | | :checkStrictly="checkStrictly" |
| | | style="height: 500px; overflow: auto" |
| | | @check="onCheck" |
| | | @expand="onExpand" |
| | | @select="onSelect" |
| | | > |
| | | <BasicTree ref="basicTree" class="depart-rule-tree" checkable :treeData="treeData" :checkedKeys="checkedKeys" |
| | | :selectedKeys="selectedKeys" :expandedKeys="expandedKeys" :checkStrictly="checkStrictly" |
| | | style="height: 500px; overflow: auto" @check="onCheck" @expand="onExpand" @select="onSelect"> |
| | | <template #title="{ slotTitle, ruleFlag }"> |
| | | <span>{{ slotTitle }}</span> |
| | | <Icon v-if="ruleFlag" icon="ant-design:align-left-outlined" style="margin-left: 5px; color: red" /> |
| | |
| | | <a-dropdown :trigger="['click']" placement="top"> |
| | | <template #overlay> |
| | | <a-menu> |
| | | <a-menu-item key="1" @click="toggleCheckStrictly(false)">ç¶åå
³è</a-menu-item> |
| | | <a-menu-item key="2" @click="toggleCheckStrictly(true)">åæ¶å
³è</a-menu-item> |
| | | <a-menu-item key="3" @click="toggleCheckALL(true)">å
¨é¨å¾é</a-menu-item> |
| | | <a-menu-item key="4" @click="toggleCheckALL(false)">åæ¶å
¨é</a-menu-item> |
| | | <a-menu-item key="5" @click="toggleExpandAll(true)">å±å¼ææ</a-menu-item> |
| | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { watch, computed, inject, ref, nextTick } from 'vue'; |
| | | import { useDrawer } from '/@/components/Drawer'; |
| | | import { BasicTree } from '/@/components/Tree/index'; |
| | | import DepartDataRuleDrawer from './DepartDataRuleDrawer.vue'; |
| | | import { queryRoleTreeList, queryDepartPermission, saveDepartPermission } from '../depart.api'; |
| | | import { computed, inject, nextTick, ref, watch } from 'vue' |
| | | import { queryDepartPermission, queryRoleTreeList, saveDepartPermission } from '../depart.api' |
| | | import DepartDataRuleDrawer from './DepartDataRuleDrawer.vue' |
| | | import { useDrawer } from '/@/components/Drawer' |
| | | import { BasicTree } from '/@/components/Tree/index' |
| | | |
| | | const props = defineProps({ |
| | | data: { type: Object, default: () => ({}) }, |
| | | }); |
| | | }) |
| | | // å½åéä¸çé¨é¨IDï¼å¯è½ä¼ä¸ºç©ºï¼ä»£è¡¨æªéæ©é¨é¨ |
| | | const departId = computed(() => props.data?.id); |
| | | const departId = computed(() => props.data?.id) |
| | | |
| | | const prefixCls = inject('prefixCls'); |
| | | const basicTree = ref(); |
| | | const loading = ref<boolean>(false); |
| | | const treeData = ref<any[]>([]); |
| | | const expandedKeys = ref<Array<any>>([]); |
| | | const selectedKeys = ref<Array<any>>([]); |
| | | const checkedKeys = ref<Array<any>>([]); |
| | | const lastCheckedKeys = ref<Array<any>>([]); |
| | | const checkStrictly = ref(true); |
| | | const prefixCls = inject('prefixCls') |
| | | const basicTree = ref() |
| | | const loading = ref<boolean>(false) |
| | | const treeData = ref<any[]>([]) |
| | | const expandedKeys = ref<Array<any>>([]) |
| | | const selectedKeys = ref<Array<any>>([]) |
| | | const checkedKeys = ref<Array<any>>([]) |
| | | const lastCheckedKeys = ref<Array<any>>([]) |
| | | const checkStrictly = ref(true) |
| | | |
| | | // æ³¨åæ°æ®è§åææå¼¹çªæ½å± |
| | | const [registerDataRuleDrawer, dataRuleDrawer] = useDrawer(); |
| | | const [registerDataRuleDrawer, dataRuleDrawer] = useDrawer() |
| | | |
| | | // onCreated |
| | | loadData(); |
| | | watch(departId, () => loadDepartPermission(), { immediate: true }); |
| | | loadData() |
| | | watch(departId, () => loadDepartPermission(), { immediate: true }) |
| | | |
| | | async function loadData() { |
| | | try { |
| | | loading.value = true; |
| | | let { treeList } = await queryRoleTreeList(); |
| | | treeData.value = treeList; |
| | | await nextTick(); |
| | | toggleExpandAll(true); |
| | | loading.value = true |
| | | let { treeList } = await queryRoleTreeList() |
| | | treeData.value = treeList |
| | | await nextTick() |
| | | toggleExpandAll(true) |
| | | } finally { |
| | | loading.value = false; |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | async function loadDepartPermission() { |
| | | if (departId.value) { |
| | | try { |
| | | loading.value = true; |
| | | let keys = await queryDepartPermission({ departId: departId.value }); |
| | | checkedKeys.value = keys; |
| | | lastCheckedKeys.value = [...keys]; |
| | | loading.value = true |
| | | let keys = await queryDepartPermission({ departId: departId.value }) |
| | | checkedKeys.value = keys |
| | | lastCheckedKeys.value = [...keys] |
| | | } finally { |
| | | loading.value = false; |
| | | loading.value = false |
| | | } |
| | | } |
| | | } |
| | | |
| | | async function onSubmit() { |
| | | try { |
| | | loading.value = true; |
| | | loading.value = true |
| | | await saveDepartPermission({ |
| | | departId: departId.value, |
| | | permissionIds: checkedKeys.value.join(','), |
| | | lastpermissionIds: lastCheckedKeys.value.join(','), |
| | | }); |
| | | await loadData(); |
| | | await loadDepartPermission(); |
| | | }) |
| | | await loadData() |
| | | await loadDepartPermission() |
| | | } finally { |
| | | loading.value = false; |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | // treeå¾éå¤éæ¡äºä»¶ |
| | | function onCheck(event) { |
| | | if (!Array.isArray(event)) { |
| | | checkedKeys.value = event.checked; |
| | | checkedKeys.value = event.checked |
| | | } else { |
| | | checkedKeys.value = event; |
| | | checkedKeys.value = event |
| | | } |
| | | } |
| | | |
| | | // treeå±å¼äºä»¶ |
| | | function onExpand($expandedKeys) { |
| | | expandedKeys.value = $expandedKeys; |
| | | expandedKeys.value = $expandedKeys |
| | | } |
| | | |
| | | // treeéä¸äºä»¶ |
| | | function onSelect($selectedKeys, { selectedNodes }) { |
| | | if (selectedNodes[0]?.ruleFlag) { |
| | | let functionId = $selectedKeys[0]; |
| | | dataRuleDrawer.openDrawer(true, { departId, functionId }); |
| | | let functionId = $selectedKeys[0] |
| | | dataRuleDrawer.openDrawer(true, { departId, functionId }) |
| | | } |
| | | selectedKeys.value = []; |
| | | selectedKeys.value = [] |
| | | } |
| | | |
| | | // 忢ç¶åå
³è |
| | | async function toggleCheckStrictly(flag) { |
| | | checkStrictly.value = flag; |
| | | await nextTick(); |
| | | checkedKeys.value = basicTree.value.getCheckedKeys(); |
| | | checkStrictly.value = flag |
| | | await nextTick() |
| | | checkedKeys.value = basicTree.value.getCheckedKeys() |
| | | } |
| | | |
| | | // 忢å±å¼æ¶èµ· |
| | | async function toggleExpandAll(flag) { |
| | | basicTree.value.expandAll(flag); |
| | | await nextTick(); |
| | | expandedKeys.value = basicTree.value.getExpandedKeys(); |
| | | basicTree.value.expandAll(flag) |
| | | await nextTick() |
| | | expandedKeys.value = basicTree.value.getExpandedKeys() |
| | | } |
| | | |
| | | // 忢å
¨é |
| | | async function toggleCheckALL(flag) { |
| | | basicTree.value.checkAll(flag); |
| | | await nextTick(); |
| | | checkedKeys.value = basicTree.value.getCheckedKeys(); |
| | | basicTree.value.checkAll(flag) |
| | | await nextTick() |
| | | checkedKeys.value = basicTree.value.getCheckedKeys() |
| | | } |
| | | </script> |
| | | |