|
@@ -0,0 +1,185 @@
|
|
|
|
|
+<!-- 用户编辑弹窗 -->
|
|
|
|
|
+<template>
|
|
|
|
|
+ <ele-modal
|
|
|
|
|
+ width="500px"
|
|
|
|
|
+ :visible.sync="showEditFlag"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ custom-class="ele-dialog-form"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ @close="cancel"
|
|
|
|
|
+ :title="title"
|
|
|
|
|
+ ref="Emodal"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="82px">
|
|
|
|
|
+ <el-row :gutter="15">
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="编码" prop="code">
|
|
|
|
|
+ <el-input v-model="form.code" placeholder="请申请编码" disabled>
|
|
|
|
|
+ </el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="文档类型" prop="type">
|
|
|
|
|
+ <DictSelection
|
|
|
|
|
+ dictName="文档类型"
|
|
|
|
|
+ v-model="form.type"
|
|
|
|
|
+ :disabled="true"
|
|
|
|
|
+ ></DictSelection>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="文档名称" prop="name">
|
|
|
|
|
+ <el-input v-model="form.name" disabled></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="目标位置" prop="directoryId">
|
|
|
|
|
+ <el-cascader
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ v-model="form.directoryId"
|
|
|
|
|
+ :options="folderList"
|
|
|
|
|
+ :props="{
|
|
|
|
|
+ value: 'id',
|
|
|
|
|
+ label: 'name',
|
|
|
|
|
+ children: 'sonDirectoryList',
|
|
|
|
|
+ emitPath: false,
|
|
|
|
|
+ checkStrictly: true
|
|
|
|
|
+ }"
|
|
|
|
|
+ ></el-cascader>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template v-slot:footer>
|
|
|
|
|
+ <el-button @click="cancel">取消</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ v-loading.fullscreen.lock="loading"
|
|
|
|
|
+ @click="save"
|
|
|
|
|
+ >
|
|
|
|
|
+ 确认
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ele-modal>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import {
|
|
|
|
|
+ fileUpdateAPI,
|
|
|
|
|
+ fileGetByIdAPI,
|
|
|
|
|
+ getDocTreeListAPI
|
|
|
|
|
+} from '@/api/doc-manage';
|
|
|
|
|
+import { setFolderList } from '../util.js';
|
|
|
|
|
+import { mapGetters } from 'vuex';
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ data() {
|
|
|
|
|
+ const defaultForm = {
|
|
|
|
|
+ name: '', //名称
|
|
|
|
|
+ type: '', //类型
|
|
|
|
|
+ sizeUnit: '', //大小,
|
|
|
|
|
+ unit: '', //单位
|
|
|
|
|
+ remark: '', //备注
|
|
|
|
|
+ status: '', //状态
|
|
|
|
|
+ storagePathId: '',
|
|
|
|
|
+ directoryId: '',
|
|
|
|
|
+ storagePath: [],
|
|
|
|
|
+ id: '',
|
|
|
|
|
+ secretLevel: 1
|
|
|
|
|
+
|
|
|
|
|
+ };
|
|
|
|
|
+ return {
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ directoryId: [{ required: true, message: '请选择', trigger: 'blur' }]
|
|
|
|
|
+ },
|
|
|
|
|
+ folderList: [],
|
|
|
|
|
+ defaultForm,
|
|
|
|
|
+ // 表单数据
|
|
|
|
|
+ form: { ...defaultForm },
|
|
|
|
|
+
|
|
|
|
|
+ // 提交状态
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ showEditFlag: false,
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ type: ''
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ // 是否开启响应式布局
|
|
|
|
|
+ styleResponsive() {
|
|
|
|
|
+ return this.$store.state.theme.styleResponsive;
|
|
|
|
|
+ },
|
|
|
|
|
+ ...mapGetters(['user'])
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ getDocTreeListAPI({
|
|
|
|
|
+ type: 0,
|
|
|
|
|
+ currentUserId: this.user.info.userId
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ this.folderList = res;
|
|
|
|
|
+ setFolderList(this.folderList); //权限过滤
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ async open(row) {
|
|
|
|
|
+ this.title = '移动文档';
|
|
|
|
|
+ this.showEditFlag = true;
|
|
|
|
|
+ this.form = await fileGetByIdAPI(row.id);
|
|
|
|
|
+ this.form.type = this.form.type + '';
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ /* 保存编辑 */
|
|
|
|
|
+ save() {
|
|
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
|
|
+ if (!valid) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.form.fileType = 0;
|
|
|
|
|
+
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ fileUpdateAPI(this.form)
|
|
|
|
|
+ .then(async (msg) => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ this.cancel();
|
|
|
|
|
+ this.$emit('done');
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ cancel() {
|
|
|
|
|
+ this.form = { ...this.defaultForm };
|
|
|
|
|
+ this.$refs.form.clearValidate();
|
|
|
|
|
+ this.showEditFlag = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+.aaa {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .upload-demo {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+
|
|
|
|
|
+ .el-upload--text {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+
|
|
|
|
|
+ button {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ background: #ffffff;
|
|
|
|
|
+ border: 1px solid #dbdbdb;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .el-upload-list {
|
|
|
|
|
+ transform: translate(10px, -39px);
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|