errorDisposition.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <u-navbar :titleStyle="{ color: '#fff' }" :autoBack="true" title="处置内容" :placeholder="true" :safeAreaInsetTop="true" :bgColor="proxy.$settingStore.themeColor.color">
  3. <template #left>
  4. <view class="u-navbar__content__left__item">
  5. <u-icon name="arrow-left" size="20" color="#fff"></u-icon>
  6. </view>
  7. </template>
  8. </u-navbar>
  9. <oa-scroll
  10. customClass="errorDisposition-container scroll-height"
  11. :customStyle="{ height: `calc(100vh - (44px + ${proxy.$settingStore.StatusBarHeight} + ${proxy.$settingStore.tabBarHeight}))` }"
  12. :refresherLoad="false"
  13. :refresherEnabled="false"
  14. :refresherEnabledTitle="false"
  15. :refresherDefaultStyle="'none'"
  16. :refresherThreshold="44"
  17. :refresherBackground="'#f5f6f7'"
  18. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  19. >
  20. <template #default>
  21. <u--form ref="uForm" :model="form" :rules="rules" labelWidth="90">
  22. <view style="padding: 10px 10px 20px 20px; background: #ffffff">
  23. <u-form-item label="事件名称" prop="eventName" :borderBottom="true" required>
  24. <view style="color: #666666">{{ form.eventName }}</view>
  25. </u-form-item>
  26. <u-form-item label="处置图片" :borderBottom="true">
  27. <oa-upload :uploadCount="5" :uploadList="form.imageList" :uploadListSrc="'url'" @uploadSuccessChange="uploadSuccessChange" @uploadDeleteChange="uploadDeleteChange"></oa-upload>
  28. </u-form-item>
  29. <u-form-item label="备注" prop="remark" :borderBottom="true">
  30. <u--textarea v-model="form.handleContent" placeholder="备注信息,最多可输入50个字" :count="true" border="none" maxlength="50"></u--textarea>
  31. </u-form-item>
  32. </view>
  33. </u--form>
  34. <view class="app-button">
  35. <view class="app-button-padding"></view>
  36. <view class="app-button-fixed">
  37. <u-button class="app-buttom" type="primary" @click="handleSubmit()" shape="circle"> 提交 </u-button>
  38. </view>
  39. </view>
  40. </template>
  41. </oa-scroll>
  42. </template>
  43. <script setup>
  44. /*----------------------------------依赖引入-----------------------------------*/
  45. import { onLoad, onShow } from "@dcloudio/uni-app";
  46. import { reactive, toRefs, getCurrentInstance } from "vue";
  47. /*----------------------------------接口引入-----------------------------------*/
  48. import { errorApi } from "@/api/business/zhaf/xunJian/index.js";
  49. /*----------------------------------组件引入-----------------------------------*/
  50. /*----------------------------------公共方法引入-----------------------------------*/
  51. /*----------------------------------公共变量-----------------------------------*/
  52. const { proxy } = getCurrentInstance();
  53. /*----------------------------------变量声明-----------------------------------*/
  54. const state = reactive({
  55. form: {
  56. eventName: "", //事件名称
  57. imageList: [],
  58. handleImage: "",
  59. handleContent: "",
  60. id: undefined,
  61. },
  62. });
  63. const { form } = toRefs(state);
  64. /**
  65. * @按钮点击事件
  66. */
  67. function handleSubmit() {
  68. if (!proxy.$common.isNetwork()) {
  69. return false;
  70. }
  71. var param = {
  72. eventName: state.form.eventName, //事件名称
  73. handleImage: JSON.stringify(state.form.imageList),
  74. handleContent: state.form.handleContent,
  75. id: state.form.id,
  76. };
  77. errorApi()
  78. .Update(param)
  79. .then(() => {
  80. proxy.$modal.msg("提交成功");
  81. proxy.$tab.navigateBack(2);
  82. })
  83. .catch((err) => {
  84. proxy.$modal.msg(err);
  85. });
  86. }
  87. /**
  88. * @图片上传成功回调
  89. */
  90. function uploadSuccessChange(e) {
  91. state.form.imageList.push({
  92. name: e.name,
  93. url: e.url,
  94. });
  95. }
  96. /**
  97. * @图片删除回调
  98. */
  99. function uploadDeleteChange(e) {
  100. state.form.imageList = e;
  101. }
  102. onLoad((options) => {
  103. state.form.id = options.id;
  104. state.form.eventName = options.eventName;
  105. });
  106. onShow(() => {
  107. //调用系统主题颜色
  108. proxy.$settingStore.systemThemeColor([1]);
  109. });
  110. </script>
  111. <style lang="scss"></style>