Showing
3 changed files
with
89 additions
and
11 deletions
| ... | @@ -8,6 +8,7 @@ export {} | ... | @@ -8,6 +8,7 @@ export {} |
| 8 | declare module '@vue/runtime-core' { | 8 | declare module '@vue/runtime-core' { |
| 9 | export interface GlobalComponents { | 9 | export interface GlobalComponents { |
| 10 | AppointmentField: typeof import('./src/components/AppointmentField/index.vue')['default'] | 10 | AppointmentField: typeof import('./src/components/AppointmentField/index.vue')['default'] |
| 11 | + ApprovalField: typeof import('./src/components/ApprovalField/index.vue')['default'] | ||
| 11 | AreaPickerField: typeof import('./src/components/AreaPickerField/index.vue')['default'] | 12 | AreaPickerField: typeof import('./src/components/AreaPickerField/index.vue')['default'] |
| 12 | ButtonField: typeof import('./src/components/ButtonField/index.vue')['default'] | 13 | ButtonField: typeof import('./src/components/ButtonField/index.vue')['default'] |
| 13 | CalendarField: typeof import('./src/components/CalendarField/index.vue')['default'] | 14 | CalendarField: typeof import('./src/components/CalendarField/index.vue')['default'] |
| ... | @@ -44,6 +45,7 @@ declare module '@vue/runtime-core' { | ... | @@ -44,6 +45,7 @@ declare module '@vue/runtime-core' { |
| 44 | TextareaField: typeof import('./src/components/TextareaField/index.vue')['default'] | 45 | TextareaField: typeof import('./src/components/TextareaField/index.vue')['default'] |
| 45 | TextField: typeof import('./src/components/TextField/index.vue')['default'] | 46 | TextField: typeof import('./src/components/TextField/index.vue')['default'] |
| 46 | TimePickerField: typeof import('./src/components/TimePickerField/index.vue')['default'] | 47 | TimePickerField: typeof import('./src/components/TimePickerField/index.vue')['default'] |
| 48 | + VanActionSheet: typeof import('vant/es')['ActionSheet'] | ||
| 47 | VanArea: typeof import('vant/es')['Area'] | 49 | VanArea: typeof import('vant/es')['Area'] |
| 48 | VanButton: typeof import('vant/es')['Button'] | 50 | VanButton: typeof import('vant/es')['Button'] |
| 49 | VanCalendar: typeof import('vant/es')['Calendar'] | 51 | VanCalendar: typeof import('vant/es')['Calendar'] |
| ... | @@ -55,6 +57,7 @@ declare module '@vue/runtime-core' { | ... | @@ -55,6 +57,7 @@ declare module '@vue/runtime-core' { |
| 55 | VanDatePicker: typeof import('vant/es')['DatePicker'] | 57 | VanDatePicker: typeof import('vant/es')['DatePicker'] |
| 56 | VanDivider: typeof import('vant/es')['Divider'] | 58 | VanDivider: typeof import('vant/es')['Divider'] |
| 57 | VanField: typeof import('vant/es')['Field'] | 59 | VanField: typeof import('vant/es')['Field'] |
| 60 | + VanFloatingBubble: typeof import('vant/es')['FloatingBubble'] | ||
| 58 | VanForm: typeof import('vant/es')['Form'] | 61 | VanForm: typeof import('vant/es')['Form'] |
| 59 | VanIcon: typeof import('vant/es')['Icon'] | 62 | VanIcon: typeof import('vant/es')['Icon'] |
| 60 | VanImage: typeof import('vant/es')['Image'] | 63 | VanImage: typeof import('vant/es')['Image'] | ... | ... |
| ... | @@ -2,12 +2,12 @@ | ... | @@ -2,12 +2,12 @@ |
| 2 | * @Author: hookehuyr hookehuyr@gmail.com | 2 | * @Author: hookehuyr hookehuyr@gmail.com |
| 3 | * @Date: 2022-05-31 12:06:19 | 3 | * @Date: 2022-05-31 12:06:19 |
| 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 5 | - * @LastEditTime: 2024-06-06 16:36:43 | 5 | + * @LastEditTime: 2024-06-07 10:28:48 |
| 6 | * @FilePath: /data-table/src/main.js | 6 | * @FilePath: /data-table/src/main.js |
| 7 | * @Description: | 7 | * @Description: |
| 8 | */ | 8 | */ |
| 9 | import { createApp } from 'vue'; | 9 | import { createApp } from 'vue'; |
| 10 | -import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag, Swipe, SwipeItem, Dialog, ActionSheet, Loading, Checkbox, Search, NavBar, Collapse, CollapseItem, RadioGroup, Radio, CheckboxGroup, Area, DatePicker, TimePicker, PickerGroup, Rate, Calendar, Divider, Popover, NoticeBar, ImagePreview } from 'vant'; | 10 | +import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag, Swipe, SwipeItem, Dialog, ActionSheet, Loading, Checkbox, Search, NavBar, Collapse, CollapseItem, RadioGroup, Radio, CheckboxGroup, Area, DatePicker, TimePicker, PickerGroup, Rate, Calendar, Divider, Popover, NoticeBar, ImagePreview, FloatingBubble } from 'vant'; |
| 11 | import router from './router'; | 11 | import router from './router'; |
| 12 | import App from './App.vue'; | 12 | import App from './App.vue'; |
| 13 | // import axios from './utils/axios'; | 13 | // import axios from './utils/axios'; |
| ... | @@ -25,6 +25,6 @@ app.config.warnHandler = () => null; | ... | @@ -25,6 +25,6 @@ app.config.warnHandler = () => null; |
| 25 | 25 | ||
| 26 | app.config.globalProperties.$http = axios; // 关键语句 | 26 | app.config.globalProperties.$http = axios; // 关键语句 |
| 27 | 27 | ||
| 28 | -app.use(pinia).use(router).use(Button).use(VanImage).use(Col).use(Row).use(Icon).use(Form).use(Field).use(CellGroup).use(Toast).use(Uploader).use(Empty).use(Tab).use(Tabs).use(Overlay).use(NumberKeyboard).use(Lazyload).use(List).use(PullRefresh).use(Popup).use(Picker).use(Sticky).use(Stepper).use(Tag).use(Swipe).use(SwipeItem).use(Dialog).use(ActionSheet).use(Loading).use(Checkbox).use(Search).use(ConfigProvider).use(NavBar).use(Collapse).use(CollapseItem).use(Radio).use(RadioGroup).use(CheckboxGroup).use(Area).use(DatePicker).use(TimePicker).use(PickerGroup).use(Rate).use(Calendar).use(Divider).use(Popover).use(NoticeBar).use(ImagePreview); | 28 | +app.use(pinia).use(router).use(Button).use(VanImage).use(Col).use(Row).use(Icon).use(Form).use(Field).use(CellGroup).use(Toast).use(Uploader).use(Empty).use(Tab).use(Tabs).use(Overlay).use(NumberKeyboard).use(Lazyload).use(List).use(PullRefresh).use(Popup).use(Picker).use(Sticky).use(Stepper).use(Tag).use(Swipe).use(SwipeItem).use(Dialog).use(ActionSheet).use(Loading).use(Checkbox).use(Search).use(ConfigProvider).use(NavBar).use(Collapse).use(CollapseItem).use(Radio).use(RadioGroup).use(CheckboxGroup).use(Area).use(DatePicker).use(TimePicker).use(PickerGroup).use(Rate).use(Calendar).use(Divider).use(Popover).use(NoticeBar).use(ImagePreview).use(FloatingBubble); |
| 29 | app.use(vueEsign) | 29 | app.use(vueEsign) |
| 30 | app.mount('#app'); | 30 | app.mount('#app'); | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-07-18 10:22:22 | 2 | * @Date: 2022-07-18 10:22:22 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-06-04 17:19:56 | 4 | + * @LastEditTime: 2024-06-07 15:05:43 |
| 5 | * @FilePath: /data-table/src/views/index.vue | 5 | * @FilePath: /data-table/src/views/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -22,16 +22,34 @@ | ... | @@ -22,16 +22,34 @@ |
| 22 | <div v-if="PHeader.label" class="table-title" v-html="PHeader.label" /> | 22 | <div v-if="PHeader.label" class="table-title" v-html="PHeader.label" /> |
| 23 | <div v-if="PHeader.description" class="table-desc" v-html="PHeader.description" /> | 23 | <div v-if="PHeader.description" class="table-desc" v-html="PHeader.description" /> |
| 24 | <van-config-provider :theme-vars="themeVars"> | 24 | <van-config-provider :theme-vars="themeVars"> |
| 25 | - <van-form @submit="onSubmit" :scroll-to-error="true"> | 25 | + <van-form ref="myForm" @submit="onSubmit" :scroll-to-error="true"> |
| 26 | <van-cell-group :border="false"> | 26 | <van-cell-group :border="false"> |
| 27 | <component v-for="(item, index) in formData" :id="item.key" :ref="(el) => setRefMap(el, item)" :key="index" | 27 | <component v-for="(item, index) in formData" :id="item.key" :ref="(el) => setRefMap(el, item)" :key="index" |
| 28 | :is="item.component" :item="item" @active="onActive" @remove="onRemove" /> | 28 | :is="item.component" :item="item" @active="onActive" @remove="onRemove" /> |
| 29 | </van-cell-group> | 29 | </van-cell-group> |
| 30 | + <!-- 非流程版表单 --> | ||
| 30 | <div v-if="formData.length && PCommit.visible" style="margin: 16px"> | 31 | <div v-if="formData.length && PCommit.visible" style="margin: 16px"> |
| 31 | <van-button round block type="primary" native-type="submit" :disabled="submitStatus"> | 32 | <van-button round block type="primary" native-type="submit" :disabled="submitStatus"> |
| 32 | {{ PCommit.text ? PCommit.text : '提交' }} | 33 | {{ PCommit.text ? PCommit.text : '提交' }} |
| 33 | </van-button> | 34 | </van-button> |
| 34 | </div> | 35 | </div> |
| 36 | + <!-- 流程表单 --> | ||
| 37 | + <div v-if="formSetting.is_flow" style="margin: 16px; border-top: 1px dashed #eee; padding-top: 1rem;"> | ||
| 38 | + <p style="margin-bottom: 1rem; font-size: 0.85rem; font-weight: bold;">审批意见</p> | ||
| 39 | + <div style="margin-bottom: 1rem; border: 1px solid #eee;"> | ||
| 40 | + <van-field | ||
| 41 | + v-model="approval_note" | ||
| 42 | + rows="3" | ||
| 43 | + autosize | ||
| 44 | + label="" | ||
| 45 | + type="textarea" | ||
| 46 | + placeholder="" | ||
| 47 | + /> | ||
| 48 | + </div> | ||
| 49 | + <van-button round block type="primary" @click="approval_show=true" style="margin-bottom: 1rem;"> | ||
| 50 | + 审核操作 | ||
| 51 | + </van-button> | ||
| 52 | + </div> | ||
| 35 | <!-- <van-cell-group :border="false"> | 53 | <!-- <van-cell-group :border="false"> |
| 36 | <component | 54 | <component |
| 37 | v-for="(item, index) in mockData" | 55 | v-for="(item, index) in mockData" |
| ... | @@ -49,6 +67,12 @@ | ... | @@ -49,6 +67,12 @@ |
| 49 | </van-button> | 67 | </van-button> |
| 50 | </div> --> | 68 | </div> --> |
| 51 | </van-form> | 69 | </van-form> |
| 70 | + <!-- <van-floating-bubble | ||
| 71 | + axis="xy" | ||
| 72 | + icon="records-o" | ||
| 73 | + magnetic="x" | ||
| 74 | + @click="onClickFloatingBubble" | ||
| 75 | + /> --> | ||
| 52 | </van-config-provider> | 76 | </van-config-provider> |
| 53 | </div> | 77 | </div> |
| 54 | <div style="text-align: center; color: #545454; font-size: 0.85rem; padding-bottom: 2rem"> | 78 | <div style="text-align: center; color: #545454; font-size: 0.85rem; padding-bottom: 2rem"> |
| ... | @@ -77,6 +101,14 @@ | ... | @@ -77,6 +101,14 @@ |
| 77 | </div> | 101 | </div> |
| 78 | </div> | 102 | </div> |
| 79 | </van-overlay> | 103 | </van-overlay> |
| 104 | + <van-action-sheet | ||
| 105 | + v-model:show="approval_show" | ||
| 106 | + :actions="actions" | ||
| 107 | + @select="onApprovalSelect" | ||
| 108 | + cancel-text="取消" | ||
| 109 | + close-on-click-action | ||
| 110 | + @cancel="onApprovalCancel" | ||
| 111 | + /> | ||
| 80 | </template> | 112 | </template> |
| 81 | 113 | ||
| 82 | <script setup> | 114 | <script setup> |
| ... | @@ -190,6 +222,36 @@ const onSubmitPwd = async () => { | ... | @@ -190,6 +222,36 @@ const onSubmitPwd = async () => { |
| 190 | } | 222 | } |
| 191 | } | 223 | } |
| 192 | 224 | ||
| 225 | +const approval_show = ref(false); | ||
| 226 | +const approval_note = ref(''); | ||
| 227 | +// 审批组件点击 | ||
| 228 | +const onClickFloatingBubble = () => { | ||
| 229 | + approval_show.value = true; | ||
| 230 | +} | ||
| 231 | +const myForm = ref(null); | ||
| 232 | +const actions = [ | ||
| 233 | + { name: '提交', id: 'commit', }, | ||
| 234 | + { name: '撤回', id: 'withdraw', disabled: true }, | ||
| 235 | + { name: '驳回', id: 'reject', }, | ||
| 236 | + { name: '结束流程', key: 'terminate', }, | ||
| 237 | +]; | ||
| 238 | +const onApprovalSelect = (item) => { | ||
| 239 | + switch (item.id) { | ||
| 240 | + case 'commit': | ||
| 241 | + myForm.value.submit() | ||
| 242 | + break; | ||
| 243 | + case 'withdraw': | ||
| 244 | + break; | ||
| 245 | + case 'reject': | ||
| 246 | + break; | ||
| 247 | + case 'terminate': | ||
| 248 | + break; | ||
| 249 | + } | ||
| 250 | +}; | ||
| 251 | +const onApprovalCancel = () => { | ||
| 252 | + | ||
| 253 | +} | ||
| 254 | + | ||
| 193 | onMounted(async () => { | 255 | onMounted(async () => { |
| 194 | // TAG: 全局背景色 | 256 | // TAG: 全局背景色 |
| 195 | document | 257 | document |
| ... | @@ -379,12 +441,18 @@ onMounted(async () => { | ... | @@ -379,12 +441,18 @@ onMounted(async () => { |
| 379 | // }) | 441 | // }) |
| 380 | formData.value = formatData(page_form); | 442 | formData.value = formatData(page_form); |
| 381 | // TODO:再次提交测试, 需要获取原来表单数据 | 443 | // TODO:再次提交测试, 需要获取原来表单数据 |
| 382 | - // formData.value.forEach((item) => { | 444 | + formData.value.forEach((item) => { |
| 383 | - // if (item.key === 'field_4') { | 445 | + if (item.key === 'field_32') { |
| 384 | - // // 不同组件默认值可能获取方式设定不一样,需要检查下 | 446 | + // 不同组件默认值可能获取方式设定不一样,需要检查下 |
| 385 | - // item.component_props.default = '123'; | 447 | + item.component_props.default = '12345657'; |
| 386 | - // } | 448 | + } |
| 387 | - // }); | 449 | + }); |
| 450 | + // TODO: 设置读写权限 read_only read_write | ||
| 451 | + formData.value.forEach((item) => { | ||
| 452 | + if (item.key === 'field_32') { | ||
| 453 | + item.component_props.readonly = true; | ||
| 454 | + } | ||
| 455 | + }); | ||
| 388 | // TAG: mock数据 | 456 | // TAG: mock数据 |
| 389 | mockData.value = [ | 457 | mockData.value = [ |
| 390 | { | 458 | { |
| ... | @@ -489,6 +557,8 @@ onMounted(async () => { | ... | @@ -489,6 +557,8 @@ onMounted(async () => { |
| 489 | submitStatus.value = true; | 557 | submitStatus.value = true; |
| 490 | } | 558 | } |
| 491 | } | 559 | } |
| 560 | + // TODO: 判断是否流程表单 | ||
| 561 | + formSetting.value.is_flow = false; | ||
| 492 | }); | 562 | }); |
| 493 | 563 | ||
| 494 | // 打开轮询用户是否关注 | 564 | // 打开轮询用户是否关注 |
| ... | @@ -800,6 +870,11 @@ const onSubmit = async (values) => { | ... | @@ -800,6 +870,11 @@ const onSubmit = async (values) => { |
| 800 | </script> | 870 | </script> |
| 801 | 871 | ||
| 802 | <style lang="less"> | 872 | <style lang="less"> |
| 873 | + | ||
| 874 | +:root:root { | ||
| 875 | + --van-floating-bubble-background: #C2915F; | ||
| 876 | +} | ||
| 877 | + | ||
| 803 | .table-title { | 878 | .table-title { |
| 804 | padding: 1rem; | 879 | padding: 1rem; |
| 805 | font-size: 1.15rem; | 880 | font-size: 1.15rem; | ... | ... |
-
Please register or login to post a comment