kllay 5 giorni fa
parent
commit
4fcaf93953

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ ENV = 'development'
 #线下:http://192.168.100.187:8083
 # 本地环境接口地址 121.36.251.245
 
-VITE_API_URL = 'http://192.168.100.101:8086'
+VITE_API_URL = 'http://1.94.168.85:8086'
 # VITE_API_URL = 'http://192.168.100.187:9084'
 # VITE_API_URL = 'https://backend.qicai321.com'
 VITE_API_WX_URL='https://api.weixin.qq.com/'

+ 1 - 1
src/views/system/borrowingnotice/crud.tsx

@@ -94,7 +94,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						col: {
 							span: 24
 						},
-						component: { showWordLimit: true, maxlength: 200 , placeholder: '请填写内容' },
+						component: { showWordLimit: true, maxlength: 200 ,placeholder: '请填写内容' },
 						rules: [{ 
 							required: true,
 								message: '内容为必填项',

+ 3 - 2
src/views/system/borrowingnotice/index.vue

@@ -7,16 +7,17 @@
 <script lang="ts" setup name="borrowingnotice">
 import { useFs } from '@fast-crud/fast-crud';
 import { onMounted } from 'vue';
-import { GetList } from './api';
+import { GetPermission } from './api';
 import { createCrudOptions } from './crud';
 import { handleColumnPermission } from '/@/utils/columnPermission';
 
 const { crudBinding, crudRef, crudExpose, crudOptions, resetCrudOptions } = useFs({ createCrudOptions });
 
+// 页面打开后获取列表数据
 // 页面打开后获取列表数据
 onMounted(async () => {
 	// 设置列权限
-	const newOptions = await handleColumnPermission(GetList, crudOptions);
+	const newOptions = await handleColumnPermission(GetPermission, crudOptions);
 	//重置crudBinding
 	resetCrudOptions(newOptions);
 	// 刷新

+ 4 - 4
src/views/system/devicemanual/api.ts

@@ -4,7 +4,7 @@ import { request } from '/@/utils/service';
 export const apiPrefix = '/api/system/articles/';
 export function GetList(query: UserPageQuery) {
 	return request({
-		url: apiPrefix+"?article_type=device_manual",
+		url: apiPrefix+"device-manuals/",
 		method: 'get',
 		params: query,
 	});
@@ -18,7 +18,7 @@ export function GetList(query: UserPageQuery) {
 
 export function AddObj(obj: AddReq) {
 	return request({
-		url: apiPrefix,
+		url: apiPrefix+"add-device-manual/",
 		method: 'post',
 		data: obj,
 	});
@@ -26,7 +26,7 @@ export function AddObj(obj: AddReq) {
 
 export function UpdateObj(obj: EditReq) {
 	return request({
-		url: apiPrefix + obj.id + '/',
+		url: apiPrefix +"add-device-manual/"+ obj.id + '/',
 		method: 'put',
 		data: obj,
 	});
@@ -34,7 +34,7 @@ export function UpdateObj(obj: EditReq) {
 
 export function DelObj(id: DelReq) {
 	return request({
-		url: apiPrefix + id + '/',
+		url: apiPrefix +"add-device-manual/" + id + '/',
 		method: 'delete',
 		data: { id },
 	});

+ 94 - 22
src/views/system/devicemanual/crud.tsx

@@ -1,4 +1,4 @@
-import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, UserPageQuery,EditReq ,DelReq} from '@fast-crud/fast-crud';
+import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, UserPageQuery,EditReq ,DelReq,dict} from '@fast-crud/fast-crud';
 import * as api from './api';
 import { auth } from '/@/utils/authFunction';
 
@@ -9,12 +9,20 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 	};
 	const editRequest = async ({ form, row }: EditReq) => {
 		form.id = row.id;
+		form.device_id=Number(form.device);
+		form.title=form.article_title;
+		form.content=form.article_content;
 		return await api.UpdateObj(form);
 	};
 	const delRequest = async ({ row }: DelReq) => {
 		return await api.DelObj(row.id);
 	};
 	const addRequest = async ({ form }: AddReq) => {
+		form.device_id=Number(form.device);
+		form.title=form.article_title;
+		form.content=form.article_content;
+		// console.log("sdfsdfsdfform::::",form);
+		
 		return await api.AddObj(form);
 	};
 
@@ -57,14 +65,51 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '序号',
 					form: { show: false },
 					column: {
+						show:false,
 						type: 'index',
 						align: 'center',
 						width: '70px',
 						columnSetDisabled: true, //禁止在列设置中选择
 					},
 				},
-				title: {
-					title: '标题',
+				device:{
+					title: '设备id',
+					search: {
+						show: false,
+					},
+					treeNode: true,
+					type: 'dict-select',
+					column: {
+						show:false,
+						minWidth: 120,
+					},
+					dict: dict({
+						url: '/api/system/device/',
+						value: 'id',
+						label: 'name',
+					}),
+					form: {
+						show:true,
+						component: { placeholder: '请选择设备id' },
+						rules: [{ required: true, message: '请选择设备id' }],
+					},
+				},
+				device_code: {
+					title: '设备编码',
+					search: {
+						show: false,
+					},
+					treeNode: true,
+					type: 'input',
+					column: {
+						minWidth: 120,
+					},
+					form: {
+						show:false,
+					},
+				},
+				article_title: {
+					title: '设备标题',
 					search: {
 						show: false,
 					},
@@ -74,6 +119,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					form: {
+						show:true,
 						rules: [
 							// 表单校验规则
 							{ required: true, message: '标题必填项' },
@@ -83,7 +129,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						},
 					},
 				},
-				content:{
+				article_content:{
 					title: '内容',
 					type: 'textarea',
 					column: {
@@ -91,6 +137,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					form: {
+						show:true,
 						col: {
 							span: 24
 						},
@@ -101,7 +148,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 							}],
 					},
 				},
-				publisher_name:{
+				device_name:{
 					title: '发布人',
 					type: 'input',
 					column: {
@@ -113,7 +160,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						rules: [{ required: false, message: '请填写发布人' }],
 					},
 				},
-				publish_time:{
+				create_datetime:{
 					title: '发布时间',
 					type: 'input',
 					column: {
@@ -125,21 +172,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						rules: [{ required: false, message: '请填写发布时间' }],
 					},
 				},
-				article_type:{
-					title: '是否在顶部',
-					type: 'input',
-					column: {
-						show:false,
-						minWidth: 120,
-					},
-					form: {
-						value:"borrow_rules",
-						show:false,
-						component: { placeholder: '请填写是否在顶部' },
-						rules: [{ required: false, message: '请填写是否在顶部' }],
-					},
-				},
-				status:{
+				is_default:{
 					title: '状态',
 					type: 'input',
 					column: {
@@ -147,12 +180,51 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					form: {
-						value:1,
+						value:true,
 						show:false,
 						component: { placeholder: '请填写状态' },
 						rules: [{ required: false, message: '请填写状态' }],
 					},
 				},
+				// device_id:{
+				// 	title: '设备id',
+				// 	type: 'input',
+				// 	column: {
+				// 		show:false,
+				// 		minWidth: 120,
+				// 	},
+				// 	form: {
+				// 		show:true,
+				// 		component: { placeholder: '请填写状态' },
+				// 		rules: [{ required: false, message: '请填写状态' }],
+				// 	},
+				// },
+				// title:{
+				// 	title: '设备标题',
+				// 	type: 'input',
+				// 	column: {
+				// 		show:false,
+				// 		minWidth: 120,
+				// 	},
+				// 	form: {
+				// 		show:true,
+				// 		component: { placeholder: '请填写设备标题' },
+				// 		rules: [{ required: false, message: '请填写设备标题' }],
+				// 	},
+				// },
+				// content:{
+				// 	title: '设备内容',
+				// 	type: 'input',
+				// 	column: {
+				// 		show:false,
+				// 		minWidth: 120,
+				// 	},
+				// 	form: {
+				// 		show:true,
+				// 		component: { placeholder: '请填写设备内容' },
+				// 		rules: [{ required: false, message: '请填写设备内容' }],
+				// 	},
+				// },
 
 
 

+ 8 - 7
src/views/system/storelist/api.ts

@@ -32,13 +32,14 @@ export function UpdateObj(obj: EditReq) {
 	});
 }
 
-// export function DelObj(id: DelReq) {
-// 	return request({
-// 		url: apiPrefix + id + '/',
-// 		method: 'delete',
-// 		data: { id },
-// 	});
-// }
+export function DelObj(id: DelReq) {
+	return request({
+		url: apiPrefix + id + '/',
+		method: 'delete',
+		data: { id },
+	});
+}
+
 export function GetPermission() {
     return request({
         url: apiPrefix,

+ 13 - 0
src/views/system/storelist/crud.tsx

@@ -10,11 +10,19 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 	const addRequest = async ({ form }: AddReq) => {
 		return await api.AddObj(form);
 	};
+	const editRequest = async ({ form }: AddReq) => {
+		return await api.UpdateObj(form);
+	};
+	const delRequest = async ({ row }: AddReq) => {
+		return await api.DelObj(row.id);
+	};
 
 	return {
 		crudOptions: {
 			request: {
 				pageRequest,
+				editRequest,
+				delRequest,
 				addRequest,
 			},
 			actionbar: {
@@ -89,6 +97,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						minWidth: 120,
 					},
 					form: {
+						value:5,
+						show:false,
 						component: { placeholder: '请填管理' },
 						rules: [{ required: true, message: '请填管理' }],
 					},
@@ -108,6 +118,7 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 					title: '租户id',
 					type: 'dict-select',
 					column: {
+						show:false,
 						minWidth: 120,
 					},
 					dict: dict({
@@ -116,6 +127,8 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp
 						label: 'name'
 					}),
 					form: {
+						value:1,
+						show:false,
 						component: { placeholder: '请填租户id' },
 						rules: [{ required: false, message: '请填租户id' }],
 					},