|
@@ -4,8 +4,10 @@ import { dict, UserPageQuery, AddReq, DelReq, EditReq, compute, CreateCrudOption
|
|
import { dictionary } from '/@/utils/dictionary';
|
|
import { dictionary } from '/@/utils/dictionary';
|
|
import { successMessage } from '/@/utils/message';
|
|
import { successMessage } from '/@/utils/message';
|
|
import { auth } from '/@/utils/authFunction';
|
|
import { auth } from '/@/utils/authFunction';
|
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
|
|
|
export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
|
|
|
+ const router = useRouter();
|
|
const pageRequest = async (query: UserPageQuery) => {
|
|
const pageRequest = async (query: UserPageQuery) => {
|
|
return await api.GetList(query);
|
|
return await api.GetList(query);
|
|
};
|
|
};
|
|
@@ -20,6 +22,16 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
return await api.AddObj(form);
|
|
return await api.AddObj(form);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const handleViewContract = (row: any) => {
|
|
|
|
+ router.push({
|
|
|
|
+ path: '/system/contract/preview',
|
|
|
|
+ query: {
|
|
|
|
+ file: row.contract_file,
|
|
|
|
+ contractName: row.contract_name
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
return {
|
|
return {
|
|
crudOptions: {
|
|
crudOptions: {
|
|
toolbar:{
|
|
toolbar:{
|
|
@@ -71,9 +83,18 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
width: 200,
|
|
width: 200,
|
|
buttons: {
|
|
buttons: {
|
|
- view: { iconRight: 'View', type: 'text', show: true },
|
|
|
|
- edit: { iconRight: 'Edit', type: 'text', show: true },
|
|
|
|
- remove: { iconRight: 'Delete', type: 'text', show: true },
|
|
|
|
|
|
+ view: { text: '详细信息', iconRight: 'View', type: 'text', show: true },
|
|
|
|
+ edit: { iconRight: 'Edit', type: 'text', show: false },
|
|
|
|
+ remove: { iconRight: 'Delete', type: 'text', show: false },
|
|
|
|
+ Viewcontract: {
|
|
|
|
+ text:'查看合约',
|
|
|
|
+ iconRight:'',
|
|
|
|
+ type:'text',
|
|
|
|
+ show:true,
|
|
|
|
+ click: (opts: any) => {
|
|
|
|
+ handleViewContract(opts.row);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
columns: {
|
|
columns: {
|
|
@@ -92,6 +113,36 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
|
|
},
|
|
},
|
|
column: { minWidth: 150 },
|
|
column: { minWidth: 150 },
|
|
},
|
|
},
|
|
|
|
+ contract_file: {
|
|
|
|
+ title: '合约文档',
|
|
|
|
+ type: 'file-uploader',
|
|
|
|
+ form: {
|
|
|
|
+ /* rules: [{ required: true, message: '请上传合约文档' }], */
|
|
|
|
+ component: {
|
|
|
|
+ uploader: {
|
|
|
|
+ type: 'form',
|
|
|
|
+ action: '/api/platform/upload/',
|
|
|
|
+ accept: '.pdf,.doc,.docx',
|
|
|
|
+ maxSize: 10 * 1024 * 1024, // 10MB
|
|
|
|
+ limit: 1,
|
|
|
|
+ },
|
|
|
|
+ placeholder: '请上传PDF或Word格式的合约文档',
|
|
|
|
+ helpMessage: '支持PDF、Word格式,文件大小不超过10MB'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ column: {
|
|
|
|
+ show:false,
|
|
|
|
+ component: {
|
|
|
|
+ // 自定义显示
|
|
|
|
+ render: ({ value }) => {
|
|
|
|
+ if (!value) return '未上传';
|
|
|
|
+ const fileName = value.split('/').pop();
|
|
|
|
+ return <el-link type="primary" href={value} target="_blank">{fileName}</el-link>;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ minWidth: 180
|
|
|
|
+ }
|
|
|
|
+ },
|
|
contract_name: {
|
|
contract_name: {
|
|
title: '合约名称',
|
|
title: '合约名称',
|
|
search: { show: true },
|
|
search: { show: true },
|