uploadEditMyHonor.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <template>
  2. <view class="page_body">
  3. <!-- 头部 -->
  4. <nav-bar height="96" :title="state.title" :onlyTitle="true" :showHeaderborder="true" @GoBack="GoBack"></nav-bar>
  5. <view :class="['page_content',{'view':state.type=='view'}]">
  6. <uni-forms ref="valiForm" :class="['forms_style',{'view':state.type=='view'}]" :rules="rules" :model="state.formData" border labelWidth="160rpx" label-align="right">
  7. <uni-forms-item label="荣誉类型:" required name="honorTypeValue">
  8. <template v-if="state.type=='view'">{{state.formData.honorTypeValue}}</template>
  9. <uni-data-select v-else v-model="state.formData.honorTypeValue" :clear="false" placeholder="请选择荣誉类型" :disabled="state.type=='upload'?false:true" :localdata="state.honorTypeData" style="width: 400rpx;" @change="ChangeDataSelect"></uni-data-select>
  10. </uni-forms-item>
  11. <template v-for="item in state.dynamicFormData">
  12. <uni-forms-item :label="`${item.dictName}:`" required :name="`input_${item.id}`">
  13. <template v-if="state.type=='view'">
  14. <template v-if="item.dictType == 1 || item.dictType == 2">{{state.formData[`${item.dictShowType}_${item.id}`]}}</template>
  15. <uni-dateformat v-else :date="state.formData[`${item.dictShowType}_${item.id}`]" format="yyyy-MM-dd"></uni-dateformat>
  16. </template>
  17. <template v-else>
  18. <uni-easyinput v-if="item.dictType == 1" v-model="state.formData[`${item.dictShowType}_${item.id}`]" :disabled="item.onlyRead == 1" :maxlength="100" :placeholder="`请输入${item.dictName}`" :style="{width: item.dictName=='获奖人'?'400rpx':''}" />
  19. <uni-data-select v-else-if="item.dictType == 2" v-model="state.formData[`${item.dictShowType}_${item.id}`]" :clear="false" :placeholder="`请选择${item.dictName}`" :localdata="item.dictList" style="width: 400rpx;"></uni-data-select>
  20. <uni-datetime-picker v-else type="date" :end="todayStr" :clear-icon="false" v-model="state.formData[`${item.dictShowType}_${item.id}`]" placeholder=" " style="width: 400rpx;" />
  21. </template>
  22. </uni-forms-item>
  23. </template>
  24. <uni-forms-item label="荣誉证书:" required name="certPicDatas">
  25. <uv-upload :maxCount="state.type=='view'?state?.formData?.certPicDatas?.length:50" :deletable="state.type!='view'" :fileList="state.formData.certPicDatas" width="240rpx" height="140rpx" multiple :previewFullImage="true" @AfterRead="AfterRead" @delete="DeletePic">
  26. <view class="upload_btn" v-if="state.type!='view'">
  27. <uni-icons class="upload_btn_icon" type="plusempty"></uni-icons>
  28. <view class="upload_btn_text">上传荣誉证书</view>
  29. </view>
  30. </uv-upload>
  31. </uni-forms-item>
  32. <uni-forms-item label="佐证材料:">
  33. <template v-if="state.type=='view'">
  34. <view class="upload_file_list_item" v-for="item in state.formData.docDatas" :key="item.createdAt">
  35. <image class="list_item_icon" src="/static/image/icon/file.png"></image>
  36. <view class="list_item_content">
  37. <view class="item_content_title">{{item.documentName}}</view>
  38. <view class="item_content_info">
  39. <view class="size">{{item.fileSize}}</view>
  40. <view class="time">{{item.createdAt}}</view>
  41. </view>
  42. </view>
  43. <view class="list_item_preview" @click="PreviewFile(item)">预览</view>
  44. </view>
  45. </template>
  46. <template v-else>
  47. <!-- maxSize:单文件上限 MB;0 表示不限制 maxCount:列表最多文件数 -->
  48. <kex-file-uploader ref="fileUploader" mode="headless" :max-count="20" :maxSize="100"></kex-file-uploader>
  49. <view class="upload_file_btn" @click="ChooseUploadFile">
  50. <uni-icons class="upload_file_btn_icon" type="plusempty"></uni-icons>
  51. <view class="upload_file_btn_text">上传佐证材料</view>
  52. </view>
  53. <view class="upload_file_list_item" v-for="(item,i) in state.formData.docDatas" :key="item.createdAt" @click="PreviewFile(item)">
  54. <image class="list_item_icon" src="/static/image/icon/file.png"></image>
  55. <view class="list_item_content">
  56. <view class="item_content_title">{{item.documentName}}</view>
  57. <view class="item_content_info">
  58. <view class="size">{{item.fileSize}}</view>
  59. <view class="time">{{item.createdAt}}</view>
  60. </view>
  61. </view>
  62. <uni-icons class="list_item_close" type="close" @click.stop="state.formData.docDatas.splice(i, 1)"></uni-icons>
  63. </view>
  64. </template>
  65. </uni-forms-item>
  66. <uni-forms-item label="驳回原因 :" v-if="state.formData.overruleContent">
  67. {{state.formData.overruleContent}}
  68. </uni-forms-item>
  69. <uni-forms-item label="审核人:" v-if="state.type=='view'">
  70. {{state.formData.reviewTeacherName}}
  71. </uni-forms-item>
  72. </uni-forms>
  73. </view>
  74. <view class="page_foot" v-if="state.type!='view'"><button class="btn_submit" type="primary" :loading="state.loading" @click="honorTypeConfirm">确认</button></view>
  75. </view>
  76. <!-- 提示框 -->
  77. <popupPreviewFile ref="popupDialogRef" :filePath="state.previewPopup.filePath"></popupPreviewFile>
  78. <!-- 文件、图片下载 -->
  79. <ss-download ref="ssdownload"></ss-download>
  80. </template>
  81. <script setup>
  82. import navBar from '@/components/navBar.vue';
  83. import uniForms from '@/uni_modules/uni-forms/components/uni-forms/uni-forms.vue';
  84. import uniFormsItem from '@/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue';
  85. import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue';
  86. import uniDataSelect from '@/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue';
  87. import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue';
  88. import uniDateformat from '@/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue';
  89. import uvUpload from '@/uni_modules/uv-upload/components/uv-upload/uv-upload.vue';
  90. import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue';
  91. import ssDownload from '@/uni_modules/ss-download/components/ss-download/ss-download.vue';
  92. import popupPreviewFile from '@/components/popupPreviewFile.vue';
  93. import {queryHonorTypeDictList,queryHonorDataDetailById,addHonorCertData,updateHonorCertData} from '@/reqApi/teacherHonor.js';
  94. import { unioformDateTransform,fileSizeConvert } from '@/common/common.js';
  95. import config from '@/config.js'; // 引入配置文件
  96. import {
  97. reactive,
  98. ref,
  99. onMounted,
  100. nextTick
  101. } from 'vue';
  102. import { onLoad } from '@dcloudio/uni-app';
  103. const state = reactive({
  104. id:'',//荣誉类型id
  105. title:'',//标题
  106. type:'',
  107. formData: {
  108. honorTypeValue: '',//荣誉类型id
  109. certPicDatas:[],//荣誉证书
  110. docDatas:[],//佐证材料
  111. overruleContent:'',//驳回原因
  112. reviewTeacherName:''//审核人
  113. },
  114. honorTypeData:[],//荣誉类型下拉
  115. dynamicFormData:[],//动态表单
  116. dictDatas:[],//动态表单传参
  117. loading:false,
  118. previewPopup:{
  119. filePath:''
  120. }
  121. })
  122. const todayStr = ref(new Date().toISOString().split('T')[0]);
  123. const rules = ref({
  124. honorTypeValue: { rules: [{ required: true, errorMessage: '请选择荣誉类型' }] },
  125. certPicDatas: { rules: [{ required: true, errorMessage: '请上传荣誉证书' }] },
  126. });
  127. const fileUploader = ref(null);
  128. const popupDialogRef = ref(null);
  129. const ssdownload = ref(null);
  130. const token = ref(uni.getStorageSync('token'));
  131. const apiBaseUrl = ref('');
  132. onLoad(async(option) => {
  133. state.id = option.id;
  134. state.type = option.type;
  135. getApiBaseUrl();
  136. uni.setStorageSync('isLoadMyHonorList', false);//返回列表页是否重新加载我的荣誉列表
  137. await GetHonorTypeDictList(option.type);//查询荣誉类型下拉数据
  138. if(option.type == 'upload'){
  139. state.title = '上传荣誉';
  140. }else{
  141. if(option.type == 'edit'){
  142. state.title = '修改荣誉';
  143. }else {
  144. state.title = decodeURIComponent(option.honorName);
  145. }
  146. GetHonorDataDetailById();
  147. }
  148. })
  149. //上传接口地址
  150. const getApiBaseUrl = () => {
  151. if (process.env.NODE_ENV === 'development') {//本地开发环境
  152. const SYSTEM_INFO = uni.getSystemInfoSync();//获取系统信息的同步接口
  153. apiBaseUrl.value = SYSTEM_INFO.uniPlatform === 'web' ? config.proxyBaseUrl:config.apiBaseUrl;//读取配置文件的apiBaseUrl变量
  154. } else {//生产/测试环境
  155. apiBaseUrl.value = config.apiBaseUrl
  156. }
  157. }
  158. //查询荣誉类型下拉数据
  159. const GetHonorTypeDictList = async (type) => {
  160. await queryHonorTypeDictList().then(res=>{
  161. if(res.code == 200){
  162. const honorTypeData = res?.data?.honorTypeDictBOS || [];
  163. honorTypeData.forEach(item=>{
  164. item.value = item.id;
  165. item.text = item.honorTypeName;
  166. const honorTypeDictData = item?.honorTypeDictBOS || [];
  167. honorTypeDictData.forEach(itemList=>{
  168. if(itemList.dictType == 2){//单选
  169. itemList.dictShowType = 'radio';
  170. const dictList = itemList?.dictList || [];
  171. dictList.forEach(dic=>{
  172. dic.text = dic.dictName;
  173. dic.value = dic.id
  174. })
  175. }else if(itemList.dictType == 1){//输入框
  176. itemList.dictShowType = 'input';
  177. }else{//日期
  178. itemList.dictShowType = 'datetime';
  179. }
  180. })
  181. })
  182. state.honorTypeData = honorTypeData;//荣誉类型下拉数据;
  183. if(type == 'upload'){//荣誉类型默认值
  184. state.formData.honorTypeValue = honorTypeData?.[0].value || '';//荣誉类型默认值
  185. const honorTypeDictData = honorTypeData?.[0]?.honorTypeDictBOS || [];
  186. SetDynamicFormData(honorTypeDictData);//设置动态表单
  187. }
  188. }else{
  189. state.honorTypeData = [];
  190. }
  191. })
  192. }
  193. //设置动态表单的值
  194. const SetDynamicFormData = (honorTypeDictData) => {
  195. honorTypeDictData.forEach(item=>{
  196. if(item.dictType == 2){//单选
  197. state.formData[`${item.dictShowType}_${item.id}`] = '';
  198. rules.value[`${item.dictShowType}_${item.id}`] = { rules: [{ required: true, errorMessage: `请选择${item.dictName}` }] };
  199. }else {//输入框 日期
  200. const value = item?.dictList?.[0]?.dictName || '';
  201. state.formData[`${item.dictShowType}_${item.id}`] = value;
  202. const placeholder = item.dictType == 1 ? '请输入' : '请选择';
  203. rules.value[`${item.dictShowType}_${item.id}`] = { rules: [{ required: true, errorMessage: `${placeholder}${item.dictName}` }] };
  204. }
  205. })
  206. state.dynamicFormData = honorTypeDictData;//动态表单
  207. }
  208. //改变荣誉类型
  209. const ChangeDataSelect = (val) => {
  210. const selectedHonorType = state.honorTypeData.find(item=>item.id == val);
  211. const honorTypeDictData = selectedHonorType?.honorTypeDictBOS || [];
  212. SetDynamicFormData(honorTypeDictData)
  213. }
  214. //查看荣誉详情接口
  215. const GetHonorDataDetailById = () => {
  216. queryHonorDataDetailById(state.id).then(res=>{
  217. if(res.code == 200){
  218. const honorTypeId = res?.data?.honorTypeId || '';
  219. const honorTypeName = res?.data?.honorTypeName || '';
  220. state.formData.honorTypeValue = state.type=='view'?honorTypeName:honorTypeId;//荣誉类型默认值
  221. //给动态表单设置值
  222. const selectedHonorType = state.honorTypeData.find(item=>item.id == honorTypeId);
  223. const honorTypeDictData = selectedHonorType?.honorTypeDictBOS || [];
  224. state.dynamicFormData = honorTypeDictData;//动态表单
  225. const honorDataList = res?.data?.honorDataList || '';
  226. honorDataList.forEach(item=>{
  227. if(item.dictType == 2){//单选
  228. state.formData[`radio_${item.honorDictLibNameId}`] = state.type!='view'?item.honorDictLibValueId:item.honorDictLibValue;
  229. }else {//输入框 日期
  230. const type = item.dictType == 1 ? 'input' : 'datetime';
  231. state.formData[`${type}_${item.honorDictLibNameId}`] = item.honorDictLibValue;
  232. }
  233. })
  234. const honorDataCertList = res?.data?.honorDataCertList || [];//荣誉证书
  235. state.formData.certPicDatas = honorDataCertList.map(item=>({
  236. ...item,
  237. url:item.picUrl
  238. }));//荣誉证书
  239. state.formData.docDatas = res?.data?.supportDocumentList || [];//佐证材料
  240. state.formData.overruleContent = res?.data?.overruleContent || '';//驳回原因
  241. state.formData.reviewTeacherName = res?.data?.reviewTeacherName || '';//审核人
  242. }
  243. })
  244. }
  245. //提交
  246. const honorTypeConfirm = () => {
  247. for (const key in rules.value) {
  248. if (state.formData?.[key] === "" || state.formData?.[key] === null || state.formData?.[key]&&state.formData?.[key]?.length === 0) {
  249. const errorMessage = rules.value[key].rules[0].errorMessage;
  250. uni.showToast({
  251. title: errorMessage,
  252. icon: 'none'
  253. })
  254. return false
  255. }
  256. }
  257. state.loading = true;
  258. const certPicDatas = state.formData.certPicDatas.map(item=>({
  259. name:item.picName,
  260. url:item.url,
  261. fileSize:item?.fileSize || '',
  262. time:item?.time || '',
  263. }))
  264. const docDatas = state.formData.docDatas.map(item=>({
  265. name:item.documentName,
  266. url:item.documentUrl,
  267. fileSize:item.fileSize,
  268. time:item.createdAt,
  269. }))
  270. const dictDatas = [];
  271. state.dynamicFormData.forEach(item=>{
  272. if(item.dictType == 2){//单选
  273. const valueData = state.formData[`${item.dictShowType}_${item.id}`];
  274. const dictList = item?.dictList || [];
  275. const valueName = dictList.find(dic=>dic.id == valueData);
  276. dictDatas.push({
  277. keyId: item.id,
  278. keyName: item.dictName,
  279. valueId: valueData,
  280. valueName: valueName?.dictName || ''
  281. })
  282. }else{
  283. let valueData = state.formData[`${item.dictShowType}_${item.id}`];
  284. if(state.type == 'upload' && Number(item.dictType) === 0){
  285. valueData = valueData + ' 00:00:00'
  286. }
  287. const dictList = item?.dictList || [];
  288. dictDatas.push({
  289. keyId: item.id,
  290. keyName: item.dictName,
  291. valueId: dictList?.[0]?.id,
  292. valueName: valueData
  293. })
  294. }
  295. })
  296. let params = {
  297. certPicDatas: certPicDatas,
  298. dictDatas: dictDatas,
  299. docDatas:docDatas,
  300. honorTypeId: state.formData.honorTypeValue
  301. }
  302. if(state.id){
  303. params.id = state.id;
  304. updateHonorCertData(params).then(res=>{
  305. if(res.code == 200){
  306. uni.showToast({
  307. title: '修改成功!',
  308. icon: 'none'
  309. })
  310. uni.setStorageSync('isLoadMyHonorList', true);//返回列表页是否重新加载我的荣誉列表
  311. GoBack();
  312. }
  313. }).finally(()=>{
  314. state.loading = false;
  315. })
  316. }else{//新建
  317. addHonorCertData(params).then(res=>{
  318. if(res.code == 200){
  319. uni.showToast({
  320. title: '上传成功!',
  321. icon: 'none'
  322. })
  323. uni.setStorageSync('isLoadMyHonorList', true);//返回列表页是否重新加载我的荣誉列表
  324. GoBack();
  325. }
  326. }).finally(()=>{
  327. state.loading = false;
  328. })
  329. }
  330. }
  331. // 删除图片
  332. const DeletePic = (event) => {
  333. state.formData.certPicDatas.splice(event.index, 1);
  334. }
  335. // 新增图片
  336. const AfterRead = async(event) => {
  337. // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
  338. let lists = [].concat(event.file);
  339. let fileListLen = state.formData.certPicDatas.length;
  340. lists.map((item) => {
  341. state.formData.certPicDatas.push({
  342. ...item,
  343. status: 'uploading',
  344. message: '上传中1'
  345. })
  346. })
  347. for (let i = 0; i < lists.length; i++) {
  348. const result = await uploadFilePromise(lists[i].url);
  349. if(result.code == 200){
  350. let item = state.formData.certPicDatas[fileListLen]
  351. state.formData.certPicDatas.splice(fileListLen, 1, Object.assign(item, {
  352. status: 'success',
  353. message: '',
  354. picName: result?.data?.fileName,
  355. url:result?.data?.url,
  356. fileSize:fileSizeConvert(lists?.[i]?.size || 0),
  357. time:unioformDateTransform(new Date())
  358. }))
  359. fileListLen++
  360. }
  361. }
  362. }
  363. const uploadFilePromise = (url) => {
  364. return new Promise((resolve, reject) => {
  365. let a = uni.uploadFile({
  366. url: `${apiBaseUrl.value}/api/v1/teach/oss/file/oss/upload_filesSele`,
  367. filePath: url,
  368. name: 'file',
  369. header:{
  370. Authorization:token.value
  371. },
  372. success: (res) => {
  373. const resdata = JSON.parse(res.data);
  374. resolve(resdata)
  375. }
  376. });
  377. })
  378. }
  379. //上传 图片 视频 文档
  380. const ChooseUploadFile = () => {
  381. fileUploader.value.chooseFile({//选择上传文件
  382. count: 1,
  383. success: (files) => {
  384. fileUploader.value.upload({//上传单个文件
  385. url:`${apiBaseUrl.value}/api/v1/teach/oss/file/oss/upload_filesSele`,
  386. file: files[0],
  387. name: 'file',
  388. header: {Authorization: token.value},
  389. method: 'POST',
  390. // withCredentials: true, // iOS 本地测远程且要带 cookie
  391. success: (res) => {
  392. const result = JSON.parse(res.result);
  393. state.formData.docDatas.push({
  394. documentName:result.data.fileName,
  395. documentUrl:result.data.url,
  396. fileSize:fileSizeConvert(files?.[0]?.size || 0),
  397. createdAt:unioformDateTransform(new Date())
  398. })
  399. },
  400. fail: (e) => console.log(e,`${apiBaseUrl.value}/api/v1/teach/oss/file/oss/upload_filesSele`,9999)
  401. });
  402. // const fileItem = files[0]
  403. // // 不使用 fileUploader.value.upload,改用uni原生上传API
  404. // uni.uploadFile({
  405. // url: `${apiBaseUrl.value}/api/v1/teach/oss/file/oss/upload_filesSele`,
  406. // filePath: fileItem.path,
  407. // name: 'file', //后端接收文件字段名
  408. // header: {
  409. // Authorization: token.value
  410. // },
  411. // timeout: 120000, //上传超时时间,大文件2分钟
  412. // success: (res) => {
  413. // console.log('上传成功',res, res.statusCode, res.data)
  414. // const result = JSON.parse(res.data);
  415. // state.formData.docDatas.push({
  416. // documentName: result.data.fileName,
  417. // documentUrl: result.data.url,
  418. // fileSize: fileSizeConvert(fileItem?.size || 0),
  419. // createdAt: unioformDateTransform(new Date())
  420. // })
  421. // },
  422. // fail: (err) => {
  423. // //这里打印iOS原生真实错误,不再是组件包装后的“网络错误”
  424. // console.error('uni.uploadFile原生失败', err)
  425. // }
  426. // })
  427. }
  428. })
  429. }
  430. //预览
  431. const PreviewFile = (item) => {
  432. const fileType = item?.documentName?.split('.')?.[1] || '';
  433. if(IsImageExts(fileType)){//图片预览
  434. state.previewPopup.filePath = item.documentUrl;
  435. popupDialogRef.value.OpenDialog();
  436. }else{//文件预览
  437. ToDownloadFile(item)
  438. }
  439. }
  440. //判断是否是图片
  441. const IsImageExts = (fileType) => {
  442. const type = fileType?.toLowerCase();
  443. const imageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp','svg', 'tiff', 'tif', 'ico', 'avif', 'heic', 'heif'];
  444. return imageExts.includes(type)
  445. }
  446. //判断是不是视频
  447. const IsVideoExts = (fileType) => {
  448. const type = fileType?.toLowerCase();
  449. const videoExts = [
  450. 'mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv',
  451. 'webm', 'm4v', '3gp', 'mpeg', 'mpg', 'mts',
  452. 'm2ts', 'ts', 'vob', 'ogv', 'ogg', 'rm', 'rmvb'
  453. ];
  454. return videoExts.includes(type)
  455. }
  456. //下载
  457. const ToDownloadFile = (item) => {
  458. const fileType = item?.documentName?.split('.')?.[1] || '';
  459. let type = '';
  460. if(IsImageExts(fileType)){
  461. type = '1';//1:图片 2 文档 3 视频
  462. }else if(IsVideoExts(fileType)){
  463. type = '3';
  464. }else{
  465. type = '2';
  466. }
  467. ssdownload?.value?.toDownload({
  468. type:fileType,
  469. src:item.documentUrl,
  470. fileName:item.documentName
  471. });
  472. }
  473. const GoBack = () => {
  474. uni.navigateBack({
  475. delta: 1
  476. });
  477. }
  478. </script>
  479. <style lang="scss" scoped>
  480. .page_body{
  481. height: 100%;
  482. min-height: auto;
  483. overflow: hidden;
  484. }
  485. .page_content{
  486. height: calc(100% - 250rpx);
  487. overflow: auto;
  488. &.view{
  489. height: calc(100% - 96rpx);
  490. }
  491. }
  492. .forms_style{
  493. &.view{
  494. :deep(.uni-forms-item){
  495. &.uni-forms-item--border{
  496. .uni-forms-item__label{
  497. padding-top: 0rpx;
  498. }
  499. }
  500. }
  501. }
  502. :deep(.uni-forms-item){
  503. &.uni-forms-item--border{
  504. border-top: 0;
  505. border-bottom: 2rpx solid #F3F3F3;
  506. .uni-forms-item__label{
  507. align-items: flex-start;
  508. padding-top: 16rpx;
  509. }
  510. }
  511. .uv-upload__wrap{
  512. // flex-direction: row-reverse;
  513. gap: 24rpx 32rpx;
  514. .uv-upload__wrap__preview{
  515. background-color: #FFFFFF;
  516. border-radius: 20rpx;
  517. border: 2rpx solid #CED1D8;
  518. box-sizing: border-box;
  519. margin: 0;
  520. .uv-upload__deletable{
  521. top:10rpx;
  522. right: 10rpx;
  523. background-color: transparent;
  524. height: 32rpx;
  525. width: 32rpx;
  526. border: 2rpx solid #999999;
  527. border-radius: 50%;
  528. .uvicon-close{
  529. color:#999999 !important;
  530. font-size: 11rpx !important;
  531. }
  532. }
  533. .uv-upload__deletable__icon{
  534. transform: scale(1);
  535. top:50%;
  536. right: 50%;
  537. transform: translate(50%, -50%);
  538. }
  539. .uv-upload__success{
  540. border-width: 20rpx;
  541. }
  542. }
  543. .upload_btn{
  544. width: 240rpx;
  545. height: 140rpx;
  546. background-color: #FAFBFF;
  547. border-radius: 20rpx;
  548. border: 2rpx solid #CCCED4;
  549. box-sizing: border-box;
  550. display: flex;
  551. flex-direction: column;
  552. align-items: center;
  553. justify-content: center;
  554. .upload_btn_icon{
  555. font-size: 40rpx !important;
  556. color: #CCCED4 !important;
  557. }
  558. .upload_btn_text{
  559. margin-top: 16rpx;
  560. font-weight: 400;
  561. font-size: 24rpx;
  562. color: #CCCED4;
  563. }
  564. }
  565. }
  566. .upload_file_btn{
  567. width: 100%;
  568. height: 120rpx;
  569. display: flex;
  570. justify-content: center;
  571. flex-direction: column;
  572. align-items: center;
  573. background-color: #FAFBFF;
  574. border-radius: 20rpx;
  575. border: 2rpx dashed #CCCED4;
  576. .upload_file_btn_icon{
  577. font-size: 40rpx !important;
  578. color: #CCCED4 !important;
  579. }
  580. .upload_file_btn_text{
  581. font-weight: 400;
  582. font-size: 24rpx;
  583. color: #CCCED4;
  584. margin-top: 8rpx;
  585. }
  586. }
  587. .upload_file_list_item{
  588. display: flex;
  589. align-items: center;
  590. width: 100%;
  591. min-height: 120rpx;
  592. padding: 20rpx 24rpx;
  593. background-color: #FFFFFF;
  594. border-radius: 20rpx;
  595. border: 2rpx solid #EBEEF5;
  596. box-sizing: border-box;
  597. margin-top: 24rpx;
  598. .list_item_icon {
  599. width: 80rpx;
  600. height: 80rpx;
  601. margin-right: 20rpx;
  602. flex-shrink: 0;
  603. }
  604. .list_item_content {
  605. flex: 1;
  606. // width: 0;
  607. // overflow: hidden;
  608. .item_content_title {
  609. width: 100%;
  610. font-weight: 500;
  611. font-size: 28rpx;
  612. color: #333333;
  613. word-break: break-all;
  614. // white-space: nowrap;
  615. // overflow: hidden;
  616. // text-overflow: ellipsis;
  617. // word-break: keep-all; /* ✅ 防止意外换行 */
  618. }
  619. .item_content_info {
  620. display: flex;
  621. flex-wrap: wrap;
  622. align-items: center;
  623. gap: 4rpx 20rpx;
  624. margin-top: 8rpx;
  625. .size {
  626. font-weight: 400;
  627. font-size: 24rpx;
  628. color: #999999;
  629. flex-shrink: 0;
  630. }
  631. .time {
  632. font-size: 24rpx;
  633. color: #999999;
  634. flex-shrink: 0;
  635. }
  636. }
  637. }
  638. .list_item_close {
  639. flex-shrink: 0;
  640. color: #999999 !important;
  641. font-size: 48rpx !important;
  642. }
  643. .list_item_preview{
  644. flex-shrink: 0;
  645. font-weight: 400;
  646. font-size: 28rpx;
  647. color: #2E64FA;
  648. }
  649. }
  650. }
  651. }
  652. .page_foot{
  653. position: fixed;
  654. left:0;
  655. right: 0;
  656. bottom: 0;
  657. padding: 20rpx 24rpx;
  658. background-color:#FFFFFF;
  659. .btn_submit{
  660. width: 100%;
  661. height: 88rpx;
  662. display: flex;
  663. justify-content: center;
  664. align-items: center;
  665. background-color: #2E64FA !important;
  666. border-radius: 20rpx;
  667. color: #FFFFFF;
  668. font-size: 28rpx;
  669. }
  670. }
  671. </style>