串联同功能
This commit is contained in:
@ -95,7 +95,7 @@ public class SysContractController extends BaseController {
|
||||
public AjaxResult getfile(@PathVariable long id) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
SysContract contract = sysContractService.selectSysContractById(id);
|
||||
if (contract.getPath() != null && !contract.getPath().equals("")) {
|
||||
if (contract.getStatus() == 1) {
|
||||
ajax.put("url", contract.getPath());
|
||||
} else {
|
||||
Map<String, String> data = new HashMap<>();
|
||||
|
@ -60,6 +60,7 @@ public class SysContractServiceImpl implements ISysContractService {
|
||||
public int insertSysContract(SysContract sysContract) {
|
||||
sysContract.setId(DateUtils.getNowDate().getTime());
|
||||
sysContract.setCreateTime(DateUtils.getNowDate());
|
||||
sysContract.setPath("/file/contract/" + sysContract.getId());
|
||||
return sysContractMapper.insertSysContract(sysContract);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"axios": "0.18.1",
|
||||
"base-64": "^1.0.0",
|
||||
"clipboard": "2.0.4",
|
||||
"clipboard": "^2.0.6",
|
||||
"core-js": "3.6.5",
|
||||
"dayjs": "^1.9.1",
|
||||
"echarts": "4.2.1",
|
||||
|
@ -94,7 +94,13 @@
|
||||
<el-table-column label="电话" align="center" prop="phone"/>
|
||||
<el-table-column label="服务时间" align="center" prop="serveTime" :formatter="serveTimeFormat"/>
|
||||
<el-table-column label="金额" align="center" prop="amount"/>
|
||||
<el-table-column label="合同地址" align="center" prop="path"/>
|
||||
<el-table-column label="合同地址" align="center" prop="path">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-copy-document" @click="handleCopy(scope.row.path)" class="copyBtn"
|
||||
:data-clipboard-text="copyValue">复制
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
@ -172,6 +178,8 @@
|
||||
updateContract
|
||||
} from "@/api/custom/contract";
|
||||
|
||||
import Clipboard from 'clipboard';
|
||||
|
||||
export default {
|
||||
name: "Contract",
|
||||
data() {
|
||||
@ -196,6 +204,8 @@
|
||||
open: false,
|
||||
// 服务时间字典
|
||||
serveTimeOptions: [],
|
||||
//
|
||||
copyValue: '',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -340,6 +350,16 @@
|
||||
this.download(response.msg);
|
||||
}).catch(function () {
|
||||
});
|
||||
},
|
||||
handleCopy(path) {
|
||||
this.copyValue = window.location.origin + path;
|
||||
const btnCopy = new Clipboard('.copyBtn');
|
||||
// btnCopy.destroy();
|
||||
this.$message({
|
||||
message: '拷贝成功',
|
||||
type: 'success'
|
||||
});
|
||||
// console.log(this.copyValue);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user