修改每日菜谱

This commit is contained in:
ctw committed 2025-01-12 21:51:34 +08:00
1 parent 002f8ad6b1
commit 33d90c45b0
8 files changed
+408 -328

No files matched your search

+24 -24
View File
@@ -25,61 +25,61 @@
</template>
<script setup lang="ts" name="select-merchant">
import { reactive, computed, defineModel, withDefaults, defineProps } from 'vue';
import * as cocApi from '/@/api/canteen/canteenOnlineCategory';
import { reactive, computed, defineModel, withDefaults, defineProps } from "vue"
import { fetchList as getCanteenCategory } from "/@/api/canteen/canteenCategory"
const selectId = defineModel();
const selectId = defineModel()
export type Props = {
placeholder?: string;
};
placeholder?: string
}
const props = withDefaults(defineProps<Props>(), {
placeholder: '请选择',
});
placeholder: "请选择",
})
const queryForm = reactive<any>({
current: 1,
size: 10,
});
size: 9999,
})
const state = reactive<any>({
loading: true,
selectId: selectId,
options: [],
});
})
watch(
selectId,
(newVal, oldValue) => {
if (newVal == oldValue) return;
state.selectId = newVal;
getOptions();
if (newVal == oldValue) return
state.selectId = newVal
getOptions()
},
{ immediate: true }
);
{ immediate: true },
)
async function getOptions() {
try {
state.loading = true;
state.loading = true
const _pa = {
...queryForm,
};
const { data } = await cocApi.fetchList(_pa);
state.options = data.records ?? [];
}
const { data } = await getCanteenCategory(_pa)
state.options = data.records ?? []
} finally {
setTimeout(() => (state.loading = false), 500);
setTimeout(() => (state.loading = false), 500)
}
}
function remoteSearch(params: string) {
if (params != queryForm.name) {
queryForm.name = params;
getOptions();
queryForm.name = params
getOptions()
}
}
function clear() {
state.selectId = null;
getOptions();
state.selectId = null
getOptions()
}
</script>
@@ -25,61 +25,61 @@
</template>
<script setup lang="ts" name="select-merchant">
import { reactive, computed, defineModel, withDefaults, defineProps } from 'vue';
import { fetchList as getCanteenCategory } from '/@/api/canteen/canteenCategory';
import { reactive, computed, defineModel, withDefaults, defineProps } from "vue"
import * as cocApi from "/@/api/canteen/canteenOnlineCategory"
const selectId = defineModel();
const selectId = defineModel()
export type Props = {
placeholder?: string;
};
placeholder?: string
}
const props = withDefaults(defineProps<Props>(), {
placeholder: '请选择',
});
placeholder: "请选择",
})
const queryForm = reactive<any>({
current: 1,
size: 9999,
});
size: 10,
})
const state = reactive<any>({
loading: true,
selectId: selectId,
options: [],
});
})
watch(
selectId,
(newVal, oldValue) => {
if (newVal == oldValue) return;
state.selectId = newVal;
getOptions();
if (newVal == oldValue) return
state.selectId = newVal
getOptions()
},
{ immediate: true }
);
{ immediate: true },
)
async function getOptions() {
try {
state.loading = true;
state.loading = true
const _pa = {
...queryForm,
};
const { data } = await getCanteenCategory(_pa);
state.options = data.records ?? [];
}
const { data } = await cocApi.fetchList(_pa)
state.options = data.records ?? []
} finally {
setTimeout(() => (state.loading = false), 500);
setTimeout(() => (state.loading = false), 500)
}
}
function remoteSearch(params: string) {
if (params != queryForm.name) {
queryForm.name = params;
getOptions();
queryForm.name = params
getOptions()
}
}
function clear() {
state.selectId = null;
getOptions();
state.selectId = null
getOptions()
}
</script>
+60 -60
View File
@@ -1,79 +1,79 @@
import Pagination from '/@/components/Pagination/index.vue';
import RightToolbar from '/@/components/RightToolbar/index.vue';
import DictTag from '/@/components/DictTag/index.vue';
import DictSelect from '/@/components/DictSelect/index.vue';
import UploadExcel from '/@/components/Upload/Excel.vue';
import UploadFile from '/@/components/Upload/index.vue';
import UploadImg from '/@/components/Upload/Image.vue';
import UploadImgs from '/@/components/Upload/Images.vue';
import DelWrap from '/@/components/DelWrap/index.vue';
import Editor from '/@/components/Editor/index.vue';
import Tip from '/@/components/Tip/index.vue';
import TagList from '/@/components/TagList/index.vue';
import SvgIcon from '/@/components/SvgIcon/index.vue';
import PreviewImage from '/@/components/PreviewImage/index.vue';
import Pagination from "/@/components/Pagination/index.vue"
import RightToolbar from "/@/components/RightToolbar/index.vue"
import DictTag from "/@/components/DictTag/index.vue"
import DictSelect from "/@/components/DictSelect/index.vue"
import UploadExcel from "/@/components/Upload/Excel.vue"
import UploadFile from "/@/components/Upload/index.vue"
import UploadImg from "/@/components/Upload/Image.vue"
import UploadImgs from "/@/components/Upload/Images.vue"
import DelWrap from "/@/components/DelWrap/index.vue"
import Editor from "/@/components/Editor/index.vue"
import Tip from "/@/components/Tip/index.vue"
import TagList from "/@/components/TagList/index.vue"
import SvgIcon from "/@/components/SvgIcon/index.vue"
import PreviewImage from "/@/components/PreviewImage/index.vue"
// 业务组件
import SelectUser from '/@/components/Select/SelectUser.vue';
import SelectWalletType from '/@/components/Select/SelectWalletType.vue';
import SelectMch from '/@/components/Select/SelectMch.vue';
import SelectDept from '/@/components/Select/SelectDept.vue';
import SelectCtcg from '/@/components/Select/SelectCtcg.vue';
import SelectCtcgd from '/@/components/Select/SelectCtcgd.vue';
import SelectUser from "/@/components/Select/SelectUser.vue"
import SelectWalletType from "/@/components/Select/SelectWalletType.vue"
import SelectMch from "/@/components/Select/SelectMch.vue"
import SelectDept from "/@/components/Select/SelectDept.vue"
import SelectCtcg from "/@/components/Select/SelectCtcg.vue"
import SelectCtcgol from "/@/components/Select/SelectCtcgol.vue"
// 第三方组件
import ElementPlus from 'element-plus';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import 'element-plus/dist/index.css';
import { Pane, Splitpanes } from 'splitpanes';
import 'splitpanes/dist/splitpanes.css';
import ElementPlus from "element-plus"
import * as ElementPlusIconsVue from "@element-plus/icons-vue"
import "element-plus/dist/index.css"
import { Pane, Splitpanes } from "splitpanes"
import "splitpanes/dist/splitpanes.css"
// 日历组件
import { setupCalendar } from 'v-calendar';
import { setupCalendar } from "v-calendar"
// @ts-ignore 引入VForm3库
import VForm3 from 'form-designer-plus'; //
import 'form-designer-plus/dist/designer.style.css'; //引入VForm3样式
import VForm3 from "form-designer-plus" //
import "form-designer-plus/dist/designer.style.css" //引入VForm3样式
// 部门树组件
import vue3TreeOrg from 'vue3-tree-org';
import 'vue3-tree-org/lib/vue3-tree-org.css';
import vue3TreeOrg from "vue3-tree-org"
import "vue3-tree-org/lib/vue3-tree-org.css"
// 导入声明
import { App } from 'vue';
import { App } from "vue"
export default {
install(app: App) {
app.component('DictTag', DictTag);
app.component('DictSelect', DictSelect);
app.component('Pagination', Pagination);
app.component('RightToolbar', RightToolbar);
app.component('uploadExcel', UploadExcel);
app.component('UploadFile', UploadFile);
app.component('UploadImg', UploadImg);
app.component('UploadImgs', UploadImgs);
app.component('Editor', Editor);
app.component('Tip', Tip);
app.component('DelWrap', DelWrap);
app.component('TagList', TagList);
app.component('SvgIcon', SvgIcon);
app.component('PreviewImage', PreviewImage);
app.component('SelectUser', SelectUser);
app.component('SelectWalletType', SelectWalletType);
app.component('SelectMch', SelectMch);
app.component('SelectDept', SelectDept);
app.component('SelectCtcg', SelectCtcg);
app.component('SelectCtcgd', SelectCtcgd);
app.component("DictTag", DictTag)
app.component("DictSelect", DictSelect)
app.component("Pagination", Pagination)
app.component("RightToolbar", RightToolbar)
app.component("uploadExcel", UploadExcel)
app.component("UploadFile", UploadFile)
app.component("UploadImg", UploadImg)
app.component("UploadImgs", UploadImgs)
app.component("Editor", Editor)
app.component("Tip", Tip)
app.component("DelWrap", DelWrap)
app.component("TagList", TagList)
app.component("SvgIcon", SvgIcon)
app.component("PreviewImage", PreviewImage)
app.component("SelectUser", SelectUser)
app.component("SelectWalletType", SelectWalletType)
app.component("SelectMch", SelectMch)
app.component("SelectDept", SelectDept)
app.component("SelectCtcg", SelectCtcg)
app.component("SelectCtcgol", SelectCtcgol)
// 导入全部的elmenet-plus的图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component);
app.component(key, component)
// 兼容性
app.component(`ele-${key}`, component);
app.component(`ele-${key}`, component)
}
// 导入布局插件
app.component('Splitpanes', Splitpanes);
app.component('Pane', Pane);
app.use(ElementPlus); // ELEMENT 组件
app.use(setupCalendar, {}); // 日历组件
app.use(VForm3); // 表单设计
app.use(vue3TreeOrg); // 组织架构组件
app.component("Splitpanes", Splitpanes)
app.component("Pane", Pane)
app.use(ElementPlus) // ELEMENT 组件
app.use(setupCalendar, {}) // 日历组件
app.use(VForm3) // 表单设计
app.use(vue3TreeOrg) // 组织架构组件
},
};
}