|
@@ -8,6 +8,7 @@
|
|
<span style="float:right;">
|
|
<span style="float:right;">
|
|
<!-- <el-link type="primary" :underline="false" v-if="list.length
|
|
<!-- <el-link type="primary" :underline="false" v-if="list.length
|
|
> 0"><i class="el-icon-setting"></i><span style="margin-right:5px;" @click="templatedialingClick('设为模板')">设为模板</span></el-link> -->
|
|
> 0"><i class="el-icon-setting"></i><span style="margin-right:5px;" @click="templatedialingClick('设为模板')">设为模板</span></el-link> -->
|
|
|
|
+ <el-link type="primary" :underline="false" @click="defaultTemplate" v-if="permissions.projectEditDefaultFolder"><i class="el-icon-folder-add"></i><span style="margin-left:5px;">默认文件夹</span></el-link>
|
|
<el-link type="primary" :underline="false" @click="createFolder"><i class="el-icon-folder-add"></i><span style="margin-left:5px;">{{ $t('createafolder') }}</span></el-link>
|
|
<el-link type="primary" :underline="false" @click="createFolder"><i class="el-icon-folder-add"></i><span style="margin-left:5px;">{{ $t('createafolder') }}</span></el-link>
|
|
<el-upload ref="upload" action="#" :http-request="uploadFile" :show-file-list="false" :limit="1" style="display:inline-block;">
|
|
<el-upload ref="upload" action="#" :http-request="uploadFile" :show-file-list="false" :limit="1" style="display:inline-block;">
|
|
<el-link type="primary" :underline="false" style="margin-left:10px;"><i class="iconfont firerock-iconshangchuan"></i><span style="margin-left:5px;">{{ $t('fileupload') }}</span></el-link>
|
|
<el-link type="primary" :underline="false" style="margin-left:10px;"><i class="iconfont firerock-iconshangchuan"></i><span style="margin-left:5px;">{{ $t('fileupload') }}</span></el-link>
|
|
@@ -155,40 +156,29 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 设为模板 -->
|
|
<!-- 设为模板 -->
|
|
- <el-dialog :title="'编辑模板'" v-if="templatedialing" :visible.sync="templatedialing" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
|
|
|
+ <el-dialog :title="'编辑默认模板'" v-if="templatedialing" :visible.sync="templatedialing" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
<div>
|
|
<div>
|
|
- <el-form :model="templateForm" ref="templateForm" label-width="80px">
|
|
|
|
- <el-form-item label="模板名称" prop="name" :rules="[
|
|
|
|
- { required: true, message: '请输入模板名称'}
|
|
|
|
- ]">
|
|
|
|
- <el-input v-model="templateForm.name" :placeholder="'请输入模板名称'" maxlength="25" show-word-limit clearable ></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-checkbox v-model="templateForm.creWithPro">随项目自动创建</el-checkbox>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
-
|
|
|
|
- <div class="fileCenter">文件中心结构</div>
|
|
|
|
<div class="filrTree">
|
|
<div class="filrTree">
|
|
<el-tree
|
|
<el-tree
|
|
:data="templateDataTree"
|
|
:data="templateDataTree"
|
|
node-key="id"
|
|
node-key="id"
|
|
- default-expand-all
|
|
|
|
:expand-on-click-node="false">
|
|
:expand-on-click-node="false">
|
|
<span class="custom-tree-node tree_node" slot-scope="{ node, data }">
|
|
<span class="custom-tree-node tree_node" slot-scope="{ node, data }">
|
|
<span>{{ node.label }}</span>
|
|
<span>{{ node.label }}</span>
|
|
<span class="tree_node_btn">
|
|
<span class="tree_node_btn">
|
|
- <i class="el-icon-circle-plus-outline" @click="addtemplateNodeDailoing = true, excessiveNodeData = data, nodeForm.name = ''"></i>
|
|
|
|
- <i class="el-icon-delete" style="margin-left: 20px" @click="removeNode(node, data)"></i>
|
|
|
|
|
|
+ <i class="el-icon-edit" @click="editNode(data)"></i>
|
|
|
|
+ <i class="el-icon-circle-plus-outline" style="margin-left: 10px" @click="newNode(data)"></i>
|
|
|
|
+ <i class="el-icon-delete" style="margin-left: 10px" @click="removeNode(node, data)"></i>
|
|
</span>
|
|
</span>
|
|
</span>
|
|
</span>
|
|
- </el-tree>
|
|
|
|
|
|
+ </el-tree>
|
|
|
|
+ <div class="treeAdd">
|
|
|
|
+ <i class="el-icon-circle-plus-outline" @click="newNode()"></i>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <!-- <el-button v-if="templateFlg" type="primary" style="width:100%;" :loading="templateDataTreeDaylong" @click="addTemplate('templateForm')">{{ $t('save') }}</el-button>
|
|
|
|
- <el-button v-if="!templateFlg" type="primary" style="width:100%;" :loading="templateDataTreeDaylong" @click="uploadTemplate('templateForm')">{{ $t('save') }}</el-button> -->
|
|
|
|
<el-button type="primary" style="width:100%;" :loading="templateDataTreeDaylong" @click="addTemplate('templateForm')">{{ $t('save') }}</el-button>
|
|
<el-button type="primary" style="width:100%;" :loading="templateDataTreeDaylong" @click="addTemplate('templateForm')">{{ $t('save') }}</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -210,6 +200,41 @@
|
|
<el-button type="primary" style="width:100%;" @click="addtemplateNode('nodeForm')">确定</el-button>
|
|
<el-button type="primary" style="width:100%;" @click="addtemplateNode('nodeForm')">确定</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <!-- 点击第一级的节点 -->
|
|
|
|
+ <el-dialog :title="'新增节点'" v-if="addtemplateTwoNodeDailoing" :visible.sync="addtemplateTwoNodeDailoing" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
|
+ <div>
|
|
|
|
+ <el-form :model="nodeForm" ref="nodeForms" label-width="100px" class="demo-ruleForm">
|
|
|
|
+ <el-form-item label="节点名称" prop="name"
|
|
|
|
+ :rules="[
|
|
|
|
+ { required: true, message: '请输入节点名称'}
|
|
|
|
+ ]"
|
|
|
|
+ >
|
|
|
|
+ <el-input v-model="nodeForm.name"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" style="width:100%;" @click="addtemplateTwoNode('nodeForms')">确定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <!-- 编辑节点的名称 -->
|
|
|
|
+ <el-dialog :title="'新增节点'" v-if="addtemplateNodeNameDailoing" :visible.sync="addtemplateNodeNameDailoing" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
|
+ <div>
|
|
|
|
+ <el-form :model="nodeForm" ref="nodeFormss" label-width="100px" class="demo-ruleForm">
|
|
|
|
+ <el-form-item label="节点名称" prop="name"
|
|
|
|
+ :rules="[
|
|
|
|
+ { required: true, message: '请输入节点名称'}
|
|
|
|
+ ]"
|
|
|
|
+ >
|
|
|
|
+ <el-input v-model="nodeForm.name"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" style="width:100%;" @click="editTemplateNodeName('nodeFormss')">确定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
</template>
|
|
</template>
|
|
@@ -284,6 +309,10 @@
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
}
|
|
}
|
|
|
|
+.treeAdd {
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<script>
|
|
<script>
|
|
import util from "../../common/js/util";
|
|
import util from "../../common/js/util";
|
|
@@ -307,6 +336,7 @@
|
|
upLoading:false,
|
|
upLoading:false,
|
|
keyword:null,
|
|
keyword:null,
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
|
+ permissions: JSON.parse(sessionStorage.getItem("permissions")),
|
|
recentFiles: [],
|
|
recentFiles: [],
|
|
addFormVisible: false,
|
|
addFormVisible: false,
|
|
addLoading: false,
|
|
addLoading: false,
|
|
@@ -331,7 +361,9 @@
|
|
templateList: [],
|
|
templateList: [],
|
|
templateFlg: false,
|
|
templateFlg: false,
|
|
templateIndex: '0',
|
|
templateIndex: '0',
|
|
- addFolderDialogTwo: false
|
|
|
|
|
|
+ addFolderDialogTwo: false,
|
|
|
|
+ addtemplateTwoNodeDailoing: false,
|
|
|
|
+ addtemplateNodeNameDailoing: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -359,13 +391,28 @@
|
|
this.templateIndex = index
|
|
this.templateIndex = index
|
|
},
|
|
},
|
|
editTemplate(data) {
|
|
editTemplate(data) {
|
|
- this.templateForm.name = data.name
|
|
|
|
- this.templateForm.creWithPro = data.creWithPro ? true : false
|
|
|
|
|
|
+ console.log('触发')
|
|
|
|
+ // this.templateForm.name = data.name
|
|
|
|
+ // this.templateForm.creWithPro = data.creWithPro ? true : false
|
|
this.templateForm.id = data.id
|
|
this.templateForm.id = data.id
|
|
this.templateDataTree = data.proDocumentTemDetailList
|
|
this.templateDataTree = data.proDocumentTemDetailList
|
|
- this.templateFlg = false
|
|
|
|
|
|
+ // this.templateFlg = false
|
|
this.templatedialing = true
|
|
this.templatedialing = true
|
|
},
|
|
},
|
|
|
|
+ newNode(data) {
|
|
|
|
+ if(data) {
|
|
|
|
+ this.excessiveNodeData = data
|
|
|
|
+ this.addtemplateNodeDailoing = true
|
|
|
|
+ } else {
|
|
|
|
+ this.addtemplateTwoNodeDailoing = true
|
|
|
|
+ }
|
|
|
|
+ this.nodeForm.name = ''
|
|
|
|
+ },
|
|
|
|
+ editNode(data) {
|
|
|
|
+ this.excessiveNodeData = data
|
|
|
|
+ this.addtemplateNodeNameDailoing = true
|
|
|
|
+ this.nodeForm.name = data.label
|
|
|
|
+ },
|
|
removeTemplate(data) {
|
|
removeTemplate(data) {
|
|
this.$confirm(`确定删除【${data.name}】模板吗?`, '提示', {
|
|
this.$confirm(`确定删除【${data.name}】模板吗?`, '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -417,55 +464,43 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- addTemplate(formName) {
|
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- let obj = {}
|
|
|
|
- if(this.templateFlg) {
|
|
|
|
- obj = {
|
|
|
|
- documentString: JSON.stringify(this.templateDataTree),
|
|
|
|
- name: this.templateForm.name,
|
|
|
|
- creWithPro: this.templateForm.creWithPro ? '1' : '0',
|
|
|
|
- companyId: this.user.companyId
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- obj = {
|
|
|
|
- documentString: JSON.stringify(this.templateDataTree),
|
|
|
|
- name: this.templateForm.name,
|
|
|
|
- creWithPro: this.templateForm.creWithPro ? '1' : '0',
|
|
|
|
- id: this.templateForm.id,
|
|
|
|
- companyId: this.user.companyId
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.templateDataTreeDaylong = true
|
|
|
|
- // this.http.post('/project-document-template/addTemplate', {
|
|
|
|
- this.http.post('/project-document-template/addTemplate', obj,
|
|
|
|
- res => {
|
|
|
|
- this.templateDataTreeDaylong = false
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- this.$message({
|
|
|
|
- message: `(${this.templateForm.name}) 模板添加成功,可在创建文件夹中查看`,
|
|
|
|
- type: 'success'
|
|
|
|
- });
|
|
|
|
- this.templatedialing = false
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: 'error'
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }, error => {
|
|
|
|
- this.templateDataTreeDaylong = false
|
|
|
|
- this.$message({
|
|
|
|
- message: error,
|
|
|
|
- type: 'error'
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
|
|
+ addTemplate() {
|
|
|
|
+ let obj = {}
|
|
|
|
+ if(this.templateFlg) {
|
|
|
|
+ obj = {
|
|
|
|
+ documentString: JSON.stringify(this.templateDataTree),
|
|
|
|
+ companyId: this.user.companyId
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ obj = {
|
|
|
|
+ documentString: JSON.stringify(this.templateDataTree),
|
|
|
|
+ id: this.templateForm.id,
|
|
|
|
+ companyId: this.user.companyId
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.templateDataTreeDaylong = true
|
|
|
|
+ this.http.post('/project-document-template/addTemplate', obj,
|
|
|
|
+ res => {
|
|
|
|
+ this.templateDataTreeDaylong = false
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `操作成功`,
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ this.templatedialing = false
|
|
} else {
|
|
} else {
|
|
- console.log('error submit!!');
|
|
|
|
- return false;
|
|
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: 'error'
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ }, error => {
|
|
|
|
+ this.templateDataTreeDaylong = false
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: 'error'
|
|
|
|
+ });
|
|
|
|
+ })
|
|
},
|
|
},
|
|
addtemplateNode(formName) {
|
|
addtemplateNode(formName) {
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
@@ -484,6 +519,37 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ addtemplateTwoNode(formName) {
|
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ let obj = {
|
|
|
|
+ children: [],
|
|
|
|
+ id: new Date().getTime()/ 1000,
|
|
|
|
+ label: this.nodeForm.name
|
|
|
|
+ }
|
|
|
|
+ this.templateDataTree.push(obj)
|
|
|
|
+ this.addtemplateTwoNodeDailoing = false
|
|
|
|
+ } else {
|
|
|
|
+ console.log('error submit!!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ editTemplateNodeName(formName) {
|
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ console.log('excessiveNodeData',this.excessiveNodeData)
|
|
|
|
+ let data = this.excessiveNodeData
|
|
|
|
+ data.label = this.nodeForm.name
|
|
|
|
+ data.name = this.nodeForm.name
|
|
|
|
+ this.addtemplateNodeNameDailoing = false
|
|
|
|
+ } else {
|
|
|
|
+ console.log('error submit!!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
removeNode(node, data) {
|
|
removeNode(node, data) {
|
|
this.$confirm(`确定删除(${data.label})节点?`, '提示', {
|
|
this.$confirm(`确定删除(${data.label})节点?`, '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -649,6 +715,9 @@
|
|
this.addFolderDialogTwo = false
|
|
this.addFolderDialogTwo = false
|
|
this.folderForm = {projectId: this.curProjectId, folderId: this.parentFid,isFolder: 1};
|
|
this.folderForm = {projectId: this.curProjectId, folderId: this.parentFid,isFolder: 1};
|
|
this.activeName = 'one'
|
|
this.activeName = 'one'
|
|
|
|
+ // this.getTemplateList()
|
|
|
|
+ },
|
|
|
|
+ defaultTemplate() {
|
|
this.getTemplateList()
|
|
this.getTemplateList()
|
|
},
|
|
},
|
|
getTemplateList() {
|
|
getTemplateList() {
|
|
@@ -656,6 +725,7 @@
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.templateList = res.data
|
|
this.templateList = res.data
|
|
|
|
+ this.editTemplate(res.data[0])
|
|
} else {
|
|
} else {
|
|
this.$message({message: res.msg,type: 'error'});
|
|
this.$message({message: res.msg,type: 'error'});
|
|
}
|
|
}
|