From ec743754d4eec74005f64ed537989b5ba6af4e79 Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期一, 20 三月 2023 10:14:08 +0800 Subject: [PATCH] 添加检测结果界面 --- src/views/dry/components/DryResultModal.vue | 66 +++ .env.development | 4 Dockerfile | 40 +- src/views/system/depart/components/DepartRuleTab.vue | 213 +++++----- src/views/dry/dataDefine/DryResult.data.ts | 181 +++++++++ src/views/dry/api/DryResult.api.ts | 64 +++ .env.production | 4 .env.test | 2 src/views/dry/dataDefine/DryOrder.data.ts | 354 +++++++++-------- src/views/dry/DryResultList.vue | 173 ++++++++ src/views/dry/sql/DryResult_menu_insert.sql | 26 + src/views/dry/components/DryResultForm.vue | 70 +++ 12 files changed, 892 insertions(+), 305 deletions(-) diff --git a/.env.development b/.env.development index 5ef8de5..2459a4f 100644 --- a/.env.development +++ b/.env.development @@ -5,13 +5,13 @@ VITE_PUBLIC_PATH = / # 璺ㄥ煙浠g悊锛屾偍鍙互閰嶇疆澶氫釜 ,璇锋敞鎰忥紝娌℃湁鎹㈣绗� -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 diff --git a/.env.production b/.env.production index de33204..be4611d 100644 --- a/.env.production +++ b/.env.production @@ -16,10 +16,10 @@ 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= diff --git a/.env.test b/.env.test index c0d9f8f..4fbb177 100644 --- a/.env.test +++ b/.env.test @@ -16,7 +16,7 @@ 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 diff --git a/Dockerfile b/Dockerfile index bafce2b..65ad3a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,27 @@ 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/; \ - proxy_redirect off; \ - proxy_set_header Host jeecg-boot-system; \ - proxy_set_header X-Real-IP \$remote_addr; \ - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \ - } \ - #瑙e喅Router(mode: 'history')妯″紡涓嬶紝鍒锋柊璺敱鍦板潃涓嶈兘鎵惧埌椤甸潰鐨勯棶棰� \ - location / { \ - root /var/www/html/; \ - index index.html index.htm; \ - if (!-e \$request_filename) { \ - rewrite ^(.*)\$ /index.html?s=\$1 last; \ - break; \ - } \ - } \ - access_log /var/log/nginx/access.log ; \ - } " > /etc/nginx/conf.d/default.conf \ + listen 80; \ + location /herb/ { \ + proxy_pass http://jeecg-boot-gateway:9999/; \ + proxy_redirect off; \ + 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; \ + } \ + #瑙e喅Router(mode: 'history')妯″紡涓嬶紝鍒锋柊璺敱鍦板潃涓嶈兘鎵惧埌椤甸潰鐨勯棶棰� \ + location / { \ + root /var/www/html/; \ + index index.html index.htm; \ + if (!-e \$request_filename) { \ + rewrite ^(.*)\$ /index.html?s=\$1 last; \ + break; \ + } \ + } \ + access_log /var/log/nginx/access.log ; \ + } " > /etc/nginx/conf.d/default.conf \ && mkdir -p /var/www \ && mkdir -p /var/www/html diff --git a/src/views/dry/DryResultList.vue b/src/views/dry/DryResultList.vue new file mode 100644 index 0000000..a0b6c34 --- /dev/null +++ b/src/views/dry/DryResultList.vue @@ -0,0 +1,173 @@ +<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> \ No newline at end of file diff --git a/src/views/dry/api/DryResult.api.ts b/src/views/dry/api/DryResult.api.ts new file mode 100644 index 0000000..b053fc1 --- /dev/null +++ b/src/views/dry/api/DryResult.api.ts @@ -0,0 +1,64 @@ +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}); +} diff --git a/src/views/dry/components/DryResultForm.vue b/src/views/dry/components/DryResultForm.vue new file mode 100644 index 0000000..1464b1a --- /dev/null +++ b/src/views/dry/components/DryResultForm.vue @@ -0,0 +1,70 @@ +<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> \ No newline at end of file diff --git a/src/views/dry/components/DryResultModal.vue b/src/views/dry/components/DryResultModal.vue new file mode 100644 index 0000000..ea1f043 --- /dev/null +++ b/src/views/dry/components/DryResultModal.vue @@ -0,0 +1,66 @@ +<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> diff --git a/src/views/dry/dataDefine/DryOrder.data.ts b/src/views/dry/dataDefine/DryOrder.data.ts index bb146e3..e79267e 100644 --- a/src/views/dry/dataDefine/DryOrder.data.ts +++ b/src/views/dry/dataDefine/DryOrder.data.ts @@ -3,177 +3,193 @@ import { rules } from '/@/utils/helper/validator' //鍒楄〃鏁版嵁 export const columns: BasicColumn[] = [ - { - title: '宸ュ崟鏃堕棿', - align: 'center', - sorter: true, - dataIndex: 'orderTime', - customRender: ({ text }) => { - return !text ? '' : text.length > 10 ? text.substr(0, 10) : text - }, - }, - { - title: '宸ュ崟鍙�', - align: 'center', - dataIndex: 'code', - }, - { - title: '鑽潗', - align: 'center', - dataIndex: 'herbId_dictText', - }, - { - title: '鍒濆鍚按鐜�', - align: 'center', - dataIndex: 'initial', - }, - { - title: '鐩爣鍚按鐜�', - align: 'center', - dataIndex: 'target', - }, - { - title: '鎶曟枡閲�', - align: 'center', - dataIndex: 'feed', - }, - { - title: '棰勮骞茬嚗鏃堕棿', - align: 'center', - dataIndex: 'et', - }, - { - title: '骞叉枡閲嶉噺', - align: 'center', - dataIndex: 'yield', - }, - { - title: '骞茬嚗鏃堕棿', - align: 'center', - dataIndex: 'drying', - }, - { - title: '棰勮鍓╀綑鏃堕棿', - align: 'center', - dataIndex: 'remain', - }, - { - title: '璁惧', - align: 'center', - dataIndex: 'equId_dictText', - }, - { - title: '杞﹂棿', - align: 'center', - dataIndex: 'shopId_dictText', - }, - { - title: '宸ュ崟鐘舵��', - align: 'center', - dataIndex: 'orderStatus', - }, - { - title: '鎿嶄綔浜�', - align: 'center', - dataIndex: 'operator_dictText', - }, + { + title: '宸ュ崟鏃堕棿', + align: 'center', + sorter: true, + dataIndex: 'orderTime', + customRender: ({ text }) => { + return !text ? '' : text.length > 10 ? text.substr(0, 10) : text + }, + }, + { + title: '宸ュ崟鍙�', + align: 'center', + dataIndex: 'code', + }, + { + title: '鑽潗', + align: 'center', + dataIndex: 'herbId_dictText', + }, + { + title: '鍒濆鍚按鐜�', + align: 'center', + dataIndex: 'initial', + }, + { + title: '鐩爣鍚按鐜�', + align: 'center', + dataIndex: 'target', + }, + { + title: '鎶曟枡閲�', + align: 'center', + dataIndex: 'feed', + }, + { + title: '棰勮骞茬嚗鏃堕棿', + align: 'center', + dataIndex: 'et', + }, + { + title: '骞叉枡閲嶉噺', + align: 'center', + dataIndex: 'yield', + }, + { + title: '骞茬嚗鏃堕棿', + align: 'center', + dataIndex: 'drying', + }, + { + title: '棰勮鍓╀綑鏃堕棿', + align: 'center', + dataIndex: 'remain', + }, + { + title: '璁惧', + align: 'center', + dataIndex: 'equId_dictText', + }, + { + title: '杞﹂棿', + align: 'center', + dataIndex: 'shopId_dictText', + }, + { + title: '宸ュ崟鐘舵��', + align: 'center', + dataIndex: 'orderStatus', + }, + { + title: '鎿嶄綔浜�', + align: 'center', + dataIndex: 'operator_dictText', + }, ] //鏌ヨ鏁版嵁 -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[] = [ - { - label: '宸ュ崟鏃堕棿', - field: 'orderTime', - component: 'DatePicker', - }, - { - label: '宸ュ崟鍙�', - field: 'code', - component: 'Input', - dynamicRules: ({ model, schema }) => { - return [{ required: false }, { ...rules.duplicateCheckRule('dry_order', 'code', model, schema)[0] }] - }, - }, - { - label: '鑽潗', - field: 'herbId', - component: 'JDictSelectTag', - componentProps: { - dictCode: 'dry_herb,name,id,tenant_id=' + getTenantId(), - }, - }, - { - label: '鍒濆鍚按鐜�', - field: 'initial', - component: 'InputNumber', - }, - { - label: '鐩爣鍚按鐜�', - field: 'target', - component: 'InputNumber', - }, - { - label: '鎶曟枡閲�', - field: 'feed', - component: 'InputNumber', - }, - { - label: '棰勮骞茬嚗鏃堕棿', - field: 'et', - component: 'InputNumber', - }, - { - label: '骞叉枡閲嶉噺', - field: 'yield', - component: 'InputNumber', - }, - { - label: '骞茬嚗鏃堕棿', - field: 'drying', - component: 'InputNumber', - }, - { - label: '棰勮鍓╀綑鏃堕棿', - field: 'remain', - component: 'InputNumber', - }, - { - label: '璁惧', - field: 'equId', - component: 'JDictSelectTag', - componentProps: { - dictCode: 'dry_equipment,name,id,tenant_id=' + getTenantId(), - }, - }, - { - label: '杞﹂棿', - field: 'shopId', - component: 'JDictSelectTag', - componentProps: { - dictCode: 'dry_shop,name,id,tenant_id=' + getTenantId(), - }, - }, - { - label: '宸ュ崟鐘舵��', - field: 'orderStatus', - component: 'InputNumber', - }, - { - label: '鎿嶄綔浜�', - field: 'operator', - component: 'JDictSelectTag', - componentProps: { - dictCode: 'sys_user,realname,id,tenant_id=' + getTenantId(), - }, - }, - // TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID - { - label: '', - field: 'id', - component: 'Input', - show: false, - }, + { + label: '宸ュ崟鏃堕棿', + field: 'orderTime', + component: 'DatePicker', + }, + { + label: '宸ュ崟鍙�', + field: 'code', + component: 'Input', + dynamicRules: ({ model, schema }) => { + return [{ required: false }, { ...rules.duplicateCheckRule('dry_order', 'code', model, schema)[0] }] + }, + }, + { + label: '鑽潗', + field: 'herbId', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'dry_herb,name,id,tenant_id=' + getTenantId(), + }, + }, + { + label: '鍒濆鍚按鐜�', + field: 'initial', + component: 'InputNumber', + }, + { + label: '鐩爣鍚按鐜�', + field: 'target', + component: 'InputNumber', + }, + { + label: '鎶曟枡閲�', + field: 'feed', + component: 'InputNumber', + }, + { + label: '棰勮骞茬嚗鏃堕棿', + field: 'et', + component: 'InputNumber', + }, + { + label: '骞叉枡閲嶉噺', + field: 'yield', + component: 'InputNumber', + }, + { + label: '骞茬嚗鏃堕棿', + field: 'drying', + component: 'InputNumber', + }, + { + label: '棰勮鍓╀綑鏃堕棿', + field: 'remain', + component: 'InputNumber', + }, + { + label: '璁惧', + field: 'equId', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'dry_equipment,name,id,tenant_id=' + getTenantId(), + }, + }, + { + label: '杞﹂棿', + field: 'shopId', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'dry_shop,name,id,tenant_id=' + getTenantId(), + }, + }, + { + label: '宸ュ崟鐘舵��', + field: 'orderStatus', + component: 'InputNumber', + }, + { + label: '鎿嶄綔浜�', + field: 'operator', + component: 'JDictSelectTag', + componentProps: { + dictCode: 'sys_user,realname,id,tenant_id=' + getTenantId(), + }, + }, + // TODO 涓婚敭闅愯棌瀛楁锛岀洰鍓嶅啓姝讳负ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, ] /** @@ -181,6 +197,6 @@ * @param param */ export function getBpmFormSchema(_formData): FormSchema[] { - // 榛樿鍜屽師濮嬭〃鍗曚繚鎸佷竴鑷� 濡傛灉娴佺▼涓厤缃簡鏉冮檺鏁版嵁锛岃繖閲岄渶瑕佸崟鐙鐞唂ormSchema - return formSchema + // 榛樿鍜屽師濮嬭〃鍗曚繚鎸佷竴鑷� 濡傛灉娴佺▼涓厤缃簡鏉冮檺鏁版嵁锛岃繖閲岄渶瑕佸崟鐙鐞唂ormSchema + return formSchema } diff --git a/src/views/dry/dataDefine/DryResult.data.ts b/src/views/dry/dataDefine/DryResult.data.ts new file mode 100644 index 0000000..2974133 --- /dev/null +++ b/src/views/dry/dataDefine/DryResult.data.ts @@ -0,0 +1,181 @@ +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[]{ + // 榛樿鍜屽師濮嬭〃鍗曚繚鎸佷竴鑷� 濡傛灉娴佺▼涓厤缃簡鏉冮檺鏁版嵁锛岃繖閲岄渶瑕佸崟鐙鐞唂ormSchema + return formSchema; +} \ No newline at end of file diff --git a/src/views/dry/sql/DryResult_menu_insert.sql b/src/views/dry/sql/DryResult_menu_insert.sql new file mode 100644 index 0000000..a45d369 --- /dev/null +++ b/src/views/dry/sql/DryResult_menu_insert.sql @@ -0,0 +1,26 @@ +-- 娉ㄦ剰锛氳椤甸潰瀵瑰簲鐨勫墠鍙扮洰褰曚负views/dry鏂囦欢澶逛笅 +-- 濡傛灉浣犳兂鏇存敼鍒板叾浠栫洰褰曪紝璇蜂慨鏀箂ql涓璫omponent瀛楁瀵瑰簲鐨勫�� + + +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); \ No newline at end of file diff --git a/src/views/system/depart/components/DepartRuleTab.vue b/src/views/system/depart/components/DepartRuleTab.vue index f8025e9..d66ca3f 100644 --- a/src/views/system/depart/components/DepartRuleTab.vue +++ b/src/views/system/depart/components/DepartRuleTab.vue @@ -1,20 +1,9 @@ <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" /> @@ -28,6 +17,8 @@ <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> @@ -47,123 +38,123 @@ </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: () => ({}) }, - }); - // 褰撳墠閫変腑鐨勯儴闂↖D锛屽彲鑳戒細涓虹┖锛屼唬琛ㄦ湭閫夋嫨閮ㄩ棬 - const departId = computed(() => props.data?.id); +const props = defineProps({ + data: { type: Object, default: () => ({}) }, +}) +// 褰撳墠閫変腑鐨勯儴闂↖D锛屽彲鑳戒細涓虹┖锛屼唬琛ㄦ湭閫夋嫨閮ㄩ棬 +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 }); +// onCreated +loadData() +watch(departId, () => loadDepartPermission(), { immediate: true }) - async function loadData() { +async function loadData() { + try { + loading.value = true + let { treeList } = await queryRoleTreeList() + treeData.value = treeList + await nextTick() + toggleExpandAll(true) + } finally { + loading.value = false + } +} + +async function loadDepartPermission() { + if (departId.value) { try { - loading.value = true; - let { treeList } = await queryRoleTreeList(); - treeData.value = treeList; - await nextTick(); - toggleExpandAll(true); + 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 loadDepartPermission() { - if (departId.value) { - try { - loading.value = true; - let keys = await queryDepartPermission({ departId: departId.value }); - checkedKeys.value = keys; - lastCheckedKeys.value = [...keys]; - } finally { - loading.value = false; - } - } +async function onSubmit() { + try { + loading.value = true + await saveDepartPermission({ + departId: departId.value, + permissionIds: checkedKeys.value.join(','), + lastpermissionIds: lastCheckedKeys.value.join(','), + }) + await loadData() + await loadDepartPermission() + } finally { + loading.value = false } +} - async function onSubmit() { - try { - loading.value = true; - await saveDepartPermission({ - departId: departId.value, - permissionIds: checkedKeys.value.join(','), - lastpermissionIds: lastCheckedKeys.value.join(','), - }); - await loadData(); - await loadDepartPermission(); - } finally { - loading.value = false; - } +// tree鍕鹃�夊閫夋浜嬩欢 +function onCheck(event) { + if (!Array.isArray(event)) { + checkedKeys.value = event.checked + } else { + checkedKeys.value = event } +} - // tree鍕鹃�夊閫夋浜嬩欢 - function onCheck(event) { - if (!Array.isArray(event)) { - checkedKeys.value = event.checked; - } else { - checkedKeys.value = event; - } - } +// tree灞曞紑浜嬩欢 +function onExpand($expandedKeys) { + expandedKeys.value = $expandedKeys +} - // tree灞曞紑浜嬩欢 - function onExpand($expandedKeys) { - expandedKeys.value = $expandedKeys; +// tree閫変腑浜嬩欢 +function onSelect($selectedKeys, { selectedNodes }) { + if (selectedNodes[0]?.ruleFlag) { + let functionId = $selectedKeys[0] + dataRuleDrawer.openDrawer(true, { departId, functionId }) } + selectedKeys.value = [] +} - // tree閫変腑浜嬩欢 - function onSelect($selectedKeys, { selectedNodes }) { - if (selectedNodes[0]?.ruleFlag) { - let functionId = $selectedKeys[0]; - dataRuleDrawer.openDrawer(true, { departId, functionId }); - } - selectedKeys.value = []; - } +// 鍒囨崲鐖跺瓙鍏宠仈 +async function toggleCheckStrictly(flag) { + checkStrictly.value = flag + await nextTick() + checkedKeys.value = basicTree.value.getCheckedKeys() +} - // 鍒囨崲鐖跺瓙鍏宠仈 - async function toggleCheckStrictly(flag) { - 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() +} - // 鍒囨崲灞曞紑鏀惰捣 - async function toggleExpandAll(flag) { - 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(); - } +// 鍒囨崲鍏ㄩ�� +async function toggleCheckALL(flag) { + basicTree.value.checkAll(flag) + await nextTick() + checkedKeys.value = basicTree.value.getCheckedKeys() +} </script> <style lang="less" scoped> - // 銆怴UEN-188銆戣В鍐虫粴鍔ㄦ潯涓嶇伒鏁忕殑闂 - .depart-rule-tree :deep(.scrollbar__bar) { - pointer-events: none; - } +// 銆怴UEN-188銆戣В鍐虫粴鍔ㄦ潯涓嶇伒鏁忕殑闂 +.depart-rule-tree :deep(.scrollbar__bar) { + pointer-events: none; +} </style> -- Gitblit v1.9.3