增加字典

main
chengyu 1 day ago
parent 390ea3260a
commit 96d36b387a
  1. BIN
      public/实名制与信息管理.xlsx
  2. 9
      src/views/large-screen/api.js
  3. 22
      src/views/large-screen/index.vue
  4. 35
      src/views/sitePersonnel/realName/index.vue
  5. 32
      src/views/sitePersonnel/realName/options.js

@ -113,4 +113,13 @@ export const getDevicePage = (arg) => {
data: arg, data: arg,
dataType: 'json', dataType: 'json',
}) })
}
// 获取字典:
export const getDict = (arg) => {
return axios.request({
url: '/system/dictionary/list',
method: 'get',
params: arg,
dataType: 'json',
})
} }

@ -27,13 +27,13 @@
<div class="boxtitle"> 项目介绍</div> <div class="boxtitle"> 项目介绍</div>
<div class="boxcontent" style="display: flex;flex-direction: column;padding: .9375rem 1.25rem;"> <div class="boxcontent" style="display: flex;flex-direction: column;padding: .9375rem 1.25rem;">
<div class="displaybox" style="margin-bottom: .625rem;"> <div class="displaybox" style="margin-bottom: .625rem;">
<div class="diamond"></div>项目名称 新火工区建设项目 <div class="diamond"></div>项目名称 {{state.name}}
</div> </div>
<div class="displaybox" style="margin-bottom: .75rem;"> <div class="displaybox" style="margin-bottom: .75rem;">
<div class="diamond" style="background-color: #FFAE3C;"></div>工地负责人xxx <div class="diamond" style="background-color: #FFAE3C;"></div>工地负责人{{state.manager}}
</div> </div>
<div class="chaochu" style="flex: 1;font-size: .8125rem;"> <div class="chaochu" style="flex: 1;font-size: .8125rem;">
项目简介本项目拟新建单体包括一期5305#5601#5806#5826#5827#7310#等6栋单体建筑二期5602#5606#5607#5606#5609#5610#5701#5801#5801-1#5802#5802-1#5803#5805#5807#5808#5810#5810-1#5811#5811-1#5812#5813#5815#5816#5816-1#5817#5818#5821#5822#5828#5829#5830#5831#5909#等34栋单体建筑建筑物基础形式为杯形基础独立基础条形基础主体结构为框架结构排架结构抗爆间室屏院墙体为钢筋混凝土剪力墙结构 {{state.introduce}}
</div> </div>
</div> </div>
@ -324,7 +324,7 @@ import { echart } from "../../echarts";
import { stausList } from './options' import { stausList } from './options'
import { retryAndRepeatRequest } from "@/utils/vctgo"; import { retryAndRepeatRequest } from "@/utils/vctgo";
import { meunList } from './options' import { meunList } from './options'
import { getRecordPage, iengineerlogList, iuserworkerType, iresourcescheduleList, vehiclestat, statistics, dataOverview, iwarnlist } from './api' import { getDict, getRecordPage, iengineerlogList, iuserworkerType, iresourcescheduleList, vehiclestat, statistics, dataOverview, iwarnlist } from './api'
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const tableTrue = ref(false); const tableTrue = ref(false);
const router = useRouter(); const router = useRouter();
@ -347,12 +347,26 @@ const state = reactive({
}, },
requestController: null, requestController: null,
time: null, time: null,
name: '',
manager: '',
introduce: '',
}) })
const myVideoRef = ref() const myVideoRef = ref()
onUnmounted(() => { onUnmounted(() => {
if (state.requestController) state.requestController.stop(); if (state.requestController) state.requestController.stop();
}); });
onMounted(async () => { onMounted(async () => {
getDict().then(res=>{
console.log('res :>> ', res);
let data = res.data;
let project_introduce = data.find(item=>item.code == 'project_introduce').subSysDictionaryList
let name = project_introduce.find(item=>item.code == 'name').value
let manager = project_introduce.find(item=>item.code == 'manager').value
let introduce = project_introduce.find(item=>item.code =='introduce').value
state.name = name;
state.manager = manager;
state.introduce = introduce;
})
getTime() getTime()
if (state.requestController) { if (state.requestController) {
state.requestController.stop(); state.requestController.stop();

@ -1,12 +1,12 @@
<script setup> <script setup>
import { reactive } from 'vue' import { reactive } from 'vue'
import { iuserList, iuserAdd, IuserUpdate, iuserDelete, iuserGetById } from './api' import { iuserList, iuserAdd, IuserUpdate, iuserDelete, iuserGetById } from './api'
import { baseModelOptions, baseFilterOptions } from './options' import { baseModelOptions, baseFilterOptions,batchOptions } from './options'
// const { proxy } = getCurrentInstance(); // const { proxy } = getCurrentInstance();
const state = reactive({ const state = reactive({
baseModelOptions: baseModelOptions(), baseModelOptions: baseModelOptions(),
batchOptions: batchOptions(),
baseFilterOptions: baseFilterOptions(), baseFilterOptions: baseFilterOptions(),
title: "实名管理", title: "实名管理",
baseModelName: '实名信息', baseModelName: '实名信息',
@ -23,6 +23,7 @@ const state = reactive({
showDeleteBtn: false, showDeleteBtn: false,
columnCount: 1, columnCount: 1,
hideselection:true, hideselection:true,
showModel: false,
// rowControl: { // rowControl: {
// showEditBtn: false, // showEditBtn: false,
// showDelBtn: false // showDelBtn: false
@ -36,11 +37,41 @@ const state = reactive({
pageInfo: { total: 0, base: { limit: 8, current: 1 } }, pageInfo: { total: 0, base: { limit: 8, current: 1 } },
}) })
const beforeUpload = (form) => {
console.log('form :>> ', form);
}
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-dialog title="批量导入" v-model="state.showModel" width="30%">
<el-upload
action="#"
:on-success="handleUploadSuccess"
:on-error="handleUploadError"
:on-progress="handleUploadProgress"
:on-change="handleUploadChange"
:auto-upload="false"
:show-file-list="false"
:before-upload="beforeUpload"
>
<el-button type="primary">点击上传</el-button>
</el-upload>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="dialogVisible = false">
确定
</el-button>
</div>
</template>
</el-dialog>
<BaseTablePage :tableOptions="state"> <BaseTablePage :tableOptions="state">
<!-- <template #afterTop="scope">
<el-button @click="state.showModel=true" type="primary">批量导入</el-button>
</template> -->
<template v-slot:column> <template v-slot:column>
<el-table-column type="index" align="center" label="序号" width="70" /> <el-table-column type="index" align="center" label="序号" width="70" />
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="姓名" align="center" prop="name" />

@ -1,3 +1,4 @@
let baseURL = import.meta.env.VITE_APP_BASE_API
export const baseModelOptions = () => { export const baseModelOptions = () => {
function validateIDCard(idCard) { function validateIDCard(idCard) {
// 15 位身份证号码正则 // 15 位身份证号码正则
@ -152,4 +153,35 @@ export const baseFilterOptions = () => {
}, },
] ]
}
export const batchOptions = () => {
return [
{
tag: 'BaseUpload',
label: '文件:',
key: 'videoUrl',
value: [],
default: [],
width: '60%',
rules: [
{ required: true, message: '请上传文件', trigger: 'change' },
],
attribute: {//属性
limit: 1,
ref: 'uploadRef', //仅支持命名uploadRef,可通过table的ref调用, table.value.uploadRef
accept: '.xlsx', //支持的格式
headers: {token: 'something'}, //定义请求头
baseUrl: baseURL+'/base/upload',//图片提交接口
resKey: {//当前value数组[{}]中,对应的url/name
urlKey: 'url',//默认值url,相同则可不传
nameKey: 'name'//默认值name,相同则可不传
},
},
customFormatter: function(data){//自定义提交表单时,格式化videoUrl字段
console.log('data :>> ', data);
if(data.length > 0) return data[0].response.url
}
}
]
} }
Loading…
Cancel
Save