页面完善

This commit is contained in:
zmj 2023-10-27 20:03:22 +08:00
parent b0825d0862
commit d3ab14fc1c
4 changed files with 97 additions and 40 deletions

View File

@ -12,5 +12,8 @@ export const addFishPicAPI = (data) => syhttp.post('/FishBreed/addFishPic', data
export const pondEnvDataAPI = (data) => syhttp.get('/FishBreed/pondEnvData', data)
// 图片列表
export const fishPicListAPI = (data) => syhttp.get('/FishBreed/fishPicList', data)
// 添加水产操作
export const addFishRecordAPI = (data) => syhttp.post('/FishBreed/addFishRecord', data)
//
// export const fishPicListAPI = (data) => syhttp.get('/FishBreed/fishPicList', data)

View File

@ -20,7 +20,7 @@
<view class="">
{{index}}
</view>
<view class="updata-btn" @click="navgo('/pages/growRecord/index?type=4')">
<view class="updata-btn" @click="navgo(`/pages/growRecord/index?type=4&pond_id=${pond_id}`)">
更新{{index.slice(0,-2)}}
</view>
</view>
@ -183,7 +183,6 @@
const pond_id = ref(0)
const headData = reactive({})
onLoad((option) => {
pondEnvDataAPI({
user_id: 307
}).then(res => {

View File

@ -118,7 +118,7 @@
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入" border="surround" v-model="formData.value"
<up-input placeholder="请输入" border="surround" v-model="formData.text"
@change="change"></up-input>
</view>
</view>
@ -128,8 +128,8 @@
{{item.title}}
</view>
<view class="pop-li">
<up-input readonly placeholder="点击选择" border="surround" v-model="formData.value"
@click="showPicker=true"></up-input>
<up-input placeholder="点击选择" border="surround" v-model="formData.select"
@tap="showPicker=true"></up-input>
</view>
</view>
<!-- 上传图片 -->
@ -137,9 +137,12 @@
<view class="">
{{item.title}}
</view>
<view class="pop-li">
<view class="code-img">
<view class="carime-icon" @click="updateImgFn">
<view class="pop-li" @click="updateImgFn">
<view v-if="formData.pic">
<u--image :src="formData.pic" width="100%" height="196.26rpx"></u--image>
</view>
<view class="code-img" v-else>
<view class="carime-icon">
<u--image src="/static/img/DJSC.png" width="91.12rpx"
height="91.12rpx"></u--image>
<view class="">
@ -155,7 +158,7 @@
{{item.title}}
</view>
<view class="pop-li">
<up-input placeholder="请输入品种" border="surround" v-model="formData.value"></up-input>
<up-input placeholder="请输入品种" border="surround" v-model="formData.serch"></up-input>
</view>
<view style="margin-bottom: 20rpx;" v-for="item in [1]" :key="item">
@ -204,7 +207,8 @@
</u-popup>
</view>
<!-- 组件 -->
<u-picker :show="showPicker" :columns="columns" @confirm="confirmFn"></u-picker>
<u-picker :show="showPicker" :columns="columns" @confirm="confirmFn" @close="showPicker=false"
@cancel="showPicker=false"></u-picker>
<u-modal :show="showModal" :showCancelButton='true' :closeOnClickOverlay="true" @close="showModal=false"
content='确认删除吗?' @confirm="delFn" @cancel="showModal=false"></u-modal>
</view>
@ -224,6 +228,12 @@
import {
onLoad
} from "@dcloudio/uni-app"
import {
addFishRecordAPI
} from "@/api/aquatic.js"
import uplodeImg from "@/utils/uplodeImg.js"
const options1 = reactive([{
text: '删除'
}])
@ -233,13 +243,15 @@
], )
const confirmFn = (e) => {
showPicker.value = false
console.log(e.value)
formData.select = e.value[0]
}
const land_id = ref(0)
const pond_id = ref(0)
const type = ref(0)
const actionData = reactive({})
onLoad((options) => {
land_id.value = options.land_id
pond_id.value = options.pond_id
actionsListAPI({
type: options.type
}).then(res => {
@ -250,10 +262,22 @@
})
const showPop = ref(false)
const formData = reactive({
value: ""
text: "",
select: "",
pic: "",
serch: ""
})
const confirm = () => {
// addFishRecordAPI({
// })
showPop.value = false
console.log(formData)
for (let key in formData) {
formData[key] = ''
}
// var key of formData {
// }
@ -291,6 +315,13 @@
// console.log(popList)
})
}
const updateImgFn = () => {
uplodeImg().then(res => {
formData.pic = res.data.image
})
}
</script>
<style lang="scss" scoped>

View File

@ -11194,6 +11194,11 @@ This will fail in production.`);
}
};
const landInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-5f103973"], ["__file", "D:/zmj/uniapp/TraceabilityAPP/components/plant/landInfo.vue"]]);
const addFishAPI = (data) => syhttp.post("/FishBreed/addFish", data);
const pondInfoAPI = (data) => syhttp.get("/FishBreed/pondInfo", data);
const addFishPicAPI = (data) => syhttp.post("/FishBreed/addFishPic", data);
const pondEnvDataAPI = (data) => syhttp.get("/FishBreed/pondEnvData", data);
const fishPicListAPI = (data) => syhttp.get("/FishBreed/fishPicList", data);
const _sfc_main$N = {
__name: "index",
setup(__props) {
@ -11206,13 +11211,15 @@ This will fail in production.`);
]);
const confirmFn = (e2) => {
showPicker.value = false;
formatAppLog("log", "at pages/growRecord/index.vue:236", e2.value);
formData.select = e2.value[0];
};
const land_id = vue.ref(0);
const pond_id = vue.ref(0);
vue.ref(0);
const actionData = vue.reactive({});
onLoad((options) => {
land_id.value = options.land_id;
pond_id.value = options.pond_id;
actionsListAPI({
type: options.type
}).then((res) => {
@ -11223,10 +11230,17 @@ This will fail in production.`);
});
const showPop = vue.ref(false);
const formData = vue.reactive({
value: ""
text: "",
select: "",
pic: "",
serch: ""
});
const confirm = () => {
showPop.value = false;
formatAppLog("log", "at pages/growRecord/index.vue:275", formData);
for (let key in formData) {
formData[key] = "";
}
};
const showModal = vue.ref(false);
const delFn = () => {
@ -11249,11 +11263,16 @@ This will fail in production.`);
popList.push(item);
if (item.type == 4) {
columns[0] = Array.from(item.options);
formatAppLog("log", "at pages/growRecord/index.vue:288", columns[0]);
formatAppLog("log", "at pages/growRecord/index.vue:312", columns[0]);
}
});
});
};
const updateImgFn = () => {
uplodeImg().then((res) => {
formData.pic = res.data.image;
});
};
return (_ctx, _cache) => {
const _component_up_input = resolveEasycom(vue.resolveDynamicComponent("up-input"), __easycom_1$7);
const _component_u__image = resolveEasycom(vue.resolveDynamicComponent("u--image"), __easycom_0$6);
@ -11354,8 +11373,8 @@ This will fail in production.`);
show: showPop.value,
round: 10,
closeable: true,
onClose: _cache[6] || (_cache[6] = ($event) => showPop.value = false),
onOpen: _cache[7] || (_cache[7] = ($event) => showPop.value = true)
onClose: _cache[5] || (_cache[5] = ($event) => showPop.value = false),
onOpen: _cache[6] || (_cache[6] = ($event) => showPop.value = true)
}, {
default: vue.withCtx(() => [
vue.createElementVNode("scroll-view", {
@ -11387,8 +11406,8 @@ This will fail in production.`);
vue.createVNode(_component_up_input, {
placeholder: "请输入",
border: "surround",
modelValue: formData.value,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formData.value = $event),
modelValue: formData.text,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formData.text = $event),
onChange: _ctx.change
}, null, 8, ["modelValue", "onChange"])
])
@ -11407,11 +11426,10 @@ This will fail in production.`);
),
vue.createElementVNode("view", { class: "pop-li" }, [
vue.createVNode(_component_up_input, {
readonly: "",
placeholder: "点击选择",
border: "surround",
modelValue: formData.value,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.value = $event),
modelValue: formData.select,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => formData.select = $event),
onClick: _cache[3] || (_cache[3] = ($event) => showPicker.value = true)
}, null, 8, ["modelValue"])
])
@ -11428,12 +11446,21 @@ This will fail in production.`);
1
/* TEXT */
),
vue.createElementVNode("view", { class: "pop-li" }, [
vue.createElementVNode("view", { class: "code-img" }, [
vue.createElementVNode("view", {
class: "carime-icon",
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.updateImgFn && _ctx.updateImgFn(...args))
}, [
vue.createElementVNode("view", {
class: "pop-li",
onClick: updateImgFn
}, [
formData.pic ? (vue.openBlock(), vue.createElementBlock("view", { key: 0 }, [
vue.createVNode(_component_u__image, {
src: formData.pic,
width: "100%",
height: "196.26rpx"
}, null, 8, ["src"])
])) : (vue.openBlock(), vue.createElementBlock("view", {
key: 1,
class: "code-img"
}, [
vue.createElementVNode("view", { class: "carime-icon" }, [
vue.createVNode(_component_u__image, {
src: "/static/img/DJSC.png",
width: "91.12rpx",
@ -11441,7 +11468,7 @@ This will fail in production.`);
}),
vue.createElementVNode("view", { class: "" }, " 点击上传图片 ")
])
])
]))
])
])) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" 搜索框 "),
@ -11460,8 +11487,8 @@ This will fail in production.`);
vue.createVNode(_component_up_input, {
placeholder: "请输入品种",
border: "surround",
modelValue: formData.value,
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => formData.value = $event)
modelValue: formData.serch,
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => formData.serch = $event)
}, null, 8, ["modelValue"])
]),
(vue.openBlock(), vue.createElementBlock(
@ -11532,16 +11559,18 @@ This will fail in production.`);
vue.createVNode(_component_u_picker, {
show: showPicker.value,
columns,
onConfirm: confirmFn
onConfirm: confirmFn,
onClose: _cache[7] || (_cache[7] = ($event) => showPicker.value = false),
onCancel: _cache[8] || (_cache[8] = ($event) => showPicker.value = false)
}, null, 8, ["show", "columns"]),
vue.createVNode(_component_u_modal, {
show: showModal.value,
showCancelButton: true,
closeOnClickOverlay: true,
onClose: _cache[8] || (_cache[8] = ($event) => showModal.value = false),
onClose: _cache[9] || (_cache[9] = ($event) => showModal.value = false),
content: "确认删除吗?",
onConfirm: delFn,
onCancel: _cache[9] || (_cache[9] = ($event) => showModal.value = false)
onCancel: _cache[10] || (_cache[10] = ($event) => showModal.value = false)
}, null, 8, ["show"])
],
2
@ -21015,11 +21044,6 @@ ${i3}
}
};
const PagesAquaticAddAquatic = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "D:/zmj/uniapp/TraceabilityAPP/pages/aquatic/addAquatic.vue"]]);
const addFishAPI = (data) => syhttp.post("/FishBreed/addFish", data);
const pondInfoAPI = (data) => syhttp.get("/FishBreed/pondInfo", data);
const addFishPicAPI = (data) => syhttp.post("/FishBreed/addFishPic", data);
const pondEnvDataAPI = (data) => syhttp.get("/FishBreed/pondEnvData", data);
const fishPicListAPI = (data) => syhttp.get("/FishBreed/fishPicList", data);
const _sfc_main$c = {
__name: "addPond",
setup(__props) {
@ -21604,7 +21628,7 @@ ${i3}
"view",
{
class: "updata-btn",
onClick: _cache[1] || (_cache[1] = ($event) => navgo("/pages/growRecord/index?type=4"))
onClick: _cache[1] || (_cache[1] = ($event) => navgo(`/pages/growRecord/index?type=4&pond_id=${pond_id.value}`))
},
" 更新" + vue.toDisplayString(index2.slice(0, -2)),
1