Commit 1916a5ed215884f8e37ab8eba454eda2512ed013
1 parent
ce1de261
1
Showing
12 changed files
with
1560 additions
and
210 deletions
.DS_Store
No preview for this file type
src/.DS_Store
No preview for this file type
src/api/onlineDev/visualDev.js
| ... | ... | @@ -3,7 +3,7 @@ import request from '@/utils/request' |
| 3 | 3 | // 获取功能列表 |
| 4 | 4 | export function getVisualDevList(data) { |
| 5 | 5 | return request({ |
| 6 | - url: '/api/visualdev/Base', | |
| 6 | + url: '/visualdev/Base', | |
| 7 | 7 | method: 'get', |
| 8 | 8 | data |
| 9 | 9 | }) |
| ... | ... | @@ -11,7 +11,7 @@ export function getVisualDevList(data) { |
| 11 | 11 | // 获取功能信息 |
| 12 | 12 | export function getVisualDevInfo(id) { |
| 13 | 13 | return request({ |
| 14 | - url: `/api/visualdev/Base/${id}`, | |
| 14 | + url: `/visualdev/Base/${id}`, | |
| 15 | 15 | method: 'get' |
| 16 | 16 | }) |
| 17 | 17 | } |
| ... | ... | @@ -20,14 +20,14 @@ export function getVisualDevInfo(id) { |
| 20 | 20 | // 删除功能 |
| 21 | 21 | export function Delete(id) { |
| 22 | 22 | return request({ |
| 23 | - url: `/api/visualdev/Base/${id}`, | |
| 23 | + url: `/visualdev/Base/${id}`, | |
| 24 | 24 | method: 'DELETE' |
| 25 | 25 | }) |
| 26 | 26 | } |
| 27 | 27 | // 修改功能 |
| 28 | 28 | export function Update(data) { |
| 29 | 29 | return request({ |
| 30 | - url: `/api/visualdev/Base/${data.id}`, | |
| 30 | + url: `/visualdev/Base/${data.id}`, | |
| 31 | 31 | method: 'PUT', |
| 32 | 32 | data |
| 33 | 33 | }) |
| ... | ... | @@ -35,7 +35,7 @@ export function Update(data) { |
| 35 | 35 | // 新建功能 |
| 36 | 36 | export function Create(data) { |
| 37 | 37 | return request({ |
| 38 | - url: '/api/visualdev/Base', | |
| 38 | + url: '/visualdev/Base', | |
| 39 | 39 | method: 'post', |
| 40 | 40 | data |
| 41 | 41 | }) |
| ... | ... | @@ -43,21 +43,21 @@ export function Create(data) { |
| 43 | 43 | // 复制功能 |
| 44 | 44 | export function Copy(id) { |
| 45 | 45 | return request({ |
| 46 | - url: `/api/visualdev/Base/${id}/Actions/Copy`, | |
| 46 | + url: `/visualdev/Base/${id}/Actions/Copy`, | |
| 47 | 47 | method: 'POST' |
| 48 | 48 | }) |
| 49 | 49 | } |
| 50 | 50 | // 获取模块命名 |
| 51 | 51 | export function getAreasName() { |
| 52 | 52 | return request({ |
| 53 | - url: `/api/visualdev/Generater/AreasName`, | |
| 53 | + url: `/visualdev/Generater/AreasName`, | |
| 54 | 54 | method: 'get' |
| 55 | 55 | }) |
| 56 | 56 | } |
| 57 | 57 | // 代码下载 |
| 58 | 58 | export function DownloadCode(id, data) { |
| 59 | 59 | return request({ |
| 60 | - url: `/api/visualdev/Generater/${id}/Actions/DownloadCode`, | |
| 60 | + url: `/visualdev/Generater/${id}/Actions/DownloadCode`, | |
| 61 | 61 | method: 'POST', |
| 62 | 62 | data |
| 63 | 63 | }) |
| ... | ... | @@ -65,7 +65,7 @@ export function DownloadCode(id, data) { |
| 65 | 65 | // 代码预览 |
| 66 | 66 | export function CodePreview(id, data) { |
| 67 | 67 | return request({ |
| 68 | - url: `/api/visualdev/Generater/${id}/Actions/CodePreview`, | |
| 68 | + url: `/visualdev/Generater/${id}/Actions/CodePreview`, | |
| 69 | 69 | method: 'POST', |
| 70 | 70 | data |
| 71 | 71 | }) |
| ... | ... | @@ -74,28 +74,28 @@ export function CodePreview(id, data) { |
| 74 | 74 | // 获取列表表单配置JSON |
| 75 | 75 | export function getConfigData(modelId) { |
| 76 | 76 | return request({ |
| 77 | - url: `/api/visualdev/OnlineDev/${modelId}/Config`, | |
| 77 | + url: `/visualdev/OnlineDev/${modelId}/Config`, | |
| 78 | 78 | method: 'get' |
| 79 | 79 | }) |
| 80 | 80 | } |
| 81 | 81 | // 获取列表配置JSON |
| 82 | 82 | export function getColumnData(modelId) { |
| 83 | 83 | return request({ |
| 84 | - url: `/api/visualdev/OnlineDev/${modelId}/ColumnData`, | |
| 84 | + url: `/visualdev/OnlineDev/${modelId}/ColumnData`, | |
| 85 | 85 | method: 'get' |
| 86 | 86 | }) |
| 87 | 87 | } |
| 88 | 88 | // 获取表单配置JSON |
| 89 | 89 | export function getFormData(modelId) { |
| 90 | 90 | return request({ |
| 91 | - url: `/api/visualdev/OnlineDev/${modelId}/FormData`, | |
| 91 | + url: `/visualdev/OnlineDev/${modelId}/FormData`, | |
| 92 | 92 | method: 'get' |
| 93 | 93 | }) |
| 94 | 94 | } |
| 95 | 95 | // 获取数据列表 |
| 96 | 96 | export function getModelList(modelId, data) { |
| 97 | 97 | return request({ |
| 98 | - url: `/api/visualdev/OnlineDev/${modelId}/List`, | |
| 98 | + url: `/visualdev/OnlineDev/${modelId}/List`, | |
| 99 | 99 | method: 'post', |
| 100 | 100 | data |
| 101 | 101 | }) |
| ... | ... | @@ -103,7 +103,7 @@ export function getModelList(modelId, data) { |
| 103 | 103 | // 添加数据 |
| 104 | 104 | export function createModel(modelId, data) { |
| 105 | 105 | return request({ |
| 106 | - url: `/api/visualdev/OnlineDev/${modelId}`, | |
| 106 | + url: `/visualdev/OnlineDev/${modelId}`, | |
| 107 | 107 | method: 'POST', |
| 108 | 108 | data |
| 109 | 109 | }) |
| ... | ... | @@ -111,7 +111,7 @@ export function createModel(modelId, data) { |
| 111 | 111 | // 修改数据 |
| 112 | 112 | export function updateModel(modelId, data) { |
| 113 | 113 | return request({ |
| 114 | - url: `/api/visualdev/OnlineDev/${modelId}/${data.id}`, | |
| 114 | + url: `/visualdev/OnlineDev/${modelId}/${data.id}`, | |
| 115 | 115 | method: 'PUT', |
| 116 | 116 | data |
| 117 | 117 | }) |
| ... | ... | @@ -119,28 +119,28 @@ export function updateModel(modelId, data) { |
| 119 | 119 | // 获取数据信息 |
| 120 | 120 | export function getModelInfo(modelId, id) { |
| 121 | 121 | return request({ |
| 122 | - url: `/api/visualdev/OnlineDev/${modelId}/${id}`, | |
| 122 | + url: `/visualdev/OnlineDev/${modelId}/${id}`, | |
| 123 | 123 | method: 'GET' |
| 124 | 124 | }) |
| 125 | 125 | } |
| 126 | 126 | // 获取数据详情 |
| 127 | 127 | export function getDataChange(modelId, id) { |
| 128 | 128 | return request({ |
| 129 | - url: `/api/visualdev/OnlineDev/${modelId}/${id}/DataChange`, | |
| 129 | + url: `/visualdev/OnlineDev/${modelId}/${id}/DataChange`, | |
| 130 | 130 | method: 'GET' |
| 131 | 131 | }) |
| 132 | 132 | } |
| 133 | 133 | // 获取表单主表属性列表 |
| 134 | 134 | export function getFormDataFields(modelId) { |
| 135 | 135 | return request({ |
| 136 | - url: `/api/visualdev/Base/${modelId}/FormDataFields`, | |
| 136 | + url: `/visualdev/Base/${modelId}/FormDataFields`, | |
| 137 | 137 | method: 'GET' |
| 138 | 138 | }) |
| 139 | 139 | } |
| 140 | 140 | // 获取表单主表属性下拉框 |
| 141 | 141 | export function getFieldDataSelect(modelId, data) { |
| 142 | 142 | return request({ |
| 143 | - url: `/api/visualdev/Base/${modelId}/FieldDataSelect`, | |
| 143 | + url: `/visualdev/Base/${modelId}/FieldDataSelect`, | |
| 144 | 144 | method: 'GET', |
| 145 | 145 | data |
| 146 | 146 | }) |
| ... | ... | @@ -148,14 +148,14 @@ export function getFieldDataSelect(modelId, data) { |
| 148 | 148 | // 删除数据 |
| 149 | 149 | export function deteleModel(modelId, id) { |
| 150 | 150 | return request({ |
| 151 | - url: `/api/visualdev/OnlineDev/${modelId}/${id}`, | |
| 151 | + url: `/visualdev/OnlineDev/${modelId}/${id}`, | |
| 152 | 152 | method: 'DELETE' |
| 153 | 153 | }) |
| 154 | 154 | } |
| 155 | 155 | // 批量删除数据 |
| 156 | 156 | export function batchDelete(modelId, ids) { |
| 157 | 157 | return request({ |
| 158 | - url: `/api/visualdev/OnlineDev/batchDelete/${modelId}`, | |
| 158 | + url: `/visualdev/OnlineDev/batchDelete/${modelId}`, | |
| 159 | 159 | method: 'post', |
| 160 | 160 | data: { ids } |
| 161 | 161 | }) |
| ... | ... | @@ -163,7 +163,7 @@ export function batchDelete(modelId, ids) { |
| 163 | 163 | // 导出 |
| 164 | 164 | export function exportModel(modelId, data) { |
| 165 | 165 | return request({ |
| 166 | - url: `/api/visualdev/OnlineDev/${modelId}/Actions/Export`, | |
| 166 | + url: `/visualdev/OnlineDev/${modelId}/Actions/Export`, | |
| 167 | 167 | method: 'POST', |
| 168 | 168 | data |
| 169 | 169 | }) |
| ... | ... | @@ -171,14 +171,14 @@ export function exportModel(modelId, data) { |
| 171 | 171 | // 下载模板 |
| 172 | 172 | export function getTemplate(modelId) { |
| 173 | 173 | return request({ |
| 174 | - url: `/api/visualdev/OnlineDev/${modelId}/Template`, | |
| 174 | + url: `/visualdev/OnlineDev/${modelId}/Template`, | |
| 175 | 175 | method: 'GET' |
| 176 | 176 | }) |
| 177 | 177 | } |
| 178 | 178 | // 获取功能下拉框列表 |
| 179 | 179 | export function getFeatureSelector(data) { |
| 180 | 180 | return request({ |
| 181 | - url: '/api/visualdev/Base/Selector', | |
| 181 | + url: '/visualdev/Base/Selector', | |
| 182 | 182 | method: 'GET', |
| 183 | 183 | data |
| 184 | 184 | }) |
| ... | ... | @@ -186,7 +186,7 @@ export function getFeatureSelector(data) { |
| 186 | 186 | // App预览(后台APP表单设计) |
| 187 | 187 | export function Preview(data) { |
| 188 | 188 | return request({ |
| 189 | - url: `/api/visualdev/OnlineDev/App/Preview`, | |
| 189 | + url: `/visualdev/OnlineDev/App/Preview`, | |
| 190 | 190 | method: 'post', |
| 191 | 191 | data: { data } |
| 192 | 192 | }) |
| ... | ... | @@ -194,14 +194,14 @@ export function Preview(data) { |
| 194 | 194 | // 导出模板 |
| 195 | 195 | export function exportData(modelId) { |
| 196 | 196 | return request({ |
| 197 | - url: `/api/visualdev/OnlineDev/${modelId}/Actions/ExportData`, | |
| 197 | + url: `/visualdev/OnlineDev/${modelId}/Actions/ExportData`, | |
| 198 | 198 | method: 'post' |
| 199 | 199 | }) |
| 200 | 200 | } |
| 201 | 201 | // 导出App |
| 202 | 202 | export function exportAppData(modelId) { |
| 203 | 203 | return request({ |
| 204 | - url: `/api/visualdev/OnlineDev/App/${modelId}/Actions/ExportData`, | |
| 204 | + url: `/visualdev/OnlineDev/App/${modelId}/Actions/ExportData`, | |
| 205 | 205 | method: 'post' |
| 206 | 206 | }) |
| 207 | 207 | } |
| 208 | 208 | \ No newline at end of file | ... | ... |
src/views/baseSpecialAction/dynamicModel/list/ExportBox.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog title="导出数据" :close-on-click-modal="false" :visible.sync="visible" | |
| 3 | + class="NCC-dialog NCC-dialog_center NCC-dialog-export" lock-scroll width="600px"> | |
| 4 | + <el-form label-position="top"> | |
| 5 | + <el-form-item> | |
| 6 | + <el-radio-group v-model="type"> | |
| 7 | + <el-radio :label="0">当前页面数据</el-radio> | |
| 8 | + <el-radio :label="1">全部页面数据</el-radio> | |
| 9 | + </el-radio-group> | |
| 10 | + </el-form-item> | |
| 11 | + <el-form-item class="export-line"> | |
| 12 | + <p slot="label" class="export-label">列表数据<span>请选择导出字段</span></p> | |
| 13 | + <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" | |
| 14 | + @change="handleCheckAllChange">全选</el-checkbox> | |
| 15 | + <el-checkbox-group v-model="columns" @change="handleCheckedChange"> | |
| 16 | + <el-checkbox v-for="item in columnList" :label="item.prop" :key="item.prop" | |
| 17 | + class="column-item"> | |
| 18 | + {{item.label}} | |
| 19 | + </el-checkbox> | |
| 20 | + </el-checkbox-group> | |
| 21 | + </el-form-item> | |
| 22 | + </el-form> | |
| 23 | + <span slot="footer" class="dialog-footer"> | |
| 24 | + <p class="footer-tip">提示:系统将导出列表中选中的数据</p> | |
| 25 | + <el-button @click="visible=false">{{$t('common.cancelButton')}}</el-button> | |
| 26 | + <el-button type="primary" @click="downLoad">导 出</el-button> | |
| 27 | + </span> | |
| 28 | + </el-dialog> | |
| 29 | +</template> | |
| 30 | + | |
| 31 | +<script> | |
| 32 | +export default { | |
| 33 | + data() { | |
| 34 | + return { | |
| 35 | + visible: false, | |
| 36 | + btnLoading: false, | |
| 37 | + type: 0, | |
| 38 | + columns: [], | |
| 39 | + checkAll: true, | |
| 40 | + isIndeterminate: false, | |
| 41 | + columnList: [] | |
| 42 | + } | |
| 43 | + }, | |
| 44 | + methods: { | |
| 45 | + init(columnList) { | |
| 46 | + this.visible = true | |
| 47 | + this.columnList = columnList | |
| 48 | + this.columns = columnList.map(o => o.prop) | |
| 49 | + }, | |
| 50 | + handleCheckAllChange(val) { | |
| 51 | + this.columns = val ? this.columnList.map(o => o.prop) : []; | |
| 52 | + this.isIndeterminate = false; | |
| 53 | + }, | |
| 54 | + handleCheckedChange(value) { | |
| 55 | + let checkedCount = value.length; | |
| 56 | + this.checkAll = checkedCount === this.columnList.length; | |
| 57 | + this.isIndeterminate = checkedCount > 0 && checkedCount < this.columnList.length; | |
| 58 | + }, | |
| 59 | + downLoad() { | |
| 60 | + this.$emit('download', { dataType: this.type, selectKey: this.columns }) | |
| 61 | + } | |
| 62 | + } | |
| 63 | +} | |
| 64 | +</script> | ... | ... |
src/views/baseSpecialAction/dynamicModel/list/Form.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <template> | |
| 4 | + <el-dialog :title="!dataForm.id ? '新建' : '编辑'" :close-on-click-modal="false" | |
| 5 | + :visible.sync="visible" class="NCC-dialog NCC-dialog_center" lock-scroll | |
| 6 | + :width="formConf.generalWidth"> | |
| 7 | + <parser :form-conf="formConf" @submit="sumbitForm" :key="key" ref="dynamicForm" | |
| 8 | + :setFormData="setFormData" :setShowOrHide="setShowOrHide" :setRequired="setRequired" | |
| 9 | + :setDisabled="setDisabled" :setFieldOptions="setFieldOptions"/> | |
| 10 | + <span slot="footer" class="dialog-footer"> | |
| 11 | + <template v-if="formConf.hasPrintBtn && formConf.printId && dataForm.id && false"> | |
| 12 | + <el-button type="primary" @click="print"> | |
| 13 | + {{formConf.printButtonText||'打 印'}} | |
| 14 | + </el-button> | |
| 15 | + </template> | |
| 16 | + <el-button @click="visible = false">{{formConf.cancelButtonText||'取 消'}}</el-button> | |
| 17 | + <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> | |
| 18 | + {{formConf.confirmButtonText||'确 定'}}</el-button> | |
| 19 | + </span> | |
| 20 | + </el-dialog> | |
| 21 | + </template> | |
| 22 | + <!-- <template> | |
| 23 | + <transition name="el-zoom-in-center"> | |
| 24 | + <div class="NCC-preview-main"> | |
| 25 | + <div class="NCC-common-page-header"> | |
| 26 | + <el-page-header @back="goBack" :content="!dataForm.id ? '新建' : '编辑'" /> | |
| 27 | + <div class="options"> | |
| 28 | + <template v-if="formConf.hasPrintBtn && formConf.printId && dataForm.id && false"> | |
| 29 | + <el-button type="primary" @click="print"> | |
| 30 | + {{formConf.printButtonText||'打 印'}} | |
| 31 | + </el-button> | |
| 32 | + </template> | |
| 33 | + <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> | |
| 34 | + {{formConf.confirmButtonText||'确 定'}}</el-button> | |
| 35 | + <el-button @click="goBack">{{formConf.cancelButtonText||'取 消'}}</el-button> | |
| 36 | + </div> | |
| 37 | + </div> | |
| 38 | + <div class="dynamic-form-main" :style="{margin: '0 auto',width:formConf.fullScreenWidth}"> | |
| 39 | + <parser :form-conf="formConf" @submit="sumbitForm" :key="key" ref="dynamicForm" | |
| 40 | + :setFormData="setFormData" :setShowOrHide="setShowOrHide" :setRequired="setRequired" | |
| 41 | + :setDisabled="setDisabled" :setFieldOptions="setFieldOptions" v-if="!loading" /> | |
| 42 | + </div> | |
| 43 | + </div> | |
| 44 | + </transition> | |
| 45 | + </template> --> | |
| 46 | + <print-browse :visible.sync="printBrowseVisible" :id="formConf.printId" :formId="dataForm.id" /> | |
| 47 | + </div> | |
| 48 | +</template> | |
| 49 | + | |
| 50 | +<script> | |
| 51 | +import { createModel, updateModel, getModelInfo } from '@/api/onlineDev/visualDev' | |
| 52 | +import Parser from '@/components/Generator/parser/Parser' | |
| 53 | +import ParserMixin from '@/components/Generator/parser/mixin' | |
| 54 | +import PrintBrowse from '@/components/PrintBrowse' | |
| 55 | +import { deepClone } from '@/utils' | |
| 56 | +export default { | |
| 57 | + components: { Parser, PrintBrowse }, | |
| 58 | + mixins: [ParserMixin], | |
| 59 | + data() { | |
| 60 | + return { | |
| 61 | + visible: false, | |
| 62 | + dataForm: { | |
| 63 | + id: '', | |
| 64 | + data: '' | |
| 65 | + }, | |
| 66 | + modelId: '', | |
| 67 | + formData: {}, | |
| 68 | + btnLoading: false, | |
| 69 | + loading: true, | |
| 70 | + isPreview: false, | |
| 71 | + useFormPermission: false, | |
| 72 | + printBrowseVisible: false, | |
| 73 | + formOperates: [], | |
| 74 | + } | |
| 75 | + }, | |
| 76 | + methods: { | |
| 77 | + goBack() { | |
| 78 | + this.$emit('refreshDataList') | |
| 79 | + }, | |
| 80 | + print() { | |
| 81 | + if (this.isPreview) return this.$message({ message: '功能预览不支持打印', type: 'warning' }) | |
| 82 | + this.printBrowseVisible = true | |
| 83 | + }, | |
| 84 | + init(formConf, modelId, id, isPreview, useFormPermission) { | |
| 85 | + | |
| 86 | + this.formConf = deepClone(JSON.parse(formConf)) | |
| 87 | + var formConf = this.formConf; | |
| 88 | + this.modelId = modelId | |
| 89 | + this.isPreview = isPreview | |
| 90 | + this.useFormPermission = useFormPermission | |
| 91 | + this.dataForm.id = id || '' | |
| 92 | + debugger | |
| 93 | + this.getFormOperates() | |
| 94 | + this.loading = true | |
| 95 | + this.$nextTick(() => { | |
| 96 | + if (this.dataForm.id) { | |
| 97 | + getModelInfo(modelId, this.dataForm.id).then(res => { | |
| 98 | + this.dataForm = res.data | |
| 99 | + if (!this.dataForm.data) return | |
| 100 | + this.formData = JSON.parse(this.dataForm.data) | |
| 101 | + this.fillFormData(formConf, this.formData) | |
| 102 | + this.$nextTick(() => { | |
| 103 | + this.visible = true | |
| 104 | + this.loading = false | |
| 105 | + }) | |
| 106 | + }) | |
| 107 | + } else { | |
| 108 | + this.formData = {} | |
| 109 | + this.fillFormData(formConf, this.formData) | |
| 110 | + this.visible = true | |
| 111 | + this.loading = false | |
| 112 | + } | |
| 113 | + this.key = +new Date() | |
| 114 | + }) | |
| 115 | + }, | |
| 116 | + getFormOperates() { | |
| 117 | + if (this.isPreview || !this.useFormPermission) return | |
| 118 | + const permissionList = this.$store.getters.permissionList | |
| 119 | + const modelId = this.modelId | |
| 120 | + const list = permissionList.filter(o => o.modelId === modelId) | |
| 121 | + this.formOperates = list[0] && list[0].form ? list[0].form : [] | |
| 122 | + }, | |
| 123 | + fillFormData(form, data) { | |
| 124 | + const loop = list => { | |
| 125 | + for (let i = 0; i < list.length; i++) { | |
| 126 | + let item = list[i] | |
| 127 | + if (item.__vModel__) { | |
| 128 | + const val = data[item.__vModel__] | |
| 129 | + if (val !== undefined) item.__config__.defaultValue = val | |
| 130 | + if (!this.isPreview && this.useFormPermission) { | |
| 131 | + let noShow = true | |
| 132 | + if (this.formOperates && this.formOperates.length) { | |
| 133 | + noShow = !this.formOperates.some(o => o.enCode === item.__vModel__) | |
| 134 | + } | |
| 135 | + noShow = item.__config__.noShow ? item.__config__.noShow : noShow | |
| 136 | + this.$set(item.__config__, 'noShow', noShow) | |
| 137 | + } | |
| 138 | + } | |
| 139 | + if (item.__config__ && item.__config__.nccKey !== 'table' && item.__config__.children && Array.isArray(item.__config__.children)) { | |
| 140 | + loop(item.__config__.children) | |
| 141 | + } | |
| 142 | + } | |
| 143 | + } | |
| 144 | + loop(form.fields) | |
| 145 | + }, | |
| 146 | + sumbitForm(data, callback) { | |
| 147 | + if (!data) return | |
| 148 | + this.btnLoading = true | |
| 149 | + this.dataForm.data = JSON.stringify(data) | |
| 150 | + const formMethod = this.dataForm.id ? updateModel : createModel | |
| 151 | + formMethod(this.modelId, this.dataForm).then(res => { | |
| 152 | + this.$message({ | |
| 153 | + message: res.msg, | |
| 154 | + type: 'success', | |
| 155 | + duration: 1500, | |
| 156 | + onClose: () => { | |
| 157 | + if (callback && typeof callback === "function") callback() | |
| 158 | + this.visible = false | |
| 159 | + this.btnLoading = false | |
| 160 | + this.$emit('refreshDataList', true) | |
| 161 | + } | |
| 162 | + }) | |
| 163 | + }).catch(() => { this.btnLoading = false }) | |
| 164 | + }, | |
| 165 | + dataFormSubmit() { | |
| 166 | + if (this.isPreview) return this.$message({ message: '功能预览不支持数据保存', type: 'warning' }) | |
| 167 | + this.$refs.dynamicForm && this.$refs.dynamicForm.submitForm() | |
| 168 | + } | |
| 169 | + } | |
| 170 | +} | |
| 171 | +</script> | |
| 0 | 172 | \ No newline at end of file | ... | ... |
src/views/baseSpecialAction/dynamicModel/list/ImportBox.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-dialog title="导入数据" :close-on-click-modal="false" :visible.sync="visible" | |
| 3 | + class="NCC-dialog NCC-dialog_center" lock-scroll width="600px"> | |
| 4 | + <el-row> | |
| 5 | + <el-col :span="12" class="grid-content"> | |
| 6 | + <p>下载导入模板,填写数据</p> | |
| 7 | + <!-- <img src="@/assets/images/xsl1.png" alt=""> --> | |
| 8 | + <p> | |
| 9 | + <el-button type="primary" round @click="downLoad()">下载导入模板</el-button> | |
| 10 | + </p> | |
| 11 | + </el-col> | |
| 12 | + <el-col :span="12" class="grid-content"> | |
| 13 | + <p>上传填写好的文件</p> | |
| 14 | + <!-- <img src="@/assets/images/xsl1.png" alt=""> --> | |
| 15 | + <p> | |
| 16 | + <el-upload | |
| 17 | + :action="define.comUrl+'/api/VisualDevelopment/Model/'+ modelId +'/Actions/Uploader'" | |
| 18 | + :headers="{ Authorization: $store.getters.token}" :on-success="handleSuccess" | |
| 19 | + :show-file-list="false" accept=".xls,.xlsx" :before-upload="beforeUpload"> | |
| 20 | + <el-button type="primary" round :loading="btnLoading">上传文件</el-button> | |
| 21 | + <!-- <div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件,且不超过500kb</div> --> | |
| 22 | + </el-upload> | |
| 23 | + </p> | |
| 24 | + </el-col> | |
| 25 | + </el-row> | |
| 26 | + </el-dialog> | |
| 27 | +</template> | |
| 28 | + | |
| 29 | +<script> | |
| 30 | +import { getTemplate, importModel } from '@/api/onlineDev/visualDev' | |
| 31 | +export default { | |
| 32 | + data() { | |
| 33 | + return { | |
| 34 | + visible: false, | |
| 35 | + btnLoading: false, | |
| 36 | + modelId: '' | |
| 37 | + } | |
| 38 | + }, | |
| 39 | + methods: { | |
| 40 | + init(modelId) { | |
| 41 | + if (!modelId) return | |
| 42 | + this.visible = true | |
| 43 | + this.modelId = modelId | |
| 44 | + }, | |
| 45 | + // 下载模板 | |
| 46 | + downLoad() { | |
| 47 | + getTemplate(this.modelId).then(res => { | |
| 48 | + if (res.data.url) window.location.href = this.define.comUrl + res.data.url | |
| 49 | + }) | |
| 50 | + }, | |
| 51 | + beforeUpload() { this.btnLoading = true }, | |
| 52 | + handleSuccess(res, file) { | |
| 53 | + this.btnLoading = false | |
| 54 | + if (res.code == 200) { | |
| 55 | + this.$message({ | |
| 56 | + message: '导入成功', | |
| 57 | + type: 'success', | |
| 58 | + duration: 1000, | |
| 59 | + onClose: () => { | |
| 60 | + this.visible = false | |
| 61 | + this.$emit('refreshDataList') | |
| 62 | + } | |
| 63 | + }) | |
| 64 | + } else { | |
| 65 | + this.$message({ message: '导入失败', type: 'error', duration: 1000 }) | |
| 66 | + } | |
| 67 | + } | |
| 68 | + } | |
| 69 | +} | |
| 70 | +</script> | |
| 71 | +<style lang="scss" scoped> | |
| 72 | +::v-deep .el-dialog__body { | |
| 73 | + padding: 40px 30px !important; | |
| 74 | +} | |
| 75 | + | |
| 76 | +.grid-content { | |
| 77 | + &:first-child { | |
| 78 | + border-right: 1px solid #dcdfe6; | |
| 79 | + } | |
| 80 | + | |
| 81 | + text-align: center; | |
| 82 | + | |
| 83 | + p { | |
| 84 | + text-align: center; | |
| 85 | + } | |
| 86 | + | |
| 87 | + img { | |
| 88 | + width: 128px; | |
| 89 | + margin: 10px 0; | |
| 90 | + } | |
| 91 | +} | |
| 92 | +</style> | |
| 0 | 93 | \ No newline at end of file | ... | ... |
src/views/baseSpecialAction/dynamicModel/list/Search.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-row class="NCC-common-search-box" :gutter="16" v-if="searchList.length"> | |
| 3 | + <el-form @submit.native.prevent> | |
| 4 | + <el-col :span="6" v-for="(item, index) in searchList" :key="index"> | |
| 5 | + <el-form-item :label="item.__config__.label" v-show="index<3 || (index>=3 && showAll)"> | |
| 6 | + <template v-if="useInputList.indexOf(item.__config__.nccKey)>-1"> | |
| 7 | + <el-input v-model="item.value" :placeholder="item.__config__.label" clearable | |
| 8 | + class="item"> | |
| 9 | + </el-input> | |
| 10 | + </template> | |
| 11 | + <template v-else-if="useDateList.indexOf(item.__config__.nccKey)>-1"> | |
| 12 | + <el-date-picker v-model="item.value" value-format="timestamp" format="yyyy-MM-dd" | |
| 13 | + start-placeholder="开始日期" end-placeholder="结束日期" class="item" type="daterange" /> | |
| 14 | + </template> | |
| 15 | + <template v-else-if="useSelectList.indexOf(item.__config__.nccKey)>-1"> | |
| 16 | + <el-select v-model="item.value" :placeholder="'请选择'+item.__config__.label" clearable | |
| 17 | + filterable class="item"> | |
| 18 | + <el-option :label="oItem[item.__config__.props.label]" | |
| 19 | + v-for="(oItem, i) in item.__slot__.options" | |
| 20 | + :value="oItem[item.__config__.props.value]" :key="i"></el-option> | |
| 21 | + </el-select> | |
| 22 | + </template> | |
| 23 | + <template v-else> | |
| 24 | + <template | |
| 25 | + v-if="item.__config__.nccKey==='numInput'||item.__config__.nccKey==='calculate'"> | |
| 26 | + <num-range v-model="item.value"></num-range> | |
| 27 | + </template> | |
| 28 | + <template v-if="item.__config__.nccKey==='cascader'"> | |
| 29 | + <el-cascader v-model="item.value" :options="item.options" clearable | |
| 30 | + :show-all-levels="item['show-all-levels']" :props="item.props.props" filterable | |
| 31 | + :placeholder="'请选择'+item.__config__.label" class="item"></el-cascader> | |
| 32 | + </template> | |
| 33 | + <template | |
| 34 | + v-if="item.__config__.nccKey==='time'|| item.__config__.nccKey==='timeRange'"> | |
| 35 | + <el-time-picker v-model="item.value" start-placeholder="开始时间" end-placeholder="结束时间" | |
| 36 | + clearable :value-format="item['value-format']" :format="item.format" is-range | |
| 37 | + class="item" /> | |
| 38 | + </template> | |
| 39 | + <template v-if="item.__config__.nccKey==='date'"> | |
| 40 | + <el-date-picker v-model="item.value" :type="item.type+'range'" | |
| 41 | + :value-format="item['value-format']" :format="item.format" start-placeholder="开始日期" | |
| 42 | + end-placeholder="结束日期" class="item"> | |
| 43 | + </el-date-picker> | |
| 44 | + </template> | |
| 45 | + <template v-if="item.__config__.nccKey==='dateRange'"> | |
| 46 | + <el-date-picker v-model="item.value" :type="item.type" | |
| 47 | + :value-format="item['value-format']" :format="item.format" start-placeholder="开始日期" | |
| 48 | + end-placeholder="结束日期" class="item"> | |
| 49 | + </el-date-picker> | |
| 50 | + </template> | |
| 51 | + <template v-if="commonList.includes(item.__config__.nccKey)"> | |
| 52 | + <component :is="item.__config__.tag" v-model="item.value" | |
| 53 | + :placeholder="'请选择'+item.__config__.label" class="item" /> | |
| 54 | + </template> | |
| 55 | + <template v-if="item.__config__.nccKey==='address'"> | |
| 56 | + <NCCAddress v-model="item.value" :placeholder="'请选择'+item.__config__.label" | |
| 57 | + :level="item.level" class="item" clearable /> | |
| 58 | + </template> | |
| 59 | + <template v-if="item.__config__.nccKey==='treeSelect'"> | |
| 60 | + <NCC-TreeSelect v-model="item.value" :placeholder="'请选择'+item.__config__.label" | |
| 61 | + :options="item.options" :multiple="item.multiple" class="item" clearable /> | |
| 62 | + </template> | |
| 63 | + <template | |
| 64 | + v-if="item.__config__.nccKey==='createUser'||item.__config__.nccKey==='modifyUser'"> | |
| 65 | + <userSelect v-model="item.value" :placeholder="'请选择'+item.__config__.label" | |
| 66 | + class="item" /> | |
| 67 | + </template> | |
| 68 | + <template v-if="item.__config__.nccKey==='currOrganize'"> | |
| 69 | + <comSelect v-model="item.value" :placeholder="'请选择'+item.__config__.label" | |
| 70 | + class="item" /> | |
| 71 | + </template> | |
| 72 | + <template v-if="item.__config__.nccKey==='currDept'"> | |
| 73 | + <depSelect v-model="item.value" :placeholder="'请选择'+item.__config__.label" | |
| 74 | + class="item" /> | |
| 75 | + </template> | |
| 76 | + <template v-if="item.__config__.nccKey==='currPosition'"> | |
| 77 | + <posSelect v-model="item.value" :placeholder="'请选择'+item.__config__.label" | |
| 78 | + class="item" /> | |
| 79 | + </template> | |
| 80 | + </template> | |
| 81 | + </el-form-item> | |
| 82 | + </el-col> | |
| 83 | + <el-col :span="6"> | |
| 84 | + <el-form-item> | |
| 85 | + <el-button type="primary" icon="el-icon-search" @click="search()">{{$t('common.search')}} | |
| 86 | + </el-button> | |
| 87 | + <el-button icon="el-icon-refresh-right" @click="reset()">{{$t('common.reset')}} | |
| 88 | + </el-button> | |
| 89 | + <template v-if="searchList.length>3"> | |
| 90 | + <el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll"> | |
| 91 | + 展开 | |
| 92 | + </el-button> | |
| 93 | + <el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else> | |
| 94 | + 收起</el-button> | |
| 95 | + </template> | |
| 96 | + </el-form-item> | |
| 97 | + </el-col> | |
| 98 | + </el-form> | |
| 99 | + </el-row> | |
| 100 | +</template> | |
| 101 | + | |
| 102 | +<script> | |
| 103 | +import { deepClone } from '@/utils' | |
| 104 | +import { dyOptionsList, useInputList, useDateList, useSelectList } from '@/components/Generator/generator/comConfig' | |
| 105 | +import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | |
| 106 | +import { previewDataInterface } from '@/api/systemData/dataInterface' | |
| 107 | +export default { | |
| 108 | + props: ['list'], | |
| 109 | + data() { | |
| 110 | + return { | |
| 111 | + showAll: false, | |
| 112 | + searchList: [], | |
| 113 | + commonList: ['comSelect', 'depSelect', 'posSelect', 'userSelect', 'dicSelect'], | |
| 114 | + useInputList, | |
| 115 | + useDateList, | |
| 116 | + useSelectList | |
| 117 | + } | |
| 118 | + }, | |
| 119 | + watch: { | |
| 120 | + list: { | |
| 121 | + handler: function (val) { | |
| 122 | + this.searchList = deepClone(val) | |
| 123 | + this.buildOptions(this.searchList) | |
| 124 | + }, | |
| 125 | + deep: true, | |
| 126 | + immediate: true | |
| 127 | + } | |
| 128 | + }, | |
| 129 | + methods: { | |
| 130 | + buildOptions(componentList) { | |
| 131 | + componentList.forEach(cur => { | |
| 132 | + const config = cur.__config__ | |
| 133 | + if (dyOptionsList.indexOf(config.nccKey) > -1) { | |
| 134 | + let isTreeSelect = config.nccKey === 'treeSelect' || config.nccKey === 'cascader' | |
| 135 | + if (config.dataType === 'dictionary') { | |
| 136 | + if (!config.dictionaryType) return | |
| 137 | + getDictionaryDataSelector(config.dictionaryType).then(res => { | |
| 138 | + isTreeSelect ? cur.options = res.data.list : cur.__slot__.options = res.data.list | |
| 139 | + }) | |
| 140 | + } | |
| 141 | + if (config.dataType === 'dynamic') { | |
| 142 | + if (!config.propsUrl) return | |
| 143 | + previewDataInterface(config.propsUrl).then(res => { | |
| 144 | + isTreeSelect ? cur.options = res.data : cur.__slot__.options = res.data | |
| 145 | + }) | |
| 146 | + } | |
| 147 | + } | |
| 148 | + }) | |
| 149 | + }, | |
| 150 | + search() { | |
| 151 | + let obj = {} | |
| 152 | + for (let i = 0; i < this.searchList.length; i++) { | |
| 153 | + const e = this.searchList[i] | |
| 154 | + if (e.value) { | |
| 155 | + if (Array.isArray(e.value)) { | |
| 156 | + if (e.value.length) obj[e.__vModel__] = e.value | |
| 157 | + } else { | |
| 158 | + obj[e.__vModel__] = e.value | |
| 159 | + } | |
| 160 | + } | |
| 161 | + } | |
| 162 | + let json = JSON.stringify(obj) === "{}" ? '' : JSON.stringify(obj) | |
| 163 | + this.$emit('search', json) | |
| 164 | + }, | |
| 165 | + reset() { | |
| 166 | + this.searchList = deepClone(this.list) | |
| 167 | + this.$emit('search', '') | |
| 168 | + }, | |
| 169 | + treeReset() { | |
| 170 | + this.searchList = deepClone(this.list) | |
| 171 | + } | |
| 172 | + } | |
| 173 | +} | |
| 174 | +</script> | |
| 0 | 175 | \ No newline at end of file | ... | ... |
src/views/baseSpecialAction/dynamicModel/list/detail/Item.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-col :span="item.__config__.span" | |
| 3 | + :class="{'item-card':item.__config__.nccKey==='card','item-table':item.__config__.nccKey==='table'}"> | |
| 4 | + <template v-if="item.__config__.layout==='colFormItem'"> | |
| 5 | + <template v-if="item.__config__.nccKey==='divider'"> | |
| 6 | + <el-divider :content-position="item['content-position']">{{item.__slot__.default}} | |
| 7 | + </el-divider> | |
| 8 | + </template> | |
| 9 | + <template v-else-if="item.__config__.nccKey==='NCCText'"> | |
| 10 | + <el-form-item label-width="0"> | |
| 11 | + <NCCText :lineHeight="item.lineHeight" :fontSize="item.fontSize" | |
| 12 | + v-model="item.__config__.defaultValue" :textStyle="item.textStyle" /> | |
| 13 | + </el-form-item> | |
| 14 | + </template> | |
| 15 | + <template v-else-if="item.__config__.nccKey==='groupTitle'"> | |
| 16 | + <el-form-item label-width="0"> | |
| 17 | + <groupTitle :content="item.content" :content-position="item['content-position']" /> | |
| 18 | + </el-form-item> | |
| 19 | + </template> | |
| 20 | + <template v-else> | |
| 21 | + <el-form-item :prop="item.__vModel__" | |
| 22 | + :label-width="item.__config__.labelWidth?`${item.__config__.labelWidth}px`: null" | |
| 23 | + :label="item.__config__.showLabel ? item.__config__.label : '' " | |
| 24 | + v-if="!item.__config__.noShow"> | |
| 25 | + <template v-if="item.__config__.nccKey==='uploadFz'"> | |
| 26 | + <div class="dy-fileList"> | |
| 27 | + <el-link :underline="false" class="dy-fileList-item" | |
| 28 | + v-for="(cItem,ci) in item.__config__.defaultValue" :key="ci" | |
| 29 | + @click="downloadFile(cItem)"><i class="el-icon-document"></i>{{cItem.name}} | |
| 30 | + </el-link> | |
| 31 | + </div> | |
| 32 | + </template> | |
| 33 | + <template v-else-if="item.__config__.nccKey==='uploadImg'"> | |
| 34 | + <el-image :src="define.comUrl+cItem.url" class="dy-img" | |
| 35 | + v-for="(cItem,ci) in item.__config__.defaultValue" :key="ci" | |
| 36 | + :preview-src-list="getImgList(item.__config__.defaultValue)" :z-index="10000"> | |
| 37 | + </el-image> | |
| 38 | + </template> | |
| 39 | + <template v-else-if="item.__config__.nccKey==='colorPicker'"> | |
| 40 | + <el-color-picker v-model="item.__config__.defaultValue" :show-alpha="item['show-alpha']" | |
| 41 | + :color-format="item['color-format']" :size="item.size" disabled /> | |
| 42 | + </template> | |
| 43 | + <template v-else-if="item.__config__.nccKey==='rate'"> | |
| 44 | + <el-rate v-model="item.__config__.defaultValue" :max="item.max" | |
| 45 | + :allow-half="item['allow-half']" :show-text="item['show-text']" | |
| 46 | + :show-score="item['show-score']" disabled /> | |
| 47 | + </template> | |
| 48 | + <template v-else-if="item.__config__.nccKey==='switch'"> | |
| 49 | + <el-switch v-model="item.__config__.defaultValue" :active-value="item['active-value']" | |
| 50 | + :active-color="item['active-color']" :active-text="item['active-text']" | |
| 51 | + :inactive-color="item['inactive-color']" :inactive-text="item['inactive-text']" | |
| 52 | + :inactive-value="item['inactive-value']" disabled /> | |
| 53 | + </template> | |
| 54 | + <template v-else-if="item.__config__.nccKey==='slider'"> | |
| 55 | + <div class="slider-box"> | |
| 56 | + <el-slider v-model="item.__config__.defaultValue" :range='item.range' | |
| 57 | + :show-stops="item['show-stops']" /> | |
| 58 | + <div class="slider-mark"></div> | |
| 59 | + </div> | |
| 60 | + </template> | |
| 61 | + <template v-else-if="item.__config__.nccKey==='editor'"> | |
| 62 | + <div v-html="item.__config__.defaultValue"></div> | |
| 63 | + </template> | |
| 64 | + <template v-else-if="item.__config__.nccKey==='relationForm'"> | |
| 65 | + <el-link :underline="false" @click.native="toDetail(item)" type="primary"> | |
| 66 | + {{ item.name }}</el-link> | |
| 67 | + </template> | |
| 68 | + <template v-else-if="item.__config__.nccKey==='relationFormAttr'"> | |
| 69 | + <p class="dynamicDetail-text"> | |
| 70 | + {{ relationData[item.relationField] &&relationData[item.relationField][item.showField] ? relationData[item.relationField][item.showField] : '' }} | |
| 71 | + </p> | |
| 72 | + </template> | |
| 73 | + <template v-else> | |
| 74 | + <p class="dynamicDetail-text">{{ getValue(item) }}</p> | |
| 75 | + </template> | |
| 76 | + </el-form-item> | |
| 77 | + </template> | |
| 78 | + </template> | |
| 79 | + <template v-else> | |
| 80 | + <template v-if="item.__config__.nccKey==='card'"> | |
| 81 | + <el-card :shadow="item.shadow" :header="item.header" class="mb-20"> | |
| 82 | + <Item v-for="(childItem, childIndex) in item.__config__.children" :key="childIndex" | |
| 83 | + :item="childItem" v-bind="$props" v-on="$listeners" /> | |
| 84 | + </el-card> | |
| 85 | + </template> | |
| 86 | + <template v-if="item.__config__.nccKey==='row'"> | |
| 87 | + <el-row :gutter="formConf.gutter"> | |
| 88 | + <Item v-for="(childItem, childIndex) in item.__config__.children" :key="childIndex" | |
| 89 | + :item="childItem" v-bind="$props" v-on="$listeners" /> | |
| 90 | + </el-row> | |
| 91 | + </template> | |
| 92 | + <template v-if="item.__config__.nccKey==='table'"> | |
| 93 | + <el-form-item label-width="0" v-if="!item.__config__.noShow"> | |
| 94 | + <div class="NCC-common-title" v-if="item.__config__.showTitle"> | |
| 95 | + <h2>{{item.__config__.label}}</h2> | |
| 96 | + </div> | |
| 97 | + <NCC-table :data="item.__config__.defaultValue"> | |
| 98 | + <template v-for="(column,columnIndex) in item.__config__.children"> | |
| 99 | + <el-table-column :key="columnIndex" :prop="column.__vModel__" | |
| 100 | + :label="column.__config__.label" v-if="column.__config__.nccKey==='relationForm'"> | |
| 101 | + <template slot-scope="scope"> | |
| 102 | + <el-link :underline="false" type="primary" | |
| 103 | + @click.native="toTableDetail(column,scope.row[column.__vModel__+'_id'])"> | |
| 104 | + {{ scope.row[column.__vModel__] }}</el-link> | |
| 105 | + </template> | |
| 106 | + </el-table-column> | |
| 107 | + <el-table-column :key="columnIndex" :prop="column.__vModel__" | |
| 108 | + :label="column.__config__.label" v-else /> | |
| 109 | + </template> | |
| 110 | + </NCC-table> | |
| 111 | + </el-form-item> | |
| 112 | + </template> | |
| 113 | + <template v-if="item.__config__.nccKey==='tab'"> | |
| 114 | + <el-tabs :type="item.type" :tab-position="item['tab-position']" | |
| 115 | + v-model="item.__config__.active" class="mb-10"> | |
| 116 | + <el-tab-pane v-for="(pane,i) in item.__config__.children" :key="i" :label="pane.title"> | |
| 117 | + <Item v-for="(childItem, childIndex) in pane.__config__.children" :key="childIndex" | |
| 118 | + :item="childItem" v-bind="$props" v-on="$listeners" /> | |
| 119 | + </el-tab-pane> | |
| 120 | + </el-tabs> | |
| 121 | + </template> | |
| 122 | + <template v-if="item.__config__.nccKey==='collapse'"> | |
| 123 | + <el-collapse :accordion="item.accordion" v-model="item.__config__.active" class="mb-20"> | |
| 124 | + <el-collapse-item v-for="(pane,i) in item.__config__.children" :key="i" | |
| 125 | + :title="pane.title" :name="pane.name"> | |
| 126 | + <Item v-for="(childItem, childIndex) in pane.__config__.children" :key="childIndex" | |
| 127 | + :item="childItem" v-bind="$props" v-on="$listeners" /> | |
| 128 | + </el-collapse-item> | |
| 129 | + </el-collapse> | |
| 130 | + </template> | |
| 131 | + </template> | |
| 132 | + </el-col> | |
| 133 | +</template> | |
| 134 | +<script> | |
| 135 | +import { getDownloadUrl } from '@/api/common' | |
| 136 | + | |
| 137 | +export default { | |
| 138 | + name: 'Item', | |
| 139 | + props: { | |
| 140 | + item: { | |
| 141 | + type: Object, | |
| 142 | + required: true | |
| 143 | + }, | |
| 144 | + formConf: { | |
| 145 | + type: Object, | |
| 146 | + required: true | |
| 147 | + }, | |
| 148 | + relationData: { | |
| 149 | + type: Object, | |
| 150 | + default: () => { } | |
| 151 | + } | |
| 152 | + }, | |
| 153 | + methods: { | |
| 154 | + toDetail(item) { | |
| 155 | + this.$emit('toDetail', item) | |
| 156 | + }, | |
| 157 | + toTableDetail(item, value) { | |
| 158 | + item.__config__.defaultValue = value | |
| 159 | + this.$emit('toDetail', item) | |
| 160 | + }, | |
| 161 | + downloadFile(file) { | |
| 162 | + if (!file.fileId) return | |
| 163 | + getDownloadUrl('annex', file.fileId).then(res => { | |
| 164 | + if (res.data.url) window.location.href = this.define.comUrl + res.data.url | |
| 165 | + }) | |
| 166 | + }, | |
| 167 | + getImgList(list) { | |
| 168 | + const newList = list.map(o => this.define.comUrl + o.url) | |
| 169 | + return newList | |
| 170 | + }, | |
| 171 | + getValue(item) { | |
| 172 | + if (Array.isArray(item.__config__.defaultValue)) { | |
| 173 | + if (['timeRange', 'dateRange'].includes(item.__config__.nccKey)) { | |
| 174 | + return item.__config__.defaultValue.join('') | |
| 175 | + } | |
| 176 | + return item.__config__.defaultValue.join() | |
| 177 | + } | |
| 178 | + return item.__config__.defaultValue | |
| 179 | + } | |
| 180 | + } | |
| 181 | +} | |
| 182 | +</script> | |
| 0 | 183 | \ No newline at end of file | ... | ... |
src/views/baseSpecialAction/dynamicModel/list/detail/Parser.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <el-row :gutter="formConf.gutter" | |
| 3 | + :class="formConf.formStyle?formConf.formStyle+' word-from-detail':''"> | |
| 4 | + <el-form :size="formConf.size" :label-position="formConf.labelPosition" | |
| 5 | + :label-width="`${formConf.labelWidth}px`" :ref="formConf.formRef"> | |
| 6 | + <Item v-for="(item, index) in formConf.fields" :key="index" :item="item" v-bind="$props" | |
| 7 | + v-on="$listeners" /> | |
| 8 | + </el-form> | |
| 9 | + </el-row> | |
| 10 | +</template> | |
| 11 | +<script> | |
| 12 | + | |
| 13 | +import Item from './Item' | |
| 14 | +export default { | |
| 15 | + components: { Item }, | |
| 16 | + props: { | |
| 17 | + formConf: { | |
| 18 | + type: Object, | |
| 19 | + required: true | |
| 20 | + }, | |
| 21 | + relationData: { | |
| 22 | + type: Object, | |
| 23 | + default: () => { } | |
| 24 | + }, | |
| 25 | + loading: { | |
| 26 | + type: Boolean, | |
| 27 | + default: false | |
| 28 | + } | |
| 29 | + } | |
| 30 | +} | |
| 31 | +</script> | |
| 0 | 32 | \ No newline at end of file | ... | ... |
src/views/baseSpecialAction/dynamicModel/list/detail/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <template v-if="formData.popupType==='general'"> | |
| 4 | + <el-dialog title="详情" :close-on-click-modal="false" :visible.sync="visible" | |
| 5 | + class="NCC-dialog NCC-dialog_center" lock-scroll :width="formData.generalWidth" | |
| 6 | + append-to-body> | |
| 7 | + <div class="dynamicDetail" v-loading="loading || mainLoading" | |
| 8 | + :element-loading-text="$t('common.loadingText')"> | |
| 9 | + <Parser :formConf="formData" :relationData="relationData" @toDetail="toDetail" | |
| 10 | + v-if="!loading" /> | |
| 11 | + </div> | |
| 12 | + <span slot="footer" class="dialog-footer"> | |
| 13 | + <template v-if="formData.hasPrintBtn && formData.printId"> | |
| 14 | + <el-button type="primary" @click="printBrowseVisible=true"> | |
| 15 | + {{formData.printButtonText||'打 印'}} | |
| 16 | + </el-button> | |
| 17 | + </template> | |
| 18 | + <el-button @click="visible = false">{{$t('common.cancelButton')}}</el-button> | |
| 19 | + </span> | |
| 20 | + </el-dialog> | |
| 21 | + </template> | |
| 22 | + <template v-if="formData.popupType==='fullScreen'"> | |
| 23 | + <transition name="el-zoom-in-center"> | |
| 24 | + <div class="NCC-preview-main"> | |
| 25 | + <div class="NCC-common-page-header"> | |
| 26 | + <el-page-header @back="goBack" content="详情" /> | |
| 27 | + <div class="options"> | |
| 28 | + <template v-if="formData.hasPrintBtn && formData.printId"> | |
| 29 | + <el-button type="primary" @click="printBrowseVisible=true"> | |
| 30 | + {{formData.printButtonText||'打 印'}} | |
| 31 | + </el-button> | |
| 32 | + </template> | |
| 33 | + <el-button @click="goBack">{{$t('common.cancelButton')}}</el-button> | |
| 34 | + </div> | |
| 35 | + </div> | |
| 36 | + <div class="dynamic-form-main dynamicDetail" | |
| 37 | + :style="{margin: '0 auto',width:formData.fullScreenWidth}" | |
| 38 | + v-loading="loading || mainLoading" :element-loading-text="$t('common.loadingText')"> | |
| 39 | + <Parser :formConf="formData" :relationData="relationData" @toDetail="toDetail" | |
| 40 | + v-if="!loading" /> | |
| 41 | + </div> | |
| 42 | + </div> | |
| 43 | + </transition> | |
| 44 | + </template> | |
| 45 | + <Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" /> | |
| 46 | + <print-browse :visible.sync="printBrowseVisible" :id="formData.printId" :formId="dataForm.id" /> | |
| 47 | + </div> | |
| 48 | +</template> | |
| 49 | + | |
| 50 | +<script> | |
| 51 | +import { getDataChange, getConfigData } from '@/api/onlineDev/visualDev' | |
| 52 | +import { deepClone } from '@/utils' | |
| 53 | +import Parser from './Parser' | |
| 54 | +import PrintBrowse from '@/components/PrintBrowse' | |
| 55 | +export default { | |
| 56 | + name: 'Detail', | |
| 57 | + components: { Parser, PrintBrowse }, | |
| 58 | + data() { | |
| 59 | + return { | |
| 60 | + visible: false, | |
| 61 | + dataForm: { | |
| 62 | + id: '', | |
| 63 | + data: '' | |
| 64 | + }, | |
| 65 | + modelId: '', | |
| 66 | + formData: {}, | |
| 67 | + formValue: {}, | |
| 68 | + loading: true, | |
| 69 | + mainLoading: false, | |
| 70 | + detailVisible: false, | |
| 71 | + relationData: {}, | |
| 72 | + useFormPermission: false, | |
| 73 | + printBrowseVisible: false, | |
| 74 | + formOperates: [] | |
| 75 | + } | |
| 76 | + }, | |
| 77 | + methods: { | |
| 78 | + goBack() { | |
| 79 | + this.$emit('close') | |
| 80 | + }, | |
| 81 | + init(formData, modelId, id, useFormPermission) { | |
| 82 | + this.formData = deepClone(formData) | |
| 83 | + this.modelId = modelId | |
| 84 | + this.useFormPermission = useFormPermission | |
| 85 | + this.dataForm.id = id || '' | |
| 86 | + this.getFormOperates() | |
| 87 | + this.loading = true | |
| 88 | + this.relationData = {} | |
| 89 | + this.$nextTick(() => { | |
| 90 | + if (this.dataForm.id) { | |
| 91 | + getDataChange(modelId, this.dataForm.id).then(res => { | |
| 92 | + this.dataForm = res.data | |
| 93 | + if (!this.dataForm.data) return | |
| 94 | + this.formValue = JSON.parse(this.dataForm.data) | |
| 95 | + this.fillFormData(this.formData, this.formValue) | |
| 96 | + this.visible = true | |
| 97 | + }) | |
| 98 | + } else { | |
| 99 | + this.formValue = {} | |
| 100 | + this.loading = false | |
| 101 | + this.visible = false | |
| 102 | + this.$emit('close') | |
| 103 | + } | |
| 104 | + }) | |
| 105 | + }, | |
| 106 | + unique(arr, attrName) { | |
| 107 | + const res = new Map() | |
| 108 | + return arr.filter(o => !res.has(o[attrName]) && res.set(o[attrName], 1)) | |
| 109 | + }, | |
| 110 | + handleAttrList(list) { | |
| 111 | + let realList = this.unique(list, 'relationField') | |
| 112 | + for (let i = 0; i < realList.length; i++) { | |
| 113 | + const item = realList[i]; | |
| 114 | + let modelId = '', id = "", field = "" | |
| 115 | + const loop = list => { | |
| 116 | + for (let i = 0; i < list.length; i++) { | |
| 117 | + if (item.relationField === list[i].__vModel__) { | |
| 118 | + modelId = list[i].modelId | |
| 119 | + id = list[i].__config__.defaultValue | |
| 120 | + field = list[i].__vModel__ | |
| 121 | + break | |
| 122 | + } | |
| 123 | + if (list[i].__config__ && list[i].__config__.nccKey !== 'table' && list[i].__config__.children && Array.isArray(list[i].__config__.children)) { | |
| 124 | + loop(list[i].__config__.children) | |
| 125 | + } | |
| 126 | + } | |
| 127 | + } | |
| 128 | + loop(this.formData.fields) | |
| 129 | + if (!id) { | |
| 130 | + this.$set(this.relationData, field, "") | |
| 131 | + continue | |
| 132 | + } | |
| 133 | + getDataChange(modelId, id).then(res => { | |
| 134 | + if (!res.data || !res.data.data) { | |
| 135 | + this.$set(this.relationData, field, "") | |
| 136 | + return | |
| 137 | + } | |
| 138 | + let data = JSON.parse(res.data.data) | |
| 139 | + this.$set(this.relationData, field, data) | |
| 140 | + }).catch(() => { this.$set(this.relationData, field, "") }) | |
| 141 | + } | |
| 142 | + }, | |
| 143 | + toDetail(item) { | |
| 144 | + if (!item.__config__.defaultValue) return | |
| 145 | + this.mainLoading = true | |
| 146 | + getConfigData(item.modelId).then(res => { | |
| 147 | + this.mainLoading = false | |
| 148 | + if (!res.data) return | |
| 149 | + if (!res.data.formData) return | |
| 150 | + let formData = JSON.parse(res.data.formData) | |
| 151 | + formData.popupType = this.formData.popupType | |
| 152 | + this.detailVisible = true | |
| 153 | + this.$nextTick(() => { | |
| 154 | + this.$refs.Detail.init(formData, item.modelId, item.__config__.defaultValue) | |
| 155 | + }) | |
| 156 | + }).catch(() => { this.mainLoading = false }) | |
| 157 | + }, | |
| 158 | + getFormOperates() { | |
| 159 | + if (!this.useFormPermission) return | |
| 160 | + const permissionList = this.$store.getters.permissionList | |
| 161 | + const modelId = this.$route.meta.modelId | |
| 162 | + const list = permissionList.filter(o => o.modelId === modelId) | |
| 163 | + this.formOperates = list[0] && list[0].form ? list[0].form : [] | |
| 164 | + }, | |
| 165 | + fillFormData(form, data) { | |
| 166 | + let relationFormAttrList = [] | |
| 167 | + const loop = list => { | |
| 168 | + for (let i = 0; i < list.length; i++) { | |
| 169 | + let item = list[i] | |
| 170 | + if (item.__vModel__) { | |
| 171 | + if (item.__config__.nccKey === 'relationForm') { | |
| 172 | + let id = data[item.__vModel__ + '_id'] | |
| 173 | + if (id) item.__config__.defaultValue = id | |
| 174 | + this.$set(item, 'name', data[item.__vModel__] || '') | |
| 175 | + } else { | |
| 176 | + const val = data[item.__vModel__] | |
| 177 | + if (val) item.__config__.defaultValue = val | |
| 178 | + } | |
| 179 | + if (this.useFormPermission) { | |
| 180 | + let noShow = true | |
| 181 | + if (this.formOperates && this.formOperates.length) { | |
| 182 | + noShow = !this.formOperates.some(o => o.enCode === item.__vModel__) | |
| 183 | + } | |
| 184 | + noShow = item.__config__.noShow ? item.__config__.noShow : noShow | |
| 185 | + this.$set(item.__config__, 'noShow', noShow) | |
| 186 | + } | |
| 187 | + } | |
| 188 | + if (item.__config__.nccKey === 'relationFormAttr') relationFormAttrList.push(item) | |
| 189 | + if (item.__config__ && item.__config__.nccKey !== 'table' && item.__config__.children && Array.isArray(item.__config__.children)) { | |
| 190 | + loop(item.__config__.children) | |
| 191 | + } | |
| 192 | + } | |
| 193 | + } | |
| 194 | + loop(form.fields) | |
| 195 | + this.handleAttrList(relationFormAttrList) | |
| 196 | + this.loading = false | |
| 197 | + } | |
| 198 | + } | |
| 199 | +} | |
| 200 | +</script> | |
| 0 | 201 | \ No newline at end of file | ... | ... |
src/views/baseSpecialAction/dynamicModel/list/index.vue
0 → 100644
| 1 | + | |
| 2 | +<template> | |
| 3 | + <div class="NCC-common-layout"> | |
| 4 | + <div class="NCC-common-layout-left" v-if="columnData.type === 2"> | |
| 5 | + <div class="NCC-common-title" v-if="columnData.treeTitle"> | |
| 6 | + <h2>{{columnData.treeTitle}}</h2> | |
| 7 | + </div> | |
| 8 | + <el-tree :data="treeData" :props="treeProps" default-expand-all highlight-current | |
| 9 | + ref="treeBox" :expand-on-click-node="false" @node-click="handleNodeClick" | |
| 10 | + class="NCC-common-el-tree" :node-key="treeProps.value"> | |
| 11 | + <span class="custom-tree-node" slot-scope="{ node, data }"> | |
| 12 | + <i :class="data.icon"></i> | |
| 13 | + <span class="text">{{node.label}}</span> | |
| 14 | + </span> | |
| 15 | + </el-tree> | |
| 16 | + </div> | |
| 17 | + <div class="NCC-common-layout-center"> | |
| 18 | + <Search ref="Search" :list="columnData.searchList" @reset="reset" @search="search" /> | |
| 19 | + <div class="NCC-common-layout-main NCC-flex-main"> | |
| 20 | + <div class="NCC-common-head"> | |
| 21 | + <div v-if="isPreview || !columnData.useBtnPermission"> | |
| 22 | + <el-button :type="i==0?'primary':'text'" :icon="item.icon" | |
| 23 | + @click="headBtnsHandel(item.value)" v-for="(item, i) in columnData.btnsList" :key="i"> | |
| 24 | + {{item.label}}</el-button> | |
| 25 | + </div> | |
| 26 | + <div v-else> | |
| 27 | + <el-button :type="i==0?'primary':'text'" :icon="item.icon" v-has="'btn_'+item.value" | |
| 28 | + @click="headBtnsHandel(item.value)" v-for="(item, i) in columnData.btnsList" :key="i"> | |
| 29 | + {{item.label}}</el-button> | |
| 30 | + </div> | |
| 31 | + <div class="NCC-common-head-right"> | |
| 32 | + <el-tooltip effect="dark" :content="$t('common.refresh')" placement="top"> | |
| 33 | + <el-link icon="icon-ym icon-ym-Refresh NCC-common-head-icon" :underline="false" | |
| 34 | + @click="initData()" /> | |
| 35 | + </el-tooltip> | |
| 36 | + <screenfull /> | |
| 37 | + </div> | |
| 38 | + </div> | |
| 39 | + <NCC-table v-loading="listLoading" :data="list" row-key="id" default-expand-all | |
| 40 | + :tree-props="{children: 'children', hasChildren: ''}" @sort-change='sortChange' | |
| 41 | + :has-c="hasBatchBtn" @selection-change="handleSelectionChange" v-if="refreshTable"> | |
| 42 | + <el-table-column :prop="item.prop" :label="item.label" :align="item.align" | |
| 43 | + :width="item.width" v-for="(item, i) in columnList" :key="i" | |
| 44 | + :sortable="item.sortable?'custom':item.sortable" /> | |
| 45 | + <el-table-column prop="flowState" label="状态" width="100" v-if="config.webType == 3"> | |
| 46 | + <template slot-scope="scope" v-if="!scope.row.top"> | |
| 47 | + <el-tag v-if="scope.row.flowState==1">等待审核</el-tag> | |
| 48 | + <el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag> | |
| 49 | + <el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag> | |
| 50 | + <el-tag type="danger" v-else-if="scope.row.flowState==4">流程撤回</el-tag> | |
| 51 | + <el-tag type="warning" v-else-if="scope.row.flowState==5">审核终止</el-tag> | |
| 52 | + <el-tag type="info" v-else>等待提交</el-tag> | |
| 53 | + </template> | |
| 54 | + </el-table-column> | |
| 55 | + <el-table-column label="操作" fixed="right" :width="columnData.columnBtnsList.length*50" | |
| 56 | + v-if="columnData.columnBtnsList.length"> | |
| 57 | + <template slot-scope="scope" v-if="!scope.row.top"> | |
| 58 | + <template v-if="isPreview || !columnData.useBtnPermission"> | |
| 59 | + <template v-for="(item, i) in columnData.columnBtnsList"> | |
| 60 | + <template v-if="item.value=='edit'"> | |
| 61 | + <el-button size="mini" type="text" :key="i" | |
| 62 | + :disabled="config.webType == 3 && [1,2,5].indexOf(scope.row.flowState)>-1" | |
| 63 | + @click="columnBtnsHandel(item.value,scope.row)"> | |
| 64 | + {{item.label}}</el-button> | |
| 65 | + </template> | |
| 66 | + <template v-if="item.value=='remove'"> | |
| 67 | + <el-button size="mini" type="text" :key="i" class="NCC-table-delBtn" | |
| 68 | + :disabled="config.webType == 3 && [1,2,3,5].indexOf(scope.row.flowState)>-1" | |
| 69 | + @click="columnBtnsHandel(item.value,scope.row)"> | |
| 70 | + {{item.label}}</el-button> | |
| 71 | + </template> | |
| 72 | + <template v-if="item.value=='detail'"> | |
| 73 | + <el-button size="mini" type="text" :key="i" | |
| 74 | + :disabled="config.webType == 3 && !scope.row.flowState" | |
| 75 | + @click="columnBtnsHandel(item.value,scope.row)"> | |
| 76 | + {{item.label}}</el-button> | |
| 77 | + </template> | |
| 78 | + </template> | |
| 79 | + </template> | |
| 80 | + <template v-else> | |
| 81 | + <template v-for="(item, i) in columnData.columnBtnsList"> | |
| 82 | + <template v-if="item.value=='edit'"> | |
| 83 | + <el-button size="mini" type="text" :key="i" | |
| 84 | + :disabled="config.webType == 3 && [1,2,5].indexOf(scope.row.flowState)>-1" | |
| 85 | + @click="columnBtnsHandel(item.value,scope.row)" v-has="'btn_'+item.value"> | |
| 86 | + {{item.label}}</el-button> | |
| 87 | + </template> | |
| 88 | + <template v-if="item.value=='remove'"> | |
| 89 | + <el-button size="mini" type="text" :key="i" class="NCC-table-delBtn" | |
| 90 | + :disabled="config.webType == 3 && [1,2,3,5].indexOf(scope.row.flowState)>-1" | |
| 91 | + @click="columnBtnsHandel(item.value,scope.row)" v-has="'btn_'+item.value"> | |
| 92 | + {{item.label}}</el-button> | |
| 93 | + </template> | |
| 94 | + <template v-if="item.value=='detail'"> | |
| 95 | + <el-button size="mini" type="text" :key="i" | |
| 96 | + :disabled="config.webType == 3 && !scope.row.flowState" | |
| 97 | + @click="columnBtnsHandel(item.value,scope.row)" v-has="'btn_'+item.value"> | |
| 98 | + {{item.label}}</el-button> | |
| 99 | + </template> | |
| 100 | + </template> | |
| 101 | + </template> | |
| 102 | + </template> | |
| 103 | + </el-table-column> | |
| 104 | + </NCC-table> | |
| 105 | + <template v-if="columnData.type !== 3 && columnData.hasPage"> | |
| 106 | + <pagination :total="total" :page.sync="listQuery.currentPage" | |
| 107 | + :limit.sync="listQuery.pageSize" @pagination="initData" /> | |
| 108 | + </template> | |
| 109 | + </div> | |
| 110 | + </div> | |
| 111 | + <FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" /> | |
| 112 | + <Form v-show="formVisible" ref="Form" @refreshDataList="refresh" /> | |
| 113 | + <Detail v-show="detailVisible" ref="Detail" @close="detailVisible = false" /> | |
| 114 | + <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> | |
| 115 | + </div> | |
| 116 | +</template> | |
| 117 | + | |
| 118 | +<script> | |
| 119 | +import { getModelList, deteleModel, batchDelete, exportModel } from '@/api/onlineDev/visualDev' | |
| 120 | +import { getDictionaryDataSelector } from '@/api/systemData/dictionary' | |
| 121 | +import { previewDataInterface } from '@/api/systemData/dataInterface' | |
| 122 | +import Form from './Form' | |
| 123 | +import FlowBox from '@/views/workFlow/components/FlowBox' | |
| 124 | +import Detail from './detail' | |
| 125 | +import ExportBox from './ExportBox' | |
| 126 | +import Search from './Search' | |
| 127 | +export default { | |
| 128 | + name: 'dynamicModel', | |
| 129 | + components: { Form, ExportBox, Search, Detail, FlowBox }, | |
| 130 | + props: ['config', 'modelId', 'isPreview'], | |
| 131 | + data() { | |
| 132 | + return { | |
| 133 | + keyword: '', | |
| 134 | + treeProps: { | |
| 135 | + children: 'children', | |
| 136 | + label: 'fullName', | |
| 137 | + value: 'id' | |
| 138 | + }, | |
| 139 | + list: [], | |
| 140 | + total: 0, | |
| 141 | + listLoading: false, | |
| 142 | + listQuery: { | |
| 143 | + currentPage: 1, | |
| 144 | + pageSize: 20, | |
| 145 | + sort: 'desc', | |
| 146 | + sidx: '', | |
| 147 | + menuId: '', | |
| 148 | + json: '' | |
| 149 | + }, | |
| 150 | + flowVisible: false, | |
| 151 | + formVisible: false, | |
| 152 | + detailVisible: false, | |
| 153 | + importBoxVisible: false, | |
| 154 | + exportBoxVisible: false, | |
| 155 | + treeData: [], | |
| 156 | + treeActiveId: '', | |
| 157 | + columnData: { | |
| 158 | + columnBtnsList: [] | |
| 159 | + }, | |
| 160 | + formData: {}, | |
| 161 | + columnList: [], | |
| 162 | + hasBatchBtn: false, | |
| 163 | + refreshTable: true, | |
| 164 | + multipleSelection: [] | |
| 165 | + } | |
| 166 | + }, | |
| 167 | + created() { | |
| 168 | + this.init() | |
| 169 | + }, | |
| 170 | + methods: { | |
| 171 | + init() { | |
| 172 | + this.listQuery.menuId = this.$route.meta.modelId | |
| 173 | + this.refreshTable = false | |
| 174 | + if (!this.config.columnData || !this.config.formData) return | |
| 175 | + this.columnData = JSON.parse(this.config.columnData) | |
| 176 | + if (this.columnData.type === 3) { | |
| 177 | + this.columnData.columnList = this.columnData.columnList.filter(o => o.prop != this.columnData.groupField) | |
| 178 | + } | |
| 179 | + this.hasBatchBtn = this.columnData.btnsList.some(o => o.value == 'batchRemove') | |
| 180 | + this.$nextTick(() => { | |
| 181 | + this.refreshTable = true | |
| 182 | + }) | |
| 183 | + this.formData = JSON.parse(this.config.formData) | |
| 184 | + this.getColumnList() | |
| 185 | + if (this.isPreview) return | |
| 186 | + this.listQuery.pageSize = this.columnData.pageSize | |
| 187 | + this.listQuery.sort = this.columnData.sort | |
| 188 | + this.listQuery.sidx = this.columnData.defaultSidx | |
| 189 | + if (this.columnData.type === 3 || !this.columnData.hasPage) this.listQuery.pageSize = 10000 | |
| 190 | + if (this.columnData.type === 2) { | |
| 191 | + this.treeProps.value = this.columnData.treePropsValue || 'id' | |
| 192 | + this.treeProps.label = this.columnData.treePropsLabel || 'fullName' | |
| 193 | + this.treeProps.children = this.columnData.treePropsChildren || 'children' | |
| 194 | + this.getTreeView() | |
| 195 | + } else { | |
| 196 | + this.initData() | |
| 197 | + } | |
| 198 | + }, | |
| 199 | + initData() { | |
| 200 | + if (this.isPreview) return | |
| 201 | + this.listLoading = true | |
| 202 | + getModelList(this.modelId, this.listQuery).then(res => { | |
| 203 | + this.list = res.data.list | |
| 204 | + if (this.columnData.type !== 3 && this.columnData.hasPage) this.total = res.data.pagination.total | |
| 205 | + this.listLoading = false | |
| 206 | + }) | |
| 207 | + }, | |
| 208 | + getTreeView() { | |
| 209 | + if (this.columnData.treeDataSource === "dictionary") { | |
| 210 | + if (!this.columnData.treeDictionary) return | |
| 211 | + getDictionaryDataSelector(this.columnData.treeDictionary).then(res => { | |
| 212 | + this.treeData = res.data.list | |
| 213 | + this.initData() | |
| 214 | + }) | |
| 215 | + } | |
| 216 | + if (this.columnData.treeDataSource === "organize") { | |
| 217 | + this.$store.dispatch('generator/getCompanyTree').then(res => { | |
| 218 | + this.treeData = res | |
| 219 | + this.initData() | |
| 220 | + }) | |
| 221 | + } | |
| 222 | + if (this.columnData.treeDataSource === "department") { | |
| 223 | + this.$store.dispatch('generator/getDepTree').then(res => { | |
| 224 | + this.treeData = res | |
| 225 | + this.initData() | |
| 226 | + }) | |
| 227 | + } | |
| 228 | + if (this.columnData.treeDataSource === "api") { | |
| 229 | + if (!this.columnData.treePropsUrl) return | |
| 230 | + previewDataInterface(this.columnData.treePropsUrl).then(res => { | |
| 231 | + if (Array.isArray(res.data)) { | |
| 232 | + this.treeData = res.data | |
| 233 | + } else { | |
| 234 | + this.treeData = [] | |
| 235 | + } | |
| 236 | + this.initData() | |
| 237 | + }) | |
| 238 | + } | |
| 239 | + }, | |
| 240 | + getColumnList() { | |
| 241 | + if (this.isPreview || !this.columnData.useColumnPermission) { | |
| 242 | + this.columnList = this.columnData.columnList | |
| 243 | + } else { | |
| 244 | + const permissionList = this.$store.getters.permissionList | |
| 245 | + const modelId = this.$route.meta.modelId | |
| 246 | + const list = permissionList.filter(o => o.modelId === modelId) | |
| 247 | + const columnList = list[0] && list[0].column ? list[0].column : [] | |
| 248 | + let realList = [] | |
| 249 | + for (let i = 0; i < columnList.length; i++) { | |
| 250 | + inner: for (let j = 0; j < this.columnData.columnList.length; j++) { | |
| 251 | + if (columnList[i].enCode === this.columnData.columnList[j].prop) { | |
| 252 | + realList.push(this.columnData.columnList[j]) | |
| 253 | + break inner | |
| 254 | + } | |
| 255 | + } | |
| 256 | + } | |
| 257 | + this.columnList = realList | |
| 258 | + } | |
| 259 | + }, | |
| 260 | + handleNodeClick(data) { | |
| 261 | + if (this.treeActiveId == data[this.treeProps.value]) return | |
| 262 | + this.treeActiveId = data[this.treeProps.value] | |
| 263 | + this.$refs.Search.treeReset() | |
| 264 | + let json = { [this.columnData.treeRelation]: data[this.treeProps.value] } | |
| 265 | + this.search(JSON.stringify(json)) | |
| 266 | + }, | |
| 267 | + handleDel(id) { | |
| 268 | + this.$confirm(this.$t('common.delTip'), this.$t('common.tipTitle'), { | |
| 269 | + type: 'warning' | |
| 270 | + }).then(() => { | |
| 271 | + deteleModel(this.modelId, id).then(res => { | |
| 272 | + this.$message({ | |
| 273 | + type: 'success', | |
| 274 | + message: res.msg, | |
| 275 | + duration: 1000, | |
| 276 | + onClose: () => { this.initData() } | |
| 277 | + }); | |
| 278 | + }) | |
| 279 | + }).catch(() => { }); | |
| 280 | + }, | |
| 281 | + addOrUpdateHandle(id, flowState) { | |
| 282 | + if (this.config.webType == 3) { | |
| 283 | + let data = { | |
| 284 | + id: id || '', | |
| 285 | + enCode: this.config.flowEnCode, | |
| 286 | + flowId: this.config.flowId, | |
| 287 | + formType: 2, | |
| 288 | + type: 1, | |
| 289 | + opType: '-1', | |
| 290 | + modelId: this.modelId, | |
| 291 | + isPreview: this.isPreview | |
| 292 | + } | |
| 293 | + this.flowVisible = true | |
| 294 | + this.$nextTick(() => { | |
| 295 | + this.$refs.FlowBox.init(data) | |
| 296 | + }) | |
| 297 | + } else { | |
| 298 | + this.formVisible = true | |
| 299 | + this.$nextTick(() => { | |
| 300 | + this.$refs.Form.init(this.formData, this.modelId, id, this.isPreview, this.columnData.useFormPermission) | |
| 301 | + }) | |
| 302 | + } | |
| 303 | + }, | |
| 304 | + headBtnsHandel(key) { | |
| 305 | + if (key === 'add') { | |
| 306 | + this.addOrUpdateHandle() | |
| 307 | + } | |
| 308 | + if (key == 'download') { | |
| 309 | + this.exportBoxVisible = true | |
| 310 | + this.$nextTick(() => { | |
| 311 | + this.$refs.ExportBox.init(this.columnList) | |
| 312 | + }) | |
| 313 | + } | |
| 314 | + if (this.isPreview) return | |
| 315 | + if (key === 'batchRemove') { | |
| 316 | + this.batchRemove() | |
| 317 | + } | |
| 318 | + }, | |
| 319 | + handleSelectionChange(val) { | |
| 320 | + const res = val.map(item => item.id) | |
| 321 | + this.multipleSelection = res | |
| 322 | + }, | |
| 323 | + batchRemove() { | |
| 324 | + if (!this.multipleSelection.length) { | |
| 325 | + this.$message({ | |
| 326 | + type: 'error', | |
| 327 | + message: '请选择一条数据', | |
| 328 | + duration: 1500, | |
| 329 | + }) | |
| 330 | + return | |
| 331 | + } | |
| 332 | + this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { | |
| 333 | + type: 'warning' | |
| 334 | + }).then(() => { | |
| 335 | + batchDelete(this.modelId, this.multipleSelection).then(res => { | |
| 336 | + this.$message({ | |
| 337 | + type: 'success', | |
| 338 | + message: res.msg, | |
| 339 | + duration: 1500, | |
| 340 | + onClose: () => { | |
| 341 | + this.initData() | |
| 342 | + } | |
| 343 | + }) | |
| 344 | + }) | |
| 345 | + }).catch(() => { }) | |
| 346 | + }, | |
| 347 | + download(data) { | |
| 348 | + if (this.isPreview) return this.$message({ message: '功能预览不支持数据导出', type: 'warning' }) | |
| 349 | + let query = { ...this.listQuery, ...data } | |
| 350 | + exportModel(this.modelId, query).then(res => { | |
| 351 | + if (!res.data.url) return | |
| 352 | + window.location.href = this.define.comUrl + res.data.url | |
| 353 | + this.$refs.ExportBox.visible = false | |
| 354 | + this.exportBoxVisible = false | |
| 355 | + }) | |
| 356 | + }, | |
| 357 | + columnBtnsHandel(key, row) { | |
| 358 | + if (key === 'edit') { | |
| 359 | + this.addOrUpdateHandle(row.id) | |
| 360 | + } | |
| 361 | + if (key === 'detail') { | |
| 362 | + this.goDetail(row.id, row.flowState) | |
| 363 | + } | |
| 364 | + if (key == 'remove') { | |
| 365 | + this.handleDel(row.id) | |
| 366 | + } | |
| 367 | + }, | |
| 368 | + goDetail(id, flowState) { | |
| 369 | + if (this.config.webType == 3) { | |
| 370 | + let data = { | |
| 371 | + id, | |
| 372 | + enCode: this.config.flowEnCode, | |
| 373 | + flowId: this.config.flowId, | |
| 374 | + formType: 2, | |
| 375 | + type: 1, | |
| 376 | + opType: 0, | |
| 377 | + modelId: this.modelId, | |
| 378 | + isPreview: this.isPreview, | |
| 379 | + status: flowState | |
| 380 | + } | |
| 381 | + this.flowVisible = true | |
| 382 | + this.$nextTick(() => { | |
| 383 | + this.$refs.FlowBox.init(data) | |
| 384 | + }) | |
| 385 | + } else { | |
| 386 | + this.detailVisible = true | |
| 387 | + this.$nextTick(() => { | |
| 388 | + this.$refs.Detail.init(this.formData, this.modelId, id, this.columnData.useFormPermission) | |
| 389 | + }) | |
| 390 | + } | |
| 391 | + }, | |
| 392 | + sortChange({ column, prop, order }) { | |
| 393 | + this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc' | |
| 394 | + this.listQuery.sidx = !order ? '' : prop | |
| 395 | + this.initData() | |
| 396 | + }, | |
| 397 | + refresh(isRefresh) { | |
| 398 | + this.formVisible = false | |
| 399 | + if (isRefresh) this.initData() | |
| 400 | + }, | |
| 401 | + colseFlow(isRefresh) { | |
| 402 | + this.flowVisible = false | |
| 403 | + if (isRefresh) this.initData() | |
| 404 | + }, | |
| 405 | + reset() { | |
| 406 | + this.listQuery.sort = 'desc' | |
| 407 | + this.listQuery.sidx = '' | |
| 408 | + this.$refs.Search.reset() | |
| 409 | + }, | |
| 410 | + search(json) { | |
| 411 | + if (this.isPreview) return | |
| 412 | + if (!json) this.$refs.treeBox && this.$refs.treeBox.setCurrentKey(null); | |
| 413 | + this.listQuery.json = json | |
| 414 | + this.listQuery.currentPage = 1 | |
| 415 | + this.initData() | |
| 416 | + } | |
| 417 | + } | |
| 418 | +} | |
| 419 | +</script> | |
| 0 | 420 | \ No newline at end of file | ... | ... |
src/views/baseSpecialhandle/index.vue
| 1 | 1 | <template> |
| 2 | - <div class="baseSpecialAction item-box common-info-box"> | |
| 3 | - <div class="item-title">专项行动处理</div> | |
| 4 | - <div class="item-body"> | |
| 5 | - <div class="NCC-common-layout"> | |
| 6 | - <div class="NCC-common-layout-center"> | |
| 7 | - <el-row class="NCC-common-search-box" :gutter="16"> | |
| 8 | - <el-form @submit.native.prevent size="mini"> | |
| 9 | - <el-col :span="6"> | |
| 10 | - <el-form-item label=""> | |
| 11 | - <el-input v-model="query.title" placeholder="标题" clearable/> | |
| 12 | - </el-form-item> | |
| 13 | - </el-col> | |
| 14 | - <el-col :span="6"> | |
| 15 | - <el-form-item label=""> | |
| 16 | - <el-select v-model="query.state" placeholder="请选择状态" clearable> | |
| 17 | - <el-option label="已填写" value="已填写"></el-option> | |
| 18 | - <el-option label="未填写" value="未填写"></el-option> | |
| 19 | - </el-select> | |
| 20 | - </el-form-item> | |
| 21 | - </el-col> | |
| 22 | - <el-col :span="6"> | |
| 23 | - <el-form-item> | |
| 24 | - <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | |
| 25 | - <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | |
| 26 | - </el-form-item> | |
| 27 | - </el-col> | |
| 28 | - </el-form> | |
| 29 | - <div class="NCC-common-search-box-right"> | |
| 30 | - <el-button type="primary" icon="el-icon-download" size="mini" @click="exportData()">导出</el-button> | |
| 31 | - </div> | |
| 32 | - </el-row> | |
| 33 | - <div class="NCC-common-layout-main NCC-flex-main"> | |
| 34 | - <NCC-table v-loading="listLoading" :data="list"> | |
| 35 | - <el-table-column prop="id" label="主键" align="left" show-overflow-tooltip/> | |
| 36 | - <el-table-column prop="title" label="标题" align="left" show-overflow-tooltip/> | |
| 37 | - <el-table-column prop="state" label="状态" align="left" show-overflow-tooltip/> | |
| 38 | - <el-table-column prop="deadline" label="截止日期" align="left" :formatter="ncc.tableDateFormat" show-overflow-tooltip/> | |
| 39 | - <el-table-column label="操作" fixed="right" width="130"> | |
| 40 | - <template slot-scope="scope"> | |
| 41 | - <el-button type="text" @click="toFillForm(scope.row)">处理</el-button> | |
| 42 | - </template> | |
| 43 | - </el-table-column> | |
| 44 | - </NCC-table> | |
| 45 | - <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/> | |
| 2 | + <div class="baseSpecialAction item-box common-info-box"> | |
| 3 | + <div class="item-title">专项行动处理</div> | |
| 4 | + <div class="item-body"> | |
| 5 | + <div class="NCC-common-layout"> | |
| 6 | + <div class="NCC-common-layout-center"> | |
| 7 | + <el-row class="NCC-common-search-box" :gutter="16"> | |
| 8 | + <el-form @submit.native.prevent size="mini"> | |
| 9 | + <el-col :span="6"> | |
| 10 | + <el-form-item label=""> | |
| 11 | + <el-input v-model="query.title" placeholder="标题" clearable /> | |
| 12 | + </el-form-item> | |
| 13 | + </el-col> | |
| 14 | + <el-col :span="6"> | |
| 15 | + <el-form-item label=""> | |
| 16 | + <el-select v-model="query.state" placeholder="请选择状态" clearable> | |
| 17 | + <el-option label="已填写" value="已填写"></el-option> | |
| 18 | + <el-option label="未填写" value="未填写"></el-option> | |
| 19 | + </el-select> | |
| 20 | + </el-form-item> | |
| 21 | + </el-col> | |
| 22 | + <el-col :span="6"> | |
| 23 | + <el-form-item> | |
| 24 | + <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | |
| 25 | + <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | |
| 26 | + </el-form-item> | |
| 27 | + </el-col> | |
| 28 | + </el-form> | |
| 29 | + <div class="NCC-common-search-box-right"> | |
| 30 | + <el-button type="primary" icon="el-icon-download" size="mini" @click="exportData()">导出</el-button> | |
| 46 | 31 | </div> |
| 32 | + </el-row> | |
| 33 | + <div class="NCC-common-layout-main NCC-flex-main"> | |
| 34 | + <NCC-table v-loading="listLoading" :data="list"> | |
| 35 | + <el-table-column prop="id" label="主键" align="left" show-overflow-tooltip /> | |
| 36 | + <el-table-column prop="title" label="标题" align="left" show-overflow-tooltip /> | |
| 37 | + <el-table-column prop="state" label="状态" align="left" show-overflow-tooltip /> | |
| 38 | + <el-table-column prop="deadline" label="截止日期" align="left" :formatter="ncc.tableDateFormat" | |
| 39 | + show-overflow-tooltip /> | |
| 40 | + <el-table-column label="操作" fixed="right" width="130"> | |
| 41 | + <template slot-scope="scope"> | |
| 42 | + <el-button type="text" @click="toFillForm(scope.row)">处理</el-button> | |
| 43 | + </template> | |
| 44 | + </el-table-column> | |
| 45 | + </NCC-table> | |
| 46 | + <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" | |
| 47 | + @pagination="initData" /> | |
| 47 | 48 | </div> |
| 48 | 49 | </div> |
| 49 | 50 | </div> |
| 50 | - <el-dialog title="专项行动处理" :visible.sync="dialogVisible" fullscreen :modal="false"> | |
| 51 | + </div> | |
| 52 | + <NCCForm v-show="dialogVisible" ref="NCCForm" @refresh="refresh" /> | |
| 53 | + <!-- <el-dialog title="专项行动处理" :visible.sync="dialogVisible" fullscreen :modal="false"> | |
| 51 | 54 | <iframe |
| 52 | 55 | :src="nestedPageUrl" |
| 53 | 56 | width="100%" |
| ... | ... | @@ -55,148 +58,162 @@ |
| 55 | 58 | frameborder="0" |
| 56 | 59 | allowfullscreen> |
| 57 | 60 | </iframe> |
| 58 | - </el-dialog> | |
| 59 | - </div> | |
| 60 | - </template> | |
| 61 | - <script> | |
| 62 | - import request from "@/utils/request"; | |
| 63 | - export default { | |
| 64 | - components: { }, | |
| 65 | - data() { | |
| 66 | - return { | |
| 67 | - query: { | |
| 68 | - title: undefined, | |
| 69 | - state: undefined, | |
| 70 | - }, | |
| 71 | - list: [], | |
| 72 | - listLoading: false, | |
| 73 | - total: 0, | |
| 74 | - listQuery: { | |
| 75 | - currentPage: 1, | |
| 76 | - pageSize: 20, | |
| 77 | - sort: "desc", | |
| 78 | - sidx: "", | |
| 79 | - }, | |
| 80 | - communicationAreaOptions: [], | |
| 81 | - communicationOutOptions: [], | |
| 82 | - dialogVisible: false, | |
| 83 | - nestedPageUrl: '', | |
| 84 | - viewportHeight: 0, | |
| 85 | - }; | |
| 86 | - }, | |
| 87 | - created() { | |
| 88 | - this.updateViewportHeight(); | |
| 89 | - this.initData() | |
| 90 | - // 监听窗口大小变化事件 | |
| 91 | - window.addEventListener('resize', this.updateViewportHeight); | |
| 92 | - }, | |
| 93 | - beforeDestroy() { | |
| 94 | - // 移除窗口大小变化事件监听器 | |
| 95 | - window.removeEventListener('resize', this.updateViewportHeight); | |
| 96 | - }, | |
| 97 | - computed: { | |
| 98 | - isSHILevel() { | |
| 99 | - // 判断角色是否为‘市级办公室’ | |
| 100 | - return this.$store.state.user.islader; | |
| 101 | - }, | |
| 61 | + </el-dialog> --> | |
| 62 | + </div> | |
| 63 | +</template> | |
| 64 | +<script> | |
| 65 | +import NCCForm from '@/views/baseSpecialAction/dynamicModel/list/Form' | |
| 66 | +import request from "@/utils/request"; | |
| 67 | +export default { | |
| 68 | + components: { NCCForm }, | |
| 69 | + data() { | |
| 70 | + return { | |
| 71 | + query: { | |
| 72 | + title: undefined, | |
| 73 | + state: undefined, | |
| 102 | 74 | }, |
| 103 | - methods: { | |
| 104 | - updateViewportHeight() { | |
| 105 | - // 获取页面显示高度 | |
| 106 | - this.viewportHeight = window.innerHeight || document.documentElement.clientHeight; | |
| 75 | + list: [], | |
| 76 | + listLoading: false, | |
| 77 | + total: 0, | |
| 78 | + listQuery: { | |
| 79 | + currentPage: 1, | |
| 80 | + pageSize: 20, | |
| 81 | + sort: "desc", | |
| 82 | + sidx: "", | |
| 107 | 83 | }, |
| 108 | - initData() { | |
| 109 | - this.listLoading = true; | |
| 110 | - let _query = { | |
| 111 | - ...this.listQuery, | |
| 112 | - ...this.query, | |
| 113 | - }; | |
| 114 | - let query = {}; | |
| 115 | - for (let key in _query) { | |
| 116 | - if (Array.isArray(_query[key])) { | |
| 117 | - query[key] = _query[key].join(); | |
| 118 | - } else { | |
| 119 | - query[key] = _query[key]; | |
| 120 | - } | |
| 84 | + communicationAreaOptions: [], | |
| 85 | + communicationOutOptions: [], | |
| 86 | + dialogVisible: false, | |
| 87 | + nestedPageUrl: '', | |
| 88 | + viewportHeight: 0, | |
| 89 | + }; | |
| 90 | + }, | |
| 91 | + created() { | |
| 92 | + this.updateViewportHeight(); | |
| 93 | + this.initData() | |
| 94 | + // 监听窗口大小变化事件 | |
| 95 | + window.addEventListener('resize', this.updateViewportHeight); | |
| 96 | + }, | |
| 97 | + beforeDestroy() { | |
| 98 | + // 移除窗口大小变化事件监听器 | |
| 99 | + window.removeEventListener('resize', this.updateViewportHeight); | |
| 100 | + }, | |
| 101 | + computed: { | |
| 102 | + isSHILevel() { | |
| 103 | + // 判断角色是否为‘市级办公室’ | |
| 104 | + return this.$store.state.user.islader; | |
| 105 | + }, | |
| 106 | + }, | |
| 107 | + methods: { | |
| 108 | + updateViewportHeight() { | |
| 109 | + // 获取页面显示高度 | |
| 110 | + this.viewportHeight = window.innerHeight || document.documentElement.clientHeight; | |
| 111 | + }, | |
| 112 | + initData() { | |
| 113 | + this.listLoading = true; | |
| 114 | + let _query = { | |
| 115 | + ...this.listQuery, | |
| 116 | + ...this.query, | |
| 117 | + }; | |
| 118 | + let query = {}; | |
| 119 | + for (let key in _query) { | |
| 120 | + if (Array.isArray(_query[key])) { | |
| 121 | + query[key] = _query[key].join(); | |
| 122 | + } else { | |
| 123 | + query[key] = _query[key]; | |
| 121 | 124 | } |
| 122 | - request({ | |
| 123 | - url: '/Extend/BaseSpecialAction/getCurrentUserSpecialAction', | |
| 124 | - method: "GET", | |
| 125 | - params: query, | |
| 126 | - }).then((res) => { | |
| 127 | - this.list = res.data.list; | |
| 128 | - this.total = res.data.pagination.total; | |
| 129 | - this.listLoading = false; | |
| 130 | - }); | |
| 131 | - }, | |
| 132 | - toFillForm(row) { | |
| 133 | - this.dialogVisible = true; | |
| 134 | - this.nestedPageUrl = `http://8.130.38.56:8043/old/#/previewModel?isPreview=1&id=${row.originId}`; | |
| 135 | - request({ | |
| 136 | - url: '/visualdev/Base', | |
| 137 | - method: "GET", | |
| 138 | - data: {type: 1}, | |
| 139 | - }).then((res) => { | |
| 140 | - this.BaseList = res.data.list[0].children.find(v => v.category == row.originId); | |
| 125 | + } | |
| 126 | + request({ | |
| 127 | + url: '/Extend/BaseSpecialAction/getCurrentUserSpecialAction', | |
| 128 | + method: "GET", | |
| 129 | + params: query, | |
| 130 | + }).then((res) => { | |
| 131 | + this.list = res.data.list; | |
| 132 | + this.total = res.data.pagination.total; | |
| 133 | + this.listLoading = false; | |
| 134 | + }); | |
| 135 | + }, | |
| 136 | + toFillForm(row) { | |
| 137 | + this.dialogVisible = true; | |
| 138 | + var Itemid= "";//数据id,没有的话就是新增 ,有的话就是修改 | |
| 139 | + var modelId= "585804670891459845";//关联的表单id | |
| 140 | + var isPreview = false;//固定死,值不变 | |
| 141 | + var useFormPermission = false;//固定死,值不变 | |
| 142 | + var formData = []; | |
| 143 | + request({ | |
| 144 | + url: '/visualdev/OnlineDev/585804670891459845/Config', | |
| 145 | + method: "GET", | |
| 146 | + params:null | |
| 147 | + }).then(res => { | |
| 148 | + formData = res.data.formData; | |
| 149 | + this.$refs.NCCForm.init(formData, modelId, Itemid, isPreview, useFormPermission) | |
| 150 | + }); | |
| 151 | + | |
| 152 | + // this.nestedPageUrl = `http://8.130.38.56:8043/old/#/previewModel?isPreview=1&id=${row.originId}`; | |
| 153 | + // request({ | |
| 154 | + // url: '/visualdev/Base', | |
| 155 | + // method: "GET", | |
| 156 | + // data: {type: 1}, | |
| 157 | + // }).then((res) => { | |
| 158 | + // this.BaseList = res.data.list[0].children.find(v => v.category == row.originId); | |
| 141 | 159 | |
| 142 | - res.data. | |
| 143 | - console.log(res); | |
| 144 | - }); | |
| 145 | - }, | |
| 160 | + // res.data. | |
| 161 | + // console.log(res); | |
| 162 | + // }); | |
| 163 | + }, | |
| 146 | 164 | |
| 147 | - exportData() { | |
| 148 | - this.exportBoxVisible = true; | |
| 149 | - this.$nextTick(() => { | |
| 150 | - this.$refs.ExportBox.init(this.list); | |
| 151 | - }); | |
| 152 | - }, | |
| 153 | - download(data) { | |
| 154 | - let query = { ...data, ...this.listQuery, ...this.query }; | |
| 155 | - request({ | |
| 156 | - url: `/Extend/BaseSpecialAction/Actions/Export`, | |
| 157 | - method: "GET", | |
| 158 | - data: query, | |
| 159 | - }).then((res) => { | |
| 160 | - if (!res.data.url) return; | |
| 161 | - window.location.href = this.define.comUrl + res.data.url; | |
| 162 | - this.$refs.ExportBox.visible = false; | |
| 163 | - this.exportBoxVisible = false; | |
| 164 | - }); | |
| 165 | - }, | |
| 166 | - search() { | |
| 167 | - this.listQuery = { | |
| 168 | - currentPage: 1, | |
| 169 | - pageSize: 20, | |
| 170 | - sort: "desc", | |
| 171 | - sidx: "", | |
| 172 | - }; | |
| 173 | - this.initData(); | |
| 174 | - }, | |
| 175 | - refresh(isrRefresh) { | |
| 176 | - this.formVisible = false; | |
| 177 | - if (isrRefresh) this.reset(); | |
| 178 | - }, | |
| 179 | - reset() { | |
| 180 | - for (let key in this.query) { | |
| 181 | - this.query[key] = undefined; | |
| 182 | - } | |
| 183 | - this.listQuery = { | |
| 184 | - currentPage: 1, | |
| 185 | - pageSize: 20, | |
| 186 | - sort: "desc", | |
| 187 | - sidx: "", | |
| 188 | - }; | |
| 189 | - this.initData(); | |
| 190 | - }, | |
| 165 | + exportData() { | |
| 166 | + this.exportBoxVisible = true; | |
| 167 | + this.$nextTick(() => { | |
| 168 | + this.$refs.ExportBox.init(this.list); | |
| 169 | + }); | |
| 170 | + }, | |
| 171 | + download(data) { | |
| 172 | + let query = { ...data, ...this.listQuery, ...this.query }; | |
| 173 | + request({ | |
| 174 | + url: `/Extend/BaseSpecialAction/Actions/Export`, | |
| 175 | + method: "GET", | |
| 176 | + data: query, | |
| 177 | + }).then((res) => { | |
| 178 | + if (!res.data.url) return; | |
| 179 | + window.location.href = this.define.comUrl + res.data.url; | |
| 180 | + this.$refs.ExportBox.visible = false; | |
| 181 | + this.exportBoxVisible = false; | |
| 182 | + }); | |
| 183 | + }, | |
| 184 | + search() { | |
| 185 | + this.listQuery = { | |
| 186 | + currentPage: 1, | |
| 187 | + pageSize: 20, | |
| 188 | + sort: "desc", | |
| 189 | + sidx: "", | |
| 190 | + }; | |
| 191 | + this.initData(); | |
| 192 | + }, | |
| 193 | + refresh(isrRefresh) { | |
| 194 | + this.formVisible = false; | |
| 195 | + if (isrRefresh) this.reset(); | |
| 196 | + }, | |
| 197 | + reset() { | |
| 198 | + for (let key in this.query) { | |
| 199 | + this.query[key] = undefined; | |
| 200 | + } | |
| 201 | + this.listQuery = { | |
| 202 | + currentPage: 1, | |
| 203 | + pageSize: 20, | |
| 204 | + sort: "desc", | |
| 205 | + sidx: "", | |
| 206 | + }; | |
| 207 | + this.initData(); | |
| 191 | 208 | }, |
| 192 | - }; | |
| 193 | - </script> | |
| 194 | - <style scoped lang="scss"> | |
| 195 | - .common-info-box { | |
| 196 | - :deep(.el-table__body-wrapper.is-scrolling-none) { | |
| 197 | - height: calc(100% - 47px); | |
| 198 | - overflow-y: scroll; | |
| 199 | - } | |
| 209 | + }, | |
| 210 | +}; | |
| 211 | +</script> | |
| 212 | +<style scoped lang="scss"> | |
| 213 | +.common-info-box { | |
| 214 | + :deep(.el-table__body-wrapper.is-scrolling-none) { | |
| 215 | + height: calc(100% - 47px); | |
| 216 | + overflow-y: scroll; | |
| 200 | 217 | } |
| 201 | - </style> | |
| 202 | - | |
| 203 | 218 | \ No newline at end of file |
| 219 | +} | |
| 220 | +</style> | |
| 204 | 221 | \ No newline at end of file | ... | ... |